patchwork-os 0.2.0-beta.0 → 0.2.0-beta.10
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 +14 -14
- package/README.md +204 -34
- package/deploy/README.md +1 -1
- package/deploy/bootstrap-vps.sh +14 -9
- package/deploy/deploy-dashboard.sh +25 -1
- package/deploy/macos/README.md +153 -0
- package/deploy/macos/com.patchwork.bridge.plist.template +54 -0
- package/deploy/macos/com.patchwork.tunnel.plist.template +76 -0
- package/deploy/macos/install-mac-bridge.sh +244 -0
- package/deploy/macos/uninstall-mac-bridge.sh +22 -0
- package/dist/activityLog.d.ts +6 -0
- package/dist/activityLog.js +63 -26
- package/dist/activityLog.js.map +1 -1
- package/dist/adapters/claude.js +22 -16
- package/dist/adapters/claude.js.map +1 -1
- package/dist/adapters/gemini.js +15 -11
- package/dist/adapters/gemini.js.map +1 -1
- package/dist/adapters/openai.js +9 -9
- package/dist/adapters/openai.js.map +1 -1
- package/dist/ajv2020.d.ts +25 -0
- package/dist/ajv2020.js +33 -0
- package/dist/ajv2020.js.map +1 -0
- package/dist/analyticsAggregator.d.ts +5 -1
- package/dist/analyticsAggregator.js +16 -5
- package/dist/analyticsAggregator.js.map +1 -1
- package/dist/analyticsConfig.d.ts +29 -0
- package/dist/analyticsConfig.js +102 -0
- package/dist/analyticsConfig.js.map +1 -0
- package/dist/analyticsPrefs.d.ts +49 -2
- package/dist/analyticsPrefs.js +177 -19
- package/dist/analyticsPrefs.js.map +1 -1
- package/dist/analyticsSend.d.ts +17 -1
- package/dist/analyticsSend.js +67 -5
- package/dist/analyticsSend.js.map +1 -1
- package/dist/approvalHttp.d.ts +14 -0
- package/dist/approvalHttp.js +212 -9
- package/dist/approvalHttp.js.map +1 -1
- package/dist/approvalInsights.js +13 -5
- package/dist/approvalInsights.js.map +1 -1
- package/dist/approvalQueue.d.ts +97 -3
- package/dist/approvalQueue.js +193 -19
- package/dist/approvalQueue.js.map +1 -1
- package/dist/approvalSignals.js +19 -11
- package/dist/approvalSignals.js.map +1 -1
- package/dist/automation.d.ts +35 -10
- package/dist/automation.js +133 -37
- package/dist/automation.js.map +1 -1
- package/dist/automationSuggestions.js +10 -8
- package/dist/automationSuggestions.js.map +1 -1
- package/dist/bridge.d.ts +2 -0
- package/dist/bridge.js +238 -51
- package/dist/bridge.js.map +1 -1
- package/dist/bridgeLockDiscovery.d.ts +27 -1
- package/dist/bridgeLockDiscovery.js +38 -11
- package/dist/bridgeLockDiscovery.js.map +1 -1
- package/dist/bridgeToken.js +3 -2
- package/dist/bridgeToken.js.map +1 -1
- package/dist/claudeDriver.d.ts +0 -16
- package/dist/claudeDriver.js +42 -28
- package/dist/claudeDriver.js.map +1 -1
- package/dist/claudeMdPatch.d.ts +9 -3
- package/dist/claudeMdPatch.js +79 -13
- package/dist/claudeMdPatch.js.map +1 -1
- package/dist/claudeOrchestrator.d.ts +13 -1
- package/dist/claudeOrchestrator.js +89 -44
- package/dist/claudeOrchestrator.js.map +1 -1
- package/dist/commands/analytics.d.ts +8 -0
- package/dist/commands/analytics.js +134 -0
- package/dist/commands/analytics.js.map +1 -0
- package/dist/commands/auditEnv.d.ts +36 -0
- package/dist/commands/auditEnv.js +202 -0
- package/dist/commands/auditEnv.js.map +1 -0
- package/dist/commands/dashboard.js +8 -1
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/doctor.d.ts +35 -0
- package/dist/commands/doctor.js +51 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/install.js +3 -0
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/launchd.js +15 -16
- package/dist/commands/launchd.js.map +1 -1
- package/dist/commands/patchworkInit.d.ts +5 -0
- package/dist/commands/patchworkInit.js +89 -7
- package/dist/commands/patchworkInit.js.map +1 -1
- package/dist/commands/recipe.d.ts +110 -0
- package/dist/commands/recipe.js +512 -9
- package/dist/commands/recipe.js.map +1 -1
- package/dist/commands/recipeInstall.js +11 -4
- package/dist/commands/recipeInstall.js.map +1 -1
- package/dist/commands/shadowScan.d.ts +34 -0
- package/dist/commands/shadowScan.js +142 -0
- package/dist/commands/shadowScan.js.map +1 -0
- package/dist/commands/task.js +2 -2
- package/dist/commands/task.js.map +1 -1
- package/dist/commands/tools.d.ts +20 -1
- package/dist/commands/tools.js +112 -3
- package/dist/commands/tools.js.map +1 -1
- package/dist/commands/tracesImport.js +21 -4
- package/dist/commands/tracesImport.js.map +1 -1
- package/dist/commitIssueLinkLog.d.ts +24 -0
- package/dist/commitIssueLinkLog.js +160 -22
- package/dist/commitIssueLinkLog.js.map +1 -1
- package/dist/companions/registry.js +15 -7
- package/dist/companions/registry.js.map +1 -1
- package/dist/config.d.ts +49 -5
- package/dist/config.js +123 -22
- package/dist/config.js.map +1 -1
- package/dist/connectorRoutes.js +913 -413
- package/dist/connectorRoutes.js.map +1 -1
- package/dist/connectors/airtable.d.ts +230 -0
- package/dist/connectors/airtable.js +700 -0
- package/dist/connectors/airtable.js.map +1 -0
- package/dist/connectors/asana.js +13 -9
- package/dist/connectors/asana.js.map +1 -1
- package/dist/connectors/baseConnector.js +25 -3
- package/dist/connectors/baseConnector.js.map +1 -1
- package/dist/connectors/caldiy.d.ts +137 -0
- package/dist/connectors/caldiy.js +424 -0
- package/dist/connectors/caldiy.js.map +1 -0
- package/dist/connectors/circleci.d.ts +162 -0
- package/dist/connectors/circleci.js +576 -0
- package/dist/connectors/circleci.js.map +1 -0
- package/dist/connectors/cloudflare.d.ts +132 -0
- package/dist/connectors/cloudflare.js +622 -0
- package/dist/connectors/cloudflare.js.map +1 -0
- package/dist/connectors/confluence.js +35 -0
- package/dist/connectors/confluence.js.map +1 -1
- package/dist/connectors/connectorRedirectUri.d.ts +30 -0
- package/dist/connectors/connectorRedirectUri.js +38 -0
- package/dist/connectors/connectorRedirectUri.js.map +1 -0
- package/dist/connectors/connectorRegistry.d.ts +63 -0
- package/dist/connectors/connectorRegistry.js +354 -0
- package/dist/connectors/connectorRegistry.js.map +1 -0
- package/dist/connectors/datadog.js +33 -4
- package/dist/connectors/datadog.js.map +1 -1
- package/dist/connectors/discord.js +14 -10
- package/dist/connectors/discord.js.map +1 -1
- package/dist/connectors/elasticsearch.d.ts +141 -0
- package/dist/connectors/elasticsearch.js +601 -0
- package/dist/connectors/elasticsearch.js.map +1 -0
- package/dist/connectors/figma.d.ts +130 -0
- package/dist/connectors/figma.js +387 -0
- package/dist/connectors/figma.js.map +1 -0
- package/dist/connectors/github.d.ts +17 -0
- package/dist/connectors/github.js +53 -2
- package/dist/connectors/github.js.map +1 -1
- package/dist/connectors/gitlab.js +12 -6
- package/dist/connectors/gitlab.js.map +1 -1
- package/dist/connectors/gmail.js +72 -21
- package/dist/connectors/gmail.js.map +1 -1
- package/dist/connectors/googleCalendar.js +8 -8
- package/dist/connectors/googleCalendar.js.map +1 -1
- package/dist/connectors/googleDocs.d.ts +103 -0
- package/dist/connectors/googleDocs.js +409 -0
- package/dist/connectors/googleDocs.js.map +1 -0
- package/dist/connectors/googleDrive.d.ts +12 -0
- package/dist/connectors/googleDrive.js +35 -8
- package/dist/connectors/googleDrive.js.map +1 -1
- package/dist/connectors/grafana.d.ts +133 -0
- package/dist/connectors/grafana.js +478 -0
- package/dist/connectors/grafana.js.map +1 -0
- package/dist/connectors/jira.d.ts +25 -0
- package/dist/connectors/jira.js +245 -2
- package/dist/connectors/jira.js.map +1 -1
- package/dist/connectors/linear.js +1 -1
- package/dist/connectors/linear.js.map +1 -1
- package/dist/connectors/mcpOAuth.js +78 -16
- package/dist/connectors/mcpOAuth.js.map +1 -1
- package/dist/connectors/monday.d.ts +217 -0
- package/dist/connectors/monday.js +655 -0
- package/dist/connectors/monday.js.map +1 -0
- package/dist/connectors/mongodb.d.ts +139 -0
- package/dist/connectors/mongodb.js +455 -0
- package/dist/connectors/mongodb.js.map +1 -0
- package/dist/connectors/oauthStateStore.d.ts +20 -0
- package/dist/connectors/oauthStateStore.js +94 -4
- package/dist/connectors/oauthStateStore.js.map +1 -1
- package/dist/connectors/obsidian.d.ts +83 -0
- package/dist/connectors/obsidian.js +441 -0
- package/dist/connectors/obsidian.js.map +1 -0
- package/dist/connectors/paystack.d.ts +159 -0
- package/dist/connectors/paystack.js +607 -0
- package/dist/connectors/paystack.js.map +1 -0
- package/dist/connectors/pipedrive.d.ts +189 -0
- package/dist/connectors/pipedrive.js +559 -0
- package/dist/connectors/pipedrive.js.map +1 -0
- package/dist/connectors/postgres.d.ts +127 -0
- package/dist/connectors/postgres.js +512 -0
- package/dist/connectors/postgres.js.map +1 -0
- package/dist/connectors/posthog.d.ts +119 -0
- package/dist/connectors/posthog.js +479 -0
- package/dist/connectors/posthog.js.map +1 -0
- package/dist/connectors/redis.d.ts +140 -0
- package/dist/connectors/redis.js +571 -0
- package/dist/connectors/redis.js.map +1 -0
- package/dist/connectors/resend.d.ts +131 -0
- package/dist/connectors/resend.js +529 -0
- package/dist/connectors/resend.js.map +1 -0
- package/dist/connectors/salesforce.d.ts +136 -0
- package/dist/connectors/salesforce.js +603 -0
- package/dist/connectors/salesforce.js.map +1 -0
- package/dist/connectors/secrets.d.ts +51 -0
- package/dist/connectors/secrets.js +102 -0
- package/dist/connectors/secrets.js.map +1 -0
- package/dist/connectors/sendgrid.d.ts +102 -0
- package/dist/connectors/sendgrid.js +423 -0
- package/dist/connectors/sendgrid.js.map +1 -0
- package/dist/connectors/shopify.d.ts +145 -0
- package/dist/connectors/shopify.js +502 -0
- package/dist/connectors/shopify.js.map +1 -0
- package/dist/connectors/slack.d.ts +1 -1
- package/dist/connectors/slack.js +61 -9
- package/dist/connectors/slack.js.map +1 -1
- package/dist/connectors/snowflake.d.ts +119 -0
- package/dist/connectors/snowflake.js +615 -0
- package/dist/connectors/snowflake.js.map +1 -0
- package/dist/connectors/supabase.d.ts +92 -0
- package/dist/connectors/supabase.js +630 -0
- package/dist/connectors/supabase.js.map +1 -0
- package/dist/connectors/todoist.d.ts +117 -0
- package/dist/connectors/todoist.js +485 -0
- package/dist/connectors/todoist.js.map +1 -0
- package/dist/connectors/tokenStorage.js +56 -14
- package/dist/connectors/tokenStorage.js.map +1 -1
- package/dist/connectors/twilio.d.ts +118 -0
- package/dist/connectors/twilio.js +475 -0
- package/dist/connectors/twilio.js.map +1 -0
- package/dist/connectors/vercel.d.ts +110 -0
- package/dist/connectors/vercel.js +479 -0
- package/dist/connectors/vercel.js.map +1 -0
- package/dist/connectors/webflow.d.ts +118 -0
- package/dist/connectors/webflow.js +393 -0
- package/dist/connectors/webflow.js.map +1 -0
- package/dist/connectors/woocommerce.d.ts +220 -0
- package/dist/connectors/woocommerce.js +464 -0
- package/dist/connectors/woocommerce.js.map +1 -0
- package/dist/crypto.js +7 -2
- package/dist/crypto.js.map +1 -1
- package/dist/decisionReplay.js +15 -6
- package/dist/decisionReplay.js.map +1 -1
- package/dist/decisionTraceLog.d.ts +28 -0
- package/dist/decisionTraceLog.js +156 -29
- package/dist/decisionTraceLog.js.map +1 -1
- package/dist/drivers/claude/api.js +5 -4
- package/dist/drivers/claude/api.js.map +1 -1
- package/dist/drivers/claude/envSanitizer.d.ts +0 -6
- package/dist/drivers/claude/envSanitizer.js +17 -2
- package/dist/drivers/claude/envSanitizer.js.map +1 -1
- package/dist/drivers/claude/streamParser.js +5 -4
- package/dist/drivers/claude/streamParser.js.map +1 -1
- package/dist/drivers/claude/subprocess.d.ts +12 -2
- package/dist/drivers/claude/subprocess.js +100 -8
- package/dist/drivers/claude/subprocess.js.map +1 -1
- package/dist/drivers/gemini/api.d.ts +18 -0
- package/dist/drivers/gemini/api.js +29 -0
- package/dist/drivers/gemini/api.js.map +1 -0
- package/dist/drivers/gemini/index.d.ts +22 -0
- package/dist/drivers/gemini/index.js +256 -129
- package/dist/drivers/gemini/index.js.map +1 -1
- package/dist/drivers/index.d.ts +3 -1
- package/dist/drivers/index.js +9 -1
- package/dist/drivers/index.js.map +1 -1
- package/dist/drivers/local/index.d.ts +43 -0
- package/dist/drivers/local/index.js +140 -0
- package/dist/drivers/local/index.js.map +1 -0
- package/dist/drivers/openai/index.js +30 -2
- package/dist/drivers/openai/index.js.map +1 -1
- package/dist/extensionClient.d.ts +37 -4
- package/dist/extensionClient.js +58 -16
- package/dist/extensionClient.js.map +1 -1
- package/dist/featureFlags.d.ts +91 -0
- package/dist/featureFlags.js +174 -3
- package/dist/featureFlags.js.map +1 -1
- package/dist/fileLock.js +21 -12
- package/dist/fileLock.js.map +1 -1
- package/dist/fileLockSync.d.ts +67 -0
- package/dist/fileLockSync.js +126 -0
- package/dist/fileLockSync.js.map +1 -0
- package/dist/fp/activityAnalytics.js +26 -12
- package/dist/fp/activityAnalytics.js.map +1 -1
- package/dist/fp/automationInterpreter.d.ts +15 -1
- package/dist/fp/automationInterpreter.js +217 -82
- package/dist/fp/automationInterpreter.js.map +1 -1
- package/dist/fp/automationProgram.d.ts +30 -0
- package/dist/fp/automationProgram.js.map +1 -1
- package/dist/fp/automationState.d.ts +24 -5
- package/dist/fp/automationState.js +56 -9
- package/dist/fp/automationState.js.map +1 -1
- package/dist/fp/automationUtils.js +1 -1
- package/dist/fp/automationUtils.js.map +1 -1
- package/dist/fp/commandDescription.js +7 -1
- package/dist/fp/commandDescription.js.map +1 -1
- package/dist/fp/extensionSnapshot.js +8 -2
- package/dist/fp/extensionSnapshot.js.map +1 -1
- package/dist/fp/interpreterContext.d.ts +66 -1
- package/dist/fp/interpreterContext.js +91 -1
- package/dist/fp/interpreterContext.js.map +1 -1
- package/dist/fp/policyParser.js +29 -1
- package/dist/fp/policyParser.js.map +1 -1
- package/dist/fsWatchWithFallback.d.ts +36 -0
- package/dist/fsWatchWithFallback.js +128 -0
- package/dist/fsWatchWithFallback.js.map +1 -0
- package/dist/haltPushDispatch.d.ts +33 -0
- package/dist/haltPushDispatch.js +103 -0
- package/dist/haltPushDispatch.js.map +1 -0
- package/dist/httpBodyValidation.d.ts +41 -0
- package/dist/httpBodyValidation.js +45 -0
- package/dist/httpBodyValidation.js.map +1 -0
- package/dist/httpErrorResponse.d.ts +36 -0
- package/dist/httpErrorResponse.js +46 -0
- package/dist/httpErrorResponse.js.map +1 -0
- package/dist/inboxRoutes.d.ts +22 -0
- package/dist/inboxRoutes.js +151 -12
- package/dist/inboxRoutes.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1054 -76
- package/dist/index.js.map +1 -1
- package/dist/installGuard.js +6 -2
- package/dist/installGuard.js.map +1 -1
- package/dist/lockfile.js +31 -4
- package/dist/lockfile.js.map +1 -1
- package/dist/oauth.d.ts +22 -0
- package/dist/oauth.js +46 -0
- package/dist/oauth.js.map +1 -1
- package/dist/oauthRoutes.d.ts +1 -1
- package/dist/oauthRoutes.js +8 -11
- package/dist/oauthRoutes.js.map +1 -1
- package/dist/orchestrator/childBridgeRegistry.js +29 -11
- package/dist/orchestrator/childBridgeRegistry.js.map +1 -1
- package/dist/patchworkConfig.d.ts +57 -1
- package/dist/patchworkConfig.js +125 -5
- package/dist/patchworkConfig.js.map +1 -1
- package/dist/pluginLoader.js +10 -1
- package/dist/pluginLoader.js.map +1 -1
- package/dist/pluginWatcher.js +12 -14
- package/dist/pluginWatcher.js.map +1 -1
- package/dist/preToolUseHook.js +10 -3
- package/dist/preToolUseHook.js.map +1 -1
- package/dist/processTree.d.ts +34 -0
- package/dist/processTree.js +105 -0
- package/dist/processTree.js.map +1 -0
- package/dist/prompts.js +7 -3
- package/dist/prompts.js.map +1 -1
- package/dist/recipeOrchestration.d.ts +9 -0
- package/dist/recipeOrchestration.js +354 -27
- package/dist/recipeOrchestration.js.map +1 -1
- package/dist/recipeRoutes.d.ts +63 -2
- package/dist/recipeRoutes.js +790 -137
- package/dist/recipeRoutes.js.map +1 -1
- package/dist/recipes/RecipeOrchestrator.d.ts +2 -0
- package/dist/recipes/RecipeOrchestrator.js +6 -1
- package/dist/recipes/RecipeOrchestrator.js.map +1 -1
- package/dist/recipes/agentExecutor.d.ts +34 -5
- package/dist/recipes/agentExecutor.js +5 -4
- package/dist/recipes/agentExecutor.js.map +1 -1
- package/dist/recipes/chainedRunner.d.ts +2 -0
- package/dist/recipes/chainedRunner.js +142 -5
- package/dist/recipes/chainedRunner.js.map +1 -1
- package/dist/recipes/connectorPreflight.d.ts +66 -0
- package/dist/recipes/connectorPreflight.js +169 -0
- package/dist/recipes/connectorPreflight.js.map +1 -0
- package/dist/recipes/dependencyGraph.js +13 -5
- package/dist/recipes/dependencyGraph.js.map +1 -1
- package/dist/recipes/githubInstallSource.d.ts +128 -0
- package/dist/recipes/githubInstallSource.js +206 -0
- package/dist/recipes/githubInstallSource.js.map +1 -0
- package/dist/recipes/haltCategory.d.ts +119 -0
- package/dist/recipes/haltCategory.js +188 -0
- package/dist/recipes/haltCategory.js.map +1 -0
- package/dist/recipes/idempotencyKey.d.ts +134 -0
- package/dist/recipes/idempotencyKey.js +322 -0
- package/dist/recipes/idempotencyKey.js.map +1 -0
- package/dist/recipes/installer.js +48 -2
- package/dist/recipes/installer.js.map +1 -1
- package/dist/recipes/judgeSummary.d.ts +50 -0
- package/dist/recipes/judgeSummary.js +47 -0
- package/dist/recipes/judgeSummary.js.map +1 -0
- package/dist/recipes/judgeVerdict.d.ts +48 -0
- package/dist/recipes/judgeVerdict.js +174 -0
- package/dist/recipes/judgeVerdict.js.map +1 -0
- package/dist/recipes/migrations/index.d.ts +9 -0
- package/dist/recipes/migrations/index.js +133 -0
- package/dist/recipes/migrations/index.js.map +1 -1
- package/dist/recipes/names.d.ts +20 -0
- package/dist/recipes/names.js +25 -0
- package/dist/recipes/names.js.map +1 -1
- package/dist/recipes/parser.js +88 -5
- package/dist/recipes/parser.js.map +1 -1
- package/dist/recipes/replayRun.js +1 -1
- package/dist/recipes/replayRun.js.map +1 -1
- package/dist/recipes/runBudget.d.ts +70 -0
- package/dist/recipes/runBudget.js +109 -0
- package/dist/recipes/runBudget.js.map +1 -0
- package/dist/recipes/scheduler.d.ts +30 -0
- package/dist/recipes/scheduler.js +69 -19
- package/dist/recipes/scheduler.js.map +1 -1
- package/dist/recipes/schema.d.ts +36 -0
- package/dist/recipes/schemaGenerator.js +103 -5
- package/dist/recipes/schemaGenerator.js.map +1 -1
- package/dist/recipes/stepObservation.js +9 -0
- package/dist/recipes/stepObservation.js.map +1 -1
- package/dist/recipes/toolRegistry.js +20 -3
- package/dist/recipes/toolRegistry.js.map +1 -1
- package/dist/recipes/tools/fanOut.d.ts +20 -0
- package/dist/recipes/tools/fanOut.js +199 -0
- package/dist/recipes/tools/fanOut.js.map +1 -0
- package/dist/recipes/tools/file.js +5 -2
- package/dist/recipes/tools/file.js.map +1 -1
- package/dist/recipes/tools/github.d.ts +1 -1
- package/dist/recipes/tools/github.js +75 -1
- package/dist/recipes/tools/github.js.map +1 -1
- package/dist/recipes/tools/gmail.js +45 -6
- package/dist/recipes/tools/gmail.js.map +1 -1
- package/dist/recipes/tools/googleDrive.js +64 -0
- package/dist/recipes/tools/googleDrive.js.map +1 -1
- package/dist/recipes/tools/http.d.ts +10 -0
- package/dist/recipes/tools/http.js +176 -0
- package/dist/recipes/tools/http.js.map +1 -0
- package/dist/recipes/tools/index.d.ts +2 -0
- package/dist/recipes/tools/index.js +2 -0
- package/dist/recipes/tools/index.js.map +1 -1
- package/dist/recipes/tools/slack.js +1 -1
- package/dist/recipes/validation.d.ts +17 -0
- package/dist/recipes/validation.js +29 -11
- package/dist/recipes/validation.js.map +1 -1
- package/dist/recipes/workspaceRoot.d.ts +37 -0
- package/dist/recipes/workspaceRoot.js +73 -0
- package/dist/recipes/workspaceRoot.js.map +1 -0
- package/dist/recipes/yamlPositions.d.ts +56 -0
- package/dist/recipes/yamlPositions.js +183 -0
- package/dist/recipes/yamlPositions.js.map +1 -0
- package/dist/recipes/yamlRunner.d.ts +195 -8
- package/dist/recipes/yamlRunner.js +877 -209
- package/dist/recipes/yamlRunner.js.map +1 -1
- package/dist/recipesHttp.d.ts +33 -3
- package/dist/recipesHttp.js +126 -12
- package/dist/recipesHttp.js.map +1 -1
- package/dist/resources.js +21 -13
- package/dist/resources.js.map +1 -1
- package/dist/runLog.d.ts +58 -5
- package/dist/runLog.js +98 -21
- package/dist/runLog.js.map +1 -1
- package/dist/sanitizeParsedJson.d.ts +39 -0
- package/dist/sanitizeParsedJson.js +55 -0
- package/dist/sanitizeParsedJson.js.map +1 -0
- package/dist/schemas/recipe.v1.json +885 -196
- package/dist/server.d.ts +166 -3
- package/dist/server.js +1313 -332
- package/dist/server.js.map +1 -1
- package/dist/sessionCheckpoint.d.ts +8 -0
- package/dist/sessionCheckpoint.js +33 -3
- package/dist/sessionCheckpoint.js.map +1 -1
- package/dist/ssrfGuard.d.ts +16 -0
- package/dist/ssrfGuard.js +87 -4
- package/dist/ssrfGuard.js.map +1 -1
- package/dist/streamableHttp.d.ts +9 -4
- package/dist/streamableHttp.js +76 -20
- package/dist/streamableHttp.js.map +1 -1
- package/dist/telemetry.js +19 -12
- package/dist/telemetry.js.map +1 -1
- package/dist/testing/shadowRun.d.ts +52 -0
- package/dist/testing/shadowRun.js +71 -0
- package/dist/testing/shadowRun.js.map +1 -0
- package/dist/tools/batchLsp.d.ts +3 -0
- package/dist/tools/bridgeDoctor.d.ts +11 -0
- package/dist/tools/bridgeDoctor.js +48 -2
- package/dist/tools/bridgeDoctor.js.map +1 -1
- package/dist/tools/bridgeStatus.d.ts +0 -12
- package/dist/tools/bridgeStatus.js +2 -28
- package/dist/tools/bridgeStatus.js.map +1 -1
- package/dist/tools/cancelClaudeTask.d.ts +1 -0
- package/dist/tools/clipboard.d.ts +2 -0
- package/dist/tools/closeTabs.d.ts +1 -0
- package/dist/tools/codeLens.d.ts +1 -0
- package/dist/tools/createIssueFromAIComment.d.ts +1 -0
- package/dist/tools/ctxGetTaskContext.d.ts +9 -0
- package/dist/tools/ctxGetTaskContext.js +50 -2
- package/dist/tools/ctxGetTaskContext.js.map +1 -1
- package/dist/tools/ctxQueryTraces.js +32 -24
- package/dist/tools/ctxQueryTraces.js.map +1 -1
- 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/detectUnusedCode.js +9 -7
- package/dist/tools/detectUnusedCode.js.map +1 -1
- package/dist/tools/documentLinks.d.ts +1 -0
- package/dist/tools/editText.d.ts +1 -0
- package/dist/tools/editText.js +2 -1
- package/dist/tools/editText.js.map +1 -1
- package/dist/tools/enrichCommit.d.ts +1 -0
- package/dist/tools/enrichStackTrace.js +11 -5
- package/dist/tools/enrichStackTrace.js.map +1 -1
- package/dist/tools/explainDiagnostic.d.ts +1 -0
- package/dist/tools/explainSymbol.d.ts +1 -0
- package/dist/tools/fileOperations.d.ts +3 -0
- package/dist/tools/fileOperations.js +2 -1
- package/dist/tools/fileOperations.js.map +1 -1
- package/dist/tools/fileWatcher.d.ts +2 -0
- package/dist/tools/fileWatcher.js +8 -2
- package/dist/tools/fileWatcher.js.map +1 -1
- package/dist/tools/findFiles.d.ts +1 -0
- package/dist/tools/fixAllLintErrors.d.ts +1 -0
- package/dist/tools/fixAllLintErrors.js +10 -5
- package/dist/tools/fixAllLintErrors.js.map +1 -1
- package/dist/tools/foldingRanges.d.ts +1 -0
- package/dist/tools/formatDocument.d.ts +1 -0
- package/dist/tools/formatDocument.js +10 -5
- package/dist/tools/formatDocument.js.map +1 -1
- package/dist/tools/generateTests.d.ts +1 -0
- package/dist/tools/getAIComments.d.ts +1 -0
- package/dist/tools/getAnalyticsReport.js +5 -1
- package/dist/tools/getAnalyticsReport.js.map +1 -1
- package/dist/tools/getBufferContent.d.ts +1 -0
- package/dist/tools/getChangeImpact.d.ts +1 -0
- package/dist/tools/getChangeImpact.js +23 -14
- package/dist/tools/getChangeImpact.js.map +1 -1
- package/dist/tools/getClaudeTaskStatus.d.ts +1 -0
- package/dist/tools/getCodeCoverage.d.ts +1 -0
- package/dist/tools/getCodeCoverage.js +32 -14
- package/dist/tools/getCodeCoverage.js.map +1 -1
- package/dist/tools/getCommitsForIssue.d.ts +1 -0
- package/dist/tools/getDebugState.d.ts +1 -0
- package/dist/tools/getDiagnostics.js +32 -29
- package/dist/tools/getDiagnostics.js.map +1 -1
- package/dist/tools/getDiffFromHandoff.js +8 -2
- package/dist/tools/getDiffFromHandoff.js.map +1 -1
- package/dist/tools/getDocumentSymbols.d.ts +1 -0
- package/dist/tools/getGitHotspots.d.ts +1 -0
- package/dist/tools/getImportedSignatures.d.ts +1 -0
- package/dist/tools/getImportedSignatures.js +18 -14
- package/dist/tools/getImportedSignatures.js.map +1 -1
- package/dist/tools/getPRTemplate.d.ts +1 -0
- package/dist/tools/getProjectContext.js +23 -10
- package/dist/tools/getProjectContext.js.map +1 -1
- package/dist/tools/getSymbolHistory.d.ts +1 -0
- package/dist/tools/getToolCapabilities.d.ts +10 -5
- package/dist/tools/getToolCapabilities.js +79 -202
- package/dist/tools/getToolCapabilities.js.map +1 -1
- package/dist/tools/getTypeSignature.d.ts +1 -0
- package/dist/tools/getWorkspaceSettings.d.ts +1 -0
- package/dist/tools/gitWrite.d.ts +11 -0
- package/dist/tools/github/actions.d.ts +2 -0
- package/dist/tools/github/composite.d.ts +3 -0
- package/dist/tools/github/issues.d.ts +4 -0
- package/dist/tools/github/pr.d.ts +7 -0
- package/dist/tools/handoffNote.d.ts +1 -0
- package/dist/tools/handoffNote.js +2 -1
- package/dist/tools/handoffNote.js.map +1 -1
- package/dist/tools/headless/lspClient.js +3 -0
- package/dist/tools/headless/lspClient.js.map +1 -1
- package/dist/tools/hoverAtCursor.d.ts +1 -0
- package/dist/tools/httpClient.d.ts +2 -0
- package/dist/tools/httpClient.js +38 -71
- package/dist/tools/httpClient.js.map +1 -1
- package/dist/tools/inlayHints.d.ts +1 -0
- package/dist/tools/launchQuickTask.d.ts +1 -0
- package/dist/tools/listClaudeTasks.d.ts +1 -0
- package/dist/tools/listClaudeTasks.js +10 -8
- package/dist/tools/listClaudeTasks.js.map +1 -1
- package/dist/tools/listTerminals.d.ts +1 -0
- package/dist/tools/lsp.d.ts +15 -0
- package/dist/tools/lsp.js +17 -0
- package/dist/tools/lsp.js.map +1 -1
- package/dist/tools/navigateToSymbolByName.d.ts +1 -0
- package/dist/tools/openDiff.d.ts +1 -0
- package/dist/tools/openDiff.js +4 -1
- package/dist/tools/openDiff.js.map +1 -1
- package/dist/tools/openFile.d.ts +1 -0
- package/dist/tools/openFile.js +4 -1
- package/dist/tools/openFile.js.map +1 -1
- package/dist/tools/openInBrowser.js +6 -1
- package/dist/tools/openInBrowser.js.map +1 -1
- package/dist/tools/organizeImports.d.ts +1 -0
- package/dist/tools/organizeImports.js +5 -3
- package/dist/tools/organizeImports.js.map +1 -1
- package/dist/tools/performanceReport.js +5 -3
- package/dist/tools/performanceReport.js.map +1 -1
- package/dist/tools/planPersistence.d.ts +3 -0
- package/dist/tools/planPersistence.js +4 -1
- package/dist/tools/planPersistence.js.map +1 -1
- package/dist/tools/previewEdit.d.ts +1 -0
- package/dist/tools/previewEdit.js +15 -4
- package/dist/tools/previewEdit.js.map +1 -1
- package/dist/tools/recentTracesDigest.js +54 -11
- package/dist/tools/recentTracesDigest.js.map +1 -1
- package/dist/tools/refactorAnalyze.d.ts +1 -0
- package/dist/tools/refactorExtractFunction.js +4 -1
- package/dist/tools/refactorExtractFunction.js.map +1 -1
- package/dist/tools/refactorPreview.d.ts +1 -0
- package/dist/tools/refactorPreview.js +10 -2
- package/dist/tools/refactorPreview.js.map +1 -1
- package/dist/tools/replaceBlock.d.ts +1 -0
- package/dist/tools/replaceBlock.js +2 -1
- package/dist/tools/replaceBlock.js.map +1 -1
- package/dist/tools/resumeClaudeTask.d.ts +1 -0
- package/dist/tools/runClaudeTask.d.ts +1 -0
- package/dist/tools/runCommand.js +5 -0
- package/dist/tools/runCommand.js.map +1 -1
- package/dist/tools/runTests.js +15 -4
- package/dist/tools/runTests.js.map +1 -1
- package/dist/tools/screenshot.d.ts +1 -0
- package/dist/tools/screenshotAndAnnotate.js +6 -2
- package/dist/tools/screenshotAndAnnotate.js.map +1 -1
- package/dist/tools/searchAndReplace.d.ts +1 -0
- package/dist/tools/searchAndReplace.js +17 -7
- package/dist/tools/searchAndReplace.js.map +1 -1
- package/dist/tools/searchTools.js +20 -19
- 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/signatureHelp.d.ts +1 -0
- package/dist/tools/spawnWorkspace.js +15 -7
- package/dist/tools/spawnWorkspace.js.map +1 -1
- package/dist/tools/terminal.d.ts +6 -0
- package/dist/tools/terminal.js +4 -0
- package/dist/tools/terminal.js.map +1 -1
- package/dist/tools/testRunners/pytest.js +6 -2
- package/dist/tools/testRunners/pytest.js.map +1 -1
- package/dist/tools/testRunners/vitestJest.js +3 -1
- package/dist/tools/testRunners/vitestJest.js.map +1 -1
- package/dist/tools/testTraceToSource.d.ts +1 -0
- package/dist/tools/transaction.d.ts +4 -0
- package/dist/tools/transaction.js +4 -1
- package/dist/tools/transaction.js.map +1 -1
- package/dist/tools/typeHierarchy.d.ts +1 -0
- package/dist/tools/utils.d.ts +22 -0
- package/dist/tools/utils.js +158 -14
- 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/transport.d.ts +3 -1
- package/dist/transport.js +103 -52
- package/dist/transport.js.map +1 -1
- package/dist/winShim.d.ts +34 -0
- package/dist/winShim.js +94 -0
- package/dist/winShim.js.map +1 -0
- package/dist/wireHaltPushDispatch.d.ts +38 -0
- package/dist/wireHaltPushDispatch.js +71 -0
- package/dist/wireHaltPushDispatch.js.map +1 -0
- package/dist/writeFileAtomic.d.ts +23 -0
- package/dist/writeFileAtomic.js +121 -0
- package/dist/writeFileAtomic.js.map +1 -0
- package/package.json +23 -7
- package/scripts/postinstall.mjs +42 -2
- package/scripts/smoke/run-all.mjs +213 -0
- package/scripts/start-all.mjs +572 -0
- package/scripts/start-all.ps1 +209 -0
- package/scripts/start-all.sh +77 -19
- package/scripts/start-orchestrator.ps1 +158 -0
- package/scripts/start-remote.mjs +122 -0
- package/templates/automation-policies/recipe-authoring.json +1 -1
- package/templates/automation-policies/security-first.json +1 -1
- package/templates/automation-policies/strict-lint.json +1 -1
- package/templates/automation-policies/test-driven.json +1 -1
- package/templates/automation-policy.example.json +1 -1
- package/templates/co.patchwork-os.bridge.plist +2 -2
- package/templates/recipes/approval-queue-ui-test.yaml +205 -0
- package/templates/recipes/ctx-loop-test.yaml +1 -1
- package/templates/recipes/fix-errors-on-save.yaml +71 -0
- package/templates/recipes/morning-brief.yaml +5 -2
- package/templates/recipes/project-health-check.yaml +4 -1
- package/templates/recipes/sentry-to-linear.yaml +72 -38
- package/templates/recipes/webhook/apple-watch-health-log.yaml +145 -0
- package/templates/recipes/webhook/customer-escalation.yaml +8 -9
- package/templates/recipes/webhook/meeting-prep.yaml +11 -5
- package/dist/commands/marketplace.d.ts +0 -11
- package/dist/commands/marketplace.js +0 -120
- package/dist/commands/marketplace.js.map +0 -1
- package/dist/recipes/legacyRecipeCompat.d.ts +0 -10
- package/dist/recipes/legacyRecipeCompat.js +0 -131
- package/dist/recipes/legacyRecipeCompat.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_comment": "strict-lint — triggers on every save and error, enforces zero-warning policy.",
|
|
3
|
-
"_usage": "Copy to automation-policy.json. Requires --automation --automation-policy <path> --
|
|
3
|
+
"_usage": "Copy to automation-policy.json. Requires --automation --automation-policy <path> --driver subprocess",
|
|
4
4
|
|
|
5
5
|
"automationSystemPrompt": "Automation bot. Drop articles/filler. Fragments OK. Abbreviate: DB/auth/config/req/res/fn. X→Y arrows. ≤5 lines. No preamble. Call tools → report results only.",
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_comment": "test-driven — enforces test coverage and runs tests automatically on every relevant change.",
|
|
3
|
-
"_usage": "Copy to automation-policy.json. Requires --automation --automation-policy <path> --
|
|
3
|
+
"_usage": "Copy to automation-policy.json. Requires --automation --automation-policy <path> --driver subprocess",
|
|
4
4
|
|
|
5
5
|
"automationSystemPrompt": "Automation bot. Drop articles/filler. Fragments OK. Abbreviate: DB/auth/config/req/res/fn. X→Y arrows. ≤5 lines. No preamble. Call tools → report results only.",
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_comment": "Example automation policy with LSP-aware prompts. Copy to automation-policy.json and adjust as needed.",
|
|
3
|
-
"_usage": "Start bridge with: claude-ide-bridge --automation --automation-policy ./automation-policy.json --
|
|
3
|
+
"_usage": "Start bridge with: claude-ide-bridge --automation --automation-policy ./automation-policy.json --driver subprocess",
|
|
4
4
|
|
|
5
5
|
"onFileChanged": {
|
|
6
6
|
"enabled": true,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<key>ProgramArguments</key>
|
|
9
9
|
<array>
|
|
10
10
|
<string>__BINARY_PATH__</string>
|
|
11
|
-
<string>--
|
|
11
|
+
<string>--driver</string>
|
|
12
12
|
<string>subprocess</string>
|
|
13
13
|
</array>
|
|
14
14
|
<key>RunAtLoad</key>
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<key>HOME</key>
|
|
25
25
|
<string>__HOME__</string>
|
|
26
26
|
<key>PATH</key>
|
|
27
|
-
<string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin</string>
|
|
27
|
+
<string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
|
|
28
28
|
</dict>
|
|
29
29
|
<key>WorkingDirectory</key>
|
|
30
30
|
<string>__HOME__</string>
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://raw.githubusercontent.com/patchworkos/recipes/main/schema/recipe.v1.json
|
|
2
|
+
apiVersion: patchwork.sh/v1
|
|
3
|
+
name: approval-queue-ui-test
|
|
4
|
+
description: |
|
|
5
|
+
End-to-end UI test for the dashboard Approval queue page. Drives a real
|
|
6
|
+
browser via the Playwright MCP server to exercise every button on
|
|
7
|
+
/approvals, verifies the expected side effects (network calls, clipboard
|
|
8
|
+
writes, DOM state, keyboard shortcuts), and writes a PASS/FAIL report to
|
|
9
|
+
~/.patchwork/inbox/.
|
|
10
|
+
|
|
11
|
+
Coverage:
|
|
12
|
+
Header — DecisionsTabs (Pending / Suggested / History), Sync inbox
|
|
13
|
+
Risk filters — All / Low / Medium / High chips
|
|
14
|
+
Card body — params toggle (▸/▾), Copy JSON, Approve (E), Reject (X),
|
|
15
|
+
Edit & approve (clipboard), Open in terminal (clipboard)
|
|
16
|
+
Selection — per-card checkbox, Select all, batch Approve, batch Reject
|
|
17
|
+
Empty state — Clear filter (filtered) and Clear filter (session banner)
|
|
18
|
+
Suggestions card — Copy allow rule, Dismiss (×), Clear all patterns
|
|
19
|
+
Keyboard — J / K (focus), E / X (decide)
|
|
20
|
+
|
|
21
|
+
PREREQUISITES
|
|
22
|
+
1. Bridge running with --driver subprocess so the agent has MCP
|
|
23
|
+
access to the Playwright server.
|
|
24
|
+
2. Dashboard reachable at DASHBOARD_URL (defaults to localhost:3000;
|
|
25
|
+
Patchwork's Next.js dev typically mounts under /dashboard, so the
|
|
26
|
+
page at $DASHBOARD_URL/approvals must respond 200).
|
|
27
|
+
3. approvalGate must be "all" or "high" — if "off", every POST
|
|
28
|
+
/approvals auto-allows ({decision:"allow",reason:"gate_off"}) and
|
|
29
|
+
the queue stays empty. The agent toggles it on at the start of the
|
|
30
|
+
run and restores it at the end.
|
|
31
|
+
4. Seeded pending approvals — the agent creates them via POST
|
|
32
|
+
/api/bridge/approvals with nohup+disown durability (so the curl
|
|
33
|
+
process survives shell exit; see seeding step). Default TTL is
|
|
34
|
+
5 min, so all UI work must finish before re-seeding.
|
|
35
|
+
5. Trigger from the dashboard Recipes page (NOT `patchwork recipe run`)
|
|
36
|
+
— the local subprocess shell has no MCP context.
|
|
37
|
+
|
|
38
|
+
IMPLEMENTATION NOTES (learned from 2026-05-07 dogfood)
|
|
39
|
+
- Click via mcp__playwright__browser_click (real Playwright clicks),
|
|
40
|
+
NOT browser_evaluate(.click()) — Chromium's clipboard.writeText
|
|
41
|
+
requires "transient activation" which programmatic clicks don't
|
|
42
|
+
provide. Edit & approve / Open in terminal silently fail otherwise.
|
|
43
|
+
- Same goes for checkboxes — programmatic input.click() doesn't
|
|
44
|
+
always trigger React's onChange synthetic event reliably.
|
|
45
|
+
- Use the URL ?session= param to force the session-banner branch;
|
|
46
|
+
no need to find a real session.
|
|
47
|
+
- Use the "Low (0)" filter to hit the empty-state branch deterministically
|
|
48
|
+
(without rejecting cards mid-test).
|
|
49
|
+
trigger:
|
|
50
|
+
type: manual
|
|
51
|
+
vars:
|
|
52
|
+
- name: DASHBOARD_URL
|
|
53
|
+
description: "Base URL where the dashboard is reachable from the agent's browser"
|
|
54
|
+
required: false
|
|
55
|
+
default: "http://localhost:3000"
|
|
56
|
+
steps:
|
|
57
|
+
- id: drive_browser
|
|
58
|
+
agent:
|
|
59
|
+
driver: claude-code
|
|
60
|
+
model: claude-haiku-4-5-20251001
|
|
61
|
+
prompt: |
|
|
62
|
+
You are running an end-to-end UI test of the Patchwork Approval
|
|
63
|
+
queue page. Use the Playwright MCP tools (mcp__playwright__*) to
|
|
64
|
+
drive a real browser. Do not skip steps. If a tool call errors,
|
|
65
|
+
record the failure and continue — every checkpoint must be
|
|
66
|
+
attempted so the report is complete.
|
|
67
|
+
|
|
68
|
+
BASE_URL: {{DASHBOARD_URL}}
|
|
69
|
+
TARGET: {{DASHBOARD_URL}}/approvals
|
|
70
|
+
|
|
71
|
+
Use mcp__playwright__browser_snapshot between actions to confirm
|
|
72
|
+
DOM state. Use mcp__playwright__browser_evaluate to read
|
|
73
|
+
navigator.clipboard.readText() (after granting clipboard-read
|
|
74
|
+
permission via browser_evaluate of the appropriate Permissions
|
|
75
|
+
API call) to verify clipboard-writing buttons.
|
|
76
|
+
|
|
77
|
+
## Checklist — record PASS / FAIL + a one-line note for each
|
|
78
|
+
|
|
79
|
+
### A. Page load + tabs (DecisionsTabs)
|
|
80
|
+
A1. browser_navigate to TARGET. Snapshot. Confirm h1 contains
|
|
81
|
+
"Approval queue".
|
|
82
|
+
A2. Click the "Suggested" tab. Confirm URL becomes /suggestions.
|
|
83
|
+
A3. browser_navigate_back. Confirm URL returns to /approvals.
|
|
84
|
+
A4. Click the "History" tab. Confirm URL becomes /decisions.
|
|
85
|
+
A5. browser_navigate_back to /approvals.
|
|
86
|
+
|
|
87
|
+
### B. Header controls
|
|
88
|
+
B1. Click "Sync inbox". Use browser_network_requests to confirm a
|
|
89
|
+
GET request to /api/bridge/approvals fired within 2s.
|
|
90
|
+
|
|
91
|
+
### C. Risk filter chips (All / Low / Medium / High)
|
|
92
|
+
For each label in [All, Low, Medium, High]:
|
|
93
|
+
C{n}. Click the filter chip with text starting with that label.
|
|
94
|
+
Confirm aria-pressed="true" on the clicked chip and
|
|
95
|
+
aria-pressed="false" on the others. Confirm the URL
|
|
96
|
+
?risk= param matches (or is absent for "All").
|
|
97
|
+
|
|
98
|
+
### D. Per-card controls — pick the FIRST visible approval card
|
|
99
|
+
Skip section D with a clear note if the queue is empty.
|
|
100
|
+
D1. Click the card's "Full params" toggle (▸). Confirm it
|
|
101
|
+
switches to ▾ and the params JSON region expands.
|
|
102
|
+
D2. Click "Copy JSON". Read clipboard; confirm it parses as JSON
|
|
103
|
+
and equals the card's params.
|
|
104
|
+
D3. Click "Edit & approve". Read clipboard; confirm it starts
|
|
105
|
+
with "patchwork approve --edit ".
|
|
106
|
+
D4. Click "› Open in terminal". Read clipboard; confirm it
|
|
107
|
+
starts with "patchwork approve " (no --edit).
|
|
108
|
+
D5. Note the card's callId, then click the per-card checkbox.
|
|
109
|
+
Confirm the checkbox is checked and the BatchActionBar
|
|
110
|
+
renders with "1 selected".
|
|
111
|
+
D6. Uncheck the same checkbox. Confirm BatchActionBar disappears.
|
|
112
|
+
|
|
113
|
+
### E. Select-all + batch (only if filtered.length > 1)
|
|
114
|
+
Skip with a note if there are fewer than 2 cards.
|
|
115
|
+
E1. Click "Select all". Confirm every visible card checkbox is
|
|
116
|
+
checked.
|
|
117
|
+
E2. Confirm BatchActionBar shows "Approve selected (N)" and
|
|
118
|
+
"Reject selected (N)" with N === visible card count.
|
|
119
|
+
E3. Do NOT click batch Approve / Reject in this run — they fire
|
|
120
|
+
real POSTs and would mutate state. Just record that the
|
|
121
|
+
buttons render and are not disabled.
|
|
122
|
+
E4. Uncheck "Select all". Confirm all card checkboxes clear.
|
|
123
|
+
|
|
124
|
+
### F. Empty-state "Clear filter"
|
|
125
|
+
F1. Click the "High" risk filter. If the resulting list is empty,
|
|
126
|
+
confirm the EmptyState renders with a "Clear filter" button.
|
|
127
|
+
Click it; confirm the filter resets to All.
|
|
128
|
+
If the High filter still has cards, record SKIP with reason.
|
|
129
|
+
|
|
130
|
+
### G. Keyboard shortcuts
|
|
131
|
+
G1. Press "j" via browser_press_key. Confirm focus advances to
|
|
132
|
+
the next card (outline: 2px solid var(--accent) on the
|
|
133
|
+
second card).
|
|
134
|
+
G2. Press "k". Confirm focus returns to the first card.
|
|
135
|
+
G3. Do NOT press E or X — they fire real decisions. Record only
|
|
136
|
+
that the keyboard hint row renders KeyChip pills for J, K,
|
|
137
|
+
E, X, ⌘K.
|
|
138
|
+
|
|
139
|
+
### H. Suggestions card (best-effort)
|
|
140
|
+
H1. Scroll to bottom. If "Pattern suggestions" card is visible
|
|
141
|
+
(depends on local approval history, may not exist), click
|
|
142
|
+
"Copy allow rule" on the first row and confirm clipboard
|
|
143
|
+
contains JSON like {"allow":["<toolName>"]}. Otherwise
|
|
144
|
+
record SKIP: "no suggestions in queue".
|
|
145
|
+
|
|
146
|
+
### I. Session-filter banner
|
|
147
|
+
I1. browser_navigate to {{DASHBOARD_URL}}/approvals?session=test1234.
|
|
148
|
+
Confirm the info banner renders with text containing
|
|
149
|
+
"Showing approvals for session". Click the banner's
|
|
150
|
+
"Clear filter" link; confirm URL becomes /approvals.
|
|
151
|
+
|
|
152
|
+
## Final step — write the report
|
|
153
|
+
Output ONLY the markdown block below, nothing else:
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
# approval-queue-ui-test — {{date}} {{time}}
|
|
157
|
+
|
|
158
|
+
Base URL: {{DASHBOARD_URL}}
|
|
159
|
+
Browser: <user-agent from snapshot>
|
|
160
|
+
|
|
161
|
+
## Result: PASS / FAIL (FAIL if any checkpoint failed)
|
|
162
|
+
|
|
163
|
+
### A. Page load + tabs
|
|
164
|
+
- A1 ... A5 — PASS / FAIL / SKIP — <note>
|
|
165
|
+
|
|
166
|
+
### B. Header controls
|
|
167
|
+
- B1 — ...
|
|
168
|
+
|
|
169
|
+
### C. Risk filters
|
|
170
|
+
- All — ...
|
|
171
|
+
- Low — ...
|
|
172
|
+
- Medium — ...
|
|
173
|
+
- High — ...
|
|
174
|
+
|
|
175
|
+
### D. Per-card controls
|
|
176
|
+
- D1 ... D6 — ...
|
|
177
|
+
|
|
178
|
+
### E. Select-all + batch
|
|
179
|
+
- E1 ... E4 — ...
|
|
180
|
+
|
|
181
|
+
### F. Empty-state Clear filter
|
|
182
|
+
- F1 — ...
|
|
183
|
+
|
|
184
|
+
### G. Keyboard shortcuts
|
|
185
|
+
- G1 ... G3 — ...
|
|
186
|
+
|
|
187
|
+
### H. Suggestions card
|
|
188
|
+
- H1 — ...
|
|
189
|
+
|
|
190
|
+
### I. Session-filter banner
|
|
191
|
+
- I1 — ...
|
|
192
|
+
|
|
193
|
+
### Failures
|
|
194
|
+
<bullet list of every FAIL with the full error / screenshot ref;
|
|
195
|
+
"none" if clean>
|
|
196
|
+
|
|
197
|
+
### Verdict
|
|
198
|
+
<one sentence>
|
|
199
|
+
```
|
|
200
|
+
into: report
|
|
201
|
+
|
|
202
|
+
- id: write_report
|
|
203
|
+
tool: file.write
|
|
204
|
+
path: ~/.patchwork/inbox/approval-queue-ui-test-{{date}}.md
|
|
205
|
+
content: "{{report}}\n"
|
|
@@ -5,7 +5,7 @@ description: |
|
|
|
5
5
|
appears in the result. Output lands in ~/.patchwork/inbox/ for manual inspection.
|
|
6
6
|
Run this after deploying a new bridge build to confirm the memory moat is live.
|
|
7
7
|
|
|
8
|
-
NOTE: requires --
|
|
8
|
+
NOTE: requires --driver subprocess and a running bridge with HTTP port
|
|
9
9
|
so the agent subprocess has MCP access. Running via `patchwork recipe run`
|
|
10
10
|
(local yamlRunner) will fail at Step 1 — the local claude -p subprocess has
|
|
11
11
|
no bridge MCP context. Trigger from the dashboard Recipes page instead.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
apiVersion: patchwork.sh/v1
|
|
2
|
+
name: fix-errors-on-save
|
|
3
|
+
description: |
|
|
4
|
+
On every save of a .ts/.tsx file, check for TypeScript errors. If errors exist,
|
|
5
|
+
an agent reads the broken code, navigates to the relevant type definitions, and
|
|
6
|
+
applies a minimal targeted fix — without refactoring surrounding code.
|
|
7
|
+
|
|
8
|
+
Requires: bridge running with --driver subprocess so the agent subprocess has
|
|
9
|
+
MCP access to getBufferContent, goToDefinition, getHover, getDiagnostics, editText.
|
|
10
|
+
|
|
11
|
+
trigger:
|
|
12
|
+
type: on_file_save
|
|
13
|
+
glob: "**/*.{ts,tsx}"
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- tool: diagnostics.get
|
|
17
|
+
uri: "{{file}}"
|
|
18
|
+
filter: error
|
|
19
|
+
into: errors
|
|
20
|
+
|
|
21
|
+
- agent:
|
|
22
|
+
prompt: |
|
|
23
|
+
A TypeScript file was just saved: {{file}}
|
|
24
|
+
|
|
25
|
+
Current errors reported by the language server:
|
|
26
|
+
{{errors}}
|
|
27
|
+
|
|
28
|
+
If there are NO errors (empty list above), output nothing (empty string) and stop.
|
|
29
|
+
|
|
30
|
+
Otherwise, fix the errors by following these steps IN ORDER:
|
|
31
|
+
|
|
32
|
+
## Step 1 — Read the file
|
|
33
|
+
Call getBufferContent for {{file}} to see the current code. Note the line
|
|
34
|
+
numbers of each error.
|
|
35
|
+
|
|
36
|
+
## Step 2 — Understand the types involved
|
|
37
|
+
For each error, use getHover at the error location to read the type information.
|
|
38
|
+
If the error references a symbol whose definition you need (e.g. "Property X does
|
|
39
|
+
not exist on type Y"), call goToDefinition on that symbol and then getBufferContent
|
|
40
|
+
on the definition file to read the actual shape of the type.
|
|
41
|
+
|
|
42
|
+
## Step 3 — Apply a minimal fix
|
|
43
|
+
Call editText to fix each error at its exact line. Rules:
|
|
44
|
+
- Fix only what the error points to — do not refactor surrounding code
|
|
45
|
+
- If fixing one error would require restructuring multiple files, stop and report
|
|
46
|
+
why instead of applying a partial fix
|
|
47
|
+
- Prefer adding a missing property/cast over restructuring the type
|
|
48
|
+
|
|
49
|
+
## Step 4 — Verify
|
|
50
|
+
Call getDiagnostics for {{file}} after your edits. If new errors appeared, revert
|
|
51
|
+
your change with another editText call and report the failure.
|
|
52
|
+
|
|
53
|
+
## Step 5 — Report
|
|
54
|
+
Output a concise markdown summary:
|
|
55
|
+
```
|
|
56
|
+
## fix-errors-on-save — {{file}}
|
|
57
|
+
**Errors found:** <count>
|
|
58
|
+
**Fixed:** <list each fix: "line N: <what was wrong> → <what was done>">
|
|
59
|
+
**Remaining:** <count, or "none">
|
|
60
|
+
**Skipped:** <any errors you couldn't safely fix, and why>
|
|
61
|
+
```
|
|
62
|
+
driver: claude-code
|
|
63
|
+
model: claude-haiku-4-5-20251001
|
|
64
|
+
into: result
|
|
65
|
+
|
|
66
|
+
# Only append to the inbox when fixes were applied. When no errors exist
|
|
67
|
+
# the agent outputs nothing (empty string) and {{result}} is empty → falsy → skip.
|
|
68
|
+
- tool: file.append
|
|
69
|
+
path: ~/.patchwork/inbox/auto-fixes.md
|
|
70
|
+
content: "{{result}}\n\n"
|
|
71
|
+
when: "{{result}}"
|
|
@@ -61,8 +61,11 @@ steps:
|
|
|
61
61
|
6. **Linear** — list in-progress and unstarted issues by priority; omit this section entirely if the list is empty or returned an error
|
|
62
62
|
|
|
63
63
|
Be concise. Skip newsletters and automated notifications.
|
|
64
|
-
# Use claude (
|
|
65
|
-
|
|
64
|
+
# Use the claude-code driver (subprocess `claude -p`) — runs under
|
|
65
|
+
# your existing Claude Code subscription, no ANTHROPIC_API_KEY
|
|
66
|
+
# required. Switch to `driver: claude` only if you have an API key
|
|
67
|
+
# set and want the Anthropic API path (different billing).
|
|
68
|
+
driver: claude-code
|
|
66
69
|
into: brief
|
|
67
70
|
- tool: file.write
|
|
68
71
|
path: ~/.patchwork/inbox/morning-brief-{{date}}.md
|
|
@@ -38,7 +38,10 @@ steps:
|
|
|
38
38
|
2. **Issues** — issues needing attention today; omit if empty
|
|
39
39
|
3. **PRs** — PRs waiting on review or action; omit if empty
|
|
40
40
|
4. **Health** — one-sentence overall assessment (on track / needs attention / blocked)
|
|
41
|
-
driver
|
|
41
|
+
# Use the claude-code driver (subprocess `claude -p`) — runs under
|
|
42
|
+
# your existing Claude Code subscription. Switch to `driver: claude`
|
|
43
|
+
# only if you have ANTHROPIC_API_KEY set and prefer the API path.
|
|
44
|
+
driver: claude-code
|
|
42
45
|
awaits: [gather]
|
|
43
46
|
- id: write
|
|
44
47
|
tool: file.write
|
|
@@ -1,77 +1,111 @@
|
|
|
1
|
+
apiVersion: patchwork.sh/v1
|
|
1
2
|
name: sentry-to-linear
|
|
2
3
|
description: |
|
|
3
|
-
Fetch a Sentry issue, enrich
|
|
4
|
+
Fetch a Sentry issue, enrich its stack trace with git blame (via
|
|
5
|
+
enrichStackTrace built into fetchSentryIssue), and create a triage-ready
|
|
4
6
|
Linear ticket. Requires both Sentry and Linear connectors connected.
|
|
5
7
|
Run ad-hoc or trigger via webhook / automation policy.
|
|
6
8
|
|
|
7
|
-
#
|
|
8
|
-
# patchwork
|
|
9
|
+
# Manual run:
|
|
10
|
+
# patchwork recipe run sentry-to-linear --var SENTRY_ISSUE_ID=12345678
|
|
9
11
|
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
+
# Webhook trigger (convert this recipe to webhook type after install):
|
|
13
|
+
# trigger:
|
|
14
|
+
# type: webhook
|
|
15
|
+
# path: /hooks/sentry-to-linear
|
|
16
|
+
# Then POST from a Sentry alert rule to https://<bridge-url>/hooks/sentry-to-linear
|
|
12
17
|
|
|
13
18
|
trigger:
|
|
14
19
|
type: manual
|
|
15
20
|
vars:
|
|
16
21
|
- name: SENTRY_ISSUE_ID
|
|
17
|
-
description: "Sentry issue ID or URL (e.g. '12345678' or 'https://sentry.io
|
|
22
|
+
description: "Sentry issue ID or URL (e.g. '12345678' or 'https://sentry.io/organizations/my-org/issues/12345678/')"
|
|
18
23
|
required: true
|
|
19
24
|
- name: LINEAR_TEAM_KEY
|
|
20
|
-
description: "Linear team key
|
|
25
|
+
description: "Linear team key (e.g. 'ENG'). Leave blank to use your first team."
|
|
21
26
|
required: false
|
|
22
27
|
- name: LINEAR_PRIORITY
|
|
23
|
-
description: "Linear priority: 1=urgent
|
|
28
|
+
description: "Linear priority: 1=urgent 2=high 3=medium 4=low"
|
|
24
29
|
required: false
|
|
25
30
|
default: "2"
|
|
26
31
|
|
|
27
32
|
steps:
|
|
28
33
|
- agent:
|
|
29
34
|
prompt: |
|
|
30
|
-
You are a triage assistant.
|
|
31
|
-
1. Fetch the Sentry issue using fetchSentryIssue with issueId "{{SENTRY_ISSUE_ID}}"
|
|
32
|
-
2. Create a Linear issue using createLinearIssue with the data you received
|
|
35
|
+
You are a triage assistant. Follow these steps exactly — do not skip any.
|
|
33
36
|
|
|
34
|
-
|
|
35
|
-
- title: Use the Sentry issue title verbatim
|
|
36
|
-
- description: Write a structured Markdown body with these sections:
|
|
37
|
-
## Error
|
|
38
|
-
(one-line error type + message from the Sentry title)
|
|
37
|
+
## Step 1 — Fetch Sentry issue with git blame enrichment
|
|
39
38
|
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
Call `fetchSentryIssue` with:
|
|
40
|
+
issueId: "{{SENTRY_ISSUE_ID}}"
|
|
41
|
+
maxFrames: 15
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
`fetchSentryIssue` automatically runs git blame on every stack frame and
|
|
44
|
+
returns `topSuspect` (the commit most likely to have introduced the bug),
|
|
45
|
+
`confidence` (high/medium/low), and per-frame `commit` attribution.
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
(the confidence field value + a one-sentence explanation of what it means)
|
|
47
|
+
## Step 2 — Create the Linear issue
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
Call `createLinearIssue` with:
|
|
50
|
+
title: The Sentry issue title verbatim
|
|
51
|
+
teamKey: "{{LINEAR_TEAM_KEY}}" (omit the key entirely if the value is blank)
|
|
52
|
+
priority: {{LINEAR_PRIORITY}} (integer — not a string)
|
|
53
|
+
labelNames: ["bug"]
|
|
54
|
+
description: A Markdown body structured exactly as follows:
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
56
|
+
---
|
|
57
|
+
## Error
|
|
58
|
+
<one-line error type + message from the Sentry title>
|
|
55
59
|
|
|
56
|
-
|
|
60
|
+
## Stack trace
|
|
61
|
+
```
|
|
62
|
+
<top 10 frames from the stackTrace field>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Suspect commit
|
|
66
|
+
<If topSuspect is non-null, format as:>
|
|
67
|
+
- **SHA:** `<sha>`
|
|
68
|
+
- **Author:** <author>
|
|
69
|
+
- **Date:** <date>
|
|
70
|
+
- **Subject:** <subject>
|
|
71
|
+
- **Frames blamed:** <frameCount> of <framesBlamed> workspace frames
|
|
72
|
+
- **Confidence:** <confidence>
|
|
73
|
+
|
|
74
|
+
<If topSuspect is null, write:>
|
|
75
|
+
No suspect commit identified (confidence: <confidence>).
|
|
76
|
+
Git blame ran on <framesBlamed> frames; none resolved to a workspace commit.
|
|
77
|
+
|
|
78
|
+
## Sentry link
|
|
79
|
+
<full Sentry URL — use issueId to construct: https://sentry.io/issues/{{SENTRY_ISSUE_ID}}/>
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Step 3 — Respond with JSON
|
|
83
|
+
|
|
84
|
+
After both tool calls succeed, respond with ONLY this JSON object
|
|
85
|
+
(no markdown fences, no extra text):
|
|
57
86
|
{
|
|
58
|
-
"sentryIssueId": "<
|
|
59
|
-
"sentryTitle": "<
|
|
60
|
-
"linearIdentifier": "<e.g. ENG-101>",
|
|
61
|
-
"linearUrl": "<
|
|
87
|
+
"sentryIssueId": "<issueId from fetchSentryIssue>",
|
|
88
|
+
"sentryTitle": "<title from fetchSentryIssue>",
|
|
89
|
+
"linearIdentifier": "<identifier from createLinearIssue, e.g. ENG-101>",
|
|
90
|
+
"linearUrl": "<url from createLinearIssue>",
|
|
62
91
|
"confidence": "<high|medium|low>",
|
|
63
|
-
"suspectCommit": "<sha or null>"
|
|
92
|
+
"suspectCommit": "<sha or null>",
|
|
93
|
+
"framesBlamed": <integer>,
|
|
94
|
+
"gitAvailable": <boolean>
|
|
64
95
|
}
|
|
65
96
|
|
|
66
|
-
If
|
|
67
|
-
|
|
68
|
-
|
|
97
|
+
If `sentryConnected` is false in the fetchSentryIssue response, stop and respond:
|
|
98
|
+
{"error": "Sentry connector not connected — visit /connections to authenticate"}
|
|
99
|
+
|
|
100
|
+
If `linearConnected` is false in the createLinearIssue response, stop and respond:
|
|
101
|
+
{"error": "Linear connector not connected — visit /connections to authenticate"}
|
|
69
102
|
driver: claude-code
|
|
70
103
|
model: claude-haiku-4-5-20251001
|
|
71
104
|
into: result
|
|
105
|
+
|
|
72
106
|
- tool: file.write
|
|
73
|
-
path: ~/.patchwork/inbox/sentry-
|
|
107
|
+
path: ~/.patchwork/inbox/sentry-{{SENTRY_ISSUE_ID}}-{{date}}.md
|
|
74
108
|
content: |
|
|
75
|
-
# Sentry → Linear
|
|
109
|
+
# Sentry → Linear: {{SENTRY_ISSUE_ID}} ({{date}})
|
|
76
110
|
|
|
77
111
|
{{result}}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
apiVersion: patchwork.sh/v1
|
|
2
|
+
name: apple-watch-health-log
|
|
3
|
+
description: |
|
|
4
|
+
Logs Apple Watch sleep duration, quality, and activity rings from an iOS
|
|
5
|
+
Shortcut. Each fire writes a daily journal entry, generates a warm AI Coach
|
|
6
|
+
insight (Fitbit-Gemini style) via Claude, appends the insight to the
|
|
7
|
+
journal, and pushes it to your phone via ntfy.sh. Two conditional nudges
|
|
8
|
+
fire only when the payload looks off:
|
|
9
|
+
|
|
10
|
+
- "Short night" — separate priority-5 push when sleep_hours_under_6 is set
|
|
11
|
+
- "Watch off your wrist" — different topic when move_percent is 0
|
|
12
|
+
|
|
13
|
+
Conditional steps are gated by `when:` and read precomputed boolean fields
|
|
14
|
+
from the iOS Shortcut payload (template substitution can't do arithmetic).
|
|
15
|
+
|
|
16
|
+
Suggested triggers:
|
|
17
|
+
- iOS Shortcut ("Log my watch" — pulls Health stats + POSTs JSON)
|
|
18
|
+
- Stream Deck button for manual end-of-day log
|
|
19
|
+
- NFC tag on your nightstand
|
|
20
|
+
- curl from any device that can POST HTTP
|
|
21
|
+
|
|
22
|
+
Payload conventions (all optional — missing fields render blank):
|
|
23
|
+
sleep_hours numeric, e.g. 7.4
|
|
24
|
+
sleep_quality "deep" | "restful" | "light" | "restless" | free text
|
|
25
|
+
sleep_hours_under_6 "1" if sleep_hours < 6 (Shortcut precomputes)
|
|
26
|
+
move_percent 0-100+ (rings can exceed 100%)
|
|
27
|
+
move_percent_zero "1" if move_percent == 0 (likely watch was off)
|
|
28
|
+
move_calories active kcal burned
|
|
29
|
+
exercise_percent 0-100+
|
|
30
|
+
exercise_min exercise minutes recorded
|
|
31
|
+
stand_percent 0-100+
|
|
32
|
+
notes free-form journal text
|
|
33
|
+
|
|
34
|
+
Setup:
|
|
35
|
+
1. Replace NTFY_TOPIC, NTFY_NUDGE_TOPIC, and NTFY_ALERT_TOPIC with your
|
|
36
|
+
own unguessable ntfy topics and subscribe to all three in the app.
|
|
37
|
+
2. Drop this file in ~/.patchwork/recipes/.
|
|
38
|
+
3. Start the bridge with `--driver subprocess` so /hooks/* is live.
|
|
39
|
+
|
|
40
|
+
Example request:
|
|
41
|
+
curl -X POST http://localhost:3101/hooks/apple-watch-health \
|
|
42
|
+
-H 'Content-Type: application/json' \
|
|
43
|
+
-d '{"sleep_hours":7.4,"sleep_quality":"restful","move_percent":112,"move_calories":645,"exercise_percent":150,"exercise_min":45,"stand_percent":100,"notes":"Closed all three rings."}'
|
|
44
|
+
|
|
45
|
+
trigger:
|
|
46
|
+
type: webhook
|
|
47
|
+
path: /apple-watch-health
|
|
48
|
+
|
|
49
|
+
steps:
|
|
50
|
+
- id: write_journal
|
|
51
|
+
tool: file.append
|
|
52
|
+
path: ~/.patchwork/health-journal/{{date}}.md
|
|
53
|
+
content: |
|
|
54
|
+
## {{date}} Apple Watch Summary
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
SLEEP {{payload.sleep_hours}}h {{payload.sleep_quality}}
|
|
58
|
+
MOVE {{payload.move_percent}}% {{payload.move_calories}} kcal
|
|
59
|
+
EXER {{payload.exercise_percent}}% {{payload.exercise_min}} min
|
|
60
|
+
STAND {{payload.stand_percent}}%
|
|
61
|
+
NOTE {{payload.notes}}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
- id: coach_insight
|
|
67
|
+
agent:
|
|
68
|
+
driver: claude-code
|
|
69
|
+
model: claude-haiku-4-5-20251001
|
|
70
|
+
into: insight
|
|
71
|
+
prompt: |
|
|
72
|
+
Read the Apple Watch numbers below and write a short, warm coaching note in the voice of a friend who knows health data well. The tone should celebrate something specific, name one pattern, and end with one small doable tip for today. No preamble, no markdown headers, no bullets, no sign-off, no emojis. Plain prose, 80-150 words, 2-3 short paragraphs.
|
|
73
|
+
|
|
74
|
+
Hard rules (response is rejected if any are broken):
|
|
75
|
+
- Anchor every compliment in a number from the data. No generic "great job".
|
|
76
|
+
- Never lecture, never list ideal ranges, never use clinical jargon.
|
|
77
|
+
- Never start with "Sure," "Here's," "Of course," or any preamble.
|
|
78
|
+
- End with one concrete tip for today, framed as a tiny win — not a lifestyle overhaul.
|
|
79
|
+
|
|
80
|
+
Tone reference (match the register, not the content):
|
|
81
|
+
|
|
82
|
+
Hey there. Your sleep performance hit 87/100 last night — solid 7 hours 45 minutes with a nice chunk of deep sleep. Recovery is looking strong at 82/100 thanks to that solid HRV of 62 ms. The pattern I notice: when you wrap exercise before 6pm your sleep lands in the high 80s pretty reliably. One small win for today: try wrapping up screens 30 minutes earlier tonight. You've got this.
|
|
83
|
+
|
|
84
|
+
Apple Watch numbers for today:
|
|
85
|
+
Sleep: {{payload.sleep_hours}} hours, {{payload.sleep_quality}}
|
|
86
|
+
Move ring: {{payload.move_percent}}% closed, {{payload.move_calories}} active calories
|
|
87
|
+
Exercise ring: {{payload.exercise_percent}}% closed, {{payload.exercise_min}} minutes
|
|
88
|
+
Stand ring: {{payload.stand_percent}}% closed
|
|
89
|
+
User's notes for the day: {{payload.notes}}
|
|
90
|
+
|
|
91
|
+
Write the coaching note now. Output only the prose, nothing else.
|
|
92
|
+
silentFailDetection: false
|
|
93
|
+
|
|
94
|
+
- id: append_insight
|
|
95
|
+
tool: file.append
|
|
96
|
+
when: "{{insight}}"
|
|
97
|
+
path: ~/.patchwork/health-journal/{{date}}.md
|
|
98
|
+
content: |
|
|
99
|
+
### Coach's note
|
|
100
|
+
|
|
101
|
+
{{insight}}
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
- id: push_to_phone
|
|
106
|
+
tool: http.post
|
|
107
|
+
when: "{{insight}}"
|
|
108
|
+
url: https://ntfy.sh/NTFY_TOPIC
|
|
109
|
+
contentType: text/plain
|
|
110
|
+
headers:
|
|
111
|
+
Title: "{{date}} - the body report"
|
|
112
|
+
Tags: watch,zzz,fire
|
|
113
|
+
body: |
|
|
114
|
+
{{insight}}
|
|
115
|
+
|
|
116
|
+
# Fires only when payload.sleep_hours_under_6 is truthy ("1", "true", etc.)
|
|
117
|
+
- id: short_night_nudge
|
|
118
|
+
tool: http.post
|
|
119
|
+
when: "{{payload.sleep_hours_under_6}}"
|
|
120
|
+
url: https://ntfy.sh/NTFY_NUDGE_TOPIC
|
|
121
|
+
contentType: text/plain
|
|
122
|
+
headers:
|
|
123
|
+
Title: Short night - go easy today
|
|
124
|
+
Tags: sleeping_face,warning
|
|
125
|
+
Priority: "5"
|
|
126
|
+
body: |
|
|
127
|
+
You logged {{payload.sleep_hours}}h ({{payload.sleep_quality}}).
|
|
128
|
+
No PR attempts. Hydrate. Move at half-throttle.
|
|
129
|
+
|
|
130
|
+
# Fires only when payload.move_percent_zero is truthy — likely the watch
|
|
131
|
+
# was off your wrist all day, not that you genuinely moved 0%.
|
|
132
|
+
- id: watch_off_alert
|
|
133
|
+
tool: http.post
|
|
134
|
+
when: "{{payload.move_percent_zero}}"
|
|
135
|
+
url: https://ntfy.sh/NTFY_ALERT_TOPIC
|
|
136
|
+
contentType: text/plain
|
|
137
|
+
headers:
|
|
138
|
+
Title: Watch reported 0% move
|
|
139
|
+
Tags: warning,watch
|
|
140
|
+
body: |
|
|
141
|
+
Move ring at 0% for {{date}}. Battery dead? Forgot the watch?
|
|
142
|
+
Today's journal entry may not reflect actual activity.
|
|
143
|
+
|
|
144
|
+
output:
|
|
145
|
+
path: ~/.patchwork/health-journal/{{date}}.md
|