Commit graph

62 commits

Author SHA1 Message Date
Nick Tabeling
a54918c3be feat(runner): add --bare and --append-system-prompt-file flags
Prevents CLAUDE.md walk-up through parent directories by passing --bare
to every Claude CLI invocation, and explicitly injects the workspace
CLAUDE.md via --append-system-prompt-file so agent identity is isolated.
Adds fake-claude fixture and integration test to verify flags are present.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 11:22:44 +02:00
Nick Tabeling
b4cc00e93c fix(new-agent): add path traversal containment check
Extracts validateAgentName() with path.resolve containment guard after
regex validation; returns clean ephemeral Discord reply on violation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 11:19:28 +02:00
Nick Tabeling
028ea0bf28 feat(identity): harden settings.json template, add injection-resistance clause
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 11:19:19 +02:00
dev
390661eea9 Merge pull request 'DIS-001: Workspace-Root nach ~/.disclaw/workspaces/ verschieben' (#23) from phase-0/workspace-root-home into main
Reviewed-on: #23
2026-04-09 09:00:27 +00:00
Nick Tabeling
d71081d2b1 feat(config): move workspaces_root to home dir, add tilde expansion
- disclaw.yaml: change default workspaces_root to ~/.disclaw/workspaces
- src/config/loader.ts: add expandWorkspacesRoot() with ~ expansion via
  os.homedir(), path.resolve() normalisation, and in-repo warning via
  console.warn (explains CLAUDE.md walk-up leak risk)
- tests/unit/workspace-root-resolve.test.ts: Vitest unit tests (a-d)
- README.md: add Migration bestehender Workspaces section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 10:40:34 +02:00
Nick Tabeling
510969b2d1 fix(runner): add sanitizedEnv, remove process.env passthrough
Introduces src/runtime/env.ts with a pure sanitizedEnv() function that
strips DISCORD_BOT_TOKEN, DISCORD_CLIENT_SECRET, DISCORD_PUBLIC_KEY, and
all keys matching /^(DISCLAW_SECRET_|SECRET_|TOKEN_|API_KEY_?)/i before
passing the environment to spawned Claude Code child processes. Adds
optional env_blocklist field to DisclawConfig. Runner now passes
DISCLAW_AGENT_NAME and respects the blocklist.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 10:39:06 +02:00
dev
b20f1fa769 Merge pull request 'DIS-002: shell:false + cross-spawn Windows-Fix im Runner' (#21) from phase-0/harden-spawn into main
Reviewed-on: #21
2026-04-09 08:34:43 +00:00
Nick Tabeling
bade6d07f6 fix(runner): replace shell:true with cross-spawn, add resolveClaude
- Remove shell:true from runner.ts (command injection vector closed)
- Import cross-spawn instead of child_process.spawn; add windowsHide:true
- Add src/runtime/resolve-claude.ts: CLAUDE_PATH env override, where/which
  PATH fallback, in-memory cache, clear error message on not-found
- Add tests/unit/resolve-claude.test.ts: 5 Vitest tests covering env override,
  PATH fallback, multi-line output trimming, error case, and cache behaviour
- Add cross-spawn + @types/cross-spawn to package.json; add vitest + test script
2026-04-09 10:29:58 +02:00
dev
59c5a0c387 Merge pull request 'forgejo management-token + organization/tasks created + workflow/board' (#20) from phase-pre/organization into main
Reviewed-on: #20
2026-04-08 14:49:30 +00:00
Nick Tabeling
d8f70aa188 forgejo management-token + organization/tasks created + workflow/board 2026-04-08 16:44:12 +02:00
Nick Tabeling
8ca3ebffde dist-folder 2026-04-08 14:24:45 +02:00
Nick Tabeling
69e0b7d727 initial 2026-04-08 14:21:19 +02:00