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,4 +1,18 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
2
16
|
import type { FSWatcher } from "node:fs";
|
|
3
17
|
import { RingBuffer } from "./ring-buffer.js";
|
|
4
18
|
export type DebugItemKind = "mcp" | "plugin";
|
|
@@ -20,6 +34,10 @@ export interface McpHotMounter {
|
|
|
20
34
|
sessions: number;
|
|
21
35
|
}>;
|
|
22
36
|
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
23
41
|
getMcpServerStderr?(agentId: string, name: string, tail: number): string[];
|
|
24
42
|
}
|
|
25
43
|
|
|
@@ -64,6 +82,11 @@ export interface DebugMountResult {
|
|
|
64
82
|
error?: string;
|
|
65
83
|
}
|
|
66
84
|
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
67
90
|
export declare function assertWithinWorkspace(workspacePath: string | undefined, targetPath: string): {
|
|
68
91
|
ok: true;
|
|
69
92
|
resolved: string;
|
|
@@ -73,10 +96,17 @@ export declare function assertWithinWorkspace(workspacePath: string | undefined,
|
|
|
73
96
|
};
|
|
74
97
|
export declare function isValidDebugName(name: string): boolean;
|
|
75
98
|
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
76
102
|
export declare function debugMountPlugin(agentId: string, workspacePath: string | undefined, pluginPath: string, hotMounter?: McpHotMounter): Promise<DebugMountResult>;
|
|
77
103
|
|
|
78
104
|
export declare function debugUnmountPlugin(agentId: string, name: string): Promise<DebugMountResult>;
|
|
79
105
|
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
80
110
|
export declare function debugMountMcp(agentId: string, workspacePath: string | undefined, mcpPath: string, hotMounter: McpHotMounter, nameOverride?: string): Promise<DebugMountResult>;
|
|
81
111
|
|
|
82
112
|
export declare function debugUnmountMcp(agentId: string, name: string, hotMounter: McpHotMounter): Promise<DebugMountResult>;
|
|
@@ -92,11 +122,21 @@ export interface DebugMountListItem {
|
|
|
92
122
|
mountedAt: number;
|
|
93
123
|
}
|
|
94
124
|
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
95
130
|
export declare function listDebugMounts(agentId: string): {
|
|
96
131
|
mcp: DebugMountListItem[];
|
|
97
132
|
plugin: DebugMountListItem[];
|
|
98
133
|
};
|
|
99
134
|
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
100
140
|
export declare function getDebugItemLogs(agentId: string, kind: DebugItemKind, name: string, tail?: number, hotMounter?: McpHotMounter): Promise<{
|
|
101
141
|
ok: boolean;
|
|
102
142
|
kind: DebugItemKind;
|
|
@@ -119,4 +159,13 @@ export interface DebugPackageResult {
|
|
|
119
159
|
error?: string;
|
|
120
160
|
}
|
|
121
161
|
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
122
171
|
export declare function packageDebugItem(workspacePath: string | undefined, itemPath: string, kind: DebugItemKind | "skill"): Promise<DebugPackageResult>;
|
|
@@ -1,4 +1,50 @@
|
|
|
1
1
|
|
|
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
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
2
48
|
import { type ACodeBuiltInToolLike } from "../desktop/built-in-desktop-tools.js";
|
|
3
49
|
import { DesktopMcpConnection, type DesktopMcpToolInfo } from "../desktop/desktop-mcp-client.js";
|
|
4
50
|
|
|
@@ -25,16 +71,72 @@ export interface DesktopAgentAiInfo {
|
|
|
25
71
|
baseURL?: string;
|
|
26
72
|
apiKey?: string;
|
|
27
73
|
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
28
78
|
supportsImage?: boolean;
|
|
29
79
|
}
|
|
30
80
|
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
31
86
|
export declare function resolveDesktopMcpBinary(): Promise<string | null>;
|
|
32
87
|
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
33
96
|
export declare function startDesktopMcpManager(agentId?: string): Promise<DesktopMcpManagerState | null>;
|
|
34
97
|
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
35
107
|
export declare function getDesktopTools(agentId: string | undefined, agentAi?: DesktopAgentAiInfo): Promise<ACodeBuiltInToolLike[]>;
|
|
36
108
|
|
|
37
|
-
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
export declare function forwardDesktopToolGuarded(agentId: string, name: string, args: Record<string, unknown>, baseForward: (name: string, args: Record<string, unknown>) => Promise<string>): Promise<string>;
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
export declare function getDesktopToolsIfReady(agentId?: string): ACodeBuiltInToolLike[];
|
|
38
140
|
|
|
39
141
|
export declare function disposeDesktopMcpManager(): Promise<void>;
|
|
40
142
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{access as
|
|
1
|
+
import{access as g,constants as U}from"node:fs/promises";import{join as y,resolve as N}from"node:path";import{createBuiltInDesktopTools as v}from"../desktop/built-in-desktop-tools.js";import{DESKTOP_INPUT_TOOLS as R,describeDesktopAction as h,emitDesktopAction as _,isHumanControlActive as $,isPaused as x}from"../desktop/desktop-control.js";import{DesktopMcpConnection as F}from"../desktop/desktop-mcp-client.js";import{logger as K}from"../utils/logger.js";import{DESKTOP_FEATURE_KEY as L,isFeatureEnabled as W}from"./instance-features.js";import{buildAgentMetaEnv as B}from"./mcp-env-injector.js";import{getPanelEnvVars as H,getAgentMeta as V}from"./panel-env.js";const f=K.child("desktop-mcp");let s=null,p=null,c=null,d,k="none";const b=process.platform==="win32"?"nuphus-mcp.exe":"nuphus-mcp",j=12e4,Y=6e4;function z(){const t=process.env.AWS_DESKTOP_MCP_TIMEOUT_MS;if(t){const e=parseInt(t,10);if(Number.isFinite(e)&&e>0)return e}return j}function G(){const t=process.env.AWS_DESKTOP_MCP_RETRY_BACKOFF_MS;if(t){const e=parseInt(t,10);if(Number.isFinite(e)&&e>=0)return e}return Y}async function I(){const t=process.env.AWS_DESKTOP_MCP_BIN;if(t){const o=N(t);return await M(o)?o:null}const e=y(process.cwd(),".desktop-mcp","bin",b);return await M(e)?e:null}async function M(t){try{return await g(t,U.F_OK),!0}catch{return!1}}function J(){const t={},e="AWS_DESKTOP_MCP_ENV_";for(const[o,n]of Object.entries(process.env))o.startsWith(e)&&n!==void 0&&(t[o.slice(e.length)]=n);return t}function P(t){const e={...J(),...H(t),...B(V(t))},o=e.NUPHUS_MCP_VISION_API_KEY!==void 0||e.NUPHUS_MCP_VISION_MODEL!==void 0;return!o&&d?.apiKey&&d.supportsImage===!0?(k="agent-fallback",e.NUPHUS_MCP_VISION_API_KEY=d.apiKey,e.NUPHUS_MCP_VISION_MODEL=d.model,d.baseURL&&(e.NUPHUS_MCP_VISION_BASE_URL=d.baseURL),f.info(`vision model fallback: reusing agent model ${d.model} for desktop_vision`)):o?k="panel-env":k="none",e}function T(t){return Object.keys(t).sort().map(e=>`${e}=${t[e]}`).join("\0")}async function O(t){if(s){if(s.connection.isConnected())return s;await m(s.connection),s=null}if(p)return p;if(c){if(c.reason==="binary-missing"||Date.now()-c.at<G())return null;c=null}return p=(async()=>{const e=await I();if(!e)return c={reason:"binary-missing",message:`nuphus-mcp binary not found. Set AWS_DESKTOP_MCP_BIN or place it at ${y(process.cwd(),".desktop-mcp","bin",b)}`,at:Date.now()},w(`desktop tools unavailable: ${c.message}`),null;const o=P(t),n=new F({command:e,env:o,onUnexpectedClose:()=>{w("nuphus-mcp process exited unexpectedly; will restart on next use"),s?.connection===n&&(s=null)}});try{const r=await n.start(),a=z();c=null;const i={connection:n,tools:r,binaryPath:e,envSig:T(o),ownerAgentId:t,forwarder:(u,l)=>X(n,u,l,a,t)};return s=i,w(`nuphus-mcp started (${e}), ${r.filter(u=>u.name.startsWith("desktop_")).length} desktop tools available`),i}catch(r){return await m(n),c={reason:"start-failed",message:r.message,at:Date.now()},C(`nuphus-mcp start failed: ${c.message}`),null}finally{p=null}})(),p}async function X(t,e,o,n,r){try{return await t.callTool(e,o,n)}catch(a){if(t.isConnected())throw a;C(`nuphus-mcp connection lost during ${e}: ${a.message}; restarting`),s?.connection===t&&(s=null),await m(t);const i=await O(r);if(!i)throw new Error(`nuphus-mcp restart failed: ${c?.message??"unknown"}`);return i.connection.callTool(e,o,n)}}async function ut(t,e){if(!t)return[];e?.model&&(d=e);const o=P(t),n=T(o);s&&s.connection.isConnected()&&s.envSig!==n&&(w("nuphus-mcp env changed; restarting to apply new env"),await tt());const r=await O(t);return r?v({tools:r.tools,agentId:t,forwarder:(a,i)=>E(t,a,i,(u,l)=>r.forwarder(u,l)),internalForwarder:(a,i)=>r.forwarder(a,i)}):[]}const D="nuphus-mcp tool error:",q="desktop control is PAUSED by the human operator (kill switch). Stop calling desktop_* tools immediately and inform the user; the operator will resume control when ready.",Q="desktop input is currently held by the human operator via remote desktop; AI input actions are suspended (read-only tools still work). Wait and retry later, or ask the user to release desktop control.";async function E(t,e,o,n){if(!W(t,L))return f.warn(`tool ${e} blocked: desktop capability disabled for ${t}`),"desktop capability is disabled for this agent (toggled off while tools were exposed); stop calling desktop_* tools";if(x(t))return f.warn(`tool ${e} blocked: desktop control paused (kill switch) for ${t}`),_(t,e,h(t,e,o),"rejected",{reason:"paused"}),q;if($(t)&&R.has(e))return f.warn(`tool ${e} blocked: human operator holds desktop control for ${t}`),_(t,e,h(t,e,o),"rejected",{reason:"human-control"}),Q;const r=h(t,e,o),i=r.action==="move"?null:_(t,e,r,"started"),u=Date.now();try{const l=await n(e,o),S=l.startsWith(D);return i&&_(t,e,r,S?"error":"done",{id:i.id,durationMs:Date.now()-u,...S&&{error:A(l.slice(D.length))}}),l}catch(l){throw i&&_(t,e,r,"error",{id:i.id,durationMs:Date.now()-u,error:A(l.message)}),l}}function A(t,e=200){const o=t.trim();return o.length<=e?o:`${o.slice(0,e)}\u2026`}function pt(t){const e=s;if(!e||!e.connection.isConnected())return Z.map(n=>({kind:"builtin",toolName:n,exposedName:n,description:`${n}\uFF08\u684C\u9762\u81EA\u52A8\u5316\u5DE5\u5177\uFF0Cnuphus-mcp \u672A\u8FD0\u884C\uFF09\u3002\u5206\u914D desktop \u5206\u7C7B\u540E\u6309\u9700\u542F\u52A8\u540E\u7AEF\uFF0C\u5177\u4F53\u5DE5\u5177\u4EE5\u542F\u52A8\u540E\u76EE\u5F55\u4E3A\u51C6\u3002`,inputSchema:{type:"object",properties:{}},category:"desktop",async execute(){const r=`${n} is not ready: nuphus-mcp backend is not running. Allocate the desktop catalog to lazily start it, then retry.`;return t?E(t,n,{},async()=>r):r}}));const o=e;return v({tools:o.tools,agentId:t,forwarder:(n,r)=>t?E(t,n,r,(a,i)=>o.forwarder(a,i)):o.forwarder(n,r),internalForwarder:(n,r)=>o.forwarder(n,r)})}const Z=["desktop_screenshot","desktop_window_screenshot","desktop_perceive","desktop_vision","desktop_input","desktop_mouse","desktop_mouse_drag","desktop_screen_size","desktop_clipboard_write","desktop_clipboard_clean","desktop_config","desktop_uia_tree","desktop_uia_click","desktop_window_activate","desktop_window_info","desktop_window_move","desktop_window_resize","desktop_windows_list"];async function tt(){const t=s;if(s=null,c=null,p){try{await p}catch{}p=null}t&&(await m(t.connection),w("nuphus-mcp stopped"))}function dt(){return{started:s!==null,binaryPath:s?.binaryPath??null,toolCount:s?s.tools.filter(t=>t.name.startsWith("desktop_")).length:0,failure:c,visionSource:k}}async function m(t){try{await t.close()}catch{}}function w(t){f.info(t)}function C(t){f.warn(t)}export{tt as disposeDesktopMcpManager,E as forwardDesktopToolGuarded,dt as getDesktopMcpStatus,ut as getDesktopTools,pt as getDesktopToolsIfReady,I as resolveDesktopMcpBinary,O as startDesktopMcpManager};
|
|
2
2
|
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
2
7
|
import { type BridgeEventPayload } from "./agent-event-store.js";
|
|
3
8
|
import { type RingBufferEntry } from "./ring-buffer.js";
|
|
4
9
|
export interface RuntimeCallbackAuthOptions {
|
|
@@ -15,10 +20,20 @@ export interface PushStatEntry {
|
|
|
15
20
|
lastError?: string;
|
|
16
21
|
}
|
|
17
22
|
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
18
26
|
export declare function scheduleEventPush(agentId: string, _entry: RingBufferEntry<BridgeEventPayload>, _authOptions?: RuntimeCallbackAuthOptions): Promise<void>;
|
|
19
27
|
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
20
31
|
export declare function startHeartbeatScheduler(): void;
|
|
21
32
|
|
|
33
|
+
|
|
34
|
+
|
|
22
35
|
export declare function stopHeartbeatScheduler(): void;
|
|
23
36
|
|
|
37
|
+
|
|
38
|
+
|
|
24
39
|
export declare function getAllPushStats(): PushStatEntry[];
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
2
9
|
export interface SnapshotIndexEntry {
|
|
3
10
|
|
|
4
11
|
backupName: string;
|
|
@@ -44,6 +51,13 @@ export interface SnapshotListItem {
|
|
|
44
51
|
totalBytes: number;
|
|
45
52
|
}
|
|
46
53
|
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
47
61
|
export declare function createSnapshot(params: {
|
|
48
62
|
workspacePath: string;
|
|
49
63
|
snapshotId?: string;
|
|
@@ -51,19 +65,33 @@ export declare function createSnapshot(params: {
|
|
|
51
65
|
triggerType?: string;
|
|
52
66
|
}): Promise<CreateSnapshotResult>;
|
|
53
67
|
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
54
76
|
export declare function restoreSnapshot(params: {
|
|
55
77
|
workspacePath: string;
|
|
56
78
|
snapshotKey: string;
|
|
57
79
|
preRestoreBackup?: boolean;
|
|
58
80
|
}): Promise<RestoreSnapshotResult>;
|
|
59
81
|
|
|
82
|
+
|
|
83
|
+
|
|
60
84
|
export declare function listSnapshots(workspacePath: string): Promise<SnapshotListItem[]>;
|
|
61
85
|
|
|
86
|
+
|
|
87
|
+
|
|
62
88
|
export declare function deleteSnapshot(snapshotKey: string): Promise<{
|
|
63
89
|
ok: boolean;
|
|
64
90
|
error?: string;
|
|
65
91
|
}>;
|
|
66
92
|
|
|
93
|
+
|
|
94
|
+
|
|
67
95
|
export declare function getSnapshotRootPath(): string;
|
|
68
96
|
export interface SnapshotRetentionSweepResult {
|
|
69
97
|
retentionDays: number | null;
|
|
@@ -73,4 +101,9 @@ export interface SnapshotRetentionSweepResult {
|
|
|
73
101
|
bytesFreed: number;
|
|
74
102
|
}
|
|
75
103
|
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
76
109
|
export declare function sweepExpiredSnapshots(retentionDays: number | null): Promise<SnapshotRetentionSweepResult>;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
2
7
|
export interface GitIgnoreRule {
|
|
3
8
|
pattern: string;
|
|
4
9
|
negated: boolean;
|
|
@@ -8,5 +13,9 @@ export interface GitIgnoreRule {
|
|
|
8
13
|
}
|
|
9
14
|
export declare function parseGitIgnoreRules(content: string): GitIgnoreRule[];
|
|
10
15
|
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
11
20
|
export declare function loadGitIgnoreRules(rootPath: string): Promise<GitIgnoreRule[]>;
|
|
12
21
|
export declare function isIgnoredByGitIgnore(relativePath: string, isDirectory: boolean, rules: GitIgnoreRule[]): boolean;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
2
8
|
export interface AdapterInstanceAiConfig {
|
|
3
9
|
model?: string;
|
|
4
10
|
baseURL?: string;
|
|
@@ -25,6 +31,9 @@ interface PrepareResult {
|
|
|
25
31
|
perInstanceConfigPath: string;
|
|
26
32
|
}
|
|
27
33
|
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
28
37
|
export declare function redactForLog(obj: Record<string, unknown>): Record<string, unknown>;
|
|
29
38
|
|
|
30
39
|
export declare function getAgentMcpExtraFilePath(agentId: string): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import l from"node:fs/promises";import M from"node:path";import{getBridgeInstanceConfigFile as D,getBridgeInstanceMcpExtraFile as _,getBridgeTemplateConfigFile as U}from"../config.js";import{getInstanceAiConfigDebugLogger as k}from"../utils/instance-ai-config-debug-logger.js";import{getAgentOwner as K}from"./agent-ownership.js";import{McpDeployManager as P}from"./mcp-deploy.js";import{injectEffectiveEnvIntoMcpServers as x,isBuiltinMcpName as N}from"./mcp-env-injector.js";import{getPanelEnvVars as j,getAgentMeta as B}from"./panel-env.js";import{getUserAiConfigFile as J,isLegacyFallbackDisabled as T}from"./user-scope.js";const $=new Set(["apiKey","api_key","apikey","key","secret","token","password"]);function Y(e){const r={...e};for(const t of Object.keys(r))if($.has(t)){const a=r[t];typeof a=="string"&&a.length>0&&(r[t]=a.length>8?`${a.slice(0,4)}...${a.slice(-4)}`:"***")}else typeof r[t]=="object"&&r[t]!==null&&(r[t]=Y(r[t]));return r}function V(){return{...process.env.ACODE_MODEL?{model:process.env.ACODE_MODEL}:{},...process.env.ACODE_BASE_URL?{baseURL:process.env.ACODE_BASE_URL}:{},...process.env.ACODE_API_KEY?{apiKey:process.env.ACODE_API_KEY}:{},...process.env.ACODE_EFFORT?{effort:process.env.ACODE_EFFORT}:{}}}async function H(e){try{const r=await l.readFile(e,"utf-8"),o=JSON.parse(r).provider?.default,n=o?.options;return{...o?.model?{model:o.model}:{},...n?.baseURL||n?.baseUrl?{baseURL:n.baseURL||n.baseUrl}:{},...n?.apiKey?{apiKey:n.apiKey}:{}}}catch{return{}}}function L(e,r,t,a){return r!==void 0?"api":t!==void 0?"env":a!==void 0?"file":"default"}function w(e){return _(e)}async function q(e){try{const r=await l.readFile(w(e),"utf-8"),t=JSON.parse(r);return t.servers&&typeof t.servers=="object"?t.servers:{}}catch{return{}}}function ae(e){return w(e)}async function ne(e){const r=K(e.agentId);let a=r?J(r):"";if(!a)a=U();else try{await l.access(a)}catch{T()||(a=U())}const o=D(e.agentId),n=e.apiOverrides??{},s=V(),f=await H(a),m=n.model??s.model??f.model,v=n.baseURL??s.baseURL??f.baseURL,b=n.apiKey??s.apiKey??f.apiKey,E=n.effort??s.effort,g={};m&&(g.model=m),v&&(g.baseURL=v),b&&(g.apiKey=b),E&&(g.effort=E);const S={model:L("model",n.model,s.model,f.model),baseURL:L("baseURL",n.baseURL,s.baseURL,f.baseURL),apiKey:L("apiKey",n.apiKey,s.apiKey,f.apiKey),effort:L("effort",n.effort,s.effort,void 0)},I=k();try{await l.mkdir(M.dirname(o),{recursive:!0});let d={};try{const i=await l.readFile(a,"utf-8");d=JSON.parse(i)}catch{}const c=JSON.parse(JSON.stringify(d)),A=c.provider??{},C=A.default??{},p=C.options??{};m&&(p.model=m),v&&(p.baseURL=v),b&&(p.apiKey=b),E&&(p.effort=E),C.options=p,A.default=C,c.provider=A;try{const i=c.mcpServers??{},R=K(e.agentId),u=R?P.forScope(R):null,O=u?u.resolveEnabledMcp(e.agentId,i):i,F=await q(e.agentId);for(const[y,h]of Object.entries(F))N(y)||(O[y]=h);x(O,j(e.agentId),{resolvePackageDir:y=>u&&u.isPackageHealthy(y)?u.packageDir(y):void 0,agentMeta:B(e.agentId)}),c.mcpServers=O}catch(i){I.log({level:"error",category:"apply",message:`MCP \u80FD\u529B\u8FC7\u6EE4/\u79C1\u6709\u5408\u5E76\u5931\u8D25\uFF08fail-open\uFF0C\u4FDD\u6301\u539F\u914D\u7F6E\uFF09: ${i instanceof Error?i.message:String(i)}`,source:"bridge",agentId:e.agentId,sessionId:e.sessionId})}await l.writeFile(o,JSON.stringify(c,null,2),"utf-8"),I.log({level:"info",category:"apply",message:"per-instance acode.json \u5DF2\u5199\u5165",source:"bridge",agentId:e.agentId,sessionId:e.sessionId,details:{perInstanceConfigPath:o,source:S}})}catch(d){const c=d instanceof Error?d.message:String(d);I.log({level:"error",category:"apply",message:`per-instance acode.json \u5199\u5165\u5931\u8D25: ${c}`,source:"bridge",agentId:e.agentId})}return{instanceConfig:{config:g,source:S},perInstanceConfigPath:o}}export{ae as getAgentMcpExtraFilePath,ne as prepareAcodeInstanceConfig,Y as redactForLog};
|
|
2
2
|
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { ToolPermissionPolicy } from "@agentswork/acode";
|
|
2
2
|
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
3
6
|
export type FeatureState = "disabled" | "collapsed" | "expanded";
|
|
4
7
|
|
|
5
8
|
export declare function normalizeFeatureState(raw: unknown): FeatureState | undefined;
|
|
@@ -8,52 +11,164 @@ export declare const DESKTOP_FEATURE_KEY = "desktop";
|
|
|
8
11
|
|
|
9
12
|
export declare const BROWSER_FEATURE_KEY = "browser";
|
|
10
13
|
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
11
19
|
export declare const LAUNCH_ITEM_FEATURE_KEY = "agentSys.launchItem";
|
|
12
20
|
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
13
27
|
export declare const HIRE_FEATURE_KEY = "agentSys.hire";
|
|
14
28
|
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
15
39
|
export declare const SKILL_INSTALL_FEATURE_KEY = "agentSys.skillInstall";
|
|
16
40
|
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
17
52
|
export declare const ABILITY_DEV_FEATURE_KEY = "agentSys.abilityDev";
|
|
18
53
|
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
19
60
|
export declare const PENCIL_FEATURE_KEY = "pencil";
|
|
20
61
|
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
21
68
|
export declare const DRAW_FEATURE_KEY = "draw";
|
|
22
69
|
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
23
77
|
export declare const OFFICE_FEATURE_KEY = "office";
|
|
24
78
|
|
|
25
79
|
export declare const COLLABORATION_FEATURE_KEY = "collaboration";
|
|
26
80
|
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
27
84
|
export declare const COLLABORATION_TASK_FEATURE_KEY = "collaboration.task";
|
|
28
85
|
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
29
89
|
export declare const COLLABORATION_MEETING_FEATURE_KEY = "collaboration.meeting";
|
|
30
90
|
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
31
94
|
export declare const COLLABORATION_DEBUG_FEATURE_KEY = "collaboration.debug";
|
|
32
95
|
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
33
99
|
export declare const COLLABORATION_FILE_HISTORY_FEATURE_KEY = "collaboration.fileHistory";
|
|
34
100
|
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
35
108
|
export declare const EMAIL_FEATURE_KEY = "email";
|
|
36
109
|
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
37
118
|
export declare const GROUP_KEY_TO_FEATURE: ReadonlyMap<string, string>;
|
|
38
119
|
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
39
124
|
export declare function resolveGroupFeatureKey(key: string): string;
|
|
40
125
|
|
|
41
126
|
export declare function setAgentFeatures(agentId: string, features: unknown): void;
|
|
42
127
|
|
|
43
128
|
export declare function getAgentFeatures(agentId: string): Record<string, FeatureState>;
|
|
44
129
|
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
45
134
|
export declare function setAgentInheritedFeatures(agentId: string, features: unknown): void;
|
|
46
135
|
|
|
47
136
|
export declare function getAgentInheritedFeatures(agentId: string): Record<string, FeatureState>;
|
|
48
137
|
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
49
152
|
export declare function getFeatureState(agentId: string, key: string): FeatureState;
|
|
50
153
|
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
51
158
|
export declare function isFeatureEnabled(agentId: string, key: string): boolean;
|
|
52
159
|
|
|
53
160
|
export declare function clearAgentFeatures(agentId: string): void;
|
|
54
161
|
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
55
165
|
export declare function getAgentToolPermissions(agentId: string): ToolPermissionPolicy | null;
|
|
56
166
|
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
57
172
|
export declare function resolveAgentToolPermissions(agentId: string): ToolPermissionPolicy;
|
|
58
173
|
|
|
59
174
|
export interface AgentCapabilities {
|
|
@@ -79,6 +194,18 @@ export declare function getAgentCapabilitiesInherited(agentId: string): AgentCap
|
|
|
79
194
|
|
|
80
195
|
export declare function getAgentPluginSources(agentId: string): Record<string, AgentPluginSource> | null;
|
|
81
196
|
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
82
209
|
export declare function isCapabilityEnabled(agentId: string, type: CapabilityType, name: string): boolean;
|
|
83
210
|
|
|
84
211
|
export declare function instanceFeaturesCacheSize(): number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{getEffective as
|
|
1
|
+
import{getAgentOwner as P}from"./agent-ownership.js";import{getEffective as N,hasAnyDefault as D}from"./capability-config.js";const j=new Set(["disabled","collapsed","expanded"]);function v(e){if(e===!0)return"expanded";if(e===!1)return"disabled";if(typeof e=="string"&&j.has(e))return e}const b={},se="desktop",I="browser",S="agentSys.launchItem",x="agentSys.hire",O="agentSys.skillInstall",R="agentSys.abilityDev",z="pencil",G="draw",H="office",k="collaboration",h="collaboration.task",m="collaboration.meeting",L="collaboration.debug",U="collaboration.fileHistory",J="email",V=new Set,W=new Set([I,z,G,H,S,x,O,R,h,m,L,U,J]),X=[["agentSys","agentSys."],[k,"collaboration."]],q=new Map([["task",h],["meeting",m],["debug",L],["fileHistory",U],["launch",S],["hire",x],["abilityMarket",O],["abilityDev",R]]);function le(e){return q.get(e)??e}function w(e){for(const[t,n]of X)if(e.startsWith(n))return t}const Q=new Set,y=new Map,_=new Map,a=new Map,Z=["fileReadOutside","commandExecution","fileModification","fileModificationOutside"],$=new Set(["allow","ask","deny"]);function ee(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;const t=e,n={};let o=!1;for(const r of Z){const i=t[r];typeof i=="string"&&$.has(i)?(n[r]=i,o=!0):n[r]="allow"}return o?n:null}function K(e){if(e==null)return{...b};let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch{t=null}if(typeof t!="object"||t===null||Array.isArray(t))return{...b};const n={};for(const[o,r]of Object.entries(t)){if(Q.has(o))continue;const i=v(r);i!==void 0&&(n[o]=i)}return n}function ue(e,t){if(!e)return;y.set(e,K(t));let n=t;if(typeof t=="string")try{n=JSON.parse(t)}catch{n=null}if(typeof n=="object"&&n!==null&&!Array.isArray(n)){const o=ee(n.toolPermissions);o?a.set(e,o):a.delete(e)}else a.delete(e)}function te(e){return y.get(e)??{...b}}function ce(e,t){if(!e)return;if(t==null){_.delete(e);return}const n=K(t);if(Object.keys(n).length===0){_.delete(e);return}_.set(e,n)}function ne(e){return _.get(e)??{}}function oe(e,t){const n=te(e),o=ne(e),r=w(t);if(r&&(n[r]??o[r])==="disabled")return"disabled";const i=n[t]??o[t];return i!==void 0?i:V.has(t)?"expanded":W.has(t)?"collapsed":"disabled"}function fe(e,t){return oe(e,t)!=="disabled"}function ae(e){y.delete(e),a.delete(e),f.delete(e),T.delete(e)}function pe(e){return a.get(e)??null}function Ee(e){return a.get(e)??{fileReadOutside:"allow",commandExecution:"allow",fileModification:"allow",fileModificationOutside:"allow"}}const M=["skills","mcp","plugins"],f=new Map,T=new Map;function Y(e){if(typeof e!="object"||e===null||Array.isArray(e))return;const t={};for(const[n,o]of Object.entries(e))n.trim()&&typeof o=="boolean"&&(t[n.trim()]=o);return t}function Ae(e,t){if(!e)return;if(t==null){f.delete(e);return}let n=t;if(typeof t=="string")try{n=JSON.parse(t)}catch{n=null}if(typeof n!="object"||n===null||Array.isArray(n)){f.delete(e);return}const o=n,r={};let i=!1;for(const A of M){const l=Y(o[A]);l&&(r[A]=l,i=!0)}i?f.set(e,r):f.delete(e);const s=o.plugins,u={};let E=!1;if(typeof s=="object"&&s!==null&&!Array.isArray(s))for(const[A,l]of Object.entries(s)){const d=A.trim();if(d){if(typeof l=="boolean"){const c=r.plugins??{};c[d]=l,r.plugins=c,i=!0;continue}if(l!==null&&typeof l=="object"&&!Array.isArray(l)){const c=l,B=c.enabled!==!1,g=typeof c.url=="string"?c.url:void 0,C=typeof c.sha256=="string"?c.sha256:void 0,F=r.plugins??{};F[d]=B,r.plugins=F,i=!0,g&&(u[d]={url:g,sha256:C},E=!0)}}}E?T.set(e,u):T.delete(e)}function de(e){return f.get(e)??null}const p=new Map;function ye(e,t){if(!e)return;if(t==null){p.delete(e);return}let n=t;if(typeof t=="string")try{n=JSON.parse(t)}catch{n=null}if(typeof n!="object"||n===null||Array.isArray(n)){p.delete(e);return}const o=n,r={};let i=!1;for(const s of M){const u=Y(o[s]);u&&(r[s]=u,i=!0)}i?p.set(e,r):p.delete(e)}function _e(e){return p.get(e)??null}function Te(e){return T.get(e)??null}function be(e,t,n){const o=P(e);if(D(o,t))return N(o,e,t,n);const i=p.get(e)?.[t]?.[n];if(i!==void 0)return i;const s=f.get(e);if(!s)return!0;const u=s[t];if(!u)return!0;const E=u[n];return E===void 0?!0:E}function ge(){return y.size}export{R as ABILITY_DEV_FEATURE_KEY,I as BROWSER_FEATURE_KEY,M as CAPABILITY_TYPES,L as COLLABORATION_DEBUG_FEATURE_KEY,k as COLLABORATION_FEATURE_KEY,U as COLLABORATION_FILE_HISTORY_FEATURE_KEY,m as COLLABORATION_MEETING_FEATURE_KEY,h as COLLABORATION_TASK_FEATURE_KEY,se as DESKTOP_FEATURE_KEY,G as DRAW_FEATURE_KEY,J as EMAIL_FEATURE_KEY,q as GROUP_KEY_TO_FEATURE,x as HIRE_FEATURE_KEY,S as LAUNCH_ITEM_FEATURE_KEY,H as OFFICE_FEATURE_KEY,z as PENCIL_FEATURE_KEY,O as SKILL_INSTALL_FEATURE_KEY,ae as clearAgentFeatures,de as getAgentCapabilities,_e as getAgentCapabilitiesInherited,te as getAgentFeatures,ne as getAgentInheritedFeatures,Te as getAgentPluginSources,pe as getAgentToolPermissions,oe as getFeatureState,ge as instanceFeaturesCacheSize,be as isCapabilityEnabled,fe as isFeatureEnabled,v as normalizeFeatureState,Ee as resolveAgentToolPermissions,le as resolveGroupFeatureKey,Ae as setAgentCapabilities,ye as setAgentCapabilitiesInherited,ue as setAgentFeatures,ce as setAgentInheritedFeatures};
|
|
2
2
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { InitLogEntry, LegacyMcpStateItem, LegacySkillStateItem, McpPayload, PluginPackage, SkillPackage } from '../types.js';
|
|
2
|
+
import type { UserScope } from './user-scope.js';
|
|
2
3
|
export declare function initInstance(agentId: string, workspacePath: string, options: {
|
|
3
4
|
skillEnabled?: boolean;
|
|
4
5
|
mcpEnabled?: boolean;
|
|
@@ -7,6 +8,8 @@ export declare function initInstance(agentId: string, workspacePath: string, opt
|
|
|
7
8
|
skillPackages?: SkillPackage[];
|
|
8
9
|
pluginPackages?: PluginPackage[];
|
|
9
10
|
mcpServers?: McpPayload[];
|
|
11
|
+
|
|
12
|
+
scope?: UserScope;
|
|
10
13
|
}): Promise<{
|
|
11
14
|
ok: boolean;
|
|
12
15
|
agentId: string;
|