aws-runtime-bridge 1.9.175 → 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 +188 -0
- package/README.md +61 -2
- package/dist/adapter/AcodeSdkAdapter.d.ts +369 -0
- package/dist/adapter/AcodeSdkAdapter.js +2 -2
- 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 +182 -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 +122 -0
- package/dist/routes/terminal.js +16 -16
- 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 +21 -21
- 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 +179 -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
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{promises as
|
|
1
|
+
import{promises as y}from"node:fs";import M from"node:path";import{downloadPluginZip as $,downloadSkillZip as O,ensureDir as v}from"../utils/file-utils.js";import{createLogger as z}from"../utils/logger.js";import{normalizeMcpPayload as B}from"../utils/mcp-utils.js";import{ensureEnabledTools as j,parseBoolean as T}from"../utils/validation.js";import{buildBuiltinAwsMcpDeploySpec as _,BUILTIN_AWS_MCP_SERVER_NAME as E}from"./aws-client-agent-mcp.js";import{setDefault as F}from"./capability-config.js";import{getAgentInitRoot as R,loadInstanceState as U,saveInstanceState as L}from"./instance-state.js";import{McpDeployManager as W,reconcileMcpDefaultsFromDeployed as Z}from"./mcp-deploy.js";import{isBuiltinMcpName as q}from"./mcp-env-injector.js";import{reconcilePluginsDefaultsFromDeployed as x,pluginManager as V}from"./plugin-manager.js";import{reconcileSkillsDefaultsFromDeployed as G,SkillManager as H}from"./skill-manager.js";import{detectToolStatuses as J}from"./tool-installer.js";const K=z("instance-init");function Q(p,c){const n=new Set(Object.values(c).filter(t=>t.installed).map(t=>t.tool));return p.filter(t=>n.has(t))}async function X(p,c,n){try{const t=await O(c,n);if(!t)return null;const m=await y.readFile(t.outputPath),b=c.defaultEnabled!==!1,i=String(c.skillName||"").trim()||void 0,r=await H.forScope(p).saveSharedSkill(m,t.fileName,b,c.sha256,i);return!r.ok||!r.skillName?null:{id:r.skillName,name:r.skillName,fileName:t.fileName,filePath:"",bytes:t.bytes,installedAt:new Date().toISOString()}}catch(t){return K.warn("\u6280\u80FD\u5305\u90E8\u7F72\u5230 bridge \u5931\u8D25\uFF08\u6309\u8DF3\u8FC7\u5904\u7406\uFF09: %s. %s",c.skillName||c.fileName||"(\u672A\u547D\u540D)",t instanceof Error?t.message:String(t)),null}}async function me(p,c,n){const t=M.resolve(c),m=R(p),b=[],i=n.scope??null,r=i?W.forScope(i):null;function l(s,d,e,a){b.push({step:s,status:d,message:e,timestamp:new Date().toISOString(),details:a})}l("prepare","running","\u5F00\u59CB\u521D\u59CB\u5316\u5B9E\u4F8B",{agentId:String(p),workspacePath:t}),await v(m),l("prepare","success","\u521D\u59CB\u5316\u76EE\u5F55\u5DF2\u5C31\u7EEA",{initRoot:m});const f=j(n.ccSwitchEnabledTools);l("detect-tools","running","\u5F00\u59CB\u68C0\u6D4B\u5DE5\u5177\u5B89\u88C5\u72B6\u6001",{tools:f});const g=await J(f);l("detect-tools","success","\u5DE5\u5177\u5B89\u88C5\u72B6\u6001\u68C0\u6D4B\u5B8C\u6210",{installedTools:Object.values(g).filter(s=>s.installed).map(s=>s.tool),missingTools:Object.values(g).filter(s=>!s.installed).map(s=>s.tool)});const I=Q(f,g),w=Object.values(g).filter(s=>!s.installed),o={ok:!0,agentId:String(p),workspacePath:t,initRoot:m,enabledTools:f,toolStatus:g,logs:b,skill:{enabled:T(n.skillEnabled,!0),packagePresent:!1},mcp:{enabled:T(n.mcpEnabled,!0),configPath:null}},k=await U(p);if(w.length>0&&l("skip-uninstalled-tools","skipped","\u5DF2\u8DF3\u8FC7\u672A\u5B89\u88C5\u5DE5\u5177",{skippedTools:w.map(s=>({tool:s.tool,error:s.error}))}),l("select-installed-tools","success","\u5DF2\u9009\u62E9\u53EF\u521D\u59CB\u5316\u5DE5\u5177",{enabledTools:f,installedTools:I}),l("load-sdk","running","\u5F00\u59CB\u90E8\u7F72\u6280\u80FD/MCP \u6A21\u677F\u5230\u672C bridge"),l("load-sdk","success","\u6280\u80FD/MCP \u6A21\u677F\u90E8\u7F72\u51C6\u5907\u5B8C\u6210",{tools:f}),o.skill.enabled){l("install-skills","running","\u5F00\u59CB\u90E8\u7F72\u6280\u80FD\u5305",{count:Array.isArray(n.skillPackages)?n.skillPackages.length:n.skillPackage?1:0});const s=await v(M.join(m,"skills")),d=Array.isArray(n.skillPackages)&&n.skillPackages.length>0?n.skillPackages:n.skillPackage?[n.skillPackage]:[],e=[];for(const a of d){const h=await X(i??{tenantId:"_legacy",userId:"_legacy"},a,s);h&&e.push(h)}e.length>0?(o.skill.packagePresent=!0,o.skill.installedCount=e.length,o.skill.installed=e,l("install-skills","success","\u6280\u80FD\u5305\u90E8\u7F72\u5B8C\u6210",{installedCount:e.length,skills:e.map(a=>a.name)})):l("install-skills","skipped","\u6CA1\u6709\u53EF\u90E8\u7F72\u7684\u6280\u80FD\u5305")}else l("install-skills","skipped","\u5DF2\u8DF3\u8FC7\u6280\u80FD\u5305\u90E8\u7F72\uFF08skillEnabled=false\uFF09");const P=Array.isArray(n.pluginPackages)?n.pluginPackages:[];if(P.length>0){l("install-plugins","running","\u5F00\u59CB\u90E8\u7F72\u63D2\u4EF6\u6A21\u677F\u5305",{count:P.length});const s=await v(M.join(m,"plugins-tmp"));let d=0;for(const e of P)if(!(!e||!String(e.downloadUrl||"").trim()))try{const a=await $(e,s);if(!a)continue;const h=await y.readFile(a.outputPath),D=e.defaultEnabled!==!1,u=await V.saveSharedPlugin(h,a.fileName,D,e.sha256,i??void 0);u.ok?(d++,l("install-plugins","success",`\u63D2\u4EF6 ${u.pluginName||a.fileName} \u5DF2\u90E8\u7F72\u5230\u672C bridge`)):l("install-plugins","error",`\u63D2\u4EF6 ${a.fileName} \u90E8\u7F72\u5931\u8D25: ${u.error||"\u672A\u77E5\u9519\u8BEF"}`)}catch(a){l("install-plugins","error",`\u63D2\u4EF6 ${e.fileName||"(\u672A\u547D\u540D)"} \u90E8\u7F72\u5931\u8D25: ${a instanceof Error?a.message:String(a)}`)}o.plugin={enabled:!0,packagePresent:P.length>0,installedCount:d},d>0?l("install-plugins","success","\u63D2\u4EF6\u6A21\u677F\u5305\u90E8\u7F72\u5B8C\u6210",{installedCount:d}):l("install-plugins","skipped","\u6CA1\u6709\u53EF\u90E8\u7F72\u7684\u63D2\u4EF6\u5305"),await y.rm(s,{recursive:!0,force:!0}).catch(()=>{})}const S=[];if(o.mcp.enabled){l("install-mcp","running","\u5F00\u59CB\u90E8\u7F72 MCP \u6A21\u677F",{count:(Array.isArray(n.mcpServers)?n.mcpServers.length:0)+1});let s;try{const e=_();if(!r)throw new Error("initInstance: \u7F3A\u5C11\u7528\u6237\u4F5C\u7528\u57DF\uFF0C\u65E0\u6CD5\u90E8\u7F72 MCP");s=r.saveMcp(E,e,!0),s.ok&&(i&&F(i,"mcp",E,!0),S.push({id:"",name:E,transport:"stdio",command:e.command||"",url:e.url||"",args:e.args||[],env:e.env||{},enabled:!0,installedAt:new Date().toISOString()}))}catch(e){s={ok:!1,error:e instanceof Error?e.message:String(e)}}s.ok||l("install-mcp","error",`\u5185\u7F6E\u901A\u8BAF MCP \u90E8\u7F72\u5931\u8D25: ${s.error||"\u672A\u77E5\u9519\u8BEF"}`);const d=(Array.isArray(n.mcpServers)?n.mcpServers:[]).map(e=>B(e)).filter(e=>e!==null);for(const e of d){if(q(e.name))continue;const a=String(e.packageUrl||"").trim();if(a)try{if(!r)throw new Error("\u7F3A\u5C11\u7528\u6237\u4F5C\u7528\u57DF");const u=await r.ensureMcpPackage(e.name,{packageUrl:a,packageSha256:e.packageSha256,fileName:`${e.name}.zip`});u.ok||l("install-mcp","error",`MCP \u5305 ${e.name} \u90E8\u7F72\u5931\u8D25: ${u.error||"\u672A\u77E5\u9519\u8BEF"}`)}catch(u){l("install-mcp","error",`MCP \u5305 ${e.name} \u90E8\u7F72\u5931\u8D25: ${u instanceof Error?u.message:String(u)}`)}const h={type:e.transport||"stdio",command:e.command||void 0,url:e.url||void 0,args:e.args||void 0,env:e.env||void 0,headers:e.headers||void 0,collapsed:e.collapsed===!0,description:e.description||void 0};if(!r)continue;r.saveMcp(e.name,h,e.enabled!==!1,e.packageSha256).ok&&S.push({id:e.id||"",name:e.name,transport:e.transport||"stdio",command:e.command||"",url:e.url||"",args:e.args||[],env:e.env||{},enabled:e.enabled!==!1,installedAt:new Date().toISOString()})}o.mcp.installedCount=S.length,l("install-mcp","success","MCP \u6A21\u677F\u90E8\u7F72\u5B8C\u6210",{installedCount:S.length,mcpServers:S.map(e=>e.name)})}else l("install-mcp","skipped","\u5DF2\u8DF3\u8FC7 MCP \u6A21\u677F\uFF08mcpEnabled=false\uFF09");l("persist-state","running","\u5F00\u59CB\u4FDD\u5B58\u5B9E\u4F8B\u72B6\u6001"),k.initialized=!0,k.enabledTools=f,k.toolStatus=g,k.skillEnabled=o.skill.enabled,k.mcpEnabled=o.mcp.enabled,await L(p,k),l("persist-state","success","\u5B9E\u4F8B\u72B6\u6001\u4FDD\u5B58\u5B8C\u6210");const C=i?G(i):0,N=i?Z(i):0,A=i?x(i):0;return(C||N||A)&&l("sync-state","success","\u80FD\u529B\u9ED8\u8BA4\u5F00\u5173\u5DF2\u5BF9\u8D26\uFF08\u65B0\u589E\u9879\u9ED8\u8BA4\u5173\u95ED\uFF09",{reconciledSkills:C,reconciledMcp:N,reconciledPlugins:A}),l("sync-state","success","\u6280\u80FD/MCP \u6A21\u677F\u90E8\u7F72\u72B6\u6001\u5DF2\u5C31\u7EEA"),l("complete","success",w.length>0?"\u5B9E\u4F8B\u521D\u59CB\u5316\u5B8C\u6210\uFF0C\u672A\u5B89\u88C5\u5DE5\u5177\u5DF2\u8DF3\u8FC7":"\u5B9E\u4F8B\u521D\u59CB\u5316\u5B8C\u6210"),{...o,installed:{skills:o.skill.installed||[],mcpServers:S}}}export{me as initInstance};
|
|
2
2
|
|
|
@@ -1,10 +1,33 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
2
6
|
import type { InstanceState } from "../types.js";
|
|
3
7
|
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
4
11
|
export declare function getInstanceStateFile(agentId: string): string;
|
|
5
12
|
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
export declare function loadInstanceState(agentId: string): Promise<InstanceState>;
|
|
7
19
|
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
8
26
|
export declare function saveInstanceState(agentId: string, state: Partial<InstanceState>): Promise<InstanceState>;
|
|
9
27
|
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
10
33
|
export declare function getAgentInitRoot(agentId: string): string;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
2
7
|
export interface JdkInfo {
|
|
3
8
|
id: string;
|
|
4
9
|
|
|
@@ -11,10 +16,20 @@ export interface JdkInfo {
|
|
|
11
16
|
source: "scan" | "manual";
|
|
12
17
|
}
|
|
13
18
|
|
|
19
|
+
|
|
20
|
+
|
|
14
21
|
export declare function scanInstalledJdks(): Promise<JdkInfo[]>;
|
|
15
22
|
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
16
26
|
export declare function listJdks(): Promise<JdkInfo[]>;
|
|
17
27
|
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
18
31
|
export declare function addManualJdk(jdkPath: string): Promise<JdkInfo>;
|
|
19
32
|
|
|
33
|
+
|
|
34
|
+
|
|
20
35
|
export declare function removeManualJdk(jdkId: string): Promise<boolean>;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
2
10
|
import { type LaunchHistoryEntry, type LaunchHistorySample, type LaunchMetricSample } from "./launch-metrics.js";
|
|
3
11
|
import { type RingBufferSlice } from "./ring-buffer.js";
|
|
4
12
|
export type LaunchRunState = "running" | "exited" | "stopped";
|
|
@@ -58,6 +66,14 @@ export interface LaunchLogsResult {
|
|
|
58
66
|
oldestIndex: number;
|
|
59
67
|
}
|
|
60
68
|
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
61
77
|
export interface LaunchStartupWaitResult {
|
|
62
78
|
outcome: "ready" | "exited" | "stopped" | "timeout";
|
|
63
79
|
|
|
@@ -72,12 +88,22 @@ export interface LaunchStartupWaitResult {
|
|
|
72
88
|
logTail: LaunchLogEntry[];
|
|
73
89
|
}
|
|
74
90
|
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
75
96
|
export declare class LaunchAlreadyRunningError extends Error {
|
|
76
97
|
|
|
77
98
|
readonly existing: LaunchRun;
|
|
78
99
|
constructor(existing: LaunchRun);
|
|
79
100
|
}
|
|
80
101
|
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
81
107
|
export interface LaunchBatchItemResult {
|
|
82
108
|
configId: string;
|
|
83
109
|
ok: boolean;
|
|
@@ -105,12 +131,24 @@ export interface LaunchBatchResult {
|
|
|
105
131
|
};
|
|
106
132
|
}
|
|
107
133
|
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
108
137
|
export declare function resolvePlaceholders(command: string, ctx: {
|
|
109
138
|
workspacePath?: string;
|
|
110
139
|
jdkPath?: string;
|
|
111
140
|
env?: Record<string, string>;
|
|
112
141
|
}): string;
|
|
113
142
|
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
114
152
|
export declare class StreamDecoder {
|
|
115
153
|
private readonly utf8Probe;
|
|
116
154
|
private readonly utf8;
|
|
@@ -121,6 +159,10 @@ export declare class StreamDecoder {
|
|
|
121
159
|
private bufferedSize;
|
|
122
160
|
private flushTimer;
|
|
123
161
|
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
124
166
|
constructor(onFlush?: (text: string) => void);
|
|
125
167
|
|
|
126
168
|
decode(chunk: Buffer): string;
|
|
@@ -129,6 +171,8 @@ export declare class StreamDecoder {
|
|
|
129
171
|
private commit;
|
|
130
172
|
}
|
|
131
173
|
|
|
174
|
+
|
|
175
|
+
|
|
132
176
|
export declare class LaunchManager {
|
|
133
177
|
private static instance;
|
|
134
178
|
|
|
@@ -136,8 +180,16 @@ export declare class LaunchManager {
|
|
|
136
180
|
|
|
137
181
|
private readonly logs;
|
|
138
182
|
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
139
187
|
private readonly startupWaiters;
|
|
140
188
|
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
141
193
|
private readonly readinessMatchers;
|
|
142
194
|
|
|
143
195
|
private readonly logListeners;
|
|
@@ -152,50 +204,136 @@ export declare class LaunchManager {
|
|
|
152
204
|
|
|
153
205
|
private runningRefs;
|
|
154
206
|
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
155
212
|
start(req: LaunchStartRequest): Promise<LaunchRun>;
|
|
156
213
|
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
157
219
|
stop(configId: string, reason?: "manual" | "shutdown", actor?: string): Promise<{
|
|
158
220
|
success: boolean;
|
|
159
221
|
message: string;
|
|
160
222
|
pid?: number;
|
|
161
223
|
}>;
|
|
162
224
|
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
163
230
|
restart(req: LaunchStartRequest): Promise<LaunchRun>;
|
|
164
231
|
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
165
238
|
startBatch(items: LaunchStartRequest[], waitTimeoutMs: number): Promise<LaunchBatchResult>;
|
|
166
239
|
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
167
245
|
stopAll(): Promise<{
|
|
168
246
|
running: number;
|
|
169
247
|
stopped: number;
|
|
170
248
|
}>;
|
|
171
249
|
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
172
262
|
waitStartupResult(configId: string, timeoutMs: number): Promise<LaunchStartupWaitResult>;
|
|
173
263
|
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
174
267
|
private scanReadinessMatch;
|
|
175
268
|
|
|
176
269
|
private resolveStartupWaiters;
|
|
177
270
|
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
178
280
|
listRuns(options?: {
|
|
179
281
|
withPorts?: boolean;
|
|
180
282
|
}): Promise<LaunchRunSummary[]>;
|
|
181
283
|
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
182
288
|
private probePorts;
|
|
183
289
|
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
184
296
|
publishRunningPorts(): Promise<void>;
|
|
185
297
|
|
|
298
|
+
|
|
299
|
+
|
|
186
300
|
getLogs(configId: string, sinceIndex: number): Promise<LaunchLogsResult | null>;
|
|
187
301
|
|
|
302
|
+
|
|
303
|
+
|
|
188
304
|
getRun(configId: string): LaunchRun | undefined;
|
|
189
305
|
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
190
309
|
getMetrics(configId: string, limit?: number): LaunchHistorySample[];
|
|
191
310
|
|
|
311
|
+
|
|
312
|
+
|
|
192
313
|
getMetricsSince(configId: string, sinceIndex: number, limit?: number): LaunchHistoryEntry[];
|
|
193
314
|
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
194
322
|
private ensureRestored;
|
|
195
323
|
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
196
330
|
private publishRunStatus;
|
|
197
331
|
|
|
332
|
+
|
|
333
|
+
|
|
198
334
|
private persist;
|
|
199
335
|
}
|
|
200
336
|
|
|
337
|
+
|
|
338
|
+
|
|
201
339
|
export declare function getLaunchManager(): LaunchManager;
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
3
21
|
export declare const METRICS_SAMPLE_INTERVAL_MS = 5000;
|
|
4
22
|
|
|
5
23
|
export declare const METRICS_HISTORY_CAPACITY = 900;
|
|
@@ -39,10 +57,19 @@ export interface RunningRunRef {
|
|
|
39
57
|
pid: number;
|
|
40
58
|
}
|
|
41
59
|
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
42
63
|
export declare function parseWindowsProcessTable(output: string): ProcessEntry[];
|
|
43
64
|
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
44
68
|
export declare function parsePsCpuTime(value: string): number;
|
|
45
69
|
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
46
73
|
export declare function parseUnixProcessTable(output: string, threadsColumn: boolean): ProcessEntry[];
|
|
47
74
|
|
|
48
75
|
export interface ProcessTreeAggregate {
|
|
@@ -53,8 +80,14 @@ export interface ProcessTreeAggregate {
|
|
|
53
80
|
found: boolean;
|
|
54
81
|
}
|
|
55
82
|
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
56
86
|
export declare function aggregateProcessTree(entries: ProcessEntry[], rootPid: number): ProcessTreeAggregate;
|
|
57
87
|
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
58
91
|
export declare function computeCpuPercent(previous: {
|
|
59
92
|
at: number;
|
|
60
93
|
totalCpuMs: number;
|
|
@@ -63,6 +96,12 @@ export declare function computeCpuPercent(previous: {
|
|
|
63
96
|
totalCpuMs: number;
|
|
64
97
|
}): number;
|
|
65
98
|
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
66
105
|
export declare class LaunchMetricsMonitor {
|
|
67
106
|
private readonly getRuns;
|
|
68
107
|
|
|
@@ -74,6 +113,9 @@ export declare class LaunchMetricsMonitor {
|
|
|
74
113
|
private ticking;
|
|
75
114
|
constructor(getRuns: () => RunningRunRef[]);
|
|
76
115
|
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
77
119
|
ensureRunning(): void;
|
|
78
120
|
|
|
79
121
|
stop(): void;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
2
13
|
export type LaunchStreamKind = "logs" | "metrics";
|
|
3
14
|
export declare class LaunchStreamHub {
|
|
4
15
|
private static instance;
|
|
@@ -8,10 +19,18 @@ export declare class LaunchStreamHub {
|
|
|
8
19
|
private readonly statusSubscribers;
|
|
9
20
|
static getInstance(): LaunchStreamHub;
|
|
10
21
|
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
11
26
|
subscribe(configId: string, kind: LaunchStreamKind, send: (frame: string) => void): () => void;
|
|
12
27
|
|
|
13
28
|
subscriberCount(configId: string, kind: LaunchStreamKind): number;
|
|
14
29
|
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
15
34
|
subscribeStatus(send: (frame: string) => void): () => void;
|
|
16
35
|
|
|
17
36
|
publishStatusRun(run: unknown): void;
|
|
@@ -30,5 +30,10 @@ export declare function createBridgeLifecycleOperation(input: {
|
|
|
30
30
|
export declare function upsertBridgeLifecycleOperation(operation: BridgeLifecycleOperation): Promise<void>;
|
|
31
31
|
export declare function removeBridgeLifecycleOperation(operationId: string): Promise<void>;
|
|
32
32
|
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
33
38
|
export declare function deliverPendingBridgeLifecycleNotifications(): Promise<void>;
|
|
34
39
|
export {};
|
|
@@ -1,9 +1,41 @@
|
|
|
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
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
3
31
|
export declare const DEFAULT_LOG_RETENTION_DAYS = 7;
|
|
4
32
|
|
|
5
33
|
export declare function normalizeLogRetentionDays(value: unknown): number;
|
|
6
34
|
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
7
39
|
export declare function setLogRetentionDays(value: unknown): number;
|
|
8
40
|
|
|
9
41
|
export declare function getLogRetentionDays(): number;
|
|
@@ -30,8 +62,14 @@ export interface LogRetentionSweepResult {
|
|
|
30
62
|
bytesFreed: number;
|
|
31
63
|
}
|
|
32
64
|
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
33
68
|
export declare function sweepExpiredLogs(): Promise<LogRetentionSweepResult>;
|
|
34
69
|
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
35
73
|
export declare function startLogRetention(): void;
|
|
36
74
|
|
|
37
75
|
export declare function stopLogRetention(): void;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import { type LspProviderSpec } from "./provider-registry.js";
|
|
17
|
+
export type LspInstallPhase = "queued" | "installing" | "done" | "error" | "removing";
|
|
18
|
+
export interface LspInstallTask {
|
|
19
|
+
providerId: string;
|
|
20
|
+
phase: LspInstallPhase;
|
|
21
|
+
startedAt: string;
|
|
22
|
+
finishedAt?: string;
|
|
23
|
+
|
|
24
|
+
logs: string[];
|
|
25
|
+
error?: string | null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
export declare function installLspProvider(providerId: string, options?: {
|
|
32
|
+
registry?: string;
|
|
33
|
+
}): Promise<LspInstallTask>;
|
|
34
|
+
|
|
35
|
+
export declare function uninstallLspProvider(providerId: string): Promise<LspInstallTask>;
|
|
36
|
+
|
|
37
|
+
export declare function getLspInstallTask(providerId: string): LspInstallTask | null;
|
|
38
|
+
|
|
39
|
+
export declare function listLspInstallTasks(): LspInstallTask[];
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
export declare function getProviderDiskUsage(providerId: string): Promise<number | null>;
|
|
45
|
+
|
|
46
|
+
export declare function detectNpmRegistry(): Promise<string | null>;
|
|
47
|
+
|
|
48
|
+
export declare function describeInstallStatus(providerId: string): {
|
|
49
|
+
providerId: string;
|
|
50
|
+
task: LspInstallTask | null;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export declare function isInstallBusy(): boolean;
|
|
54
|
+
|
|
55
|
+
export declare function listNpmProviders(): LspProviderSpec[];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{execFile as v,spawn as x}from"node:child_process";import{promises as l}from"node:fs";import $ from"node:path";import{promisify as k}from"node:util";import{createLogger as L}from"../../utils/logger.js";import{getLspServerDir as d,getProvider as P,listAllProviders as S}from"./provider-registry.js";const A=k(v),m=L("lsp-install"),I=200,p=new Map;let u=null;function c(){return new Date().toISOString()}function w(){return process.platform==="win32"?"npm.cmd":"npm"}function f(t,r){for(const e of r.split(/\r?\n/)){const n=e.trim();n&&t.logs.push(n)}for(;t.logs.length>I;)t.logs.shift()}function h(t){const r=P(t);if(!r)throw new Error(`unknown lsp provider: ${t}`);if(r.kind!=="npm"||!r.npmPackage)throw new Error(r.kind==="builtin"?`${r.label} \u5DF2\u5185\u7F6E\uFF0C\u65E0\u9700\u5B89\u88C5`:`${r.label} \u9700\u8981\u5728\u672C\u673A\u5B89\u88C5\u539F\u751F\u8BED\u8A00\u670D\u52A1\uFF1A${(r.systemBinaries??[]).join(" / ")}`);return r}async function b(t,r,e){const n={...process.env};e.registry&&(n.npm_config_registry=e.registry),await new Promise((i,a)=>{const o=x(w(),r,{env:n,shell:process.platform==="win32",stdio:["ignore","pipe","pipe"]});o.stdout?.on("data",s=>f(t,s.toString("utf8"))),o.stderr?.on("data",s=>f(t,s.toString("utf8"))),o.on("error",s=>a(s)),o.on("exit",s=>{s===0?i():a(new Error(`npm ${r[0]??""} exited with code ${s}`))})})}async function B(t,r={}){const e=h(t),n=p.get(e.id);if(n&&(n.phase==="installing"||n.phase==="queued")||n&&n.phase==="done")return n;const i={providerId:e.id,phase:"queued",startedAt:c(),logs:[],error:null};return p.set(e.id,i),u=(async()=>{i.phase="installing";const o=d(e.id);await l.mkdir(o,{recursive:!0}),f(i,`\u5B89\u88C5 ${e.npmPackage}@${e.npmVersion} \u2192 ${o}`);try{await b(i,["install","--prefix",o,"--no-audit","--no-fund","--loglevel","error",`${e.npmPackage}@${e.npmVersion}`],r),i.phase="done",i.finishedAt=c(),m.info(`[lsp-install] \u5B89\u88C5\u5B8C\u6210 provider=${e.id}`)}catch(s){i.phase="error",i.error=s.message,i.finishedAt=c(),m.warn(`[lsp-install] \u5B89\u88C5\u5931\u8D25 provider=${e.id}: ${i.error}`)}finally{u=null}})(),await u,i}async function M(t){const r=h(t),e={providerId:r.id,phase:"removing",startedAt:c(),logs:[],error:null};p.set(r.id,e);const n=d(r.id);return await l.rm(n,{recursive:!0,force:!0}),e.phase="done",e.finishedAt=c(),f(e,`\u5DF2\u5220\u9664 ${n}`),m.info(`[lsp-install] \u5378\u8F7D\u5B8C\u6210 provider=${r.id}`),e}function D(t){return p.get(String(t||"").trim().toLowerCase())??null}function O(){return[...p.values()]}async function V(t){const r=d(t);try{if(!(await l.stat(r)).isDirectory())return null;let n=0;const i=async a=>{const o=await l.readdir(a,{withFileTypes:!0});for(const s of o){const g=$.join(a,s.name);if(s.isDirectory())await i(g);else if(s.isFile()){const y=await l.stat(g);n+=y.size}}};return await i(r),n}catch{return null}}async function j(){try{const{stdout:t}=await A(w(),["config","get","registry"],{timeout:1e4});return String(t||"").trim()||null}catch{return null}}function z(t){return{providerId:t,task:D(t)}}function C(){return u!==null}function G(){return S().filter(t=>t.kind==="npm")}export{z as describeInstallStatus,j as detectNpmRegistry,D as getLspInstallTask,V as getProviderDiskUsage,B as installLspProvider,C as isInstallBusy,O as listLspInstallTasks,G as listNpmProviders,M as uninstallLspProvider};
|
|
2
|
+
|