aws-runtime-bridge 1.9.185 → 1.9.186

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.
@@ -1,4 +1,4 @@
1
- import{EventEmitter as _}from"node:events";import{logger as h}from"./logger.js";const d="[temp clipboard paste file]",g=/[A-Z]:(?:\\\\|\\)[^\r\n"'`]*?(?:\\\\|\\)mini-term-clipboard(?:\\\\|\\)paste-\d+\.txt/gi,A=/\/[^\r\n"'`]*?\/mini-term-clipboard\/paste-\d+\.txt/gi,S=/mini-term-clipboard[\\/]paste-\d+\.txt/gi,w=new Set(["aws-mcp","agents-work-studio"]),f=500;function p(c){return c.replace(g,d).replace(A,d).replace(S,d)}const y=/^(password|passwd|secret|token|api[-_]?key|access[-_]?key|private[-_]?key|authorization|credential)/i;function m(c,e=0){if(e>8)return c;if(Array.isArray(c))return c.map(t=>m(t,e+1));if(c!==null&&typeof c=="object"){const t={};for(const[r,i]of Object.entries(c))typeof i=="string"&&y.test(r)?t[r]="[redacted]":t[r]=m(i,e+1);return t}return c}class u extends _{config;currentStatus="stopped";currentAction=null;constructor(e){super(),this.config=e}reportStarting(){this.updateStatus("starting")}reportRunning(){this.updateStatus("running")}reportWaitingInput(){this.updateStatus("waiting_input"),this.clearAction()}reportThinking(){this.updateStatus("thinking"),this.clearAction()}reportStopped(){this.updateStatus("stopped"),this.clearAction()}reportError(){this.updateStatus("error"),this.clearAction()}reportToolUse(e,t){const r=this.parseToolAction(e,t);this.updateStatus("tool_using",r.type,r.label,r.detail,void 0,this.formatToolInput(t))}reportToolResult(e){this.updateStatus("tool_using",this.currentAction?.type,this.currentAction?.label,this.currentAction?.detail,this.formatToolResult(e),this.currentAction?.input)}reportToolError(e){const t=e instanceof Error?e.message:String(e);this.updateStatus("error",this.currentAction?.type,this.currentAction?.label||"Tool call failed",this.currentAction?.detail,t,this.currentAction?.input),this.clearAction()}static KNOWN_MCP_TOOLS={get_colleague:"aws-mcp",list_colleague_events:"aws-mcp",get_group_rooms:"aws-mcp",list_project_members:"aws-mcp",get_profile:"aws-mcp",hire_colleague:"aws-mcp",send_group:"aws-mcp",send_private:"aws-mcp",poll_message:"aws-mcp",get_message:"aws-mcp",get_dm_history:"aws-mcp",get_group_history:"aws-mcp",my_task:"aws-mcp",create_task_instance_comment:"aws-mcp",submit_task_result:"aws-mcp",start_task_rollback:"aws-mcp",finish_task_rollback:"aws-mcp",create_memory:"aws-mcp",read_memory:"aws-mcp",update_memory:"aws-mcp",delete_memory:"aws-mcp",search_memory:"aws-mcp",list_memories:"aws-mcp"};static canonicalizeMcpServer(e,t){const r=u.KNOWN_MCP_TOOLS[t.toLowerCase()];return r&&w.has(e.toLowerCase())?r:e}static formatMcpDetail(e,t){return e?t?`${u.canonicalizeMcpServer(e,t)}/${t}`:e:t}parseToolAction(e,t){const r=e.toLowerCase(),i=r.replace(/[_-]/g,""),a=(...n)=>{for(const s of n){if(typeof s=="string"&&s.trim())return p(s);if(Array.isArray(s)&&s.length>0){const l=s[0];if(typeof l=="string"&&l.trim())return p(l)}}};if(r.includes("skill")||r.includes("disclose"))return{type:"skill",label:"Calling skill",detail:t?.name?p(String(t.name)):void 0};const o=u.KNOWN_MCP_TOOLS[r];if(o)return{type:"mcp",label:"Calling MCP",detail:u.formatMcpDetail(o,e)};if(r.startsWith("mcp__")){const n=e.split("__"),s=n[1]||"",l=n.slice(2).join("__");return{type:"mcp",label:"Calling MCP",detail:u.formatMcpDetail(s,l)}}if(r.startsWith("mcp_")||r.includes("_mcp_"))return{type:"mcp",label:"Calling MCP",detail:e.replace(/^mcp_/,"").replace(/_/g," ")};if(r.includes("-mcp__")){const n=e.split("__"),s=n[0],l=n.slice(1).join("__");return{type:"mcp",label:"Calling MCP",detail:u.formatMcpDetail(s,l)}}if(i==="edit"||i==="editfile"||i==="strreplace"||i==="editcode"||i==="applypatch"||i==="multiedit")return{type:"edit_file",label:"\u7F16\u8F91\u6587\u4EF6",detail:a(t?.path,t?.file_path,t?.filePath,t?.target_file,t?.targetFile)};if(i==="write"||i==="writefile"||i==="fswrite")return{type:"write_file",label:"\u5199\u5165\u6587\u4EF6",detail:a(t?.path,t?.file_path,t?.filePath,t?.target_file,t?.targetFile)};if(i==="read"||i==="readfile"||i==="readcode"||i==="readmultiplefiles")return{type:"read_file",label:"\u8BFB\u53D6\u6587\u4EF6",detail:a(t?.path,t?.file_path,t?.filePath,t?.paths,t?.target_file,t?.targetFile)};if(i==="bash"||i==="execute"||i==="shell"||i==="pwsh"||i==="executepwsh"||i==="controlpwshprocess"||i==="runcommand"){const n=a(t?.command,t?.cmd,t?.argv);return{type:"bash",label:"\u6267\u884C\u547D\u4EE4",detail:n&&n.length>f?`${n.substring(0,f)}...\uFF08\u5185\u5BB9\u8FC7\u957F\uFF0C\u5DF2\u622A\u65AD\uFF09`:n}}return i==="search"||i==="grep"||i==="find"||i==="glob"||i==="grepsearch"||i==="filesearch"?{type:"search",label:"\u641C\u7D22\u6587\u4EF6",detail:t?.query?p(String(t.query)):void 0}:r.includes("web")||r.includes("fetch")||r.includes("http")?{type:"web",label:"\u7F51\u7EDC\u8BF7\u6C42",detail:t?.url?p(String(t.url)):void 0}:{type:"tool_using",label:"Calling tool",detail:e}}updateStatus(e,t,r,i,a,o){this.currentStatus=e,t&&(this.currentAction={type:t,label:r,detail:i,input:o});const n={agentId:this.config.agentId,status:e,actionType:t??void 0,actionLabel:t?this.currentAction?.label:void 0,actionDetail:t?this.currentAction?.detail:void 0,actionInput:t?this.currentAction?.input:void 0,actionResult:a,timestamp:new Date().toISOString()};h.info(`[StatusReporter] \u72B6\u6001\u66F4\u65B0: ${e}${r?` - ${r}`:""}`),this.config.sendStatusUpdate(n)}clearAction(){this.currentAction=null}formatToolInput(e){if(!(!e||Object.keys(e).length===0))try{const t=p(JSON.stringify(m(e),null,2)),r=6e3;return t.length<=r?t:`${t.slice(0,r)}
1
+ import{EventEmitter as _}from"node:events";import{logger as h}from"./logger.js";const d="[temp clipboard paste file]",g=/[A-Z]:(?:\\\\|\\)[^\r\n"'`]*?(?:\\\\|\\)mini-term-clipboard(?:\\\\|\\)paste-\d+\.txt/gi,A=/\/[^\r\n"'`]*?\/mini-term-clipboard\/paste-\d+\.txt/gi,S=/mini-term-clipboard[\\/]paste-\d+\.txt/gi,w=new Set(["aws-mcp","agents-work-studio"]),f=500;function p(c){return c.replace(g,d).replace(A,d).replace(S,d)}const y=/^(password|passwd|secret|token|api[-_]?key|access[-_]?key|private[-_]?key|authorization|credential)/i;function m(c,e=0){if(e>8)return c;if(Array.isArray(c))return c.map(t=>m(t,e+1));if(c!==null&&typeof c=="object"){const t={};for(const[r,i]of Object.entries(c))typeof i=="string"&&y.test(r)?t[r]="[redacted]":t[r]=m(i,e+1);return t}return c}class u extends _{config;currentStatus="stopped";currentAction=null;constructor(e){super(),this.config=e}reportStarting(){this.updateStatus("starting")}reportRunning(){this.updateStatus("running")}reportWaitingInput(){this.updateStatus("waiting_input"),this.clearAction()}reportThinking(){this.updateStatus("thinking"),this.clearAction()}reportStopped(){this.updateStatus("stopped"),this.clearAction()}reportError(){this.updateStatus("error"),this.clearAction()}reportToolUse(e,t){const r=this.parseToolAction(e,t);this.updateStatus("tool_using",r.type,r.label,r.detail,void 0,this.formatToolInput(t))}reportToolResult(e){this.updateStatus("tool_using",this.currentAction?.type,this.currentAction?.label,this.currentAction?.detail,this.formatToolResult(e),this.currentAction?.input)}reportToolError(e){const t=e instanceof Error?e.message:String(e);this.updateStatus("error",this.currentAction?.type,this.currentAction?.label||"Tool call failed",this.currentAction?.detail,t,this.currentAction?.input),this.clearAction()}static KNOWN_MCP_TOOLS={get_colleague:"aws-mcp",list_colleague_events:"aws-mcp",get_group_rooms:"aws-mcp",list_project_members:"aws-mcp",get_profile:"aws-mcp",hire_colleague:"aws-mcp",send_group:"aws-mcp",send_private:"aws-mcp",get_send_status:"aws-mcp",poll_message:"aws-mcp",get_message:"aws-mcp",get_dm_history:"aws-mcp",get_group_history:"aws-mcp",my_task:"aws-mcp",create_task_instance_comment:"aws-mcp",submit_task_result:"aws-mcp",start_task_rollback:"aws-mcp",finish_task_rollback:"aws-mcp",create_memory:"aws-mcp",read_memory:"aws-mcp",update_memory:"aws-mcp",delete_memory:"aws-mcp",search_memory:"aws-mcp",list_memories:"aws-mcp"};static canonicalizeMcpServer(e,t){const r=u.KNOWN_MCP_TOOLS[t.toLowerCase()];return r&&w.has(e.toLowerCase())?r:e}static formatMcpDetail(e,t){return e?t?`${u.canonicalizeMcpServer(e,t)}/${t}`:e:t}parseToolAction(e,t){const r=e.toLowerCase(),i=r.replace(/[_-]/g,""),a=(...n)=>{for(const s of n){if(typeof s=="string"&&s.trim())return p(s);if(Array.isArray(s)&&s.length>0){const l=s[0];if(typeof l=="string"&&l.trim())return p(l)}}};if(r.includes("skill")||r.includes("disclose"))return{type:"skill",label:"Calling skill",detail:t?.name?p(String(t.name)):void 0};const o=u.KNOWN_MCP_TOOLS[r];if(o)return{type:"mcp",label:"Calling MCP",detail:u.formatMcpDetail(o,e)};if(r.startsWith("mcp__")){const n=e.split("__"),s=n[1]||"",l=n.slice(2).join("__");return{type:"mcp",label:"Calling MCP",detail:u.formatMcpDetail(s,l)}}if(r.startsWith("mcp_")||r.includes("_mcp_"))return{type:"mcp",label:"Calling MCP",detail:e.replace(/^mcp_/,"").replace(/_/g," ")};if(r.includes("-mcp__")){const n=e.split("__"),s=n[0],l=n.slice(1).join("__");return{type:"mcp",label:"Calling MCP",detail:u.formatMcpDetail(s,l)}}if(i==="edit"||i==="editfile"||i==="strreplace"||i==="editcode"||i==="applypatch"||i==="multiedit")return{type:"edit_file",label:"\u7F16\u8F91\u6587\u4EF6",detail:a(t?.path,t?.file_path,t?.filePath,t?.target_file,t?.targetFile)};if(i==="write"||i==="writefile"||i==="fswrite")return{type:"write_file",label:"\u5199\u5165\u6587\u4EF6",detail:a(t?.path,t?.file_path,t?.filePath,t?.target_file,t?.targetFile)};if(i==="read"||i==="readfile"||i==="readcode"||i==="readmultiplefiles")return{type:"read_file",label:"\u8BFB\u53D6\u6587\u4EF6",detail:a(t?.path,t?.file_path,t?.filePath,t?.paths,t?.target_file,t?.targetFile)};if(i==="bash"||i==="execute"||i==="shell"||i==="pwsh"||i==="executepwsh"||i==="controlpwshprocess"||i==="runcommand"){const n=a(t?.command,t?.cmd,t?.argv);return{type:"bash",label:"\u6267\u884C\u547D\u4EE4",detail:n&&n.length>f?`${n.substring(0,f)}...\uFF08\u5185\u5BB9\u8FC7\u957F\uFF0C\u5DF2\u622A\u65AD\uFF09`:n}}return i==="search"||i==="grep"||i==="find"||i==="glob"||i==="grepsearch"||i==="filesearch"?{type:"search",label:"\u641C\u7D22\u6587\u4EF6",detail:t?.query?p(String(t.query)):void 0}:r.includes("web")||r.includes("fetch")||r.includes("http")?{type:"web",label:"\u7F51\u7EDC\u8BF7\u6C42",detail:t?.url?p(String(t.url)):void 0}:{type:"tool_using",label:"Calling tool",detail:e}}updateStatus(e,t,r,i,a,o){this.currentStatus=e,t&&(this.currentAction={type:t,label:r,detail:i,input:o});const n={agentId:this.config.agentId,status:e,actionType:t??void 0,actionLabel:t?this.currentAction?.label:void 0,actionDetail:t?this.currentAction?.detail:void 0,actionInput:t?this.currentAction?.input:void 0,actionResult:a,timestamp:new Date().toISOString()};h.info(`[StatusReporter] \u72B6\u6001\u66F4\u65B0: ${e}${r?` - ${r}`:""}`),this.config.sendStatusUpdate(n)}clearAction(){this.currentAction=null}formatToolInput(e){if(!(!e||Object.keys(e).length===0))try{const t=p(JSON.stringify(m(e),null,2)),r=6e3;return t.length<=r?t:`${t.slice(0,r)}
2
2
  ...(input too long, truncated)`}catch{return}}formatToolResult(e){let t;try{t=typeof e=="string"?e:JSON.stringify(e,null,2)}catch(o){t=`[Unable to serialize tool result: ${o instanceof Error?o.message:String(o)}]`}const r=t||String(e),i=4e3,a=p(r);return a.length<=i?a:`${a.slice(0,i)}
3
3
  ...(result too long, truncated)`}getCurrentStatus(){return{agentId:this.config.agentId,status:this.currentStatus,actionType:this.currentAction?.type,actionLabel:this.currentAction?.label,actionDetail:this.currentAction?.detail,actionInput:this.currentAction?.input,timestamp:new Date().toISOString()}}}export{u as StatusReporter,p as redactTransientClipboardPastePaths};
4
4
 
@@ -673,16 +673,14 @@ export interface SendPrivateArgs {
673
673
 
674
674
 
675
675
 
676
+
677
+
678
+
676
679
  export interface VoiceSendOptions {
677
680
 
678
681
  emotion?: "neutral" | "happy" | "excited" | "calm" | "sad" | "serious";
679
682
 
680
683
  speaker?: number | string;
681
-
682
-
683
-
684
-
685
- async?: boolean;
686
684
  }
687
685
 
688
686
  export interface SendGroupArgs {
@@ -697,6 +695,8 @@ export interface SendGroupArgs {
697
695
  replyTo?: ReplyToRef[];
698
696
 
699
697
  voice?: VoiceSendOptions;
698
+
699
+ mentions?: string[];
700
700
  }
701
701
 
702
702
  export interface GetDmHistoryArgs {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aws-runtime-bridge",
3
- "version": "1.9.185",
3
+ "version": "1.9.186",
4
4
  "description": "AgentsWorkStudio runtime bridge service for machine-level agent runtime integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",