@ikarmic/forge-core 4.4.0 → 5.0.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 +2 -2
- package/dist/agent/agent.d.ts +0 -1
- package/dist/agent/agent.js +84 -32
- package/dist/agent/architect.d.ts +3 -1
- package/dist/agent/architect.js +1 -1
- 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 +2 -1
- package/dist/agent/enhance-prompt.d.ts +7 -0
- package/dist/agent/enhance-prompt.js +30 -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/ai-comments/index.d.ts +0 -1
- package/dist/ai-comments/index.js +0 -1
- package/dist/attachments.d.ts +46 -0
- package/dist/attachments.js +178 -0
- 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 +0 -1
- 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 +4 -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 +24 -0
- package/dist/commands/custom-commands.js +98 -0
- package/dist/config-file.d.ts +4 -1
- package/dist/config-file.js +0 -1
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -1
- package/dist/context/compaction.d.ts +0 -1
- package/dist/context/compaction.js +17 -3
- 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/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 +42 -16
- package/dist/git/auto-commit.d.ts +1 -2
- package/dist/git/auto-commit.js +17 -5
- package/dist/git/index.d.ts +0 -1
- package/dist/git/index.js +0 -1
- package/dist/github/github-tools.d.ts +83 -0
- package/dist/github/github-tools.js +175 -0
- 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 +0 -1
- 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/index.d.ts +21 -9
- package/dist/index.js +16 -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 +0 -1
- package/dist/lsp/client.js +0 -1
- 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 +0 -1
- package/dist/mcp/index.js +0 -1
- 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 +0 -1
- package/dist/mcp/manager.js +0 -1
- package/dist/mcp/marketplace-types.d.ts +0 -1
- package/dist/mcp/marketplace-types.js +0 -1
- package/dist/mcp/marketplace.d.ts +0 -1
- package/dist/mcp/marketplace.js +0 -1
- package/dist/mcp/mcp-client.d.ts +0 -1
- package/dist/mcp/mcp-client.js +0 -1
- package/dist/mcp/mcp-config.d.ts +0 -1
- package/dist/mcp/mcp-config.js +0 -1
- package/dist/mcp/registry.d.ts +0 -1
- package/dist/mcp/registry.js +0 -1
- package/dist/memory/memory-store.d.ts +57 -11
- package/dist/memory/memory-store.js +236 -70
- package/dist/memory/rank.d.ts +20 -0
- package/dist/memory/rank.js +64 -0
- package/dist/memory/stale.d.ts +18 -0
- package/dist/memory/stale.js +45 -0
- package/dist/model-alias.d.ts +0 -1
- package/dist/model-alias.js +0 -1
- package/dist/model-catalog.d.ts +0 -1
- package/dist/model-catalog.js +0 -1
- package/dist/model-list.d.ts +0 -1
- package/dist/model-list.js +0 -1
- 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 +0 -1
- package/dist/orchestrator/specialists.d.ts +0 -1
- package/dist/orchestrator/specialists.js +5 -6
- 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/policy.d.ts +0 -1
- package/dist/policy/policy.js +0 -1
- package/dist/policy/proxy.d.ts +0 -1
- package/dist/policy/proxy.js +0 -1
- package/dist/pricing.d.ts +0 -1
- package/dist/pricing.js +0 -1
- package/dist/providers.d.ts +0 -1
- package/dist/providers.js +0 -1
- 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 +0 -1
- package/dist/semantic/embedder.js +0 -1
- package/dist/semantic/semantic-index.d.ts +0 -1
- package/dist/semantic/semantic-index.js +4 -1
- package/dist/semantic/vector-store.d.ts +0 -1
- package/dist/semantic/vector-store.js +0 -1
- package/dist/sessions/index.d.ts +2 -1
- package/dist/sessions/index.js +2 -1
- package/dist/sessions/prune.d.ts +23 -0
- package/dist/sessions/prune.js +35 -0
- package/dist/sessions/search.d.ts +22 -0
- package/dist/sessions/search.js +66 -0
- 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 +0 -1
- 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/index.d.ts +0 -1
- package/dist/skills/index.js +0 -1
- package/dist/skills/loader.d.ts +0 -1
- package/dist/skills/loader.js +0 -1
- 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 +0 -1
- package/dist/skills/parser.d.ts +0 -1
- package/dist/skills/parser.js +0 -1
- package/dist/skills/types.d.ts +0 -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 +2 -1
- package/dist/specs/index.js +1 -1
- package/dist/specs/store.d.ts +7 -1
- package/dist/specs/store.js +33 -1
- package/dist/specs/sync.d.ts +29 -0
- package/dist/specs/sync.js +155 -0
- package/dist/specs/tasks-parser.d.ts +0 -1
- package/dist/specs/tasks-parser.js +0 -1
- package/dist/specs/types.d.ts +2 -1
- package/dist/specs/types.js +0 -1
- 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 +0 -1
- 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/tools/browser-tools.d.ts +0 -1
- package/dist/tools/browser-tools.js +0 -1
- package/dist/tools/codebase-search.d.ts +0 -1
- package/dist/tools/codebase-search.js +0 -1
- 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 +0 -1
- package/dist/tools/fetch-url.d.ts +0 -1
- package/dist/tools/fetch-url.js +0 -1
- package/dist/tools/find-references.d.ts +0 -1
- package/dist/tools/find-references.js +0 -1
- package/dist/tools/find-symbol.d.ts +0 -1
- package/dist/tools/find-symbol.js +0 -1
- package/dist/tools/ignore-rules.d.ts +15 -0
- package/dist/tools/ignore-rules.js +84 -0
- package/dist/tools/index.d.ts +3 -3
- package/dist/tools/index.js +5 -3
- package/dist/tools/list-files.d.ts +3 -1
- package/dist/tools/list-files.js +8 -1
- package/dist/tools/list-symbols.d.ts +0 -1
- package/dist/tools/list-symbols.js +0 -1
- package/dist/tools/memory.d.ts +34 -2
- package/dist/tools/memory.js +118 -26
- package/dist/tools/notebook.d.ts +69 -0
- package/dist/tools/notebook.js +163 -0
- package/dist/tools/policy.d.ts +0 -1
- package/dist/tools/policy.js +0 -1
- package/dist/tools/read-file.d.ts +8 -2
- package/dist/tools/read-file.js +19 -2
- package/dist/tools/read-image.d.ts +0 -1
- package/dist/tools/read-image.js +0 -1
- package/dist/tools/read-only.d.ts +0 -1
- package/dist/tools/read-only.js +0 -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 +0 -1
- package/dist/tools/run-command.js +0 -1
- package/dist/tools/sandbox-loader.d.ts +0 -1
- package/dist/tools/sandbox-loader.js +0 -1
- package/dist/tools/search-files.d.ts +5 -3
- package/dist/tools/search-files.js +8 -1
- package/dist/tools/shared.d.ts +0 -1
- package/dist/tools/shared.js +0 -1
- package/dist/tools/sub-agent.d.ts +0 -1
- package/dist/tools/sub-agent.js +0 -1
- package/dist/tools/web-search.d.ts +55 -0
- package/dist/tools/web-search.js +131 -0
- package/dist/tools/write-file.d.ts +0 -1
- package/dist/tools/write-file.js +0 -1
- package/dist/types.d.ts +43 -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 +0 -1
- package/dist/worktree/worktree.js +0 -1
- package/package.json +4 -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/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/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/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/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/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/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/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/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/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
package/dist/specs/store.d.ts
CHANGED
|
@@ -23,6 +23,13 @@ export declare class SpecStore {
|
|
|
23
23
|
get(id: string): Promise<SpecSummary | null>;
|
|
24
24
|
/** List every approved spec, oldest first. */
|
|
25
25
|
list(): Promise<SpecSummary[]>;
|
|
26
|
+
/** The three documents of an approved spec, or null when it doesn't exist. */
|
|
27
|
+
readDocs(id: string): Promise<SpecSections | null>;
|
|
28
|
+
/**
|
|
29
|
+
* Replace an approved spec's documents (a re-sync with the code). The previous versions
|
|
30
|
+
* are kept in `<dir>/history/<timestamp>/`, and the manifest records `syncedAt`.
|
|
31
|
+
*/
|
|
32
|
+
update(id: string, sections: SpecSections, now?: Date): Promise<SpecSummary>;
|
|
26
33
|
/** Delete an approved spec's directory. Returns false when it didn't exist. */
|
|
27
34
|
delete(id: string): Promise<boolean>;
|
|
28
35
|
private draftDir;
|
|
@@ -44,4 +51,3 @@ export declare class SpecStore {
|
|
|
44
51
|
* all (e.g. `"!!!"`).
|
|
45
52
|
*/
|
|
46
53
|
export declare function slugifyTaskForSpecId(task: string): string;
|
|
47
|
-
//# sourceMappingURL=store.d.ts.map
|
package/dist/specs/store.js
CHANGED
|
@@ -14,6 +14,7 @@ import { convertToCheckboxes } from './tasks-parser.js';
|
|
|
14
14
|
const MANIFEST_FILENAME = 'manifest.json';
|
|
15
15
|
const DRAFT_FILENAME = 'draft.json';
|
|
16
16
|
const RUNS_FILENAME = 'runs.json';
|
|
17
|
+
const HISTORY_DIR = 'history';
|
|
17
18
|
const DRAFTS_DIR = '.drafts';
|
|
18
19
|
const MAX_RUNS_PER_TASK = 20;
|
|
19
20
|
const SAFE_ID = /^[a-z0-9][a-z0-9._-]*$/i;
|
|
@@ -88,6 +89,38 @@ export class SpecStore {
|
|
|
88
89
|
}
|
|
89
90
|
return out.sort((a, b) => a.approvedAt.localeCompare(b.approvedAt));
|
|
90
91
|
}
|
|
92
|
+
/** The three documents of an approved spec, or null when it doesn't exist. */
|
|
93
|
+
async readDocs(id) {
|
|
94
|
+
const spec = await this.get(id);
|
|
95
|
+
if (!spec)
|
|
96
|
+
return null;
|
|
97
|
+
const read = (f) => readFile(path.join(spec.dir, f), 'utf8').catch(() => '');
|
|
98
|
+
return { requirements: await read('requirements.md'), design: await read('design.md'), tasks: await read('tasks.md') };
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Replace an approved spec's documents (a re-sync with the code). The previous versions
|
|
102
|
+
* are kept in `<dir>/history/<timestamp>/`, and the manifest records `syncedAt`.
|
|
103
|
+
*/
|
|
104
|
+
async update(id, sections, now = new Date()) {
|
|
105
|
+
assertSafeSpecId(id);
|
|
106
|
+
const spec = await this.get(id);
|
|
107
|
+
if (!spec)
|
|
108
|
+
throw new Error(`no spec ${id}`);
|
|
109
|
+
const stamp = now.toISOString().replace(/[:.]/g, '-');
|
|
110
|
+
const backup = path.join(spec.dir, HISTORY_DIR, stamp);
|
|
111
|
+
await mkdir(backup, { recursive: true });
|
|
112
|
+
for (const f of ['requirements.md', 'design.md', 'tasks.md']) {
|
|
113
|
+
const from = path.join(spec.dir, f);
|
|
114
|
+
if (existsSync(from))
|
|
115
|
+
await writeFile(path.join(backup, f), await readFile(from, 'utf8'), 'utf8');
|
|
116
|
+
}
|
|
117
|
+
await writeFile(path.join(spec.dir, 'requirements.md'), sections.requirements, 'utf8');
|
|
118
|
+
await writeFile(path.join(spec.dir, 'design.md'), sections.design, 'utf8');
|
|
119
|
+
await writeFile(path.join(spec.dir, 'tasks.md'), sections.tasks, 'utf8');
|
|
120
|
+
const updated = { ...spec, syncedAt: now.toISOString() };
|
|
121
|
+
await writeFile(path.join(spec.dir, MANIFEST_FILENAME), JSON.stringify(updated, null, 2), 'utf8');
|
|
122
|
+
return updated;
|
|
123
|
+
}
|
|
91
124
|
/** Delete an approved spec's directory. Returns false when it didn't exist. */
|
|
92
125
|
async delete(id) {
|
|
93
126
|
if (!isSafeSpecId(id))
|
|
@@ -222,4 +255,3 @@ export function slugifyTaskForSpecId(task) {
|
|
|
222
255
|
const suffix = Math.random().toString(36).slice(2, 8);
|
|
223
256
|
return `${slug}-${suffix}`;
|
|
224
257
|
}
|
|
225
|
-
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { SpecSections, SpecSummary } from './types.js';
|
|
2
|
+
export interface SpecDrift {
|
|
3
|
+
/** Paths the documents mention (in backticks) that no longer exist. */
|
|
4
|
+
missingPaths: string[];
|
|
5
|
+
/** Files changed since the spec was approved or last synced (committed or not), workspace-relative. */
|
|
6
|
+
changedFiles: string[];
|
|
7
|
+
tasks: {
|
|
8
|
+
done: number;
|
|
9
|
+
total: number;
|
|
10
|
+
};
|
|
11
|
+
/** When the comparison starts: the last sync, else approval. */
|
|
12
|
+
since: string;
|
|
13
|
+
}
|
|
14
|
+
/** Backticked tokens that look like file paths: a slash or a file extension, no spaces. */
|
|
15
|
+
export declare function referencedPaths(markdown: string): string[];
|
|
16
|
+
/** Files changed since `iso` (commits after it plus uncommitted work), or [] outside a git repo. */
|
|
17
|
+
export declare function changedSince(cwd: string, iso: string): Promise<string[]>;
|
|
18
|
+
export declare function specDrift(cwd: string, spec: Pick<SpecSummary, 'approvedAt'> & {
|
|
19
|
+
syncedAt?: string;
|
|
20
|
+
}, docs: SpecSections): Promise<SpecDrift>;
|
|
21
|
+
/** The task for a spec-mode run that brings the documents up to date with the code. */
|
|
22
|
+
export declare function syncSpecTask(spec: Pick<SpecSummary, 'id' | 'task'>, docs: SpecSections, drift: SpecDrift): string;
|
|
23
|
+
/** Re-tick tasks (matched by their written number, else their title) that were done before the sync. */
|
|
24
|
+
export declare function keepDoneTasks(before: string, after: string): string;
|
|
25
|
+
/** Line counts added and removed between two texts (a rough size of the change, not a diff). */
|
|
26
|
+
export declare function changeSize(before: string, after: string): {
|
|
27
|
+
added: number;
|
|
28
|
+
removed: number;
|
|
29
|
+
};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-sync an approved spec with the code. The code moves on after a spec is approved
|
|
3
|
+
* (tasks done by hand, files renamed, designs changed mid-way), so the documents drift.
|
|
4
|
+
*
|
|
5
|
+
* - {@link specDrift} measures it without a model: paths the docs mention that are
|
|
6
|
+
* gone, files changed since the spec was approved (or last synced), task progress.
|
|
7
|
+
* - {@link syncSpecTask} is the task for a read-only spec-mode run that rewrites the
|
|
8
|
+
* three documents to describe the code as it is now.
|
|
9
|
+
* - {@link keepDoneTasks} makes sure a re-sync never un-ticks a task the user finished.
|
|
10
|
+
*
|
|
11
|
+
* The caller shows the change and writes it with `SpecStore.update` (which keeps the
|
|
12
|
+
* previous version in `history/`).
|
|
13
|
+
*/
|
|
14
|
+
import { execFile } from 'node:child_process';
|
|
15
|
+
import { existsSync } from 'node:fs';
|
|
16
|
+
import path from 'node:path';
|
|
17
|
+
import { promisify } from 'node:util';
|
|
18
|
+
import { parseTasks, setTaskDone } from './tasks-parser.js';
|
|
19
|
+
const execFileAsync = promisify(execFile);
|
|
20
|
+
/** Backticked tokens that look like file paths: a slash or a file extension, no spaces. */
|
|
21
|
+
export function referencedPaths(markdown) {
|
|
22
|
+
const out = new Set();
|
|
23
|
+
for (const m of markdown.matchAll(/`([^`\s]+)`/g)) {
|
|
24
|
+
let p = m[1].replace(/[:#].*$/, '').replace(/[),.;]+$/, '');
|
|
25
|
+
if (p.startsWith('./'))
|
|
26
|
+
p = p.slice(2);
|
|
27
|
+
if (!p || /^[a-z]+:\/\//i.test(p) || p.startsWith('-') || p.startsWith('@'))
|
|
28
|
+
continue;
|
|
29
|
+
const looksLikePath = (p.includes('/') && /[A-Za-z0-9_]/.test(p)) || /^[\w.-]+\.[A-Za-z][A-Za-z0-9]{0,5}$/.test(p);
|
|
30
|
+
// Globs, placeholders and versions are not paths.
|
|
31
|
+
if (!looksLikePath || /[*?{}<>$]/.test(p) || /^\d+(\.\d+)+$/.test(p))
|
|
32
|
+
continue;
|
|
33
|
+
out.add(p);
|
|
34
|
+
}
|
|
35
|
+
return [...out].sort();
|
|
36
|
+
}
|
|
37
|
+
async function git(cwd, args) {
|
|
38
|
+
const { stdout } = await execFileAsync('git', args, { cwd, timeout: 20_000, maxBuffer: 16 * 1024 * 1024 });
|
|
39
|
+
return stdout;
|
|
40
|
+
}
|
|
41
|
+
/** Files changed since `iso` (commits after it plus uncommitted work), or [] outside a git repo. */
|
|
42
|
+
export async function changedSince(cwd, iso) {
|
|
43
|
+
const files = new Set();
|
|
44
|
+
try {
|
|
45
|
+
const log = await git(cwd, ['log', `--since=${iso}`, '--name-only', '--pretty=format:']);
|
|
46
|
+
for (const f of log.split('\n'))
|
|
47
|
+
if (f.trim())
|
|
48
|
+
files.add(f.trim());
|
|
49
|
+
const status = await git(cwd, ['status', '--porcelain', '--untracked-files=all']);
|
|
50
|
+
for (const line of status.split('\n')) {
|
|
51
|
+
const f = line.slice(3).trim();
|
|
52
|
+
if (!f)
|
|
53
|
+
continue;
|
|
54
|
+
files.add(f.includes(' -> ') ? f.split(' -> ')[1] : f);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
// The spec's own files are not code drift.
|
|
61
|
+
return [...files].filter((f) => !f.startsWith('.forge/')).sort();
|
|
62
|
+
}
|
|
63
|
+
export async function specDrift(cwd, spec, docs) {
|
|
64
|
+
const since = spec.syncedAt ?? spec.approvedAt;
|
|
65
|
+
const mentioned = referencedPaths(`${docs.requirements}\n${docs.design}\n${docs.tasks}`);
|
|
66
|
+
const tasks = parseTasks(docs.tasks);
|
|
67
|
+
return {
|
|
68
|
+
missingPaths: mentioned.filter((p) => !existsSync(path.join(cwd, p))),
|
|
69
|
+
changedFiles: await changedSince(cwd, since),
|
|
70
|
+
tasks: { done: tasks.filter((t) => t.done).length, total: tasks.length },
|
|
71
|
+
since,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const LIST_MAX = 80;
|
|
75
|
+
function list(items) {
|
|
76
|
+
if (items.length === 0)
|
|
77
|
+
return '(none)';
|
|
78
|
+
const shown = items.slice(0, LIST_MAX).map((i) => `- ${i}`);
|
|
79
|
+
if (items.length > LIST_MAX)
|
|
80
|
+
shown.push(`- … and ${items.length - LIST_MAX} more`);
|
|
81
|
+
return shown.join('\n');
|
|
82
|
+
}
|
|
83
|
+
/** The task for a spec-mode run that brings the documents up to date with the code. */
|
|
84
|
+
export function syncSpecTask(spec, docs, drift) {
|
|
85
|
+
return `Bring the spec "${spec.id}" up to date with the code as it is now. It was written for: ${spec.task}
|
|
86
|
+
|
|
87
|
+
Read the code (start with the changed files below) and rewrite the three documents so they describe what is actually built and what is still left to do:
|
|
88
|
+
- requirements.md: keep every requirement and its number; change one only where the code deliberately does something else, and say so in the requirement.
|
|
89
|
+
- design.md: describe the real modules, files, data shapes and flows. Fix paths and names that changed; drop parts that were not built and are no longer planned.
|
|
90
|
+
- tasks.md: keep the checklist format (- [ ] / - [x]) and the task numbers. Tick a task when the code clearly does it. Never untick a ticked task. Add new unticked tasks, numbered after the last one, for work the code still needs to meet the requirements.
|
|
91
|
+
|
|
92
|
+
Do not change any code. Reply with the three updated documents in the usual format.
|
|
93
|
+
|
|
94
|
+
Since ${drift.since}:
|
|
95
|
+
Changed files:
|
|
96
|
+
${list(drift.changedFiles)}
|
|
97
|
+
|
|
98
|
+
Paths the documents mention that no longer exist:
|
|
99
|
+
${list(drift.missingPaths)}
|
|
100
|
+
|
|
101
|
+
Task progress: ${drift.tasks.done} of ${drift.tasks.total} ticked.
|
|
102
|
+
|
|
103
|
+
<current-requirements.md>
|
|
104
|
+
${docs.requirements}
|
|
105
|
+
</current-requirements.md>
|
|
106
|
+
|
|
107
|
+
<current-design.md>
|
|
108
|
+
${docs.design}
|
|
109
|
+
</current-design.md>
|
|
110
|
+
|
|
111
|
+
<current-tasks.md>
|
|
112
|
+
${docs.tasks}
|
|
113
|
+
</current-tasks.md>`;
|
|
114
|
+
}
|
|
115
|
+
const NUMBER = /^(\d+(?:\.\d+)*)[.)]?\s+/;
|
|
116
|
+
/** A task's written number (`2.1`), or null: parseTasks falls back to its position, which moves. */
|
|
117
|
+
function writtenNumber(title) {
|
|
118
|
+
return NUMBER.exec(title)?.[1] ?? null;
|
|
119
|
+
}
|
|
120
|
+
function bareTitle(title) {
|
|
121
|
+
return title.replace(NUMBER, '').trim().toLowerCase();
|
|
122
|
+
}
|
|
123
|
+
/** Re-tick tasks (matched by their written number, else their title) that were done before the sync. */
|
|
124
|
+
export function keepDoneTasks(before, after) {
|
|
125
|
+
const doneBefore = parseTasks(before).filter((t) => t.done);
|
|
126
|
+
if (doneBefore.length === 0)
|
|
127
|
+
return after;
|
|
128
|
+
const numbers = new Set(doneBefore.map((t) => writtenNumber(t.title)).filter((n) => n !== null));
|
|
129
|
+
const titles = new Set(doneBefore.map((t) => bareTitle(t.title)));
|
|
130
|
+
let md = after;
|
|
131
|
+
for (const task of parseTasks(after)) {
|
|
132
|
+
if (task.done)
|
|
133
|
+
continue;
|
|
134
|
+
const n = writtenNumber(task.title);
|
|
135
|
+
if (!(n !== null && numbers.has(n)) && !titles.has(bareTitle(task.title)))
|
|
136
|
+
continue;
|
|
137
|
+
const r = setTaskDone(md, task, true);
|
|
138
|
+
if (r.ok)
|
|
139
|
+
md = r.md;
|
|
140
|
+
}
|
|
141
|
+
return md;
|
|
142
|
+
}
|
|
143
|
+
/** Line counts added and removed between two texts (a rough size of the change, not a diff). */
|
|
144
|
+
export function changeSize(before, after) {
|
|
145
|
+
const count = (lines) => lines.reduce((m, l) => m.set(l, (m.get(l) ?? 0) + 1), new Map());
|
|
146
|
+
const a = count(before.split('\n'));
|
|
147
|
+
const b = count(after.split('\n'));
|
|
148
|
+
let added = 0;
|
|
149
|
+
let removed = 0;
|
|
150
|
+
for (const [line, n] of b)
|
|
151
|
+
added += Math.max(0, n - (a.get(line) ?? 0));
|
|
152
|
+
for (const [line, n] of a)
|
|
153
|
+
removed += Math.max(0, n - (b.get(line) ?? 0));
|
|
154
|
+
return { added, removed };
|
|
155
|
+
}
|
package/dist/specs/types.d.ts
CHANGED
|
@@ -36,7 +36,8 @@ export interface SpecSummary {
|
|
|
36
36
|
id: string;
|
|
37
37
|
task: string;
|
|
38
38
|
approvedAt: string;
|
|
39
|
+
/** When the documents were last re-synced with the code (`SpecStore.update`). */
|
|
40
|
+
syncedAt?: string;
|
|
39
41
|
/** Absolute path to `.forge/specs/<id>/`. */
|
|
40
42
|
dir: string;
|
|
41
43
|
}
|
|
42
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/specs/types.js
CHANGED
package/dist/steering/glob.d.ts
CHANGED
package/dist/steering/glob.js
CHANGED
package/dist/steering/index.d.ts
CHANGED
|
@@ -4,4 +4,3 @@ export { isSafeSteeringName, loadSteering, overrideFilePath, parseSteering, read
|
|
|
4
4
|
export { MAX_TOOL_INJECTIONS, START_BUDGET_BYTES, TOOL_DOC_BYTES, formatSteeringLine, selectAtStart, selectOnToolTouch, stripSteering, toWorkspaceRelative, wrapSteering, } from './select.js';
|
|
5
5
|
export type { StartSelection } from './select.js';
|
|
6
6
|
export type { SteeringConfig, SteeringDoc, SteeringInclusion, SteeringLoadResult, SteeringSkip } from './types.js';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/steering/index.js
CHANGED
|
@@ -2,4 +2,3 @@
|
|
|
2
2
|
export { pathMatchesGlob } from './glob.js';
|
|
3
3
|
export { isSafeSteeringName, loadSteering, overrideFilePath, parseSteering, readOverride, setSteeringDisabled, } from './loader.js';
|
|
4
4
|
export { MAX_TOOL_INJECTIONS, START_BUDGET_BYTES, TOOL_DOC_BYTES, formatSteeringLine, selectAtStart, selectOnToolTouch, stripSteering, toWorkspaceRelative, wrapSteering, } from './select.js';
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
package/dist/steering/loader.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export declare const PROJECT_INSTRUCTION_FILES: readonly ["AGENTS.md", "CLAUDE.md", "CONVENTIONS.md"];
|
|
2
2
|
export declare const MAX_INSTRUCTION_BYTES = 16000;
|
|
3
3
|
export declare function buildProjectInstructionsBlock(cwd: string): Promise<string>;
|
|
4
|
-
//# sourceMappingURL=project-instructions.d.ts.map
|
package/dist/steering/select.js
CHANGED
package/dist/steering/types.d.ts
CHANGED
package/dist/steering/types.js
CHANGED
|
@@ -16,4 +16,3 @@ export type { ZodTypeAny } from 'zod';
|
|
|
16
16
|
export { formatZodError, jsonSchemaToZod, loadSchemaFile, } from './schema.js';
|
|
17
17
|
export { defaultRetryPrompt, isStructuredOutputError, runStructuredAgent, StructuredOutputError, validateFinalText, } from './retry.js';
|
|
18
18
|
export type { StructuredRunOptions, StructuredRunResult } from './retry.js';
|
|
19
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/structured/index.js
CHANGED
package/dist/structured/retry.js
CHANGED
|
@@ -9,4 +9,3 @@ export declare function isAlwaysAllowable(command: string, hasCwd?: boolean): bo
|
|
|
9
9
|
export declare function needsScriptFingerprint(command: string): boolean;
|
|
10
10
|
/** Whether a `run_command` call's arguments name one of `allowed` exactly, without a working-directory override. */
|
|
11
11
|
export declare function isListedCommand(args: unknown, allowed: readonly string[]): boolean;
|
|
12
|
-
//# sourceMappingURL=command-allow.d.ts.map
|
package/dist/tools/edit-file.js
CHANGED
package/dist/tools/fetch-url.js
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Files read in every directory, in this order. `.forgeignore` is for paths only the agent should skip. */
|
|
2
|
+
export declare const IGNORE_FILE_NAMES: readonly [".gitignore", ".forgeignore"];
|
|
3
|
+
/** The closest ancestor of `dir` (itself included) that holds a `.git` entry, or null. */
|
|
4
|
+
export declare function findGitRoot(dir: string): string | null;
|
|
5
|
+
export declare class IgnoreRules {
|
|
6
|
+
private readonly top;
|
|
7
|
+
private readonly cache;
|
|
8
|
+
/** `top` is where rule lookup starts: the git root, or the walked directory outside a repository. */
|
|
9
|
+
private constructor();
|
|
10
|
+
/** Rules for walking anywhere under `cwd`. */
|
|
11
|
+
static forRoot(cwd: string): IgnoreRules;
|
|
12
|
+
private rulesIn;
|
|
13
|
+
/** Whether `absPath` is ignored. Paths outside the rule root are never ignored here. */
|
|
14
|
+
isIgnored(absPath: string, isDir: boolean): boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git-style ignore rules for walking the workspace: `.gitignore` and `.forgeignore`
|
|
3
|
+
* files (in the walked tree and in its ancestors up to the git root) plus
|
|
4
|
+
* `.git/info/exclude`. Each file's patterns apply relative to its own directory,
|
|
5
|
+
* and a deeper file can re-include (`!pattern`) what a shallower one ignored, as in git.
|
|
6
|
+
*/
|
|
7
|
+
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
8
|
+
import path from 'node:path';
|
|
9
|
+
import ignore from 'ignore';
|
|
10
|
+
/** Files read in every directory, in this order. `.forgeignore` is for paths only the agent should skip. */
|
|
11
|
+
export const IGNORE_FILE_NAMES = ['.gitignore', '.forgeignore'];
|
|
12
|
+
function readIfFile(file) {
|
|
13
|
+
try {
|
|
14
|
+
return statSync(file).isFile() ? readFileSync(file, 'utf8') : null;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/** The closest ancestor of `dir` (itself included) that holds a `.git` entry, or null. */
|
|
21
|
+
export function findGitRoot(dir) {
|
|
22
|
+
let current = path.resolve(dir);
|
|
23
|
+
for (;;) {
|
|
24
|
+
if (existsSync(path.join(current, '.git')))
|
|
25
|
+
return current;
|
|
26
|
+
const parent = path.dirname(current);
|
|
27
|
+
if (parent === current)
|
|
28
|
+
return null;
|
|
29
|
+
current = parent;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export class IgnoreRules {
|
|
33
|
+
top;
|
|
34
|
+
cache = new Map();
|
|
35
|
+
/** `top` is where rule lookup starts: the git root, or the walked directory outside a repository. */
|
|
36
|
+
constructor(top) {
|
|
37
|
+
this.top = top;
|
|
38
|
+
}
|
|
39
|
+
/** Rules for walking anywhere under `cwd`. */
|
|
40
|
+
static forRoot(cwd) {
|
|
41
|
+
const abs = path.resolve(cwd);
|
|
42
|
+
return new IgnoreRules(findGitRoot(abs) ?? abs);
|
|
43
|
+
}
|
|
44
|
+
rulesIn(dir) {
|
|
45
|
+
if (this.cache.has(dir))
|
|
46
|
+
return this.cache.get(dir);
|
|
47
|
+
const chunks = [];
|
|
48
|
+
if (dir === this.top) {
|
|
49
|
+
const exclude = readIfFile(path.join(dir, '.git', 'info', 'exclude'));
|
|
50
|
+
if (exclude)
|
|
51
|
+
chunks.push(exclude);
|
|
52
|
+
}
|
|
53
|
+
for (const name of IGNORE_FILE_NAMES) {
|
|
54
|
+
const text = readIfFile(path.join(dir, name));
|
|
55
|
+
if (text)
|
|
56
|
+
chunks.push(text);
|
|
57
|
+
}
|
|
58
|
+
const rules = chunks.length > 0 ? ignore().add(chunks.join('\n')) : null;
|
|
59
|
+
this.cache.set(dir, rules);
|
|
60
|
+
return rules;
|
|
61
|
+
}
|
|
62
|
+
/** Whether `absPath` is ignored. Paths outside the rule root are never ignored here. */
|
|
63
|
+
isIgnored(absPath, isDir) {
|
|
64
|
+
const rel = path.relative(this.top, path.resolve(absPath));
|
|
65
|
+
if (!rel || rel.startsWith('..') || path.isAbsolute(rel))
|
|
66
|
+
return false;
|
|
67
|
+
const parts = rel.split(path.sep);
|
|
68
|
+
let ignored = false;
|
|
69
|
+
let dir = this.top;
|
|
70
|
+
for (let i = 0; i < parts.length; i++) {
|
|
71
|
+
const rules = this.rulesIn(dir);
|
|
72
|
+
if (rules) {
|
|
73
|
+
const sub = parts.slice(i).join('/') + (isDir ? '/' : '');
|
|
74
|
+
const verdict = rules.test(sub);
|
|
75
|
+
if (verdict.ignored)
|
|
76
|
+
ignored = true;
|
|
77
|
+
else if (verdict.unignored)
|
|
78
|
+
ignored = false;
|
|
79
|
+
}
|
|
80
|
+
dir = path.join(dir, parts[i]);
|
|
81
|
+
}
|
|
82
|
+
return ignored;
|
|
83
|
+
}
|
|
84
|
+
}
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ import { findReferencesTool } from './find-references.js';
|
|
|
4
4
|
import { findSymbolTool } from './find-symbol.js';
|
|
5
5
|
import { listFilesTool } from './list-files.js';
|
|
6
6
|
import { listSymbolsTool } from './list-symbols.js';
|
|
7
|
-
import { memoryReadTool, memoryWriteTool } from './memory.js';
|
|
7
|
+
import { memoryForgetTool, memoryReadTool, memoryWriteTool } from './memory.js';
|
|
8
|
+
import { editNotebookTool } from './notebook.js';
|
|
8
9
|
import { readFileTool } from './read-file.js';
|
|
9
10
|
import { readImageTool } from './read-image.js';
|
|
10
11
|
import { runCommandTool } from './run-command.js';
|
|
@@ -25,11 +26,10 @@ type AnyToolDefinition = ToolDefinition<any, any>;
|
|
|
25
26
|
* intentional: the model sees this order in its tool list.
|
|
26
27
|
*/
|
|
27
28
|
export declare const BUILTIN_TOOLS: readonly AnyToolDefinition[];
|
|
28
|
-
export { editFileTool, fetchUrlTool, findReferencesTool, findSymbolTool, listFilesTool, listSymbolsTool, memoryReadTool, memoryWriteTool, readFileTool, readImageTool, runCommandTool, searchFilesTool, subAgentTool, writeFileTool, };
|
|
29
|
+
export { editFileTool, editNotebookTool, fetchUrlTool, findReferencesTool, findSymbolTool, listFilesTool, listSymbolsTool, memoryForgetTool, memoryReadTool, memoryWriteTool, readFileTool, readImageTool, runCommandTool, searchFilesTool, subAgentTool, writeFileTool, };
|
|
29
30
|
export type { ToolContext, ToolDefinition, ToolPolicy, ToolSandbox } from '../types.js';
|
|
30
31
|
export { checkPolicyViolation, globToRegex, mergeToolSandbox, normalizePathPattern, pathMatchesAny } from './policy.js';
|
|
31
32
|
export { redact, countRedactions, buildRules } from './redact.js';
|
|
32
33
|
export type { RedactionRule, RedactionResult } from './redact.js';
|
|
33
34
|
export { ToolResultCache, buildCacheKey, cachedExecute } from './result-cache.js';
|
|
34
35
|
export type { CacheKeyParts, CacheStats } from './result-cache.js';
|
|
35
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/tools/index.js
CHANGED
|
@@ -4,7 +4,8 @@ import { findReferencesTool } from './find-references.js';
|
|
|
4
4
|
import { findSymbolTool } from './find-symbol.js';
|
|
5
5
|
import { listFilesTool } from './list-files.js';
|
|
6
6
|
import { listSymbolsTool } from './list-symbols.js';
|
|
7
|
-
import { memoryReadTool, memoryWriteTool } from './memory.js';
|
|
7
|
+
import { memoryForgetTool, memoryReadTool, memoryWriteTool } from './memory.js';
|
|
8
|
+
import { editNotebookTool } from './notebook.js';
|
|
8
9
|
import { readFileTool } from './read-file.js';
|
|
9
10
|
import { readImageTool } from './read-image.js';
|
|
10
11
|
import { runCommandTool } from './run-command.js';
|
|
@@ -27,14 +28,15 @@ export const BUILTIN_TOOLS = [
|
|
|
27
28
|
findReferencesTool,
|
|
28
29
|
writeFileTool,
|
|
29
30
|
editFileTool,
|
|
31
|
+
editNotebookTool,
|
|
30
32
|
runCommandTool,
|
|
31
33
|
fetchUrlTool,
|
|
32
34
|
memoryReadTool,
|
|
33
35
|
memoryWriteTool,
|
|
36
|
+
memoryForgetTool,
|
|
34
37
|
subAgentTool,
|
|
35
38
|
];
|
|
36
|
-
export { editFileTool, fetchUrlTool, findReferencesTool, findSymbolTool, listFilesTool, listSymbolsTool, memoryReadTool, memoryWriteTool, readFileTool, readImageTool, runCommandTool, searchFilesTool, subAgentTool, writeFileTool, };
|
|
39
|
+
export { editFileTool, editNotebookTool, fetchUrlTool, findReferencesTool, findSymbolTool, listFilesTool, listSymbolsTool, memoryForgetTool, memoryReadTool, memoryWriteTool, readFileTool, readImageTool, runCommandTool, searchFilesTool, subAgentTool, writeFileTool, };
|
|
37
40
|
export { checkPolicyViolation, globToRegex, mergeToolSandbox, normalizePathPattern, pathMatchesAny } from './policy.js';
|
|
38
41
|
export { redact, countRedactions, buildRules } from './redact.js';
|
|
39
42
|
export { ToolResultCache, buildCacheKey, cachedExecute } from './result-cache.js';
|
|
40
|
-
//# sourceMappingURL=index.js.map
|