9 Commits

Author SHA1 Message Date
pftom 89d92d8ae0 feat(dev): auto-switch ports on dev:all when defaults are busy
Adds a small launcher (scripts/dev-all.mjs) that probes free ports
for the daemon (OD_PORT, default 7456) and Vite (VITE_PORT, default
5173) before invoking concurrently, so a stray process holding
either port no longer breaks the boot. The resolved ports are
exported into the child env; vite.config.ts now reads VITE_PORT to
keep its dev server and /api proxy aligned with the daemon's actual
port.

Made-with: Cursor
2026-04-28 22:19:42 +08:00
pftom 5a63d09f2f Enhance README and add star promotion assets
- Added a "Star us" section in both English and Chinese README files to encourage users to star the project on GitHub.
- Included a new image asset for the star promotion.
- Introduced a new HTML file for a dedicated star promotion page.
- Updated .gitignore to exclude new cursor-related files.
2026-04-28 20:32:39 +08:00
pftom 19b5272f38 Merge branch 'main' into feat/optimize-naming 2026-04-28 16:23:44 +08:00
pftom 1337907df3 Merge branch 'main' of github.com:nexu-io/open-design 2026-04-28 16:20:14 +08:00
pftom 490bbe29c9 Merge branch 'feat/optimize-naming' of github.com:nexu-io/open-design into feat/optimize-naming 2026-04-28 16:16:51 +08:00
pftom 0eef347336 Update README and documentation for deck framework directives
- Clarified DECK_FRAMEWORK_DIRECTIVE description in both English and Chinese README files to specify conditions for deck kind without a skill seed.
- Added detailed workflow instructions in deck-framework.ts to emphasize the importance of copying the framework before adding content.
- Enhanced discovery.ts to reinforce the framework-first approach for deck projects.
- Updated system.ts to ensure proper handling of deck projects with and without bound skills, preventing re-authorship of scaling and navigation logic.
2026-04-28 16:11:46 +08:00
pftom 243e611eeb Update README and documentation for deck framework directives
- Clarified DECK_FRAMEWORK_DIRECTIVE description in both English and Chinese README files to specify conditions for deck kind without a skill seed.
- Added detailed workflow instructions in deck-framework.ts to emphasize the importance of copying the framework before adding content.
- Enhanced discovery.ts to reinforce the framework-first approach for deck projects.
- Updated system.ts to ensure proper handling of deck projects with and without bound skills, preventing re-authorship of scaling and navigation logic.
2026-04-28 16:07:52 +08:00
pftom 985238403f Add contributing guidelines in English and Chinese
- Introduced CONTRIBUTING.md and CONTRIBUTING.zh-CN.md to provide clear instructions for contributors.
- Outlined contribution types, local setup instructions, and merging criteria for skills and design systems.
- Enhanced README files to reference the new contributing guidelines.
2026-04-28 16:02:17 +08:00
pftom af3f96379a Refactor project name from "Open Claude Design" to "Open Design"
- Updated project name in package.json, package-lock.json, and README files.
- Changed CLI commands and references from "ocd" to "od".
- Adjusted file structure references in documentation and code to reflect new naming conventions.
- Enhanced .gitignore to include new runtime data files.
- Updated metadata in LICENSE file to match new project name.
2026-04-28 14:48:45 +08:00
5 changed files with 17 additions and 61 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 366 KiB

+9 -33
View File
@@ -7,12 +7,7 @@ import path from 'node:path';
const execFileP = promisify(execFile);
// Each entry defines how to invoke the agent in non-interactive "one-shot" mode.
// `buildArgs(prompt, imagePaths, extraAllowedDirs)` returns argv for the child
// process. `extraAllowedDirs` is a list of absolute directories the agent must
// be permitted to read files from (skill seeds, design-system specs) that live
// outside the project cwd. Currently only Claude Code wires this through
// (`--add-dir`); other agents either inherit broader access or run with cwd
// boundaries we can't widen via flags.
// `buildArgs(prompt, imagePaths)` returns argv for the child process.
// `streamFormat` hints to the daemon how to interpret stdout:
// - 'claude-stream-json' : line-delimited JSON emitted by Claude Code's
// `--output-format stream-json`. Daemon parses it into typed events
@@ -24,23 +19,14 @@ export const AGENT_DEFS = [
name: 'Claude Code',
bin: 'claude',
versionArgs: ['--version'],
buildArgs: (prompt, _imagePaths, extraAllowedDirs = []) => {
const args = [
'-p',
prompt,
'--output-format',
'stream-json',
'--verbose',
'--include-partial-messages',
];
const dirs = (extraAllowedDirs || []).filter(
(d) => typeof d === 'string' && d.length > 0,
);
if (dirs.length > 0) {
args.push('--add-dir', ...dirs);
}
return args;
},
buildArgs: (prompt) => [
'-p',
prompt,
'--output-format',
'stream-json',
'--verbose',
'--include-partial-messages',
],
streamFormat: 'claude-stream-json',
},
{
@@ -125,13 +111,3 @@ export async function detectAgents() {
export function getAgentDef(id) {
return AGENT_DEFS.find((a) => a.id === id) || null;
}
// Resolve the absolute path of an agent's binary on the current PATH.
// Used by the chat handler so spawn() gets the same executable that
// detection reported as available — fixes Windows ENOENT when the bare
// bin name isn't on the child process's PATH (issue #10).
export function resolveAgentBin(id) {
const def = getAgentDef(id);
if (!def?.bin) return null;
return resolveOnPath(def.bin);
}
+4 -26
View File
@@ -6,7 +6,7 @@ import { fileURLToPath } from 'node:url';
import path from 'node:path';
import fs from 'node:fs';
import os from 'node:os';
import { detectAgents, getAgentDef, resolveAgentBin } from './agents.js';
import { detectAgents, getAgentDef } from './agents.js';
import { listSkills } from './skills.js';
import { listDesignSystems, readDesignSystem } from './design-systems.js';
import { createClaudeStreamHandler } from './claude-stream.js';
@@ -769,17 +769,7 @@ export async function startServer({ port = 7456 } = {}) {
safeImages.length ? `\n\n${safeImages.map((p) => `@${p}`).join(' ')}` : '',
].join('');
// Skill seeds (`skills/<id>/assets/template.html`) and design-system
// specs (`design-systems/<id>/DESIGN.md`) live outside the project cwd.
// The composed system prompt asks the agent to Read them via absolute
// paths in the skill-root preamble — without an explicit allowlist,
// Claude Code blocks those reads (issue #6: "no permission to read
// skills template"). We surface both roots so any agent that honours
// `--add-dir` can resolve those side files.
const extraAllowedDirs = [SKILLS_DIR, DESIGN_SYSTEMS_DIR].filter(
(d) => fs.existsSync(d),
);
const args = def.buildArgs(composed, safeImages, extraAllowedDirs);
const args = def.buildArgs(composed, safeImages);
res.setHeader('Content-Type', 'text/event-stream');
res.setHeader('Cache-Control', 'no-cache, no-transform');
@@ -792,20 +782,9 @@ export async function startServer({ port = 7456 } = {}) {
res.write(`data: ${JSON.stringify(data)}\n\n`);
};
// Resolve the agent's bin to its absolute path. Detection (`/api/agents`)
// already locates the executable via PATH, but spawning the bare name here
// fails on Windows (ENOENT) when the child process's PATH doesn't contain
// the user's npm-global / shim directory — see issue #10.
const resolvedBin = resolveAgentBin(agentId) || def.bin;
// npm shims on Windows are .cmd/.bat files; Node ≥21 refuses to spawn
// those without `shell: true` (CVE-2024-27980). When `shell: true` is set
// on Windows, Node escapes args automatically for the cmd.exe shell.
const useShell =
process.platform === 'win32' && /\.(cmd|bat)$/i.test(resolvedBin);
send('start', {
agentId,
bin: resolvedBin,
bin: def.bin,
streamFormat: def.streamFormat ?? 'plain',
projectId: typeof projectId === 'string' ? projectId : null,
cwd,
@@ -813,11 +792,10 @@ export async function startServer({ port = 7456 } = {}) {
let child;
try {
child = spawn(resolvedBin, args, {
child = spawn(def.bin, args, {
env: { ...process.env },
stdio: ['ignore', 'pipe', 'pipe'],
cwd: cwd || undefined,
shell: useShell,
});
} catch (err) {
send('error', { message: `spawn failed: ${err.message}` });
-1
View File
@@ -116,7 +116,6 @@ export function App() {
const withOnboarding: AppConfig = { ...next, onboardingCompleted: true };
saveConfig(withOnboarding);
setConfig(withOnboarding);
setSettingsOpen(false);
}, []);
const handleModeChange = useCallback(
+4 -1
View File
@@ -276,7 +276,10 @@ export function SettingsDialog({
type="button"
className="primary"
disabled={!canSave}
onClick={() => onSave(cfg)}
onClick={() => {
onSave(cfg);
onClose();
}}
>
{welcome ? t('settings.getStarted') : t('common.save')}
</button>