@vpxa/aikit 0.1.59 → 0.1.60
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/README.md +38 -3
- package/package.json +2 -1
- package/packages/aikit-client/dist/index.d.ts +146 -4
- package/packages/aikit-client/dist/index.js +5 -1
- package/packages/analyzers/dist/index.d.ts +309 -11
- package/packages/analyzers/dist/index.js +54 -1
- package/packages/chunker/dist/index.d.ts +451 -18
- package/packages/chunker/dist/index.js +24 -1
- package/packages/cli/dist/{commands/init/constants.js → constants-D3v4VDf0.js} +1 -1
- package/packages/cli/dist/index.js +15 -2
- package/packages/cli/dist/init-D0CiV9PX.js +7 -0
- package/packages/cli/dist/scaffold-CJwkHf-q.js +2 -0
- package/packages/cli/dist/{commands/init/templates.js → templates-DJ7EC5vw.js} +1 -1
- package/packages/cli/dist/user-HmJYNt5b.js +5 -0
- package/packages/core/dist/index.d.ts +357 -6
- package/packages/core/dist/index.js +1 -1
- package/packages/dashboard/dist/assets/{index-Cdke3KDK.js → index-C6D-PCp0.js} +7 -7
- package/packages/dashboard/dist/assets/index-C6D-PCp0.js.map +1 -0
- package/packages/dashboard/dist/index.html +1 -1
- package/packages/elicitation/dist/index.d.ts +139 -4
- package/packages/elicitation/dist/index.js +1 -1
- package/packages/embeddings/dist/index.d.ts +45 -2
- package/packages/embeddings/dist/index.js +1 -1
- package/packages/enterprise-bridge/dist/index.d.ts +275 -7
- package/packages/enterprise-bridge/dist/index.js +1 -1
- package/packages/flows/dist/index.d.ts +345 -12
- package/packages/flows/dist/index.js +15 -1
- package/packages/indexer/dist/index.d.ts +196 -6
- package/packages/indexer/dist/index.js +1 -1
- package/packages/present/dist/index.html +314 -313
- package/packages/server/dist/curated-manager-DX-_oJg0.js +5 -0
- package/packages/server/dist/index.d.ts +139 -1
- package/packages/server/dist/index.js +1 -1
- package/packages/server/dist/server-eMZ64H9b.js +1274 -0
- package/packages/store/dist/index.d.ts +316 -5
- package/packages/store/dist/index.js +90 -1
- package/packages/store/dist/lance-store-jdHZp-V4.js +1 -0
- package/packages/tools/dist/index.d.ts +2161 -61
- package/packages/tools/dist/index.js +117 -1
- package/packages/tui/dist/{App-CoMyn2kt.js → App-DobfqTPH.js} +1 -1
- package/packages/tui/dist/App.d.ts +1 -1
- package/packages/tui/dist/App.js +1 -1
- package/packages/tui/dist/{LogPanel-CDItCD0E.js → LogPanel-DGeptKim.js} +3 -3
- package/packages/tui/dist/hooks/useKBClient.d.ts +1 -1
- package/packages/tui/dist/{index-MXJeXmCf.d.ts → index-floZQwfo.d.ts} +2 -1
- package/packages/tui/dist/index.d.ts +1 -1
- package/packages/tui/dist/index.js +1 -1
- package/packages/tui/dist/panels/LogPanel.js +1 -1
- package/scaffold/definitions/bodies.mjs +47 -0
- package/scaffold/definitions/protocols.mjs +9 -0
- package/scaffold/definitions/tools.mjs +15 -0
- package/scaffold/general/agents/Debugger.agent.md +9 -0
- package/scaffold/general/agents/Documenter.agent.md +9 -0
- package/scaffold/general/agents/Frontend.agent.md +9 -0
- package/scaffold/general/agents/Implementer.agent.md +9 -0
- package/scaffold/general/agents/Orchestrator.agent.md +47 -0
- package/scaffold/general/agents/Planner.agent.md +9 -0
- package/scaffold/general/agents/Refactor.agent.md +9 -0
- package/scaffold/general/agents/Security.agent.md +9 -0
- package/scaffold/general/agents/_shared/code-agent-base.md +9 -0
- package/scaffold/general/skills/aikit/SKILL.md +71 -7
- package/packages/aikit-client/dist/direct-client.d.ts +0 -37
- package/packages/aikit-client/dist/direct-client.js +0 -1
- package/packages/aikit-client/dist/mcp-client.d.ts +0 -19
- package/packages/aikit-client/dist/mcp-client.js +0 -4
- package/packages/aikit-client/dist/parsers.d.ts +0 -35
- package/packages/aikit-client/dist/parsers.js +0 -2
- package/packages/aikit-client/dist/types.d.ts +0 -62
- package/packages/aikit-client/dist/types.js +0 -1
- package/packages/analyzers/dist/blast-radius-analyzer.d.ts +0 -19
- package/packages/analyzers/dist/blast-radius-analyzer.js +0 -6
- package/packages/analyzers/dist/dependency-analyzer.d.ts +0 -32
- package/packages/analyzers/dist/dependency-analyzer.js +0 -8
- package/packages/analyzers/dist/diagram-generator.d.ts +0 -16
- package/packages/analyzers/dist/diagram-generator.js +0 -2
- package/packages/analyzers/dist/entry-point-analyzer.d.ts +0 -40
- package/packages/analyzers/dist/entry-point-analyzer.js +0 -4
- package/packages/analyzers/dist/knowledge-producer.d.ts +0 -40
- package/packages/analyzers/dist/knowledge-producer.js +0 -26
- package/packages/analyzers/dist/pattern-analyzer.d.ts +0 -15
- package/packages/analyzers/dist/pattern-analyzer.js +0 -2
- package/packages/analyzers/dist/regex-call-graph.d.ts +0 -10
- package/packages/analyzers/dist/regex-call-graph.js +0 -1
- package/packages/analyzers/dist/structure-analyzer.d.ts +0 -19
- package/packages/analyzers/dist/structure-analyzer.js +0 -4
- package/packages/analyzers/dist/symbol-analyzer.d.ts +0 -14
- package/packages/analyzers/dist/symbol-analyzer.js +0 -9
- package/packages/analyzers/dist/ts-call-graph.d.ts +0 -29
- package/packages/analyzers/dist/ts-call-graph.js +0 -1
- package/packages/analyzers/dist/types.d.ts +0 -110
- package/packages/analyzers/dist/types.js +0 -1
- package/packages/chunker/dist/call-graph-extractor.d.ts +0 -25
- package/packages/chunker/dist/call-graph-extractor.js +0 -1
- package/packages/chunker/dist/chunker-factory.d.ts +0 -19
- package/packages/chunker/dist/chunker-factory.js +0 -1
- package/packages/chunker/dist/chunker.interface.d.ts +0 -13
- package/packages/chunker/dist/chunker.interface.js +0 -1
- package/packages/chunker/dist/code-chunker.d.ts +0 -17
- package/packages/chunker/dist/code-chunker.js +0 -11
- package/packages/chunker/dist/extractors/call-extractor.d.ts +0 -24
- package/packages/chunker/dist/extractors/call-extractor.js +0 -1
- package/packages/chunker/dist/extractors/entry-point-detector.d.ts +0 -14
- package/packages/chunker/dist/extractors/entry-point-detector.js +0 -1
- package/packages/chunker/dist/extractors/import-extractor.d.ts +0 -14
- package/packages/chunker/dist/extractors/import-extractor.js +0 -1
- package/packages/chunker/dist/extractors/pattern-detector.d.ts +0 -14
- package/packages/chunker/dist/extractors/pattern-detector.js +0 -1
- package/packages/chunker/dist/extractors/scope-resolver.d.ts +0 -26
- package/packages/chunker/dist/extractors/scope-resolver.js +0 -1
- package/packages/chunker/dist/extractors/symbol-extractor.d.ts +0 -14
- package/packages/chunker/dist/extractors/symbol-extractor.js +0 -3
- package/packages/chunker/dist/extractors/types.d.ts +0 -44
- package/packages/chunker/dist/extractors/types.js +0 -1
- package/packages/chunker/dist/generic-chunker.d.ts +0 -15
- package/packages/chunker/dist/generic-chunker.js +0 -5
- package/packages/chunker/dist/markdown-chunker.d.ts +0 -17
- package/packages/chunker/dist/markdown-chunker.js +0 -3
- package/packages/chunker/dist/wasm/languages.d.ts +0 -18
- package/packages/chunker/dist/wasm/languages.js +0 -1
- package/packages/chunker/dist/wasm/query-executor.d.ts +0 -70
- package/packages/chunker/dist/wasm/query-executor.js +0 -1
- package/packages/chunker/dist/wasm/runtime.d.ts +0 -44
- package/packages/chunker/dist/wasm/runtime.js +0 -1
- package/packages/chunker/dist/wasm/types.d.ts +0 -84
- package/packages/chunker/dist/wasm/types.js +0 -1
- package/packages/chunker/dist/wasm-chunker.d.ts +0 -23
- package/packages/chunker/dist/wasm-chunker.js +0 -6
- package/packages/cli/dist/aikit-init.d.ts +0 -59
- package/packages/cli/dist/aikit-init.js +0 -1
- package/packages/cli/dist/commands/analyze.d.ts +0 -6
- package/packages/cli/dist/commands/analyze.js +0 -2
- package/packages/cli/dist/commands/context-cmds.d.ts +0 -6
- package/packages/cli/dist/commands/context-cmds.js +0 -1
- package/packages/cli/dist/commands/environment.d.ts +0 -6
- package/packages/cli/dist/commands/environment.js +0 -1
- package/packages/cli/dist/commands/execution.d.ts +0 -6
- package/packages/cli/dist/commands/execution.js +0 -1
- package/packages/cli/dist/commands/flow.d.ts +0 -6
- package/packages/cli/dist/commands/flow.js +0 -1
- package/packages/cli/dist/commands/graph.d.ts +0 -6
- package/packages/cli/dist/commands/graph.js +0 -6
- package/packages/cli/dist/commands/init/adapters.d.ts +0 -28
- package/packages/cli/dist/commands/init/adapters.js +0 -1
- package/packages/cli/dist/commands/init/config.d.ts +0 -10
- package/packages/cli/dist/commands/init/config.js +0 -3
- package/packages/cli/dist/commands/init/constants.d.ts +0 -46
- package/packages/cli/dist/commands/init/curated.d.ts +0 -7
- package/packages/cli/dist/commands/init/curated.js +0 -1
- package/packages/cli/dist/commands/init/frontmatter.d.ts +0 -79
- package/packages/cli/dist/commands/init/frontmatter.js +0 -2
- package/packages/cli/dist/commands/init/index.d.ts +0 -36
- package/packages/cli/dist/commands/init/index.js +0 -5
- package/packages/cli/dist/commands/init/manifest.d.ts +0 -72
- package/packages/cli/dist/commands/init/manifest.js +0 -1
- package/packages/cli/dist/commands/init/scaffold.d.ts +0 -58
- package/packages/cli/dist/commands/init/scaffold.js +0 -1
- package/packages/cli/dist/commands/init/templates.d.ts +0 -9
- package/packages/cli/dist/commands/init/user.d.ts +0 -61
- package/packages/cli/dist/commands/init/user.js +0 -5
- package/packages/cli/dist/commands/knowledge.d.ts +0 -6
- package/packages/cli/dist/commands/knowledge.js +0 -1
- package/packages/cli/dist/commands/search.d.ts +0 -6
- package/packages/cli/dist/commands/search.js +0 -1
- package/packages/cli/dist/commands/system.d.ts +0 -6
- package/packages/cli/dist/commands/system.js +0 -4
- package/packages/cli/dist/commands/upgrade.d.ts +0 -6
- package/packages/cli/dist/commands/upgrade.js +0 -1
- package/packages/cli/dist/commands/workspace.d.ts +0 -6
- package/packages/cli/dist/commands/workspace.js +0 -1
- package/packages/cli/dist/context.d.ts +0 -7
- package/packages/cli/dist/context.js +0 -1
- package/packages/cli/dist/helpers.d.ts +0 -55
- package/packages/cli/dist/helpers.js +0 -5
- package/packages/cli/dist/types.d.ts +0 -9
- package/packages/cli/dist/types.js +0 -1
- package/packages/core/dist/constants.d.ts +0 -74
- package/packages/core/dist/constants.js +0 -1
- package/packages/core/dist/content-detector.d.ts +0 -13
- package/packages/core/dist/content-detector.js +0 -1
- package/packages/core/dist/errors.d.ts +0 -20
- package/packages/core/dist/errors.js +0 -1
- package/packages/core/dist/global-registry.d.ts +0 -69
- package/packages/core/dist/global-registry.js +0 -1
- package/packages/core/dist/logger.d.ts +0 -32
- package/packages/core/dist/logger.js +0 -1
- package/packages/core/dist/types.d.ts +0 -149
- package/packages/core/dist/types.js +0 -1
- package/packages/dashboard/dist/assets/index-Cdke3KDK.js.map +0 -1
- package/packages/elicitation/dist/build.d.ts +0 -14
- package/packages/elicitation/dist/build.js +0 -1
- package/packages/elicitation/dist/fields.d.ts +0 -32
- package/packages/elicitation/dist/fields.js +0 -1
- package/packages/elicitation/dist/normalize.d.ts +0 -15
- package/packages/elicitation/dist/normalize.js +0 -1
- package/packages/elicitation/dist/types.d.ts +0 -88
- package/packages/elicitation/dist/types.js +0 -1
- package/packages/embeddings/dist/embedder.interface.d.ts +0 -26
- package/packages/embeddings/dist/embedder.interface.js +0 -1
- package/packages/embeddings/dist/onnx-embedder.d.ts +0 -23
- package/packages/embeddings/dist/onnx-embedder.js +0 -1
- package/packages/enterprise-bridge/dist/cache.d.ts +0 -28
- package/packages/enterprise-bridge/dist/cache.js +0 -1
- package/packages/enterprise-bridge/dist/er-client.d.ts +0 -37
- package/packages/enterprise-bridge/dist/er-client.js +0 -1
- package/packages/enterprise-bridge/dist/evolution-collector.d.ts +0 -62
- package/packages/enterprise-bridge/dist/evolution-collector.js +0 -1
- package/packages/enterprise-bridge/dist/policy-store.d.ts +0 -45
- package/packages/enterprise-bridge/dist/policy-store.js +0 -1
- package/packages/enterprise-bridge/dist/push-adapter.d.ts +0 -23
- package/packages/enterprise-bridge/dist/push-adapter.js +0 -1
- package/packages/enterprise-bridge/dist/result-merger.d.ts +0 -14
- package/packages/enterprise-bridge/dist/result-merger.js +0 -1
- package/packages/enterprise-bridge/dist/types.d.ts +0 -81
- package/packages/enterprise-bridge/dist/types.js +0 -1
- package/packages/flows/dist/adapters/claude-plugin.d.ts +0 -25
- package/packages/flows/dist/adapters/claude-plugin.js +0 -3
- package/packages/flows/dist/adapters/copilot.d.ts +0 -12
- package/packages/flows/dist/adapters/copilot.js +0 -1
- package/packages/flows/dist/adapters/index.d.ts +0 -12
- package/packages/flows/dist/adapters/index.js +0 -1
- package/packages/flows/dist/adapters/native.d.ts +0 -10
- package/packages/flows/dist/adapters/native.js +0 -1
- package/packages/flows/dist/adapters/openspec.d.ts +0 -40
- package/packages/flows/dist/adapters/openspec.js +0 -1
- package/packages/flows/dist/builtins.d.ts +0 -16
- package/packages/flows/dist/builtins.js +0 -1
- package/packages/flows/dist/foundation.d.ts +0 -20
- package/packages/flows/dist/foundation.js +0 -11
- package/packages/flows/dist/git.d.ts +0 -53
- package/packages/flows/dist/git.js +0 -2
- package/packages/flows/dist/loader.d.ts +0 -13
- package/packages/flows/dist/loader.js +0 -2
- package/packages/flows/dist/registry.d.ts +0 -23
- package/packages/flows/dist/registry.js +0 -1
- package/packages/flows/dist/state-machine.d.ts +0 -23
- package/packages/flows/dist/state-machine.js +0 -1
- package/packages/flows/dist/symlinks.d.ts +0 -17
- package/packages/flows/dist/symlinks.js +0 -1
- package/packages/flows/dist/types.d.ts +0 -127
- package/packages/flows/dist/types.js +0 -1
- package/packages/indexer/dist/file-hasher.d.ts +0 -13
- package/packages/indexer/dist/file-hasher.js +0 -1
- package/packages/indexer/dist/filesystem-crawler.d.ts +0 -29
- package/packages/indexer/dist/filesystem-crawler.js +0 -1
- package/packages/indexer/dist/graph-extractor.d.ts +0 -22
- package/packages/indexer/dist/graph-extractor.js +0 -1
- package/packages/indexer/dist/hash-cache.d.ts +0 -24
- package/packages/indexer/dist/hash-cache.js +0 -1
- package/packages/indexer/dist/incremental-indexer.d.ts +0 -73
- package/packages/indexer/dist/incremental-indexer.js +0 -1
- package/packages/indexer/dist/smart-index-scheduler.d.ts +0 -47
- package/packages/indexer/dist/smart-index-scheduler.js +0 -1
- package/packages/server/dist/api.d.ts +0 -3
- package/packages/server/dist/api.js +0 -1
- package/packages/server/dist/auto-gc.d.ts +0 -30
- package/packages/server/dist/auto-gc.js +0 -1
- package/packages/server/dist/background-task.d.ts +0 -47
- package/packages/server/dist/background-task.js +0 -1
- package/packages/server/dist/completions.d.ts +0 -14
- package/packages/server/dist/completions.js +0 -1
- package/packages/server/dist/compression-interceptor.d.ts +0 -12
- package/packages/server/dist/compression-interceptor.js +0 -1
- package/packages/server/dist/config.d.ts +0 -16
- package/packages/server/dist/cross-workspace.d.ts +0 -43
- package/packages/server/dist/cross-workspace.js +0 -1
- package/packages/server/dist/curated-manager.d.ts +0 -92
- package/packages/server/dist/curated-manager.js +0 -5
- package/packages/server/dist/dashboard-static.d.ts +0 -27
- package/packages/server/dist/elicitor.d.ts +0 -18
- package/packages/server/dist/elicitor.js +0 -1
- package/packages/server/dist/idle-timer.d.ts +0 -33
- package/packages/server/dist/idle-timer.js +0 -1
- package/packages/server/dist/mcp-logging.d.ts +0 -11
- package/packages/server/dist/mcp-logging.js +0 -1
- package/packages/server/dist/memory-monitor.d.ts +0 -37
- package/packages/server/dist/memory-monitor.js +0 -1
- package/packages/server/dist/output-schemas.d.ts +0 -244
- package/packages/server/dist/output-schemas.js +0 -1
- package/packages/server/dist/prompts.d.ts +0 -13
- package/packages/server/dist/prompts.js +0 -13
- package/packages/server/dist/replay-interceptor.d.ts +0 -23
- package/packages/server/dist/replay-interceptor.js +0 -1
- package/packages/server/dist/resource-links.d.ts +0 -34
- package/packages/server/dist/resource-links.js +0 -1
- package/packages/server/dist/resources/curated-resources.d.ts +0 -13
- package/packages/server/dist/resources/curated-resources.js +0 -2
- package/packages/server/dist/resources/resource-notifier.d.ts +0 -45
- package/packages/server/dist/resources/resource-notifier.js +0 -1
- package/packages/server/dist/resources/resources.d.ts +0 -8
- package/packages/server/dist/resources/resources.js +0 -2
- package/packages/server/dist/sampling.d.ts +0 -41
- package/packages/server/dist/sampling.js +0 -2
- package/packages/server/dist/server.d.ts +0 -63
- package/packages/server/dist/server.js +0 -3
- package/packages/server/dist/structured-content-guard.d.ts +0 -28
- package/packages/server/dist/structured-content-guard.js +0 -1
- package/packages/server/dist/task-manager.d.ts +0 -40
- package/packages/server/dist/task-manager.js +0 -1
- package/packages/server/dist/tool-metadata.d.ts +0 -38
- package/packages/server/dist/tool-metadata.js +0 -1
- package/packages/server/dist/tool-prefix.d.ts +0 -12
- package/packages/server/dist/tool-prefix.js +0 -1
- package/packages/server/dist/tool-timeout.d.ts +0 -27
- package/packages/server/dist/tool-timeout.js +0 -1
- package/packages/server/dist/tools/analyze.tools.d.ts +0 -14
- package/packages/server/dist/tools/analyze.tools.js +0 -8
- package/packages/server/dist/tools/audit.tool.d.ts +0 -8
- package/packages/server/dist/tools/audit.tool.js +0 -1
- package/packages/server/dist/tools/brainstorm.tool.d.ts +0 -7
- package/packages/server/dist/tools/brainstorm.tool.js +0 -9
- package/packages/server/dist/tools/bridge.tools.d.ts +0 -34
- package/packages/server/dist/tools/bridge.tools.js +0 -15
- package/packages/server/dist/tools/config.tool.d.ts +0 -8
- package/packages/server/dist/tools/config.tool.js +0 -12
- package/packages/server/dist/tools/context.tools.d.ts +0 -15
- package/packages/server/dist/tools/context.tools.js +0 -10
- package/packages/server/dist/tools/evolution.tools.d.ts +0 -7
- package/packages/server/dist/tools/evolution.tools.js +0 -5
- package/packages/server/dist/tools/execution.tools.d.ts +0 -14
- package/packages/server/dist/tools/execution.tools.js +0 -4
- package/packages/server/dist/tools/flow.tools.d.ts +0 -7
- package/packages/server/dist/tools/flow.tools.js +0 -16
- package/packages/server/dist/tools/forge.tools.d.ts +0 -13
- package/packages/server/dist/tools/forge.tools.js +0 -10
- package/packages/server/dist/tools/forget.tool.d.ts +0 -8
- package/packages/server/dist/tools/forget.tool.js +0 -1
- package/packages/server/dist/tools/graph.tool.d.ts +0 -7
- package/packages/server/dist/tools/graph.tool.js +0 -29
- package/packages/server/dist/tools/infra.tools.d.ts +0 -10
- package/packages/server/dist/tools/infra.tools.js +0 -5
- package/packages/server/dist/tools/list.tool.d.ts +0 -7
- package/packages/server/dist/tools/list.tool.js +0 -2
- package/packages/server/dist/tools/lookup.tool.d.ts +0 -7
- package/packages/server/dist/tools/lookup.tool.js +0 -3
- package/packages/server/dist/tools/manipulation.tools.d.ts +0 -10
- package/packages/server/dist/tools/manipulation.tools.js +0 -4
- package/packages/server/dist/tools/onboard.tool.d.ts +0 -12
- package/packages/server/dist/tools/onboard.tool.js +0 -2
- package/packages/server/dist/tools/persistence.tools.d.ts +0 -10
- package/packages/server/dist/tools/persistence.tools.js +0 -5
- package/packages/server/dist/tools/policy.tools.d.ts +0 -7
- package/packages/server/dist/tools/policy.tools.js +0 -3
- package/packages/server/dist/tools/present/browser.d.ts +0 -4
- package/packages/server/dist/tools/present/browser.js +0 -93
- package/packages/server/dist/tools/present/helpers.d.ts +0 -19
- package/packages/server/dist/tools/present/helpers.js +0 -16
- package/packages/server/dist/tools/present/html.d.ts +0 -18
- package/packages/server/dist/tools/present/html.js +0 -5
- package/packages/server/dist/tools/present/index.d.ts +0 -2
- package/packages/server/dist/tools/present/index.js +0 -1
- package/packages/server/dist/tools/present/markdown.d.ts +0 -32
- package/packages/server/dist/tools/present/markdown.js +0 -11
- package/packages/server/dist/tools/present/templates.d.ts +0 -14
- package/packages/server/dist/tools/present/templates.js +0 -472
- package/packages/server/dist/tools/present/tool.d.ts +0 -27
- package/packages/server/dist/tools/present/tool.js +0 -39
- package/packages/server/dist/tools/present-blocks.d.ts +0 -46
- package/packages/server/dist/tools/present-blocks.js +0 -27
- package/packages/server/dist/tools/present-charts.d.ts +0 -31
- package/packages/server/dist/tools/present-charts.js +0 -34
- package/packages/server/dist/tools/present-theme.d.ts +0 -14
- package/packages/server/dist/tools/present-theme.js +0 -396
- package/packages/server/dist/tools/present-utils.d.ts +0 -11
- package/packages/server/dist/tools/present-utils.js +0 -1
- package/packages/server/dist/tools/present.tool.d.ts +0 -2
- package/packages/server/dist/tools/present.tool.js +0 -1
- package/packages/server/dist/tools/produce.tool.d.ts +0 -7
- package/packages/server/dist/tools/produce.tool.js +0 -4
- package/packages/server/dist/tools/read.tool.d.ts +0 -7
- package/packages/server/dist/tools/read.tool.js +0 -2
- package/packages/server/dist/tools/reindex.tool.d.ts +0 -11
- package/packages/server/dist/tools/reindex.tool.js +0 -9
- package/packages/server/dist/tools/remember.tool.d.ts +0 -9
- package/packages/server/dist/tools/remember.tool.js +0 -4
- package/packages/server/dist/tools/replay.tool.d.ts +0 -6
- package/packages/server/dist/tools/replay.tool.js +0 -3
- package/packages/server/dist/tools/restore.tool.d.ts +0 -6
- package/packages/server/dist/tools/restore.tool.js +0 -3
- package/packages/server/dist/tools/search.tool.d.ts +0 -11
- package/packages/server/dist/tools/search.tool.js +0 -10
- package/packages/server/dist/tools/status.tool.d.ts +0 -28
- package/packages/server/dist/tools/status.tool.js +0 -3
- package/packages/server/dist/tools/update.tool.d.ts +0 -8
- package/packages/server/dist/tools/update.tool.js +0 -1
- package/packages/server/dist/tools/utility.tools.d.ts +0 -15
- package/packages/server/dist/tools/utility.tools.js +0 -13
- package/packages/server/dist/version-check.d.ts +0 -32
- package/packages/store/dist/graph-store.interface.d.ts +0 -159
- package/packages/store/dist/graph-store.interface.js +0 -1
- package/packages/store/dist/lance-store.d.ts +0 -46
- package/packages/store/dist/lance-store.js +0 -1
- package/packages/store/dist/sqlite-graph-store.d.ts +0 -57
- package/packages/store/dist/sqlite-graph-store.js +0 -90
- package/packages/store/dist/store-factory.d.ts +0 -12
- package/packages/store/dist/store-factory.js +0 -1
- package/packages/store/dist/store.interface.d.ts +0 -54
- package/packages/store/dist/store.interface.js +0 -1
- package/packages/tools/dist/audit.d.ts +0 -65
- package/packages/tools/dist/audit.js +0 -6
- package/packages/tools/dist/batch.d.ts +0 -23
- package/packages/tools/dist/batch.js +0 -1
- package/packages/tools/dist/changelog.d.ts +0 -36
- package/packages/tools/dist/changelog.js +0 -2
- package/packages/tools/dist/check.d.ts +0 -48
- package/packages/tools/dist/check.js +0 -2
- package/packages/tools/dist/checkpoint.d.ts +0 -19
- package/packages/tools/dist/checkpoint.js +0 -1
- package/packages/tools/dist/codemod.d.ts +0 -39
- package/packages/tools/dist/codemod.js +0 -2
- package/packages/tools/dist/compact.d.ts +0 -47
- package/packages/tools/dist/compact.js +0 -3
- package/packages/tools/dist/compress-output.d.ts +0 -38
- package/packages/tools/dist/compress-output.js +0 -1
- package/packages/tools/dist/compression/delta-cache.d.ts +0 -29
- package/packages/tools/dist/compression/delta-cache.js +0 -1
- package/packages/tools/dist/compression/engine.d.ts +0 -34
- package/packages/tools/dist/compression/engine.js +0 -4
- package/packages/tools/dist/compression/litm.d.ts +0 -20
- package/packages/tools/dist/compression/litm.js +0 -1
- package/packages/tools/dist/compression/mmr.d.ts +0 -24
- package/packages/tools/dist/compression/mmr.js +0 -1
- package/packages/tools/dist/compression/rules/docker.d.ts +0 -11
- package/packages/tools/dist/compression/rules/docker.js +0 -3
- package/packages/tools/dist/compression/rules/generic.d.ts +0 -11
- package/packages/tools/dist/compression/rules/generic.js +0 -3
- package/packages/tools/dist/compression/rules/git.d.ts +0 -11
- package/packages/tools/dist/compression/rules/git.js +0 -3
- package/packages/tools/dist/compression/rules/index.d.ts +0 -14
- package/packages/tools/dist/compression/rules/index.js +0 -1
- package/packages/tools/dist/compression/rules/kubectl.d.ts +0 -11
- package/packages/tools/dist/compression/rules/kubectl.js +0 -3
- package/packages/tools/dist/compression/rules/lint.d.ts +0 -11
- package/packages/tools/dist/compression/rules/lint.js +0 -3
- package/packages/tools/dist/compression/rules/npm.d.ts +0 -11
- package/packages/tools/dist/compression/rules/npm.js +0 -3
- package/packages/tools/dist/compression/rules/test-runner.d.ts +0 -11
- package/packages/tools/dist/compression/rules/test-runner.js +0 -3
- package/packages/tools/dist/compression/scoring.d.ts +0 -26
- package/packages/tools/dist/compression/scoring.js +0 -1
- package/packages/tools/dist/compression/types.d.ts +0 -61
- package/packages/tools/dist/compression/types.js +0 -1
- package/packages/tools/dist/config-extractor.d.ts +0 -9
- package/packages/tools/dist/config-extractor.js +0 -7
- package/packages/tools/dist/data-transform.d.ts +0 -12
- package/packages/tools/dist/data-transform.js +0 -1
- package/packages/tools/dist/dead-symbols.d.ts +0 -28
- package/packages/tools/dist/dead-symbols.js +0 -2
- package/packages/tools/dist/delegate.d.ts +0 -36
- package/packages/tools/dist/delegate.js +0 -1
- package/packages/tools/dist/diagram-builder.d.ts +0 -9
- package/packages/tools/dist/diagram-builder.js +0 -9
- package/packages/tools/dist/diff-parse.d.ts +0 -28
- package/packages/tools/dist/diff-parse.js +0 -3
- package/packages/tools/dist/digest.d.ts +0 -55
- package/packages/tools/dist/digest.js +0 -6
- package/packages/tools/dist/dogfood-log.d.ts +0 -49
- package/packages/tools/dist/dogfood-log.js +0 -2
- package/packages/tools/dist/encode.d.ts +0 -16
- package/packages/tools/dist/encode.js +0 -1
- package/packages/tools/dist/env-info.d.ts +0 -30
- package/packages/tools/dist/env-info.js +0 -1
- package/packages/tools/dist/eval.d.ts +0 -15
- package/packages/tools/dist/eval.js +0 -2
- package/packages/tools/dist/evidence-map.d.ts +0 -92
- package/packages/tools/dist/evidence-map.js +0 -2
- package/packages/tools/dist/file-cache.d.ts +0 -41
- package/packages/tools/dist/file-cache.js +0 -3
- package/packages/tools/dist/file-summary.d.ts +0 -52
- package/packages/tools/dist/file-summary.js +0 -2
- package/packages/tools/dist/file-walk.d.ts +0 -6
- package/packages/tools/dist/file-walk.js +0 -1
- package/packages/tools/dist/find-examples.d.ts +0 -29
- package/packages/tools/dist/find-examples.js +0 -3
- package/packages/tools/dist/find.d.ts +0 -49
- package/packages/tools/dist/find.js +0 -1
- package/packages/tools/dist/forge-classify.d.ts +0 -44
- package/packages/tools/dist/forge-classify.js +0 -2
- package/packages/tools/dist/forge-ground.d.ts +0 -61
- package/packages/tools/dist/forge-ground.js +0 -1
- package/packages/tools/dist/git-context.d.ts +0 -25
- package/packages/tools/dist/git-context.js +0 -3
- package/packages/tools/dist/graph-query.d.ts +0 -98
- package/packages/tools/dist/graph-query.js +0 -1
- package/packages/tools/dist/guide.d.ts +0 -25
- package/packages/tools/dist/guide.js +0 -1
- package/packages/tools/dist/health.d.ts +0 -16
- package/packages/tools/dist/health.js +0 -2
- package/packages/tools/dist/http-request.d.ts +0 -25
- package/packages/tools/dist/http-request.js +0 -1
- package/packages/tools/dist/lane.d.ts +0 -41
- package/packages/tools/dist/lane.js +0 -6
- package/packages/tools/dist/measure.d.ts +0 -42
- package/packages/tools/dist/measure.js +0 -2
- package/packages/tools/dist/onboard-utils.d.ts +0 -12
- package/packages/tools/dist/onboard-utils.js +0 -1
- package/packages/tools/dist/onboard.d.ts +0 -50
- package/packages/tools/dist/onboard.js +0 -18
- package/packages/tools/dist/parse-output.d.ts +0 -84
- package/packages/tools/dist/parse-output.js +0 -2
- package/packages/tools/dist/path-resolver.d.ts +0 -14
- package/packages/tools/dist/path-resolver.js +0 -1
- package/packages/tools/dist/process-manager.d.ts +0 -20
- package/packages/tools/dist/process-manager.js +0 -1
- package/packages/tools/dist/queue.d.ts +0 -40
- package/packages/tools/dist/queue.js +0 -1
- package/packages/tools/dist/regex-test.d.ts +0 -33
- package/packages/tools/dist/regex-test.js +0 -1
- package/packages/tools/dist/regex-utils.d.ts +0 -8
- package/packages/tools/dist/regex-utils.js +0 -1
- package/packages/tools/dist/rename.d.ts +0 -31
- package/packages/tools/dist/rename.js +0 -2
- package/packages/tools/dist/replay.d.ts +0 -59
- package/packages/tools/dist/replay.js +0 -4
- package/packages/tools/dist/response-envelope.d.ts +0 -43
- package/packages/tools/dist/response-envelope.js +0 -1
- package/packages/tools/dist/restore-points.d.ts +0 -22
- package/packages/tools/dist/restore-points.js +0 -1
- package/packages/tools/dist/schema-validate.d.ts +0 -25
- package/packages/tools/dist/schema-validate.js +0 -1
- package/packages/tools/dist/scope-map.d.ts +0 -51
- package/packages/tools/dist/scope-map.js +0 -1
- package/packages/tools/dist/snippet.d.ts +0 -35
- package/packages/tools/dist/snippet.js +0 -1
- package/packages/tools/dist/stash.d.ts +0 -14
- package/packages/tools/dist/stash.js +0 -1
- package/packages/tools/dist/stratum-card.d.ts +0 -30
- package/packages/tools/dist/stratum-card.js +0 -4
- package/packages/tools/dist/symbol.d.ts +0 -45
- package/packages/tools/dist/symbol.js +0 -3
- package/packages/tools/dist/synthesis-engine.d.ts +0 -13
- package/packages/tools/dist/synthesis-engine.js +0 -6
- package/packages/tools/dist/test-run.d.ts +0 -28
- package/packages/tools/dist/test-run.js +0 -2
- package/packages/tools/dist/text-utils.d.ts +0 -24
- package/packages/tools/dist/text-utils.js +0 -2
- package/packages/tools/dist/time-utils.d.ts +0 -20
- package/packages/tools/dist/time-utils.js +0 -1
- package/packages/tools/dist/trace.d.ts +0 -43
- package/packages/tools/dist/trace.js +0 -2
- package/packages/tools/dist/truncation.d.ts +0 -66
- package/packages/tools/dist/truncation.js +0 -11
- package/packages/tools/dist/watch.d.ts +0 -32
- package/packages/tools/dist/watch.js +0 -1
- package/packages/tools/dist/web-fetch.d.ts +0 -47
- package/packages/tools/dist/web-fetch.js +0 -8
- package/packages/tools/dist/web-search.d.ts +0 -25
- package/packages/tools/dist/web-search.js +0 -1
- package/packages/tools/dist/workset.d.ts +0 -47
- package/packages/tools/dist/workset.js +0 -1
- package/scaffold/__tests__/copilot-inline-shared-protocols.test.mjs +0 -39
- /package/packages/server/dist/{config.js → config-C5IU9Lau.js} +0 -0
- /package/packages/server/dist/{dashboard-static.js → dashboard-static-BfIe0Si1.js} +0 -0
- /package/packages/server/dist/{version-check.js → version-check-D4j0Pykd.js} +0 -0
|
@@ -1,61 +1,2161 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
1
|
+
import { ContentType, KnowledgeOrigin } from "../../core/dist/index.js";
|
|
2
|
+
import { IEmbedder } from "../../embeddings/dist/index.js";
|
|
3
|
+
import { DepthGroupedResult, GraphEdge, GraphNode, GraphStats, GraphTraversalResult, GraphValidationResult, IGraphStore, IKnowledgeStore, ProcessInfo, Symbol360 } from "../../store/dist/index.js";
|
|
4
|
+
|
|
5
|
+
//#region packages/tools/src/response-envelope.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Standardized response envelope for AI Kit tools (E-009).
|
|
8
|
+
* New tools should return KBResponse<T>. Existing tools can adopt gradually.
|
|
9
|
+
*/
|
|
10
|
+
interface KBNextHint {
|
|
11
|
+
tool: string;
|
|
12
|
+
reason: string;
|
|
13
|
+
suggested_args?: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
interface KBError {
|
|
16
|
+
code: KBErrorCode;
|
|
17
|
+
category: 'input' | 'runtime' | 'dependency' | 'timeout' | 'not_found';
|
|
18
|
+
retryable: boolean;
|
|
19
|
+
message: string;
|
|
20
|
+
suggestion?: string;
|
|
21
|
+
}
|
|
22
|
+
type KBErrorCode = 'SYMBOL_NOT_FOUND' | 'INDEX_STALE' | 'TREE_SITTER_UNAVAILABLE' | 'PARSE_FAILED' | 'BUDGET_EXCEEDED' | 'PATH_NOT_FOUND' | 'EMBEDDING_COLD_START' | 'ANALYSIS_FAILED';
|
|
23
|
+
interface KBResponseMeta {
|
|
24
|
+
durationMs: number;
|
|
25
|
+
tokensEstimate: number;
|
|
26
|
+
detail: 'summary' | 'errors' | 'full';
|
|
27
|
+
cached: boolean;
|
|
28
|
+
truncated: boolean;
|
|
29
|
+
caveats?: string[];
|
|
30
|
+
}
|
|
31
|
+
interface KBResponse<T> {
|
|
32
|
+
ok: boolean;
|
|
33
|
+
tool: string;
|
|
34
|
+
summary: string;
|
|
35
|
+
data?: T;
|
|
36
|
+
meta: KBResponseMeta;
|
|
37
|
+
next?: KBNextHint[];
|
|
38
|
+
error?: KBError;
|
|
39
|
+
}
|
|
40
|
+
/** Create a success response. */
|
|
41
|
+
declare function okResponse<T>(tool: string, summary: string, data: T, meta: Partial<KBResponseMeta> & {
|
|
42
|
+
durationMs: number;
|
|
43
|
+
}, next?: KBNextHint[]): KBResponse<T>;
|
|
44
|
+
/** Create an error response. */
|
|
45
|
+
declare function errorResponse(tool: string, error: KBError, durationMs: number): KBResponse<never>;
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region packages/tools/src/audit.d.ts
|
|
48
|
+
type AuditCheck = 'structure' | 'dependencies' | 'patterns' | 'health' | 'dead_symbols' | 'check' | 'entry_points';
|
|
49
|
+
interface AuditOptions {
|
|
50
|
+
/** Root path to audit (default: cwd) */
|
|
51
|
+
path?: string;
|
|
52
|
+
/** Which checks to run (default: all) */
|
|
53
|
+
checks?: AuditCheck[];
|
|
54
|
+
/** Detail level (default: 'summary') */
|
|
55
|
+
detail?: 'summary' | 'full';
|
|
56
|
+
}
|
|
57
|
+
interface AuditRecommendation {
|
|
58
|
+
priority: 'high' | 'medium' | 'low';
|
|
59
|
+
area: string;
|
|
60
|
+
message: string;
|
|
61
|
+
}
|
|
62
|
+
interface AuditData {
|
|
63
|
+
score: number;
|
|
64
|
+
structure?: {
|
|
65
|
+
files: number;
|
|
66
|
+
packages: number;
|
|
67
|
+
languages: Record<string, number>;
|
|
68
|
+
};
|
|
69
|
+
dependencies?: {
|
|
70
|
+
external: number;
|
|
71
|
+
internal: number;
|
|
72
|
+
};
|
|
73
|
+
patterns?: Array<{
|
|
74
|
+
name: string;
|
|
75
|
+
confidence: string;
|
|
76
|
+
count: number;
|
|
77
|
+
}>;
|
|
78
|
+
health?: {
|
|
79
|
+
score: number;
|
|
80
|
+
checks: number;
|
|
81
|
+
passed: number;
|
|
82
|
+
warned: number;
|
|
83
|
+
failed: number;
|
|
84
|
+
};
|
|
85
|
+
deadSymbols?: {
|
|
86
|
+
source: number;
|
|
87
|
+
docs: number;
|
|
88
|
+
};
|
|
89
|
+
entryPoints?: {
|
|
90
|
+
total: number;
|
|
91
|
+
types: Record<string, number>;
|
|
92
|
+
};
|
|
93
|
+
typecheck?: {
|
|
94
|
+
passed: boolean;
|
|
95
|
+
errorCount: number;
|
|
96
|
+
topErrors: string[];
|
|
97
|
+
};
|
|
98
|
+
lint?: {
|
|
99
|
+
passed: boolean;
|
|
100
|
+
errorCount: number;
|
|
101
|
+
topErrors: string[];
|
|
102
|
+
};
|
|
103
|
+
recommendations: AuditRecommendation[];
|
|
104
|
+
}
|
|
105
|
+
declare function audit(store: IKnowledgeStore, embedder: IEmbedder, options?: AuditOptions): Promise<KBResponse<AuditData>>;
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region packages/tools/src/batch.d.ts
|
|
108
|
+
interface BatchOperation {
|
|
109
|
+
/** Unique ID for this operation */
|
|
110
|
+
id: string;
|
|
111
|
+
/** Operation type */
|
|
112
|
+
type: string;
|
|
113
|
+
/** Arguments for the operation */
|
|
114
|
+
args: Record<string, unknown>;
|
|
115
|
+
}
|
|
116
|
+
interface BatchResult {
|
|
117
|
+
id: string;
|
|
118
|
+
status: 'success' | 'error';
|
|
119
|
+
result?: unknown;
|
|
120
|
+
error?: string;
|
|
121
|
+
durationMs: number;
|
|
122
|
+
}
|
|
123
|
+
interface BatchOptions {
|
|
124
|
+
/** Max concurrent operations (default: 4) */
|
|
125
|
+
concurrency?: number;
|
|
126
|
+
}
|
|
127
|
+
declare function batch(operations: BatchOperation[], executor: (op: BatchOperation) => Promise<unknown>, options?: BatchOptions): Promise<BatchResult[]>;
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region packages/tools/src/changelog.d.ts
|
|
130
|
+
/**
|
|
131
|
+
* aikit_changelog — Generate a changelog from git history.
|
|
132
|
+
*/
|
|
133
|
+
type ChangelogFormat = 'grouped' | 'chronological' | 'per-scope';
|
|
134
|
+
interface ChangelogOptions {
|
|
135
|
+
from: string;
|
|
136
|
+
to?: string;
|
|
137
|
+
format?: ChangelogFormat;
|
|
138
|
+
includeBreaking?: boolean;
|
|
139
|
+
cwd?: string;
|
|
140
|
+
}
|
|
141
|
+
interface ChangelogEntry {
|
|
142
|
+
hash: string;
|
|
143
|
+
type: string;
|
|
144
|
+
scope: string;
|
|
145
|
+
subject: string;
|
|
146
|
+
body: string;
|
|
147
|
+
author: string;
|
|
148
|
+
date: string;
|
|
149
|
+
breaking: boolean;
|
|
150
|
+
}
|
|
151
|
+
interface ChangelogResult {
|
|
152
|
+
entries: ChangelogEntry[];
|
|
153
|
+
markdown: string;
|
|
154
|
+
stats: {
|
|
155
|
+
total: number;
|
|
156
|
+
breaking: number;
|
|
157
|
+
types: Record<string, number>;
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
declare function changelog(options: ChangelogOptions): ChangelogResult;
|
|
161
|
+
/** Exported for testing */
|
|
162
|
+
declare function formatChangelog(entries: ChangelogEntry[], format: ChangelogFormat, includeBreaking: boolean): string;
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region packages/tools/src/parse-output.d.ts
|
|
165
|
+
/**
|
|
166
|
+
* aikit_parse_output — Structured parsers for common build tool output.
|
|
167
|
+
*
|
|
168
|
+
* Converts noisy text output from tsc, vitest, biome, and git status
|
|
169
|
+
* into structured JSON that LLM agents can act on directly.
|
|
170
|
+
*/
|
|
171
|
+
interface ParsedError {
|
|
172
|
+
file: string;
|
|
173
|
+
line?: number;
|
|
174
|
+
column?: number;
|
|
175
|
+
severity: 'error' | 'warning' | 'info';
|
|
176
|
+
code?: string;
|
|
177
|
+
message: string;
|
|
178
|
+
}
|
|
179
|
+
interface ParsedTestResult {
|
|
180
|
+
name: string;
|
|
181
|
+
file?: string;
|
|
182
|
+
status: 'pass' | 'fail' | 'skip';
|
|
183
|
+
duration?: number;
|
|
184
|
+
error?: string;
|
|
185
|
+
}
|
|
186
|
+
interface ParsedTestSummary {
|
|
187
|
+
tests: ParsedTestResult[];
|
|
188
|
+
passed: number;
|
|
189
|
+
failed: number;
|
|
190
|
+
skipped: number;
|
|
191
|
+
duration?: number;
|
|
192
|
+
suites?: number;
|
|
193
|
+
}
|
|
194
|
+
interface ParsedGitStatus {
|
|
195
|
+
staged: Array<{
|
|
196
|
+
status: string;
|
|
197
|
+
file: string;
|
|
198
|
+
}>;
|
|
199
|
+
unstaged: Array<{
|
|
200
|
+
status: string;
|
|
201
|
+
file: string;
|
|
202
|
+
}>;
|
|
203
|
+
untracked: string[];
|
|
204
|
+
branch?: string;
|
|
205
|
+
}
|
|
206
|
+
type ParsedOutput = {
|
|
207
|
+
tool: 'tsc';
|
|
208
|
+
errors: ParsedError[];
|
|
209
|
+
} | {
|
|
210
|
+
tool: 'vitest';
|
|
211
|
+
summary: ParsedTestSummary;
|
|
212
|
+
} | {
|
|
213
|
+
tool: 'biome';
|
|
214
|
+
errors: ParsedError[];
|
|
215
|
+
} | {
|
|
216
|
+
tool: 'git-status';
|
|
217
|
+
status: ParsedGitStatus;
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* Parse `tsc` output into structured errors.
|
|
221
|
+
*
|
|
222
|
+
* Example line: `src/foo.ts(10,5): error TS2339: Property 'x' does not exist`
|
|
223
|
+
*/
|
|
224
|
+
declare function parseTsc(output: string): ParsedError[];
|
|
225
|
+
/**
|
|
226
|
+
* Parse vitest run output into structured test results.
|
|
227
|
+
*/
|
|
228
|
+
declare function parseVitest(output: string): ParsedTestSummary;
|
|
229
|
+
/**
|
|
230
|
+
* Parse biome check/lint output into structured errors.
|
|
231
|
+
*
|
|
232
|
+
* Example: `src/foo.ts:10:5 lint/suspicious/noDoubleEquals ━━━`
|
|
233
|
+
* ` × Use === instead of ==`
|
|
234
|
+
*/
|
|
235
|
+
declare function parseBiome(output: string): ParsedError[];
|
|
236
|
+
/**
|
|
237
|
+
* Parse `git status --porcelain=v1 -b` output into structured status.
|
|
238
|
+
*/
|
|
239
|
+
declare function parseGitStatus(output: string): ParsedGitStatus;
|
|
240
|
+
/**
|
|
241
|
+
* Auto-detect the tool from output content and parse accordingly.
|
|
242
|
+
*/
|
|
243
|
+
declare function parseOutput(output: string, tool?: string): ParsedOutput;
|
|
244
|
+
//#endregion
|
|
245
|
+
//#region packages/tools/src/check.d.ts
|
|
246
|
+
interface CheckOptions {
|
|
247
|
+
/** Specific files to check (if empty, checks all) */
|
|
248
|
+
files?: string[];
|
|
249
|
+
/** Working directory */
|
|
250
|
+
cwd?: string;
|
|
251
|
+
/** Skip typecheck */
|
|
252
|
+
skipTypes?: boolean;
|
|
253
|
+
/** Skip lint */
|
|
254
|
+
skipLint?: boolean;
|
|
255
|
+
/** Detail level: summary (default, minimal), errors (parsed errors), full (includes raw) */
|
|
256
|
+
detail?: 'summary' | 'errors' | 'full';
|
|
257
|
+
}
|
|
258
|
+
interface CheckSummaryResult {
|
|
259
|
+
passed: boolean;
|
|
260
|
+
tsc: {
|
|
261
|
+
passed: boolean;
|
|
262
|
+
errorCount: number;
|
|
263
|
+
warningCount: number;
|
|
264
|
+
topErrors: string[];
|
|
265
|
+
};
|
|
266
|
+
biome: {
|
|
267
|
+
passed: boolean;
|
|
268
|
+
errorCount: number;
|
|
269
|
+
warningCount: number;
|
|
270
|
+
topErrors: string[];
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
interface CheckResult {
|
|
274
|
+
tsc: {
|
|
275
|
+
errors: ParsedError[];
|
|
276
|
+
passed: boolean;
|
|
277
|
+
raw?: string;
|
|
278
|
+
};
|
|
279
|
+
biome: {
|
|
280
|
+
errors: ParsedError[];
|
|
281
|
+
passed: boolean;
|
|
282
|
+
raw?: string;
|
|
283
|
+
};
|
|
284
|
+
passed: boolean;
|
|
285
|
+
}
|
|
286
|
+
declare function check(options?: CheckOptions): Promise<CheckResult>;
|
|
287
|
+
/** Produce a minimal summary for LLM consumption (~300 tokens) */
|
|
288
|
+
declare function summarizeCheckResult(result: CheckResult): CheckSummaryResult;
|
|
289
|
+
//#endregion
|
|
290
|
+
//#region packages/tools/src/checkpoint.d.ts
|
|
291
|
+
interface Checkpoint {
|
|
292
|
+
id: string;
|
|
293
|
+
label: string;
|
|
294
|
+
createdAt: string;
|
|
295
|
+
data: Record<string, unknown>;
|
|
296
|
+
files?: string[];
|
|
297
|
+
notes?: string;
|
|
298
|
+
}
|
|
299
|
+
declare function checkpointSave(label: string, data: Record<string, unknown>, options?: {
|
|
300
|
+
files?: string[];
|
|
301
|
+
notes?: string;
|
|
302
|
+
cwd?: string;
|
|
303
|
+
}): Checkpoint;
|
|
304
|
+
declare function checkpointLoad(id: string, cwd?: string): Checkpoint | undefined;
|
|
305
|
+
declare function checkpointList(cwd?: string): Checkpoint[];
|
|
306
|
+
declare function checkpointLatest(cwd?: string): Checkpoint | undefined;
|
|
307
|
+
//#endregion
|
|
308
|
+
//#region packages/tools/src/codemod.d.ts
|
|
309
|
+
interface CodemodRule {
|
|
310
|
+
/** Description of what this rule does */
|
|
311
|
+
description: string;
|
|
312
|
+
/** Regex pattern to match (string form, will be compiled) */
|
|
313
|
+
pattern: string;
|
|
314
|
+
/** Replacement string (supports $1, $2 capture groups) */
|
|
315
|
+
replacement: string;
|
|
316
|
+
/** Optional: only apply to files matching this glob */
|
|
317
|
+
fileFilter?: string;
|
|
318
|
+
}
|
|
319
|
+
interface CodemodOptions {
|
|
320
|
+
/** Root directory to apply codemod in */
|
|
321
|
+
rootPath: string;
|
|
322
|
+
/** Rules to apply */
|
|
323
|
+
rules: CodemodRule[];
|
|
324
|
+
/** File extensions to process */
|
|
325
|
+
extensions?: string[];
|
|
326
|
+
/** Exclude patterns */
|
|
327
|
+
exclude?: string[];
|
|
328
|
+
/** Dry run */
|
|
329
|
+
dryRun?: boolean;
|
|
330
|
+
}
|
|
331
|
+
interface CodemodChange {
|
|
332
|
+
rule: string;
|
|
333
|
+
path: string;
|
|
334
|
+
line: number;
|
|
335
|
+
before: string;
|
|
336
|
+
after: string;
|
|
337
|
+
}
|
|
338
|
+
interface CodemodResult {
|
|
339
|
+
changes: CodemodChange[];
|
|
340
|
+
rulesApplied: number;
|
|
341
|
+
filesModified: number;
|
|
342
|
+
dryRun: boolean;
|
|
343
|
+
}
|
|
344
|
+
declare function codemod(options: CodemodOptions): Promise<CodemodResult>;
|
|
345
|
+
//#endregion
|
|
346
|
+
//#region packages/tools/src/file-cache.d.ts
|
|
347
|
+
interface FileCacheEntry {
|
|
348
|
+
/** Full file content */
|
|
349
|
+
content: string;
|
|
350
|
+
/** SHA-256 hash of content */
|
|
351
|
+
hash: string;
|
|
352
|
+
/** Line count */
|
|
353
|
+
lines: number;
|
|
354
|
+
/** Estimated token count (~chars/4) */
|
|
355
|
+
estimatedTokens: number;
|
|
356
|
+
/** How many times this file has been requested */
|
|
357
|
+
hitCount: number;
|
|
358
|
+
/** Whether content changed since last read (false on cache hit) */
|
|
359
|
+
changed: boolean;
|
|
360
|
+
}
|
|
361
|
+
interface FileCacheStats {
|
|
362
|
+
totalReads: number;
|
|
363
|
+
cacheHits: number;
|
|
364
|
+
filesTracked: number;
|
|
365
|
+
}
|
|
366
|
+
declare class FileCache {
|
|
367
|
+
private cache;
|
|
368
|
+
private totalReads;
|
|
369
|
+
private cacheHits;
|
|
370
|
+
private static readonly MAX_ENTRIES;
|
|
371
|
+
/**
|
|
372
|
+
* Get file content with deduplication.
|
|
373
|
+
* First call: reads from disk, hashes, caches.
|
|
374
|
+
* Subsequent calls: checks mtime → if unchanged, cache hit (skip read).
|
|
375
|
+
* If mtime changed: re-reads, re-hashes, checks if content actually changed.
|
|
376
|
+
*/
|
|
377
|
+
get(filePath: string): Promise<FileCacheEntry>;
|
|
378
|
+
/** Remove a single file from cache. Returns true if it was cached. */
|
|
379
|
+
invalidate(filePath: string): boolean;
|
|
380
|
+
/** Clear all cached files. Returns how many were cleared. */
|
|
381
|
+
clear(): number;
|
|
382
|
+
/** Get cache statistics. */
|
|
383
|
+
stats(): FileCacheStats;
|
|
384
|
+
}
|
|
385
|
+
//#endregion
|
|
386
|
+
//#region packages/tools/src/compact.d.ts
|
|
387
|
+
interface CompactOptions {
|
|
388
|
+
/** The text to compress (at least one of text/path required) */
|
|
389
|
+
text?: string;
|
|
390
|
+
/** File path to read server-side — avoids read_file round-trip (at least one of text/path required) */
|
|
391
|
+
path?: string;
|
|
392
|
+
/** The focus query — what are we trying to understand? */
|
|
393
|
+
query: string;
|
|
394
|
+
/** Target output size in characters (default: 3000) */
|
|
395
|
+
maxChars?: number;
|
|
396
|
+
/** Token budget — when set, overrides maxChars (approx 4 chars per token) */
|
|
397
|
+
tokenBudget?: number;
|
|
398
|
+
/** Minimum similarity score to include a segment (0-1, default: 0.3) */
|
|
399
|
+
minScore?: number;
|
|
400
|
+
/** Segmentation strategy (default: 'paragraph') */
|
|
401
|
+
segmentation?: 'paragraph' | 'sentence' | 'line';
|
|
402
|
+
/** Optional file cache — use cached content instead of raw readFile */
|
|
403
|
+
cache?: FileCache;
|
|
404
|
+
/**
|
|
405
|
+
* Content delivery mode:
|
|
406
|
+
* - 'full' (default): Return compressed text as normal
|
|
407
|
+
* - 'delta': Return only changes since last read (for re-reads of same file)
|
|
408
|
+
*/
|
|
409
|
+
mode?: 'full' | 'delta';
|
|
410
|
+
}
|
|
411
|
+
interface CompactResult {
|
|
412
|
+
/** The compressed text */
|
|
413
|
+
text: string;
|
|
414
|
+
/** Original size in chars */
|
|
415
|
+
originalChars: number;
|
|
416
|
+
/** Compressed size in chars */
|
|
417
|
+
compressedChars: number;
|
|
418
|
+
/** Compression ratio (0-1, lower = more compressed) */
|
|
419
|
+
ratio: number;
|
|
420
|
+
/** Number of segments kept / total */
|
|
421
|
+
segmentsKept: number;
|
|
422
|
+
segmentsTotal: number;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Compress text by extracting segments most relevant to a query.
|
|
426
|
+
*/
|
|
427
|
+
declare function compact(embedder: IEmbedder, options: CompactOptions): Promise<CompactResult>;
|
|
428
|
+
//#endregion
|
|
429
|
+
//#region packages/tools/src/compression/types.d.ts
|
|
430
|
+
/**
|
|
431
|
+
* Compression mode determines how aggressively output is compressed.
|
|
432
|
+
*/
|
|
433
|
+
type CompressionMode = 'structural' | 'heuristic' | 'aggressive';
|
|
434
|
+
/**
|
|
435
|
+
* Context provided to compression rules for matching and processing.
|
|
436
|
+
*/
|
|
437
|
+
interface CompressionContext {
|
|
438
|
+
/** Raw output text (ANSI already stripped) */
|
|
439
|
+
text: string;
|
|
440
|
+
/** Detected tool/source (e.g., 'git', 'npm', 'vitest', 'docker') */
|
|
441
|
+
tool: string;
|
|
442
|
+
/** Compression mode */
|
|
443
|
+
mode: CompressionMode;
|
|
444
|
+
/** Maximum output characters */
|
|
445
|
+
maxChars: number;
|
|
446
|
+
/** Original character count before any processing */
|
|
447
|
+
originalChars: number;
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Result from applying a compression rule.
|
|
451
|
+
*/
|
|
452
|
+
interface CompressionResult {
|
|
453
|
+
/** Compressed text */
|
|
454
|
+
text: string;
|
|
455
|
+
/** Original character count */
|
|
456
|
+
originalChars: number;
|
|
457
|
+
/** Compressed character count */
|
|
458
|
+
compressedChars: number;
|
|
459
|
+
/** Compression ratio (compressed / original) */
|
|
460
|
+
ratio: number;
|
|
461
|
+
/** Which rule was applied */
|
|
462
|
+
rule: string;
|
|
463
|
+
/** Detected tool */
|
|
464
|
+
tool: string;
|
|
465
|
+
/** Metadata about the compression */
|
|
466
|
+
_meta: {
|
|
467
|
+
truncated: boolean;
|
|
468
|
+
mode: CompressionMode;
|
|
469
|
+
sectionsKept?: number;
|
|
470
|
+
sectionsTotal?: number;
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* A compression rule that can match and process specific output formats.
|
|
475
|
+
*/
|
|
476
|
+
interface CompressionRule {
|
|
477
|
+
/** Unique rule name */
|
|
478
|
+
name: string;
|
|
479
|
+
/** Tool patterns this rule handles (regex or string) */
|
|
480
|
+
toolPatterns: (string | RegExp)[];
|
|
481
|
+
/** Priority (higher = checked first, default 0) */
|
|
482
|
+
priority: number;
|
|
483
|
+
/** Test if this rule can handle the given context */
|
|
484
|
+
match(ctx: CompressionContext): boolean;
|
|
485
|
+
/** Apply compression and return result text */
|
|
486
|
+
compress(ctx: CompressionContext): string;
|
|
487
|
+
}
|
|
488
|
+
//#endregion
|
|
489
|
+
//#region packages/tools/src/compression/engine.d.ts
|
|
490
|
+
/**
|
|
491
|
+
* Register a compression rule. Rules are auto-sorted by priority (highest first).
|
|
492
|
+
*/
|
|
493
|
+
declare function registerRule(rule: CompressionRule): void;
|
|
494
|
+
/**
|
|
495
|
+
* Register multiple compression rules at once.
|
|
496
|
+
*/
|
|
497
|
+
declare function registerRules(newRules: CompressionRule[]): void;
|
|
498
|
+
/**
|
|
499
|
+
* Get all registered rules (for testing/inspection).
|
|
500
|
+
*/
|
|
501
|
+
declare function getRegisteredRules(): readonly CompressionRule[];
|
|
502
|
+
/**
|
|
503
|
+
* Detect the tool that produced the output.
|
|
504
|
+
* Uses heuristic pattern matching on the raw text.
|
|
505
|
+
*/
|
|
506
|
+
declare function detectOutputTool(text: string): string;
|
|
507
|
+
/**
|
|
508
|
+
* Core compression pipeline.
|
|
509
|
+
* 1. Strip ANSI codes
|
|
510
|
+
* 2. Detect tool
|
|
511
|
+
* 3. Find matching rule (priority order)
|
|
512
|
+
* 4. Apply rule or fall back to truncation
|
|
513
|
+
*/
|
|
514
|
+
declare function compressOutput(rawText: string, options?: {
|
|
515
|
+
mode?: CompressionMode;
|
|
516
|
+
maxChars?: number;
|
|
517
|
+
tool?: string;
|
|
518
|
+
}): CompressionResult;
|
|
519
|
+
//#endregion
|
|
520
|
+
//#region packages/tools/src/compress-output.d.ts
|
|
521
|
+
interface CompressOutputOptions {
|
|
522
|
+
/** Raw terminal/shell output text */
|
|
523
|
+
text: string;
|
|
524
|
+
/** Override detected tool (e.g., 'git', 'npm', 'tsc') */
|
|
525
|
+
tool?: string;
|
|
526
|
+
/** Compression mode: structural (default), heuristic, aggressive */
|
|
527
|
+
mode?: CompressionMode;
|
|
528
|
+
/** Maximum output characters (default: 4000) */
|
|
529
|
+
maxChars?: number;
|
|
530
|
+
/** Maximum output tokens (alternative to maxChars, uses 4 chars/token) */
|
|
531
|
+
tokenBudget?: number;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Compress terminal/shell output using intelligent rule-based compression.
|
|
535
|
+
*
|
|
536
|
+
* Automatically detects the tool that produced the output (git, npm, tsc,
|
|
537
|
+
* vitest, docker, kubectl, ESLint, etc.) and applies tool-specific
|
|
538
|
+
* compression strategies that preserve critical information while reducing
|
|
539
|
+
* token count.
|
|
540
|
+
*
|
|
541
|
+
* @example
|
|
542
|
+
* ```ts
|
|
543
|
+
* const result = compressTerminalOutput({
|
|
544
|
+
* text: rawGitDiff,
|
|
545
|
+
* maxChars: 3000,
|
|
546
|
+
* });
|
|
547
|
+
* // result.text contains compressed output
|
|
548
|
+
* // result.rule tells which compression rule was applied
|
|
549
|
+
* // result._meta.truncated tells if output was further truncated
|
|
550
|
+
* ```
|
|
551
|
+
*/
|
|
552
|
+
declare function compressTerminalOutput(options: CompressOutputOptions): CompressionResult;
|
|
553
|
+
//#endregion
|
|
554
|
+
//#region packages/tools/src/compression/scoring.d.ts
|
|
555
|
+
/**
|
|
556
|
+
* Score a line of text by BPE token density (surprise).
|
|
557
|
+
* Higher score = more information-dense content.
|
|
558
|
+
* Range: 0.0 to 1.0
|
|
559
|
+
*/
|
|
560
|
+
declare function bpeSurprise(line: string): number;
|
|
561
|
+
/**
|
|
562
|
+
* Score text lines with composite BPE surprise scoring.
|
|
563
|
+
* Combines token density with rare token frequency.
|
|
564
|
+
*
|
|
565
|
+
* @param lines - Array of text lines to score
|
|
566
|
+
* @returns Array of scores (0.0 to 1.0) in same order as input
|
|
567
|
+
*/
|
|
568
|
+
declare function scoreLines(lines: string[]): number[];
|
|
569
|
+
/**
|
|
570
|
+
* Fallback scoring using Shannon character entropy.
|
|
571
|
+
* Used when BPE tokenizer is unavailable.
|
|
572
|
+
*/
|
|
573
|
+
declare function shannonEntropy(text: string): number;
|
|
574
|
+
/**
|
|
575
|
+
* Score a single line with fallback to entropy if BPE fails.
|
|
576
|
+
*/
|
|
577
|
+
declare function scoreLine(line: string): number;
|
|
578
|
+
//#endregion
|
|
579
|
+
//#region packages/tools/src/data-transform.d.ts
|
|
580
|
+
interface TransformOptions {
|
|
581
|
+
input: unknown;
|
|
582
|
+
expression: string;
|
|
583
|
+
}
|
|
584
|
+
interface TransformResult {
|
|
585
|
+
output: unknown;
|
|
586
|
+
outputString: string;
|
|
587
|
+
}
|
|
588
|
+
declare function dataTransform(options: TransformOptions): TransformResult;
|
|
589
|
+
//#endregion
|
|
590
|
+
//#region packages/tools/src/dead-symbols.d.ts
|
|
591
|
+
interface DeadSymbolOptions {
|
|
592
|
+
/** Root path to scope the search */
|
|
593
|
+
rootPath?: string;
|
|
594
|
+
/** Max symbols to scan (default: 100) */
|
|
595
|
+
limit?: number;
|
|
596
|
+
}
|
|
597
|
+
interface DeadSymbol {
|
|
598
|
+
name: string;
|
|
599
|
+
path: string;
|
|
600
|
+
line: number;
|
|
601
|
+
kind: string;
|
|
602
|
+
}
|
|
603
|
+
interface DeadSymbolResult {
|
|
604
|
+
/** Dead symbols in source files (.ts/.js/.tsx/.jsx) — actionable */
|
|
605
|
+
deadInSource: DeadSymbol[];
|
|
606
|
+
/** Dead symbols in documentation files (.md) — informational */
|
|
607
|
+
deadInDocs: DeadSymbol[];
|
|
608
|
+
totalExports: number;
|
|
609
|
+
totalDeadSource: number;
|
|
610
|
+
totalDeadDocs: number;
|
|
611
|
+
}
|
|
612
|
+
declare function findDeadSymbols(embedder: IEmbedder, store: IKnowledgeStore, options?: DeadSymbolOptions): Promise<DeadSymbolResult>;
|
|
613
|
+
//#endregion
|
|
614
|
+
//#region packages/tools/src/delegate.d.ts
|
|
615
|
+
interface DelegateOptions {
|
|
616
|
+
/** The prompt / task to send to the local model. */
|
|
617
|
+
prompt: string;
|
|
618
|
+
/** Model to use (default: the first available model). */
|
|
619
|
+
model?: string;
|
|
620
|
+
/** Optional system prompt. */
|
|
621
|
+
system?: string;
|
|
622
|
+
/** Optional context to include before the prompt. */
|
|
623
|
+
context?: string;
|
|
624
|
+
/** Temperature (0-2, default: 0.3 for deterministic-ish output). */
|
|
625
|
+
temperature?: number;
|
|
626
|
+
/** Timeout in milliseconds (default: 120_000). */
|
|
627
|
+
timeout?: number;
|
|
628
|
+
/** Ollama base URL (default: http://localhost:11434). */
|
|
629
|
+
baseUrl?: string;
|
|
630
|
+
}
|
|
631
|
+
interface DelegateResult {
|
|
632
|
+
model: string;
|
|
633
|
+
response: string;
|
|
634
|
+
durationMs: number;
|
|
635
|
+
tokenCount?: number;
|
|
636
|
+
error?: string;
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Check if Ollama is running and return available models.
|
|
640
|
+
*/
|
|
641
|
+
declare function delegateListModels(baseUrl?: string): Promise<string[]>;
|
|
642
|
+
/**
|
|
643
|
+
* Delegate a task to a local Ollama model.
|
|
644
|
+
*
|
|
645
|
+
* Fails fast if Ollama is not running or no models are available.
|
|
646
|
+
*/
|
|
647
|
+
declare function delegate(options: DelegateOptions): Promise<DelegateResult>;
|
|
648
|
+
//#endregion
|
|
649
|
+
//#region packages/tools/src/diff-parse.d.ts
|
|
650
|
+
interface DiffFile {
|
|
651
|
+
path: string;
|
|
652
|
+
oldPath?: string;
|
|
653
|
+
status: 'added' | 'modified' | 'deleted' | 'renamed';
|
|
654
|
+
hunks: DiffHunk[];
|
|
655
|
+
additions: number;
|
|
656
|
+
deletions: number;
|
|
657
|
+
}
|
|
658
|
+
interface DiffHunk {
|
|
659
|
+
oldStart: number;
|
|
660
|
+
oldLines: number;
|
|
661
|
+
newStart: number;
|
|
662
|
+
newLines: number;
|
|
663
|
+
header: string;
|
|
664
|
+
changes: DiffChange[];
|
|
665
|
+
}
|
|
666
|
+
interface DiffChange {
|
|
667
|
+
type: 'add' | 'delete' | 'context';
|
|
668
|
+
line: number;
|
|
669
|
+
content: string;
|
|
670
|
+
}
|
|
671
|
+
interface DiffParseOptions {
|
|
672
|
+
diff: string;
|
|
673
|
+
}
|
|
674
|
+
declare function diffParse(options: DiffParseOptions): DiffFile[];
|
|
675
|
+
//#endregion
|
|
676
|
+
//#region packages/tools/src/digest.d.ts
|
|
677
|
+
interface DigestSource {
|
|
678
|
+
/** Unique identifier for this source */
|
|
679
|
+
id: string;
|
|
680
|
+
/** The text to compress */
|
|
681
|
+
text: string;
|
|
682
|
+
/** Priority weight (default: 1). Higher = more budget share */
|
|
683
|
+
weight?: number;
|
|
684
|
+
}
|
|
685
|
+
interface DigestOptions {
|
|
686
|
+
/** Source texts to compress */
|
|
687
|
+
sources: DigestSource[];
|
|
688
|
+
/** Focus query — what matters for the next step? */
|
|
689
|
+
query: string;
|
|
690
|
+
/** Target budget in characters (default: 4000) */
|
|
691
|
+
maxChars?: number;
|
|
692
|
+
/** Key fields to always extract via keyword matching */
|
|
693
|
+
pinFields?: string[];
|
|
694
|
+
/** Segmentation strategy (default: 'paragraph') */
|
|
695
|
+
segmentation?: 'paragraph' | 'sentence' | 'line';
|
|
696
|
+
/**
|
|
697
|
+
* Enable MMR deduplication across segments (default: true).
|
|
698
|
+
* Prevents near-identical segments from consuming budget.
|
|
699
|
+
*/
|
|
700
|
+
dedup?: boolean;
|
|
701
|
+
}
|
|
702
|
+
interface DigestFieldEntry {
|
|
703
|
+
sourceId: string;
|
|
704
|
+
value: string;
|
|
705
|
+
}
|
|
706
|
+
interface DigestResult {
|
|
707
|
+
/** Compressed narrative (all sources merged, reading order maintained) */
|
|
708
|
+
text: string;
|
|
709
|
+
/** Extracted structured fields */
|
|
710
|
+
fields: Record<string, DigestFieldEntry[]>;
|
|
711
|
+
/** Per-source compression stats */
|
|
712
|
+
sourceStats: Array<{
|
|
713
|
+
id: string;
|
|
714
|
+
originalChars: number;
|
|
715
|
+
keptChars: number;
|
|
716
|
+
segmentsKept: number;
|
|
717
|
+
segmentsTotal: number;
|
|
718
|
+
}>;
|
|
719
|
+
totalOriginalChars: number;
|
|
720
|
+
totalCompressedChars: number;
|
|
721
|
+
ratio: number;
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* Compress multiple text sources into a single digest.
|
|
725
|
+
*/
|
|
726
|
+
declare function digest(embedder: IEmbedder, options: DigestOptions): Promise<DigestResult>;
|
|
727
|
+
//#endregion
|
|
728
|
+
//#region packages/tools/src/dogfood-log.d.ts
|
|
729
|
+
/**
|
|
730
|
+
* aikit_dogfood — Review persistent warn/error logs for dogfooding.
|
|
731
|
+
*
|
|
732
|
+
* Reads daily JSONL log files from .aikit-state/logs/ and returns a
|
|
733
|
+
* summarized or detailed view of recent issues. Useful for periodic
|
|
734
|
+
* review cycles to identify and fix recurring problems.
|
|
735
|
+
*/
|
|
736
|
+
interface DogfoodLogEntry {
|
|
737
|
+
ts: string;
|
|
738
|
+
level: 'warn' | 'error';
|
|
739
|
+
component: string;
|
|
740
|
+
msg: string;
|
|
741
|
+
[key: string]: unknown;
|
|
742
|
+
}
|
|
743
|
+
interface DogfoodLogOptions {
|
|
744
|
+
/** Number of days to look back (default: 7) */
|
|
745
|
+
days?: number;
|
|
746
|
+
/** Filter by level */
|
|
747
|
+
level?: 'warn' | 'error';
|
|
748
|
+
/** Filter by component name */
|
|
749
|
+
component?: string;
|
|
750
|
+
/** Maximum entries to return in detail (default: 50) */
|
|
751
|
+
limit?: number;
|
|
752
|
+
}
|
|
753
|
+
interface DogfoodLogGroupedEntry {
|
|
754
|
+
component: string;
|
|
755
|
+
msg: string;
|
|
756
|
+
level: 'warn' | 'error';
|
|
757
|
+
count: number;
|
|
758
|
+
firstSeen: string;
|
|
759
|
+
lastSeen: string;
|
|
760
|
+
}
|
|
761
|
+
interface DogfoodLogResult {
|
|
762
|
+
/** Total entries found matching filters */
|
|
763
|
+
totalEntries: number;
|
|
764
|
+
/** Unique issue groups (by component + message) */
|
|
765
|
+
groups: DogfoodLogGroupedEntry[];
|
|
766
|
+
/** Most recent entries (up to limit) */
|
|
767
|
+
recent: DogfoodLogEntry[];
|
|
768
|
+
/** Date range covered */
|
|
769
|
+
dateRange: {
|
|
770
|
+
from: string;
|
|
771
|
+
to: string;
|
|
772
|
+
};
|
|
773
|
+
}
|
|
774
|
+
declare function dogfoodLog(options?: DogfoodLogOptions): DogfoodLogResult;
|
|
775
|
+
//#endregion
|
|
776
|
+
//#region packages/tools/src/encode.d.ts
|
|
777
|
+
/**
|
|
778
|
+
* aikit_encode — Encoding, decoding, and hashing utilities.
|
|
779
|
+
*/
|
|
780
|
+
type EncodeOperation = 'base64_encode' | 'base64_decode' | 'url_encode' | 'url_decode' | 'sha256' | 'md5' | 'jwt_decode' | 'hex_encode' | 'hex_decode';
|
|
781
|
+
interface EncodeOptions {
|
|
782
|
+
operation: EncodeOperation;
|
|
783
|
+
input: string;
|
|
784
|
+
}
|
|
785
|
+
interface EncodeResult {
|
|
786
|
+
output: string;
|
|
787
|
+
operation: string;
|
|
788
|
+
}
|
|
789
|
+
declare function encode(options: EncodeOptions): EncodeResult;
|
|
790
|
+
//#endregion
|
|
791
|
+
//#region packages/tools/src/env-info.d.ts
|
|
792
|
+
/**
|
|
793
|
+
* aikit_env — System environment and runtime information.
|
|
794
|
+
*/
|
|
795
|
+
interface EnvInfoOptions {
|
|
796
|
+
includeEnv?: boolean;
|
|
797
|
+
filterEnv?: string;
|
|
798
|
+
showSensitive?: boolean;
|
|
799
|
+
}
|
|
800
|
+
interface EnvInfoResult {
|
|
801
|
+
system: {
|
|
802
|
+
platform: string;
|
|
803
|
+
arch: string;
|
|
804
|
+
release: string;
|
|
805
|
+
hostname: string;
|
|
806
|
+
type: string;
|
|
807
|
+
cpus: number;
|
|
808
|
+
memoryTotalGb: number;
|
|
809
|
+
memoryFreeGb: number;
|
|
810
|
+
};
|
|
811
|
+
runtime: {
|
|
812
|
+
node: string;
|
|
813
|
+
v8: string;
|
|
814
|
+
};
|
|
815
|
+
cwd: string;
|
|
816
|
+
env?: Record<string, string>;
|
|
817
|
+
}
|
|
818
|
+
declare function envInfo(options?: EnvInfoOptions): EnvInfoResult;
|
|
819
|
+
//#endregion
|
|
820
|
+
//#region packages/tools/src/eval.d.ts
|
|
821
|
+
interface EvalOptions {
|
|
822
|
+
code: string;
|
|
823
|
+
lang?: 'js' | 'ts';
|
|
824
|
+
timeout?: number;
|
|
825
|
+
}
|
|
826
|
+
interface EvalResult {
|
|
827
|
+
success: boolean;
|
|
828
|
+
output: string;
|
|
829
|
+
error?: string;
|
|
830
|
+
durationMs: number;
|
|
831
|
+
}
|
|
832
|
+
declare function evaluate(options: EvalOptions): EvalResult;
|
|
833
|
+
//#endregion
|
|
834
|
+
//#region packages/tools/src/evidence-map.d.ts
|
|
835
|
+
/**
|
|
836
|
+
* aikit_evidence_map — FORGE Evidence Map CRUD + Gate evaluator.
|
|
837
|
+
*
|
|
838
|
+
* Structured storage, validation, and gate evaluation for FORGE Evidence Map entries.
|
|
839
|
+
* Persisted in .aikit-state/evidence-maps.json.
|
|
840
|
+
*/
|
|
841
|
+
type EvidenceStatus = 'V' | 'A' | 'U';
|
|
842
|
+
type UnknownType = 'contract' | 'convention' | 'freshness' | 'runtime' | 'data-flow' | 'impact';
|
|
843
|
+
type GateDecision = 'YIELD' | 'HOLD' | 'HARD_BLOCK' | 'FORCED_DELIVERY';
|
|
844
|
+
type ForgeTier = 'floor' | 'standard' | 'critical';
|
|
845
|
+
type SafetyGate = 'provenance' | 'commitment' | 'coverage';
|
|
846
|
+
interface EvidenceEntry {
|
|
847
|
+
id: number;
|
|
848
|
+
claim: string;
|
|
849
|
+
status: EvidenceStatus;
|
|
850
|
+
receipt: string;
|
|
851
|
+
criticalPath: boolean;
|
|
852
|
+
unknownType?: UnknownType;
|
|
853
|
+
safetyGate?: SafetyGate;
|
|
854
|
+
}
|
|
855
|
+
interface EvidenceMapState {
|
|
856
|
+
taskId: string;
|
|
857
|
+
tier: ForgeTier;
|
|
858
|
+
entries: EvidenceEntry[];
|
|
859
|
+
createdAt: string;
|
|
860
|
+
updatedAt: string;
|
|
861
|
+
}
|
|
862
|
+
interface SafetyGateResult {
|
|
863
|
+
provenance: 'pass' | 'fail';
|
|
864
|
+
commitment: 'pass' | 'fail';
|
|
865
|
+
coverage: 'pass' | 'fail';
|
|
866
|
+
failures: string[];
|
|
867
|
+
}
|
|
868
|
+
interface GateResult {
|
|
869
|
+
decision: GateDecision;
|
|
870
|
+
reason: string;
|
|
871
|
+
unresolvedCritical: EvidenceEntry[];
|
|
872
|
+
warnings: string[];
|
|
873
|
+
stats: {
|
|
874
|
+
total: number;
|
|
875
|
+
verified: number;
|
|
876
|
+
assumed: number;
|
|
877
|
+
unresolved: number;
|
|
878
|
+
};
|
|
879
|
+
safetyGates?: SafetyGateResult;
|
|
880
|
+
annotation?: string;
|
|
881
|
+
}
|
|
882
|
+
type EvidenceMapAction = {
|
|
883
|
+
action: 'create';
|
|
884
|
+
taskId: string;
|
|
885
|
+
tier: ForgeTier;
|
|
886
|
+
} | {
|
|
887
|
+
action: 'add';
|
|
888
|
+
taskId: string;
|
|
889
|
+
claim: string;
|
|
890
|
+
status: EvidenceStatus;
|
|
891
|
+
receipt: string;
|
|
892
|
+
criticalPath?: boolean;
|
|
893
|
+
unknownType?: UnknownType;
|
|
894
|
+
safetyGate?: SafetyGate;
|
|
895
|
+
} | {
|
|
896
|
+
action: 'update';
|
|
897
|
+
taskId: string;
|
|
898
|
+
id: number;
|
|
899
|
+
status: EvidenceStatus;
|
|
900
|
+
receipt: string;
|
|
901
|
+
} | {
|
|
902
|
+
action: 'get';
|
|
903
|
+
taskId: string;
|
|
904
|
+
} | {
|
|
905
|
+
action: 'gate';
|
|
906
|
+
taskId: string;
|
|
907
|
+
retryCount?: number;
|
|
908
|
+
} | {
|
|
909
|
+
action: 'list';
|
|
910
|
+
} | {
|
|
911
|
+
action: 'delete';
|
|
912
|
+
taskId: string;
|
|
913
|
+
};
|
|
914
|
+
interface EvidenceMapResult {
|
|
915
|
+
state?: EvidenceMapState;
|
|
916
|
+
states?: EvidenceMapState[];
|
|
917
|
+
entry?: EvidenceEntry;
|
|
918
|
+
gate?: GateResult;
|
|
919
|
+
deleted?: boolean;
|
|
920
|
+
formattedMap?: string;
|
|
921
|
+
}
|
|
922
|
+
declare function evidenceMap(action: EvidenceMapAction, cwd?: string): EvidenceMapResult;
|
|
923
|
+
declare function autoClaimTestFailures(taskId: string, failures: string[], cwd?: string): EvidenceEntry[];
|
|
924
|
+
//#endregion
|
|
925
|
+
//#region packages/tools/src/file-summary.d.ts
|
|
926
|
+
interface FileSummaryOptions {
|
|
927
|
+
path: string;
|
|
928
|
+
/** Pre-loaded content — skip readFile when provided (e.g., from FileCache) */
|
|
929
|
+
content?: string;
|
|
930
|
+
previewLines?: number;
|
|
931
|
+
}
|
|
932
|
+
interface FileSummaryResult {
|
|
933
|
+
path: string;
|
|
934
|
+
lines: number;
|
|
935
|
+
language: string;
|
|
936
|
+
imports: string[];
|
|
937
|
+
exports: string[];
|
|
938
|
+
functions: Array<{
|
|
939
|
+
name: string;
|
|
940
|
+
line: number;
|
|
941
|
+
exported: boolean;
|
|
942
|
+
signature?: string;
|
|
943
|
+
}>;
|
|
944
|
+
classes: Array<{
|
|
945
|
+
name: string;
|
|
946
|
+
line: number;
|
|
947
|
+
exported: boolean;
|
|
948
|
+
signature?: string;
|
|
949
|
+
}>;
|
|
950
|
+
interfaces: Array<{
|
|
951
|
+
name: string;
|
|
952
|
+
line: number;
|
|
953
|
+
exported: boolean;
|
|
954
|
+
}>;
|
|
955
|
+
types: Array<{
|
|
956
|
+
name: string;
|
|
957
|
+
line: number;
|
|
958
|
+
exported: boolean;
|
|
959
|
+
}>;
|
|
960
|
+
/** Import details with external/internal classification (AST-powered) */
|
|
961
|
+
importDetails?: Array<{
|
|
962
|
+
source: string;
|
|
963
|
+
specifiers: string[];
|
|
964
|
+
isExternal: boolean;
|
|
965
|
+
}>;
|
|
966
|
+
/** Intra-file call edges showing which functions call which (AST-powered) */
|
|
967
|
+
callEdges?: Array<{
|
|
968
|
+
caller: string;
|
|
969
|
+
callee: string;
|
|
970
|
+
line: number;
|
|
971
|
+
}>;
|
|
972
|
+
estimatedTokens: number;
|
|
973
|
+
}
|
|
974
|
+
declare function fileSummary(options: FileSummaryOptions): Promise<FileSummaryResult>;
|
|
975
|
+
//#endregion
|
|
976
|
+
//#region packages/tools/src/find.d.ts
|
|
977
|
+
interface FindOptions {
|
|
978
|
+
/** Semantic search query (optional) */
|
|
979
|
+
query?: string;
|
|
980
|
+
/** File glob pattern (optional) */
|
|
981
|
+
glob?: string;
|
|
982
|
+
/** Keyword/regex pattern for text search (optional) */
|
|
983
|
+
pattern?: string;
|
|
984
|
+
/** Max results per strategy (default: 10) */
|
|
985
|
+
limit?: number;
|
|
986
|
+
/** Filter by content type */
|
|
987
|
+
contentType?: ContentType;
|
|
988
|
+
/** Working directory for glob resolution (default: cwd) */
|
|
989
|
+
cwd?: string;
|
|
990
|
+
}
|
|
991
|
+
interface FindResult {
|
|
992
|
+
/** File path (relative to cwd) */
|
|
993
|
+
path: string;
|
|
994
|
+
/** How this result was found */
|
|
995
|
+
source: 'vector' | 'keyword' | 'glob' | 'pattern';
|
|
996
|
+
/** Relevance score (0-1 for vector/keyword, 1 for glob/pattern matches) */
|
|
997
|
+
score: number;
|
|
998
|
+
/** Line range if from AI Kit search */
|
|
999
|
+
lineRange?: {
|
|
1000
|
+
start: number;
|
|
1001
|
+
end: number;
|
|
1002
|
+
};
|
|
1003
|
+
/** Content preview */
|
|
1004
|
+
preview?: string;
|
|
1005
|
+
}
|
|
1006
|
+
interface FindResults {
|
|
1007
|
+
results: FindResult[];
|
|
1008
|
+
strategies: string[];
|
|
1009
|
+
totalFound: number;
|
|
1010
|
+
failedStrategies?: Array<{
|
|
1011
|
+
strategy: string;
|
|
1012
|
+
reason: string;
|
|
1013
|
+
}>;
|
|
1014
|
+
}
|
|
1015
|
+
/**
|
|
1016
|
+
* Run federated search across multiple strategies.
|
|
1017
|
+
*/
|
|
1018
|
+
declare function find(embedder: IEmbedder, store: IKnowledgeStore, options: FindOptions): Promise<FindResults>;
|
|
1019
|
+
//#endregion
|
|
1020
|
+
//#region packages/tools/src/find-examples.d.ts
|
|
1021
|
+
interface FindExamplesOptions {
|
|
1022
|
+
/** Symbol or pattern to find examples of */
|
|
1023
|
+
query: string;
|
|
1024
|
+
/** Max examples to return (default: 5) */
|
|
1025
|
+
limit?: number;
|
|
1026
|
+
/** Filter by content type */
|
|
1027
|
+
contentType?: ContentType;
|
|
1028
|
+
}
|
|
1029
|
+
interface Example {
|
|
1030
|
+
path: string;
|
|
1031
|
+
startLine: number;
|
|
1032
|
+
endLine: number;
|
|
1033
|
+
content: string;
|
|
1034
|
+
relevance: number;
|
|
1035
|
+
context: string;
|
|
1036
|
+
}
|
|
1037
|
+
interface FindExamplesResult {
|
|
1038
|
+
query: string;
|
|
1039
|
+
examples: Example[];
|
|
1040
|
+
totalFound: number;
|
|
1041
|
+
}
|
|
1042
|
+
declare function findExamples(embedder: IEmbedder, store: IKnowledgeStore, options: FindExamplesOptions): Promise<FindExamplesResult>;
|
|
1043
|
+
//#endregion
|
|
1044
|
+
//#region packages/tools/src/forge-classify.d.ts
|
|
1045
|
+
interface ForgeClassifyOptions {
|
|
1046
|
+
/** Files being modified (absolute or relative paths) */
|
|
1047
|
+
files: string[];
|
|
1048
|
+
/** Task description for keyword detection */
|
|
1049
|
+
task: string;
|
|
1050
|
+
/** Root path for package boundary detection */
|
|
1051
|
+
rootPath: string;
|
|
1052
|
+
}
|
|
1053
|
+
interface ClassifyTrigger {
|
|
1054
|
+
rule: string;
|
|
1055
|
+
detail: string;
|
|
1056
|
+
source: 'blast_radius' | 'cross_package' | 'schema_contract' | 'security_auth' | 'task_hint' | 'default';
|
|
1057
|
+
}
|
|
1058
|
+
interface TypedUnknownSeed {
|
|
1059
|
+
description: string;
|
|
1060
|
+
type: 'contract' | 'convention' | 'freshness' | 'runtime' | 'data-flow' | 'impact';
|
|
1061
|
+
suggestedTool: string;
|
|
1062
|
+
}
|
|
1063
|
+
interface ForgeClassifyCeremony {
|
|
1064
|
+
ground: string;
|
|
1065
|
+
build: string;
|
|
1066
|
+
break: string;
|
|
1067
|
+
evidenceMap: string;
|
|
1068
|
+
gate: string;
|
|
1069
|
+
}
|
|
1070
|
+
interface ForgeClassifyResult {
|
|
1071
|
+
tier: ForgeTier;
|
|
1072
|
+
triggers: ClassifyTrigger[];
|
|
1073
|
+
packagesCrossed: string[];
|
|
1074
|
+
hasSchemaChange: boolean;
|
|
1075
|
+
hasSecurityPath: boolean;
|
|
1076
|
+
typedUnknownSeeds: TypedUnknownSeed[];
|
|
1077
|
+
ceremony: ForgeClassifyCeremony;
|
|
1078
|
+
reclassifyHint?: {
|
|
1079
|
+
suggestedTier: ForgeTier;
|
|
1080
|
+
reason: string;
|
|
1081
|
+
};
|
|
1082
|
+
}
|
|
1083
|
+
declare function forgeClassify(options: ForgeClassifyOptions): Promise<ForgeClassifyResult>;
|
|
1084
|
+
//#endregion
|
|
1085
|
+
//#region packages/tools/src/scope-map.d.ts
|
|
1086
|
+
interface ScopeMapOptions {
|
|
1087
|
+
/** Description of the task to scope */
|
|
1088
|
+
task: string;
|
|
1089
|
+
/** Maximum number of files to include (default: 15) */
|
|
1090
|
+
maxFiles?: number;
|
|
1091
|
+
/** Group results by directory (default: true) */
|
|
1092
|
+
groupByDirectory?: boolean;
|
|
1093
|
+
/** Filter by content type */
|
|
1094
|
+
contentType?: ContentType;
|
|
1095
|
+
/** Filter by origin */
|
|
1096
|
+
origin?: KnowledgeOrigin;
|
|
1097
|
+
}
|
|
1098
|
+
interface ScopeMapEntry {
|
|
1099
|
+
/** File path */
|
|
1100
|
+
path: string;
|
|
1101
|
+
/** Why this file is relevant (derived from matched chunks) */
|
|
1102
|
+
reason: string;
|
|
1103
|
+
/** Estimated token count (chars / 4 approximation) */
|
|
1104
|
+
estimatedTokens: number;
|
|
1105
|
+
/** Relevance score (0-1) */
|
|
1106
|
+
relevance: number;
|
|
1107
|
+
/** Line ranges to focus on */
|
|
1108
|
+
focusRanges: Array<{
|
|
1109
|
+
start: number;
|
|
1110
|
+
end: number;
|
|
1111
|
+
heading?: string;
|
|
1112
|
+
}>;
|
|
1113
|
+
}
|
|
1114
|
+
interface ScopeMapResult {
|
|
1115
|
+
/** The task that was analyzed */
|
|
1116
|
+
task: string;
|
|
1117
|
+
/** Prioritized file list */
|
|
1118
|
+
files: ScopeMapEntry[];
|
|
1119
|
+
/** Total estimated tokens across all files */
|
|
1120
|
+
totalEstimatedTokens: number;
|
|
1121
|
+
/** Suggested reading order (file paths) */
|
|
1122
|
+
readingOrder: string[];
|
|
1123
|
+
/** Suggested compact/file_summary commands to reduce context */
|
|
1124
|
+
compactCommands: string[];
|
|
1125
|
+
}
|
|
1126
|
+
/**
|
|
1127
|
+
* Generate a task-scoped reading plan.
|
|
1128
|
+
*/
|
|
1129
|
+
declare function scopeMap(embedder: IEmbedder, store: IKnowledgeStore, options: ScopeMapOptions): Promise<ScopeMapResult>;
|
|
1130
|
+
//#endregion
|
|
1131
|
+
//#region packages/tools/src/forge-ground.d.ts
|
|
1132
|
+
interface ForgeGroundOptions {
|
|
1133
|
+
/** Task description */
|
|
1134
|
+
task: string;
|
|
1135
|
+
/** Target files being modified (absolute paths) */
|
|
1136
|
+
files: string[];
|
|
1137
|
+
/** Root path of the codebase */
|
|
1138
|
+
rootPath: string;
|
|
1139
|
+
/** Max constraint entries to load (default: 3) */
|
|
1140
|
+
maxConstraints?: number;
|
|
1141
|
+
/** Force a specific tier (skip auto-classify) */
|
|
1142
|
+
forceTier?: ForgeTier;
|
|
1143
|
+
/** Task ID for evidence map creation (default: auto-generated from task) */
|
|
1144
|
+
taskId?: string;
|
|
1145
|
+
}
|
|
1146
|
+
interface ConstraintRef {
|
|
1147
|
+
source: string;
|
|
1148
|
+
snippet: string;
|
|
1149
|
+
relevance: number;
|
|
1150
|
+
}
|
|
1151
|
+
interface ForgeGroundResult {
|
|
1152
|
+
/** Computed or forced tier */
|
|
1153
|
+
tier: ForgeTier;
|
|
1154
|
+
/** Classification triggers (empty if tier was forced) */
|
|
1155
|
+
classifyTriggers: ClassifyTrigger[];
|
|
1156
|
+
/** Scope map (relevant files with focus ranges) — null for Floor tier */
|
|
1157
|
+
scopeMap: ScopeMapResult | null;
|
|
1158
|
+
/** Typed Unknown Queue seeds */
|
|
1159
|
+
typedUnknownSeeds: TypedUnknownSeed[];
|
|
1160
|
+
/** Constraint seed — relevant AI Kit entries from decisions/patterns */
|
|
1161
|
+
constraints: ConstraintRef[];
|
|
1162
|
+
/** File summaries for target files */
|
|
1163
|
+
fileSummaries: Array<{
|
|
1164
|
+
path: string;
|
|
1165
|
+
exports: string[];
|
|
1166
|
+
functions: string[];
|
|
1167
|
+
lines: number;
|
|
1168
|
+
error?: string;
|
|
1169
|
+
}>;
|
|
1170
|
+
/** Evidence map task ID (created if Standard or Critical) */
|
|
1171
|
+
evidenceMapTaskId: string | null;
|
|
1172
|
+
/** Total estimated tokens for this Ground output */
|
|
1173
|
+
estimatedTokens: number;
|
|
1174
|
+
/** Ceremony recommendations for this tier */
|
|
1175
|
+
ceremony: {
|
|
1176
|
+
ground: string;
|
|
1177
|
+
build: string;
|
|
1178
|
+
break: string;
|
|
1179
|
+
evidenceMap: string;
|
|
1180
|
+
gate: string;
|
|
1181
|
+
};
|
|
1182
|
+
}
|
|
1183
|
+
declare function forgeGround(embedder: IEmbedder, store: IKnowledgeStore, options: ForgeGroundOptions): Promise<ForgeGroundResult>;
|
|
1184
|
+
//#endregion
|
|
1185
|
+
//#region packages/tools/src/git-context.d.ts
|
|
1186
|
+
interface GitContextOptions {
|
|
1187
|
+
cwd?: string;
|
|
1188
|
+
commitCount?: number;
|
|
1189
|
+
includeDiff?: boolean;
|
|
1190
|
+
}
|
|
1191
|
+
interface GitContextResult {
|
|
1192
|
+
gitRoot: string;
|
|
1193
|
+
branch: string;
|
|
1194
|
+
status: {
|
|
1195
|
+
staged: string[];
|
|
1196
|
+
modified: string[];
|
|
1197
|
+
untracked: string[];
|
|
1198
|
+
};
|
|
1199
|
+
recentCommits: Array<{
|
|
1200
|
+
hash: string;
|
|
1201
|
+
message: string;
|
|
1202
|
+
author: string;
|
|
1203
|
+
date: string;
|
|
1204
|
+
}>;
|
|
1205
|
+
diff?: string;
|
|
1206
|
+
}
|
|
1207
|
+
declare function gitContext(options?: GitContextOptions): Promise<GitContextResult>;
|
|
1208
|
+
//#endregion
|
|
1209
|
+
//#region packages/tools/src/graph-query.d.ts
|
|
1210
|
+
interface GraphQueryOptions {
|
|
1211
|
+
/** Action: query nodes, traverse from a node, get stats, or add data */
|
|
1212
|
+
action: 'find_nodes' | 'find_edges' | 'neighbors' | 'traverse' | 'stats' | 'validate' | 'add' | 'delete' | 'clear' | 'detect_communities' | 'set_community' | 'trace_process' | 'list_processes' | 'delete_process' | 'depth_traverse' | 'cohesion' | 'symbol360';
|
|
1213
|
+
/** Node type filter (for find_nodes) */
|
|
1214
|
+
nodeType?: string;
|
|
1215
|
+
/** Name pattern (LIKE %pattern%) for find_nodes */
|
|
1216
|
+
namePattern?: string;
|
|
1217
|
+
/** Source path filter */
|
|
1218
|
+
sourcePath?: string;
|
|
1219
|
+
/** Node ID for neighbors/traverse/delete */
|
|
1220
|
+
nodeId?: string;
|
|
1221
|
+
/** Edge type filter */
|
|
1222
|
+
edgeType?: string;
|
|
1223
|
+
/** From node ID (for find_edges) */
|
|
1224
|
+
fromId?: string;
|
|
1225
|
+
/** To node ID (for find_edges) */
|
|
1226
|
+
toId?: string;
|
|
1227
|
+
/** Traversal direction */
|
|
1228
|
+
direction?: 'outgoing' | 'incoming' | 'both';
|
|
1229
|
+
/** Max traversal depth (default: 2) */
|
|
1230
|
+
maxDepth?: number;
|
|
1231
|
+
/** Max results (default: 50) */
|
|
1232
|
+
limit?: number;
|
|
1233
|
+
/** Nodes to add (for action=add) */
|
|
1234
|
+
nodes?: Array<{
|
|
1235
|
+
id?: string;
|
|
1236
|
+
type: string;
|
|
1237
|
+
name: string;
|
|
1238
|
+
properties?: Record<string, unknown>;
|
|
1239
|
+
sourceRecordId?: string;
|
|
1240
|
+
sourcePath?: string;
|
|
1241
|
+
}>;
|
|
1242
|
+
/** Edges to add (for action=add) */
|
|
1243
|
+
edges?: Array<{
|
|
1244
|
+
id?: string;
|
|
1245
|
+
fromId: string;
|
|
1246
|
+
toId: string;
|
|
1247
|
+
type: string;
|
|
1248
|
+
weight?: number;
|
|
1249
|
+
properties?: Record<string, unknown>;
|
|
1250
|
+
}>;
|
|
1251
|
+
/** Community label (for set_community, cohesion) */
|
|
1252
|
+
community?: string;
|
|
1253
|
+
/** Process ID (for delete_process) */
|
|
1254
|
+
processId?: string;
|
|
1255
|
+
/** Label for process tracing */
|
|
1256
|
+
label?: string;
|
|
1257
|
+
}
|
|
1258
|
+
interface GraphQueryResult {
|
|
1259
|
+
action: string;
|
|
1260
|
+
nodes?: GraphNode[];
|
|
1261
|
+
edges?: GraphEdge[];
|
|
1262
|
+
stats?: GraphStats;
|
|
1263
|
+
validation?: GraphValidationResult;
|
|
1264
|
+
communities?: Record<string, string[]>;
|
|
1265
|
+
process?: ProcessInfo;
|
|
1266
|
+
processes?: ProcessInfo[];
|
|
1267
|
+
depthGroups?: DepthGroupedResult;
|
|
1268
|
+
cohesionScore?: number;
|
|
1269
|
+
symbol360?: Symbol360;
|
|
1270
|
+
nodesAdded?: number;
|
|
1271
|
+
edgesAdded?: number;
|
|
1272
|
+
deleted?: number;
|
|
1273
|
+
summary: string;
|
|
1274
|
+
}
|
|
1275
|
+
declare function graphQuery(graphStore: IGraphStore, options: GraphQueryOptions): Promise<GraphQueryResult>;
|
|
1276
|
+
interface GraphAugmentOptions {
|
|
1277
|
+
/** Max graph hops from each vector hit (default: 1) */
|
|
1278
|
+
hops?: number;
|
|
1279
|
+
/** Edge type filter for graph expansion */
|
|
1280
|
+
edgeType?: string;
|
|
1281
|
+
/** Max graph nodes per vector hit (default: 5) */
|
|
1282
|
+
maxPerHit?: number;
|
|
1283
|
+
}
|
|
1284
|
+
interface GraphAugmentedResult {
|
|
1285
|
+
/** Original search result record ID */
|
|
1286
|
+
recordId: string;
|
|
1287
|
+
/** Original similarity score */
|
|
1288
|
+
score: number;
|
|
1289
|
+
/** Source path of the matched record */
|
|
1290
|
+
sourcePath: string;
|
|
1291
|
+
/** Graph nodes connected to this record (via sourceRecordId) */
|
|
1292
|
+
graphContext: GraphTraversalResult;
|
|
1293
|
+
}
|
|
1294
|
+
/**
|
|
1295
|
+
* Augment vector search results with graph context.
|
|
1296
|
+
* For each search hit, finds linked graph nodes and traverses their connections.
|
|
1297
|
+
*/
|
|
1298
|
+
declare function graphAugmentSearch(graphStore: IGraphStore, hits: Array<{
|
|
1299
|
+
recordId: string;
|
|
1300
|
+
score: number;
|
|
1301
|
+
sourcePath: string;
|
|
1302
|
+
}>, options?: GraphAugmentOptions): Promise<GraphAugmentedResult[]>;
|
|
1303
|
+
//#endregion
|
|
1304
|
+
//#region packages/tools/src/guide.d.ts
|
|
1305
|
+
/**
|
|
1306
|
+
* Tool discovery — recommends MCP tools and workflows for a given goal.
|
|
1307
|
+
*
|
|
1308
|
+
* Uses keyword matching against predefined workflow templates.
|
|
1309
|
+
* No embeddings required — pure string matching for instant results.
|
|
1310
|
+
*/
|
|
1311
|
+
interface GuideRecommendation {
|
|
1312
|
+
tool: string;
|
|
1313
|
+
reason: string;
|
|
1314
|
+
order: number;
|
|
1315
|
+
suggestedArgs?: Record<string, unknown>;
|
|
1316
|
+
}
|
|
1317
|
+
interface GuideResult {
|
|
1318
|
+
workflow: string;
|
|
1319
|
+
description: string;
|
|
1320
|
+
tools: GuideRecommendation[];
|
|
1321
|
+
alternativeWorkflows: string[];
|
|
1322
|
+
}
|
|
1323
|
+
/**
|
|
1324
|
+
* Match a goal description to the best workflow and return tool recommendations.
|
|
1325
|
+
*/
|
|
1326
|
+
declare function guide(goal: string, maxRecommendations?: number, indexMode?: string): GuideResult;
|
|
1327
|
+
//#endregion
|
|
1328
|
+
//#region packages/tools/src/health.d.ts
|
|
1329
|
+
interface HealthCheck {
|
|
1330
|
+
name: string;
|
|
1331
|
+
status: 'pass' | 'warn' | 'fail';
|
|
1332
|
+
message: string;
|
|
1333
|
+
}
|
|
1334
|
+
interface HealthResult {
|
|
1335
|
+
path: string;
|
|
1336
|
+
checks: HealthCheck[];
|
|
1337
|
+
score: number;
|
|
1338
|
+
summary: string;
|
|
1339
|
+
}
|
|
1340
|
+
/** Run project health checks on a directory. */
|
|
1341
|
+
declare function health(rootPath?: string): HealthResult;
|
|
1342
|
+
//#endregion
|
|
1343
|
+
//#region packages/tools/src/http-request.d.ts
|
|
1344
|
+
/**
|
|
1345
|
+
* aikit_http — Make HTTP requests for API testing and debugging.
|
|
1346
|
+
*/
|
|
1347
|
+
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD';
|
|
1348
|
+
interface HttpRequestOptions {
|
|
1349
|
+
url: string;
|
|
1350
|
+
method?: HttpMethod;
|
|
1351
|
+
headers?: Record<string, string>;
|
|
1352
|
+
body?: string;
|
|
1353
|
+
timeout?: number;
|
|
1354
|
+
}
|
|
1355
|
+
interface HttpRequestResult {
|
|
1356
|
+
status: number;
|
|
1357
|
+
statusText: string;
|
|
1358
|
+
headers: Record<string, string>;
|
|
1359
|
+
body: string;
|
|
1360
|
+
durationMs: number;
|
|
1361
|
+
contentType: string;
|
|
1362
|
+
sizeBytes: number;
|
|
1363
|
+
truncated: boolean;
|
|
1364
|
+
}
|
|
1365
|
+
declare function httpRequest(options: HttpRequestOptions): Promise<HttpRequestResult>;
|
|
1366
|
+
//#endregion
|
|
1367
|
+
//#region packages/tools/src/lane.d.ts
|
|
1368
|
+
interface LaneMeta {
|
|
1369
|
+
name: string;
|
|
1370
|
+
createdAt: string;
|
|
1371
|
+
sourceFiles: string[];
|
|
1372
|
+
rootPath: string;
|
|
1373
|
+
}
|
|
1374
|
+
interface LaneDiffEntry {
|
|
1375
|
+
file: string;
|
|
1376
|
+
status: 'modified' | 'added' | 'deleted' | 'unchanged';
|
|
1377
|
+
diff?: string;
|
|
1378
|
+
}
|
|
1379
|
+
interface LaneDiffResult {
|
|
1380
|
+
name: string;
|
|
1381
|
+
entries: LaneDiffEntry[];
|
|
1382
|
+
modified: number;
|
|
1383
|
+
added: number;
|
|
1384
|
+
deleted: number;
|
|
1385
|
+
}
|
|
1386
|
+
interface LaneMergeResult {
|
|
1387
|
+
name: string;
|
|
1388
|
+
filesMerged: number;
|
|
1389
|
+
files: string[];
|
|
1390
|
+
}
|
|
1391
|
+
/**
|
|
1392
|
+
* Create an isolated lane by copying specified files into `.aikit-state/lanes/<name>/`.
|
|
1393
|
+
* Files are stored with their relative paths preserved.
|
|
1394
|
+
*/
|
|
1395
|
+
declare function laneCreate(name: string, files: string[], cwd?: string): LaneMeta;
|
|
1396
|
+
/** List all active lanes. */
|
|
1397
|
+
declare function laneList(cwd?: string): LaneMeta[];
|
|
1398
|
+
/** Get the status of a lane — which files are modified, added, deleted. */
|
|
1399
|
+
declare function laneStatus(name: string, cwd?: string): LaneDiffResult;
|
|
1400
|
+
/** Generate a unified diff for modified files in a lane. */
|
|
1401
|
+
declare function laneDiff(name: string, cwd?: string): LaneDiffResult;
|
|
1402
|
+
/** Merge lane files back to the original locations. */
|
|
1403
|
+
declare function laneMerge(name: string, cwd?: string): LaneMergeResult;
|
|
1404
|
+
/** Discard a lane entirely. */
|
|
1405
|
+
declare function laneDiscard(name: string, cwd?: string): boolean;
|
|
1406
|
+
//#endregion
|
|
1407
|
+
//#region packages/tools/src/measure.d.ts
|
|
1408
|
+
/**
|
|
1409
|
+
* aikit_measure — Code complexity and size metrics.
|
|
1410
|
+
*/
|
|
1411
|
+
interface MeasureOptions {
|
|
1412
|
+
path: string;
|
|
1413
|
+
extensions?: string[];
|
|
1414
|
+
}
|
|
1415
|
+
interface FileMetrics {
|
|
1416
|
+
path: string;
|
|
1417
|
+
lines: {
|
|
1418
|
+
total: number;
|
|
1419
|
+
code: number;
|
|
1420
|
+
blank: number;
|
|
1421
|
+
comment: number;
|
|
1422
|
+
};
|
|
1423
|
+
complexity: number;
|
|
1424
|
+
/** AST-based cognitive complexity that weights nested branches higher (available when WASM is active) */
|
|
1425
|
+
cognitiveComplexity?: number;
|
|
1426
|
+
functions: number;
|
|
1427
|
+
imports: number;
|
|
1428
|
+
exports: number;
|
|
1429
|
+
}
|
|
1430
|
+
interface MeasureResult {
|
|
1431
|
+
files: FileMetrics[];
|
|
1432
|
+
summary: {
|
|
1433
|
+
totalFiles: number;
|
|
1434
|
+
totalLines: number;
|
|
1435
|
+
totalCodeLines: number;
|
|
1436
|
+
avgComplexity: number;
|
|
1437
|
+
maxComplexity: {
|
|
1438
|
+
file: string;
|
|
1439
|
+
value: number;
|
|
1440
|
+
};
|
|
1441
|
+
totalFunctions: number;
|
|
1442
|
+
};
|
|
1443
|
+
}
|
|
1444
|
+
declare function measure(options: MeasureOptions): Promise<MeasureResult>;
|
|
1445
|
+
/** Exported for unit testing */
|
|
1446
|
+
declare function analyzeFile(path: string, content: string): FileMetrics;
|
|
1447
|
+
//#endregion
|
|
1448
|
+
//#region packages/tools/src/onboard.d.ts
|
|
1449
|
+
/**
|
|
1450
|
+
* aikit_onboard — First-time codebase onboarding in a single command.
|
|
1451
|
+
*
|
|
1452
|
+
* Runs all analysis tools in parallel and optionally writes structured
|
|
1453
|
+
* output to `.ai/context/` for human-readable reference.
|
|
1454
|
+
*
|
|
1455
|
+
* Analyses: structure, dependencies, entry-points, symbols, patterns, diagram.
|
|
1456
|
+
*/
|
|
1457
|
+
type OnboardMode = 'memory' | 'generate';
|
|
1458
|
+
interface OnboardOptions {
|
|
1459
|
+
/** Root path to analyze */
|
|
1460
|
+
path: string;
|
|
1461
|
+
/** Output mode: 'memory' (AI Kit only) or 'generate' (write to .ai/context/) */
|
|
1462
|
+
mode?: OnboardMode;
|
|
1463
|
+
/** Output directory for generate mode (default: '<path>/.ai/context') */
|
|
1464
|
+
outDir?: string;
|
|
1465
|
+
}
|
|
1466
|
+
interface OnboardStepResult {
|
|
1467
|
+
name: string;
|
|
1468
|
+
status: 'success' | 'failed';
|
|
1469
|
+
output: string;
|
|
1470
|
+
durationMs: number;
|
|
1471
|
+
error?: string;
|
|
1472
|
+
}
|
|
1473
|
+
interface OnboardResult {
|
|
1474
|
+
/** Root path that was analyzed */
|
|
1475
|
+
path: string;
|
|
1476
|
+
/** Mode used */
|
|
1477
|
+
mode: OnboardMode;
|
|
1478
|
+
/** Results for each analysis step */
|
|
1479
|
+
steps: OnboardStepResult[];
|
|
1480
|
+
/** Output directory (only set in generate mode) */
|
|
1481
|
+
outDir?: string;
|
|
1482
|
+
/** Total duration in ms */
|
|
1483
|
+
totalDurationMs: number;
|
|
1484
|
+
/** Auto-generated AI Kit entries for curated store persistence */
|
|
1485
|
+
autoRemember?: Array<{
|
|
1486
|
+
title: string;
|
|
1487
|
+
content: string;
|
|
1488
|
+
category: string;
|
|
1489
|
+
tags: string[];
|
|
1490
|
+
}>;
|
|
1491
|
+
}
|
|
1492
|
+
/**
|
|
1493
|
+
* Run all onboarding analyses in parallel and return combined results.
|
|
1494
|
+
*/
|
|
1495
|
+
declare function onboard(options: OnboardOptions): Promise<OnboardResult>;
|
|
1496
|
+
//#endregion
|
|
1497
|
+
//#region packages/tools/src/path-resolver.d.ts
|
|
1498
|
+
/**
|
|
1499
|
+
* Shared path resolver for MCP tools (E-014).
|
|
1500
|
+
* Provides consistent path resolution across all tools.
|
|
1501
|
+
*/
|
|
1502
|
+
/**
|
|
1503
|
+
* Resolve a user-supplied path to an absolute path.
|
|
1504
|
+
* - Absolute paths are returned as-is
|
|
1505
|
+
* - Relative paths are resolved against the server's cwd
|
|
1506
|
+
* - '.' and empty/undefined default to cwd
|
|
1507
|
+
*/
|
|
1508
|
+
declare function resolvePath(input?: string): string;
|
|
1509
|
+
//#endregion
|
|
1510
|
+
//#region packages/tools/src/process-manager.d.ts
|
|
1511
|
+
interface ManagedProcess {
|
|
1512
|
+
id: string;
|
|
1513
|
+
command: string;
|
|
1514
|
+
args: string[];
|
|
1515
|
+
pid?: number;
|
|
1516
|
+
status: 'running' | 'stopped' | 'error';
|
|
1517
|
+
startedAt: string;
|
|
1518
|
+
exitCode?: number;
|
|
1519
|
+
logs: string[];
|
|
1520
|
+
}
|
|
1521
|
+
declare function processStart(id: string, command: string, args?: string[], options?: {
|
|
1522
|
+
cwd?: string;
|
|
1523
|
+
}): ManagedProcess;
|
|
1524
|
+
declare function processStop(id: string): ManagedProcess | undefined;
|
|
1525
|
+
declare function processStatus(id: string): ManagedProcess | undefined;
|
|
1526
|
+
declare function processList(): ManagedProcess[];
|
|
1527
|
+
declare function processLogs(id: string, tail?: number): string[];
|
|
1528
|
+
//#endregion
|
|
1529
|
+
//#region packages/tools/src/queue.d.ts
|
|
1530
|
+
interface QueueItem {
|
|
1531
|
+
id: string;
|
|
1532
|
+
title: string;
|
|
1533
|
+
status: 'pending' | 'in-progress' | 'done' | 'failed';
|
|
1534
|
+
data?: unknown;
|
|
1535
|
+
createdAt: string;
|
|
1536
|
+
updatedAt: string;
|
|
1537
|
+
error?: string;
|
|
1538
|
+
}
|
|
1539
|
+
interface QueueState {
|
|
1540
|
+
name: string;
|
|
1541
|
+
items: QueueItem[];
|
|
1542
|
+
}
|
|
1543
|
+
/** Create a new named queue. */
|
|
1544
|
+
declare function queueCreate(name: string, cwd?: string): QueueState;
|
|
1545
|
+
/** Push an item onto a queue. Creates the queue if it doesn't exist. */
|
|
1546
|
+
declare function queuePush(name: string, title: string, data?: unknown, cwd?: string): QueueItem;
|
|
1547
|
+
/** Take the next pending item from a queue and mark it in-progress. */
|
|
1548
|
+
declare function queueNext(name: string, cwd?: string): QueueItem | null;
|
|
1549
|
+
/** Mark a queue item as done. */
|
|
1550
|
+
declare function queueDone(name: string, id: string, cwd?: string): QueueItem;
|
|
1551
|
+
/** Mark a queue item as failed with an error message. */
|
|
1552
|
+
declare function queueFail(name: string, id: string, error: string, cwd?: string): QueueItem;
|
|
1553
|
+
/** Get the current state of a queue. */
|
|
1554
|
+
declare function queueGet(name: string, cwd?: string): QueueState | null;
|
|
1555
|
+
/** List all queues with their item counts. */
|
|
1556
|
+
declare function queueList(cwd?: string): Array<{
|
|
1557
|
+
name: string;
|
|
1558
|
+
pending: number;
|
|
1559
|
+
done: number;
|
|
1560
|
+
failed: number;
|
|
1561
|
+
total: number;
|
|
1562
|
+
}>;
|
|
1563
|
+
/** Clear completed items from a queue. */
|
|
1564
|
+
declare function queueClear(name: string, cwd?: string): number;
|
|
1565
|
+
/** Delete a queue entirely. */
|
|
1566
|
+
declare function queueDelete(name: string, cwd?: string): boolean;
|
|
1567
|
+
//#endregion
|
|
1568
|
+
//#region packages/tools/src/regex-test.d.ts
|
|
1569
|
+
/**
|
|
1570
|
+
* aikit_regex_test — Test regex patterns against sample strings.
|
|
1571
|
+
*/
|
|
1572
|
+
interface RegexTestOptions {
|
|
1573
|
+
pattern: string;
|
|
1574
|
+
flags?: string;
|
|
1575
|
+
testStrings: string[];
|
|
1576
|
+
mode?: 'match' | 'replace' | 'split';
|
|
1577
|
+
replacement?: string;
|
|
1578
|
+
}
|
|
1579
|
+
interface RegexMatchInfo {
|
|
1580
|
+
full: string;
|
|
1581
|
+
groups: (string | undefined)[];
|
|
1582
|
+
index: number;
|
|
1583
|
+
}
|
|
1584
|
+
interface RegexTestStringResult {
|
|
1585
|
+
input: string;
|
|
1586
|
+
matched: boolean;
|
|
1587
|
+
matches?: RegexMatchInfo[];
|
|
1588
|
+
replaced?: string;
|
|
1589
|
+
split?: string[];
|
|
1590
|
+
}
|
|
1591
|
+
interface RegexTestResult {
|
|
1592
|
+
pattern: string;
|
|
1593
|
+
flags: string;
|
|
1594
|
+
results: RegexTestStringResult[];
|
|
1595
|
+
valid: boolean;
|
|
1596
|
+
error?: string;
|
|
1597
|
+
}
|
|
1598
|
+
declare function regexTest(options: RegexTestOptions): RegexTestResult;
|
|
1599
|
+
//#endregion
|
|
1600
|
+
//#region packages/tools/src/regex-utils.d.ts
|
|
1601
|
+
/**
|
|
1602
|
+
* Escape special regular-expression characters in a string so it can be
|
|
1603
|
+
* embedded safely inside a `new RegExp(...)` expression.
|
|
1604
|
+
*/
|
|
1605
|
+
declare function escapeRegExp(value: string): string;
|
|
1606
|
+
//#endregion
|
|
1607
|
+
//#region packages/tools/src/rename.d.ts
|
|
1608
|
+
interface RenameOptions {
|
|
1609
|
+
/** Symbol to rename */
|
|
1610
|
+
oldName: string;
|
|
1611
|
+
/** New symbol name */
|
|
1612
|
+
newName: string;
|
|
1613
|
+
/** Root directory to search in */
|
|
1614
|
+
rootPath: string;
|
|
1615
|
+
/** File extensions to process (default: .ts, .tsx, .js, .jsx) */
|
|
1616
|
+
extensions?: string[];
|
|
1617
|
+
/** Glob patterns to exclude */
|
|
1618
|
+
exclude?: string[];
|
|
1619
|
+
/** Dry run — don't write changes */
|
|
1620
|
+
dryRun?: boolean;
|
|
1621
|
+
}
|
|
1622
|
+
interface RenameChange {
|
|
1623
|
+
path: string;
|
|
1624
|
+
line: number;
|
|
1625
|
+
before: string;
|
|
1626
|
+
after: string;
|
|
1627
|
+
}
|
|
1628
|
+
interface RenameResult {
|
|
1629
|
+
oldName: string;
|
|
1630
|
+
newName: string;
|
|
1631
|
+
changes: RenameChange[];
|
|
1632
|
+
filesModified: number;
|
|
1633
|
+
dryRun: boolean;
|
|
1634
|
+
}
|
|
1635
|
+
declare function rename(options: RenameOptions): Promise<RenameResult>;
|
|
1636
|
+
//#endregion
|
|
1637
|
+
//#region packages/tools/src/replay.d.ts
|
|
1638
|
+
/**
|
|
1639
|
+
* Replay — append-only audit trail of tool/CLI invocations.
|
|
1640
|
+
*
|
|
1641
|
+
* Captures tool name, arguments (redacted), duration, and result summary
|
|
1642
|
+
* to `.aikit-state/replay.jsonl`. Used by `aikit replay` CLI, `aikit_replay` MCP tool,
|
|
1643
|
+
* and the TUI log panel.
|
|
1644
|
+
*/
|
|
1645
|
+
interface ReplayEntry {
|
|
1646
|
+
/** ISO timestamp */
|
|
1647
|
+
ts: string;
|
|
1648
|
+
/** Source: 'mcp' | 'cli' */
|
|
1649
|
+
source: 'mcp' | 'cli';
|
|
1650
|
+
/** Tool or command name */
|
|
1651
|
+
tool: string;
|
|
1652
|
+
/** Redacted input summary (first 200 chars of JSON) */
|
|
1653
|
+
input: string;
|
|
1654
|
+
/** Duration in milliseconds */
|
|
1655
|
+
durationMs: number;
|
|
1656
|
+
/** Result status */
|
|
1657
|
+
status: 'ok' | 'error';
|
|
1658
|
+
/** Short result summary (first 200 chars) */
|
|
1659
|
+
output: string;
|
|
1660
|
+
}
|
|
1661
|
+
interface ReplayOptions {
|
|
1662
|
+
/** Max entries to return (default: 20) */
|
|
1663
|
+
last?: number;
|
|
1664
|
+
/** Filter by tool name */
|
|
1665
|
+
tool?: string;
|
|
1666
|
+
/** Filter by source */
|
|
1667
|
+
source?: 'mcp' | 'cli';
|
|
1668
|
+
/** Filter entries after this ISO timestamp */
|
|
1669
|
+
since?: string;
|
|
1670
|
+
}
|
|
1671
|
+
/**
|
|
1672
|
+
* Append a replay entry to the audit log.
|
|
1673
|
+
* Creates the state directory if it doesn't exist.
|
|
1674
|
+
*/
|
|
1675
|
+
declare function replayAppend(entry: ReplayEntry): void;
|
|
1676
|
+
/**
|
|
1677
|
+
* Read replay entries with optional filters.
|
|
1678
|
+
*/
|
|
1679
|
+
declare function replayList(opts?: ReplayOptions): ReplayEntry[];
|
|
1680
|
+
/**
|
|
1681
|
+
* Trim the replay log to MAX_ENTRIES, keeping the most recent.
|
|
1682
|
+
* Async to avoid blocking the event loop on large logs.
|
|
1683
|
+
*/
|
|
1684
|
+
declare function replayTrim(): Promise<number>;
|
|
1685
|
+
/**
|
|
1686
|
+
* Clear the entire replay log.
|
|
1687
|
+
*/
|
|
1688
|
+
declare function replayClear(): void;
|
|
1689
|
+
/**
|
|
1690
|
+
* Helper: create a replay entry from a tool invocation.
|
|
1691
|
+
* Use as a wrapper around tool execution.
|
|
1692
|
+
*/
|
|
1693
|
+
declare function replayCapture(source: 'mcp' | 'cli', tool: string, input: unknown, fn: () => Promise<unknown>): Promise<unknown>;
|
|
1694
|
+
//#endregion
|
|
1695
|
+
//#region packages/tools/src/restore-points.d.ts
|
|
1696
|
+
interface RestorePoint {
|
|
1697
|
+
id: string;
|
|
1698
|
+
timestamp: string;
|
|
1699
|
+
operation: 'codemod' | 'rename' | 'forget';
|
|
1700
|
+
files: Array<{
|
|
1701
|
+
path: string;
|
|
1702
|
+
content: string;
|
|
1703
|
+
}>;
|
|
1704
|
+
description: string;
|
|
1705
|
+
}
|
|
1706
|
+
/** Create a restore point before a destructive operation */
|
|
1707
|
+
declare function createRestorePoint(operation: RestorePoint['operation'], files: Array<{
|
|
1708
|
+
path: string;
|
|
1709
|
+
content: string;
|
|
1710
|
+
}>, description: string): string;
|
|
1711
|
+
/** List all restore points (newest first) */
|
|
1712
|
+
declare function listRestorePoints(): RestorePoint[];
|
|
1713
|
+
/** Restore files from a restore point, returns list of restored paths */
|
|
1714
|
+
declare function restoreFromPoint(id: string): Promise<string[]>;
|
|
1715
|
+
//#endregion
|
|
1716
|
+
//#region packages/tools/src/schema-validate.d.ts
|
|
1717
|
+
/**
|
|
1718
|
+
* aikit_schema_validate — Validate data against a JSON Schema (core subset).
|
|
1719
|
+
*
|
|
1720
|
+
* Supports: type, required, properties, additionalProperties, items,
|
|
1721
|
+
* enum, const, pattern, minimum, maximum, minLength, maxLength,
|
|
1722
|
+
* minItems, maxItems.
|
|
1723
|
+
*/
|
|
1724
|
+
interface SchemaValidateOptions {
|
|
1725
|
+
data: unknown;
|
|
1726
|
+
schema: Record<string, unknown>;
|
|
1727
|
+
}
|
|
1728
|
+
interface ValidationError {
|
|
1729
|
+
path: string;
|
|
1730
|
+
message: string;
|
|
1731
|
+
expected?: string;
|
|
1732
|
+
received?: string;
|
|
1733
|
+
}
|
|
1734
|
+
interface SchemaValidateResult {
|
|
1735
|
+
valid: boolean;
|
|
1736
|
+
errors: ValidationError[];
|
|
1737
|
+
}
|
|
1738
|
+
declare function schemaValidate(options: SchemaValidateOptions): SchemaValidateResult;
|
|
1739
|
+
//#endregion
|
|
1740
|
+
//#region packages/tools/src/stash.d.ts
|
|
1741
|
+
interface StashEntry {
|
|
1742
|
+
key: string;
|
|
1743
|
+
value: unknown;
|
|
1744
|
+
type: string;
|
|
1745
|
+
storedAt: string;
|
|
1746
|
+
}
|
|
1747
|
+
declare function stashSet(key: string, value: unknown, cwd?: string): StashEntry;
|
|
1748
|
+
declare function stashGet(key: string, cwd?: string): StashEntry | undefined;
|
|
1749
|
+
declare function stashList(cwd?: string): StashEntry[];
|
|
1750
|
+
declare function stashDelete(key: string, cwd?: string): boolean;
|
|
1751
|
+
declare function stashClear(cwd?: string): number;
|
|
1752
|
+
//#endregion
|
|
1753
|
+
//#region packages/tools/src/session-digest.d.ts
|
|
1754
|
+
interface SessionDigestOptions {
|
|
1755
|
+
scope?: 'tools' | 'stash' | 'all';
|
|
1756
|
+
since?: string;
|
|
1757
|
+
last?: number;
|
|
1758
|
+
focus?: string;
|
|
1759
|
+
mode?: 'deterministic' | 'sampling';
|
|
1760
|
+
tokenBudget?: number;
|
|
1761
|
+
persist?: boolean;
|
|
1762
|
+
}
|
|
1763
|
+
interface SessionDigestResult {
|
|
1764
|
+
digest: string;
|
|
1765
|
+
stats: {
|
|
1766
|
+
replayEntries: number;
|
|
1767
|
+
stashKeys: number;
|
|
1768
|
+
checkpoints: number;
|
|
1769
|
+
errors: number;
|
|
1770
|
+
toolsUsed: string[];
|
|
1771
|
+
};
|
|
1772
|
+
persistedKey?: string;
|
|
1773
|
+
}
|
|
1774
|
+
interface SessionDigestDeps {
|
|
1775
|
+
replayEntries?: ReplayEntry[];
|
|
1776
|
+
stashEntries?: StashEntry[];
|
|
1777
|
+
checkpoints?: Checkpoint[];
|
|
1778
|
+
persistEntry?: (key: string, value: unknown) => StashEntry;
|
|
1779
|
+
now?: Date;
|
|
1780
|
+
}
|
|
1781
|
+
declare function sessionDigest(options?: SessionDigestOptions, deps?: SessionDigestDeps): SessionDigestResult;
|
|
1782
|
+
declare function sessionDigestSampling(options: SessionDigestOptions, samplingFn: (prompt: string, systemPrompt: string, maxTokens: number) => Promise<string>, deps?: SessionDigestDeps): Promise<SessionDigestResult>;
|
|
1783
|
+
//#endregion
|
|
1784
|
+
//#region packages/tools/src/snippet.d.ts
|
|
1785
|
+
/**
|
|
1786
|
+
* aikit_snippet — Persistent code template storage with search.
|
|
1787
|
+
*/
|
|
1788
|
+
interface Snippet {
|
|
1789
|
+
name: string;
|
|
1790
|
+
language: string;
|
|
1791
|
+
code: string;
|
|
1792
|
+
tags: string[];
|
|
1793
|
+
created: string;
|
|
1794
|
+
updated: string;
|
|
1795
|
+
}
|
|
1796
|
+
type SnippetAction = 'save' | 'get' | 'list' | 'search' | 'delete';
|
|
1797
|
+
interface SnippetOptions {
|
|
1798
|
+
action: SnippetAction;
|
|
1799
|
+
name?: string;
|
|
1800
|
+
language?: string;
|
|
1801
|
+
code?: string;
|
|
1802
|
+
tags?: string[];
|
|
1803
|
+
query?: string;
|
|
1804
|
+
}
|
|
1805
|
+
type SnippetResult = Snippet | {
|
|
1806
|
+
snippets: SnippetSummary[];
|
|
1807
|
+
} | {
|
|
1808
|
+
deleted: boolean;
|
|
1809
|
+
};
|
|
1810
|
+
interface SnippetSummary {
|
|
1811
|
+
name: string;
|
|
1812
|
+
language: string;
|
|
1813
|
+
tags: string[];
|
|
1814
|
+
updated: string;
|
|
1815
|
+
}
|
|
1816
|
+
declare function snippet(options: SnippetOptions): SnippetResult;
|
|
1817
|
+
//#endregion
|
|
1818
|
+
//#region packages/tools/src/stratum-card.d.ts
|
|
1819
|
+
interface StratumCardOptions {
|
|
1820
|
+
files: string[];
|
|
1821
|
+
query: string;
|
|
1822
|
+
tier?: 'T1' | 'T2';
|
|
1823
|
+
maxContentChars?: number;
|
|
1824
|
+
/** Optional file cache — avoids redundant reads and eliminates double-read with fileSummary */
|
|
1825
|
+
cache?: FileCache;
|
|
1826
|
+
}
|
|
1827
|
+
interface StratumCard {
|
|
1828
|
+
path: string;
|
|
1829
|
+
tier: 'T1' | 'T2';
|
|
1830
|
+
card: string;
|
|
1831
|
+
unknowns: string[];
|
|
1832
|
+
riskTier: 'low' | 'medium' | 'high';
|
|
1833
|
+
tokenEstimate: number;
|
|
1834
|
+
originalTokenEstimate: number;
|
|
1835
|
+
}
|
|
1836
|
+
interface StratumCardResult {
|
|
1837
|
+
cards: StratumCard[];
|
|
1838
|
+
totalTokenEstimate: number;
|
|
1839
|
+
totalOriginalTokenEstimate: number;
|
|
1840
|
+
compressionRatio: number;
|
|
1841
|
+
}
|
|
1842
|
+
declare function stratumCard(embedder: IEmbedder, options: StratumCardOptions): Promise<StratumCardResult>;
|
|
1843
|
+
//#endregion
|
|
1844
|
+
//#region packages/tools/src/symbol.d.ts
|
|
1845
|
+
interface SymbolGraphContext {
|
|
1846
|
+
/** Module that defines this symbol */
|
|
1847
|
+
definingModule?: string;
|
|
1848
|
+
/** Modules that import the file containing this symbol */
|
|
1849
|
+
importedByModules: string[];
|
|
1850
|
+
/** Symbols defined in the same module */
|
|
1851
|
+
siblingSymbols: string[];
|
|
1852
|
+
}
|
|
1853
|
+
interface SymbolInfo {
|
|
1854
|
+
name: string;
|
|
1855
|
+
definedIn?: {
|
|
1856
|
+
path: string;
|
|
1857
|
+
line: number;
|
|
1858
|
+
kind: string;
|
|
1859
|
+
signature?: string;
|
|
1860
|
+
};
|
|
1861
|
+
importedBy: Array<{
|
|
1862
|
+
path: string;
|
|
1863
|
+
line: number;
|
|
1864
|
+
importStatement: string;
|
|
1865
|
+
}>;
|
|
1866
|
+
referencedIn: Array<{
|
|
1867
|
+
path: string;
|
|
1868
|
+
line: number;
|
|
1869
|
+
context: string;
|
|
1870
|
+
scope?: string;
|
|
1871
|
+
}>;
|
|
1872
|
+
/** Graph-derived context (when graph store available) */
|
|
1873
|
+
graphContext?: SymbolGraphContext;
|
|
1874
|
+
}
|
|
1875
|
+
interface SymbolOptions {
|
|
1876
|
+
/** Symbol name to look up */
|
|
1877
|
+
name: string;
|
|
1878
|
+
/** Limit results */
|
|
1879
|
+
limit?: number;
|
|
1880
|
+
/** Optional graph store for enriching results */
|
|
1881
|
+
graphStore?: IGraphStore;
|
|
1882
|
+
}
|
|
1883
|
+
declare function symbol(embedder: IEmbedder, store: IKnowledgeStore, options: SymbolOptions): Promise<SymbolInfo>;
|
|
1884
|
+
//#endregion
|
|
1885
|
+
//#region packages/tools/src/test-run.d.ts
|
|
1886
|
+
interface TestRunOptions {
|
|
1887
|
+
files?: string[];
|
|
1888
|
+
cwd?: string;
|
|
1889
|
+
timeout?: number;
|
|
1890
|
+
grep?: string;
|
|
1891
|
+
/** Include full raw output in result (default: false to save tokens) */
|
|
1892
|
+
includeRaw?: boolean;
|
|
1893
|
+
}
|
|
1894
|
+
interface TestRunResult {
|
|
1895
|
+
summary: ParsedTestSummary;
|
|
1896
|
+
passed: boolean;
|
|
1897
|
+
raw?: string;
|
|
1898
|
+
durationMs: number;
|
|
1899
|
+
}
|
|
1900
|
+
declare function testRun(options?: TestRunOptions): Promise<TestRunResult>;
|
|
1901
|
+
/**
|
|
1902
|
+
* Classify non-zero exit codes — some tools use exit code 1 for
|
|
1903
|
+
* non-error conditions (e.g., grep returns 1 for "no matches").
|
|
1904
|
+
*/
|
|
1905
|
+
declare function classifyExitCode(exitCode: number, _stdout: string, command?: string): {
|
|
1906
|
+
isError: boolean;
|
|
1907
|
+
reason?: string;
|
|
1908
|
+
};
|
|
1909
|
+
//#endregion
|
|
1910
|
+
//#region packages/tools/src/text-utils.d.ts
|
|
1911
|
+
/**
|
|
1912
|
+
* Shared text utilities used by compact, digest, stratum-card, and other tools.
|
|
1913
|
+
*/
|
|
1914
|
+
/**
|
|
1915
|
+
* Approximate token count from character count (~4 chars/token).
|
|
1916
|
+
*/
|
|
1917
|
+
declare function estimateTokens(text: string): number;
|
|
1918
|
+
/**
|
|
1919
|
+
* Segment text into chunks for scoring.
|
|
1920
|
+
*/
|
|
1921
|
+
declare function segment(text: string, strategy: 'paragraph' | 'sentence' | 'line'): string[];
|
|
1922
|
+
/**
|
|
1923
|
+
* Cosine similarity between two vectors.
|
|
1924
|
+
*/
|
|
1925
|
+
declare function cosineSimilarity(a: Float32Array, b: Float32Array): number;
|
|
1926
|
+
/**
|
|
1927
|
+
* Reorder items using "bookend" strategy (Liu et al. 2023 "Lost in the Middle").
|
|
1928
|
+
* Highest-scoring items placed at start and end positions for better LLM attention.
|
|
1929
|
+
* Input must already be sorted by score descending.
|
|
1930
|
+
*/
|
|
1931
|
+
declare function bookendReorder<T>(items: T[]): T[];
|
|
1932
|
+
//#endregion
|
|
1933
|
+
//#region packages/tools/src/time-utils.d.ts
|
|
1934
|
+
/**
|
|
1935
|
+
* aikit_time — Timezone conversion, date parsing, duration calculation.
|
|
1936
|
+
*/
|
|
1937
|
+
type TimeOperation = 'now' | 'parse' | 'convert' | 'diff' | 'add';
|
|
1938
|
+
interface TimeOptions {
|
|
1939
|
+
operation: TimeOperation;
|
|
1940
|
+
input?: string;
|
|
1941
|
+
timezone?: string;
|
|
1942
|
+
duration?: string;
|
|
1943
|
+
}
|
|
1944
|
+
interface TimeResult {
|
|
1945
|
+
output: string;
|
|
1946
|
+
iso: string;
|
|
1947
|
+
unix: number;
|
|
1948
|
+
details?: Record<string, string | number>;
|
|
1949
|
+
}
|
|
1950
|
+
declare function timeUtils(options: TimeOptions): TimeResult;
|
|
1951
|
+
//#endregion
|
|
1952
|
+
//#region packages/tools/src/trace.d.ts
|
|
1953
|
+
interface TraceOptions {
|
|
1954
|
+
/** Starting point — a symbol or file:line reference */
|
|
1955
|
+
start: string;
|
|
1956
|
+
/** Direction */
|
|
1957
|
+
direction: 'forward' | 'backward' | 'both';
|
|
1958
|
+
/** Max depth (default: 3) */
|
|
1959
|
+
maxDepth?: number;
|
|
1960
|
+
/** Optional graph store for enriching results */
|
|
1961
|
+
graphStore?: IGraphStore;
|
|
1962
|
+
}
|
|
1963
|
+
interface TraceGraphContext {
|
|
1964
|
+
/** Module that defines the traced symbol */
|
|
1965
|
+
definingModule?: string;
|
|
1966
|
+
/** Community/cluster of the traced symbol */
|
|
1967
|
+
community?: string;
|
|
1968
|
+
/** Modules that import the file containing this symbol */
|
|
1969
|
+
importedByModules: string[];
|
|
1970
|
+
/** Symbols defined in the same module */
|
|
1971
|
+
siblingSymbols: string[];
|
|
1972
|
+
}
|
|
1973
|
+
interface TraceNode {
|
|
1974
|
+
path: string;
|
|
1975
|
+
symbol: string;
|
|
1976
|
+
line: number;
|
|
1977
|
+
relationship: 'calls' | 'called-by' | 'imports' | 'imported-by' | 'references';
|
|
1978
|
+
/** The enclosing function/scope where the relationship occurs (AST-powered) */
|
|
1979
|
+
scope?: string;
|
|
1980
|
+
}
|
|
1981
|
+
interface TraceResult {
|
|
1982
|
+
start: string;
|
|
1983
|
+
direction: string;
|
|
1984
|
+
nodes: TraceNode[];
|
|
1985
|
+
depth: number;
|
|
1986
|
+
/** Graph-derived context (when graph store available) */
|
|
1987
|
+
graphContext?: TraceGraphContext;
|
|
1988
|
+
}
|
|
1989
|
+
declare function trace(embedder: IEmbedder, store: IKnowledgeStore, options: TraceOptions): Promise<TraceResult>;
|
|
1990
|
+
//#endregion
|
|
1991
|
+
//#region packages/tools/src/truncation.d.ts
|
|
1992
|
+
/**
|
|
1993
|
+
* Truncate text keeping both head and tail portions.
|
|
1994
|
+
* Critical for process output where errors appear at the end.
|
|
1995
|
+
*
|
|
1996
|
+
* @param text - Full text to truncate
|
|
1997
|
+
* @param maxLen - Maximum character length
|
|
1998
|
+
* @param headRatio - Fraction for head portion (default 0.6)
|
|
1999
|
+
* @returns Truncated text with separator showing omitted line/char count
|
|
2000
|
+
*/
|
|
2001
|
+
declare function headTailTruncate(text: string, maxLen: number, headRatio?: number): string;
|
|
2002
|
+
/**
|
|
2003
|
+
* Truncate at a paragraph boundary near maxLength (head-only).
|
|
2004
|
+
* Best for web content and markdown where structure is at the top.
|
|
2005
|
+
*/
|
|
2006
|
+
declare function paragraphTruncate(text: string, maxLen: number): string;
|
|
2007
|
+
/**
|
|
2008
|
+
* Truncate text to fit within a token budget.
|
|
2009
|
+
* Uses ~4 chars/token approximation. Snaps to line boundaries.
|
|
2010
|
+
*
|
|
2011
|
+
* @param text - Full text to truncate
|
|
2012
|
+
* @param maxTokens - Maximum token count
|
|
2013
|
+
* @returns Original text if within budget, or truncated with notice
|
|
2014
|
+
*/
|
|
2015
|
+
declare function truncateToTokenBudget(text: string, maxTokens: number): string;
|
|
2016
|
+
//#endregion
|
|
2017
|
+
//#region packages/tools/src/watch.d.ts
|
|
2018
|
+
interface WatchEvent {
|
|
2019
|
+
type: 'change' | 'rename';
|
|
2020
|
+
path: string;
|
|
2021
|
+
timestamp: string;
|
|
2022
|
+
}
|
|
2023
|
+
interface WatchOptions {
|
|
2024
|
+
/** Directory to watch */
|
|
2025
|
+
path: string;
|
|
2026
|
+
/** Glob patterns to exclude */
|
|
2027
|
+
exclude?: string[];
|
|
2028
|
+
/** Max events to buffer (default: 100) */
|
|
2029
|
+
maxEvents?: number;
|
|
2030
|
+
}
|
|
2031
|
+
interface WatchHandle {
|
|
2032
|
+
id: string;
|
|
2033
|
+
path: string;
|
|
2034
|
+
events: WatchEvent[];
|
|
2035
|
+
status: 'watching' | 'stopped';
|
|
2036
|
+
stop: () => void;
|
|
2037
|
+
getEvents: (since?: string) => WatchEvent[];
|
|
2038
|
+
}
|
|
2039
|
+
declare function watchStart(options: WatchOptions): WatchHandle;
|
|
2040
|
+
declare function watchStop(id: string): boolean;
|
|
2041
|
+
declare function watchList(): Array<{
|
|
2042
|
+
id: string;
|
|
2043
|
+
path: string;
|
|
2044
|
+
status: string;
|
|
2045
|
+
eventCount: number;
|
|
2046
|
+
}>;
|
|
2047
|
+
//#endregion
|
|
2048
|
+
//#region packages/tools/src/web-fetch.d.ts
|
|
2049
|
+
/**
|
|
2050
|
+
* aikit_web_fetch — Fetch a web page and convert to LLM-friendly format.
|
|
2051
|
+
*
|
|
2052
|
+
* Supports multiple output modes: markdown (default), raw HTML,
|
|
2053
|
+
* extracted links, or heading outline. Strips scripts, styles,
|
|
2054
|
+
* and non-content elements for compact, token-efficient output.
|
|
2055
|
+
*/
|
|
2056
|
+
type WebFetchMode = 'markdown' | 'raw' | 'links' | 'outline';
|
|
2057
|
+
interface WebFetchOptions {
|
|
2058
|
+
/** URL to fetch */
|
|
2059
|
+
url: string;
|
|
2060
|
+
/** Output mode */
|
|
2061
|
+
mode?: WebFetchMode;
|
|
2062
|
+
/** CSS selector to extract specific element (default: auto-detect main content) */
|
|
2063
|
+
selector?: string;
|
|
2064
|
+
/** Max characters in output — smart truncation at paragraph boundaries */
|
|
2065
|
+
maxLength?: number;
|
|
2066
|
+
/** Include page metadata header (title, description, URL) */
|
|
2067
|
+
includeMetadata?: boolean;
|
|
2068
|
+
/** Append extracted links list at the end */
|
|
2069
|
+
includeLinks?: boolean;
|
|
2070
|
+
/** Include image alt texts inline */
|
|
2071
|
+
includeImages?: boolean;
|
|
2072
|
+
/** Request timeout in milliseconds */
|
|
2073
|
+
timeout?: number;
|
|
2074
|
+
}
|
|
2075
|
+
interface WebFetchResult {
|
|
2076
|
+
/** The converted content */
|
|
2077
|
+
content: string;
|
|
2078
|
+
/** Page title */
|
|
2079
|
+
title: string;
|
|
2080
|
+
/** Page description (from meta) */
|
|
2081
|
+
description: string;
|
|
2082
|
+
/** Final URL after redirects */
|
|
2083
|
+
url: string;
|
|
2084
|
+
/** Content length before truncation */
|
|
2085
|
+
originalLength: number;
|
|
2086
|
+
/** Whether content was truncated */
|
|
2087
|
+
truncated: boolean;
|
|
2088
|
+
}
|
|
2089
|
+
/**
|
|
2090
|
+
* Fetch a web page and convert to an LLM-friendly format.
|
|
2091
|
+
*/
|
|
2092
|
+
declare function webFetch(options: WebFetchOptions): Promise<WebFetchResult>;
|
|
2093
|
+
//#endregion
|
|
2094
|
+
//#region packages/tools/src/web-search.d.ts
|
|
2095
|
+
/**
|
|
2096
|
+
* aikit_web_search — Search the web and return structured results.
|
|
2097
|
+
*
|
|
2098
|
+
* Uses DuckDuckGo HTML search (no API key required).
|
|
2099
|
+
*/
|
|
2100
|
+
interface WebSearchOptions {
|
|
2101
|
+
query: string;
|
|
2102
|
+
limit?: number;
|
|
2103
|
+
site?: string;
|
|
2104
|
+
}
|
|
2105
|
+
interface WebSearchResultItem {
|
|
2106
|
+
title: string;
|
|
2107
|
+
url: string;
|
|
2108
|
+
snippet: string;
|
|
2109
|
+
}
|
|
2110
|
+
interface WebSearchResult {
|
|
2111
|
+
results: WebSearchResultItem[];
|
|
2112
|
+
query: string;
|
|
2113
|
+
}
|
|
2114
|
+
declare function webSearch(options: WebSearchOptions): Promise<WebSearchResult>;
|
|
2115
|
+
/** Parse search results from DuckDuckGo HTML. Exported for testing. */
|
|
2116
|
+
declare function parseSearchResults(html: string, query: string, limit: number): WebSearchResult;
|
|
2117
|
+
//#endregion
|
|
2118
|
+
//#region packages/tools/src/workset.d.ts
|
|
2119
|
+
/**
|
|
2120
|
+
* aikit_workset — Named file set management.
|
|
2121
|
+
*
|
|
2122
|
+
* Persistent worksets stored in .aikit-state/worksets.json.
|
|
2123
|
+
* Use cases: "remember this set of files I'm working on",
|
|
2124
|
+
* "load my previous context", "share file sets between sessions".
|
|
2125
|
+
*/
|
|
2126
|
+
interface Workset {
|
|
2127
|
+
name: string;
|
|
2128
|
+
files: string[];
|
|
2129
|
+
created: string;
|
|
2130
|
+
updated: string;
|
|
2131
|
+
description?: string;
|
|
2132
|
+
}
|
|
2133
|
+
/**
|
|
2134
|
+
* Create or update a workset.
|
|
2135
|
+
*/
|
|
2136
|
+
declare function saveWorkset(name: string, files: string[], options?: {
|
|
2137
|
+
description?: string;
|
|
2138
|
+
cwd?: string;
|
|
2139
|
+
}): Workset;
|
|
2140
|
+
/**
|
|
2141
|
+
* Get a workset by name.
|
|
2142
|
+
*/
|
|
2143
|
+
declare function getWorkset(name: string, cwd?: string): Workset | null;
|
|
2144
|
+
/**
|
|
2145
|
+
* List all worksets.
|
|
2146
|
+
*/
|
|
2147
|
+
declare function listWorksets(cwd?: string): Workset[];
|
|
2148
|
+
/**
|
|
2149
|
+
* Delete a workset.
|
|
2150
|
+
*/
|
|
2151
|
+
declare function deleteWorkset(name: string, cwd?: string): boolean;
|
|
2152
|
+
/**
|
|
2153
|
+
* Add files to an existing workset (creates if not exists).
|
|
2154
|
+
*/
|
|
2155
|
+
declare function addToWorkset(name: string, files: string[], cwd?: string): Workset;
|
|
2156
|
+
/**
|
|
2157
|
+
* Remove files from a workset.
|
|
2158
|
+
*/
|
|
2159
|
+
declare function removeFromWorkset(name: string, files: string[], cwd?: string): Workset | null;
|
|
2160
|
+
//#endregion
|
|
2161
|
+
export { type AuditCheck, type AuditData, type AuditOptions, type AuditRecommendation, type BatchOperation, type BatchOptions, type BatchResult, type ChangelogEntry, type ChangelogFormat, type ChangelogOptions, type ChangelogResult, type CheckOptions, type CheckResult, type CheckSummaryResult, type Checkpoint, type ClassifyTrigger, type CodemodChange, type CodemodOptions, type CodemodResult, type CodemodRule, type CompactOptions, type CompactResult, type CompressOutputOptions, type CompressionContext, type CompressionMode, type CompressionResult, type CompressionRule, type ConstraintRef, type DeadSymbol, type DeadSymbolOptions, type DeadSymbolResult, type DelegateOptions, type DelegateResult, type DiffChange, type DiffFile, type DiffHunk, type DiffParseOptions, type DigestFieldEntry, type DigestOptions, type DigestResult, type DigestSource, type DogfoodLogEntry, type DogfoodLogGroupedEntry, type DogfoodLogOptions, type DogfoodLogResult, type EncodeOperation, type EncodeOptions, type EncodeResult, type EnvInfoOptions, type EnvInfoResult, type EvalOptions, type EvalResult, type EvidenceEntry, type EvidenceMapAction, type EvidenceMapResult, type EvidenceMapState, type EvidenceStatus, type Example, FileCache, type FileCacheEntry, type FileCacheStats, type FileMetrics, type FileSummaryOptions, type FileSummaryResult, type FindExamplesOptions, type FindExamplesResult, type FindOptions, type FindResult, type FindResults, type ForgeClassifyCeremony, type ForgeClassifyOptions, type ForgeClassifyResult, type ForgeGroundOptions, type ForgeGroundResult, type ForgeTier, type GateDecision, type GateResult, type GitContextOptions, type GitContextResult, type GraphAugmentOptions, type GraphAugmentedResult, type GraphQueryOptions, type GraphQueryResult, type GuideRecommendation, type GuideResult, type HealthCheck, type HealthResult, type HttpMethod, type HttpRequestOptions, type HttpRequestResult, type KBError, type KBErrorCode, type KBNextHint, type KBResponse, type KBResponseMeta, type LaneDiffEntry, type LaneDiffResult, type LaneMergeResult, type LaneMeta, type ManagedProcess, type MeasureOptions, type MeasureResult, type OnboardMode, type OnboardOptions, type OnboardResult, type OnboardStepResult, type ParsedError, type ParsedGitStatus, type ParsedOutput, type ParsedTestResult, type ParsedTestSummary, type QueueItem, type QueueState, type RegexTestOptions, type RegexTestResult, type RenameChange, type RenameOptions, type RenameResult, type ReplayEntry, type ReplayOptions, type RestorePoint, type SafetyGate, type SafetyGateResult, type SchemaValidateOptions, type SchemaValidateResult, type ScopeMapEntry, type ScopeMapOptions, type ScopeMapResult, type SessionDigestOptions, type SessionDigestResult, type Snippet, type SnippetAction, type SnippetOptions, type SnippetResult, type StashEntry, type StratumCard, type StratumCardOptions, type StratumCardResult, type SymbolGraphContext, type SymbolInfo, type SymbolOptions, type TestRunOptions, type TestRunResult, type TimeOptions, type TimeResult, type TraceNode, type TraceOptions, type TraceResult, type TransformOptions, type TransformResult, type TypedUnknownSeed, type UnknownType, type ValidationError, type WatchEvent, type WatchHandle, type WatchOptions, type WebFetchMode, type WebFetchOptions, type WebFetchResult, type WebSearchOptions, type WebSearchResult, type WebSearchResultItem, type Workset, addToWorkset, analyzeFile, audit, autoClaimTestFailures, batch, bookendReorder, bpeSurprise, changelog, check, checkpointLatest, checkpointList, checkpointLoad, checkpointSave, classifyExitCode, codemod, compact, compressOutput, compressTerminalOutput, cosineSimilarity, createRestorePoint, dataTransform, delegate, delegateListModels, deleteWorkset, detectOutputTool, diffParse, digest, dogfoodLog, encode, envInfo, errorResponse, escapeRegExp, estimateTokens, evaluate, evidenceMap, fileSummary, find, findDeadSymbols, findExamples, forgeClassify, forgeGround, formatChangelog, getRegisteredRules, getWorkset, gitContext, graphAugmentSearch, graphQuery, guide, headTailTruncate, health, httpRequest, laneCreate, laneDiff, laneDiscard, laneList, laneMerge, laneStatus, listRestorePoints, listWorksets, measure, okResponse, onboard, paragraphTruncate, parseBiome, parseGitStatus, parseOutput, parseSearchResults, parseTsc, parseVitest, processList, processLogs, processStart, processStatus, processStop, queueClear, queueCreate, queueDelete, queueDone, queueFail, queueGet, queueList, queueNext, queuePush, regexTest, registerRule, registerRules, removeFromWorkset, rename, replayAppend, replayCapture, replayClear, replayList, replayTrim, resolvePath, restoreFromPoint, saveWorkset, schemaValidate, scopeMap, scoreLine, scoreLines, segment, sessionDigest, sessionDigestSampling, shannonEntropy, snippet, stashClear, stashDelete, stashGet, stashList, stashSet, stratumCard, summarizeCheckResult, symbol, testRun, timeUtils, trace, truncateToTokenBudget, watchList, watchStart, watchStop, webFetch, webSearch };
|