@axiom-lattice/gateway 4.2.2 → 4.2.3
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/{a2a-standard-VEQBXBMM.mjs → a2a-standard-ALXWP7V6.mjs} +2 -2
- package/dist/chunk-EMYRCJOI.mjs +99 -0
- package/dist/chunk-EMYRCJOI.mjs.map +1 -0
- package/dist/{chunk-J4BK77PA.mjs → chunk-YKTXW6F6.mjs} +11 -1
- package/dist/chunk-YKTXW6F6.mjs.map +1 -0
- package/dist/embed/{embed-page-AgentDetailSideApp-DTDBMB2U.js → embed-page-AgentDetailSideApp-3LBCEKFU.js} +1 -1
- package/dist/embed/{embed-page-AgentGovernanceWorkbench-JUP6SNBX.js → embed-page-AgentGovernanceWorkbench-K3JUQNBW.js} +1 -1
- package/dist/embed/{embed-page-MessageGraph-H5S7SARE.js → embed-page-MessageGraph-3X4ROEN6.js} +1 -1
- package/dist/embed/{embed-page-ReactChart-FWXMXO7F.js → embed-page-ReactChart-F6VYCIYY.js} +1 -1
- package/dist/embed/{embed-page-SkillFlow-SFZ5HLMK.js → embed-page-SkillFlow-3CF7R3CW.js} +1 -1
- package/dist/embed/{embed-page-TasksSideApp-Q6HTW6S6.js → embed-page-TasksSideApp-3WRDBZU3.js} +1 -1
- package/dist/embed/{embed-page-TeamWorkspace-6KFWCIKW.js → embed-page-TeamWorkspace-6JSMZYUF.js} +1 -1
- package/dist/embed/{embed-page-TopologyRuntimeView-MASWKWXA.js → embed-page-TopologyRuntimeView-YDFENLHH.js} +1 -1
- package/dist/embed/{embed-page-WorkflowAutomationView-6UOT36GW.js → embed-page-WorkflowAutomationView-MP5B7Q2Q.js} +1 -1
- package/dist/embed/{embed-page-chunk-AVZ7FKIO.js → embed-page-chunk-B2E2XOH2.js} +10 -10
- package/dist/embed/{embed-page-chunk-X4DK4JRG.js → embed-page-chunk-FFO7CAYL.js} +1 -1
- package/dist/embed/{embed-page-chunk-NHOWQIND.js → embed-page-chunk-GDTBDOUE.js} +284 -204
- package/dist/embed/{embed-page-chunk-NFLB3VUZ.js → embed-page-chunk-IRP6JSSX.js} +1 -1
- package/dist/embed/{embed-page-chunk-3EUETTEM.js → embed-page-chunk-PAJ5NG2Z.js} +1 -1
- package/dist/embed/{embed-page-chunk-FJ3SFKJY.js → embed-page-chunk-QEYWJHEK.js} +1 -1
- package/dist/embed/{embed-page-chunk-N46WJ2FS.js → embed-page-chunk-RVXX5HKF.js} +1 -1
- package/dist/embed/{embed-page-chunk-2WCPJYBC.js → embed-page-chunk-UOL6CUAL.js} +1 -1
- package/dist/embed/{embed-page-chunk-74BPRLSV.js → embed-page-chunk-URNZX66S.js} +5 -5
- package/dist/embed/{embed-page-chunk-7SO4HHS4.js → embed-page-chunk-YMJGPA3F.js} +163 -145
- package/dist/embed/embed-page.js +1 -1
- package/dist/index.d.mts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +1720 -872
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1209 -430
- package/dist/index.mjs.map +1 -1
- package/dist/{resources-SRQRKW5G.mjs → resources-JFKAPS45.mjs} +16 -10
- package/dist/resources-JFKAPS45.mjs.map +1 -0
- package/package.json +9 -7
- package/dist/chunk-J4BK77PA.mjs.map +0 -1
- package/dist/chunk-LHQY46YB.mjs +0 -47
- package/dist/chunk-LHQY46YB.mjs.map +0 -1
- package/dist/resources-SRQRKW5G.mjs.map +0 -1
- /package/dist/{a2a-standard-VEQBXBMM.mjs.map → a2a-standard-ALXWP7V6.mjs.map} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{D as Oe,Ha as
|
|
2
|
-
`,n),p=o===-1?e.length:o+1,g=o===-1?e.length:o,d=e.slice(n,g),c=d.endsWith("\r")?d.slice(0,-1):d,m=c.match(/^ {0,3}(`{3,}|~{3,})/),y=a!==void 0;if(!a&&m?a={marker:m[1][0],length:m[1].length}:a&&new RegExp(`^ {0,3}\\${a.marker}{${a.length},}[ \\t]*$`).test(c)&&(a=void 0),t.push({text:c,start:n,end:p,fenced:y||m!==null,lineNumber:t.length+1}),o===-1)break;n=p}return t}function wt(e,t){let n=Ge(e),a=[];for(let o=0;o<n.length;o+=1){let p=n[o];if(p.fenced||p.text.trimEnd().replace(/^ {0,3}/,"")!==t)continue;let g=e.length;for(let d=o+1;d<n.length;d+=1)if(!n[d].fenced&&/^ {0,3}#{1,2}(?:[ \t]+|$)/.test(n[d].text)){g=n[d].start;break}a.push({headingLine:o,start:p.start,end:g})}return a}function ge(e){let t=e.trim(),n=t.length-1;if(!t.startsWith("|")||!t.endsWith("|")||Fe(t,n))return;let a=[],o="";for(let p=1;p<t.length-1;p+=1){let g=t[p];g==="|"&&Fe(t,p)?o+=g:g==="|"?(a.push(Le(o.trim())),o=""):o+=g}return a.push(Le(o.trim())),a}function Le(e){let t="";for(let n=0;n<e.length;n+=1)e[n]==="\\"&&(e[n+1]==="\\"||e[n+1]==="|")&&(n+=1),t+=e[n];return t}function Fe(e,t){let n=0;for(let a=t-1;a>=0&&e[a]==="\\";a-=1)n+=1;return n%2===1}function F(e,t,n={}){return{success:!1,code:e,message:t,...n}}function ye(e){let t=wt(e,xt);if(t.length===0)return F("MISSING_BELIEF_STATE","Markdown does not contain a Belief State section.");if(t.length>1)return F("DUPLICATE_BELIEF_STATE","Markdown contains more than one Belief State section.");let n=Ge(e),a=t[0],o=n.slice(a.headingLine+1).filter(m=>m.start<a.end&&m.text.trim()!==""),p=o[0]&&ge(o[0].text),g=o[1]&&ge(o[1].text);if(!p||p.length!==fe.length||p.some((m,y)=>m!==fe[y])||!g||g.length!==fe.length||g.some(m=>!/^:?-{3,}:?$/.test(m)))return F("INVALID_BELIEF_HEADERS","Belief State must use the canonical four-column headers.");let d=[],c=new Set;for(let m of o.slice(2)){let y=ge(m.text);if(!y||y.length!==4||y[3].length===0)return F("MALFORMED_BELIEF_ROW","Belief State contains a malformed row.",{line:m.lineNumber});let h=y[0].match(/^`([^`]+)`$/);if(!h||!It.test(h[1]))return F("INVALID_BELIEF_KEY","Belief keys must be backtick-wrapped kebab-case.",{line:m.lineNumber});let f=h[1];if(c.has(f))return F("DUPLICATE_BELIEF_KEY",`Belief key '${f}' appears more than once.`,{line:m.lineNumber,key:f});for(let[
|
|
1
|
+
import{D as Oe,Ha as _,Pa as Me,Q as Be,Va as j,da as W,e as Se,g as De,ha as je,p as ue,qa as me,s as _e,t as ee,w as $e,z as Pe}from"./embed-page-chunk-YMJGPA3F.js";import{a as D}from"./embed-page-chunk-MB65DZAX.js";import{W as Ae,Z as ce,pa as Ce,va as pe}from"./embed-page-chunk-O4QK5LWZ.js";import{a as Z}from"./embed-page-chunk-4BKXE5ON.js";import{e as k}from"./embed-page-chunk-6Y3UYJ6Z.js";var ie=k(Z());var I=k(Z());var V=k(Z());var U={HUMAN:"human",AI:"ai",TOOL:"tool",INTERRUPT:"interrupt",ERROR:"error",MESSAGE_COMPLETED:"message_completed",MESSAGE_FAILED:"message_failed",THREAD_IDLE:"thread_idle"};var vt="^execution-result:[A-Za-z0-9._:-]+$",Gt=new RegExp(vt);var xt="## Belief State";var fe=["Belief Key","Probability","Target","Basis"],It=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,Tt=/^(?:100|[0-9]{1,2})%$/;function Ge(e){let t=[],n=0,a;for(;n<=e.length;){let o=e.indexOf(`
|
|
2
|
+
`,n),p=o===-1?e.length:o+1,g=o===-1?e.length:o,d=e.slice(n,g),c=d.endsWith("\r")?d.slice(0,-1):d,m=c.match(/^ {0,3}(`{3,}|~{3,})/),y=a!==void 0;if(!a&&m?a={marker:m[1][0],length:m[1].length}:a&&new RegExp(`^ {0,3}\\${a.marker}{${a.length},}[ \\t]*$`).test(c)&&(a=void 0),t.push({text:c,start:n,end:p,fenced:y||m!==null,lineNumber:t.length+1}),o===-1)break;n=p}return t}function wt(e,t){let n=Ge(e),a=[];for(let o=0;o<n.length;o+=1){let p=n[o];if(p.fenced||p.text.trimEnd().replace(/^ {0,3}/,"")!==t)continue;let g=e.length;for(let d=o+1;d<n.length;d+=1)if(!n[d].fenced&&/^ {0,3}#{1,2}(?:[ \t]+|$)/.test(n[d].text)){g=n[d].start;break}a.push({headingLine:o,start:p.start,end:g})}return a}function ge(e){let t=e.trim(),n=t.length-1;if(!t.startsWith("|")||!t.endsWith("|")||Fe(t,n))return;let a=[],o="";for(let p=1;p<t.length-1;p+=1){let g=t[p];g==="|"&&Fe(t,p)?o+=g:g==="|"?(a.push(Le(o.trim())),o=""):o+=g}return a.push(Le(o.trim())),a}function Le(e){let t="";for(let n=0;n<e.length;n+=1)e[n]==="\\"&&(e[n+1]==="\\"||e[n+1]==="|")&&(n+=1),t+=e[n];return t}function Fe(e,t){let n=0;for(let a=t-1;a>=0&&e[a]==="\\";a-=1)n+=1;return n%2===1}function F(e,t,n={}){return{success:!1,code:e,message:t,...n}}function ye(e){let t=wt(e,xt);if(t.length===0)return F("MISSING_BELIEF_STATE","Markdown does not contain a Belief State section.");if(t.length>1)return F("DUPLICATE_BELIEF_STATE","Markdown contains more than one Belief State section.");let n=Ge(e),a=t[0],o=n.slice(a.headingLine+1).filter(m=>m.start<a.end&&m.text.trim()!==""),p=o[0]&&ge(o[0].text),g=o[1]&&ge(o[1].text);if(!p||p.length!==fe.length||p.some((m,y)=>m!==fe[y])||!g||g.length!==fe.length||g.some(m=>!/^:?-{3,}:?$/.test(m)))return F("INVALID_BELIEF_HEADERS","Belief State must use the canonical four-column headers.");let d=[],c=new Set;for(let m of o.slice(2)){let y=ge(m.text);if(!y||y.length!==4||y[3].length===0)return F("MALFORMED_BELIEF_ROW","Belief State contains a malformed row.",{line:m.lineNumber});let h=y[0].match(/^`([^`]+)`$/);if(!h||!It.test(h[1]))return F("INVALID_BELIEF_KEY","Belief keys must be backtick-wrapped kebab-case.",{line:m.lineNumber});let f=h[1];if(c.has(f))return F("DUPLICATE_BELIEF_KEY",`Belief key '${f}' appears more than once.`,{line:m.lineNumber,key:f});for(let[E,N]of[[1,"probability"],[2,"target"]])if(!Tt.test(y[E]))return F("INVALID_BELIEF_PERCENT",`Belief ${N} must be an integer from 0% to 100%.`,{line:m.lineNumber,column:N});c.add(f),d.push({key:f,probability:Number.parseInt(y[1],10),target:Number.parseInt(y[2],10),basis:y[3]})}return{success:!0,state:{entries:d}}}var Nt=2e3,kt=12,Et=100;function Rt(e){if(!At(e,["type","widget"])||e.type!=="widget"||!Ke(e.widget))return;let t=e.widget;if(t.kind==="callout")return!ze(t,["kind","text"],["title","tone"])||!H(t.text)||t.title!==void 0&&!H(t.title)||t.tone!==void 0&&t.tone!=="info"&&t.tone!=="success"&&t.tone!=="warning"?void 0:{type:"widget",widget:{kind:"callout",text:t.text,...typeof t.title=="string"?{title:t.title}:{},...t.tone?{tone:t.tone}:{}}};if(t.kind==="table"){if(!ze(t,["kind","columns","rows"],["caption"])||!Array.isArray(t.columns)||!Array.isArray(t.rows))return;let n=t.columns,a=t.rows;return n.length===0||n.length>kt||!n.every(H)||a.length>Et||!a.every(o=>Array.isArray(o)&&o.length===n.length&&o.every(H))||t.caption!==void 0&&!H(t.caption)?void 0:{type:"widget",widget:{kind:"table",columns:[...n],rows:a.map(o=>[...o]),...typeof t.caption=="string"?{caption:t.caption}:{}}}}}function H(e){return typeof e=="string"&&e.length<=Nt}function Ke(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function At(e,t){return Ke(e)&&Object.keys(e).length===t.length&&t.every(n=>n in e)}function ze(e,t,n){let a=Object.keys(e);return t.every(o=>o in e)&&a.every(o=>t.includes(o)||n.includes(o))}function Kt(e={}){return{startedToolIds:new Set,allowInterrupts:e.allowInterrupts??!0,allowGenUI:e.allowGenUI??!1}}function Wt(e,t){if(e.type===U.AI){let n=[],a=t?.startedToolIds??new Set;if(typeof e.data.content=="string"&&e.data.content&&n.push({type:"message.delta",text:e.data.content}),t?.allowGenUI&&Array.isArray(e.data.content))for(let o of e.data.content){let p=Rt(o);p&&n.push({type:"genui.render",block:p})}for(let o of e.data.tool_call_chunks??[])o.id&&o.name&&!a.has(o.id)&&(a.add(o.id),n.push({type:"tool.started",id:o.id,name:o.name}));for(let o of e.data.tool_calls??[])a.has(o.id)||(a.add(o.id),n.push({type:"tool.started",id:o.id,name:o.name}));return n}if(e.type===U.TOOL&&e.data.tool_call_id)return[{type:"tool.completed",id:e.data.tool_call_id}];if(e.type===U.INTERRUPT){if(t&&!t.allowInterrupts)return[{type:"stream.completed"}];let n=Ct(e);return n?[{type:"interrupt.created",interrupt:n},{type:"stream.completed"}]:[{type:"stream.completed"}]}if(e.type===U.MESSAGE_COMPLETED)return[{type:"message.completed",messageId:e.data.id},{type:"stream.completed"}];if(e.type===U.ERROR){let n=typeof e.data.code=="string"?e.data.code:"stream_error";return n==="aborted"||n==="superseded"?[{type:"stream.completed"}]:[{type:"error",error:{code:"STREAM_FAILED",message:typeof e.data.content=="string"&&e.data.content?e.data.content:"Stream failed",retryable:!1}},{type:"stream.completed"}]}return e.type===U.MESSAGE_FAILED?[{type:"error",error:{code:"STREAM_FAILED",message:"Stream failed",retryable:!0}},{type:"stream.completed"}]:[]}function Ct(e){let t=St(e.data.content);if(!t)return;let n=e.id,a=typeof n=="string"?n:e.data.id;if(a)return{id:a,type:typeof t.type=="string"?t.type:"input",prompt:typeof t.prompt=="string"?t.prompt:typeof t.message=="string"?t.message:"Input required",...he(t.data)?{data:t.data}:{}}}function St(e){if(!e)return{};if(he(e))return e;if(typeof e=="string")try{let t=JSON.parse(e);return he(t)?t:{prompt:e}}catch{return{prompt:e}}}function he(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var T=k(D());function We(e){if(!e||!ye(e).success)return e??"";let t=e.split(`
|
|
3
3
|
`),n,a=t.map(d=>{let c=d.match(/^ {0,3}(`{3,}|~{3,})/),m=n!==void 0;return!n&&c?n={marker:c[1][0],length:c[1].length}:n&&new RegExp(`^ {0,3}\\${n.marker}{${n.length},}[ \\t]*$`).test(d)&&(n=void 0),m||c!==null}),o=t.findIndex((d,c)=>!a[c]&&/^ {0,3}##\s+Belief State\s*$/i.test(d.trimEnd()));if(o<0)return e;let p=t.slice(o+1).findIndex((d,c)=>!a[o+1+c]&&/^ {0,3}#{1,2}(?:[ \t]+|$)/.test(d)),g=p<0?t.length:o+1+p;return[...t.slice(0,o),...t.slice(g)].join(`
|
|
4
4
|
`).replace(/\n{3,}/g,`
|
|
5
5
|
|
|
6
|
-
`).trim()}var Dt
|
|
6
|
+
`).trim()}var Dt=_(({token:e,css:t})=>({block:t`
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: column;
|
|
9
9
|
gap: 8px;
|
|
@@ -32,7 +32,7 @@ import{D as Oe,Ha as $,Pa as Me,Q as Be,Va as j,da as W,e as Se,g as De,ha as je
|
|
|
32
32
|
font-family: ${e.fontFamilyCode};
|
|
33
33
|
`,basisCell:t`
|
|
34
34
|
color: ${e.colorTextSecondary};
|
|
35
|
-
`})),Ue=({description:e})=>{let{styles:t}=Dt(),n=(0,
|
|
35
|
+
`})),Ue=({description:e})=>{let{styles:t}=Dt(),n=(0,V.useMemo)(()=>ye(e??""),[e]),a=(0,V.useRef)(!1);return(0,V.useEffect)(()=>{!n.success&&!a.current&&(a.current=!0,console.warn(`[TaskBeliefState] ${n.code}: ${n.message}`))},[n]),n.success?(0,T.jsxs)("div",{"data-testid":"belief-state",className:t.block,children:[(0,T.jsx)("div",{className:t.label,children:"Belief State (Last reconciled snapshot)"}),(0,T.jsxs)("table",{className:t.table,children:[(0,T.jsx)("thead",{children:(0,T.jsxs)("tr",{children:[(0,T.jsx)("th",{className:t.th,children:"Key"}),(0,T.jsx)("th",{className:t.th,style:{textAlign:"right"},children:"Probability"}),(0,T.jsx)("th",{className:t.th,style:{textAlign:"right"},children:"Target"}),(0,T.jsx)("th",{className:t.th,children:"Basis"})]})}),(0,T.jsx)("tbody",{children:n.state.entries.map(o=>(0,T.jsxs)("tr",{children:[(0,T.jsx)("td",{className:`${t.td} ${t.keyCell}`,children:o.key}),(0,T.jsxs)("td",{className:t.td,style:{textAlign:"right"},children:[o.probability,"%"]}),(0,T.jsxs)("td",{className:t.td,style:{textAlign:"right"},children:[o.target,"%"]}),(0,T.jsx)("td",{className:`${t.td} ${t.basisCell}`,children:o.basis})]},o.key))})]})]}):null};var x=k(D()),_t=_(({token:e,css:t})=>({root:t`
|
|
36
36
|
display: flex;
|
|
37
37
|
flex-direction: column;
|
|
38
38
|
gap: 6px;
|
|
@@ -90,7 +90,7 @@ import{D as Oe,Ha as $,Pa as Me,Q as Be,Va as j,da as W,e as Se,g as De,ha as je
|
|
|
90
90
|
outline-offset: 2px;
|
|
91
91
|
border-radius: 4px;
|
|
92
92
|
}
|
|
93
|
-
`})),be=({item:e,viewChat:t})=>{let{styles:n}
|
|
93
|
+
`})),be=({item:e,viewChat:t})=>{let{styles:n}=_t(),a=typeof e.detail?.markdown=="string"&&e.detail.markdown.length>0?e.detail.markdown:void 0,o=typeof e.detail?.result=="string"&&e.detail.result.length>0?e.detail.result:void 0,p=e.detail?.beliefImpact,g=(Array.isArray(p)?p:[]).filter(c=>typeof c=="object"&&c!==null).map(c=>({key:typeof c.key=="string"?c.key:"",after:typeof c.after=="number"?c.after:Number.NaN,basis:typeof c.basis=="string"?c.basis:""})).filter(c=>c.key.length>0),d=!!(e.threadId&&t);return!a&&!o&&g.length===0&&!d?null:(0,x.jsxs)("div",{className:n.root,"data-testid":"task-activity-detail",children:[a&&(0,x.jsx)("div",{className:n.markdown,children:(0,x.jsx)(j,{content:a})}),o&&(0,x.jsxs)("div",{className:n.markdown,children:[(0,x.jsx)("div",{className:n.resultLabel,children:"Result"}),(0,x.jsx)(j,{content:o})]}),g.length>0&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:n.resultLabel,children:"Belief Impact"}),(0,x.jsx)("div",{className:n.impactList,children:g.map((c,m)=>(0,x.jsxs)("span",{className:n.impactRow,children:[(0,x.jsxs)("span",{className:n.impactKey,children:[c.key,":"]}),(0,x.jsxs)("span",{children:["reported ",Number.isFinite(c.after)?`${c.after}%`:"n/a"]}),c.basis&&(0,x.jsxs)("span",{className:n.impactBasis,children:["\u2014 ",c.basis]})]},`${c.key}-${m}`))})]}),d&&(0,x.jsxs)("button",{type:"button",className:n.viewChat,onClick:t,children:[(0,x.jsx)(W,{size:12}),"View Chat"]})]})};var l=k(D()),Ve=_(({token:e,css:t})=>({workbench:t`
|
|
94
94
|
min-width: 0;
|
|
95
95
|
max-width: 100%;
|
|
96
96
|
color: ${e.colorText};
|
|
@@ -260,7 +260,7 @@ import{D as Oe,Ha as $,Pa as Me,Q as Be,Va as j,da as W,e as Se,g as De,ha as je
|
|
|
260
260
|
width: 100%;
|
|
261
261
|
> * { min-height: 32px; }
|
|
262
262
|
}
|
|
263
|
-
`}));function ve(e){return new Date(e).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function
|
|
263
|
+
`}));function ve(e){return new Date(e).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function $t(e){let t=e instanceof Date?e:new Date(e),n=Date.now()-t.getTime();return n<60*1e3?"just now":n<3600*1e3?`${Math.floor(n/(60*1e3))}m ago`:n<1440*60*1e3?`${Math.floor(n/(3600*1e3))}h ago`:n<10080*60*1e3?`${Math.floor(n/(1440*60*1e3))}d ago`:t.toLocaleDateString("en-US",{year:"numeric",month:"2-digit",day:"2-digit"})}function Pt(e){let t=Object.entries(e).filter(n=>n[1]);return t.length===0?"None":t.map(([n,a])=>`${n.replaceAll("_"," ")} ${a}`).join(" \xB7 ")}var w=({label:e,children:t})=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("dt",{children:e}),(0,l.jsx)("dd",{children:t})]}),q=({name:e,children:t,className:n,showHeading:a=!0})=>{let{styles:o}=Ve();return(0,l.jsxs)("section",{role:"region","aria-label":e,className:`${o.card} ${n??""}`,children:[a&&(0,l.jsx)("h3",{className:o.heading,children:e}),t]})},He=({task:e,facts:t,parent:n,canGoBack:a=!1,onBack:o,onParentClick:p,headingRef:g,statusControl:d,priorityControl:c,regions:m,threadId:y,onViewChat:h})=>{let{styles:f}=Ve(),E=e.ownerType==="agent"?`@${e.ownerId}`:e.ownerId,N=t.execution.dependencies;return(0,l.jsxs)("div",{className:f.workbench,"data-testid":"task-detail-workbench",children:[(0,l.jsxs)("header",{"aria-label":"Task command",className:`${f.command} ${f.commandResponsive}`,children:[a&&o&&(0,l.jsx)("button",{type:"button",className:f.backButton,"data-testid":"task-detail-back",onClick:o,"aria-label":"Back",children:(0,l.jsx)(Se,{size:16})}),(0,l.jsxs)("div",{className:f.commandMain,children:[n&&(p?(0,l.jsxs)("button",{type:"button",className:`${f.parentPath} ${f.parentAction}`,"data-testid":"parent-row","aria-label":`Parent: ${n.title}`,onClick:()=>p(n),children:[n.title," /"]}):(0,l.jsxs)("div",{className:f.parentPath,"data-testid":"parent-row",children:[n.title," /"]})),(0,l.jsx)("h2",{ref:g,className:f.title,tabIndex:g?-1:void 0,"data-testid":"task-detail-heading",children:e.title}),(0,l.jsxs)("div",{className:f.commandMeta,children:[(0,l.jsx)("span",{children:E}),(0,l.jsx)("span",{children:"Updated"}),(0,l.jsx)("span",{title:ve(e.updatedAt),children:$t(e.updatedAt)})]})]}),(0,l.jsx)("div",{className:`${f.commandActions} ${f.actionsResponsive}`,children:y&&h&&(0,l.jsx)(Ae,{className:`${f.commandAction} task-detail-compact-action`,"data-testid":"thread-row","aria-label":"View agent work",icon:(0,l.jsx)(W,{size:14}),onClick:()=>h(y),children:"View agent work"})})]}),(0,l.jsxs)("div",{className:f.factStrip,children:[(0,l.jsxs)("section",{role:"region","aria-label":"State",className:f.factCard,children:[(0,l.jsx)("h3",{className:f.heading,children:"State"}),(0,l.jsxs)("dl",{className:f.facts,children:[(0,l.jsx)(w,{label:"Status",children:d}),(0,l.jsx)(w,{label:"Priority",children:c}),(0,l.jsx)(w,{label:"Due",children:t.state.dueDate?(0,l.jsxs)(l.Fragment,{children:[ve(t.state.dueDate),t.state.overdue&&(0,l.jsx)("span",{className:f.overdue,"data-testid":"overdue-marker",children:" \xB7 Overdue"})]}):"Not set"}),(0,l.jsx)(w,{label:"Review policy",children:t.state.requiresReview?"Yes":"No"}),(0,l.jsx)(w,{label:"Waiting approval",children:t.state.awaitingReview?"Yes":"No"}),(0,l.jsx)(w,{label:"Failure reason recorded",children:t.state.hasFailureReason?"Yes":"No"})]})]}),(0,l.jsxs)("section",{role:"region","aria-label":"Execution",className:f.factCard,children:[(0,l.jsx)("h3",{className:f.heading,children:"Execution"}),(0,l.jsxs)("dl",{className:f.facts,children:[(0,l.jsxs)(w,{label:"Subtasks",children:[t.execution.subtasks.completed," / ",t.execution.subtasks.total]}),(0,l.jsx)(w,{label:"Status distribution",children:Pt(t.execution.subtasks.byStatus)}),(0,l.jsx)(w,{label:"Dependencies",children:N.total===0?"None":`${N.completed} completed / ${N.known} known / ${N.unavailable} unavailable`}),(0,l.jsx)(w,{label:"Latest activity",children:t.execution.latestActivityAt?ve(t.execution.latestActivityAt):"None"}),(0,l.jsx)(w,{label:"Maximum attempt",children:t.execution.maxAttempt??"None"})]})]}),(0,l.jsxs)("section",{role:"region","aria-label":"Output",className:f.factCard,children:[(0,l.jsx)("h3",{className:f.heading,children:"Output"}),(0,l.jsxs)("dl",{className:f.facts,children:[(0,l.jsx)(w,{label:"Result recorded",children:t.output.hasResult?"Yes":"No"}),(0,l.jsx)(w,{label:"Failure recorded",children:t.output.hasFailureReason?"Yes":"No"}),(0,l.jsx)(w,{label:"Files",children:t.output.files}),(0,l.jsx)(w,{label:"Artifacts",children:t.output.artifacts}),(0,l.jsx)(w,{label:"References",children:t.output.references}),(0,l.jsx)(w,{label:"Conversation",children:t.output.hasConversation?"Yes":"No"})]})]})]}),(0,l.jsxs)("div",{className:f.grid,children:[(0,l.jsx)(q,{name:"Task Content",children:m.taskContent}),(0,l.jsx)(q,{name:"Context",className:f.contextCard,children:(0,l.jsx)("div",{className:f.contextContent,children:m.context})}),(0,l.jsx)(q,{name:"Output details",children:m.output}),(0,l.jsx)(q,{name:"Subtasks",children:m.subtasks}),(0,l.jsx)(q,{name:"Activity",className:f.activity,showHeading:!1,children:m.activity})]})]})};function xe(e){return e==="completed"||e==="cancelled"}function sn(e,t){let a=t?.hideCompleted??!1?e.filter(d=>!xe(d.status)):e,o=new Set(a.map(d=>d.id)),p=[],g=new Set;for(let d of a){if(d.parentId&&o.has(d.parentId)&&d.parentId!==d.id){let c=`${d.parentId}|${d.id}|parent`;g.has(c)||(g.add(c),p.push({from:d.parentId,to:d.id,kind:"parent"}))}for(let c of d.dependencies??[])if(o.has(c)&&c!==d.id){let m=`${c}|${d.id}|dependency`;g.has(m)||(g.add(m),p.push({from:c,to:d.id,kind:"dependency"}))}}return{nodes:a.map(d=>({id:d.id,task:d})),edges:Ot(o,p)}}function Ot(e,t){let n=[...t];for(;;){let a=new Map,o=new Map;for(let h of e)a.set(h,0),o.set(h,[]);for(let h of n)a.set(h.to,(a.get(h.to)??0)+1),o.get(h.from)?.push(h.to);let p=[...a.entries()].filter(([,h])=>h===0).map(([h])=>h),g=0;for(;p.length>0;){let h=p.shift();g+=1;for(let f of o.get(h)??[]){let E=(a.get(f)??0)-1;a.set(f,E),E===0&&p.push(f)}}if(g>=e.size)return n;let d=new Set([...a.entries()].filter(([,h])=>h>0).map(([h])=>h)),c=h=>d.has(h.from)&&d.has(h.to),m=n.findIndex(h=>h.kind==="dependency"&&c(h)),y=m>=0?m:n.findIndex(c);if(y===-1)return n;n.splice(y,1)}}function Ye(e){let{task:t,workItems:n,subtasks:a,relatedTasks:o}=e,p=e.now??new Date,g=t.dueDate===void 0?Number.NaN:new Date(t.dueDate).getTime(),d=p.getTime(),c=t.failureReason!==void 0,m=t.context?.interruption,y=t.status==="interrupted"&&typeof m=="object"&&m!==null&&m.type==="review_required",h={};for(let v of a)h[v.status]=(h[v.status]??0)+1;let f=new Set(t.dependencies??[]),E=new Map(o.map(v=>[v.id,v])),N=0,P=0;for(let v of f){let R=E.get(v);R&&(N+=1,R.status==="completed"&&(P+=1))}let r,S;for(let v of n){let R=Xe(v.createdAt);R!==void 0&&(r===void 0||R>r.getTime())&&(r=new Date(R)),typeof v.attempt=="number"&&Number.isFinite(v.attempt)&&(S=S===void 0?v.attempt:Math.max(S,v.attempt))}let O=t.files??[],B=Ie(t,n);return{state:{status:t.status,priority:t.priority,dueDate:t.dueDate,overdue:Number.isFinite(g)&&Number.isFinite(d)&&g<d&&!xe(t.status),requiresReview:t.requireReview===!0,awaitingReview:y,hasFailureReason:c},execution:{subtasks:{total:a.length,completed:h.completed??0,byStatus:h},dependencies:{total:f.size,known:N,completed:P,unavailable:f.size-N},latestActivityAt:r,maxAttempt:S},output:{hasResult:t.result!==void 0,hasFailureReason:c,files:O.length,artifacts:O.filter(v=>v.addedBy==="agent").length,references:O.filter(v=>v.addedBy==="user").length,hasConversation:B!==void 0}}}function Ie(e,t){let n=e.context?.thread_id;if(qe(n))return n;let a,o=Number.NEGATIVE_INFINITY;for(let p of t){if(!qe(p.threadId))continue;let g=Xe(p.createdAt);g!==void 0&&g>o&&(a=p.threadId,o=g)}return a}function Xe(e){if(!(e instanceof Date)&&typeof e!="string")return;let t=e instanceof Date?e.getTime():new Date(e).getTime();return Number.isFinite(t)?t:void 0}function qe(e){return typeof e=="string"&&e.trim().length>0}var i=k(D()),Y={pending:{label:"Pending",color:"#7A7A7A"},in_progress:{label:"In Progress",color:"#3b82f6"},review:{label:"Review",color:"#f59e0b"},failed:{label:"Failed",color:"#ef4444"},interrupted:{label:"Interrupted",color:"#8b5cf6"},completed:{label:"Completed",color:"#22c55e"},cancelled:{label:"Cancelled",color:"#7A7A7A"}},Je={high:{label:"High",color:"#ef4444"},medium:{label:"Medium",color:"#f59e0b"},low:{label:"Low",color:"#22c55e"}},Bt={approved:(0,i.jsx)(ee,{size:14,style:{color:"#22c55e"}}),rejected:(0,i.jsx)(Pe,{size:14,style:{color:"#ef4444"}}),started:(0,i.jsx)(me,{size:14,style:{color:"#3b82f6"}}),failed:(0,i.jsx)(_e,{size:14,style:{color:"#ef4444"}}),completed:(0,i.jsx)(ee,{size:14,style:{color:"#22c55e"}}),retried:(0,i.jsx)(me,{size:14,style:{color:"#f59e0b"}}),cancelled:(0,i.jsx)(De,{size:14,style:{color:"#7A7A7A"}}),created:(0,i.jsx)($e,{size:14,style:{color:"#7A7A7A"}})};function Te(e){return(e instanceof Date?e:new Date(e)).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function Qe(e){let t=e instanceof Date?e:new Date(e),n=Date.now()-t.getTime();return n<60*1e3?"just now":n<3600*1e3?`${Math.floor(n/(60*1e3))}m ago`:n<1440*60*1e3?`${Math.floor(n/(3600*1e3))}h ago`:n<10080*60*1e3?`${Math.floor(n/(1440*60*1e3))}d ago`:t.toLocaleDateString("en-US",{year:"numeric",month:"2-digit",day:"2-digit"})}function jt(e){if(e.name)return e.name;let t=e.uri.split("/").filter(Boolean);return t[t.length-1]||e.uri}var Mt=_(({token:e,css:t})=>({main:t`
|
|
264
264
|
flex: 1 1 380px;
|
|
265
265
|
min-width: 0;
|
|
266
266
|
display: flex;
|
|
@@ -451,10 +451,10 @@ import{D as Oe,Ha as $,Pa as Me,Q as Be,Va as j,da as W,e as Se,g as De,ha as je
|
|
|
451
451
|
align-items: center;
|
|
452
452
|
justify-content: center;
|
|
453
453
|
padding: 48px 0;
|
|
454
|
-
`})),Ze=({task:e,relatedTasks:t=[],onRelatedTaskClick:n,headingRef:a,workItems:o=[],loading:p=!1,activityError:g,actions:d,transitionPending:c=!1,subtaskProgress:m,subtasks:y,onSubtaskClick:h,parent:f,onParentClick:
|
|
455
|
-
`).filter(u=>/^\s*[-*]\s*\[[ x]\]/i.test(u)).map(u=>({text:u.replace(/^\s*[-*]\s*\[[ x]\]\s*/i,""),done:/^\s*[-*]\s*\[[x]\]/i.test(u)}));return s.sort((u,b)=>Number(u.done)-Number(b.done)),{checklistItems:s,doneCount:s.filter(u=>u.done).length}},[e.description]),
|
|
454
|
+
`})),Ze=({task:e,relatedTasks:t=[],onRelatedTaskClick:n,headingRef:a,workItems:o=[],loading:p=!1,activityError:g,actions:d,transitionPending:c=!1,subtaskProgress:m,subtasks:y,onSubtaskClick:h,parent:f,onParentClick:E,canGoBack:N=!1,onBack:P})=>{let{styles:r}=Mt(),[S,O]=(0,I.useState)(!1),[B,v]=(0,I.useState)(!1),[R,we]=(0,I.useState)(!1),Ne=(0,I.useId)(),ke=(0,I.useId)(),A=Y[e.status]||Y.pending,oe=Je[e.priority]||Je.medium,X=e.context?.interruption,M=e.status==="interrupted"&&typeof X=="object"&&X!==null&&X.type==="review_required",re=Ie(e,o),z=d?.onViewChat,tt=(0,I.useMemo)(()=>Ye({task:e,workItems:o,subtasks:y??[],relatedTasks:t}),[t,y,e,o]),J=M?X.evidenceId:void 0,ae=typeof J=="string"&&J.length>0,L=(0,I.useMemo)(()=>{let s=o.filter(u=>u.action==="completion_evidence");return ae?s.find(u=>u.id===J):[...s].sort((u,b)=>new Date(b.createdAt).getTime()-new Date(u.createdAt).getTime())[0]},[ae,J,o]),nt=typeof L?.detail?.result=="string"&&L.detail.result.length>0,{checklistItems:se,doneCount:it}=(0,I.useMemo)(()=>{if(!e.description)return{checklistItems:[],doneCount:0};let s=e.description.split(`
|
|
455
|
+
`).filter(u=>/^\s*[-*]\s*\[[ x]\]/i.test(u)).map(u=>({text:u.replace(/^\s*[-*]\s*\[[ x]\]\s*/i,""),done:/^\s*[-*]\s*\[[x]\]/i.test(u)}));return s.sort((u,b)=>Number(u.done)-Number(b.done)),{checklistItems:s,doneCount:s.filter(u=>u.done).length}},[e.description]),Ee=(0,I.useMemo)(()=>e.description?We(e.description).split(`
|
|
456
456
|
`).filter(s=>!/^\s*[-*]\s*\[[ x]\]/i.test(s)).join(`
|
|
457
|
-
`).trim():"",[e.description]),ot=typeof e.description=="string"&&e.description.trim().length>0,rt=e.files?.filter(s=>s.addedBy==="agent")??[],at=e.files?.filter(s=>s.addedBy==="user")??[],st=e.files?.filter(s=>s.addedBy===void 0)??[],le=(0,I.useMemo)(()=>o.length>0?[...o].sort((s,u)=>new Date(s.createdAt).getTime()-new Date(u.createdAt).getTime()):[{id:"created",action:"created",actor:e.ownerId,summary:"Task created",createdAt:e.createdAt},{id:"status",action:e.status,actor:e.ownerId,summary:`Status: ${A.label}`,createdAt:e.updatedAt}],[o,e,A.label]),G=(0,I.useMemo)(()=>{let s=new Set,u=new Set;for(let b of le){if(b.action==="completion_evidence")continue;let C=b.detail?.eventKey??b.eventKey;typeof C=="string"&&C.length>0&&s.add(C);let _=b.detail?.evidenceId;typeof _=="string"&&_.length>0&&u.add(_)}return le.filter(b=>{if(b.action!=="completion_evidence")return!0;if(M&&b.id===L?.id)return!1;let C=b.detail?.eventKey??b.eventKey;return u.has(b.id)?!1:typeof C!="string"||!s.has(C)})},[le,M,L?.id]),lt=g?0:G.length,dt=B?G:G.slice(-3),ct=S?y:y?.slice(0,5),de=(0,I.useMemo)(()=>y&&y.length>0?{done:y.filter(s=>s.status==="completed").length,total:y.length}:m,[y,m]),Q=(0,I.useMemo)(()=>{if(!d||e.ownerType==="agent")return[];let s=[];return e.status==="failed"&&(d.onRetry&&s.push({key:"retry",label:"Retry",onClick:d.onRetry}),d.onCancel&&s.push({key:"cancel",label:"Cancel task",danger:!0,onClick:d.onCancel})),s},[d,e.ownerType,e.status]);(0,I.useEffect)(()=>{we(!1)},[e.id,e.status,c]),(0,I.useEffect)(()=>{O(!1),v(!1)},[e.id]);let Ee=Q.length>0?(0,i.jsxs)("button",{type:"button",className:`${r.statusBadge} ${r.quietButton} ${r.compactAction} ${r.statusTrigger}`,style:{color:A.color},"data-testid":"status-badge","aria-label":`Change status, current status ${A.label}`,"aria-haspopup":"menu","aria-expanded":E,children:[(0,i.jsx)("span",{className:r.statusDot,style:{background:A.color}}),A.label,(0,i.jsx)(ue,{size:12})]}):(0,i.jsxs)("span",{className:r.statusBadge,style:{color:A.color},"data-testid":"status-badge",children:[(0,i.jsx)("span",{className:r.statusDot,style:{background:A.color}}),A.label]}),pt=(0,i.jsxs)(i.Fragment,{children:[Re?(0,i.jsx)("div",{className:r.description,children:(0,i.jsx)(j,{content:Re})}):ot?null:(0,i.jsx)("div",{className:r.feedMeta,children:"No task description"}),se.length>0&&(0,i.jsxs)("div",{style:{marginTop:16},children:[(0,i.jsxs)("div",{className:r.sectionTitle,children:["Acceptance \u2713 ",it,"/",se.length]}),se.map((s,u)=>(0,i.jsxs)("div",{"data-testid":"checklist-item",className:`${r.checklistItem} ${s.done?r.checklistDone:""}`,children:[s.done?(0,i.jsx)(ee,{size:14,style:{color:"#22c55e",flexShrink:0,marginTop:2}}):(0,i.jsx)("div",{style:{width:14,height:14,border:"2px solid #d9d9d9",borderRadius:3,flexShrink:0,marginTop:2}}),(0,i.jsx)("span",{children:s.text})]},u))]}),(0,i.jsx)(Ue,{description:e.description})]}),ut=(0,i.jsxs)("div",{className:r.main,children:[M&&(0,i.jsxs)("div",{className:r.waitingCard,"data-testid":"approval-waiting",children:[(0,i.jsx)("div",{className:r.sectionTitle,style:{color:"#b45309",margin:0},children:"Waiting for approval"}),L&&(0,i.jsx)(be,{item:L}),!L&&ae&&(0,i.jsx)("div",{className:r.feedMeta,children:p?"Approval evidence is loading...":"Approval evidence is unavailable."}),e.result!==void 0&&!nt&&(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:r.sectionTitle,children:"Result"}),(0,i.jsx)("div",{className:r.description,children:e.result.length>0?(0,i.jsx)(j,{content:e.result}):"No text provided"})]}),!re||!z?(0,i.jsx)("div",{className:r.feedMeta,children:"The agent conversation is unavailable because no thread is associated with this task."}):null]}),e.result!==void 0&&!M?(0,i.jsxs)("div",{className:r.resultCard,children:[(0,i.jsx)("h4",{className:r.sectionTitle,children:"Result"}),(0,i.jsx)("div",{className:r.description,children:e.result.length>0?(0,i.jsx)(j,{content:e.result}):"No text provided"})]}):M?null:(0,i.jsx)("div",{className:r.feedMeta,children:"No result recorded"}),e.failureReason!==void 0&&(0,i.jsxs)("div",{className:r.failureCard,children:[(0,i.jsx)("h4",{className:r.sectionTitle,style:{color:"#ef4444"},children:"Failure Reason"}),(0,i.jsx)("div",{className:r.description,children:e.failureReason.length>0?(0,i.jsx)(j,{content:e.failureReason}):"No text provided"})]}),e.failureReason===void 0&&(0,i.jsx)("div",{className:r.feedMeta,children:"No failure reason recorded"}),e.files&&e.files.length>0?(0,i.jsx)("div",{"data-testid":"files-section",children:[["Artifacts",rt],["References",at],["Other files",st]].map(([s,u])=>u.length>0&&(0,i.jsxs)("div",{style:{marginTop:8},children:[(0,i.jsx)("h4",{className:r.sectionTitle,children:s}),u.map((b,C)=>{let _=jt(b),K=/^https?:\/\//.test(b.uri);return(0,i.jsxs)("div",{"data-testid":"file-row",className:r.fileRow,children:[(0,i.jsx)(je,{size:13,style:{flexShrink:0,color:"#7A7A7A"}}),K?(0,i.jsx)("a",{href:b.uri,target:"_blank",rel:"noreferrer",className:r.fileName,children:_}):(0,i.jsx)("span",{className:r.fileName,title:b.uri,children:_})]},`${b.uri}-${C}`)})]},s))}):(0,i.jsx)("div",{className:r.feedMeta,children:"No files attached"}),!re&&!M&&(0,i.jsx)("div",{className:r.feedMeta,children:"No conversation associated"})]}),mt=(0,i.jsxs)("div",{children:[(0,i.jsxs)("h3",{className:r.sectionTitle,children:["Activity (",lt,")"]}),(0,i.jsx)("div",{id:ke,children:p?(0,i.jsx)("div",{className:r.spinner,"data-testid":"feed-loading",children:(0,i.jsx)(pe,{size:"small"})}):g?(0,i.jsx)("div",{role:"alert",className:r.feedMeta,children:g}):G.length===0?(0,i.jsx)(ce,{description:"No activity yet",image:ce.PRESENTED_IMAGE_SIMPLE}):(0,i.jsx)("div",{className:r.feed,"data-testid":"activity-feed",children:dt.map(s=>{let u=s.action==="activity"&&typeof s.detail?.markdown=="string",b=s.action==="completion_evidence",C=typeof s.detail?.result=="string"||Array.isArray(s.detail?.beliefImpact),_=u||b||C,K=s.threadId,bt=K&&z?()=>z(K):void 0;return(0,i.jsxs)("div",{className:r.feedItem,"data-testid":s.action==="update_agent"?"feed-item-update_agent":"activity-item",style:s.action==="update_agent"?{borderLeft:"2px solid #6366f1",paddingLeft:8}:void 0,children:[(0,i.jsx)("span",{style:{flexShrink:0,marginTop:2},children:Bt[s.action]||(0,i.jsx)(Be,{size:14,style:{color:"#7A7A7A"}})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:r.feedSummary,children:b?"Completion evidence recorded":s.summary||s.action}),_&&(0,i.jsx)(be,{item:s,viewChat:bt}),(0,i.jsxs)("div",{className:r.feedMeta,children:[(0,i.jsx)("span",{children:s.actor}),(0,i.jsx)("span",{title:Te(s.createdAt),children:Qe(s.createdAt)}),s.attempt!==void 0&&s.attempt>1&&(0,i.jsxs)("span",{children:["Attempt #",s.attempt]}),K&&z&&!_&&(0,i.jsxs)("button",{type:"button",className:`${r.threadLink} ${r.quietButton}`,onClick:()=>z(K),children:[(0,i.jsx)(W,{size:12}),"View Chat"]})]})]})]},s.id)})})}),!p&&!g&&G.length>3&&(0,i.jsxs)("button",{type:"button",className:`${r.feedHeader} ${r.quietButton}`,onClick:()=>v(s=>!s),"aria-expanded":B,"aria-controls":ke,children:[B?(0,i.jsx)(ue,{size:14}):null,B?"Show fewer activity items":`View all ${G.length} activity items`]})]}),ft=c?(0,i.jsxs)("span",{className:r.statusBadge,style:{color:A.color},"data-testid":"status-pending",role:"status","aria-live":"polite","aria-label":`Updating task status; current status ${A.label}`,children:[(0,i.jsx)(pe,{size:"small"}),"Updating \xB7 ",A.label]}):Q.length>0?(0,i.jsx)(Ce,{menu:{items:Q.map(({key:s,label:u,danger:b})=>({key:s,label:u,danger:b})),onClick:({key:s})=>Q.find(u=>u.key===s)?.onClick()},trigger:["click"],open:E,onOpenChange:we,children:Ee}):Ee,gt=(0,i.jsxs)("span",{className:r.propValue,"data-testid":"priority-row",children:[(0,i.jsx)("span",{className:r.statusDot,style:{background:oe.color}}),(0,i.jsx)("span",{style:{color:oe.color,fontWeight:600},children:oe.label})]}),ht=(0,i.jsxs)("div",{className:r.rail,"data-testid":"rail",children:[(0,i.jsxs)("div",{className:r.propRow,children:[(0,i.jsx)("span",{className:r.propLabel,children:"Created"}),(0,i.jsxs)("span",{className:r.propValue,children:[(0,i.jsx)(Oe,{size:13}),(0,i.jsx)("span",{title:Te(e.createdAt),children:Qe(e.createdAt)})]})]}),e.dueDate&&(0,i.jsxs)("div",{className:r.propRow,children:[(0,i.jsx)("span",{className:r.propLabel,children:"Due"}),(0,i.jsx)("span",{className:r.propValue,children:Te(e.dueDate)})]}),e.dependencies&&e.dependencies.length>0?[...new Set(e.dependencies)].map(s=>{let u=t.find(C=>C.id===s),b=u?Y[u.status]?.label??u.status:void 0;return(0,i.jsxs)("div",{className:r.propRow,children:[(0,i.jsx)("span",{className:r.propLabel,children:"Dependency"}),u&&n?(0,i.jsxs)("button",{type:"button",className:`${r.propValue} ${r.quietButton} ${r.compactAction}`,"aria-label":`Dependency: ${u.title}, status ${b}`,onClick:()=>n(u),children:[u.title," \xB7 ",b]}):(0,i.jsx)("span",{className:r.propValue,children:u?`${u.title} \xB7 ${b}`:"Dependency unavailable"})]},s)}):(0,i.jsx)("div",{className:r.feedMeta,children:"No dependencies"})]}),yt=y&&y.length>0?(0,i.jsxs)("div",{"data-testid":"subtasks-section",children:[de&&(0,i.jsxs)("div",{className:r.sectionTitle,children:[de.done,"/",de.total," completed"]}),(0,i.jsx)("div",{id:Ne,children:ct?.map(s=>{let u=Y[s.status]||Y.pending,b=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:r.statusDot,style:{background:u.color}}),(0,i.jsx)("span",{className:r.subtaskTitle,children:s.title}),(0,i.jsx)("span",{className:r.subtaskStatus,style:{color:u.color},children:u.label})]});return h?(0,i.jsx)("button",{type:"button","data-testid":"subtask-row",className:`${r.subtaskRow} ${r.quietButton} ${r.actionRow}`,title:`${u.label} \xB7 ${s.title}`,"aria-label":`${s.title}, status ${u.label}`,onClick:()=>h(s),children:b},s.id):(0,i.jsx)("div",{"data-testid":"subtask-row",className:r.subtaskRow,title:`${u.label} \xB7 ${s.title}`,children:b},s.id)})}),y.length>5&&(0,i.jsx)("button",{type:"button",className:`${r.feedHeader} ${r.quietButton}`,onClick:()=>O(s=>!s),"aria-expanded":S,"aria-controls":Ne,children:S?"Show fewer subtasks":`View all ${y.length} subtasks`})]}):m&&m.total>0?(0,i.jsxs)("div",{children:[m.done,"/",m.total," completed"]}):(0,i.jsx)("div",{className:r.feedMeta,children:"No subtasks"});return(0,i.jsx)(He,{task:e,facts:tt,parent:f,canGoBack:k,onBack:P,onParentClick:R,headingRef:a,statusControl:ft,priorityControl:gt,regions:{taskContent:pt,context:ht,output:ut,subtasks:yt,activity:mt},threadId:re,onViewChat:z})};var ne=N(D()),Ft=$(({css:e})=>({container:e`
|
|
457
|
+
`).trim():"",[e.description]),ot=typeof e.description=="string"&&e.description.trim().length>0,rt=e.files?.filter(s=>s.addedBy==="agent")??[],at=e.files?.filter(s=>s.addedBy==="user")??[],st=e.files?.filter(s=>s.addedBy===void 0)??[],le=(0,I.useMemo)(()=>o.length>0?[...o].sort((s,u)=>new Date(s.createdAt).getTime()-new Date(u.createdAt).getTime()):[{id:"created",action:"created",actor:e.ownerId,summary:"Task created",createdAt:e.createdAt},{id:"status",action:e.status,actor:e.ownerId,summary:`Status: ${A.label}`,createdAt:e.updatedAt}],[o,e,A.label]),G=(0,I.useMemo)(()=>{let s=new Set,u=new Set;for(let b of le){if(b.action==="completion_evidence")continue;let C=b.detail?.eventKey??b.eventKey;typeof C=="string"&&C.length>0&&s.add(C);let $=b.detail?.evidenceId;typeof $=="string"&&$.length>0&&u.add($)}return le.filter(b=>{if(b.action!=="completion_evidence")return!0;if(M&&b.id===L?.id)return!1;let C=b.detail?.eventKey??b.eventKey;return u.has(b.id)?!1:typeof C!="string"||!s.has(C)})},[le,M,L?.id]),lt=g?0:G.length,dt=B?G:G.slice(-3),ct=S?y:y?.slice(0,5),de=(0,I.useMemo)(()=>y&&y.length>0?{done:y.filter(s=>s.status==="completed").length,total:y.length}:m,[y,m]),Q=(0,I.useMemo)(()=>{if(!d||e.ownerType==="agent")return[];let s=[];return e.status==="failed"&&(d.onRetry&&s.push({key:"retry",label:"Retry",onClick:d.onRetry}),d.onCancel&&s.push({key:"cancel",label:"Cancel task",danger:!0,onClick:d.onCancel})),s},[d,e.ownerType,e.status]);(0,I.useEffect)(()=>{we(!1)},[e.id,e.status,c]),(0,I.useEffect)(()=>{O(!1),v(!1)},[e.id]);let Re=Q.length>0?(0,i.jsxs)("button",{type:"button",className:`${r.statusBadge} ${r.quietButton} ${r.compactAction} ${r.statusTrigger}`,style:{color:A.color},"data-testid":"status-badge","aria-label":`Change status, current status ${A.label}`,"aria-haspopup":"menu","aria-expanded":R,children:[(0,i.jsx)("span",{className:r.statusDot,style:{background:A.color}}),A.label,(0,i.jsx)(ue,{size:12})]}):(0,i.jsxs)("span",{className:r.statusBadge,style:{color:A.color},"data-testid":"status-badge",children:[(0,i.jsx)("span",{className:r.statusDot,style:{background:A.color}}),A.label]}),pt=(0,i.jsxs)(i.Fragment,{children:[Ee?(0,i.jsx)("div",{className:r.description,children:(0,i.jsx)(j,{content:Ee})}):ot?null:(0,i.jsx)("div",{className:r.feedMeta,children:"No task description"}),se.length>0&&(0,i.jsxs)("div",{style:{marginTop:16},children:[(0,i.jsxs)("div",{className:r.sectionTitle,children:["Acceptance \u2713 ",it,"/",se.length]}),se.map((s,u)=>(0,i.jsxs)("div",{"data-testid":"checklist-item",className:`${r.checklistItem} ${s.done?r.checklistDone:""}`,children:[s.done?(0,i.jsx)(ee,{size:14,style:{color:"#22c55e",flexShrink:0,marginTop:2}}):(0,i.jsx)("div",{style:{width:14,height:14,border:"2px solid #d9d9d9",borderRadius:3,flexShrink:0,marginTop:2}}),(0,i.jsx)("span",{children:s.text})]},u))]}),(0,i.jsx)(Ue,{description:e.description})]}),ut=(0,i.jsxs)("div",{className:r.main,children:[M&&(0,i.jsxs)("div",{className:r.waitingCard,"data-testid":"approval-waiting",children:[(0,i.jsx)("div",{className:r.sectionTitle,style:{color:"#b45309",margin:0},children:"Waiting for approval"}),L&&(0,i.jsx)(be,{item:L}),!L&&ae&&(0,i.jsx)("div",{className:r.feedMeta,children:p?"Approval evidence is loading...":"Approval evidence is unavailable."}),e.result!==void 0&&!nt&&(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:r.sectionTitle,children:"Result"}),(0,i.jsx)("div",{className:r.description,children:e.result.length>0?(0,i.jsx)(j,{content:e.result}):"No text provided"})]}),!re||!z?(0,i.jsx)("div",{className:r.feedMeta,children:"The agent conversation is unavailable because no thread is associated with this task."}):null]}),e.result!==void 0&&!M?(0,i.jsxs)("div",{className:r.resultCard,children:[(0,i.jsx)("h4",{className:r.sectionTitle,children:"Result"}),(0,i.jsx)("div",{className:r.description,children:e.result.length>0?(0,i.jsx)(j,{content:e.result}):"No text provided"})]}):M?null:(0,i.jsx)("div",{className:r.feedMeta,children:"No result recorded"}),e.failureReason!==void 0&&(0,i.jsxs)("div",{className:r.failureCard,children:[(0,i.jsx)("h4",{className:r.sectionTitle,style:{color:"#ef4444"},children:"Failure Reason"}),(0,i.jsx)("div",{className:r.description,children:e.failureReason.length>0?(0,i.jsx)(j,{content:e.failureReason}):"No text provided"})]}),e.failureReason===void 0&&(0,i.jsx)("div",{className:r.feedMeta,children:"No failure reason recorded"}),e.files&&e.files.length>0?(0,i.jsx)("div",{"data-testid":"files-section",children:[["Artifacts",rt],["References",at],["Other files",st]].map(([s,u])=>u.length>0&&(0,i.jsxs)("div",{style:{marginTop:8},children:[(0,i.jsx)("h4",{className:r.sectionTitle,children:s}),u.map((b,C)=>{let $=jt(b),K=/^https?:\/\//.test(b.uri);return(0,i.jsxs)("div",{"data-testid":"file-row",className:r.fileRow,children:[(0,i.jsx)(je,{size:13,style:{flexShrink:0,color:"#7A7A7A"}}),K?(0,i.jsx)("a",{href:b.uri,target:"_blank",rel:"noreferrer",className:r.fileName,children:$}):(0,i.jsx)("span",{className:r.fileName,title:b.uri,children:$})]},`${b.uri}-${C}`)})]},s))}):(0,i.jsx)("div",{className:r.feedMeta,children:"No files attached"}),!re&&!M&&(0,i.jsx)("div",{className:r.feedMeta,children:"No conversation associated"})]}),mt=(0,i.jsxs)("div",{children:[(0,i.jsxs)("h3",{className:r.sectionTitle,children:["Activity (",lt,")"]}),(0,i.jsx)("div",{id:Ne,children:p?(0,i.jsx)("div",{className:r.spinner,"data-testid":"feed-loading",children:(0,i.jsx)(pe,{size:"small"})}):g?(0,i.jsx)("div",{role:"alert",className:r.feedMeta,children:g}):G.length===0?(0,i.jsx)(ce,{description:"No activity yet",image:ce.PRESENTED_IMAGE_SIMPLE}):(0,i.jsx)("div",{className:r.feed,"data-testid":"activity-feed",children:dt.map(s=>{let u=s.action==="activity"&&typeof s.detail?.markdown=="string",b=s.action==="completion_evidence",C=typeof s.detail?.result=="string"||Array.isArray(s.detail?.beliefImpact),$=u||b||C,K=s.threadId,bt=K&&z?()=>z(K):void 0;return(0,i.jsxs)("div",{className:r.feedItem,"data-testid":s.action==="update_agent"?"feed-item-update_agent":"activity-item",style:s.action==="update_agent"?{borderLeft:"2px solid #6366f1",paddingLeft:8}:void 0,children:[(0,i.jsx)("span",{style:{flexShrink:0,marginTop:2},children:Bt[s.action]||(0,i.jsx)(Be,{size:14,style:{color:"#7A7A7A"}})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:r.feedSummary,children:b?"Completion evidence recorded":s.summary||s.action}),$&&(0,i.jsx)(be,{item:s,viewChat:bt}),(0,i.jsxs)("div",{className:r.feedMeta,children:[(0,i.jsx)("span",{children:s.actor}),(0,i.jsx)("span",{title:Te(s.createdAt),children:Qe(s.createdAt)}),s.attempt!==void 0&&s.attempt>1&&(0,i.jsxs)("span",{children:["Attempt #",s.attempt]}),K&&z&&!$&&(0,i.jsxs)("button",{type:"button",className:`${r.threadLink} ${r.quietButton}`,onClick:()=>z(K),children:[(0,i.jsx)(W,{size:12}),"View Chat"]})]})]})]},s.id)})})}),!p&&!g&&G.length>3&&(0,i.jsxs)("button",{type:"button",className:`${r.feedHeader} ${r.quietButton}`,onClick:()=>v(s=>!s),"aria-expanded":B,"aria-controls":Ne,children:[B?(0,i.jsx)(ue,{size:14}):null,B?"Show fewer activity items":`View all ${G.length} activity items`]})]}),ft=c?(0,i.jsxs)("span",{className:r.statusBadge,style:{color:A.color},"data-testid":"status-pending",role:"status","aria-live":"polite","aria-label":`Updating task status; current status ${A.label}`,children:[(0,i.jsx)(pe,{size:"small"}),"Updating \xB7 ",A.label]}):Q.length>0?(0,i.jsx)(Ce,{menu:{items:Q.map(({key:s,label:u,danger:b})=>({key:s,label:u,danger:b})),onClick:({key:s})=>Q.find(u=>u.key===s)?.onClick()},trigger:["click"],open:R,onOpenChange:we,children:Re}):Re,gt=(0,i.jsxs)("span",{className:r.propValue,"data-testid":"priority-row",children:[(0,i.jsx)("span",{className:r.statusDot,style:{background:oe.color}}),(0,i.jsx)("span",{style:{color:oe.color,fontWeight:600},children:oe.label})]}),ht=(0,i.jsxs)("div",{className:r.rail,"data-testid":"rail",children:[(0,i.jsxs)("div",{className:r.propRow,children:[(0,i.jsx)("span",{className:r.propLabel,children:"Created"}),(0,i.jsxs)("span",{className:r.propValue,children:[(0,i.jsx)(Oe,{size:13}),(0,i.jsx)("span",{title:Te(e.createdAt),children:Qe(e.createdAt)})]})]}),e.dueDate&&(0,i.jsxs)("div",{className:r.propRow,children:[(0,i.jsx)("span",{className:r.propLabel,children:"Due"}),(0,i.jsx)("span",{className:r.propValue,children:Te(e.dueDate)})]}),e.dependencies&&e.dependencies.length>0?[...new Set(e.dependencies)].map(s=>{let u=t.find(C=>C.id===s),b=u?Y[u.status]?.label??u.status:void 0;return(0,i.jsxs)("div",{className:r.propRow,children:[(0,i.jsx)("span",{className:r.propLabel,children:"Dependency"}),u&&n?(0,i.jsxs)("button",{type:"button",className:`${r.propValue} ${r.quietButton} ${r.compactAction}`,"aria-label":`Dependency: ${u.title}, status ${b}`,onClick:()=>n(u),children:[u.title," \xB7 ",b]}):(0,i.jsx)("span",{className:r.propValue,children:u?`${u.title} \xB7 ${b}`:"Dependency unavailable"})]},s)}):(0,i.jsx)("div",{className:r.feedMeta,children:"No dependencies"})]}),yt=y&&y.length>0?(0,i.jsxs)("div",{"data-testid":"subtasks-section",children:[de&&(0,i.jsxs)("div",{className:r.sectionTitle,children:[de.done,"/",de.total," completed"]}),(0,i.jsx)("div",{id:ke,children:ct?.map(s=>{let u=Y[s.status]||Y.pending,b=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:r.statusDot,style:{background:u.color}}),(0,i.jsx)("span",{className:r.subtaskTitle,children:s.title}),(0,i.jsx)("span",{className:r.subtaskStatus,style:{color:u.color},children:u.label})]});return h?(0,i.jsx)("button",{type:"button","data-testid":"subtask-row",className:`${r.subtaskRow} ${r.quietButton} ${r.actionRow}`,title:`${u.label} \xB7 ${s.title}`,"aria-label":`${s.title}, status ${u.label}`,onClick:()=>h(s),children:b},s.id):(0,i.jsx)("div",{"data-testid":"subtask-row",className:r.subtaskRow,title:`${u.label} \xB7 ${s.title}`,children:b},s.id)})}),y.length>5&&(0,i.jsx)("button",{type:"button",className:`${r.feedHeader} ${r.quietButton}`,onClick:()=>O(s=>!s),"aria-expanded":S,"aria-controls":ke,children:S?"Show fewer subtasks":`View all ${y.length} subtasks`})]}):m&&m.total>0?(0,i.jsxs)("div",{children:[m.done,"/",m.total," completed"]}):(0,i.jsx)("div",{className:r.feedMeta,children:"No subtasks"});return(0,i.jsx)(He,{task:e,facts:tt,parent:f,canGoBack:N,onBack:P,onParentClick:E,headingRef:a,statusControl:ft,priorityControl:gt,regions:{taskContent:pt,context:ht,output:ut,subtasks:yt,activity:mt},threadId:re,onViewChat:z})};var ne=k(D()),Ft=_(({css:e})=>({container:e`
|
|
458
458
|
display: flex;
|
|
459
459
|
flex-direction: column;
|
|
460
460
|
height: 100%;
|
|
@@ -464,4 +464,4 @@ import{D as Oe,Ha as $,Pa as Me,Q as Be,Va as j,da as W,e as Se,g as De,ha as je
|
|
|
464
464
|
min-height: 0;
|
|
465
465
|
overflow-y: auto;
|
|
466
466
|
padding: clamp(12px, 3cqi, 16px) clamp(16px, 4cqi, ${24}px);
|
|
467
|
-
`})),
|
|
467
|
+
`})),kn=({task:e,relatedTasks:t,onRelatedTaskClick:n,workItems:a,loading:o,activityError:p,transitionPending:g=!1,onApprove:d,onReject:c,onRetry:m,onCancel:y,onViewChat:h,onBack:f,canGoBack:E=!0,maxHeight:N,focusKey:P,subtasks:r,onSubtaskClick:S,parent:O,onParentClick:B})=>{let{styles:v}=Ft(),R=(0,ie.useRef)(null);return(0,ie.useEffect)(()=>{P!==void 0&&R.current?.focus()},[P]),(0,ne.jsx)("div",{className:v.container,"data-testid":"task-detail-panel",style:N===void 0?void 0:{maxHeight:N},children:(0,ne.jsx)("div",{className:v.body,children:(0,ne.jsx)(Ze,{task:e,relatedTasks:t,onRelatedTaskClick:n,headingRef:P===void 0?void 0:R,workItems:a,loading:o,activityError:p,transitionPending:g,actions:{onApprove:d,onReject:c,onRetry:m,onCancel:y,onViewChat:h},subtasks:r,onSubtaskClick:S,parent:O,onParentClick:B,canGoBack:E,onBack:f})})})};var et=k(Z());function zt(e,t){let n=e.ownerType==="agent"?e.ownerId:"general-purpose";return{component_key:"task",message:e.title||"Task",data:{thread_id:t,description:e.description||"",subagent_type:n}}}var An=e=>{let{openSideApp:t}=Me();return(0,et.useCallback)(n=>{if(e)try{t(zt(e,n))}catch{console.warn("Cannot open task chat: ChatUIContextProvider is not mounted")}},[t,e])};export{U as a,Rt as b,Kt as c,Wt as d,xe as e,sn as f,kn as g,An as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ka as n}from"./embed-page-chunk-
|
|
1
|
+
import{Ka as n}from"./embed-page-chunk-YMJGPA3F.js";import{k as i,l as p,p as s}from"./embed-page-chunk-URNZX66S.js";import{a as d}from"./embed-page-chunk-MB65DZAX.js";import{e as a}from"./embed-page-chunk-6Y3UYJ6Z.js";var e=a(d()),P=({defaultWorkspaceId:t,defaultProjectId:o,children:r})=>{let c=p("__GLOBAL__");return(0,e.jsx)(n,{workspaceId:t,projectId:o,client:c,children:r})},f=({children:t,defaultProjectId:o,defaultWorkspaceId:r})=>{let{config:{baseURL:c}}=s();return(0,e.jsx)(i,{config:{baseURL:c,apiKey:"",assistantId:"__GLOBAL__",transport:"sse"},children:(0,e.jsx)(P,{defaultWorkspaceId:r,defaultProjectId:o,children:t})})},I=f;export{f as a,I as b};
|