Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 89d92d8ae0 | |||
| 5a63d09f2f | |||
| 19b5272f38 | |||
| 1337907df3 | |||
| 490bbe29c9 | |||
| 0eef347336 | |||
| 243e611eeb | |||
| 985238403f | |||
| af3f96379a |
Binary file not shown.
|
Before Width: | Height: | Size: 366 KiB |
+9
-23
@@ -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',
|
||||
},
|
||||
{
|
||||
|
||||
+1
-11
@@ -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');
|
||||
|
||||
@@ -116,7 +116,6 @@ export function App() {
|
||||
const withOnboarding: AppConfig = { ...next, onboardingCompleted: true };
|
||||
saveConfig(withOnboarding);
|
||||
setConfig(withOnboarding);
|
||||
setSettingsOpen(false);
|
||||
}, []);
|
||||
|
||||
const handleModeChange = useCallback(
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user