@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,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Named providers beyond the built-in eleven: a table of well-known OpenAI-compatible services plus whatever the
|
|
3
|
+
* user defines under `customProviders` in `~/.forge/config.json`. A model on one of them is written `id:model`
|
|
4
|
+
* (e.g. `groq:llama-3.3-70b-versatile`) and resolves to an endpoint (base URL, key, headers) that
|
|
5
|
+
* `createLanguageModel` calls with the OpenAI chat or Anthropic message style. Pure; nothing here reads files.
|
|
6
|
+
*/
|
|
7
|
+
export type EndpointApi = 'openai-compatible' | 'anthropic';
|
|
8
|
+
export interface CustomModelConfig {
|
|
9
|
+
/** The id sent to the API when the key used in Forge differs from it. */
|
|
10
|
+
id?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
limit?: {
|
|
13
|
+
context?: number;
|
|
14
|
+
output?: number;
|
|
15
|
+
};
|
|
16
|
+
cost?: {
|
|
17
|
+
input?: number;
|
|
18
|
+
output?: number;
|
|
19
|
+
};
|
|
20
|
+
toolCall?: boolean;
|
|
21
|
+
reasoning?: boolean;
|
|
22
|
+
modalities?: {
|
|
23
|
+
input: string[];
|
|
24
|
+
output: string[];
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface CustomProviderConfig {
|
|
28
|
+
name?: string;
|
|
29
|
+
baseUrl?: string;
|
|
30
|
+
/** Stored as plain text in the config file; prefer `apiKeyEnv`. */
|
|
31
|
+
apiKey?: string;
|
|
32
|
+
/** Name of the environment variable that holds the key. */
|
|
33
|
+
apiKeyEnv?: string;
|
|
34
|
+
headers?: Record<string, string>;
|
|
35
|
+
api?: EndpointApi;
|
|
36
|
+
/** Give up on a request that has not answered after this many milliseconds. */
|
|
37
|
+
timeoutMs?: number;
|
|
38
|
+
/** Abort a streamed answer that stays silent this long. */
|
|
39
|
+
chunkTimeoutMs?: number;
|
|
40
|
+
models?: Record<string, CustomModelConfig>;
|
|
41
|
+
whitelist?: string[];
|
|
42
|
+
blacklist?: string[];
|
|
43
|
+
}
|
|
44
|
+
/** Where a call goes: the resolved form of a provider, carried on `ModelConfig.endpoint`. */
|
|
45
|
+
export interface ProviderEndpoint {
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
baseUrl: string;
|
|
49
|
+
apiKey?: string;
|
|
50
|
+
headers?: Record<string, string>;
|
|
51
|
+
api: EndpointApi;
|
|
52
|
+
timeoutMs?: number;
|
|
53
|
+
chunkTimeoutMs?: number;
|
|
54
|
+
}
|
|
55
|
+
export interface ProviderPreset {
|
|
56
|
+
name: string;
|
|
57
|
+
baseUrl: string;
|
|
58
|
+
apiKeyEnv: string;
|
|
59
|
+
api?: EndpointApi;
|
|
60
|
+
}
|
|
61
|
+
/** Defaults for services that speak the OpenAI chat protocol. Any field can be overridden under `customProviders`. */
|
|
62
|
+
export declare const PROVIDER_PRESETS: Readonly<Record<string, ProviderPreset>>;
|
|
63
|
+
/** Why an entry of `customProviders` cannot be used, one problem per bad entry. A preset id may omit its URL. */
|
|
64
|
+
export declare function customProviderProblems(custom: Record<string, CustomProviderConfig> | undefined): Array<{
|
|
65
|
+
id: string;
|
|
66
|
+
message: string;
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* The `customProviders` of the running host, so every place that turns a model name into a model (aliases,
|
|
70
|
+
* the cheap model, sub-agents, the picker) sees them without each call site passing the config along.
|
|
71
|
+
* Hosts register at the start of every run; tests reset with `undefined`.
|
|
72
|
+
*/
|
|
73
|
+
export declare function registerCustomProviders(custom: Record<string, CustomProviderConfig> | undefined): void;
|
|
74
|
+
export declare function registeredCustomProviders(): Record<string, CustomProviderConfig> | undefined;
|
|
75
|
+
export interface ModelFilter {
|
|
76
|
+
whitelist?: string[];
|
|
77
|
+
blacklist?: string[];
|
|
78
|
+
}
|
|
79
|
+
/** `modelFilters` of the running host (per provider id), read by the model pickers. */
|
|
80
|
+
export declare function registerModelFilters(filters: Record<string, ModelFilter> | undefined): void;
|
|
81
|
+
/** The filter for a provider id: the registered `modelFilters` entry, else the whitelist/blacklist on its custom provider. */
|
|
82
|
+
export declare function modelFilterFor(providerId: string): ModelFilter | undefined;
|
|
83
|
+
/** Preset ids and custom ids, once each; a built-in id never appears. */
|
|
84
|
+
export declare function knownProviderIds(custom: Record<string, CustomProviderConfig> | undefined): string[];
|
|
85
|
+
/** The endpoint for a provider id, or undefined when the id is built-in, unknown, or has no usable URL. */
|
|
86
|
+
export declare function resolveProviderEndpoint(id: string, custom: Record<string, CustomProviderConfig> | undefined, env?: NodeJS.ProcessEnv): ProviderEndpoint | undefined;
|
|
87
|
+
/** The id the API expects for a model key (`models.<key>.id`), or the key itself. */
|
|
88
|
+
export declare function apiModelId(providerId: string, modelKey: string, custom: Record<string, CustomProviderConfig> | undefined): string;
|
|
89
|
+
/** Apply a provider's `whitelist` (only these) then `blacklist` (not these) to a model list. */
|
|
90
|
+
export declare function filterModels<T extends {
|
|
91
|
+
id: string;
|
|
92
|
+
}>(entries: readonly T[], filter: {
|
|
93
|
+
whitelist?: string[];
|
|
94
|
+
blacklist?: string[];
|
|
95
|
+
} | undefined): T[];
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Named providers beyond the built-in eleven: a table of well-known OpenAI-compatible services plus whatever the
|
|
3
|
+
* user defines under `customProviders` in `~/.forge/config.json`. A model on one of them is written `id:model`
|
|
4
|
+
* (e.g. `groq:llama-3.3-70b-versatile`) and resolves to an endpoint (base URL, key, headers) that
|
|
5
|
+
* `createLanguageModel` calls with the OpenAI chat or Anthropic message style. Pure; nothing here reads files.
|
|
6
|
+
*/
|
|
7
|
+
/** Defaults for services that speak the OpenAI chat protocol. Any field can be overridden under `customProviders`. */
|
|
8
|
+
export const PROVIDER_PRESETS = {
|
|
9
|
+
groq: { name: 'Groq', baseUrl: 'https://api.groq.com/openai/v1', apiKeyEnv: 'GROQ_API_KEY' },
|
|
10
|
+
deepseek: { name: 'DeepSeek', baseUrl: 'https://api.deepseek.com/v1', apiKeyEnv: 'DEEPSEEK_API_KEY' },
|
|
11
|
+
mistral: { name: 'Mistral', baseUrl: 'https://api.mistral.ai/v1', apiKeyEnv: 'MISTRAL_API_KEY' },
|
|
12
|
+
xai: { name: 'xAI', baseUrl: 'https://api.x.ai/v1', apiKeyEnv: 'XAI_API_KEY' },
|
|
13
|
+
cerebras: { name: 'Cerebras', baseUrl: 'https://api.cerebras.ai/v1', apiKeyEnv: 'CEREBRAS_API_KEY' },
|
|
14
|
+
fireworks: { name: 'Fireworks', baseUrl: 'https://api.fireworks.ai/inference/v1', apiKeyEnv: 'FIREWORKS_API_KEY' },
|
|
15
|
+
together: { name: 'Together AI', baseUrl: 'https://api.together.xyz/v1', apiKeyEnv: 'TOGETHER_API_KEY' },
|
|
16
|
+
moonshot: { name: 'Moonshot', baseUrl: 'https://api.moonshot.ai/v1', apiKeyEnv: 'MOONSHOT_API_KEY' },
|
|
17
|
+
nebius: { name: 'Nebius', baseUrl: 'https://api.studio.nebius.com/v1', apiKeyEnv: 'NEBIUS_API_KEY' },
|
|
18
|
+
vercel: { name: 'Vercel AI Gateway', baseUrl: 'https://ai-gateway.vercel.sh/v1', apiKeyEnv: 'AI_GATEWAY_API_KEY' },
|
|
19
|
+
perplexity: { name: 'Perplexity', baseUrl: 'https://api.perplexity.ai', apiKeyEnv: 'PERPLEXITY_API_KEY' },
|
|
20
|
+
deepinfra: { name: 'DeepInfra', baseUrl: 'https://api.deepinfra.com/v1/openai', apiKeyEnv: 'DEEPINFRA_API_KEY' },
|
|
21
|
+
sambanova: { name: 'SambaNova', baseUrl: 'https://api.sambanova.ai/v1', apiKeyEnv: 'SAMBANOVA_API_KEY' },
|
|
22
|
+
hyperbolic: { name: 'Hyperbolic', baseUrl: 'https://api.hyperbolic.xyz/v1', apiKeyEnv: 'HYPERBOLIC_API_KEY' },
|
|
23
|
+
huggingface: { name: 'Hugging Face', baseUrl: 'https://router.huggingface.co/v1', apiKeyEnv: 'HF_TOKEN' },
|
|
24
|
+
alibaba: { name: 'Alibaba Qwen', baseUrl: 'https://dashscope-intl.aliyuncs.com/compatible-mode/v1', apiKeyEnv: 'DASHSCOPE_API_KEY' },
|
|
25
|
+
venice: { name: 'Venice', baseUrl: 'https://api.venice.ai/api/v1', apiKeyEnv: 'VENICE_API_KEY' },
|
|
26
|
+
requesty: { name: 'Requesty', baseUrl: 'https://router.requesty.ai/v1', apiKeyEnv: 'REQUESTY_API_KEY' },
|
|
27
|
+
poolside: { name: 'Poolside', baseUrl: 'https://inference.poolside.ai/v1', apiKeyEnv: 'POOLSIDE_API_KEY' },
|
|
28
|
+
zenmux: { name: 'ZenMux', baseUrl: 'https://zenmux.ai/api/v1', apiKeyEnv: 'ZENMUX_API_KEY' },
|
|
29
|
+
};
|
|
30
|
+
const BUILTIN_IDS = new Set(['openai', 'anthropic', 'google', 'ollama', 'openrouter', 'minimax', 'bedrock', 'vertex', 'azure', 'lmstudio', 'openai-compatible', 'auto']);
|
|
31
|
+
const ID = /^[a-z0-9][a-z0-9_-]*$/;
|
|
32
|
+
const trimSlash = (url) => url.replace(/\/+$/, '');
|
|
33
|
+
const positive = (n) => typeof n === 'number' && Number.isFinite(n) && n > 0;
|
|
34
|
+
/** Why an entry of `customProviders` cannot be used, one problem per bad entry. A preset id may omit its URL. */
|
|
35
|
+
export function customProviderProblems(custom) {
|
|
36
|
+
const out = [];
|
|
37
|
+
for (const [id, c] of Object.entries(custom ?? {})) {
|
|
38
|
+
if (BUILTIN_IDS.has(id))
|
|
39
|
+
out.push({ id, message: `"${id}" is a built-in provider name; pick another id.` });
|
|
40
|
+
else if (!ID.test(id))
|
|
41
|
+
out.push({ id, message: `"${id}" is not a valid id: use lowercase letters, digits, - and _.` });
|
|
42
|
+
else if (!c || typeof c !== 'object')
|
|
43
|
+
out.push({ id, message: `"${id}" must be an object.` });
|
|
44
|
+
else {
|
|
45
|
+
const url = c.baseUrl ?? PROVIDER_PRESETS[id]?.baseUrl;
|
|
46
|
+
if (!url)
|
|
47
|
+
out.push({ id, message: `"${id}" needs a baseUrl.` });
|
|
48
|
+
else if (!/^https?:\/\//i.test(url))
|
|
49
|
+
out.push({ id, message: `"${id}" baseUrl must start with http:// or https://.` });
|
|
50
|
+
else if (c.timeoutMs !== undefined && !positive(c.timeoutMs))
|
|
51
|
+
out.push({ id, message: `"${id}" timeoutMs must be a positive number.` });
|
|
52
|
+
else if (c.chunkTimeoutMs !== undefined && !positive(c.chunkTimeoutMs))
|
|
53
|
+
out.push({ id, message: `"${id}" chunkTimeoutMs must be a positive number.` });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return out;
|
|
57
|
+
}
|
|
58
|
+
let registered;
|
|
59
|
+
/**
|
|
60
|
+
* The `customProviders` of the running host, so every place that turns a model name into a model (aliases,
|
|
61
|
+
* the cheap model, sub-agents, the picker) sees them without each call site passing the config along.
|
|
62
|
+
* Hosts register at the start of every run; tests reset with `undefined`.
|
|
63
|
+
*/
|
|
64
|
+
export function registerCustomProviders(custom) {
|
|
65
|
+
registered = custom;
|
|
66
|
+
}
|
|
67
|
+
export function registeredCustomProviders() {
|
|
68
|
+
return registered;
|
|
69
|
+
}
|
|
70
|
+
let registeredFilters;
|
|
71
|
+
/** `modelFilters` of the running host (per provider id), read by the model pickers. */
|
|
72
|
+
export function registerModelFilters(filters) {
|
|
73
|
+
registeredFilters = filters;
|
|
74
|
+
}
|
|
75
|
+
/** The filter for a provider id: the registered `modelFilters` entry, else the whitelist/blacklist on its custom provider. */
|
|
76
|
+
export function modelFilterFor(providerId) {
|
|
77
|
+
return registeredFilters?.[providerId] ?? (registered?.[providerId]?.whitelist || registered?.[providerId]?.blacklist
|
|
78
|
+
? { ...(registered[providerId].whitelist ? { whitelist: registered[providerId].whitelist } : {}), ...(registered[providerId].blacklist ? { blacklist: registered[providerId].blacklist } : {}) }
|
|
79
|
+
: undefined);
|
|
80
|
+
}
|
|
81
|
+
/** Preset ids and custom ids, once each; a built-in id never appears. */
|
|
82
|
+
export function knownProviderIds(custom) {
|
|
83
|
+
const ids = new Set(Object.keys(PROVIDER_PRESETS));
|
|
84
|
+
for (const id of Object.keys(custom ?? {}))
|
|
85
|
+
if (!BUILTIN_IDS.has(id))
|
|
86
|
+
ids.add(id);
|
|
87
|
+
return [...ids];
|
|
88
|
+
}
|
|
89
|
+
/** The endpoint for a provider id, or undefined when the id is built-in, unknown, or has no usable URL. */
|
|
90
|
+
export function resolveProviderEndpoint(id, custom, env = process.env) {
|
|
91
|
+
if (BUILTIN_IDS.has(id))
|
|
92
|
+
return undefined;
|
|
93
|
+
const preset = PROVIDER_PRESETS[id];
|
|
94
|
+
const c = custom?.[id];
|
|
95
|
+
const baseUrl = c?.baseUrl ?? preset?.baseUrl;
|
|
96
|
+
if (!baseUrl || (!c && !preset))
|
|
97
|
+
return undefined;
|
|
98
|
+
const keyEnv = c?.apiKeyEnv ?? preset?.apiKeyEnv;
|
|
99
|
+
const apiKey = c?.apiKey ?? (keyEnv ? env[keyEnv] : undefined);
|
|
100
|
+
return {
|
|
101
|
+
id,
|
|
102
|
+
name: c?.name ?? preset?.name ?? id,
|
|
103
|
+
baseUrl: trimSlash(baseUrl),
|
|
104
|
+
...(apiKey ? { apiKey } : {}),
|
|
105
|
+
...(c?.headers ? { headers: c.headers } : {}),
|
|
106
|
+
api: c?.api ?? preset?.api ?? 'openai-compatible',
|
|
107
|
+
...(c?.timeoutMs ? { timeoutMs: c.timeoutMs } : {}),
|
|
108
|
+
...(c?.chunkTimeoutMs ? { chunkTimeoutMs: c.chunkTimeoutMs } : {}),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/** The id the API expects for a model key (`models.<key>.id`), or the key itself. */
|
|
112
|
+
export function apiModelId(providerId, modelKey, custom) {
|
|
113
|
+
return custom?.[providerId]?.models?.[modelKey]?.id ?? modelKey;
|
|
114
|
+
}
|
|
115
|
+
/** Apply a provider's `whitelist` (only these) then `blacklist` (not these) to a model list. */
|
|
116
|
+
export function filterModels(entries, filter) {
|
|
117
|
+
const allow = filter?.whitelist?.length ? new Set(filter.whitelist) : undefined;
|
|
118
|
+
const block = filter?.blacklist?.length ? new Set(filter.blacklist) : undefined;
|
|
119
|
+
return entries.filter((e) => (!allow || allow.has(e.id)) && (!block || !block.has(e.id)));
|
|
120
|
+
}
|
package/dist/diff/index.d.ts
CHANGED
package/dist/diff/index.js
CHANGED
|
@@ -27,11 +27,11 @@ export declare function commitDirty(cwd: string, options?: GitCommitOptions): Pr
|
|
|
27
27
|
export declare function diffForFiles(cwd: string, files: string[]): Promise<string>;
|
|
28
28
|
/** Deterministic message used when no model is available or it fails. */
|
|
29
29
|
export declare function fallbackCommitMessage(files: string[]): string;
|
|
30
|
-
export declare function commitMessagePrompt(diff: string, task?: string): string;
|
|
31
|
-
/** Strip fences/quotes a model may wrap around the message. */
|
|
30
|
+
export declare function commitMessagePrompt(diff: string, task?: string, instruction?: string): string;
|
|
31
|
+
/** Strip an inline `<think>` block (MiniMax and other reasoning models) and the fences/quotes a model may wrap around the message. */
|
|
32
32
|
export declare function cleanCommitMessage(text: string): string;
|
|
33
33
|
/** Draft a commit message with `model` (typically the cheap model); never throws. */
|
|
34
|
-
export declare function generateCommitMessage(diff: string, files: string[], model: ModelConfig | undefined, task?: string, modelFactory?: (cfg: ModelConfig) => LanguageModel): Promise<string>;
|
|
34
|
+
export declare function generateCommitMessage(diff: string, files: string[], model: ModelConfig | undefined, task?: string, modelFactory?: (cfg: ModelConfig) => LanguageModel, instruction?: string): Promise<string>;
|
|
35
35
|
export type UndoResult = {
|
|
36
36
|
ok: true;
|
|
37
37
|
commit: string;
|
|
@@ -61,4 +61,3 @@ export declare function afterRun(cwd: string, state: {
|
|
|
61
61
|
task?: string;
|
|
62
62
|
modelFactory?: (cfg: ModelConfig) => LanguageModel;
|
|
63
63
|
}): Promise<ForgeCommit | null>;
|
|
64
|
-
//# sourceMappingURL=auto-commit.d.ts.map
|
package/dist/git/auto-commit.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { execFile } from 'node:child_process';
|
|
7
7
|
import { promisify } from 'node:util';
|
|
8
8
|
import { generateText } from 'ai';
|
|
9
|
+
import { stripThinkTags } from '../agent/think-tags.js';
|
|
9
10
|
import { createLanguageModel } from '../providers.js';
|
|
10
11
|
const execFileAsync = promisify(execFile);
|
|
11
12
|
async function git(cwd, args) {
|
|
@@ -111,24 +112,25 @@ export function fallbackCommitMessage(files) {
|
|
|
111
112
|
return `forge: update ${shown}${more}`;
|
|
112
113
|
}
|
|
113
114
|
const MAX_DIFF_CHARS = 12_000;
|
|
114
|
-
export function commitMessagePrompt(diff, task) {
|
|
115
|
+
export function commitMessagePrompt(diff, task, instruction) {
|
|
115
116
|
const clipped = diff.length > MAX_DIFF_CHARS ? `${diff.slice(0, MAX_DIFF_CHARS)}\n[diff truncated]` : diff;
|
|
116
|
-
|
|
117
|
+
const lead = instruction?.trim() || 'Write a git commit message for this diff in conventional-commit style (type(scope): subject, imperative mood, under 72 characters). Add a short body only if the change needs explaining. Reply with the message only, no quotes or code fences.';
|
|
118
|
+
return `${lead}${task ? `\n\nThe change was made for this request: ${task}` : ''}\n\n${clipped}`;
|
|
117
119
|
}
|
|
118
|
-
/** Strip fences/quotes a model may wrap around the message. */
|
|
120
|
+
/** Strip an inline `<think>` block (MiniMax and other reasoning models) and the fences/quotes a model may wrap around the message. */
|
|
119
121
|
export function cleanCommitMessage(text) {
|
|
120
|
-
return text
|
|
122
|
+
return stripThinkTags(text)
|
|
121
123
|
.replace(/^```[a-z]*\n?|\n?```$/gi, '')
|
|
122
124
|
.trim()
|
|
123
125
|
.replace(/^["'`]+|["'`]+$/g, '')
|
|
124
126
|
.trim();
|
|
125
127
|
}
|
|
126
128
|
/** Draft a commit message with `model` (typically the cheap model); never throws. */
|
|
127
|
-
export async function generateCommitMessage(diff, files, model, task, modelFactory = createLanguageModel) {
|
|
129
|
+
export async function generateCommitMessage(diff, files, model, task, modelFactory = createLanguageModel, instruction) {
|
|
128
130
|
if (!model || !diff.trim())
|
|
129
131
|
return fallbackCommitMessage(files);
|
|
130
132
|
try {
|
|
131
|
-
const result = await generateText({ model: modelFactory(model), prompt: commitMessagePrompt(diff, task) });
|
|
133
|
+
const result = await generateText({ model: modelFactory(model), prompt: commitMessagePrompt(diff, task, instruction) });
|
|
132
134
|
const message = cleanCommitMessage(result.text);
|
|
133
135
|
return message || fallbackCommitMessage(files);
|
|
134
136
|
}
|
|
@@ -182,4 +184,3 @@ export async function afterRun(cwd, state, options) {
|
|
|
182
184
|
const message = await generateCommitMessage(diff, files, options.model, options.task, options.modelFactory);
|
|
183
185
|
return commitFiles(cwd, files, message, options);
|
|
184
186
|
}
|
|
185
|
-
//# sourceMappingURL=auto-commit.js.map
|
package/dist/git/index.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export { FORGE_TRAILER, afterRun, beforeRun, changedFiles, cleanCommitMessage, commitDirty, commitFiles, commitMessagePrompt, diffForFiles, fallbackCommitMessage, generateCommitMessage, isGitRepo, undoLastForgeCommit, } from './auto-commit.js';
|
|
2
2
|
export type { ForgeCommit, GitCommitOptions, UndoResult } from './auto-commit.js';
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/git/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
1
|
export { FORGE_TRAILER, afterRun, beforeRun, changedFiles, cleanCommitMessage, commitDirty, commitFiles, commitMessagePrompt, diffForFiles, fallbackCommitMessage, generateCommitMessage, isGitRepo, undoLastForgeCommit, } from './auto-commit.js';
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -62,14 +62,14 @@ declare const createParams: z.ZodObject<{
|
|
|
62
62
|
head: z.ZodOptional<z.ZodString>;
|
|
63
63
|
draft: z.ZodOptional<z.ZodBoolean>;
|
|
64
64
|
}, "strip", z.ZodTypeAny, {
|
|
65
|
-
title: string;
|
|
66
65
|
body: string;
|
|
66
|
+
title: string;
|
|
67
67
|
draft?: boolean | undefined;
|
|
68
68
|
base?: string | undefined;
|
|
69
69
|
head?: string | undefined;
|
|
70
70
|
}, {
|
|
71
|
-
title: string;
|
|
72
71
|
body: string;
|
|
72
|
+
title: string;
|
|
73
73
|
draft?: boolean | undefined;
|
|
74
74
|
base?: string | undefined;
|
|
75
75
|
head?: string | undefined;
|
|
@@ -81,4 +81,3 @@ export declare function createGitHubCreateTool(cfg: GitHubConfig): ToolDefinitio
|
|
|
81
81
|
}>;
|
|
82
82
|
export declare function createGitHubTools(cfg: GitHubConfig): ToolDefinition[];
|
|
83
83
|
export {};
|
|
84
|
-
//# sourceMappingURL=github-tools.d.ts.map
|
package/dist/hooks/bus.d.ts
CHANGED
package/dist/hooks/bus.js
CHANGED
package/dist/hooks/config.d.ts
CHANGED
package/dist/hooks/config.js
CHANGED
package/dist/hooks/events.d.ts
CHANGED
|
@@ -87,4 +87,3 @@ export declare function eventToolName(event: HookEvent): string | undefined;
|
|
|
87
87
|
* glob" for this one event. Returns undefined for every other event.
|
|
88
88
|
*/
|
|
89
89
|
export declare function eventFilePath(event: HookEvent): string | undefined;
|
|
90
|
-
//# sourceMappingURL=events.d.ts.map
|
package/dist/hooks/events.js
CHANGED
package/dist/hooks/index.d.ts
CHANGED
|
@@ -18,4 +18,3 @@ export { AGENT_HOOK_TOOLS, createAgentHookRunner, type AgentHookRunnerOptions }
|
|
|
18
18
|
export { shouldIgnoreWatchPath } from './watch-ignore.js';
|
|
19
19
|
export { FileChangeCoalescer, type FileChangeType } from './watch-coalescer.js';
|
|
20
20
|
export { watchFilesystem } from './watcher.js';
|
|
21
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/hooks/index.js
CHANGED
|
@@ -13,4 +13,3 @@ export { AGENT_HOOK_TOOLS, createAgentHookRunner } from './agent-runner.js';
|
|
|
13
13
|
export { shouldIgnoreWatchPath } from './watch-ignore.js';
|
|
14
14
|
export { FileChangeCoalescer } from './watch-coalescer.js';
|
|
15
15
|
export { watchFilesystem } from './watcher.js';
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
package/dist/hooks/loader.d.ts
CHANGED
package/dist/hooks/loader.js
CHANGED
package/dist/hooks/runner.d.ts
CHANGED
package/dist/hooks/runner.js
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import { spawn } from 'node:child_process';
|
|
16
16
|
import { execFileSync } from 'node:child_process';
|
|
17
17
|
import { redact } from '../tools/redact.js';
|
|
18
|
+
import { shellEnv } from '../tools/shell-env.js';
|
|
18
19
|
/** Compute the env-var map for an event. */
|
|
19
20
|
export function eventToEnv(event) {
|
|
20
21
|
const env = {
|
|
@@ -98,11 +99,11 @@ export function runHook(event, config) {
|
|
|
98
99
|
proc = spawn(config.command, [], {
|
|
99
100
|
shell: true,
|
|
100
101
|
detached: process.platform !== 'win32',
|
|
101
|
-
env: {
|
|
102
|
+
env: shellEnv({
|
|
102
103
|
...process.env,
|
|
103
104
|
...(config.env ?? {}),
|
|
104
105
|
...eventToEnv(event),
|
|
105
|
-
},
|
|
106
|
+
}),
|
|
106
107
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
107
108
|
windowsHide: true,
|
|
108
109
|
});
|
|
@@ -182,4 +183,3 @@ export function runHook(event, config) {
|
|
|
182
183
|
});
|
|
183
184
|
});
|
|
184
185
|
}
|
|
185
|
-
//# sourceMappingURL=runner.js.map
|
package/dist/hooks/watcher.d.ts
CHANGED
package/dist/hooks/watcher.js
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { McpServerSpec } from '../mcp/mcp-config.js';
|
|
2
|
+
export type ImportScope = 'user' | 'project';
|
|
3
|
+
export interface ClaudeImportPlan {
|
|
4
|
+
mcp: Array<{
|
|
5
|
+
name: string;
|
|
6
|
+
spec: McpServerSpec;
|
|
7
|
+
scope: ImportScope;
|
|
8
|
+
from: string;
|
|
9
|
+
}>;
|
|
10
|
+
/** Folders to add to `skillPaths` (`~/...` or relative to the workspace). */
|
|
11
|
+
skillPaths: string[];
|
|
12
|
+
agents: Array<{
|
|
13
|
+
name: string;
|
|
14
|
+
scope: ImportScope;
|
|
15
|
+
text: string;
|
|
16
|
+
from: string;
|
|
17
|
+
}>;
|
|
18
|
+
commands: Array<{
|
|
19
|
+
name: string;
|
|
20
|
+
scope: ImportScope;
|
|
21
|
+
text: string;
|
|
22
|
+
from: string;
|
|
23
|
+
}>;
|
|
24
|
+
notes: string[];
|
|
25
|
+
}
|
|
26
|
+
export interface ImportRoots {
|
|
27
|
+
home: string;
|
|
28
|
+
cwd: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function planClaudeImport(roots: ImportRoots): Promise<ClaudeImportPlan>;
|
|
31
|
+
export interface ApplyOptions extends ImportRoots {
|
|
32
|
+
/** Defaults to `<home>/.forge/config.json`. */
|
|
33
|
+
configPath?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ApplyResult {
|
|
36
|
+
written: string[];
|
|
37
|
+
skipped: string[];
|
|
38
|
+
}
|
|
39
|
+
export declare function applyClaudeImport(plan: ClaudeImportPlan, opts: ApplyOptions): Promise<ApplyResult>;
|