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
package/README.bridge.md
CHANGED
|
@@ -40,6 +40,12 @@ claude --ide
|
|
|
40
40
|
|
|
41
41
|
> **Updating?** Use `npm install -g claude-ide-bridge@latest` — `npm update -g` may lag the registry cache after a new release.
|
|
42
42
|
|
|
43
|
+
> **macOS LaunchAgent users:** always install from the registry (`npm install -g patchwork-os`) or
|
|
44
|
+
> from a tarball (`npm pack && npm install -g patchwork-os-*.tgz`).
|
|
45
|
+
> Running `npm install -g .` from a repo checkout creates a symlink — the macOS sandbox
|
|
46
|
+
> cannot follow it, causing EPERM when launchctl starts the bridge.
|
|
47
|
+
> `patchwork-os launchd install` will refuse to proceed and print fix instructions.
|
|
48
|
+
|
|
43
49
|
After `init`, type `/mcp` in Claude Code to confirm the bridge is connected. Type `/ide` to see open files, diagnostics, and editor state.
|
|
44
50
|
|
|
45
51
|
> **One bridge per workspace.** Each project runs its own bridge instance on its own port. Start a separate `claude-ide-bridge --watch` in each directory.
|
package/README.md
CHANGED
|
@@ -1,67 +1,347 @@
|
|
|
1
1
|
# Patchwork OS
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
### Your personal AI runtime, local-first.
|
|
4
|
+
|
|
5
|
+
> Patchwork OS is a local-first personal AI runtime: pluggable model providers, hot-reloadable tools, YAML recipes, a delegation policy with approval queue, and a durable trace memory — all running on your machine, all under your policy.
|
|
6
|
+
|
|
7
|
+
You decide which model. You decide which actions need a human nod. You own the credentials, the logs, and the deployment. Nothing phones home.
|
|
8
|
+
|
|
9
|
+
**Five primitives, one runtime:**
|
|
10
|
+
|
|
11
|
+
- **Tools** — 170+ built-in (LSP, git, terminal, debugger, files) plus any plugin you write. Plugins hot-reload — Claude can author a tool mid-session and call it on the next turn. See [Live Toolsmithing](documents/live-toolsmithing.md).
|
|
12
|
+
- **Recipes** — YAML automations triggered by cron, file save, git commit, test run, or webhook. Anything that can POST a JSON payload can fire a recipe.
|
|
13
|
+
- **Delegation Policy** — three risk tiers, four-source precedence (managed → project-local → project → user). Auto-approve safe, require approval for risky, block dangerous.
|
|
14
|
+
- **Trace memory** — every approval, every recipe run, every enrichment is durable JSONL. Past decisions are surfaced into future sessions automatically. Bundle and back up with [`patchwork traces export`](src/commands/tracesExport.ts).
|
|
15
|
+
- **OAuth** — turn your runtime into a private personal API. PKCE S256, dynamic client registration, deployable on a VPS in minutes.
|
|
16
|
+
|
|
17
|
+
> **Why not [an MCP server / Zapier / a hosted assistant / a local agent framework]?** See [the comparison page](documents/comparison.md) for the honest tradeoff against each.
|
|
18
|
+
>
|
|
19
|
+
> **What does this look like in one diagram?** See the [architecture overview](documents/architecture.md).
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
The same codebase ships **two ways to use it.** Pick the layer you need.
|
|
24
|
+
|
|
25
|
+
| | What you get | Install | Best for |
|
|
26
|
+
|---|---|---|---|
|
|
27
|
+
| **🔌 Claude IDE Bridge** | MCP bridge connecting Claude Code to your IDE. 170+ tools — diagnostics, LSP, debugger, terminal, git, GitHub, file ops. | `npm i -g patchwork-os` then run `claude-ide-bridge` | Anyone who wants Claude Code to see and act on their editor state |
|
|
28
|
+
| **🤖 Patchwork OS** | Everything in the bridge **plus** YAML recipes, approval queue, oversight dashboard, mobile push approvals, multi-model providers, JetBrains companion. | Same package, run `patchwork patchwork-init` | Power users running automation, agent workflows, or background tasks |
|
|
29
|
+
|
|
30
|
+
Same codebase. Bridge is the foundation; Patchwork OS is the optional layer on top. **No vendor lock-in. Runs on your machine.**
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 🔌 Claude IDE Bridge — Quick Start
|
|
4
35
|
|
|
5
36
|
```bash
|
|
6
|
-
|
|
37
|
+
# 1. Install the npm package
|
|
38
|
+
npm install -g patchwork-os
|
|
39
|
+
|
|
40
|
+
# 2. Install the VS Code / Cursor / Windsurf extension
|
|
41
|
+
# Search "Claude IDE Bridge" on OpenVSX, or:
|
|
42
|
+
claude-ide-bridge install-extension
|
|
43
|
+
|
|
44
|
+
# 3. Start the bridge for your workspace
|
|
45
|
+
claude-ide-bridge --workspace .
|
|
46
|
+
|
|
47
|
+
# 4. Connect Claude Code (in another terminal)
|
|
48
|
+
CLAUDE_CODE_IDE_SKIP_VALID_CHECK=true claude --ide
|
|
7
49
|
```
|
|
8
50
|
|
|
9
|
-
That
|
|
51
|
+
Type `/ide` in Claude Code to confirm the connection. That's it — Claude now sees your diagnostics, open files, and editor state, and can call 170+ tools to act on them.
|
|
52
|
+
|
|
53
|
+
**What the bridge gives Claude:**
|
|
54
|
+
|
|
55
|
+
- Diagnostics, LSP navigation (goto / references / call hierarchy), refactoring with risk analysis
|
|
56
|
+
- Terminal — run commands, read output, wait for async work
|
|
57
|
+
- Git — status, diff, commit, push, blame, checkout, branch list
|
|
58
|
+
- GitHub — open PRs, list issues, post reviews, fetch run logs
|
|
59
|
+
- Debugger — set breakpoints, evaluate expressions, inspect runtime state
|
|
60
|
+
- Files — read, edit by line range, search and replace, capture screenshots
|
|
61
|
+
- Code quality — `auditDependencies`, `detectUnusedCode`, `getCodeCoverage`, `getGitHotspots`
|
|
62
|
+
|
|
63
|
+
The bridge runs without any flags. No recipes, no automation, no dashboard — just the IDE-Claude connection.
|
|
64
|
+
|
|
65
|
+
**Compatible IDEs:** VS Code, Cursor, Windsurf, Google Antigravity. JetBrains IDEs via [companion plugin](#jetbrains-plugin).
|
|
66
|
+
|
|
67
|
+
**Transport layers:**
|
|
10
68
|
|
|
11
|
-
|
|
69
|
+
| Client | Protocol |
|
|
70
|
+
|---|---|
|
|
71
|
+
| Claude Code CLI | WebSocket `ws://127.0.0.1:<port>` |
|
|
72
|
+
| Claude Desktop | stdio shim → WebSocket |
|
|
73
|
+
| Remote (claude.ai, Codex CLI) | Streamable HTTP + Bearer token |
|
|
12
74
|
|
|
13
|
-
|
|
75
|
+
**Tool modes:**
|
|
14
76
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
77
|
+
| Mode | Tools | When to use |
|
|
78
|
+
|---|---|---|
|
|
79
|
+
| Full _(default)_ | ~170 | All git, GitHub, terminal, file ops, orchestration |
|
|
80
|
+
| Slim (`--slim`) | ~60 | LSP + debugger + editor state only |
|
|
18
81
|
|
|
19
|
-
|
|
82
|
+
Bridge-only docs: [documents/platform-docs.md](documents/platform-docs.md)
|
|
20
83
|
|
|
21
|
-
|
|
22
|
-
- **Your models, your keys** — Claude, GPT, Gemini, Grok, or local Ollama. Swap anytime. Nothing phones home.
|
|
23
|
-
- **Oversight first** — everything risky lands in `~/.patchwork/inbox/` for your approval before it goes anywhere.
|
|
84
|
+
---
|
|
24
85
|
|
|
25
|
-
##
|
|
86
|
+
## 🤖 Patchwork OS — Quick Start
|
|
26
87
|
|
|
27
88
|
```bash
|
|
28
|
-
patchwork-os
|
|
29
|
-
patchwork-os recipe run daily-status # run one now
|
|
30
|
-
patchwork-os # open terminal dashboard
|
|
89
|
+
npx patchwork-os@beta patchwork-init
|
|
31
90
|
```
|
|
32
91
|
|
|
33
|
-
|
|
92
|
+
Sets up 5 local recipes, detects Ollama, and opens a terminal dashboard — under 90 seconds.
|
|
34
93
|
|
|
35
|
-
|
|
94
|
+
### ☀️ Morning Brief — the hero workflow
|
|
36
95
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
96
|
+
Get an AI digest of your Gmail, calendar, and tasks every morning — or on demand:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# First-time setup (connect Gmail + Google Calendar)
|
|
100
|
+
patchwork-os patchwork-init
|
|
101
|
+
patchwork-os connections connect gmail
|
|
102
|
+
patchwork-os connections connect google-calendar
|
|
103
|
+
|
|
104
|
+
# Run it now
|
|
105
|
+
patchwork-os recipe run morning-brief
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
The brief lands in `~/.patchwork/inbox/` as a Markdown file. Open the dashboard (`http://localhost:3200`) to read it, approve any drafted replies, or let it auto-send at 08:00 via the built-in cron trigger.
|
|
109
|
+
|
|
110
|
+
No connectors yet? Run with `--local` using Ollama — it summarises your clipboard and last-touched files instead.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
### What it adds on top of the bridge
|
|
115
|
+
|
|
116
|
+
Patchwork OS is a local automation platform that watches your workspace for events, runs AI-powered recipes in response, and routes anything risky through an approval queue before it goes anywhere.
|
|
117
|
+
|
|
118
|
+
Think of it as a background agent that acts on your behalf — but asks before sending, writing, or modifying anything consequential.
|
|
119
|
+
|
|
120
|
+
- Test suite fails on CI → triage note in your inbox before you wake up
|
|
121
|
+
- Customer email arrives → draft reply in your voice, pending your approval
|
|
122
|
+
- Field-trip permission form flagged → reply drafted to the teacher, waiting for your nod
|
|
123
|
+
|
|
124
|
+
**Recipes** are plain YAML files. They declare a trigger (cron, file save, git commit, test run, webhook) and an action (run a prompt, write to inbox, call a connector). No code required. Share them like dotfiles.
|
|
125
|
+
|
|
126
|
+
**Models** are yours. Claude, GPT, Gemini, Grok, or local Ollama. Swap at any time. Nothing phones home.
|
|
127
|
+
|
|
128
|
+
**Oversight** is non-negotiable. Every write or external action lands in `~/.patchwork/inbox/` for approval. The web UI at `http://localhost:3200` shows pending approvals, live sessions, recipe run history, and analytics.
|
|
129
|
+
|
|
130
|
+
### Patchwork commands
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# One-command setup: extension + CLAUDE.md + starter recipes
|
|
134
|
+
patchwork patchwork-init
|
|
135
|
+
|
|
136
|
+
# Explore
|
|
137
|
+
patchwork recipe list # installed recipes
|
|
138
|
+
patchwork recipe run daily-status # run one now
|
|
139
|
+
patchwork recipe run morning-brief --local # run with local Ollama
|
|
140
|
+
patchwork tools list # browse 170+ tools
|
|
141
|
+
patchwork # open terminal dashboard
|
|
142
|
+
|
|
143
|
+
# Web UI — bridge + extension watcher in tmux
|
|
144
|
+
patchwork start-all # then http://localhost:3200
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Starter recipes
|
|
148
|
+
|
|
149
|
+
The package ships these in `templates/recipes/`. Recipes that need API keys are noted; the rest are zero-config.
|
|
150
|
+
|
|
151
|
+
| Recipe | Trigger | What it does | Needs |
|
|
152
|
+
|---|---|---|---|
|
|
153
|
+
| `ambient-journal` | git commit | Appends one line to `~/.patchwork/journal/` | — |
|
|
154
|
+
| `daily-status` | cron 08:00 | Morning brief from yesterday's commits | — |
|
|
155
|
+
| `lint-on-save` | file save | Surfaces new TS/JS diagnostics to inbox | — |
|
|
156
|
+
| `stale-branches` | cron weekly | Lists branches older than 30 days | — |
|
|
157
|
+
| `watch-failing-tests` | test run | Drops triage note to inbox on failure | — |
|
|
158
|
+
| `project-health-check` | manual | Snapshot of repo health + flagged risks | — |
|
|
159
|
+
| `ctx-loop-test` | manual | Smoke test for context-platform end-to-end | — |
|
|
160
|
+
| `morning-brief` | cron 08:00 | Gmail + Linear + Slack + Calendar digest | Gmail, Linear, Slack, Google Calendar |
|
|
161
|
+
| `morning-brief-slack` | cron 08:00 | Same brief but only posts to Slack | Linear, Slack |
|
|
162
|
+
| `gmail-health-check` | manual | Verify Gmail connector + token state | Gmail |
|
|
163
|
+
| `inbox-triage` | manual | Triage Gmail unread → suggest archive/reply | Gmail |
|
|
164
|
+
| `sentry-to-linear` | manual | Sentry issue → Linear ticket (one-shot) | Sentry, Linear |
|
|
165
|
+
|
|
166
|
+
**Connectors available** (all writes governed by your delegation policy): Slack, GitHub, Linear, Gmail, Google Calendar, Google Drive, Sentry, Notion, Confluence, Datadog, HubSpot, Intercom, Stripe, Zendesk, Jira, PagerDuty, Discord, Asana, GitLab.
|
|
167
|
+
|
|
168
|
+
**Delegation policy presets** ([`templates/policies/`](templates/policies/)): five persona starters — conservative, developer, headless-CI, regulated-industry, personal-assistant. Copy one into `~/.patchwork/config.json` and restart.
|
|
169
|
+
|
|
170
|
+
**Webhook recipe starters** ([`templates/recipes/webhook/`](templates/recipes/webhook/)): five webhook-triggered recipes — capture-thought, morning-brief (on-demand), meeting-prep, incident-intake, customer-escalation. Anything that can POST HTTP can drive these — iPhone Shortcut, Stream Deck, Home Assistant, NFC tag, monitoring tool.
|
|
171
|
+
|
|
172
|
+
### Automation hooks
|
|
44
173
|
|
|
45
|
-
|
|
174
|
+
Event-driven hooks trigger Claude tasks automatically. Activate with `--automation --automation-policy <path.json> --claude-driver subprocess`.
|
|
46
175
|
|
|
47
|
-
|
|
176
|
+
Key hooks:
|
|
48
177
|
|
|
49
|
-
|
|
|
178
|
+
| Hook | Fires when |
|
|
50
179
|
|---|---|
|
|
51
|
-
|
|
|
52
|
-
|
|
|
53
|
-
|
|
|
54
|
-
|
|
|
180
|
+
| `onFileSave` | Matching files saved |
|
|
181
|
+
| `onDiagnosticsStateChange` | Errors appear or clear |
|
|
182
|
+
| `onRecipeSave` | Any `.yaml`/`.yml` saved — runs preflight |
|
|
183
|
+
| `onGitCommit` / `onGitPush` / `onGitPull` | Git tools succeed |
|
|
184
|
+
| `onTestRun` | Test run completes (filter: any/failure/pass-after-fail) |
|
|
185
|
+
| `onBranchCheckout` | After branch switch |
|
|
186
|
+
| `onPullRequest` | After `githubCreatePR` succeeds |
|
|
187
|
+
| `onCompaction` | Before/after Claude context compaction |
|
|
188
|
+
| `onTaskCreated` / `onTaskSuccess` | Orchestrator task lifecycle |
|
|
55
189
|
|
|
56
|
-
|
|
190
|
+
All hooks support inline prompts, named prompt references, and a minimum 5s cooldown. Full reference: [documents/platform-docs.md → Automation Hooks](documents/platform-docs.md)
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Architecture
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
patchwork-os (npm package)
|
|
198
|
+
│
|
|
199
|
+
├── claude-ide-bridge ← run alone for bridge-only mode
|
|
200
|
+
│ ├── MCP server 170+ tools over WebSocket / HTTP / stdio
|
|
201
|
+
│ ├── VS Code extension LSP, debugger, editor state, live diagnostics
|
|
202
|
+
│ ├── Git / GitHub gitCommit, gitPush, githubCreatePR, …
|
|
203
|
+
│ ├── Terminal runInTerminal, getTerminalOutput, …
|
|
204
|
+
│ └── Code quality auditDependencies, detectUnusedCode, getCodeCoverage
|
|
205
|
+
│
|
|
206
|
+
└── patchwork ← run for full Patchwork OS layer
|
|
207
|
+
├── Recipe runner YAML triggers → LLM prompt → action
|
|
208
|
+
├── Connectors Linear, Sentry, Slack, Google Calendar, +
|
|
209
|
+
├── Orchestrator Claude subprocess tasks, automation hooks
|
|
210
|
+
├── Oversight inbox ~/.patchwork/inbox/ — approval queue
|
|
211
|
+
└── Web dashboard http://localhost:3200 — approvals, sessions, analytics
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
The npm package ships **three CLI binaries** that share the same code:
|
|
215
|
+
|
|
216
|
+
| Binary | Default behavior |
|
|
217
|
+
|---|---|
|
|
218
|
+
| `claude-ide-bridge` | Bridge only — no automation, no recipe runner, no dashboard |
|
|
219
|
+
| `patchwork` | Full Patchwork OS — automation + recipes + dashboard |
|
|
220
|
+
| `patchwork-os` | Alias for `patchwork` |
|
|
221
|
+
|
|
222
|
+
Use whichever fits your mental model.
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Tool surface (v0.2.0-beta.0)
|
|
227
|
+
|
|
228
|
+
170+ MCP tools across 15 categories. Highlights:
|
|
229
|
+
|
|
230
|
+
| Category | Tools |
|
|
231
|
+
|---|---|
|
|
232
|
+
| LSP / Code Intelligence | `getDiagnostics`, `goToDefinition`, `findReferences`, `getCallHierarchy`, `renameSymbol`, `refactorAnalyze`, `explainSymbol`, … (37 tools) |
|
|
233
|
+
| Git | `getGitStatus`, `getGitDiff`, `gitCommit`, `gitPush`, `gitCheckout`, `gitBlame`, … (16 tools) |
|
|
234
|
+
| GitHub | `githubCreatePR`, `githubListPRs`, `githubCreateIssue`, `githubPostPRReview`, … (13 tools) |
|
|
235
|
+
| Terminal | `runInTerminal`, `createTerminal`, `getTerminalOutput`, `waitForTerminalOutput` |
|
|
236
|
+
| File Operations | `editText`, `searchAndReplace`, `searchWorkspace`, `findFiles`, `getFileTree`, … |
|
|
237
|
+
| Debugger | `setDebugBreakpoints`, `startDebugging`, `evaluateInDebugger` |
|
|
238
|
+
| Orchestrator | `runClaudeTask`, `listClaudeTasks`, `getClaudeTaskStatus` |
|
|
239
|
+
| Context Platform | `ctxGetTaskContext`, `ctxQueryTraces`, `ctxSaveTrace`, `enrichStackTrace` |
|
|
240
|
+
|
|
241
|
+
Full reference: [documents/platform-docs.md](documents/platform-docs.md)
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Plugin system
|
|
246
|
+
|
|
247
|
+
Extend the tool surface without forking the bridge.
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
# Scaffold a new plugin
|
|
251
|
+
patchwork gen-plugin-stub ./my-plugin --name "org/name" --prefix "myPrefix"
|
|
252
|
+
|
|
253
|
+
# Load at runtime
|
|
254
|
+
claude-ide-bridge --plugin ./my-plugin
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
Plugins register MCP tools in-process. With `--plugin-watch`, the bridge reloads them on save — Claude can write a tool *during* a session and use it on the next turn. See [documents/live-toolsmithing.md](documents/live-toolsmithing.md) for the worked walkthrough and [examples/plugins/sqlite-library/](examples/plugins/sqlite-library/) for a runnable example.
|
|
258
|
+
|
|
259
|
+
Publish to npm with keyword `claude-ide-bridge-plugin` for distribution.
|
|
260
|
+
|
|
261
|
+
Full reference: [documents/plugin-authoring.md](documents/plugin-authoring.md)
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## JetBrains plugin
|
|
266
|
+
|
|
267
|
+
Companion IntelliJ plugin (v1.0.0) on the JetBrains Marketplace. Covers 49 handlers: core tools, PSI-based LSP (goto, references, hover, rename, symbols, format), XDebugger integration, and code style tools.
|
|
268
|
+
|
|
269
|
+
Use the same bridge from VS Code and JetBrains IDEs simultaneously — IntelliJ IDEA, PyCharm, GoLand, WebStorm, and other IntelliJ-platform editors.
|
|
270
|
+
|
|
271
|
+
Source: [intellij-plugin/](intellij-plugin/)
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## Remote deployment
|
|
276
|
+
|
|
277
|
+
Run headless on a VPS with full tool support via VS Code Remote-SSH.
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
claude-ide-bridge --bind 0.0.0.0 \
|
|
281
|
+
--issuer-url https://your-domain.com \
|
|
282
|
+
--fixed-token <uuid> \
|
|
283
|
+
--vps
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
Systemd service and deploy scripts in [`deploy/`](deploy/). Full guide: [docs/remote-access.md](docs/remote-access.md).
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## What's shipped
|
|
291
|
+
|
|
292
|
+
| Feature | Status |
|
|
293
|
+
|---|---|
|
|
294
|
+
| 170+ MCP tools (LSP, git, tests, debugger, diagnostics) | **shipped** |
|
|
295
|
+
| VS Code / Cursor / Windsurf / Antigravity extension | **shipped** |
|
|
296
|
+
| JetBrains plugin (49 handlers) | **shipped** |
|
|
297
|
+
| `patchwork-init` — one-command setup | **shipped** |
|
|
298
|
+
| Terminal dashboard | **shipped** |
|
|
299
|
+
| Web oversight UI (approvals, sessions, recipes) | **shipped** |
|
|
300
|
+
| Recipe runner (YAML, cron, manual, webhook) | **shipped** |
|
|
301
|
+
| Multi-provider LLM (Claude, Gemini, OpenAI, Grok, Ollama) | **shipped** |
|
|
302
|
+
| Connectors: Linear, Sentry, Slack, Google Calendar, Intercom, HubSpot, Datadog, Stripe | **shipped** |
|
|
303
|
+
| Cross-session memory (traces, handoff notes) | **shipped** |
|
|
304
|
+
| Mobile oversight PWA (push approvals) | **shipped (beta)** |
|
|
305
|
+
| Community recipe marketplace | Q3 2026 |
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## Install from source
|
|
57
310
|
|
|
58
311
|
```bash
|
|
59
312
|
git clone https://github.com/Oolab-labs/patchwork-os
|
|
60
313
|
cd patchwork-os
|
|
61
314
|
npm install && npm run build
|
|
62
|
-
|
|
315
|
+
|
|
316
|
+
# Pack first — do NOT use `npm install -g .`
|
|
317
|
+
# Symlink installs break the macOS LaunchAgent (EPERM at startup)
|
|
318
|
+
npm pack
|
|
319
|
+
npm install -g patchwork-os-*.tgz
|
|
320
|
+
patchwork patchwork-init
|
|
63
321
|
```
|
|
64
322
|
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## Documentation
|
|
326
|
+
|
|
327
|
+
| Doc | Contents |
|
|
328
|
+
|---|---|
|
|
329
|
+
| [documents/platform-docs.md](documents/platform-docs.md) | Full tool reference (170+ tools), automation hooks, connectors |
|
|
330
|
+
| [documents/prompts-reference.md](documents/prompts-reference.md) | All 72 MCP prompts |
|
|
331
|
+
| [documents/styleguide.md](documents/styleguide.md) | Code conventions, UI patterns |
|
|
332
|
+
| [documents/roadmap.md](documents/roadmap.md) | Development direction |
|
|
333
|
+
| [documents/data-reference.md](documents/data-reference.md) | Data flows, state management, protocol details |
|
|
334
|
+
| [documents/plugin-authoring.md](documents/plugin-authoring.md) | Plugin manifest schema, entrypoint API, distribution |
|
|
335
|
+
| [documents/live-toolsmithing.md](documents/live-toolsmithing.md) | Write tools while the AI is using them — hot-reload narrative + worked example |
|
|
336
|
+
| [documents/triggers.md](documents/triggers.md) | Anything Can Trigger Your AI — iPhone Shortcuts, Stream Deck, Home Assistant, curl, GitHub Actions |
|
|
337
|
+
| [documents/speculative-refactoring.md](documents/speculative-refactoring.md) | Stage multi-file edits, review the diff, commit or discard — honest about commit-phase semantics |
|
|
338
|
+
| [documents/architecture.md](documents/architecture.md) | One-page architecture diagram + how to read it |
|
|
339
|
+
| [documents/comparison.md](documents/comparison.md) | Patchwork vs MCP server / Zapier / hosted assistants / agent frameworks — honest tradeoffs |
|
|
340
|
+
| [docs/adr/](docs/adr/) | Architecture Decision Records |
|
|
341
|
+
| [docs/remote-access.md](docs/remote-access.md) | VPS deployment guide |
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
65
345
|
## License
|
|
66
346
|
|
|
67
|
-
MIT © Oolab Labs
|
|
347
|
+
MIT © Oolab Labs
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# deploy/bootstrap-new-vps.sh
|
|
3
|
-
# Full fresh-server setup for
|
|
3
|
+
# Full fresh-server setup for patchwork-os on a NEW VPS.
|
|
4
4
|
# Handles everything from Node.js install to running HTTPS service.
|
|
5
5
|
#
|
|
6
6
|
# Usage (run as root on a fresh Ubuntu 22.04/24.04 VPS):
|
|
7
|
-
# curl -fsSL https://raw.githubusercontent.com/Oolab-labs/
|
|
7
|
+
# curl -fsSL https://raw.githubusercontent.com/Oolab-labs/patchwork-os/main/deploy/bootstrap-new-vps.sh | \
|
|
8
8
|
# DOMAIN=bridge.example.com bash
|
|
9
9
|
#
|
|
10
10
|
# Or after cloning:
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
# DOMAIN Subdomain for the bridge (e.g. bridge.example.com)
|
|
15
15
|
#
|
|
16
16
|
# Optional environment variables:
|
|
17
|
-
# REPO_URL Git repo URL (default: https://github.com/Oolab-labs/
|
|
18
|
-
# INSTALL_DIR Where to clone the repo (default: /opt/
|
|
19
|
-
# SERVICE_USER System user to run bridge (default:
|
|
17
|
+
# REPO_URL Git repo URL (default: https://github.com/Oolab-labs/patchwork-os)
|
|
18
|
+
# INSTALL_DIR Where to clone the repo (default: /opt/patchwork-os)
|
|
19
|
+
# SERVICE_USER System user to run bridge (default: patchwork)
|
|
20
20
|
# PORT Bridge port (default: 9000)
|
|
21
21
|
# BRANCH Git branch to clone (default: main)
|
|
22
22
|
# SKIP_CERTBOT Set to 1 to skip TLS cert (useful if DNS not yet set)
|
|
@@ -25,13 +25,13 @@ set -euo pipefail
|
|
|
25
25
|
|
|
26
26
|
# ── Config ────────────────────────────────────────────────────────────────────
|
|
27
27
|
DOMAIN="${DOMAIN:-}"
|
|
28
|
-
REPO_URL="${REPO_URL:-https://github.com/Oolab-labs/
|
|
29
|
-
INSTALL_DIR="${INSTALL_DIR:-/opt/
|
|
30
|
-
SERVICE_USER="${SERVICE_USER:-
|
|
28
|
+
REPO_URL="${REPO_URL:-https://github.com/Oolab-labs/patchwork-os}"
|
|
29
|
+
INSTALL_DIR="${INSTALL_DIR:-/opt/patchwork-os}"
|
|
30
|
+
SERVICE_USER="${SERVICE_USER:-patchwork}"
|
|
31
31
|
PORT="${PORT:-9000}"
|
|
32
32
|
BRANCH="${BRANCH:-main}"
|
|
33
33
|
SKIP_CERTBOT="${SKIP_CERTBOT:-0}"
|
|
34
|
-
SERVICE_NAME="
|
|
34
|
+
SERVICE_NAME="patchwork-os"
|
|
35
35
|
|
|
36
36
|
RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m'
|
|
37
37
|
info() { echo -e "${GREEN}✓${NC} $*"; }
|
|
@@ -163,8 +163,8 @@ section "Systemd service"
|
|
|
163
163
|
# Generate service file from template (parameterised for this install)
|
|
164
164
|
cat > "/etc/systemd/system/${SERVICE_NAME}.service" <<SERVICE
|
|
165
165
|
[Unit]
|
|
166
|
-
Description=
|
|
167
|
-
Documentation=https://github.com/Oolab-labs/
|
|
166
|
+
Description=Patchwork OS bridge
|
|
167
|
+
Documentation=https://github.com/Oolab-labs/patchwork-os
|
|
168
168
|
After=network.target
|
|
169
169
|
StartLimitIntervalSec=120
|
|
170
170
|
StartLimitBurst=5
|
|
@@ -193,7 +193,7 @@ RestartSec=5
|
|
|
193
193
|
|
|
194
194
|
StandardOutput=journal
|
|
195
195
|
StandardError=journal
|
|
196
|
-
SyslogIdentifier=
|
|
196
|
+
SyslogIdentifier=patchwork-os
|
|
197
197
|
|
|
198
198
|
NoNewPrivileges=true
|
|
199
199
|
PrivateTmp=true
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# deploy/bootstrap-vps.sh
|
|
3
|
+
# Full VPS bootstrap for patchworkos.com
|
|
4
|
+
# Run as root on a fresh Ubuntu 24.04 VPS
|
|
5
|
+
# Usage: bash bootstrap-vps.sh
|
|
6
|
+
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
DOMAIN="patchworkos.com"
|
|
10
|
+
EMAIL="support@gigsecure.co.ke"
|
|
11
|
+
BRIDGE_PORT=3284
|
|
12
|
+
BRIDGE_USER="patchwork"
|
|
13
|
+
BRIDGE_HOME="/opt/patchwork"
|
|
14
|
+
NODE_VERSION="22"
|
|
15
|
+
|
|
16
|
+
# ── Colours ──────────────────────────────────────────────────────────────────
|
|
17
|
+
RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m'
|
|
18
|
+
info() { echo -e "${GREEN}[bootstrap]${NC} $*"; }
|
|
19
|
+
warn() { echo -e "${YELLOW}[bootstrap]${NC} $*"; }
|
|
20
|
+
error() { echo -e "${RED}[bootstrap]${NC} $*"; exit 1; }
|
|
21
|
+
|
|
22
|
+
# ── 1. System updates ─────────────────────────────────────────────────────────
|
|
23
|
+
info "Updating system packages..."
|
|
24
|
+
apt-get update -qq
|
|
25
|
+
apt-get upgrade -y -qq
|
|
26
|
+
apt-get install -y -qq curl wget gnupg2 ca-certificates lsb-release \
|
|
27
|
+
nginx certbot python3-certbot-nginx ufw git jq unzip
|
|
28
|
+
|
|
29
|
+
# ── 2. Node.js ────────────────────────────────────────────────────────────────
|
|
30
|
+
info "Installing Node.js ${NODE_VERSION}..."
|
|
31
|
+
curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - >/dev/null
|
|
32
|
+
apt-get install -y -qq nodejs
|
|
33
|
+
node --version
|
|
34
|
+
npm --version
|
|
35
|
+
|
|
36
|
+
# ── 3. Service user ───────────────────────────────────────────────────────────
|
|
37
|
+
info "Creating service user '${BRIDGE_USER}'..."
|
|
38
|
+
id "${BRIDGE_USER}" &>/dev/null || useradd -r -m -d "${BRIDGE_HOME}" -s /bin/bash "${BRIDGE_USER}"
|
|
39
|
+
mkdir -p "${BRIDGE_HOME}"
|
|
40
|
+
chown "${BRIDGE_USER}:${BRIDGE_USER}" "${BRIDGE_HOME}"
|
|
41
|
+
|
|
42
|
+
# ── 4. Install bridge globally ────────────────────────────────────────────────
|
|
43
|
+
info "Installing patchwork-os from npm..."
|
|
44
|
+
npm install -g patchwork-os@alpha 2>&1 | tail -5
|
|
45
|
+
# `patchwork-os` ships three bin aliases: `patchwork` (preferred),
|
|
46
|
+
# `patchwork-os`, and the legacy `claude-ide-bridge`. Use the canonical
|
|
47
|
+
# `patchwork` name for the systemd unit + nginx config below.
|
|
48
|
+
BRIDGE_BIN="$(which patchwork)"
|
|
49
|
+
info "Bridge binary: ${BRIDGE_BIN}"
|
|
50
|
+
|
|
51
|
+
# ── 5. Generate fixed token ───────────────────────────────────────────────────
|
|
52
|
+
FIXED_TOKEN="$(uuidgen | tr '[:upper:]' '[:lower:]')"
|
|
53
|
+
info "Generated bridge token (save this!): ${FIXED_TOKEN}"
|
|
54
|
+
|
|
55
|
+
# Persist token to a file readable only by root + patchwork user
|
|
56
|
+
TOKEN_FILE="/etc/patchwork/bridge-token"
|
|
57
|
+
mkdir -p /etc/patchwork
|
|
58
|
+
echo "${FIXED_TOKEN}" > "${TOKEN_FILE}"
|
|
59
|
+
chown root:"${BRIDGE_USER}" "${TOKEN_FILE}"
|
|
60
|
+
chmod 640 "${TOKEN_FILE}"
|
|
61
|
+
|
|
62
|
+
# ── 6. Systemd service ────────────────────────────────────────────────────────
|
|
63
|
+
info "Writing systemd service..."
|
|
64
|
+
cat > /etc/systemd/system/patchwork-bridge.service <<EOF
|
|
65
|
+
[Unit]
|
|
66
|
+
Description=Patchwork OS — Claude IDE Bridge
|
|
67
|
+
After=network-online.target
|
|
68
|
+
Wants=network-online.target
|
|
69
|
+
|
|
70
|
+
[Service]
|
|
71
|
+
Type=simple
|
|
72
|
+
User=${BRIDGE_USER}
|
|
73
|
+
Group=${BRIDGE_USER}
|
|
74
|
+
WorkingDirectory=${BRIDGE_HOME}
|
|
75
|
+
Environment=NODE_ENV=production
|
|
76
|
+
Environment=HOME=${BRIDGE_HOME}
|
|
77
|
+
|
|
78
|
+
ExecStart=${BRIDGE_BIN} \\
|
|
79
|
+
--bind 0.0.0.0 \\
|
|
80
|
+
--port ${BRIDGE_PORT} \\
|
|
81
|
+
--vps \\
|
|
82
|
+
--issuer-url https://${DOMAIN} \\
|
|
83
|
+
--cors-origin https://claude.ai \\
|
|
84
|
+
--cors-origin https://app.patchworkos.com \\
|
|
85
|
+
--fixed-token ${FIXED_TOKEN}
|
|
86
|
+
|
|
87
|
+
Restart=always
|
|
88
|
+
RestartSec=5
|
|
89
|
+
StandardOutput=journal
|
|
90
|
+
StandardError=journal
|
|
91
|
+
SyslogIdentifier=patchwork-bridge
|
|
92
|
+
|
|
93
|
+
# Hardening
|
|
94
|
+
NoNewPrivileges=true
|
|
95
|
+
ProtectSystem=strict
|
|
96
|
+
ProtectHome=read-only
|
|
97
|
+
ReadWritePaths=${BRIDGE_HOME}
|
|
98
|
+
PrivateTmp=true
|
|
99
|
+
|
|
100
|
+
[Install]
|
|
101
|
+
WantedBy=multi-user.target
|
|
102
|
+
EOF
|
|
103
|
+
|
|
104
|
+
systemctl daemon-reload
|
|
105
|
+
systemctl enable patchwork-bridge
|
|
106
|
+
|
|
107
|
+
# ── 7. UFW firewall ───────────────────────────────────────────────────────────
|
|
108
|
+
info "Configuring firewall..."
|
|
109
|
+
ufw --force reset >/dev/null
|
|
110
|
+
ufw default deny incoming >/dev/null
|
|
111
|
+
ufw default allow outgoing >/dev/null
|
|
112
|
+
ufw allow ssh >/dev/null
|
|
113
|
+
ufw allow http >/dev/null
|
|
114
|
+
ufw allow https >/dev/null
|
|
115
|
+
ufw --force enable >/dev/null
|
|
116
|
+
ufw status
|
|
117
|
+
|
|
118
|
+
# ── 8. Nginx config — HTTP only first (certbot needs nginx up to issue cert) ──
|
|
119
|
+
info "Writing nginx config (HTTP only)..."
|
|
120
|
+
cat > /etc/nginx/sites-available/patchworkos <<'NGINX'
|
|
121
|
+
server {
|
|
122
|
+
listen 80;
|
|
123
|
+
listen [::]:80;
|
|
124
|
+
server_name patchworkos.com www.patchworkos.com;
|
|
125
|
+
|
|
126
|
+
location /.well-known/acme-challenge/ { root /var/www/html; }
|
|
127
|
+
|
|
128
|
+
location / {
|
|
129
|
+
proxy_pass http://127.0.0.1:3284;
|
|
130
|
+
proxy_http_version 1.1;
|
|
131
|
+
proxy_set_header Upgrade $http_upgrade;
|
|
132
|
+
proxy_set_header Connection "upgrade";
|
|
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
|
+
proxy_read_timeout 3600s;
|
|
138
|
+
proxy_send_timeout 3600s;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
NGINX
|
|
142
|
+
|
|
143
|
+
ln -sf /etc/nginx/sites-available/patchworkos /etc/nginx/sites-enabled/patchworkos
|
|
144
|
+
rm -f /etc/nginx/sites-enabled/default
|
|
145
|
+
|
|
146
|
+
nginx -t
|
|
147
|
+
systemctl reload nginx
|
|
148
|
+
|
|
149
|
+
# ── 9. TLS certificate ────────────────────────────────────────────────────────
|
|
150
|
+
info "Issuing Let's Encrypt certificate for ${DOMAIN}..."
|
|
151
|
+
certbot --nginx \
|
|
152
|
+
-d "${DOMAIN}" \
|
|
153
|
+
-d "www.${DOMAIN}" \
|
|
154
|
+
--non-interactive \
|
|
155
|
+
--agree-tos \
|
|
156
|
+
--email "${EMAIL}" \
|
|
157
|
+
--redirect
|
|
158
|
+
|
|
159
|
+
# Certbot rewrites the nginx config with SSL — reload to apply
|
|
160
|
+
systemctl reload nginx
|
|
161
|
+
|
|
162
|
+
# ── 10. Start bridge ──────────────────────────────────────────────────────────
|
|
163
|
+
info "Starting bridge service..."
|
|
164
|
+
systemctl start patchwork-bridge
|
|
165
|
+
sleep 3
|
|
166
|
+
systemctl is-active patchwork-bridge && info "Bridge is running." || warn "Bridge may have failed — check: journalctl -u patchwork-bridge -n 50"
|
|
167
|
+
|
|
168
|
+
# ── 11. Print summary ─────────────────────────────────────────────────────────
|
|
169
|
+
echo ""
|
|
170
|
+
echo -e "${GREEN}═══════════════════════════════════════════════════${NC}"
|
|
171
|
+
echo -e "${GREEN} Patchwork OS — VPS bootstrap complete${NC}"
|
|
172
|
+
echo -e "${GREEN}═══════════════════════════════════════════════════${NC}"
|
|
173
|
+
echo ""
|
|
174
|
+
echo " Domain: https://${DOMAIN}"
|
|
175
|
+
echo " Bridge port: ${BRIDGE_PORT} (internal, nginx proxied)"
|
|
176
|
+
echo " Token file: ${TOKEN_FILE}"
|
|
177
|
+
echo " Token: ${FIXED_TOKEN}"
|
|
178
|
+
echo ""
|
|
179
|
+
echo " Service: systemctl status patchwork-bridge"
|
|
180
|
+
echo " Logs: journalctl -u patchwork-bridge -f"
|
|
181
|
+
echo " Nginx logs: tail -f /var/log/nginx/access.log"
|
|
182
|
+
echo ""
|
|
183
|
+
echo -e "${YELLOW} Save the token above — you'll need it to connect Claude Code.${NC}"
|
|
184
|
+
echo ""
|
|
185
|
+
echo " To connect Claude Code remotely:"
|
|
186
|
+
echo " claude mcp add patchwork https://${DOMAIN}/mcp --token ${FIXED_TOKEN}"
|
|
187
|
+
echo ""
|