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
|
@@ -3,29 +3,50 @@ import { homedir } from "node:os";
|
|
|
3
3
|
import { dirname, join, resolve } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { loadConfig, saveConfig, } from "../patchworkConfig.js";
|
|
6
|
+
import { registerPreToolUseHook } from "../preToolUseHook.js";
|
|
6
7
|
function parseArgs(argv) {
|
|
7
8
|
if (argv.includes("--help") || argv.includes("-h"))
|
|
8
9
|
return { help: true };
|
|
9
10
|
return {
|
|
10
11
|
force: argv.includes("--force"),
|
|
11
12
|
skipOllama: argv.includes("--no-ollama"),
|
|
13
|
+
withConnectors: argv.includes("--with-connectors"),
|
|
12
14
|
};
|
|
13
15
|
}
|
|
16
|
+
// Recipes that run with no external service credentials (local file/git only).
|
|
17
|
+
// Anything not in this set requires a connector (gmail, github, linear, slack,
|
|
18
|
+
// sentry, calendar, …) and is skipped on first init unless --with-connectors.
|
|
19
|
+
const LOCAL_ONLY_RECIPES = new Set([
|
|
20
|
+
"ambient-journal.yaml",
|
|
21
|
+
"daily-status.yaml",
|
|
22
|
+
"lint-on-save.yaml",
|
|
23
|
+
"stale-branches.yaml",
|
|
24
|
+
"watch-failing-tests.yaml",
|
|
25
|
+
]);
|
|
26
|
+
// Dev/dogfood fixtures that aren't user-facing and shouldn't be seeded by
|
|
27
|
+
// either init mode. Skipped silently regardless of --with-connectors.
|
|
28
|
+
const DEV_FIXTURE_RECIPES = new Set([
|
|
29
|
+
"ctx-loop-test.yaml",
|
|
30
|
+
]);
|
|
14
31
|
function printHelp() {
|
|
15
32
|
process.stdout.write(`patchwork-os init — Set up ~/.patchwork on this machine
|
|
16
33
|
|
|
17
34
|
Usage: patchwork-os init [options]
|
|
18
35
|
|
|
19
36
|
Options:
|
|
20
|
-
--force
|
|
21
|
-
--no-ollama
|
|
22
|
-
--
|
|
37
|
+
--force Overwrite existing config (default: merge, preserve)
|
|
38
|
+
--no-ollama Skip Ollama detection
|
|
39
|
+
--with-connectors Also copy connector-dependent recipes (gmail, github, …)
|
|
40
|
+
--help, -h Show this help
|
|
23
41
|
|
|
24
42
|
What it does:
|
|
25
43
|
1. Create ~/.patchwork/{config.json,recipes,inbox,journal}
|
|
26
|
-
2. Copy
|
|
44
|
+
2. Copy local-only recipe templates to ~/.patchwork/recipes/
|
|
45
|
+
(add --with-connectors to also copy gmail/github/etc. recipes)
|
|
27
46
|
3. Detect Ollama at localhost:11434 → set provider to ollama-local
|
|
28
|
-
4.
|
|
47
|
+
4. Register the Patchwork PreToolUse hook in ~/.claude/settings.json
|
|
48
|
+
so Claude Code routes tool calls through your delegation policy
|
|
49
|
+
5. Print next steps
|
|
29
50
|
`);
|
|
30
51
|
}
|
|
31
52
|
function findTemplatesDir() {
|
|
@@ -76,10 +97,17 @@ export async function runPatchworkInit(argv, opts = {}) {
|
|
|
76
97
|
const templatesDir = findTemplatesDir();
|
|
77
98
|
let recipesCopied = 0;
|
|
78
99
|
let recipesSkipped = 0;
|
|
100
|
+
let recipesGated = 0;
|
|
79
101
|
if (templatesDir) {
|
|
80
102
|
for (const name of readdirSync(templatesDir)) {
|
|
81
103
|
if (!name.endsWith(".yaml"))
|
|
82
104
|
continue;
|
|
105
|
+
if (DEV_FIXTURE_RECIPES.has(name))
|
|
106
|
+
continue;
|
|
107
|
+
if (!parsed.withConnectors && !LOCAL_ONLY_RECIPES.has(name)) {
|
|
108
|
+
recipesGated++;
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
83
111
|
const dest = join(recipesDir, name);
|
|
84
112
|
if (existsSync(dest) && !parsed.force) {
|
|
85
113
|
recipesSkipped++;
|
|
@@ -88,7 +116,10 @@ export async function runPatchworkInit(argv, opts = {}) {
|
|
|
88
116
|
copyFileSync(join(templatesDir, name), dest);
|
|
89
117
|
recipesCopied++;
|
|
90
118
|
}
|
|
91
|
-
|
|
119
|
+
const gatedNote = recipesGated
|
|
120
|
+
? ` (${recipesGated} connector-recipes skipped — re-run with --with-connectors)`
|
|
121
|
+
: "";
|
|
122
|
+
log(` ✓ recipes: ${recipesCopied} copied, ${recipesSkipped} preserved${gatedNote}\n`);
|
|
92
123
|
}
|
|
93
124
|
else {
|
|
94
125
|
log(` ! recipe templates not found (expected templates/recipes/)\n`);
|
|
@@ -127,7 +158,7 @@ export async function runPatchworkInit(argv, opts = {}) {
|
|
|
127
158
|
model: ollamaDetected ? "local" : "claude",
|
|
128
159
|
recipesDir,
|
|
129
160
|
dashboard: {
|
|
130
|
-
port:
|
|
161
|
+
port: 3200,
|
|
131
162
|
requireApproval: ["high"],
|
|
132
163
|
pushNotifications: false,
|
|
133
164
|
},
|
|
@@ -139,10 +170,44 @@ export async function runPatchworkInit(argv, opts = {}) {
|
|
|
139
170
|
existsSync(configPath) && parsed.force ? "overwritten" : "created";
|
|
140
171
|
}
|
|
141
172
|
log(` ✓ config ${configAction}: ${configPath}\n`);
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
173
|
+
// Register the Patchwork PreToolUse hook in Claude Code's settings.json
|
|
174
|
+
// so CC actually routes tool calls through the bridge's approval queue.
|
|
175
|
+
// Without this, `--approval-gate` is silently inert and the entire
|
|
176
|
+
// personalSignals catalog has no input data — exactly the foot-gun
|
|
177
|
+
// PR #150 added a startup warning for. Now `patchwork-init` fixes it
|
|
178
|
+
// at the source rather than just warning about it later.
|
|
179
|
+
const ccSettingsDir = process.env.CLAUDE_CONFIG_DIR ?? join(home, ".claude");
|
|
180
|
+
mkdirSync(ccSettingsDir, { recursive: true });
|
|
181
|
+
const ccSettingsPath = join(ccSettingsDir, "settings.json");
|
|
182
|
+
const hookResult = registerPreToolUseHook(ccSettingsPath);
|
|
183
|
+
let preToolUseHook;
|
|
184
|
+
if (hookResult.action === "added") {
|
|
185
|
+
log(` ✓ Claude Code PreToolUse hook registered: ${ccSettingsPath}\n`);
|
|
186
|
+
preToolUseHook = "added";
|
|
187
|
+
}
|
|
188
|
+
else if (hookResult.action === "already-wired") {
|
|
189
|
+
log(` ✓ Claude Code PreToolUse hook already registered\n`);
|
|
190
|
+
preToolUseHook = "already-wired";
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
log(` ! Could not register Claude Code PreToolUse hook: ${hookResult.error ?? "unknown"}\n` +
|
|
194
|
+
` Delegation policy will not see traffic until you add the hook manually.\n`);
|
|
195
|
+
preToolUseHook = "error";
|
|
196
|
+
}
|
|
197
|
+
// CC reads hooks at session start, so the registration we just did
|
|
198
|
+
// (or confirmed) only takes effect for *future* sessions. Without
|
|
199
|
+
// this prompt, users follow the docs, run init, and the delegation policy
|
|
200
|
+
// still appears inert — the trap that wasted hours of investigation
|
|
201
|
+
// during dogfood verification on 2026-05-03.
|
|
202
|
+
const restartLine = preToolUseHook === "added"
|
|
203
|
+
? `\n ⚠ Restart Claude Code so the new PreToolUse hook takes effect.\n (CC reads hooks at session start — existing sessions won't see the change.)\n`
|
|
204
|
+
: "";
|
|
205
|
+
log(`${restartLine}\nNext:
|
|
206
|
+
1. patchwork start # launch bridge + Claude + dashboard (one command)
|
|
207
|
+
2. patchwork-os recipe run daily-status # zero-config: yesterday's commits + today's hints
|
|
208
|
+
3. patchwork-os # terminal dashboard (TUI, alternative to web)
|
|
209
|
+
4. patchwork-os recipe list # browse installed recipes
|
|
210
|
+
5. patchwork-os init --with-connectors # add gmail/github/linear/etc. recipes\n`);
|
|
146
211
|
return {
|
|
147
212
|
configPath,
|
|
148
213
|
recipesDir,
|
|
@@ -150,6 +215,7 @@ export async function runPatchworkInit(argv, opts = {}) {
|
|
|
150
215
|
recipesSkipped,
|
|
151
216
|
ollamaDetected,
|
|
152
217
|
configAction,
|
|
218
|
+
preToolUseHook,
|
|
153
219
|
};
|
|
154
220
|
}
|
|
155
221
|
//# sourceMappingURL=patchworkInit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patchworkInit.js","sourceRoot":"","sources":["../../src/commands/patchworkInit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAA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AAE,SAAS,CAAC,CAAC;IAC7E,SAAS,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9C,MAAM,cAAc,GAAG,IAAI,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;IAC5D,MAAM,UAAU,GAAG,sBAAsB,CAAC,cAAc,CAAC,CAAC;IAC1D,IAAI,cAA4C,CAAC;IACjD,IAAI,UAAU,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;QAClC,GAAG,CAAC,+CAA+C,cAAc,IAAI,CAAC,CAAC;QACvE,cAAc,GAAG,OAAO,CAAC;IAC3B,CAAC;SAAM,IAAI,UAAU,CAAC,MAAM,KAAK,eAAe,EAAE,CAAC;QACjD,GAAG,CAAC,sDAAsD,CAAC,CAAC;QAC5D,cAAc,GAAG,eAAe,CAAC;IACnC,CAAC;SAAM,CAAC;QACN,GAAG,CACD,uDAAuD,UAAU,CAAC,KAAK,IAAI,SAAS,IAAI;YACtF,+EAA+E,CAClF,CAAC;QACF,cAAc,GAAG,OAAO,CAAC;IAC3B,CAAC;IAED,mEAAmE;IACnE,kEAAkE;IAClE,0EAA0E;IAC1E,oEAAoE;IACpE,6CAA6C;IAC7C,MAAM,WAAW,GACf,cAAc,KAAK,OAAO;QACxB,CAAC,CAAC,yJAAyJ;QAC3J,CAAC,CAAC,EAAE,CAAC;IAET,GAAG,CAAC,GAAG,WAAW;;;;;wFAKoE,CAAC,CAAC;IAExF,OAAO;QACL,UAAU;QACV,UAAU;QACV,aAAa;QACb,cAAc;QACd,cAAc;QACd,YAAY;QACZ,cAAc;KACf,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recipe CLI commands — new, lint, test, watch, record, fmt
|
|
3
|
+
*
|
|
4
|
+
* Implements the A2 CLI UX milestone for recipe authoring.
|
|
5
|
+
*/
|
|
6
|
+
import "../recipes/tools/index.js";
|
|
7
|
+
import { type LintIssue, type LintResult } from "../recipes/validation.js";
|
|
8
|
+
import { type RunnerDeps, type RunResult, type YamlRecipe } from "../recipes/yamlRunner.js";
|
|
9
|
+
export interface NewOptions {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
template?: string;
|
|
13
|
+
outputDir?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function runNew(options: NewOptions): {
|
|
16
|
+
path: string;
|
|
17
|
+
content: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function listTemplates(): string[];
|
|
20
|
+
export interface SchemaWriteResult {
|
|
21
|
+
outputDir: string;
|
|
22
|
+
filesWritten: string[];
|
|
23
|
+
}
|
|
24
|
+
export declare function runSchema(outputDir: string): Promise<SchemaWriteResult>;
|
|
25
|
+
export type { LintIssue, LintResult };
|
|
26
|
+
/**
|
|
27
|
+
* Lint a recipe file against the schema.
|
|
28
|
+
* Falls back to basic YAML parsing if schema linting is disabled.
|
|
29
|
+
*/
|
|
30
|
+
export declare function runLint(recipePath: string): LintResult;
|
|
31
|
+
export interface FmtResult {
|
|
32
|
+
formatted: string;
|
|
33
|
+
changed: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Format/normalize a recipe file.
|
|
37
|
+
* - Normalizes YAML formatting
|
|
38
|
+
* - Sorts keys in consistent order
|
|
39
|
+
* - Validates and re-serializes
|
|
40
|
+
*/
|
|
41
|
+
export declare function runFmt(recipePath: string, options?: {
|
|
42
|
+
check?: boolean;
|
|
43
|
+
}): FmtResult;
|
|
44
|
+
export interface FmtWatchOptions {
|
|
45
|
+
recipePath: string;
|
|
46
|
+
check?: boolean;
|
|
47
|
+
onResult: (result: FmtResult) => void | Promise<void>;
|
|
48
|
+
onError?: (err: Error) => void;
|
|
49
|
+
debounceMs?: number;
|
|
50
|
+
watchFactory?: WatchFactory;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Watch a recipe file and re-run `runFmt` on every save (debounced).
|
|
54
|
+
* Mirrors runPreflightWatch / runTestWatch — composes runWatch + runFmt.
|
|
55
|
+
* Returns a stop function.
|
|
56
|
+
*/
|
|
57
|
+
export declare function runFmtWatch(options: FmtWatchOptions): () => void;
|
|
58
|
+
export interface RunRecipeOptions {
|
|
59
|
+
dryRun?: boolean;
|
|
60
|
+
step?: string;
|
|
61
|
+
vars?: Record<string, string>;
|
|
62
|
+
workdir?: string;
|
|
63
|
+
deps?: Partial<RunnerDeps>;
|
|
64
|
+
}
|
|
65
|
+
export interface RunRecipeStepSelection {
|
|
66
|
+
query: string;
|
|
67
|
+
matchedBy: "id" | "into" | "tool";
|
|
68
|
+
matchedValue: string;
|
|
69
|
+
}
|
|
70
|
+
export interface RunRecipeResult {
|
|
71
|
+
recipe: YamlRecipe;
|
|
72
|
+
recipePath: string;
|
|
73
|
+
result: RunResult | import("../recipes/chainedRunner.js").ChainedRunResult;
|
|
74
|
+
stepSelection?: RunRecipeStepSelection;
|
|
75
|
+
}
|
|
76
|
+
export interface RecipeExecutionSummary {
|
|
77
|
+
ok: boolean;
|
|
78
|
+
steps: number;
|
|
79
|
+
outputs: string[];
|
|
80
|
+
errorMessage?: string;
|
|
81
|
+
failed?: number;
|
|
82
|
+
skipped?: number;
|
|
83
|
+
}
|
|
84
|
+
export interface WatchedRecipeRunResult {
|
|
85
|
+
lint: LintResult;
|
|
86
|
+
run?: RunRecipeResult;
|
|
87
|
+
summary?: RecipeExecutionSummary;
|
|
88
|
+
}
|
|
89
|
+
export declare function runRecipe(recipeRef: string, options?: RunRecipeOptions): Promise<RunRecipeResult>;
|
|
90
|
+
export declare function summarizeRecipeExecution(result: RunRecipeResult["result"]): RecipeExecutionSummary;
|
|
91
|
+
/**
|
|
92
|
+
* Normalize either a yamlRunner RunResult or a chainedRunner ChainedRunResult
|
|
93
|
+
* into the RunStepResult[] shape expected by RecipeRunLog.appendDirect.
|
|
94
|
+
* Returns undefined when the result has no step-level detail.
|
|
95
|
+
*/
|
|
96
|
+
export declare function extractRunLogStepResults(result: RunRecipeResult["result"]): Array<{
|
|
97
|
+
id: string;
|
|
98
|
+
tool?: string;
|
|
99
|
+
status: "ok" | "skipped" | "error";
|
|
100
|
+
error?: string;
|
|
101
|
+
durationMs: number;
|
|
102
|
+
}> | undefined;
|
|
103
|
+
export declare function formatRunReport(result: RunRecipeResult["result"], recipeName: string): string;
|
|
104
|
+
export declare function runWatchedRecipe(recipePath: string, options?: Pick<RunRecipeOptions, "workdir" | "deps" | "vars">): Promise<WatchedRecipeRunResult>;
|
|
105
|
+
/**
|
|
106
|
+
* Stable JSON schema version for machine-readable dry-run plans.
|
|
107
|
+
* Bump on breaking shape changes; consumers (dashboard run timeline, external tools)
|
|
108
|
+
* should gate on this field.
|
|
109
|
+
*/
|
|
110
|
+
export declare const DRY_RUN_PLAN_SCHEMA_VERSION = 1;
|
|
111
|
+
export interface RecipeDryRunPlanStep {
|
|
112
|
+
id: string;
|
|
113
|
+
type: "tool" | "agent" | "recipe";
|
|
114
|
+
tool?: string;
|
|
115
|
+
/** Namespace derived from tool id (e.g. "gmail" from "gmail.fetch_unread"). */
|
|
116
|
+
namespace?: string;
|
|
117
|
+
into?: string;
|
|
118
|
+
optional?: boolean;
|
|
119
|
+
prompt?: string;
|
|
120
|
+
params?: Record<string, unknown>;
|
|
121
|
+
dependencies?: string[];
|
|
122
|
+
condition?: string;
|
|
123
|
+
/** Explicit risk on the step, or registry default when absent. */
|
|
124
|
+
risk?: "low" | "medium" | "high";
|
|
125
|
+
/** Registry metadata — true if the tool mutates external state. */
|
|
126
|
+
isWrite?: boolean;
|
|
127
|
+
/** Registry metadata — true if the tool calls an external SaaS connector. */
|
|
128
|
+
isConnector?: boolean;
|
|
129
|
+
/** True if the tool id is known to the registry (false → unresolved at plan time). */
|
|
130
|
+
resolved?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Nested-recipe reference for `step.type === "recipe"` (chained recipes
|
|
133
|
+
* with `recipe:` or `chain:` field). Bare name (e.g. `branch-health`) or
|
|
134
|
+
* relative/absolute path. F-07 fix: this is now part of the plan-step
|
|
135
|
+
* shape so write-detection can recurse into nested recipes.
|
|
136
|
+
*/
|
|
137
|
+
recipe?: string;
|
|
138
|
+
/**
|
|
139
|
+
* F-07 fix: when this step is a nested recipe and its writes were
|
|
140
|
+
* detected via recursion, this is the count of write-tagged tool steps
|
|
141
|
+
* inside the nested recipe (transitively). 0 if the recurse depth was
|
|
142
|
+
* hit before any writes were found, undefined for non-recipe steps.
|
|
143
|
+
*/
|
|
144
|
+
nestedWriteCount?: number;
|
|
145
|
+
}
|
|
146
|
+
export interface RecipeDryRunPlan {
|
|
147
|
+
/** Stable schema version for consumers. */
|
|
148
|
+
schemaVersion: typeof DRY_RUN_PLAN_SCHEMA_VERSION;
|
|
149
|
+
recipe: string;
|
|
150
|
+
mode: "dry-run";
|
|
151
|
+
triggerType: string;
|
|
152
|
+
/** ISO-8601 generation timestamp. */
|
|
153
|
+
generatedAt: string;
|
|
154
|
+
stepSelection?: RunRecipeStepSelection;
|
|
155
|
+
steps: RecipeDryRunPlanStep[];
|
|
156
|
+
parallelGroups?: string[][];
|
|
157
|
+
maxDepth?: number;
|
|
158
|
+
/** Distinct connector namespaces referenced by the plan. */
|
|
159
|
+
connectorNamespaces?: string[];
|
|
160
|
+
/** True if any step is registry-tagged as a write/mutation. */
|
|
161
|
+
hasWriteSteps?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Static lint pass over the recipe definition (validateRecipeDefinition).
|
|
164
|
+
* Surfaces error- and warning-level issues — including dotted-ref / output
|
|
165
|
+
* schema warnings — so editors and dashboards consuming the plan see the
|
|
166
|
+
* same signal as the CLI lint and the dashboard editor. Always present;
|
|
167
|
+
* arrays may be empty when the recipe is clean.
|
|
168
|
+
*/
|
|
169
|
+
lint: {
|
|
170
|
+
errors: string[];
|
|
171
|
+
warnings: string[];
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
export declare function runRecipeDryPlan(recipeRef: string, options?: RunRecipeOptions): Promise<RecipeDryRunPlan>;
|
|
175
|
+
export type PreflightIssueCode = "unresolved-tool" | "unacknowledged-write" | "missing-fixture" | "lint-error" | "lint-warning" | "into-shadows-builtin" | "into-duplicate";
|
|
176
|
+
export interface PreflightIssue {
|
|
177
|
+
level: "error" | "warning";
|
|
178
|
+
code: PreflightIssueCode;
|
|
179
|
+
message: string;
|
|
180
|
+
stepId?: string;
|
|
181
|
+
tool?: string;
|
|
182
|
+
namespace?: string;
|
|
183
|
+
}
|
|
184
|
+
export interface PreflightResult {
|
|
185
|
+
ok: boolean;
|
|
186
|
+
recipe: string;
|
|
187
|
+
issues: PreflightIssue[];
|
|
188
|
+
plan: RecipeDryRunPlan;
|
|
189
|
+
}
|
|
190
|
+
export interface PreflightOptions extends RunRecipeOptions {
|
|
191
|
+
/**
|
|
192
|
+
* If true, steps tagged `isWrite: true` fail preflight unless the recipe opts in
|
|
193
|
+
* via a matching `allowWrites` entry (tool id or namespace). Default: true.
|
|
194
|
+
*/
|
|
195
|
+
requireWriteAck?: boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Explicit allowlist of tool ids or namespaces the caller acknowledges as writes.
|
|
198
|
+
* Example: `["slack.post_message", "github"]`.
|
|
199
|
+
*/
|
|
200
|
+
allowWrites?: string[];
|
|
201
|
+
/**
|
|
202
|
+
* If true, missing fixture libraries for connector namespaces become errors.
|
|
203
|
+
* Default: false — preflight is a policy check, not a mock-run.
|
|
204
|
+
*/
|
|
205
|
+
requireFixtures?: boolean;
|
|
206
|
+
/** Override fixtures dir (defaults to ~/.patchwork/fixtures). */
|
|
207
|
+
fixturesDir?: string;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Static policy check over a recipe: lint + dry-plan + unresolved/write/fixture checks.
|
|
211
|
+
* No connector calls, no agent calls — safe to run in CI.
|
|
212
|
+
*/
|
|
213
|
+
export declare function runPreflight(recipeRef: string, options?: PreflightOptions): Promise<PreflightResult>;
|
|
214
|
+
export interface PreflightWatchOptions extends PreflightOptions {
|
|
215
|
+
recipePath: string;
|
|
216
|
+
onResult: (result: PreflightResult) => void | Promise<void>;
|
|
217
|
+
onError?: (err: Error) => void;
|
|
218
|
+
debounceMs?: number;
|
|
219
|
+
watchFactory?: WatchFactory;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Watch a recipe file and run preflight on every save (debounced). Composes
|
|
223
|
+
* runWatch + runPreflight so editor integrations get live policy feedback
|
|
224
|
+
* without spawning the CLI per keystroke.
|
|
225
|
+
*
|
|
226
|
+
* Returns a stop function. If a preflight is in-flight when a new save lands,
|
|
227
|
+
* at most one rerun is queued (matches runWatch semantics).
|
|
228
|
+
*/
|
|
229
|
+
export declare function runPreflightWatch(options: PreflightWatchOptions): () => void;
|
|
230
|
+
/**
|
|
231
|
+
* Exported for the cli-warns-when-out-of-jail.test regression suite —
|
|
232
|
+
* the warn path is what we assert on, not the path-resolution behaviour.
|
|
233
|
+
* Internal callers should keep using the local symbol.
|
|
234
|
+
*/
|
|
235
|
+
export declare function resolveRecipeRefForCli(recipeRef: string): string;
|
|
236
|
+
export interface RecipeTestResult {
|
|
237
|
+
valid: boolean;
|
|
238
|
+
issues: LintIssue[];
|
|
239
|
+
warnings: number;
|
|
240
|
+
errors: number;
|
|
241
|
+
requiredFixtures: string[];
|
|
242
|
+
missingFixtures: string[];
|
|
243
|
+
stepsRun: number;
|
|
244
|
+
outputs: string[];
|
|
245
|
+
assertionFailures: import("../recipes/yamlRunner.js").AssertionFailure[];
|
|
246
|
+
}
|
|
247
|
+
export interface RecipeRecordResult {
|
|
248
|
+
valid: boolean;
|
|
249
|
+
issues: LintIssue[];
|
|
250
|
+
warnings: number;
|
|
251
|
+
errors: number;
|
|
252
|
+
recordedFixtures: string[];
|
|
253
|
+
stepsRun: number;
|
|
254
|
+
outputs: string[];
|
|
255
|
+
}
|
|
256
|
+
export declare function runRecord(recipePath: string, options?: {
|
|
257
|
+
fixturesDir?: string;
|
|
258
|
+
deps?: Partial<RunnerDeps>;
|
|
259
|
+
}): Promise<RecipeRecordResult>;
|
|
260
|
+
export declare function runTest(recipePath: string, options?: {
|
|
261
|
+
fixturesDir?: string;
|
|
262
|
+
}): Promise<RecipeTestResult>;
|
|
263
|
+
export interface TestWatchOptions {
|
|
264
|
+
recipePath: string;
|
|
265
|
+
fixturesDir?: string;
|
|
266
|
+
onResult: (result: RecipeTestResult) => void | Promise<void>;
|
|
267
|
+
onError?: (err: Error) => void;
|
|
268
|
+
debounceMs?: number;
|
|
269
|
+
watchFactory?: WatchFactory;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Watch a recipe file and re-run `patchwork recipe test` on every save (debounced).
|
|
273
|
+
* Mirrors runPreflightWatch — composes runWatch + runTest.
|
|
274
|
+
* Returns a stop function.
|
|
275
|
+
*/
|
|
276
|
+
export declare function runTestWatch(options: TestWatchOptions): () => void;
|
|
277
|
+
type WatchFactory = (path: string, options: {
|
|
278
|
+
recursive: boolean;
|
|
279
|
+
}, listener: (eventType: string, changedFile: string | Buffer | null) => void) => {
|
|
280
|
+
close(): void;
|
|
281
|
+
};
|
|
282
|
+
export interface WatchOptions {
|
|
283
|
+
recipePath: string;
|
|
284
|
+
onChange: () => void | Promise<void>;
|
|
285
|
+
onError?: (err: Error) => void;
|
|
286
|
+
debounceMs?: number;
|
|
287
|
+
watchFactory?: WatchFactory;
|
|
288
|
+
}
|
|
289
|
+
export declare function runWatch(options: WatchOptions): () => void;
|