aws-runtime-bridge 1.9.130 → 1.9.134
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/dist/adapter/AcodeSdkAdapter.d.ts +15 -0
- package/dist/adapter/AcodeSdkAdapter.js +5 -5
- package/dist/adapter/types.d.ts +9 -0
- package/dist/browser/browser-frame-encode.d.ts +16 -0
- package/dist/browser/browser-frame-encode.js +2 -0
- package/dist/browser/browser-pool.js +1 -1
- package/dist/browser/built-in-browser-tools.js +1 -1
- package/dist/browser/screencast-differ.d.ts +35 -0
- package/dist/browser/screencast-differ.js +2 -0
- package/dist/browser/screencast-manager.d.ts +32 -0
- package/dist/browser/screencast-manager.js +1 -1
- package/dist/browser/types.d.ts +48 -1
- package/dist/browser/types.js +1 -1
- package/dist/browser/ws-server.d.ts +1 -1
- package/dist/browser/ws-server.js +1 -1
- package/dist/routes/background-tasks.js +7 -1
- package/dist/routes/instance-tool-status.d.ts +4 -0
- package/dist/routes/instance-tool-status.js +2 -0
- package/dist/routes/instance.d.ts +0 -2
- package/dist/routes/instance.js +1 -1
- package/dist/routes/system-metrics.js +1 -1
- package/dist/routes/terminal.js +19 -19
- package/dist/services/acode-bg-manager.d.ts +36 -0
- package/dist/services/acode-bg-manager.js +2 -0
- package/dist/services/browser-session-manager.js +1 -1
- package/dist/services/instance-features.d.ts +5 -0
- package/dist/services/instance-features.js +1 -1
- package/dist/services/process-detail.d.ts +77 -0
- package/dist/services/process-detail.js +32 -0
- package/dist/services/process-top.d.ts +53 -0
- package/dist/services/process-top.js +50 -0
- package/dist/services/session-output.d.ts +10 -0
- package/dist/services/session-output.js +3 -3
- package/package/acode/dist/await-complete-tool.js +4 -4
- package/package/acode/dist/background-command-manager.d.ts +39 -0
- package/package/acode/dist/background-command-manager.js +5 -5
- package/package/acode/dist/background-command-tools.js +1 -1
- package/package/acode/dist/built-in-file-tools.d.ts +25 -1
- package/package/acode/dist/built-in-file-tools.js +2 -2
- package/package/acode/dist/builtins/shellCommandResult.d.ts +3 -0
- package/package/acode/dist/builtins/shellCommandResult.js +1 -1
- package/package/acode/dist/builtins/shellCommandRunner.d.ts +2 -0
- package/package/acode/dist/builtins/shellCommandRunner.js +1 -1
- package/package/acode/dist/image-utils.d.ts +52 -0
- package/package/acode/dist/image-utils.js +2 -0
- package/package/acode/dist/index.d.ts +1 -0
- package/package/acode/dist/index.js +1 -1
- package/package/acode/dist/runtime.d.ts +15 -1
- package/package/acode/dist/runtime.js +26 -26
- package/package/acode/dist/sub-agent-tools.js +30 -26
- package/package/acode/dist/sub-agent-types.d.ts +1 -1
- package/package/acode/dist/tool-allocation.d.ts +4 -4
- package/package/acode/dist/tool-allocation.js +1 -1
- package/package/acode/dist/types.d.ts +3 -1
- package/package/aws-client-agent-mcp/dist/http-client.d.ts +4 -0
- package/package/aws-client-agent-mcp/dist/http-client.js +1 -1
- package/package/aws-client-agent-mcp/dist/mcp-server.d.ts +8 -0
- package/package/aws-client-agent-mcp/dist/mcp-server.js +28 -25
- package/package/aws-client-agent-mcp/dist/mcp-tools.js +6 -6
- package/package/aws-client-agent-mcp/dist/memory-store.d.ts +6 -0
- package/package/aws-client-agent-mcp/dist/memory-tools.js +2 -2
- package/package/aws-client-agent-mcp/dist/types.d.ts +4 -0
- package/package/aws-client-agent-mcp/package.json +1 -1
- package/package.json +3 -3
- package/package/aws-client-agent-mcp/dist/agent-client.test.d.ts +0 -1
- package/package/aws-client-agent-mcp/dist/agent-client.test.js +0 -1066
- package/package/aws-client-agent-mcp/dist/config.test.d.ts +0 -1
- package/package/aws-client-agent-mcp/dist/config.test.js +0 -259
- package/package/aws-client-agent-mcp/dist/context-manager.test.d.ts +0 -2
- package/package/aws-client-agent-mcp/dist/context-manager.test.js +0 -312
- package/package/aws-client-agent-mcp/dist/http-client.test.d.ts +0 -1
- package/package/aws-client-agent-mcp/dist/http-client.test.js +0 -808
- package/package/aws-client-agent-mcp/dist/launch-config-tools.test.d.ts +0 -1
- package/package/aws-client-agent-mcp/dist/launch-config-tools.test.js +0 -110
- package/package/aws-client-agent-mcp/dist/logger.test.d.ts +0 -1
- package/package/aws-client-agent-mcp/dist/logger.test.js +0 -27
- package/package/aws-client-agent-mcp/dist/mcp-server.test.d.ts +0 -1
- package/package/aws-client-agent-mcp/dist/mcp-server.test.js +0 -2798
- package/package/aws-client-agent-mcp/dist/mcp-tools.test.d.ts +0 -1
- package/package/aws-client-agent-mcp/dist/mcp-tools.test.js +0 -152
- package/package/aws-client-agent-mcp/dist/memory-store.test.d.ts +0 -1
- package/package/aws-client-agent-mcp/dist/memory-store.test.js +0 -664
- package/package/aws-client-agent-mcp/dist/message-buffer.test.d.ts +0 -1
- package/package/aws-client-agent-mcp/dist/message-buffer.test.js +0 -142
- package/package/aws-client-agent-mcp/dist/parent-lifecycle.test.d.ts +0 -1
- package/package/aws-client-agent-mcp/dist/parent-lifecycle.test.js +0 -81
- package/package/aws-client-agent-mcp/dist/runtime-launch-binding.test.d.ts +0 -1
- package/package/aws-client-agent-mcp/dist/runtime-launch-binding.test.js +0 -201
- package/package/aws-client-agent-mcp/dist/status-reporter.test.d.ts +0 -1
- package/package/aws-client-agent-mcp/dist/status-reporter.test.js +0 -157
- package/package/aws-client-agent-mcp/dist/watchdog.test.d.ts +0 -1
- package/package/aws-client-agent-mcp/dist/watchdog.test.js +0 -124
- package/package/aws-client-agent-mcp/dist/websocket-client.test.d.ts +0 -1
- package/package/aws-client-agent-mcp/dist/websocket-client.test.js +0 -725
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { mkdtemp, rm } from "node:fs/promises";
|
|
3
|
-
import os from "node:os";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import { afterEach, describe, it } from "node:test";
|
|
6
|
-
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
7
|
-
import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js";
|
|
8
|
-
import { McpServer } from "./mcp-server.js";
|
|
9
|
-
import { MCP_TOOLS, LAUNCH_CONFIG_TOOL_NAMES, HIRE_TOOL_NAMES } from "./mcp-tools.js";
|
|
10
|
-
import { MessageBuffer } from "./message-buffer.js";
|
|
11
|
-
import { MemoryStore } from "./memory-store.js";
|
|
12
|
-
const LAUNCH_ITEM_FEATURE_KEY = "agentSys.launchItem";
|
|
13
|
-
const LAUNCH_TOOLS_ENV_KEY = "AWS_LAUNCH_CONFIG_TOOLS";
|
|
14
|
-
const LAUNCH_TOOL_NAMES = [...LAUNCH_CONFIG_TOOL_NAMES];
|
|
15
|
-
/**
|
|
16
|
-
* 构造带能力开关 stub 的 McpServer(内存存储 + 假 agentClient),
|
|
17
|
-
* 通过 InMemoryTransport 暴露 SDK server,供真实 MCP Client 连接调用。
|
|
18
|
-
*/
|
|
19
|
-
async function buildServer(getRuntimeFeatures) {
|
|
20
|
-
const dir = await mkdtemp(path.join(os.tmpdir(), "aws-mcp-launch-"));
|
|
21
|
-
const server = new McpServer();
|
|
22
|
-
Reflect.set(server, "messageBuffer", new MessageBuffer());
|
|
23
|
-
Reflect.set(server, "memoryStore", new MemoryStore(path.join(dir, "instance-memory")));
|
|
24
|
-
Reflect.set(server, "roleMemoryStore", new MemoryStore(path.join(dir, "role-memory")));
|
|
25
|
-
Reflect.set(server, "sessionContextMemoryStore", new MemoryStore(path.join(dir, "session-context")));
|
|
26
|
-
Reflect.set(server, "agentClient", {
|
|
27
|
-
getStatusReporter: () => null,
|
|
28
|
-
getRuntimeFeatures,
|
|
29
|
-
});
|
|
30
|
-
const sdkServer = Reflect.get(server, "server");
|
|
31
|
-
const [serverTransport, clientTransport] = InMemoryTransport.createLinkedPair();
|
|
32
|
-
await sdkServer.connect(serverTransport);
|
|
33
|
-
const client = new Client({ name: "test", version: "1.0.0" });
|
|
34
|
-
await client.connect(clientTransport);
|
|
35
|
-
return { server, client, dir };
|
|
36
|
-
}
|
|
37
|
-
async function listToolNames(client) {
|
|
38
|
-
const result = await client.listTools();
|
|
39
|
-
return result.tools.map((tool) => tool.name);
|
|
40
|
-
}
|
|
41
|
-
describe("launch_config_* 能力开关门控(aws-mcp 侧)", () => {
|
|
42
|
-
const dirs = [];
|
|
43
|
-
const originalEnv = process.env[LAUNCH_TOOLS_ENV_KEY];
|
|
44
|
-
afterEach(async () => {
|
|
45
|
-
if (originalEnv === undefined) {
|
|
46
|
-
delete process.env[LAUNCH_TOOLS_ENV_KEY];
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
process.env[LAUNCH_TOOLS_ENV_KEY] = originalEnv;
|
|
50
|
-
}
|
|
51
|
-
await Promise.all(dirs.splice(0).map((dir) => rm(dir, { recursive: true, force: true })));
|
|
52
|
-
});
|
|
53
|
-
it("未开启「启动项管理」时完全不暴露 launch_config_* 工具", async () => {
|
|
54
|
-
const { client, dir } = await buildServer(async () => ({}));
|
|
55
|
-
dirs.push(dir);
|
|
56
|
-
const names = await listToolNames(client);
|
|
57
|
-
for (const launchTool of LAUNCH_TOOL_NAMES) {
|
|
58
|
-
assert.equal(names.includes(launchTool), false, `${launchTool} 不应暴露`);
|
|
59
|
-
}
|
|
60
|
-
// 能力开关 stub 返回空对象:启动项管理与招聘工具(默认关闭)均不暴露
|
|
61
|
-
for (const hireTool of HIRE_TOOL_NAMES) {
|
|
62
|
-
assert.equal(names.includes(hireTool), false, `${hireTool} 不应暴露`);
|
|
63
|
-
}
|
|
64
|
-
assert.equal(names.length, MCP_TOOLS.length - LAUNCH_TOOL_NAMES.length - HIRE_TOOL_NAMES.size);
|
|
65
|
-
});
|
|
66
|
-
it("开启「启动项管理」后暴露全部 9 个启动项工具", async () => {
|
|
67
|
-
const { client, dir } = await buildServer(async () => ({
|
|
68
|
-
[LAUNCH_ITEM_FEATURE_KEY]: true,
|
|
69
|
-
}));
|
|
70
|
-
dirs.push(dir);
|
|
71
|
-
const names = await listToolNames(client);
|
|
72
|
-
for (const launchTool of LAUNCH_TOOL_NAMES) {
|
|
73
|
-
assert.equal(names.includes(launchTool), true, `${launchTool} 应暴露`);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
it("能力拉取失败时回退启动期 env:env=1 暴露,无 env 不暴露", async () => {
|
|
77
|
-
process.env[LAUNCH_TOOLS_ENV_KEY] = "1";
|
|
78
|
-
const { client, dir } = await buildServer(async () => {
|
|
79
|
-
throw new Error("network down");
|
|
80
|
-
});
|
|
81
|
-
dirs.push(dir);
|
|
82
|
-
const namesWithEnv = await listToolNames(client);
|
|
83
|
-
for (const launchTool of LAUNCH_TOOL_NAMES) {
|
|
84
|
-
assert.equal(namesWithEnv.includes(launchTool), true, `${launchTool} 应回退暴露(env=1)`);
|
|
85
|
-
}
|
|
86
|
-
// 独立实例(新缓存):无 env → 不暴露
|
|
87
|
-
delete process.env[LAUNCH_TOOLS_ENV_KEY];
|
|
88
|
-
const second = await buildServer(async () => {
|
|
89
|
-
throw new Error("network down");
|
|
90
|
-
});
|
|
91
|
-
dirs.push(second.dir);
|
|
92
|
-
const namesWithoutEnv = await listToolNames(second.client);
|
|
93
|
-
for (const launchTool of LAUNCH_TOOL_NAMES) {
|
|
94
|
-
assert.equal(namesWithoutEnv.includes(launchTool), false, `${launchTool} 不应暴露(无 env)`);
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
it("未开启时直接调用 launch_config_* 被执行期守卫拒绝", async () => {
|
|
98
|
-
const { client, dir } = await buildServer(async () => ({}));
|
|
99
|
-
dirs.push(dir);
|
|
100
|
-
const result = await client.callTool({
|
|
101
|
-
name: "launch_config_list",
|
|
102
|
-
arguments: {},
|
|
103
|
-
});
|
|
104
|
-
assert.equal(result.isError, true, "未开启时应返回 isError");
|
|
105
|
-
const text = result.content
|
|
106
|
-
.map((block) => block.text ?? "")
|
|
107
|
-
.join("");
|
|
108
|
-
assert.match(text, /启动项管理能力未开启/);
|
|
109
|
-
});
|
|
110
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import * as path from "node:path";
|
|
3
|
-
import { describe, it } from "node:test";
|
|
4
|
-
import { buildStartupLogFilePath, formatLogFileTimestamp, formatLogYearMonth, sanitizeLogFileNameSegment, } from "./logger.js";
|
|
5
|
-
describe("logger startup log path", () => {
|
|
6
|
-
it("formats year-month directory for log archiving", () => {
|
|
7
|
-
const startupTime = new Date(2026, 4, 5, 9, 8, 7, 6);
|
|
8
|
-
assert.equal(formatLogYearMonth(startupTime), "2026-05");
|
|
9
|
-
});
|
|
10
|
-
it("formats file timestamp as dd-HHmmssSSS", () => {
|
|
11
|
-
const startupTime = new Date(2026, 4, 5, 9, 8, 7, 6);
|
|
12
|
-
assert.equal(formatLogFileTimestamp(startupTime), "05-090807006");
|
|
13
|
-
});
|
|
14
|
-
it("sanitizes unsafe filename characters", () => {
|
|
15
|
-
assert.equal(sanitizeLogFileNameSegment('demo:bad*name?'), "demo_bad_name_");
|
|
16
|
-
});
|
|
17
|
-
it("builds log path nested under agent/aws-mcp-node/role-instance/yyyy-MM", () => {
|
|
18
|
-
const startupTime = new Date(2026, 4, 5, 9, 8, 7, 6);
|
|
19
|
-
const logFilePath = buildStartupLogFilePath({
|
|
20
|
-
homeDir: "C:/Users/dev",
|
|
21
|
-
roleName: "测试助手",
|
|
22
|
-
instanceName: "128M",
|
|
23
|
-
startupTime,
|
|
24
|
-
});
|
|
25
|
-
assert.equal(logFilePath, path.join("C:/Users/dev", ".aws-bridge", "log", "agent", "aws-mcp-node", "测试助手-128M", "2026-05", "05-090807006.log"));
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|