aws-runtime-bridge 1.9.172 → 1.9.179
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 +314 -0
- package/README.md +61 -2
- package/dist/adapter/AcodeSdkAdapter.d.ts +374 -1
- 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 +184 -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/bridge-temp-files.d.ts +1 -0
- package/dist/routes/bridge-temp-files.js +2 -0
- 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 +2021 -628
- 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 +15 -10
- package/dist/routes/file-browser.js +1 -1
- 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 +185 -0
- package/dist/routes/git.js +34 -34
- 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/sessions.js +1 -1
- 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 +6 -0
- package/dist/routes/tech-stack.js +2 -0
- package/dist/routes/terminal.d.ts +122 -0
- package/dist/routes/terminal.js +22 -22
- 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 +39 -0
- package/dist/services/agent-pty-manager.js +5 -4
- package/dist/services/agent-startup-memory.d.ts +34 -0
- package/dist/services/agent-startup-memory.js +4 -4
- 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 +65 -0
- package/dist/services/bridge-temp-files.js +2 -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 +42 -0
- package/dist/services/fileSnapshotStore.js +1 -1
- package/dist/services/gitignore.d.ts +21 -0
- package/dist/services/gitignore.js +2 -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/log-retention.js +1 -1
- 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 +43 -0
- package/dist/services/open-doc-events.js +2 -0
- package/dist/services/open-doc-registry.d.ts +59 -0
- package/dist/services/open-doc-registry.js +2 -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/request-invalid-dump.js +1 -1
- 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/runtime-resources-snapshot.js +2 -2
- 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 +30 -0
- package/dist/services/snapshot-retention.js +2 -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 +43 -0
- package/dist/services/tech-stack-scanner.js +2 -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 +99 -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 +2 -2
- 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 +12 -0
- package/package/acode/dist/__tests__/summary-request-helper.js +2 -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 +71 -0
- package/package/acode/dist/cache-control.js +2 -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 +388 -4
- package/package/acode/dist/compaction.js +19 -17
- 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 +110 -0
- package/package/acode/dist/microcompact.js +2 -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 +828 -9
- package/package/acode/dist/runtime.js +40 -33
- 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 +32 -0
- package/package/acode/dist/token-estimator.js +2 -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 +192 -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/ability-market-tools.js +1 -1
- package/package/aws-client-agent-mcp/dist/agent-client.d.ts +290 -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 +610 -0
- package/package/aws-client-agent-mcp/dist/mcp-server.js +25 -23
- 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 +102 -2
- package/package/aws-client-agent-mcp/dist/memory-store.js +27 -2
- package/package/aws-client-agent-mcp/dist/memory-tools.d.ts +18 -0
- package/package/aws-client-agent-mcp/dist/memory-tools.js +13 -9
- 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 +5 -1
- package/package/aws-client-agent-mcp/dist/server-memory-store.js +1 -1
- 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 +174 -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
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
2
7
|
import axios from "axios";
|
|
3
8
|
import { type Logger } from "../utils/logger.js";
|
|
4
9
|
export interface BridgePackageInfo {
|
|
@@ -23,11 +28,20 @@ interface NotifyOptions {
|
|
|
23
28
|
post?: typeof axios.post;
|
|
24
29
|
}
|
|
25
30
|
|
|
31
|
+
|
|
32
|
+
|
|
26
33
|
export declare function readBridgePackageInfo(): Promise<BridgePackageInfo>;
|
|
27
34
|
|
|
35
|
+
|
|
36
|
+
|
|
28
37
|
export declare function createBridgePackagePublishPayload(packageInfo: BridgePackageInfo, env?: NodeJS.ProcessEnv, now?: () => Date): BridgePackagePublishPayload;
|
|
29
38
|
|
|
39
|
+
|
|
40
|
+
|
|
30
41
|
export declare function createBridgePublishSignature(body: string, secret: string): string;
|
|
31
42
|
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
32
46
|
export declare function notifyBridgePackagePublished(options?: NotifyOptions): Promise<boolean>;
|
|
33
47
|
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export interface PairBridgeOptions {
|
|
14
|
+
|
|
15
|
+
ticket: string;
|
|
16
|
+
|
|
17
|
+
serverUrl?: string;
|
|
18
|
+
|
|
19
|
+
instanceId?: string;
|
|
20
|
+
|
|
21
|
+
targetIdentity?: string;
|
|
22
|
+
|
|
23
|
+
instanceName?: string;
|
|
24
|
+
|
|
25
|
+
registerAddr?: string;
|
|
26
|
+
|
|
27
|
+
configPath?: string;
|
|
28
|
+
|
|
29
|
+
postPair?: (url: string, body: Record<string, unknown>) => Promise<PairApiResponse>;
|
|
30
|
+
}
|
|
31
|
+
export interface PairApiResponse {
|
|
32
|
+
success: boolean;
|
|
33
|
+
message?: string;
|
|
34
|
+
instanceId?: string;
|
|
35
|
+
machineToken?: string;
|
|
36
|
+
connectionKey?: string;
|
|
37
|
+
serverUrl?: string;
|
|
38
|
+
instanceName?: string;
|
|
39
|
+
credentialType?: string;
|
|
40
|
+
tenantId?: string;
|
|
41
|
+
userId?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface PairBridgeResult {
|
|
44
|
+
success: boolean;
|
|
45
|
+
instanceId?: string;
|
|
46
|
+
serverUrl?: string;
|
|
47
|
+
error?: string;
|
|
48
|
+
}
|
|
49
|
+
interface ResolvedTarget {
|
|
50
|
+
|
|
51
|
+
index: number;
|
|
52
|
+
target: Record<string, unknown>;
|
|
53
|
+
serverUrl: string;
|
|
54
|
+
tunnel: boolean;
|
|
55
|
+
instanceId?: string;
|
|
56
|
+
|
|
57
|
+
connectionKey: string;
|
|
58
|
+
instanceName: string;
|
|
59
|
+
runtimeBridgeBaseUrl: string;
|
|
60
|
+
|
|
61
|
+
isNewTarget: boolean;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
export declare function resolvePairTarget(config: Record<string, unknown>, options: Pick<PairBridgeOptions, "serverUrl" | "instanceName" | "registerAddr" | "instanceId" | "targetIdentity">): ResolvedTarget;
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
export declare function pairBridge(options: PairBridgeOptions): Promise<PairBridgeResult>;
|
|
82
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{randomBytes as N}from"node:crypto";import{existsSync as $,mkdirSync as B,readFileSync as x,writeFileSync as E}from"node:fs";import K from"node:os";import R from"node:path";import A from"axios";import{getActiveBridgeHttpPort as P,getAutoRegisterConfigFilePath as k,schedulerBaseUrl as b}from"../config.js";import{runExclusiveConfigWrite as C}from"../utils/config-write-queue.js";import{logger as F}from"../utils/logger.js";import{normalizeTargetServerUrl as I}from"../utils/target-identity.js";const q="awsp_";function S(t){if(!$(t))return{};try{return JSON.parse(x(t,"utf-8"))}catch(s){throw new Error(`\u65E0\u6CD5\u89E3\u6790\u914D\u7F6E\u6587\u4EF6 ${t}: ${s.message}`)}}function w(t){return Array.isArray(t.autoRegisterTargets)?t.autoRegisterTargets.filter(s=>!!(s&&typeof s=="object"&&!Array.isArray(s))):[]}function O(){return`bridge-${N(6).toString("hex")}`}function _(t,s){return/^https?:\/\//i.test(t)?t:/:[0-9]+$/.test(t)?`http://${t}`:`http://${t}:${s}`}function j(t,s){const o=w(t),h=s.serverUrl?.trim(),e=h?I(h):"",m=String(s.instanceId||"").trim(),v=String(s.targetIdentity||"").trim();let n=-1,c=t,d=!1;if(o.length>0){const g=o.map((a,T)=>({item:a,itemIndex:T})).filter(({item:a})=>!e||I(a.serverUrl||a.schedulerBaseUrl)===e);let u=g;if(m){const a=g.filter(({item:T})=>String(T.instanceId||"").trim()===m);if(a.length>1)throw new Error(`\u5339\u914D\u5230\u591A\u4E2A instanceId=${m} \u7684\u914D\u5BF9\u76EE\u6807\uFF0C\u8BF7\u68C0\u67E5 config.json`);a.length===1?u=a:(u=[],d=!0)}else if(v){if(u=g.filter(({item:a})=>String(a.credentialId||a.userKey||"").trim()===v),u.length>1)throw new Error("\u5339\u914D\u5230\u591A\u4E2A\u914D\u5BF9\u76EE\u6807\uFF0C\u8BF7\u7528 --instance-id \u6216 --target-identity \u7CBE\u786E\u6307\u5B9A");if(u.length===0)throw new Error("\u6307\u5B9A targetIdentity \u7684\u914D\u5BF9\u76EE\u6807\u4E0D\u5B58\u5728")}else if(g.length>1)throw new Error("\u5B58\u5728\u591A\u4E2A\u6CE8\u518C\u76EE\u6807\uFF0C\u8BF7\u7528 --server-url \u642D\u914D --instance-id / --target-identity \u6307\u5B9A\u672C\u6B21\u914D\u5BF9\u76EE\u6807");if(d)n=o.length;else if(n=u[0]?.itemIndex??-1,n<0){if(!e)throw new Error("\u65E0\u6CD5\u786E\u5B9A\u914D\u5BF9\u76EE\u6807\uFF0C\u8BF7\u7528 --server-url \u6307\u5B9A");c={serverUrl:h},n=o.length,d=!0}else c=o[n]||{}}const y=I(h||c.serverUrl||c.schedulerBaseUrl||b);if(!y)throw new Error("\u65E0\u6CD5\u786E\u5B9A\u8C03\u5EA6\u4E2D\u5FC3\u5730\u5740\uFF0C\u8BF7\u7528 --server-url \u6307\u5B9A");const i=s.registerAddr||String(c.registerAddr||c.registerIp||c.virtualIp||"").trim(),l=c.tunnel===!0?!0:c.tunnel===!1?!1:!i;let r=m||String(c.instanceId||"").trim()||void 0,f;if(l){r||(r=O());const g=new URL(y);f=`${g.protocol}//${g.host}/tunnel/${r}`}else f=_(i,P());const p=String(c.connectionKey||"").trim(),U=s.instanceName?.trim()||String(c.instanceName||"").trim()||K.hostname();return{index:n,target:c,serverUrl:y,tunnel:l,instanceId:r,connectionKey:p,instanceName:U,runtimeBridgeBaseUrl:f,isNewTarget:d}}async function M(t,s){return(await A.post(t,s,{headers:{"Content-Type":"application/json"},timeout:15e3})).data}async function V(t){const s=String(t.ticket||"").trim();if(!s.startsWith(q))return{success:!1,error:"\u914D\u5BF9\u7968\u636E\u683C\u5F0F\u4E0D\u6B63\u786E\uFF08\u5E94\u4EE5 awsp_ \u5F00\u5934\uFF09\uFF0C\u8BF7\u4ECE\u7BA1\u7406\u9875\u91CD\u65B0\u590D\u5236"};const o=t.configPath||k(),h=S(o);let e;try{e=j(h,t)}catch(i){return{success:!1,error:i.message}}const m={pairingTicket:s,instanceName:e.instanceName,runtimeBridgeBaseUrl:e.runtimeBridgeBaseUrl};e.instanceId&&(m.instanceId=e.instanceId);const v=t.postPair||M;let n;try{n=await v(`${e.serverUrl}/api/instances/pair`,m)}catch(i){const l=i;return{success:!1,error:l.response?.data?.message||l.message||"\u914D\u5BF9\u8BF7\u6C42\u5931\u8D25"}}if(!n?.success||!n.machineToken||!n.instanceId)return{success:!1,error:n?.message||"\u8C03\u5EA6\u4E2D\u5FC3\u672A\u8FD4\u56DE\u673A\u5668\u51ED\u636E"};const c=String(n.connectionKey||"").trim();if(!c)return{success:!1,error:"\u8C03\u5EA6\u4E2D\u5FC3\u672A\u8FD4\u56DE\u8FDE\u63A5\u5BC6\u94A5\uFF08server \u7248\u672C\u8FC7\u65E7\uFF1F\uFF09\uFF0C\u8BF7\u5347\u7EA7 server \u540E\u91CD\u8BD5"};const d=n.instanceId,y=n.instanceName||e.instanceName;try{await C(o,()=>{const i=S(o),l=w(i);let r;if(Array.isArray(i.autoRegisterTargets)&&l.length>0){const f=l.filter(a=>I(a.serverUrl||a.schedulerBaseUrl)===I(e.serverUrl)),p=String(e.target.userKey||"").trim(),U=e.instanceId?f.filter(a=>String(a.instanceId||"").trim()===e.instanceId):[],g=p?f.filter(a=>String(a.userKey||"").trim()===p):[];if(U.length>1||g.length>1)throw new Error(`\u914D\u5BF9\u5199\u56DE\u5931\u8D25\uFF1A\u5339\u914D\u5230\u591A\u4E2A\u76EE\u6807\uFF08server=${e.serverUrl}\uFF09\uFF0C\u8BF7\u7528 instanceId / target identity \u7CBE\u786E\u6307\u5B9A`);const u=U[0]||g[0]||(f.length===1&&!e.isNewTarget?f[0]:void 0);u?r=u:!e.isNewTarget&&e.index>=0&&l[e.index]?r=l[e.index]:(r={serverUrl:e.serverUrl},l.push(r),i.autoRegisterTargets=l)}else r=i;r.serverUrl=r.serverUrl||e.serverUrl,r.instanceName=r.instanceName||y,r.instanceId=d,r.credentialId=d,delete r.credentialRef,r.credentialType=n.credentialType||"MACHINE_TOKEN",r.machineToken=n.machineToken,r.connectionKey=c,n.tenantId&&(r.tenantId=n.tenantId),n.userId&&(r.userId=n.userId),Array.isArray(i.autoRegisterTargets)&&i.autoRegisterTargets.length>0&&String(i.connectionKey||"").trim()&&delete i.connectionKey,B(R.dirname(o),{recursive:!0}),E(o,JSON.stringify(i,null,2),"utf-8")})}catch(i){return{success:!1,error:i.message}}return F.info(`[Pair] \u914D\u5BF9\u6210\u529F: server=${e.serverUrl}, instanceId=${d}, machineToken \u5DF2\u5199\u5165 ${o}`),{success:!0,instanceId:d,serverUrl:e.serverUrl}}export{V as pairBridge,j as resolvePairTarget};
|
|
2
|
+
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
|
|
2
|
+
export declare const BRIDGE_TEMP_ROOT: string;
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export declare const BRIDGE_TEMP_MAX_BYTES: number;
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export declare function normalizeTempFileExtension(originalName: string): string;
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export declare function decodePossiblyLatin1Utf8FileName(rawName: string): string;
|
|
24
|
+
export interface WriteBridgeTempFileParams {
|
|
25
|
+
|
|
26
|
+
originalName: string;
|
|
27
|
+
|
|
28
|
+
bytes: Buffer;
|
|
29
|
+
|
|
30
|
+
mediaType?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface BridgeTempFileResult {
|
|
33
|
+
|
|
34
|
+
path: string;
|
|
35
|
+
|
|
36
|
+
name: string;
|
|
37
|
+
|
|
38
|
+
mediaType: string;
|
|
39
|
+
|
|
40
|
+
size: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
export declare function writeBridgeTempFile(params: WriteBridgeTempFileParams): Promise<BridgeTempFileResult>;
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
export declare function resolveBridgeTempFilePath(rawPath: string): string | null;
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
export declare function readBridgeTempFile(rawPath: string): Promise<Buffer | null>;
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
export declare function deleteBridgeTempFile(rawPath: string): Promise<boolean>;
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
export declare function guessTempFileMediaType(filePath: string): string;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{randomUUID as m}from"node:crypto";import{promises as a}from"node:fs";import f from"node:os";import n from"node:path";import{createLogger as d}from"../utils/logger.js";const s=d("bridge-temp-files"),p=n.join(f.tmpdir(),"aw-temp","ATT"),u=7,F=Number.POSITIVE_INFINITY;function g(r=new Date){const e=r.getFullYear(),t=String(r.getMonth()+1).padStart(2,"0"),i=String(r.getDate()).padStart(2,"0");return n.join(p,`${e}${t}${i}`)}async function x(){const r=Date.now()-u*24*60*60*1e3;try{const e=await a.readdir(p,{withFileTypes:!0});for(const t of e){if(!t.isDirectory())continue;const i=n.join(p,t.name);try{(await a.stat(i)).mtimeMs<r&&(await a.rm(i,{recursive:!0,force:!0}),s.info(`[bridge-temp-files] removed expired temp dir: ${i}`))}catch{}}}catch(e){const t=e;t.code!=="ENOENT"&&s.warn("[bridge-temp-files] cleanup expired dirs failed:",t)}}function w(r){const e=n.basename(c(r).replace(/\\/g,"/")),t=e.lastIndexOf(".");if(t<=0||t===e.length-1)return"";const o=e.slice(t+1).toLowerCase().replace(/[^a-z0-9]/g,"");return!o||o.length>16?"":`.${o}`}function c(r){const e=String(r||"");if(!/[\u00c0-\u00ff]/.test(e))return e;const t=Buffer.from(e,"latin1").toString("utf8");return!t||t.includes("\uFFFD")?e:t}async function b(r){const e=r.bytes;if(!e||e.length===0)throw new Error("file content is empty");const t=c(r.originalName),i=g();await a.mkdir(i,{recursive:!0});const o=n.join(i,`${m()}${w(t)}`);return await a.writeFile(o,e),x(),s.info(`[bridge-temp-files] wrote temp file: name=${t} path=${o} size=${e.length}`),{path:o.replace(/\\/g,"/"),name:t,mediaType:r.mediaType||"application/octet-stream",size:e.length}}function l(r){const e=String(r||"").trim();if(!e)return null;const t=n.resolve(e),i=n.resolve(p);return t!==i&&!t.startsWith(i+n.sep)?null:t}async function N(r){const e=l(r);if(!e)return null;try{return(await a.stat(e)).isFile()?await a.readFile(e):null}catch(t){const i=t;return i.code!=="ENOENT"&&s.warn("[bridge-temp-files] read temp file failed:",i),null}}async function D(r){const e=l(r);if(!e)return!1;try{return await a.rm(e,{force:!0}),!0}catch(t){return s.warn("[bridge-temp-files] delete temp file failed:",t),!1}}function I(r){const e=n.extname(r).toLowerCase();return{".txt":"text/plain",".md":"text/markdown",".json":"application/json",".csv":"text/csv",".xml":"application/xml",".html":"text/html",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml",".zip":"application/zip",".gz":"application/gzip",".tar":"application/x-tar",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation"}[e]||"application/octet-stream"}export{F as BRIDGE_TEMP_MAX_BYTES,p as BRIDGE_TEMP_ROOT,c as decodePossiblyLatin1Utf8FileName,D as deleteBridgeTempFile,I as guessTempFileMediaType,w as normalizeTempFileExtension,N as readBridgeTempFile,l as resolveBridgeTempFilePath,b as writeBridgeTempFile};
|
|
2
|
+
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
2
13
|
import { type BrowserPool } from "../browser/browser-pool.js";
|
|
3
14
|
import { createBuiltInBrowserTools } from "../browser/built-in-browser-tools.js";
|
|
4
15
|
import type { AddListenerParams, UpdateListenerParams } from "../browser/page-listener-manager.js";
|
|
@@ -13,28 +24,65 @@ interface BrowserSessionManagerState {
|
|
|
13
24
|
wsHost: string;
|
|
14
25
|
}
|
|
15
26
|
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
16
32
|
export declare function startBrowserSessionManager(poolConfig?: Partial<BrowserPoolConfig>, wsConfig?: Partial<WsServerConfig>): Promise<BrowserSessionManagerState>;
|
|
17
33
|
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
18
40
|
export declare function getBrowserWsUrl(agentId: string, browserId?: string): string | null;
|
|
19
41
|
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
20
45
|
export declare function listBrowserWsUrls(agentId: string): Array<{
|
|
21
46
|
browserId: string;
|
|
22
47
|
title: string;
|
|
23
48
|
wsUrl: string;
|
|
24
49
|
}>;
|
|
25
50
|
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
26
54
|
export declare function getBrowserWsPort(): number | null;
|
|
27
55
|
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
28
66
|
export declare function getBrowserTools(agentId: string | undefined, scopeKey?: string, ssrfConfig?: SsrfConfig): Promise<ReturnType<typeof createBuiltInBrowserTools>>;
|
|
29
67
|
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
30
71
|
export declare function closeBrowserSession(agentId: string): Promise<void>;
|
|
31
72
|
|
|
73
|
+
|
|
74
|
+
|
|
32
75
|
export declare function closeBrowserSessionById(agentId: string, browserId?: string): Promise<void>;
|
|
33
76
|
|
|
77
|
+
|
|
78
|
+
|
|
34
79
|
export declare function disposeBrowserSessionManager(): Promise<void>;
|
|
35
80
|
|
|
36
81
|
export declare function isBrowserSessionManagerStarted(): boolean;
|
|
37
82
|
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
38
86
|
export declare function addBrowserListener(agentId: string, browserId: string, params: AddListenerParams): Promise<PageListener>;
|
|
39
87
|
|
|
40
88
|
export declare function updateBrowserListener(agentId: string, browserId: string, listenerId: ListenerId, params: Omit<UpdateListenerParams, "listenerId">): Promise<PageListener | undefined>;
|
|
@@ -45,11 +93,34 @@ export declare function toggleBrowserListener(agentId: string, browserId: string
|
|
|
45
93
|
|
|
46
94
|
export declare function listBrowserListeners(agentId: string, browserId: string): Promise<PageListenerInfo[]>;
|
|
47
95
|
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
48
100
|
export declare function collectAgentListenerEvents(agentId: string): Promise<ListenerTriggerEvent[]>;
|
|
49
101
|
|
|
50
102
|
export declare function registerListenerWakeHook(agentId: string | undefined, fn: () => void): void;
|
|
51
103
|
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
52
108
|
export declare function unregisterListenerWakeHook(agentId: string | undefined, fn?: () => void): void;
|
|
53
109
|
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
54
125
|
export declare function buildListenerInjectionPrompt(events: ListenerTriggerEvent[]): string;
|
|
55
126
|
export {};
|
|
@@ -1,29 +1,74 @@
|
|
|
1
|
-
|
|
1
|
+
import { type CapabilityType, type UserScope } from "./user-scope.js";
|
|
2
|
+
export type { CapabilityType } from "./user-scope.js";
|
|
2
3
|
export declare const CAPABILITY_TYPES: readonly CapabilityType[];
|
|
3
|
-
export declare function setDeployedDefaultsProvider(type: CapabilityType, provider: (() => Record<string, boolean>) | null): void;
|
|
4
|
+
export declare function setDeployedDefaultsProvider(type: CapabilityType, provider: ((scope: UserScope | null) => Record<string, boolean>) | null): void;
|
|
4
5
|
|
|
5
|
-
export declare function getDefaults(type: CapabilityType): Record<string, boolean>;
|
|
6
6
|
|
|
7
|
-
export declare function getOverrides(agentId: string, type: CapabilityType): Record<string, boolean>;
|
|
8
7
|
|
|
9
|
-
export declare function getInherited(agentId: string, type: CapabilityType): Record<string, boolean>;
|
|
10
8
|
|
|
11
|
-
export declare function
|
|
9
|
+
export declare function getDefaults(scope: UserScope | null, type: CapabilityType): Record<string, boolean>;
|
|
12
10
|
|
|
13
|
-
export declare function getEffectiveSource(agentId: string, type: CapabilityType, name: string): "agent" | "inherited" | "bridge" | "deployed" | "default";
|
|
14
11
|
|
|
15
|
-
export declare function setDefault(type: CapabilityType, name: string, value: boolean | null): boolean;
|
|
16
12
|
|
|
17
|
-
export declare function setOverride(agentId: string, type: CapabilityType, name: string, value: boolean | null): boolean;
|
|
18
13
|
|
|
19
|
-
export declare function
|
|
14
|
+
export declare function getOverrides(scope: UserScope | null, agentId: string, type: CapabilityType): Record<string, boolean>;
|
|
20
15
|
|
|
21
|
-
export declare function listOverrideAgents(type: CapabilityType): string[];
|
|
22
16
|
|
|
23
|
-
export declare function reconcileDefaultsFromDeployed(type: CapabilityType): number;
|
|
24
17
|
|
|
25
|
-
export declare function hasAnyDefault(type: CapabilityType): boolean;
|
|
26
18
|
|
|
27
|
-
export declare function
|
|
19
|
+
export declare function getInherited(scope: UserScope | null, agentId: string, type: CapabilityType): Record<string, boolean>;
|
|
28
20
|
|
|
29
|
-
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
export declare function getEffective(scope: UserScope | null, agentId: string, type: CapabilityType, name: string, fallback?: boolean): boolean;
|
|
29
|
+
|
|
30
|
+
export declare function getEffectiveSource(scope: UserScope | null, agentId: string, type: CapabilityType, name: string): "agent" | "inherited" | "bridge" | "deployed" | "default";
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
export declare function setDefault(scope: UserScope, type: CapabilityType, name: string, value: boolean | null): boolean;
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
export declare function setOverride(scope: UserScope, agentId: string, type: CapabilityType, name: string, value: boolean | null): boolean;
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
export declare function setInherited(scope: UserScope, agentId: string, type: CapabilityType, map: Record<string, boolean> | null): boolean;
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
export declare function listOverrideAgents(scope: UserScope | null, type: CapabilityType): string[];
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
export declare function reconcileDefaultsFromDeployed(scope: UserScope, type: CapabilityType): number;
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
export declare function hasAnyDefault(scope: UserScope | null, type: CapabilityType): boolean;
|
|
67
|
+
|
|
68
|
+
export declare function getEffectiveMap(scope: UserScope | null, agentId: string, type: CapabilityType, names: Iterable<string>): Record<string, boolean>;
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
export declare function setInheritedMap(scope: UserScope, agentId: string, byType: Partial<Record<CapabilityType, Record<string, boolean>>> | null): CapabilityType[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{existsSync as
|
|
2
|
-
`)}function
|
|
1
|
+
import{existsSync as A,readFileSync as x,readdirSync as B}from"node:fs";import h from"node:path";import{getBridgeTemplateMcpDir as P,getBridgeTemplatePluginsDir as W,getBridgeTemplateSkillsDir as C}from"../config.js";import{atomicWriteFileSync as $,sanitizeAgentId as z}from"../utils/file-utils.js";import{getAgentOwner as F}from"./agent-ownership.js";import{getUserCapabilityAgentFile as R,getUserCapabilityDefaultsFile as U,isLegacyFallbackDisabled as v,scopeEquals as Y}from"./user-scope.js";const J=["skills","mcp","plugins"];function a(r,e){if(e){const t=F(e);if(t)return t}return r}function N(r,e){if(!e)return;const t=F(e);if(t&&!Y(t,r))throw new Error("agent-ownership-mismatch")}function j(r){switch(r){case"skills":return C();case"mcp":return P();case"plugins":return W();default:throw new Error(`\u672A\u77E5\u80FD\u529B\u7C7B\u578B: ${String(r)}`)}}function k(r){return h.join(j(r),"config.json")}function O(r,e){return h.join(j(r),"agents",`${z(e)}.json`)}function E(r,e){return U(r,e)}function g(r,e,t){return R(r,e,t)}const y=new Map;function ie(r,e){e?y.set(r,e):y.delete(r)}function S(r,e,t){const n=y.get(r);if(n)try{return n(t)[e]}catch{return}}function b(r){try{if(!A(r))return{};const e=JSON.parse(x(r,"utf8"));return!e||typeof e!="object"||Array.isArray(e)?{}:e}catch{return{}}}function M(r,e){$(r,`${JSON.stringify(e,null,2)}
|
|
2
|
+
`)}function l(r,e){const t=e[r];if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[i,o]of Object.entries(t))i.trim()&&typeof o=="boolean"&&(n[i.trim()]=o);return n}function _(r,e,t,n){const i={...l(e,r)};n==null?delete i[t]:i[t]=n,r[e]=i}function q(r){try{if(!A(r))return{};const e=JSON.parse(x(r,"utf8"));return!e||typeof e!="object"||Array.isArray(e)?{}:e}catch{return{}}}function c(r,e,t){const n=q(r),i=n[t];return i&&typeof i=="object"&&!Array.isArray(i)?l(e,i):t==="overrides"?l(e,n):{}}function T(r,e,t,n){const i={};for(const o of["overrides","inherited"]){const s=o===t?n:c(r,e,o),f={};for(const u of J){const d=u===e?s:c(r,u,o);f[u]=d}i[o]=f}M(r,i)}function p(r,e){const t={};return r?(Object.assign(t,l(e,b(E(r,e)))),t):(v()||Object.assign(t,l(e,b(k(e)))),t)}function L(r,e,t){if(!e)return{};const n=a(r,e);return n?c(g(n,t,e),t,"overrides"):v()?{}:c(O(t,e),t,"overrides")}function V(r,e,t){if(!e)return{};const n=a(r,e);return n?c(g(n,t,e),t,"inherited"):v()?{}:c(O(t,e),t,"inherited")}function G(r,e,t,n,i){const o=a(r,e),f=L(o,e,t)[n];if(f!==void 0)return f;const d=V(o,e,t)[n];if(d!==void 0)return d;const D=p(o,t)[n];if(D!==void 0)return D;if(i!==void 0)return i;const m=S(t,n,o);if(m!==void 0)return m;if(o&&!v()){const w=H(e,t,n);if(w!==void 0)return w}return!1}function H(r,e,t){if(r){const i=c(O(e,r),e,"overrides")[t];if(i!==void 0)return i;const o=c(O(e,r),e,"inherited")[t];if(o!==void 0)return o}const n=l(e,b(k(e)))[t];return n!==void 0?n:S(e,t,null)}function oe(r,e,t,n){const i=a(r,e);return L(i,e,t)[n]!==void 0?"agent":V(i,e,t)[n]!==void 0?"inherited":p(i,t)[n]!==void 0?"bridge":S(t,n,i)!==void 0?"deployed":"default"}function K(r,e,t,n){const i=E(r,e),o=b(i),s=l(e,o);_(o,e,t,n);const f=l(e,o);return JSON.stringify(s)===JSON.stringify(f)?!1:(M(i,o),!0)}function fe(r,e,t,n,i){if(!e)return!1;N(r,e);const o=a(r,e)??r,s=g(o,t,e),f=c(s,t,"overrides"),u={...f};return i==null?delete u[n]:u[n]=i,JSON.stringify(f)===JSON.stringify(u)?!1:(T(s,t,"overrides",u),!0)}function Q(r,e,t,n){if(!e)return!1;N(r,e);const i=a(r,e)??r,o=g(i,t,e),s=c(o,t,"inherited"),f={};if(n&&typeof n=="object"&&!Array.isArray(n))for(const[u,d]of Object.entries(n))u.trim()&&typeof d=="boolean"&&(f[u.trim()]=d);return JSON.stringify(s)===JSON.stringify(f)?!1:(T(o,t,"inherited",f),!0)}function se(r,e){const t=r?h.dirname(g(r,e,"_probe")):h.join(j(e),"agents");try{return A(t)?B(t).filter(n=>n.endsWith(".json")&&!n.startsWith(".")).map(n=>n.slice(0,-5)):[]}catch{return[]}}function ue(r,e){const t=y.get(e);if(!t)return 0;let n=0;const i=p(r,e),o=t(r)??{};for(const s of Object.keys(o))s in i||o[s]===!0&&(K(r,e,s,!1),n++);return n}function ce(r,e){return Object.keys(p(r,e)).length>0}function le(r,e,t,n){const i={};for(const o of n)i[o]=G(r,e,t,o);return i}function de(r,e,t){const n=[];if(!e)return n;for(const i of J){const o=t&&typeof t=="object"?t[i]??{}:{};Q(r,e,i,o)&&n.push(i)}return n}export{J as CAPABILITY_TYPES,p as getDefaults,G as getEffective,le as getEffectiveMap,oe as getEffectiveSource,V as getInherited,L as getOverrides,ce as hasAnyDefault,se as listOverrideAgents,ue as reconcileDefaultsFromDeployed,K as setDefault,ie as setDeployedDefaultsProvider,Q as setInherited,de as setInheritedMap,fe as setOverride};
|
|
3
3
|
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
2
7
|
export declare function readChangelog(version: string): Promise<{
|
|
3
8
|
found: boolean;
|
|
4
9
|
content: string;
|
|
5
10
|
path: string;
|
|
6
11
|
}>;
|
|
7
12
|
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
8
17
|
export declare function appendChangelogSection(version: string, body: string): Promise<void>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type PairBridgeOptions, type PairBridgeResult } from "./bridge-pairing.js";
|
|
1
2
|
import type { StartupConfigWizardResult } from "./startup-config-wizard.js";
|
|
2
3
|
import { type WindowsServiceManager } from "./windows-service-manager.js";
|
|
3
4
|
export interface CliCommandResult {
|
|
@@ -29,6 +30,9 @@ export interface CliCommandOptions {
|
|
|
29
30
|
|
|
30
31
|
launchdLogPath?: string;
|
|
31
32
|
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
32
36
|
launchdDomainTarget?: string;
|
|
33
37
|
|
|
34
38
|
findRunningBridgeProcesses?: (platform: NodeJS.Platform) => number[];
|
|
@@ -37,32 +41,110 @@ export interface CliCommandOptions {
|
|
|
37
41
|
|
|
38
42
|
prompt?: (question: string) => Promise<string>;
|
|
39
43
|
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
40
48
|
globalModulePath?: () => string | null;
|
|
41
49
|
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
42
54
|
queryWindowsServiceState?: (serviceName: string) => string | null;
|
|
43
55
|
|
|
56
|
+
pair?: (options: PairBridgeOptions) => Promise<PairBridgeResult>;
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
44
62
|
assumeYes?: boolean;
|
|
45
63
|
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
46
69
|
skipKill?: boolean;
|
|
47
70
|
}
|
|
48
71
|
export declare function readPackageVersion(packageRoot?: string): string;
|
|
49
72
|
|
|
73
|
+
|
|
74
|
+
|
|
50
75
|
export declare function createSystemdUnitContent(executablePath: string): string;
|
|
51
76
|
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
52
89
|
export declare function createLaunchdPlistContent(executablePath: string, options?: {
|
|
53
90
|
userHomeDir?: string;
|
|
54
91
|
logPath?: string;
|
|
55
92
|
}): string;
|
|
56
93
|
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
57
107
|
export declare function defaultFindRunningBridgeProcesses(platform: NodeJS.Platform): number[];
|
|
58
108
|
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
59
118
|
export declare function defaultKillBridgeProcess(pid: number, platform: NodeJS.Platform, waitTimeoutMs?: number, waitIntervalMs?: number): void;
|
|
60
119
|
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
61
124
|
export declare function defaultProcessIsGone(pid: number, platform: NodeJS.Platform): boolean;
|
|
62
125
|
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
63
133
|
export declare function waitForProcessGone(isProcessGone: (pid: number, platform: NodeJS.Platform) => boolean, pid: number, platform: NodeJS.Platform, timeoutMs?: number, intervalMs?: number): boolean;
|
|
64
134
|
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
65
139
|
export declare function removeDirWithRetry(targetDir: string, retries?: number, baseDelayMs?: number): void;
|
|
66
140
|
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
67
149
|
export declare function removeUpdateFseventsResidue(globalRoot: string): void;
|
|
68
150
|
export declare function handleCliCommand(options?: CliCommandOptions): Promise<CliCommandResult>;
|