mindweave 0.0.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -0
- package/README.md +171 -14
- package/dist/alternator/chassis/cache.js +47 -0
- package/dist/alternator/chassis/cache.js.map +1 -0
- package/dist/alternator/chassis/domRefs.js +53 -0
- package/dist/alternator/chassis/domRefs.js.map +1 -0
- package/dist/alternator/chassis/extractWorker.js +65 -0
- package/dist/alternator/chassis/extractWorker.js.map +1 -0
- package/dist/alternator/chassis/graph.js +221 -0
- package/dist/alternator/chassis/graph.js.map +1 -0
- package/dist/alternator/chassis/index.js +463 -0
- package/dist/alternator/chassis/index.js.map +1 -0
- package/dist/alternator/chassis/isolation.js +336 -0
- package/dist/alternator/chassis/isolation.js.map +1 -0
- package/dist/alternator/chassis/langCases.js +69 -0
- package/dist/alternator/chassis/langCases.js.map +1 -0
- package/dist/alternator/chassis/lsp.js +469 -0
- package/dist/alternator/chassis/lsp.js.map +1 -0
- package/dist/alternator/chassis/markup.js +262 -0
- package/dist/alternator/chassis/markup.js.map +1 -0
- package/dist/alternator/chassis/provision.js +198 -0
- package/dist/alternator/chassis/provision.js.map +1 -0
- package/dist/alternator/chassis/rank.js +72 -0
- package/dist/alternator/chassis/rank.js.map +1 -0
- package/dist/alternator/chassis/servers.js +215 -0
- package/dist/alternator/chassis/servers.js.map +1 -0
- package/dist/alternator/chassis/treesitter.js +608 -0
- package/dist/alternator/chassis/treesitter.js.map +1 -0
- package/dist/alternator/chassis/types.js +24 -0
- package/dist/alternator/chassis/types.js.map +1 -0
- package/dist/alternator/lane.js +67 -0
- package/dist/alternator/lane.js.map +1 -0
- package/dist/cli/App.js +2586 -0
- package/dist/cli/App.js.map +1 -0
- package/dist/cli/altScreen.js +67 -0
- package/dist/cli/altScreen.js.map +1 -0
- package/dist/cli/approvalChannel.js +72 -0
- package/dist/cli/approvalChannel.js.map +1 -0
- package/dist/cli/attachments.js +188 -0
- package/dist/cli/attachments.js.map +1 -0
- package/dist/cli/bootstrap.js +279 -0
- package/dist/cli/bootstrap.js.map +1 -0
- package/dist/cli/chatAnchor.js +94 -0
- package/dist/cli/chatAnchor.js.map +1 -0
- package/dist/cli/commandArgs.js +79 -0
- package/dist/cli/commandArgs.js.map +1 -0
- package/dist/cli/commandRoute.js +78 -0
- package/dist/cli/commandRoute.js.map +1 -0
- package/dist/cli/compaction.js +69 -0
- package/dist/cli/compaction.js.map +1 -0
- package/dist/cli/components/ApprovalBox.js +100 -0
- package/dist/cli/components/ApprovalBox.js.map +1 -0
- package/dist/cli/components/BlockView.js +128 -0
- package/dist/cli/components/BlockView.js.map +1 -0
- package/dist/cli/components/FirstRunFrame.js +41 -0
- package/dist/cli/components/FirstRunFrame.js.map +1 -0
- package/dist/cli/components/KeyManager.js +197 -0
- package/dist/cli/components/KeyManager.js.map +1 -0
- package/dist/cli/components/KeySetup.js +125 -0
- package/dist/cli/components/KeySetup.js.map +1 -0
- package/dist/cli/components/MenuFrame.js +24 -0
- package/dist/cli/components/MenuFrame.js.map +1 -0
- package/dist/cli/components/Picker.js +82 -0
- package/dist/cli/components/Picker.js.map +1 -0
- package/dist/cli/components/PromptInput.js +509 -0
- package/dist/cli/components/PromptInput.js.map +1 -0
- package/dist/cli/components/SubagentView.js +86 -0
- package/dist/cli/components/SubagentView.js.map +1 -0
- package/dist/cli/components/ToolGroup.js +60 -0
- package/dist/cli/components/ToolGroup.js.map +1 -0
- package/dist/cli/components/ToolLine.js +123 -0
- package/dist/cli/components/ToolLine.js.map +1 -0
- package/dist/cli/components/TrustGate.js +37 -0
- package/dist/cli/components/TrustGate.js.map +1 -0
- package/dist/cli/costView.js +40 -0
- package/dist/cli/costView.js.map +1 -0
- package/dist/cli/frameRate.js +30 -0
- package/dist/cli/frameRate.js.map +1 -0
- package/dist/cli/framebuffer/paint.js +165 -0
- package/dist/cli/framebuffer/paint.js.map +1 -0
- package/dist/cli/framebuffer/parse.js +266 -0
- package/dist/cli/framebuffer/parse.js.map +1 -0
- package/dist/cli/framebuffer/screen.js +196 -0
- package/dist/cli/framebuffer/screen.js.map +1 -0
- package/dist/cli/framebuffer/writer.js +139 -0
- package/dist/cli/framebuffer/writer.js.map +1 -0
- package/dist/cli/groupReveal.js +51 -0
- package/dist/cli/groupReveal.js.map +1 -0
- package/dist/cli/help.js +55 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/inputView.js +105 -0
- package/dist/cli/inputView.js.map +1 -0
- package/dist/cli/keyManager.js +65 -0
- package/dist/cli/keyManager.js.map +1 -0
- package/dist/cli/keySetup.js +35 -0
- package/dist/cli/keySetup.js.map +1 -0
- package/dist/cli/keyStore.js +73 -0
- package/dist/cli/keyStore.js.map +1 -0
- package/dist/cli/markdown.js +460 -0
- package/dist/cli/markdown.js.map +1 -0
- package/dist/cli/messageQueue.js +96 -0
- package/dist/cli/messageQueue.js.map +1 -0
- package/dist/cli/modes.js +90 -0
- package/dist/cli/modes.js.map +1 -0
- package/dist/cli/mouse.js +78 -0
- package/dist/cli/mouse.js.map +1 -0
- package/dist/cli/pasteAssembler.js +44 -0
- package/dist/cli/pasteAssembler.js.map +1 -0
- package/dist/cli/pathComplete.js +39 -0
- package/dist/cli/pathComplete.js.map +1 -0
- package/dist/cli/perfLog.js +90 -0
- package/dist/cli/perfLog.js.map +1 -0
- package/dist/cli/reveal.js +32 -0
- package/dist/cli/reveal.js.map +1 -0
- package/dist/cli/revealPace.js +59 -0
- package/dist/cli/revealPace.js.map +1 -0
- package/dist/cli/sessionCarry.js +19 -0
- package/dist/cli/sessionCarry.js.map +1 -0
- package/dist/cli/smoothScroll.js +74 -0
- package/dist/cli/smoothScroll.js.map +1 -0
- package/dist/cli/startupArgs.js +96 -0
- package/dist/cli/startupArgs.js.map +1 -0
- package/dist/cli/terminalRestore.js +34 -0
- package/dist/cli/terminalRestore.js.map +1 -0
- package/dist/cli/toolDisplay.js +219 -0
- package/dist/cli/toolDisplay.js.map +1 -0
- package/dist/cli/toolItems.js +65 -0
- package/dist/cli/toolItems.js.map +1 -0
- package/dist/cli/transcript.js +351 -0
- package/dist/cli/transcript.js.map +1 -0
- package/dist/cli/trust.js +79 -0
- package/dist/cli/trust.js.map +1 -0
- package/dist/cli/updateCheck.js +107 -0
- package/dist/cli/updateCheck.js.map +1 -0
- package/dist/cli/version.js +39 -0
- package/dist/cli/version.js.map +1 -0
- package/dist/cli/viewport.js +179 -0
- package/dist/cli/viewport.js.map +1 -0
- package/dist/cli/virtualWindow.js +103 -0
- package/dist/cli/virtualWindow.js.map +1 -0
- package/dist/cli/workingVerb.js +37 -0
- package/dist/cli/workingVerb.js.map +1 -0
- package/dist/cli/wrap.js +145 -0
- package/dist/cli/wrap.js.map +1 -0
- package/dist/drivers/anthropic/cachePoints.js +77 -0
- package/dist/drivers/anthropic/cachePoints.js.map +1 -0
- package/dist/drivers/anthropic/client.js +432 -0
- package/dist/drivers/anthropic/client.js.map +1 -0
- package/dist/drivers/anthropic/index.js +10 -0
- package/dist/drivers/anthropic/index.js.map +1 -0
- package/dist/drivers/anthropic/manifest.js +221 -0
- package/dist/drivers/anthropic/manifest.js.map +1 -0
- package/dist/drivers/cerebras/client.js +69 -0
- package/dist/drivers/cerebras/client.js.map +1 -0
- package/dist/drivers/cerebras/index.js +5 -0
- package/dist/drivers/cerebras/index.js.map +1 -0
- package/dist/drivers/cerebras/manifest.js +140 -0
- package/dist/drivers/cerebras/manifest.js.map +1 -0
- package/dist/drivers/clientId.js +41 -0
- package/dist/drivers/clientId.js.map +1 -0
- package/dist/drivers/contextOverflow.js +77 -0
- package/dist/drivers/contextOverflow.js.map +1 -0
- package/dist/drivers/deepseek/client.js +168 -0
- package/dist/drivers/deepseek/client.js.map +1 -0
- package/dist/drivers/deepseek/index.js +16 -0
- package/dist/drivers/deepseek/index.js.map +1 -0
- package/dist/drivers/deepseek/inlineTools.js +46 -0
- package/dist/drivers/deepseek/inlineTools.js.map +1 -0
- package/dist/drivers/deepseek/manifest.js +166 -0
- package/dist/drivers/deepseek/manifest.js.map +1 -0
- package/dist/drivers/gemini/client.js +38 -0
- package/dist/drivers/gemini/client.js.map +1 -0
- package/dist/drivers/gemini/index.js +5 -0
- package/dist/drivers/gemini/index.js.map +1 -0
- package/dist/drivers/gemini/manifest.js +150 -0
- package/dist/drivers/gemini/manifest.js.map +1 -0
- package/dist/drivers/glm/client.js +90 -0
- package/dist/drivers/glm/client.js.map +1 -0
- package/dist/drivers/glm/index.js +9 -0
- package/dist/drivers/glm/index.js.map +1 -0
- package/dist/drivers/glm/manifest.js +183 -0
- package/dist/drivers/glm/manifest.js.map +1 -0
- package/dist/drivers/groq/client.js +80 -0
- package/dist/drivers/groq/client.js.map +1 -0
- package/dist/drivers/groq/index.js +5 -0
- package/dist/drivers/groq/index.js.map +1 -0
- package/dist/drivers/groq/manifest.js +160 -0
- package/dist/drivers/groq/manifest.js.map +1 -0
- package/dist/drivers/kimi/client.js +82 -0
- package/dist/drivers/kimi/client.js.map +1 -0
- package/dist/drivers/kimi/index.js +9 -0
- package/dist/drivers/kimi/index.js.map +1 -0
- package/dist/drivers/kimi/manifest.js +168 -0
- package/dist/drivers/kimi/manifest.js.map +1 -0
- package/dist/drivers/meta/client.js +30 -0
- package/dist/drivers/meta/client.js.map +1 -0
- package/dist/drivers/meta/index.js +5 -0
- package/dist/drivers/meta/index.js.map +1 -0
- package/dist/drivers/meta/manifest.js +101 -0
- package/dist/drivers/meta/manifest.js.map +1 -0
- package/dist/drivers/minimax/client.js +36 -0
- package/dist/drivers/minimax/client.js.map +1 -0
- package/dist/drivers/minimax/index.js +5 -0
- package/dist/drivers/minimax/index.js.map +1 -0
- package/dist/drivers/minimax/manifest.js +120 -0
- package/dist/drivers/minimax/manifest.js.map +1 -0
- package/dist/drivers/mistral/client.js +54 -0
- package/dist/drivers/mistral/client.js.map +1 -0
- package/dist/drivers/mistral/index.js +5 -0
- package/dist/drivers/mistral/index.js.map +1 -0
- package/dist/drivers/mistral/manifest.js +118 -0
- package/dist/drivers/mistral/manifest.js.map +1 -0
- package/dist/drivers/openai/client.js +290 -0
- package/dist/drivers/openai/client.js.map +1 -0
- package/dist/drivers/openai/index.js +9 -0
- package/dist/drivers/openai/index.js.map +1 -0
- package/dist/drivers/openai/manifest.js +133 -0
- package/dist/drivers/openai/manifest.js.map +1 -0
- package/dist/drivers/openaiCompat/wire.js +493 -0
- package/dist/drivers/openaiCompat/wire.js.map +1 -0
- package/dist/drivers/partialTurn.js +23 -0
- package/dist/drivers/partialTurn.js.map +1 -0
- package/dist/drivers/providerError.js +181 -0
- package/dist/drivers/providerError.js.map +1 -0
- package/dist/drivers/qwen/client.js +93 -0
- package/dist/drivers/qwen/client.js.map +1 -0
- package/dist/drivers/qwen/index.js +9 -0
- package/dist/drivers/qwen/index.js.map +1 -0
- package/dist/drivers/qwen/manifest.js +146 -0
- package/dist/drivers/qwen/manifest.js.map +1 -0
- package/dist/drivers/registry.js +177 -0
- package/dist/drivers/registry.js.map +1 -0
- package/dist/drivers/retryPolicy.js +129 -0
- package/dist/drivers/retryPolicy.js.map +1 -0
- package/dist/drivers/searchBlocks.js +61 -0
- package/dist/drivers/searchBlocks.js.map +1 -0
- package/dist/drivers/types.js +2 -0
- package/dist/drivers/types.js.map +1 -0
- package/dist/drivers/xai/client.js +63 -0
- package/dist/drivers/xai/client.js.map +1 -0
- package/dist/drivers/xai/index.js +5 -0
- package/dist/drivers/xai/index.js.map +1 -0
- package/dist/drivers/xai/manifest.js +137 -0
- package/dist/drivers/xai/manifest.js.map +1 -0
- package/dist/dynamo/_probe.tmp.js +20 -0
- package/dist/dynamo/_probe.tmp.js.map +1 -0
- package/dist/dynamo/cacheBreak.js +88 -0
- package/dist/dynamo/cacheBreak.js.map +1 -0
- package/dist/dynamo/contextWindow.js +243 -0
- package/dist/dynamo/contextWindow.js.map +1 -0
- package/dist/dynamo/engine.js +2011 -0
- package/dist/dynamo/engine.js.map +1 -0
- package/dist/dynamo/guard.js +132 -0
- package/dist/dynamo/guard.js.map +1 -0
- package/dist/dynamo/liveMeter.js +58 -0
- package/dist/dynamo/liveMeter.js.map +1 -0
- package/dist/dynamo/model.js +172 -0
- package/dist/dynamo/model.js.map +1 -0
- package/dist/dynamo/planArtifact.js +125 -0
- package/dist/dynamo/planArtifact.js.map +1 -0
- package/dist/dynamo/pricing.js +140 -0
- package/dist/dynamo/pricing.js.map +1 -0
- package/dist/dynamo/prompt.js +264 -0
- package/dist/dynamo/prompt.js.map +1 -0
- package/dist/dynamo/spend.js +45 -0
- package/dist/dynamo/spend.js.map +1 -0
- package/dist/dynamo/verify.js +483 -0
- package/dist/dynamo/verify.js.map +1 -0
- package/dist/governor/forbidden.js +181 -0
- package/dist/governor/forbidden.js.map +1 -0
- package/dist/governor/freshness.js +83 -0
- package/dist/governor/freshness.js.map +1 -0
- package/dist/governor/frontmatter.js +38 -0
- package/dist/governor/frontmatter.js.map +1 -0
- package/dist/governor/glob.js +75 -0
- package/dist/governor/glob.js.map +1 -0
- package/dist/governor/index.js +87 -0
- package/dist/governor/index.js.map +1 -0
- package/dist/governor/rules.js +80 -0
- package/dist/governor/rules.js.map +1 -0
- package/dist/governor/scope.js +91 -0
- package/dist/governor/scope.js.map +1 -0
- package/dist/governor/skills.js +176 -0
- package/dist/governor/skills.js.map +1 -0
- package/dist/governor/types.js +16 -0
- package/dist/governor/types.js.map +1 -0
- package/dist/governor/write.js +182 -0
- package/dist/governor/write.js.map +1 -0
- package/dist/index.js +89 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/catalog.js +232 -0
- package/dist/mcp/catalog.js.map +1 -0
- package/dist/mcp/config.js +116 -0
- package/dist/mcp/config.js.map +1 -0
- package/dist/mcp/configWrite.js +254 -0
- package/dist/mcp/configWrite.js.map +1 -0
- package/dist/mcp/connection.js +504 -0
- package/dist/mcp/connection.js.map +1 -0
- package/dist/mcp/deferred.js +104 -0
- package/dist/mcp/deferred.js.map +1 -0
- package/dist/mcp/discover.js +128 -0
- package/dist/mcp/discover.js.map +1 -0
- package/dist/mcp/manager.js +679 -0
- package/dist/mcp/manager.js.map +1 -0
- package/dist/mcp/paramHeaders.js +163 -0
- package/dist/mcp/paramHeaders.js.map +1 -0
- package/dist/mcp/prompts.js +136 -0
- package/dist/mcp/prompts.js.map +1 -0
- package/dist/mcp/protocol.js +171 -0
- package/dist/mcp/protocol.js.map +1 -0
- package/dist/mcp/resources.js +119 -0
- package/dist/mcp/resources.js.map +1 -0
- package/dist/mcp/resultStore.js +180 -0
- package/dist/mcp/resultStore.js.map +1 -0
- package/dist/mcp/subscriptions.js +74 -0
- package/dist/mcp/subscriptions.js.map +1 -0
- package/dist/mcp/transport/headerValue.js +40 -0
- package/dist/mcp/transport/headerValue.js.map +1 -0
- package/dist/mcp/transport/http.js +321 -0
- package/dist/mcp/transport/http.js.map +1 -0
- package/dist/mcp/transport/stdio.js +234 -0
- package/dist/mcp/transport/stdio.js.map +1 -0
- package/dist/mcp/transport/types.js +27 -0
- package/dist/mcp/transport/types.js.map +1 -0
- package/dist/mcp/trust.js +98 -0
- package/dist/mcp/trust.js.map +1 -0
- package/dist/mcp/trustStore.js +55 -0
- package/dist/mcp/trustStore.js.map +1 -0
- package/dist/memory/autoMemory.js +340 -0
- package/dist/memory/autoMemory.js.map +1 -0
- package/dist/memory/compaction.js +513 -0
- package/dist/memory/compaction.js.map +1 -0
- package/dist/memory/images.js +173 -0
- package/dist/memory/images.js.map +1 -0
- package/dist/memory/presence.js +59 -0
- package/dist/memory/presence.js.map +1 -0
- package/dist/memory/projectNotes.js +247 -0
- package/dist/memory/projectNotes.js.map +1 -0
- package/dist/memory/restore.js +72 -0
- package/dist/memory/restore.js.map +1 -0
- package/dist/memory/session.js +472 -0
- package/dist/memory/session.js.map +1 -0
- package/dist/memory/sessionMemory.js +142 -0
- package/dist/memory/sessionMemory.js.map +1 -0
- package/dist/memory/sessionMemoryCompact.js +136 -0
- package/dist/memory/sessionMemoryCompact.js.map +1 -0
- package/dist/memory/store.js +217 -0
- package/dist/memory/store.js.map +1 -0
- package/dist/memory/types.js +14 -0
- package/dist/memory/types.js.map +1 -0
- package/dist/memory/workingSet.js +383 -0
- package/dist/memory/workingSet.js.map +1 -0
- package/dist/project/context.js +425 -0
- package/dist/project/context.js.map +1 -0
- package/dist/tools/approval.js +189 -0
- package/dist/tools/approval.js.map +1 -0
- package/dist/tools/askUser.js +103 -0
- package/dist/tools/askUser.js.map +1 -0
- package/dist/tools/atomicWrite.js +151 -0
- package/dist/tools/atomicWrite.js.map +1 -0
- package/dist/tools/backgroundShells.js +468 -0
- package/dist/tools/backgroundShells.js.map +1 -0
- package/dist/tools/captureSweep.js +77 -0
- package/dist/tools/captureSweep.js.map +1 -0
- package/dist/tools/chassisMux.js +92 -0
- package/dist/tools/chassisMux.js.map +1 -0
- package/dist/tools/checkpoints.js +328 -0
- package/dist/tools/checkpoints.js.map +1 -0
- package/dist/tools/codeIntel.js +267 -0
- package/dist/tools/codeIntel.js.map +1 -0
- package/dist/tools/deferredNative.js +121 -0
- package/dist/tools/deferredNative.js.map +1 -0
- package/dist/tools/detail.js +135 -0
- package/dist/tools/detail.js.map +1 -0
- package/dist/tools/diagnostics.js +174 -0
- package/dist/tools/diagnostics.js.map +1 -0
- package/dist/tools/edit.js +167 -0
- package/dist/tools/edit.js.map +1 -0
- package/dist/tools/editCore.js +283 -0
- package/dist/tools/editCore.js.map +1 -0
- package/dist/tools/editFile.js +183 -0
- package/dist/tools/editFile.js.map +1 -0
- package/dist/tools/editRipple.js +126 -0
- package/dist/tools/editRipple.js.map +1 -0
- package/dist/tools/editTarget.js +131 -0
- package/dist/tools/editTarget.js.map +1 -0
- package/dist/tools/editWindow.js +49 -0
- package/dist/tools/editWindow.js.map +1 -0
- package/dist/tools/eol.js +56 -0
- package/dist/tools/eol.js.map +1 -0
- package/dist/tools/exitPlan.js +175 -0
- package/dist/tools/exitPlan.js.map +1 -0
- package/dist/tools/focus.js +42 -0
- package/dist/tools/focus.js.map +1 -0
- package/dist/tools/gitignore.js +148 -0
- package/dist/tools/gitignore.js.map +1 -0
- package/dist/tools/glob.js +134 -0
- package/dist/tools/glob.js.map +1 -0
- package/dist/tools/governorTools.js +258 -0
- package/dist/tools/governorTools.js.map +1 -0
- package/dist/tools/grep.js +450 -0
- package/dist/tools/grep.js.map +1 -0
- package/dist/tools/guard.js +220 -0
- package/dist/tools/guard.js.map +1 -0
- package/dist/tools/killTree.js +215 -0
- package/dist/tools/killTree.js.map +1 -0
- package/dist/tools/listDir.js +143 -0
- package/dist/tools/listDir.js.map +1 -0
- package/dist/tools/mcpAdd.js +176 -0
- package/dist/tools/mcpAdd.js.map +1 -0
- package/dist/tools/mcpResources.js +116 -0
- package/dist/tools/mcpResources.js.map +1 -0
- package/dist/tools/mcpSearch.js +123 -0
- package/dist/tools/mcpSearch.js.map +1 -0
- package/dist/tools/multiEdit.js +168 -0
- package/dist/tools/multiEdit.js.map +1 -0
- package/dist/tools/paths.js +225 -0
- package/dist/tools/paths.js.map +1 -0
- package/dist/tools/posixShell.js +123 -0
- package/dist/tools/posixShell.js.map +1 -0
- package/dist/tools/readFile.js +371 -0
- package/dist/tools/readFile.js.map +1 -0
- package/dist/tools/readSymbol.js +145 -0
- package/dist/tools/readSymbol.js.map +1 -0
- package/dist/tools/registry.js +120 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/replaceSymbol.js +141 -0
- package/dist/tools/replaceSymbol.js.map +1 -0
- package/dist/tools/results.js +15 -0
- package/dist/tools/results.js.map +1 -0
- package/dist/tools/ripgrep.js +145 -0
- package/dist/tools/ripgrep.js.map +1 -0
- package/dist/tools/runCommand.js +633 -0
- package/dist/tools/runCommand.js.map +1 -0
- package/dist/tools/saveMemory.js +102 -0
- package/dist/tools/saveMemory.js.map +1 -0
- package/dist/tools/screenshot.js +200 -0
- package/dist/tools/screenshot.js.map +1 -0
- package/dist/tools/screenshotWin.js +227 -0
- package/dist/tools/screenshotWin.js.map +1 -0
- package/dist/tools/search.js +121 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/sessionTools.js +187 -0
- package/dist/tools/sessionTools.js.map +1 -0
- package/dist/tools/shellCheckpoint.js +123 -0
- package/dist/tools/shellCheckpoint.js.map +1 -0
- package/dist/tools/shellLint.js +102 -0
- package/dist/tools/shellLint.js.map +1 -0
- package/dist/tools/shellTools.js +203 -0
- package/dist/tools/shellTools.js.map +1 -0
- package/dist/tools/spanCore.js +78 -0
- package/dist/tools/spanCore.js.map +1 -0
- package/dist/tools/subagent.js +224 -0
- package/dist/tools/subagent.js.map +1 -0
- package/dist/tools/subagentReport.js +114 -0
- package/dist/tools/subagentReport.js.map +1 -0
- package/dist/tools/tempSweep.js +118 -0
- package/dist/tools/tempSweep.js.map +1 -0
- package/dist/tools/todo.js +117 -0
- package/dist/tools/todo.js.map +1 -0
- package/dist/tools/types.js +2 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/tools/untrusted.js +46 -0
- package/dist/tools/untrusted.js.map +1 -0
- package/dist/tools/useSkill.js +62 -0
- package/dist/tools/useSkill.js.map +1 -0
- package/dist/tools/walk.js +152 -0
- package/dist/tools/walk.js.map +1 -0
- package/dist/tools/web.js +61 -0
- package/dist/tools/web.js.map +1 -0
- package/dist/tools/webFetch.js +444 -0
- package/dist/tools/webFetch.js.map +1 -0
- package/dist/tools/webSearch.js +130 -0
- package/dist/tools/webSearch.js.map +1 -0
- package/dist/tools/workspace.js +212 -0
- package/dist/tools/workspace.js.map +1 -0
- package/dist/tools/workspaceDiscover.js +216 -0
- package/dist/tools/workspaceDiscover.js.map +1 -0
- package/dist/tools/writeFile.js +162 -0
- package/dist/tools/writeFile.js.map +1 -0
- package/package.json +74 -28
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* glob.ts — find files by name pattern.
|
|
3
|
+
*
|
|
4
|
+
* The model's way to discover paths it can then read or edit. Primary engine is
|
|
5
|
+
* ripgrep (`rg --files -g <pattern>`): fast and .gitignore-aware. When `rg` isn't
|
|
6
|
+
* installed it falls back to a pure-Node walk filtered by a compiled glob. A simple
|
|
7
|
+
* shape: `pattern` + optional `path`.
|
|
8
|
+
*/
|
|
9
|
+
import { promises as fs } from "node:fs";
|
|
10
|
+
import { join } from "node:path";
|
|
11
|
+
import { relativize, searchUnits } from "./paths.js";
|
|
12
|
+
import { DEFAULT_IGNORES, globToRegExp, walkFiles } from "./walk.js";
|
|
13
|
+
import { SEARCH_EXCLUDE_GLOBS, excludedFromSearch } from "./guard.js";
|
|
14
|
+
import { ripgrepAvailable, runRipgrep } from "./ripgrep.js";
|
|
15
|
+
import { fail, failQuietly } from "./results.js";
|
|
16
|
+
/** Cap on paths returned. Exported for the merged `search` tool's description. */
|
|
17
|
+
export const GLOB_MAX_RESULTS = 100;
|
|
18
|
+
const MAX_RESULTS = GLOB_MAX_RESULTS;
|
|
19
|
+
export const globDef = {
|
|
20
|
+
name: "glob",
|
|
21
|
+
readOnly: true,
|
|
22
|
+
// Same failure as grep had: the model reads "No files found." as "this project does
|
|
23
|
+
// not have that file", when .gitignore may simply have hidden it. Stated here so an
|
|
24
|
+
// empty result is understood as a bounded search rather than a fact about the repo.
|
|
25
|
+
description: "Find files whose path matches a glob pattern (e.g. `**/*.ts`, `src/**/*.{ts,tsx}`). " +
|
|
26
|
+
"Returns matching file paths. Searches every session root unless `path` is given. " +
|
|
27
|
+
"The pattern is matched against each file's path RELATIVE to the root being " +
|
|
28
|
+
"searched, so `src/**/*.ts` works and a leading slash does not. " +
|
|
29
|
+
"Files the project's .gitignore excludes are NOT listed, and neither are " +
|
|
30
|
+
"node_modules or .git, so 'No files found' means it is not in the tracked tree, " +
|
|
31
|
+
"not that it is absent from disk. Generated or built output usually falls in that " +
|
|
32
|
+
`gap. Results stop after ${MAX_RESULTS} paths and say so when they do. ` +
|
|
33
|
+
"Use grep instead when you care what is INSIDE files rather than what they are called.",
|
|
34
|
+
parameters: {
|
|
35
|
+
type: "object",
|
|
36
|
+
additionalProperties: false,
|
|
37
|
+
required: ["pattern"],
|
|
38
|
+
properties: {
|
|
39
|
+
pattern: {
|
|
40
|
+
type: "string",
|
|
41
|
+
description: "The glob pattern to match file paths against.",
|
|
42
|
+
},
|
|
43
|
+
path: {
|
|
44
|
+
type: "string",
|
|
45
|
+
description: "Directory (or a root's label) to search in. Defaults to all session roots. Omit to use the default.",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
async execute(args, ctx) {
|
|
50
|
+
const pattern = typeof args.pattern === "string" ? args.pattern.trim() : "";
|
|
51
|
+
if (!pattern)
|
|
52
|
+
return failQuietly("`pattern` is required.");
|
|
53
|
+
// Patterns are matched against a ROOT-RELATIVE path, which a leading slash can
|
|
54
|
+
// never equal. Decided here rather than inside either engine because the two read
|
|
55
|
+
// it differently: the Node matcher anchors the slash and finds nothing, while
|
|
56
|
+
// ripgrep treats it as anchored-to-the-search-root and matches. Same call, same
|
|
57
|
+
// project, two answers, depending only on whether `rg` was installed.
|
|
58
|
+
if (pattern.startsWith("/")) {
|
|
59
|
+
return { output: "No files found.", summary: `glob ${pattern} — no matches` };
|
|
60
|
+
}
|
|
61
|
+
const rawPath = typeof args.path === "string" && args.path.trim() ? args.path.trim() : undefined;
|
|
62
|
+
const units = searchUnits(ctx, rawPath);
|
|
63
|
+
const haveRg = await ripgrepAvailable();
|
|
64
|
+
const matched = [];
|
|
65
|
+
for (const unit of units) {
|
|
66
|
+
const dir = unit.sub ? join(unit.root, unit.sub) : unit.root;
|
|
67
|
+
try {
|
|
68
|
+
const stat = await fs.stat(dir);
|
|
69
|
+
if (!stat.isDirectory()) {
|
|
70
|
+
if (rawPath)
|
|
71
|
+
return fail(`${rawPath} is not a directory.`);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
if (rawPath)
|
|
77
|
+
return fail(`directory not found: ${rawPath}`);
|
|
78
|
+
continue; // a missing root in a multi-root sweep is skipped, not fatal
|
|
79
|
+
}
|
|
80
|
+
matched.push(...(haveRg ? await globViaRipgrep(pattern, unit, ctx) : await globViaWalk(pattern, unit, ctx)));
|
|
81
|
+
}
|
|
82
|
+
if (matched.length === 0) {
|
|
83
|
+
return { output: "No files found.", summary: `glob ${pattern} — no matches` };
|
|
84
|
+
}
|
|
85
|
+
const truncated = matched.length > MAX_RESULTS;
|
|
86
|
+
const lines = matched.slice(0, MAX_RESULTS);
|
|
87
|
+
if (truncated) {
|
|
88
|
+
lines.push(`… (${matched.length - MAX_RESULTS} more — narrow the pattern)`);
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
output: lines.join("\n"),
|
|
92
|
+
summary: `glob ${pattern} (${matched.length} match${matched.length === 1 ? "" : "es"})`,
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
/** `rg --files -g` within one root. Emitted root-relative paths are re-labeled so
|
|
97
|
+
* they round-trip across roots (single-root: a plain relative path, unchanged). */
|
|
98
|
+
async function globViaRipgrep(pattern, unit, ctx) {
|
|
99
|
+
const args = ["--files", "--hidden", "--path-separator", "/"];
|
|
100
|
+
// ORDER IS LOAD-BEARING. ripgrep's `-g` rules are last-match-wins, exactly like
|
|
101
|
+
// .gitignore, so the caller's pattern MUST come first and the exclusions after it.
|
|
102
|
+
// With the exclusions first, a pattern as ordinary as `**/*` matched last and
|
|
103
|
+
// overrode every one of them, and `rg --files --hidden` then listed `.env` and
|
|
104
|
+
// `id_rsa` outright. MEASURED both ways against a real rg before changing this.
|
|
105
|
+
args.push("-g", pattern);
|
|
106
|
+
for (const dir of DEFAULT_IGNORES)
|
|
107
|
+
args.push("-g", `!${dir}`);
|
|
108
|
+
// `--hidden` makes ripgrep descend into dot-directories, which is exactly where
|
|
109
|
+
// secrets and other agents' saved sessions live. grep has always excluded them, on
|
|
110
|
+
// the reasoning that a search must not surface what a direct read would refuse.
|
|
111
|
+
// Listing a path is a weaker disclosure than printing its contents, but it is the
|
|
112
|
+
// same disclosure in kind: it tells the model a secrets file exists and where. The
|
|
113
|
+
// guard is only meaningful if every way of looking respects it.
|
|
114
|
+
for (const excluded of SEARCH_EXCLUDE_GLOBS)
|
|
115
|
+
args.push("-g", `!${excluded}`);
|
|
116
|
+
args.push("--", unit.sub || ".");
|
|
117
|
+
const res = await runRipgrep(args, unit.root);
|
|
118
|
+
if (res.code !== 0 && res.code !== 1)
|
|
119
|
+
return globViaWalk(pattern, unit, ctx); // fall back on rg failure
|
|
120
|
+
return res.lines.map((line) => relativize(ctx, join(unit.root, line)));
|
|
121
|
+
}
|
|
122
|
+
/** Pure-Node fallback: walk one root and filter by the compiled glob; labeled output. */
|
|
123
|
+
async function globViaWalk(pattern, unit, ctx) {
|
|
124
|
+
const regexp = globToRegExp(pattern);
|
|
125
|
+
const dir = unit.sub ? join(unit.root, unit.sub) : unit.root;
|
|
126
|
+
const { files } = await walkFiles(dir, 20_000);
|
|
127
|
+
// The same exclusions the ripgrep path applies, so the two engines cannot disagree
|
|
128
|
+
// about what is allowed to be seen.
|
|
129
|
+
return files
|
|
130
|
+
.filter((f) => !excludedFromSearch(f.abs))
|
|
131
|
+
.filter((f) => regexp.test(f.rel))
|
|
132
|
+
.map((f) => relativize(ctx, f.abs));
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=glob.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../src/tools/glob.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAmB,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,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C,GAAG,CAAC,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { isMcpToolName } from "../mcp/catalog.js";
|
|
2
|
+
import { writeRule, appendForbidden, appendForbiddenCommand, appendForbiddenMcpTool, deriveRuleName, slugify, writeSkill } from "../governor/write.js";
|
|
3
|
+
import { rescope } from "../governor/scope.js";
|
|
4
|
+
import { parseGlobs } from "../governor/rules.js";
|
|
5
|
+
import { failQuietly } from "./results.js";
|
|
6
|
+
/** The project root for state files: the fixed session root, carried on the
|
|
7
|
+
* governance config (cwd may have moved via `cd`; the root never does). */
|
|
8
|
+
function projectRoot(ctx) {
|
|
9
|
+
return ctx.governance?.forbidden.root ?? ctx.cwd;
|
|
10
|
+
}
|
|
11
|
+
async function doRememberRule(args, ctx) {
|
|
12
|
+
const body = typeof args.value === "string" ? args.value.trim() : "";
|
|
13
|
+
if (!body)
|
|
14
|
+
return failQuietly("`value` is required — the rule text.");
|
|
15
|
+
const name = (typeof args.name === "string" && args.name.trim()) || deriveRuleName(body);
|
|
16
|
+
const globs = parseGlobs(typeof args.globs === "string" ? args.globs : undefined);
|
|
17
|
+
const saved = await writeRule(projectRoot(ctx), name, body, "", globs);
|
|
18
|
+
// Mirror into the live session so the rule is in the very next prompt.
|
|
19
|
+
//
|
|
20
|
+
// Deduplicate by SLUG, not by the display name. The rule FILE is `<slug>.md`, so
|
|
21
|
+
// "Use pnpm" and "use pnpm!" are one rule on disk and were two in memory: the
|
|
22
|
+
// session showed both, the next session showed one, and the user watched a rule
|
|
23
|
+
// they had just set disappear on restart. Matching how the file is keyed is what
|
|
24
|
+
// keeps the live list and the disk agreeing.
|
|
25
|
+
if (ctx.governance) {
|
|
26
|
+
const slug = slugify(saved.name);
|
|
27
|
+
ctx.governance.rules = [...ctx.governance.rules.filter((r) => slugify(r.name) !== slug), saved];
|
|
28
|
+
// A brand-new scoped rule never saw the paths this session already worked in, and
|
|
29
|
+
// scoping is decided at touch time — so without this it would sit inert until the
|
|
30
|
+
// model happened to touch a matching file again.
|
|
31
|
+
if (ctx.ruleScope)
|
|
32
|
+
rescope(ctx.ruleScope, ctx.governance.rules);
|
|
33
|
+
}
|
|
34
|
+
const scope = globs.length > 0 ? ` (scoped to ${globs.join(", ")})` : "";
|
|
35
|
+
return {
|
|
36
|
+
output: `Saved rule '${saved.name}'${scope}. It now applies to this project (this session and future ones).`,
|
|
37
|
+
summary: `saved rule '${saved.name}'`,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
async function doForbidPath(args, ctx) {
|
|
41
|
+
const pattern = typeof args.value === "string" ? args.value.trim() : "";
|
|
42
|
+
if (!pattern)
|
|
43
|
+
return failQuietly("`value` is required — the path glob to forbid.");
|
|
44
|
+
const result = await appendForbidden(projectRoot(ctx), pattern);
|
|
45
|
+
if (!result.pattern)
|
|
46
|
+
return failQuietly("the pattern is empty after normalization.");
|
|
47
|
+
// Mirror into the live forbidden config (new array → matcher recompiles).
|
|
48
|
+
if (ctx.governance && result.added) {
|
|
49
|
+
ctx.governance.forbidden = {
|
|
50
|
+
...ctx.governance.forbidden,
|
|
51
|
+
patterns: [...ctx.governance.forbidden.patterns, result.pattern],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
output: result.added
|
|
56
|
+
? `Forbidden '${result.pattern}'. I won't modify it or run commands against it.`
|
|
57
|
+
: `'${result.pattern}' was already forbidden.`,
|
|
58
|
+
summary: result.added ? `forbade '${result.pattern}'` : `'${result.pattern}' already forbidden`,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
async function doForbidCommand(args, ctx) {
|
|
62
|
+
const pattern = typeof args.value === "string" ? args.value.trim() : "";
|
|
63
|
+
if (!pattern)
|
|
64
|
+
return failQuietly("`value` is required — the command to forbid.");
|
|
65
|
+
const result = await appendForbiddenCommand(projectRoot(ctx), pattern);
|
|
66
|
+
if (!result.pattern)
|
|
67
|
+
return failQuietly("the pattern is empty after normalization.");
|
|
68
|
+
// Mirror into the live forbidden config (new array → enforced this turn on).
|
|
69
|
+
if (ctx.governance && result.added) {
|
|
70
|
+
ctx.governance.forbidden = {
|
|
71
|
+
...ctx.governance.forbidden,
|
|
72
|
+
commands: [...(ctx.governance.forbidden.commands ?? []), result.pattern],
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
output: result.added
|
|
77
|
+
? `Forbidden the command '${result.pattern}'. I won't run it (or anything containing it) unless you lift it.`
|
|
78
|
+
: `'${result.pattern}' was already forbidden.`,
|
|
79
|
+
summary: result.added ? `forbade command '${result.pattern}'` : `'${result.pattern}' already forbidden`,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
async function doForbidMcpTool(args, ctx) {
|
|
83
|
+
const name = typeof args.value === "string" ? args.value.trim() : "";
|
|
84
|
+
if (!name)
|
|
85
|
+
return failQuietly("`value` is required — the full MCP tool name.");
|
|
86
|
+
// Guarding the shape matters: a bare tool name would be written to disk, never
|
|
87
|
+
// match anything, and look like the ban silently failed.
|
|
88
|
+
if (!isMcpToolName(name)) {
|
|
89
|
+
return failQuietly(`'${name}' is not an MCP tool name. Use the full name from your tool list, e.g. 'mcp__github__create_issue'.`);
|
|
90
|
+
}
|
|
91
|
+
const result = await appendForbiddenMcpTool(projectRoot(ctx), name);
|
|
92
|
+
if (!result.pattern)
|
|
93
|
+
return failQuietly("the name is empty after normalization.");
|
|
94
|
+
// Mirror into the live config AND the live pool, so the ban takes effect on the
|
|
95
|
+
// next step rather than the next session.
|
|
96
|
+
if (ctx.governance && result.added) {
|
|
97
|
+
ctx.governance.forbidden = {
|
|
98
|
+
...ctx.governance.forbidden,
|
|
99
|
+
mcpTools: [...(ctx.governance.forbidden.mcpTools ?? []), result.pattern],
|
|
100
|
+
};
|
|
101
|
+
ctx.mcp?.setForbidden(ctx.governance.forbidden.mcpTools ?? []);
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
output: result.added
|
|
105
|
+
? `Forbidden the MCP tool '${result.pattern}'. It's no longer available to me unless you lift it.`
|
|
106
|
+
: `'${result.pattern}' was already forbidden.`,
|
|
107
|
+
summary: result.added ? `forbade '${result.pattern}'` : `'${result.pattern}' already forbidden`,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
const ACTIONS = {
|
|
111
|
+
remember_rule: doRememberRule,
|
|
112
|
+
forbid_path: doForbidPath,
|
|
113
|
+
forbid_command: doForbidCommand,
|
|
114
|
+
forbid_mcp_tool: doForbidMcpTool,
|
|
115
|
+
};
|
|
116
|
+
export const governor = {
|
|
117
|
+
name: "governor",
|
|
118
|
+
deferred: true,
|
|
119
|
+
readOnly: false,
|
|
120
|
+
// Each action keeps the ONE warning that changes what the model does, and loses the
|
|
121
|
+
// rest. The dropped prose explained things the tool already reports in its own reply
|
|
122
|
+
// (that a duplicate is harmless, that a refusal can be lifted), which is a worse
|
|
123
|
+
// place to learn it than the reply itself and was being paid for every turn.
|
|
124
|
+
description: "Record a standing decision for THIS project. Persists across sessions and takes " +
|
|
125
|
+
"effect immediately. Pass `action` and `value`:\n" +
|
|
126
|
+
"- remember_rule — a durable directive to follow here ('Use pnpm, never npm'). " +
|
|
127
|
+
"Injected into your context EVERY turn from now on, so prefer few sharp rules; " +
|
|
128
|
+
"pass `globs` to scope one to matching files instead. Write it as a standing " +
|
|
129
|
+
"instruction, not a note about now. Reusing a `name` replaces that rule.\n" +
|
|
130
|
+
"- forbid_path — a file/folder/glob that must never be MODIFIED ('src/legacy/**'). " +
|
|
131
|
+
"It can still be read and searched; this protects against changes, not against " +
|
|
132
|
+
"looking.\n" +
|
|
133
|
+
"- forbid_command — a command that must never be RUN ('git push --force'). Matched " +
|
|
134
|
+
"as a case-insensitive substring, so a short pattern catches far more than it " +
|
|
135
|
+
"looks like: forbid the specific command the user meant, not a word from it.\n" +
|
|
136
|
+
"- forbid_mcp_tool — one MCP tool, by its FULL 'mcp__server__tool' name; a bare " +
|
|
137
|
+
"name is rejected rather than silently matching nothing.\n" +
|
|
138
|
+
"Use it when the user states a durable preference or says not to touch/run " +
|
|
139
|
+
"something — not for a one-off instruction about the task in hand.",
|
|
140
|
+
parameters: {
|
|
141
|
+
type: "object",
|
|
142
|
+
additionalProperties: false,
|
|
143
|
+
required: ["action", "value"],
|
|
144
|
+
properties: {
|
|
145
|
+
action: {
|
|
146
|
+
type: "string",
|
|
147
|
+
enum: ["remember_rule", "forbid_path", "forbid_command", "forbid_mcp_tool"],
|
|
148
|
+
description: "What to record.",
|
|
149
|
+
},
|
|
150
|
+
value: {
|
|
151
|
+
type: "string",
|
|
152
|
+
description: "The rule text, path glob, command fragment, or full MCP tool name — whichever the action takes.",
|
|
153
|
+
},
|
|
154
|
+
name: {
|
|
155
|
+
type: "string",
|
|
156
|
+
description: "remember_rule only: short name for the rule; derived from the text if omitted.",
|
|
157
|
+
},
|
|
158
|
+
globs: {
|
|
159
|
+
type: "string",
|
|
160
|
+
description: "remember_rule only: comma-separated path globs that scope the rule to matching files " +
|
|
161
|
+
"(e.g. 'src/api/**'). Omit for an always-on rule.",
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
async execute(args, ctx) {
|
|
166
|
+
const action = typeof args.action === "string" ? args.action.trim() : "";
|
|
167
|
+
const handler = ACTIONS[action];
|
|
168
|
+
// Naming the valid set beats a bare "invalid action": the model corrects in one
|
|
169
|
+
// step instead of guessing at the spelling.
|
|
170
|
+
if (!handler) {
|
|
171
|
+
return failQuietly(`\`action\` must be one of: ${Object.keys(ACTIONS).join(", ")}.`);
|
|
172
|
+
}
|
|
173
|
+
return handler(args, ctx);
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
export const createSkill = {
|
|
177
|
+
name: "create_skill",
|
|
178
|
+
deferred: true,
|
|
179
|
+
readOnly: false,
|
|
180
|
+
// Two things the model could not have known: the name is normalised (so the
|
|
181
|
+
// invocation it announces may not be the name it passed), and creating over an
|
|
182
|
+
// existing name destroys that skill.
|
|
183
|
+
description: "Create a reusable skill for THIS project: a named, step-by-step procedure that " +
|
|
184
|
+
"you or the user (via /name) can run later. Use it when the user says to save a " +
|
|
185
|
+
"skill, or to capture a multi-step workflow clearly worth repeating. It persists " +
|
|
186
|
+
"across sessions.\n" +
|
|
187
|
+
"Unlike a rule, a skill is CHEAP to keep: only its name and description sit in " +
|
|
188
|
+
"your context, and the steps are loaded only when it runs. So prefer a skill for " +
|
|
189
|
+
"anything procedural, and a rule only for something that must colour every turn.\n" +
|
|
190
|
+
"The name is normalised to lowercase-with-dashes, so 'Release Process' becomes " +
|
|
191
|
+
"/release-process — the result tells you the real invocation. Creating one under a " +
|
|
192
|
+
"name that normalises to an existing skill REPLACES it, with no warning, so check " +
|
|
193
|
+
"available_skills first if you are unsure. Write `steps` as a clear markdown " +
|
|
194
|
+
"checklist for someone starting cold, and use $ARGUMENTS or $1…$9 where the " +
|
|
195
|
+
"procedure needs input.",
|
|
196
|
+
parameters: {
|
|
197
|
+
type: "object",
|
|
198
|
+
additionalProperties: false,
|
|
199
|
+
required: ["name", "description", "steps"],
|
|
200
|
+
properties: {
|
|
201
|
+
name: {
|
|
202
|
+
type: "string",
|
|
203
|
+
description: "Short invocation name, e.g. 'release' (becomes /release).",
|
|
204
|
+
},
|
|
205
|
+
description: {
|
|
206
|
+
type: "string",
|
|
207
|
+
description: "One line on what the skill does — shown in the catalog and used to pick it.",
|
|
208
|
+
},
|
|
209
|
+
steps: {
|
|
210
|
+
type: "string",
|
|
211
|
+
description: "The skill body: the procedure as markdown. May use $ARGUMENTS or $1/$2 placeholders " +
|
|
212
|
+
"for arguments passed at invocation.",
|
|
213
|
+
},
|
|
214
|
+
when_to_use: {
|
|
215
|
+
type: "string",
|
|
216
|
+
description: "Optional: when you should reach for this skill.",
|
|
217
|
+
},
|
|
218
|
+
argument_hint: {
|
|
219
|
+
type: "string",
|
|
220
|
+
description: "Optional usage hint for arguments, e.g. '<env>' for /release <env>.",
|
|
221
|
+
},
|
|
222
|
+
globs: {
|
|
223
|
+
type: "string",
|
|
224
|
+
description: "Optional comma-separated globs that scope the skill's catalog visibility to matching " +
|
|
225
|
+
"files (it stays invokable by name regardless).",
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
async execute(args, ctx) {
|
|
230
|
+
const name = typeof args.name === "string" ? args.name.trim() : "";
|
|
231
|
+
const description = typeof args.description === "string" ? args.description.trim() : "";
|
|
232
|
+
const body = typeof args.steps === "string" ? args.steps.trim() : "";
|
|
233
|
+
if (!name)
|
|
234
|
+
return failQuietly("`name` is required.");
|
|
235
|
+
if (!body)
|
|
236
|
+
return failQuietly("`steps` is required — the skill needs a body.");
|
|
237
|
+
const saved = await writeSkill(projectRoot(ctx), {
|
|
238
|
+
name,
|
|
239
|
+
description,
|
|
240
|
+
body,
|
|
241
|
+
whenToUse: typeof args.when_to_use === "string" ? args.when_to_use.trim() : "",
|
|
242
|
+
argumentHint: typeof args.argument_hint === "string" ? args.argument_hint.trim() : "",
|
|
243
|
+
globs: parseGlobs(typeof args.globs === "string" ? args.globs : undefined),
|
|
244
|
+
});
|
|
245
|
+
// Mirror into the live catalog so it can be used immediately.
|
|
246
|
+
if (ctx.governance) {
|
|
247
|
+
ctx.governance.skills = [
|
|
248
|
+
...ctx.governance.skills.filter((s) => s.name !== saved.name),
|
|
249
|
+
saved,
|
|
250
|
+
].sort((a, b) => a.name.localeCompare(b.name));
|
|
251
|
+
}
|
|
252
|
+
return {
|
|
253
|
+
output: `Created skill '${saved.name}'. Run it with /${saved.name} or call use_skill.`,
|
|
254
|
+
summary: `created skill '${saved.name}'`,
|
|
255
|
+
};
|
|
256
|
+
},
|
|
257
|
+
};
|
|
258
|
+
//# sourceMappingURL=governorTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"governorTools.js","sourceRoot":"","sources":["../../src/tools/governorTools.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OA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