patchwork-os 0.2.0-beta.9.canary.92 → 1.1.0-beta.1
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 +15 -16
- package/README.md +46 -458
- package/dist/activationMetrics.js +2 -3
- package/dist/activationMetrics.js.map +1 -1
- package/dist/activityLog.d.ts +1 -0
- package/dist/activityLog.js +8 -3
- package/dist/activityLog.js.map +1 -1
- package/dist/adapters/gemini.js +2 -2
- package/dist/adapters/gemini.js.map +1 -1
- package/dist/adapters/grok.js +6 -1
- package/dist/adapters/grok.js.map +1 -1
- package/dist/adapters/openai.js +4 -0
- package/dist/adapters/openai.js.map +1 -1
- package/dist/approvalHttp.d.ts +9 -0
- package/dist/approvalHttp.js +210 -171
- package/dist/approvalHttp.js.map +1 -1
- package/dist/approvalKpi.d.ts +102 -0
- package/dist/approvalKpi.js +282 -0
- package/dist/approvalKpi.js.map +1 -0
- package/dist/approvalQueue.d.ts +1 -1
- package/dist/approvalQueue.js.map +1 -1
- package/dist/automation.d.ts +45 -4
- package/dist/automation.js +123 -15
- package/dist/automation.js.map +1 -1
- package/dist/bridge.d.ts +10 -0
- package/dist/bridge.js +225 -46
- package/dist/bridge.js.map +1 -1
- package/dist/bridgeLockDiscovery.d.ts +16 -1
- package/dist/bridgeLockDiscovery.js +38 -4
- package/dist/bridgeLockDiscovery.js.map +1 -1
- package/dist/bridgeToolsRules.js +3 -18
- package/dist/bridgeToolsRules.js.map +1 -1
- package/dist/claudeAuthHttp.d.ts +25 -0
- package/dist/claudeAuthHttp.js +219 -0
- package/dist/claudeAuthHttp.js.map +1 -0
- package/dist/claudeDriver.js +4 -1
- package/dist/claudeDriver.js.map +1 -1
- package/dist/claudeOrchestrator.d.ts +15 -0
- package/dist/claudeOrchestrator.js +44 -0
- package/dist/claudeOrchestrator.js.map +1 -1
- package/dist/commands/connect.d.ts +47 -0
- package/dist/commands/connect.js +419 -0
- package/dist/commands/connect.js.map +1 -0
- package/dist/commands/install.js +3 -10
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/launchd.d.ts +7 -0
- package/dist/commands/launchd.js +20 -2
- package/dist/commands/launchd.js.map +1 -1
- package/dist/commands/patchworkInit.d.ts +7 -0
- package/dist/commands/patchworkInit.js +26 -0
- package/dist/commands/patchworkInit.js.map +1 -1
- package/dist/commands/recipe.d.ts +59 -4
- package/dist/commands/recipe.js +206 -5
- package/dist/commands/recipe.js.map +1 -1
- package/dist/commands/recipeInstall.d.ts +9 -0
- package/dist/commands/recipeInstall.js +56 -3
- package/dist/commands/recipeInstall.js.map +1 -1
- package/dist/commands/task.d.ts +25 -0
- package/dist/commands/task.js +61 -41
- package/dist/commands/task.js.map +1 -1
- package/dist/commands/tokenEfficiency.d.ts +4 -0
- package/dist/commands/tokenEfficiency.js +23 -26
- package/dist/commands/tokenEfficiency.js.map +1 -1
- package/dist/commands/tracesExport.d.ts +15 -1
- package/dist/commands/tracesExport.js +39 -5
- package/dist/commands/tracesExport.js.map +1 -1
- package/dist/config.js +16 -0
- package/dist/config.js.map +1 -1
- package/dist/connectorRoutes.js +613 -62
- package/dist/connectorRoutes.js.map +1 -1
- package/dist/connectors/asana.js +9 -3
- package/dist/connectors/asana.js.map +1 -1
- package/dist/connectors/baseConnector.d.ts +16 -0
- package/dist/connectors/baseConnector.js +2 -0
- package/dist/connectors/baseConnector.js.map +1 -1
- package/dist/connectors/caldiy.js +34 -0
- package/dist/connectors/caldiy.js.map +1 -1
- package/dist/connectors/confluence.js +9 -2
- package/dist/connectors/confluence.js.map +1 -1
- package/dist/connectors/connectorActivity.d.ts +24 -0
- package/dist/connectors/connectorActivity.js +32 -0
- package/dist/connectors/connectorActivity.js.map +1 -0
- package/dist/connectors/connectorRedirectUri.js +22 -2
- package/dist/connectors/connectorRedirectUri.js.map +1 -1
- package/dist/connectors/connectorRegistry.d.ts +0 -3
- package/dist/connectors/connectorRegistry.js +8 -8
- package/dist/connectors/connectorRegistry.js.map +1 -1
- package/dist/connectors/datadog.js +8 -1
- package/dist/connectors/datadog.js.map +1 -1
- package/dist/connectors/discord.js +4 -3
- package/dist/connectors/discord.js.map +1 -1
- package/dist/connectors/elasticsearch.js +22 -0
- package/dist/connectors/elasticsearch.js.map +1 -1
- package/dist/connectors/github.d.ts +38 -0
- package/dist/connectors/github.js +91 -5
- package/dist/connectors/github.js.map +1 -1
- package/dist/connectors/gitlab.js +19 -16
- package/dist/connectors/gitlab.js.map +1 -1
- package/dist/connectors/gmail.d.ts +5 -0
- package/dist/connectors/gmail.js +53 -11
- package/dist/connectors/gmail.js.map +1 -1
- package/dist/connectors/googleCalendar.js +5 -4
- package/dist/connectors/googleCalendar.js.map +1 -1
- package/dist/connectors/googleDocs.js +7 -6
- package/dist/connectors/googleDocs.js.map +1 -1
- package/dist/connectors/googleDrive.js +15 -8
- package/dist/connectors/googleDrive.js.map +1 -1
- package/dist/connectors/grafana.js +39 -3
- package/dist/connectors/grafana.js.map +1 -1
- package/dist/connectors/jira.d.ts +1 -1
- package/dist/connectors/jira.js +19 -4
- package/dist/connectors/jira.js.map +1 -1
- package/dist/connectors/linear.js +2 -2
- package/dist/connectors/linear.js.map +1 -1
- package/dist/connectors/mcpClient.d.ts +29 -1
- package/dist/connectors/mcpClient.js +114 -44
- package/dist/connectors/mcpClient.js.map +1 -1
- package/dist/connectors/mcpOAuth.d.ts +1 -0
- package/dist/connectors/mcpOAuth.js +49 -4
- package/dist/connectors/mcpOAuth.js.map +1 -1
- package/dist/connectors/monday.js +5 -4
- package/dist/connectors/monday.js.map +1 -1
- package/dist/connectors/mongodb.js +32 -5
- package/dist/connectors/mongodb.js.map +1 -1
- package/dist/connectors/notion.d.ts +1 -1
- package/dist/connectors/notion.js +22 -6
- package/dist/connectors/notion.js.map +1 -1
- package/dist/connectors/oauthError.d.ts +17 -0
- package/dist/connectors/oauthError.js +50 -0
- package/dist/connectors/oauthError.js.map +1 -0
- package/dist/connectors/postgres.d.ts +7 -0
- package/dist/connectors/postgres.js +32 -2
- package/dist/connectors/postgres.js.map +1 -1
- package/dist/connectors/posthog.js +26 -0
- package/dist/connectors/posthog.js.map +1 -1
- package/dist/connectors/redis.d.ts +1 -0
- package/dist/connectors/redis.js +47 -20
- package/dist/connectors/redis.js.map +1 -1
- package/dist/connectors/salesforce.js +66 -5
- package/dist/connectors/salesforce.js.map +1 -1
- package/dist/connectors/sentry.js +2 -2
- package/dist/connectors/sentry.js.map +1 -1
- package/dist/connectors/slack.js +37 -14
- package/dist/connectors/slack.js.map +1 -1
- package/dist/connectors/snowflake.js +24 -0
- package/dist/connectors/snowflake.js.map +1 -1
- package/dist/connectors/stripe.js +9 -2
- package/dist/connectors/stripe.js.map +1 -1
- package/dist/connectors/supabase.js +34 -0
- package/dist/connectors/supabase.js.map +1 -1
- package/dist/connectors/tokenStorage.d.ts +20 -0
- package/dist/connectors/tokenStorage.js +196 -64
- package/dist/connectors/tokenStorage.js.map +1 -1
- package/dist/connectors/woocommerce.js +34 -0
- package/dist/connectors/woocommerce.js.map +1 -1
- package/dist/copilot/parseIntent.d.ts +58 -0
- package/dist/copilot/parseIntent.js +149 -0
- package/dist/copilot/parseIntent.js.map +1 -0
- package/dist/decisionReplay.d.ts +8 -6
- package/dist/decisionReplay.js +35 -11
- package/dist/decisionReplay.js.map +1 -1
- package/dist/decisionTraceLog.d.ts +9 -0
- package/dist/decisionTraceLog.js +6 -0
- package/dist/decisionTraceLog.js.map +1 -1
- package/dist/drivers/claude/api.js +49 -7
- package/dist/drivers/claude/api.js.map +1 -1
- package/dist/drivers/claude/envSanitizer.d.ts +9 -1
- package/dist/drivers/claude/envSanitizer.js +41 -3
- package/dist/drivers/claude/envSanitizer.js.map +1 -1
- package/dist/drivers/claude/streamParser.d.ts +13 -0
- package/dist/drivers/claude/streamParser.js.map +1 -1
- package/dist/drivers/claude/subprocess.js +131 -16
- package/dist/drivers/claude/subprocess.js.map +1 -1
- package/dist/drivers/claude/subprocessSettings.d.ts +1 -1
- package/dist/drivers/claude/subprocessSettings.js +18 -4
- package/dist/drivers/claude/subprocessSettings.js.map +1 -1
- package/dist/drivers/gemini/index.d.ts +13 -0
- package/dist/drivers/gemini/index.js +211 -67
- package/dist/drivers/gemini/index.js.map +1 -1
- package/dist/drivers/local/index.d.ts +2 -17
- package/dist/drivers/local/index.js +5 -92
- package/dist/drivers/local/index.js.map +1 -1
- package/dist/drivers/openai/index.js +69 -9
- package/dist/drivers/openai/index.js.map +1 -1
- package/dist/drivers/outputCap.d.ts +27 -0
- package/dist/drivers/outputCap.js +50 -0
- package/dist/drivers/outputCap.js.map +1 -0
- package/dist/embeddings/cosine.d.ts +23 -0
- package/dist/embeddings/cosine.js +59 -0
- package/dist/embeddings/cosine.js.map +1 -0
- package/dist/embeddings/index.d.ts +19 -0
- package/dist/embeddings/index.js +35 -0
- package/dist/embeddings/index.js.map +1 -0
- package/dist/embeddings/localEmbeddings.d.ts +29 -0
- package/dist/embeddings/localEmbeddings.js +103 -0
- package/dist/embeddings/localEmbeddings.js.map +1 -0
- package/dist/embeddings/localEndpoints.d.ts +24 -0
- package/dist/embeddings/localEndpoints.js +37 -0
- package/dist/embeddings/localEndpoints.js.map +1 -0
- package/dist/embeddings/types.d.ts +32 -0
- package/dist/embeddings/types.js +12 -0
- package/dist/embeddings/types.js.map +1 -0
- package/dist/featureFlags.d.ts +18 -0
- package/dist/featureFlags.js +32 -0
- package/dist/featureFlags.js.map +1 -1
- package/dist/fp/automationInterpreter.js +118 -39
- package/dist/fp/automationInterpreter.js.map +1 -1
- package/dist/fp/automationProgram.d.ts +10 -0
- package/dist/fp/automationProgram.js.map +1 -1
- package/dist/fp/automationState.d.ts +6 -0
- package/dist/fp/automationState.js +38 -0
- package/dist/fp/automationState.js.map +1 -1
- package/dist/fp/commandDescription.d.ts +6 -0
- package/dist/fp/commandDescription.js +18 -5
- package/dist/fp/commandDescription.js.map +1 -1
- package/dist/fp/interpreterContext.d.ts +16 -5
- package/dist/fp/interpreterContext.js +59 -3
- package/dist/fp/interpreterContext.js.map +1 -1
- package/dist/fp/policyParser.js +18 -8
- package/dist/fp/policyParser.js.map +1 -1
- package/dist/haltPushDispatch.d.ts +4 -0
- package/dist/haltPushDispatch.js +7 -22
- package/dist/haltPushDispatch.js.map +1 -1
- package/dist/inboxRoutes.js +2 -2
- package/dist/inboxRoutes.js.map +1 -1
- package/dist/index.js +672 -135
- package/dist/index.js.map +1 -1
- package/dist/installGuard.js +6 -0
- package/dist/installGuard.js.map +1 -1
- package/dist/localEndpointGuard.d.ts +25 -0
- package/dist/localEndpointGuard.js +101 -0
- package/dist/localEndpointGuard.js.map +1 -0
- package/dist/mcpRoutes.js +1 -1
- package/dist/mcpRoutes.js.map +1 -1
- package/dist/oauth.d.ts +13 -0
- package/dist/oauth.js +53 -9
- package/dist/oauth.js.map +1 -1
- package/dist/orchestrator/childBridgeClient.d.ts +7 -0
- package/dist/orchestrator/childBridgeClient.js +42 -1
- package/dist/orchestrator/childBridgeClient.js.map +1 -1
- package/dist/orchestrator/orchestratorBridge.d.ts +33 -0
- package/dist/orchestrator/orchestratorBridge.js +75 -9
- package/dist/orchestrator/orchestratorBridge.js.map +1 -1
- package/dist/patchworkConfig.d.ts +4 -0
- package/dist/patchworkConfig.js +33 -4
- package/dist/patchworkConfig.js.map +1 -1
- package/dist/probe.js +39 -5
- package/dist/probe.js.map +1 -1
- package/dist/recipeOrchestration.d.ts +59 -0
- package/dist/recipeOrchestration.js +314 -60
- package/dist/recipeOrchestration.js.map +1 -1
- package/dist/recipeRoutes.d.ts +93 -0
- package/dist/recipeRoutes.js +664 -27
- package/dist/recipeRoutes.js.map +1 -1
- package/dist/recipes/RecipeOrchestrator.d.ts +14 -0
- package/dist/recipes/RecipeOrchestrator.js +42 -2
- package/dist/recipes/RecipeOrchestrator.js.map +1 -1
- package/dist/recipes/agentExecutor.d.ts +51 -2
- package/dist/recipes/agentExecutor.js +86 -13
- package/dist/recipes/agentExecutor.js.map +1 -1
- package/dist/recipes/chainedRunner.d.ts +111 -3
- package/dist/recipes/chainedRunner.js +440 -45
- package/dist/recipes/chainedRunner.js.map +1 -1
- package/dist/recipes/compiler.js +42 -29
- package/dist/recipes/compiler.js.map +1 -1
- package/dist/recipes/connectorPreflight.js +31 -0
- package/dist/recipes/connectorPreflight.js.map +1 -1
- package/dist/recipes/dependencyGraph.d.ts +16 -0
- package/dist/recipes/dependencyGraph.js +37 -2
- package/dist/recipes/dependencyGraph.js.map +1 -1
- package/dist/recipes/eventTriggerPrograms.d.ts +36 -0
- package/dist/recipes/eventTriggerPrograms.js +158 -0
- package/dist/recipes/eventTriggerPrograms.js.map +1 -0
- package/dist/recipes/githubInstallSource.d.ts +9 -2
- package/dist/recipes/githubInstallSource.js +36 -6
- package/dist/recipes/githubInstallSource.js.map +1 -1
- package/dist/recipes/haltCategory.d.ts +10 -0
- package/dist/recipes/haltCategory.js +11 -1
- package/dist/recipes/haltCategory.js.map +1 -1
- package/dist/recipes/idempotencyKey.d.ts +30 -3
- package/dist/recipes/idempotencyKey.js +89 -5
- package/dist/recipes/idempotencyKey.js.map +1 -1
- package/dist/recipes/installer.js +12 -35
- package/dist/recipes/installer.js.map +1 -1
- package/dist/recipes/judgeVerdict.d.ts +11 -1
- package/dist/recipes/judgeVerdict.js +47 -7
- package/dist/recipes/judgeVerdict.js.map +1 -1
- package/dist/recipes/names.d.ts +5 -0
- package/dist/recipes/names.js +10 -5
- package/dist/recipes/names.js.map +1 -1
- package/dist/recipes/parser.js +74 -10
- package/dist/recipes/parser.js.map +1 -1
- package/dist/recipes/pricing/costRouter.d.ts +43 -0
- package/dist/recipes/pricing/costRouter.js +44 -0
- package/dist/recipes/pricing/costRouter.js.map +1 -0
- package/dist/recipes/pricing/priceTable.d.ts +76 -0
- package/dist/recipes/pricing/priceTable.js +144 -0
- package/dist/recipes/pricing/priceTable.js.map +1 -0
- package/dist/recipes/replayRun.js +5 -2
- package/dist/recipes/replayRun.js.map +1 -1
- package/dist/recipes/resolveRecipePath.js +15 -1
- package/dist/recipes/resolveRecipePath.js.map +1 -1
- package/dist/recipes/runBudget.d.ts +93 -32
- package/dist/recipes/runBudget.js +213 -49
- package/dist/recipes/runBudget.js.map +1 -1
- package/dist/recipes/runRegistry.d.ts +32 -0
- package/dist/recipes/runRegistry.js +54 -0
- package/dist/recipes/runRegistry.js.map +1 -0
- package/dist/recipes/scheduler.js +6 -2
- package/dist/recipes/scheduler.js.map +1 -1
- package/dist/recipes/schema.d.ts +59 -6
- package/dist/recipes/schemaGenerator.d.ts +9 -0
- package/dist/recipes/schemaGenerator.js +446 -77
- package/dist/recipes/schemaGenerator.js.map +1 -1
- package/dist/recipes/simulation/aggregateRunRisk.d.ts +46 -0
- package/dist/recipes/simulation/aggregateRunRisk.js +120 -0
- package/dist/recipes/simulation/aggregateRunRisk.js.map +1 -0
- package/dist/recipes/simulation/costProjector.d.ts +32 -0
- package/dist/recipes/simulation/costProjector.js +194 -0
- package/dist/recipes/simulation/costProjector.js.map +1 -0
- package/dist/recipes/simulation/sideEffects.d.ts +32 -0
- package/dist/recipes/simulation/sideEffects.js +62 -0
- package/dist/recipes/simulation/sideEffects.js.map +1 -0
- package/dist/recipes/simulation/simulate.d.ts +36 -0
- package/dist/recipes/simulation/simulate.js +264 -0
- package/dist/recipes/simulation/simulate.js.map +1 -0
- package/dist/recipes/simulation/simulateMockedRun.d.ts +52 -0
- package/dist/recipes/simulation/simulateMockedRun.js +84 -0
- package/dist/recipes/simulation/simulateMockedRun.js.map +1 -0
- package/dist/recipes/simulation/synthesizeMockedOutputs.d.ts +31 -0
- package/dist/recipes/simulation/synthesizeMockedOutputs.js +50 -0
- package/dist/recipes/simulation/synthesizeMockedOutputs.js.map +1 -0
- package/dist/recipes/simulation/types.d.ts +198 -0
- package/dist/recipes/simulation/types.js +30 -0
- package/dist/recipes/simulation/types.js.map +1 -0
- package/dist/recipes/stepObservation.d.ts +12 -0
- package/dist/recipes/stepObservation.js +21 -1
- package/dist/recipes/stepObservation.js.map +1 -1
- package/dist/recipes/toolRegistry.js +61 -24
- package/dist/recipes/toolRegistry.js.map +1 -1
- package/dist/recipes/tools/airtable.d.ts +15 -0
- package/dist/recipes/tools/airtable.js +240 -0
- package/dist/recipes/tools/airtable.js.map +1 -0
- package/dist/recipes/tools/caldiy.d.ts +13 -0
- package/dist/recipes/tools/caldiy.js +215 -0
- package/dist/recipes/tools/caldiy.js.map +1 -0
- package/dist/recipes/tools/circleci.d.ts +10 -0
- package/dist/recipes/tools/circleci.js +204 -0
- package/dist/recipes/tools/circleci.js.map +1 -0
- package/dist/recipes/tools/cloudflare.d.ts +13 -0
- package/dist/recipes/tools/cloudflare.js +211 -0
- package/dist/recipes/tools/cloudflare.js.map +1 -0
- package/dist/recipes/tools/confluence.js +11 -10
- package/dist/recipes/tools/confluence.js.map +1 -1
- package/dist/recipes/tools/datadog.js +13 -12
- package/dist/recipes/tools/datadog.js.map +1 -1
- package/dist/recipes/tools/docs.d.ts +18 -0
- package/dist/recipes/tools/docs.js +95 -0
- package/dist/recipes/tools/docs.js.map +1 -0
- package/dist/recipes/tools/elasticsearch.d.ts +11 -0
- package/dist/recipes/tools/elasticsearch.js +157 -0
- package/dist/recipes/tools/elasticsearch.js.map +1 -0
- package/dist/recipes/tools/fanOut.js +4 -4
- package/dist/recipes/tools/fanOut.js.map +1 -1
- package/dist/recipes/tools/figma.d.ts +12 -0
- package/dist/recipes/tools/figma.js +195 -0
- package/dist/recipes/tools/figma.js.map +1 -0
- package/dist/recipes/tools/file.js +43 -22
- package/dist/recipes/tools/file.js.map +1 -1
- package/dist/recipes/tools/github.js +162 -5
- package/dist/recipes/tools/github.js.map +1 -1
- package/dist/recipes/tools/gmail.js +45 -33
- package/dist/recipes/tools/gmail.js.map +1 -1
- package/dist/recipes/tools/grafana.d.ts +11 -0
- package/dist/recipes/tools/grafana.js +216 -0
- package/dist/recipes/tools/grafana.js.map +1 -0
- package/dist/recipes/tools/http.d.ts +1 -1
- package/dist/recipes/tools/http.js +10 -28
- package/dist/recipes/tools/http.js.map +1 -1
- package/dist/recipes/tools/hubspot.js +13 -12
- package/dist/recipes/tools/hubspot.js.map +1 -1
- package/dist/recipes/tools/index.d.ts +28 -0
- package/dist/recipes/tools/index.js +28 -0
- package/dist/recipes/tools/index.js.map +1 -1
- package/dist/recipes/tools/intercom.js +11 -10
- package/dist/recipes/tools/intercom.js.map +1 -1
- package/dist/recipes/tools/jira.js +13 -0
- package/dist/recipes/tools/jira.js.map +1 -1
- package/dist/recipes/tools/meetingNotes.js +2 -2
- package/dist/recipes/tools/monday.d.ts +22 -0
- package/dist/recipes/tools/monday.js +242 -0
- package/dist/recipes/tools/monday.js.map +1 -0
- package/dist/recipes/tools/mongodb.d.ts +19 -0
- package/dist/recipes/tools/mongodb.js +194 -0
- package/dist/recipes/tools/mongodb.js.map +1 -0
- package/dist/recipes/tools/notion.js +11 -10
- package/dist/recipes/tools/notion.js.map +1 -1
- package/dist/recipes/tools/obsidian.d.ts +15 -0
- package/dist/recipes/tools/obsidian.js +173 -0
- package/dist/recipes/tools/obsidian.js.map +1 -0
- package/dist/recipes/tools/outcomes.d.ts +15 -0
- package/dist/recipes/tools/outcomes.js +111 -0
- package/dist/recipes/tools/outcomes.js.map +1 -0
- package/dist/recipes/tools/paystack.d.ts +11 -0
- package/dist/recipes/tools/paystack.js +212 -0
- package/dist/recipes/tools/paystack.js.map +1 -0
- package/dist/recipes/tools/pipedrive.d.ts +16 -0
- package/dist/recipes/tools/pipedrive.js +234 -0
- package/dist/recipes/tools/pipedrive.js.map +1 -0
- package/dist/recipes/tools/postgres.d.ts +15 -0
- package/dist/recipes/tools/postgres.js +186 -0
- package/dist/recipes/tools/postgres.js.map +1 -0
- package/dist/recipes/tools/posthog.d.ts +16 -0
- package/dist/recipes/tools/posthog.js +219 -0
- package/dist/recipes/tools/posthog.js.map +1 -0
- package/dist/recipes/tools/redis.d.ts +9 -0
- package/dist/recipes/tools/redis.js +141 -0
- package/dist/recipes/tools/redis.js.map +1 -0
- package/dist/recipes/tools/resend.d.ts +8 -0
- package/dist/recipes/tools/resend.js +153 -0
- package/dist/recipes/tools/resend.js.map +1 -0
- package/dist/recipes/tools/salesforce.d.ts +16 -0
- package/dist/recipes/tools/salesforce.js +184 -0
- package/dist/recipes/tools/salesforce.js.map +1 -0
- package/dist/recipes/tools/sendgrid.d.ts +9 -0
- package/dist/recipes/tools/sendgrid.js +175 -0
- package/dist/recipes/tools/sendgrid.js.map +1 -0
- package/dist/recipes/tools/shopify.d.ts +16 -0
- package/dist/recipes/tools/shopify.js +266 -0
- package/dist/recipes/tools/shopify.js.map +1 -0
- package/dist/recipes/tools/snowflake.d.ts +16 -0
- package/dist/recipes/tools/snowflake.js +173 -0
- package/dist/recipes/tools/snowflake.js.map +1 -0
- package/dist/recipes/tools/stripe.js +13 -12
- package/dist/recipes/tools/stripe.js.map +1 -1
- package/dist/recipes/tools/supabase.d.ts +9 -0
- package/dist/recipes/tools/supabase.js +133 -0
- package/dist/recipes/tools/supabase.js.map +1 -0
- package/dist/recipes/tools/todoist.d.ts +15 -0
- package/dist/recipes/tools/todoist.js +228 -0
- package/dist/recipes/tools/todoist.js.map +1 -0
- package/dist/recipes/tools/twilio.d.ts +11 -0
- package/dist/recipes/tools/twilio.js +180 -0
- package/dist/recipes/tools/twilio.js.map +1 -0
- package/dist/recipes/tools/vercel.d.ts +9 -0
- package/dist/recipes/tools/vercel.js +146 -0
- package/dist/recipes/tools/vercel.js.map +1 -0
- package/dist/recipes/tools/webflow.d.ts +11 -0
- package/dist/recipes/tools/webflow.js +244 -0
- package/dist/recipes/tools/webflow.js.map +1 -0
- package/dist/recipes/tools/woocommerce.d.ts +18 -0
- package/dist/recipes/tools/woocommerce.js +260 -0
- package/dist/recipes/tools/woocommerce.js.map +1 -0
- package/dist/recipes/tools/wrapConnectorExecute.d.ts +25 -0
- package/dist/recipes/tools/wrapConnectorExecute.js +37 -0
- package/dist/recipes/tools/wrapConnectorExecute.js.map +1 -0
- package/dist/recipes/tools/zendesk.js +11 -10
- package/dist/recipes/tools/zendesk.js.map +1 -1
- package/dist/recipes/triggerVars.d.ts +15 -0
- package/dist/recipes/triggerVars.js +57 -0
- package/dist/recipes/triggerVars.js.map +1 -0
- package/dist/recipes/validation.d.ts +1 -1
- package/dist/recipes/validation.js +536 -12
- package/dist/recipes/validation.js.map +1 -1
- package/dist/recipes/yamlPositions.d.ts +1 -1
- package/dist/recipes/yamlPositions.js +7 -2
- package/dist/recipes/yamlPositions.js.map +1 -1
- package/dist/recipes/yamlRunner.d.ts +216 -4
- package/dist/recipes/yamlRunner.js +1030 -96
- package/dist/recipes/yamlRunner.js.map +1 -1
- package/dist/recipesHttp.d.ts +5 -0
- package/dist/recipesHttp.js +68 -6
- package/dist/recipesHttp.js.map +1 -1
- package/dist/resources.js +14 -1
- package/dist/resources.js.map +1 -1
- package/dist/riskSignals.d.ts +42 -0
- package/dist/riskSignals.js +197 -0
- package/dist/riskSignals.js.map +1 -0
- package/dist/riskTier.d.ts +9 -0
- package/dist/riskTier.js +48 -0
- package/dist/riskTier.js.map +1 -1
- package/dist/runLog.d.ts +53 -0
- package/dist/runLog.js +75 -16
- package/dist/runLog.js.map +1 -1
- package/dist/schemas/recipe.v1.json +360 -16
- package/dist/server.d.ts +60 -0
- package/dist/server.js +192 -31
- package/dist/server.js.map +1 -1
- package/dist/sessionCheckpoint.js +4 -1
- package/dist/sessionCheckpoint.js.map +1 -1
- package/dist/sessionDetail.d.ts +43 -0
- package/dist/sessionDetail.js +59 -0
- package/dist/sessionDetail.js.map +1 -0
- package/dist/settingsEnv.d.ts +47 -0
- package/dist/settingsEnv.js +88 -0
- package/dist/settingsEnv.js.map +1 -0
- package/dist/streamableHttp.js +44 -10
- package/dist/streamableHttp.js.map +1 -1
- package/dist/ta/backtest/abnday.d.ts +53 -0
- package/dist/ta/backtest/abnday.js +123 -0
- package/dist/ta/backtest/abnday.js.map +1 -0
- package/dist/ta/backtest/directional.d.ts +48 -0
- package/dist/ta/backtest/directional.js +103 -0
- package/dist/ta/backtest/directional.js.map +1 -0
- package/dist/ta/backtest/fundx.d.ts +67 -0
- package/dist/ta/backtest/fundx.js +264 -0
- package/dist/ta/backtest/fundx.js.map +1 -0
- package/dist/ta/backtest/fvg.d.ts +62 -0
- package/dist/ta/backtest/fvg.js +236 -0
- package/dist/ta/backtest/fvg.js.map +1 -0
- package/dist/ta/backtest/ichimoku.d.ts +41 -0
- package/dist/ta/backtest/ichimoku.js +146 -0
- package/dist/ta/backtest/ichimoku.js.map +1 -0
- package/dist/ta/backtest/ingest.d.ts +20 -0
- package/dist/ta/backtest/ingest.js +104 -0
- package/dist/ta/backtest/ingest.js.map +1 -0
- package/dist/ta/backtest/msb.d.ts +49 -0
- package/dist/ta/backtest/msb.js +162 -0
- package/dist/ta/backtest/msb.js.map +1 -0
- package/dist/ta/backtest/scoring.d.ts +33 -0
- package/dist/ta/backtest/scoring.js +82 -0
- package/dist/ta/backtest/scoring.js.map +1 -0
- package/dist/ta/backtest/summary.d.ts +20 -0
- package/dist/ta/backtest/summary.js +42 -0
- package/dist/ta/backtest/summary.js.map +1 -0
- package/dist/ta/backtest/tsmom.d.ts +72 -0
- package/dist/ta/backtest/tsmom.js +202 -0
- package/dist/ta/backtest/tsmom.js.map +1 -0
- package/dist/ta/backtest/volsq.d.ts +34 -0
- package/dist/ta/backtest/volsq.js +154 -0
- package/dist/ta/backtest/volsq.js.map +1 -0
- package/dist/ta/backtest/walkForward.d.ts +45 -0
- package/dist/ta/backtest/walkForward.js +136 -0
- package/dist/ta/backtest/walkForward.js.map +1 -0
- package/dist/ta/cycles.d.ts +15 -0
- package/dist/ta/cycles.js +31 -0
- package/dist/ta/cycles.js.map +1 -0
- package/dist/ta/desk/accrualEmitter.d.ts +59 -0
- package/dist/ta/desk/accrualEmitter.js +136 -0
- package/dist/ta/desk/accrualEmitter.js.map +1 -0
- package/dist/ta/desk/cellBacktest.d.ts +179 -0
- package/dist/ta/desk/cellBacktest.js +514 -0
- package/dist/ta/desk/cellBacktest.js.map +1 -0
- package/dist/ta/desk/cells/wpMaRejection.d.ts +49 -0
- package/dist/ta/desk/cells/wpMaRejection.js +141 -0
- package/dist/ta/desk/cells/wpMaRejection.js.map +1 -0
- package/dist/ta/desk/cells/wpVolumeClimax.d.ts +57 -0
- package/dist/ta/desk/cells/wpVolumeClimax.js +193 -0
- package/dist/ta/desk/cells/wpVolumeClimax.js.map +1 -0
- package/dist/ta/desk/collectors.d.ts +18 -0
- package/dist/ta/desk/collectors.js +450 -0
- package/dist/ta/desk/collectors.js.map +1 -0
- package/dist/ta/desk/contract.d.ts +51 -0
- package/dist/ta/desk/contract.js +261 -0
- package/dist/ta/desk/contract.js.map +1 -0
- package/dist/ta/desk/deskLedger.d.ts +36 -0
- package/dist/ta/desk/deskLedger.js +239 -0
- package/dist/ta/desk/deskLedger.js.map +1 -0
- package/dist/ta/desk/liqTape.d.ts +37 -0
- package/dist/ta/desk/liqTape.js +99 -0
- package/dist/ta/desk/liqTape.js.map +1 -0
- package/dist/ta/desk/post.d.ts +20 -0
- package/dist/ta/desk/post.js +65 -0
- package/dist/ta/desk/post.js.map +1 -0
- package/dist/ta/desk/render.d.ts +25 -0
- package/dist/ta/desk/render.js +398 -0
- package/dist/ta/desk/render.js.map +1 -0
- package/dist/ta/desk/surfaces.d.ts +216 -0
- package/dist/ta/desk/surfaces.js +472 -0
- package/dist/ta/desk/surfaces.js.map +1 -0
- package/dist/ta/desk/types.d.ts +174 -0
- package/dist/ta/desk/types.js +104 -0
- package/dist/ta/desk/types.js.map +1 -0
- package/dist/ta/index.d.ts +23 -0
- package/dist/ta/index.js +54 -0
- package/dist/ta/index.js.map +1 -0
- package/dist/ta/ledger.d.ts +44 -0
- package/dist/ta/ledger.js +95 -0
- package/dist/ta/ledger.js.map +1 -0
- package/dist/ta/levels.d.ts +21 -0
- package/dist/ta/levels.js +41 -0
- package/dist/ta/levels.js.map +1 -0
- package/dist/ta/swings.d.ts +30 -0
- package/dist/ta/swings.js +83 -0
- package/dist/ta/swings.js.map +1 -0
- package/dist/ta/types.d.ts +81 -0
- package/dist/ta/types.js +20 -0
- package/dist/ta/types.js.map +1 -0
- package/dist/telemetry.js +20 -9
- package/dist/telemetry.js.map +1 -1
- package/dist/tokenUsageTracker.d.ts +2 -1
- package/dist/tokenUsageTracker.js +38 -20
- package/dist/tokenUsageTracker.js.map +1 -1
- package/dist/tools/contextBundle.js +13 -9
- package/dist/tools/contextBundle.js.map +1 -1
- package/dist/tools/ctxGetTaskContext.js +8 -3
- package/dist/tools/ctxGetTaskContext.js.map +1 -1
- package/dist/tools/ctxQueryTraces.d.ts +18 -1
- package/dist/tools/ctxQueryTraces.js +176 -27
- package/dist/tools/ctxQueryTraces.js.map +1 -1
- package/dist/tools/enrichCommit.js +5 -2
- package/dist/tools/enrichCommit.js.map +1 -1
- package/dist/tools/getDependencyTree.js +2 -2
- package/dist/tools/getDependencyTree.js.map +1 -1
- package/dist/tools/getDiagnostics.js +3 -0
- package/dist/tools/getDiagnostics.js.map +1 -1
- package/dist/tools/getDocumentSymbols.js +5 -1
- package/dist/tools/getDocumentSymbols.js.map +1 -1
- package/dist/tools/getGitHotspots.js +12 -1
- package/dist/tools/getGitHotspots.js.map +1 -1
- package/dist/tools/getGitLog.js +5 -2
- package/dist/tools/getGitLog.js.map +1 -1
- package/dist/tools/getGitStatus.js +6 -1
- package/dist/tools/getGitStatus.js.map +1 -1
- package/dist/tools/getProjectContext.js +3 -1
- package/dist/tools/getProjectContext.js.map +1 -1
- package/dist/tools/getToolCapabilities.js +39 -4
- package/dist/tools/getToolCapabilities.js.map +1 -1
- package/dist/tools/gitWrite.js +12 -3
- package/dist/tools/gitWrite.js.map +1 -1
- package/dist/tools/github/composite.d.ts +1 -1
- package/dist/tools/github/composite.js +7 -7
- package/dist/tools/github/composite.js.map +1 -1
- package/dist/tools/github/pr.d.ts +6 -6
- package/dist/tools/github/pr.js +18 -11
- package/dist/tools/github/pr.js.map +1 -1
- package/dist/tools/httpClient.js +55 -3
- package/dist/tools/httpClient.js.map +1 -1
- package/dist/tools/index.d.ts +2 -1
- package/dist/tools/index.js +19 -12
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/lsp.d.ts +6 -0
- package/dist/tools/lsp.js +81 -12
- package/dist/tools/lsp.js.map +1 -1
- package/dist/tools/previewEdit.js +16 -1
- package/dist/tools/previewEdit.js.map +1 -1
- package/dist/tools/resumeClaudeTask.js +17 -0
- package/dist/tools/resumeClaudeTask.js.map +1 -1
- package/dist/tools/searchAndReplace.js +9 -5
- package/dist/tools/searchAndReplace.js.map +1 -1
- package/dist/tools/searchTools.d.ts +26 -0
- package/dist/tools/searchTools.js +42 -2
- package/dist/tools/searchTools.js.map +1 -1
- package/dist/tools/terminal.js +23 -51
- package/dist/tools/terminal.js.map +1 -1
- package/dist/tools/transaction.d.ts +9 -1
- package/dist/tools/transaction.js +59 -4
- package/dist/tools/transaction.js.map +1 -1
- package/dist/tools/utils.d.ts +16 -0
- package/dist/tools/utils.js +77 -7
- package/dist/tools/utils.js.map +1 -1
- package/dist/transport.d.ts +31 -0
- package/dist/transport.js +117 -14
- package/dist/transport.js.map +1 -1
- package/dist/wireHaltPushDispatch.js +12 -0
- package/dist/wireHaltPushDispatch.js.map +1 -1
- package/dist/workerGateDecisionLog.d.ts +141 -0
- package/dist/workerGateDecisionLog.js +361 -0
- package/dist/workerGateDecisionLog.js.map +1 -0
- package/dist/workers/actionClass.d.ts +38 -0
- package/dist/workers/actionClass.js +155 -0
- package/dist/workers/actionClass.js.map +1 -0
- package/dist/workers/backtest.d.ts +68 -0
- package/dist/workers/backtest.js +113 -0
- package/dist/workers/backtest.js.map +1 -0
- package/dist/workers/contextRisk.d.ts +35 -0
- package/dist/workers/contextRisk.js +20 -0
- package/dist/workers/contextRisk.js.map +1 -0
- package/dist/workers/contextRiskScorer.d.ts +48 -0
- package/dist/workers/contextRiskScorer.js +94 -0
- package/dist/workers/contextRiskScorer.js.map +1 -0
- package/dist/workers/graduation.d.ts +61 -0
- package/dist/workers/graduation.js +112 -0
- package/dist/workers/graduation.js.map +1 -0
- package/dist/workers/outcomeStore.d.ts +98 -0
- package/dist/workers/outcomeStore.js +146 -0
- package/dist/workers/outcomeStore.js.map +1 -0
- package/dist/workers/outcomesCli.d.ts +34 -0
- package/dist/workers/outcomesCli.js +91 -0
- package/dist/workers/outcomesCli.js.map +1 -0
- package/dist/workers/runWorkerShadow.d.ts +90 -0
- package/dist/workers/runWorkerShadow.js +323 -0
- package/dist/workers/runWorkerShadow.js.map +1 -0
- package/dist/workers/shadowGate.d.ts +30 -0
- package/dist/workers/shadowGate.js +58 -0
- package/dist/workers/shadowGate.js.map +1 -0
- package/dist/workers/shadowObserver.d.ts +165 -0
- package/dist/workers/shadowObserver.js +203 -0
- package/dist/workers/shadowObserver.js.map +1 -0
- package/dist/workers/shadowReport.d.ts +16 -0
- package/dist/workers/shadowReport.js +61 -0
- package/dist/workers/shadowReport.js.map +1 -0
- package/dist/workers/shadowRun.d.ts +38 -0
- package/dist/workers/shadowRun.js +44 -0
- package/dist/workers/shadowRun.js.map +1 -0
- package/dist/workers/trustLevel.d.ts +82 -0
- package/dist/workers/trustLevel.js +100 -0
- package/dist/workers/trustLevel.js.map +1 -0
- package/dist/workers/worker.d.ts +49 -0
- package/dist/workers/worker.js +88 -0
- package/dist/workers/worker.js.map +1 -0
- package/dist/workers/workerGate.d.ts +101 -0
- package/dist/workers/workerGate.js +210 -0
- package/dist/workers/workerGate.js.map +1 -0
- package/dist/workers/workerLevelStore.d.ts +33 -0
- package/dist/workers/workerLevelStore.js +87 -0
- package/dist/workers/workerLevelStore.js.map +1 -0
- package/dist/workers/workerLoader.d.ts +7 -0
- package/dist/workers/workerLoader.js +31 -0
- package/dist/workers/workerLoader.js.map +1 -0
- package/dist/writeFileAtomic.js +40 -13
- package/dist/writeFileAtomic.js.map +1 -1
- package/package.json +14 -6
- package/scripts/mcp-stdio-shim.cjs +247 -87
- package/templates/CLAUDE.bridge.md +1 -1
- package/templates/recipes/dependency-bump.yaml +33 -0
- package/templates/recipes/incident-to-pr.yaml +187 -0
- package/templates/recipes/outcome-ingester.yaml +53 -0
- package/templates/recipes/release-notes.yaml +30 -0
- package/templates/recipes/triage-failing-tests-autofile.yaml +152 -0
- package/templates/recipes/triage-failing-tests.yaml +38 -0
- package/templates/workers/dependency-upkeep.worker.yaml +26 -0
- package/templates/workers/release-notes.worker.yaml +17 -0
- package/templates/workers/test-guardian.worker.yaml +24 -0
- package/deploy/README.md +0 -172
- package/deploy/bootstrap-new-vps.sh +0 -364
- package/deploy/bootstrap-vps.sh +0 -192
- package/deploy/claude-ide-bridge.service.template +0 -67
- package/deploy/claude-ide-bridge@.service +0 -31
- package/deploy/deploy-dashboard.sh +0 -198
- package/deploy/deploy-landing.sh +0 -136
- package/deploy/ecosystem.config.js.example +0 -36
- package/deploy/install-vps-service.sh +0 -240
- package/deploy/macos/README.md +0 -153
- package/deploy/macos/com.patchwork.bridge.plist.template +0 -54
- package/deploy/macos/com.patchwork.tunnel.plist.template +0 -76
- package/deploy/macos/install-mac-bridge.sh +0 -244
- package/deploy/macos/uninstall-mac-bridge.sh +0 -22
- package/deploy/nginx-claude-bridge.conf.template +0 -129
package/deploy/bootstrap-vps.sh
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# deploy/bootstrap-vps.sh
|
|
3
|
-
# Full VPS bootstrap for a single Patchwork OS bridge.
|
|
4
|
-
# Run as root on a fresh Ubuntu 24.04 VPS.
|
|
5
|
-
# Usage: PATCHWORK_DOMAIN=your.tld PATCHWORK_ACME_EMAIL=you@your.tld bash bootstrap-vps.sh
|
|
6
|
-
|
|
7
|
-
set -euo pipefail
|
|
8
|
-
|
|
9
|
-
# Domain + ACME contact are deployment-specific — supply them via the
|
|
10
|
-
# environment so no real domain/email is committed to version control.
|
|
11
|
-
DOMAIN="${PATCHWORK_DOMAIN:?set PATCHWORK_DOMAIN, e.g. your.tld}"
|
|
12
|
-
EMAIL="${PATCHWORK_ACME_EMAIL:?set PATCHWORK_ACME_EMAIL, e.g. you@your.tld}"
|
|
13
|
-
BRIDGE_PORT=3284
|
|
14
|
-
BRIDGE_USER="patchwork"
|
|
15
|
-
BRIDGE_HOME="/opt/patchwork"
|
|
16
|
-
NODE_VERSION="22"
|
|
17
|
-
|
|
18
|
-
# ── Colours ──────────────────────────────────────────────────────────────────
|
|
19
|
-
RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m'
|
|
20
|
-
info() { echo -e "${GREEN}[bootstrap]${NC} $*"; }
|
|
21
|
-
warn() { echo -e "${YELLOW}[bootstrap]${NC} $*"; }
|
|
22
|
-
error() { echo -e "${RED}[bootstrap]${NC} $*"; exit 1; }
|
|
23
|
-
|
|
24
|
-
# ── 1. System updates ─────────────────────────────────────────────────────────
|
|
25
|
-
info "Updating system packages..."
|
|
26
|
-
apt-get update -qq
|
|
27
|
-
apt-get upgrade -y -qq
|
|
28
|
-
apt-get install -y -qq curl wget gnupg2 ca-certificates lsb-release \
|
|
29
|
-
nginx certbot python3-certbot-nginx ufw git jq unzip
|
|
30
|
-
|
|
31
|
-
# ── 2. Node.js ────────────────────────────────────────────────────────────────
|
|
32
|
-
info "Installing Node.js ${NODE_VERSION}..."
|
|
33
|
-
curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - >/dev/null
|
|
34
|
-
apt-get install -y -qq nodejs
|
|
35
|
-
node --version
|
|
36
|
-
npm --version
|
|
37
|
-
|
|
38
|
-
# ── 3. Service user ───────────────────────────────────────────────────────────
|
|
39
|
-
info "Creating service user '${BRIDGE_USER}'..."
|
|
40
|
-
id "${BRIDGE_USER}" &>/dev/null || useradd -r -m -d "${BRIDGE_HOME}" -s /bin/bash "${BRIDGE_USER}"
|
|
41
|
-
mkdir -p "${BRIDGE_HOME}"
|
|
42
|
-
chown "${BRIDGE_USER}:${BRIDGE_USER}" "${BRIDGE_HOME}"
|
|
43
|
-
|
|
44
|
-
# ── 4. Install bridge globally ────────────────────────────────────────────────
|
|
45
|
-
info "Installing patchwork-os from npm..."
|
|
46
|
-
npm install -g patchwork-os@alpha 2>&1 | tail -5
|
|
47
|
-
# `patchwork-os` ships three bin aliases: `patchwork` (preferred),
|
|
48
|
-
# `patchwork-os`, and the legacy `claude-ide-bridge`. Use the canonical
|
|
49
|
-
# `patchwork` name for the systemd unit + nginx config below.
|
|
50
|
-
BRIDGE_BIN="$(which patchwork)"
|
|
51
|
-
info "Bridge binary: ${BRIDGE_BIN}"
|
|
52
|
-
|
|
53
|
-
# ── 5. Generate fixed token ───────────────────────────────────────────────────
|
|
54
|
-
FIXED_TOKEN="$(uuidgen | tr '[:upper:]' '[:lower:]')"
|
|
55
|
-
info "Generated bridge token (save this!): ${FIXED_TOKEN}"
|
|
56
|
-
|
|
57
|
-
# Persist token to a file readable only by root + patchwork user
|
|
58
|
-
TOKEN_FILE="/etc/patchwork/bridge-token"
|
|
59
|
-
mkdir -p /etc/patchwork
|
|
60
|
-
echo "${FIXED_TOKEN}" > "${TOKEN_FILE}"
|
|
61
|
-
chown root:"${BRIDGE_USER}" "${TOKEN_FILE}"
|
|
62
|
-
chmod 640 "${TOKEN_FILE}"
|
|
63
|
-
|
|
64
|
-
# ── 6. Systemd service ────────────────────────────────────────────────────────
|
|
65
|
-
info "Writing systemd service..."
|
|
66
|
-
cat > /etc/systemd/system/patchwork-bridge.service <<EOF
|
|
67
|
-
[Unit]
|
|
68
|
-
Description=Patchwork OS — Claude IDE Bridge
|
|
69
|
-
After=network-online.target
|
|
70
|
-
Wants=network-online.target
|
|
71
|
-
|
|
72
|
-
[Service]
|
|
73
|
-
Type=simple
|
|
74
|
-
User=${BRIDGE_USER}
|
|
75
|
-
Group=${BRIDGE_USER}
|
|
76
|
-
WorkingDirectory=${BRIDGE_HOME}
|
|
77
|
-
Environment=NODE_ENV=production
|
|
78
|
-
Environment=HOME=${BRIDGE_HOME}
|
|
79
|
-
|
|
80
|
-
ExecStart=${BRIDGE_BIN} \\
|
|
81
|
-
--bind 0.0.0.0 \\
|
|
82
|
-
--port ${BRIDGE_PORT} \\
|
|
83
|
-
--vps \\
|
|
84
|
-
--issuer-url https://${DOMAIN} \\
|
|
85
|
-
--cors-origin https://claude.ai \\
|
|
86
|
-
--fixed-token ${FIXED_TOKEN}
|
|
87
|
-
|
|
88
|
-
Restart=always
|
|
89
|
-
RestartSec=5
|
|
90
|
-
StandardOutput=journal
|
|
91
|
-
StandardError=journal
|
|
92
|
-
SyslogIdentifier=patchwork-bridge
|
|
93
|
-
|
|
94
|
-
# Hardening
|
|
95
|
-
NoNewPrivileges=true
|
|
96
|
-
ProtectSystem=strict
|
|
97
|
-
ProtectHome=read-only
|
|
98
|
-
ReadWritePaths=${BRIDGE_HOME}
|
|
99
|
-
PrivateTmp=true
|
|
100
|
-
|
|
101
|
-
[Install]
|
|
102
|
-
WantedBy=multi-user.target
|
|
103
|
-
EOF
|
|
104
|
-
|
|
105
|
-
systemctl daemon-reload
|
|
106
|
-
systemctl enable patchwork-bridge
|
|
107
|
-
|
|
108
|
-
# ── 7. UFW firewall ───────────────────────────────────────────────────────────
|
|
109
|
-
info "Configuring firewall..."
|
|
110
|
-
ufw --force reset >/dev/null
|
|
111
|
-
ufw default deny incoming >/dev/null
|
|
112
|
-
ufw default allow outgoing >/dev/null
|
|
113
|
-
ufw allow ssh >/dev/null
|
|
114
|
-
ufw allow http >/dev/null
|
|
115
|
-
ufw allow https >/dev/null
|
|
116
|
-
ufw --force enable >/dev/null
|
|
117
|
-
ufw status
|
|
118
|
-
|
|
119
|
-
# ── 8. Nginx config — HTTP only first (certbot needs nginx up to issue cert) ──
|
|
120
|
-
info "Writing nginx config (HTTP only)..."
|
|
121
|
-
cat > /etc/nginx/sites-available/patchwork <<'NGINX'
|
|
122
|
-
server {
|
|
123
|
-
listen 80;
|
|
124
|
-
listen [::]:80;
|
|
125
|
-
server_name __DOMAIN__ www.__DOMAIN__;
|
|
126
|
-
|
|
127
|
-
location /.well-known/acme-challenge/ { root /var/www/html; }
|
|
128
|
-
|
|
129
|
-
location / {
|
|
130
|
-
proxy_pass http://127.0.0.1:3284;
|
|
131
|
-
proxy_http_version 1.1;
|
|
132
|
-
proxy_set_header Upgrade $http_upgrade;
|
|
133
|
-
proxy_set_header Connection "upgrade";
|
|
134
|
-
proxy_set_header Host $host;
|
|
135
|
-
proxy_set_header X-Real-IP $remote_addr;
|
|
136
|
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
137
|
-
proxy_set_header X-Forwarded-Proto $scheme;
|
|
138
|
-
proxy_read_timeout 3600s;
|
|
139
|
-
proxy_send_timeout 3600s;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
NGINX
|
|
143
|
-
|
|
144
|
-
# Substitute the deployment domain into the just-written config (the heredoc
|
|
145
|
-
# is quoted so nginx's own $variables survive un-expanded).
|
|
146
|
-
sed -i "s/__DOMAIN__/${DOMAIN}/g" /etc/nginx/sites-available/patchwork
|
|
147
|
-
|
|
148
|
-
ln -sf /etc/nginx/sites-available/patchwork /etc/nginx/sites-enabled/patchwork
|
|
149
|
-
rm -f /etc/nginx/sites-enabled/default
|
|
150
|
-
|
|
151
|
-
nginx -t
|
|
152
|
-
systemctl reload nginx
|
|
153
|
-
|
|
154
|
-
# ── 9. TLS certificate ────────────────────────────────────────────────────────
|
|
155
|
-
info "Issuing Let's Encrypt certificate for ${DOMAIN}..."
|
|
156
|
-
certbot --nginx \
|
|
157
|
-
-d "${DOMAIN}" \
|
|
158
|
-
-d "www.${DOMAIN}" \
|
|
159
|
-
--non-interactive \
|
|
160
|
-
--agree-tos \
|
|
161
|
-
--email "${EMAIL}" \
|
|
162
|
-
--redirect
|
|
163
|
-
|
|
164
|
-
# Certbot rewrites the nginx config with SSL — reload to apply
|
|
165
|
-
systemctl reload nginx
|
|
166
|
-
|
|
167
|
-
# ── 10. Start bridge ──────────────────────────────────────────────────────────
|
|
168
|
-
info "Starting bridge service..."
|
|
169
|
-
systemctl start patchwork-bridge
|
|
170
|
-
sleep 3
|
|
171
|
-
systemctl is-active patchwork-bridge && info "Bridge is running." || warn "Bridge may have failed — check: journalctl -u patchwork-bridge -n 50"
|
|
172
|
-
|
|
173
|
-
# ── 11. Print summary ─────────────────────────────────────────────────────────
|
|
174
|
-
echo ""
|
|
175
|
-
echo -e "${GREEN}═══════════════════════════════════════════════════${NC}"
|
|
176
|
-
echo -e "${GREEN} Patchwork OS — VPS bootstrap complete${NC}"
|
|
177
|
-
echo -e "${GREEN}═══════════════════════════════════════════════════${NC}"
|
|
178
|
-
echo ""
|
|
179
|
-
echo " Domain: https://${DOMAIN}"
|
|
180
|
-
echo " Bridge port: ${BRIDGE_PORT} (internal, nginx proxied)"
|
|
181
|
-
echo " Token file: ${TOKEN_FILE}"
|
|
182
|
-
echo " Token: ${FIXED_TOKEN}"
|
|
183
|
-
echo ""
|
|
184
|
-
echo " Service: systemctl status patchwork-bridge"
|
|
185
|
-
echo " Logs: journalctl -u patchwork-bridge -f"
|
|
186
|
-
echo " Nginx logs: tail -f /var/log/nginx/access.log"
|
|
187
|
-
echo ""
|
|
188
|
-
echo -e "${YELLOW} Save the token above — you'll need it to connect Claude Code.${NC}"
|
|
189
|
-
echo ""
|
|
190
|
-
echo " To connect Claude Code remotely:"
|
|
191
|
-
echo " claude mcp add patchwork https://${DOMAIN}/mcp --token ${FIXED_TOKEN}"
|
|
192
|
-
echo ""
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
# deploy/claude-ide-bridge.service.template
|
|
2
|
-
# Reference template — paths and user are injected by the install scripts.
|
|
3
|
-
# Do NOT copy this file to /etc/systemd/system/ directly.
|
|
4
|
-
# Use bootstrap-new-vps.sh or install-vps-service.sh which generate
|
|
5
|
-
# the final unit file with all variables substituted.
|
|
6
|
-
|
|
7
|
-
[Unit]
|
|
8
|
-
Description=Claude IDE Bridge MCP Server
|
|
9
|
-
Documentation=https://github.com/Oolab-labs/claude-ide-bridge
|
|
10
|
-
After=network.target
|
|
11
|
-
StartLimitIntervalSec=120
|
|
12
|
-
StartLimitBurst=5
|
|
13
|
-
|
|
14
|
-
[Service]
|
|
15
|
-
Type=simple
|
|
16
|
-
User=${SERVICE_USER}
|
|
17
|
-
WorkingDirectory=${INSTALL_DIR}
|
|
18
|
-
|
|
19
|
-
# Load personal config — FIXED_TOKEN, PORT, WORKSPACE must be set here
|
|
20
|
-
EnvironmentFile=${ENV_FILE}
|
|
21
|
-
|
|
22
|
-
# Bridge process — reads PORT, WORKSPACE, FIXED_TOKEN from EnvironmentFile
|
|
23
|
-
ExecStart=/usr/bin/node ${INSTALL_DIR}/dist/index.js \
|
|
24
|
-
--port ${PORT} \
|
|
25
|
-
--workspace ${WORKSPACE} \
|
|
26
|
-
--fixed-token ${FIXED_TOKEN} \
|
|
27
|
-
--grace-period 120000 \
|
|
28
|
-
--vps
|
|
29
|
-
|
|
30
|
-
# Graceful shutdown: SIGTERM → wait 15s → SIGKILL
|
|
31
|
-
KillMode=mixed
|
|
32
|
-
KillSignal=SIGTERM
|
|
33
|
-
TimeoutStopSec=15
|
|
34
|
-
|
|
35
|
-
# Restart policy: always restart unless manually stopped
|
|
36
|
-
Restart=always
|
|
37
|
-
RestartSec=5
|
|
38
|
-
|
|
39
|
-
# Logging — view with: journalctl -u claude-ide-bridge -f
|
|
40
|
-
StandardOutput=journal
|
|
41
|
-
StandardError=journal
|
|
42
|
-
SyslogIdentifier=claude-ide-bridge
|
|
43
|
-
|
|
44
|
-
# Hardening
|
|
45
|
-
NoNewPrivileges=true
|
|
46
|
-
PrivateTmp=true
|
|
47
|
-
ProtectSystem=strict
|
|
48
|
-
ProtectHome=read-only
|
|
49
|
-
ReadWritePaths=${INSTALL_DIR} /tmp /root/.claude
|
|
50
|
-
CapabilityBoundingSet=
|
|
51
|
-
AmbientCapabilities=
|
|
52
|
-
LockPersonality=true
|
|
53
|
-
RestrictNamespaces=true
|
|
54
|
-
RestrictRealtime=true
|
|
55
|
-
RestrictSUIDSGID=true
|
|
56
|
-
ProtectSystem=strict
|
|
57
|
-
ProtectHome=read-only
|
|
58
|
-
ReadWritePaths=${INSTALL_DIR} /tmp /root/.claude
|
|
59
|
-
CapabilityBoundingSet=
|
|
60
|
-
AmbientCapabilities=
|
|
61
|
-
LockPersonality=true
|
|
62
|
-
RestrictNamespaces=true
|
|
63
|
-
RestrictRealtime=true
|
|
64
|
-
RestrictSUIDSGID=true
|
|
65
|
-
|
|
66
|
-
[Install]
|
|
67
|
-
WantedBy=multi-user.target
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
[Unit]
|
|
2
|
-
Description=Claude IDE Bridge MCP Server (for user %i)
|
|
3
|
-
After=network.target
|
|
4
|
-
StartLimitIntervalSec=60
|
|
5
|
-
StartLimitBurst=5
|
|
6
|
-
|
|
7
|
-
[Service]
|
|
8
|
-
Type=simple
|
|
9
|
-
User=%i
|
|
10
|
-
WorkingDirectory=%h
|
|
11
|
-
ExecStart=/usr/local/bin/node /opt/claude-ide-bridge/dist/index.js --workspace %h --jsonl
|
|
12
|
-
Restart=on-failure
|
|
13
|
-
RestartSec=3
|
|
14
|
-
TimeoutStopSec=10
|
|
15
|
-
KillMode=mixed
|
|
16
|
-
KillSignal=SIGTERM
|
|
17
|
-
StandardOutput=journal
|
|
18
|
-
StandardError=journal
|
|
19
|
-
SyslogIdentifier=claude-ide-bridge
|
|
20
|
-
NoNewPrivileges=true
|
|
21
|
-
ProtectSystem=strict
|
|
22
|
-
ReadWritePaths=%h/.claude %h
|
|
23
|
-
PrivateTmp=true
|
|
24
|
-
ProtectHome=read-only
|
|
25
|
-
CapabilityBoundingSet=
|
|
26
|
-
LockPersonality=true
|
|
27
|
-
RestrictNamespaces=true
|
|
28
|
-
RestrictSUIDSGID=true
|
|
29
|
-
|
|
30
|
-
[Install]
|
|
31
|
-
WantedBy=default.target
|
|
@@ -1,198 +0,0 @@
|
|
|
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
|
-
# Pass secrets as positional args (NOT inside the heredoc body) so the
|
|
43
|
-
# single-quoted heredoc still preserves remote-shell `$X` references but
|
|
44
|
-
# the operator's local env reaches the VPS. Without this, the previous
|
|
45
|
-
# `${PATCHWORK_BRIDGE_TOKEN:-REPLACE_ME}` inside the heredoc evaluated on
|
|
46
|
-
# the remote, where the var doesn't exist, and always wrote REPLACE_ME.
|
|
47
|
-
# shellcheck disable=SC2087
|
|
48
|
-
ssh "$VPS" bash -s -- "${PATCHWORK_BRIDGE_TOKEN:-REPLACE_ME}" "${DASHBOARD_PASSWORD:-}" <<'REMOTE'
|
|
49
|
-
set -euo pipefail
|
|
50
|
-
# `${N:-}` so an empty/missing positional arg doesn't trip `set -u`.
|
|
51
|
-
PATCHWORK_BRIDGE_TOKEN="${1:-REPLACE_ME}"
|
|
52
|
-
DASHBOARD_PASSWORD="${2:-}"
|
|
53
|
-
REMOTE_DIR="/opt/patchwork-dashboard"
|
|
54
|
-
PM2_NAME="patchwork-dashboard"
|
|
55
|
-
PORT=3200
|
|
56
|
-
|
|
57
|
-
# Stop existing PM2 process if running
|
|
58
|
-
if pm2 list | grep -q "$PM2_NAME"; then
|
|
59
|
-
pm2 stop "$PM2_NAME" || true
|
|
60
|
-
pm2 delete "$PM2_NAME" || true
|
|
61
|
-
fi
|
|
62
|
-
|
|
63
|
-
# Preserve .env.local across the deploy. Without this stash/restore, the
|
|
64
|
-
# `rm -rf "$REMOTE_DIR"` below blows away every secret the operator pasted
|
|
65
|
-
# (VAPID, PATCHWORK_PUSH_TOKEN, custom DASHBOARD_PASSWORD), and the "if
|
|
66
|
-
# already exists, preserve" branch later in this script never fires —
|
|
67
|
-
# the file no longer exists by then.
|
|
68
|
-
ENV_BACKUP=""
|
|
69
|
-
if [ -f "$REMOTE_DIR/.env.local" ]; then
|
|
70
|
-
ENV_BACKUP="$(mktemp /tmp/patchwork-env.XXXXXX)"
|
|
71
|
-
cp -p "$REMOTE_DIR/.env.local" "$ENV_BACKUP"
|
|
72
|
-
fi
|
|
73
|
-
|
|
74
|
-
# Wipe and recreate deploy dir
|
|
75
|
-
rm -rf "$REMOTE_DIR"
|
|
76
|
-
mkdir -p "$REMOTE_DIR"
|
|
77
|
-
|
|
78
|
-
if [ -n "$ENV_BACKUP" ] && [ -f "$ENV_BACKUP" ]; then
|
|
79
|
-
cp -p "$ENV_BACKUP" "$REMOTE_DIR/.env.local"
|
|
80
|
-
rm -f "$ENV_BACKUP"
|
|
81
|
-
fi
|
|
82
|
-
|
|
83
|
-
# Extract
|
|
84
|
-
tar -xzf /tmp/patchwork-dashboard.tar.gz -C "$REMOTE_DIR"
|
|
85
|
-
rm /tmp/patchwork-dashboard.tar.gz
|
|
86
|
-
|
|
87
|
-
# Copy static assets into standalone's expected location
|
|
88
|
-
mkdir -p "$REMOTE_DIR/.next"
|
|
89
|
-
if [ -d "$REMOTE_DIR/.next/static" ]; then
|
|
90
|
-
echo "static dir already in place"
|
|
91
|
-
else
|
|
92
|
-
# tar may have extracted flat; handle both layouts
|
|
93
|
-
if [ -d /tmp/dashboard-static ]; then
|
|
94
|
-
cp -r /tmp/dashboard-static "$REMOTE_DIR/.next/static"
|
|
95
|
-
fi
|
|
96
|
-
fi
|
|
97
|
-
|
|
98
|
-
# Also copy public dir if present
|
|
99
|
-
if [ -d "$REMOTE_DIR/public" ]; then
|
|
100
|
-
echo "public dir in place"
|
|
101
|
-
fi
|
|
102
|
-
|
|
103
|
-
# Write .env.local — secrets must be set via environment before running this script:
|
|
104
|
-
# PATCHWORK_BRIDGE_TOKEN, DASHBOARD_PASSWORD
|
|
105
|
-
# PATCHWORK_BRIDGE_TOKEN is the bridge auth token (from: patchwork print-token)
|
|
106
|
-
# DASHBOARD_PASSWORD protects the dashboard UI (leave blank to disable auth)
|
|
107
|
-
if [ -f "$REMOTE_DIR/.env.local" ]; then
|
|
108
|
-
echo ".env.local already exists on VPS — preserving (delete manually to reset)"
|
|
109
|
-
else
|
|
110
|
-
cat > "$REMOTE_DIR/.env.local" <<ENV
|
|
111
|
-
NEXT_PUBLIC_BASE_PATH=/dashboard
|
|
112
|
-
PATCHWORK_BRIDGE_URL=https://patchworkos.com
|
|
113
|
-
PATCHWORK_BRIDGE_TOKEN=${PATCHWORK_BRIDGE_TOKEN:-REPLACE_ME}
|
|
114
|
-
VAPID_SUBJECT=mailto:support@gigsecure.co.ke
|
|
115
|
-
DASHBOARD_PASSWORD=${DASHBOARD_PASSWORD:-}
|
|
116
|
-
ENV
|
|
117
|
-
chmod 600 "$REMOTE_DIR/.env.local"
|
|
118
|
-
echo "Wrote .env.local — review and update secrets if placeholders remain"
|
|
119
|
-
fi
|
|
120
|
-
|
|
121
|
-
# Install PM2 if missing
|
|
122
|
-
which pm2 || npm install -g pm2
|
|
123
|
-
|
|
124
|
-
# Start with PM2
|
|
125
|
-
cd "$REMOTE_DIR"
|
|
126
|
-
PORT=3200 pm2 start server.js --name "$PM2_NAME"
|
|
127
|
-
|
|
128
|
-
pm2 save
|
|
129
|
-
echo "PM2 started: $PM2_NAME on port $PORT"
|
|
130
|
-
REMOTE
|
|
131
|
-
|
|
132
|
-
echo "==> Configuring nginx..."
|
|
133
|
-
ssh "$VPS" bash <<'NGINX'
|
|
134
|
-
set -euo pipefail
|
|
135
|
-
NGINX_CONF="/etc/nginx/sites-available/patchworkos"
|
|
136
|
-
|
|
137
|
-
# Add SSE location block if missing
|
|
138
|
-
if ! grep -q "location /dashboard/api/bridge/stream" "$NGINX_CONF"; then
|
|
139
|
-
# Insert before the closing brace of the SSL server block
|
|
140
|
-
# We insert just before the last `}` that closes the server block listening on 443
|
|
141
|
-
python3 - "$NGINX_CONF" <<'PYEOF'
|
|
142
|
-
import sys, re
|
|
143
|
-
|
|
144
|
-
path = sys.argv[1]
|
|
145
|
-
with open(path) as f:
|
|
146
|
-
content = f.read()
|
|
147
|
-
|
|
148
|
-
sse_block = """
|
|
149
|
-
# SSE passthrough — no buffering
|
|
150
|
-
location /dashboard/api/bridge/stream {
|
|
151
|
-
proxy_pass http://127.0.0.1:3200;
|
|
152
|
-
proxy_http_version 1.1;
|
|
153
|
-
proxy_buffering off;
|
|
154
|
-
proxy_cache off;
|
|
155
|
-
proxy_read_timeout 86400s;
|
|
156
|
-
proxy_send_timeout 86400s;
|
|
157
|
-
proxy_set_header Host $host;
|
|
158
|
-
proxy_set_header X-Real-IP $remote_addr;
|
|
159
|
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
160
|
-
proxy_set_header X-Forwarded-Proto $scheme;
|
|
161
|
-
add_header X-Accel-Buffering no;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
# Dashboard app
|
|
165
|
-
location /dashboard {
|
|
166
|
-
proxy_pass http://127.0.0.1:3200;
|
|
167
|
-
proxy_http_version 1.1;
|
|
168
|
-
proxy_set_header Host $host;
|
|
169
|
-
proxy_set_header X-Real-IP $remote_addr;
|
|
170
|
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
171
|
-
proxy_set_header X-Forwarded-Proto $scheme;
|
|
172
|
-
proxy_read_timeout 60s;
|
|
173
|
-
}
|
|
174
|
-
"""
|
|
175
|
-
|
|
176
|
-
# Find the ssl/443 server block and insert before its closing brace
|
|
177
|
-
# Strategy: find last `}` in file and insert before it
|
|
178
|
-
idx = content.rfind('\n}')
|
|
179
|
-
if idx == -1:
|
|
180
|
-
print("ERROR: could not find closing brace in nginx config", file=sys.stderr)
|
|
181
|
-
sys.exit(1)
|
|
182
|
-
|
|
183
|
-
new_content = content[:idx] + sse_block + content[idx:]
|
|
184
|
-
with open(path, 'w') as f:
|
|
185
|
-
f.write(new_content)
|
|
186
|
-
print("nginx: location blocks inserted")
|
|
187
|
-
PYEOF
|
|
188
|
-
else
|
|
189
|
-
echo "nginx: location blocks already present, skipping"
|
|
190
|
-
fi
|
|
191
|
-
|
|
192
|
-
nginx -t && systemctl reload nginx
|
|
193
|
-
echo "nginx reloaded"
|
|
194
|
-
NGINX
|
|
195
|
-
|
|
196
|
-
echo ""
|
|
197
|
-
echo "==> Deploy complete!"
|
|
198
|
-
echo " Dashboard: https://patchworkos.com/dashboard"
|
package/deploy/deploy-landing.sh
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
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"
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// PM2 ecosystem config for claude-ide-bridge.
|
|
2
|
-
// Copy to the repo root and edit before use:
|
|
3
|
-
// cp deploy/ecosystem.config.js.example ecosystem.config.js
|
|
4
|
-
//
|
|
5
|
-
// Usage:
|
|
6
|
-
// pm2 start ecosystem.config.js
|
|
7
|
-
// pm2 save
|
|
8
|
-
//
|
|
9
|
-
// IMPORTANT: The --port value below must match the port in your nginx proxy_pass.
|
|
10
|
-
// The bridge defaults to a random port if --port is not set, which breaks nginx.
|
|
11
|
-
|
|
12
|
-
module.exports = {
|
|
13
|
-
apps: [
|
|
14
|
-
{
|
|
15
|
-
name: "claude-bridge",
|
|
16
|
-
script: "dist/index.js",
|
|
17
|
-
cwd: "/root/claude-ide-bridge", // adjust to your INSTALL_DIR
|
|
18
|
-
|
|
19
|
-
// All bridge flags go here — NOT in env (PORT env var is not read by the bridge)
|
|
20
|
-
args: [
|
|
21
|
-
"--port", "4748", // must match nginx proxy_pass port
|
|
22
|
-
"--bind", "0.0.0.0", // expose to all interfaces (nginx handles TLS)
|
|
23
|
-
"--vps", // expands command allowlist for server use
|
|
24
|
-
"--fixed-token", "YOUR_TOKEN_HERE", // stable token; prevents rotation on restart
|
|
25
|
-
].join(" "),
|
|
26
|
-
|
|
27
|
-
restart_delay: 5000, // wait 5s before restart on crash
|
|
28
|
-
max_restarts: 20, // give up after 20 consecutive crashes
|
|
29
|
-
min_uptime: "10s", // don't count a restart as a crash if up for <10s
|
|
30
|
-
|
|
31
|
-
env: {
|
|
32
|
-
NODE_ENV: "production",
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
};
|