@ikarmic/forge-core 4.5.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +44 -21
- package/README.md +1 -1
- package/dist/agent/agent.d.ts +8 -1
- package/dist/agent/agent.js +143 -23
- package/dist/agent/architect.d.ts +0 -1
- package/dist/agent/architect.js +0 -1
- package/dist/agent/background.d.ts +58 -0
- package/dist/agent/background.js +139 -0
- package/dist/agent/cache-hints.d.ts +0 -1
- package/dist/agent/cache-hints.js +0 -1
- package/dist/agent/cost-router.d.ts +0 -1
- package/dist/agent/cost-router.js +0 -1
- package/dist/agent/enhance-prompt.d.ts +9 -0
- package/dist/agent/enhance-prompt.js +34 -0
- package/dist/agent/goal.d.ts +54 -0
- package/dist/agent/goal.js +65 -0
- package/dist/agent/index.d.ts +0 -1
- package/dist/agent/index.js +0 -1
- package/dist/agent/loop-guard.d.ts +21 -0
- package/dist/agent/loop-guard.js +41 -0
- package/dist/agent/prompts.d.ts +0 -1
- package/dist/agent/prompts.js +0 -1
- package/dist/agent/think-tags.d.ts +0 -1
- package/dist/agent/think-tags.js +0 -1
- package/dist/agent/verify.d.ts +0 -1
- package/dist/agent/verify.js +0 -1
- package/dist/agents/agent-files.d.ts +43 -0
- package/dist/agents/agent-files.js +109 -0
- package/dist/ai-comments/index.d.ts +0 -1
- package/dist/ai-comments/index.js +0 -1
- package/dist/attachments.d.ts +0 -1
- package/dist/attachments.js +0 -1
- package/dist/browser/cdp.d.ts +0 -1
- package/dist/browser/cdp.js +0 -1
- package/dist/browser/chrome.d.ts +0 -1
- package/dist/browser/chrome.js +0 -1
- package/dist/browser/session.d.ts +0 -1
- package/dist/browser/session.js +0 -1
- package/dist/checkpoints/index.d.ts +0 -1
- package/dist/checkpoints/index.js +0 -1
- package/dist/checkpoints/store.d.ts +0 -1
- package/dist/checkpoints/store.js +5 -2
- package/dist/checkpoints/types.d.ts +0 -1
- package/dist/checkpoints/types.js +0 -1
- package/dist/code-index/builder.d.ts +0 -1
- package/dist/code-index/builder.js +0 -1
- package/dist/code-index/index-store.d.ts +0 -1
- package/dist/code-index/index-store.js +0 -1
- package/dist/code-index/parser.d.ts +0 -1
- package/dist/code-index/parser.js +0 -1
- package/dist/code-index/types.d.ts +0 -1
- package/dist/code-index/types.js +0 -1
- package/dist/commands/custom-commands.d.ts +9 -5
- package/dist/commands/custom-commands.js +13 -3
- package/dist/config-file.d.ts +47 -1
- package/dist/config-file.js +249 -6
- package/dist/config-merge.d.ts +13 -0
- package/dist/config-merge.js +67 -0
- package/dist/config-schema.d.ts +340 -0
- package/dist/config-schema.js +126 -0
- package/dist/config.d.ts +0 -1
- package/dist/config.js +2 -2
- package/dist/context/compaction.d.ts +0 -1
- package/dist/context/compaction.js +10 -2
- package/dist/context/mask.d.ts +0 -1
- package/dist/context/mask.js +1 -2
- package/dist/credentials/index.d.ts +0 -1
- package/dist/credentials/index.js +0 -1
- package/dist/credentials/types.d.ts +0 -1
- package/dist/credentials/types.js +0 -1
- package/dist/custom-providers.d.ts +95 -0
- package/dist/custom-providers.js +120 -0
- package/dist/diff/index.d.ts +0 -1
- package/dist/diff/index.js +0 -1
- package/dist/diff/unified-diff.d.ts +0 -1
- package/dist/diff/unified-diff.js +0 -1
- package/dist/git/auto-commit.d.ts +3 -4
- package/dist/git/auto-commit.js +8 -7
- package/dist/git/index.d.ts +0 -1
- package/dist/git/index.js +0 -1
- package/dist/github/github-tools.d.ts +2 -3
- package/dist/github/github-tools.js +0 -1
- package/dist/hooks/agent-runner.d.ts +0 -1
- package/dist/hooks/agent-runner.js +0 -1
- package/dist/hooks/bus.d.ts +0 -1
- package/dist/hooks/bus.js +0 -1
- package/dist/hooks/config.d.ts +0 -1
- package/dist/hooks/config.js +0 -1
- package/dist/hooks/events.d.ts +0 -1
- package/dist/hooks/events.js +0 -1
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.js +0 -1
- package/dist/hooks/loader.d.ts +0 -1
- package/dist/hooks/loader.js +0 -1
- package/dist/hooks/runner.d.ts +0 -1
- package/dist/hooks/runner.js +3 -3
- package/dist/hooks/watch-coalescer.d.ts +0 -1
- package/dist/hooks/watch-coalescer.js +0 -1
- package/dist/hooks/watch-ignore.d.ts +0 -1
- package/dist/hooks/watch-ignore.js +0 -1
- package/dist/hooks/watcher.d.ts +0 -1
- package/dist/hooks/watcher.js +0 -1
- package/dist/import/claude-code.d.ts +39 -0
- package/dist/import/claude-code.js +254 -0
- package/dist/index.d.ts +37 -7
- package/dist/index.js +28 -5
- package/dist/lazy-model.d.ts +0 -1
- package/dist/lazy-model.js +0 -1
- package/dist/lint/auto-lint.d.ts +0 -1
- package/dist/lint/auto-lint.js +0 -1
- package/dist/lint/index.d.ts +0 -1
- package/dist/lint/index.js +0 -1
- package/dist/lsp/client.d.ts +5 -1
- package/dist/lsp/client.js +39 -4
- package/dist/lsp/diagnostics.d.ts +0 -1
- package/dist/lsp/diagnostics.js +0 -1
- package/dist/lsp/index.d.ts +0 -1
- package/dist/lsp/index.js +0 -1
- package/dist/mcp/catalog.d.ts +0 -1
- package/dist/mcp/catalog.js +0 -1
- package/dist/mcp/index.d.ts +5 -2
- package/dist/mcp/index.js +3 -2
- package/dist/mcp/json-schema-to-zod.d.ts +0 -1
- package/dist/mcp/json-schema-to-zod.js +0 -1
- package/dist/mcp/manager.d.ts +17 -4
- package/dist/mcp/manager.js +27 -3
- package/dist/mcp/marketplace-types.d.ts +0 -1
- package/dist/mcp/marketplace-types.js +0 -1
- package/dist/mcp/marketplace.d.ts +2 -1
- package/dist/mcp/marketplace.js +10 -5
- package/dist/mcp/mcp-client.d.ts +12 -3
- package/dist/mcp/mcp-client.js +74 -18
- package/dist/mcp/mcp-config.d.ts +2 -1
- package/dist/mcp/mcp-config.js +1 -1
- package/dist/mcp/oauth.d.ts +55 -0
- package/dist/mcp/oauth.js +197 -0
- package/dist/mcp/registry.d.ts +0 -1
- package/dist/mcp/registry.js +0 -1
- package/dist/mcp/resource-tools.d.ts +8 -0
- package/dist/mcp/resource-tools.js +56 -0
- package/dist/memory/memory-store.d.ts +0 -1
- package/dist/memory/memory-store.js +0 -1
- package/dist/memory/rank.d.ts +0 -1
- package/dist/memory/rank.js +0 -1
- package/dist/memory/session-digest.d.ts +12 -0
- package/dist/memory/session-digest.js +47 -0
- package/dist/memory/stale.d.ts +0 -1
- package/dist/memory/stale.js +2 -2
- package/dist/model-alias.d.ts +18 -3
- package/dist/model-alias.js +27 -4
- package/dist/model-catalog.d.ts +0 -1
- package/dist/model-catalog.js +0 -2
- package/dist/model-list.d.ts +0 -1
- package/dist/model-list.js +2 -2
- package/dist/model-overrides.d.ts +30 -0
- package/dist/model-overrides.js +48 -0
- package/dist/orchestrator/board-tools.d.ts +0 -1
- package/dist/orchestrator/board-tools.js +0 -1
- package/dist/orchestrator/board.d.ts +0 -1
- package/dist/orchestrator/board.js +0 -1
- package/dist/orchestrator/index.d.ts +0 -1
- package/dist/orchestrator/index.js +0 -1
- package/dist/orchestrator/orchestrator.d.ts +0 -1
- package/dist/orchestrator/orchestrator.js +0 -1
- package/dist/orchestrator/router.d.ts +0 -1
- package/dist/orchestrator/router.js +0 -1
- package/dist/orchestrator/specialists-registry.d.ts +0 -1
- package/dist/orchestrator/specialists-registry.js +2 -4
- package/dist/orchestrator/specialists.d.ts +0 -1
- package/dist/orchestrator/specialists.js +4 -5
- package/dist/orchestrator/types.d.ts +0 -1
- package/dist/orchestrator/types.js +0 -1
- package/dist/plugins/index.d.ts +0 -1
- package/dist/plugins/index.js +0 -1
- package/dist/plugins/install.d.ts +0 -1
- package/dist/plugins/install.js +0 -1
- package/dist/plugins/loader.d.ts +0 -1
- package/dist/plugins/loader.js +0 -1
- package/dist/policy/audit.d.ts +0 -1
- package/dist/policy/audit.js +0 -1
- package/dist/policy/ca-certs.d.ts +8 -0
- package/dist/policy/ca-certs.js +30 -0
- package/dist/policy/policy.d.ts +0 -1
- package/dist/policy/policy.js +0 -1
- package/dist/policy/proxy.d.ts +10 -4
- package/dist/policy/proxy.js +33 -7
- package/dist/pricing.d.ts +0 -1
- package/dist/pricing.js +4 -1
- package/dist/providers.d.ts +7 -1
- package/dist/providers.js +39 -6
- package/dist/repomap/index.d.ts +0 -1
- package/dist/repomap/index.js +0 -1
- package/dist/repomap/repo-map.d.ts +0 -1
- package/dist/repomap/repo-map.js +0 -1
- package/dist/semantic/chunker.d.ts +0 -1
- package/dist/semantic/chunker.js +0 -1
- package/dist/semantic/embedder.d.ts +15 -1
- package/dist/semantic/embedder.js +25 -1
- package/dist/semantic/semantic-index.d.ts +10 -3
- package/dist/semantic/semantic-index.js +16 -8
- package/dist/semantic/vector-store.d.ts +0 -1
- package/dist/semantic/vector-store.js +0 -1
- package/dist/sessions/index.d.ts +1 -1
- package/dist/sessions/index.js +1 -1
- package/dist/sessions/prune.d.ts +23 -0
- package/dist/sessions/prune.js +35 -0
- package/dist/sessions/search.d.ts +0 -1
- package/dist/sessions/search.js +0 -1
- package/dist/sessions/session-export.d.ts +0 -1
- package/dist/sessions/session-export.js +0 -1
- package/dist/sessions/session-store.d.ts +0 -1
- package/dist/sessions/session-store.js +2 -2
- package/dist/sessions/watch.d.ts +0 -1
- package/dist/sessions/watch.js +0 -1
- package/dist/settings-export.d.ts +0 -1
- package/dist/settings-export.js +0 -1
- package/dist/skills/activator.d.ts +0 -1
- package/dist/skills/activator.js +0 -1
- package/dist/skills/builtin.d.ts +2 -0
- package/dist/skills/builtin.js +68 -0
- package/dist/skills/index.d.ts +2 -1
- package/dist/skills/index.js +2 -1
- package/dist/skills/loader.d.ts +10 -4
- package/dist/skills/loader.js +20 -8
- package/dist/skills/marketplace-types.d.ts +0 -1
- package/dist/skills/marketplace-types.js +0 -1
- package/dist/skills/marketplace.d.ts +0 -1
- package/dist/skills/marketplace.js +2 -2
- package/dist/skills/parser.d.ts +0 -1
- package/dist/skills/parser.js +0 -1
- package/dist/skills/remote.d.ts +14 -0
- package/dist/skills/remote.js +131 -0
- package/dist/skills/types.d.ts +10 -1
- package/dist/skills/types.js +0 -1
- package/dist/specs/generate.d.ts +0 -1
- package/dist/specs/generate.js +0 -1
- package/dist/specs/index.d.ts +0 -1
- package/dist/specs/index.js +0 -1
- package/dist/specs/store.d.ts +0 -1
- package/dist/specs/store.js +0 -1
- package/dist/specs/sync.d.ts +0 -1
- package/dist/specs/sync.js +0 -1
- package/dist/specs/tasks-parser.d.ts +0 -1
- package/dist/specs/tasks-parser.js +0 -1
- package/dist/specs/types.d.ts +0 -1
- package/dist/specs/types.js +0 -1
- package/dist/steering/extra-instructions.d.ts +8 -0
- package/dist/steering/extra-instructions.js +104 -0
- package/dist/steering/folder-instructions.d.ts +8 -0
- package/dist/steering/folder-instructions.js +28 -0
- package/dist/steering/glob.d.ts +0 -1
- package/dist/steering/glob.js +0 -1
- package/dist/steering/index.d.ts +0 -1
- package/dist/steering/index.js +0 -1
- package/dist/steering/loader.d.ts +0 -1
- package/dist/steering/loader.js +0 -1
- package/dist/steering/project-instructions.d.ts +0 -1
- package/dist/steering/project-instructions.js +0 -1
- package/dist/steering/select.d.ts +0 -1
- package/dist/steering/select.js +2 -2
- package/dist/steering/types.d.ts +0 -1
- package/dist/steering/types.js +0 -1
- package/dist/structured/index.d.ts +0 -1
- package/dist/structured/index.js +0 -1
- package/dist/structured/retry.d.ts +0 -1
- package/dist/structured/retry.js +0 -1
- package/dist/structured/schema.d.ts +0 -1
- package/dist/structured/schema.js +0 -1
- package/dist/timed-fetch.d.ts +12 -0
- package/dist/timed-fetch.js +83 -0
- package/dist/tools/apply-patch.d.ts +52 -0
- package/dist/tools/apply-patch.js +197 -0
- package/dist/tools/ask-user.d.ts +27 -0
- package/dist/tools/ask-user.js +32 -0
- package/dist/tools/browser-tools.d.ts +6 -7
- package/dist/tools/browser-tools.js +3 -14
- package/dist/tools/codebase-search.d.ts +4 -3
- package/dist/tools/codebase-search.js +2 -3
- package/dist/tools/command-allow.d.ts +0 -1
- package/dist/tools/command-allow.js +0 -1
- package/dist/tools/edit-file.d.ts +0 -1
- package/dist/tools/edit-file.js +5 -4
- package/dist/tools/fetch-url.d.ts +7 -1
- package/dist/tools/fetch-url.js +52 -20
- package/dist/tools/find-references.d.ts +0 -1
- package/dist/tools/find-references.js +0 -1
- package/dist/tools/find-symbol.d.ts +2 -3
- package/dist/tools/find-symbol.js +0 -1
- package/dist/tools/ignore-rules.d.ts +0 -1
- package/dist/tools/ignore-rules.js +2 -2
- package/dist/tools/index.d.ts +5 -2
- package/dist/tools/index.js +10 -2
- package/dist/tools/list-files.d.ts +0 -1
- package/dist/tools/list-files.js +0 -1
- package/dist/tools/list-symbols.d.ts +0 -1
- package/dist/tools/list-symbols.js +0 -1
- package/dist/tools/memory.d.ts +6 -7
- package/dist/tools/memory.js +0 -1
- package/dist/tools/notebook.d.ts +2 -3
- package/dist/tools/notebook.js +0 -1
- package/dist/tools/permission-rules.d.ts +32 -0
- package/dist/tools/permission-rules.js +182 -0
- package/dist/tools/policy.d.ts +0 -1
- package/dist/tools/policy.js +0 -1
- package/dist/tools/read-file.d.ts +5 -1
- package/dist/tools/read-file.js +7 -3
- package/dist/tools/read-image.d.ts +0 -1
- package/dist/tools/read-image.js +0 -1
- package/dist/tools/read-only.d.ts +1 -2
- package/dist/tools/read-only.js +2 -1
- package/dist/tools/redact.d.ts +0 -1
- package/dist/tools/redact.js +0 -1
- package/dist/tools/result-cache.d.ts +0 -1
- package/dist/tools/result-cache.js +0 -1
- package/dist/tools/run-command.d.ts +4 -3
- package/dist/tools/run-command.js +12 -9
- package/dist/tools/sandbox-loader.d.ts +0 -1
- package/dist/tools/sandbox-loader.js +3 -14
- package/dist/tools/search-files.d.ts +8 -3
- package/dist/tools/search-files.js +43 -1
- package/dist/tools/shared.d.ts +5 -1
- package/dist/tools/shared.js +30 -3
- package/dist/tools/shell-env.d.ts +7 -0
- package/dist/tools/shell-env.js +9 -0
- package/dist/tools/sub-agent-wait.d.ts +29 -0
- package/dist/tools/sub-agent-wait.js +60 -0
- package/dist/tools/sub-agent.d.ts +50 -5
- package/dist/tools/sub-agent.js +210 -126
- package/dist/tools/text-encoding.d.ts +10 -0
- package/dist/tools/text-encoding.js +40 -0
- package/dist/tools/todo.d.ts +36 -0
- package/dist/tools/todo.js +42 -0
- package/dist/tools/web-search.d.ts +0 -1
- package/dist/tools/web-search.js +0 -1
- package/dist/tools/write-file.d.ts +0 -1
- package/dist/tools/write-file.js +15 -10
- package/dist/tools/write-tools.d.ts +12 -0
- package/dist/tools/write-tools.js +18 -0
- package/dist/types.d.ts +85 -2
- package/dist/types.js +0 -1
- package/dist/verify/detect.d.ts +0 -1
- package/dist/verify/detect.js +0 -1
- package/dist/verify/index.d.ts +0 -1
- package/dist/verify/index.js +0 -1
- package/dist/worktree/branch-ops.d.ts +0 -1
- package/dist/worktree/branch-ops.js +0 -1
- package/dist/worktree/index.d.ts +0 -1
- package/dist/worktree/index.js +0 -1
- package/dist/worktree/worktree.d.ts +3 -1
- package/dist/worktree/worktree.js +22 -1
- package/package.json +3 -2
- package/dist/agent/agent.d.ts.map +0 -1
- package/dist/agent/agent.js.map +0 -1
- package/dist/agent/architect.d.ts.map +0 -1
- package/dist/agent/architect.js.map +0 -1
- package/dist/agent/cache-hints.d.ts.map +0 -1
- package/dist/agent/cache-hints.js.map +0 -1
- package/dist/agent/cost-router.d.ts.map +0 -1
- package/dist/agent/cost-router.js.map +0 -1
- package/dist/agent/index.d.ts.map +0 -1
- package/dist/agent/index.js.map +0 -1
- package/dist/agent/prompts.d.ts.map +0 -1
- package/dist/agent/prompts.js.map +0 -1
- package/dist/agent/think-tags.d.ts.map +0 -1
- package/dist/agent/think-tags.js.map +0 -1
- package/dist/agent/verify.d.ts.map +0 -1
- package/dist/agent/verify.js.map +0 -1
- package/dist/ai-comments/index.d.ts.map +0 -1
- package/dist/ai-comments/index.js.map +0 -1
- package/dist/attachments.d.ts.map +0 -1
- package/dist/attachments.js.map +0 -1
- package/dist/browser/cdp.d.ts.map +0 -1
- package/dist/browser/cdp.js.map +0 -1
- package/dist/browser/chrome.d.ts.map +0 -1
- package/dist/browser/chrome.js.map +0 -1
- package/dist/browser/session.d.ts.map +0 -1
- package/dist/browser/session.js.map +0 -1
- package/dist/checkpoints/index.d.ts.map +0 -1
- package/dist/checkpoints/index.js.map +0 -1
- package/dist/checkpoints/store.d.ts.map +0 -1
- package/dist/checkpoints/store.js.map +0 -1
- package/dist/checkpoints/types.d.ts.map +0 -1
- package/dist/checkpoints/types.js.map +0 -1
- package/dist/code-index/builder.d.ts.map +0 -1
- package/dist/code-index/builder.js.map +0 -1
- package/dist/code-index/index-store.d.ts.map +0 -1
- package/dist/code-index/index-store.js.map +0 -1
- package/dist/code-index/parser.d.ts.map +0 -1
- package/dist/code-index/parser.js.map +0 -1
- package/dist/code-index/types.d.ts.map +0 -1
- package/dist/code-index/types.js.map +0 -1
- package/dist/commands/custom-commands.d.ts.map +0 -1
- package/dist/commands/custom-commands.js.map +0 -1
- package/dist/config-file.d.ts.map +0 -1
- package/dist/config-file.js.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/context/compaction.d.ts.map +0 -1
- package/dist/context/compaction.js.map +0 -1
- package/dist/context/mask.d.ts.map +0 -1
- package/dist/context/mask.js.map +0 -1
- package/dist/credentials/index.d.ts.map +0 -1
- package/dist/credentials/index.js.map +0 -1
- package/dist/credentials/types.d.ts.map +0 -1
- package/dist/credentials/types.js.map +0 -1
- package/dist/diff/index.d.ts.map +0 -1
- package/dist/diff/index.js.map +0 -1
- package/dist/diff/unified-diff.d.ts.map +0 -1
- package/dist/diff/unified-diff.js.map +0 -1
- package/dist/git/auto-commit.d.ts.map +0 -1
- package/dist/git/auto-commit.js.map +0 -1
- package/dist/git/index.d.ts.map +0 -1
- package/dist/git/index.js.map +0 -1
- package/dist/github/github-tools.d.ts.map +0 -1
- package/dist/github/github-tools.js.map +0 -1
- package/dist/hooks/agent-runner.d.ts.map +0 -1
- package/dist/hooks/agent-runner.js.map +0 -1
- package/dist/hooks/bus.d.ts.map +0 -1
- package/dist/hooks/bus.js.map +0 -1
- package/dist/hooks/config.d.ts.map +0 -1
- package/dist/hooks/config.js.map +0 -1
- package/dist/hooks/events.d.ts.map +0 -1
- package/dist/hooks/events.js.map +0 -1
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/loader.d.ts.map +0 -1
- package/dist/hooks/loader.js.map +0 -1
- package/dist/hooks/runner.d.ts.map +0 -1
- package/dist/hooks/runner.js.map +0 -1
- package/dist/hooks/watch-coalescer.d.ts.map +0 -1
- package/dist/hooks/watch-coalescer.js.map +0 -1
- package/dist/hooks/watch-ignore.d.ts.map +0 -1
- package/dist/hooks/watch-ignore.js.map +0 -1
- package/dist/hooks/watcher.d.ts.map +0 -1
- package/dist/hooks/watcher.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lazy-model.d.ts.map +0 -1
- package/dist/lazy-model.js.map +0 -1
- package/dist/lint/auto-lint.d.ts.map +0 -1
- package/dist/lint/auto-lint.js.map +0 -1
- package/dist/lint/index.d.ts.map +0 -1
- package/dist/lint/index.js.map +0 -1
- package/dist/lsp/client.d.ts.map +0 -1
- package/dist/lsp/client.js.map +0 -1
- package/dist/lsp/diagnostics.d.ts.map +0 -1
- package/dist/lsp/diagnostics.js.map +0 -1
- package/dist/lsp/index.d.ts.map +0 -1
- package/dist/lsp/index.js.map +0 -1
- package/dist/mcp/catalog.d.ts.map +0 -1
- package/dist/mcp/catalog.js.map +0 -1
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/json-schema-to-zod.d.ts.map +0 -1
- package/dist/mcp/json-schema-to-zod.js.map +0 -1
- package/dist/mcp/manager.d.ts.map +0 -1
- package/dist/mcp/manager.js.map +0 -1
- package/dist/mcp/marketplace-types.d.ts.map +0 -1
- package/dist/mcp/marketplace-types.js.map +0 -1
- package/dist/mcp/marketplace.d.ts.map +0 -1
- package/dist/mcp/marketplace.js.map +0 -1
- package/dist/mcp/mcp-client.d.ts.map +0 -1
- package/dist/mcp/mcp-client.js.map +0 -1
- package/dist/mcp/mcp-config.d.ts.map +0 -1
- package/dist/mcp/mcp-config.js.map +0 -1
- package/dist/mcp/registry.d.ts.map +0 -1
- package/dist/mcp/registry.js.map +0 -1
- package/dist/memory/memory-store.d.ts.map +0 -1
- package/dist/memory/memory-store.js.map +0 -1
- package/dist/memory/rank.d.ts.map +0 -1
- package/dist/memory/rank.js.map +0 -1
- package/dist/memory/stale.d.ts.map +0 -1
- package/dist/memory/stale.js.map +0 -1
- package/dist/model-alias.d.ts.map +0 -1
- package/dist/model-alias.js.map +0 -1
- package/dist/model-catalog.d.ts.map +0 -1
- package/dist/model-catalog.js.map +0 -1
- package/dist/model-list.d.ts.map +0 -1
- package/dist/model-list.js.map +0 -1
- package/dist/orchestrator/board-tools.d.ts.map +0 -1
- package/dist/orchestrator/board-tools.js.map +0 -1
- package/dist/orchestrator/board.d.ts.map +0 -1
- package/dist/orchestrator/board.js.map +0 -1
- package/dist/orchestrator/index.d.ts.map +0 -1
- package/dist/orchestrator/index.js.map +0 -1
- package/dist/orchestrator/orchestrator.d.ts.map +0 -1
- package/dist/orchestrator/orchestrator.js.map +0 -1
- package/dist/orchestrator/router.d.ts.map +0 -1
- package/dist/orchestrator/router.js.map +0 -1
- package/dist/orchestrator/specialists-registry.d.ts.map +0 -1
- package/dist/orchestrator/specialists-registry.js.map +0 -1
- package/dist/orchestrator/specialists.d.ts.map +0 -1
- package/dist/orchestrator/specialists.js.map +0 -1
- package/dist/orchestrator/types.d.ts.map +0 -1
- package/dist/orchestrator/types.js.map +0 -1
- package/dist/plugins/index.d.ts.map +0 -1
- package/dist/plugins/index.js.map +0 -1
- package/dist/plugins/install.d.ts.map +0 -1
- package/dist/plugins/install.js.map +0 -1
- package/dist/plugins/loader.d.ts.map +0 -1
- package/dist/plugins/loader.js.map +0 -1
- package/dist/policy/audit.d.ts.map +0 -1
- package/dist/policy/audit.js.map +0 -1
- package/dist/policy/policy.d.ts.map +0 -1
- package/dist/policy/policy.js.map +0 -1
- package/dist/policy/proxy.d.ts.map +0 -1
- package/dist/policy/proxy.js.map +0 -1
- package/dist/pricing.d.ts.map +0 -1
- package/dist/pricing.js.map +0 -1
- package/dist/providers.d.ts.map +0 -1
- package/dist/providers.js.map +0 -1
- package/dist/repomap/index.d.ts.map +0 -1
- package/dist/repomap/index.js.map +0 -1
- package/dist/repomap/repo-map.d.ts.map +0 -1
- package/dist/repomap/repo-map.js.map +0 -1
- package/dist/semantic/chunker.d.ts.map +0 -1
- package/dist/semantic/chunker.js.map +0 -1
- package/dist/semantic/embedder.d.ts.map +0 -1
- package/dist/semantic/embedder.js.map +0 -1
- package/dist/semantic/semantic-index.d.ts.map +0 -1
- package/dist/semantic/semantic-index.js.map +0 -1
- package/dist/semantic/vector-store.d.ts.map +0 -1
- package/dist/semantic/vector-store.js.map +0 -1
- package/dist/sessions/index.d.ts.map +0 -1
- package/dist/sessions/index.js.map +0 -1
- package/dist/sessions/search.d.ts.map +0 -1
- package/dist/sessions/search.js.map +0 -1
- package/dist/sessions/session-export.d.ts.map +0 -1
- package/dist/sessions/session-export.js.map +0 -1
- package/dist/sessions/session-store.d.ts.map +0 -1
- package/dist/sessions/session-store.js.map +0 -1
- package/dist/sessions/watch.d.ts.map +0 -1
- package/dist/sessions/watch.js.map +0 -1
- package/dist/settings-export.d.ts.map +0 -1
- package/dist/settings-export.js.map +0 -1
- package/dist/skills/activator.d.ts.map +0 -1
- package/dist/skills/activator.js.map +0 -1
- package/dist/skills/index.d.ts.map +0 -1
- package/dist/skills/index.js.map +0 -1
- package/dist/skills/loader.d.ts.map +0 -1
- package/dist/skills/loader.js.map +0 -1
- package/dist/skills/marketplace-types.d.ts.map +0 -1
- package/dist/skills/marketplace-types.js.map +0 -1
- package/dist/skills/marketplace.d.ts.map +0 -1
- package/dist/skills/marketplace.js.map +0 -1
- package/dist/skills/parser.d.ts.map +0 -1
- package/dist/skills/parser.js.map +0 -1
- package/dist/skills/types.d.ts.map +0 -1
- package/dist/skills/types.js.map +0 -1
- package/dist/specs/generate.d.ts.map +0 -1
- package/dist/specs/generate.js.map +0 -1
- package/dist/specs/index.d.ts.map +0 -1
- package/dist/specs/index.js.map +0 -1
- package/dist/specs/store.d.ts.map +0 -1
- package/dist/specs/store.js.map +0 -1
- package/dist/specs/sync.d.ts.map +0 -1
- package/dist/specs/sync.js.map +0 -1
- package/dist/specs/tasks-parser.d.ts.map +0 -1
- package/dist/specs/tasks-parser.js.map +0 -1
- package/dist/specs/types.d.ts.map +0 -1
- package/dist/specs/types.js.map +0 -1
- package/dist/steering/glob.d.ts.map +0 -1
- package/dist/steering/glob.js.map +0 -1
- package/dist/steering/index.d.ts.map +0 -1
- package/dist/steering/index.js.map +0 -1
- package/dist/steering/loader.d.ts.map +0 -1
- package/dist/steering/loader.js.map +0 -1
- package/dist/steering/project-instructions.d.ts.map +0 -1
- package/dist/steering/project-instructions.js.map +0 -1
- package/dist/steering/select.d.ts.map +0 -1
- package/dist/steering/select.js.map +0 -1
- package/dist/steering/types.d.ts.map +0 -1
- package/dist/steering/types.js.map +0 -1
- package/dist/structured/index.d.ts.map +0 -1
- package/dist/structured/index.js.map +0 -1
- package/dist/structured/retry.d.ts.map +0 -1
- package/dist/structured/retry.js.map +0 -1
- package/dist/structured/schema.d.ts.map +0 -1
- package/dist/structured/schema.js.map +0 -1
- package/dist/tools/browser-tools.d.ts.map +0 -1
- package/dist/tools/browser-tools.js.map +0 -1
- package/dist/tools/codebase-search.d.ts.map +0 -1
- package/dist/tools/codebase-search.js.map +0 -1
- package/dist/tools/command-allow.d.ts.map +0 -1
- package/dist/tools/command-allow.js.map +0 -1
- package/dist/tools/edit-file.d.ts.map +0 -1
- package/dist/tools/edit-file.js.map +0 -1
- package/dist/tools/fetch-url.d.ts.map +0 -1
- package/dist/tools/fetch-url.js.map +0 -1
- package/dist/tools/find-references.d.ts.map +0 -1
- package/dist/tools/find-references.js.map +0 -1
- package/dist/tools/find-symbol.d.ts.map +0 -1
- package/dist/tools/find-symbol.js.map +0 -1
- package/dist/tools/ignore-rules.d.ts.map +0 -1
- package/dist/tools/ignore-rules.js.map +0 -1
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/list-files.d.ts.map +0 -1
- package/dist/tools/list-files.js.map +0 -1
- package/dist/tools/list-symbols.d.ts.map +0 -1
- package/dist/tools/list-symbols.js.map +0 -1
- package/dist/tools/memory.d.ts.map +0 -1
- package/dist/tools/memory.js.map +0 -1
- package/dist/tools/notebook.d.ts.map +0 -1
- package/dist/tools/notebook.js.map +0 -1
- package/dist/tools/policy.d.ts.map +0 -1
- package/dist/tools/policy.js.map +0 -1
- package/dist/tools/read-file.d.ts.map +0 -1
- package/dist/tools/read-file.js.map +0 -1
- package/dist/tools/read-image.d.ts.map +0 -1
- package/dist/tools/read-image.js.map +0 -1
- package/dist/tools/read-only.d.ts.map +0 -1
- package/dist/tools/read-only.js.map +0 -1
- package/dist/tools/redact.d.ts.map +0 -1
- package/dist/tools/redact.js.map +0 -1
- package/dist/tools/result-cache.d.ts.map +0 -1
- package/dist/tools/result-cache.js.map +0 -1
- package/dist/tools/run-command.d.ts.map +0 -1
- package/dist/tools/run-command.js.map +0 -1
- package/dist/tools/sandbox-loader.d.ts.map +0 -1
- package/dist/tools/sandbox-loader.js.map +0 -1
- package/dist/tools/search-files.d.ts.map +0 -1
- package/dist/tools/search-files.js.map +0 -1
- package/dist/tools/shared.d.ts.map +0 -1
- package/dist/tools/shared.js.map +0 -1
- package/dist/tools/sub-agent.d.ts.map +0 -1
- package/dist/tools/sub-agent.js.map +0 -1
- package/dist/tools/web-search.d.ts.map +0 -1
- package/dist/tools/web-search.js.map +0 -1
- package/dist/tools/write-file.d.ts.map +0 -1
- package/dist/tools/write-file.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/verify/detect.d.ts.map +0 -1
- package/dist/verify/detect.js.map +0 -1
- package/dist/verify/index.d.ts.map +0 -1
- package/dist/verify/index.js.map +0 -1
- package/dist/worktree/branch-ops.d.ts.map +0 -1
- package/dist/worktree/branch-ops.js.map +0 -1
- package/dist/worktree/index.d.ts.map +0 -1
- package/dist/worktree/index.js.map +0 -1
- package/dist/worktree/worktree.d.ts.map +0 -1
- package/dist/worktree/worktree.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { type SemanticHit } from '../semantic/semantic-index.js';
|
|
2
|
+
import { type SemanticHit, type SemanticOptions } from '../semantic/semantic-index.js';
|
|
3
3
|
import type { Embedder } from '../semantic/embedder.js';
|
|
4
4
|
import type { ToolDefinition } from '../types.js';
|
|
5
5
|
declare const params: z.ZodObject<{
|
|
@@ -18,6 +18,7 @@ export interface CodebaseSearchResult {
|
|
|
18
18
|
results: SemanticHit[];
|
|
19
19
|
note: string;
|
|
20
20
|
}
|
|
21
|
-
export declare function createCodebaseSearchTool(embedder: Embedder
|
|
21
|
+
export declare function createCodebaseSearchTool(embedder: Embedder, options?: SemanticOptions & {
|
|
22
|
+
defaultLimit?: number;
|
|
23
|
+
}): ToolDefinition<z.infer<typeof params>, CodebaseSearchResult>;
|
|
22
24
|
export {};
|
|
23
|
-
//# sourceMappingURL=codebase-search.d.ts.map
|
|
@@ -4,7 +4,7 @@ const params = z.object({
|
|
|
4
4
|
query: z.string().describe('What you are looking for, in natural language or identifiers (e.g. "where passwords are hashed").'),
|
|
5
5
|
limit: z.number().int().min(1).max(20).optional().describe('Max results. Default 8.'),
|
|
6
6
|
});
|
|
7
|
-
export function createCodebaseSearchTool(embedder) {
|
|
7
|
+
export function createCodebaseSearchTool(embedder, options = {}) {
|
|
8
8
|
return {
|
|
9
9
|
name: 'codebase_search',
|
|
10
10
|
description: 'Semantic search over the codebase: returns the most relevant code chunks (path, line range, snippet) for a description. Use it to find where something is implemented when you do not know the exact name; use find_symbol/search_files when you do.',
|
|
@@ -12,11 +12,10 @@ export function createCodebaseSearchTool(embedder) {
|
|
|
12
12
|
execute: async (args, ctx) => ({
|
|
13
13
|
query: args.query,
|
|
14
14
|
embedder: embedder.id,
|
|
15
|
-
results: await searchSemantic(ctx.cwd, embedder, args.query, args.limit ?? 8),
|
|
15
|
+
results: await searchSemantic(ctx.cwd, embedder, args.query, args.limit ?? options.defaultLimit ?? 8, options),
|
|
16
16
|
note: embedder.id.startsWith('hashing')
|
|
17
17
|
? 'Ranking is by shared vocabulary (offline embedder). Set FORGE_EMBED_PROVIDER=openai|ollama for meaning-based ranking.'
|
|
18
18
|
: 'Ranked by embedding similarity.',
|
|
19
19
|
}),
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
//# sourceMappingURL=codebase-search.js.map
|
|
@@ -9,4 +9,3 @@ export declare function isAlwaysAllowable(command: string, hasCwd?: boolean): bo
|
|
|
9
9
|
export declare function needsScriptFingerprint(command: string): boolean;
|
|
10
10
|
/** Whether a `run_command` call's arguments name one of `allowed` exactly, without a working-directory override. */
|
|
11
11
|
export declare function isListedCommand(args: unknown, allowed: readonly string[]): boolean;
|
|
12
|
-
//# sourceMappingURL=command-allow.d.ts.map
|
package/dist/tools/edit-file.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFile, writeFile } from 'node:fs/promises';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { resolveAndCheckPath } from './shared.js';
|
|
4
|
+
import { decodeText, encodeText } from './text-encoding.js';
|
|
4
5
|
const params = z.object({
|
|
5
6
|
path: z.string().describe('Path of the file to edit, relative to the working directory or absolute.'),
|
|
6
7
|
old_text: z.string().describe('Exact text to find in the file. Must match exactly (whitespace-sensitive).'),
|
|
@@ -18,7 +19,7 @@ export const editFileTool = {
|
|
|
18
19
|
destructive: false,
|
|
19
20
|
execute: async (args, ctx) => {
|
|
20
21
|
const resolved = resolveAndCheckPath(args.path, ctx);
|
|
21
|
-
const original = await readFile(resolved
|
|
22
|
+
const { text: original, encoding } = await readFile(resolved).then(decodeText).catch((err) => {
|
|
22
23
|
if (err.code === 'ENOENT')
|
|
23
24
|
throw new Error(`File not found: ${args.path}`);
|
|
24
25
|
throw err;
|
|
@@ -37,11 +38,12 @@ export const editFileTool = {
|
|
|
37
38
|
// string 2nd arg to String.prototype.replace still honors special
|
|
38
39
|
// patterns like $&, $1, $$ even though old_text isn't a regex.
|
|
39
40
|
: original.replace(args.old_text, () => args.new_text);
|
|
40
|
-
|
|
41
|
+
const bytes = encodeText(updated, encoding);
|
|
42
|
+
await writeFile(resolved, bytes);
|
|
41
43
|
return {
|
|
42
44
|
path: resolved,
|
|
43
45
|
replacements: replaceAll ? occurrences : 1,
|
|
44
|
-
bytes:
|
|
46
|
+
bytes: bytes.length,
|
|
45
47
|
};
|
|
46
48
|
},
|
|
47
49
|
};
|
|
@@ -56,4 +58,3 @@ function countOccurrences(haystack, needle) {
|
|
|
56
58
|
}
|
|
57
59
|
return count;
|
|
58
60
|
}
|
|
59
|
-
//# sourceMappingURL=edit-file.js.map
|
|
@@ -37,6 +37,12 @@ export interface FetchUrlResult {
|
|
|
37
37
|
/** True when the response was truncated to fit `max_bytes` or `excerpt` size. */
|
|
38
38
|
truncated: boolean;
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* SSRF protection: true for an IP literal that is loopback, link-local,
|
|
42
|
+
* or RFC1918 private. `fetch_url` refuses these hosts by default (see
|
|
43
|
+
* {@link assertUrlNotBlocked}) so an agent-supplied URL can't reach
|
|
44
|
+
* loopback services or cloud metadata endpoints (e.g. 169.254.169.254).
|
|
45
|
+
*/
|
|
46
|
+
export declare function isBlockedAddress(ip: string): boolean;
|
|
40
47
|
export declare const fetchUrlTool: ToolDefinition<z.infer<typeof params>, FetchUrlResult>;
|
|
41
48
|
export {};
|
|
42
|
-
//# sourceMappingURL=fetch-url.d.ts.map
|
package/dist/tools/fetch-url.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { lookup } from 'node:dns/promises';
|
|
2
2
|
import net from 'node:net';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
+
import { installedFetch } from '../policy/proxy.js';
|
|
4
5
|
import { checkPolicyViolation } from './policy.js';
|
|
5
6
|
const params = z.object({
|
|
6
7
|
url: z
|
|
@@ -37,19 +38,24 @@ const DEFAULT_MAX_BYTES = 200_000;
|
|
|
37
38
|
const DEFAULT_TIMEOUT_MS = 10_000;
|
|
38
39
|
const EXCERPT_MAX_CHARS = 8_000;
|
|
39
40
|
const USER_AGENT = 'ikarmic-forge/0.1 (fetch_url)';
|
|
41
|
+
const MAX_REDIRECTS = 5;
|
|
40
42
|
/**
|
|
41
43
|
* SSRF protection: true for an IP literal that is loopback, link-local,
|
|
42
44
|
* or RFC1918 private. `fetch_url` refuses these hosts by default (see
|
|
43
45
|
* {@link assertUrlNotBlocked}) so an agent-supplied URL can't reach
|
|
44
46
|
* loopback services or cloud metadata endpoints (e.g. 169.254.169.254).
|
|
45
47
|
*/
|
|
46
|
-
function isBlockedAddress(ip) {
|
|
48
|
+
export function isBlockedAddress(ip) {
|
|
47
49
|
if (net.isIPv4(ip)) {
|
|
48
50
|
const parts = ip.split('.').map(Number);
|
|
49
51
|
const a = parts[0];
|
|
50
52
|
const b = parts[1];
|
|
53
|
+
if (a === 0)
|
|
54
|
+
return true; // 0.0.0.0/8: "this host" (0.0.0.0 reaches local services)
|
|
51
55
|
if (a === 127)
|
|
52
56
|
return true; // 127.0.0.0/8: loopback
|
|
57
|
+
if (a === 100 && b >= 64 && b <= 127)
|
|
58
|
+
return true; // 100.64.0.0/10: carrier-grade NAT / cloud-internal
|
|
53
59
|
if (a === 10)
|
|
54
60
|
return true; // 10.0.0.0/8: private
|
|
55
61
|
if (a === 172 && b >= 16 && b <= 31)
|
|
@@ -62,16 +68,25 @@ function isBlockedAddress(ip) {
|
|
|
62
68
|
}
|
|
63
69
|
if (net.isIPv6(ip)) {
|
|
64
70
|
const lower = ip.toLowerCase();
|
|
65
|
-
if (lower === '::1')
|
|
66
|
-
return true; // loopback
|
|
71
|
+
if (lower === '::1' || lower === '::')
|
|
72
|
+
return true; // loopback, unspecified
|
|
67
73
|
// IPv4-mapped IPv6 (::ffff:a.b.c.d): check the embedded v4 address too,
|
|
68
74
|
// otherwise it's a trivial bypass of the v4 checks above.
|
|
69
75
|
const mapped = lower.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/);
|
|
70
76
|
if (mapped)
|
|
71
77
|
return isBlockedAddress(mapped[1]);
|
|
78
|
+
// The same mapped address written in hex (::ffff:7f00:1 is 127.0.0.1).
|
|
79
|
+
const mappedHex = lower.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/);
|
|
80
|
+
if (mappedHex) {
|
|
81
|
+
const hi = parseInt(mappedHex[1], 16);
|
|
82
|
+
const lo = parseInt(mappedHex[2], 16);
|
|
83
|
+
return isBlockedAddress(`${hi >> 8}.${hi & 255}.${lo >> 8}.${lo & 255}`);
|
|
84
|
+
}
|
|
72
85
|
const firstGroup = parseInt(lower.split(':')[0] ?? '', 16);
|
|
73
86
|
if (!Number.isNaN(firstGroup) && firstGroup >= 0xfe80 && firstGroup <= 0xfebf)
|
|
74
87
|
return true; // fe80::/10: link-local
|
|
88
|
+
if (!Number.isNaN(firstGroup) && firstGroup >= 0xfc00 && firstGroup <= 0xfdff)
|
|
89
|
+
return true; // fc00::/7: unique local (private)
|
|
75
90
|
return false;
|
|
76
91
|
}
|
|
77
92
|
return false;
|
|
@@ -140,21 +155,39 @@ export const fetchUrlTool = {
|
|
|
140
155
|
? setTimeout(() => controller.abort(), timeoutMs)
|
|
141
156
|
: null;
|
|
142
157
|
let response;
|
|
158
|
+
let finalUrl = args.url;
|
|
143
159
|
try {
|
|
144
|
-
//
|
|
145
|
-
//
|
|
146
|
-
//
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
160
|
+
// Redirects are followed here, one hop at a time, so every hop passes the same policy and SSRF checks as the
|
|
161
|
+
// first URL: a public page must not be able to bounce the agent to 169.254.169.254 or localhost.
|
|
162
|
+
// The installed fetch honours the proxy and the extra CA roots even where the host replaced the global one.
|
|
163
|
+
const doFetch = installedFetch() ?? fetch;
|
|
164
|
+
let current = args.url;
|
|
165
|
+
for (let hop = 0;; hop++) {
|
|
166
|
+
response = await doFetch(current, {
|
|
167
|
+
method: 'GET',
|
|
168
|
+
redirect: 'manual',
|
|
169
|
+
signal: controller.signal,
|
|
170
|
+
headers: {
|
|
171
|
+
'user-agent': USER_AGENT,
|
|
172
|
+
accept: 'text/html, application/json, text/plain;q=0.9, */*;q=0.5',
|
|
173
|
+
},
|
|
174
|
+
});
|
|
175
|
+
const location = response.headers.get('location');
|
|
176
|
+
if (!follow || response.status < 300 || response.status >= 400 || !location)
|
|
177
|
+
break;
|
|
178
|
+
if (hop >= MAX_REDIRECTS)
|
|
179
|
+
throw new Error(`stopped after ${MAX_REDIRECTS} redirects`);
|
|
180
|
+
const next = new URL(location, current).href;
|
|
181
|
+
if (!/^https?:$/i.test(new URL(next).protocol))
|
|
182
|
+
throw new Error(`refusing a redirect to ${next}`);
|
|
183
|
+
const hopViolation = checkPolicyViolation(ctx.policy, { cwd: ctx.cwd, url: next });
|
|
184
|
+
if (hopViolation)
|
|
185
|
+
throw new Error(`[sandbox] ${hopViolation}`);
|
|
186
|
+
await assertUrlNotBlocked(next, ctx.policy);
|
|
187
|
+
await response.body?.cancel().catch(() => undefined);
|
|
188
|
+
current = next;
|
|
189
|
+
}
|
|
190
|
+
finalUrl = current;
|
|
158
191
|
}
|
|
159
192
|
catch (err) {
|
|
160
193
|
if (timeoutHandle)
|
|
@@ -167,7 +200,7 @@ export const fetchUrlTool = {
|
|
|
167
200
|
if (timeoutHandle)
|
|
168
201
|
clearTimeout(timeoutHandle);
|
|
169
202
|
if (response.status >= 400) {
|
|
170
|
-
throw new Error(`fetch_url: HTTP ${response.status} ${response.statusText || ''} (${
|
|
203
|
+
throw new Error(`fetch_url: HTTP ${response.status} ${response.statusText || ''} (${finalUrl})`);
|
|
171
204
|
}
|
|
172
205
|
const contentType = response.headers.get('content-type')?.toLowerCase() ?? 'text/plain';
|
|
173
206
|
const buffer = await readWithCap(response, maxBytes);
|
|
@@ -195,7 +228,7 @@ export const fetchUrlTool = {
|
|
|
195
228
|
}
|
|
196
229
|
const excerpt = body.length > EXCERPT_MAX_CHARS ? body.slice(0, EXCERPT_MAX_CHARS) + '\n\n…(truncated for display; raw response was ' + body.length + ' chars)' : body;
|
|
197
230
|
return {
|
|
198
|
-
url:
|
|
231
|
+
url: finalUrl,
|
|
199
232
|
status: response.status,
|
|
200
233
|
statusText: response.statusText,
|
|
201
234
|
contentType,
|
|
@@ -296,4 +329,3 @@ function prettyJson(text) {
|
|
|
296
329
|
return text;
|
|
297
330
|
}
|
|
298
331
|
}
|
|
299
|
-
//# sourceMappingURL=fetch-url.js.map
|
|
@@ -6,10 +6,10 @@ declare const params: z.ZodObject<{
|
|
|
6
6
|
kind: z.ZodOptional<z.ZodEnum<["function", "class", "interface", "type", "enum", "const", "method"]>>;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
8
|
name: string;
|
|
9
|
-
kind?: "function" | "
|
|
9
|
+
kind?: "function" | "class" | "interface" | "type" | "enum" | "const" | "method" | undefined;
|
|
10
10
|
}, {
|
|
11
11
|
name: string;
|
|
12
|
-
kind?: "function" | "
|
|
12
|
+
kind?: "function" | "class" | "interface" | "type" | "enum" | "const" | "method" | undefined;
|
|
13
13
|
}>;
|
|
14
14
|
export interface FindSymbolMatch {
|
|
15
15
|
name: string;
|
|
@@ -24,4 +24,3 @@ export interface FindSymbolResult {
|
|
|
24
24
|
}
|
|
25
25
|
export declare const findSymbolTool: ToolDefinition<z.infer<typeof params>, FindSymbolResult>;
|
|
26
26
|
export {};
|
|
27
|
-
//# sourceMappingURL=find-symbol.d.ts.map
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
8
8
|
import path from 'node:path';
|
|
9
9
|
import ignore from 'ignore';
|
|
10
|
+
import { isOutsideRel } from './shared.js';
|
|
10
11
|
/** Files read in every directory, in this order. `.forgeignore` is for paths only the agent should skip. */
|
|
11
12
|
export const IGNORE_FILE_NAMES = ['.gitignore', '.forgeignore'];
|
|
12
13
|
function readIfFile(file) {
|
|
@@ -62,7 +63,7 @@ export class IgnoreRules {
|
|
|
62
63
|
/** Whether `absPath` is ignored. Paths outside the rule root are never ignored here. */
|
|
63
64
|
isIgnored(absPath, isDir) {
|
|
64
65
|
const rel = path.relative(this.top, path.resolve(absPath));
|
|
65
|
-
if (!rel ||
|
|
66
|
+
if (!rel || isOutsideRel(rel))
|
|
66
67
|
return false;
|
|
67
68
|
const parts = rel.split(path.sep);
|
|
68
69
|
let ignored = false;
|
|
@@ -82,4 +83,3 @@ export class IgnoreRules {
|
|
|
82
83
|
return ignored;
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
|
-
//# sourceMappingURL=ignore-rules.js.map
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { applyPatchTool } from './apply-patch.js';
|
|
1
2
|
import { editFileTool } from './edit-file.js';
|
|
2
3
|
import { fetchUrlTool } from './fetch-url.js';
|
|
3
4
|
import { findReferencesTool } from './find-references.js';
|
|
@@ -10,7 +11,10 @@ import { readFileTool } from './read-file.js';
|
|
|
10
11
|
import { readImageTool } from './read-image.js';
|
|
11
12
|
import { runCommandTool } from './run-command.js';
|
|
12
13
|
import { searchFilesTool } from './search-files.js';
|
|
14
|
+
import { askUserTool } from './ask-user.js';
|
|
13
15
|
import { subAgentTool } from './sub-agent.js';
|
|
16
|
+
import { subAgentWaitTool } from './sub-agent-wait.js';
|
|
17
|
+
import { todoReadTool, todoWriteTool } from './todo.js';
|
|
14
18
|
import { writeFileTool } from './write-file.js';
|
|
15
19
|
import type { ToolDefinition } from '../types.js';
|
|
16
20
|
/**
|
|
@@ -26,11 +30,10 @@ type AnyToolDefinition = ToolDefinition<any, any>;
|
|
|
26
30
|
* intentional: the model sees this order in its tool list.
|
|
27
31
|
*/
|
|
28
32
|
export declare const BUILTIN_TOOLS: readonly AnyToolDefinition[];
|
|
29
|
-
export { editFileTool, editNotebookTool, fetchUrlTool, findReferencesTool, findSymbolTool, listFilesTool, listSymbolsTool, memoryForgetTool, memoryReadTool, memoryWriteTool, readFileTool, readImageTool, runCommandTool, searchFilesTool, subAgentTool, writeFileTool, };
|
|
33
|
+
export { applyPatchTool, askUserTool, editFileTool, editNotebookTool, fetchUrlTool, findReferencesTool, findSymbolTool, listFilesTool, listSymbolsTool, memoryForgetTool, memoryReadTool, memoryWriteTool, readFileTool, readImageTool, runCommandTool, searchFilesTool, subAgentTool, subAgentWaitTool, todoReadTool, todoWriteTool, writeFileTool, };
|
|
30
34
|
export type { ToolContext, ToolDefinition, ToolPolicy, ToolSandbox } from '../types.js';
|
|
31
35
|
export { checkPolicyViolation, globToRegex, mergeToolSandbox, normalizePathPattern, pathMatchesAny } from './policy.js';
|
|
32
36
|
export { redact, countRedactions, buildRules } from './redact.js';
|
|
33
37
|
export type { RedactionRule, RedactionResult } from './redact.js';
|
|
34
38
|
export { ToolResultCache, buildCacheKey, cachedExecute } from './result-cache.js';
|
|
35
39
|
export type { CacheKeyParts, CacheStats } from './result-cache.js';
|
|
36
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/tools/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { applyPatchTool } from './apply-patch.js';
|
|
1
2
|
import { editFileTool } from './edit-file.js';
|
|
2
3
|
import { fetchUrlTool } from './fetch-url.js';
|
|
3
4
|
import { findReferencesTool } from './find-references.js';
|
|
@@ -10,7 +11,10 @@ import { readFileTool } from './read-file.js';
|
|
|
10
11
|
import { readImageTool } from './read-image.js';
|
|
11
12
|
import { runCommandTool } from './run-command.js';
|
|
12
13
|
import { searchFilesTool } from './search-files.js';
|
|
14
|
+
import { askUserTool } from './ask-user.js';
|
|
13
15
|
import { subAgentTool } from './sub-agent.js';
|
|
16
|
+
import { subAgentWaitTool } from './sub-agent-wait.js';
|
|
17
|
+
import { todoReadTool, todoWriteTool } from './todo.js';
|
|
14
18
|
import { writeFileTool } from './write-file.js';
|
|
15
19
|
/**
|
|
16
20
|
* The built-in tool set that ships with Forge. These cover the file system,
|
|
@@ -28,6 +32,7 @@ export const BUILTIN_TOOLS = [
|
|
|
28
32
|
findReferencesTool,
|
|
29
33
|
writeFileTool,
|
|
30
34
|
editFileTool,
|
|
35
|
+
applyPatchTool,
|
|
31
36
|
editNotebookTool,
|
|
32
37
|
runCommandTool,
|
|
33
38
|
fetchUrlTool,
|
|
@@ -35,9 +40,12 @@ export const BUILTIN_TOOLS = [
|
|
|
35
40
|
memoryWriteTool,
|
|
36
41
|
memoryForgetTool,
|
|
37
42
|
subAgentTool,
|
|
43
|
+
subAgentWaitTool,
|
|
44
|
+
todoWriteTool,
|
|
45
|
+
todoReadTool,
|
|
46
|
+
askUserTool,
|
|
38
47
|
];
|
|
39
|
-
export { editFileTool, editNotebookTool, fetchUrlTool, findReferencesTool, findSymbolTool, listFilesTool, listSymbolsTool, memoryForgetTool, memoryReadTool, memoryWriteTool, readFileTool, readImageTool, runCommandTool, searchFilesTool, subAgentTool, writeFileTool, };
|
|
48
|
+
export { applyPatchTool, askUserTool, editFileTool, editNotebookTool, fetchUrlTool, findReferencesTool, findSymbolTool, listFilesTool, listSymbolsTool, memoryForgetTool, memoryReadTool, memoryWriteTool, readFileTool, readImageTool, runCommandTool, searchFilesTool, subAgentTool, subAgentWaitTool, todoReadTool, todoWriteTool, writeFileTool, };
|
|
40
49
|
export { checkPolicyViolation, globToRegex, mergeToolSandbox, normalizePathPattern, pathMatchesAny } from './policy.js';
|
|
41
50
|
export { redact, countRedactions, buildRules } from './redact.js';
|
|
42
51
|
export { ToolResultCache, buildCacheKey, cachedExecute } from './result-cache.js';
|
|
43
|
-
//# sourceMappingURL=index.js.map
|
package/dist/tools/list-files.js
CHANGED
package/dist/tools/memory.d.ts
CHANGED
|
@@ -11,11 +11,11 @@ declare const readParams: z.ZodObject<{
|
|
|
11
11
|
/** Optional heading to filter by. Returns just that section's body. */
|
|
12
12
|
section: z.ZodOptional<z.ZodString>;
|
|
13
13
|
}, "strip", z.ZodTypeAny, {
|
|
14
|
-
scope?: "project" | "global" | "both" | undefined;
|
|
15
14
|
section?: string | undefined;
|
|
16
|
-
}, {
|
|
17
15
|
scope?: "project" | "global" | "both" | undefined;
|
|
16
|
+
}, {
|
|
18
17
|
section?: string | undefined;
|
|
18
|
+
scope?: "project" | "global" | "both" | undefined;
|
|
19
19
|
}>;
|
|
20
20
|
export interface MemoryReadResult {
|
|
21
21
|
scope: 'project' | 'global' | 'both';
|
|
@@ -43,17 +43,17 @@ declare const writeParams: z.ZodObject<{
|
|
|
43
43
|
}, "strip", z.ZodTypeAny, {
|
|
44
44
|
body: string;
|
|
45
45
|
heading: string;
|
|
46
|
-
type?: "
|
|
47
|
-
scope?: "project" | "global" | undefined;
|
|
46
|
+
type?: "convention" | "decision" | "correction" | "reference" | undefined;
|
|
48
47
|
refs?: string[] | undefined;
|
|
49
48
|
pin?: boolean | undefined;
|
|
49
|
+
scope?: "project" | "global" | undefined;
|
|
50
50
|
}, {
|
|
51
51
|
body: string;
|
|
52
52
|
heading: string;
|
|
53
|
-
type?: "
|
|
54
|
-
scope?: "project" | "global" | undefined;
|
|
53
|
+
type?: "convention" | "decision" | "correction" | "reference" | undefined;
|
|
55
54
|
refs?: string[] | undefined;
|
|
56
55
|
pin?: boolean | undefined;
|
|
56
|
+
scope?: "project" | "global" | undefined;
|
|
57
57
|
}>;
|
|
58
58
|
export interface MemoryWriteResult {
|
|
59
59
|
scope: 'project' | 'global';
|
|
@@ -85,4 +85,3 @@ export interface MemoryForgetResult {
|
|
|
85
85
|
}
|
|
86
86
|
export declare const memoryForgetTool: ToolDefinition<z.infer<typeof forgetParams>, MemoryForgetResult>;
|
|
87
87
|
export {};
|
|
88
|
-
//# sourceMappingURL=memory.d.ts.map
|
package/dist/tools/memory.js
CHANGED
package/dist/tools/notebook.d.ts
CHANGED
|
@@ -46,16 +46,16 @@ declare const params: z.ZodObject<{
|
|
|
46
46
|
cell_type: z.ZodOptional<z.ZodEnum<["code", "markdown", "raw"]>>;
|
|
47
47
|
}, "strip", z.ZodTypeAny, {
|
|
48
48
|
path: string;
|
|
49
|
+
mode?: "replace" | "delete" | "insert" | undefined;
|
|
49
50
|
source?: string | undefined;
|
|
50
51
|
cell_type?: "code" | "raw" | "markdown" | undefined;
|
|
51
|
-
mode?: "replace" | "insert" | "delete" | undefined;
|
|
52
52
|
cell_index?: number | undefined;
|
|
53
53
|
cell_id?: string | undefined;
|
|
54
54
|
}, {
|
|
55
55
|
path: string;
|
|
56
|
+
mode?: "replace" | "delete" | "insert" | undefined;
|
|
56
57
|
source?: string | undefined;
|
|
57
58
|
cell_type?: "code" | "raw" | "markdown" | undefined;
|
|
58
|
-
mode?: "replace" | "insert" | "delete" | undefined;
|
|
59
59
|
cell_index?: number | undefined;
|
|
60
60
|
cell_id?: string | undefined;
|
|
61
61
|
}>;
|
|
@@ -67,4 +67,3 @@ export interface EditNotebookResult {
|
|
|
67
67
|
}
|
|
68
68
|
export declare const editNotebookTool: ToolDefinition<z.infer<typeof params>, EditNotebookResult>;
|
|
69
69
|
export {};
|
|
70
|
-
//# sourceMappingURL=notebook.d.ts.map
|
package/dist/tools/notebook.js
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ordered permission rules, as in Kilo's `permission` config: each permission (read, edit, bash, ...) maps to
|
|
3
|
+
* an action or to a pattern map, rules run in config order and the LAST match wins. Pure; the agent consults it
|
|
4
|
+
* in `requestApproval`.
|
|
5
|
+
*/
|
|
6
|
+
export type PermissionAction = 'allow' | 'ask' | 'deny';
|
|
7
|
+
export type PermissionConfig = Record<string, PermissionAction | Record<string, PermissionAction>>;
|
|
8
|
+
export interface PermissionRule {
|
|
9
|
+
permission: string;
|
|
10
|
+
pattern: string;
|
|
11
|
+
action: PermissionAction;
|
|
12
|
+
}
|
|
13
|
+
/** Flatten a config object into ordered rules; entries with an unknown action are dropped. */
|
|
14
|
+
export declare function compilePermissionRules(config: PermissionConfig | undefined): PermissionRule[];
|
|
15
|
+
/** The action of the last rule matching `permission` and `target`, or undefined when none does. */
|
|
16
|
+
export declare function evaluatePermission(rules: readonly PermissionRule[], permission: string, target: string): PermissionAction | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Split a shell command into the commands a permission rule must each allow: `&&`, `||`, `;`, `|` and newlines
|
|
19
|
+
* outside quotes separate commands; the inside of `$(...)` and backticks is added as extra commands, and an
|
|
20
|
+
* unquoted `>` redirect adds a `redirect:` entry, so an allow rule for `git status *` cannot cover
|
|
21
|
+
* `git status $(rm -rf x)` or `git status > file`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function splitShellCommands(command: string): string[];
|
|
24
|
+
/** `.env` and `.env.*` hold secrets; `.env.example` and `.env.sample` are documentation. */
|
|
25
|
+
export declare function isSensitiveFile(relPath: string): boolean;
|
|
26
|
+
/** True when a token of the command points outside `cwd`: `~`, a `..` escape, or an absolute path elsewhere. */
|
|
27
|
+
export declare function touchesOutsideCwd(command: string, cwd: string): boolean;
|
|
28
|
+
/** Which permission a tool call falls under and the strings the rules are matched against; undefined = no rule applies. */
|
|
29
|
+
export declare function permissionFor(toolName: string, args: unknown, cwd: string): {
|
|
30
|
+
permission: string;
|
|
31
|
+
targets: string[];
|
|
32
|
+
} | undefined;
|