patchwork-os 0.2.0-beta.1 → 0.2.0-beta.10.canary.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.bridge.md +14 -14
- package/README.md +201 -34
- package/deploy/README.md +1 -1
- package/deploy/bootstrap-vps.sh +14 -9
- package/deploy/deploy-dashboard.sh +25 -1
- package/deploy/macos/README.md +153 -0
- package/deploy/macos/com.patchwork.bridge.plist.template +54 -0
- package/deploy/macos/com.patchwork.tunnel.plist.template +76 -0
- package/deploy/macos/install-mac-bridge.sh +244 -0
- package/deploy/macos/uninstall-mac-bridge.sh +22 -0
- package/dist/activityLog.d.ts +6 -0
- package/dist/activityLog.js +63 -26
- package/dist/activityLog.js.map +1 -1
- package/dist/adapters/claude.js +22 -16
- package/dist/adapters/claude.js.map +1 -1
- package/dist/adapters/gemini.js +15 -11
- package/dist/adapters/gemini.js.map +1 -1
- package/dist/adapters/openai.js +9 -9
- package/dist/adapters/openai.js.map +1 -1
- package/dist/ajv2020.d.ts +25 -0
- package/dist/ajv2020.js +33 -0
- package/dist/ajv2020.js.map +1 -0
- package/dist/analyticsAggregator.js +1 -1
- package/dist/analyticsAggregator.js.map +1 -1
- package/dist/analyticsConfig.d.ts +29 -0
- package/dist/analyticsConfig.js +102 -0
- package/dist/analyticsConfig.js.map +1 -0
- package/dist/analyticsPrefs.d.ts +38 -2
- package/dist/analyticsPrefs.js +148 -23
- package/dist/analyticsPrefs.js.map +1 -1
- package/dist/analyticsSend.d.ts +17 -1
- package/dist/analyticsSend.js +67 -5
- package/dist/analyticsSend.js.map +1 -1
- package/dist/approvalHttp.d.ts +14 -0
- package/dist/approvalHttp.js +212 -9
- package/dist/approvalHttp.js.map +1 -1
- package/dist/approvalInsights.js +13 -5
- package/dist/approvalInsights.js.map +1 -1
- package/dist/approvalQueue.d.ts +97 -3
- package/dist/approvalQueue.js +193 -19
- package/dist/approvalQueue.js.map +1 -1
- package/dist/approvalSignals.js +19 -11
- package/dist/approvalSignals.js.map +1 -1
- package/dist/automation.d.ts +35 -10
- package/dist/automation.js +133 -37
- package/dist/automation.js.map +1 -1
- package/dist/automationSuggestions.js +10 -8
- package/dist/automationSuggestions.js.map +1 -1
- package/dist/bridge.d.ts +2 -0
- package/dist/bridge.js +202 -25
- package/dist/bridge.js.map +1 -1
- package/dist/bridgeLockDiscovery.d.ts +27 -1
- package/dist/bridgeLockDiscovery.js +38 -11
- package/dist/bridgeLockDiscovery.js.map +1 -1
- package/dist/bridgeToken.js +3 -2
- package/dist/bridgeToken.js.map +1 -1
- package/dist/claudeDriver.js +23 -8
- package/dist/claudeDriver.js.map +1 -1
- package/dist/claudeOrchestrator.d.ts +1 -1
- package/dist/claudeOrchestrator.js +87 -44
- package/dist/claudeOrchestrator.js.map +1 -1
- package/dist/commands/analytics.d.ts +8 -0
- package/dist/commands/analytics.js +134 -0
- package/dist/commands/analytics.js.map +1 -0
- package/dist/commands/auditEnv.d.ts +36 -0
- package/dist/commands/auditEnv.js +202 -0
- package/dist/commands/auditEnv.js.map +1 -0
- package/dist/commands/dashboard.js +8 -1
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/doctor.d.ts +35 -0
- package/dist/commands/doctor.js +51 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/install.js +3 -0
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/launchd.js +15 -16
- package/dist/commands/launchd.js.map +1 -1
- package/dist/commands/patchworkInit.d.ts +5 -0
- package/dist/commands/patchworkInit.js +89 -7
- package/dist/commands/patchworkInit.js.map +1 -1
- package/dist/commands/recipe.d.ts +110 -0
- package/dist/commands/recipe.js +512 -9
- package/dist/commands/recipe.js.map +1 -1
- package/dist/commands/recipeInstall.js +11 -4
- package/dist/commands/recipeInstall.js.map +1 -1
- package/dist/commands/shadowScan.d.ts +34 -0
- package/dist/commands/shadowScan.js +142 -0
- package/dist/commands/shadowScan.js.map +1 -0
- package/dist/commands/task.js +2 -2
- package/dist/commands/task.js.map +1 -1
- package/dist/commands/tools.d.ts +20 -1
- package/dist/commands/tools.js +112 -3
- package/dist/commands/tools.js.map +1 -1
- package/dist/commands/tracesImport.js +21 -4
- package/dist/commands/tracesImport.js.map +1 -1
- package/dist/commitIssueLinkLog.d.ts +16 -0
- package/dist/commitIssueLinkLog.js +110 -24
- package/dist/commitIssueLinkLog.js.map +1 -1
- package/dist/companions/registry.js +15 -7
- package/dist/companions/registry.js.map +1 -1
- package/dist/config.d.ts +47 -3
- package/dist/config.js +111 -21
- package/dist/config.js.map +1 -1
- package/dist/connectorRoutes.js +866 -57
- package/dist/connectorRoutes.js.map +1 -1
- package/dist/connectors/airtable.d.ts +230 -0
- package/dist/connectors/airtable.js +700 -0
- package/dist/connectors/airtable.js.map +1 -0
- package/dist/connectors/asana.js +13 -9
- package/dist/connectors/asana.js.map +1 -1
- package/dist/connectors/baseConnector.js +25 -3
- package/dist/connectors/baseConnector.js.map +1 -1
- package/dist/connectors/caldiy.d.ts +137 -0
- package/dist/connectors/caldiy.js +424 -0
- package/dist/connectors/caldiy.js.map +1 -0
- package/dist/connectors/circleci.d.ts +162 -0
- package/dist/connectors/circleci.js +576 -0
- package/dist/connectors/circleci.js.map +1 -0
- package/dist/connectors/cloudflare.d.ts +132 -0
- package/dist/connectors/cloudflare.js +622 -0
- package/dist/connectors/cloudflare.js.map +1 -0
- package/dist/connectors/confluence.js +35 -0
- package/dist/connectors/confluence.js.map +1 -1
- package/dist/connectors/connectorRedirectUri.d.ts +30 -0
- package/dist/connectors/connectorRedirectUri.js +38 -0
- package/dist/connectors/connectorRedirectUri.js.map +1 -0
- package/dist/connectors/connectorRegistry.d.ts +63 -0
- package/dist/connectors/connectorRegistry.js +354 -0
- package/dist/connectors/connectorRegistry.js.map +1 -0
- package/dist/connectors/datadog.js +33 -4
- package/dist/connectors/datadog.js.map +1 -1
- package/dist/connectors/discord.js +14 -10
- package/dist/connectors/discord.js.map +1 -1
- package/dist/connectors/elasticsearch.d.ts +141 -0
- package/dist/connectors/elasticsearch.js +601 -0
- package/dist/connectors/elasticsearch.js.map +1 -0
- package/dist/connectors/figma.d.ts +130 -0
- package/dist/connectors/figma.js +387 -0
- package/dist/connectors/figma.js.map +1 -0
- package/dist/connectors/github.d.ts +17 -0
- package/dist/connectors/github.js +53 -2
- package/dist/connectors/github.js.map +1 -1
- package/dist/connectors/gitlab.js +12 -6
- package/dist/connectors/gitlab.js.map +1 -1
- package/dist/connectors/gmail.js +72 -21
- package/dist/connectors/gmail.js.map +1 -1
- package/dist/connectors/googleCalendar.js +8 -8
- package/dist/connectors/googleCalendar.js.map +1 -1
- package/dist/connectors/googleDocs.d.ts +103 -0
- package/dist/connectors/googleDocs.js +409 -0
- package/dist/connectors/googleDocs.js.map +1 -0
- package/dist/connectors/googleDrive.d.ts +12 -0
- package/dist/connectors/googleDrive.js +35 -8
- package/dist/connectors/googleDrive.js.map +1 -1
- package/dist/connectors/grafana.d.ts +133 -0
- package/dist/connectors/grafana.js +478 -0
- package/dist/connectors/grafana.js.map +1 -0
- package/dist/connectors/jira.d.ts +25 -0
- package/dist/connectors/jira.js +227 -1
- package/dist/connectors/jira.js.map +1 -1
- package/dist/connectors/linear.js +1 -1
- package/dist/connectors/linear.js.map +1 -1
- package/dist/connectors/mcpOAuth.js +78 -16
- package/dist/connectors/mcpOAuth.js.map +1 -1
- package/dist/connectors/monday.d.ts +217 -0
- package/dist/connectors/monday.js +655 -0
- package/dist/connectors/monday.js.map +1 -0
- package/dist/connectors/mongodb.d.ts +139 -0
- package/dist/connectors/mongodb.js +455 -0
- package/dist/connectors/mongodb.js.map +1 -0
- package/dist/connectors/oauthStateStore.d.ts +20 -0
- package/dist/connectors/oauthStateStore.js +94 -4
- package/dist/connectors/oauthStateStore.js.map +1 -1
- package/dist/connectors/obsidian.d.ts +83 -0
- package/dist/connectors/obsidian.js +441 -0
- package/dist/connectors/obsidian.js.map +1 -0
- package/dist/connectors/paystack.d.ts +159 -0
- package/dist/connectors/paystack.js +607 -0
- package/dist/connectors/paystack.js.map +1 -0
- package/dist/connectors/pipedrive.d.ts +189 -0
- package/dist/connectors/pipedrive.js +559 -0
- package/dist/connectors/pipedrive.js.map +1 -0
- package/dist/connectors/postgres.d.ts +127 -0
- package/dist/connectors/postgres.js +512 -0
- package/dist/connectors/postgres.js.map +1 -0
- package/dist/connectors/posthog.d.ts +119 -0
- package/dist/connectors/posthog.js +479 -0
- package/dist/connectors/posthog.js.map +1 -0
- package/dist/connectors/redis.d.ts +140 -0
- package/dist/connectors/redis.js +571 -0
- package/dist/connectors/redis.js.map +1 -0
- package/dist/connectors/resend.d.ts +131 -0
- package/dist/connectors/resend.js +529 -0
- package/dist/connectors/resend.js.map +1 -0
- package/dist/connectors/salesforce.d.ts +136 -0
- package/dist/connectors/salesforce.js +603 -0
- package/dist/connectors/salesforce.js.map +1 -0
- package/dist/connectors/secrets.d.ts +51 -0
- package/dist/connectors/secrets.js +102 -0
- package/dist/connectors/secrets.js.map +1 -0
- package/dist/connectors/sendgrid.d.ts +102 -0
- package/dist/connectors/sendgrid.js +423 -0
- package/dist/connectors/sendgrid.js.map +1 -0
- package/dist/connectors/shopify.d.ts +145 -0
- package/dist/connectors/shopify.js +502 -0
- package/dist/connectors/shopify.js.map +1 -0
- package/dist/connectors/slack.d.ts +1 -1
- package/dist/connectors/slack.js +61 -9
- package/dist/connectors/slack.js.map +1 -1
- package/dist/connectors/snowflake.d.ts +119 -0
- package/dist/connectors/snowflake.js +615 -0
- package/dist/connectors/snowflake.js.map +1 -0
- package/dist/connectors/supabase.d.ts +92 -0
- package/dist/connectors/supabase.js +630 -0
- package/dist/connectors/supabase.js.map +1 -0
- package/dist/connectors/todoist.d.ts +117 -0
- package/dist/connectors/todoist.js +485 -0
- package/dist/connectors/todoist.js.map +1 -0
- package/dist/connectors/tokenStorage.js +56 -14
- package/dist/connectors/tokenStorage.js.map +1 -1
- package/dist/connectors/twilio.d.ts +118 -0
- package/dist/connectors/twilio.js +475 -0
- package/dist/connectors/twilio.js.map +1 -0
- package/dist/connectors/vercel.d.ts +110 -0
- package/dist/connectors/vercel.js +479 -0
- package/dist/connectors/vercel.js.map +1 -0
- package/dist/connectors/webflow.d.ts +118 -0
- package/dist/connectors/webflow.js +393 -0
- package/dist/connectors/webflow.js.map +1 -0
- package/dist/connectors/woocommerce.d.ts +220 -0
- package/dist/connectors/woocommerce.js +464 -0
- package/dist/connectors/woocommerce.js.map +1 -0
- package/dist/crypto.js +7 -2
- package/dist/crypto.js.map +1 -1
- package/dist/decisionReplay.js +15 -6
- package/dist/decisionReplay.js.map +1 -1
- package/dist/decisionTraceLog.d.ts +28 -0
- package/dist/decisionTraceLog.js +156 -29
- package/dist/decisionTraceLog.js.map +1 -1
- package/dist/drivers/claude/api.js +5 -4
- package/dist/drivers/claude/api.js.map +1 -1
- package/dist/drivers/claude/envSanitizer.d.ts +0 -6
- package/dist/drivers/claude/envSanitizer.js +17 -2
- package/dist/drivers/claude/envSanitizer.js.map +1 -1
- package/dist/drivers/claude/streamParser.js +5 -4
- package/dist/drivers/claude/streamParser.js.map +1 -1
- package/dist/drivers/claude/subprocess.js +22 -3
- package/dist/drivers/claude/subprocess.js.map +1 -1
- package/dist/drivers/gemini/index.d.ts +22 -0
- package/dist/drivers/gemini/index.js +256 -129
- package/dist/drivers/gemini/index.js.map +1 -1
- package/dist/drivers/local/index.d.ts +17 -0
- package/dist/drivers/local/index.js +99 -0
- package/dist/drivers/local/index.js.map +1 -1
- package/dist/drivers/openai/index.js +30 -2
- package/dist/drivers/openai/index.js.map +1 -1
- package/dist/extensionClient.d.ts +37 -4
- package/dist/extensionClient.js +58 -16
- package/dist/extensionClient.js.map +1 -1
- package/dist/featureFlags.d.ts +91 -0
- package/dist/featureFlags.js +174 -3
- package/dist/featureFlags.js.map +1 -1
- package/dist/fileLock.js +21 -12
- package/dist/fileLock.js.map +1 -1
- package/dist/fileLockSync.d.ts +67 -0
- package/dist/fileLockSync.js +126 -0
- package/dist/fileLockSync.js.map +1 -0
- package/dist/fp/activityAnalytics.js +26 -12
- package/dist/fp/activityAnalytics.js.map +1 -1
- package/dist/fp/automationInterpreter.d.ts +15 -1
- package/dist/fp/automationInterpreter.js +217 -82
- package/dist/fp/automationInterpreter.js.map +1 -1
- package/dist/fp/automationProgram.d.ts +30 -0
- package/dist/fp/automationProgram.js.map +1 -1
- package/dist/fp/automationState.d.ts +24 -5
- package/dist/fp/automationState.js +56 -9
- package/dist/fp/automationState.js.map +1 -1
- package/dist/fp/automationUtils.js +1 -1
- package/dist/fp/automationUtils.js.map +1 -1
- package/dist/fp/commandDescription.js +7 -1
- package/dist/fp/commandDescription.js.map +1 -1
- package/dist/fp/extensionSnapshot.js +8 -2
- package/dist/fp/extensionSnapshot.js.map +1 -1
- package/dist/fp/interpreterContext.d.ts +66 -1
- package/dist/fp/interpreterContext.js +91 -1
- package/dist/fp/interpreterContext.js.map +1 -1
- package/dist/fp/policyParser.js +29 -1
- package/dist/fp/policyParser.js.map +1 -1
- package/dist/fsWatchWithFallback.d.ts +36 -0
- package/dist/fsWatchWithFallback.js +128 -0
- package/dist/fsWatchWithFallback.js.map +1 -0
- package/dist/haltPushDispatch.d.ts +33 -0
- package/dist/haltPushDispatch.js +103 -0
- package/dist/haltPushDispatch.js.map +1 -0
- package/dist/httpBodyValidation.d.ts +41 -0
- package/dist/httpBodyValidation.js +45 -0
- package/dist/httpBodyValidation.js.map +1 -0
- package/dist/inboxRoutes.d.ts +22 -0
- package/dist/inboxRoutes.js +61 -1
- package/dist/inboxRoutes.js.map +1 -1
- package/dist/index.js +1053 -76
- package/dist/index.js.map +1 -1
- package/dist/installGuard.js +6 -2
- package/dist/installGuard.js.map +1 -1
- package/dist/lockfile.js +31 -4
- package/dist/lockfile.js.map +1 -1
- package/dist/oauth.d.ts +9 -0
- package/dist/oauth.js +33 -0
- package/dist/oauth.js.map +1 -1
- package/dist/oauthRoutes.d.ts +1 -1
- package/dist/oauthRoutes.js +5 -3
- package/dist/oauthRoutes.js.map +1 -1
- package/dist/orchestrator/childBridgeRegistry.js +29 -11
- package/dist/orchestrator/childBridgeRegistry.js.map +1 -1
- package/dist/patchworkConfig.d.ts +44 -1
- package/dist/patchworkConfig.js +28 -3
- package/dist/patchworkConfig.js.map +1 -1
- package/dist/pluginLoader.js +10 -1
- package/dist/pluginLoader.js.map +1 -1
- package/dist/pluginWatcher.js +12 -14
- package/dist/pluginWatcher.js.map +1 -1
- package/dist/preToolUseHook.js +3 -2
- package/dist/preToolUseHook.js.map +1 -1
- package/dist/processTree.d.ts +34 -0
- package/dist/processTree.js +105 -0
- package/dist/processTree.js.map +1 -0
- package/dist/prompts.js +3 -3
- package/dist/prompts.js.map +1 -1
- package/dist/recipeOrchestration.d.ts +9 -0
- package/dist/recipeOrchestration.js +341 -24
- package/dist/recipeOrchestration.js.map +1 -1
- package/dist/recipeRoutes.d.ts +58 -2
- package/dist/recipeRoutes.js +744 -115
- package/dist/recipeRoutes.js.map +1 -1
- package/dist/recipes/RecipeOrchestrator.d.ts +2 -0
- package/dist/recipes/RecipeOrchestrator.js +6 -1
- package/dist/recipes/RecipeOrchestrator.js.map +1 -1
- package/dist/recipes/agentExecutor.d.ts +25 -5
- package/dist/recipes/agentExecutor.js.map +1 -1
- package/dist/recipes/chainedRunner.d.ts +2 -0
- package/dist/recipes/chainedRunner.js +142 -5
- package/dist/recipes/chainedRunner.js.map +1 -1
- package/dist/recipes/connectorPreflight.d.ts +66 -0
- package/dist/recipes/connectorPreflight.js +169 -0
- package/dist/recipes/connectorPreflight.js.map +1 -0
- package/dist/recipes/dependencyGraph.js +13 -5
- package/dist/recipes/dependencyGraph.js.map +1 -1
- package/dist/recipes/githubInstallSource.d.ts +128 -0
- package/dist/recipes/githubInstallSource.js +206 -0
- package/dist/recipes/githubInstallSource.js.map +1 -0
- package/dist/recipes/haltCategory.d.ts +119 -0
- package/dist/recipes/haltCategory.js +188 -0
- package/dist/recipes/haltCategory.js.map +1 -0
- package/dist/recipes/idempotencyKey.d.ts +134 -0
- package/dist/recipes/idempotencyKey.js +322 -0
- package/dist/recipes/idempotencyKey.js.map +1 -0
- package/dist/recipes/installer.js +48 -2
- package/dist/recipes/installer.js.map +1 -1
- package/dist/recipes/judgeSummary.d.ts +50 -0
- package/dist/recipes/judgeSummary.js +47 -0
- package/dist/recipes/judgeSummary.js.map +1 -0
- package/dist/recipes/judgeVerdict.d.ts +48 -0
- package/dist/recipes/judgeVerdict.js +174 -0
- package/dist/recipes/judgeVerdict.js.map +1 -0
- package/dist/recipes/migrations/index.d.ts +9 -0
- package/dist/recipes/migrations/index.js +133 -0
- package/dist/recipes/migrations/index.js.map +1 -1
- package/dist/recipes/names.d.ts +20 -0
- package/dist/recipes/names.js +25 -0
- package/dist/recipes/names.js.map +1 -1
- package/dist/recipes/parser.js +88 -5
- package/dist/recipes/parser.js.map +1 -1
- package/dist/recipes/replayRun.js +1 -1
- package/dist/recipes/replayRun.js.map +1 -1
- package/dist/recipes/runBudget.d.ts +70 -0
- package/dist/recipes/runBudget.js +109 -0
- package/dist/recipes/runBudget.js.map +1 -0
- package/dist/recipes/scheduler.d.ts +30 -0
- package/dist/recipes/scheduler.js +69 -19
- package/dist/recipes/scheduler.js.map +1 -1
- package/dist/recipes/schema.d.ts +36 -0
- package/dist/recipes/schemaGenerator.js +103 -5
- package/dist/recipes/schemaGenerator.js.map +1 -1
- package/dist/recipes/stepObservation.js +9 -0
- package/dist/recipes/stepObservation.js.map +1 -1
- package/dist/recipes/toolRegistry.js +20 -3
- package/dist/recipes/toolRegistry.js.map +1 -1
- package/dist/recipes/tools/fanOut.d.ts +20 -0
- package/dist/recipes/tools/fanOut.js +199 -0
- package/dist/recipes/tools/fanOut.js.map +1 -0
- package/dist/recipes/tools/file.js +5 -2
- package/dist/recipes/tools/file.js.map +1 -1
- package/dist/recipes/tools/github.d.ts +1 -1
- package/dist/recipes/tools/github.js +75 -1
- package/dist/recipes/tools/github.js.map +1 -1
- package/dist/recipes/tools/gmail.js +27 -5
- package/dist/recipes/tools/gmail.js.map +1 -1
- package/dist/recipes/tools/googleDrive.js +64 -0
- package/dist/recipes/tools/googleDrive.js.map +1 -1
- package/dist/recipes/tools/http.d.ts +10 -0
- package/dist/recipes/tools/http.js +176 -0
- package/dist/recipes/tools/http.js.map +1 -0
- package/dist/recipes/tools/index.d.ts +2 -0
- package/dist/recipes/tools/index.js +2 -0
- package/dist/recipes/tools/index.js.map +1 -1
- package/dist/recipes/tools/slack.js +1 -1
- package/dist/recipes/validation.d.ts +17 -0
- package/dist/recipes/validation.js +29 -11
- package/dist/recipes/validation.js.map +1 -1
- package/dist/recipes/workspaceRoot.d.ts +37 -0
- package/dist/recipes/workspaceRoot.js +73 -0
- package/dist/recipes/workspaceRoot.js.map +1 -0
- package/dist/recipes/yamlPositions.d.ts +56 -0
- package/dist/recipes/yamlPositions.js +183 -0
- package/dist/recipes/yamlPositions.js.map +1 -0
- package/dist/recipes/yamlRunner.d.ts +182 -8
- package/dist/recipes/yamlRunner.js +877 -217
- package/dist/recipes/yamlRunner.js.map +1 -1
- package/dist/recipesHttp.d.ts +19 -3
- package/dist/recipesHttp.js +67 -11
- package/dist/recipesHttp.js.map +1 -1
- package/dist/resources.js +21 -13
- package/dist/resources.js.map +1 -1
- package/dist/runLog.d.ts +58 -5
- package/dist/runLog.js +98 -21
- package/dist/runLog.js.map +1 -1
- package/dist/sanitizeParsedJson.d.ts +39 -0
- package/dist/sanitizeParsedJson.js +55 -0
- package/dist/sanitizeParsedJson.js.map +1 -0
- package/dist/schemas/recipe.v1.json +885 -196
- package/dist/server.d.ts +160 -3
- package/dist/server.js +1099 -122
- package/dist/server.js.map +1 -1
- package/dist/sessionCheckpoint.d.ts +8 -0
- package/dist/sessionCheckpoint.js +33 -3
- package/dist/sessionCheckpoint.js.map +1 -1
- package/dist/ssrfGuard.d.ts +16 -0
- package/dist/ssrfGuard.js +87 -4
- package/dist/ssrfGuard.js.map +1 -1
- package/dist/streamableHttp.d.ts +9 -4
- package/dist/streamableHttp.js +76 -20
- package/dist/streamableHttp.js.map +1 -1
- package/dist/telemetry.js +19 -12
- package/dist/telemetry.js.map +1 -1
- package/dist/testing/shadowRun.d.ts +52 -0
- package/dist/testing/shadowRun.js +71 -0
- package/dist/testing/shadowRun.js.map +1 -0
- package/dist/tools/batchLsp.d.ts +3 -0
- package/dist/tools/bridgeDoctor.d.ts +11 -0
- package/dist/tools/bridgeDoctor.js +48 -2
- package/dist/tools/bridgeDoctor.js.map +1 -1
- package/dist/tools/bridgeStatus.d.ts +0 -12
- package/dist/tools/bridgeStatus.js +2 -28
- package/dist/tools/bridgeStatus.js.map +1 -1
- package/dist/tools/cancelClaudeTask.d.ts +1 -0
- package/dist/tools/clipboard.d.ts +2 -0
- package/dist/tools/closeTabs.d.ts +1 -0
- package/dist/tools/codeLens.d.ts +1 -0
- package/dist/tools/createIssueFromAIComment.d.ts +1 -0
- package/dist/tools/ctxGetTaskContext.d.ts +9 -0
- package/dist/tools/ctxGetTaskContext.js +50 -2
- package/dist/tools/ctxGetTaskContext.js.map +1 -1
- package/dist/tools/ctxQueryTraces.js +32 -24
- package/dist/tools/ctxQueryTraces.js.map +1 -1
- package/dist/tools/ctxSaveTrace.d.ts +1 -0
- package/dist/tools/debug.d.ts +4 -0
- package/dist/tools/decorations.d.ts +2 -0
- package/dist/tools/detectUnusedCode.js +9 -7
- package/dist/tools/detectUnusedCode.js.map +1 -1
- package/dist/tools/documentLinks.d.ts +1 -0
- package/dist/tools/editText.d.ts +1 -0
- package/dist/tools/editText.js +2 -1
- package/dist/tools/editText.js.map +1 -1
- package/dist/tools/enrichCommit.d.ts +1 -0
- package/dist/tools/enrichStackTrace.js +11 -5
- package/dist/tools/enrichStackTrace.js.map +1 -1
- package/dist/tools/explainDiagnostic.d.ts +1 -0
- package/dist/tools/explainSymbol.d.ts +1 -0
- package/dist/tools/fileOperations.d.ts +3 -0
- package/dist/tools/fileOperations.js +2 -1
- package/dist/tools/fileOperations.js.map +1 -1
- package/dist/tools/fileWatcher.d.ts +2 -0
- package/dist/tools/fileWatcher.js +8 -2
- package/dist/tools/fileWatcher.js.map +1 -1
- package/dist/tools/findFiles.d.ts +1 -0
- package/dist/tools/fixAllLintErrors.d.ts +1 -0
- package/dist/tools/fixAllLintErrors.js +10 -5
- package/dist/tools/fixAllLintErrors.js.map +1 -1
- package/dist/tools/foldingRanges.d.ts +1 -0
- package/dist/tools/formatDocument.d.ts +1 -0
- package/dist/tools/formatDocument.js +10 -5
- package/dist/tools/formatDocument.js.map +1 -1
- package/dist/tools/generateTests.d.ts +1 -0
- package/dist/tools/getAIComments.d.ts +1 -0
- package/dist/tools/getAnalyticsReport.js +5 -1
- package/dist/tools/getAnalyticsReport.js.map +1 -1
- package/dist/tools/getBufferContent.d.ts +1 -0
- package/dist/tools/getChangeImpact.d.ts +1 -0
- package/dist/tools/getChangeImpact.js +23 -14
- package/dist/tools/getChangeImpact.js.map +1 -1
- package/dist/tools/getClaudeTaskStatus.d.ts +1 -0
- package/dist/tools/getCodeCoverage.d.ts +1 -0
- package/dist/tools/getCodeCoverage.js +32 -14
- package/dist/tools/getCodeCoverage.js.map +1 -1
- package/dist/tools/getCommitsForIssue.d.ts +1 -0
- package/dist/tools/getDebugState.d.ts +1 -0
- package/dist/tools/getDiagnostics.js +32 -29
- package/dist/tools/getDiagnostics.js.map +1 -1
- package/dist/tools/getDiffFromHandoff.js +8 -2
- package/dist/tools/getDiffFromHandoff.js.map +1 -1
- package/dist/tools/getDocumentSymbols.d.ts +1 -0
- package/dist/tools/getGitHotspots.d.ts +1 -0
- package/dist/tools/getImportedSignatures.d.ts +1 -0
- package/dist/tools/getImportedSignatures.js +18 -14
- package/dist/tools/getImportedSignatures.js.map +1 -1
- package/dist/tools/getPRTemplate.d.ts +1 -0
- package/dist/tools/getProjectContext.js +23 -10
- package/dist/tools/getProjectContext.js.map +1 -1
- package/dist/tools/getSymbolHistory.d.ts +1 -0
- package/dist/tools/getToolCapabilities.d.ts +10 -5
- package/dist/tools/getToolCapabilities.js +79 -202
- package/dist/tools/getToolCapabilities.js.map +1 -1
- package/dist/tools/getTypeSignature.d.ts +1 -0
- package/dist/tools/getWorkspaceSettings.d.ts +1 -0
- package/dist/tools/gitWrite.d.ts +11 -0
- package/dist/tools/github/actions.d.ts +2 -0
- package/dist/tools/github/composite.d.ts +3 -0
- package/dist/tools/github/issues.d.ts +4 -0
- package/dist/tools/github/pr.d.ts +7 -0
- package/dist/tools/handoffNote.d.ts +1 -0
- package/dist/tools/handoffNote.js +2 -1
- package/dist/tools/handoffNote.js.map +1 -1
- package/dist/tools/headless/lspClient.js +3 -0
- package/dist/tools/headless/lspClient.js.map +1 -1
- package/dist/tools/hoverAtCursor.d.ts +1 -0
- package/dist/tools/httpClient.d.ts +2 -0
- package/dist/tools/httpClient.js +38 -71
- package/dist/tools/httpClient.js.map +1 -1
- package/dist/tools/inlayHints.d.ts +1 -0
- package/dist/tools/launchQuickTask.d.ts +1 -0
- package/dist/tools/listClaudeTasks.d.ts +1 -0
- package/dist/tools/listClaudeTasks.js +10 -8
- package/dist/tools/listClaudeTasks.js.map +1 -1
- package/dist/tools/listTerminals.d.ts +1 -0
- package/dist/tools/lsp.d.ts +15 -0
- package/dist/tools/lsp.js +17 -0
- package/dist/tools/lsp.js.map +1 -1
- package/dist/tools/navigateToSymbolByName.d.ts +1 -0
- package/dist/tools/openDiff.d.ts +1 -0
- package/dist/tools/openDiff.js +4 -1
- package/dist/tools/openDiff.js.map +1 -1
- package/dist/tools/openFile.d.ts +1 -0
- package/dist/tools/openFile.js +4 -1
- package/dist/tools/openFile.js.map +1 -1
- package/dist/tools/openInBrowser.js +6 -1
- package/dist/tools/openInBrowser.js.map +1 -1
- package/dist/tools/organizeImports.d.ts +1 -0
- package/dist/tools/organizeImports.js +5 -3
- package/dist/tools/organizeImports.js.map +1 -1
- package/dist/tools/performanceReport.js +5 -3
- package/dist/tools/performanceReport.js.map +1 -1
- package/dist/tools/planPersistence.d.ts +3 -0
- package/dist/tools/planPersistence.js +4 -1
- package/dist/tools/planPersistence.js.map +1 -1
- package/dist/tools/previewEdit.d.ts +1 -0
- package/dist/tools/previewEdit.js +15 -4
- package/dist/tools/previewEdit.js.map +1 -1
- package/dist/tools/recentTracesDigest.js +54 -11
- package/dist/tools/recentTracesDigest.js.map +1 -1
- package/dist/tools/refactorAnalyze.d.ts +1 -0
- package/dist/tools/refactorExtractFunction.js +4 -1
- package/dist/tools/refactorExtractFunction.js.map +1 -1
- package/dist/tools/refactorPreview.d.ts +1 -0
- package/dist/tools/refactorPreview.js +10 -2
- package/dist/tools/refactorPreview.js.map +1 -1
- package/dist/tools/replaceBlock.d.ts +1 -0
- package/dist/tools/replaceBlock.js +2 -1
- package/dist/tools/replaceBlock.js.map +1 -1
- package/dist/tools/resumeClaudeTask.d.ts +1 -0
- package/dist/tools/runClaudeTask.d.ts +1 -0
- package/dist/tools/runTests.js +15 -4
- package/dist/tools/runTests.js.map +1 -1
- package/dist/tools/screenshot.d.ts +1 -0
- package/dist/tools/screenshotAndAnnotate.js +6 -2
- package/dist/tools/screenshotAndAnnotate.js.map +1 -1
- package/dist/tools/searchAndReplace.d.ts +1 -0
- package/dist/tools/searchAndReplace.js +17 -7
- package/dist/tools/searchAndReplace.js.map +1 -1
- package/dist/tools/searchTools.js +20 -19
- package/dist/tools/searchTools.js.map +1 -1
- package/dist/tools/searchWorkspace.d.ts +1 -0
- package/dist/tools/selectionRanges.d.ts +1 -0
- package/dist/tools/semanticTokens.d.ts +1 -0
- package/dist/tools/signatureHelp.d.ts +1 -0
- package/dist/tools/spawnWorkspace.js +15 -7
- package/dist/tools/spawnWorkspace.js.map +1 -1
- package/dist/tools/terminal.d.ts +6 -0
- package/dist/tools/testRunners/pytest.js +6 -2
- package/dist/tools/testRunners/pytest.js.map +1 -1
- package/dist/tools/testRunners/vitestJest.js +3 -1
- package/dist/tools/testRunners/vitestJest.js.map +1 -1
- package/dist/tools/testTraceToSource.d.ts +1 -0
- package/dist/tools/transaction.d.ts +4 -0
- package/dist/tools/transaction.js +4 -1
- package/dist/tools/transaction.js.map +1 -1
- package/dist/tools/typeHierarchy.d.ts +1 -0
- package/dist/tools/utils.d.ts +18 -0
- package/dist/tools/utils.js +103 -18
- package/dist/tools/utils.js.map +1 -1
- package/dist/tools/vscodeCommands.d.ts +2 -0
- package/dist/tools/vscodeTasks.d.ts +2 -0
- package/dist/tools/workspaceSettings.d.ts +1 -0
- package/dist/transport.d.ts +3 -1
- package/dist/transport.js +103 -52
- package/dist/transport.js.map +1 -1
- package/dist/winShim.d.ts +34 -0
- package/dist/winShim.js +94 -0
- package/dist/winShim.js.map +1 -0
- package/dist/wireHaltPushDispatch.d.ts +38 -0
- package/dist/wireHaltPushDispatch.js +71 -0
- package/dist/wireHaltPushDispatch.js.map +1 -0
- package/dist/writeFileAtomic.d.ts +23 -0
- package/dist/writeFileAtomic.js +121 -0
- package/dist/writeFileAtomic.js.map +1 -0
- package/package.json +23 -7
- package/scripts/postinstall.mjs +42 -2
- package/scripts/smoke/run-all.mjs +213 -0
- package/scripts/start-all.mjs +572 -0
- package/scripts/start-all.ps1 +209 -0
- package/scripts/start-all.sh +73 -17
- package/scripts/start-orchestrator.ps1 +158 -0
- package/scripts/start-remote.mjs +122 -0
- package/templates/automation-policies/recipe-authoring.json +1 -1
- package/templates/automation-policies/security-first.json +1 -1
- package/templates/automation-policies/strict-lint.json +1 -1
- package/templates/automation-policies/test-driven.json +1 -1
- package/templates/automation-policy.example.json +1 -1
- package/templates/co.patchwork-os.bridge.plist +2 -2
- package/templates/recipes/approval-queue-ui-test.yaml +1 -1
- package/templates/recipes/ctx-loop-test.yaml +1 -1
- package/templates/recipes/fix-errors-on-save.yaml +71 -0
- package/templates/recipes/morning-brief.yaml +5 -2
- package/templates/recipes/project-health-check.yaml +4 -1
- package/templates/recipes/sentry-to-linear.yaml +72 -38
- package/templates/recipes/webhook/apple-watch-health-log.yaml +145 -0
- package/templates/recipes/webhook/customer-escalation.yaml +8 -9
- package/templates/recipes/webhook/meeting-prep.yaml +11 -5
- package/dist/commands/marketplace.d.ts +0 -16
- package/dist/commands/marketplace.js +0 -32
- package/dist/commands/marketplace.js.map +0 -1
- package/dist/recipes/legacyRecipeCompat.d.ts +0 -10
- package/dist/recipes/legacyRecipeCompat.js +0 -131
- package/dist/recipes/legacyRecipeCompat.js.map +0 -1
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Postgres connector — read-only SQL access via the `pg` driver.
|
|
3
|
+
*
|
|
4
|
+
* Auth: connection string OR discrete host/port/database/user/password.
|
|
5
|
+
* - Stored: getSecretJsonSync("postgres") → PostgresTokens
|
|
6
|
+
*
|
|
7
|
+
* Tools: listTables, describeTable, query (SELECT-only), explain (SELECT-only)
|
|
8
|
+
*
|
|
9
|
+
* Driver: `pg` is loaded lazily via dynamic import. It is NOT a project
|
|
10
|
+
* dependency — operators must `npm install pg` in their workspace before
|
|
11
|
+
* using this connector.
|
|
12
|
+
*
|
|
13
|
+
* Extends BaseConnector for unified auth, retry, rate-limit, error handling.
|
|
14
|
+
*
|
|
15
|
+
* This file is the canonical template for the other data-store connectors
|
|
16
|
+
* (MongoDB, Redis, Elasticsearch). Keep the shape consistent.
|
|
17
|
+
*/
|
|
18
|
+
import { type AuthContext, BaseConnector, type ConnectorError, type ConnectorStatus } from "./baseConnector.js";
|
|
19
|
+
export interface PostgresTokens {
|
|
20
|
+
/** Full DSN: postgres://user:pass@host:port/db */
|
|
21
|
+
connectionString?: string;
|
|
22
|
+
host?: string;
|
|
23
|
+
port?: number;
|
|
24
|
+
database?: string;
|
|
25
|
+
user?: string;
|
|
26
|
+
password?: string;
|
|
27
|
+
ssl?: boolean;
|
|
28
|
+
connected_at: string;
|
|
29
|
+
}
|
|
30
|
+
export interface PostgresTable {
|
|
31
|
+
table_schema: string;
|
|
32
|
+
table_name: string;
|
|
33
|
+
}
|
|
34
|
+
export interface PostgresColumn {
|
|
35
|
+
column_name: string;
|
|
36
|
+
data_type: string;
|
|
37
|
+
is_nullable: string;
|
|
38
|
+
column_default: string | null;
|
|
39
|
+
}
|
|
40
|
+
export interface PostgresQueryResult {
|
|
41
|
+
rows: Record<string, unknown>[];
|
|
42
|
+
rowCount: number;
|
|
43
|
+
fields: {
|
|
44
|
+
name: string;
|
|
45
|
+
dataTypeID: number;
|
|
46
|
+
}[];
|
|
47
|
+
truncated: boolean;
|
|
48
|
+
}
|
|
49
|
+
type PgPoolClient = {
|
|
50
|
+
query: (text: string, values?: unknown[]) => Promise<PgQueryResultRaw>;
|
|
51
|
+
release: () => void;
|
|
52
|
+
};
|
|
53
|
+
type PgQueryResultRaw = {
|
|
54
|
+
rows: Record<string, unknown>[];
|
|
55
|
+
rowCount: number | null;
|
|
56
|
+
fields?: {
|
|
57
|
+
name: string;
|
|
58
|
+
dataTypeID: number;
|
|
59
|
+
}[];
|
|
60
|
+
};
|
|
61
|
+
type PgPool = {
|
|
62
|
+
query: (text: string, values?: unknown[]) => Promise<PgQueryResultRaw>;
|
|
63
|
+
connect: () => Promise<PgPoolClient>;
|
|
64
|
+
end: () => Promise<void>;
|
|
65
|
+
};
|
|
66
|
+
type PgModule = {
|
|
67
|
+
Pool: new (config: Record<string, unknown>) => PgPool;
|
|
68
|
+
};
|
|
69
|
+
export declare function __setPgModuleForTest(mod: PgModule | null): void;
|
|
70
|
+
/**
|
|
71
|
+
* True iff `sql` is a read-only statement (SELECT / SHOW / EXPLAIN / WITH).
|
|
72
|
+
* Strips leading comments + whitespace and inspects the first keyword.
|
|
73
|
+
* Defence in depth: pair with role-level read-only grants on the DB side.
|
|
74
|
+
*/
|
|
75
|
+
export declare function isReadOnlySql(sql: string): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Wrap a SELECT-style statement with `LIMIT n` if it does not already cap
|
|
78
|
+
* rows. Cheap heuristic: case-insensitive "limit" word search. The runtime
|
|
79
|
+
* row-count cap in `query()` is the real safety net.
|
|
80
|
+
*/
|
|
81
|
+
export declare function applyRowLimit(sql: string, limit: number): string;
|
|
82
|
+
export declare class PostgresConnector extends BaseConnector {
|
|
83
|
+
readonly providerName = "postgres";
|
|
84
|
+
private tokens;
|
|
85
|
+
private pool;
|
|
86
|
+
protected getOAuthConfig(): null;
|
|
87
|
+
authenticate(): Promise<AuthContext>;
|
|
88
|
+
healthCheck(): Promise<{
|
|
89
|
+
ok: boolean;
|
|
90
|
+
error?: ConnectorError;
|
|
91
|
+
}>;
|
|
92
|
+
normalizeError(error: unknown): ConnectorError;
|
|
93
|
+
getStatus(): ConnectorStatus;
|
|
94
|
+
private getPool;
|
|
95
|
+
/** Close the pool. Called by the HTTP disconnect handler. */
|
|
96
|
+
disconnect(): Promise<void>;
|
|
97
|
+
listTables(schema?: string): Promise<PostgresTable[]>;
|
|
98
|
+
describeTable(table: string, schema?: string): Promise<PostgresColumn[]>;
|
|
99
|
+
query(sql: string, params?: unknown[], rowLimit?: number): Promise<PostgresQueryResult>;
|
|
100
|
+
explain(sql: string): Promise<unknown>;
|
|
101
|
+
}
|
|
102
|
+
export declare function loadTokens(): PostgresTokens | null;
|
|
103
|
+
export declare function saveTokens(tokens: PostgresTokens): void;
|
|
104
|
+
export declare function clearTokens(): void;
|
|
105
|
+
export declare function getPostgresConnector(): PostgresConnector;
|
|
106
|
+
export { getPostgresConnector as postgres };
|
|
107
|
+
export interface ConnectorHandlerResult {
|
|
108
|
+
status: number;
|
|
109
|
+
body: string;
|
|
110
|
+
contentType?: string;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* POST /connections/postgres/connect
|
|
114
|
+
* body: { connectionString } OR { host, port?, database, user, password, ssl? }
|
|
115
|
+
*
|
|
116
|
+
* Validates by opening a connection, running `SELECT 1`, then closing.
|
|
117
|
+
* Only stores tokens after a successful round-trip.
|
|
118
|
+
*/
|
|
119
|
+
export declare function handlePostgresConnect(body: string): Promise<ConnectorHandlerResult>;
|
|
120
|
+
/**
|
|
121
|
+
* POST /connections/postgres/test
|
|
122
|
+
*/
|
|
123
|
+
export declare function handlePostgresTest(): Promise<ConnectorHandlerResult>;
|
|
124
|
+
/**
|
|
125
|
+
* DELETE /connections/postgres
|
|
126
|
+
*/
|
|
127
|
+
export declare function handlePostgresDisconnect(): Promise<ConnectorHandlerResult>;
|
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Postgres connector — read-only SQL access via the `pg` driver.
|
|
3
|
+
*
|
|
4
|
+
* Auth: connection string OR discrete host/port/database/user/password.
|
|
5
|
+
* - Stored: getSecretJsonSync("postgres") → PostgresTokens
|
|
6
|
+
*
|
|
7
|
+
* Tools: listTables, describeTable, query (SELECT-only), explain (SELECT-only)
|
|
8
|
+
*
|
|
9
|
+
* Driver: `pg` is loaded lazily via dynamic import. It is NOT a project
|
|
10
|
+
* dependency — operators must `npm install pg` in their workspace before
|
|
11
|
+
* using this connector.
|
|
12
|
+
*
|
|
13
|
+
* Extends BaseConnector for unified auth, retry, rate-limit, error handling.
|
|
14
|
+
*
|
|
15
|
+
* This file is the canonical template for the other data-store connectors
|
|
16
|
+
* (MongoDB, Redis, Elasticsearch). Keep the shape consistent.
|
|
17
|
+
*/
|
|
18
|
+
import { BaseConnector, } from "./baseConnector.js";
|
|
19
|
+
import { deleteSecretJsonSync, getSecretJsonSync, storeSecretJsonSync, } from "./tokenStorage.js";
|
|
20
|
+
let _pgModulePromise = null;
|
|
21
|
+
async function loadPgDriver() {
|
|
22
|
+
if (!_pgModulePromise) {
|
|
23
|
+
// @ts-expect-error — `pg` is an optional peer dependency, not in package.json
|
|
24
|
+
_pgModulePromise = import("pg").then((m) => m.default ??
|
|
25
|
+
m, () => null);
|
|
26
|
+
}
|
|
27
|
+
const mod = await _pgModulePromise;
|
|
28
|
+
if (!mod) {
|
|
29
|
+
throw new Error("Postgres driver not installed. Run: npm install pg");
|
|
30
|
+
}
|
|
31
|
+
return mod;
|
|
32
|
+
}
|
|
33
|
+
// Test seam — lets the test file inject a fake pg module without touching disk.
|
|
34
|
+
export function __setPgModuleForTest(mod) {
|
|
35
|
+
_pgModulePromise = mod ? Promise.resolve(mod) : null;
|
|
36
|
+
}
|
|
37
|
+
// ── SQL safety guard ────────────────────────────────────────────────────────
|
|
38
|
+
const READ_ONLY_KEYWORDS = new Set(["select", "show", "explain", "with"]);
|
|
39
|
+
/**
|
|
40
|
+
* True iff `sql` is a read-only statement (SELECT / SHOW / EXPLAIN / WITH).
|
|
41
|
+
* Strips leading comments + whitespace and inspects the first keyword.
|
|
42
|
+
* Defence in depth: pair with role-level read-only grants on the DB side.
|
|
43
|
+
*/
|
|
44
|
+
export function isReadOnlySql(sql) {
|
|
45
|
+
if (typeof sql !== "string")
|
|
46
|
+
return false;
|
|
47
|
+
let s = sql.trim();
|
|
48
|
+
// Strip leading -- line comments and /* */ block comments
|
|
49
|
+
while (s.length > 0) {
|
|
50
|
+
if (s.startsWith("--")) {
|
|
51
|
+
const nl = s.indexOf("\n");
|
|
52
|
+
s = nl === -1 ? "" : s.slice(nl + 1).trim();
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (s.startsWith("/*")) {
|
|
56
|
+
const end = s.indexOf("*/");
|
|
57
|
+
s = end === -1 ? "" : s.slice(end + 2).trim();
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
const match = s.match(/^([a-zA-Z]+)/);
|
|
63
|
+
if (!match)
|
|
64
|
+
return false;
|
|
65
|
+
const kw = match[1].toLowerCase();
|
|
66
|
+
if (!READ_ONLY_KEYWORDS.has(kw))
|
|
67
|
+
return false;
|
|
68
|
+
// Reject semicolon-chained statements (cheap heuristic — rejects trailing
|
|
69
|
+
// ";" too, accept that). Allows a single trailing semicolon.
|
|
70
|
+
const stripped = s.replace(/;\s*$/, "");
|
|
71
|
+
if (stripped.includes(";"))
|
|
72
|
+
return false;
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Wrap a SELECT-style statement with `LIMIT n` if it does not already cap
|
|
77
|
+
* rows. Cheap heuristic: case-insensitive "limit" word search. The runtime
|
|
78
|
+
* row-count cap in `query()` is the real safety net.
|
|
79
|
+
*/
|
|
80
|
+
export function applyRowLimit(sql, limit) {
|
|
81
|
+
const trimmed = sql.replace(/;\s*$/, "").trim();
|
|
82
|
+
if (/\blimit\s+\d+/i.test(trimmed))
|
|
83
|
+
return trimmed;
|
|
84
|
+
return `${trimmed} LIMIT ${limit}`;
|
|
85
|
+
}
|
|
86
|
+
// ── Connector ───────────────────────────────────────────────────────────────
|
|
87
|
+
export class PostgresConnector extends BaseConnector {
|
|
88
|
+
providerName = "postgres";
|
|
89
|
+
tokens = null;
|
|
90
|
+
pool = null;
|
|
91
|
+
getOAuthConfig() {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
async authenticate() {
|
|
95
|
+
const tokens = loadTokens();
|
|
96
|
+
if (!tokens) {
|
|
97
|
+
throw new Error("Postgres not connected. Run: patchwork-os connect postgres");
|
|
98
|
+
}
|
|
99
|
+
this.tokens = tokens;
|
|
100
|
+
return {
|
|
101
|
+
token: tokens.connectionString ?? "postgres",
|
|
102
|
+
scopes: ["read"],
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
async healthCheck() {
|
|
106
|
+
try {
|
|
107
|
+
const pool = await this.getPool();
|
|
108
|
+
await pool.query("SELECT 1");
|
|
109
|
+
return { ok: true };
|
|
110
|
+
}
|
|
111
|
+
catch (err) {
|
|
112
|
+
return { ok: false, error: this.normalizeError(err) };
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
normalizeError(error) {
|
|
116
|
+
const code = error && typeof error === "object" && "code" in error
|
|
117
|
+
? String(error.code)
|
|
118
|
+
: "";
|
|
119
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
120
|
+
if (code === "28P01" || code === "28000") {
|
|
121
|
+
return {
|
|
122
|
+
code: "auth_expired",
|
|
123
|
+
message: `Postgres authentication failed: ${message}`,
|
|
124
|
+
retryable: false,
|
|
125
|
+
suggestedAction: "patchwork-os connect postgres",
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
if (code === "3D000") {
|
|
129
|
+
return {
|
|
130
|
+
code: "not_found",
|
|
131
|
+
message: `Postgres database does not exist: ${message}`,
|
|
132
|
+
retryable: false,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
if (code === "08006" ||
|
|
136
|
+
code === "08001" ||
|
|
137
|
+
code === "08000" ||
|
|
138
|
+
code === "08003" ||
|
|
139
|
+
code === "08004") {
|
|
140
|
+
return {
|
|
141
|
+
code: "network_error",
|
|
142
|
+
message: `Postgres connection error: ${message}`,
|
|
143
|
+
retryable: true,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
if (code === "42501") {
|
|
147
|
+
return {
|
|
148
|
+
code: "permission_denied",
|
|
149
|
+
message: `Postgres permission denied: ${message}`,
|
|
150
|
+
retryable: false,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
if (code === "42P01") {
|
|
154
|
+
return {
|
|
155
|
+
code: "not_found",
|
|
156
|
+
message: `Postgres table not found: ${message}`,
|
|
157
|
+
retryable: false,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
if (error instanceof Error &&
|
|
161
|
+
(message.includes("ENOTFOUND") ||
|
|
162
|
+
message.includes("ECONNREFUSED") ||
|
|
163
|
+
message.includes("ETIMEDOUT"))) {
|
|
164
|
+
return {
|
|
165
|
+
code: "network_error",
|
|
166
|
+
message: `Cannot connect to Postgres: ${message}`,
|
|
167
|
+
retryable: true,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
return {
|
|
171
|
+
code: "provider_error",
|
|
172
|
+
message,
|
|
173
|
+
retryable: false,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
getStatus() {
|
|
177
|
+
const tokens = loadTokens();
|
|
178
|
+
return {
|
|
179
|
+
id: "postgres",
|
|
180
|
+
status: tokens ? "connected" : "disconnected",
|
|
181
|
+
lastSync: tokens?.connected_at,
|
|
182
|
+
workspace: tokens?.database && tokens?.host
|
|
183
|
+
? `Postgres ${tokens.database}@${tokens.host}`
|
|
184
|
+
: tokens?.database
|
|
185
|
+
? `Postgres ${tokens.database}`
|
|
186
|
+
: undefined,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
// ── Pool management ───────────────────────────────────────────────────────
|
|
190
|
+
async getPool() {
|
|
191
|
+
if (this.pool)
|
|
192
|
+
return this.pool;
|
|
193
|
+
if (!this.tokens) {
|
|
194
|
+
const loaded = loadTokens();
|
|
195
|
+
if (!loaded) {
|
|
196
|
+
throw new Error("Postgres not connected");
|
|
197
|
+
}
|
|
198
|
+
this.tokens = loaded;
|
|
199
|
+
}
|
|
200
|
+
const pg = await loadPgDriver();
|
|
201
|
+
this.pool = new pg.Pool(buildPgConfig(this.tokens));
|
|
202
|
+
return this.pool;
|
|
203
|
+
}
|
|
204
|
+
/** Close the pool. Called by the HTTP disconnect handler. */
|
|
205
|
+
async disconnect() {
|
|
206
|
+
if (this.pool) {
|
|
207
|
+
try {
|
|
208
|
+
await this.pool.end();
|
|
209
|
+
}
|
|
210
|
+
catch {
|
|
211
|
+
// ignore — pool may already be closed
|
|
212
|
+
}
|
|
213
|
+
this.pool = null;
|
|
214
|
+
}
|
|
215
|
+
this.tokens = null;
|
|
216
|
+
}
|
|
217
|
+
// ── API Methods ───────────────────────────────────────────────────────────
|
|
218
|
+
async listTables(schema) {
|
|
219
|
+
const result = await this.apiCall(async () => {
|
|
220
|
+
const pool = await this.getPool();
|
|
221
|
+
const params = [];
|
|
222
|
+
let sql = "SELECT table_schema, table_name FROM information_schema.tables WHERE table_schema NOT IN ('pg_catalog','information_schema')";
|
|
223
|
+
if (schema) {
|
|
224
|
+
params.push(schema);
|
|
225
|
+
sql += " AND table_schema = $1";
|
|
226
|
+
}
|
|
227
|
+
sql += " ORDER BY table_schema, table_name";
|
|
228
|
+
const r = await pool.query(sql, params);
|
|
229
|
+
return r.rows;
|
|
230
|
+
});
|
|
231
|
+
if ("error" in result)
|
|
232
|
+
throw new Error(result.error.message);
|
|
233
|
+
return result.data;
|
|
234
|
+
}
|
|
235
|
+
async describeTable(table, schema = "public") {
|
|
236
|
+
const result = await this.apiCall(async () => {
|
|
237
|
+
const pool = await this.getPool();
|
|
238
|
+
const r = await pool.query("SELECT column_name, data_type, is_nullable, column_default FROM information_schema.columns WHERE table_schema = $1 AND table_name = $2 ORDER BY ordinal_position", [schema, table]);
|
|
239
|
+
return r.rows;
|
|
240
|
+
});
|
|
241
|
+
if ("error" in result)
|
|
242
|
+
throw new Error(result.error.message);
|
|
243
|
+
return result.data;
|
|
244
|
+
}
|
|
245
|
+
async query(sql, params = [], rowLimit = 100) {
|
|
246
|
+
if (!isReadOnlySql(sql)) {
|
|
247
|
+
throw new Error("Only read-only statements (SELECT / SHOW / EXPLAIN / WITH) are permitted");
|
|
248
|
+
}
|
|
249
|
+
const cap = Math.max(1, Math.min(rowLimit, 10_000));
|
|
250
|
+
const bounded = applyRowLimit(sql, cap);
|
|
251
|
+
const result = await this.apiCall(async () => {
|
|
252
|
+
const pool = await this.getPool();
|
|
253
|
+
const r = await pool.query(bounded, params);
|
|
254
|
+
const rows = r.rows ?? [];
|
|
255
|
+
const truncated = rows.length >= cap;
|
|
256
|
+
return {
|
|
257
|
+
rows: rows.slice(0, cap),
|
|
258
|
+
rowCount: r.rowCount ?? rows.length,
|
|
259
|
+
fields: r.fields ?? [],
|
|
260
|
+
truncated,
|
|
261
|
+
};
|
|
262
|
+
});
|
|
263
|
+
if ("error" in result)
|
|
264
|
+
throw new Error(result.error.message);
|
|
265
|
+
return result.data;
|
|
266
|
+
}
|
|
267
|
+
async explain(sql) {
|
|
268
|
+
if (!isReadOnlySql(sql)) {
|
|
269
|
+
throw new Error("Only read-only statements (SELECT / SHOW / EXPLAIN / WITH) are permitted");
|
|
270
|
+
}
|
|
271
|
+
const stripped = sql.replace(/;\s*$/, "").trim();
|
|
272
|
+
const wrapped = `EXPLAIN (FORMAT JSON) ${stripped}`;
|
|
273
|
+
const result = await this.apiCall(async () => {
|
|
274
|
+
const pool = await this.getPool();
|
|
275
|
+
const r = await pool.query(wrapped);
|
|
276
|
+
// pg returns a single-row, single-column JSON array
|
|
277
|
+
const first = r.rows[0];
|
|
278
|
+
if (!first)
|
|
279
|
+
return null;
|
|
280
|
+
const key = Object.keys(first)[0];
|
|
281
|
+
return key ? first[key] : first;
|
|
282
|
+
});
|
|
283
|
+
if ("error" in result)
|
|
284
|
+
throw new Error(result.error.message);
|
|
285
|
+
return result.data;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
// ── Config builder ──────────────────────────────────────────────────────────
|
|
289
|
+
function buildPgConfig(tokens) {
|
|
290
|
+
const config = {
|
|
291
|
+
// Single-client pool — datasource workloads are short-lived; keep
|
|
292
|
+
// connections cheap.
|
|
293
|
+
max: 4,
|
|
294
|
+
idleTimeoutMillis: 30_000,
|
|
295
|
+
connectionTimeoutMillis: 10_000,
|
|
296
|
+
};
|
|
297
|
+
if (tokens.connectionString) {
|
|
298
|
+
config.connectionString = tokens.connectionString;
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
if (tokens.host)
|
|
302
|
+
config.host = tokens.host;
|
|
303
|
+
if (tokens.port)
|
|
304
|
+
config.port = tokens.port;
|
|
305
|
+
if (tokens.database)
|
|
306
|
+
config.database = tokens.database;
|
|
307
|
+
if (tokens.user)
|
|
308
|
+
config.user = tokens.user;
|
|
309
|
+
if (tokens.password)
|
|
310
|
+
config.password = tokens.password;
|
|
311
|
+
}
|
|
312
|
+
if (tokens.ssl)
|
|
313
|
+
config.ssl = { rejectUnauthorized: false };
|
|
314
|
+
return config;
|
|
315
|
+
}
|
|
316
|
+
// ── Token persistence ───────────────────────────────────────────────────────
|
|
317
|
+
export function loadTokens() {
|
|
318
|
+
return getSecretJsonSync("postgres");
|
|
319
|
+
}
|
|
320
|
+
export function saveTokens(tokens) {
|
|
321
|
+
storeSecretJsonSync("postgres", tokens);
|
|
322
|
+
}
|
|
323
|
+
export function clearTokens() {
|
|
324
|
+
try {
|
|
325
|
+
deleteSecretJsonSync("postgres");
|
|
326
|
+
}
|
|
327
|
+
catch {
|
|
328
|
+
// ignore
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
// ── Singleton instance ──────────────────────────────────────────────────────
|
|
332
|
+
let _instance = null;
|
|
333
|
+
function resetPostgresConnector() {
|
|
334
|
+
if (_instance) {
|
|
335
|
+
// Best-effort pool teardown — don't block.
|
|
336
|
+
void _instance.disconnect();
|
|
337
|
+
}
|
|
338
|
+
_instance = null;
|
|
339
|
+
}
|
|
340
|
+
export function getPostgresConnector() {
|
|
341
|
+
if (!_instance) {
|
|
342
|
+
_instance = new PostgresConnector();
|
|
343
|
+
}
|
|
344
|
+
return _instance;
|
|
345
|
+
}
|
|
346
|
+
export { getPostgresConnector as postgres };
|
|
347
|
+
/**
|
|
348
|
+
* POST /connections/postgres/connect
|
|
349
|
+
* body: { connectionString } OR { host, port?, database, user, password, ssl? }
|
|
350
|
+
*
|
|
351
|
+
* Validates by opening a connection, running `SELECT 1`, then closing.
|
|
352
|
+
* Only stores tokens after a successful round-trip.
|
|
353
|
+
*/
|
|
354
|
+
export async function handlePostgresConnect(body) {
|
|
355
|
+
let parsed;
|
|
356
|
+
try {
|
|
357
|
+
parsed = JSON.parse(body);
|
|
358
|
+
}
|
|
359
|
+
catch {
|
|
360
|
+
return {
|
|
361
|
+
status: 400,
|
|
362
|
+
contentType: "application/json",
|
|
363
|
+
body: JSON.stringify({ ok: false, error: "Invalid JSON body" }),
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
const candidate = { connected_at: new Date().toISOString() };
|
|
367
|
+
if (typeof parsed.connectionString === "string" && parsed.connectionString) {
|
|
368
|
+
candidate.connectionString = parsed.connectionString;
|
|
369
|
+
}
|
|
370
|
+
else {
|
|
371
|
+
if (typeof parsed.host !== "string" || !parsed.host) {
|
|
372
|
+
return {
|
|
373
|
+
status: 400,
|
|
374
|
+
contentType: "application/json",
|
|
375
|
+
body: JSON.stringify({
|
|
376
|
+
ok: false,
|
|
377
|
+
error: "Provide connectionString OR host+database+user+password",
|
|
378
|
+
}),
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
if (typeof parsed.database !== "string" || !parsed.database) {
|
|
382
|
+
return {
|
|
383
|
+
status: 400,
|
|
384
|
+
contentType: "application/json",
|
|
385
|
+
body: JSON.stringify({ ok: false, error: "database is required" }),
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
if (typeof parsed.user !== "string" || !parsed.user) {
|
|
389
|
+
return {
|
|
390
|
+
status: 400,
|
|
391
|
+
contentType: "application/json",
|
|
392
|
+
body: JSON.stringify({ ok: false, error: "user is required" }),
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
if (typeof parsed.password !== "string") {
|
|
396
|
+
return {
|
|
397
|
+
status: 400,
|
|
398
|
+
contentType: "application/json",
|
|
399
|
+
body: JSON.stringify({ ok: false, error: "password is required" }),
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
candidate.host = parsed.host;
|
|
403
|
+
candidate.database = parsed.database;
|
|
404
|
+
candidate.user = parsed.user;
|
|
405
|
+
candidate.password = parsed.password;
|
|
406
|
+
if (typeof parsed.port === "number")
|
|
407
|
+
candidate.port = parsed.port;
|
|
408
|
+
if (typeof parsed.ssl === "boolean")
|
|
409
|
+
candidate.ssl = parsed.ssl;
|
|
410
|
+
}
|
|
411
|
+
// Validate by opening a pool + SELECT 1.
|
|
412
|
+
let pg;
|
|
413
|
+
try {
|
|
414
|
+
pg = await loadPgDriver();
|
|
415
|
+
}
|
|
416
|
+
catch (err) {
|
|
417
|
+
return {
|
|
418
|
+
status: 500,
|
|
419
|
+
contentType: "application/json",
|
|
420
|
+
body: JSON.stringify({
|
|
421
|
+
ok: false,
|
|
422
|
+
error: err instanceof Error ? err.message : String(err),
|
|
423
|
+
}),
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
const pool = new pg.Pool(buildPgConfig(candidate));
|
|
427
|
+
try {
|
|
428
|
+
await pool.query("SELECT 1");
|
|
429
|
+
}
|
|
430
|
+
catch (err) {
|
|
431
|
+
try {
|
|
432
|
+
await pool.end();
|
|
433
|
+
}
|
|
434
|
+
catch {
|
|
435
|
+
/* ignore */
|
|
436
|
+
}
|
|
437
|
+
const norm = getPostgresConnector().normalizeError(err);
|
|
438
|
+
return {
|
|
439
|
+
status: norm.code === "auth_expired" || norm.code === "permission_denied"
|
|
440
|
+
? 401
|
|
441
|
+
: 400,
|
|
442
|
+
contentType: "application/json",
|
|
443
|
+
body: JSON.stringify({ ok: false, error: norm.message }),
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
try {
|
|
447
|
+
await pool.end();
|
|
448
|
+
}
|
|
449
|
+
catch {
|
|
450
|
+
/* ignore */
|
|
451
|
+
}
|
|
452
|
+
saveTokens(candidate);
|
|
453
|
+
resetPostgresConnector();
|
|
454
|
+
return {
|
|
455
|
+
status: 200,
|
|
456
|
+
contentType: "application/json",
|
|
457
|
+
body: JSON.stringify({
|
|
458
|
+
ok: true,
|
|
459
|
+
database: candidate.database,
|
|
460
|
+
host: candidate.host,
|
|
461
|
+
connectedAt: candidate.connected_at,
|
|
462
|
+
}),
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* POST /connections/postgres/test
|
|
467
|
+
*/
|
|
468
|
+
export async function handlePostgresTest() {
|
|
469
|
+
const tokens = loadTokens();
|
|
470
|
+
if (!tokens) {
|
|
471
|
+
return {
|
|
472
|
+
status: 400,
|
|
473
|
+
contentType: "application/json",
|
|
474
|
+
body: JSON.stringify({ ok: false, error: "Postgres not connected" }),
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
try {
|
|
478
|
+
const connector = getPostgresConnector();
|
|
479
|
+
const check = await connector.healthCheck();
|
|
480
|
+
return {
|
|
481
|
+
status: check.ok ? 200 : 401,
|
|
482
|
+
contentType: "application/json",
|
|
483
|
+
body: JSON.stringify(check.ok ? { ok: true } : { ok: false, error: check.error?.message }),
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
catch (err) {
|
|
487
|
+
return {
|
|
488
|
+
status: 500,
|
|
489
|
+
contentType: "application/json",
|
|
490
|
+
body: JSON.stringify({
|
|
491
|
+
ok: false,
|
|
492
|
+
error: err instanceof Error ? err.message : String(err),
|
|
493
|
+
}),
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* DELETE /connections/postgres
|
|
499
|
+
*/
|
|
500
|
+
export async function handlePostgresDisconnect() {
|
|
501
|
+
if (_instance) {
|
|
502
|
+
await _instance.disconnect();
|
|
503
|
+
}
|
|
504
|
+
clearTokens();
|
|
505
|
+
resetPostgresConnector();
|
|
506
|
+
return {
|
|
507
|
+
status: 200,
|
|
508
|
+
contentType: "application/json",
|
|
509
|
+
body: JSON.stringify({ ok: true }),
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
//# sourceMappingURL=postgres.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres.js","sourceRoot":"","sources":["../../src/connectors/postgres.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAEL,aAAa,GAGd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAqD3B,IAAI,gBAAgB,GAAoC,IAAI,CAAC;AAC7D,KAAK,UAAU,YAAY;IACzB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,8EAA8E;QAC9E,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAClC,CAAC,CAAC,EAAE,EAAE,CACH,CAAuC,CAAC,OAAO;YAC/C,CAAyB,EAC5B,GAAG,EAAE,CAAC,IAAI,CACX,CAAC;IACJ,CAAC;IAC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