@vpxa/aikit 0.1.58 → 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 +315 -314
- 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/scaffold/general/skills/c4-architecture/SKILL.md +87 -1
- package/scaffold/general/skills/c4-architecture/references/html-design-system.md +337 -0
- package/scaffold/general/skills/c4-architecture/references/html-template.html +627 -0
- package/scaffold/general/skills/present/SKILL.md +180 -0
- 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 +0,0 @@
|
|
|
1
|
-
const e=[{name:`onboard`,description:`First-time codebase exploration and understanding`,keywords:[`onboard`,`new project`,`understand`,`explore`,`first time`,`getting started`,`learn`,`overview`],tools:[{tool:`status`,reason:`Check index health and record count`,order:1},{tool:`onboard`,reason:`Run all analysis tools in one command`,order:2,suggestedArgs:{path:`.`}},{tool:`search`,reason:`Find specific topics of interest`,order:3},{tool:`graph`,reason:`Module & symbol relationship map — stats for overview, neighbors for exploration`,order:4,suggestedArgs:{action:`stats`}}]},{name:`audit`,description:`Assess project health, quality, and structure`,keywords:[`audit`,`health`,`quality`,`assess`,`review project`,`check quality`,`code quality`,`tech debt`],tools:[{tool:`status`,reason:`Check index freshness`,order:1},{tool:`audit`,reason:`Unified audit report with score and recommendations`,order:2,suggestedArgs:{detail:`summary`}},{tool:`check`,reason:`Typecheck + lint validation`,order:3},{tool:`health`,reason:`Detailed health checks on package.json, tsconfig, etc.`,order:4}]},{name:`bugfix`,description:`Diagnose and fix a bug or failing test`,keywords:[`bug`,`fix`,`debug`,`error`,`failing`,`broken`,`crash`,`wrong`,`issue`,`problem`,`not working`],tools:[{tool:`parse_output`,reason:`Parse error output from build tools (tsc, vitest, biome)`,order:1},{tool:`symbol`,reason:`Find definition and all references of the failing symbol`,order:2},{tool:`trace`,reason:`Trace call chain backward from the failure point`,order:3,suggestedArgs:{direction:`backward`}},{tool:`graph`,reason:`Understand module context — what imports the failing module`,order:4,suggestedArgs:{action:`neighbors`}},{tool:`search`,reason:`Search for related patterns or similar fixes`,order:5},{tool:`test_run`,reason:`Re-run tests after fix`,order:6}]},{name:`implement`,description:`Add a new feature or implement a change`,keywords:[`implement`,`add feature`,`new feature`,`build`,`create`,`add`,`develop`,`write code`],tools:[{tool:`scope_map`,reason:`Generate a reading plan for affected files`,order:1},{tool:`search`,reason:`Find related patterns and prior art`,order:2},{tool:`find`,reason:`Find usage examples of similar patterns`,order:3,suggestedArgs:{mode:`examples`}},{tool:`graph`,reason:`Map module dependencies before adding new code`,order:4,suggestedArgs:{action:`neighbors`}},{tool:`symbol`,reason:`Find existing patterns to follow`,order:5},{tool:`trace`,reason:`Understand call chains to integrate with`,order:6},{tool:`check`,reason:`Validate after implementation`,order:7},{tool:`test_run`,reason:`Run tests to verify`,order:8},{tool:`blast_radius`,reason:`Check impact of changes`,order:9}]},{name:`refactor`,description:`Restructure or clean up existing code`,keywords:[`refactor`,`restructure`,`clean up`,`reorganize`,`rename`,`move`,`extract`,`DRY`,`dead code`],tools:[{tool:`dead_symbols`,reason:`Find unused exports to remove`,order:1},{tool:`graph`,reason:`Map module dependency graph before restructuring`,order:2,suggestedArgs:{action:`neighbors`}},{tool:`trace`,reason:`Understand call chains affected by refactoring`,order:3},{tool:`symbol`,reason:`Find all references before renaming`,order:4},{tool:`blast_radius`,reason:`Assess impact before making changes`,order:5},{tool:`rename`,reason:`Safe cross-file rename`,order:6},{tool:`check`,reason:`Validate after refactoring`,order:7},{tool:`test_run`,reason:`Ensure no regressions`,order:8}]},{name:`search`,description:`Find specific code, patterns, or information`,keywords:[`find`,`search`,`where`,`locate`,`look for`,`grep`,`which file`,`how does`],tools:[{tool:`search`,reason:`Hybrid semantic + keyword search`,order:1},{tool:`find`,reason:`Federated search with glob and regex`,order:2},{tool:`symbol`,reason:`Resolve a specific symbol definition and references`,order:3},{tool:`graph`,reason:`Explore cross-module import relationships and connected symbols`,order:4,suggestedArgs:{action:`neighbors`}}]},{name:`code-navigation`,description:`Understand code structure, module relationships, and cross-package dependencies`,keywords:[`navigate`,`understand`,`module`,`import`,`dependency`,`relationship`,`call chain`,`who calls`,`who uses`,`connected`,`cross-package`],tools:[{tool:`graph`,reason:`Module import graph — see who imports whom across packages`,order:1,suggestedArgs:{action:`neighbors`}},{tool:`symbol`,reason:`Resolve symbol definitions and all references`,order:2},{tool:`trace`,reason:`Follow call chains forward or backward`,order:3},{tool:`file_summary`,reason:`Structural overview of target files`,order:4}]},{name:`context`,description:`Compress or manage context for efficient LLM interaction`,keywords:[`context`,`compress`,`summarize`,`too long`,`token`,`budget`,`reduce`,`compact`],tools:[{tool:`file_summary`,reason:`Quick structural overview without reading full file`,order:1},{tool:`compact`,reason:`Compress file to relevant sections`,order:2,suggestedArgs:{segmentation:`paragraph`}},{tool:`digest`,reason:`Compress multiple sources into budgeted summary`,order:3},{tool:`stratum_card`,reason:`Generate reusable context cards`,order:4}]},{name:`memory`,description:`Manage persistent knowledge across sessions`,keywords:[`memory`,`remember`,`persist`,`save`,`recall`,`decision`,`convention`,`session`,`checkpoint`],tools:[{tool:`list`,reason:`See all stored knowledge entries`,order:1},{tool:`search`,reason:`Search curated knowledge`,order:2,suggestedArgs:{origin:`curated`}},{tool:`remember`,reason:`Store a new decision or pattern`,order:3},{tool:`checkpoint`,reason:`Save/restore session progress`,order:4},{tool:`stash`,reason:`Temporary key-value storage within session`,order:5}]},{name:`validate`,description:`Run checks, tests, and validation`,keywords:[`validate`,`check`,`test`,`lint`,`typecheck`,`verify`,`CI`,`pass`,`run tests`],tools:[{tool:`check`,reason:`Typecheck + lint in one call`,order:1,suggestedArgs:{detail:`errors`}},{tool:`test_run`,reason:`Run tests with structured output`,order:2},{tool:`health`,reason:`Project health assessment`,order:3}]},{name:`analyze`,description:`Deep analysis of codebase structure, dependencies, or patterns`,keywords:[`analyze`,`dependency`,`structure`,`pattern`,`architecture`,`diagram`,`entry point`,`import`],tools:[{tool:`analyze_structure`,reason:`Project structure overview`,order:1},{tool:`analyze_dependencies`,reason:`Dependency graph and analysis`,order:2},{tool:`graph`,reason:`Traverse module import graph for cross-package relationships`,order:3,suggestedArgs:{action:`neighbors`}},{tool:`symbol`,reason:`Deep-dive into specific symbols`,order:4},{tool:`trace`,reason:`Follow data flow and call chains`,order:5},{tool:`analyze_patterns`,reason:`Detect code patterns and conventions`,order:6},{tool:`analyze_entry_points`,reason:`Find handlers, exports, and entry points`,order:7},{tool:`analyze_diagram`,reason:`Generate Mermaid diagrams`,order:8}]},{name:`upgrade`,description:`Update AI Kit agents, prompts, skills, and scaffold to the latest version (user-level and workspace-level)`,keywords:[`upgrade`,`update`,`version`,`scaffold`,`outdated`,`mismatch`,`deploy`,`install`,`refresh`],tools:[{tool:`status`,reason:`Check current versions and detect mismatches — auto-triggers upgrade when a version mismatch is found`,order:1},{tool:`reindex`,reason:`Refresh the index after the upgrade completes`,order:2},{tool:`produce_knowledge`,reason:`Regenerate codebase analysis with updated tooling`,order:3,suggestedArgs:{path:`.`}}]},{name:`flow`,description:`Manage development flows — structured step-by-step processes for tasks`,keywords:[`flow`,`workflow`,`step`,`process`,`pipeline`,`lifecycle`,`sequence`,`start flow`,`flow status`],tools:[{tool:`flow_list`,reason:`List all available flows (builtin + custom)`,order:1},{tool:`flow_status`,reason:`Check current active flow and step`,order:2},{tool:`flow_start`,reason:`Start a named flow`,order:3},{tool:`flow_step`,reason:`Advance to next step, skip, or redo`,order:4},{tool:`flow_read_instruction`,reason:`Read the current step instruction`,order:5},{tool:`flow_info`,reason:`Get detailed info about a specific flow`,order:6},{tool:`flow_add`,reason:`Install a new custom flow`,order:7},{tool:`flow_update`,reason:`Update an existing custom flow`,order:8},{tool:`flow_remove`,reason:`Remove a custom flow`,order:9},{tool:`flow_reset`,reason:`Clear active flow state to start over`,order:10}]},{name:`web`,description:`Fetch web pages, search the web, or make HTTP API calls`,keywords:[`web`,`fetch`,`url`,`website`,`api`,`http`,`request`,`download`,`scrape`,`browse`,`web search`,`online`],tools:[{tool:`web_search`,reason:`Search the web for information`,order:1},{tool:`web_fetch`,reason:`Fetch and extract content from URLs`,order:2},{tool:`http`,reason:`Make raw HTTP requests to APIs`,order:3}]},{name:`brainstorm`,description:`Interactive ideation and creative exploration for design decisions`,keywords:[`brainstorm`,`ideate`,`ideas`,`explore`,`creative`,`design`,`options`,`approach`,`alternatives`,`think`],tools:[{tool:`brainstorm`,reason:`Interactive structured ideation session`,order:1},{tool:`search`,reason:`Find related patterns and prior art`,order:2,suggestedArgs:{origin:`curated`}},{tool:`remember`,reason:`Persist chosen direction as a decision`,order:3,suggestedArgs:{category:`decisions`}}]},{name:`present`,description:`Display rich visual content — dashboards, charts, tables, timelines`,keywords:[`present`,`dashboard`,`chart`,`table`,`visualize`,`display`,`show`,`render`,`report`,`timeline`],tools:[{tool:`present`,reason:`Render rich HTML dashboards, charts, and tables`,order:1},{tool:`analyze_diagram`,reason:`Generate Mermaid diagrams for architecture views`,order:2},{tool:`measure`,reason:`Collect metrics to visualize`,order:3}]},{name:`quality`,description:`FORGE quality gates — classify task complexity, ground requirements, verify evidence`,keywords:[`quality`,`forge`,`evidence`,`gate`,`classify`,`ground`,`tier`,`critical`,`verify`,`proof`],tools:[{tool:`forge_classify`,reason:`Determine task tier (Floor/Standard/Critical)`,order:1},{tool:`forge_ground`,reason:`Ground requirements with evidence criteria`,order:2},{tool:`evidence_map`,reason:`Map evidence and run quality gates`,order:3,suggestedArgs:{action:`gate`}},{tool:`check`,reason:`Typecheck + lint validation`,order:4},{tool:`test_run`,reason:`Run tests for coverage evidence`,order:5}]},{name:`transform`,description:`Automated code transformations — codemods, renames, data transforms`,keywords:[`transform`,`codemod`,`rename`,`replace`,`migrate`,`convert`,`data transform`,`rewrite`,`bulk edit`],tools:[{tool:`rename`,reason:`Safe cross-file symbol rename`,order:1},{tool:`codemod`,reason:`Apply AST-level code transformations`,order:2},{tool:`data_transform`,reason:`Transform data between formats`,order:3},{tool:`diff_parse`,reason:`Parse and analyze diffs`,order:4},{tool:`blast_radius`,reason:`Check impact of transformations`,order:5}]},{name:`git`,description:`Git context, changelogs, and version tracking`,keywords:[`git`,`commit`,`diff`,`changelog`,`history`,`branch`,`version`,`release`,`changes`,`what changed`],tools:[{tool:`git_context`,reason:`Get git status, diff, and branch info`,order:1},{tool:`changelog`,reason:`Generate changelog from git history`,order:2},{tool:`blast_radius`,reason:`Assess impact of changed files`,order:3}]},{name:`indexing`,description:`Manage smart indexing, trickle mode, and index maintenance`,keywords:[`index`,`indexing`,`smart index`,`trickle`,`reindex`,`index mode`,`index status`,`queue`,`stale index`],tools:[{tool:`status`,reason:`Check index mode, queue size, and freshness`,order:1},{tool:`reindex`,reason:`Force a full reindex (only when smart mode cannot keep up)`,order:2,suggestedArgs:{force:!0}},{tool:`produce_knowledge`,reason:`Regenerate curated resource analysis`,order:3,suggestedArgs:{path:`.`}}]}];function t(t,n=5,r){let i=t.toLowerCase(),a=e.map(e=>{let t=0;for(let n of e.keywords)i.includes(n)&&(t+=n.includes(` `)?2:1);return{workflow:e,score:t}}).filter(e=>e.score>0).sort((e,t)=>t.score-e.score),o=e.find(e=>e.name===`search`)??e[0],s=a[0]?.workflow??o,c=a.slice(1,4).map(e=>e.workflow.name).filter(e=>e!==s.name),l={workflow:s.name,description:s.description,tools:s.tools.slice(0,n),alternativeWorkflows:c};return r===`smart`&&(l.tools=l.tools.map(e=>e.tool===`reindex`?{...e,reason:`Smart indexing is active — files are indexed automatically. Use reindex({ force: true }) only if the index is severely outdated.`,suggestedArgs:{force:!0}}:e)),l}export{t as guide};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//#region packages/tools/src/health.d.ts
|
|
2
|
-
interface HealthCheck {
|
|
3
|
-
name: string;
|
|
4
|
-
status: 'pass' | 'warn' | 'fail';
|
|
5
|
-
message: string;
|
|
6
|
-
}
|
|
7
|
-
interface HealthResult {
|
|
8
|
-
path: string;
|
|
9
|
-
checks: HealthCheck[];
|
|
10
|
-
score: number;
|
|
11
|
-
summary: string;
|
|
12
|
-
}
|
|
13
|
-
/** Run project health checks on a directory. */
|
|
14
|
-
declare function health(rootPath?: string): HealthResult;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { HealthCheck, HealthResult, health };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{extname as e,join as t,relative as n,resolve as r}from"node:path";import{existsSync as i,readFileSync as a,readdirSync as o,statSync as s}from"node:fs";function c(e){let n=r(e??process.cwd()),o=[],c=t(n,`package.json`);if(i(c)){o.push({name:`package.json`,status:`pass`,message:`Found`});try{let e=JSON.parse(a(c,`utf-8`));e.name?o.push({name:`package.name`,status:`pass`,message:e.name}):o.push({name:`package.name`,status:`warn`,message:`Missing package name`});let t=e.scripts??{};for(let e of[`build`,`test`,`lint`])t[e]?o.push({name:`script:${e}`,status:`pass`,message:t[e]}):o.push({name:`script:${e}`,status:`warn`,message:`No "${e}" script defined`});e.type===`module`?o.push({name:`esm`,status:`pass`,message:`ESM ("type": "module")`}):e.type===`commonjs`?o.push({name:`esm`,status:`pass`,message:`CJS ("type": "commonjs")`}):o.push({name:`esm`,status:`warn`,message:`No "type" field — defaults to CJS`}),e.engines?.node?o.push({name:`engines.node`,status:`pass`,message:e.engines.node}):o.push({name:`engines.node`,status:`warn`,message:`No Node.js engine constraint`})}catch{o.push({name:`package.json`,status:`fail`,message:`Failed to parse package.json`})}}else o.push({name:`package.json`,status:`fail`,message:`Missing — not a Node.js project`});let f=t(n,`tsconfig.json`);i(f)?o.push({name:`tsconfig.json`,status:`pass`,message:`Found`}):o.push({name:`tsconfig.json`,status:`warn`,message:`Missing`});let p=t(n,`.gitignore`);if(i(p)){let e=a(p,`utf-8`),t=e.includes(`node_modules`),n=e.includes(`dist`);t&&n?o.push({name:`.gitignore`,status:`pass`,message:`Includes node_modules and dist`}):o.push({name:`.gitignore`,status:`warn`,message:`Missing: ${t?``:`node_modules `}${n?``:`dist`}`.trim()})}else o.push({name:`.gitignore`,status:`warn`,message:`Missing`});let h=[`pnpm-lock.yaml`,`package-lock.json`,`yarn.lock`,`bun.lock`].find(e=>i(t(n,e)));h?o.push({name:`lockfile`,status:`pass`,message:h}):o.push({name:`lockfile`,status:`warn`,message:`No lock file found`});let g=t(n,`README.md`);if(i(g)){let e=a(g,`utf-8`).length;o.push({name:`README.md`,status:e>100?`pass`:`warn`,message:e>100?`Found (${e} chars)`:`Found but very short`})}else o.push({name:`README.md`,status:`warn`,message:`Missing`});if(i(t(n,`LICENSE`))||i(t(n,`LICENSE.md`))?o.push({name:`LICENSE`,status:`pass`,message:`Found`}):o.push({name:`LICENSE`,status:`warn`,message:`Missing`}),i(f))try{let e=a(f,`utf-8`).replace(/\/\/.*$/gm,``).replace(/\/\*[\s\S]*?\*\//g,``);JSON.parse(e).compilerOptions?.strict===!0?o.push({name:`typescript.strict`,status:`pass`,message:`strict: true`}):o.push({name:`typescript.strict`,status:`warn`,message:`strict mode not enabled in tsconfig.json`})}catch{}if(i(c))try{let e=JSON.parse(a(c,`utf-8`));e.exports?o.push({name:`package.exports`,status:`pass`,message:`Has exports field`}):e.workspaces||i(t(n,`pnpm-workspace.yaml`))||o.push({name:`package.exports`,status:`warn`,message:`Missing — consider adding exports field for explicit public API`});let r=l(n,e);r.length>0&&u(n,r,o)}catch{}let _=t(n,`dist`),v=t(n,`src`);if(i(_)&&i(v))try{let e=s(_).mtimeMs;d(v)>e?o.push({name:`build.freshness`,status:`warn`,message:`Source files are newer than dist/ — rebuild may be needed`}):o.push({name:`build.freshness`,status:`pass`,message:`Build output is fresh`})}catch{}if(i(v)){let e=m(v);if(e.length===0)o.push({name:`circular_deps`,status:`pass`,message:`No circular imports detected`});else{let t=e.slice(0,3).map(e=>e.join(` → `));o.push({name:`circular_deps`,status:`warn`,message:`${e.length} circular import(s): ${t.join(`; `)}${e.length>3?` (+${e.length-3} more)`:``}`})}}let y=o.length,b=o.filter(e=>e.status===`pass`).length,x=o.filter(e=>e.status===`fail`).length;return{path:n,checks:o,score:y>0?Math.round(b/y*100):0,summary:x>0?`${x} critical issue(s), ${y-b-x} warning(s)`:y-b>0?`${y-b} warning(s)`:`All checks passed`}}function l(e,n){let r=[];Array.isArray(n.workspaces)?r.push(...n.workspaces):n.workspaces&&typeof n.workspaces==`object`&&Array.isArray(n.workspaces.packages)&&r.push(...n.workspaces.packages);let s=t(e,`pnpm-workspace.yaml`);if(i(s)){let e=a(s,`utf-8`);for(let t of e.split(`
|
|
2
|
-
`)){let e=t.match(/^\s*-\s+['"]?([^'"#\s]+)['"]?\s*$/);e&&r.push(e[1])}}let c=[];for(let n of r)if(n.endsWith(`/*`)||n.endsWith(`/**`)){let r=t(e,n.replace(/\/\*+$/,``));if(i(r))try{for(let e of o(r,{withFileTypes:!0}))e.isDirectory()&&i(t(r,e.name,`package.json`))&&c.push(t(r,e.name))}catch{}}else{let r=t(e,n);i(t(r,`package.json`))&&c.push(r)}return c}function u(e,n,r){let i=0,o=0,s=new Map;for(let e of n)try{let n=JSON.parse(a(t(e,`package.json`),`utf-8`));n.scripts?.test||i++,!n.exports&&!n.main&&o++;let r={...n.dependencies,...n.devDependencies};for(let e of Object.values(r))if(typeof e==`string`&&e.startsWith(`workspace:`)){let t=e.startsWith(`workspace:*`)?`workspace:*`:e.startsWith(`workspace:^`)?`workspace:^`:`workspace:~`;s.set(t,(s.get(t)??0)+1)}}catch{}if(i>0?r.push({name:`workspace.test-scripts`,status:`warn`,message:`${i}/${n.length} workspace packages missing test script`}):r.push({name:`workspace.test-scripts`,status:`pass`,message:`All ${n.length} workspace packages have test scripts`}),o>0?r.push({name:`workspace.exports`,status:`warn`,message:`${o}/${n.length} packages missing exports field`}):n.length>0&&r.push({name:`workspace.exports`,status:`pass`,message:`All ${n.length} packages have exports or main field`}),s.size>1){let e=[...s.entries()].map(([e,t])=>`${e} (${t})`).join(`, `);r.push({name:`workspace.protocol`,status:`warn`,message:`Mixed workspace protocols: ${e} — consider standardizing`})}else if(s.size===1){let[e]=s.keys();r.push({name:`workspace.protocol`,status:`pass`,message:`Consistent workspace protocol: ${e}`})}}function d(e){let n=0;try{for(let r of o(e,{withFileTypes:!0})){if(r.name.startsWith(`.`)||r.name===`node_modules`)continue;let i=t(e,r.name);n=r.isDirectory()?Math.max(n,d(i)):Math.max(n,s(i).mtimeMs)}}catch{}return n}const f=/(?:import|export)\s+.*?from\s+['"](\.[^'"]+)['"]/g,p=new Set([`.ts`,`.tsx`,`.mts`]);function m(e){let t=new Map;h(e,e,t);let n=[],r=new Set,i=new Set;function a(e,o){if(i.has(e)){let t=o.indexOf(e);t>=0&&n.push(o.slice(t).concat(e));return}if(!r.has(e)){r.add(e),i.add(e),o.push(e);for(let n of t.get(e)??[])a(n,o);o.pop(),i.delete(e)}}for(let e of t.keys())a(e,[]);return n}function h(r,i,c){let l;try{l=o(r)}catch{return}for(let o of l){if(o.startsWith(`.`)||o===`node_modules`||o===`__tests__`)continue;let l=t(r,o);try{if(s(l).isDirectory())h(l,i,c);else if(p.has(e(o))){let e=n(i,l).replace(/\\/g,`/`),t=a(l,`utf-8`),o=[];for(let e of t.matchAll(f)){let t=e[1],n=g(r,t,i);n&&o.push(n)}c.set(e,o)}}catch{}}}function g(e,t,i){let a=r(e,t);for(let e of[`.ts`,`.tsx`,`.mts`,`.js`,`.mjs`,``])return n(i,e?a.replace(/\.[^.]+$/,``)+e:a).replace(/\\/g,`/`).replace(/\.js$/,`.ts`).replace(/\.mjs$/,`.mts`);return null}export{c as health};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//#region packages/tools/src/http-request.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* aikit_http — Make HTTP requests for API testing and debugging.
|
|
4
|
-
*/
|
|
5
|
-
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD';
|
|
6
|
-
interface HttpRequestOptions {
|
|
7
|
-
url: string;
|
|
8
|
-
method?: HttpMethod;
|
|
9
|
-
headers?: Record<string, string>;
|
|
10
|
-
body?: string;
|
|
11
|
-
timeout?: number;
|
|
12
|
-
}
|
|
13
|
-
interface HttpRequestResult {
|
|
14
|
-
status: number;
|
|
15
|
-
statusText: string;
|
|
16
|
-
headers: Record<string, string>;
|
|
17
|
-
body: string;
|
|
18
|
-
durationMs: number;
|
|
19
|
-
contentType: string;
|
|
20
|
-
sizeBytes: number;
|
|
21
|
-
truncated: boolean;
|
|
22
|
-
}
|
|
23
|
-
declare function httpRequest(options: HttpRequestOptions): Promise<HttpRequestResult>;
|
|
24
|
-
//#endregion
|
|
25
|
-
export { HttpMethod, HttpRequestOptions, HttpRequestResult, httpRequest };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{headTailTruncate as e}from"./truncation.js";const t=5e4;async function n(n){let{url:r,method:i=`GET`,headers:a={},body:o,timeout:s=15e3}=n,c=new URL(r);if(c.protocol!==`http:`&&c.protocol!==`https:`)throw Error(`Unsupported protocol: ${c.protocol} — only http/https allowed`);let l=c.hostname;if(l===`169.254.169.254`||l===`metadata.google.internal`||l.startsWith(`fd`)||/^(10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.)/.test(l)||l===`0.0.0.0`||l===`[::]`)throw Error(`Blocked request to private/metadata address: ${l}`);let u=new AbortController,d=setTimeout(()=>u.abort(),s),f=Date.now(),p;try{p=await fetch(r,{method:i,headers:{"User-Agent":`aikit-http/1.0`,...a},body:i!==`GET`&&i!==`HEAD`?o:void 0,signal:u.signal,redirect:`follow`})}finally{clearTimeout(d)}let m=Date.now()-f,h=await p.text(),g=p.headers.get(`content-type`)??``,_=h;if(g.includes(`json`))try{_=JSON.stringify(JSON.parse(h),null,2)}catch{}let v=!1;_.length>t&&(_=e(_,t),v=!0);let y={};return p.headers.forEach((e,t)=>{y[t]=e}),{status:p.status,statusText:p.statusText,headers:y,body:_,durationMs:m,contentType:g,sizeBytes:h.length,truncated:v}}export{n as httpRequest};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
//#region packages/tools/src/lane.d.ts
|
|
2
|
-
interface LaneMeta {
|
|
3
|
-
name: string;
|
|
4
|
-
createdAt: string;
|
|
5
|
-
sourceFiles: string[];
|
|
6
|
-
rootPath: string;
|
|
7
|
-
}
|
|
8
|
-
interface LaneDiffEntry {
|
|
9
|
-
file: string;
|
|
10
|
-
status: 'modified' | 'added' | 'deleted' | 'unchanged';
|
|
11
|
-
diff?: string;
|
|
12
|
-
}
|
|
13
|
-
interface LaneDiffResult {
|
|
14
|
-
name: string;
|
|
15
|
-
entries: LaneDiffEntry[];
|
|
16
|
-
modified: number;
|
|
17
|
-
added: number;
|
|
18
|
-
deleted: number;
|
|
19
|
-
}
|
|
20
|
-
interface LaneMergeResult {
|
|
21
|
-
name: string;
|
|
22
|
-
filesMerged: number;
|
|
23
|
-
files: string[];
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Create an isolated lane by copying specified files into `.aikit-state/lanes/<name>/`.
|
|
27
|
-
* Files are stored with their relative paths preserved.
|
|
28
|
-
*/
|
|
29
|
-
declare function laneCreate(name: string, files: string[], cwd?: string): LaneMeta;
|
|
30
|
-
/** List all active lanes. */
|
|
31
|
-
declare function laneList(cwd?: string): LaneMeta[];
|
|
32
|
-
/** Get the status of a lane — which files are modified, added, deleted. */
|
|
33
|
-
declare function laneStatus(name: string, cwd?: string): LaneDiffResult;
|
|
34
|
-
/** Generate a unified diff for modified files in a lane. */
|
|
35
|
-
declare function laneDiff(name: string, cwd?: string): LaneDiffResult;
|
|
36
|
-
/** Merge lane files back to the original locations. */
|
|
37
|
-
declare function laneMerge(name: string, cwd?: string): LaneMergeResult;
|
|
38
|
-
/** Discard a lane entirely. */
|
|
39
|
-
declare function laneDiscard(name: string, cwd?: string): boolean;
|
|
40
|
-
//#endregion
|
|
41
|
-
export { LaneDiffEntry, LaneDiffResult, LaneMergeResult, LaneMeta, laneCreate, laneDiff, laneDiscard, laneList, laneMerge, laneStatus };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{join as e,relative as t,resolve as n}from"node:path";import{cpSync as r,existsSync as i,mkdirSync as a,readFileSync as o,readdirSync as s,rmSync as c,statSync as l,writeFileSync as u}from"node:fs";import{resolveStateDir as d}from"../../core/dist/index.js";function f(e){return n(d(e??process.cwd()),`lanes`)}const p=`.lane-meta.json`;function m(e){return f(e)}function h(e,t){let r=m(t),i=n(r,e);if(!i.startsWith(n(r)))throw Error(`Invalid lane name: "${e}"`);return i}function g(t,n){let r=e(h(t,n),p);if(!i(r))throw Error(`Lane "${t}" does not exist`);try{return JSON.parse(o(r,`utf-8`))}catch{throw Error(`Lane "${t}" has corrupted metadata`)}}function _(o,s,c){let l=c??process.cwd(),d=h(o,c);if(i(d))throw Error(`Lane "${o}" already exists`);a(d,{recursive:!0});let f=[];for(let o of s){let s=n(l,o);if(!i(s))throw Error(`Source file does not exist: ${o}`);let c=t(l,s).replace(/\\/g,`/`),u=e(d,c);a(e(u,`..`),{recursive:!0}),r(s,u),f.push(c)}let m={name:o,createdAt:new Date().toISOString(),sourceFiles:f,rootPath:l};return u(e(d,p),`${JSON.stringify(m,null,2)}\n`,`utf-8`),m}function v(t){let n=m(t);if(!i(n))return[];let r=s(n),a=[];for(let t of r){let r=e(n,t,p);if(i(r))try{a.push(JSON.parse(o(r,`utf-8`)))}catch{}}return a}function y(t,r){let a=g(t,r),s=h(t,r),c=a.rootPath,l=[];for(let t of a.sourceFiles){let r=n(c,t),a=e(s,t);if(!i(a)){l.push({file:t,status:`deleted`});continue}if(!i(r)){l.push({file:t,status:`added`});continue}o(r,`utf-8`)===o(a,`utf-8`)?l.push({file:t,status:`unchanged`}):l.push({file:t,status:`modified`})}let u=C(s);for(let e of u)a.sourceFiles.includes(e)||l.push({file:e,status:`added`});return{name:t,entries:l,modified:l.filter(e=>e.status===`modified`).length,added:l.filter(e=>e.status===`added`).length,deleted:l.filter(e=>e.status===`deleted`).length}}function b(t,r){let a=g(t,r),s=h(t,r),c=a.rootPath,l=[],u=new Set(a.sourceFiles);for(let e of C(s))u.add(e);for(let t of u){let r=n(c,t),a=e(s,t),u=i(r),d=i(a);if(!d&&u){l.push({file:t,status:`deleted`});continue}if(d&&!u){let e=o(a,`utf-8`);l.push({file:t,status:`added`,diff:e.split(`
|
|
2
|
-
`).map(e=>`+${e}`).join(`
|
|
3
|
-
`)});continue}if(!d||!u)continue;let f=o(r,`utf-8`),p=o(a,`utf-8`);f===p?l.push({file:t,status:`unchanged`}):l.push({file:t,status:`modified`,diff:w(f,p)})}return{name:t,entries:l,modified:l.filter(e=>e.status===`modified`).length,added:l.filter(e=>e.status===`added`).length,deleted:l.filter(e=>e.status===`deleted`).length}}function x(t,o){let s=g(t,o),l=h(t,o),u=s.rootPath,d=[],f=new Set(s.sourceFiles);for(let e of C(l))f.add(e);for(let t of f){let o=e(l,t);if(!i(o))continue;let s=n(u,t);a(e(s,`..`),{recursive:!0}),r(o,s),d.push(t)}return c(l,{recursive:!0,force:!0}),{name:t,filesMerged:d.length,files:d}}function S(e,t){let n=h(e,t);return i(n)?(c(n,{recursive:!0,force:!0}),!0):!1}function C(n){let r=[];function a(i){for(let o of s(i)){if(o===p)continue;let s=e(i,o);l(s).isDirectory()?a(s):r.push(t(n,s).replace(/\\/g,`/`))}}return i(n)&&a(n),r.sort()}function w(e,t){let n=e.split(`
|
|
4
|
-
`),r=t.split(`
|
|
5
|
-
`),i=[],a=Math.max(n.length,r.length);for(let e=0;e<a;e++){let t=n[e],a=r[e];t===a?i.push(` ${t??``}`):(t!==void 0&&i.push(`-${t}`),a!==void 0&&i.push(`+${a}`))}return i.join(`
|
|
6
|
-
`)}export{_ as laneCreate,b as laneDiff,S as laneDiscard,v as laneList,x as laneMerge,y as laneStatus};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
//#region packages/tools/src/measure.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* aikit_measure — Code complexity and size metrics.
|
|
4
|
-
*/
|
|
5
|
-
interface MeasureOptions {
|
|
6
|
-
path: string;
|
|
7
|
-
extensions?: string[];
|
|
8
|
-
}
|
|
9
|
-
interface FileMetrics {
|
|
10
|
-
path: string;
|
|
11
|
-
lines: {
|
|
12
|
-
total: number;
|
|
13
|
-
code: number;
|
|
14
|
-
blank: number;
|
|
15
|
-
comment: number;
|
|
16
|
-
};
|
|
17
|
-
complexity: number;
|
|
18
|
-
/** AST-based cognitive complexity that weights nested branches higher (available when WASM is active) */
|
|
19
|
-
cognitiveComplexity?: number;
|
|
20
|
-
functions: number;
|
|
21
|
-
imports: number;
|
|
22
|
-
exports: number;
|
|
23
|
-
}
|
|
24
|
-
interface MeasureResult {
|
|
25
|
-
files: FileMetrics[];
|
|
26
|
-
summary: {
|
|
27
|
-
totalFiles: number;
|
|
28
|
-
totalLines: number;
|
|
29
|
-
totalCodeLines: number;
|
|
30
|
-
avgComplexity: number;
|
|
31
|
-
maxComplexity: {
|
|
32
|
-
file: string;
|
|
33
|
-
value: number;
|
|
34
|
-
};
|
|
35
|
-
totalFunctions: number;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
declare function measure(options: MeasureOptions): Promise<MeasureResult>;
|
|
39
|
-
/** Exported for unit testing */
|
|
40
|
-
declare function analyzeFile(path: string, content: string): FileMetrics;
|
|
41
|
-
//#endregion
|
|
42
|
-
export { FileMetrics, MeasureOptions, MeasureResult, analyzeFile, measure };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{extname as e,join as t,relative as n}from"node:path";import{SUPPORTED_EXTENSIONS as r,WasmRuntime as i}from"../../chunker/dist/index.js";import{readFileSync as a,readdirSync as o,statSync as s}from"node:fs";const c=new Set([`node_modules`,`.git`,`dist`,`build`,`coverage`,`.turbo`,`cdk.out`,`.cache`]),l=[/\bif\s*\(/g,/\belse\s+if\b/g,/\bfor\s*\(/g,/\bwhile\s*\(/g,/\bcase\s+/g,/\bcatch\s*\(/g,/&&/g,/\|\|/g,/\?\?/g];async function u(t){let{path:r,extensions:i=[`.ts`,`.tsx`,`.js`,`.jsx`]}=t,o=h(r,i),s=[];for(let t of o){let r=a(t,`utf8`),i=d(n(process.cwd(),t),r),o=await m(r,e(t));o!==void 0&&(i.cognitiveComplexity=o),s.push(i)}s.sort((e,t)=>t.complexity-e.complexity);let c=s.reduce((e,t)=>e+t.lines.total,0),l=s.reduce((e,t)=>e+t.lines.code,0),u=s.reduce((e,t)=>e+t.complexity,0),f=s.reduce((e,t)=>e+t.functions,0),p=s[0]??{path:``,complexity:0};return{files:s,summary:{totalFiles:s.length,totalLines:c,totalCodeLines:l,avgComplexity:s.length>0?Math.round(u/s.length*10)/10:0,maxComplexity:{file:p.path,value:p.complexity},totalFunctions:f}}}function d(e,t){let n=t.split(`
|
|
2
|
-
`),r=0,i=0,a=!1;for(let e of n){let t=e.trim();if(t===``){r++;continue}if(a){i++,t.includes(`*/`)&&(a=!1);continue}if(t.startsWith(`//`)){i++;continue}t.startsWith(`/*`)&&(i++,a=!t.includes(`*/`))}let o=1;for(let e of l){let n=t.match(e);n&&(o+=n.length)}let s=(t.match(/\bfunction\b/g)?.length??0)+(t.match(/=>\s*[{(]/g)?.length??0),c=t.match(/^\s*import\s/gm)?.length??0,u=t.match(/^\s*export\s/gm)?.length??0;return{path:e,lines:{total:n.length,code:n.length-r-i,blank:r,comment:i},complexity:o,functions:s,imports:c,exports:u}}const f=new Set(`if_statement.for_statement.for_in_statement.while_statement.do_statement.switch_case.catch_clause.ternary_expression.if_statement.for_statement.while_statement.except_clause.list_comprehension.if_statement.for_statement.enhanced_for_statement.while_statement.catch_clause.ternary_expression.if_statement.for_statement.select_statement.if_expression.for_expression.while_expression.match_arm`.split(`.`)),p=new Set([`if_statement`,`if_expression`,`for_statement`,`for_in_statement`,`enhanced_for_statement`,`for_expression`,`while_statement`,`while_expression`,`do_statement`,`switch_statement`,`match_expression`,`try_statement`,`catch_clause`,`except_clause`,`lambda`,`lambda_expression`,`arrow_function`]);async function m(e,t){let n=i.get();if(!(!n||!r.has(t)))try{let r=await n.parse(e,t);if(!r)return;let i=0;function a(e,t){let n=f.has(e.type),r=p.has(e.type);n&&(i+=1+t);let o=r?t+1:t;for(let t=0;t<e.childCount;t++){let n=e.child(t);n&&a(n,o)}}return a(r.rootNode,0),i}catch{return}}function h(n,r){try{if(s(n).isFile())return[n]}catch{throw Error(`Path not found: ${n}`)}let i=[];function a(n){for(let l of o(n)){if(c.has(l))continue;let o=t(n,l);s(o).isDirectory()?a(o):r.includes(e(l).toLowerCase())&&i.push(o)}}return a(n),i.sort(),i}export{d as analyzeFile,u as measure};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
//#region packages/tools/src/onboard-utils.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Shared utilities for onboard sub-modules.
|
|
4
|
-
*/
|
|
5
|
-
declare const TEST_SEGMENTS: Set<string>;
|
|
6
|
-
declare function isTestPath(filePath: string): boolean;
|
|
7
|
-
/** Get the package key for grouping: detects monorepo, Java, and flat structures */
|
|
8
|
-
declare function getPackageKey(fp: string): string;
|
|
9
|
-
/** Try to match extensionless import path to actual source file */
|
|
10
|
-
declare function resolveExtensionlessPath(nf: string, exportsByFile: Map<string, unknown>): string;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { TEST_SEGMENTS, getPackageKey, isTestPath, resolveExtensionlessPath };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=new Set([`test`,`tests`,`__tests__`,`spec`,`specs`,`__mocks__`,`__fixtures__`,`fixtures`,`test-utils`]);function t(t){return t.replace(/\\/g,`/`).split(`/`).some(t=>e.has(t))||/\.(test|spec)\.[jt]sx?$/.test(t)||/Test\.java$/.test(t)}function n(e){let t=e.split(`/`);if(t.length>=2&&[`packages`,`services`,`providers`,`apps`,`libs`].includes(t[0]))return`${t[0]}/${t[1]}`;let n=t.indexOf(`java`),r=t.indexOf(`kotlin`),i=n>=0?n:r;if(i>=0&&i+2<t.length){let e=t.slice(i+1);return[`com`,`org`,`net`,`io`,`dev`].includes(e[0])&&e.length>=3?e.slice(0,3).join(`/`):e.slice(0,2).join(`/`)}return t[0]===`src`&&t.length>=3?`${t[0]}/${t[1]}`:t[0]}function r(e,t){if(t.has(e))return e;for(let n of[`.ts`,`.tsx`,`.js`,`.jsx`])if(t.has(`${e}${n}`))return`${e}${n}`;return t.has(`${e}/index.ts`)?`${e}/index.ts`:e}export{e as TEST_SEGMENTS,n as getPackageKey,t as isTestPath,r as resolveExtensionlessPath};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
//#region packages/tools/src/onboard.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* aikit_onboard — First-time codebase onboarding in a single command.
|
|
4
|
-
*
|
|
5
|
-
* Runs all analysis tools in parallel and optionally writes structured
|
|
6
|
-
* output to `.ai/context/` for human-readable reference.
|
|
7
|
-
*
|
|
8
|
-
* Analyses: structure, dependencies, entry-points, symbols, patterns, diagram.
|
|
9
|
-
*/
|
|
10
|
-
type OnboardMode = 'memory' | 'generate';
|
|
11
|
-
interface OnboardOptions {
|
|
12
|
-
/** Root path to analyze */
|
|
13
|
-
path: string;
|
|
14
|
-
/** Output mode: 'memory' (AI Kit only) or 'generate' (write to .ai/context/) */
|
|
15
|
-
mode?: OnboardMode;
|
|
16
|
-
/** Output directory for generate mode (default: '<path>/.ai/context') */
|
|
17
|
-
outDir?: string;
|
|
18
|
-
}
|
|
19
|
-
interface OnboardStepResult {
|
|
20
|
-
name: string;
|
|
21
|
-
status: 'success' | 'failed';
|
|
22
|
-
output: string;
|
|
23
|
-
durationMs: number;
|
|
24
|
-
error?: string;
|
|
25
|
-
}
|
|
26
|
-
interface OnboardResult {
|
|
27
|
-
/** Root path that was analyzed */
|
|
28
|
-
path: string;
|
|
29
|
-
/** Mode used */
|
|
30
|
-
mode: OnboardMode;
|
|
31
|
-
/** Results for each analysis step */
|
|
32
|
-
steps: OnboardStepResult[];
|
|
33
|
-
/** Output directory (only set in generate mode) */
|
|
34
|
-
outDir?: string;
|
|
35
|
-
/** Total duration in ms */
|
|
36
|
-
totalDurationMs: number;
|
|
37
|
-
/** Auto-generated AI Kit entries for curated store persistence */
|
|
38
|
-
autoRemember?: Array<{
|
|
39
|
-
title: string;
|
|
40
|
-
content: string;
|
|
41
|
-
category: string;
|
|
42
|
-
tags: string[];
|
|
43
|
-
}>;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Run all onboarding analyses in parallel and return combined results.
|
|
47
|
-
*/
|
|
48
|
-
declare function onboard(options: OnboardOptions): Promise<OnboardResult>;
|
|
49
|
-
//#endregion
|
|
50
|
-
export { OnboardMode, OnboardOptions, OnboardResult, OnboardStepResult, onboard };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import{extractConfigValues as e}from"./config-extractor.js";import{buildDiagrams as t}from"./diagram-builder.js";import{buildCodeMap as n,buildSynthesisGuide as r}from"./synthesis-engine.js";import{DependencyAnalyzer as i,DiagramGenerator as a,EntryPointAnalyzer as o,PatternAnalyzer as ee,StructureAnalyzer as s,SymbolAnalyzer as c,extractRegexCallGraph as l,extractTsCallGraph as u}from"../../analyzers/dist/index.js";import{mkdir as d,readdir as f,rm as p,writeFile as m}from"node:fs/promises";import{basename as h,join as g,resolve as _}from"node:path";import{existsSync as v}from"node:fs";import{AIKIT_PATHS as y}from"../../core/dist/index.js";const b={structure:`Project Structure`,dependencies:`Dependencies`,"entry-points":`Entry Points`,symbols:`Symbols`,patterns:`Patterns`,diagram:`C4 Container Diagram`,"code-map":`Code Map (Module Graph)`,"config-values":`Configuration Values`,"synthesis-guide":`Synthesis Guide`,"api-surface":`API Surface`,"type-inventory":`Type Inventory`};function x(e){let t=e.get(`symbols`);if(!t?.symbols?.length)return`# API Surface
|
|
2
|
-
|
|
3
|
-
*No symbol data available.*
|
|
4
|
-
`;let n=t.symbols.filter(e=>e.exported);if(n.length===0)return`# API Surface
|
|
5
|
-
|
|
6
|
-
*No exported symbols found.*
|
|
7
|
-
`;let r=new Map;for(let e of n){let t=r.get(e.filePath)??[];t.push(e),r.set(e.filePath,t)}let i=[`# API Surface
|
|
8
|
-
`];for(let[e,t]of[...r.entries()].sort(([e],[t])=>e.localeCompare(t))){i.push(`## ${e}\n`);for(let e of t){e.decorators?.length&&i.push(e.decorators.join(` `));let t=e.signature??``,n=e.returnType?`: ${e.returnType}`:``;if(e.kind===`function`||e.kind===`method`)i.push(`### \`${e.name}${t}${n}\``);else if(e.kind===`class`)i.push(`### class \`${e.name}\`${t?` ${t}`:``}`);else if(e.kind===`interface`||e.kind===`type`){let t=e.typeBody?` ${e.typeBody}`:``;i.push(`### ${e.kind} \`${e.name}\`${t}`)}else i.push(`### ${e.kind} \`${e.name}\`${t?`: ${t}`:``}`);e.jsdoc&&i.push(`> ${e.jsdoc}`),i.push(``)}}let a=i.join(`
|
|
9
|
-
`);return a.length>1e5?`${a.slice(0,1e5)}\n\n*[truncated]*`:a}function S(e){let t=e.get(`symbols`);if(!t?.symbols?.length)return`# Type Inventory
|
|
10
|
-
|
|
11
|
-
*No symbol data available.*
|
|
12
|
-
`;let n=t.symbols.filter(e=>e.exported&&(e.kind===`interface`||e.kind===`type`||e.kind===`enum`));if(n.length===0)return`# Type Inventory
|
|
13
|
-
|
|
14
|
-
*No exported types/interfaces found.*
|
|
15
|
-
`;let r=new Map;for(let e of n){let t=r.get(e.filePath)??[];t.push(e),r.set(e.filePath,t)}let i=[`# Type Inventory
|
|
16
|
-
`];for(let[e,t]of[...r.entries()].sort(([e],[t])=>e.localeCompare(t))){i.push(`## ${e}\n`);for(let e of t){let t=e.typeBody??`*body not available*`;e.jsdoc&&i.push(`> ${e.jsdoc}`),i.push(`### ${e.kind} \`${e.name}\``),i.push("```"),i.push(t),i.push("```\n")}}let a=i.join(`
|
|
17
|
-
`);return a.length>1e5?`${a.slice(0,1e5)}\n\n*[truncated]*`:a}async function C(C){let w=Date.now(),T=_(C.path),E=h(T),D=C.mode??`generate`,O=C.outDir??g(T,y.aiContext),k=new s,A=new i,j=new c,M=new ee,N=new o,P=new a,F=[{name:`structure`,fn:()=>k.analyze(T,{format:`markdown`,maxDepth:3,sourceOnly:!0})},{name:`dependencies`,fn:()=>A.analyze(T,{format:`markdown`})},{name:`entry-points`,fn:()=>N.analyze(T)},{name:`symbols`,fn:()=>j.analyze(T,{format:`markdown`})},{name:`patterns`,fn:()=>M.analyze(T)},{name:`diagram`,fn:()=>P.analyze(T,{diagramType:`architecture`})}],I=await Promise.allSettled(F.map(async e=>{let t=Date.now(),n=await e.fn();return{name:e.name,result:n,durationMs:Date.now()-t}})),L=[],R=new Map,z=new Map;for(let e of I)if(e.status===`fulfilled`){let{name:t,result:n,durationMs:r}=e.value,i=n;L.push({name:t,status:`success`,output:i.output,durationMs:r}),R.set(t,i.output),z.set(t,i.data)}else{let t=e.reason,n=F[I.indexOf(e)].name;L.push({name:n,status:`failed`,output:``,durationMs:0,error:t.message})}let B=Date.now(),V=null;try{let e=await u(T);if((!e||e.edges.length===0)&&(e=await l(T)),e&&e.edges.length>0){V=new Map;for(let t of e.edges){let e=V.get(t.from);e||(e=new Map,V.set(t.from,e));let n=e.get(t.to);if(n)for(let e of t.symbols)n.includes(e)||n.push(e);else e.set(t.to,[...t.symbols])}}}catch{}let H=Date.now()-B,U=Date.now(),W=n(z,E,V),G=Date.now()-U+H;if(L.push({name:`code-map`,status:`success`,output:W,durationMs:G}),R.set(`code-map`,W),V&&V.size>0){let e=t(V,z,E),n=L.find(e=>e.name===`diagram`);n&&(n.output=e,R.set(`diagram`,e))}let K=Date.now(),q=await e(T,E),J=Date.now()-K;L.push({name:`config-values`,status:`success`,output:q,durationMs:J}),R.set(`config-values`,q);let Y=r(L,D,E,z);L.push({name:`synthesis-guide`,status:`success`,output:Y,durationMs:0}),R.set(`synthesis-guide`,Y);let X=x(z);L.push({name:`api-surface`,status:`success`,output:X,durationMs:0}),R.set(`api-surface`,X);let Z=S(z);if(L.push({name:`type-inventory`,status:`success`,output:Z,durationMs:0}),R.set(`type-inventory`,Z),D===`generate`){if(v(O))for(let e of await f(O))(e.endsWith(`.md`)||e.endsWith(`.json`))&&await p(g(O,e),{force:!0});await d(O,{recursive:!0});let e=new Date().toISOString();for(let[t,n]of R){let r=g(O,`${t}.md`),i=n.replaceAll(T,E);await m(r,`<!-- Generated: ${e} -->\n<!-- Project: ${E} -->\n\n`+i,`utf-8`)}let t=[`<!-- Generated: ${e} -->`,`<!-- Project: ${E} -->`,``,`# ${E} — Codebase Knowledge`,``,`## Contents`,``];for(let e of L){let n=`${e.name}.md`,r=b[e.name]??e.name,i=e.status===`success`?`✓`:`✗`,a=e.durationMs>0?` (${e.durationMs}ms)`:``;t.push(`- ${i} [${r}](./${n})${a}`)}t.push(``),await m(g(O,`README.md`),t.join(`
|
|
18
|
-
`),`utf-8`)}let Q=[];Q.push({title:`Onboard: ${E} project overview`,content:Y.slice(0,2e3),category:`conventions`,tags:[`onboard`,`project-overview`,E]});let $=L.find(e=>e.name===`patterns`);return $?.status===`success`&&$.output&&Q.push({title:`Onboard: ${E} detected patterns`,content:$.output.slice(0,1500),category:`patterns`,tags:[`onboard`,`patterns`,E]}),q&&Q.push({title:`Onboard: ${E} config and commands`,content:q.slice(0,1500),category:`conventions`,tags:[`onboard`,`config`,`commands`,E]}),{path:T,mode:D,steps:L,outDir:D===`generate`?O:void 0,totalDurationMs:Date.now()-w,autoRemember:Q}}export{C as onboard};
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
//#region packages/tools/src/parse-output.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* aikit_parse_output — Structured parsers for common build tool output.
|
|
4
|
-
*
|
|
5
|
-
* Converts noisy text output from tsc, vitest, biome, and git status
|
|
6
|
-
* into structured JSON that LLM agents can act on directly.
|
|
7
|
-
*/
|
|
8
|
-
interface ParsedError {
|
|
9
|
-
file: string;
|
|
10
|
-
line?: number;
|
|
11
|
-
column?: number;
|
|
12
|
-
severity: 'error' | 'warning' | 'info';
|
|
13
|
-
code?: string;
|
|
14
|
-
message: string;
|
|
15
|
-
}
|
|
16
|
-
interface ParsedTestResult {
|
|
17
|
-
name: string;
|
|
18
|
-
file?: string;
|
|
19
|
-
status: 'pass' | 'fail' | 'skip';
|
|
20
|
-
duration?: number;
|
|
21
|
-
error?: string;
|
|
22
|
-
}
|
|
23
|
-
interface ParsedTestSummary {
|
|
24
|
-
tests: ParsedTestResult[];
|
|
25
|
-
passed: number;
|
|
26
|
-
failed: number;
|
|
27
|
-
skipped: number;
|
|
28
|
-
duration?: number;
|
|
29
|
-
suites?: number;
|
|
30
|
-
}
|
|
31
|
-
interface ParsedGitStatus {
|
|
32
|
-
staged: Array<{
|
|
33
|
-
status: string;
|
|
34
|
-
file: string;
|
|
35
|
-
}>;
|
|
36
|
-
unstaged: Array<{
|
|
37
|
-
status: string;
|
|
38
|
-
file: string;
|
|
39
|
-
}>;
|
|
40
|
-
untracked: string[];
|
|
41
|
-
branch?: string;
|
|
42
|
-
}
|
|
43
|
-
type ParsedOutput = {
|
|
44
|
-
tool: 'tsc';
|
|
45
|
-
errors: ParsedError[];
|
|
46
|
-
} | {
|
|
47
|
-
tool: 'vitest';
|
|
48
|
-
summary: ParsedTestSummary;
|
|
49
|
-
} | {
|
|
50
|
-
tool: 'biome';
|
|
51
|
-
errors: ParsedError[];
|
|
52
|
-
} | {
|
|
53
|
-
tool: 'git-status';
|
|
54
|
-
status: ParsedGitStatus;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Parse `tsc` output into structured errors.
|
|
58
|
-
*
|
|
59
|
-
* Example line: `src/foo.ts(10,5): error TS2339: Property 'x' does not exist`
|
|
60
|
-
*/
|
|
61
|
-
declare function parseTsc(output: string): ParsedError[];
|
|
62
|
-
/** Strip ANSI escape codes from terminal output */
|
|
63
|
-
declare function stripAnsi(text: string): string;
|
|
64
|
-
/**
|
|
65
|
-
* Parse vitest run output into structured test results.
|
|
66
|
-
*/
|
|
67
|
-
declare function parseVitest(output: string): ParsedTestSummary;
|
|
68
|
-
/**
|
|
69
|
-
* Parse biome check/lint output into structured errors.
|
|
70
|
-
*
|
|
71
|
-
* Example: `src/foo.ts:10:5 lint/suspicious/noDoubleEquals ━━━`
|
|
72
|
-
* ` × Use === instead of ==`
|
|
73
|
-
*/
|
|
74
|
-
declare function parseBiome(output: string): ParsedError[];
|
|
75
|
-
/**
|
|
76
|
-
* Parse `git status --porcelain=v1 -b` output into structured status.
|
|
77
|
-
*/
|
|
78
|
-
declare function parseGitStatus(output: string): ParsedGitStatus;
|
|
79
|
-
/**
|
|
80
|
-
* Auto-detect the tool from output content and parse accordingly.
|
|
81
|
-
*/
|
|
82
|
-
declare function parseOutput(output: string, tool?: string): ParsedOutput;
|
|
83
|
-
//#endregion
|
|
84
|
-
export { ParsedError, ParsedGitStatus, ParsedOutput, ParsedTestResult, ParsedTestSummary, parseBiome, parseGitStatus, parseOutput, parseTsc, parseVitest, stripAnsi };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function e(e){let t=[];for(let n of e.matchAll(/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+(TS\d+):\s+(.+)$/gm))t.push({file:n[1],line:Number.parseInt(n[2],10),column:Number.parseInt(n[3],10),severity:n[4],code:n[5],message:n[6]});if(t.length===0)for(let n of e.matchAll(/^(.+?):(\d+):(\d+)\s+-\s+(error|warning)\s+(TS\d+):\s+(.+)$/gm))t.push({file:n[1],line:Number.parseInt(n[2],10),column:Number.parseInt(n[3],10),severity:n[4],code:n[5],message:n[6]});return t}function t(e){return e.replace(/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g,``)}function n(e){let n=t(e),r=[];for(let e of n.matchAll(/^\s*([✓✕×-])\s+(.+?)(?:\s+(\d+)ms)?$/gm)){let t=e[1],n=t===`✓`?`pass`:t===`-`?`skip`:`fail`;r.push({name:e[2].trim(),status:n,duration:e[3]?Number.parseInt(e[3],10):void 0})}for(let e of n.matchAll(/^\s*([✓✕×])\s+(\S+\.test\.\w+)\s+\((\d+)\s+tests?\)\s*(\d+ms)?$/gm)){let t=e[1]===`✓`?`pass`:`fail`;r.push({name:e[2],file:e[2],status:t,duration:e[4]?Number.parseInt(e[4],10):void 0})}let i=/Tests\s+(?:(\d+)\s+passed)?(?:\s*\|\s*)?(?:(\d+)\s+failed)?(?:\s*\|\s*)?(?:(\d+)\s+skipped)?\s*\((\d+)\)/.exec(n),a=i?Number.parseInt(i[1]??`0`,10):r.filter(e=>e.status===`pass`).length,o=i?Number.parseInt(i[2]??`0`,10):r.filter(e=>e.status===`fail`).length,s=i?Number.parseInt(i[3]??`0`,10):r.filter(e=>e.status===`skip`).length,c=/Duration\s+(\d+(?:\.\d+)?)(?:ms|s)/.exec(n),l=c?c[0].includes(`s`)&&!c[0].includes(`ms`)?Number.parseFloat(c[1])*1e3:Number.parseFloat(c[1]):void 0,u=/Test Files\s+(\d+)\s+passed/.exec(n);return{tests:r,passed:a,failed:o,skipped:s,duration:l,suites:u?Number.parseInt(u[1],10):void 0}}function r(e){let t=[];for(let n of e.matchAll(/^(.+?):(\d+):(\d+)\s+([\w/]+)\s+━+$/gm)){let r=n[1],i=Number.parseInt(n[2],10),a=Number.parseInt(n[3],10),o=n[4],s=e.slice((n.index??0)+n[0].length,(n.index??0)+n[0].length+500),c=/^\s*[×!i]\s+(.+)$/m.exec(s),l=c?c[1].trim():o,u=o.includes(`lint`)?`warning`:`error`;t.push({file:r,line:i,column:a,severity:u,code:o,message:l})}return t}function i(e){let t=[],n=[],r=[],i;for(let o of e.split(`
|
|
2
|
-
`)){if(!o)continue;if(o.startsWith(`## `)){i=o.slice(3).split(`...`)[0];continue}let e=o[0],s=o[1],c=o.slice(3).trim();e===`?`&&s===`?`?r.push(c):(e!==` `&&e!==`?`&&t.push({status:a(e),file:c}),s!==` `&&s!==`?`&&n.push({status:a(s),file:c}))}return{staged:t,unstaged:n,untracked:r,branch:i}}function a(e){return{M:`modified`,A:`added`,D:`deleted`,R:`renamed`,C:`copied`,U:`unmerged`}[e]??e}function o(t,a){let o=a??s(t);switch(o){case`tsc`:return{tool:`tsc`,errors:e(t)};case`vitest`:return{tool:`vitest`,summary:n(t)};case`biome`:return{tool:`biome`,errors:r(t)};case`git-status`:return{tool:`git-status`,status:i(t)};default:throw Error(`Unknown tool: ${o}. Supported: tsc, vitest, biome, git-status`)}}function s(e){return e.includes(`error TS`)||/\(\d+,\d+\):\s+error/.test(e)?`tsc`:e.includes(`vitest`)||e.includes(`Test Files`)||e.includes(`✓`)?`vitest`:e.includes(`biome`)||/\w+\/\w+\s+━+/.test(e)?`biome`:/^##\s/.test(e)||/^[MADRCU?! ]{2}\s/.test(e)?`git-status`:`unknown`}export{r as parseBiome,i as parseGitStatus,o as parseOutput,e as parseTsc,n as parseVitest,t as stripAnsi};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//#region packages/tools/src/path-resolver.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Shared path resolver for MCP tools (E-014).
|
|
4
|
-
* Provides consistent path resolution across all tools.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Resolve a user-supplied path to an absolute path.
|
|
8
|
-
* - Absolute paths are returned as-is
|
|
9
|
-
* - Relative paths are resolved against the server's cwd
|
|
10
|
-
* - '.' and empty/undefined default to cwd
|
|
11
|
-
*/
|
|
12
|
-
declare function resolvePath(input?: string): string;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { resolvePath };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{isAbsolute as e,resolve as t}from"node:path";function n(n){return!n||n===`.`?process.cwd():e(n)?n:t(process.cwd(),n)}export{n as resolvePath};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
//#region packages/tools/src/process-manager.d.ts
|
|
2
|
-
interface ManagedProcess {
|
|
3
|
-
id: string;
|
|
4
|
-
command: string;
|
|
5
|
-
args: string[];
|
|
6
|
-
pid?: number;
|
|
7
|
-
status: 'running' | 'stopped' | 'error';
|
|
8
|
-
startedAt: string;
|
|
9
|
-
exitCode?: number;
|
|
10
|
-
logs: string[];
|
|
11
|
-
}
|
|
12
|
-
declare function processStart(id: string, command: string, args?: string[], options?: {
|
|
13
|
-
cwd?: string;
|
|
14
|
-
}): ManagedProcess;
|
|
15
|
-
declare function processStop(id: string): ManagedProcess | undefined;
|
|
16
|
-
declare function processStatus(id: string): ManagedProcess | undefined;
|
|
17
|
-
declare function processList(): ManagedProcess[];
|
|
18
|
-
declare function processLogs(id: string, tail?: number): string[];
|
|
19
|
-
//#endregion
|
|
20
|
-
export { ManagedProcess, processList, processLogs, processStart, processStatus, processStop };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{spawn as e}from"node:child_process";const t=new Map;function n(n,r,i=[],a){if(t.has(n))throw Error(`Process "${n}" is already running. Stop it first.`);if(t.size>=20)throw Error(`Too many managed processes (max 20). Stop some first.`);let o=/[;|&`$(){}[\]!<>\\]/,s=[r,...i].join(` `);if(o.test(s))throw Error(`Command contains disallowed shell metacharacters`);let c=e(s,{cwd:a?.cwd??process.cwd(),shell:!0,stdio:[`ignore`,`pipe`,`pipe`]}),l={id:n,command:r,args:i,pid:c.pid??void 0,status:`running`,startedAt:new Date().toISOString(),logs:[]},u=e=>{let t=e.toString().split(/\r?\n/).filter(Boolean);l.logs.push(...t),l.logs.length>200&&(l.logs=l.logs.slice(-200))};return c.stdout?.on(`data`,u),c.stderr?.on(`data`,u),c.on(`exit`,e=>{l.status=e===0?`stopped`:`error`,l.exitCode=e??void 0,setTimeout(()=>t.delete(n),3e4)}),c.on(`error`,e=>{l.status=`error`,l.logs.push(`[error] ${e.message}`)}),t.set(n,{proc:c,info:l}),l}function r(e){let n=t.get(e);if(!n)return;n.proc.kill(`SIGTERM`);let r=setTimeout(()=>{try{n.proc.kill(`SIGKILL`)}catch{}},5e3);return n.proc.once(`exit`,()=>clearTimeout(r)),n.info.status=`stopped`,t.delete(e),n.info}function i(e){return t.get(e)?.info}function a(){return[...t.values()].map(e=>e.info)}function o(e,n){let r=t.get(e);return r?n?r.info.logs.slice(-n):r.info.logs:[]}export{a as processList,o as processLogs,n as processStart,i as processStatus,r as processStop};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
//#region packages/tools/src/queue.d.ts
|
|
2
|
-
interface QueueItem {
|
|
3
|
-
id: string;
|
|
4
|
-
title: string;
|
|
5
|
-
status: 'pending' | 'in-progress' | 'done' | 'failed';
|
|
6
|
-
data?: unknown;
|
|
7
|
-
createdAt: string;
|
|
8
|
-
updatedAt: string;
|
|
9
|
-
error?: string;
|
|
10
|
-
}
|
|
11
|
-
interface QueueState {
|
|
12
|
-
name: string;
|
|
13
|
-
items: QueueItem[];
|
|
14
|
-
}
|
|
15
|
-
/** Create a new named queue. */
|
|
16
|
-
declare function queueCreate(name: string, cwd?: string): QueueState;
|
|
17
|
-
/** Push an item onto a queue. Creates the queue if it doesn't exist. */
|
|
18
|
-
declare function queuePush(name: string, title: string, data?: unknown, cwd?: string): QueueItem;
|
|
19
|
-
/** Take the next pending item from a queue and mark it in-progress. */
|
|
20
|
-
declare function queueNext(name: string, cwd?: string): QueueItem | null;
|
|
21
|
-
/** Mark a queue item as done. */
|
|
22
|
-
declare function queueDone(name: string, id: string, cwd?: string): QueueItem;
|
|
23
|
-
/** Mark a queue item as failed with an error message. */
|
|
24
|
-
declare function queueFail(name: string, id: string, error: string, cwd?: string): QueueItem;
|
|
25
|
-
/** Get the current state of a queue. */
|
|
26
|
-
declare function queueGet(name: string, cwd?: string): QueueState | null;
|
|
27
|
-
/** List all queues with their item counts. */
|
|
28
|
-
declare function queueList(cwd?: string): Array<{
|
|
29
|
-
name: string;
|
|
30
|
-
pending: number;
|
|
31
|
-
done: number;
|
|
32
|
-
failed: number;
|
|
33
|
-
total: number;
|
|
34
|
-
}>;
|
|
35
|
-
/** Clear completed items from a queue. */
|
|
36
|
-
declare function queueClear(name: string, cwd?: string): number;
|
|
37
|
-
/** Delete a queue entirely. */
|
|
38
|
-
declare function queueDelete(name: string, cwd?: string): boolean;
|
|
39
|
-
//#endregion
|
|
40
|
-
export { QueueItem, QueueState, queueClear, queueCreate, queueDelete, queueDone, queueFail, queueGet, queueList, queueNext, queuePush };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{dirname as e,resolve as t}from"node:path";import{existsSync as n,mkdirSync as r,readFileSync as i,renameSync as a,writeFileSync as o}from"node:fs";import{resolveStateDir as s}from"../../core/dist/index.js";function c(e){return t(s(e??process.cwd()),`queue.json`)}function l(e){let t=c(e);if(!n(t))return{};try{return JSON.parse(i(t,`utf-8`))}catch(e){return e?.code===`ENOENT`||console.warn(`Corrupt state file ${t}: ${e instanceof Error?e.message:String(e)}`),{}}}function u(t,i){let s=c(i),l=e(s);n(l)||r(l,{recursive:!0});let u=`${s}.tmp`;o(u,`${JSON.stringify(t,null,2)}\n`,`utf-8`),a(u,s)}function d(){return`q_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,6)}`}function f(e,t){let n=l(t);if(n[e])throw Error(`Queue "${e}" already exists`);let r={name:e,items:[]};return n[e]=r,u(n,t),r}function p(e,t,n,r){let i=l(r);i[e]||(i[e]={name:e,items:[]});let a=new Date().toISOString(),o={id:d(),title:t,status:`pending`,data:n,createdAt:a,updatedAt:a};if(i[e].items.length>=500)throw Error(`Queue "${e}" has reached the maximum of 500 items. Clear completed items with queue({ action: "clear" }) before adding more.`);return i[e].items.push(o),u(i,r),o}function m(e,t){let n=l(t),r=n[e];if(!r)throw Error(`Queue "${e}" does not exist`);let i=r.items.find(e=>e.status===`pending`);return i?(i.status=`in-progress`,i.updatedAt=new Date().toISOString(),u(n,t),i):null}function h(e,t,n){let r=l(n),i=r[e];if(!i)throw Error(`Queue "${e}" does not exist`);let a=i.items.find(e=>e.id===t);if(!a)throw Error(`Item "${t}" not found in queue "${e}"`);return a.status=`done`,a.updatedAt=new Date().toISOString(),u(r,n),a}function g(e,t,n,r){let i=l(r),a=i[e];if(!a)throw Error(`Queue "${e}" does not exist`);let o=a.items.find(e=>e.id===t);if(!o)throw Error(`Item "${t}" not found in queue "${e}"`);return o.status=`failed`,o.error=n,o.updatedAt=new Date().toISOString(),u(i,r),o}function _(e,t){return l(t)[e]??null}function v(e){let t=l(e);return Object.values(t).map(e=>({name:e.name,pending:e.items.filter(e=>e.status===`pending`).length,done:e.items.filter(e=>e.status===`done`).length,failed:e.items.filter(e=>e.status===`failed`).length,total:e.items.length}))}function y(e,t){let n=l(t),r=n[e];if(!r)throw Error(`Queue "${e}" does not exist`);let i=r.items.length;r.items=r.items.filter(e=>e.status===`pending`||e.status===`in-progress`);let a=i-r.items.length;return u(n,t),a}function b(e,t){let n=l(t);return n[e]?(delete n[e],u(n,t),!0):!1}export{y as queueClear,f as queueCreate,b as queueDelete,h as queueDone,g as queueFail,_ as queueGet,v as queueList,m as queueNext,p as queuePush};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//#region packages/tools/src/regex-test.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* aikit_regex_test — Test regex patterns against sample strings.
|
|
4
|
-
*/
|
|
5
|
-
interface RegexTestOptions {
|
|
6
|
-
pattern: string;
|
|
7
|
-
flags?: string;
|
|
8
|
-
testStrings: string[];
|
|
9
|
-
mode?: 'match' | 'replace' | 'split';
|
|
10
|
-
replacement?: string;
|
|
11
|
-
}
|
|
12
|
-
interface RegexMatchInfo {
|
|
13
|
-
full: string;
|
|
14
|
-
groups: (string | undefined)[];
|
|
15
|
-
index: number;
|
|
16
|
-
}
|
|
17
|
-
interface RegexTestStringResult {
|
|
18
|
-
input: string;
|
|
19
|
-
matched: boolean;
|
|
20
|
-
matches?: RegexMatchInfo[];
|
|
21
|
-
replaced?: string;
|
|
22
|
-
split?: string[];
|
|
23
|
-
}
|
|
24
|
-
interface RegexTestResult {
|
|
25
|
-
pattern: string;
|
|
26
|
-
flags: string;
|
|
27
|
-
results: RegexTestStringResult[];
|
|
28
|
-
valid: boolean;
|
|
29
|
-
error?: string;
|
|
30
|
-
}
|
|
31
|
-
declare function regexTest(options: RegexTestOptions): RegexTestResult;
|
|
32
|
-
//#endregion
|
|
33
|
-
export { RegexMatchInfo, RegexTestOptions, RegexTestResult, RegexTestStringResult, regexTest };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){let{pattern:t,flags:n=``,testStrings:r,mode:i=`match`,replacement:a=``}=e;try{let e=new RegExp(t,n);return{pattern:t,flags:n,results:r.map(r=>{let o=e.test(r);switch(i){case`match`:{let e=n.includes(`g`)?n:`${n}g`;return{input:r,matched:o,matches:[...r.matchAll(new RegExp(t,e))].map(e=>({full:e[0],groups:[...e.slice(1)],index:e.index??0}))}}case`replace`:return{input:r,matched:o,replaced:r.replace(new RegExp(t,n),a)};default:return{input:r,matched:o,split:r.split(new RegExp(t,n))}}}),valid:!0}}catch(e){return{pattern:t,flags:n,results:[],valid:!1,error:e.message}}}export{e as regexTest};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
//#region packages/tools/src/regex-utils.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Escape special regular-expression characters in a string so it can be
|
|
4
|
-
* embedded safely inside a `new RegExp(...)` expression.
|
|
5
|
-
*/
|
|
6
|
-
declare function escapeRegExp(value: string): string;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { escapeRegExp };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}export{e as escapeRegExp};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
//#region packages/tools/src/rename.d.ts
|
|
2
|
-
interface RenameOptions {
|
|
3
|
-
/** Symbol to rename */
|
|
4
|
-
oldName: string;
|
|
5
|
-
/** New symbol name */
|
|
6
|
-
newName: string;
|
|
7
|
-
/** Root directory to search in */
|
|
8
|
-
rootPath: string;
|
|
9
|
-
/** File extensions to process (default: .ts, .tsx, .js, .jsx) */
|
|
10
|
-
extensions?: string[];
|
|
11
|
-
/** Glob patterns to exclude */
|
|
12
|
-
exclude?: string[];
|
|
13
|
-
/** Dry run — don't write changes */
|
|
14
|
-
dryRun?: boolean;
|
|
15
|
-
}
|
|
16
|
-
interface RenameChange {
|
|
17
|
-
path: string;
|
|
18
|
-
line: number;
|
|
19
|
-
before: string;
|
|
20
|
-
after: string;
|
|
21
|
-
}
|
|
22
|
-
interface RenameResult {
|
|
23
|
-
oldName: string;
|
|
24
|
-
newName: string;
|
|
25
|
-
changes: RenameChange[];
|
|
26
|
-
filesModified: number;
|
|
27
|
-
dryRun: boolean;
|
|
28
|
-
}
|
|
29
|
-
declare function rename(options: RenameOptions): Promise<RenameResult>;
|
|
30
|
-
//#endregion
|
|
31
|
-
export { RenameChange, RenameOptions, RenameResult, rename };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{escapeRegExp as e}from"./regex-utils.js";import{DEFAULT_TOOL_EXTENSIONS as t,walkFiles as n}from"./file-walk.js";import{createRestorePoint as r}from"./restore-points.js";import{readFile as i,writeFile as a}from"node:fs/promises";import{relative as o}from"node:path";function s(e){return e.replace(/\\/g,`/`)}function c(t){return RegExp(`(^|[^A-Za-z0-9_$])(${e(t)})(?=[^A-Za-z0-9_$]|$)`,`g`)}async function l(e){let{oldName:l,newName:u,rootPath:d,extensions:f=t,exclude:p=[],dryRun:m=!1}=e;if(!l.trim())throw Error(`oldName must not be empty`);let h=c(l),g=await n(d,f,p),_=[],v=0,y=[];for(let e of g){let t=await i(e,`utf-8`),n=t.split(/\r?\n/),r=!1;for(let t=0;t<n.length;t++){let i=n[t];h.lastIndex=0;let a=i.replace(h,(e,t)=>(r=!0,`${t}${u}`));i!==a&&(n[t]=a,_.push({path:s(o(d,e)),line:t+1,before:i,after:a}))}r&&(v+=1,m||(y.push({path:e,content:t}),await a(e,n.join(`
|
|
2
|
-
`),`utf-8`)))}return!m&&y.length>0&&r(`rename`,y,`rename: ${l} → ${u}, ${v} files`),{oldName:l,newName:u,changes:_,filesModified:v,dryRun:m}}export{l as rename};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
//#region packages/tools/src/replay.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Replay — append-only audit trail of tool/CLI invocations.
|
|
4
|
-
*
|
|
5
|
-
* Captures tool name, arguments (redacted), duration, and result summary
|
|
6
|
-
* to `.aikit-state/replay.jsonl`. Used by `aikit replay` CLI, `aikit_replay` MCP tool,
|
|
7
|
-
* and the TUI log panel.
|
|
8
|
-
*/
|
|
9
|
-
interface ReplayEntry {
|
|
10
|
-
/** ISO timestamp */
|
|
11
|
-
ts: string;
|
|
12
|
-
/** Source: 'mcp' | 'cli' */
|
|
13
|
-
source: 'mcp' | 'cli';
|
|
14
|
-
/** Tool or command name */
|
|
15
|
-
tool: string;
|
|
16
|
-
/** Redacted input summary (first 200 chars of JSON) */
|
|
17
|
-
input: string;
|
|
18
|
-
/** Duration in milliseconds */
|
|
19
|
-
durationMs: number;
|
|
20
|
-
/** Result status */
|
|
21
|
-
status: 'ok' | 'error';
|
|
22
|
-
/** Short result summary (first 200 chars) */
|
|
23
|
-
output: string;
|
|
24
|
-
}
|
|
25
|
-
interface ReplayOptions {
|
|
26
|
-
/** Max entries to return (default: 20) */
|
|
27
|
-
last?: number;
|
|
28
|
-
/** Filter by tool name */
|
|
29
|
-
tool?: string;
|
|
30
|
-
/** Filter by source */
|
|
31
|
-
source?: 'mcp' | 'cli';
|
|
32
|
-
/** Filter entries after this ISO timestamp */
|
|
33
|
-
since?: string;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Append a replay entry to the audit log.
|
|
37
|
-
* Creates the state directory if it doesn't exist.
|
|
38
|
-
*/
|
|
39
|
-
declare function replayAppend(entry: ReplayEntry): void;
|
|
40
|
-
/**
|
|
41
|
-
* Read replay entries with optional filters.
|
|
42
|
-
*/
|
|
43
|
-
declare function replayList(opts?: ReplayOptions): ReplayEntry[];
|
|
44
|
-
/**
|
|
45
|
-
* Trim the replay log to MAX_ENTRIES, keeping the most recent.
|
|
46
|
-
* Async to avoid blocking the event loop on large logs.
|
|
47
|
-
*/
|
|
48
|
-
declare function replayTrim(): Promise<number>;
|
|
49
|
-
/**
|
|
50
|
-
* Clear the entire replay log.
|
|
51
|
-
*/
|
|
52
|
-
declare function replayClear(): void;
|
|
53
|
-
/**
|
|
54
|
-
* Helper: create a replay entry from a tool invocation.
|
|
55
|
-
* Use as a wrapper around tool execution.
|
|
56
|
-
*/
|
|
57
|
-
declare function replayCapture(source: 'mcp' | 'cli', tool: string, input: unknown, fn: () => Promise<unknown>): Promise<unknown>;
|
|
58
|
-
//#endregion
|
|
59
|
-
export { ReplayEntry, ReplayOptions, replayAppend, replayCapture, replayClear, replayList, replayTrim };
|