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,174 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# deploy-dashboard.sh — Build dashboard locally and deploy to VPS
|
|
3
|
+
# Run from Mac: bash deploy/deploy-dashboard.sh
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
VPS="root@185.167.97.141"
|
|
7
|
+
REMOTE_DIR="/opt/patchwork-dashboard"
|
|
8
|
+
PM2_NAME="patchwork-dashboard"
|
|
9
|
+
PORT=3200
|
|
10
|
+
NGINX_CONF="/etc/nginx/sites-available/patchworkos"
|
|
11
|
+
DASHBOARD_URL="https://patchworkos.com/dashboard"
|
|
12
|
+
|
|
13
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
14
|
+
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
15
|
+
DASHBOARD_DIR="$REPO_ROOT/dashboard"
|
|
16
|
+
|
|
17
|
+
echo "==> Building dashboard..."
|
|
18
|
+
cd "$DASHBOARD_DIR"
|
|
19
|
+
npm run build
|
|
20
|
+
|
|
21
|
+
echo "==> Packaging standalone build..."
|
|
22
|
+
TARBALL="/tmp/patchwork-dashboard.tar.gz"
|
|
23
|
+
STAGE="/tmp/patchwork-dashboard-stage"
|
|
24
|
+
rm -rf "$STAGE" && mkdir -p "$STAGE"
|
|
25
|
+
|
|
26
|
+
# Copy standalone output
|
|
27
|
+
cp -r "$DASHBOARD_DIR/.next/standalone/." "$STAGE/"
|
|
28
|
+
# Standalone needs static assets in .next/static
|
|
29
|
+
mkdir -p "$STAGE/.next/static"
|
|
30
|
+
cp -r "$DASHBOARD_DIR/.next/static/." "$STAGE/.next/static/"
|
|
31
|
+
# Copy public dir if it exists
|
|
32
|
+
if [ -d "$DASHBOARD_DIR/public" ]; then
|
|
33
|
+
cp -r "$DASHBOARD_DIR/public/." "$STAGE/public/"
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
tar -czf "$TARBALL" --no-xattrs -C "$STAGE" .
|
|
37
|
+
|
|
38
|
+
echo "==> Copying tarball to VPS..."
|
|
39
|
+
scp "$TARBALL" "$VPS:/tmp/patchwork-dashboard.tar.gz"
|
|
40
|
+
|
|
41
|
+
echo "==> Deploying on VPS..."
|
|
42
|
+
# shellcheck disable=SC2087
|
|
43
|
+
ssh "$VPS" bash <<'REMOTE'
|
|
44
|
+
set -euo pipefail
|
|
45
|
+
REMOTE_DIR="/opt/patchwork-dashboard"
|
|
46
|
+
PM2_NAME="patchwork-dashboard"
|
|
47
|
+
PORT=3200
|
|
48
|
+
|
|
49
|
+
# Stop existing PM2 process if running
|
|
50
|
+
if pm2 list | grep -q "$PM2_NAME"; then
|
|
51
|
+
pm2 stop "$PM2_NAME" || true
|
|
52
|
+
pm2 delete "$PM2_NAME" || true
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
# Wipe and recreate deploy dir
|
|
56
|
+
rm -rf "$REMOTE_DIR"
|
|
57
|
+
mkdir -p "$REMOTE_DIR"
|
|
58
|
+
|
|
59
|
+
# Extract
|
|
60
|
+
tar -xzf /tmp/patchwork-dashboard.tar.gz -C "$REMOTE_DIR"
|
|
61
|
+
rm /tmp/patchwork-dashboard.tar.gz
|
|
62
|
+
|
|
63
|
+
# Copy static assets into standalone's expected location
|
|
64
|
+
mkdir -p "$REMOTE_DIR/.next"
|
|
65
|
+
if [ -d "$REMOTE_DIR/.next/static" ]; then
|
|
66
|
+
echo "static dir already in place"
|
|
67
|
+
else
|
|
68
|
+
# tar may have extracted flat; handle both layouts
|
|
69
|
+
if [ -d /tmp/dashboard-static ]; then
|
|
70
|
+
cp -r /tmp/dashboard-static "$REMOTE_DIR/.next/static"
|
|
71
|
+
fi
|
|
72
|
+
fi
|
|
73
|
+
|
|
74
|
+
# Also copy public dir if present
|
|
75
|
+
if [ -d "$REMOTE_DIR/public" ]; then
|
|
76
|
+
echo "public dir in place"
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
# Write .env.local — secrets must be set via environment before running this script:
|
|
80
|
+
# PATCHWORK_BRIDGE_TOKEN, DASHBOARD_PASSWORD
|
|
81
|
+
# PATCHWORK_BRIDGE_TOKEN is the bridge auth token (from: patchwork print-token)
|
|
82
|
+
# DASHBOARD_PASSWORD protects the dashboard UI (leave blank to disable auth)
|
|
83
|
+
if [ -f "$REMOTE_DIR/.env.local" ]; then
|
|
84
|
+
echo ".env.local already exists on VPS — preserving (delete manually to reset)"
|
|
85
|
+
else
|
|
86
|
+
cat > "$REMOTE_DIR/.env.local" <<ENV
|
|
87
|
+
NEXT_PUBLIC_BASE_PATH=/dashboard
|
|
88
|
+
PATCHWORK_BRIDGE_URL=https://patchworkos.com
|
|
89
|
+
PATCHWORK_BRIDGE_TOKEN=${PATCHWORK_BRIDGE_TOKEN:-REPLACE_ME}
|
|
90
|
+
VAPID_SUBJECT=mailto:support@gigsecure.co.ke
|
|
91
|
+
DASHBOARD_PASSWORD=${DASHBOARD_PASSWORD:-}
|
|
92
|
+
ENV
|
|
93
|
+
chmod 600 "$REMOTE_DIR/.env.local"
|
|
94
|
+
echo "Wrote .env.local — review and update secrets if placeholders remain"
|
|
95
|
+
fi
|
|
96
|
+
|
|
97
|
+
# Install PM2 if missing
|
|
98
|
+
which pm2 || npm install -g pm2
|
|
99
|
+
|
|
100
|
+
# Start with PM2
|
|
101
|
+
cd "$REMOTE_DIR"
|
|
102
|
+
PORT=3200 pm2 start server.js --name "$PM2_NAME"
|
|
103
|
+
|
|
104
|
+
pm2 save
|
|
105
|
+
echo "PM2 started: $PM2_NAME on port $PORT"
|
|
106
|
+
REMOTE
|
|
107
|
+
|
|
108
|
+
echo "==> Configuring nginx..."
|
|
109
|
+
ssh "$VPS" bash <<'NGINX'
|
|
110
|
+
set -euo pipefail
|
|
111
|
+
NGINX_CONF="/etc/nginx/sites-available/patchworkos"
|
|
112
|
+
|
|
113
|
+
# Add SSE location block if missing
|
|
114
|
+
if ! grep -q "location /dashboard/api/bridge/stream" "$NGINX_CONF"; then
|
|
115
|
+
# Insert before the closing brace of the SSL server block
|
|
116
|
+
# We insert just before the last `}` that closes the server block listening on 443
|
|
117
|
+
python3 - "$NGINX_CONF" <<'PYEOF'
|
|
118
|
+
import sys, re
|
|
119
|
+
|
|
120
|
+
path = sys.argv[1]
|
|
121
|
+
with open(path) as f:
|
|
122
|
+
content = f.read()
|
|
123
|
+
|
|
124
|
+
sse_block = """
|
|
125
|
+
# SSE passthrough — no buffering
|
|
126
|
+
location /dashboard/api/bridge/stream {
|
|
127
|
+
proxy_pass http://127.0.0.1:3200;
|
|
128
|
+
proxy_http_version 1.1;
|
|
129
|
+
proxy_buffering off;
|
|
130
|
+
proxy_cache off;
|
|
131
|
+
proxy_read_timeout 86400s;
|
|
132
|
+
proxy_send_timeout 86400s;
|
|
133
|
+
proxy_set_header Host $host;
|
|
134
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
135
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
136
|
+
proxy_set_header X-Forwarded-Proto $scheme;
|
|
137
|
+
add_header X-Accel-Buffering no;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
# Dashboard app
|
|
141
|
+
location /dashboard {
|
|
142
|
+
proxy_pass http://127.0.0.1:3200;
|
|
143
|
+
proxy_http_version 1.1;
|
|
144
|
+
proxy_set_header Host $host;
|
|
145
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
146
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
147
|
+
proxy_set_header X-Forwarded-Proto $scheme;
|
|
148
|
+
proxy_read_timeout 60s;
|
|
149
|
+
}
|
|
150
|
+
"""
|
|
151
|
+
|
|
152
|
+
# Find the ssl/443 server block and insert before its closing brace
|
|
153
|
+
# Strategy: find last `}` in file and insert before it
|
|
154
|
+
idx = content.rfind('\n}')
|
|
155
|
+
if idx == -1:
|
|
156
|
+
print("ERROR: could not find closing brace in nginx config", file=sys.stderr)
|
|
157
|
+
sys.exit(1)
|
|
158
|
+
|
|
159
|
+
new_content = content[:idx] + sse_block + content[idx:]
|
|
160
|
+
with open(path, 'w') as f:
|
|
161
|
+
f.write(new_content)
|
|
162
|
+
print("nginx: location blocks inserted")
|
|
163
|
+
PYEOF
|
|
164
|
+
else
|
|
165
|
+
echo "nginx: location blocks already present, skipping"
|
|
166
|
+
fi
|
|
167
|
+
|
|
168
|
+
nginx -t && systemctl reload nginx
|
|
169
|
+
echo "nginx reloaded"
|
|
170
|
+
NGINX
|
|
171
|
+
|
|
172
|
+
echo ""
|
|
173
|
+
echo "==> Deploy complete!"
|
|
174
|
+
echo " Dashboard: https://patchworkos.com/dashboard"
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# deploy-landing.sh — Deploy static landing page to VPS
|
|
3
|
+
# Run from Mac: bash deploy/deploy-landing.sh
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
VPS="root@185.167.97.141"
|
|
7
|
+
LANDING_DIR="/var/www/patchwork-landing"
|
|
8
|
+
NGINX_CONF="/etc/nginx/sites-available/patchworkos"
|
|
9
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
10
|
+
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
11
|
+
|
|
12
|
+
echo "==> Copying landing page + assets to VPS..."
|
|
13
|
+
ssh "$VPS" "mkdir -p $LANDING_DIR"
|
|
14
|
+
# index.html plus the favicon + manifest browsers probe at apex. Without
|
|
15
|
+
# these the browser console fills with /favicon.svg and /manifest.json
|
|
16
|
+
# 401s on every page load (nginx falls through to the dashboard middleware
|
|
17
|
+
# for paths that don't have an explicit `location`).
|
|
18
|
+
scp "$REPO_ROOT/landing/index.html" "$VPS:$LANDING_DIR/index.html"
|
|
19
|
+
scp "$REPO_ROOT/landing/favicon.ico" "$VPS:$LANDING_DIR/favicon.ico"
|
|
20
|
+
scp "$REPO_ROOT/landing/favicon.svg" "$VPS:$LANDING_DIR/favicon.svg"
|
|
21
|
+
scp "$REPO_ROOT/landing/manifest.json" "$VPS:$LANDING_DIR/manifest.json"
|
|
22
|
+
|
|
23
|
+
echo "==> Updating nginx to serve landing page at root..."
|
|
24
|
+
ssh "$VPS" bash <<'REMOTE'
|
|
25
|
+
set -euo pipefail
|
|
26
|
+
NGINX_CONF="/etc/nginx/sites-available/patchworkos"
|
|
27
|
+
|
|
28
|
+
# Insert landing page root location if not already present
|
|
29
|
+
if ! grep -q "location = /" "$NGINX_CONF"; then
|
|
30
|
+
python3 - "$NGINX_CONF" <<'PYEOF'
|
|
31
|
+
import sys, re
|
|
32
|
+
|
|
33
|
+
path = sys.argv[1]
|
|
34
|
+
with open(path) as f:
|
|
35
|
+
content = f.read()
|
|
36
|
+
|
|
37
|
+
landing_blocks = """
|
|
38
|
+
# Static landing page at root
|
|
39
|
+
location = / {
|
|
40
|
+
root /var/www/patchwork-landing;
|
|
41
|
+
try_files /index.html =404;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
# Bridge API paths — proxy to bridge
|
|
45
|
+
location ~ ^/(mcp|oauth|notify|\.well-known|metrics|health|approvals|activity|sessions|traces|recipes|connectors|settings|schemas|push) {
|
|
46
|
+
proxy_pass http://127.0.0.1:3284;
|
|
47
|
+
proxy_http_version 1.1;
|
|
48
|
+
proxy_set_header Upgrade $http_upgrade;
|
|
49
|
+
proxy_set_header Connection "upgrade";
|
|
50
|
+
proxy_set_header Host $host;
|
|
51
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
52
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
53
|
+
proxy_set_header X-Forwarded-Proto $scheme;
|
|
54
|
+
proxy_read_timeout 3600s;
|
|
55
|
+
proxy_send_timeout 3600s;
|
|
56
|
+
}
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
# Insert before the SSE/dashboard blocks (before first "location /dashboard")
|
|
60
|
+
# or before the last closing brace if those don't exist
|
|
61
|
+
if 'location /dashboard' in content:
|
|
62
|
+
idx = content.find(' # SSE passthrough')
|
|
63
|
+
if idx == -1:
|
|
64
|
+
idx = content.find(' location /dashboard')
|
|
65
|
+
else:
|
|
66
|
+
idx = content.rfind('\n}')
|
|
67
|
+
|
|
68
|
+
if idx == -1:
|
|
69
|
+
idx = content.rfind('\n}')
|
|
70
|
+
|
|
71
|
+
new_content = content[:idx] + landing_blocks + content[idx:]
|
|
72
|
+
with open(path, 'w') as f:
|
|
73
|
+
f.write(new_content)
|
|
74
|
+
print("nginx: landing + bridge location blocks inserted")
|
|
75
|
+
PYEOF
|
|
76
|
+
else
|
|
77
|
+
echo "nginx: landing location already present, skipping"
|
|
78
|
+
fi
|
|
79
|
+
|
|
80
|
+
# Independent idempotency block for the apex asset locations — these were
|
|
81
|
+
# added after the original landing block, so existing installs miss them.
|
|
82
|
+
if ! grep -q "location = /favicon.ico" "$NGINX_CONF"; then
|
|
83
|
+
python3 - "$NGINX_CONF" <<'PYEOF'
|
|
84
|
+
import sys
|
|
85
|
+
|
|
86
|
+
path = sys.argv[1]
|
|
87
|
+
with open(path) as f:
|
|
88
|
+
content = f.read()
|
|
89
|
+
|
|
90
|
+
asset_blocks = """
|
|
91
|
+
# Apex assets — favicon + PWA manifest browsers probe at root
|
|
92
|
+
location = /favicon.ico {
|
|
93
|
+
root /var/www/patchwork-landing;
|
|
94
|
+
try_files /favicon.ico =404;
|
|
95
|
+
access_log off;
|
|
96
|
+
}
|
|
97
|
+
location = /favicon.svg {
|
|
98
|
+
root /var/www/patchwork-landing;
|
|
99
|
+
try_files /favicon.svg =404;
|
|
100
|
+
access_log off;
|
|
101
|
+
}
|
|
102
|
+
location = /manifest.json {
|
|
103
|
+
root /var/www/patchwork-landing;
|
|
104
|
+
try_files /manifest.json =404;
|
|
105
|
+
access_log off;
|
|
106
|
+
}
|
|
107
|
+
"""
|
|
108
|
+
|
|
109
|
+
# Insert immediately after the existing `location = /` block
|
|
110
|
+
marker = ' location = / {'
|
|
111
|
+
idx = content.find(marker)
|
|
112
|
+
if idx == -1:
|
|
113
|
+
print("WARN: could not find `location = /` to anchor; appending to end", flush=True)
|
|
114
|
+
idx = content.rfind('\n}')
|
|
115
|
+
new_content = content[:idx] + asset_blocks + content[idx:]
|
|
116
|
+
else:
|
|
117
|
+
# find end of the location = / block
|
|
118
|
+
end = content.find(' }', idx)
|
|
119
|
+
end = content.find('\n', end) + 1 if end != -1 else idx
|
|
120
|
+
new_content = content[:end] + asset_blocks + content[end:]
|
|
121
|
+
|
|
122
|
+
with open(path, 'w') as f:
|
|
123
|
+
f.write(new_content)
|
|
124
|
+
print("nginx: apex asset location blocks inserted")
|
|
125
|
+
PYEOF
|
|
126
|
+
else
|
|
127
|
+
echo "nginx: apex asset locations already present, skipping"
|
|
128
|
+
fi
|
|
129
|
+
|
|
130
|
+
nginx -t && systemctl reload nginx
|
|
131
|
+
echo "nginx reloaded"
|
|
132
|
+
REMOTE
|
|
133
|
+
|
|
134
|
+
echo ""
|
|
135
|
+
echo "==> Deploy complete!"
|
|
136
|
+
echo " Landing page: https://patchworkos.com"
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Activation metrics — a small, local-only counter file that tracks how far
|
|
3
|
+
* along the user is in the "first success" journey. Nothing here is ever
|
|
4
|
+
* transmitted off-machine. The outbound usage analytics pipeline lives in
|
|
5
|
+
* `analyticsAggregator.ts` / `analyticsSend.ts` and is a separate concern.
|
|
6
|
+
*
|
|
7
|
+
* Intended counters:
|
|
8
|
+
* - installedAt first time any metric was recorded
|
|
9
|
+
* - firstRecipeRunAt timestamp of the first successful recipe run
|
|
10
|
+
* - recipeRunsTotal running count of successful recipe runs
|
|
11
|
+
* - recipeRunsByDay map of YYYY-MM-DD -> count, trimmed to 14 days
|
|
12
|
+
* - approvalsPrompted count of approval requests created
|
|
13
|
+
* - approvalsCompleted count of approvals approved or rejected (not timed out)
|
|
14
|
+
*
|
|
15
|
+
* These feed a single "first success in N days" KPI card on the dashboard.
|
|
16
|
+
*
|
|
17
|
+
* Opt-out: if the existing outbound analytics preference is explicitly `false`
|
|
18
|
+
* via `getAnalyticsPref()`, all record operations become no-ops. The user does
|
|
19
|
+
* not need to re-opt-out; the existing opt-out is sufficient. Reads are
|
|
20
|
+
* always allowed (they never leave the machine).
|
|
21
|
+
*
|
|
22
|
+
* Storage: `~/.patchwork/telemetry.json` (respects PATCHWORK_HOME override).
|
|
23
|
+
* File is written atomically via tmp+rename with 0o600 permissions.
|
|
24
|
+
*/
|
|
25
|
+
export interface ActivationMetrics {
|
|
26
|
+
installedAt: number;
|
|
27
|
+
firstRecipeRunAt: number | null;
|
|
28
|
+
recipeRunsTotal: number;
|
|
29
|
+
recipeRunsByDay: Record<string, number>;
|
|
30
|
+
approvalsPrompted: number;
|
|
31
|
+
approvalsCompleted: number;
|
|
32
|
+
}
|
|
33
|
+
export interface ActivationSummary {
|
|
34
|
+
installedAt: number;
|
|
35
|
+
firstRecipeRunAt: number | null;
|
|
36
|
+
/** Milliseconds between install and first successful recipe run. Null until first success. */
|
|
37
|
+
timeToFirstRecipeRunMs: number | null;
|
|
38
|
+
/** Total successful recipe runs across all time. */
|
|
39
|
+
recipeRunsTotal: number;
|
|
40
|
+
/** Recipe runs in the last 7 days (inclusive of today). */
|
|
41
|
+
recipeRunsLast7Days: number;
|
|
42
|
+
/** Distinct calendar days with at least one recipe run in the last 7 days. */
|
|
43
|
+
activeDaysLast7: number;
|
|
44
|
+
/** Fraction of prompted approvals that were completed (approved or rejected). 0..1 or null. */
|
|
45
|
+
approvalCompletionRate: number | null;
|
|
46
|
+
approvalsPrompted: number;
|
|
47
|
+
approvalsCompleted: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Load metrics from disk. Returns a fresh empty record if the file is missing
|
|
51
|
+
* or malformed. Never throws on I/O errors.
|
|
52
|
+
*/
|
|
53
|
+
export declare function loadMetrics(configDir?: string, now?: number): ActivationMetrics;
|
|
54
|
+
/**
|
|
55
|
+
* Record one successful recipe run. Sets `firstRecipeRunAt` on the first call
|
|
56
|
+
* and increments total + per-day counters. Trims the per-day map so the file
|
|
57
|
+
* stays O(14 entries).
|
|
58
|
+
*
|
|
59
|
+
* No-op if the user has explicitly opted out of analytics.
|
|
60
|
+
*/
|
|
61
|
+
export declare function recordRecipeRun(configDir?: string, now?: number): void;
|
|
62
|
+
/** Record an approval prompt being surfaced to the user. */
|
|
63
|
+
export declare function recordApprovalPrompted(configDir?: string, now?: number): void;
|
|
64
|
+
/** Record an approval being acted on (approved or rejected — not a timeout). */
|
|
65
|
+
export declare function recordApprovalCompleted(configDir?: string, now?: number): void;
|
|
66
|
+
/** Derive a dashboard-friendly summary from a metrics record. Pure function. */
|
|
67
|
+
export declare function computeSummary(metrics: ActivationMetrics, now?: number): ActivationSummary;
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Activation metrics — a small, local-only counter file that tracks how far
|
|
3
|
+
* along the user is in the "first success" journey. Nothing here is ever
|
|
4
|
+
* transmitted off-machine. The outbound usage analytics pipeline lives in
|
|
5
|
+
* `analyticsAggregator.ts` / `analyticsSend.ts` and is a separate concern.
|
|
6
|
+
*
|
|
7
|
+
* Intended counters:
|
|
8
|
+
* - installedAt first time any metric was recorded
|
|
9
|
+
* - firstRecipeRunAt timestamp of the first successful recipe run
|
|
10
|
+
* - recipeRunsTotal running count of successful recipe runs
|
|
11
|
+
* - recipeRunsByDay map of YYYY-MM-DD -> count, trimmed to 14 days
|
|
12
|
+
* - approvalsPrompted count of approval requests created
|
|
13
|
+
* - approvalsCompleted count of approvals approved or rejected (not timed out)
|
|
14
|
+
*
|
|
15
|
+
* These feed a single "first success in N days" KPI card on the dashboard.
|
|
16
|
+
*
|
|
17
|
+
* Opt-out: if the existing outbound analytics preference is explicitly `false`
|
|
18
|
+
* via `getAnalyticsPref()`, all record operations become no-ops. The user does
|
|
19
|
+
* not need to re-opt-out; the existing opt-out is sufficient. Reads are
|
|
20
|
+
* always allowed (they never leave the machine).
|
|
21
|
+
*
|
|
22
|
+
* Storage: `~/.patchwork/telemetry.json` (respects PATCHWORK_HOME override).
|
|
23
|
+
* File is written atomically via tmp+rename with 0o600 permissions.
|
|
24
|
+
*/
|
|
25
|
+
import fs from "node:fs";
|
|
26
|
+
import os from "node:os";
|
|
27
|
+
import path from "node:path";
|
|
28
|
+
import { getAnalyticsPref } from "./analyticsPrefs.js";
|
|
29
|
+
const METRICS_FILENAME = "telemetry.json";
|
|
30
|
+
const MAX_DAYS_RETAINED = 14;
|
|
31
|
+
function resolveMetricsPath(configDir) {
|
|
32
|
+
if (configDir)
|
|
33
|
+
return path.join(configDir, METRICS_FILENAME);
|
|
34
|
+
const root = process.env.PATCHWORK_HOME ?? path.join(os.homedir(), ".patchwork");
|
|
35
|
+
return path.join(root, METRICS_FILENAME);
|
|
36
|
+
}
|
|
37
|
+
function emptyMetrics(now) {
|
|
38
|
+
return {
|
|
39
|
+
installedAt: now,
|
|
40
|
+
firstRecipeRunAt: null,
|
|
41
|
+
recipeRunsTotal: 0,
|
|
42
|
+
recipeRunsByDay: {},
|
|
43
|
+
approvalsPrompted: 0,
|
|
44
|
+
approvalsCompleted: 0,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function isRecord(value) {
|
|
48
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
49
|
+
}
|
|
50
|
+
function coerceMetrics(raw, now) {
|
|
51
|
+
if (!isRecord(raw))
|
|
52
|
+
return emptyMetrics(now);
|
|
53
|
+
const installedAt = typeof raw.installedAt === "number" && raw.installedAt > 0
|
|
54
|
+
? raw.installedAt
|
|
55
|
+
: now;
|
|
56
|
+
const firstRecipeRunAt = typeof raw.firstRecipeRunAt === "number" && raw.firstRecipeRunAt > 0
|
|
57
|
+
? raw.firstRecipeRunAt
|
|
58
|
+
: null;
|
|
59
|
+
const recipeRunsTotal = typeof raw.recipeRunsTotal === "number" &&
|
|
60
|
+
Number.isFinite(raw.recipeRunsTotal) &&
|
|
61
|
+
raw.recipeRunsTotal >= 0
|
|
62
|
+
? Math.floor(raw.recipeRunsTotal)
|
|
63
|
+
: 0;
|
|
64
|
+
const byDay = {};
|
|
65
|
+
if (isRecord(raw.recipeRunsByDay)) {
|
|
66
|
+
for (const [k, v] of Object.entries(raw.recipeRunsByDay)) {
|
|
67
|
+
if (typeof k === "string" &&
|
|
68
|
+
isValidDayKey(k) &&
|
|
69
|
+
typeof v === "number" &&
|
|
70
|
+
Number.isFinite(v) &&
|
|
71
|
+
v >= 0) {
|
|
72
|
+
byDay[k] = Math.floor(v);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const approvalsPrompted = typeof raw.approvalsPrompted === "number" &&
|
|
77
|
+
Number.isFinite(raw.approvalsPrompted) &&
|
|
78
|
+
raw.approvalsPrompted >= 0
|
|
79
|
+
? Math.floor(raw.approvalsPrompted)
|
|
80
|
+
: 0;
|
|
81
|
+
const approvalsCompleted = typeof raw.approvalsCompleted === "number" &&
|
|
82
|
+
Number.isFinite(raw.approvalsCompleted) &&
|
|
83
|
+
raw.approvalsCompleted >= 0
|
|
84
|
+
? Math.floor(raw.approvalsCompleted)
|
|
85
|
+
: 0;
|
|
86
|
+
return {
|
|
87
|
+
installedAt,
|
|
88
|
+
firstRecipeRunAt,
|
|
89
|
+
recipeRunsTotal,
|
|
90
|
+
recipeRunsByDay: byDay,
|
|
91
|
+
approvalsPrompted,
|
|
92
|
+
approvalsCompleted,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Load metrics from disk. Returns a fresh empty record if the file is missing
|
|
97
|
+
* or malformed. Never throws on I/O errors.
|
|
98
|
+
*/
|
|
99
|
+
export function loadMetrics(configDir, now = Date.now()) {
|
|
100
|
+
const file = resolveMetricsPath(configDir);
|
|
101
|
+
try {
|
|
102
|
+
const raw = fs.readFileSync(file, "utf-8");
|
|
103
|
+
return coerceMetrics(JSON.parse(raw), now);
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
return emptyMetrics(now);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function isValidDayKey(key) {
|
|
110
|
+
const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(key);
|
|
111
|
+
if (!m)
|
|
112
|
+
return false;
|
|
113
|
+
const year = Number(m[1]);
|
|
114
|
+
const month = Number(m[2]);
|
|
115
|
+
const day = Number(m[3]);
|
|
116
|
+
if (month < 1 || month > 12)
|
|
117
|
+
return false;
|
|
118
|
+
if (day < 1 || day > 31)
|
|
119
|
+
return false;
|
|
120
|
+
// Round-trip check rejects impossible calendar dates (e.g. Feb 30).
|
|
121
|
+
const reconstructed = new Date(Date.UTC(year, month - 1, day));
|
|
122
|
+
return (reconstructed.getUTCFullYear() === year &&
|
|
123
|
+
reconstructed.getUTCMonth() === month - 1 &&
|
|
124
|
+
reconstructed.getUTCDate() === day);
|
|
125
|
+
}
|
|
126
|
+
function dayKey(ts) {
|
|
127
|
+
const d = new Date(ts);
|
|
128
|
+
const year = d.getUTCFullYear();
|
|
129
|
+
const month = String(d.getUTCMonth() + 1).padStart(2, "0");
|
|
130
|
+
const day = String(d.getUTCDate()).padStart(2, "0");
|
|
131
|
+
return `${year}-${month}-${day}`;
|
|
132
|
+
}
|
|
133
|
+
function trimByDay(byDay, retainDays) {
|
|
134
|
+
const keys = Object.keys(byDay).sort();
|
|
135
|
+
if (keys.length <= retainDays)
|
|
136
|
+
return byDay;
|
|
137
|
+
const kept = keys.slice(keys.length - retainDays);
|
|
138
|
+
const result = {};
|
|
139
|
+
for (const k of kept) {
|
|
140
|
+
const v = byDay[k];
|
|
141
|
+
if (v !== undefined)
|
|
142
|
+
result[k] = v;
|
|
143
|
+
}
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
146
|
+
function writeAtomic(file, metrics) {
|
|
147
|
+
const dir = path.dirname(file);
|
|
148
|
+
fs.mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
149
|
+
const tmp = `${file}.tmp`;
|
|
150
|
+
fs.writeFileSync(tmp, `${JSON.stringify(metrics, null, 2)}\n`, {
|
|
151
|
+
mode: 0o600,
|
|
152
|
+
});
|
|
153
|
+
fs.renameSync(tmp, file);
|
|
154
|
+
}
|
|
155
|
+
/** Returns true if the outbound analytics preference is not an explicit false. */
|
|
156
|
+
function isRecordingAllowed() {
|
|
157
|
+
return getAnalyticsPref() !== false;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Record one successful recipe run. Sets `firstRecipeRunAt` on the first call
|
|
161
|
+
* and increments total + per-day counters. Trims the per-day map so the file
|
|
162
|
+
* stays O(14 entries).
|
|
163
|
+
*
|
|
164
|
+
* No-op if the user has explicitly opted out of analytics.
|
|
165
|
+
*/
|
|
166
|
+
export function recordRecipeRun(configDir, now = Date.now()) {
|
|
167
|
+
if (!isRecordingAllowed())
|
|
168
|
+
return;
|
|
169
|
+
const file = resolveMetricsPath(configDir);
|
|
170
|
+
const current = loadMetrics(configDir, now);
|
|
171
|
+
const key = dayKey(now);
|
|
172
|
+
const nextByDay = { ...current.recipeRunsByDay };
|
|
173
|
+
nextByDay[key] = (nextByDay[key] ?? 0) + 1;
|
|
174
|
+
const next = {
|
|
175
|
+
...current,
|
|
176
|
+
firstRecipeRunAt: current.firstRecipeRunAt ?? now,
|
|
177
|
+
recipeRunsTotal: current.recipeRunsTotal + 1,
|
|
178
|
+
recipeRunsByDay: trimByDay(nextByDay, MAX_DAYS_RETAINED),
|
|
179
|
+
};
|
|
180
|
+
try {
|
|
181
|
+
writeAtomic(file, next);
|
|
182
|
+
}
|
|
183
|
+
catch {
|
|
184
|
+
// Metrics must never affect product behavior — swallow write failures.
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/** Record an approval prompt being surfaced to the user. */
|
|
188
|
+
export function recordApprovalPrompted(configDir, now = Date.now()) {
|
|
189
|
+
if (!isRecordingAllowed())
|
|
190
|
+
return;
|
|
191
|
+
const file = resolveMetricsPath(configDir);
|
|
192
|
+
const current = loadMetrics(configDir, now);
|
|
193
|
+
const next = {
|
|
194
|
+
...current,
|
|
195
|
+
approvalsPrompted: current.approvalsPrompted + 1,
|
|
196
|
+
};
|
|
197
|
+
try {
|
|
198
|
+
writeAtomic(file, next);
|
|
199
|
+
}
|
|
200
|
+
catch {
|
|
201
|
+
// swallow
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/** Record an approval being acted on (approved or rejected — not a timeout). */
|
|
205
|
+
export function recordApprovalCompleted(configDir, now = Date.now()) {
|
|
206
|
+
if (!isRecordingAllowed())
|
|
207
|
+
return;
|
|
208
|
+
const file = resolveMetricsPath(configDir);
|
|
209
|
+
const current = loadMetrics(configDir, now);
|
|
210
|
+
const next = {
|
|
211
|
+
...current,
|
|
212
|
+
approvalsCompleted: current.approvalsCompleted + 1,
|
|
213
|
+
};
|
|
214
|
+
try {
|
|
215
|
+
writeAtomic(file, next);
|
|
216
|
+
}
|
|
217
|
+
catch {
|
|
218
|
+
// swallow
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
/** Derive a dashboard-friendly summary from a metrics record. Pure function. */
|
|
222
|
+
export function computeSummary(metrics, now = Date.now()) {
|
|
223
|
+
const timeToFirst = metrics.firstRecipeRunAt !== null
|
|
224
|
+
? Math.max(0, metrics.firstRecipeRunAt - metrics.installedAt)
|
|
225
|
+
: null;
|
|
226
|
+
const sevenDaysAgo = now - 7 * 24 * 60 * 60 * 1000;
|
|
227
|
+
let runsLast7 = 0;
|
|
228
|
+
let activeDays = 0;
|
|
229
|
+
for (const [key, count] of Object.entries(metrics.recipeRunsByDay)) {
|
|
230
|
+
// Reconstruct timestamp at UTC midnight for the day bucket.
|
|
231
|
+
const [y, m, d] = key.split("-").map(Number);
|
|
232
|
+
if (y === undefined || m === undefined || d === undefined)
|
|
233
|
+
continue;
|
|
234
|
+
const bucket = Date.UTC(y, m - 1, d);
|
|
235
|
+
if (bucket >= sevenDaysAgo && count > 0) {
|
|
236
|
+
runsLast7 += count;
|
|
237
|
+
activeDays += 1;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
const approvalCompletionRate = metrics.approvalsPrompted > 0
|
|
241
|
+
? Math.min(1, metrics.approvalsCompleted / metrics.approvalsPrompted)
|
|
242
|
+
: null;
|
|
243
|
+
return {
|
|
244
|
+
installedAt: metrics.installedAt,
|
|
245
|
+
firstRecipeRunAt: metrics.firstRecipeRunAt,
|
|
246
|
+
timeToFirstRecipeRunMs: timeToFirst,
|
|
247
|
+
recipeRunsTotal: metrics.recipeRunsTotal,
|
|
248
|
+
recipeRunsLast7Days: runsLast7,
|
|
249
|
+
activeDaysLast7: activeDays,
|
|
250
|
+
approvalCompletionRate,
|
|
251
|
+
approvalsPrompted: metrics.approvalsPrompted,
|
|
252
|
+
approvalsCompleted: metrics.approvalsCompleted,
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=activationMetrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activationMetrics.js","sourceRoot":"","sources":["../src/activationMetrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AA4BvD,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAC1C,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B,SAAS,kBAAkB,CAAC,SAAkB;IAC5C,IAAI,SAAS;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAC7D,MAAM,IAAI,GACR,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;IACtE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,YAAY,CAAC,GAAW;IAC/B,OAAO;QACL,WAAW,EAAE,GAAG;QAChB,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