@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,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extra certificate authorities for company networks that inspect TLS with their own root. Node reads
|
|
3
|
+
* `NODE_EXTRA_CA_CERTS` only at process start, which an editor extension cannot set, so the files are read here
|
|
4
|
+
* and handed to the HTTP dispatcher (see installProxy).
|
|
5
|
+
*/
|
|
6
|
+
import { readFileSync } from 'node:fs';
|
|
7
|
+
import os from 'node:os';
|
|
8
|
+
import path from 'node:path';
|
|
9
|
+
export function readCaCertificates(files, opts = {}) {
|
|
10
|
+
const home = opts.home ?? os.homedir();
|
|
11
|
+
const pems = [];
|
|
12
|
+
const warnings = [];
|
|
13
|
+
for (const raw of files) {
|
|
14
|
+
const file = raw.trim();
|
|
15
|
+
if (!file)
|
|
16
|
+
continue;
|
|
17
|
+
const resolved = file === '~' || file.startsWith('~/') || file.startsWith('~\\') ? path.join(home, file.slice(1)) : file;
|
|
18
|
+
try {
|
|
19
|
+
const text = readFileSync(resolved, 'utf8');
|
|
20
|
+
if (/-----BEGIN CERTIFICATE-----/.test(text))
|
|
21
|
+
pems.push(text);
|
|
22
|
+
else
|
|
23
|
+
warnings.push(`${file}: no PEM certificate found; ignored`);
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
warnings.push(`${file}: ${err.message}; ignored`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return { pems, warnings };
|
|
30
|
+
}
|
package/dist/policy/policy.d.ts
CHANGED
|
@@ -106,4 +106,3 @@ export declare function filterMcpServers<T>(servers: Record<string, T>, policy:
|
|
|
106
106
|
/** Return `config` with the policy applied (a new object; the input is not mutated). */
|
|
107
107
|
export declare function applyPolicy(config: AgentConfig, policy: OrgPolicy | undefined): AgentConfig;
|
|
108
108
|
export {};
|
|
109
|
-
//# sourceMappingURL=policy.d.ts.map
|
package/dist/policy/policy.js
CHANGED
package/dist/policy/proxy.d.ts
CHANGED
|
@@ -14,8 +14,14 @@ export interface ProxySettings {
|
|
|
14
14
|
export declare function proxyFromEnv(env?: NodeJS.ProcessEnv): ProxySettings;
|
|
15
15
|
export declare function hasProxy(p: ProxySettings): boolean;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* A fetch that goes through the dispatcher installed by {@link installProxy} (the proxy and the extra CA roots), or
|
|
18
|
+
* undefined when none is installed. Needed because a host can replace the global `fetch` with one that ignores the
|
|
19
|
+
* global dispatcher: VS Code does in its extension host. Calls that must honour the proxy and the roots pass this one
|
|
20
|
+
* explicitly instead of relying on the global.
|
|
19
21
|
*/
|
|
20
|
-
export declare function
|
|
21
|
-
|
|
22
|
+
export declare function installedFetch(): typeof fetch | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Route all `fetch` traffic through the proxy in `settings` (default: the environment) and trust `extraCa`
|
|
25
|
+
* (PEM text) on top of the built-in roots. Idempotent. Returns whether anything was installed.
|
|
26
|
+
*/
|
|
27
|
+
export declare function installProxy(settings?: ProxySettings, extraCa?: readonly string[]): Promise<boolean>;
|
package/dist/policy/proxy.js
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* well-known global symbol, so installing it from the npm `undici` package also
|
|
6
6
|
* routes Node's bundled fetch.
|
|
7
7
|
*/
|
|
8
|
+
import https from 'node:https';
|
|
9
|
+
import { rootCertificates } from 'node:tls';
|
|
8
10
|
/** Proxy settings from the standard environment variables (either case). */
|
|
9
11
|
export function proxyFromEnv(env = process.env) {
|
|
10
12
|
const pick = (a, b) => env[a] || env[b] || undefined;
|
|
@@ -17,15 +19,40 @@ export function hasProxy(p) {
|
|
|
17
19
|
return Boolean(p.https || p.http);
|
|
18
20
|
}
|
|
19
21
|
let installed = false;
|
|
22
|
+
let installedFetchFn;
|
|
20
23
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
24
|
+
* A fetch that goes through the dispatcher installed by {@link installProxy} (the proxy and the extra CA roots), or
|
|
25
|
+
* undefined when none is installed. Needed because a host can replace the global `fetch` with one that ignores the
|
|
26
|
+
* global dispatcher: VS Code does in its extension host. Calls that must honour the proxy and the roots pass this one
|
|
27
|
+
* explicitly instead of relying on the global.
|
|
23
28
|
*/
|
|
24
|
-
export
|
|
25
|
-
|
|
29
|
+
export function installedFetch() {
|
|
30
|
+
return installedFetchFn;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Route all `fetch` traffic through the proxy in `settings` (default: the environment) and trust `extraCa`
|
|
34
|
+
* (PEM text) on top of the built-in roots. Idempotent. Returns whether anything was installed.
|
|
35
|
+
*/
|
|
36
|
+
export async function installProxy(settings = proxyFromEnv(), extraCa = []) {
|
|
37
|
+
if (installed || (!hasProxy(settings) && extraCa.length === 0))
|
|
26
38
|
return false;
|
|
27
|
-
const { EnvHttpProxyAgent, setGlobalDispatcher } = await import('undici');
|
|
28
|
-
|
|
39
|
+
const { Agent, EnvHttpProxyAgent, fetch: undiciFetch, setGlobalDispatcher } = await import('undici');
|
|
40
|
+
const useDispatcher = (dispatcher) => {
|
|
41
|
+
setGlobalDispatcher(dispatcher);
|
|
42
|
+
installedFetchFn = ((input, init) => undiciFetch(input, { ...init, dispatcher }));
|
|
43
|
+
};
|
|
44
|
+
const tls = extraCa.length > 0 ? { ca: [...rootCertificates, ...extraCa] } : undefined;
|
|
45
|
+
// Not everything goes through undici: VS Code replaces the extension host's fetch with one built on node:https, which
|
|
46
|
+
// reads the global agent. Trust the roots there too.
|
|
47
|
+
if (tls)
|
|
48
|
+
https.globalAgent.options.ca = tls.ca;
|
|
49
|
+
if (!hasProxy(settings)) {
|
|
50
|
+
useDispatcher(new Agent({ connect: tls }));
|
|
51
|
+
installed = true;
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
useDispatcher(new EnvHttpProxyAgent({
|
|
55
|
+
...(tls ? { requestTls: tls, proxyTls: tls } : {}),
|
|
29
56
|
// Plain-http targets are forwarded as absolute-URI requests (the classic proxy protocol);
|
|
30
57
|
// https targets always use CONNECT tunnels.
|
|
31
58
|
proxyTunnel: false,
|
|
@@ -36,4 +63,3 @@ export async function installProxy(settings = proxyFromEnv()) {
|
|
|
36
63
|
installed = true;
|
|
37
64
|
return true;
|
|
38
65
|
}
|
|
39
|
-
//# sourceMappingURL=proxy.js.map
|
package/dist/pricing.d.ts
CHANGED
package/dist/pricing.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { overrideCost } from './model-overrides.js';
|
|
1
2
|
/**
|
|
2
3
|
* Pricing table. Keys are matched with case-insensitive substring matching
|
|
3
4
|
* against the model id (after stripping any "models/" / "claude-" /
|
|
@@ -99,6 +100,9 @@ export function lookupPricing(model, override) {
|
|
|
99
100
|
const cache = typeof model === 'string' ? {} : cacheMultipliersFor(model);
|
|
100
101
|
if (override)
|
|
101
102
|
return { ...cache, ...override, known: true };
|
|
103
|
+
const configured = overrideCost(model);
|
|
104
|
+
if (configured)
|
|
105
|
+
return { ...cache, ...configured, known: true };
|
|
102
106
|
const id = (typeof model === 'string' ? model : model.model).toLowerCase();
|
|
103
107
|
// Strip only the OpenRouter-style 'models/' prefix so 'models/gemini-1.5-pro'
|
|
104
108
|
// resolves the same way as 'gemini-1.5-pro'. We do NOT strip provider prefixes
|
|
@@ -187,4 +191,3 @@ export function knownModelIds(provider) {
|
|
|
187
191
|
const hints = prefixHints[provider];
|
|
188
192
|
return ids.filter((id) => hints.some((h) => id.includes(h)));
|
|
189
193
|
}
|
|
190
|
-
//# sourceMappingURL=pricing.js.map
|
package/dist/providers.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LanguageModel } from 'ai';
|
|
2
|
+
import type { ProviderEndpoint } from './custom-providers.js';
|
|
2
3
|
import type { ModelConfig, ProviderName } from './types.js';
|
|
3
4
|
/**
|
|
4
5
|
* Build a Vercel AI SDK `LanguageModel` from a `ModelConfig`.
|
|
@@ -14,6 +15,12 @@ import type { ModelConfig, ProviderName } from './types.js';
|
|
|
14
15
|
* dependency footprint small (no separate `ollama-ai-provider` or
|
|
15
16
|
* `openrouter-ai-provider` packages).
|
|
16
17
|
*/
|
|
18
|
+
/**
|
|
19
|
+
* A model on a named provider: the OpenAI chat protocol (default) or the Anthropic message protocol, at the
|
|
20
|
+
* endpoint's URL with its key and headers. `timeoutMs` and `chunkTimeoutMs` wrap the HTTP calls.
|
|
21
|
+
* `fetchImpl` exists for tests.
|
|
22
|
+
*/
|
|
23
|
+
export declare function createEndpointModel(endpoint: ProviderEndpoint, model: string, fetchImpl?: typeof fetch): LanguageModel;
|
|
17
24
|
export declare function createLanguageModel(config: ModelConfig): LanguageModel;
|
|
18
25
|
/**
|
|
19
26
|
* Resolve a model from the environment when no config is supplied. Throws a
|
|
@@ -34,4 +41,3 @@ export declare function pickAvailableProvider(env?: NodeJS.ProcessEnv, disabled?
|
|
|
34
41
|
* Pretty-print a model identifier for display (e.g. "anthropic/claude-sonnet-4-5").
|
|
35
42
|
*/
|
|
36
43
|
export declare function formatModelId(config: ModelConfig): string;
|
|
37
|
-
//# sourceMappingURL=providers.d.ts.map
|
package/dist/providers.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { anthropic } from '@ai-sdk/anthropic';
|
|
2
|
-
import { google } from '@ai-sdk/google';
|
|
2
|
+
import { createGoogleGenerativeAI, google } from '@ai-sdk/google';
|
|
3
|
+
import { createAnthropic } from '@ai-sdk/anthropic';
|
|
3
4
|
import { createOpenAI, openai } from '@ai-sdk/openai';
|
|
4
5
|
import { defaultModelFor, hasProviderKey } from './config.js';
|
|
6
|
+
import { installedFetch } from './policy/proxy.js';
|
|
7
|
+
import { withTimeouts } from './timed-fetch.js';
|
|
5
8
|
import { lazyLanguageModel } from './lazy-model.js';
|
|
6
9
|
/**
|
|
7
10
|
* Default Ollama base URL. Ollama serves an OpenAI-compatible API at
|
|
@@ -33,25 +36,51 @@ const MINIMAX_BASE_URL = 'https://api.minimax.io/v1';
|
|
|
33
36
|
* dependency footprint small (no separate `ollama-ai-provider` or
|
|
34
37
|
* `openrouter-ai-provider` packages).
|
|
35
38
|
*/
|
|
39
|
+
/**
|
|
40
|
+
* A model on a named provider: the OpenAI chat protocol (default) or the Anthropic message protocol, at the
|
|
41
|
+
* endpoint's URL with its key and headers. `timeoutMs` and `chunkTimeoutMs` wrap the HTTP calls.
|
|
42
|
+
* `fetchImpl` exists for tests.
|
|
43
|
+
*/
|
|
44
|
+
export function createEndpointModel(endpoint, model, fetchImpl = installedFetch() ?? fetch) {
|
|
45
|
+
const timed = withTimeouts(fetchImpl, { ...(endpoint.timeoutMs ? { timeoutMs: endpoint.timeoutMs } : {}), ...(endpoint.chunkTimeoutMs ? { chunkTimeoutMs: endpoint.chunkTimeoutMs } : {}) });
|
|
46
|
+
const common = {
|
|
47
|
+
baseURL: endpoint.baseUrl,
|
|
48
|
+
...(endpoint.headers ? { headers: endpoint.headers } : {}),
|
|
49
|
+
fetch: timed,
|
|
50
|
+
};
|
|
51
|
+
if (endpoint.api === 'anthropic')
|
|
52
|
+
return createAnthropic({ ...common, apiKey: endpoint.apiKey ?? '' })(model);
|
|
53
|
+
return createOpenAI({ ...common, apiKey: endpoint.apiKey ?? 'none' }).chat(model);
|
|
54
|
+
}
|
|
55
|
+
/** `{ fetch }` when a proxy or extra CA roots are installed (see installedFetch), else nothing: the SDK then uses the global one. */
|
|
56
|
+
function viaInstalled() {
|
|
57
|
+
const f = installedFetch();
|
|
58
|
+
return f ? { fetch: f } : {};
|
|
59
|
+
}
|
|
36
60
|
export function createLanguageModel(config) {
|
|
61
|
+
if (config.endpoint)
|
|
62
|
+
return createEndpointModel(config.endpoint, config.model);
|
|
63
|
+
const net = viaInstalled();
|
|
37
64
|
switch (config.provider) {
|
|
38
65
|
case 'openai':
|
|
39
|
-
return openai(config.model);
|
|
66
|
+
return net.fetch ? createOpenAI(net)(config.model) : openai(config.model);
|
|
40
67
|
case 'anthropic':
|
|
41
|
-
return anthropic(config.model);
|
|
68
|
+
return net.fetch ? createAnthropic(net)(config.model) : anthropic(config.model);
|
|
42
69
|
case 'google':
|
|
43
|
-
return google(config.model);
|
|
70
|
+
return net.fetch ? createGoogleGenerativeAI(net)(config.model) : google(config.model);
|
|
44
71
|
case 'ollama':
|
|
45
72
|
return createOpenAI({
|
|
46
73
|
baseURL: process.env.OLLAMA_BASE_URL ?? DEFAULT_OLLAMA_BASE_URL,
|
|
47
74
|
// Ollama doesn't require an API key: pass a placeholder so the
|
|
48
75
|
// OpenAI SDK's auth header doesn't trip on undefined.
|
|
49
76
|
apiKey: process.env.OLLAMA_API_KEY ?? 'ollama',
|
|
77
|
+
...net,
|
|
50
78
|
}).chat(config.model);
|
|
51
79
|
case 'openrouter':
|
|
52
80
|
return createOpenAI({
|
|
53
81
|
baseURL: OPENROUTER_BASE_URL,
|
|
54
82
|
apiKey: process.env.OPENROUTER_API_KEY ?? '',
|
|
83
|
+
...net,
|
|
55
84
|
headers: {
|
|
56
85
|
// OpenRouter recommends an app-name header so they can attribute
|
|
57
86
|
// traffic; helps if you ever need to reach support.
|
|
@@ -64,18 +93,20 @@ export function createLanguageModel(config) {
|
|
|
64
93
|
return createOpenAI({
|
|
65
94
|
baseURL: process.env.MINIMAX_BASE_URL ?? MINIMAX_BASE_URL,
|
|
66
95
|
apiKey: process.env.MINIMAX_API_KEY ?? '',
|
|
96
|
+
...net,
|
|
67
97
|
}).chat(config.model);
|
|
68
98
|
case 'lmstudio':
|
|
69
99
|
return createOpenAI({
|
|
70
100
|
baseURL: process.env.LMSTUDIO_BASE_URL ?? DEFAULT_LMSTUDIO_BASE_URL,
|
|
71
101
|
apiKey: process.env.LMSTUDIO_API_KEY ?? 'lm-studio',
|
|
102
|
+
...net,
|
|
72
103
|
}).chat(config.model);
|
|
73
104
|
case 'openai-compatible': {
|
|
74
105
|
const baseURL = process.env.OPENAI_COMPATIBLE_BASE_URL;
|
|
75
106
|
if (!baseURL) {
|
|
76
107
|
throw new Error('Provider "openai-compatible" needs OPENAI_COMPATIBLE_BASE_URL (e.g. http://localhost:8000/v1).');
|
|
77
108
|
}
|
|
78
|
-
return createOpenAI({ baseURL, apiKey: process.env.OPENAI_COMPATIBLE_API_KEY ?? 'none' }).chat(config.model);
|
|
109
|
+
return createOpenAI({ baseURL, apiKey: process.env.OPENAI_COMPATIBLE_API_KEY ?? 'none', ...net }).chat(config.model);
|
|
79
110
|
}
|
|
80
111
|
// The three cloud-account SDKs are heavy (~1.2 s to import together), so they load on first use.
|
|
81
112
|
case 'bedrock':
|
|
@@ -83,6 +114,7 @@ export function createLanguageModel(config) {
|
|
|
83
114
|
const { createAmazonBedrock } = await import('@ai-sdk/amazon-bedrock');
|
|
84
115
|
return createAmazonBedrock({
|
|
85
116
|
region: process.env.AWS_REGION ?? 'us-east-1',
|
|
117
|
+
...net,
|
|
86
118
|
...(process.env.AWS_BEARER_TOKEN_BEDROCK ? { apiKey: process.env.AWS_BEARER_TOKEN_BEDROCK } : {}),
|
|
87
119
|
...(process.env.AWS_ACCESS_KEY_ID && process.env.AWS_SECRET_ACCESS_KEY
|
|
88
120
|
? {
|
|
@@ -99,12 +131,14 @@ export function createLanguageModel(config) {
|
|
|
99
131
|
return createVertex({
|
|
100
132
|
...(process.env.GOOGLE_VERTEX_PROJECT ? { project: process.env.GOOGLE_VERTEX_PROJECT } : {}),
|
|
101
133
|
location: process.env.GOOGLE_VERTEX_LOCATION ?? 'us-central1',
|
|
134
|
+
...net,
|
|
102
135
|
})(config.model);
|
|
103
136
|
});
|
|
104
137
|
case 'azure':
|
|
105
138
|
return lazyLanguageModel({ provider: 'azure', modelId: config.model }, async () => {
|
|
106
139
|
const { createAzure } = await import('@ai-sdk/azure');
|
|
107
140
|
return createAzure({
|
|
141
|
+
...net,
|
|
108
142
|
...(process.env.AZURE_API_KEY ? { apiKey: process.env.AZURE_API_KEY } : {}),
|
|
109
143
|
...(process.env.AZURE_RESOURCE_NAME ? { resourceName: process.env.AZURE_RESOURCE_NAME } : {}),
|
|
110
144
|
...(process.env.AZURE_OPENAI_BASE_URL ? { baseURL: process.env.AZURE_OPENAI_BASE_URL } : {}),
|
|
@@ -218,4 +252,3 @@ export function pickAvailableProvider(env = process.env, disabled = []) {
|
|
|
218
252
|
export function formatModelId(config) {
|
|
219
253
|
return `${config.provider}/${config.model}`;
|
|
220
254
|
}
|
|
221
|
-
//# sourceMappingURL=providers.js.map
|
package/dist/repomap/index.d.ts
CHANGED
|
@@ -2,4 +2,3 @@ export { DEFAULT_MAP_TOKENS, buildEdges, buildRepoMap, estimateTokens, identifie
|
|
|
2
2
|
export type { RepoMap, RepoMapOptions } from './repo-map.js';
|
|
3
3
|
export { isExported, isTestFile, nameWeight } from './repo-map.js';
|
|
4
4
|
export type { DefinitionFilter } from './repo-map.js';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/repomap/index.js
CHANGED
|
@@ -41,4 +41,3 @@ export declare function isExported(file: string, sym: CodeSymbol, line: string):
|
|
|
41
41
|
export declare function buildRepoMap(cwd: string, options?: RepoMapOptions): Promise<RepoMap>;
|
|
42
42
|
/** The block added to the system prompt. */
|
|
43
43
|
export declare function repoMapBlock(map: RepoMap): string;
|
|
44
|
-
//# sourceMappingURL=repo-map.d.ts.map
|
package/dist/repomap/repo-map.js
CHANGED
package/dist/semantic/chunker.js
CHANGED
|
@@ -26,10 +26,24 @@ export interface OpenAiCompatibleEmbedderOptions {
|
|
|
26
26
|
fetchImpl?: typeof fetch;
|
|
27
27
|
}
|
|
28
28
|
export declare function openAiCompatibleEmbedder(options: OpenAiCompatibleEmbedderOptions): Embedder;
|
|
29
|
+
export interface EmbedderSpec {
|
|
30
|
+
kind: 'hashing' | 'openai' | 'ollama' | 'custom';
|
|
31
|
+
model?: string;
|
|
32
|
+
/** For `custom`: an OpenAI-compatible `/embeddings` endpoint, up to and including `/v1`. */
|
|
33
|
+
baseUrl?: string;
|
|
34
|
+
/** For `custom`: the name of the environment variable holding the key (never the key itself). */
|
|
35
|
+
apiKeyEnv?: string;
|
|
36
|
+
batchSize?: number;
|
|
37
|
+
fetchImpl?: typeof fetch;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* An embedder from explicit settings. A choice that lacks what it needs (no key, no endpoint) gives the offline
|
|
41
|
+
* hashing embedder rather than an embedder that fails every search.
|
|
42
|
+
*/
|
|
43
|
+
export declare function buildEmbedder(spec: EmbedderSpec, env?: NodeJS.ProcessEnv): Embedder;
|
|
29
44
|
/**
|
|
30
45
|
* `FORGE_EMBED_PROVIDER` = `hashing` (default) | `openai` | `ollama`.
|
|
31
46
|
* `FORGE_EMBED_MODEL` overrides the model. Falls back to hashing when the
|
|
32
47
|
* chosen provider lacks what it needs (e.g. no OPENAI_API_KEY).
|
|
33
48
|
*/
|
|
34
49
|
export declare function embedderFromEnv(env?: NodeJS.ProcessEnv): Embedder;
|
|
35
|
-
//# sourceMappingURL=embedder.d.ts.map
|
|
@@ -85,6 +85,31 @@ export function openAiCompatibleEmbedder(options) {
|
|
|
85
85
|
},
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* An embedder from explicit settings. A choice that lacks what it needs (no key, no endpoint) gives the offline
|
|
90
|
+
* hashing embedder rather than an embedder that fails every search.
|
|
91
|
+
*/
|
|
92
|
+
export function buildEmbedder(spec, env = process.env) {
|
|
93
|
+
const common = { ...(spec.batchSize ? { batchSize: spec.batchSize } : {}), ...(spec.fetchImpl ? { fetchImpl: spec.fetchImpl } : {}) };
|
|
94
|
+
switch (spec.kind) {
|
|
95
|
+
case 'openai':
|
|
96
|
+
if (!env.OPENAI_API_KEY)
|
|
97
|
+
return hashingEmbedder();
|
|
98
|
+
return openAiCompatibleEmbedder({ baseUrl: env.OPENAI_BASE_URL ?? 'https://api.openai.com/v1', model: spec.model || 'text-embedding-3-small', apiKey: env.OPENAI_API_KEY, ...common });
|
|
99
|
+
case 'ollama': {
|
|
100
|
+
const host = (env.OLLAMA_BASE_URL ?? 'http://localhost:11434').replace(/\/+$/, '').replace(/\/v1$/, '');
|
|
101
|
+
return openAiCompatibleEmbedder({ baseUrl: `${host}/v1`, model: spec.model || 'nomic-embed-text', ...common });
|
|
102
|
+
}
|
|
103
|
+
case 'custom': {
|
|
104
|
+
if (!spec.baseUrl || !spec.model)
|
|
105
|
+
return hashingEmbedder();
|
|
106
|
+
const apiKey = spec.apiKeyEnv ? env[spec.apiKeyEnv] : undefined;
|
|
107
|
+
return openAiCompatibleEmbedder({ baseUrl: spec.baseUrl, model: spec.model, ...(apiKey ? { apiKey } : {}), ...common });
|
|
108
|
+
}
|
|
109
|
+
default:
|
|
110
|
+
return hashingEmbedder();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
88
113
|
/**
|
|
89
114
|
* `FORGE_EMBED_PROVIDER` = `hashing` (default) | `openai` | `ollama`.
|
|
90
115
|
* `FORGE_EMBED_MODEL` overrides the model. Falls back to hashing when the
|
|
@@ -105,4 +130,3 @@ export function embedderFromEnv(env = process.env) {
|
|
|
105
130
|
}
|
|
106
131
|
return hashingEmbedder();
|
|
107
132
|
}
|
|
108
|
-
//# sourceMappingURL=embedder.js.map
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { type Embedder } from './embedder.js';
|
|
2
2
|
import { type SemanticManifest } from './vector-store.js';
|
|
3
|
+
export interface SemanticOptions {
|
|
4
|
+
/** File extensions to index, with the dot. Default: the common source and Markdown ones. */
|
|
5
|
+
extensions?: readonly string[];
|
|
6
|
+
/** Hits scoring below this (cosine similarity) are left out. Default: none cut. */
|
|
7
|
+
minScore?: number;
|
|
8
|
+
}
|
|
9
|
+
/** `"ts, .py,md"` as `['.ts', '.py', '.md']`; undefined (use the defaults) when nothing usable is left. */
|
|
10
|
+
export declare function parseExtensions(text: string | undefined): string[] | undefined;
|
|
3
11
|
export interface SemanticHit {
|
|
4
12
|
path: string;
|
|
5
13
|
startLine: number;
|
|
@@ -8,6 +16,5 @@ export interface SemanticHit {
|
|
|
8
16
|
snippet: string;
|
|
9
17
|
}
|
|
10
18
|
/** Bring `.forge/index/embeddings.json` up to date: re-embed only changed files, drop deleted ones. */
|
|
11
|
-
export declare function ensureSemanticFresh(cwd: string, embedder: Embedder): Promise<SemanticManifest>;
|
|
12
|
-
export declare function searchSemantic(cwd: string, embedder: Embedder, query: string, k?: number): Promise<SemanticHit[]>;
|
|
13
|
-
//# sourceMappingURL=semantic-index.d.ts.map
|
|
19
|
+
export declare function ensureSemanticFresh(cwd: string, embedder: Embedder, options?: SemanticOptions): Promise<SemanticManifest>;
|
|
20
|
+
export declare function searchSemantic(cwd: string, embedder: Embedder, query: string, k?: number, options?: SemanticOptions): Promise<SemanticHit[]>;
|
|
@@ -7,9 +7,17 @@ import { chunkSource } from './chunker.js';
|
|
|
7
7
|
import { cosine } from './embedder.js';
|
|
8
8
|
import { decodeVector, encodeVector, loadSemanticManifest, saveSemanticManifest } from './vector-store.js';
|
|
9
9
|
const EXTENSIONS = new Set(['.ts', '.tsx', '.js', '.jsx', '.py', '.go', '.rs', '.java', '.md']);
|
|
10
|
+
/** `"ts, .py,md"` as `['.ts', '.py', '.md']`; undefined (use the defaults) when nothing usable is left. */
|
|
11
|
+
export function parseExtensions(text) {
|
|
12
|
+
const list = (text ?? '')
|
|
13
|
+
.split(',')
|
|
14
|
+
.map((e) => e.trim().toLowerCase().replace(/^\.?/, '.'))
|
|
15
|
+
.filter((e) => /^\.[a-z0-9]{1,12}$/.test(e));
|
|
16
|
+
return list.length ? [...new Set(list)] : undefined;
|
|
17
|
+
}
|
|
10
18
|
const MAX_FILE_BYTES = 512 * 1024;
|
|
11
19
|
const SNIPPET_LINES = 40;
|
|
12
|
-
async function collect(cwd) {
|
|
20
|
+
async function collect(cwd, extensions) {
|
|
13
21
|
const out = [];
|
|
14
22
|
const rules = IgnoreRules.forRoot(cwd);
|
|
15
23
|
async function walk(dir) {
|
|
@@ -29,7 +37,7 @@ async function collect(cwd) {
|
|
|
29
37
|
if (entry.isDirectory()) {
|
|
30
38
|
await walk(abs);
|
|
31
39
|
}
|
|
32
|
-
else if (entry.isFile() &&
|
|
40
|
+
else if (entry.isFile() && extensions.has(path.extname(entry.name).toLowerCase())) {
|
|
33
41
|
const s = await stat(abs);
|
|
34
42
|
if (s.size <= MAX_FILE_BYTES) {
|
|
35
43
|
out.push({ rel: path.relative(cwd, abs).split(path.sep).join('/'), abs, ext: path.extname(entry.name), mtimeMs: s.mtimeMs });
|
|
@@ -41,9 +49,9 @@ async function collect(cwd) {
|
|
|
41
49
|
return out;
|
|
42
50
|
}
|
|
43
51
|
/** Bring `.forge/index/embeddings.json` up to date: re-embed only changed files, drop deleted ones. */
|
|
44
|
-
export async function ensureSemanticFresh(cwd, embedder) {
|
|
52
|
+
export async function ensureSemanticFresh(cwd, embedder, options = {}) {
|
|
45
53
|
const manifest = await loadSemanticManifest(cwd, embedder.id);
|
|
46
|
-
const files = await collect(cwd);
|
|
54
|
+
const files = await collect(cwd, options.extensions ? new Set(options.extensions) : EXTENSIONS);
|
|
47
55
|
const seen = new Set(files.map((f) => f.rel));
|
|
48
56
|
let changed = false;
|
|
49
57
|
for (const f of files) {
|
|
@@ -68,8 +76,8 @@ export async function ensureSemanticFresh(cwd, embedder) {
|
|
|
68
76
|
await saveSemanticManifest(cwd, manifest);
|
|
69
77
|
return manifest;
|
|
70
78
|
}
|
|
71
|
-
export async function searchSemantic(cwd, embedder, query, k = 8) {
|
|
72
|
-
const manifest = await ensureSemanticFresh(cwd, embedder);
|
|
79
|
+
export async function searchSemantic(cwd, embedder, query, k = 8, options = {}) {
|
|
80
|
+
const manifest = await ensureSemanticFresh(cwd, embedder, options);
|
|
73
81
|
const [q] = await embedder.embed([query]);
|
|
74
82
|
if (!q)
|
|
75
83
|
return [];
|
|
@@ -80,7 +88,8 @@ export async function searchSemantic(cwd, embedder, query, k = 8) {
|
|
|
80
88
|
}
|
|
81
89
|
scored.sort((a, b) => b.score - a.score);
|
|
82
90
|
const hits = [];
|
|
83
|
-
|
|
91
|
+
const floor = options.minScore;
|
|
92
|
+
for (const top of scored.filter((c) => floor === undefined || c.score >= floor).slice(0, k)) {
|
|
84
93
|
let text;
|
|
85
94
|
try {
|
|
86
95
|
const lines = (await readFile(path.join(cwd, top.rel), 'utf8')).split(/\r?\n/);
|
|
@@ -93,4 +102,3 @@ export async function searchSemantic(cwd, embedder, query, k = 8) {
|
|
|
93
102
|
}
|
|
94
103
|
return hits;
|
|
95
104
|
}
|
|
96
|
-
//# sourceMappingURL=semantic-index.js.map
|
|
@@ -17,4 +17,3 @@ export declare function encodeVector(v: number[]): string;
|
|
|
17
17
|
export declare function decodeVector(s: string): number[];
|
|
18
18
|
export declare function loadSemanticManifest(cwd: string, embedderId: string): Promise<SemanticManifest>;
|
|
19
19
|
export declare function saveSemanticManifest(cwd: string, manifest: SemanticManifest): Promise<void>;
|
|
20
|
-
//# sourceMappingURL=vector-store.d.ts.map
|
package/dist/sessions/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { defaultSessionDir, generateSessionId, saveSession, loadSession, deleteSession, listSessions, findLatestSession, } from './session-store.js';
|
|
2
2
|
export type { Session, ListEntry } from './session-store.js';
|
|
3
|
+
export { pruneByRetention, pruneSessions, type SessionPruneOptions, type SessionPruneResult } from './prune.js';
|
|
3
4
|
export { formatSessionMarkdown, formatSessionJson, type FormatOptions } from './session-export.js';
|
|
4
5
|
export { appendedSince, summarizeMessage, watchSession } from './watch.js';
|
|
5
6
|
export type { SessionUpdate, WatchSessionOptions } from './watch.js';
|
|
6
7
|
export { searchSessions, sessionText, type SessionMatch, type SearchSessionsOptions } from './search.js';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/sessions/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { defaultSessionDir, generateSessionId, saveSession, loadSession, deleteSession, listSessions, findLatestSession, } from './session-store.js';
|
|
2
|
+
export { pruneByRetention, pruneSessions } from './prune.js';
|
|
2
3
|
export { formatSessionMarkdown, formatSessionJson } from './session-export.js';
|
|
3
4
|
export { appendedSince, summarizeMessage, watchSession } from './watch.js';
|
|
4
5
|
export { searchSessions, sessionText } from './search.js';
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface SessionPruneOptions {
|
|
2
|
+
/** Delete sessions last updated more than this many days ago. */
|
|
3
|
+
olderThanDays: number;
|
|
4
|
+
/** Session ids never to delete, such as the one that is open right now. */
|
|
5
|
+
keepIds?: readonly string[];
|
|
6
|
+
/** Report what would be deleted without deleting it. */
|
|
7
|
+
dryRun?: boolean;
|
|
8
|
+
/** The clock; tests pass a fixed date. */
|
|
9
|
+
now?: Date;
|
|
10
|
+
}
|
|
11
|
+
export interface SessionPruneResult {
|
|
12
|
+
/** Ids deleted (or, in a dry run, that would be). */
|
|
13
|
+
deleted: string[];
|
|
14
|
+
/** Sessions left in place. */
|
|
15
|
+
kept: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Prune by the `sessionRetentionDays` setting. Returns undefined, touching nothing, unless it is a
|
|
19
|
+
* positive number: unset means "keep everything".
|
|
20
|
+
*/
|
|
21
|
+
export declare function pruneByRetention(dir: string, retentionDays: number | undefined, opts?: Pick<SessionPruneOptions, 'keepIds' | 'now'>): Promise<SessionPruneResult | undefined>;
|
|
22
|
+
/** Delete saved sessions that have not been touched for `olderThanDays` days. Files that are not valid sessions are never touched. */
|
|
23
|
+
export declare function pruneSessions(dir: string, opts: SessionPruneOptions): Promise<SessionPruneResult>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { deleteSession, listSessions } from './session-store.js';
|
|
3
|
+
/**
|
|
4
|
+
* Prune by the `sessionRetentionDays` setting. Returns undefined, touching nothing, unless it is a
|
|
5
|
+
* positive number: unset means "keep everything".
|
|
6
|
+
*/
|
|
7
|
+
export async function pruneByRetention(dir, retentionDays, opts = {}) {
|
|
8
|
+
if (retentionDays === undefined || !Number.isFinite(retentionDays) || retentionDays <= 0)
|
|
9
|
+
return undefined;
|
|
10
|
+
return pruneSessions(dir, { ...opts, olderThanDays: retentionDays });
|
|
11
|
+
}
|
|
12
|
+
/** Delete saved sessions that have not been touched for `olderThanDays` days. Files that are not valid sessions are never touched. */
|
|
13
|
+
export async function pruneSessions(dir, opts) {
|
|
14
|
+
if (!Number.isFinite(opts.olderThanDays) || opts.olderThanDays <= 0) {
|
|
15
|
+
throw new Error(`pruneSessions: olderThanDays must be a positive number, got ${opts.olderThanDays}`);
|
|
16
|
+
}
|
|
17
|
+
if (!existsSync(dir))
|
|
18
|
+
return { deleted: [], kept: 0 };
|
|
19
|
+
const cutoff = (opts.now ?? new Date()).getTime() - opts.olderThanDays * 86_400_000;
|
|
20
|
+
const keep = new Set(opts.keepIds ?? []);
|
|
21
|
+
const deleted = [];
|
|
22
|
+
let kept = 0;
|
|
23
|
+
for (const entry of await listSessions(dir)) {
|
|
24
|
+
const updated = Date.parse(entry.updatedAt);
|
|
25
|
+
const stale = Number.isFinite(updated) && updated < cutoff;
|
|
26
|
+
if (!stale || keep.has(entry.id)) {
|
|
27
|
+
kept++;
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
if (!opts.dryRun)
|
|
31
|
+
await deleteSession(entry.id, dir);
|
|
32
|
+
deleted.push(entry.id);
|
|
33
|
+
}
|
|
34
|
+
return { deleted, kept };
|
|
35
|
+
}
|
|
@@ -20,4 +20,3 @@ export interface SearchSessionsOptions {
|
|
|
20
20
|
export declare function sessionText(messages: readonly unknown[]): string;
|
|
21
21
|
export declare function snippetAround(text: string, at: number, width?: number): string;
|
|
22
22
|
export declare function searchSessions(dir: string, query: string, options?: SearchSessionsOptions): Promise<SessionMatch[]>;
|
|
23
|
-
//# sourceMappingURL=search.d.ts.map
|
package/dist/sessions/search.js
CHANGED
|
@@ -62,4 +62,3 @@ export declare function deleteSession(id: string, dir: string): Promise<void>;
|
|
|
62
62
|
export declare function listSessions(dir: string): Promise<ListEntry[]>;
|
|
63
63
|
/** Most-recent session, or null if there are none. */
|
|
64
64
|
export declare function findLatestSession(dir: string): Promise<ListEntry | null>;
|
|
65
|
-
//# sourceMappingURL=session-store.d.ts.map
|
|
@@ -155,7 +155,8 @@ function extractPreview(messages) {
|
|
|
155
155
|
if (!firstUser)
|
|
156
156
|
return undefined;
|
|
157
157
|
const rawText = typeof firstUser.content === 'string' ? firstUser.content : extractText(firstUser.content);
|
|
158
|
-
|
|
158
|
+
// The `<context ...>` blocks an @mention appends are attachments, not the user's words.
|
|
159
|
+
const text = rawText === undefined ? undefined : stripSteering(rawText).replace(/\n\n<context [^>]*>[\s\S]*?<\/context>/g, '');
|
|
159
160
|
if (!text)
|
|
160
161
|
return undefined;
|
|
161
162
|
const oneLine = text.replace(/\s+/g, ' ').trim();
|
|
@@ -180,4 +181,3 @@ async function rename(from, to) {
|
|
|
180
181
|
// Suppress unused-import warning on rare Node versions.
|
|
181
182
|
void mkdtemp;
|
|
182
183
|
void rm;
|
|
183
|
-
//# sourceMappingURL=session-store.js.map
|
package/dist/sessions/watch.d.ts
CHANGED
|
@@ -26,4 +26,3 @@ export declare function watchSession(id: string, dir: string, onUpdate: (update:
|
|
|
26
26
|
export declare function appendedSince(prev: ModelMessage[], next: ModelMessage[]): ModelMessage[] | null;
|
|
27
27
|
/** One short line per message part, for live tails. */
|
|
28
28
|
export declare function summarizeMessage(message: ModelMessage, maxChars?: number): string[];
|
|
29
|
-
//# sourceMappingURL=watch.d.ts.map
|
package/dist/sessions/watch.js
CHANGED