aws-runtime-bridge 1.9.175 → 1.9.180
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/CHANGELOG.md +223 -0
- package/README.md +61 -2
- package/dist/adapter/AcodeSdkAdapter.d.ts +382 -0
- package/dist/adapter/AcodeSdkAdapter.js +3 -3
- package/dist/adapter/AdapterRegistry.d.ts +28 -0
- package/dist/adapter/ClaudeSdkAdapter.d.ts +71 -0
- package/dist/adapter/CodexSdkAdapter.d.ts +14 -0
- package/dist/adapter/OpencodeSdkAdapter.d.ts +44 -0
- package/dist/adapter/acode-tool-names.d.ts +9 -0
- package/dist/adapter/idle-poll-loop.d.ts +20 -0
- package/dist/adapter/index.d.ts +3 -0
- package/dist/adapter/instance-ai-config-resolver.d.ts +20 -0
- package/dist/adapter/prompts.d.ts +12 -0
- package/dist/adapter/types.d.ts +201 -0
- package/dist/browser/browser-bootstrap.d.ts +15 -0
- package/dist/browser/browser-connect-token.d.ts +11 -0
- package/dist/browser/browser-frame-encode.d.ts +32 -0
- package/dist/browser/browser-pool.d.ts +129 -0
- package/dist/browser/browser-profile-store.d.ts +41 -0
- package/dist/browser/browser-ws-bridge.d.ts +20 -0
- package/dist/browser/built-in-browser-tools.d.ts +44 -0
- package/dist/browser/element-locator.d.ts +25 -0
- package/dist/browser/element-picker.d.ts +30 -0
- package/dist/browser/frame-encode.d.ts +19 -0
- package/dist/browser/input-dispatcher.d.ts +35 -0
- package/dist/browser/listener-store.d.ts +44 -0
- package/dist/browser/page-listener-manager.d.ts +88 -0
- package/dist/browser/page-listener-types.d.ts +38 -0
- package/dist/browser/screencast-differ.d.ts +10 -0
- package/dist/browser/screencast-manager.d.ts +94 -0
- package/dist/browser/snapshot-serializer.d.ts +56 -0
- package/dist/browser/ssrf-guard.d.ts +44 -0
- package/dist/browser/stealth.d.ts +21 -0
- package/dist/browser/step-archive.d.ts +13 -0
- package/dist/browser/types.d.ts +100 -0
- package/dist/browser/ws-server.d.ts +54 -0
- package/dist/config.d.ts +138 -2
- package/dist/config.js +2 -2
- package/dist/desktop/built-in-desktop-tools.d.ts +68 -0
- package/dist/desktop/built-in-desktop-tools.js +2 -1
- package/dist/desktop/desktop-control.d.ts +142 -0
- package/dist/desktop/desktop-control.js +2 -0
- package/dist/desktop/desktop-mcp-client.d.ts +28 -0
- package/dist/desktop/desktop-staleness.d.ts +66 -0
- package/dist/desktop/desktop-staleness.js +2 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1 -1
- package/dist/middleware/auth.d.ts +26 -0
- package/dist/middleware/auth.js +1 -1
- package/dist/remote-desktop/computer-control.d.ts +3 -0
- package/dist/remote-desktop/coords.d.ts +6 -0
- package/dist/remote-desktop/frame-backpressure.d.ts +10 -0
- package/dist/remote-desktop/frame-encode.d.ts +3 -0
- package/dist/remote-desktop/index.js +2 -2
- package/dist/remote-desktop/input-dispatcher.d.ts +4 -0
- package/dist/remote-desktop/permission-manager.d.ts +3 -0
- package/dist/remote-desktop/screen-capture.d.ts +91 -0
- package/dist/remote-desktop/session-manager.d.ts +47 -0
- package/dist/remote-desktop/session-manager.js +1 -1
- package/dist/remote-desktop/system-backend.d.ts +64 -0
- package/dist/remote-desktop/types.d.ts +25 -0
- package/dist/remote-desktop/ui-automation.d.ts +11 -0
- package/dist/remote-desktop/win32-api.d.ts +10 -0
- package/dist/routes/acode-todos.d.ts +13 -0
- package/dist/routes/agent-state.d.ts +15 -0
- package/dist/routes/ai-sources.js +1 -1
- package/dist/routes/background-tasks.d.ts +18 -0
- package/dist/routes/background-tasks.js +2 -2
- package/dist/routes/browser-listeners.d.ts +17 -0
- package/dist/routes/browser-sessions.d.ts +10 -0
- package/dist/routes/capabilities.js +1 -1
- package/dist/routes/dashboard-icon.d.ts +9 -0
- package/dist/routes/dashboard-icon.js +2 -0
- package/dist/routes/dashboard-theme.d.ts +24 -0
- package/dist/routes/dashboard-theme.js +157 -0
- package/dist/routes/dashboard.d.ts +9 -0
- package/dist/routes/dashboard.js +1988 -625
- package/dist/routes/debug-mount.d.ts +16 -0
- package/dist/routes/desktop-control.d.ts +15 -0
- package/dist/routes/desktop-control.js +2 -0
- package/dist/routes/events.d.ts +4 -0
- package/dist/routes/file-browser.d.ts +11 -0
- package/dist/routes/file-change-diff.d.ts +25 -0
- package/dist/routes/file-diff-rollback.d.ts +28 -0
- package/dist/routes/file-snapshot.d.ts +7 -0
- package/dist/routes/git.d.ts +143 -0
- package/dist/routes/instance-tool-status.d.ts +5 -0
- package/dist/routes/instance.d.ts +8 -0
- package/dist/routes/instance.js +1 -1
- package/dist/routes/jdks.d.ts +4 -0
- package/dist/routes/launch.d.ts +5 -0
- package/dist/routes/lsp-providers.d.ts +11 -0
- package/dist/routes/lsp-providers.js +2 -0
- package/dist/routes/lsp.d.ts +41 -0
- package/dist/routes/lsp.js +4 -2
- package/dist/routes/mcp-extra.d.ts +15 -0
- package/dist/routes/mcp.d.ts +16 -0
- package/dist/routes/mcp.js +1 -1
- package/dist/routes/plugins.d.ts +19 -0
- package/dist/routes/plugins.js +1 -1
- package/dist/routes/processes.d.ts +4 -0
- package/dist/routes/properties.d.ts +4 -0
- package/dist/routes/pty.d.ts +29 -0
- package/dist/routes/runtime-binding.d.ts +3 -0
- package/dist/routes/sessions.d.ts +22 -0
- package/dist/routes/skills.d.ts +15 -0
- package/dist/routes/skills.js +1 -1
- package/dist/routes/sub-agents.d.ts +11 -0
- package/dist/routes/sub-agents.js +1 -1
- package/dist/routes/task-context.d.ts +5 -0
- package/dist/routes/tech-stack.d.ts +4 -0
- package/dist/routes/terminal.d.ts +131 -0
- package/dist/routes/terminal.js +25 -25
- package/dist/routes/workspace-index.d.ts +12 -0
- package/dist/routes/workspace-index.js +2 -0
- package/dist/routes/yml.d.ts +4 -0
- package/dist/scripts/migrate-user-scopes.d.ts +26 -0
- package/dist/scripts/migrate-user-scopes.js +2 -0
- package/dist/services/access-control.d.ts +21 -0
- package/dist/services/acode-bg-manager.d.ts +21 -0
- package/dist/services/acode-package.d.ts +10 -0
- package/dist/services/acode-package.js +1 -1
- package/dist/services/agent-capability-sync.d.ts +26 -0
- package/dist/services/agent-capability-sync.js +1 -1
- package/dist/services/agent-event-store.d.ts +20 -0
- package/dist/services/agent-ownership.d.ts +58 -0
- package/dist/services/agent-ownership.js +3 -0
- package/dist/services/agent-process-manager.d.ts +154 -0
- package/dist/services/agent-pty-manager.d.ts +37 -0
- package/dist/services/agent-startup-memory.d.ts +34 -0
- package/dist/services/agent-startup-memory.js +1 -1
- package/dist/services/ai-config-service.d.ts +26 -52
- package/dist/services/ai-config-service.js +1 -3
- package/dist/services/ai-source-apply.d.ts +7 -15
- package/dist/services/ai-source-apply.js +1 -1
- package/dist/services/auto-register.d.ts +165 -1
- package/dist/services/auto-register.js +1 -1
- package/dist/services/aws-client-agent-mcp.d.ts +14 -0
- package/dist/services/aws-client-agent-mcp.js +2 -2
- package/dist/services/bridge-package-publish-hooks.d.ts +14 -0
- package/dist/services/bridge-pairing.d.ts +82 -0
- package/dist/services/bridge-pairing.js +2 -0
- package/dist/services/bridge-temp-files.d.ts +29 -0
- package/dist/services/browser-session-manager.d.ts +71 -0
- package/dist/services/capability-config.d.ts +60 -15
- package/dist/services/capability-config.js +2 -2
- package/dist/services/change-cache-retention.d.ts +9 -0
- package/dist/services/changelog.d.ts +9 -0
- package/dist/services/cli-commands.d.ts +82 -0
- package/dist/services/cli-commands.js +6 -6
- package/dist/services/connection-key-rotation.d.ts +27 -0
- package/dist/services/connection-key-rotation.js +2 -0
- package/dist/services/debug-mount.d.ts +49 -0
- package/dist/services/desktop-mcp-manager.d.ts +103 -1
- package/dist/services/desktop-mcp-manager.js +1 -1
- package/dist/services/event-delta-pusher.d.ts +15 -0
- package/dist/services/fileSnapshotStore.d.ts +33 -0
- package/dist/services/gitignore.d.ts +9 -0
- package/dist/services/instance-ai-config-service.d.ts +9 -0
- package/dist/services/instance-ai-config-service.js +1 -1
- package/dist/services/instance-features.d.ts +127 -0
- package/dist/services/instance-features.js +1 -1
- package/dist/services/instance-init-service.d.ts +3 -0
- package/dist/services/instance-init-service.js +1 -1
- package/dist/services/instance-state.d.ts +23 -0
- package/dist/services/jdk-scanner.d.ts +15 -0
- package/dist/services/launch-manager.d.ts +138 -0
- package/dist/services/launch-metrics.d.ts +42 -0
- package/dist/services/launch-streams.d.ts +19 -0
- package/dist/services/lifecycle-state.d.ts +5 -0
- package/dist/services/log-retention.d.ts +38 -0
- package/dist/services/lsp/install-manager.d.ts +55 -0
- package/dist/services/lsp/install-manager.js +2 -0
- package/dist/services/lsp/provider-registry.d.ts +108 -0
- package/dist/services/lsp/provider-registry.js +2 -0
- package/dist/services/lsp/uri-rewrite.d.ts +44 -0
- package/dist/services/lsp/uri-rewrite.js +2 -0
- package/dist/services/lsp-stdio-bridge.d.ts +41 -4
- package/dist/services/lsp-stdio-bridge.js +3 -3
- package/dist/services/mcp-deploy.d.ts +45 -4
- package/dist/services/mcp-deploy.js +4 -4
- package/dist/services/mcp-env-injector.d.ts +52 -0
- package/dist/services/mcp-launch-binding-queue.d.ts +12 -0
- package/dist/services/mcp-package.d.ts +22 -0
- package/dist/services/mcp-package.js +1 -1
- package/dist/services/mcp-probe-client.d.ts +19 -0
- package/dist/services/mcp-probe-client.js +1 -1
- package/dist/services/open-doc-events.d.ts +22 -0
- package/dist/services/open-doc-registry.d.ts +35 -0
- package/dist/services/orphan-monitor.d.ts +43 -0
- package/dist/services/panel-auth.d.ts +24 -0
- package/dist/services/panel-env.d.ts +28 -0
- package/dist/services/plugin-deployment.d.ts +34 -1
- package/dist/services/plugin-deployment.js +2 -2
- package/dist/services/plugin-event-buffer.d.ts +21 -0
- package/dist/services/plugin-fs.d.ts +11 -0
- package/dist/services/plugin-handler-adapter.d.ts +13 -0
- package/dist/services/plugin-listener-runner.d.ts +10 -0
- package/dist/services/plugin-loader.d.ts +15 -0
- package/dist/services/plugin-manager.d.ts +95 -9
- package/dist/services/plugin-manager.js +4 -4
- package/dist/services/plugin-manifest.d.ts +14 -0
- package/dist/services/plugin-package.d.ts +13 -0
- package/dist/services/plugin-runtime.d.ts +15 -0
- package/dist/services/port-detector.d.ts +15 -0
- package/dist/services/process-detail.d.ts +3 -0
- package/dist/services/process-detector.d.ts +132 -0
- package/dist/services/process-registry.d.ts +120 -0
- package/dist/services/process-top.d.ts +6 -0
- package/dist/services/request-identity.d.ts +77 -0
- package/dist/services/request-identity.js +2 -0
- package/dist/services/request-invalid-dump.d.ts +4 -0
- package/dist/services/ring-buffer.d.ts +33 -0
- package/dist/services/runtime-binding.d.ts +56 -4
- package/dist/services/runtime-binding.js +4 -4
- package/dist/services/runtime-lifecycle-policy.d.ts +17 -0
- package/dist/services/runtime-resources-snapshot.d.ts +26 -0
- package/dist/services/sdk-tool-file-change-recorder.d.ts +9 -0
- package/dist/services/session-output.d.ts +63 -0
- package/dist/services/session-output.js +3 -3
- package/dist/services/skill-manager.d.ts +42 -5
- package/dist/services/skill-manager.js +3 -3
- package/dist/services/snapshot-retention.d.ts +23 -0
- package/dist/services/startup-config-wizard.d.ts +7 -1
- package/dist/services/startup-config-wizard.js +10 -10
- package/dist/services/system-metrics.d.ts +3 -0
- package/dist/services/tech-stack-scanner.d.ts +12 -0
- package/dist/services/terminal-persistence.d.ts +43 -0
- package/dist/services/tool-installer.d.ts +12 -0
- package/dist/services/tunnel-client.d.ts +57 -2
- package/dist/services/tunnel-client.js +1 -1
- package/dist/services/update-log.d.ts +6 -0
- package/dist/services/update-notifier.d.ts +17 -0
- package/dist/services/update-notifier.js +2 -2
- package/dist/services/user-scope.d.ts +115 -0
- package/dist/services/user-scope.js +2 -0
- package/dist/services/windows-service-manager.d.ts +12 -0
- package/dist/services/workspace-files.d.ts +64 -0
- package/dist/services/workspace-index/index-manager.d.ts +46 -0
- package/dist/services/workspace-index/index-manager.js +2 -0
- package/dist/services/workspace-index/indexer.d.ts +15 -0
- package/dist/services/workspace-index/indexer.js +2 -0
- package/dist/services/workspace-index/query.d.ts +74 -0
- package/dist/services/workspace-index/query.js +5 -0
- package/dist/services/workspace-index/resolver.d.ts +26 -0
- package/dist/services/workspace-index/resolver.js +2 -0
- package/dist/services/workspace-index/types.d.ts +89 -0
- package/dist/services/workspace-index/types.js +2 -0
- package/dist/services/workspace-watch.d.ts +4 -0
- package/dist/services/workspaceTaskChangeWatcher.d.ts +49 -0
- package/dist/services/workspaceTaskChangeWatcher.js +1 -1
- package/dist/types.d.ts +9 -0
- package/dist/utils/config-write-queue.d.ts +11 -0
- package/dist/utils/env-safety.d.ts +21 -0
- package/dist/utils/file-utils.d.ts +15 -0
- package/dist/utils/instance-ai-config-debug-logger.d.ts +15 -0
- package/dist/utils/lifecycle-log.d.ts +5 -0
- package/dist/utils/logger.d.ts +13 -0
- package/dist/utils/logger.js +2 -1
- package/dist/utils/npm-version.d.ts +10 -0
- package/dist/utils/path-utils.d.ts +12 -0
- package/dist/utils/scheduler-url.d.ts +18 -0
- package/dist/utils/scheduler-url.js +2 -0
- package/dist/utils/sdk-package-loader.d.ts +13 -0
- package/dist/utils/sdk-package-loader.js +1 -1
- package/dist/utils/target-identity.d.ts +31 -0
- package/dist/utils/target-identity.js +2 -0
- package/dist/utils/validation.d.ts +17 -0
- package/dist/utils/yaml-utils.d.ts +48 -0
- package/package/acode/dist/__tests__/summary-request-helper.d.ts +10 -0
- package/package/acode/dist/ask-user-question-tool.d.ts +17 -0
- package/package/acode/dist/await-complete-tool.d.ts +12 -0
- package/package/acode/dist/background-command-manager.d.ts +105 -0
- package/package/acode/dist/background-command-store.d.ts +27 -0
- package/package/acode/dist/background-command-tools.d.ts +8 -0
- package/package/acode/dist/background-output-ringbuffer.d.ts +15 -0
- package/package/acode/dist/built-in-file-tools.d.ts +65 -0
- package/package/acode/dist/built-in-symbols-tool.d.ts +3 -0
- package/package/acode/dist/builtins/commandArtifacts.d.ts +3 -0
- package/package/acode/dist/builtins/shellCommandPreparation.d.ts +17 -0
- package/package/acode/dist/builtins/shellCommandRunner.d.ts +4 -0
- package/package/acode/dist/builtins/shellOutputDecoder.d.ts +15 -0
- package/package/acode/dist/cache-control.d.ts +45 -0
- package/package/acode/dist/commands/commandLoader.d.ts +3 -0
- package/package/acode/dist/commands/commandParser.d.ts +3 -0
- package/package/acode/dist/commands/commandRegistry.d.ts +3 -0
- package/package/acode/dist/compaction.d.ts +354 -0
- package/package/acode/dist/config.d.ts +3 -0
- package/package/acode/dist/context-overflow.d.ts +32 -0
- package/package/acode/dist/fs-utils.d.ts +18 -0
- package/package/acode/dist/hooks/hookBus.d.ts +3 -0
- package/package/acode/dist/image-utils.d.ts +35 -0
- package/package/acode/dist/index.d.ts +1 -0
- package/package/acode/dist/index.js +1 -1
- package/package/acode/dist/mcpToolNames.d.ts +32 -0
- package/package/acode/dist/microcompact.d.ts +53 -0
- package/package/acode/dist/parsers/ast-cache.d.ts +41 -0
- package/package/acode/dist/parsers/file-index.d.ts +83 -0
- package/package/acode/dist/parsers/file-index.js +4 -0
- package/package/acode/dist/parsers/language-detector.d.ts +4 -0
- package/package/acode/dist/parsers/tree-sitter-loader.d.ts +12 -0
- package/package/acode/dist/parsers/types.d.ts +11 -0
- package/package/acode/dist/paths.d.ts +14 -0
- package/package/acode/dist/plugin-types.d.ts +34 -0
- package/package/acode/dist/read-file-state.d.ts +15 -0
- package/package/acode/dist/runtime-environment.d.ts +16 -0
- package/package/acode/dist/runtime.d.ts +824 -9
- package/package/acode/dist/runtime.js +22 -22
- package/package/acode/dist/skill-tool.d.ts +20 -0
- package/package/acode/dist/sub-agent-manager.d.ts +169 -0
- package/package/acode/dist/sub-agent-manager.js +1 -1
- package/package/acode/dist/sub-agent-store.d.ts +50 -0
- package/package/acode/dist/sub-agent-tools.d.ts +15 -0
- package/package/acode/dist/sub-agent-types.d.ts +13 -0
- package/package/acode/dist/terminal-tool.d.ts +15 -0
- package/package/acode/dist/terminal-types.d.ts +10 -0
- package/package/acode/dist/todo-store.d.ts +15 -0
- package/package/acode/dist/token-estimator.d.ts +17 -0
- package/package/acode/dist/tool-allocation.d.ts +113 -0
- package/package/acode/dist/tool-concurrency/index.d.ts +8 -0
- package/package/acode/dist/tool-concurrency/observability.d.ts +32 -0
- package/package/acode/dist/tool-concurrency/resource-lock.d.ts +30 -0
- package/package/acode/dist/tool-concurrency/scheduler.d.ts +19 -0
- package/package/acode/dist/tool-concurrency/types.d.ts +57 -0
- package/package/acode/dist/tool-group-manager.d.ts +195 -0
- package/package/acode/dist/tool-group-manager.js +4 -4
- package/package/acode/dist/types.d.ts +194 -0
- package/package/aws-client-agent-mcp/README.md +130 -215
- package/package/aws-client-agent-mcp/dist/ability-market-tools.d.ts +57 -0
- package/package/aws-client-agent-mcp/dist/agent-client.d.ts +277 -3
- package/package/aws-client-agent-mcp/dist/agent-client.js +1 -1
- package/package/aws-client-agent-mcp/dist/config.d.ts +18 -0
- package/package/aws-client-agent-mcp/dist/constants.d.ts +2 -0
- package/package/aws-client-agent-mcp/dist/context-manager.d.ts +70 -0
- package/package/aws-client-agent-mcp/dist/http-client.d.ts +61 -0
- package/package/aws-client-agent-mcp/dist/index.d.ts +10 -0
- package/package/aws-client-agent-mcp/dist/logger.d.ts +24 -0
- package/package/aws-client-agent-mcp/dist/mcp-server.d.ts +606 -1
- package/package/aws-client-agent-mcp/dist/mcp-server.js +4 -4
- package/package/aws-client-agent-mcp/dist/mcp-tools.d.ts +158 -0
- package/package/aws-client-agent-mcp/dist/mcp-tools.js +38 -22
- package/package/aws-client-agent-mcp/dist/memory-store.d.ts +81 -0
- package/package/aws-client-agent-mcp/dist/memory-tools.d.ts +18 -0
- package/package/aws-client-agent-mcp/dist/message-buffer.d.ts +86 -0
- package/package/aws-client-agent-mcp/dist/messageContent.d.ts +24 -0
- package/package/aws-client-agent-mcp/dist/office/office-equation.d.ts +19 -0
- package/package/aws-client-agent-mcp/dist/office/office-image.d.ts +18 -0
- package/package/aws-client-agent-mcp/dist/office/office-workspace.d.ts +29 -0
- package/package/aws-client-agent-mcp/dist/parent-lifecycle.d.ts +18 -0
- package/package/aws-client-agent-mcp/dist/runtime-launch-binding.d.ts +6 -0
- package/package/aws-client-agent-mcp/dist/server-memory-store.d.ts +4 -0
- package/package/aws-client-agent-mcp/dist/status-reporter.d.ts +41 -0
- package/package/aws-client-agent-mcp/dist/tool-groups.d.ts +136 -0
- package/package/aws-client-agent-mcp/dist/types.d.ts +123 -0
- package/package/aws-client-agent-mcp/dist/watchdog.d.ts +7 -0
- package/package/aws-client-agent-mcp/dist/websocket-client.d.ts +108 -0
- package/package.json +1 -1
|
@@ -4,10 +4,30 @@ export declare function isStdioMcpSpec(spec: unknown): boolean;
|
|
|
4
4
|
export declare const MCP_PACKAGE_DIR_PLACEHOLDER = "${MCP_PACKAGE_DIR}";
|
|
5
5
|
export declare const MCP_NODE_PLACEHOLDER = "${MCP_NODE}";
|
|
6
6
|
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
7
17
|
export declare function expandMcpPackagePlaceholders(record: Record<string, unknown>, packageDir?: string, nodePath?: string): boolean;
|
|
8
18
|
|
|
9
19
|
export declare function isBuiltinMcpName(name: string): boolean;
|
|
10
20
|
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
11
31
|
export declare const AGENT_META_ENV_KEYS: {
|
|
12
32
|
readonly agentId: "AWS_AGENT_ID";
|
|
13
33
|
readonly roleId: "AWS_AGENT_ROLE_ID";
|
|
@@ -21,16 +41,48 @@ export interface AgentMetaEnvInput {
|
|
|
21
41
|
projectId?: string;
|
|
22
42
|
}
|
|
23
43
|
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
24
47
|
export declare function buildAgentMetaEnv(meta: AgentMetaEnvInput | undefined): Record<string, string>;
|
|
25
48
|
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
26
55
|
export declare function expandEnvPlaceholders(text: string, env: Record<string, string>): string;
|
|
27
56
|
export interface InjectEnvOptions {
|
|
28
57
|
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
29
61
|
overwriteExisting?: boolean;
|
|
30
62
|
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
31
67
|
resolvePackageDir?: (name: string) => string | undefined;
|
|
32
68
|
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
33
73
|
agentMeta?: AgentMetaEnvInput;
|
|
34
74
|
}
|
|
35
75
|
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
36
88
|
export declare function injectEffectiveEnvIntoMcpServers(servers: Record<string, unknown>, effectiveEnv: Record<string, string>, options?: InjectEnvOptions): string[];
|
|
@@ -32,17 +32,29 @@ export declare function enqueueMcpLaunchBinding(input: McpLaunchBindingInput): M
|
|
|
32
32
|
export declare function claimMcpLaunchBinding(request: McpLaunchBindingClaimRequest): ClaimedMcpLaunchBinding | null;
|
|
33
33
|
export declare function getMcpLaunchQueueSize(workspacePath: unknown): number;
|
|
34
34
|
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
35
38
|
export declare function removeMcpLaunchBinding(bindingId: string): boolean;
|
|
36
39
|
export declare function clearMcpLaunchBindingQueues(): void;
|
|
37
40
|
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
38
44
|
export declare function getLatestAgentToken(agentId: string): {
|
|
39
45
|
runtimeAccessToken: string;
|
|
40
46
|
} | null;
|
|
41
47
|
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
42
51
|
export declare function getLatestAgentTokenEntry(agentId: string): {
|
|
43
52
|
runtimeAccessToken: string;
|
|
44
53
|
schedulerBaseUrl?: string;
|
|
45
54
|
updatedAt: number;
|
|
46
55
|
} | null;
|
|
47
56
|
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
48
60
|
export declare function updateLatestAgentToken(agentId: string, runtimeAccessToken: string, schedulerBaseUrl?: string): void;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
2
13
|
export interface McpPackageManifestEnvField {
|
|
3
14
|
key: string;
|
|
4
15
|
required?: boolean;
|
|
@@ -17,9 +28,14 @@ export interface McpPackageManifest {
|
|
|
17
28
|
install?: string;
|
|
18
29
|
description?: string;
|
|
19
30
|
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
20
34
|
env?: McpPackageManifestEnvField[];
|
|
21
35
|
}
|
|
22
36
|
|
|
37
|
+
|
|
38
|
+
|
|
23
39
|
export declare function validateMcpPackageManifest(raw: unknown): McpPackageManifest;
|
|
24
40
|
|
|
25
41
|
export declare function readMcpPackageManifest(packageDir: string): McpPackageManifest;
|
|
@@ -30,6 +46,12 @@ export interface McpPackageExtractResult {
|
|
|
30
46
|
manifest: McpPackageManifest;
|
|
31
47
|
}
|
|
32
48
|
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
33
52
|
export declare function extractMcpPackageZip(zipBuffer: Buffer, stagingRoot: string): Promise<McpPackageExtractResult>;
|
|
34
53
|
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
35
57
|
export declare function runMcpPackageInstall(packageDir: string, manifest: McpPackageManifest): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{spawn as l}from"node:child_process";import{existsSync as E,readFileSync as g}from"node:fs";import h from"node:path";import{
|
|
1
|
+
import{spawn as l}from"node:child_process";import{existsSync as E,readFileSync as g}from"node:fs";import h from"node:path";import{BLOCKED_ENV_KEYS as S,ENV_KEY_PATTERN as w}from"../utils/env-safety.js";import{createLogger as y}from"../utils/logger.js";import{extractPluginZip as T}from"./plugin-package.js";const A=y("mcp-package"),$=new Set(["node","python","binary"]),M=new Set(["bundled","npm"]),d="mcp.json",N=/^[A-Za-z0-9_./@+-]+$/,a=/^(npm|pnpm|yarn)\s+(ci|install)(\s+[A-Za-z0-9@._/:=+-]+)*$/,u=5*60*1e3,P=64*1024;function f(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function _(n){if(n==null)return;if(!Array.isArray(n))throw new Error("mcp.json \u7684 env \u975E\u6CD5\uFF08\u987B\u4E3A\u6570\u7EC4\uFF09");if(n.length===0)return;if(n.length>64)throw new Error("mcp.json \u7684 env \u6700\u591A\u58F0\u660E 64 \u9879");const i=new Set,e=[];for(const r of n){if(!f(r))throw new Error("mcp.json \u7684 env \u5143\u7D20\u975E\u6CD5\uFF08\u987B\u4E3A\u5BF9\u8C61\uFF09");const t=String(r.key??"").trim();if(!t)throw new Error("mcp.json \u7684 env \u5143\u7D20\u7F3A\u5C11 key");if(!w.test(t))throw new Error(`mcp.json \u7684 env \u53D8\u91CF\u540D\u975E\u6CD5: ${t}`);if(S.has(t.toUpperCase()))throw new Error(`mcp.json \u58F0\u660E\u4E86\u7981\u6B62\u7684\u5371\u9669\u73AF\u5883\u53D8\u91CF: ${t}`);if(i.has(t))throw new Error(`mcp.json \u7684 env \u91CD\u590D\u58F0\u660E: ${t}`);i.add(t),e.push({key:t,required:r.required===!0,sensitive:r.sensitive===!0,description:r.description!==void 0?String(r.description):void 0,example:r.example!==void 0?String(r.example):void 0})}return e}function v(n){if(!f(n))throw new Error("mcp.json \u5FC5\u987B\u662F JSON \u5BF9\u8C61");const i=String(n.runtime??"").trim().toLowerCase();if(!$.has(i))throw new Error(`mcp.json \u7684 runtime \u975E\u6CD5\uFF08\u4EC5 node/python/binary\uFF09: ${String(n.runtime)}`);const e=String(n.entry??"").trim();if(!e||!N.test(e)||e.startsWith("/")||/^[A-Za-z]:/.test(e)||e.split(/[\\/]/).includes(".."))throw new Error(`mcp.json \u7684 entry \u975E\u6CD5\uFF08\u987B\u4E3A\u5305\u5185\u76F8\u5BF9\u8DEF\u5F84\uFF09: ${e}`);const r=String(n.dependencies??"bundled").trim().toLowerCase()||"bundled";if(!M.has(r))throw new Error(`mcp.json \u7684 dependencies \u975E\u6CD5\uFF08\u4EC5 bundled/npm\uFF09: ${r}`);let t;if(r==="npm"&&(t=String(n.install??"").trim(),!t||!a.test(t)))throw new Error(`dependencies=npm \u65F6\u5FC5\u987B\u58F0\u660E\u5408\u6CD5\u7684 install \u547D\u4EE4\uFF08\u4EC5 npm/pnpm/yarn \u7684 install/ci\uFF09: ${t}`);const o=Array.isArray(n.args)?n.args.filter(s=>s!=null).map(String):void 0;return{name:n.name!==void 0?String(n.name):void 0,version:n.version!==void 0?String(n.version):void 0,runtime:i,entry:e,args:o,dependencies:r,install:t,description:n.description!==void 0?String(n.description):void 0,env:_(n.env)}}function j(n){const i=h.join(n,d);if(!E(i))throw new Error(`MCP \u5305\u5185\u7F3A\u5C11 ${d}\uFF08\u5305\u578B MCP \u5FC5\u987B\u81EA\u63CF\u8FF0 runtime/entry\uFF09`);let e;try{e=JSON.parse(g(i,"utf8"))}catch(r){throw new Error(`MCP \u5305\u5185 ${d} \u89E3\u6790\u5931\u8D25: ${r instanceof Error?r.message:String(r)}`)}return v(e)}async function O(n,i){const{pluginDir:e,fileCount:r}=await T(n,i),t=j(e);return{packageDir:e,fileCount:r,manifest:t}}async function R(n,i){if(i.dependencies!=="npm")return;const e=String(i.install??"").trim();if(!a.test(e))throw new Error(`\u62D2\u7EDD\u6267\u884C\u975E\u767D\u540D\u5355\u5B89\u88C5\u547D\u4EE4: ${e}`);await new Promise((r,t)=>{A.info("[mcp-package] \u6267\u884C\u4F9D\u8D56\u5B89\u88C5: %s (cwd=%s)",e,n);const o=l(e,{cwd:n,shell:!0,windowsHide:!0});let s="";const p=c=>{s.length<P&&(s+=c.toString("utf8"))};o.stdout?.on("data",p),o.stderr?.on("data",p);const m=setTimeout(()=>{o.kill(),t(new Error(`\u4F9D\u8D56\u5B89\u88C5\u8D85\u65F6\uFF08${u}ms\uFF09: ${e}`))},u);o.on("error",c=>{clearTimeout(m),t(new Error(`\u4F9D\u8D56\u5B89\u88C5\u8FDB\u7A0B\u542F\u52A8\u5931\u8D25: ${c.message}`))}),o.on("close",c=>{if(clearTimeout(m),c!==0){t(new Error(`\u4F9D\u8D56\u5B89\u88C5\u5931\u8D25\uFF08\u9000\u51FA\u7801 ${c}\uFF09: ${s.trim().slice(0,600)||"(\u65E0\u8F93\u51FA)"}`));return}r()})})}export{O as extractMcpPackageZip,j as readMcpPackageManifest,R as runMcpPackageInstall,v as validateMcpPackageManifest};
|
|
2
2
|
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
2
14
|
import { type AgentMetaEnvInput } from "./mcp-env-injector.js";
|
|
3
15
|
export interface McpProbeTool {
|
|
4
16
|
name: string;
|
|
@@ -15,6 +27,8 @@ export interface McpProbeResult {
|
|
|
15
27
|
}
|
|
16
28
|
export interface McpProbeOptions {
|
|
17
29
|
|
|
30
|
+
scope?: import("./user-scope.js").UserScope;
|
|
31
|
+
|
|
18
32
|
effectiveEnv?: Record<string, string>;
|
|
19
33
|
|
|
20
34
|
agentMeta?: AgentMetaEnvInput;
|
|
@@ -22,4 +36,9 @@ export interface McpProbeOptions {
|
|
|
22
36
|
listToolsTimeoutMs?: number;
|
|
23
37
|
}
|
|
24
38
|
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
25
44
|
export declare function probeDeployedMcp(name: string, options?: McpProbeOptions): Promise<McpProbeResult>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Client as
|
|
1
|
+
import{Client as k}from"@modelcontextprotocol/sdk/client/index.js";import{SSEClientTransport as _}from"@modelcontextprotocol/sdk/client/sse.js";import{StdioClientTransport as b}from"@modelcontextprotocol/sdk/client/stdio.js";import{StreamableHTTPClientTransport as v}from"@modelcontextprotocol/sdk/client/streamableHttp.js";import{sanitizeEnvForChild as T}from"../utils/env-safety.js";import{createLogger as y}from"../utils/logger.js";import{McpDeployManager as S}from"./mcp-deploy.js";import{buildAgentMetaEnv as $,expandEnvPlaceholders as u,expandMcpPackagePlaceholders as L,isBuiltinMcpName as O}from"./mcp-env-injector.js";const D=y("mcp-probe"),U=1e4,I=1e4;async function B(r,t={}){const e=String(r??"").trim();if(!e)return{ok:!1,name:e,tools:[],error:"name is required"};if(!/^[a-zA-Z0-9_.-]+$/.test(e))return{ok:!1,name:e,tools:[],error:`MCP \u540D\u975E\u6CD5: ${e}`};if(O(e))return{ok:!1,name:e,tools:[],error:`\u300C${e}\u300D\u662F\u5185\u7F6E\u901A\u8BAF MCP\uFF0C\u4E0D\u63A5\u53D7\u63A2\u6D4B`};const c=t.scope?S.forScope(t.scope).getSpec(e):null;if(!c&&!t.scope)return{ok:!1,name:e,tools:[],error:`\u672A\u5728\u90E8\u7F72\u533A\u627E\u5230\u8BE5 MCP: ${e}\uFF08\u7F3A\u7528\u6237\u4F5C\u7528\u57DF\uFF09`};if(!c)return{ok:!1,name:e,tools:[],error:`\u672A\u5728\u90E8\u7F72\u533A\u627E\u5230\u8BE5 MCP: ${e}\uFF08\u8BF7\u5148\u5B89\u88C5/\u90E8\u7F72\uFF09`};const s=t.connectTimeoutMs??U,i=t.listToolsTimeoutMs??I,n=new k({name:"aws-runtime-bridge-probe",version:"1.0.0"});try{const a=q(c,t.effectiveEnv??{},e,t.agentMeta,t.scope);await w(n.connect(a),s,`MCP initialize timeout after ${s}ms`);const{tools:m}=await w(n.listTools(),i,`MCP listTools timeout after ${i}ms`),l=n.getInstructions();return{ok:!0,name:e,tools:(m??[]).map(o=>({name:o.name,...o.description?{description:o.description}:{},...o.inputSchema?{inputSchema:o.inputSchema}:{}})),...l?{instructions:l}:{}}}catch(a){const m=a instanceof Error?a.message:String(a);return D.warn(`[mcp] \u63A2\u6D4B\u5931\u8D25: ${e}: ${m}`),{ok:!1,name:e,tools:[],error:m}}finally{try{await n.close()}catch{}}}function q(r,t,e,c,s){const i=String(r.type??"stdio").toLowerCase();if(i==="stdio"||r.command){if(!r.command)throw new Error("stdio MCP server requires command");const o=T(t),d=T(r.env??{}),f={...o,...d,...$(c)},p=s?S.forScope(s):null,E=p&&e&&p.isPackageHealthy(e)?p.packageDir(e):void 0,g={command:r.command,args:r.args??[]};L(g,E);const h=u(String(g.command),f),C=g.args.map(P=>u(String(P),f)),M=new b({command:h,args:C,env:f,stderr:"pipe"});return M.stderr?.on("data",()=>{}),M}if(!r.url)throw new Error("remote MCP server requires url");const n=T(t),a=u(r.url,n),m=r.headers?Object.fromEntries(Object.entries(r.headers).map(([o,d])=>[o,u(String(d),n)])):void 0,l=m?{headers:m}:void 0;return i==="sse"?new _(new URL(a),{requestInit:l}):new v(new URL(a),{requestInit:l})}function w(r,t,e){return new Promise((c,s)=>{const i=setTimeout(()=>s(new Error(e)),t);r.then(n=>{clearTimeout(i),c(n)},n=>{clearTimeout(i),s(n instanceof Error?n:new Error(String(n)))})})}export{B as probeDeployedMcp};
|
|
2
2
|
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
2
12
|
import type { OpenDocKind } from "./open-doc-registry.js";
|
|
3
13
|
|
|
4
14
|
export type OpenDocEvent = {
|
|
@@ -16,6 +26,18 @@ export type OpenDocEvent = {
|
|
|
16
26
|
docId: string;
|
|
17
27
|
};
|
|
18
28
|
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
19
34
|
export declare function normalizeSemanticToolName(raw: string | undefined): string;
|
|
20
35
|
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
21
43
|
export declare function resolveOpenDocEvent(toolName: string | undefined, args: Record<string, unknown> | undefined, result: unknown): OpenDocEvent | null;
|
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
3
25
|
export type OpenDocKind = "pencil" | "draw" | "office";
|
|
4
26
|
|
|
5
27
|
export interface OpenDocEntry {
|
|
@@ -13,10 +35,23 @@ export interface OpenDocEntry {
|
|
|
13
35
|
detail?: string;
|
|
14
36
|
}
|
|
15
37
|
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
16
43
|
export declare function recordOpenDocument(agentId: string | undefined, entry: OpenDocEntry): void;
|
|
17
44
|
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
18
48
|
export declare function closeOpenDocument(agentId: string | undefined, kind: OpenDocKind): void;
|
|
19
49
|
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
20
55
|
export declare function removeOpenDocument(agentId: string | undefined, kind: OpenDocKind, docId: string): void;
|
|
21
56
|
|
|
22
57
|
export declare function listOpenDocuments(agentId: string | undefined): OpenDocEntry[];
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
3
9
|
export type OrphanEventType = 'orphan_detected' | 'orphan_cleaned' | 'process_unresponsive' | 'process_high_cpu' | 'process_high_memory' | 'health_check';
|
|
4
10
|
|
|
11
|
+
|
|
12
|
+
|
|
5
13
|
export interface OrphanEvent {
|
|
6
14
|
type: OrphanEventType;
|
|
7
15
|
agentId: string;
|
|
@@ -11,36 +19,65 @@ export interface OrphanEvent {
|
|
|
11
19
|
details?: Record<string, unknown>;
|
|
12
20
|
}
|
|
13
21
|
|
|
22
|
+
|
|
23
|
+
|
|
14
24
|
export declare class OrphanMonitor {
|
|
15
25
|
private intervalId;
|
|
16
26
|
private lastScanTime;
|
|
17
27
|
private eventListeners;
|
|
18
28
|
private stopped;
|
|
19
29
|
|
|
30
|
+
|
|
31
|
+
|
|
20
32
|
start(): Promise<void>;
|
|
21
33
|
|
|
34
|
+
|
|
35
|
+
|
|
22
36
|
stop(): void;
|
|
23
37
|
|
|
38
|
+
|
|
39
|
+
|
|
24
40
|
scan(): Promise<void>;
|
|
25
41
|
|
|
42
|
+
|
|
43
|
+
|
|
26
44
|
private handleOrphanDetected;
|
|
27
45
|
|
|
46
|
+
|
|
47
|
+
|
|
28
48
|
private handleHealthIssue;
|
|
29
49
|
|
|
50
|
+
|
|
51
|
+
|
|
30
52
|
private autoCleanOrphan;
|
|
31
53
|
|
|
54
|
+
|
|
55
|
+
|
|
32
56
|
private cleanupDeadSessions;
|
|
33
57
|
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
34
61
|
private checkAgentExistsOnServer;
|
|
35
62
|
|
|
63
|
+
|
|
64
|
+
|
|
36
65
|
private reportToScheduler;
|
|
37
66
|
|
|
67
|
+
|
|
68
|
+
|
|
38
69
|
onEvent(listener: (event: OrphanEvent) => void): void;
|
|
39
70
|
|
|
71
|
+
|
|
72
|
+
|
|
40
73
|
offEvent(listener: (event: OrphanEvent) => void): void;
|
|
41
74
|
|
|
75
|
+
|
|
76
|
+
|
|
42
77
|
private emit;
|
|
43
78
|
|
|
79
|
+
|
|
80
|
+
|
|
44
81
|
getStatus(): {
|
|
45
82
|
running: boolean;
|
|
46
83
|
lastScanTime: Date | null;
|
|
@@ -48,8 +85,14 @@ export declare class OrphanMonitor {
|
|
|
48
85
|
};
|
|
49
86
|
}
|
|
50
87
|
|
|
88
|
+
|
|
89
|
+
|
|
51
90
|
export declare function getOrphanMonitor(): OrphanMonitor;
|
|
52
91
|
|
|
92
|
+
|
|
93
|
+
|
|
53
94
|
export declare function startOrphanMonitor(): Promise<void>;
|
|
54
95
|
|
|
96
|
+
|
|
97
|
+
|
|
55
98
|
export declare function stopOrphanMonitor(): void;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
3
10
|
export declare function createSession(): string;
|
|
4
11
|
|
|
5
12
|
export declare function validateSession(token: string | undefined | null): boolean;
|
|
@@ -34,11 +41,28 @@ export declare function validateCredentials(username: string, password: string):
|
|
|
34
41
|
|
|
35
42
|
export declare function clearCredentialsCache(): void;
|
|
36
43
|
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
37
48
|
export declare function hasConfiguredCredentials(): boolean;
|
|
38
49
|
|
|
50
|
+
|
|
51
|
+
|
|
39
52
|
export declare function isDefaultCredentials(): boolean;
|
|
40
53
|
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
41
59
|
export declare function setPanelCredentials(username: string, password: string): Promise<void>;
|
|
42
60
|
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
43
67
|
export declare function migrateLegacyPanelCredentials(): Promise<boolean>;
|
|
44
68
|
export {};
|
|
@@ -1,12 +1,40 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
2
21
|
import type { AgentMetaEnvInput } from "./mcp-env-injector.js";
|
|
3
22
|
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
4
26
|
export declare function setPanelEnvVars(agentId: string | undefined, env: unknown): void;
|
|
5
27
|
|
|
6
28
|
export declare function getPanelEnvVars(agentId?: string): Record<string, string>;
|
|
7
29
|
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
8
33
|
export declare function setAgentMeta(agentId: string | undefined, meta: unknown): void;
|
|
9
34
|
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
10
38
|
export declare function getAgentMeta(agentId?: string): AgentMetaEnvInput | undefined;
|
|
11
39
|
|
|
12
40
|
export declare function clearPanelEnvVars(agentId: string | undefined): void;
|
|
@@ -1,19 +1,46 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
2
11
|
import type { PluginLoader } from "./plugin-loader.js";
|
|
3
12
|
import type { SharedPluginEntry } from "./plugin-runtime.js";
|
|
4
13
|
export declare class PluginDeploymentStore {
|
|
5
14
|
private readonly rootDir;
|
|
6
15
|
private readonly runtimeRootDir;
|
|
7
16
|
private readonly loader;
|
|
8
|
-
|
|
17
|
+
|
|
18
|
+
private readonly legacyRootDir?;
|
|
19
|
+
constructor(rootDir: string, runtimeRootDir: string | undefined, loader: PluginLoader,
|
|
20
|
+
|
|
21
|
+
legacyRootDir?: string | undefined);
|
|
9
22
|
deployedDir(): string;
|
|
10
23
|
deployedManifestFile(): string;
|
|
11
24
|
|
|
25
|
+
private legacyDeployedDir;
|
|
26
|
+
private legacyDeployedManifestFile;
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
12
32
|
deployedPluginDir(name: string): string;
|
|
13
33
|
|
|
14
34
|
private legacySharedDir;
|
|
15
35
|
|
|
16
36
|
deployedPluginHealthy(name: string): boolean;
|
|
37
|
+
|
|
38
|
+
private legacyPluginHealthy;
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
resolveDeployedSourceDir(name: string): string | null;
|
|
17
44
|
readSharedManifest(): SharedPluginEntry[];
|
|
18
45
|
writeSharedManifest(entries: SharedPluginEntry[]): void;
|
|
19
46
|
|
|
@@ -21,12 +48,18 @@ export declare class PluginDeploymentStore {
|
|
|
21
48
|
|
|
22
49
|
deployPluginZipToPersistentDir(zipBuffer: Buffer, expectedName?: string): Promise<SharedPluginEntry | null>;
|
|
23
50
|
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
24
54
|
replaceDeployedDir(pluginName: string, sourceDir: string): void;
|
|
25
55
|
|
|
26
56
|
removeDeployedDir(pluginName: string): void;
|
|
27
57
|
|
|
28
58
|
updateSharedManifest(mutator: (entries: SharedPluginEntry[]) => SharedPluginEntry[]): Promise<void>;
|
|
29
59
|
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
30
63
|
runtimeDirFor(agentId: string): string;
|
|
31
64
|
runtimeLinkPath(agentId: string, name: string): string;
|
|
32
65
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{cpSync as S,existsSync as
|
|
2
|
-
`,"utf8")}async migrateLegacySharedIfNeeded(){try{if(
|
|
1
|
+
import{cpSync as S,existsSync as o,lstatSync as P,mkdirSync as h,readFileSync as d,readdirSync as w,renameSync as D,rmSync as u,symlinkSync as M,writeFileSync as N}from"node:fs";import{join as s,resolve as m}from"node:path";import{getBridgeInstancePluginsDir as v}from"../config.js";import{sanitizeAgentId as F,sanitizeArchiveFileName as k,withFileLock as $}from"../utils/file-utils.js";import{createLogger as L}from"../utils/logger.js";import{isValidPluginName as f,PLUGIN_NAME_PATTERN as R}from"./plugin-manifest.js";import{extractPluginZip as A}from"./plugin-package.js";const a=L("plugin-manager"),E=process.platform==="win32"?"junction":"dir";class x{constructor(e,i,r,t){this.rootDir=e,this.runtimeRootDir=i,this.loader=r,this.legacyRootDir=t}deployedDir(){return s(this.rootDir,"deployed")}deployedManifestFile(){return s(this.deployedDir(),"manifest.json")}legacyDeployedDir(){return this.legacyRootDir?s(this.legacyRootDir,"deployed"):""}legacyDeployedManifestFile(){return this.legacyDeployedDir()?s(this.legacyDeployedDir(),"manifest.json"):""}deployedPluginDir(e){if(!f(e))throw new Error(`\u975E\u6CD5\u63D2\u4EF6\u540D\uFF08\u4EC5\u5141\u8BB8 ${R}\uFF09: ${JSON.stringify(e)}`);const i=s(this.deployedDir(),e),r=m(this.deployedDir());if(m(i)!==s(r,e))throw new Error(`\u63D2\u4EF6\u76EE\u5F55\u8D8A\u51FA\u90E8\u7F72\u533A: ${e}`);return i}legacySharedDir(){return s(this.rootDir,"shared")}deployedPluginHealthy(e){return o(s(this.deployedPluginDir(e),"plugin.json"))||this.legacyPluginHealthy(e)}legacyPluginHealthy(e){if(!this.legacyDeployedDir())return!1;try{const i=s(this.legacyDeployedDir(),e);return o(s(i,"plugin.json"))}catch{return!1}}resolveDeployedSourceDir(e){return o(s(this.deployedPluginDir(e),"plugin.json"))?this.deployedPluginDir(e):this.legacyPluginHealthy(e)?s(this.legacyDeployedDir(),e):null}readSharedManifest(){const e=new Map;if(this.legacyDeployedManifestFile())try{const i=JSON.parse(d(this.legacyDeployedManifestFile(),"utf8"));for(const r of Array.isArray(i.plugins)?i.plugins:[])r&&f(r.pluginName)&&e.set(r.pluginName,r)}catch{}try{const i=JSON.parse(d(this.deployedManifestFile(),"utf8"));for(const r of Array.isArray(i.plugins)?i.plugins:[])r&&f(r.pluginName)&&e.set(r.pluginName,r)}catch{}return[...e.values()]}writeSharedManifest(e){h(this.deployedDir(),{recursive:!0}),N(this.deployedManifestFile(),`${JSON.stringify({version:2,plugins:e},null,2)}
|
|
2
|
+
`,"utf8")}async migrateLegacySharedIfNeeded(){try{if(o(this.deployedManifestFile()))return;const e=s(this.legacySharedDir(),"manifest.json");if(!o(e))return;const i=JSON.parse(d(e,"utf8")),r=Array.isArray(i.plugins)?i.plugins:[];if(r.length===0)return;const t=[];let n=0,l=0;for(const y of r){const g=k(y.zipFile,"");if(!y.pluginName||!g)continue;const p=s(this.legacySharedDir(),g);if(o(p)){n+=1;try{const c=await this.deployPluginZipToPersistentDir(d(p),y.pluginName);if(!c){l+=1;continue}t.push(c),a.info("[shared] \u65E7\u5171\u4EAB\u63D2\u4EF6\u8FC1\u79FB\u5230\u90E8\u7F72\u533A: %s",y.pluginName)}catch(c){l+=1,a.warn("[shared] \u65E7\u5171\u4EAB\u63D2\u4EF6 %s \u8FC1\u79FB\u5931\u8D25: %s",y.pluginName,c instanceof Error?c.message:String(c))}}}t.length>0&&this.writeSharedManifest(t),l===0?u(this.legacySharedDir(),{recursive:!0,force:!0}):a.warn("[shared] \u65E7\u5171\u4EAB\u63D2\u4EF6\u8FC1\u79FB\u90E8\u5206\u5931\u8D25\uFF08%d/%d\uFF09\uFF0C\u4FDD\u7559 shared/ \u76EE\u5F55\u4EE5\u514D\u6570\u636E\u4E22\u5931",l,n)}catch(e){a.warn("[shared] \u65E7\u5171\u4EAB\u63D2\u4EF6\u8FC1\u79FB\u672A\u6267\u884C\uFF08\u4E0B\u6B21\u91CD\u8BD5\uFF09: %s",e instanceof Error?e.message:String(e))}}async deployPluginZipToPersistentDir(e,i){if(!e||e.length===0)return null;const r=s(this.rootDir,"tmp",`migrate-${Date.now()}-${Math.random().toString(36).slice(2,8)}`);try{const t=await A(e,r),n=this.loader.loadManifestOnly(t.pluginDir);if(!n.ok)return null;const l=n.manifest.name;return i&&l!==i?null:(this.replaceDeployedDir(l,t.pluginDir),{pluginName:l,zipFile:`${l}.zip`,fileName:`${l}.zip`,defaultEnabled:!0})}finally{u(r,{recursive:!0,force:!0})}}replaceDeployedDir(e,i){h(this.deployedDir(),{recursive:!0});const r=this.deployedPluginDir(e),t=s(this.deployedDir(),`.old-${e}-${Date.now()}-${Math.random().toString(36).slice(2,8)}`);o(r)&&D(r,t);try{S(i,r,{recursive:!0,filter:n=>!/[\\/]\.git([\\/]|$)/.test(n)&&!/[\\/]node_modules([\\/]|$)/.test(n)})}catch(n){throw o(t)&&(u(r,{recursive:!0,force:!0}),D(t,r)),n}o(t)&&u(t,{recursive:!0,force:!0})}removeDeployedDir(e){u(this.deployedPluginDir(e),{recursive:!0,force:!0})}async updateSharedManifest(e){await $(this.deployedManifestFile(),async()=>{this.writeSharedManifest(e(this.readSharedManifest()))})}runtimeDirFor(e){return this.runtimeRootDir?s(this.runtimeRootDir,F(e)):v(e)}runtimeLinkPath(e,i){return s(this.runtimeDirFor(e),i)}ensureRuntimeLink(e,i){const r=this.runtimeLinkPath(e,i),t=this.resolveDeployedSourceDir(i);if(!t)return!1;h(this.runtimeDirFor(e),{recursive:!0});try{if(o(r)){let n=!1;try{n=P(r).isSymbolicLink()}catch{n=!1}if(n)try{return w(r),!0}catch{}u(r,{recursive:!0,force:!0})}return M(t,r,E),a.info("[agent:%s] \u63D2\u4EF6\u8FD0\u884C\u65F6\u94FE\u63A5\u5DF2\u5EFA\u7ACB: %s \u2192 %s",e,r,t),!0}catch(n){return a.warn("[agent:%s] \u63D2\u4EF6\u8FD0\u884C\u65F6\u94FE\u63A5\u5931\u8D25\uFF08%s \u2192 %s\uFF09: %s",e,i,t,n instanceof Error?n.message:String(n)),!1}}removeRuntimeLink(e,i){const r=this.runtimeLinkPath(e,i);try{o(r)&&(u(r,{recursive:!0,force:!0}),a.info("[agent:%s] \u63D2\u4EF6\u8FD0\u884C\u65F6\u94FE\u63A5\u5DF2\u79FB\u9664: %s",e,i))}catch(t){a.warn("[agent:%s] \u63D2\u4EF6\u8FD0\u884C\u65F6\u94FE\u63A5\u79FB\u9664\u5931\u8D25\uFF08%s\uFF09: %s",e,i,t instanceof Error?t.message:String(t))}}}export{x as PluginDeploymentStore};
|
|
3
3
|
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
2
13
|
export type PluginEventPriority = "urgent" | "normal" | "low";
|
|
3
14
|
|
|
4
15
|
export interface PluginEventMessage {
|
|
@@ -39,11 +50,21 @@ export declare class PluginEventBuffer {
|
|
|
39
50
|
constructor(agentId: string);
|
|
40
51
|
get currentRevision(): number;
|
|
41
52
|
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
42
56
|
push(record: PluginEventRecord): boolean;
|
|
43
57
|
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
44
61
|
drain(opts?: PluginEventDrainOptions): PluginEventDrainResult;
|
|
45
62
|
|
|
46
63
|
private dropOldestLowestPriority;
|
|
47
64
|
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
48
69
|
private pruneDedup;
|
|
49
70
|
}
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
2
12
|
import type { PluginInvokeContext, PluginToolInvocationResult, JsonObject } from "@agentswork/acode";
|
|
3
13
|
import type { PluginToolDef } from "./plugin-manifest.js";
|
|
4
14
|
import type { LoadedPlugin } from "./plugin-runtime.js";
|
|
5
15
|
export declare function executeHandler(agentId: string, plugin: LoadedPlugin, tool: PluginToolDef, params: JsonObject, ctx?: PluginInvokeContext): Promise<PluginToolInvocationResult>;
|
|
6
16
|
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
7
20
|
export declare function buildPluginEnv(plugin: LoadedPlugin, agentId: string): NodeJS.ProcessEnv;
|