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,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* stepObservation — observability shims for recipe step execution.
|
|
3
|
+
*
|
|
4
|
+
* Bundles two independent concerns that both wrap step output for the
|
|
5
|
+
* runner / runlog / dashboard. They live together because they're both
|
|
6
|
+
* "what the runtime sees of a step's result," not because they share
|
|
7
|
+
* data — the two functions don't call each other and don't share types.
|
|
8
|
+
*
|
|
9
|
+
* 1. detectSilentFail(result) — recognize tool-output strings or shapes
|
|
10
|
+
* that indicate a tool silently failed but reported "success" to
|
|
11
|
+
* the runner. Used by yamlRunner to flag steps as `error` even when
|
|
12
|
+
* the tool returned `ok:true`. Per-step opt-out via
|
|
13
|
+
* `silentFailDetection: false`.
|
|
14
|
+
*
|
|
15
|
+
* 2. captureForRunlog(value) — sanitize + cap a step value for
|
|
16
|
+
* persistence. Redacts known sensitive keys, handles cycles /
|
|
17
|
+
* BigInt / undefined, and truncates JSON over 8 KB with a clear
|
|
18
|
+
* `[truncated]` marker. Used by chainedRunner + approvalHttp.
|
|
19
|
+
*
|
|
20
|
+
* Both replace the previous `detectSilentFail.ts` and `captureForRunlog.ts`
|
|
21
|
+
* files (issue #252). Behavior is unchanged — the merge is organizational.
|
|
22
|
+
*/
|
|
23
|
+
export interface SilentFailMatch {
|
|
24
|
+
reason: string;
|
|
25
|
+
/** Slice of the result that triggered the match (for the error msg). */
|
|
26
|
+
matched: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns a `SilentFailMatch` if `result` looks like a silent-fail
|
|
30
|
+
* placeholder, else `null`. JSON `{ok:false}` detection stays in the
|
|
31
|
+
* runner — this module only handles the string + JSON-shape patterns
|
|
32
|
+
* the runner doesn't already catch.
|
|
33
|
+
*/
|
|
34
|
+
export declare function detectSilentFail(result: unknown): SilentFailMatch | null;
|
|
35
|
+
/**
|
|
36
|
+
* Capture a value for inclusion in `RunStepResult`. Returns undefined if
|
|
37
|
+
* the value is `undefined` (don't bloat the log row for steps that
|
|
38
|
+
* produced nothing).
|
|
39
|
+
*
|
|
40
|
+
* Throws nothing — sanitize/serialize errors are caught and replaced with
|
|
41
|
+
* a small placeholder so a malformed step output never breaks the log
|
|
42
|
+
* write.
|
|
43
|
+
*/
|
|
44
|
+
export declare function captureForRunlog(value: unknown): unknown | undefined;
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* stepObservation — observability shims for recipe step execution.
|
|
3
|
+
*
|
|
4
|
+
* Bundles two independent concerns that both wrap step output for the
|
|
5
|
+
* runner / runlog / dashboard. They live together because they're both
|
|
6
|
+
* "what the runtime sees of a step's result," not because they share
|
|
7
|
+
* data — the two functions don't call each other and don't share types.
|
|
8
|
+
*
|
|
9
|
+
* 1. detectSilentFail(result) — recognize tool-output strings or shapes
|
|
10
|
+
* that indicate a tool silently failed but reported "success" to
|
|
11
|
+
* the runner. Used by yamlRunner to flag steps as `error` even when
|
|
12
|
+
* the tool returned `ok:true`. Per-step opt-out via
|
|
13
|
+
* `silentFailDetection: false`.
|
|
14
|
+
*
|
|
15
|
+
* 2. captureForRunlog(value) — sanitize + cap a step value for
|
|
16
|
+
* persistence. Redacts known sensitive keys, handles cycles /
|
|
17
|
+
* BigInt / undefined, and truncates JSON over 8 KB with a clear
|
|
18
|
+
* `[truncated]` marker. Used by chainedRunner + approvalHttp.
|
|
19
|
+
*
|
|
20
|
+
* Both replace the previous `detectSilentFail.ts` and `captureForRunlog.ts`
|
|
21
|
+
* files (issue #252). Behavior is unchanged — the merge is organizational.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Patterns that indicate a tool silently failed.
|
|
25
|
+
*
|
|
26
|
+
* The patterns are intentionally narrow — string-typed tool outputs are
|
|
27
|
+
* a rich surface and we don't want false positives. Each pattern
|
|
28
|
+
* corresponds to a known antipattern caught in the wild; bare prose is
|
|
29
|
+
* NOT flagged.
|
|
30
|
+
*/
|
|
31
|
+
const SILENT_FAIL_PATTERNS = [
|
|
32
|
+
// Placeholder strings emitted by `defaultGitLogSince`,
|
|
33
|
+
// `defaultGitStaleBranches` (pre-PR-70), and similar tools that
|
|
34
|
+
// catch all errors and return a parens-wrapped "unavailable" string.
|
|
35
|
+
// Match: anywhere on a single line, parens around a phrase containing
|
|
36
|
+
// "unavailable" / "not available" / "not configured" / "error" /
|
|
37
|
+
// "failed" — any of those wrapped in parens at the start of the line
|
|
38
|
+
// is a strong signal.
|
|
39
|
+
{
|
|
40
|
+
regex: /^\s*\(([^()]*?)(unavailable|not available|not configured|no data|error|failed)\)/i,
|
|
41
|
+
reason: "tool returned a parens-wrapped placeholder",
|
|
42
|
+
},
|
|
43
|
+
// Agent-step short-circuit: agentExecutor's own error/skip strings.
|
|
44
|
+
// Used by `executeAgent` when an API key is missing or the LLM
|
|
45
|
+
// returns nothing. Not surfaced as JSON, so the runner never saw it.
|
|
46
|
+
{
|
|
47
|
+
regex: /^\s*\[agent step (skipped|failed):/i,
|
|
48
|
+
reason: "agent step skipped or failed (string placeholder)",
|
|
49
|
+
},
|
|
50
|
+
// Generic step-skipped marker in case more callers adopt it.
|
|
51
|
+
{
|
|
52
|
+
regex: /^\s*\[step (skipped|failed):/i,
|
|
53
|
+
reason: "step skipped or failed (string placeholder)",
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
/**
|
|
57
|
+
* Returns a `SilentFailMatch` if `result` looks like a silent-fail
|
|
58
|
+
* placeholder, else `null`. JSON `{ok:false}` detection stays in the
|
|
59
|
+
* runner — this module only handles the string + JSON-shape patterns
|
|
60
|
+
* the runner doesn't already catch.
|
|
61
|
+
*/
|
|
62
|
+
export function detectSilentFail(result) {
|
|
63
|
+
if (result === null || result === undefined)
|
|
64
|
+
return null;
|
|
65
|
+
if (typeof result === "string") {
|
|
66
|
+
for (const { regex, reason } of SILENT_FAIL_PATTERNS) {
|
|
67
|
+
const m = regex.exec(result);
|
|
68
|
+
if (m) {
|
|
69
|
+
// Cap the matched fragment so error messages stay readable.
|
|
70
|
+
const matched = m[0].slice(0, 120);
|
|
71
|
+
return { reason, matched };
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// String result that LOOKS like JSON — try parsing and recursing.
|
|
75
|
+
if (result.startsWith("{") || result.startsWith("[")) {
|
|
76
|
+
try {
|
|
77
|
+
return detectSilentFail(JSON.parse(result));
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
if (typeof result === "object" && !Array.isArray(result)) {
|
|
86
|
+
const obj = result;
|
|
87
|
+
// List-tool antipattern: `{count: 0, error: "..."}`. Tools that
|
|
88
|
+
// catch errors and return an empty list with an `error` field
|
|
89
|
+
// succeed-with-zero from the runner's view. Specifically targets
|
|
90
|
+
// `github.listIssues`, `linear.listIssues`, etc. flagged in the
|
|
91
|
+
// tool audit.
|
|
92
|
+
if (typeof obj.error === "string" &&
|
|
93
|
+
obj.error.length > 0 &&
|
|
94
|
+
(obj.count === 0 ||
|
|
95
|
+
(Array.isArray(obj.items) && obj.items.length === 0) ||
|
|
96
|
+
(Array.isArray(obj.results) && obj.results.length === 0))) {
|
|
97
|
+
return {
|
|
98
|
+
reason: "list-tool returned empty with error field",
|
|
99
|
+
matched: obj.error.slice(0, 120),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
// captureForRunlog
|
|
107
|
+
//
|
|
108
|
+
// VD-2 captures `resolvedParams`, `output`, and `registrySnapshot` per step
|
|
109
|
+
// so the dashboard can show diff hovers + replay. These can carry secrets
|
|
110
|
+
// (auth headers, API keys, passwords) and arbitrary user data, so we:
|
|
111
|
+
//
|
|
112
|
+
// 1. Redact known sensitive keys before serialization.
|
|
113
|
+
// 2. JSON-stringify defensively (handle cycles, BigInt, undefined).
|
|
114
|
+
// 3. Cap the JSON-encoded form at MAX_BYTES. Larger values are
|
|
115
|
+
// truncated with a clear `[truncated]` marker so the dashboard can
|
|
116
|
+
// tell users the value didn't fit, rather than guessing why it's
|
|
117
|
+
// missing.
|
|
118
|
+
//
|
|
119
|
+
// Bytes are JSON-string bytes, not the in-memory size — safe upper bound
|
|
120
|
+
// since serialization is what the runlog persists.
|
|
121
|
+
// ---------------------------------------------------------------------------
|
|
122
|
+
const MAX_BYTES = 8 * 1024;
|
|
123
|
+
// Case-insensitive substring match. Order: most specific first to avoid
|
|
124
|
+
// accidentally matching narrower strings (none currently overlap, but
|
|
125
|
+
// this is the convention).
|
|
126
|
+
const SENSITIVE_KEY_PATTERNS = [
|
|
127
|
+
"authorization",
|
|
128
|
+
"x-api-key",
|
|
129
|
+
"api-key",
|
|
130
|
+
"apikey",
|
|
131
|
+
"password",
|
|
132
|
+
"passwd",
|
|
133
|
+
"secret",
|
|
134
|
+
"token",
|
|
135
|
+
"cookie",
|
|
136
|
+
"session",
|
|
137
|
+
"private-key",
|
|
138
|
+
"privatekey",
|
|
139
|
+
"client-secret",
|
|
140
|
+
"client_secret",
|
|
141
|
+
"refresh-token",
|
|
142
|
+
"refresh_token",
|
|
143
|
+
"access-token",
|
|
144
|
+
"access_token",
|
|
145
|
+
];
|
|
146
|
+
const REDACTED = "[REDACTED]";
|
|
147
|
+
const TRUNCATED = "[truncated]";
|
|
148
|
+
function isSensitiveKey(key) {
|
|
149
|
+
const lower = key.toLowerCase();
|
|
150
|
+
for (const pattern of SENSITIVE_KEY_PATTERNS) {
|
|
151
|
+
if (lower.includes(pattern))
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Walk a value and replace any property whose key matches a sensitive
|
|
158
|
+
* pattern. Arrays + nested objects walked recursively. Cycles handled by
|
|
159
|
+
* tracking seen objects. Non-objects pass through unchanged.
|
|
160
|
+
*/
|
|
161
|
+
function redactSensitive(value, seen = new WeakSet()) {
|
|
162
|
+
if (value === null || typeof value !== "object")
|
|
163
|
+
return value;
|
|
164
|
+
if (seen.has(value))
|
|
165
|
+
return "[circular]";
|
|
166
|
+
seen.add(value);
|
|
167
|
+
if (Array.isArray(value)) {
|
|
168
|
+
return value.map((v) => redactSensitive(v, seen));
|
|
169
|
+
}
|
|
170
|
+
const out = {};
|
|
171
|
+
for (const [k, v] of Object.entries(value)) {
|
|
172
|
+
if (isSensitiveKey(k)) {
|
|
173
|
+
out[k] = REDACTED;
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
out[k] = redactSensitive(v, seen);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return out;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Capture a value for inclusion in `RunStepResult`. Returns undefined if
|
|
183
|
+
* the value is `undefined` (don't bloat the log row for steps that
|
|
184
|
+
* produced nothing).
|
|
185
|
+
*
|
|
186
|
+
* Throws nothing — sanitize/serialize errors are caught and replaced with
|
|
187
|
+
* a small placeholder so a malformed step output never breaks the log
|
|
188
|
+
* write.
|
|
189
|
+
*/
|
|
190
|
+
export function captureForRunlog(value) {
|
|
191
|
+
if (value === undefined)
|
|
192
|
+
return undefined;
|
|
193
|
+
let redacted;
|
|
194
|
+
try {
|
|
195
|
+
redacted = redactSensitive(value);
|
|
196
|
+
}
|
|
197
|
+
catch {
|
|
198
|
+
return { error: "[capture-redact-failed]" };
|
|
199
|
+
}
|
|
200
|
+
let json;
|
|
201
|
+
try {
|
|
202
|
+
json = JSON.stringify(redacted, (_key, v) => {
|
|
203
|
+
if (typeof v === "bigint")
|
|
204
|
+
return `${v}n`;
|
|
205
|
+
if (typeof v === "function")
|
|
206
|
+
return "[function]";
|
|
207
|
+
if (typeof v === "symbol")
|
|
208
|
+
return v.toString();
|
|
209
|
+
return v;
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
catch {
|
|
213
|
+
return { error: "[capture-serialize-failed]" };
|
|
214
|
+
}
|
|
215
|
+
// JSON.stringify returns undefined for certain top-level values (e.g.
|
|
216
|
+
// bare `undefined`). Already excluded above, but guard for safety.
|
|
217
|
+
if (typeof json !== "string")
|
|
218
|
+
return undefined;
|
|
219
|
+
if (Buffer.byteLength(json, "utf8") <= MAX_BYTES) {
|
|
220
|
+
return redacted;
|
|
221
|
+
}
|
|
222
|
+
// Over the cap. Don't try to walk + trim — that gets messy fast. Just
|
|
223
|
+
// slice the JSON string to the budget and reattach a clear marker.
|
|
224
|
+
// Re-parse may fail (we cut mid-key); if so, return a string envelope.
|
|
225
|
+
const slice = json.slice(0, MAX_BYTES);
|
|
226
|
+
return {
|
|
227
|
+
[TRUNCATED]: true,
|
|
228
|
+
bytes: Buffer.byteLength(json, "utf8"),
|
|
229
|
+
preview: slice,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=stepObservation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepObservation.js","sourceRoot":"","sources":["../../src/recipes/stepObservation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA0BH;;;;;;;GAOG;AACH,MAAM,oBAAoB,GAA6C;IACrE,uDAAuD;IACvD,gEAAgE;IAChE,qEAAqE;IACrE,sEAAsE;IACtE,iEAAiE;IACjE,qEAAqE;IACrE,sBAAsB;IACtB;QACE,KAAK,EACH,mFAAmF;QACrF,MAAM,EAAE,4CAA4C;KACrD;IACD,oEAAoE;IACpE,+DAA+D;IAC/D,qEAAqE;IACrE;QACE,KAAK,EAAE,qCAAqC;QAC5C,MAAM,EAAE,mDAAmD;KAC5D;IACD,6DAA6D;IAC7D;QACE,KAAK,EAAE,+BAA+B;QACtC,MAAM,EAAE,6CAA6C;KACtD;CACF,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAe;IAC9C,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAEzD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,KAAK,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,oBAAoB,EAAE,CAAC;YACrD,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,MAA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AQ;gBAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;YAC/C,OAAO,CAAC,CAAC;QACX,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,KAAK,EAAE,4BAA4B,EAAE,CAAC;IACjD,CAAC;IACD,sEAAsE;IACtE,mEAAmE;IACnE,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAE/C,IAAI,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,SAAS,EAAE,CAAC;QACjD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,sEAAsE;IACtE,mEAAmE;IACnE,uEAAuE;IACvE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IACvC,OAAO;QACL,CAAC,SAAS,CAAC,EAAE,IAAI;QACjB,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC;QACtC,OAAO,EAAE,KAAK;KACf,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template Engine — safe template resolution for recipe step outputs.
|
|
3
|
+
*
|
|
4
|
+
* Replaces the deprecated `vm2` approach with a pure AST-based evaluator.
|
|
5
|
+
* Supports: `{{steps.X.data}}`, `{{steps.X.data.field.subfield}}`, `{{env.Y}}`
|
|
6
|
+
*
|
|
7
|
+
* Security: No eval, no Function constructor, no VM. Just path walking.
|
|
8
|
+
*/
|
|
9
|
+
export interface TemplateContext {
|
|
10
|
+
steps: Record<string, StepOutput>;
|
|
11
|
+
env: Record<string, string | undefined>;
|
|
12
|
+
}
|
|
13
|
+
export interface StepOutput {
|
|
14
|
+
status: "success" | "error" | "skipped";
|
|
15
|
+
data: unknown;
|
|
16
|
+
metadata?: {
|
|
17
|
+
startedAt: Date;
|
|
18
|
+
completedAt: Date;
|
|
19
|
+
model?: string;
|
|
20
|
+
tokenUsage?: number;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface TemplateCompileError {
|
|
24
|
+
type: "compile_error";
|
|
25
|
+
template: string;
|
|
26
|
+
message: string;
|
|
27
|
+
}
|
|
28
|
+
export interface TemplateEvalError {
|
|
29
|
+
type: "eval_error";
|
|
30
|
+
template: string;
|
|
31
|
+
path: string;
|
|
32
|
+
message: string;
|
|
33
|
+
}
|
|
34
|
+
export type TemplateError = TemplateCompileError | TemplateEvalError;
|
|
35
|
+
export interface CompiledTemplate {
|
|
36
|
+
readonly source: string;
|
|
37
|
+
readonly hasTemplates: boolean;
|
|
38
|
+
evaluate(context: TemplateContext): {
|
|
39
|
+
value: string;
|
|
40
|
+
} | {
|
|
41
|
+
error: TemplateError;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Compile a template string into an executable form.
|
|
46
|
+
* Parses `{{...}}` expressions once, not per-evaluation.
|
|
47
|
+
*/
|
|
48
|
+
export declare function compileTemplate(template: string): CompiledTemplate;
|
|
49
|
+
/**
|
|
50
|
+
* Convenience: compile and evaluate in one call.
|
|
51
|
+
* Prefer pre-compilation for repeated evaluations.
|
|
52
|
+
*/
|
|
53
|
+
export declare function evaluateTemplate(template: string, context: TemplateContext): {
|
|
54
|
+
value: string;
|
|
55
|
+
} | {
|
|
56
|
+
error: TemplateError;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Validate all templates in a recipe at load time.
|
|
60
|
+
* Returns array of errors, empty if all valid.
|
|
61
|
+
*/
|
|
62
|
+
export declare function validateRecipeTemplates(templates: string[]): TemplateError[];
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template Engine — safe template resolution for recipe step outputs.
|
|
3
|
+
*
|
|
4
|
+
* Replaces the deprecated `vm2` approach with a pure AST-based evaluator.
|
|
5
|
+
* Supports: `{{steps.X.data}}`, `{{steps.X.data.field.subfield}}`, `{{env.Y}}`
|
|
6
|
+
*
|
|
7
|
+
* Security: No eval, no Function constructor, no VM. Just path walking.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Compile a template string into an executable form.
|
|
11
|
+
* Parses `{{...}}` expressions once, not per-evaluation.
|
|
12
|
+
*/
|
|
13
|
+
export function compileTemplate(template) {
|
|
14
|
+
const parts = [];
|
|
15
|
+
// Match {{expression}} — non-greedy, no nesting
|
|
16
|
+
const regex = /\{\{([^{}]+)\}\}/g;
|
|
17
|
+
let lastIndex = 0;
|
|
18
|
+
let match;
|
|
19
|
+
while ((match = regex.exec(template)) !== null) {
|
|
20
|
+
// Add literal text before this match
|
|
21
|
+
if (match.index > lastIndex) {
|
|
22
|
+
parts.push(template.slice(lastIndex, match.index));
|
|
23
|
+
}
|
|
24
|
+
const expression = match[1]?.trim();
|
|
25
|
+
if (!expression) {
|
|
26
|
+
// Whitespace-only expression like `{{ }}` — preserve as literal so the
|
|
27
|
+
// surrounding text isn't duplicated on the next iteration. Without
|
|
28
|
+
// advancing lastIndex, the next slice(lastIndex, match.index) would
|
|
29
|
+
// re-emit text we already pushed above.
|
|
30
|
+
parts.push(match[0]);
|
|
31
|
+
lastIndex = regex.lastIndex;
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
const parsed = parseExpression(expression);
|
|
35
|
+
if (!parsed) {
|
|
36
|
+
return {
|
|
37
|
+
source: template,
|
|
38
|
+
hasTemplates: true,
|
|
39
|
+
evaluate: () => ({
|
|
40
|
+
error: {
|
|
41
|
+
type: "compile_error",
|
|
42
|
+
template,
|
|
43
|
+
message: `Invalid expression: ${expression}`,
|
|
44
|
+
},
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
parts.push(parsed);
|
|
49
|
+
lastIndex = regex.lastIndex;
|
|
50
|
+
}
|
|
51
|
+
// Add remaining literal text
|
|
52
|
+
if (lastIndex < template.length) {
|
|
53
|
+
parts.push(template.slice(lastIndex));
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
source: template,
|
|
57
|
+
hasTemplates: parts.some((p) => typeof p !== "string"),
|
|
58
|
+
evaluate: (context) => evaluateCompiled(parts, context),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Parse an expression like "steps.X.data.field" or "env.HOME"
|
|
63
|
+
* Returns null if invalid syntax.
|
|
64
|
+
*/
|
|
65
|
+
function parseExpression(expr) {
|
|
66
|
+
const parts = expr.split(".");
|
|
67
|
+
if (parts.length < 2)
|
|
68
|
+
return null;
|
|
69
|
+
const root = parts[0];
|
|
70
|
+
const rest = parts.slice(1);
|
|
71
|
+
if (root === "steps" && rest.length >= 2) {
|
|
72
|
+
// steps.X.data or steps.X.data.field
|
|
73
|
+
return { path: expr, type: "step" };
|
|
74
|
+
}
|
|
75
|
+
if (root === "env" && rest.length === 1) {
|
|
76
|
+
// env.HOME
|
|
77
|
+
return { path: expr, type: "env" };
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
function evaluateCompiled(parts, context) {
|
|
82
|
+
const values = [];
|
|
83
|
+
for (const part of parts) {
|
|
84
|
+
if (typeof part === "string") {
|
|
85
|
+
values.push(part);
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
const result = evaluateExpression(part, context);
|
|
89
|
+
if ("error" in result) {
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
values.push(result.value);
|
|
93
|
+
}
|
|
94
|
+
return { value: values.join("") };
|
|
95
|
+
}
|
|
96
|
+
function evaluateExpression(expr, context) {
|
|
97
|
+
const parts = expr.path.split(".");
|
|
98
|
+
if (expr.type === "env") {
|
|
99
|
+
const key = parts[1];
|
|
100
|
+
if (!key)
|
|
101
|
+
return { value: "" };
|
|
102
|
+
// Object.hasOwn guards against prototype keys ("toString", "constructor",
|
|
103
|
+
// etc.) which would otherwise resolve to Object.prototype members.
|
|
104
|
+
const value = Object.hasOwn(context.env, key)
|
|
105
|
+
? context.env[key]
|
|
106
|
+
: undefined;
|
|
107
|
+
return {
|
|
108
|
+
value: value ?? "",
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
// steps.X.data.path...
|
|
112
|
+
const stepId = parts[1];
|
|
113
|
+
const dataKey = parts[2];
|
|
114
|
+
const pathRest = parts.slice(3);
|
|
115
|
+
if (!stepId || !dataKey) {
|
|
116
|
+
return { value: "" };
|
|
117
|
+
}
|
|
118
|
+
const step = Object.hasOwn(context.steps, stepId)
|
|
119
|
+
? context.steps[stepId]
|
|
120
|
+
: undefined;
|
|
121
|
+
if (!step) {
|
|
122
|
+
return {
|
|
123
|
+
error: {
|
|
124
|
+
type: "eval_error",
|
|
125
|
+
template: `{{${expr.path}}}`,
|
|
126
|
+
path: expr.path,
|
|
127
|
+
message: `Step '${stepId}' not found`,
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
if (dataKey !== "data" && dataKey !== "status" && dataKey !== "metadata") {
|
|
132
|
+
return {
|
|
133
|
+
error: {
|
|
134
|
+
type: "eval_error",
|
|
135
|
+
template: `{{${expr.path}}}`,
|
|
136
|
+
path: expr.path,
|
|
137
|
+
message: `Invalid step accessor '${dataKey}', expected 'data', 'status', or 'metadata'`,
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
let value = step[dataKey];
|
|
142
|
+
// Walk the rest of the path
|
|
143
|
+
for (const key of pathRest) {
|
|
144
|
+
if (value === null || value === undefined) {
|
|
145
|
+
return { value: "" }; // Missing path resolves to empty string
|
|
146
|
+
}
|
|
147
|
+
if (Array.isArray(value)) {
|
|
148
|
+
const index = parseInt(key, 10);
|
|
149
|
+
if (Number.isNaN(index) || index < 0 || index >= value.length) {
|
|
150
|
+
return { value: "" };
|
|
151
|
+
}
|
|
152
|
+
value = value[index];
|
|
153
|
+
}
|
|
154
|
+
else if (typeof value === "object") {
|
|
155
|
+
// Object.hasOwn guards against prototype keys leaking Object.prototype
|
|
156
|
+
// members (constructor, toString, valueOf, etc.) into the path walk.
|
|
157
|
+
const obj = value;
|
|
158
|
+
value = Object.hasOwn(obj, key) ? obj[key] : undefined;
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
return { value: "" };
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
// Serialize to string
|
|
165
|
+
if (value === null || value === undefined) {
|
|
166
|
+
return { value: "" };
|
|
167
|
+
}
|
|
168
|
+
if (typeof value === "string") {
|
|
169
|
+
return { value };
|
|
170
|
+
}
|
|
171
|
+
// Functions and other non-JSON-serializable values stringify to undefined,
|
|
172
|
+
// which would silently violate the { value: string } contract. Coerce to "".
|
|
173
|
+
const serialized = JSON.stringify(value);
|
|
174
|
+
return { value: serialized ?? "" };
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Convenience: compile and evaluate in one call.
|
|
178
|
+
* Prefer pre-compilation for repeated evaluations.
|
|
179
|
+
*/
|
|
180
|
+
export function evaluateTemplate(template, context) {
|
|
181
|
+
return compileTemplate(template).evaluate(context);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Validate all templates in a recipe at load time.
|
|
185
|
+
* Returns array of errors, empty if all valid.
|
|
186
|
+
*/
|
|
187
|
+
export function validateRecipeTemplates(templates) {
|
|
188
|
+
const errors = [];
|
|
189
|
+
for (const template of templates) {
|
|
190
|
+
const compiled = compileTemplate(template);
|
|
191
|
+
if (!compiled.hasTemplates)
|
|
192
|
+
continue; // literal — valid
|
|
193
|
+
// Probe with empty context: compile_error surfaces regardless of runtime values
|
|
194
|
+
const result = compiled.evaluate({ steps: {}, env: {} });
|
|
195
|
+
if ("error" in result && result.error.type === "compile_error") {
|
|
196
|
+
errors.push(result.error);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return errors;
|
|
200
|
+
}
|
|
201
|
+
//# sourceMappingURL=templateEngine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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