patchwork-os 0.2.0-alpha.9 → 0.2.0-beta.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/README.bridge.md +6 -0
- package/README.md +315 -35
- package/deploy/bootstrap-new-vps.sh +12 -12
- package/deploy/bootstrap-vps.sh +187 -0
- package/deploy/deploy-dashboard.sh +174 -0
- package/deploy/deploy-landing.sh +136 -0
- package/dist/activationMetrics.d.ts +67 -0
- package/dist/activationMetrics.js +255 -0
- package/dist/activationMetrics.js.map +1 -0
- package/dist/activityLog.d.ts +49 -0
- package/dist/activityLog.js +78 -0
- package/dist/activityLog.js.map +1 -1
- package/dist/approvalHttp.d.ts +49 -2
- package/dist/approvalHttp.js +217 -21
- package/dist/approvalHttp.js.map +1 -1
- package/dist/approvalInsights.d.ts +49 -0
- package/dist/approvalInsights.js +97 -0
- package/dist/approvalInsights.js.map +1 -0
- package/dist/approvalQueue.d.ts +27 -1
- package/dist/approvalQueue.js +123 -3
- package/dist/approvalQueue.js.map +1 -1
- package/dist/approvalSignals.d.ts +124 -0
- package/dist/approvalSignals.js +512 -0
- package/dist/approvalSignals.js.map +1 -0
- package/dist/automation.d.ts +57 -0
- package/dist/automation.js +156 -59
- package/dist/automation.js.map +1 -1
- package/dist/automationSuggestions.d.ts +79 -0
- package/dist/automationSuggestions.js +150 -0
- package/dist/automationSuggestions.js.map +1 -0
- package/dist/bridge.d.ts +3 -0
- package/dist/bridge.js +174 -143
- package/dist/bridge.js.map +1 -1
- package/dist/bridgeToken.js +57 -19
- package/dist/bridgeToken.js.map +1 -1
- package/dist/ccPermissions.d.ts +15 -0
- package/dist/ccPermissions.js +21 -4
- package/dist/ccPermissions.js.map +1 -1
- package/dist/claudeDriver.js +74 -16
- package/dist/claudeDriver.js.map +1 -1
- package/dist/claudeOrchestrator.d.ts +1 -1
- package/dist/claudeOrchestrator.js +14 -8
- package/dist/claudeOrchestrator.js.map +1 -1
- package/dist/commands/dashboard.js +1 -1
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/launchd.d.ts +2 -0
- package/dist/commands/launchd.js +94 -0
- package/dist/commands/launchd.js.map +1 -0
- package/dist/commands/patchworkInit.d.ts +8 -0
- package/dist/commands/patchworkInit.js +77 -11
- package/dist/commands/patchworkInit.js.map +1 -1
- package/dist/commands/recipe.d.ts +289 -0
- package/dist/commands/recipe.js +1359 -0
- package/dist/commands/recipe.js.map +1 -0
- package/dist/commands/recipeInstall.d.ts +150 -0
- package/dist/commands/recipeInstall.js +647 -0
- package/dist/commands/recipeInstall.js.map +1 -0
- package/dist/commands/tracesExport.d.ts +83 -0
- package/dist/commands/tracesExport.js +269 -0
- package/dist/commands/tracesExport.js.map +1 -0
- package/dist/commands/tracesImport.d.ts +56 -0
- package/dist/commands/tracesImport.js +161 -0
- package/dist/commands/tracesImport.js.map +1 -0
- package/dist/config.d.ts +22 -1
- package/dist/config.js +108 -9
- package/dist/config.js.map +1 -1
- package/dist/connectorRoutes.d.ts +43 -0
- package/dist/connectorRoutes.js +1609 -0
- package/dist/connectorRoutes.js.map +1 -0
- package/dist/connectors/asana.d.ts +198 -0
- package/dist/connectors/asana.js +679 -0
- package/dist/connectors/asana.js.map +1 -0
- package/dist/connectors/baseConnector.d.ts +153 -0
- package/dist/connectors/baseConnector.js +336 -0
- package/dist/connectors/baseConnector.js.map +1 -0
- package/dist/connectors/confluence.d.ts +111 -0
- package/dist/connectors/confluence.js +406 -0
- package/dist/connectors/confluence.js.map +1 -0
- package/dist/connectors/datadog.d.ts +116 -0
- package/dist/connectors/datadog.js +385 -0
- package/dist/connectors/datadog.js.map +1 -0
- package/dist/connectors/discord.d.ts +150 -0
- package/dist/connectors/discord.js +543 -0
- package/dist/connectors/discord.js.map +1 -0
- package/dist/connectors/fixtureLibrary.d.ts +21 -0
- package/dist/connectors/fixtureLibrary.js +70 -0
- package/dist/connectors/fixtureLibrary.js.map +1 -0
- package/dist/connectors/fixtureRecorder.d.ts +1 -0
- package/dist/connectors/fixtureRecorder.js +35 -0
- package/dist/connectors/fixtureRecorder.js.map +1 -0
- package/dist/connectors/github.js +17 -18
- package/dist/connectors/github.js.map +1 -1
- package/dist/connectors/gitlab.d.ts +180 -0
- package/dist/connectors/gitlab.js +582 -0
- package/dist/connectors/gitlab.js.map +1 -0
- package/dist/connectors/gmail.d.ts +4 -1
- package/dist/connectors/gmail.js +149 -27
- package/dist/connectors/gmail.js.map +1 -1
- package/dist/connectors/googleCalendar.d.ts +4 -1
- package/dist/connectors/googleCalendar.js +88 -25
- package/dist/connectors/googleCalendar.js.map +1 -1
- package/dist/connectors/googleDrive.d.ts +34 -0
- package/dist/connectors/googleDrive.js +321 -0
- package/dist/connectors/googleDrive.js.map +1 -0
- package/dist/connectors/htmlEscape.d.ts +5 -0
- package/dist/connectors/htmlEscape.js +13 -0
- package/dist/connectors/htmlEscape.js.map +1 -0
- package/dist/connectors/hubspot.d.ts +112 -0
- package/dist/connectors/hubspot.js +408 -0
- package/dist/connectors/hubspot.js.map +1 -0
- package/dist/connectors/intercom.d.ts +102 -0
- package/dist/connectors/intercom.js +402 -0
- package/dist/connectors/intercom.js.map +1 -0
- package/dist/connectors/jira.d.ts +98 -0
- package/dist/connectors/jira.js +379 -0
- package/dist/connectors/jira.js.map +1 -0
- package/dist/connectors/linear.js +30 -19
- package/dist/connectors/linear.js.map +1 -1
- package/dist/connectors/mcpOAuth.d.ts +3 -0
- package/dist/connectors/mcpOAuth.js +64 -10
- package/dist/connectors/mcpOAuth.js.map +1 -1
- package/dist/connectors/mockConnector.d.ts +28 -0
- package/dist/connectors/mockConnector.js +81 -0
- package/dist/connectors/mockConnector.js.map +1 -0
- package/dist/connectors/notion.d.ts +143 -0
- package/dist/connectors/notion.js +424 -0
- package/dist/connectors/notion.js.map +1 -0
- package/dist/connectors/oauthStateStore.d.ts +31 -0
- package/dist/connectors/oauthStateStore.js +52 -0
- package/dist/connectors/oauthStateStore.js.map +1 -0
- package/dist/connectors/pagerduty.d.ts +160 -0
- package/dist/connectors/pagerduty.js +464 -0
- package/dist/connectors/pagerduty.js.map +1 -0
- package/dist/connectors/sentry.js +5 -13
- package/dist/connectors/sentry.js.map +1 -1
- package/dist/connectors/slack.d.ts +16 -1
- package/dist/connectors/slack.js +155 -32
- package/dist/connectors/slack.js.map +1 -1
- package/dist/connectors/stripe.d.ts +116 -0
- package/dist/connectors/stripe.js +379 -0
- package/dist/connectors/stripe.js.map +1 -0
- package/dist/connectors/tokenStorage.d.ts +35 -0
- package/dist/connectors/tokenStorage.js +484 -0
- package/dist/connectors/tokenStorage.js.map +1 -0
- package/dist/connectors/zendesk.d.ts +104 -0
- package/dist/connectors/zendesk.js +442 -0
- package/dist/connectors/zendesk.js.map +1 -0
- package/dist/cors.d.ts +10 -0
- package/dist/cors.js +29 -0
- package/dist/cors.js.map +1 -0
- package/dist/decisionReplay.d.ts +72 -0
- package/dist/decisionReplay.js +92 -0
- package/dist/decisionReplay.js.map +1 -0
- package/dist/decisionTraceLog.d.ts +6 -0
- package/dist/decisionTraceLog.js +54 -2
- package/dist/decisionTraceLog.js.map +1 -1
- package/dist/drivers/gemini/index.d.ts +5 -1
- package/dist/drivers/gemini/index.js +39 -5
- package/dist/drivers/gemini/index.js.map +1 -1
- package/dist/drivers/index.d.ts +5 -0
- package/dist/drivers/index.js +1 -1
- package/dist/drivers/index.js.map +1 -1
- package/dist/featureFlags.d.ts +79 -0
- package/dist/featureFlags.js +208 -0
- package/dist/featureFlags.js.map +1 -0
- package/dist/fp/automationInterpreter.js +26 -21
- package/dist/fp/automationInterpreter.js.map +1 -1
- package/dist/fp/automationProgram.d.ts +1 -1
- package/dist/fp/automationProgram.js.map +1 -1
- package/dist/fp/automationState.js +4 -1
- package/dist/fp/automationState.js.map +1 -1
- package/dist/fp/policyParser.js +21 -1
- package/dist/fp/policyParser.js.map +1 -1
- package/dist/inboxRoutes.d.ts +22 -0
- package/dist/inboxRoutes.js +114 -0
- package/dist/inboxRoutes.js.map +1 -0
- package/dist/index.js +1400 -201
- package/dist/index.js.map +1 -1
- package/dist/installGuard.d.ts +25 -0
- package/dist/installGuard.js +48 -0
- package/dist/installGuard.js.map +1 -0
- package/dist/mcpRoutes.d.ts +37 -0
- package/dist/mcpRoutes.js +76 -0
- package/dist/mcpRoutes.js.map +1 -0
- package/dist/oauth.d.ts +7 -1
- package/dist/oauth.js +201 -39
- package/dist/oauth.js.map +1 -1
- package/dist/oauthRoutes.d.ts +32 -0
- package/dist/oauthRoutes.js +124 -0
- package/dist/oauthRoutes.js.map +1 -0
- package/dist/orchestrator/orchestratorBridge.js +2 -2
- package/dist/orchestrator/orchestratorBridge.js.map +1 -1
- package/dist/patchworkConfig.d.ts +16 -0
- package/dist/patchworkConfig.js +1 -1
- package/dist/patchworkConfig.js.map +1 -1
- package/dist/pluginLoader.d.ts +28 -0
- package/dist/pluginLoader.js +77 -11
- package/dist/pluginLoader.js.map +1 -1
- package/dist/pluginWatcher.js +8 -3
- package/dist/pluginWatcher.js.map +1 -1
- package/dist/preToolUseHook.d.ts +12 -0
- package/dist/preToolUseHook.js +23 -0
- package/dist/preToolUseHook.js.map +1 -1
- package/dist/recipeOrchestration.d.ts +121 -0
- package/dist/recipeOrchestration.js +955 -0
- package/dist/recipeOrchestration.js.map +1 -0
- package/dist/recipeRoutes.d.ts +180 -0
- package/dist/recipeRoutes.js +1345 -0
- package/dist/recipeRoutes.js.map +1 -0
- package/dist/recipes/RecipeOrchestrator.d.ts +40 -0
- package/dist/recipes/RecipeOrchestrator.js +51 -0
- package/dist/recipes/RecipeOrchestrator.js.map +1 -0
- package/dist/recipes/agentExecutor.d.ts +29 -0
- package/dist/recipes/agentExecutor.js +49 -0
- package/dist/recipes/agentExecutor.js.map +1 -0
- package/dist/recipes/chainedRunner.d.ts +191 -0
- package/dist/recipes/chainedRunner.js +759 -0
- package/dist/recipes/chainedRunner.js.map +1 -0
- package/dist/recipes/compiler.js +3 -3
- package/dist/recipes/compiler.js.map +1 -1
- package/dist/recipes/dependencyGraph.d.ts +39 -0
- package/dist/recipes/dependencyGraph.js +199 -0
- package/dist/recipes/dependencyGraph.js.map +1 -0
- package/dist/recipes/disabledMarkers.d.ts +48 -0
- package/dist/recipes/disabledMarkers.js +52 -0
- package/dist/recipes/disabledMarkers.js.map +1 -0
- package/dist/recipes/installer.js +3 -3
- package/dist/recipes/installer.js.map +1 -1
- package/dist/recipes/legacyRecipeCompat.d.ts +10 -0
- package/dist/recipes/legacyRecipeCompat.js +131 -0
- package/dist/recipes/legacyRecipeCompat.js.map +1 -0
- package/dist/recipes/manifest.d.ts +47 -0
- package/dist/recipes/manifest.js +156 -0
- package/dist/recipes/manifest.js.map +1 -0
- package/dist/recipes/migrationWarnings.d.ts +12 -0
- package/dist/recipes/migrationWarnings.js +44 -0
- package/dist/recipes/migrationWarnings.js.map +1 -0
- package/dist/recipes/migrations/index.d.ts +24 -0
- package/dist/recipes/migrations/index.js +55 -0
- package/dist/recipes/migrations/index.js.map +1 -0
- package/dist/recipes/migrations/types.d.ts +28 -0
- package/dist/recipes/migrations/types.js +2 -0
- package/dist/recipes/migrations/types.js.map +1 -0
- package/dist/recipes/migrations/v1.d.ts +11 -0
- package/dist/recipes/migrations/v1.js +18 -0
- package/dist/recipes/migrations/v1.js.map +1 -0
- package/dist/recipes/names.d.ts +40 -0
- package/dist/recipes/names.js +66 -0
- package/dist/recipes/names.js.map +1 -0
- package/dist/recipes/nestedRecipeStep.d.ts +58 -0
- package/dist/recipes/nestedRecipeStep.js +95 -0
- package/dist/recipes/nestedRecipeStep.js.map +1 -0
- package/dist/recipes/outputRegistry.d.ts +28 -0
- package/dist/recipes/outputRegistry.js +52 -0
- package/dist/recipes/outputRegistry.js.map +1 -0
- package/dist/recipes/parser.js +4 -1
- package/dist/recipes/parser.js.map +1 -1
- package/dist/recipes/replayRun.d.ts +62 -0
- package/dist/recipes/replayRun.js +97 -0
- package/dist/recipes/replayRun.js.map +1 -0
- package/dist/recipes/resolveRecipePath.d.ts +69 -0
- package/dist/recipes/resolveRecipePath.js +202 -0
- package/dist/recipes/resolveRecipePath.js.map +1 -0
- package/dist/recipes/scheduler.d.ts +23 -7
- package/dist/recipes/scheduler.js +225 -45
- package/dist/recipes/scheduler.js.map +1 -1
- package/dist/recipes/schema.d.ts +17 -2
- package/dist/recipes/schemaGenerator.d.ts +28 -0
- package/dist/recipes/schemaGenerator.js +565 -0
- package/dist/recipes/schemaGenerator.js.map +1 -0
- package/dist/recipes/stepObservation.d.ts +44 -0
- package/dist/recipes/stepObservation.js +232 -0
- package/dist/recipes/stepObservation.js.map +1 -0
- package/dist/recipes/templateEngine.d.ts +62 -0
- package/dist/recipes/templateEngine.js +201 -0
- package/dist/recipes/templateEngine.js.map +1 -0
- package/dist/recipes/toolRegistry.d.ts +186 -0
- package/dist/recipes/toolRegistry.js +309 -0
- package/dist/recipes/toolRegistry.js.map +1 -0
- package/dist/recipes/tools/asana.d.ts +16 -0
- package/dist/recipes/tools/asana.js +524 -0
- package/dist/recipes/tools/asana.js.map +1 -0
- package/dist/recipes/tools/calendar.d.ts +6 -0
- package/dist/recipes/tools/calendar.js +61 -0
- package/dist/recipes/tools/calendar.js.map +1 -0
- package/dist/recipes/tools/confluence.d.ts +6 -0
- package/dist/recipes/tools/confluence.js +254 -0
- package/dist/recipes/tools/confluence.js.map +1 -0
- package/dist/recipes/tools/datadog.d.ts +6 -0
- package/dist/recipes/tools/datadog.js +239 -0
- package/dist/recipes/tools/datadog.js.map +1 -0
- package/dist/recipes/tools/diagnostics.d.ts +6 -0
- package/dist/recipes/tools/diagnostics.js +36 -0
- package/dist/recipes/tools/diagnostics.js.map +1 -0
- package/dist/recipes/tools/discord.d.ts +18 -0
- package/dist/recipes/tools/discord.js +254 -0
- package/dist/recipes/tools/discord.js.map +1 -0
- package/dist/recipes/tools/file.d.ts +12 -0
- package/dist/recipes/tools/file.js +174 -0
- package/dist/recipes/tools/file.js.map +1 -0
- package/dist/recipes/tools/git.d.ts +6 -0
- package/dist/recipes/tools/git.js +63 -0
- package/dist/recipes/tools/git.js.map +1 -0
- package/dist/recipes/tools/github.d.ts +6 -0
- package/dist/recipes/tools/github.js +116 -0
- package/dist/recipes/tools/github.js.map +1 -0
- package/dist/recipes/tools/gitlab.d.ts +11 -0
- package/dist/recipes/tools/gitlab.js +285 -0
- package/dist/recipes/tools/gitlab.js.map +1 -0
- package/dist/recipes/tools/gmail.d.ts +6 -0
- package/dist/recipes/tools/gmail.js +434 -0
- package/dist/recipes/tools/gmail.js.map +1 -0
- package/dist/recipes/tools/googleDrive.d.ts +1 -0
- package/dist/recipes/tools/googleDrive.js +55 -0
- package/dist/recipes/tools/googleDrive.js.map +1 -0
- package/dist/recipes/tools/hubspot.d.ts +6 -0
- package/dist/recipes/tools/hubspot.js +232 -0
- package/dist/recipes/tools/hubspot.js.map +1 -0
- package/dist/recipes/tools/index.d.ts +30 -0
- package/dist/recipes/tools/index.js +33 -0
- package/dist/recipes/tools/index.js.map +1 -0
- package/dist/recipes/tools/intercom.d.ts +6 -0
- package/dist/recipes/tools/intercom.js +226 -0
- package/dist/recipes/tools/intercom.js.map +1 -0
- package/dist/recipes/tools/jira.d.ts +14 -0
- package/dist/recipes/tools/jira.js +369 -0
- package/dist/recipes/tools/jira.js.map +1 -0
- package/dist/recipes/tools/linear.d.ts +7 -0
- package/dist/recipes/tools/linear.js +307 -0
- package/dist/recipes/tools/linear.js.map +1 -0
- package/dist/recipes/tools/meetingNotes.d.ts +21 -0
- package/dist/recipes/tools/meetingNotes.js +701 -0
- package/dist/recipes/tools/meetingNotes.js.map +1 -0
- package/dist/recipes/tools/notion.d.ts +6 -0
- package/dist/recipes/tools/notion.js +278 -0
- package/dist/recipes/tools/notion.js.map +1 -0
- package/dist/recipes/tools/pagerduty.d.ts +15 -0
- package/dist/recipes/tools/pagerduty.js +451 -0
- package/dist/recipes/tools/pagerduty.js.map +1 -0
- package/dist/recipes/tools/sentry.d.ts +12 -0
- package/dist/recipes/tools/sentry.js +73 -0
- package/dist/recipes/tools/sentry.js.map +1 -0
- package/dist/recipes/tools/slack.d.ts +6 -0
- package/dist/recipes/tools/slack.js +82 -0
- package/dist/recipes/tools/slack.js.map +1 -0
- package/dist/recipes/tools/stripe.d.ts +6 -0
- package/dist/recipes/tools/stripe.js +265 -0
- package/dist/recipes/tools/stripe.js.map +1 -0
- package/dist/recipes/tools/zendesk.d.ts +6 -0
- package/dist/recipes/tools/zendesk.js +245 -0
- package/dist/recipes/tools/zendesk.js.map +1 -0
- package/dist/recipes/validation.d.ts +13 -0
- package/dist/recipes/validation.js +617 -0
- package/dist/recipes/validation.js.map +1 -0
- package/dist/recipes/yamlRunner.d.ts +116 -1
- package/dist/recipes/yamlRunner.js +1000 -401
- package/dist/recipes/yamlRunner.js.map +1 -1
- package/dist/recipesHttp.d.ts +137 -6
- package/dist/recipesHttp.js +941 -29
- package/dist/recipesHttp.js.map +1 -1
- package/dist/riskTier.js +7 -1
- package/dist/riskTier.js.map +1 -1
- package/dist/runLog.d.ts +100 -1
- package/dist/runLog.js +258 -5
- package/dist/runLog.js.map +1 -1
- package/dist/schemas/dry-run-plan.v1.json +139 -0
- package/dist/schemas/recipe.v1.json +684 -0
- package/dist/server.d.ts +121 -8
- package/dist/server.js +538 -735
- package/dist/server.js.map +1 -1
- package/dist/ssrfGuard.d.ts +54 -0
- package/dist/ssrfGuard.js +122 -0
- package/dist/ssrfGuard.js.map +1 -0
- package/dist/streamableHttp.d.ts +39 -1
- package/dist/streamableHttp.js +128 -17
- package/dist/streamableHttp.js.map +1 -1
- package/dist/tokenUsageTracker.d.ts +33 -0
- package/dist/tokenUsageTracker.js +146 -0
- package/dist/tokenUsageTracker.js.map +1 -0
- package/dist/tools/activityLog.d.ts +2 -0
- package/dist/tools/addLinearComment.d.ts +1 -0
- package/dist/tools/addLinearComment.js +4 -2
- package/dist/tools/addLinearComment.js.map +1 -1
- package/dist/tools/batchLsp.d.ts +3 -0
- package/dist/tools/bridgeDoctor.d.ts +1 -0
- package/dist/tools/bridgeDoctor.js +2 -2
- package/dist/tools/bridgeDoctor.js.map +1 -1
- package/dist/tools/bridgeStatus.d.ts +1 -0
- package/dist/tools/cancelClaudeTask.d.ts +2 -0
- package/dist/tools/cancelClaudeTask.js +1 -0
- package/dist/tools/cancelClaudeTask.js.map +1 -1
- package/dist/tools/checkDocumentDirty.d.ts +1 -0
- package/dist/tools/clipboard.d.ts +2 -0
- package/dist/tools/closeTabs.d.ts +2 -0
- package/dist/tools/codeLens.d.ts +1 -0
- package/dist/tools/contextBundle.d.ts +1 -0
- package/dist/tools/createIssueFromAIComment.d.ts +1 -0
- package/dist/tools/createLinearIssue.d.ts +1 -0
- package/dist/tools/ctxGetTaskContext.d.ts +1 -0
- package/dist/tools/ctxQueryTraces.d.ts +1 -0
- package/dist/tools/ctxSaveTrace.d.ts +1 -0
- package/dist/tools/debug.d.ts +4 -0
- package/dist/tools/decorations.d.ts +2 -0
- package/dist/tools/documentLinks.d.ts +1 -0
- package/dist/tools/editText.d.ts +1 -0
- package/dist/tools/enrichCommit.d.ts +1 -0
- package/dist/tools/enrichStackTrace.d.ts +1 -0
- package/dist/tools/explainDiagnostic.d.ts +1 -0
- package/dist/tools/explainSymbol.d.ts +1 -0
- package/dist/tools/fetchCalendarEvents.d.ts +1 -0
- package/dist/tools/fetchGithubIssue.d.ts +1 -0
- package/dist/tools/fetchGithubPR.d.ts +1 -0
- package/dist/tools/fetchLinearIssue.d.ts +1 -0
- package/dist/tools/fetchSentryIssue.d.ts +1 -0
- package/dist/tools/fetchSlackProfile.d.ts +1 -0
- package/dist/tools/fetchSlackProfile.js +4 -1
- package/dist/tools/fetchSlackProfile.js.map +1 -1
- package/dist/tools/fileOperations.d.ts +3 -0
- package/dist/tools/fileWatcher.d.ts +2 -0
- package/dist/tools/findFiles.d.ts +1 -0
- package/dist/tools/findRelatedTests.d.ts +1 -0
- package/dist/tools/fixAllLintErrors.d.ts +1 -0
- package/dist/tools/foldingRanges.d.ts +1 -0
- package/dist/tools/formatDocument.d.ts +1 -0
- package/dist/tools/generateTests.d.ts +1 -0
- package/dist/tools/getAIComments.d.ts +1 -0
- package/dist/tools/getAnalyticsReport.d.ts +1 -0
- package/dist/tools/getArchitectureContext.d.ts +1 -0
- package/dist/tools/getBufferContent.d.ts +1 -0
- package/dist/tools/getChangeImpact.d.ts +1 -0
- package/dist/tools/getClaudeTaskStatus.d.ts +2 -0
- package/dist/tools/getClaudeTaskStatus.js +1 -0
- package/dist/tools/getClaudeTaskStatus.js.map +1 -1
- package/dist/tools/getCodeCoverage.d.ts +1 -0
- package/dist/tools/getCommitsForIssue.d.ts +1 -0
- package/dist/tools/getConnectorStatus.d.ts +1 -0
- package/dist/tools/getCurrentSelection.d.ts +2 -0
- package/dist/tools/getDebugState.d.ts +1 -0
- package/dist/tools/getDependencyTree.d.ts +1 -0
- package/dist/tools/getDiagnostics.d.ts +1 -0
- package/dist/tools/getDiffFromHandoff.d.ts +1 -0
- package/dist/tools/getDocumentSymbols.d.ts +25 -0
- package/dist/tools/getDocumentSymbols.js +74 -8
- package/dist/tools/getDocumentSymbols.js.map +1 -1
- package/dist/tools/getFileTree.d.ts +1 -0
- package/dist/tools/getGitDiff.d.ts +1 -0
- package/dist/tools/getGitHotspots.d.ts +1 -0
- package/dist/tools/getGitLog.d.ts +1 -0
- package/dist/tools/getGitStatus.d.ts +1 -0
- package/dist/tools/getImportTree.d.ts +1 -0
- package/dist/tools/getImportedSignatures.d.ts +1 -0
- package/dist/tools/getOpenEditors.d.ts +1 -0
- package/dist/tools/getPRTemplate.d.ts +1 -0
- package/dist/tools/getProjectContext.d.ts +1 -0
- package/dist/tools/getProjectInfo.d.ts +1 -0
- package/dist/tools/getSecurityAdvisories.d.ts +1 -0
- package/dist/tools/getSecurityAdvisories.js +10 -1
- package/dist/tools/getSecurityAdvisories.js.map +1 -1
- package/dist/tools/getSessionUsage.d.ts +4 -0
- package/dist/tools/getSessionUsage.js +3 -0
- package/dist/tools/getSessionUsage.js.map +1 -1
- package/dist/tools/getSymbolHistory.d.ts +1 -0
- package/dist/tools/getToolCapabilities.d.ts +1 -0
- package/dist/tools/getTypeSignature.d.ts +1 -0
- package/dist/tools/getWorkspaceFolders.d.ts +1 -0
- package/dist/tools/getWorkspaceSettings.d.ts +1 -0
- package/dist/tools/gitHistory.d.ts +2 -0
- package/dist/tools/gitWrite.d.ts +11 -0
- package/dist/tools/github/actions.d.ts +2 -0
- package/dist/tools/github/actions.js +4 -2
- package/dist/tools/github/actions.js.map +1 -1
- package/dist/tools/github/composite.d.ts +342 -0
- package/dist/tools/github/composite.js +343 -0
- package/dist/tools/github/composite.js.map +1 -0
- package/dist/tools/github/index.d.ts +1 -0
- package/dist/tools/github/index.js +1 -0
- package/dist/tools/github/index.js.map +1 -1
- package/dist/tools/github/issues.d.ts +4 -0
- package/dist/tools/github/issues.js +8 -4
- package/dist/tools/github/issues.js.map +1 -1
- package/dist/tools/github/pr.d.ts +7 -0
- package/dist/tools/github/pr.js +50 -12
- package/dist/tools/github/pr.js.map +1 -1
- package/dist/tools/handoffNote.d.ts +4 -0
- package/dist/tools/handoffNote.js +2 -0
- package/dist/tools/handoffNote.js.map +1 -1
- package/dist/tools/hoverAtCursor.d.ts +1 -0
- package/dist/tools/httpClient.d.ts +2 -0
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.js +47 -8
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/inlayHints.d.ts +1 -0
- package/dist/tools/launchQuickTask.d.ts +2 -0
- package/dist/tools/launchQuickTask.js +1 -0
- package/dist/tools/launchQuickTask.js.map +1 -1
- package/dist/tools/listClaudeTasks.d.ts +2 -0
- package/dist/tools/listClaudeTasks.js +1 -0
- package/dist/tools/listClaudeTasks.js.map +1 -1
- package/dist/tools/listTerminals.d.ts +1 -0
- package/dist/tools/lsp.d.ts +14 -0
- package/dist/tools/navigateToSymbolByName.d.ts +1 -0
- package/dist/tools/openDiff.d.ts +1 -0
- package/dist/tools/openFile.d.ts +1 -0
- package/dist/tools/openInBrowser.d.ts +1 -0
- package/dist/tools/organizeImports.d.ts +1 -0
- package/dist/tools/performanceReport.d.ts +1 -0
- package/dist/tools/planPersistence.d.ts +5 -0
- package/dist/tools/previewEdit.d.ts +1 -0
- package/dist/tools/refactorAnalyze.d.ts +1 -0
- package/dist/tools/refactorPreview.d.ts +2 -0
- package/dist/tools/refactorPreview.js +1 -0
- package/dist/tools/refactorPreview.js.map +1 -1
- package/dist/tools/replaceBlock.d.ts +1 -0
- package/dist/tools/resumeClaudeTask.d.ts +2 -0
- package/dist/tools/resumeClaudeTask.js +1 -0
- package/dist/tools/resumeClaudeTask.js.map +1 -1
- package/dist/tools/runClaudeTask.d.ts +2 -0
- package/dist/tools/runClaudeTask.js +1 -0
- package/dist/tools/runClaudeTask.js.map +1 -1
- package/dist/tools/runCommand.d.ts +1 -0
- package/dist/tools/runTests.d.ts +1 -0
- package/dist/tools/saveDocument.d.ts +1 -0
- package/dist/tools/screenshotAndAnnotate.d.ts +1 -0
- package/dist/tools/searchAndReplace.d.ts +1 -0
- package/dist/tools/searchTools.d.ts +1 -0
- package/dist/tools/searchTools.js +1 -1
- package/dist/tools/searchTools.js.map +1 -1
- package/dist/tools/searchWorkspace.d.ts +1 -0
- package/dist/tools/selectionRanges.d.ts +1 -0
- package/dist/tools/semanticTokens.d.ts +1 -0
- package/dist/tools/setActiveWorkspaceFolder.d.ts +1 -0
- package/dist/tools/signatureHelp.d.ts +1 -0
- package/dist/tools/slackListChannels.d.ts +1 -0
- package/dist/tools/slackListChannels.js.map +1 -1
- package/dist/tools/slackPostMessage.d.ts +1 -0
- package/dist/tools/slackPostMessage.js +11 -6
- package/dist/tools/slackPostMessage.js.map +1 -1
- package/dist/tools/terminal.d.ts +6 -0
- package/dist/tools/testTraceToSource.d.ts +1 -0
- package/dist/tools/testTraceToSource.js +2 -2
- package/dist/tools/testTraceToSource.js.map +1 -1
- package/dist/tools/transaction.d.ts +23 -0
- package/dist/tools/transaction.js +29 -0
- package/dist/tools/transaction.js.map +1 -1
- package/dist/tools/typeHierarchy.d.ts +1 -0
- package/dist/tools/updateLinearIssue.d.ts +1 -0
- package/dist/tools/updateLinearIssue.js +20 -6
- package/dist/tools/updateLinearIssue.js.map +1 -1
- package/dist/tools/utils.d.ts +2 -0
- package/dist/tools/utils.js.map +1 -1
- package/dist/tools/vscodeCommands.d.ts +2 -0
- package/dist/tools/vscodeTasks.d.ts +2 -0
- package/dist/tools/workspaceSettings.d.ts +1 -0
- package/dist/traceEncryption.d.ts +46 -0
- package/dist/traceEncryption.js +124 -0
- package/dist/traceEncryption.js.map +1 -0
- package/dist/transport.d.ts +46 -1
- package/dist/transport.js +173 -19
- package/dist/transport.js.map +1 -1
- package/package.json +30 -8
- package/scripts/mcp-stdio-shim.cjs +19 -3
- package/scripts/start-all.sh +30 -1
- package/templates/automation-policies/recipe-authoring.json +25 -0
- package/templates/automation-policy.example.json +6 -0
- package/templates/co.patchwork-os.bridge.plist +34 -0
- package/templates/policies/README.md +72 -0
- package/templates/policies/conservative.json +14 -0
- package/templates/policies/developer.json +14 -0
- package/templates/policies/headless-ci.json +24 -0
- package/templates/policies/personal-assistant.json +15 -0
- package/templates/policies/regulated-industry.json +18 -0
- package/templates/recipes/lint-on-save.yaml +1 -2
- package/templates/recipes/morning-brief-slack.yaml +57 -0
- package/templates/recipes/morning-brief.yaml +2 -2
- package/templates/recipes/project-health-check.yaml +50 -0
- package/templates/recipes/webhook/README.md +70 -0
- package/templates/recipes/webhook/capture-thought.yaml +26 -0
- package/templates/recipes/webhook/customer-escalation.yaml +49 -0
- package/templates/recipes/webhook/incident-intake.yaml +46 -0
- package/templates/recipes/webhook/meeting-prep.yaml +48 -0
- package/templates/recipes/webhook/morning-brief.yaml +57 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discord tools — wrappers for guilds, channels, messages, user, and send.
|
|
3
|
+
*
|
|
4
|
+
* Self-registering tool module for the recipe tool registry. Read tools wrap
|
|
5
|
+
* connector throws into the `{count, items, error}` shape; the write tool
|
|
6
|
+
* (`discord.send_message`) returns the single-object `{ok, ..., error?}` shape
|
|
7
|
+
* and is gated through the approval queue (`isWrite: true`).
|
|
8
|
+
*
|
|
9
|
+
* Each tool wraps connector throws into the `{count, items, error}` shape that
|
|
10
|
+
* the runner's silent-fail detector (PR #75) catches as a step error rather
|
|
11
|
+
* than a silent empty list.
|
|
12
|
+
*
|
|
13
|
+
* NOTE on `discord.send_message`: Discord's REST API only accepts message
|
|
14
|
+
* sends from bot-scope OAuth tokens. The connector currently uses user-scope
|
|
15
|
+
* (identify/guilds/messages.read), so the underlying call will surface a
|
|
16
|
+
* `permission_denied` error until operators re-auth with the bot scope.
|
|
17
|
+
*/
|
|
18
|
+
import { CommonSchemas, registerTool } from "../toolRegistry.js";
|
|
19
|
+
// ============================================================================
|
|
20
|
+
// discord.get_current_user
|
|
21
|
+
// ============================================================================
|
|
22
|
+
registerTool({
|
|
23
|
+
id: "discord.get_current_user",
|
|
24
|
+
namespace: "discord",
|
|
25
|
+
description: "Fetch the authenticated Discord user (username, id, discriminator).",
|
|
26
|
+
paramsSchema: {
|
|
27
|
+
type: "object",
|
|
28
|
+
properties: {
|
|
29
|
+
into: CommonSchemas.into,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
outputSchema: {
|
|
33
|
+
type: "object",
|
|
34
|
+
properties: {
|
|
35
|
+
count: { type: "number" },
|
|
36
|
+
items: { type: "array", items: { type: "object" } },
|
|
37
|
+
error: { type: "string" },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
riskDefault: "low",
|
|
41
|
+
isWrite: false,
|
|
42
|
+
isConnector: true,
|
|
43
|
+
execute: async () => {
|
|
44
|
+
const { getDiscordConnector } = await import("../../connectors/discord.js");
|
|
45
|
+
try {
|
|
46
|
+
const connector = getDiscordConnector();
|
|
47
|
+
const user = await connector.getCurrentUser();
|
|
48
|
+
return JSON.stringify({ count: 1, items: [user] });
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
return JSON.stringify({
|
|
52
|
+
count: 0,
|
|
53
|
+
items: [],
|
|
54
|
+
error: err instanceof Error ? err.message : String(err),
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
// ============================================================================
|
|
60
|
+
// discord.list_guilds
|
|
61
|
+
// ============================================================================
|
|
62
|
+
registerTool({
|
|
63
|
+
id: "discord.list_guilds",
|
|
64
|
+
namespace: "discord",
|
|
65
|
+
description: "List Discord guilds (servers) the authenticated user belongs to.",
|
|
66
|
+
paramsSchema: {
|
|
67
|
+
type: "object",
|
|
68
|
+
properties: {
|
|
69
|
+
max: CommonSchemas.max,
|
|
70
|
+
into: CommonSchemas.into,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
outputSchema: {
|
|
74
|
+
type: "object",
|
|
75
|
+
properties: {
|
|
76
|
+
count: { type: "number" },
|
|
77
|
+
items: { type: "array", items: { type: "object" } },
|
|
78
|
+
error: { type: "string" },
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
riskDefault: "low",
|
|
82
|
+
isWrite: false,
|
|
83
|
+
isConnector: true,
|
|
84
|
+
execute: async ({ params }) => {
|
|
85
|
+
const { getDiscordConnector } = await import("../../connectors/discord.js");
|
|
86
|
+
const limit = typeof params.max === "number" ? params.max : 100;
|
|
87
|
+
try {
|
|
88
|
+
const connector = getDiscordConnector();
|
|
89
|
+
const guilds = await connector.listGuilds({ limit });
|
|
90
|
+
return JSON.stringify({ count: guilds.length, items: guilds });
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
return JSON.stringify({
|
|
94
|
+
count: 0,
|
|
95
|
+
items: [],
|
|
96
|
+
error: err instanceof Error ? err.message : String(err),
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
// ============================================================================
|
|
102
|
+
// discord.list_channels
|
|
103
|
+
// ============================================================================
|
|
104
|
+
registerTool({
|
|
105
|
+
id: "discord.list_channels",
|
|
106
|
+
namespace: "discord",
|
|
107
|
+
description: "List text channels in a Discord guild (filters out voice / category / threads).",
|
|
108
|
+
paramsSchema: {
|
|
109
|
+
type: "object",
|
|
110
|
+
properties: {
|
|
111
|
+
guildId: {
|
|
112
|
+
type: "string",
|
|
113
|
+
description: "Discord guild (server) id",
|
|
114
|
+
},
|
|
115
|
+
into: CommonSchemas.into,
|
|
116
|
+
},
|
|
117
|
+
required: ["guildId"],
|
|
118
|
+
},
|
|
119
|
+
outputSchema: {
|
|
120
|
+
type: "object",
|
|
121
|
+
properties: {
|
|
122
|
+
count: { type: "number" },
|
|
123
|
+
items: { type: "array", items: { type: "object" } },
|
|
124
|
+
error: { type: "string" },
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
riskDefault: "low",
|
|
128
|
+
isWrite: false,
|
|
129
|
+
isConnector: true,
|
|
130
|
+
execute: async ({ params }) => {
|
|
131
|
+
const { getDiscordConnector } = await import("../../connectors/discord.js");
|
|
132
|
+
try {
|
|
133
|
+
const connector = getDiscordConnector();
|
|
134
|
+
const channels = await connector.listChannels(params.guildId);
|
|
135
|
+
return JSON.stringify({ count: channels.length, items: channels });
|
|
136
|
+
}
|
|
137
|
+
catch (err) {
|
|
138
|
+
return JSON.stringify({
|
|
139
|
+
count: 0,
|
|
140
|
+
items: [],
|
|
141
|
+
error: err instanceof Error ? err.message : String(err),
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
// ============================================================================
|
|
147
|
+
// discord.list_messages
|
|
148
|
+
// ============================================================================
|
|
149
|
+
registerTool({
|
|
150
|
+
id: "discord.list_messages",
|
|
151
|
+
namespace: "discord",
|
|
152
|
+
description: "List recent messages in a Discord channel (newest first).",
|
|
153
|
+
paramsSchema: {
|
|
154
|
+
type: "object",
|
|
155
|
+
properties: {
|
|
156
|
+
channelId: {
|
|
157
|
+
type: "string",
|
|
158
|
+
description: "Discord channel id",
|
|
159
|
+
},
|
|
160
|
+
max: CommonSchemas.max,
|
|
161
|
+
into: CommonSchemas.into,
|
|
162
|
+
},
|
|
163
|
+
required: ["channelId"],
|
|
164
|
+
},
|
|
165
|
+
outputSchema: {
|
|
166
|
+
type: "object",
|
|
167
|
+
properties: {
|
|
168
|
+
count: { type: "number" },
|
|
169
|
+
items: { type: "array", items: { type: "object" } },
|
|
170
|
+
error: { type: "string" },
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
riskDefault: "low",
|
|
174
|
+
isWrite: false,
|
|
175
|
+
isConnector: true,
|
|
176
|
+
execute: async ({ params }) => {
|
|
177
|
+
const { getDiscordConnector } = await import("../../connectors/discord.js");
|
|
178
|
+
const limit = typeof params.max === "number" ? params.max : 50;
|
|
179
|
+
try {
|
|
180
|
+
const connector = getDiscordConnector();
|
|
181
|
+
const messages = await connector.listMessages(params.channelId, { limit });
|
|
182
|
+
return JSON.stringify({ count: messages.length, items: messages });
|
|
183
|
+
}
|
|
184
|
+
catch (err) {
|
|
185
|
+
return JSON.stringify({
|
|
186
|
+
count: 0,
|
|
187
|
+
items: [],
|
|
188
|
+
error: err instanceof Error ? err.message : String(err),
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
});
|
|
193
|
+
// ============================================================================
|
|
194
|
+
// discord.send_message (write-gated)
|
|
195
|
+
// ============================================================================
|
|
196
|
+
registerTool({
|
|
197
|
+
id: "discord.send_message",
|
|
198
|
+
namespace: "discord",
|
|
199
|
+
description: "Send a message to a Discord channel. Requires bot-scope OAuth — user-context tokens will fail with permission_denied.",
|
|
200
|
+
paramsSchema: {
|
|
201
|
+
type: "object",
|
|
202
|
+
properties: {
|
|
203
|
+
channel_id: { type: "string", description: "Discord channel id" },
|
|
204
|
+
content: {
|
|
205
|
+
type: "string",
|
|
206
|
+
description: "Message content (≤2000 chars)",
|
|
207
|
+
},
|
|
208
|
+
tts: {
|
|
209
|
+
type: "boolean",
|
|
210
|
+
description: "Send as text-to-speech (default false)",
|
|
211
|
+
},
|
|
212
|
+
into: CommonSchemas.into,
|
|
213
|
+
},
|
|
214
|
+
required: ["channel_id", "content"],
|
|
215
|
+
},
|
|
216
|
+
outputSchema: {
|
|
217
|
+
type: "object",
|
|
218
|
+
properties: {
|
|
219
|
+
ok: { type: "boolean" },
|
|
220
|
+
id: { type: "string" },
|
|
221
|
+
channel_id: { type: "string" },
|
|
222
|
+
content: { type: "string" },
|
|
223
|
+
timestamp: { type: "string" },
|
|
224
|
+
error: { type: "string" },
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
riskDefault: "medium",
|
|
228
|
+
isWrite: true,
|
|
229
|
+
isConnector: true,
|
|
230
|
+
execute: async ({ params }) => {
|
|
231
|
+
const { getDiscordConnector } = await import("../../connectors/discord.js");
|
|
232
|
+
try {
|
|
233
|
+
const connector = getDiscordConnector();
|
|
234
|
+
const message = await connector.sendMessage(params.channel_id, {
|
|
235
|
+
content: params.content,
|
|
236
|
+
tts: typeof params.tts === "boolean" ? params.tts : undefined,
|
|
237
|
+
});
|
|
238
|
+
return JSON.stringify({
|
|
239
|
+
ok: true,
|
|
240
|
+
id: message.id,
|
|
241
|
+
channel_id: message.channel_id,
|
|
242
|
+
content: message.content,
|
|
243
|
+
timestamp: message.timestamp,
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
catch (err) {
|
|
247
|
+
return JSON.stringify({
|
|
248
|
+
ok: false,
|
|
249
|
+
error: err instanceof Error ? err.message : String(err),
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
//# sourceMappingURL=discord.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discord.js","sourceRoot":"","sources":["../../../src/recipes/tools/discord.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEjE,+EA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,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;aACxD,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File tools — file.read, file.write, file.append
|
|
3
|
+
*
|
|
4
|
+
* Self-registering tool module for the recipe tool registry.
|
|
5
|
+
*
|
|
6
|
+
* Path containment is enforced via `resolveRecipePath` (see
|
|
7
|
+
* `../resolveRecipePath.ts`) — every path passed in by a recipe is
|
|
8
|
+
* normalized, symlink-resolved, and asserted inside the recipe jail
|
|
9
|
+
* roots before any FS call. Closes G-security F-01 / F-02 / F-10 + R2
|
|
10
|
+
* C-1.
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File tools — file.read, file.write, file.append
|
|
3
|
+
*
|
|
4
|
+
* Self-registering tool module for the recipe tool registry.
|
|
5
|
+
*
|
|
6
|
+
* Path containment is enforced via `resolveRecipePath` (see
|
|
7
|
+
* `../resolveRecipePath.ts`) — every path passed in by a recipe is
|
|
8
|
+
* normalized, symlink-resolved, and asserted inside the recipe jail
|
|
9
|
+
* roots before any FS call. Closes G-security F-01 / F-02 / F-10 + R2
|
|
10
|
+
* C-1.
|
|
11
|
+
*/
|
|
12
|
+
import { existsSync, mkdirSync } from "node:fs";
|
|
13
|
+
import { dirname } from "node:path";
|
|
14
|
+
import { assertWriteAllowed } from "../../featureFlags.js";
|
|
15
|
+
import { resolveRecipePath } from "../resolveRecipePath.js";
|
|
16
|
+
import { CommonSchemas, registerTool } from "../toolRegistry.js";
|
|
17
|
+
function jailedPath(p, workspace, write) {
|
|
18
|
+
return resolveRecipePath(p, { workspace, write });
|
|
19
|
+
}
|
|
20
|
+
function ensureDir(p) {
|
|
21
|
+
const dir = dirname(p);
|
|
22
|
+
if (dir && dir !== "." && !existsSync(dir)) {
|
|
23
|
+
mkdirSync(dir, { recursive: true });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
// ============================================================================
|
|
27
|
+
// file.read
|
|
28
|
+
// ============================================================================
|
|
29
|
+
registerTool({
|
|
30
|
+
id: "file.read",
|
|
31
|
+
namespace: "file",
|
|
32
|
+
description: "Read file content into context. Supports optional flag to allow missing files.",
|
|
33
|
+
paramsSchema: {
|
|
34
|
+
type: "object",
|
|
35
|
+
properties: {
|
|
36
|
+
path: CommonSchemas.filePath,
|
|
37
|
+
optional: CommonSchemas.optional,
|
|
38
|
+
into: CommonSchemas.into,
|
|
39
|
+
},
|
|
40
|
+
required: ["path"],
|
|
41
|
+
},
|
|
42
|
+
outputSchema: {
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "File content as string (or empty if optional and missing)",
|
|
45
|
+
},
|
|
46
|
+
riskDefault: "low",
|
|
47
|
+
isWrite: false,
|
|
48
|
+
execute: async ({ params, step, deps }) => {
|
|
49
|
+
const p = jailedPath(params.path, deps.workdir, false);
|
|
50
|
+
const optional = step.optional ?? false;
|
|
51
|
+
try {
|
|
52
|
+
return deps.readFile(p);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
if (optional)
|
|
56
|
+
return "";
|
|
57
|
+
throw new Error(`file.read: could not read ${p}`);
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
// ============================================================================
|
|
62
|
+
// file.write
|
|
63
|
+
// ============================================================================
|
|
64
|
+
registerTool({
|
|
65
|
+
id: "file.write",
|
|
66
|
+
namespace: "file",
|
|
67
|
+
description: "Write content to a file path (creates directories as needed).",
|
|
68
|
+
paramsSchema: {
|
|
69
|
+
type: "object",
|
|
70
|
+
properties: {
|
|
71
|
+
path: CommonSchemas.filePath,
|
|
72
|
+
content: {
|
|
73
|
+
type: "string",
|
|
74
|
+
description: "Content to write (supports {{template}} substitution)",
|
|
75
|
+
},
|
|
76
|
+
into: CommonSchemas.into,
|
|
77
|
+
},
|
|
78
|
+
required: ["path", "content"],
|
|
79
|
+
},
|
|
80
|
+
outputSchema: {
|
|
81
|
+
type: "object",
|
|
82
|
+
properties: {
|
|
83
|
+
path: { type: "string" },
|
|
84
|
+
bytesWritten: { type: "number" },
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
riskDefault: "medium",
|
|
88
|
+
isWrite: true,
|
|
89
|
+
execute: async ({ params, deps }) => {
|
|
90
|
+
assertWriteAllowed("file.write");
|
|
91
|
+
const p = jailedPath(params.path, deps.workdir, true);
|
|
92
|
+
const content = params.content;
|
|
93
|
+
ensureDir(p);
|
|
94
|
+
deps.writeFile(p, content);
|
|
95
|
+
return JSON.stringify({ path: p, bytesWritten: content.length });
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
// ============================================================================
|
|
99
|
+
// file.append
|
|
100
|
+
// ============================================================================
|
|
101
|
+
registerTool({
|
|
102
|
+
id: "file.append",
|
|
103
|
+
namespace: "file",
|
|
104
|
+
description: "Append content to a file (creates if missing). Supports conditional 'when' clause.",
|
|
105
|
+
paramsSchema: {
|
|
106
|
+
type: "object",
|
|
107
|
+
properties: {
|
|
108
|
+
path: CommonSchemas.filePath,
|
|
109
|
+
content: {
|
|
110
|
+
type: "string",
|
|
111
|
+
description: "Content to append (supports {{template}} substitution)",
|
|
112
|
+
},
|
|
113
|
+
when: CommonSchemas.when,
|
|
114
|
+
into: CommonSchemas.into,
|
|
115
|
+
},
|
|
116
|
+
required: ["path", "content"],
|
|
117
|
+
},
|
|
118
|
+
outputSchema: {
|
|
119
|
+
type: "object",
|
|
120
|
+
properties: {
|
|
121
|
+
path: { type: "string" },
|
|
122
|
+
bytesAppended: { type: "number" },
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
riskDefault: "medium",
|
|
126
|
+
isWrite: true,
|
|
127
|
+
execute: async ({ params, step, deps }) => {
|
|
128
|
+
assertWriteAllowed("file.append");
|
|
129
|
+
const p = jailedPath(params.path, deps.workdir, true);
|
|
130
|
+
const content = params.content;
|
|
131
|
+
// 'when' condition is evaluated before executeStep is called in yamlRunner
|
|
132
|
+
// but we check here too for direct registry usage
|
|
133
|
+
const when = step.when;
|
|
134
|
+
if (when && !evalCondition(when, {})) {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
ensureDir(p);
|
|
138
|
+
deps.appendFile(p, content);
|
|
139
|
+
return JSON.stringify({ path: p, bytesAppended: content.length });
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
/**
|
|
143
|
+
* Minimal condition evaluator for 'when' clauses.
|
|
144
|
+
* Note: yamlRunner.ts has a more complete evalWhen that runs before executeStep.
|
|
145
|
+
* This is a fallback for direct registry usage.
|
|
146
|
+
*/
|
|
147
|
+
function evalCondition(expr, _ctx) {
|
|
148
|
+
// Simple numeric comparisons: "N > 0"
|
|
149
|
+
const match = expr.match(/^\s*(\w+)\s*([><=!]+)\s*(\d+)\s*$/);
|
|
150
|
+
if (match) {
|
|
151
|
+
const [, _var, op, val] = match;
|
|
152
|
+
if (!op || !val)
|
|
153
|
+
return false;
|
|
154
|
+
const num = 0; // Would resolve from ctx in full implementation
|
|
155
|
+
const cmp = parseInt(val, 10);
|
|
156
|
+
switch (op) {
|
|
157
|
+
case ">":
|
|
158
|
+
return num > cmp;
|
|
159
|
+
case ">=":
|
|
160
|
+
return num >= cmp;
|
|
161
|
+
case "<":
|
|
162
|
+
return num < cmp;
|
|
163
|
+
case "<=":
|
|
164
|
+
return num <= cmp;
|
|
165
|
+
case "==":
|
|
166
|
+
return num === cmp;
|
|
167
|
+
case "!=":
|
|
168
|
+
return num !== cmp;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
// Default: evaluate truthy
|
|
172
|
+
return expr.length > 0;
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.js","sourceRoot":"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G,KAAK,GAAG,CAAC;YACrB,KAAK,IAAI;gBACP,OAAO,GAAG,KAAK,GAAG,CAAC;QACvB,CAAC;IACH,CAAC;IACD,2BAA2B;IAC3B,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git tools — git.log_since, git.stale_branches
|
|
3
|
+
*
|
|
4
|
+
* Self-registering tool module for the recipe tool registry.
|
|
5
|
+
*/
|
|
6
|
+
import { CommonSchemas, registerTool } from "../toolRegistry.js";
|
|
7
|
+
// ============================================================================
|
|
8
|
+
// git.log_since
|
|
9
|
+
// ============================================================================
|
|
10
|
+
registerTool({
|
|
11
|
+
id: "git.log_since",
|
|
12
|
+
namespace: "git",
|
|
13
|
+
description: "Get git log since a time expression (e.g., '24h', '7d', '2026-01-01').",
|
|
14
|
+
paramsSchema: {
|
|
15
|
+
type: "object",
|
|
16
|
+
properties: {
|
|
17
|
+
since: CommonSchemas.since,
|
|
18
|
+
into: CommonSchemas.into,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
outputSchema: {
|
|
22
|
+
type: "string",
|
|
23
|
+
description: "Git log output as newline-separated commits",
|
|
24
|
+
},
|
|
25
|
+
riskDefault: "low",
|
|
26
|
+
isWrite: false,
|
|
27
|
+
execute: async ({ params, deps }) => {
|
|
28
|
+
const since = params.since ?? "24h";
|
|
29
|
+
// Use injected gitLogSince for testability
|
|
30
|
+
return deps.gitLogSince(since, deps.workdir);
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
// ============================================================================
|
|
34
|
+
// git.stale_branches
|
|
35
|
+
// ============================================================================
|
|
36
|
+
registerTool({
|
|
37
|
+
id: "git.stale_branches",
|
|
38
|
+
namespace: "git",
|
|
39
|
+
description: "List branches with no activity in N days.",
|
|
40
|
+
paramsSchema: {
|
|
41
|
+
type: "object",
|
|
42
|
+
properties: {
|
|
43
|
+
days: {
|
|
44
|
+
type: "number",
|
|
45
|
+
description: "Number of days of inactivity to consider stale",
|
|
46
|
+
default: 30,
|
|
47
|
+
},
|
|
48
|
+
into: CommonSchemas.into,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
outputSchema: {
|
|
52
|
+
type: "string",
|
|
53
|
+
description: "List of stale branches with last commit dates",
|
|
54
|
+
},
|
|
55
|
+
riskDefault: "low",
|
|
56
|
+
isWrite: false,
|
|
57
|
+
execute: async ({ params, deps }) => {
|
|
58
|
+
const days = typeof params.days === "number" ? params.days : 30;
|
|
59
|
+
// Use injected gitStaleBranches for testability
|
|
60
|
+
return deps.gitStaleBranches(days, deps.workdir);
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=git.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../../src/recipes/tools/git.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEjE,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAE/E,YAAY,CAAC;IACX,EAAE,EAAE,eAAe;IACnB,SAAS,EAAE,KAAK;IAChB,WAAW,EACT,wEAAwE;IAC1E,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE,aAAa,CAAC,KAAK;YAC1B,IAAI,EAAE,aAAa,CAAC,IAAI;SACzB;KACF;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,6CAA6C;KAC3D;IACD,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;QAClC,MAAM,KAAK,GAAI,MAAM,CAAC,KAAgB,IAAI,KAAK,CAAC;QAChD,2CAA2C;QAC3C,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;CACF,CAAC,CAAC;AAEH,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E,YAAY,CAAC;IACX,EAAE,EAAE,oBAAoB;IACxB,SAAS,EAAE,KAAK;IAChB,WAAW,EAAE,2CAA2C;IACxD,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gDAAgD;gBAC7D,OAAO,EAAE,EAAE;aACZ;YACD,IAAI,EAAE,aAAa,CAAC,IAAI;SACzB;KACF;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,+CAA+C;KAC7D;IACD,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;QAClC,MAAM,IAAI,GAAG,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAChE,gDAAgD;QAChD,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub tools — github.list_issues, github.list_prs
|
|
3
|
+
*
|
|
4
|
+
* Self-registering tool module for the recipe tool registry.
|
|
5
|
+
*/
|
|
6
|
+
import { CommonSchemas, registerTool } from "../toolRegistry.js";
|
|
7
|
+
// ============================================================================
|
|
8
|
+
// github.list_issues
|
|
9
|
+
// ============================================================================
|
|
10
|
+
registerTool({
|
|
11
|
+
id: "github.list_issues",
|
|
12
|
+
namespace: "github",
|
|
13
|
+
description: "List GitHub issues assigned to a user or matching filters.",
|
|
14
|
+
paramsSchema: {
|
|
15
|
+
type: "object",
|
|
16
|
+
properties: {
|
|
17
|
+
repo: {
|
|
18
|
+
type: "string",
|
|
19
|
+
description: "Repository in 'owner/repo' format (omit for all accessible repos)",
|
|
20
|
+
},
|
|
21
|
+
assignee: {
|
|
22
|
+
type: "string",
|
|
23
|
+
description: "User to filter by (use '@me' for current user)",
|
|
24
|
+
default: "@me",
|
|
25
|
+
},
|
|
26
|
+
max: CommonSchemas.max,
|
|
27
|
+
into: CommonSchemas.into,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
outputSchema: {
|
|
31
|
+
type: "object",
|
|
32
|
+
properties: {
|
|
33
|
+
count: { type: "number" },
|
|
34
|
+
issues: { type: "array" },
|
|
35
|
+
error: { type: "string" },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
riskDefault: "low",
|
|
39
|
+
isWrite: false,
|
|
40
|
+
isConnector: true,
|
|
41
|
+
execute: async ({ params }) => {
|
|
42
|
+
const { listIssues } = await import("../../connectors/github.js");
|
|
43
|
+
const repo = params.repo ? String(params.repo) : undefined;
|
|
44
|
+
const assignee = params.assignee ? String(params.assignee) : "@me";
|
|
45
|
+
const limit = typeof params.max === "number" ? params.max : 20;
|
|
46
|
+
try {
|
|
47
|
+
const issues = await listIssues({ repo, assignee, limit });
|
|
48
|
+
return JSON.stringify({ count: issues.length, issues });
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
// Translate connector throw into the {count:0, items:[], error}
|
|
52
|
+
// shape that the runner's silent-fail detector (PR #72) catches
|
|
53
|
+
// as a step error. Pre-fix this just propagated as a thrown
|
|
54
|
+
// error which the runner caught fine — but the connector
|
|
55
|
+
// itself used to silently `[]`-swallow all failures.
|
|
56
|
+
return JSON.stringify({
|
|
57
|
+
count: 0,
|
|
58
|
+
issues: [],
|
|
59
|
+
error: err instanceof Error ? err.message : String(err),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
// ============================================================================
|
|
65
|
+
// github.list_prs
|
|
66
|
+
// ============================================================================
|
|
67
|
+
registerTool({
|
|
68
|
+
id: "github.list_prs",
|
|
69
|
+
namespace: "github",
|
|
70
|
+
description: "List GitHub pull requests authored by or involving a user.",
|
|
71
|
+
paramsSchema: {
|
|
72
|
+
type: "object",
|
|
73
|
+
properties: {
|
|
74
|
+
repo: {
|
|
75
|
+
type: "string",
|
|
76
|
+
description: "Repository in 'owner/repo' format (omit for all accessible repos)",
|
|
77
|
+
},
|
|
78
|
+
author: {
|
|
79
|
+
type: "string",
|
|
80
|
+
description: "Author to filter by (use '@me' for current user)",
|
|
81
|
+
default: "@me",
|
|
82
|
+
},
|
|
83
|
+
max: CommonSchemas.max,
|
|
84
|
+
into: CommonSchemas.into,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
outputSchema: {
|
|
88
|
+
type: "object",
|
|
89
|
+
properties: {
|
|
90
|
+
count: { type: "number" },
|
|
91
|
+
prs: { type: "array" },
|
|
92
|
+
error: { type: "string" },
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
riskDefault: "low",
|
|
96
|
+
isWrite: false,
|
|
97
|
+
isConnector: true,
|
|
98
|
+
execute: async ({ params }) => {
|
|
99
|
+
const { listPRs } = await import("../../connectors/github.js");
|
|
100
|
+
const repo = params.repo ? String(params.repo) : undefined;
|
|
101
|
+
const author = params.author ? String(params.author) : "@me";
|
|
102
|
+
const limit = typeof params.max === "number" ? params.max : 20;
|
|
103
|
+
try {
|
|
104
|
+
const prs = await listPRs({ repo, author, limit });
|
|
105
|
+
return JSON.stringify({ count: prs.length, prs });
|
|
106
|
+
}
|
|
107
|
+
catch (err) {
|
|
108
|
+
return JSON.stringify({
|
|
109
|
+
count: 0,
|
|
110
|
+
prs: [],
|
|
111
|
+
error: err instanceof Error ? err.message : String(err),
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
//# sourceMappingURL=github.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github.js","sourceRoot":"","sources":["../../../src/recipes/tools/github.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEjE,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E,YAAY,CAAC;IACX,EAAE,EAAE,oBAAoB;IACxB,SAAS,EAAE,QAAQ;IACnB,WAAW,EAAE,4DAA4D;IACzE,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,mEAAmE;aACtE;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gDAAgD;gBAC7D,OAAO,EAAE,KAAK;aACf;YACD,GAAG,EAAE,aAAa,CAAC,GAAG;YACtB,IAAI,EAAE,aAAa,CAAC,IAAI;SACzB;KACF;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACzB,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;YACzB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC1B;KACF;IACD,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,KAAK;IACd,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QAC5B,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,4BAA4B,CAAC,CAAC;QAClE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3D,MA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