patchwork-os 0.2.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.bridge.md +352 -0
- package/README.md +72 -0
- package/deploy/README.md +172 -0
- package/deploy/bootstrap-new-vps.sh +364 -0
- package/deploy/claude-ide-bridge.service.template +67 -0
- package/deploy/claude-ide-bridge@.service +31 -0
- package/deploy/ecosystem.config.js.example +36 -0
- package/deploy/install-vps-service.sh +240 -0
- package/deploy/nginx-claude-bridge.conf.template +129 -0
- package/dist/activityLog.d.ts +112 -0
- package/dist/activityLog.js +399 -0
- package/dist/activityLog.js.map +1 -0
- package/dist/activityTypes.d.ts +28 -0
- package/dist/activityTypes.js +9 -0
- package/dist/activityTypes.js.map +1 -0
- package/dist/adapters/base.d.ts +78 -0
- package/dist/adapters/base.js +14 -0
- package/dist/adapters/base.js.map +1 -0
- package/dist/adapters/claude.d.ts +18 -0
- package/dist/adapters/claude.js +276 -0
- package/dist/adapters/claude.js.map +1 -0
- package/dist/adapters/gemini.d.ts +17 -0
- package/dist/adapters/gemini.js +218 -0
- package/dist/adapters/gemini.js.map +1 -0
- package/dist/adapters/grok.d.ts +7 -0
- package/dist/adapters/grok.js +21 -0
- package/dist/adapters/grok.js.map +1 -0
- package/dist/adapters/index.d.ts +5 -0
- package/dist/adapters/index.js +37 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/local.d.ts +7 -0
- package/dist/adapters/local.js +22 -0
- package/dist/adapters/local.js.map +1 -0
- package/dist/adapters/openai.d.ts +22 -0
- package/dist/adapters/openai.js +284 -0
- package/dist/adapters/openai.js.map +1 -0
- package/dist/adapters/sse.d.ts +13 -0
- package/dist/adapters/sse.js +58 -0
- package/dist/adapters/sse.js.map +1 -0
- package/dist/analyticsAggregator.d.ts +28 -0
- package/dist/analyticsAggregator.js +133 -0
- package/dist/analyticsAggregator.js.map +1 -0
- package/dist/analyticsPrefs.d.ts +9 -0
- package/dist/analyticsPrefs.js +50 -0
- package/dist/analyticsPrefs.js.map +1 -0
- package/dist/analyticsSend.d.ts +12 -0
- package/dist/analyticsSend.js +34 -0
- package/dist/analyticsSend.js.map +1 -0
- package/dist/approvalHttp.d.ts +46 -0
- package/dist/approvalHttp.js +370 -0
- package/dist/approvalHttp.js.map +1 -0
- package/dist/approvalQueue.d.ts +49 -0
- package/dist/approvalQueue.js +84 -0
- package/dist/approvalQueue.js.map +1 -0
- package/dist/automation.d.ts +675 -0
- package/dist/automation.js +1038 -0
- package/dist/automation.js.map +1 -0
- package/dist/bridge.d.ts +85 -0
- package/dist/bridge.js +1535 -0
- package/dist/bridge.js.map +1 -0
- package/dist/bridgeLockDiscovery.d.ts +11 -0
- package/dist/bridgeLockDiscovery.js +49 -0
- package/dist/bridgeLockDiscovery.js.map +1 -0
- package/dist/bridgeToken.d.ts +22 -0
- package/dist/bridgeToken.js +114 -0
- package/dist/bridgeToken.js.map +1 -0
- package/dist/bridgeToolsRules.d.ts +20 -0
- package/dist/bridgeToolsRules.js +79 -0
- package/dist/bridgeToolsRules.js.map +1 -0
- package/dist/ccPermissions.d.ts +59 -0
- package/dist/ccPermissions.js +163 -0
- package/dist/ccPermissions.js.map +1 -0
- package/dist/claudeDriver.d.ts +129 -0
- package/dist/claudeDriver.js +459 -0
- package/dist/claudeDriver.js.map +1 -0
- package/dist/claudeMdPatch.d.ts +29 -0
- package/dist/claudeMdPatch.js +164 -0
- package/dist/claudeMdPatch.js.map +1 -0
- package/dist/claudeOrchestrator.d.ts +171 -0
- package/dist/claudeOrchestrator.js +591 -0
- package/dist/claudeOrchestrator.js.map +1 -0
- package/dist/commands/install.d.ts +1 -0
- package/dist/commands/install.js +158 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/marketplace.d.ts +11 -0
- package/dist/commands/marketplace.js +120 -0
- package/dist/commands/marketplace.js.map +1 -0
- package/dist/commands/patchworkInit.d.ts +14 -0
- package/dist/commands/patchworkInit.js +155 -0
- package/dist/commands/patchworkInit.js.map +1 -0
- package/dist/commands/task.d.ts +14 -0
- package/dist/commands/task.js +289 -0
- package/dist/commands/task.js.map +1 -0
- package/dist/commands/tokenEfficiency.d.ts +9 -0
- package/dist/commands/tokenEfficiency.js +211 -0
- package/dist/commands/tokenEfficiency.js.map +1 -0
- package/dist/commands/tools.d.ts +28 -0
- package/dist/commands/tools.js +326 -0
- package/dist/commands/tools.js.map +1 -0
- package/dist/commitIssueLinkLog.d.ts +77 -0
- package/dist/commitIssueLinkLog.js +142 -0
- package/dist/commitIssueLinkLog.js.map +1 -0
- package/dist/companions/registry.d.ts +12 -0
- package/dist/companions/registry.js +71 -0
- package/dist/companions/registry.js.map +1 -0
- package/dist/config.d.ts +105 -0
- package/dist/config.js +720 -0
- package/dist/config.js.map +1 -0
- package/dist/crypto.d.ts +16 -0
- package/dist/crypto.js +34 -0
- package/dist/crypto.js.map +1 -0
- package/dist/dashboard.d.ts +12 -0
- package/dist/dashboard.js +149 -0
- package/dist/dashboard.js.map +1 -0
- package/dist/decisionTraceLog.d.ts +77 -0
- package/dist/decisionTraceLog.js +147 -0
- package/dist/decisionTraceLog.js.map +1 -0
- package/dist/errors.d.ts +32 -0
- package/dist/errors.js +34 -0
- package/dist/errors.js.map +1 -0
- package/dist/extensionClient.d.ts +279 -0
- package/dist/extensionClient.js +1253 -0
- package/dist/extensionClient.js.map +1 -0
- package/dist/fileLock.d.ts +36 -0
- package/dist/fileLock.js +121 -0
- package/dist/fileLock.js.map +1 -0
- package/dist/fp/activityAnalytics.d.ts +39 -0
- package/dist/fp/activityAnalytics.js +111 -0
- package/dist/fp/activityAnalytics.js.map +1 -0
- package/dist/fp/async.d.ts +48 -0
- package/dist/fp/async.js +60 -0
- package/dist/fp/async.js.map +1 -0
- package/dist/fp/automationInterpreter.d.ts +37 -0
- package/dist/fp/automationInterpreter.js +523 -0
- package/dist/fp/automationInterpreter.js.map +1 -0
- package/dist/fp/automationProgram.d.ts +89 -0
- package/dist/fp/automationProgram.js +29 -0
- package/dist/fp/automationProgram.js.map +1 -0
- package/dist/fp/automationState.d.ts +135 -0
- package/dist/fp/automationState.js +206 -0
- package/dist/fp/automationState.js.map +1 -0
- package/dist/fp/automationUtils.d.ts +31 -0
- package/dist/fp/automationUtils.js +61 -0
- package/dist/fp/automationUtils.js.map +1 -0
- package/dist/fp/brandedTypes.d.ts +32 -0
- package/dist/fp/brandedTypes.js +41 -0
- package/dist/fp/brandedTypes.js.map +1 -0
- package/dist/fp/commandDescription.d.ts +18 -0
- package/dist/fp/commandDescription.js +125 -0
- package/dist/fp/commandDescription.js.map +1 -0
- package/dist/fp/extensionSnapshot.d.ts +10 -0
- package/dist/fp/extensionSnapshot.js +14 -0
- package/dist/fp/extensionSnapshot.js.map +1 -0
- package/dist/fp/index.d.ts +8 -0
- package/dist/fp/index.js +9 -0
- package/dist/fp/index.js.map +1 -0
- package/dist/fp/interpreterContext.d.ts +69 -0
- package/dist/fp/interpreterContext.js +56 -0
- package/dist/fp/interpreterContext.js.map +1 -0
- package/dist/fp/policyParser.d.ts +16 -0
- package/dist/fp/policyParser.js +334 -0
- package/dist/fp/policyParser.js.map +1 -0
- package/dist/fp/result.d.ts +38 -0
- package/dist/fp/result.js +57 -0
- package/dist/fp/result.js.map +1 -0
- package/dist/fp/tokenBucket.d.ts +27 -0
- package/dist/fp/tokenBucket.js +36 -0
- package/dist/fp/tokenBucket.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1465 -0
- package/dist/index.js.map +1 -0
- package/dist/instructionsUtils.d.ts +17 -0
- package/dist/instructionsUtils.js +38 -0
- package/dist/instructionsUtils.js.map +1 -0
- package/dist/lockfile.d.ts +16 -0
- package/dist/lockfile.js +172 -0
- package/dist/lockfile.js.map +1 -0
- package/dist/logger.d.ts +16 -0
- package/dist/logger.js +68 -0
- package/dist/logger.js.map +1 -0
- package/dist/oauth.d.ts +105 -0
- package/dist/oauth.js +880 -0
- package/dist/oauth.js.map +1 -0
- package/dist/orchestrator/childBridgeClient.d.ts +33 -0
- package/dist/orchestrator/childBridgeClient.js +321 -0
- package/dist/orchestrator/childBridgeClient.js.map +1 -0
- package/dist/orchestrator/childBridgeRegistry.d.ts +67 -0
- package/dist/orchestrator/childBridgeRegistry.js +297 -0
- package/dist/orchestrator/childBridgeRegistry.js.map +1 -0
- package/dist/orchestrator/index.d.ts +3 -0
- package/dist/orchestrator/index.js +3 -0
- package/dist/orchestrator/index.js.map +1 -0
- package/dist/orchestrator/orchestratorBridge.d.ts +32 -0
- package/dist/orchestrator/orchestratorBridge.js +412 -0
- package/dist/orchestrator/orchestratorBridge.js.map +1 -0
- package/dist/orchestrator/orchestratorConfig.d.ts +11 -0
- package/dist/orchestrator/orchestratorConfig.js +85 -0
- package/dist/orchestrator/orchestratorConfig.js.map +1 -0
- package/dist/orchestrator/orchestratorTools.d.ts +16 -0
- package/dist/orchestrator/orchestratorTools.js +272 -0
- package/dist/orchestrator/orchestratorTools.js.map +1 -0
- package/dist/patchworkCli.d.ts +15 -0
- package/dist/patchworkCli.js +41 -0
- package/dist/patchworkCli.js.map +1 -0
- package/dist/patchworkConfig.d.ts +28 -0
- package/dist/patchworkConfig.js +30 -0
- package/dist/patchworkConfig.js.map +1 -0
- package/dist/plugin.d.ts +106 -0
- package/dist/plugin.js +31 -0
- package/dist/plugin.js.map +1 -0
- package/dist/pluginLoader.d.ts +44 -0
- package/dist/pluginLoader.js +357 -0
- package/dist/pluginLoader.js.map +1 -0
- package/dist/pluginWatcher.d.ts +24 -0
- package/dist/pluginWatcher.js +139 -0
- package/dist/pluginWatcher.js.map +1 -0
- package/dist/preToolUseHook.d.ts +10 -0
- package/dist/preToolUseHook.js +57 -0
- package/dist/preToolUseHook.js.map +1 -0
- package/dist/probe.d.ts +35 -0
- package/dist/probe.js +143 -0
- package/dist/probe.js.map +1 -0
- package/dist/prompts.d.ts +27 -0
- package/dist/prompts.js +1680 -0
- package/dist/prompts.js.map +1 -0
- package/dist/quickTaskPresets.d.ts +64 -0
- package/dist/quickTaskPresets.js +156 -0
- package/dist/quickTaskPresets.js.map +1 -0
- package/dist/recipes/compiler.d.ts +44 -0
- package/dist/recipes/compiler.js +140 -0
- package/dist/recipes/compiler.js.map +1 -0
- package/dist/recipes/installer.d.ts +25 -0
- package/dist/recipes/installer.js +62 -0
- package/dist/recipes/installer.js.map +1 -0
- package/dist/recipes/parser.d.ts +18 -0
- package/dist/recipes/parser.js +160 -0
- package/dist/recipes/parser.js.map +1 -0
- package/dist/recipes/scheduler.d.ts +45 -0
- package/dist/recipes/scheduler.js +110 -0
- package/dist/recipes/scheduler.js.map +1 -0
- package/dist/recipes/schema.d.ts +71 -0
- package/dist/recipes/schema.js +11 -0
- package/dist/recipes/schema.js.map +1 -0
- package/dist/recipesHttp.d.ts +63 -0
- package/dist/recipesHttp.js +183 -0
- package/dist/recipesHttp.js.map +1 -0
- package/dist/resources.d.ts +33 -0
- package/dist/resources.js +266 -0
- package/dist/resources.js.map +1 -0
- package/dist/riskTier.d.ts +40 -0
- package/dist/riskTier.js +142 -0
- package/dist/riskTier.js.map +1 -0
- package/dist/runLog.d.ts +90 -0
- package/dist/runLog.js +143 -0
- package/dist/runLog.js.map +1 -0
- package/dist/server.d.ts +160 -0
- package/dist/server.js +1244 -0
- package/dist/server.js.map +1 -0
- package/dist/sessionCheckpoint.d.ts +37 -0
- package/dist/sessionCheckpoint.js +123 -0
- package/dist/sessionCheckpoint.js.map +1 -0
- package/dist/streamableHttp.d.ts +86 -0
- package/dist/streamableHttp.js +702 -0
- package/dist/streamableHttp.js.map +1 -0
- package/dist/telemetry.d.ts +18 -0
- package/dist/telemetry.js +95 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/tools/activityLog.d.ts +140 -0
- package/dist/tools/activityLog.js +204 -0
- package/dist/tools/activityLog.js.map +1 -0
- package/dist/tools/auditDependencies.d.ts +67 -0
- package/dist/tools/auditDependencies.js +298 -0
- package/dist/tools/auditDependencies.js.map +1 -0
- package/dist/tools/batchLsp.d.ts +262 -0
- package/dist/tools/batchLsp.js +328 -0
- package/dist/tools/batchLsp.js.map +1 -0
- package/dist/tools/blame-utils.d.ts +30 -0
- package/dist/tools/blame-utils.js +60 -0
- package/dist/tools/blame-utils.js.map +1 -0
- package/dist/tools/bridgeDoctor.d.ts +78 -0
- package/dist/tools/bridgeDoctor.js +542 -0
- package/dist/tools/bridgeDoctor.js.map +1 -0
- package/dist/tools/bridgeStatus.d.ts +122 -0
- package/dist/tools/bridgeStatus.js +250 -0
- package/dist/tools/bridgeStatus.js.map +1 -0
- package/dist/tools/cancelClaudeTask.d.ts +48 -0
- package/dist/tools/cancelClaudeTask.js +56 -0
- package/dist/tools/cancelClaudeTask.js.map +1 -0
- package/dist/tools/checkDocumentDirty.d.ts +56 -0
- package/dist/tools/checkDocumentDirty.js +74 -0
- package/dist/tools/checkDocumentDirty.js.map +1 -0
- package/dist/tools/clipboard.d.ts +80 -0
- package/dist/tools/clipboard.js +211 -0
- package/dist/tools/clipboard.js.map +1 -0
- package/dist/tools/closeTabs.d.ts +84 -0
- package/dist/tools/closeTabs.js +97 -0
- package/dist/tools/closeTabs.js.map +1 -0
- package/dist/tools/codeLens.d.ts +50 -0
- package/dist/tools/codeLens.js +47 -0
- package/dist/tools/codeLens.js.map +1 -0
- package/dist/tools/contextBundle.d.ts +75 -0
- package/dist/tools/contextBundle.js +218 -0
- package/dist/tools/contextBundle.js.map +1 -0
- package/dist/tools/createIssueFromAIComment.d.ts +75 -0
- package/dist/tools/createIssueFromAIComment.js +119 -0
- package/dist/tools/createIssueFromAIComment.js.map +1 -0
- package/dist/tools/ctxGetTaskContext.d.ts +103 -0
- package/dist/tools/ctxGetTaskContext.js +274 -0
- package/dist/tools/ctxGetTaskContext.js.map +1 -0
- package/dist/tools/ctxQueryTraces.d.ts +142 -0
- package/dist/tools/ctxQueryTraces.js +194 -0
- package/dist/tools/ctxQueryTraces.js.map +1 -0
- package/dist/tools/ctxSaveTrace.d.ts +87 -0
- package/dist/tools/ctxSaveTrace.js +94 -0
- package/dist/tools/ctxSaveTrace.js.map +1 -0
- package/dist/tools/debug.d.ts +206 -0
- package/dist/tools/debug.js +234 -0
- package/dist/tools/debug.js.map +1 -0
- package/dist/tools/decorations.d.ts +130 -0
- package/dist/tools/decorations.js +160 -0
- package/dist/tools/decorations.js.map +1 -0
- package/dist/tools/detectUnusedCode.d.ts +78 -0
- package/dist/tools/detectUnusedCode.js +173 -0
- package/dist/tools/detectUnusedCode.js.map +1 -0
- package/dist/tools/documentLinks.d.ts +62 -0
- package/dist/tools/documentLinks.js +55 -0
- package/dist/tools/documentLinks.js.map +1 -0
- package/dist/tools/editText.d.ts +108 -0
- package/dist/tools/editText.js +318 -0
- package/dist/tools/editText.js.map +1 -0
- package/dist/tools/enrichCommit.d.ts +89 -0
- package/dist/tools/enrichCommit.js +201 -0
- package/dist/tools/enrichCommit.js.map +1 -0
- package/dist/tools/enrichStackTrace.d.ts +121 -0
- package/dist/tools/enrichStackTrace.js +194 -0
- package/dist/tools/enrichStackTrace.js.map +1 -0
- package/dist/tools/explainDiagnostic.d.ts +137 -0
- package/dist/tools/explainDiagnostic.js +230 -0
- package/dist/tools/explainDiagnostic.js.map +1 -0
- package/dist/tools/explainSymbol.d.ts +119 -0
- package/dist/tools/explainSymbol.js +177 -0
- package/dist/tools/explainSymbol.js.map +1 -0
- package/dist/tools/fileOperations.d.ts +186 -0
- package/dist/tools/fileOperations.js +330 -0
- package/dist/tools/fileOperations.js.map +1 -0
- package/dist/tools/fileWatcher.d.ts +107 -0
- package/dist/tools/fileWatcher.js +121 -0
- package/dist/tools/fileWatcher.js.map +1 -0
- package/dist/tools/findFiles.d.ts +65 -0
- package/dist/tools/findFiles.js +142 -0
- package/dist/tools/findFiles.js.map +1 -0
- package/dist/tools/findRelatedTests.d.ts +83 -0
- package/dist/tools/findRelatedTests.js +196 -0
- package/dist/tools/findRelatedTests.js.map +1 -0
- package/dist/tools/fixAllLintErrors.d.ts +66 -0
- package/dist/tools/fixAllLintErrors.js +128 -0
- package/dist/tools/fixAllLintErrors.js.map +1 -0
- package/dist/tools/foldingRanges.d.ts +50 -0
- package/dist/tools/foldingRanges.js +51 -0
- package/dist/tools/foldingRanges.js.map +1 -0
- package/dist/tools/formatAndSave.d.ts +57 -0
- package/dist/tools/formatAndSave.js +87 -0
- package/dist/tools/formatAndSave.js.map +1 -0
- package/dist/tools/formatDocument.d.ts +61 -0
- package/dist/tools/formatDocument.js +144 -0
- package/dist/tools/formatDocument.js.map +1 -0
- package/dist/tools/generateAPIDocumentation.d.ts +62 -0
- package/dist/tools/generateAPIDocumentation.js +249 -0
- package/dist/tools/generateAPIDocumentation.js.map +1 -0
- package/dist/tools/generateTests.d.ts +75 -0
- package/dist/tools/generateTests.js +226 -0
- package/dist/tools/generateTests.js.map +1 -0
- package/dist/tools/getAIComments.d.ts +79 -0
- package/dist/tools/getAIComments.js +93 -0
- package/dist/tools/getAIComments.js.map +1 -0
- package/dist/tools/getAnalyticsReport.d.ts +102 -0
- package/dist/tools/getAnalyticsReport.js +137 -0
- package/dist/tools/getAnalyticsReport.js.map +1 -0
- package/dist/tools/getArchitectureContext.d.ts +85 -0
- package/dist/tools/getArchitectureContext.js +135 -0
- package/dist/tools/getArchitectureContext.js.map +1 -0
- package/dist/tools/getBufferContent.d.ts +80 -0
- package/dist/tools/getBufferContent.js +207 -0
- package/dist/tools/getBufferContent.js.map +1 -0
- package/dist/tools/getChangeImpact.d.ts +76 -0
- package/dist/tools/getChangeImpact.js +184 -0
- package/dist/tools/getChangeImpact.js.map +1 -0
- package/dist/tools/getClaudeTaskStatus.d.ts +87 -0
- package/dist/tools/getClaudeTaskStatus.js +89 -0
- package/dist/tools/getClaudeTaskStatus.js.map +1 -0
- package/dist/tools/getCodeCoverage.d.ts +86 -0
- package/dist/tools/getCodeCoverage.js +237 -0
- package/dist/tools/getCodeCoverage.js.map +1 -0
- package/dist/tools/getCommitsForIssue.d.ts +98 -0
- package/dist/tools/getCommitsForIssue.js +106 -0
- package/dist/tools/getCommitsForIssue.js.map +1 -0
- package/dist/tools/getCurrentSelection.d.ts +123 -0
- package/dist/tools/getCurrentSelection.js +113 -0
- package/dist/tools/getCurrentSelection.js.map +1 -0
- package/dist/tools/getDebugState.d.ts +140 -0
- package/dist/tools/getDebugState.js +109 -0
- package/dist/tools/getDebugState.js.map +1 -0
- package/dist/tools/getDependencyTree.d.ts +59 -0
- package/dist/tools/getDependencyTree.js +207 -0
- package/dist/tools/getDependencyTree.js.map +1 -0
- package/dist/tools/getDiagnostics.d.ts +108 -0
- package/dist/tools/getDiagnostics.js +371 -0
- package/dist/tools/getDiagnostics.js.map +1 -0
- package/dist/tools/getDiffFromHandoff.d.ts +89 -0
- package/dist/tools/getDiffFromHandoff.js +163 -0
- package/dist/tools/getDiffFromHandoff.js.map +1 -0
- package/dist/tools/getDocumentSymbols.d.ts +74 -0
- package/dist/tools/getDocumentSymbols.js +177 -0
- package/dist/tools/getDocumentSymbols.js.map +1 -0
- package/dist/tools/getFileTree.d.ts +66 -0
- package/dist/tools/getFileTree.js +131 -0
- package/dist/tools/getFileTree.js.map +1 -0
- package/dist/tools/getGitDiff.d.ts +50 -0
- package/dist/tools/getGitDiff.js +73 -0
- package/dist/tools/getGitDiff.js.map +1 -0
- package/dist/tools/getGitHotspots.d.ts +88 -0
- package/dist/tools/getGitHotspots.js +145 -0
- package/dist/tools/getGitHotspots.js.map +1 -0
- package/dist/tools/getGitLog.d.ts +62 -0
- package/dist/tools/getGitLog.js +87 -0
- package/dist/tools/getGitLog.js.map +1 -0
- package/dist/tools/getGitStatus.d.ts +72 -0
- package/dist/tools/getGitStatus.js +126 -0
- package/dist/tools/getGitStatus.js.map +1 -0
- package/dist/tools/getImportTree.d.ts +73 -0
- package/dist/tools/getImportTree.js +223 -0
- package/dist/tools/getImportTree.js.map +1 -0
- package/dist/tools/getImportedSignatures.d.ts +62 -0
- package/dist/tools/getImportedSignatures.js +255 -0
- package/dist/tools/getImportedSignatures.js.map +1 -0
- package/dist/tools/getOpenEditors.d.ts +62 -0
- package/dist/tools/getOpenEditors.js +126 -0
- package/dist/tools/getOpenEditors.js.map +1 -0
- package/dist/tools/getPRTemplate.d.ts +68 -0
- package/dist/tools/getPRTemplate.js +187 -0
- package/dist/tools/getPRTemplate.js.map +1 -0
- package/dist/tools/getProjectContext.d.ts +114 -0
- package/dist/tools/getProjectContext.js +344 -0
- package/dist/tools/getProjectContext.js.map +1 -0
- package/dist/tools/getProjectInfo.d.ts +51 -0
- package/dist/tools/getProjectInfo.js +325 -0
- package/dist/tools/getProjectInfo.js.map +1 -0
- package/dist/tools/getSecurityAdvisories.d.ts +105 -0
- package/dist/tools/getSecurityAdvisories.js +472 -0
- package/dist/tools/getSecurityAdvisories.js.map +1 -0
- package/dist/tools/getSessionUsage.d.ts +58 -0
- package/dist/tools/getSessionUsage.js +57 -0
- package/dist/tools/getSessionUsage.js.map +1 -0
- package/dist/tools/getSymbolHistory.d.ts +157 -0
- package/dist/tools/getSymbolHistory.js +256 -0
- package/dist/tools/getSymbolHistory.js.map +1 -0
- package/dist/tools/getToolCapabilities.d.ts +69 -0
- package/dist/tools/getToolCapabilities.js +298 -0
- package/dist/tools/getToolCapabilities.js.map +1 -0
- package/dist/tools/getTypeSignature.d.ts +70 -0
- package/dist/tools/getTypeSignature.js +132 -0
- package/dist/tools/getTypeSignature.js.map +1 -0
- package/dist/tools/getWorkspaceFolders.d.ts +58 -0
- package/dist/tools/getWorkspaceFolders.js +69 -0
- package/dist/tools/getWorkspaceFolders.js.map +1 -0
- package/dist/tools/getWorkspaceSettings.d.ts +44 -0
- package/dist/tools/getWorkspaceSettings.js +70 -0
- package/dist/tools/getWorkspaceSettings.js.map +1 -0
- package/dist/tools/git-utils.d.ts +16 -0
- package/dist/tools/git-utils.js +46 -0
- package/dist/tools/git-utils.js.map +1 -0
- package/dist/tools/gitHistory.d.ts +110 -0
- package/dist/tools/gitHistory.js +167 -0
- package/dist/tools/gitHistory.js.map +1 -0
- package/dist/tools/gitWrite.d.ts +612 -0
- package/dist/tools/gitWrite.js +983 -0
- package/dist/tools/gitWrite.js.map +1 -0
- package/dist/tools/github/actions.d.ts +152 -0
- package/dist/tools/github/actions.js +195 -0
- package/dist/tools/github/actions.js.map +1 -0
- package/dist/tools/github/index.d.ts +3 -0
- package/dist/tools/github/index.js +4 -0
- package/dist/tools/github/index.js.map +1 -0
- package/dist/tools/github/issues.d.ts +281 -0
- package/dist/tools/github/issues.js +340 -0
- package/dist/tools/github/issues.js.map +1 -0
- package/dist/tools/github/pr.d.ts +433 -0
- package/dist/tools/github/pr.js +588 -0
- package/dist/tools/github/pr.js.map +1 -0
- package/dist/tools/github/shared.d.ts +4 -0
- package/dist/tools/github/shared.js +12 -0
- package/dist/tools/github/shared.js.map +1 -0
- package/dist/tools/handoffNote.d.ts +106 -0
- package/dist/tools/handoffNote.js +232 -0
- package/dist/tools/handoffNote.js.map +1 -0
- package/dist/tools/headless/lspClient.d.ts +26 -0
- package/dist/tools/headless/lspClient.js +221 -0
- package/dist/tools/headless/lspClient.js.map +1 -0
- package/dist/tools/headless/lspFallback.d.ts +28 -0
- package/dist/tools/headless/lspFallback.js +122 -0
- package/dist/tools/headless/lspFallback.js.map +1 -0
- package/dist/tools/hoverAtCursor.d.ts +54 -0
- package/dist/tools/hoverAtCursor.js +68 -0
- package/dist/tools/hoverAtCursor.js.map +1 -0
- package/dist/tools/httpClient.d.ts +141 -0
- package/dist/tools/httpClient.js +486 -0
- package/dist/tools/httpClient.js.map +1 -0
- package/dist/tools/index.d.ts +49 -0
- package/dist/tools/index.js +672 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/inlayHints.d.ts +81 -0
- package/dist/tools/inlayHints.js +76 -0
- package/dist/tools/inlayHints.js.map +1 -0
- package/dist/tools/issueRefs.d.ts +14 -0
- package/dist/tools/issueRefs.js +27 -0
- package/dist/tools/issueRefs.js.map +1 -0
- package/dist/tools/jumpToFirstError.d.ts +63 -0
- package/dist/tools/jumpToFirstError.js +124 -0
- package/dist/tools/jumpToFirstError.js.map +1 -0
- package/dist/tools/launchQuickTask.d.ts +76 -0
- package/dist/tools/launchQuickTask.js +170 -0
- package/dist/tools/launchQuickTask.js.map +1 -0
- package/dist/tools/linters/biome.d.ts +2 -0
- package/dist/tools/linters/biome.js +44 -0
- package/dist/tools/linters/biome.js.map +1 -0
- package/dist/tools/linters/cargo.d.ts +2 -0
- package/dist/tools/linters/cargo.js +45 -0
- package/dist/tools/linters/cargo.js.map +1 -0
- package/dist/tools/linters/eslint.d.ts +2 -0
- package/dist/tools/linters/eslint.js +59 -0
- package/dist/tools/linters/eslint.js.map +1 -0
- package/dist/tools/linters/govet.d.ts +2 -0
- package/dist/tools/linters/govet.js +37 -0
- package/dist/tools/linters/govet.js.map +1 -0
- package/dist/tools/linters/pyright.d.ts +2 -0
- package/dist/tools/linters/pyright.js +34 -0
- package/dist/tools/linters/pyright.js.map +1 -0
- package/dist/tools/linters/ruff.d.ts +2 -0
- package/dist/tools/linters/ruff.js +30 -0
- package/dist/tools/linters/ruff.js.map +1 -0
- package/dist/tools/linters/types.d.ts +16 -0
- package/dist/tools/linters/types.js +2 -0
- package/dist/tools/linters/types.js.map +1 -0
- package/dist/tools/linters/typescript.d.ts +2 -0
- package/dist/tools/linters/typescript.js +38 -0
- package/dist/tools/linters/typescript.js.map +1 -0
- package/dist/tools/listClaudeTasks.d.ts +84 -0
- package/dist/tools/listClaudeTasks.js +88 -0
- package/dist/tools/listClaudeTasks.js.map +1 -0
- package/dist/tools/listTerminals.d.ts +55 -0
- package/dist/tools/listTerminals.js +78 -0
- package/dist/tools/listTerminals.js.map +1 -0
- package/dist/tools/lsp.d.ts +1086 -0
- package/dist/tools/lsp.js +1339 -0
- package/dist/tools/lsp.js.map +1 -0
- package/dist/tools/navigateToSymbolByName.d.ts +56 -0
- package/dist/tools/navigateToSymbolByName.js +170 -0
- package/dist/tools/navigateToSymbolByName.js.map +1 -0
- package/dist/tools/openDiff.d.ts +66 -0
- package/dist/tools/openDiff.js +126 -0
- package/dist/tools/openDiff.js.map +1 -0
- package/dist/tools/openFile.d.ts +69 -0
- package/dist/tools/openFile.js +129 -0
- package/dist/tools/openFile.js.map +1 -0
- package/dist/tools/openInBrowser.d.ts +55 -0
- package/dist/tools/openInBrowser.js +129 -0
- package/dist/tools/openInBrowser.js.map +1 -0
- package/dist/tools/organizeImports.d.ts +56 -0
- package/dist/tools/organizeImports.js +115 -0
- package/dist/tools/organizeImports.js.map +1 -0
- package/dist/tools/performanceReport.d.ts +133 -0
- package/dist/tools/performanceReport.js +218 -0
- package/dist/tools/performanceReport.js.map +1 -0
- package/dist/tools/planPersistence.d.ts +306 -0
- package/dist/tools/planPersistence.js +485 -0
- package/dist/tools/planPersistence.js.map +1 -0
- package/dist/tools/previewEdit.d.ts +107 -0
- package/dist/tools/previewEdit.js +270 -0
- package/dist/tools/previewEdit.js.map +1 -0
- package/dist/tools/recentTracesDigest.d.ts +35 -0
- package/dist/tools/recentTracesDigest.js +98 -0
- package/dist/tools/recentTracesDigest.js.map +1 -0
- package/dist/tools/refactorAnalyze.d.ts +78 -0
- package/dist/tools/refactorAnalyze.js +141 -0
- package/dist/tools/refactorAnalyze.js.map +1 -0
- package/dist/tools/refactorExtractFunction.d.ts +52 -0
- package/dist/tools/refactorExtractFunction.js +121 -0
- package/dist/tools/refactorExtractFunction.js.map +1 -0
- package/dist/tools/refactorPreview.d.ts +75 -0
- package/dist/tools/refactorPreview.js +93 -0
- package/dist/tools/refactorPreview.js.map +1 -0
- package/dist/tools/replaceBlock.d.ts +62 -0
- package/dist/tools/replaceBlock.js +125 -0
- package/dist/tools/replaceBlock.js.map +1 -0
- package/dist/tools/resumeClaudeTask.d.ts +75 -0
- package/dist/tools/resumeClaudeTask.js +149 -0
- package/dist/tools/resumeClaudeTask.js.map +1 -0
- package/dist/tools/runClaudeTask.d.ts +97 -0
- package/dist/tools/runClaudeTask.js +224 -0
- package/dist/tools/runClaudeTask.js.map +1 -0
- package/dist/tools/runCommand.d.ts +82 -0
- package/dist/tools/runCommand.js +101 -0
- package/dist/tools/runCommand.js.map +1 -0
- package/dist/tools/runTests.d.ts +146 -0
- package/dist/tools/runTests.js +315 -0
- package/dist/tools/runTests.js.map +1 -0
- package/dist/tools/saveDocument.d.ts +50 -0
- package/dist/tools/saveDocument.js +73 -0
- package/dist/tools/saveDocument.js.map +1 -0
- package/dist/tools/screenshot.d.ts +23 -0
- package/dist/tools/screenshot.js +43 -0
- package/dist/tools/screenshot.js.map +1 -0
- package/dist/tools/screenshotAndAnnotate.d.ts +103 -0
- package/dist/tools/screenshotAndAnnotate.js +192 -0
- package/dist/tools/screenshotAndAnnotate.js.map +1 -0
- package/dist/tools/searchAndReplace.d.ts +108 -0
- package/dist/tools/searchAndReplace.js +281 -0
- package/dist/tools/searchAndReplace.js.map +1 -0
- package/dist/tools/searchTools.d.ts +61 -0
- package/dist/tools/searchTools.js +85 -0
- package/dist/tools/searchTools.js.map +1 -0
- package/dist/tools/searchWorkspace.d.ts +99 -0
- package/dist/tools/searchWorkspace.js +189 -0
- package/dist/tools/searchWorkspace.js.map +1 -0
- package/dist/tools/selectionRanges.d.ts +58 -0
- package/dist/tools/selectionRanges.js +61 -0
- package/dist/tools/selectionRanges.js.map +1 -0
- package/dist/tools/semanticTokens.d.ts +87 -0
- package/dist/tools/semanticTokens.js +86 -0
- package/dist/tools/semanticTokens.js.map +1 -0
- package/dist/tools/setActiveWorkspaceFolder.d.ts +41 -0
- package/dist/tools/setActiveWorkspaceFolder.js +38 -0
- package/dist/tools/setActiveWorkspaceFolder.js.map +1 -0
- package/dist/tools/signatureHelp.d.ts +86 -0
- package/dist/tools/signatureHelp.js +79 -0
- package/dist/tools/signatureHelp.js.map +1 -0
- package/dist/tools/spawnWorkspace.d.ts +103 -0
- package/dist/tools/spawnWorkspace.js +268 -0
- package/dist/tools/spawnWorkspace.js.map +1 -0
- package/dist/tools/stackTraceParser.d.ts +43 -0
- package/dist/tools/stackTraceParser.js +139 -0
- package/dist/tools/stackTraceParser.js.map +1 -0
- package/dist/tools/terminal.d.ts +352 -0
- package/dist/tools/terminal.js +670 -0
- package/dist/tools/terminal.js.map +1 -0
- package/dist/tools/testRunners/cargoTest.d.ts +2 -0
- package/dist/tools/testRunners/cargoTest.js +129 -0
- package/dist/tools/testRunners/cargoTest.js.map +1 -0
- package/dist/tools/testRunners/goTest.d.ts +2 -0
- package/dist/tools/testRunners/goTest.js +108 -0
- package/dist/tools/testRunners/goTest.js.map +1 -0
- package/dist/tools/testRunners/pytest.d.ts +2 -0
- package/dist/tools/testRunners/pytest.js +135 -0
- package/dist/tools/testRunners/pytest.js.map +1 -0
- package/dist/tools/testRunners/types.d.ts +18 -0
- package/dist/tools/testRunners/types.js +2 -0
- package/dist/tools/testRunners/types.js.map +1 -0
- package/dist/tools/testRunners/vitestJest.d.ts +3 -0
- package/dist/tools/testRunners/vitestJest.js +215 -0
- package/dist/tools/testRunners/vitestJest.js.map +1 -0
- package/dist/tools/testTraceToSource.d.ts +80 -0
- package/dist/tools/testTraceToSource.js +206 -0
- package/dist/tools/testTraceToSource.js.map +1 -0
- package/dist/tools/transaction.d.ts +243 -0
- package/dist/tools/transaction.js +309 -0
- package/dist/tools/transaction.js.map +1 -0
- package/dist/tools/typeHierarchy.d.ts +77 -0
- package/dist/tools/typeHierarchy.js +86 -0
- package/dist/tools/typeHierarchy.js.map +1 -0
- package/dist/tools/utils.d.ts +124 -0
- package/dist/tools/utils.js +566 -0
- package/dist/tools/utils.js.map +1 -0
- package/dist/tools/vscodeCommands.d.ts +90 -0
- package/dist/tools/vscodeCommands.js +112 -0
- package/dist/tools/vscodeCommands.js.map +1 -0
- package/dist/tools/vscodeTasks.d.ts +102 -0
- package/dist/tools/vscodeTasks.js +110 -0
- package/dist/tools/vscodeTasks.js.map +1 -0
- package/dist/tools/watchDiagnostics.d.ts +64 -0
- package/dist/tools/watchDiagnostics.js +270 -0
- package/dist/tools/watchDiagnostics.js.map +1 -0
- package/dist/tools/workspaceSettings.d.ts +57 -0
- package/dist/tools/workspaceSettings.js +80 -0
- package/dist/tools/workspaceSettings.js.map +1 -0
- package/dist/transport.d.ts +207 -0
- package/dist/transport.js +1272 -0
- package/dist/transport.js.map +1 -0
- package/dist/version.d.ts +13 -0
- package/dist/version.js +31 -0
- package/dist/version.js.map +1 -0
- package/dist/wsUtils.d.ts +8 -0
- package/dist/wsUtils.js +54 -0
- package/dist/wsUtils.js.map +1 -0
- package/package.json +118 -0
- package/scripts/gen-claude-desktop-config.sh +124 -0
- package/scripts/gen-mcp-config.sh +390 -0
- package/scripts/install-extension.sh +106 -0
- package/scripts/mcp-stdio-shim.cjs +482 -0
- package/scripts/postinstall.mjs +68 -0
- package/scripts/start-all.sh +502 -0
- package/scripts/start-orchestrator.sh +186 -0
- package/scripts/start-remote.sh +126 -0
- package/scripts/start-vps.sh +116 -0
- package/templates/CLAUDE.bridge.md +125 -0
- package/templates/automation-policies/security-first.json +46 -0
- package/templates/automation-policies/strict-lint.json +41 -0
- package/templates/automation-policies/test-driven.json +54 -0
- package/templates/automation-policy.example.json +105 -0
- package/templates/bridge-tools.md +111 -0
- package/templates/dispatch-context.md +33 -0
- package/templates/managed-agent/code-review-agent.md +50 -0
- package/templates/managed-agent/managed-agent-mcp.json +102 -0
- package/templates/recipes/ambient-journal.yaml +11 -0
- package/templates/recipes/daily-status.yaml +21 -0
- package/templates/recipes/lint-on-save.yaml +13 -0
- package/templates/recipes/stale-branches.yaml +18 -0
- package/templates/recipes/watch-failing-tests.yaml +15 -0
- package/templates/scheduled-tasks/dependency-audit/SKILL.md +77 -0
- package/templates/scheduled-tasks/health-check/SKILL.md +73 -0
- package/templates/scheduled-tasks/nightly-review/SKILL.md +69 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Auto-restart wrapper for claude remote-control.
|
|
3
|
+
# Prevents macOS idle sleep, auto-restarts on disconnect, runs in tmux.
|
|
4
|
+
#
|
|
5
|
+
# Usage:
|
|
6
|
+
# ./scripts/start-remote.sh [--notify <ntfy-topic>]
|
|
7
|
+
# npm run remote
|
|
8
|
+
#
|
|
9
|
+
# Controls:
|
|
10
|
+
# Ctrl+C — exit cleanly (no restart)
|
|
11
|
+
# Ctrl+B, D — detach tmux (keeps running)
|
|
12
|
+
# tmux attach -t claude-remote — reattach
|
|
13
|
+
|
|
14
|
+
set -uo pipefail
|
|
15
|
+
|
|
16
|
+
SESSION_NAME="claude-remote"
|
|
17
|
+
NTFY_TOPIC=""
|
|
18
|
+
|
|
19
|
+
# --- Parse args ---
|
|
20
|
+
while [[ $# -gt 0 ]]; do
|
|
21
|
+
case "$1" in
|
|
22
|
+
--notify) NTFY_TOPIC="$2"; shift 2 ;;
|
|
23
|
+
*) echo "Unknown option: $1" >&2; exit 1 ;;
|
|
24
|
+
esac
|
|
25
|
+
done
|
|
26
|
+
|
|
27
|
+
# --- Dependency checks ---
|
|
28
|
+
command -v tmux >/dev/null 2>&1 || {
|
|
29
|
+
echo "Error: tmux is required. Install with: brew install tmux" >&2
|
|
30
|
+
exit 1
|
|
31
|
+
}
|
|
32
|
+
command -v claude >/dev/null 2>&1 || {
|
|
33
|
+
echo "Error: claude CLI not found on PATH." >&2
|
|
34
|
+
exit 1
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
# --- tmux session management ---
|
|
38
|
+
# If not already inside tmux, create or attach to session
|
|
39
|
+
if [[ -z "${TMUX:-}" ]]; then
|
|
40
|
+
exec tmux new-session -As "$SESSION_NAME" "$0 $([ -n "$NTFY_TOPIC" ] && echo "--notify $NTFY_TOPIC")"
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
echo "=== Remote Control auto-restart wrapper ==="
|
|
44
|
+
echo " Ctrl+C to exit cleanly"
|
|
45
|
+
echo " Ctrl+B, D to detach (keeps running)"
|
|
46
|
+
echo " tmux attach -t $SESSION_NAME to reattach"
|
|
47
|
+
[[ -n "$NTFY_TOPIC" ]] && echo " Push notifications: ntfy.sh/$NTFY_TOPIC"
|
|
48
|
+
echo ""
|
|
49
|
+
|
|
50
|
+
# --- Auto-restart loop with exponential backoff ---
|
|
51
|
+
# Use export so the subshell can access variables without quote-splicing
|
|
52
|
+
export RESTART_BASE_DELAY=5
|
|
53
|
+
export RESTART_MAX_DELAY=300
|
|
54
|
+
export MAX_CONSECUTIVE_FAILURES=50
|
|
55
|
+
export HEALTHY_RUNTIME=60
|
|
56
|
+
export NTFY_TOPIC
|
|
57
|
+
|
|
58
|
+
# Detect caffeinate (macOS-only; skip on Linux)
|
|
59
|
+
CAFFEINATE=""
|
|
60
|
+
if command -v caffeinate >/dev/null 2>&1; then
|
|
61
|
+
CAFFEINATE="caffeinate -i"
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
# SIGTERM handler: forward signal to child process group
|
|
65
|
+
cleanup() {
|
|
66
|
+
echo ""
|
|
67
|
+
echo "Received termination signal. Shutting down..."
|
|
68
|
+
kill -- -$$ 2>/dev/null
|
|
69
|
+
exit 0
|
|
70
|
+
}
|
|
71
|
+
trap cleanup TERM HUP
|
|
72
|
+
|
|
73
|
+
$CAFFEINATE bash -c '
|
|
74
|
+
delay=$RESTART_BASE_DELAY
|
|
75
|
+
consecutive_failures=0
|
|
76
|
+
|
|
77
|
+
while true; do
|
|
78
|
+
start_time=$(date +%s)
|
|
79
|
+
claude remote-control
|
|
80
|
+
exit_code=$?
|
|
81
|
+
elapsed=$(( $(date +%s) - start_time ))
|
|
82
|
+
|
|
83
|
+
# Ctrl+C (SIGINT) — exit cleanly
|
|
84
|
+
if [ $exit_code -eq 130 ]; then
|
|
85
|
+
echo ""
|
|
86
|
+
echo "Exited by user (Ctrl+C)."
|
|
87
|
+
exit 0
|
|
88
|
+
fi
|
|
89
|
+
|
|
90
|
+
# Reset backoff if the process ran for a healthy duration
|
|
91
|
+
if [ "$elapsed" -ge "$HEALTHY_RUNTIME" ]; then
|
|
92
|
+
consecutive_failures=0
|
|
93
|
+
delay=$RESTART_BASE_DELAY
|
|
94
|
+
else
|
|
95
|
+
consecutive_failures=$((consecutive_failures + 1))
|
|
96
|
+
delay=$(( RESTART_BASE_DELAY * (2 ** (consecutive_failures > 6 ? 6 : consecutive_failures - 1)) ))
|
|
97
|
+
[ "$delay" -gt "$RESTART_MAX_DELAY" ] && delay=$RESTART_MAX_DELAY
|
|
98
|
+
fi
|
|
99
|
+
|
|
100
|
+
# Circuit breaker: stop after too many rapid failures
|
|
101
|
+
if [ "$consecutive_failures" -ge "$MAX_CONSECUTIVE_FAILURES" ]; then
|
|
102
|
+
echo ""
|
|
103
|
+
echo "Too many consecutive failures ($MAX_CONSECUTIVE_FAILURES). Giving up."
|
|
104
|
+
echo "Check that \"claude remote-control\" works on its own, then retry."
|
|
105
|
+
if [ -n "$NTFY_TOPIC" ]; then
|
|
106
|
+
curl -s --max-time 10 --connect-timeout 5 \
|
|
107
|
+
-H "Title: Claude Remote" -H "Priority: high" \
|
|
108
|
+
-d "Circuit breaker: too many failures ($MAX_CONSECUTIVE_FAILURES). Giving up." \
|
|
109
|
+
"https://ntfy.sh/$NTFY_TOPIC" >/dev/null 2>&1 &
|
|
110
|
+
fi
|
|
111
|
+
exit 1
|
|
112
|
+
fi
|
|
113
|
+
|
|
114
|
+
echo ""
|
|
115
|
+
echo "[$(date "+%H:%M:%S")] Remote control disconnected (exit $exit_code). Restarting in ${delay}s..."
|
|
116
|
+
|
|
117
|
+
# Send ntfy notification on disconnect
|
|
118
|
+
if [ -n "$NTFY_TOPIC" ]; then
|
|
119
|
+
curl -s --max-time 10 --connect-timeout 5 \
|
|
120
|
+
-H "Title: Claude Remote" -d "Disconnected (exit $exit_code). Restarting in ${delay}s..." \
|
|
121
|
+
"https://ntfy.sh/$NTFY_TOPIC" >/dev/null 2>&1 &
|
|
122
|
+
fi
|
|
123
|
+
|
|
124
|
+
sleep "$delay"
|
|
125
|
+
done
|
|
126
|
+
'
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# VPS startup script for claude-ide-bridge.
|
|
3
|
+
# Starts the bridge on a fixed port inside tmux, with optional ngrok tunnel.
|
|
4
|
+
#
|
|
5
|
+
# Personal config lives in .env.vps (gitignored) — copy from .env.vps.example:
|
|
6
|
+
# cp .env.vps.example .env.vps && edit .env.vps
|
|
7
|
+
#
|
|
8
|
+
# Usage:
|
|
9
|
+
# bash scripts/start-vps.sh [--ngrok] [--stop]
|
|
10
|
+
# npm run vps
|
|
11
|
+
#
|
|
12
|
+
# Controls:
|
|
13
|
+
# tmux attach -t bridge -- view bridge logs
|
|
14
|
+
# tmux attach -t ngrok -- view ngrok status
|
|
15
|
+
# Ctrl+B, D -- detach (keeps running)
|
|
16
|
+
# bash scripts/start-vps.sh --stop -- kill all sessions
|
|
17
|
+
|
|
18
|
+
set -uo pipefail
|
|
19
|
+
|
|
20
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
21
|
+
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
22
|
+
|
|
23
|
+
# -- Load personal config (.env.vps) ------------------------------------------
|
|
24
|
+
ENV_FILE="$REPO_ROOT/.env.vps"
|
|
25
|
+
if [[ -f "$ENV_FILE" ]]; then
|
|
26
|
+
# shellcheck source=/dev/null
|
|
27
|
+
source "$ENV_FILE"
|
|
28
|
+
else
|
|
29
|
+
echo "Error: $ENV_FILE not found." >&2
|
|
30
|
+
echo " Copy the example: cp .env.vps.example .env.vps" >&2
|
|
31
|
+
echo " Then fill in your PORT, WORKSPACE, and FIXED_TOKEN." >&2
|
|
32
|
+
exit 1
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
# -- Defaults (can be overridden in .env.vps) ----------------------------------
|
|
36
|
+
PORT="${PORT:-9000}"
|
|
37
|
+
WORKSPACE="${WORKSPACE:-$REPO_ROOT}"
|
|
38
|
+
FIXED_TOKEN="${FIXED_TOKEN:-}"
|
|
39
|
+
START_NGROK=false
|
|
40
|
+
STOP=false
|
|
41
|
+
BRIDGE_SESSION="${BRIDGE_SESSION:-bridge}"
|
|
42
|
+
NGROK_SESSION="${NGROK_SESSION:-ngrok}"
|
|
43
|
+
|
|
44
|
+
if [[ -z "$FIXED_TOKEN" ]]; then
|
|
45
|
+
echo "Error: FIXED_TOKEN is not set in $ENV_FILE" >&2
|
|
46
|
+
exit 1
|
|
47
|
+
fi
|
|
48
|
+
# -- Parse args ----------------------------------------------------------------
|
|
49
|
+
while [[ $# -gt 0 ]]; do
|
|
50
|
+
case "$1" in
|
|
51
|
+
--ngrok) START_NGROK=true; shift ;;
|
|
52
|
+
--stop) STOP=true; shift ;;
|
|
53
|
+
*) echo "Unknown option: $1" >&2; exit 1 ;;
|
|
54
|
+
esac
|
|
55
|
+
done
|
|
56
|
+
# ── Stop mode ─────────────────────────────────────────────────────────────────
|
|
57
|
+
if [[ "$STOP" == true ]]; then
|
|
58
|
+
echo "Stopping bridge and ngrok sessions..."
|
|
59
|
+
tmux kill-session -t "$BRIDGE_SESSION" 2>/dev/null && echo " v bridge stopped" || echo " - bridge not running"
|
|
60
|
+
tmux kill-session -t "$NGROK_SESSION" 2>/dev/null && echo " v ngrok stopped" || echo " - ngrok not running"
|
|
61
|
+
exit 0
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
# ── Dependency checks ─────────────────────────────────────────────────────────
|
|
65
|
+
command -v tmux >/dev/null 2>&1 || { echo "Error: tmux not found. Run: apt install tmux" >&2; exit 1; }
|
|
66
|
+
command -v node >/dev/null 2>&1 || { echo "Error: node not found." >&2; exit 1; }
|
|
67
|
+
|
|
68
|
+
DIST="$WORKSPACE/dist/index.js"
|
|
69
|
+
if [[ ! -f "$DIST" ]]; then
|
|
70
|
+
echo "Error: $DIST not found. Run: npm run build" >&2
|
|
71
|
+
exit 1
|
|
72
|
+
fi
|
|
73
|
+
|
|
74
|
+
# ── Kill stale bridge session ─────────────────────────────────────────────────
|
|
75
|
+
tmux kill-session -t "$BRIDGE_SESSION" 2>/dev/null || true
|
|
76
|
+
|
|
77
|
+
# ── Bridge session (auto-restart loop) ───────────────────────────────────────
|
|
78
|
+
BRIDGE_CMD="node $DIST --port $PORT --workspace $WORKSPACE --fixed-token $FIXED_TOKEN --vps"
|
|
79
|
+
|
|
80
|
+
tmux new-session -d -s "$BRIDGE_SESSION" -x 220 -y 50 bash
|
|
81
|
+
sleep 0.3
|
|
82
|
+
|
|
83
|
+
tmux send-keys -t "$BRIDGE_SESSION" "while true; do
|
|
84
|
+
echo \"[\$(date '+%H:%M:%S')] Starting bridge on port $PORT...\"
|
|
85
|
+
$BRIDGE_CMD
|
|
86
|
+
EXIT=\$?
|
|
87
|
+
if [ \$EXIT -eq 130 ]; then echo 'Stopped by user (Ctrl+C).'; break; fi
|
|
88
|
+
echo \"[\$(date '+%H:%M:%S')] Bridge exited (code \$EXIT). Restarting in 5s...\"
|
|
89
|
+
sleep 5
|
|
90
|
+
done" Enter
|
|
91
|
+
|
|
92
|
+
echo "v Bridge started → tmux attach -t $BRIDGE_SESSION"
|
|
93
|
+
|
|
94
|
+
# ── Optional ngrok session ────────────────────────────────────────────────────
|
|
95
|
+
if [[ "$START_NGROK" == true ]]; then
|
|
96
|
+
if ! command -v ngrok >/dev/null 2>&1; then
|
|
97
|
+
echo "Warning: ngrok not found — skipping tunnel." >&2
|
|
98
|
+
else
|
|
99
|
+
tmux kill-session -t "$NGROK_SESSION" 2>/dev/null || true
|
|
100
|
+
tmux new-session -d -s "$NGROK_SESSION" -x 220 -y 50 \
|
|
101
|
+
"ngrok http $PORT --log stdout"
|
|
102
|
+
echo "v Ngrok started → tmux attach -t $NGROK_SESSION"
|
|
103
|
+
fi
|
|
104
|
+
fi
|
|
105
|
+
|
|
106
|
+
# ── Summary ───────────────────────────────────────────────────────────────────
|
|
107
|
+
echo ""
|
|
108
|
+
echo " Port: $PORT"
|
|
109
|
+
echo " Token: $FIXED_TOKEN"
|
|
110
|
+
echo " Workspace: $WORKSPACE"
|
|
111
|
+
echo ""
|
|
112
|
+
echo "Useful commands:"
|
|
113
|
+
echo " tmux attach -t $BRIDGE_SESSION # view bridge logs"
|
|
114
|
+
[[ "$START_NGROK" == true ]] && echo " tmux attach -t $NGROK_SESSION # view ngrok"
|
|
115
|
+
echo " bash scripts/start-vps.sh --stop # stop everything"
|
|
116
|
+
echo ""
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
## Claude IDE Bridge
|
|
2
|
+
|
|
3
|
+
@import .claude/rules/bridge-tools.md
|
|
4
|
+
> **BRIDGE TOOL ENFORCEMENT — mandatory when bridge is connected**
|
|
5
|
+
> Do NOT use native Claude Code tools or shell commands for workspace operations:
|
|
6
|
+
> - File reading: `getBufferContent` (not `Read` tool)
|
|
7
|
+
> - File editing: `editText` or `searchAndReplace` (not `Edit`/`Write` tools)
|
|
8
|
+
> - File search: `searchWorkspace` / `findFiles` (not `Grep`/`Glob` tools)
|
|
9
|
+
> - Testing: `runTests` (not `npm test` / `npx vitest`)
|
|
10
|
+
> - Diagnostics: `getDiagnostics` (not `tsc --noEmit` / `npm run lint`)
|
|
11
|
+
> - Git: `gitCommit`, `gitAdd`, `gitPush` (not `git commit` etc.)
|
|
12
|
+
> - Shell commands: `runInTerminal` (not `Bash` tool)
|
|
13
|
+
>
|
|
14
|
+
> **Exceptions:** `Read`/`Edit`/`Write` on files outside the workspace (`~/.claude/`, system paths) have no bridge equivalent.
|
|
15
|
+
>
|
|
16
|
+
> Full substitution table: see `.claude/rules/bridge-tools.md` (loaded above via @import).
|
|
17
|
+
The bridge is connected via MCP. The session-start hook reports connection status, tool count, and extension state automatically — check that summary before proceeding. If tools appear missing, call `getBridgeStatus` to diagnose.
|
|
18
|
+
|
|
19
|
+
### Bug fix methodology
|
|
20
|
+
|
|
21
|
+
When a bug is reported, do NOT start by trying to fix it. Instead:
|
|
22
|
+
1. Write a test that reproduces the bug (the test should fail)
|
|
23
|
+
2. Fix the bug and confirm the test now passes
|
|
24
|
+
3. Only then consider the bug fixed
|
|
25
|
+
|
|
26
|
+
### Documentation & memory
|
|
27
|
+
|
|
28
|
+
Keep project documentation and Claude's memory in sync with the code:
|
|
29
|
+
|
|
30
|
+
- **After architectural changes** — update `CLAUDE.md` so future sessions have accurate context. If a pattern, rule, or constraint changes, the file should reflect it.
|
|
31
|
+
- **At the end of a work session** — if meaningful decisions were made (why a pattern was chosen, what was tried and rejected, what the next steps are), save a summary to memory: *"Remember that we chose X approach because Y."*
|
|
32
|
+
- **Prune stale instructions** — if `CLAUDE.md` contains outdated guidance, remove or correct it. Stale instructions cause confident mistakes in future sessions.
|
|
33
|
+
|
|
34
|
+
### Modular rules (optional)
|
|
35
|
+
|
|
36
|
+
For large projects, move individual rules out of CLAUDE.md into scoped files under `.claude/rules/`:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
.claude/rules/testing.md — applies when working with test files
|
|
40
|
+
.claude/rules/security.md — applies to auth, payments, sensitive modules
|
|
41
|
+
.claude/rules/typescript.md — TypeScript-specific conventions
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Reference them from CLAUDE.md with:
|
|
45
|
+
```
|
|
46
|
+
@import .claude/rules/testing.md
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Path globs on rule files mean Claude only loads them when working on matching files — keeps context focused and token-efficient.
|
|
50
|
+
|
|
51
|
+
### Workflow rules
|
|
52
|
+
|
|
53
|
+
Bridge tool substitution rules are in `.claude/rules/bridge-tools.md` (loaded above). The Quick reference table below is a summary.
|
|
54
|
+
|
|
55
|
+
### Quick reference
|
|
56
|
+
|
|
57
|
+
| Task | Tool |
|
|
58
|
+
|---|---|
|
|
59
|
+
| Check errors / warnings | `getDiagnostics` |
|
|
60
|
+
| Run tests | `runTests` |
|
|
61
|
+
| Git status / diff | `getGitStatus`, `getGitDiff` |
|
|
62
|
+
| Stage, commit, push | `gitAdd`, `gitCommit`, `gitPush` |
|
|
63
|
+
| Open a pull request | `githubCreatePR` |
|
|
64
|
+
| Navigate to definition | `goToDefinition` |
|
|
65
|
+
| Find all references | `findReferences` |
|
|
66
|
+
| Call hierarchy | `getCallHierarchy` |
|
|
67
|
+
| File tree / symbols | `getFileTree`, `getDocumentSymbols` |
|
|
68
|
+
| Run a shell command | `runInTerminal`, `getTerminalOutput` |
|
|
69
|
+
| Interactive debug | `setDebugBreakpoints`, `startDebugging`, `evaluateInDebugger` |
|
|
70
|
+
| Lint / format | `fixAllLintErrors`, `formatDocument` |
|
|
71
|
+
| Security audit | `getSecurityAdvisories`, `auditDependencies` |
|
|
72
|
+
| Unused code | `detectUnusedCode` |
|
|
73
|
+
|
|
74
|
+
### Dispatch prompts (mobile)
|
|
75
|
+
|
|
76
|
+
When a terse message arrives via Claude Desktop Dispatch (phone/Siri), Claude automatically routes it to the appropriate bridge prompt. You can also invoke these prompts directly by name in any chat.
|
|
77
|
+
|
|
78
|
+
When responding to terse Dispatch messages from a phone, use these prompts for consistent, concise output:
|
|
79
|
+
|
|
80
|
+
| Phone message | Prompt | Tools called |
|
|
81
|
+
|---|---|---|
|
|
82
|
+
| "How's the build?" | `project-status` | `getGitStatus`, `getDiagnostics`, `runTests` |
|
|
83
|
+
| "Run the tests" | `quick-tests` | `runTests` |
|
|
84
|
+
| "Review my changes" | `quick-review` | `getGitStatus`, `getGitDiff`, `getDiagnostics` |
|
|
85
|
+
| "Does it build?" | `build-check` | `getProjectInfo`, `getDiagnostics`, `runCommand` |
|
|
86
|
+
| "What changed?" | `recent-activity` | `getGitLog`, `getGitStatus` |
|
|
87
|
+
|
|
88
|
+
Keep responses concise (under 20 lines) when the conversation arrives via Dispatch.
|
|
89
|
+
|
|
90
|
+
### Agent Teams & Scheduled Tasks
|
|
91
|
+
|
|
92
|
+
| Context | Prompt | What it does |
|
|
93
|
+
|---|---|---|
|
|
94
|
+
| Team lead checking on parallel agents | `team-status` | Workspace state, active tasks, recent activity across sessions |
|
|
95
|
+
| Scheduled nightly/hourly health check | `health-check` | Tests + diagnostics + security advisories + git status |
|
|
96
|
+
|
|
97
|
+
> Prerequisite for `team-status`: multiple Claude Code sessions must be connected simultaneously. Solo sessions will show empty team activity.
|
|
98
|
+
|
|
99
|
+
> **Claude Code ≥ v2.1.77**: `SendMessage` auto-resumes stopped agents — no need to check whether a teammate is running before sending to it.
|
|
100
|
+
|
|
101
|
+
Ready-made scheduled task templates (nightly-review, health-check, dependency-audit) are included with the bridge package. Copy the ones you want to `~/.claude/scheduled-tasks/` and restart Claude Desktop to activate them. Find them in the `templates/scheduled-tasks/` directory of the `claude-ide-bridge` npm package (typically `$(npm root -g)/claude-ide-bridge/templates/scheduled-tasks/`).
|
|
102
|
+
|
|
103
|
+
### Cowork (computer-use)
|
|
104
|
+
|
|
105
|
+
**MCP bridge tools are NOT available inside Cowork sessions.** Always run `/mcp__bridge__cowork` in a regular Claude Code or Claude Desktop chat first to gather context and write a handoff note, then open Cowork.
|
|
106
|
+
|
|
107
|
+
Workflow:
|
|
108
|
+
1. Regular chat: run `/mcp__bridge__cowork` → Claude collects IDE state → calls `setHandoffNote`
|
|
109
|
+
2. Open Cowork (Cmd+2 on Mac) → Cowork reads the handoff note for context
|
|
110
|
+
|
|
111
|
+
**If bridge tools are missing from your tool list inside Cowork:** you're in the wrong context. Exit, run the prompt in regular chat, then return.
|
|
112
|
+
|
|
113
|
+
Full details: [docs/cowork-workflow.md](docs/cowork-workflow.md)
|
|
114
|
+
|
|
115
|
+
**Cowork uses git worktrees:** Cowork sessions operate in an isolated git worktree (separate branch/working copy), not the main workspace root. Files written by Cowork land in the worktree. Always add "write all files to the workspace root, not a subdirectory" as the first instruction in your CLAUDE.md when using Cowork with a synced workspace. After Cowork finishes, review and merge the worktree branch back to main.
|
|
116
|
+
|
|
117
|
+
### Session continuity
|
|
118
|
+
|
|
119
|
+
| Scenario | Action |
|
|
120
|
+
|---|---|
|
|
121
|
+
| Switching CLI → Desktop | Call `setHandoffNote` before switching; bridge auto-snapshots if note is >5 min stale |
|
|
122
|
+
| Session just started | Call `getHandoffNote` to pick up prior context (workspace-scoped). **Caution:** the `onInstructionsLoaded` automation hook may have auto-overwritten the note at session start — if the content looks generic or templated, treat it as stale and consult any persistent session log your project maintains (e.g. `docs/session-log.md`) for authoritative history. |
|
|
123
|
+
| Bridge restarted | First connected client receives a "restored from checkpoint" notification |
|
|
124
|
+
| Preparing for Cowork | Run `/mcp__bridge__cowork` in regular chat first — Cowork has no MCP access |
|
|
125
|
+
| Multi-workspace | Notes are workspace-scoped; switching workspaces won't overwrite each other's notes |
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "security-first — monitors auth, payment, and API surface for vulnerabilities on every relevant change.",
|
|
3
|
+
"_usage": "Copy to automation-policy.json. Requires --automation --automation-policy <path> --claude-driver subprocess",
|
|
4
|
+
|
|
5
|
+
"automationSystemPrompt": "Automation bot. Drop articles/filler. Fragments OK. Abbreviate: DB/auth/config/req/res/fn. X→Y arrows. ≤5 lines. No preamble. Call tools → report results only.",
|
|
6
|
+
|
|
7
|
+
"onFileSave": {
|
|
8
|
+
"enabled": true,
|
|
9
|
+
"patterns": ["src/**/*.ts", "!src/**/*.test.ts", "!src/**/__tests__/**"],
|
|
10
|
+
"cooldownMs": 12000,
|
|
11
|
+
"prompt": "{{file}} saved. getDiagnostics → type errors (null-deref/undefined risk). Hardcoded secrets? User input missing validation? ≤12 lines."
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
"onGitCommit": {
|
|
15
|
+
"enabled": true,
|
|
16
|
+
"cooldownMs": 15000,
|
|
17
|
+
"prompt": "Commit {{branch}}: {{message}}\nFiles: {{files}}\ngetDiagnostics (errors only). Each file: input validation? auth required? no secrets? Auth/payment/session files → flag for manual review. ≤15 lines."
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
"onGitPush": {
|
|
21
|
+
"enabled": true,
|
|
22
|
+
"cooldownMs": 15000,
|
|
23
|
+
"prompt": "Pushed {{branch}} to {{remote}}. getSecurityAdvisories + auditDependencies → high/critical CVEs only."
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
"onPullRequest": {
|
|
27
|
+
"enabled": true,
|
|
28
|
+
"cooldownMs": 10000,
|
|
29
|
+
"prompt": "PR #{{number}}: {{title}} ({{url}}). getDiagnostics → type errors? Auth/payment/session files touched? New API endpoints authenticated? Security readiness: 1-line verdict."
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
"onDiagnosticsError": {
|
|
33
|
+
"enabled": true,
|
|
34
|
+
"cooldownMs": 20000,
|
|
35
|
+
"minSeverity": "error",
|
|
36
|
+
"diagnosticTypes": ["ts"],
|
|
37
|
+
"prompt": "Type err {{file}}:\n{{diagnostics}}\nSecurity impact: null-deref/injection/auth-bypass risk? Safest fix."
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
"onCompaction": {
|
|
41
|
+
"enabled": true,
|
|
42
|
+
"phase": "post",
|
|
43
|
+
"cooldownMs": 5000,
|
|
44
|
+
"prompt": "Compacted. getGitStatus + getDiagnostics. Drop articles/filler. Fragments OK. Abbreviate (DB/auth/config/req/res/fn). Stay terse. Security-sensitive files modified? ≤8 lines."
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "strict-lint — triggers on every save and error, enforces zero-warning policy.",
|
|
3
|
+
"_usage": "Copy to automation-policy.json. Requires --automation --automation-policy <path> --claude-driver subprocess",
|
|
4
|
+
|
|
5
|
+
"automationSystemPrompt": "Automation bot. Drop articles/filler. Fragments OK. Abbreviate: DB/auth/config/req/res/fn. X→Y arrows. ≤5 lines. No preamble. Call tools → report results only.",
|
|
6
|
+
|
|
7
|
+
"onFileSave": {
|
|
8
|
+
"enabled": true,
|
|
9
|
+
"patterns": ["**/*.{ts,tsx,js,jsx}"],
|
|
10
|
+
"condition": "!**/*.test.ts",
|
|
11
|
+
"cooldownMs": 8000,
|
|
12
|
+
"prompt": "{{file}} saved. fixAllLintErrors → getDiagnostics. Remaining errors/warnings ≤10 lines. Zero-warning policy."
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
"onDiagnosticsError": {
|
|
16
|
+
"enabled": true,
|
|
17
|
+
"cooldownMs": 10000,
|
|
18
|
+
"minSeverity": "warning",
|
|
19
|
+
"diagnosticTypes": ["ts", "eslint", "biome"],
|
|
20
|
+
"prompt": "Lint/type issue {{file}}:\n{{diagnostics}}\nfixAllLintErrors → manual fixes needed? ≤10 lines."
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
"onDiagnosticsCleared": {
|
|
24
|
+
"enabled": true,
|
|
25
|
+
"cooldownMs": 10000,
|
|
26
|
+
"prompt": "{{file}} issues cleared. getDiagnostics → confirm workspace clean."
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
"onGitCommit": {
|
|
30
|
+
"enabled": true,
|
|
31
|
+
"cooldownMs": 10000,
|
|
32
|
+
"prompt": "Commit {{branch}}: {{message}}\nFiles: {{files}}\ngetDiagnostics workspace-wide. Errors → block. Warnings → report. Zero-warning policy."
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
"onCompaction": {
|
|
36
|
+
"enabled": true,
|
|
37
|
+
"phase": "post",
|
|
38
|
+
"cooldownMs": 5000,
|
|
39
|
+
"prompt": "Compacted. getGitStatus + getDiagnostics workspace-wide. Drop articles/filler. Fragments OK. Abbreviate (DB/auth/config/req/res/fn). Stay terse. Branch, error count, warning count ≤5 lines."
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "test-driven — enforces test coverage and runs tests automatically on every relevant change.",
|
|
3
|
+
"_usage": "Copy to automation-policy.json. Requires --automation --automation-policy <path> --claude-driver subprocess",
|
|
4
|
+
|
|
5
|
+
"automationSystemPrompt": "Automation bot. Drop articles/filler. Fragments OK. Abbreviate: DB/auth/config/req/res/fn. X→Y arrows. ≤5 lines. No preamble. Call tools → report results only.",
|
|
6
|
+
|
|
7
|
+
"onFileSave": {
|
|
8
|
+
"enabled": true,
|
|
9
|
+
"patterns": ["src/**/*.ts", "vscode-extension/src/**/*.ts"],
|
|
10
|
+
"condition": "!**/*.test.ts",
|
|
11
|
+
"cooldownMs": 10000,
|
|
12
|
+
"prompt": "{{file}} saved. getDiagnostics → errors. runTests (filtered to file). No test file → generateTests scaffold. Report: error count, pass/fail, coverage note."
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
"onDiagnosticsError": {
|
|
16
|
+
"enabled": true,
|
|
17
|
+
"cooldownMs": 15000,
|
|
18
|
+
"minSeverity": "error",
|
|
19
|
+
"diagnosticTypes": ["ts"],
|
|
20
|
+
"prompt": "Type err {{file}}:\n{{diagnostics}}\nDO NOT fix yet. getCallHierarchy (incoming) → what depends on symbol. Cause + safest fix. ≤12 lines."
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
"onDiagnosticsCleared": {
|
|
24
|
+
"enabled": true,
|
|
25
|
+
"cooldownMs": 10000,
|
|
26
|
+
"prompt": "{{file}} error cleared. runTests → confirm fix correct, no regressions."
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
"onTestRun": {
|
|
30
|
+
"enabled": true,
|
|
31
|
+
"cooldownMs": 10000,
|
|
32
|
+
"onFailureOnly": true,
|
|
33
|
+
"prompt": "{{failed}}/{{total}} fail.\n{{failures}}\ngetDiagnostics (failing test files). getCallHierarchy (incoming) on first failing symbol → root cause. Minimal fix — don't change test expectations unless contract changed."
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
"onGitCommit": {
|
|
37
|
+
"enabled": true,
|
|
38
|
+
"cooldownMs": 12000,
|
|
39
|
+
"prompt": "Commit {{branch}}: {{message}}\nFiles: {{files}}\ngetDiagnostics (errors only). Non-test files changed → runTests → pass/fail. Flag files missing test coverage."
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
"onBranchCheckout": {
|
|
43
|
+
"enabled": true,
|
|
44
|
+
"cooldownMs": 8000,
|
|
45
|
+
"prompt": "→{{branch}} (from {{previousBranch}}). getDiagnostics + runTests → branch, error count, pass/fail. ≤5 lines."
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
"onCompaction": {
|
|
49
|
+
"enabled": true,
|
|
50
|
+
"phase": "post",
|
|
51
|
+
"cooldownMs": 5000,
|
|
52
|
+
"prompt": "Compacted. getGitStatus + getDiagnostics + getHandoffNote. Drop articles/filler. Fragments OK. Abbreviate (DB/auth/config/req/res/fn). Stay terse. ≤8 lines."
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Example automation policy with LSP-aware prompts. Copy to automation-policy.json and adjust as needed.",
|
|
3
|
+
"_usage": "Start bridge with: claude-ide-bridge --automation --automation-policy ./automation-policy.json --claude-driver subprocess",
|
|
4
|
+
|
|
5
|
+
"onFileChanged": {
|
|
6
|
+
"enabled": true,
|
|
7
|
+
"patterns": [
|
|
8
|
+
"**/*.{ts,tsx,js,jsx,py,go,rs}",
|
|
9
|
+
"!node_modules/**",
|
|
10
|
+
"!dist/**"
|
|
11
|
+
],
|
|
12
|
+
"prompt": "File {{file}} was just edited. Call getChangeImpact on the changed symbols to compute blast radius. If risk is medium or high (referenceCount > 10 or callerCount > 5), also call findReferences to list the affected files. If the changed file exports an interface or abstract class, also call findImplementations at the first exported symbol position to check that all implementations are still reachable. Report in ≤15 lines: risk badge, reference counts, and the top 5 most-impacted files.",
|
|
13
|
+
"cooldownMs": 15000
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
"onFileSave": {
|
|
17
|
+
"enabled": false,
|
|
18
|
+
"patterns": ["**/*.{ts,tsx}"],
|
|
19
|
+
"prompt": "{{file}} was saved. Run getDiagnostics for this file and report any new errors or warnings. If there are type errors, call getHover at the first error position to explain the expected vs actual types.",
|
|
20
|
+
"cooldownMs": 10000
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
"onDiagnosticsError": {
|
|
24
|
+
"enabled": true,
|
|
25
|
+
"minSeverity": "error",
|
|
26
|
+
"patterns": ["**/*.{ts,tsx,js,jsx}"],
|
|
27
|
+
"prompt": "New diagnostic errors appeared in {{file}}:\n\n{{diagnostics}}\n\nFor each error: (1) call getHover at the error position to fetch type info, (2) if the error is a type error, call goToTypeDefinition at that position to navigate to the root type definition, (3) call explainSymbol on the failing symbol if applicable, (4) suggest the most likely fix. Keep response under 20 lines.",
|
|
28
|
+
"cooldownMs": 20000
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
"onDiagnosticsCleared": {
|
|
32
|
+
"enabled": true,
|
|
33
|
+
"prompt": "The error in {{file}} was just cleared. Run the tests for that file to confirm the fix.",
|
|
34
|
+
"cooldownMs": 10000
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
"onTaskSuccess": {
|
|
38
|
+
"enabled": false,
|
|
39
|
+
"prompt": "Task {{taskId}} completed. Review the output and check for any follow-up actions needed.",
|
|
40
|
+
"cooldownMs": 5000
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
"onBranchCheckout": {
|
|
44
|
+
"enabled": true,
|
|
45
|
+
"prompt": "Switched to branch {{branch}} (from {{previousBranch}}). Run getDiagnostics with no uri to baseline workspace health. If there are errors, call explainSymbol on the first one. Report: branch name, error count, warning count, and first error (if any).",
|
|
46
|
+
"cooldownMs": 30000
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
"onGitCommit": {
|
|
50
|
+
"enabled": true,
|
|
51
|
+
"prompt": "Committed {{hash}} on {{branch}}: {{message}}. Changed files: {{files}}. For each changed file: call getChangeImpact to check blast radius. If any export was removed or renamed, call findReferences to verify no broken callers remain. If any interface or abstract class was modified, call findImplementations at the changed symbol to verify all concrete implementations are still consistent. Report a compact post-commit health summary.",
|
|
52
|
+
"cooldownMs": 10000
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
"onGitPush": {
|
|
56
|
+
"enabled": false,
|
|
57
|
+
"prompt": "Pushed {{commits}} commits to {{remote}}/{{branch}}. Run getDiagnostics workspace-wide and detectUnusedCode to flag any dead exports that were pushed. Keep report under 15 lines.",
|
|
58
|
+
"cooldownMs": 5000
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
"_commentPromptName": "Instead of an inline prompt, you can reference any named MCP prompt using promptName + promptArgs. Event placeholders ({{file}}, {{branch}}, etc.) work inside promptArgs values too.",
|
|
62
|
+
"onFileSave_example_named": {
|
|
63
|
+
"_comment": "Example: use the explore-type prompt on every saved file (position 1:1 = first symbol)",
|
|
64
|
+
"enabled": false,
|
|
65
|
+
"promptName": "explore-type",
|
|
66
|
+
"promptArgs": {
|
|
67
|
+
"file": "{{file}}",
|
|
68
|
+
"line": "1",
|
|
69
|
+
"column": "1"
|
|
70
|
+
},
|
|
71
|
+
"patterns": ["**/*.{ts,tsx}"],
|
|
72
|
+
"cooldownMs": 30000
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
"onPullRequest": {
|
|
76
|
+
"enabled": true,
|
|
77
|
+
"prompt": "PR #{{number}} opened: {{title}} ({{url}}). Changed files: {{files}}. For each changed file: (1) call getChangeImpact to report blast radius, (2) call getDiagnostics to surface any new errors. Output a compact PR readiness report: risk badge per file, total error count, top 3 most-impacted downstream files.",
|
|
78
|
+
"cooldownMs": 5000
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
"onTestRun": {
|
|
82
|
+
"enabled": true,
|
|
83
|
+
"prompt": "Tests just ran. Results: {{results}}. For each failed test file: call getDiagnostics to check for type errors, then call getCallHierarchy (incoming) on the failing function to identify what changed upstream. If the failure involves an interface mismatch, call goToDeclaration on the symbol under test to verify the expected contract. Suggest the most likely root cause in ≤10 lines.",
|
|
84
|
+
"cooldownMs": 15000
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
"onCompaction": {
|
|
88
|
+
"enabled": true,
|
|
89
|
+
"phase": "post",
|
|
90
|
+
"prompt": "Context was just compacted. Re-orient: call getProjectInfo for workspace summary, getGitStatus for current changes, and getDiagnostics to check health. Report in ≤10 lines so the session can continue smoothly.",
|
|
91
|
+
"cooldownMs": 60000
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
"onTaskCreated": {
|
|
95
|
+
"enabled": false,
|
|
96
|
+
"prompt": "A new Claude Code task was created ({{taskId}}): {{prompt}}. Call getClaudeTaskStatus once to confirm it started. If the task prompt mentions a file, call getDiagnostics on that file to baseline current state before the task modifies anything.",
|
|
97
|
+
"cooldownMs": 5000
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
"onPermissionDenied": {
|
|
101
|
+
"enabled": false,
|
|
102
|
+
"prompt": "The tool '{{tool}}' was blocked (reason: {{reason}}). Call getBridgeStatus to confirm bridge health, then call getToolCapabilities to list available tools. If the tool is an IDE tool, check whether the VS Code extension is still connected.",
|
|
103
|
+
"cooldownMs": 15000
|
|
104
|
+
}
|
|
105
|
+
}
|