@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
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bring a Claude Code setup over to Forge: MCP servers, skill folders, sub-agents and slash commands.
|
|
3
|
+
* `planClaudeImport` only reads; `applyClaudeImport` writes into Forge's own locations and never replaces
|
|
4
|
+
* something that is already there. What Forge has no equivalent for (permissions, hooks) is listed in `notes`.
|
|
5
|
+
* A converted agent is never given more tools than the original: tools that map to nothing leave it read-only.
|
|
6
|
+
*/
|
|
7
|
+
import { mkdir, readdir, readFile, writeFile } from 'node:fs/promises';
|
|
8
|
+
import path from 'node:path';
|
|
9
|
+
import { loadForgeConfigFile, saveForgeConfigFile } from '../config-file.js';
|
|
10
|
+
import { parseFrontmatter } from '../skills/parser.js';
|
|
11
|
+
const TOOL_MAP = {
|
|
12
|
+
Read: ['read_file'],
|
|
13
|
+
Grep: ['search_files'],
|
|
14
|
+
Glob: ['list_files'],
|
|
15
|
+
LS: ['list_files'],
|
|
16
|
+
Write: ['write_file'],
|
|
17
|
+
Edit: ['edit_file'],
|
|
18
|
+
MultiEdit: ['edit_file'],
|
|
19
|
+
NotebookEdit: ['edit_notebook'],
|
|
20
|
+
Bash: ['run_command'],
|
|
21
|
+
WebFetch: ['fetch_url'],
|
|
22
|
+
WebSearch: ['web_search'],
|
|
23
|
+
TodoWrite: ['todo_write', 'todo_read'],
|
|
24
|
+
};
|
|
25
|
+
const READ_ONLY_FALLBACK = ['read_file', 'list_files', 'search_files'];
|
|
26
|
+
const COMMAND_NAME = /^[a-zA-Z][a-zA-Z0-9_-]*$/;
|
|
27
|
+
/** A command body that runs a shell line (!`cmd`) or pulls in a file (@path.ext) in Claude Code. */
|
|
28
|
+
const CLAUDE_INLINE = /(^|\s)!`|(^|\s)@\S+\.\w+/;
|
|
29
|
+
const isObject = (v) => v !== null && typeof v === 'object' && !Array.isArray(v);
|
|
30
|
+
async function readJson(file) {
|
|
31
|
+
try {
|
|
32
|
+
return JSON.parse(await readFile(file, 'utf8'));
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async function isDir(dir) {
|
|
39
|
+
try {
|
|
40
|
+
await readdir(dir);
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async function mdFiles(dir) {
|
|
48
|
+
try {
|
|
49
|
+
return (await readdir(dir)).filter((n) => n.toLowerCase().endsWith('.md')).sort();
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** One Claude Code server entry as a Forge spec, or undefined when it has neither a command nor a URL. */
|
|
56
|
+
function convertServer(raw) {
|
|
57
|
+
if (!isObject(raw))
|
|
58
|
+
return undefined;
|
|
59
|
+
const str = (v) => (typeof v === 'string' && v ? v : undefined);
|
|
60
|
+
const strList = (v) => (Array.isArray(v) ? v.filter((x) => typeof x === 'string') : undefined);
|
|
61
|
+
const strMap = (v) => isObject(v) ? Object.fromEntries(Object.entries(v).filter((e) => typeof e[1] === 'string')) : undefined;
|
|
62
|
+
const command = str(raw.command);
|
|
63
|
+
const url = str(raw.url);
|
|
64
|
+
if (!command && !url)
|
|
65
|
+
return undefined;
|
|
66
|
+
const type = raw.type === 'http' ? 'streamable-http' : raw.type === 'sse' ? 'sse' : raw.type === 'stdio' ? 'stdio' : undefined;
|
|
67
|
+
const args = strList(raw.args);
|
|
68
|
+
const env = strMap(raw.env);
|
|
69
|
+
const headers = strMap(raw.headers);
|
|
70
|
+
return {
|
|
71
|
+
...(type ? { type } : {}),
|
|
72
|
+
...(command ? { command } : {}),
|
|
73
|
+
...(args ? { args } : {}),
|
|
74
|
+
...(env && Object.keys(env).length ? { env } : {}),
|
|
75
|
+
...(url ? { url } : {}),
|
|
76
|
+
...(headers && Object.keys(headers).length ? { headers } : {}),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function collectServers(servers, scope, from, plan, seen) {
|
|
80
|
+
if (!isObject(servers))
|
|
81
|
+
return;
|
|
82
|
+
for (const [name, raw] of Object.entries(servers)) {
|
|
83
|
+
const key = `${scope}:${name}`;
|
|
84
|
+
if (seen.has(key))
|
|
85
|
+
continue;
|
|
86
|
+
const spec = convertServer(raw);
|
|
87
|
+
if (!spec) {
|
|
88
|
+
plan.notes.push(`${from}: MCP server "${name}" has no command or url; not imported`);
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
seen.add(key);
|
|
92
|
+
plan.mcp.push({ name, spec, scope, from });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const norm = (p) => p.replace(/\\/g, '/').replace(/\/$/, '').toLowerCase();
|
|
96
|
+
function agentSlug(name) {
|
|
97
|
+
return name.toLowerCase().replace(/[^a-z0-9_-]+/g, '-').replace(/^[^a-z0-9]+|-+$/g, '').slice(0, 64);
|
|
98
|
+
}
|
|
99
|
+
function oneLine(s) {
|
|
100
|
+
return s.replace(/\\n/g, ' ').replace(/\s+/g, ' ').trim();
|
|
101
|
+
}
|
|
102
|
+
function convertAgent(file, text, notes) {
|
|
103
|
+
const { fields, body } = parseFrontmatter(text.replace(/\r\n/g, '\n'));
|
|
104
|
+
const label = path.basename(file);
|
|
105
|
+
const description = oneLine(fields.get('description') ?? '');
|
|
106
|
+
if (!description) {
|
|
107
|
+
notes.push(`${label}: no description; agent not imported`);
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
const name = agentSlug(fields.get('name') || label.replace(/\.md$/i, ''));
|
|
111
|
+
if (!name) {
|
|
112
|
+
notes.push(`${label}: no usable name; agent not imported`);
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
let tools;
|
|
116
|
+
const rawTools = fields.get('tools');
|
|
117
|
+
if (rawTools !== undefined && rawTools.trim()) {
|
|
118
|
+
const wanted = rawTools.split(',').map((s) => s.trim()).filter(Boolean);
|
|
119
|
+
const mapped = new Set();
|
|
120
|
+
for (const w of wanted) {
|
|
121
|
+
const base = w.replace(/\(.*$/, '');
|
|
122
|
+
if (base !== w)
|
|
123
|
+
notes.push(`${label}: "${w}" limited a tool by pattern in Claude Code; Forge permission rules decide that now`);
|
|
124
|
+
for (const t of TOOL_MAP[base] ?? [])
|
|
125
|
+
mapped.add(t);
|
|
126
|
+
if (!TOOL_MAP[base] && base !== 'Task')
|
|
127
|
+
notes.push(`${label}: tool "${base}" has no Forge equivalent; left out`);
|
|
128
|
+
}
|
|
129
|
+
tools = mapped.size > 0 ? [...mapped] : READ_ONLY_FALLBACK;
|
|
130
|
+
if (mapped.size === 0)
|
|
131
|
+
notes.push(`${label}: none of its tools map to Forge; imported as read-only`);
|
|
132
|
+
}
|
|
133
|
+
const front = ['---', `description: ${description}`, 'mode: subagent', ...(tools ? [`tools: ${tools.join(', ')}`] : []), '---'];
|
|
134
|
+
return { name, text: `${front.join('\n')}\n${body.trim()}\n` };
|
|
135
|
+
}
|
|
136
|
+
function convertCommand(file, text, notes) {
|
|
137
|
+
const label = path.basename(file);
|
|
138
|
+
const name = label.replace(/\.md$/i, '');
|
|
139
|
+
if (!COMMAND_NAME.test(name)) {
|
|
140
|
+
notes.push(`${label}: not a valid command name (letters, digits, - and _); not imported`);
|
|
141
|
+
return undefined;
|
|
142
|
+
}
|
|
143
|
+
const { fields, body } = parseFrontmatter(text.replace(/\r\n/g, '\n'));
|
|
144
|
+
const description = oneLine(fields.get('description') ?? '');
|
|
145
|
+
if (CLAUDE_INLINE.test(body))
|
|
146
|
+
notes.push(`${label}: runs a shell line or pulls in a file inside the prompt in Claude Code; Forge sends that text as it is`);
|
|
147
|
+
const head = description ? `---\ndescription: ${description}\n---\n` : '';
|
|
148
|
+
return { name, text: `${head}${body.replace(/\s+$/, '')}\n` };
|
|
149
|
+
}
|
|
150
|
+
export async function planClaudeImport(roots) {
|
|
151
|
+
const { home, cwd } = roots;
|
|
152
|
+
const plan = { mcp: [], skillPaths: [], agents: [], commands: [], notes: [] };
|
|
153
|
+
const seen = new Set();
|
|
154
|
+
const claudeJson = await readJson(path.join(home, '.claude.json'));
|
|
155
|
+
if (isObject(claudeJson)) {
|
|
156
|
+
collectServers(claudeJson.mcpServers, 'user', '~/.claude.json', plan, seen);
|
|
157
|
+
if (isObject(claudeJson.projects)) {
|
|
158
|
+
for (const [dir, value] of Object.entries(claudeJson.projects)) {
|
|
159
|
+
if (norm(dir) === norm(cwd) && isObject(value))
|
|
160
|
+
collectServers(value.mcpServers, 'project', '~/.claude.json (this project)', plan, seen);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
const projectMcp = await readJson(path.join(cwd, '.mcp.json'));
|
|
165
|
+
if (isObject(projectMcp))
|
|
166
|
+
collectServers(projectMcp.mcpServers, 'project', '.mcp.json', plan, seen);
|
|
167
|
+
if (await isDir(path.join(home, '.claude', 'skills')))
|
|
168
|
+
plan.skillPaths.push('~/.claude/skills');
|
|
169
|
+
if (await isDir(path.join(cwd, '.claude', 'skills')))
|
|
170
|
+
plan.skillPaths.push('.claude/skills');
|
|
171
|
+
const places = [
|
|
172
|
+
['user', path.join(home, '.claude')],
|
|
173
|
+
['project', path.join(cwd, '.claude')],
|
|
174
|
+
];
|
|
175
|
+
for (const [scope, base] of places) {
|
|
176
|
+
for (const n of await mdFiles(path.join(base, 'agents'))) {
|
|
177
|
+
const file = path.join(base, 'agents', n);
|
|
178
|
+
const out = convertAgent(file, await readFile(file, 'utf8'), plan.notes);
|
|
179
|
+
if (out)
|
|
180
|
+
plan.agents.push({ ...out, scope, from: file });
|
|
181
|
+
}
|
|
182
|
+
for (const n of await mdFiles(path.join(base, 'commands'))) {
|
|
183
|
+
const file = path.join(base, 'commands', n);
|
|
184
|
+
const out = convertCommand(file, await readFile(file, 'utf8'), plan.notes);
|
|
185
|
+
if (out)
|
|
186
|
+
plan.commands.push({ ...out, scope, from: file });
|
|
187
|
+
}
|
|
188
|
+
const settings = await readJson(path.join(base, 'settings.json'));
|
|
189
|
+
if (isObject(settings)) {
|
|
190
|
+
const where = `${scope === 'user' ? '~' : '.'}/.claude/settings.json`;
|
|
191
|
+
if (settings.permissions !== undefined)
|
|
192
|
+
plan.notes.push(`${where}: permissions are not imported; set Forge permission rules instead`);
|
|
193
|
+
if (settings.hooks !== undefined)
|
|
194
|
+
plan.notes.push(`${where}: hooks are not imported`);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return plan;
|
|
198
|
+
}
|
|
199
|
+
async function writeNew(file, text, result) {
|
|
200
|
+
await mkdir(path.dirname(file), { recursive: true });
|
|
201
|
+
try {
|
|
202
|
+
await writeFile(file, text, { encoding: 'utf8', flag: 'wx' });
|
|
203
|
+
result.written.push(file);
|
|
204
|
+
}
|
|
205
|
+
catch (err) {
|
|
206
|
+
if (err.code === 'EEXIST')
|
|
207
|
+
result.skipped.push(`${file} already exists`);
|
|
208
|
+
else
|
|
209
|
+
throw err;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
export async function applyClaudeImport(plan, opts) {
|
|
213
|
+
const { home, cwd } = opts;
|
|
214
|
+
const result = { written: [], skipped: [] };
|
|
215
|
+
const forgeDir = (scope) => path.join(scope === 'user' ? home : cwd, '.forge');
|
|
216
|
+
for (const scope of ['user', 'project']) {
|
|
217
|
+
const items = plan.mcp.filter((m) => m.scope === scope);
|
|
218
|
+
if (items.length === 0)
|
|
219
|
+
continue;
|
|
220
|
+
const file = path.join(forgeDir(scope), 'mcp.json');
|
|
221
|
+
const existing = await readJson(file);
|
|
222
|
+
const servers = isObject(existing) && isObject(existing.mcpServers) ? { ...existing.mcpServers } : {};
|
|
223
|
+
let added = 0;
|
|
224
|
+
for (const m of items) {
|
|
225
|
+
if (m.name in servers) {
|
|
226
|
+
result.skipped.push(`MCP server "${m.name}" already in ${file}`);
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
servers[m.name] = m.spec;
|
|
230
|
+
added += 1;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (added > 0) {
|
|
234
|
+
await mkdir(path.dirname(file), { recursive: true });
|
|
235
|
+
await writeFile(file, JSON.stringify({ ...(isObject(existing) ? existing : {}), mcpServers: servers }, null, 2) + '\n', 'utf8');
|
|
236
|
+
result.written.push(file);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
for (const a of plan.agents)
|
|
240
|
+
await writeNew(path.join(forgeDir(a.scope), 'agents', `${a.name}.md`), a.text, result);
|
|
241
|
+
for (const c of plan.commands)
|
|
242
|
+
await writeNew(path.join(forgeDir(c.scope), 'commands', `${c.name}.md`), c.text, result);
|
|
243
|
+
if (plan.skillPaths.length > 0) {
|
|
244
|
+
const configPath = opts.configPath ?? path.join(home, '.forge', 'config.json');
|
|
245
|
+
const { config } = await loadForgeConfigFile(configPath);
|
|
246
|
+
const current = config.skillPaths ?? [];
|
|
247
|
+
const add = plan.skillPaths.filter((p) => !current.includes(p));
|
|
248
|
+
if (add.length > 0) {
|
|
249
|
+
await saveForgeConfigFile({ skillPaths: [...current, ...add] }, configPath);
|
|
250
|
+
result.written.push(configPath);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return result;
|
|
254
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { Agent, applySandbox } from './agent/agent.js';
|
|
2
|
+
export { LoopGuard } from './agent/loop-guard.js';
|
|
3
|
+
export { enhancePrompt } from './agent/enhance-prompt.js';
|
|
4
|
+
export { stripThinkTags } from './agent/think-tags.js';
|
|
2
5
|
export { createGitHubCreateTool, createGitHubReadTool, createGitHubTools, githubFromEnv, parseRemote, type GitHubConfig, type PullRequestReport, type RepoRef, } from './github/github-tools.js';
|
|
3
6
|
export { createWebSearchTool, searchWeb, WEB_SEARCH_PROVIDERS, webSearchFromEnv, webSearchProblem, type WebSearchConfig, type WebSearchProvider, type WebSearchResult, } from './tools/web-search.js';
|
|
4
7
|
export { attachmentKind, attachmentBytes, attachmentParts, attachmentProblem, describeAttachment, detectMediaType, loadAttachment, makeAttachment, mediaPartTokens, MAX_ATTACHMENT_BYTES, MAX_IMAGE_ATTACHMENT_BYTES, type Attachment, type AttachmentKind, } from './attachments.js';
|
|
@@ -33,17 +36,17 @@ export type { MemoryForgetResult, MemoryReadResult, MemoryWriteResult } from './
|
|
|
33
36
|
export { buildLlmSummarizer, compactMessages, estimateMessageTokens, estimateTokens, getModelWindowTokens, shouldCompact, } from './context/compaction.js';
|
|
34
37
|
export type { CompactionResult, Summarizer } from './context/compaction.js';
|
|
35
38
|
export { defaultModelFor, detectProvider, envVarForProvider, fastDefaultFor, hasProviderKey, readModelConfigFromEnv, resolveApiKey, SUPPORTED_PROVIDERS, } from './config.js';
|
|
36
|
-
export { loadMcpConfig, parseMcpConfig, connectAll, connectOne, closeAll, mcpResultToValue, jsonSchemaToZod, } from './mcp/index.js';
|
|
39
|
+
export { loadMcpConfig, parseMcpConfig, connectAll, connectOne, closeAll, mcpResultToValue, mcpInstructionsBlock, createMcpResourceTools, jsonSchemaToZod, } from './mcp/index.js';
|
|
37
40
|
export type { McpConfigFile, McpServerSpec, ConnectedMcpServer, } from './mcp/index.js';
|
|
38
41
|
export { createLanguageModel, formatModelId, pickAvailableProvider, resolveModelFromEnv, resolveModelFromEnvAsync } from './providers.js';
|
|
39
|
-
export { defaultSessionDir, generateSessionId, saveSession, loadSession, deleteSession, listSessions, findLatestSession, formatSessionMarkdown, formatSessionJson, appendedSince, summarizeMessage, watchSession, searchSessions, sessionText, } from './sessions/index.js';
|
|
40
|
-
export type { Session, ListEntry, FormatOptions, SessionUpdate, WatchSessionOptions, SessionMatch, SearchSessionsOptions } from './sessions/index.js';
|
|
42
|
+
export { defaultSessionDir, generateSessionId, saveSession, loadSession, deleteSession, listSessions, findLatestSession, formatSessionMarkdown, formatSessionJson, appendedSince, summarizeMessage, watchSession, searchSessions, sessionText, pruneSessions, pruneByRetention, } from './sessions/index.js';
|
|
43
|
+
export type { Session, ListEntry, FormatOptions, SessionUpdate, WatchSessionOptions, SessionMatch, SearchSessionsOptions, SessionPruneOptions, SessionPruneResult } from './sessions/index.js';
|
|
41
44
|
export { commandDirs, expandCustomCommand, formatCustomCommands, loadCustomCommands, parseCommandFile, type CustomCommand, } from './commands/custom-commands.js';
|
|
42
45
|
export { BUILTIN_TOOLS, editFileTool, fetchUrlTool, findSymbolTool, listFilesTool, memoryReadTool, memoryForgetTool, memoryWriteTool, readFileTool, runCommandTool, searchFilesTool, subAgentTool, writeFileTool, checkPolicyViolation, globToRegex, mergeToolSandbox, normalizePathPattern, pathMatchesAny, redact, countRedactions, buildRules, ToolResultCache, buildCacheKey, cachedExecute, } from './tools/index.js';
|
|
43
|
-
export type { AgentConfig, AgentEvent, AgentRunOptions, AgentRunReason, AgentRunResult, AnyLanguageModel, ApprovalDecision, CommandRunner, ModelRouter, VerifyConfig, ApprovalRequest, LanguageModelFactory, ModelConfig, PricePerMillionTokens, ProviderName, RedactOptions, ToolContext, ToolDefinition, ToolPolicy, ToolSandbox, } from './types.js';
|
|
46
|
+
export type { AgentConfig, AgentEvent, AgentRunOptions, AgentRunReason, AgentRunResult, AnyLanguageModel, ApprovalDecision, CommandRunner, ModelRouter, VerifyConfig, ApprovalRequest, LanguageModelFactory, ModelConfig, PricePerMillionTokens, ProviderName, RedactOptions, TodoItem, ToolContext, UserQuestion, ToolDefinition, ToolPolicy, ToolSandbox, } from './types.js';
|
|
44
47
|
export type { CacheKeyParts, CacheStats } from './tools/index.js';
|
|
45
48
|
export type { RedactionRule, RedactionResult } from './tools/index.js';
|
|
46
|
-
export { buildSkillsBlock, composeSkillsPrompt, discoverSkills, fetchSkillsCatalog, installSkillFromCatalog, loadSkillsRegistry, loadSkillsRegistryAsync, parseSkill, parseSkillsDir, resolveSkillRoots, scoreSkill, searchSkills, selectSkills, skillsRegistryFromList, DEFAULT_SKILL_CATALOG_URL, GLOBAL_SKILLS_DIR, LOCAL_SKILLS_DIR, PROJECT_SKILLS_DIR, SKILL_CATALOG_VERSION, } from './skills/index.js';
|
|
49
|
+
export { buildSkillsBlock, builtinSkills, composeSkillsPrompt, discoverSkills, fetchSkillsCatalog, installSkillFromCatalog, loadSkillsRegistry, loadSkillsRegistryAsync, parseSkill, parseSkillsDir, resolveSkillRoots, scoreSkill, searchSkills, selectSkills, skillsRegistryFromList, DEFAULT_SKILL_CATALOG_URL, GLOBAL_SKILLS_DIR, LOCAL_SKILLS_DIR, PROJECT_SKILLS_DIR, SKILL_CATALOG_VERSION, } from './skills/index.js';
|
|
47
50
|
export type { Skill, SkillCatalog, SkillCatalogEntry, SkillRegistry, SkillRoots, SkillSearchResult, SkillSource, } from './skills/index.js';
|
|
48
51
|
export { cosine, embedderFromEnv, hashingEmbedder, openAiCompatibleEmbedder, } from './semantic/embedder.js';
|
|
49
52
|
export type { Embedder, OpenAiCompatibleEmbedderOptions } from './semantic/embedder.js';
|
|
@@ -60,7 +63,13 @@ export { PolicyError, applyPolicy, assertProviderAllowed, filterMcpServers, getO
|
|
|
60
63
|
export type { OrgPolicy } from './policy/policy.js';
|
|
61
64
|
export { createFileAuditSink, defaultAuditFile, scrubArgs } from './policy/audit.js';
|
|
62
65
|
export type { AuditEntry, AuditSink } from './policy/audit.js';
|
|
63
|
-
export { hasProxy, installProxy, proxyFromEnv } from './policy/proxy.js';
|
|
66
|
+
export { hasProxy, installProxy, installedFetch, proxyFromEnv } from './policy/proxy.js';
|
|
67
|
+
export { readCaCertificates } from './policy/ca-certs.js';
|
|
68
|
+
export { BackgroundAgents, MAX_RUNNING_BACKGROUND, backgroundResultsBlock } from './agent/background.js';
|
|
69
|
+
export type { BackgroundAgent, BackgroundState } from './agent/background.js';
|
|
70
|
+
export { applyClaudeImport, planClaudeImport } from './import/claude-code.js';
|
|
71
|
+
export type { ApplyResult, ClaudeImportPlan } from './import/claude-code.js';
|
|
72
|
+
export type { CaCertificates } from './policy/ca-certs.js';
|
|
64
73
|
export type { ProxySettings } from './policy/proxy.js';
|
|
65
74
|
export { AGENT_HOOK_TOOLS, createAgentHookRunner, DEFAULT_AGENT_HOOK_TIMEOUT_MS, DEFAULT_HOOK_TIMEOUT_MS, HooksBus, eventFilePath, eventToEnv, eventToolName, globalSettingsPath, hooksBusFromConfig, loadHooksConfig, matcherMatches, projectSettingsPath, runHook, validateHooksConfig, HOOK_EVENT_NAMES, shouldIgnoreWatchPath, FileChangeCoalescer, watchFilesystem, } from './hooks/index.js';
|
|
66
75
|
export type { AgentHookConfig, AgentHookRunner, AgentHookRunnerOptions, ShellHookConfig, ForgeSettings, HookConfig, HookDispatchLog, HookEvent, HookEventName, FileChangeType, HookMatcherEntry, HookRunResult, HooksConfig, LoadHooksResult, } from './hooks/index.js';
|
|
@@ -84,6 +93,16 @@ export { branchChangedFiles, branchDiff, commitAllInWorktree, compareWorktreeCon
|
|
|
84
93
|
export type { MergeResult, WorktreeCommit, CreateOptions, RemoveOptions, RemoveResult, WorktreeContextSnapshot, WorktreeInfo, WorktreeMismatchKind, WorktreeMismatchResult, } from './worktree/index.js';
|
|
85
94
|
export { formatSteeringLine, isSafeSteeringName, loadSteering, overrideFilePath, parseSteering, pathMatchesGlob, readOverride, selectAtStart, selectOnToolTouch, setSteeringDisabled, stripSteering, wrapSteering, } from './steering/index.js';
|
|
86
95
|
export type { StartSelection, SteeringConfig, SteeringDoc, SteeringInclusion, SteeringLoadResult, SteeringSkip, } from './steering/index.js';
|
|
96
|
+
export { CONFIG_KEY_COVERAGE, FORGE_CONFIG_SCHEMA } from './config-schema.js';
|
|
97
|
+
export { FILE_WRITE_TOOL_NAMES, filesTouchedBy } from './tools/write-tools.js';
|
|
98
|
+
export { shellEnv } from './tools/shell-env.js';
|
|
99
|
+
export { previewPatch } from './tools/apply-patch.js';
|
|
100
|
+
export type { PatchPreview } from './tools/apply-patch.js';
|
|
101
|
+
export { applyPatchTool, parsePatch, patchedPaths } from './tools/apply-patch.js';
|
|
102
|
+
export { buildEmbedder, type EmbedderSpec } from './semantic/embedder.js';
|
|
103
|
+
export { parseExtensions, type SemanticOptions } from './semantic/semantic-index.js';
|
|
104
|
+
export { cleanDigest, generateSessionDigest, shouldDigest, type DigestItem } from './memory/session-digest.js';
|
|
105
|
+
export { buildExtraInstructionsBlock } from './steering/extra-instructions.js';
|
|
87
106
|
export { buildProjectInstructionsBlock, PROJECT_INSTRUCTION_FILES } from './steering/project-instructions.js';
|
|
88
107
|
export { aiCommentTask, findAiComments, triggerOf } from './ai-comments/index.js';
|
|
89
108
|
export type { AiComment, AiCommentAction, AiCommentFile } from './ai-comments/index.js';
|
|
@@ -95,8 +114,19 @@ export type { SyntaxProblem } from './code-index/parser.js';
|
|
|
95
114
|
export * from './lsp/index.js';
|
|
96
115
|
export * from './plugins/index.js';
|
|
97
116
|
export { READ_ONLY_TOOLS, resolveAutoApprove } from './tools/read-only.js';
|
|
117
|
+
export { compilePermissionRules, evaluatePermission, isSensitiveFile, permissionFor, splitShellCommands, touchesOutsideCwd } from './tools/permission-rules.js';
|
|
118
|
+
export type { PermissionAction, PermissionConfig, PermissionRule } from './tools/permission-rules.js';
|
|
98
119
|
export { autoRunCommands, autoRunFingerprint, detectProjectChecks, formatProjectCommandsBlock, projectScriptsFingerprint } from './verify/index.js';
|
|
99
120
|
export { isAlwaysAllowable, isListedCommand, needsScriptFingerprint, normalizeCommand } from './tools/command-allow.js';
|
|
100
121
|
export type { CheckKind, DetectedCheck, DetectedChecks } from './verify/index.js';
|
|
101
122
|
export { IgnoreRules, IGNORE_FILE_NAMES, findGitRoot } from './tools/ignore-rules.js';
|
|
102
|
-
|
|
123
|
+
export { MAX_OBJECTIVE_CHARS, applyTurnOutcome, createGoalReportTool, goalPrompt, pauseGoal, resumeGoal, startGoal } from './agent/goal.js';
|
|
124
|
+
export type { GoalReport, GoalState, GoalStatus, TurnOutcome } from './agent/goal.js';
|
|
125
|
+
export { loadMergedForgeConfig, projectConfigPath } from './config-merge.js';
|
|
126
|
+
export { PROVIDER_PRESETS, apiModelId, customProviderProblems, filterModels, knownProviderIds, modelFilterFor, registerCustomProviders, registerModelFilters, registeredCustomProviders, resolveProviderEndpoint, } from './custom-providers.js';
|
|
127
|
+
export type { CustomModelConfig, CustomProviderConfig, EndpointApi, ProviderEndpoint, ProviderPreset } from './custom-providers.js';
|
|
128
|
+
export { withTimeouts, type FetchTimeouts } from './timed-fetch.js';
|
|
129
|
+
export { createEndpointModel } from './providers.js';
|
|
130
|
+
export { agentToSpecialist, loadAgentFiles, parseAgentFile, registerAgentDefs, registeredAgent, registeredAgents, type AgentDef } from './agents/agent-files.js';
|
|
131
|
+
export { applyResolved, type ResolvedModelRef } from './model-alias.js';
|
|
132
|
+
export { getModelOverride, overridesFromProviders, registerModelOverrides, type ModelOverride, type ModelOverrides } from './model-overrides.js';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { Agent, applySandbox } from './agent/agent.js';
|
|
2
|
+
export { LoopGuard } from './agent/loop-guard.js';
|
|
3
|
+
export { enhancePrompt } from './agent/enhance-prompt.js';
|
|
4
|
+
export { stripThinkTags } from './agent/think-tags.js';
|
|
2
5
|
export { createGitHubCreateTool, createGitHubReadTool, createGitHubTools, githubFromEnv, parseRemote, } from './github/github-tools.js';
|
|
3
6
|
export { createWebSearchTool, searchWeb, WEB_SEARCH_PROVIDERS, webSearchFromEnv, webSearchProblem, } from './tools/web-search.js';
|
|
4
7
|
export { attachmentKind, attachmentBytes, attachmentParts, attachmentProblem, describeAttachment, detectMediaType, loadAttachment, makeAttachment, mediaPartTokens, MAX_ATTACHMENT_BYTES, MAX_IMAGE_ATTACHMENT_BYTES, } from './attachments.js';
|
|
@@ -19,13 +22,13 @@ export { checkStale, staleKey } from './memory/stale.js';
|
|
|
19
22
|
export { MAX_BODY_CHARS } from './tools/memory.js';
|
|
20
23
|
export { buildLlmSummarizer, compactMessages, estimateMessageTokens, estimateTokens, getModelWindowTokens, shouldCompact, } from './context/compaction.js';
|
|
21
24
|
export { defaultModelFor, detectProvider, envVarForProvider, fastDefaultFor, hasProviderKey, readModelConfigFromEnv, resolveApiKey, SUPPORTED_PROVIDERS, } from './config.js';
|
|
22
|
-
export { loadMcpConfig, parseMcpConfig, connectAll, connectOne, closeAll, mcpResultToValue, jsonSchemaToZod, } from './mcp/index.js';
|
|
25
|
+
export { loadMcpConfig, parseMcpConfig, connectAll, connectOne, closeAll, mcpResultToValue, mcpInstructionsBlock, createMcpResourceTools, jsonSchemaToZod, } from './mcp/index.js';
|
|
23
26
|
export { createLanguageModel, formatModelId, pickAvailableProvider, resolveModelFromEnv, resolveModelFromEnvAsync } from './providers.js';
|
|
24
|
-
export { defaultSessionDir, generateSessionId, saveSession, loadSession, deleteSession, listSessions, findLatestSession, formatSessionMarkdown, formatSessionJson, appendedSince, summarizeMessage, watchSession, searchSessions, sessionText, } from './sessions/index.js';
|
|
27
|
+
export { defaultSessionDir, generateSessionId, saveSession, loadSession, deleteSession, listSessions, findLatestSession, formatSessionMarkdown, formatSessionJson, appendedSince, summarizeMessage, watchSession, searchSessions, sessionText, pruneSessions, pruneByRetention, } from './sessions/index.js';
|
|
25
28
|
export { commandDirs, expandCustomCommand, formatCustomCommands, loadCustomCommands, parseCommandFile, } from './commands/custom-commands.js';
|
|
26
29
|
export { BUILTIN_TOOLS, editFileTool, fetchUrlTool, findSymbolTool, listFilesTool, memoryReadTool, memoryForgetTool, memoryWriteTool, readFileTool, runCommandTool, searchFilesTool, subAgentTool, writeFileTool, checkPolicyViolation, globToRegex, mergeToolSandbox, normalizePathPattern, pathMatchesAny, redact, countRedactions, buildRules, ToolResultCache, buildCacheKey, cachedExecute, } from './tools/index.js';
|
|
27
30
|
// Skills system
|
|
28
|
-
export { buildSkillsBlock, composeSkillsPrompt, discoverSkills, fetchSkillsCatalog, installSkillFromCatalog, loadSkillsRegistry, loadSkillsRegistryAsync, parseSkill, parseSkillsDir, resolveSkillRoots, scoreSkill, searchSkills, selectSkills, skillsRegistryFromList, DEFAULT_SKILL_CATALOG_URL, GLOBAL_SKILLS_DIR, LOCAL_SKILLS_DIR, PROJECT_SKILLS_DIR, SKILL_CATALOG_VERSION, } from './skills/index.js';
|
|
31
|
+
export { buildSkillsBlock, builtinSkills, composeSkillsPrompt, discoverSkills, fetchSkillsCatalog, installSkillFromCatalog, loadSkillsRegistry, loadSkillsRegistryAsync, parseSkill, parseSkillsDir, resolveSkillRoots, scoreSkill, searchSkills, selectSkills, skillsRegistryFromList, DEFAULT_SKILL_CATALOG_URL, GLOBAL_SKILLS_DIR, LOCAL_SKILLS_DIR, PROJECT_SKILLS_DIR, SKILL_CATALOG_VERSION, } from './skills/index.js';
|
|
29
32
|
export { cosine, embedderFromEnv, hashingEmbedder, openAiCompatibleEmbedder, } from './semantic/embedder.js';
|
|
30
33
|
export { ensureSemanticFresh, searchSemantic } from './semantic/semantic-index.js';
|
|
31
34
|
export { createCodebaseSearchTool } from './tools/codebase-search.js';
|
|
@@ -37,7 +40,10 @@ export { applyCacheHints, supportsCacheHints } from './agent/cache-hints.js';
|
|
|
37
40
|
// Organization policy, audit log, proxy
|
|
38
41
|
export { PolicyError, applyPolicy, assertProviderAllowed, filterMcpServers, getOrgPolicy, loadOrgPolicy, managedPolicyPath, parsePolicy, resetOrgPolicyCache, } from './policy/policy.js';
|
|
39
42
|
export { createFileAuditSink, defaultAuditFile, scrubArgs } from './policy/audit.js';
|
|
40
|
-
export { hasProxy, installProxy, proxyFromEnv } from './policy/proxy.js';
|
|
43
|
+
export { hasProxy, installProxy, installedFetch, proxyFromEnv } from './policy/proxy.js';
|
|
44
|
+
export { readCaCertificates } from './policy/ca-certs.js';
|
|
45
|
+
export { BackgroundAgents, MAX_RUNNING_BACKGROUND, backgroundResultsBlock } from './agent/background.js';
|
|
46
|
+
export { applyClaudeImport, planClaudeImport } from './import/claude-code.js';
|
|
41
47
|
// Hooks system
|
|
42
48
|
export { AGENT_HOOK_TOOLS, createAgentHookRunner, DEFAULT_AGENT_HOOK_TIMEOUT_MS, DEFAULT_HOOK_TIMEOUT_MS, HooksBus, eventFilePath, eventToEnv, eventToolName, globalSettingsPath, hooksBusFromConfig, loadHooksConfig, matcherMatches, projectSettingsPath, runHook, validateHooksConfig, HOOK_EVENT_NAMES, shouldIgnoreWatchPath, FileChangeCoalescer, watchFilesystem, } from './hooks/index.js';
|
|
43
49
|
// MCP marketplace
|
|
@@ -67,6 +73,15 @@ export { defaultRetryPrompt, formatZodError, isStructuredOutputError, loadSchema
|
|
|
67
73
|
export { branchChangedFiles, branchDiff, commitAllInWorktree, compareWorktreeContexts, deleteBranch, mergeBranch, snapshotWorktreeContext, WorktreeError, WorktreeManager, } from './worktree/index.js';
|
|
68
74
|
// Steering files (SP3a)
|
|
69
75
|
export { formatSteeringLine, isSafeSteeringName, loadSteering, overrideFilePath, parseSteering, pathMatchesGlob, readOverride, selectAtStart, selectOnToolTouch, setSteeringDisabled, stripSteering, wrapSteering, } from './steering/index.js';
|
|
76
|
+
export { CONFIG_KEY_COVERAGE, FORGE_CONFIG_SCHEMA } from './config-schema.js';
|
|
77
|
+
export { FILE_WRITE_TOOL_NAMES, filesTouchedBy } from './tools/write-tools.js';
|
|
78
|
+
export { shellEnv } from './tools/shell-env.js';
|
|
79
|
+
export { previewPatch } from './tools/apply-patch.js';
|
|
80
|
+
export { applyPatchTool, parsePatch, patchedPaths } from './tools/apply-patch.js';
|
|
81
|
+
export { buildEmbedder } from './semantic/embedder.js';
|
|
82
|
+
export { parseExtensions } from './semantic/semantic-index.js';
|
|
83
|
+
export { cleanDigest, generateSessionDigest, shouldDigest } from './memory/session-digest.js';
|
|
84
|
+
export { buildExtraInstructionsBlock } from './steering/extra-instructions.js';
|
|
70
85
|
export { buildProjectInstructionsBlock, PROJECT_INSTRUCTION_FILES } from './steering/project-instructions.js';
|
|
71
86
|
// AI comments (Aider parity E).
|
|
72
87
|
export { aiCommentTask, findAiComments, triggerOf } from './ai-comments/index.js';
|
|
@@ -82,9 +97,17 @@ export * from './lsp/index.js';
|
|
|
82
97
|
export * from './plugins/index.js';
|
|
83
98
|
// Tools that are approved without a prompt by default (read-only).
|
|
84
99
|
export { READ_ONLY_TOOLS, resolveAutoApprove } from './tools/read-only.js';
|
|
100
|
+
export { compilePermissionRules, evaluatePermission, isSensitiveFile, permissionFor, splitShellCommands, touchesOutsideCwd } from './tools/permission-rules.js';
|
|
85
101
|
// Project check detection (typecheck / lint / test commands) for verify-by-default.
|
|
86
102
|
export { autoRunCommands, autoRunFingerprint, detectProjectChecks, formatProjectCommandsBlock, projectScriptsFingerprint } from './verify/index.js';
|
|
87
103
|
export { isAlwaysAllowable, isListedCommand, needsScriptFingerprint, normalizeCommand } from './tools/command-allow.js';
|
|
88
104
|
// Git-style ignore rules (.gitignore, .forgeignore) used by the file tools and indexes.
|
|
89
105
|
export { IgnoreRules, IGNORE_FILE_NAMES, findGitRoot } from './tools/ignore-rules.js';
|
|
90
|
-
|
|
106
|
+
export { MAX_OBJECTIVE_CHARS, applyTurnOutcome, createGoalReportTool, goalPrompt, pauseGoal, resumeGoal, startGoal } from './agent/goal.js';
|
|
107
|
+
export { loadMergedForgeConfig, projectConfigPath } from './config-merge.js';
|
|
108
|
+
export { PROVIDER_PRESETS, apiModelId, customProviderProblems, filterModels, knownProviderIds, modelFilterFor, registerCustomProviders, registerModelFilters, registeredCustomProviders, resolveProviderEndpoint, } from './custom-providers.js';
|
|
109
|
+
export { withTimeouts } from './timed-fetch.js';
|
|
110
|
+
export { createEndpointModel } from './providers.js';
|
|
111
|
+
export { agentToSpecialist, loadAgentFiles, parseAgentFile, registerAgentDefs, registeredAgent, registeredAgents } from './agents/agent-files.js';
|
|
112
|
+
export { applyResolved } from './model-alias.js';
|
|
113
|
+
export { getModelOverride, overridesFromProviders, registerModelOverrides } from './model-overrides.js';
|
package/dist/lazy-model.d.ts
CHANGED
package/dist/lazy-model.js
CHANGED
package/dist/lint/auto-lint.d.ts
CHANGED
|
@@ -23,4 +23,3 @@ export declare function commandFor(relPath: string, commands: Record<string, str
|
|
|
23
23
|
export declare function lintFile(relPath: string, config: AutoLintConfig, ctx: ToolContext): Promise<LintReport>;
|
|
24
24
|
/** The note appended to the tool result when lint found problems. */
|
|
25
25
|
export declare function lintMessage(report: LintReport): string;
|
|
26
|
-
//# sourceMappingURL=auto-lint.d.ts.map
|
package/dist/lint/auto-lint.js
CHANGED
|
@@ -58,4 +58,3 @@ export async function lintFile(relPath, config, ctx) {
|
|
|
58
58
|
export function lintMessage(report) {
|
|
59
59
|
return `[auto-lint] ${report.problems.length} problem${report.problems.length === 1 ? '' : 's'} in ${report.path}. Fix them:\n${report.problems.join('\n')}`;
|
|
60
60
|
}
|
|
61
|
-
//# sourceMappingURL=auto-lint.js.map
|
package/dist/lint/index.d.ts
CHANGED
package/dist/lint/index.js
CHANGED
package/dist/lsp/client.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The absolute path of `command` found on PATH (with PATHEXT on Windows), or undefined. Never the current directory.
|
|
3
|
+
* A command that already names a path is returned as it is.
|
|
4
|
+
*/
|
|
5
|
+
export declare function resolveOnPath(command: string, env: NodeJS.ProcessEnv, platform: NodeJS.Platform): string | undefined;
|
|
1
6
|
export type LspSeverity = 'error' | 'warning' | 'info' | 'hint';
|
|
2
7
|
export interface LspDiagnostic {
|
|
3
8
|
/** 1-based. */
|
|
@@ -37,4 +42,3 @@ export declare class LspClient {
|
|
|
37
42
|
private onData;
|
|
38
43
|
private onMessage;
|
|
39
44
|
}
|
|
40
|
-
//# sourceMappingURL=client.d.ts.map
|
package/dist/lsp/client.js
CHANGED
|
@@ -4,6 +4,37 @@
|
|
|
4
4
|
* JSON-RPC 2.0 with `Content-Length` framing is small enough to own.
|
|
5
5
|
*/
|
|
6
6
|
import { spawn } from 'node:child_process';
|
|
7
|
+
import { statSync } from 'node:fs';
|
|
8
|
+
import path from 'node:path';
|
|
9
|
+
/**
|
|
10
|
+
* The absolute path of `command` found on PATH (with PATHEXT on Windows), or undefined. Never the current directory.
|
|
11
|
+
* A command that already names a path is returned as it is.
|
|
12
|
+
*/
|
|
13
|
+
export function resolveOnPath(command, env, platform) {
|
|
14
|
+
if (/[\\/]/.test(command))
|
|
15
|
+
return command;
|
|
16
|
+
const isFile = (p) => {
|
|
17
|
+
try {
|
|
18
|
+
return statSync(p).isFile();
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const win = platform === 'win32';
|
|
25
|
+
const dirs = (env.PATH ?? env.Path ?? '').split(win ? ';' : path.delimiter).filter(Boolean);
|
|
26
|
+
const exts = win ? ['', ...(env.PATHEXT ?? '.COM;.EXE;.BAT;.CMD').split(';').filter(Boolean).map((e) => e.toLowerCase())] : [''];
|
|
27
|
+
for (const dir of dirs) {
|
|
28
|
+
for (const ext of exts) {
|
|
29
|
+
if (win && ext === '' && !/\.[a-z0-9]+$/i.test(command))
|
|
30
|
+
continue; // Windows runs nothing without an extension
|
|
31
|
+
const candidate = path.join(dir, command + ext);
|
|
32
|
+
if (isFile(candidate))
|
|
33
|
+
return candidate;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
7
38
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
8
39
|
/**
|
|
9
40
|
* Servers echo document URIs in their own spelling (`file:///c%3A/x` for the
|
|
@@ -45,9 +76,14 @@ export class LspClient {
|
|
|
45
76
|
* the spawn error (e.g. ENOENT) when the server binary is not installed.
|
|
46
77
|
*/
|
|
47
78
|
static async start(spec, rootDir, timeoutMs) {
|
|
48
|
-
//
|
|
49
|
-
|
|
50
|
-
const
|
|
79
|
+
// The server runs in the workspace, and Windows looks in the current directory before PATH: a repository could
|
|
80
|
+
// ship its own `typescript-language-server.cmd`. So a bare name is resolved on PATH first, never in the workspace.
|
|
81
|
+
const command = resolveOnPath(spec.command, process.env, process.platform);
|
|
82
|
+
if (!command)
|
|
83
|
+
throw Object.assign(new Error(`${spec.command} is not installed (not found on PATH)`), { code: 'ENOENT' });
|
|
84
|
+
// npm `.cmd` shims need a shell on Windows; the path is quoted because it is now absolute and may contain spaces.
|
|
85
|
+
const shell = process.platform === 'win32' && /\.(cmd|bat)$/i.test(command);
|
|
86
|
+
const proc = spawn(shell ? `"${command}"` : command, spec.args ?? [], { cwd: rootDir, stdio: ['pipe', 'pipe', 'pipe'], shell });
|
|
51
87
|
const spawned = new Promise((_, reject) => proc.once('error', reject));
|
|
52
88
|
const client = new LspClient(proc);
|
|
53
89
|
const rootUri = pathToFileURL(rootDir).href;
|
|
@@ -206,4 +242,3 @@ function toDiagnostic(d) {
|
|
|
206
242
|
...(d.code !== undefined ? { code: d.code } : {}),
|
|
207
243
|
};
|
|
208
244
|
}
|
|
209
|
-
//# sourceMappingURL=client.js.map
|
|
@@ -19,4 +19,3 @@ export interface LspReport {
|
|
|
19
19
|
export declare function collectErrors(files: string[], cwd: string, config?: LspConfig): Promise<LspReport>;
|
|
20
20
|
/** Plain-text rendering fed to the model, in `file:line:col: message` form. */
|
|
21
21
|
export declare function formatErrors(errors: FileDiagnostics[]): string;
|
|
22
|
-
//# sourceMappingURL=diagnostics.d.ts.map
|
package/dist/lsp/diagnostics.js
CHANGED
package/dist/lsp/index.d.ts
CHANGED
|
@@ -2,4 +2,3 @@ export { LspClient } from './client.js';
|
|
|
2
2
|
export type { LspDiagnostic, LspServerSpec, LspSeverity } from './client.js';
|
|
3
3
|
export { collectErrors, formatErrors } from './diagnostics.js';
|
|
4
4
|
export type { FileDiagnostics, LspConfig, LspReport } from './diagnostics.js';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/lsp/index.js
CHANGED
package/dist/mcp/catalog.d.ts
CHANGED
package/dist/mcp/catalog.js
CHANGED
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export { loadMcpConfig, parseMcpConfig } from './mcp-config.js';
|
|
2
2
|
export type { McpConfigFile, McpServerSpec } from './mcp-config.js';
|
|
3
3
|
export { jsonSchemaToZod } from './json-schema-to-zod.js';
|
|
4
|
-
export { connectAll, connectOne, closeAll, mcpResultToValue } from './mcp-client.js';
|
|
4
|
+
export { connectAll, connectOne, closeAll, mcpInstructionsBlock, mcpResultToValue, McpAuthRequiredError } from './mcp-client.js';
|
|
5
|
+
export type { ConnectOptions } from './mcp-client.js';
|
|
6
|
+
export { forgetSavedAuth, defaultMcpAuthDir } from './oauth.js';
|
|
7
|
+
export type { McpOAuthOptions } from './oauth.js';
|
|
8
|
+
export { createMcpResourceTools } from './resource-tools.js';
|
|
5
9
|
export { BUILTIN_MCP_CATALOG, loadMcpCatalog } from './catalog.js';
|
|
6
10
|
export { McpManager, expandSpec } from './manager.js';
|
|
7
11
|
export type { McpManagerOptions, McpServerState, McpServerStatus } from './manager.js';
|
|
@@ -10,4 +14,3 @@ export type { ConnectedMcpServer } from './mcp-client.js';
|
|
|
10
14
|
export { defaultCacheRoot, defaultUserMcpPath, installMcpServer, installDirNameFor, listInstalledServers, normalizeGithubSource, probeRepoForServer, readUserMcpRegistry, uninstallMcpServer, writeUserMcpRegistry, } from './marketplace.js';
|
|
11
15
|
export type { InstalledMcpServer, InstalledServerMetadata, MarketplaceCatalog, MarketplaceEntry, } from './marketplace-types.js';
|
|
12
16
|
export { MARKETPLACE_CATALOG_VERSION } from './marketplace-types.js';
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/mcp/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export { loadMcpConfig, parseMcpConfig } from './mcp-config.js';
|
|
2
2
|
export { jsonSchemaToZod } from './json-schema-to-zod.js';
|
|
3
|
-
export { connectAll, connectOne, closeAll, mcpResultToValue } from './mcp-client.js';
|
|
3
|
+
export { connectAll, connectOne, closeAll, mcpInstructionsBlock, mcpResultToValue, McpAuthRequiredError } from './mcp-client.js';
|
|
4
|
+
export { forgetSavedAuth, defaultMcpAuthDir } from './oauth.js';
|
|
5
|
+
export { createMcpResourceTools } from './resource-tools.js';
|
|
4
6
|
export { BUILTIN_MCP_CATALOG, loadMcpCatalog } from './catalog.js';
|
|
5
7
|
export { McpManager, expandSpec } from './manager.js';
|
|
6
8
|
export { assertValidServerName, registerMcpServer, setMcpServerDisabled } from './registry.js';
|
|
7
9
|
// MCP marketplace
|
|
8
10
|
export { defaultCacheRoot, defaultUserMcpPath, installMcpServer, installDirNameFor, listInstalledServers, normalizeGithubSource, probeRepoForServer, readUserMcpRegistry, uninstallMcpServer, writeUserMcpRegistry, } from './marketplace.js';
|
|
9
11
|
export { MARKETPLACE_CATALOG_VERSION } from './marketplace-types.js';
|
|
10
|
-
//# sourceMappingURL=index.js.map
|