aws-runtime-bridge 1.9.128 → 1.9.131
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/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/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/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/package/acode/dist/await-complete-tool.js +4 -4
- package/package/acode/dist/background-command-manager.d.ts +58 -0
- package/package/acode/dist/background-command-manager.js +5 -6
- package/package/acode/dist/background-command-tools.js +1 -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/runtime.js +7 -7
- 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/aws-client-agent-mcp/dist/mcp-server.js +1 -1
- package/package.json +3 -3
|
@@ -48,16 +48,16 @@ export declare const EXPLORE_READONLY_DENIED_TOOLS: Set<string>;
|
|
|
48
48
|
|
|
49
49
|
export declare const SUB_AGENT_ALLOWED_MCP_TOOLS: Set<string>;
|
|
50
50
|
|
|
51
|
-
export declare const PRESET_EXPLORE = "
|
|
51
|
+
export declare const PRESET_EXPLORE = "explore";
|
|
52
52
|
|
|
53
|
-
export declare const PRESET_CORE = "
|
|
53
|
+
export declare const PRESET_CORE = "core";
|
|
54
54
|
|
|
55
55
|
export declare const TYPE_LABEL_CUSTOM = "custom";
|
|
56
56
|
|
|
57
57
|
export declare class ToolAllocationError extends Error {
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
export declare function
|
|
60
|
+
export declare function expandPreset(preset: SubAgentType, catalog: readonly ToolCatalogEntry[]): string[];
|
|
61
61
|
|
|
62
62
|
export interface ResolvedToolAllocation {
|
|
63
63
|
|
|
@@ -66,4 +66,4 @@ export interface ResolvedToolAllocation {
|
|
|
66
66
|
label: SubAgentType;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
export declare function resolveToolAllocation(
|
|
69
|
+
export declare function resolveToolAllocation(subagentType: SubAgentType, rawTools: readonly string[], catalog: readonly ToolCatalogEntry[]): ResolvedToolAllocation;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const i="default",
|
|
1
|
+
const i="default",p=new Set(["sub_agent","list_sub_agents","get_sub_agent_status","abort_sub_agent","list_sub_agent_tools"]),_=new Set(["poll_message","get_message","send_group","send_private","create_task_instance_comment","submit_task_result","start_task_rollback","finish_task_rollback","reject_task","terminate_task","hire_colleague","hire_colleagues_batch","abandon_memory_update"]);function m(e){return e.kind==="mcp"&&_.has(e.toolName)}function k(e,n){if(n.length===0)return[...e];const r=new Set(e.map(t=>t.exposedName)),o=[...e];for(const t of n)r.has(t.exposedName)||(r.add(t.exposedName),o.push(t));return o}function d(e){return e.kind==="mcp"?e.serverName||"mcp":e.category||i}function T(e,n){return!n||e.length===0?[...e]:e.map(r=>{if(r.kind!=="builtin")return r;const t=r.execute;return typeof t!="function"?r:{...r,execute:(s,c)=>{const a=s&&typeof s=="object"&&s.agentId==null?{...s,agentId:n}:s;return t(a,c)}}})}function h(e){if(e.kind==="mcp"){const t=e.serverName||"mcp",s=[`${t}.${e.toolName}`];return e.exposedName&&e.exposedName!==e.toolName&&s.push(`${t}.${e.exposedName}`),s}const n=e.category||i,r=[`${n}.${e.exposedName}`],o=`${n}_`;return n!==i&&e.exposedName.startsWith(o)&&r.push(`${n}.${e.exposedName.slice(o.length)}`),r}function f(e){let n=e.trim();for(;n.length>0&&(n.endsWith("*")||n.endsWith("."));)n=n.slice(0,-1).trimEnd();return n}function b(e,n){if(m(e))return!1;const r=n.map(t=>typeof t=="string"?f(t):"").filter(t=>t.length>0);if(r.length===0)return!1;const o=h(e);return r.some(t=>o.some(s=>s===t||s.startsWith(`${t}.`)))}function w(e){const n=[],r=new Map;for(const o of e){if(p.has(o.exposedName)||m(o))continue;const t=d(o);let s=r.get(t);s||(s={kind:o.kind,names:[],seen:new Set},r.set(t,s),n.push(t));const c=x(o);s.seen.has(c)||(s.seen.add(c),s.names.push(c))}return n.sort((o,t)=>o===i?-1:t===i?1:o<t?-1:o>t?1:0).map(o=>{const t=r.get(o);return{category:o,kind:t.kind,tools:t.names}})}function x(e){if(e.kind==="mcp")return e.toolName;const n=e.category||i,r=`${n}_`;return n!==i&&e.exposedName.startsWith(r)?e.exposedName.slice(r.length):e.exposedName}const g=new Set(["write_file","edit_file","delete_file"]),y=new Set(["create_memory","read_memory","update_memory","delete_memory","search_memory","list_memories","get_memory_stats","list_memories_by_file","memory_recurrence","memory_recurrence_complete"]),E="explore",N="core",O="custom";class l extends Error{}function A(e,n){if(e==="core")return[i];const r=[],o=n.find(t=>t.category===i);if(o)for(const t of o.tools)g.has(t)||r.push(`${i}.${t}`);for(const t of n)if(t.kind==="mcp")for(const s of t.tools)y.has(s)&&r.push(`${t.category}.${s}`);return r}function $(e,n,r){for(const o of r){if(o.category===n)return;for(const t of o.tools){const s=`${o.category}.${t}`;if(s===n||s.startsWith(`${n}.`))return}}throw e.startsWith("@")?new l(`Unknown tool preset '${e}'. Presets are now specified via the 'subagent_type' parameter ('${E}', '${N}', or 'custom'); '@explore'/'@core' are no longer valid in 'tools'.`):new l(`Unknown tool allocation '${e}'. Allocatable categories: ${r.map(o=>o.category).join(", ")}. Call list_sub_agent_tools to see all allocatable categories and tool paths.`)}function S(e,n,r){if(e==="custom"&&n.length===0)throw new l("'tools' parameter is required when subagent_type is 'custom'. Call list_sub_agent_tools to see all allocatable categories and tool paths.");if(e==="explore"||e==="core")return{patterns:A(e,r),label:e};const o=n.map(a=>typeof a=="string"?a.trim():"").filter(a=>a.length>0),t=[];for(const a of o){const u=f(a);$(a,u,r),t.push(u)}const s=new Set,c=[];for(const a of t)a.length===0||s.has(a)||(s.add(a),c.push(a));return{patterns:c,label:e}}export{_ as AGENT_IDENTITY_MCP_RESTRICTED_TOOLS,i as DEFAULT_TOOL_CATEGORY,g as EXPLORE_READONLY_DENIED_TOOLS,N as PRESET_CORE,E as PRESET_EXPLORE,y as SUB_AGENT_ALLOWED_MCP_TOOLS,p as SUB_AGENT_MANAGEMENT_TOOL_NAMES,O as TYPE_LABEL_CUSTOM,l as ToolAllocationError,w as buildToolCatalog,A as expandPreset,m as isAgentIdentityRestrictedTool,b as matchesToolAllocation,k as mergeAllocatableTools,f as normalizeAllocationPattern,T as rebindDefaultAgentId,S as resolveToolAllocation,h as toolAllocationAliases,d as toolAllocationCategory};
|
|
2
2
|
|
|
@@ -44,6 +44,6 @@ ${n}\u53D8\u5316\u7C7B\u578B: ${s}
|
|
|
44
44
|
|
|
45
45
|
`),m=i.length>a.length?`
|
|
46
46
|
|
|
47
|
-
\uFF08\u53E6\u6709 ${i.length-a.length} \u6761\u5DF2\u5B8C\u6210\uFF0C\u8BF7\u7528
|
|
47
|
+
\uFF08\u53E6\u6709 ${i.length-a.length} \u6761\u5DF2\u5B8C\u6210\uFF0C\u8BF7\u7528 list_background_commands \u67E5\u770B\uFF09`:"";return await N.promises.writeFile(t,JSON.stringify({...n,updatedAt:Date.now(),tasks:s.map(u=>i.some(h=>h.taskId===u.taskId)?{...u,notified:!0}:u)},null,2),"utf-8").catch(u=>{o.warn("[McpServer] \u6807\u8BB0\u540E\u53F0\u4EFB\u52A1\u5DF2\u901A\u77E5\u5931\u8D25: %s",u?.message??u)}),{msgId:`bg-notif-${Date.now()}`,senderId:"MCP-System",senderName:"ACode Background",receiverId:e,content:`[Background commands completed]
|
|
48
48
|
${l}${m}`,requireReply:!1,timestamp:new Date().toISOString()}}catch(e){return o.warn("[McpServer] \u6784\u5EFA\u540E\u53F0\u547D\u4EE4\u5B8C\u6210\u901A\u77E5\u5931\u8D25: %s",e instanceof Error?e.message:String(e)),null}}async start(){const e=new K;await this.server.connect(e),await this.agentClient.initialize(),o.info("[McpServer] MCP Server \u5DF2\u542F\u52A8\uFF0C\u7B49\u5F85\u8FDE\u63A5..."),o.info(`[McpServer] \u53EF\u7528\u5DE5\u5177: ${F.map(t=>t.name).join(", ")}`),o.info(`[McpServer] \u5DE5\u4F5C\u76EE\u5F55: ${process.env.AWS_WORKSPACE_PATH||process.cwd()}`),U&&o.info("[McpServer] \u964D\u7EA7\u6A21\u5F0F\u5DF2\u542F\u7528\uFF0C\u6CE8\u518C\u5931\u8D25\u65F6\u5C06\u4EE5\u79BB\u7EBF\u6A21\u5F0F\u7EE7\u7EED\u8FD0\u884C"),this.autoRegisterInBackground(),o.info("[McpServer] MCP Server \u5DF2\u5C31\u7EEA\uFF0C\u5DE5\u5177\u5DF2\u53EF\u7528")}startLeaseRenewal(){this.leaseRenewalTimer||(this.leaseRenewalTimer=setInterval(async()=>{try{if(!this.getCurrentAgentId())return;(await this.memoryStore.renewMemoryLease(S.LEASE_DURATION_MINUTES)).renewed===0&&(o.warn("[McpServer] \u79DF\u7EA6\u5DF2\u4E22\u5931\uFF08renewed=0\uFF09\uFF0C\u505C\u6B62\u7EED\u671F\u5B9A\u65F6\u5668"),this.stopLeaseRenewal())}catch(e){const t=e instanceof Error?e.message:String(e);t.includes("not supported")?(o.info("[McpServer] \u5F53\u524D\u5B58\u50A8\u4E0D\u652F\u6301\u79DF\u7EA6\u7EED\u671F\uFF0C\u505C\u6B62\u7EED\u671F\u5B9A\u65F6\u5668"),this.stopLeaseRenewal()):o.warn("[McpServer] \u7EED\u671F\u79DF\u7EA6\u5931\u8D25: %s",t)}},S.LEASE_RENEW_INTERVAL_MS),o.info("[McpServer] \u79DF\u7EA6\u7EED\u671F\u5B9A\u65F6\u5668\u5DF2\u542F\u52A8\uFF0C\u95F4\u9694: 60s"))}stopLeaseRenewal(){this.leaseRenewalTimer&&(clearInterval(this.leaseRenewalTimer),this.leaseRenewalTimer=null,o.info("[McpServer] \u79DF\u7EA6\u7EED\u671F\u5B9A\u65F6\u5668\u5DF2\u505C\u6B62"))}stop(){this.stopLeaseRenewal(),this.getCurrentAgentId()&&this.memoryStore.releaseAllMemoryClaims().catch(t=>o.warn("[McpServer] \u91CA\u653E claim \u5931\u8D25: %s",t instanceof Error?t.message:String(t))),this.agentClient.stop(),o.info("[McpServer] MCP Server \u5DF2\u505C\u6B62")}async autoRegister(){const e=this.agentClient.getAgentConfig();o.info(`[McpServer] \u89D2\u8272: "${e.roleName}"`),o.info(`[McpServer] AgentID: "${e.agentId||"(\u81EA\u52A8\u5206\u914D)"}"`),o.info("[McpServer] \u6B63\u5728\u8BF7\u6C42\u8C03\u5EA6\u4E2D\u5FC3\u6CE8\u518C...");let t=0;for(;;)try{const r=await this.agentClient.register();o.info(`[McpServer] \u6CE8\u518C\u6210\u529F: ${r.displayName} (${r.agentId})`),o.info(`[McpServer] \u72B6\u6001: ${r.status}`),this.startListeningInternal(),o.info("[McpServer] \u6D88\u606F\u76D1\u542C\u5DF2\u81EA\u52A8\u542F\u52A8");const n=this.agentClient.getStatusReporter();n&&n.reportWaitingInput(),await this.reportMemoryStatsToServer(),this.maybeSyncPermanentMemoryToServer();return}catch(r){const n=r instanceof Error?r.message:String(r);if(t++,O>0&&t>=O){if(U){o.warn(`[McpServer] \u6CE8\u518C\u8D85\u8FC7\u6700\u5927\u91CD\u8BD5\u6B21\u6570 (${O}\u6B21)\uFF0C\u8FDB\u5165\u964D\u7EA7\u6A21\u5F0F`),this.agentClient.enterDegradedMode(),this.startListeningInternal(),o.info("[McpServer] \u964D\u7EA7\u6A21\u5F0F\uFF1A\u6D88\u606F\u76D1\u542C\u5DF2\u542F\u52A8"),this.agentClient.retryRegistrationInBackground(se,ie);const s=this.agentClient.getStatusReporter();s&&s.reportWaitingInput(),await this.reportMemoryStatsToServer();return}throw new Error(`\u6CE8\u518C\u8D85\u8FC7\u6700\u5927\u91CD\u8BD5\u6B21\u6570 (${O}\u6B21)\uFF0C\u653E\u5F03\u542F\u52A8: ${n}`)}o.warn(`[McpServer] \u6CE8\u518C\u5931\u8D25\uFF0C\u7B49\u5F85\u91CD\u8BD5... (${t}/${O}): ${n}`),await this.delay(re)}}autoRegisterInBackground(){this.autoRegister().catch(e=>{o.error("[McpServer] \u540E\u53F0\u6CE8\u518C\u5F02\u5E38: %s, stack=%s",e instanceof Error?e.message:String(e),e instanceof Error?e.stack:"(no stack)")})}startListeningInternal(){o.info("[McpServer] startListeningInternal \u88AB\u8C03\u7528");const e=t=>{o.info(`[McpServer] profileHandler \u88AB\u8C03\u7528\uFF0CdisplayName: ${t.displayName}`),this.messageBuffer.setProfileMessage(t),this.profileSynced=!0,this.syncRoleMemoryStore(t),this.maybeSyncPermanentMemoryToServer()};if(this.agentClient.isInDegradedMode()){o.info("[McpServer] \u964D\u7EA7\u6A21\u5F0F\uFF1A\u8DF3\u8FC7 WebSocket \u8FDE\u63A5\uFF0C\u4EC5\u542F\u52A8\u672C\u5730\u6D88\u606F\u76D1\u542C"),this.agentClient.start(this.handleIncomingMessage.bind(this),{pollMode:!1,profileHandler:e,systemNotifyHandler:this.handleSystemNotify.bind(this)}),this.activelySyncProfile();return}this.agentClient.start(this.handleIncomingMessage.bind(this),{pollMode:!1,profileHandler:e,systemNotifyHandler:this.handleSystemNotify.bind(this)}),this.activelySyncProfile()}activelySyncProfile(){this.profileSynced||this.agentClient.getProfile().then(e=>{this.profileSynced||(this.profileSynced=!0,o.info(`[McpServer] \u4E3B\u52A8\u83B7\u53D6 profile \u6210\u529F: displayName=${e.displayName}, roleName="${e.roleName??"(\u7A7A)"}"`),this.messageBuffer.setProfileMessage(e),this.syncRoleMemoryStore(e),this.maybeSyncPermanentMemoryToServer())}).catch(e=>{o.warn("[McpServer] \u4E3B\u52A8\u83B7\u53D6 profile \u5931\u8D25: %s",e instanceof Error?e.message:String(e))})}delay(e){return new Promise(t=>setTimeout(t,e))}}export{S as McpServer};
|
|
49
49
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aws-runtime-bridge",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.131",
|
|
4
4
|
"description": "AgentsWorkStudio runtime bridge service for machine-level agent runtime integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"playwright"
|
|
30
30
|
],
|
|
31
31
|
"optionalDependencies": {
|
|
32
|
-
"node-windows": "^1.0.0-beta.8"
|
|
32
|
+
"node-windows": "^1.0.0-beta.8",
|
|
33
|
+
"sharp": "^0.35.3"
|
|
33
34
|
},
|
|
34
35
|
"engines": {
|
|
35
36
|
"node": ">=20.0.0 <25"
|
|
@@ -77,7 +78,6 @@
|
|
|
77
78
|
"node-pty": "^1.0.0",
|
|
78
79
|
"node-screenshots": "^0.2.8",
|
|
79
80
|
"playwright": "^1.62.0",
|
|
80
|
-
"sharp": "^0.35.3",
|
|
81
81
|
"tar": "^7.5.15",
|
|
82
82
|
"unzipper": "^0.12.3",
|
|
83
83
|
"uuid": "^11.0.3",
|