@axiom-lattice/gateway 4.2.5 → 4.3.1
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/embed/agent-chat-loader.js +1 -1
- package/dist/embed/{embed-page-AgentDetailSideApp-YPN3NDEA.js → embed-page-AgentDetailSideApp-ONXG4B3D.js} +1 -1
- package/dist/embed/{embed-page-AgentGovernanceWorkbench-FAZQNPAM.js → embed-page-AgentGovernanceWorkbench-LCIQ5UF3.js} +1 -1
- package/dist/embed/{embed-page-MessageGraph-CEOPX4GM.js → embed-page-MessageGraph-P7DBTZCL.js} +1 -1
- package/dist/embed/{embed-page-ReactChart-NZAYQOQH.js → embed-page-ReactChart-XS7D26VP.js} +1 -1
- package/dist/embed/{embed-page-SkillFlow-TPESM4DI.js → embed-page-SkillFlow-HPH37PZH.js} +1 -1
- package/dist/embed/{embed-page-TasksSideApp-3EAPMISU.js → embed-page-TasksSideApp-MQTUCJO4.js} +1 -1
- package/dist/embed/{embed-page-TeamWorkspace-HB7ER45L.js → embed-page-TeamWorkspace-7T2HRXLG.js} +1 -1
- package/dist/embed/{embed-page-TopologyRuntimeView-O7JPR22B.js → embed-page-TopologyRuntimeView-PU2D7VZ7.js} +1 -1
- package/dist/embed/{embed-page-WorkflowAutomationView-OUXOBHXC.js → embed-page-WorkflowAutomationView-ST76M33F.js} +1 -1
- package/dist/embed/{embed-page-chunk-ZTRCHYWV.js → embed-page-chunk-4ZSGPIBZ.js} +1 -1
- package/dist/embed/{embed-page-chunk-4SKSUBXL.js → embed-page-chunk-BRETUPSG.js} +110 -109
- package/dist/embed/{embed-page-chunk-U6JBLAYD.js → embed-page-chunk-LE6OFJ7R.js} +1 -1
- package/dist/embed/{embed-page-chunk-KFUAWYJ7.js → embed-page-chunk-T25T2YE6.js} +1 -1
- package/dist/embed/{embed-page-chunk-ILNGM4RN.js → embed-page-chunk-U6SL5TG6.js} +89 -38
- package/dist/embed/embed-page-chunk-VRV57DFE.js +466 -0
- package/dist/embed/embed-page-chunk-YPV4BAWI.js +245 -0
- package/dist/embed/{embed-page-chunk-6C2UZV63.js → embed-page-chunk-Z4S4OYA4.js} +1 -1
- package/dist/embed/{embed-page-chunk-TQPMRDLI.js → embed-page-chunk-ZKJ7Z7P3.js} +1 -1
- package/dist/embed/{embed-page-chunk-RTVQJYET.js → embed-page-chunk-ZXFZANZM.js} +1 -1
- package/dist/embed/embed-page.js +3 -3
- package/dist/index.js +140 -146
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -24
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
- package/dist/embed/embed-page-chunk-5XKUKLZQ.js +0 -467
- package/dist/embed/embed-page-chunk-GCDGRO6A.js +0 -245
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
import{B as $e,E as Re,I as Ae,Ma as B,Ua as Be,V as De,_a as z,b as de,ia as V,j as Ne,l as Ie,ma as Se,u as ce,va as pe,x as Ce,y as J}from"./embed-page-chunk-BRETUPSG.js";import{a as S}from"./embed-page-chunk-MB65DZAX.js";import{W as Te,Z as se,pa as we,va as le}from"./embed-page-chunk-O4QK5LWZ.js";import{a as X}from"./embed-page-chunk-4BKXE5ON.js";import{e as N}from"./embed-page-chunk-6Y3UYJ6Z.js";var ee=N(X());var k=N(X());var q=N(X());var T=N(S());function Fe(e){if(!e||!de(e).success)return e??"";let t=e.split(`
|
|
2
|
+
`),n,m=t.map(l=>{let s=l.match(/^ {0,3}(`{3,}|~{3,})/),x=n!==void 0;return!n&&s?n={marker:s[1][0],length:s[1].length}:n&&new RegExp(`^ {0,3}\\${n.marker}{${n.length},}[ \\t]*$`).test(l)&&(n=void 0),x||s!==null}),c=t.findIndex((l,s)=>!m[s]&&/^ {0,3}##\s+Belief State\s*$/i.test(l.trimEnd()));if(c<0)return e;let h=t.slice(c+1).findIndex((l,s)=>!m[c+1+s]&&/^ {0,3}#{1,2}(?:[ \t]+|$)/.test(l)),g=h<0?t.length:c+1+h;return[...t.slice(0,c),...t.slice(g)].join(`
|
|
3
|
+
`).replace(/\n{3,}/g,`
|
|
4
|
+
|
|
5
|
+
`).trim()}var lt=B(({token:e,css:t})=>({block:t`
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: 8px;
|
|
9
|
+
`,label:t`
|
|
10
|
+
margin: 0;
|
|
11
|
+
font-size: 13px;
|
|
12
|
+
font-weight: 600;
|
|
13
|
+
color: ${e.colorTextSecondary};
|
|
14
|
+
`,table:t`
|
|
15
|
+
width: 100%;
|
|
16
|
+
border-collapse: collapse;
|
|
17
|
+
font-size: 13px;
|
|
18
|
+
line-height: 1.5;
|
|
19
|
+
`,th:t`
|
|
20
|
+
text-align: left;
|
|
21
|
+
font-weight: 600;
|
|
22
|
+
color: ${e.colorTextTertiary};
|
|
23
|
+
padding: 4px 8px;
|
|
24
|
+
border-bottom: 1px solid ${e.colorBorderSecondary};
|
|
25
|
+
`,td:t`
|
|
26
|
+
padding: 4px 8px;
|
|
27
|
+
border-bottom: 1px solid ${e.colorBorderSecondary};
|
|
28
|
+
color: ${e.colorText};
|
|
29
|
+
vertical-align: top;
|
|
30
|
+
`,keyCell:t`
|
|
31
|
+
font-family: ${e.fontFamilyCode};
|
|
32
|
+
`,basisCell:t`
|
|
33
|
+
color: ${e.colorTextSecondary};
|
|
34
|
+
`})),Pe=({description:e})=>{let{styles:t}=lt(),n=(0,q.useMemo)(()=>de(e??""),[e]),m=(0,q.useRef)(!1);return(0,q.useEffect)(()=>{!n.success&&!m.current&&(m.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(c=>(0,T.jsxs)("tr",{children:[(0,T.jsx)("td",{className:`${t.td} ${t.keyCell}`,children:c.key}),(0,T.jsxs)("td",{className:t.td,style:{textAlign:"right"},children:[c.probability,"%"]}),(0,T.jsxs)("td",{className:t.td,style:{textAlign:"right"},children:[c.target,"%"]}),(0,T.jsx)("td",{className:`${t.td} ${t.basisCell}`,children:c.basis})]},c.key))})]})]}):null};var v=N(S()),dt=B(({token:e,css:t})=>({root:t`
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
gap: 6px;
|
|
38
|
+
margin-top: 6px;
|
|
39
|
+
padding-left: 2px;
|
|
40
|
+
`,markdown:t`
|
|
41
|
+
font-size: 13px;
|
|
42
|
+
color: ${e.colorText};
|
|
43
|
+
`,resultLabel:t`
|
|
44
|
+
font-size: 12px;
|
|
45
|
+
font-weight: 600;
|
|
46
|
+
color: ${e.colorTextSecondary};
|
|
47
|
+
`,impactList:t`
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
gap: 4px;
|
|
51
|
+
`,impactRow:t`
|
|
52
|
+
display: inline-flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
gap: 6px;
|
|
55
|
+
font-size: 12px;
|
|
56
|
+
color: ${e.colorText};
|
|
57
|
+
background: ${e.colorFillTertiary};
|
|
58
|
+
border-radius: 6px;
|
|
59
|
+
padding: 3px 8px;
|
|
60
|
+
align-self: flex-start;
|
|
61
|
+
`,impactKey:t`
|
|
62
|
+
font-weight: 600;
|
|
63
|
+
color: ${e.colorInfo};
|
|
64
|
+
`,impactBasis:t`
|
|
65
|
+
color: ${e.colorTextTertiary};
|
|
66
|
+
`,viewChat:t`
|
|
67
|
+
display: inline-flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
gap: 4px;
|
|
70
|
+
font-size: 12px;
|
|
71
|
+
color: ${e.colorInfo};
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
appearance: none;
|
|
74
|
+
background: transparent;
|
|
75
|
+
border: 0;
|
|
76
|
+
font-family: inherit;
|
|
77
|
+
margin: 0;
|
|
78
|
+
min-height: 24px;
|
|
79
|
+
padding: 2px 4px;
|
|
80
|
+
align-self: flex-start;
|
|
81
|
+
&:hover {
|
|
82
|
+
text-decoration: underline;
|
|
83
|
+
}
|
|
84
|
+
&:active {
|
|
85
|
+
opacity: 0.75;
|
|
86
|
+
}
|
|
87
|
+
&:focus-visible {
|
|
88
|
+
outline: 2px solid ${e.colorPrimaryBorder};
|
|
89
|
+
outline-offset: 2px;
|
|
90
|
+
border-radius: 4px;
|
|
91
|
+
}
|
|
92
|
+
`})),me=({item:e,viewChat:t})=>{let{styles:n}=dt(),m=typeof e.detail?.markdown=="string"&&e.detail.markdown.length>0?e.detail.markdown:void 0,c=typeof e.detail?.result=="string"&&e.detail.result.length>0?e.detail.result:void 0,h=e.detail?.beliefImpact,g=(Array.isArray(h)?h:[]).filter(s=>typeof s=="object"&&s!==null).map(s=>({key:typeof s.key=="string"?s.key:"",after:typeof s.after=="number"?s.after:Number.NaN,basis:typeof s.basis=="string"?s.basis:""})).filter(s=>s.key.length>0),l=!!(e.threadId&&t);return!m&&!c&&g.length===0&&!l?null:(0,v.jsxs)("div",{className:n.root,"data-testid":"task-activity-detail",children:[m&&(0,v.jsx)("div",{className:n.markdown,children:(0,v.jsx)(z,{content:m})}),c&&(0,v.jsxs)("div",{className:n.markdown,children:[(0,v.jsx)("div",{className:n.resultLabel,children:"Result"}),(0,v.jsx)(z,{content:c})]}),g.length>0&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{className:n.resultLabel,children:"Belief Impact"}),(0,v.jsx)("div",{className:n.impactList,children:g.map((s,x)=>(0,v.jsxs)("span",{className:n.impactRow,children:[(0,v.jsxs)("span",{className:n.impactKey,children:[s.key,":"]}),(0,v.jsxs)("span",{children:["reported ",Number.isFinite(s.after)?`${s.after}%`:"n/a"]}),s.basis&&(0,v.jsxs)("span",{className:n.impactBasis,children:["\u2014 ",s.basis]})]},`${s.key}-${x}`))})]}),l&&(0,v.jsxs)("button",{type:"button",className:n.viewChat,onClick:t,children:[(0,v.jsx)(V,{size:12}),"View Chat"]})]})};var r=N(S()),Ee=B(({token:e,css:t})=>({workbench:t`
|
|
93
|
+
min-width: 0;
|
|
94
|
+
max-width: 100%;
|
|
95
|
+
color: ${e.colorText};
|
|
96
|
+
container-name: task-detail-workbench;
|
|
97
|
+
container-type: inline-size;
|
|
98
|
+
`,command:t`
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
gap: 12px;
|
|
102
|
+
margin-bottom: 18px;
|
|
103
|
+
min-width: 0;
|
|
104
|
+
`,commandMain:t`
|
|
105
|
+
flex: 1 1 auto;
|
|
106
|
+
min-width: 0;
|
|
107
|
+
`,parentPath:t`
|
|
108
|
+
appearance: none;
|
|
109
|
+
display: inline-flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
min-height: 32px;
|
|
112
|
+
margin-bottom: 4px;
|
|
113
|
+
padding: 0 4px;
|
|
114
|
+
border: 0;
|
|
115
|
+
border-radius: 6px;
|
|
116
|
+
background: transparent;
|
|
117
|
+
color: ${e.colorTextTertiary};
|
|
118
|
+
font: inherit;
|
|
119
|
+
font-size: 12px;
|
|
120
|
+
cursor: default;
|
|
121
|
+
&:focus-visible {
|
|
122
|
+
outline: 2px solid ${e.colorPrimaryBorder};
|
|
123
|
+
outline-offset: 2px;
|
|
124
|
+
}
|
|
125
|
+
`,parentAction:t`
|
|
126
|
+
cursor: pointer;
|
|
127
|
+
&:hover { color: ${e.colorPrimary}; }
|
|
128
|
+
`,title:t`
|
|
129
|
+
margin: 0;
|
|
130
|
+
color: ${e.colorText};
|
|
131
|
+
font-size: 22px;
|
|
132
|
+
font-weight: 650;
|
|
133
|
+
line-height: 1.25;
|
|
134
|
+
overflow-wrap: anywhere;
|
|
135
|
+
&:focus-visible {
|
|
136
|
+
outline: 2px solid ${e.colorPrimaryBorder};
|
|
137
|
+
outline-offset: 3px;
|
|
138
|
+
border-radius: 4px;
|
|
139
|
+
}
|
|
140
|
+
`,commandMeta:t`
|
|
141
|
+
display: flex;
|
|
142
|
+
flex-wrap: wrap;
|
|
143
|
+
gap: 10px;
|
|
144
|
+
margin-top: 6px;
|
|
145
|
+
color: ${e.colorTextSecondary};
|
|
146
|
+
font-size: 12px;
|
|
147
|
+
`,commandActions:t`
|
|
148
|
+
display: flex;
|
|
149
|
+
align-items: center;
|
|
150
|
+
gap: 8px;
|
|
151
|
+
flex: 0 0 auto;
|
|
152
|
+
`,backButton:t`
|
|
153
|
+
appearance: none;
|
|
154
|
+
display: inline-flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
justify-content: center;
|
|
157
|
+
width: 32px;
|
|
158
|
+
height: 32px;
|
|
159
|
+
padding: 0;
|
|
160
|
+
border: 1px solid ${e.colorBorderSecondary};
|
|
161
|
+
border-radius: ${e.borderRadius}px;
|
|
162
|
+
background: ${e.colorBgContainer};
|
|
163
|
+
color: ${e.colorTextSecondary};
|
|
164
|
+
cursor: pointer;
|
|
165
|
+
flex: 0 0 auto;
|
|
166
|
+
&:hover {
|
|
167
|
+
color: ${e.colorText};
|
|
168
|
+
border-color: ${e.colorBorder};
|
|
169
|
+
background: ${e.colorBgTextHover};
|
|
170
|
+
}
|
|
171
|
+
&:focus-visible {
|
|
172
|
+
outline: 2px solid ${e.colorPrimary};
|
|
173
|
+
outline-offset: 2px;
|
|
174
|
+
}
|
|
175
|
+
`,commandAction:t`
|
|
176
|
+
min-height: 32px;
|
|
177
|
+
white-space: normal;
|
|
178
|
+
`,factStrip:t`
|
|
179
|
+
display: grid;
|
|
180
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
181
|
+
gap: 12px;
|
|
182
|
+
margin-bottom: 16px;
|
|
183
|
+
@container task-detail-workbench (min-width: 640px) and (max-width: ${899}px) {
|
|
184
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
185
|
+
> :first-child { grid-column: 1 / -1; }
|
|
186
|
+
}
|
|
187
|
+
@container task-detail-workbench (max-width: 639px) {
|
|
188
|
+
grid-template-columns: minmax(0, 1fr);
|
|
189
|
+
}
|
|
190
|
+
`,factCard:t`
|
|
191
|
+
min-width: 0;
|
|
192
|
+
padding: 14px 16px;
|
|
193
|
+
border: 1px solid ${e.colorBorderSecondary};
|
|
194
|
+
border-radius: 14px;
|
|
195
|
+
background: ${e.colorBgContainer};
|
|
196
|
+
&:first-child { border-top: 2px solid ${e.colorPrimary}; }
|
|
197
|
+
`,heading:t`
|
|
198
|
+
margin: 0 0 10px;
|
|
199
|
+
color: ${e.colorTextSecondary};
|
|
200
|
+
font-size: 12px;
|
|
201
|
+
font-weight: 700;
|
|
202
|
+
letter-spacing: 0.04em;
|
|
203
|
+
text-transform: uppercase;
|
|
204
|
+
`,facts:t`
|
|
205
|
+
display: grid;
|
|
206
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
207
|
+
gap: 7px 12px;
|
|
208
|
+
margin: 0;
|
|
209
|
+
font-size: 12px;
|
|
210
|
+
dt { color: ${e.colorTextTertiary}; }
|
|
211
|
+
dd {
|
|
212
|
+
min-width: 0;
|
|
213
|
+
margin: 0;
|
|
214
|
+
color: ${e.colorText};
|
|
215
|
+
font-weight: 650;
|
|
216
|
+
text-align: right;
|
|
217
|
+
overflow-wrap: anywhere;
|
|
218
|
+
}
|
|
219
|
+
`,overdue:t`
|
|
220
|
+
color: ${e.colorError};
|
|
221
|
+
font-weight: 700;
|
|
222
|
+
`,grid:t`
|
|
223
|
+
display: grid;
|
|
224
|
+
grid-template-columns: 2fr 1fr;
|
|
225
|
+
gap: 16px;
|
|
226
|
+
align-items: start;
|
|
227
|
+
@container task-detail-workbench (max-width: ${899}px) {
|
|
228
|
+
grid-template-columns: minmax(0, 1fr);
|
|
229
|
+
}
|
|
230
|
+
`,card:t`
|
|
231
|
+
min-width: 0;
|
|
232
|
+
padding: 18px;
|
|
233
|
+
border: 1px solid ${e.colorBorderSecondary};
|
|
234
|
+
border-radius: 16px;
|
|
235
|
+
background: ${e.colorBgContainer};
|
|
236
|
+
`,contextCard:t`
|
|
237
|
+
@container task-detail-workbench (min-width: 640px) and (max-width: ${899}px) {
|
|
238
|
+
padding: 14px 18px;
|
|
239
|
+
}
|
|
240
|
+
`,contextContent:t`
|
|
241
|
+
min-width: 0;
|
|
242
|
+
@container task-detail-workbench (min-width: 640px) and (max-width: ${899}px) {
|
|
243
|
+
> * {
|
|
244
|
+
display: grid;
|
|
245
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
246
|
+
column-gap: 24px;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
`,activity:t`
|
|
250
|
+
grid-column: 1 / -1;
|
|
251
|
+
`,commandResponsive:t`
|
|
252
|
+
@container task-detail-workbench (max-width: 639px) {
|
|
253
|
+
flex-wrap: wrap;
|
|
254
|
+
align-items: flex-start;
|
|
255
|
+
.ant-btn { min-height: 32px; }
|
|
256
|
+
}
|
|
257
|
+
`,actionsResponsive:t`
|
|
258
|
+
@container task-detail-workbench (max-width: 639px) {
|
|
259
|
+
width: 100%;
|
|
260
|
+
> * { min-height: 32px; }
|
|
261
|
+
}
|
|
262
|
+
`}));function ue(e){return new Date(e).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function ct(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,m])=>`${n.replaceAll("_"," ")} ${m}`).join(" \xB7 ")}var w=({label:e,children:t})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("dt",{children:e}),(0,r.jsx)("dd",{children:t})]}),H=({name:e,children:t,className:n,showHeading:m=!0})=>{let{styles:c}=Ee();return(0,r.jsxs)("section",{role:"region","aria-label":e,className:`${c.card} ${n??""}`,children:[m&&(0,r.jsx)("h3",{className:c.heading,children:e}),t]})},Me=({task:e,facts:t,parent:n,canGoBack:m=!1,onBack:c,onParentClick:h,headingRef:g,statusControl:l,priorityControl:s,regions:x,threadId:b,onViewChat:u})=>{let{styles:p}=Ee(),A=e.ownerType==="agent"?`@${e.ownerId}`:e.ownerId,I=t.execution.dependencies;return(0,r.jsxs)("div",{className:p.workbench,"data-testid":"task-detail-workbench",children:[(0,r.jsxs)("header",{"aria-label":"Task command",className:`${p.command} ${p.commandResponsive}`,children:[m&&c&&(0,r.jsx)("button",{type:"button",className:p.backButton,"data-testid":"task-detail-back",onClick:c,"aria-label":"Back",children:(0,r.jsx)(Ne,{size:16})}),(0,r.jsxs)("div",{className:p.commandMain,children:[n&&(h?(0,r.jsxs)("button",{type:"button",className:`${p.parentPath} ${p.parentAction}`,"data-testid":"parent-row","aria-label":`Parent: ${n.title}`,onClick:()=>h(n),children:[n.title," /"]}):(0,r.jsxs)("div",{className:p.parentPath,"data-testid":"parent-row",children:[n.title," /"]})),(0,r.jsx)("h2",{ref:g,className:p.title,tabIndex:g?-1:void 0,"data-testid":"task-detail-heading",children:e.title}),(0,r.jsxs)("div",{className:p.commandMeta,children:[(0,r.jsx)("span",{children:A}),(0,r.jsx)("span",{children:"Updated"}),(0,r.jsx)("span",{title:ue(e.updatedAt),children:ct(e.updatedAt)})]})]}),(0,r.jsx)("div",{className:`${p.commandActions} ${p.actionsResponsive}`,children:b&&u&&(0,r.jsx)(Te,{className:`${p.commandAction} task-detail-compact-action`,"data-testid":"thread-row","aria-label":"View agent work",icon:(0,r.jsx)(V,{size:14}),onClick:()=>u(b),children:"View agent work"})})]}),(0,r.jsxs)("div",{className:p.factStrip,children:[(0,r.jsxs)("section",{role:"region","aria-label":"State",className:p.factCard,children:[(0,r.jsx)("h3",{className:p.heading,children:"State"}),(0,r.jsxs)("dl",{className:p.facts,children:[(0,r.jsx)(w,{label:"Status",children:l}),(0,r.jsx)(w,{label:"Priority",children:s}),(0,r.jsx)(w,{label:"Due",children:t.state.dueDate?(0,r.jsxs)(r.Fragment,{children:[ue(t.state.dueDate),t.state.overdue&&(0,r.jsx)("span",{className:p.overdue,"data-testid":"overdue-marker",children:" \xB7 Overdue"})]}):"Not set"}),(0,r.jsx)(w,{label:"Review policy",children:t.state.requiresReview?"Yes":"No"}),(0,r.jsx)(w,{label:"Waiting approval",children:t.state.awaitingReview?"Yes":"No"}),(0,r.jsx)(w,{label:"Failure reason recorded",children:t.state.hasFailureReason?"Yes":"No"})]})]}),(0,r.jsxs)("section",{role:"region","aria-label":"Execution",className:p.factCard,children:[(0,r.jsx)("h3",{className:p.heading,children:"Execution"}),(0,r.jsxs)("dl",{className:p.facts,children:[(0,r.jsxs)(w,{label:"Subtasks",children:[t.execution.subtasks.completed," / ",t.execution.subtasks.total]}),(0,r.jsx)(w,{label:"Status distribution",children:pt(t.execution.subtasks.byStatus)}),(0,r.jsx)(w,{label:"Dependencies",children:I.total===0?"None":`${I.completed} completed / ${I.known} known / ${I.unavailable} unavailable`}),(0,r.jsx)(w,{label:"Latest activity",children:t.execution.latestActivityAt?ue(t.execution.latestActivityAt):"None"}),(0,r.jsx)(w,{label:"Maximum attempt",children:t.execution.maxAttempt??"None"})]})]}),(0,r.jsxs)("section",{role:"region","aria-label":"Output",className:p.factCard,children:[(0,r.jsx)("h3",{className:p.heading,children:"Output"}),(0,r.jsxs)("dl",{className:p.facts,children:[(0,r.jsx)(w,{label:"Result recorded",children:t.output.hasResult?"Yes":"No"}),(0,r.jsx)(w,{label:"Failure recorded",children:t.output.hasFailureReason?"Yes":"No"}),(0,r.jsx)(w,{label:"Files",children:t.output.files}),(0,r.jsx)(w,{label:"Artifacts",children:t.output.artifacts}),(0,r.jsx)(w,{label:"References",children:t.output.references}),(0,r.jsx)(w,{label:"Conversation",children:t.output.hasConversation?"Yes":"No"})]})]})]}),(0,r.jsxs)("div",{className:p.grid,children:[(0,r.jsx)(H,{name:"Task Content",children:x.taskContent}),(0,r.jsx)(H,{name:"Context",className:p.contextCard,children:(0,r.jsx)("div",{className:p.contextContent,children:x.context})}),(0,r.jsx)(H,{name:"Output details",children:x.output}),(0,r.jsx)(H,{name:"Subtasks",children:x.subtasks}),(0,r.jsx)(H,{name:"Activity",className:p.activity,showHeading:!1,children:x.activity})]})]})};function fe(e){return e==="completed"||e==="cancelled"}function Ft(e,t){let m=t?.hideCompleted??!1?e.filter(l=>!fe(l.status)):e,c=new Set(m.map(l=>l.id)),h=[],g=new Set;for(let l of m){if(l.parentId&&c.has(l.parentId)&&l.parentId!==l.id){let s=`${l.parentId}|${l.id}|parent`;g.has(s)||(g.add(s),h.push({from:l.parentId,to:l.id,kind:"parent"}))}for(let s of l.dependencies??[])if(c.has(s)&&s!==l.id){let x=`${s}|${l.id}|dependency`;g.has(x)||(g.add(x),h.push({from:s,to:l.id,kind:"dependency"}))}}return{nodes:m.map(l=>({id:l.id,task:l})),edges:mt(c,h)}}function mt(e,t){let n=[...t];for(;;){let m=new Map,c=new Map;for(let u of e)m.set(u,0),c.set(u,[]);for(let u of n)m.set(u.to,(m.get(u.to)??0)+1),c.get(u.from)?.push(u.to);let h=[...m.entries()].filter(([,u])=>u===0).map(([u])=>u),g=0;for(;h.length>0;){let u=h.shift();g+=1;for(let p of c.get(u)??[]){let A=(m.get(p)??0)-1;m.set(p,A),A===0&&h.push(p)}}if(g>=e.size)return n;let l=new Set([...m.entries()].filter(([,u])=>u>0).map(([u])=>u)),s=u=>l.has(u.from)&&l.has(u.to),x=n.findIndex(u=>u.kind==="dependency"&&s(u)),b=x>=0?x:n.findIndex(s);if(b===-1)return n;n.splice(b,1)}}function _e(e){let{task:t,workItems:n,subtasks:m,relatedTasks:c}=e,h=e.now??new Date,g=t.dueDate===void 0?Number.NaN:new Date(t.dueDate).getTime(),l=h.getTime(),s=t.failureReason!==void 0,x=t.context?.interruption,b=t.status==="interrupted"&&typeof x=="object"&&x!==null&&x.type==="review_required",u={};for(let y of m)u[y.status]=(u[y.status]??0)+1;let p=new Set(t.dependencies??[]),A=new Map(c.map(y=>[y.id,y])),I=0,P=0;for(let y of p){let C=A.get(y);C&&(I+=1,C.status==="completed"&&(P+=1))}let i,D;for(let y of n){let C=Le(y.createdAt);C!==void 0&&(i===void 0||C>i.getTime())&&(i=new Date(C)),typeof y.attempt=="number"&&Number.isFinite(y.attempt)&&(D=D===void 0?y.attempt:Math.max(D,y.attempt))}let E=t.files??[],M=ge(t,n);return{state:{status:t.status,priority:t.priority,dueDate:t.dueDate,overdue:Number.isFinite(g)&&Number.isFinite(l)&&g<l&&!fe(t.status),requiresReview:t.requireReview===!0,awaitingReview:b,hasFailureReason:s},execution:{subtasks:{total:m.length,completed:u.completed??0,byStatus:u},dependencies:{total:p.size,known:I,completed:P,unavailable:p.size-I},latestActivityAt:i,maxAttempt:D},output:{hasResult:t.result!==void 0,hasFailureReason:s,files:E.length,artifacts:E.filter(y=>y.addedBy==="agent").length,references:E.filter(y=>y.addedBy==="user").length,hasConversation:M!==void 0}}}function ge(e,t){let n=e.context?.thread_id;if(ze(n))return n;let m,c=Number.NEGATIVE_INFINITY;for(let h of t){if(!ze(h.threadId))continue;let g=Le(h.createdAt);g!==void 0&&g>c&&(m=h.threadId,c=g)}return m}function Le(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 ze(e){return typeof e=="string"&&e.trim().length>0}var a=N(S()),K={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"}},Ge={high:{label:"High",color:"#ef4444"},medium:{label:"Medium",color:"#f59e0b"},low:{label:"Low",color:"#22c55e"}},ut={approved:(0,a.jsx)(J,{size:14,style:{color:"#22c55e"}}),rejected:(0,a.jsx)(Re,{size:14,style:{color:"#ef4444"}}),started:(0,a.jsx)(pe,{size:14,style:{color:"#3b82f6"}}),failed:(0,a.jsx)(Ce,{size:14,style:{color:"#ef4444"}}),completed:(0,a.jsx)(J,{size:14,style:{color:"#22c55e"}}),retried:(0,a.jsx)(pe,{size:14,style:{color:"#f59e0b"}}),cancelled:(0,a.jsx)(Ie,{size:14,style:{color:"#7A7A7A"}}),created:(0,a.jsx)($e,{size:14,style:{color:"#7A7A7A"}})};function he(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 We(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 ft(e){if(e.name)return e.name;let t=e.uri.split("/").filter(Boolean);return t[t.length-1]||e.uri}var gt=B(({token:e,css:t})=>({main:t`
|
|
263
|
+
flex: 1 1 380px;
|
|
264
|
+
min-width: 0;
|
|
265
|
+
display: flex;
|
|
266
|
+
flex-direction: column;
|
|
267
|
+
gap: 16px;
|
|
268
|
+
`,rail:t`
|
|
269
|
+
display: flex;
|
|
270
|
+
flex-direction: column;
|
|
271
|
+
`,sectionTitle:t`
|
|
272
|
+
margin: 0 0 8px;
|
|
273
|
+
font-size: 13px;
|
|
274
|
+
font-weight: 600;
|
|
275
|
+
color: ${e.colorTextSecondary};
|
|
276
|
+
`,description:t`
|
|
277
|
+
font-size: 14px;
|
|
278
|
+
color: ${e.colorText};
|
|
279
|
+
line-height: 1.7;
|
|
280
|
+
`,resultCard:t`
|
|
281
|
+
background: #f6ffed;
|
|
282
|
+
border: 1px solid #b7eb8f;
|
|
283
|
+
border-radius: 12px;
|
|
284
|
+
padding: 16px;
|
|
285
|
+
`,failureCard:t`
|
|
286
|
+
background: #fff2f0;
|
|
287
|
+
border: 1px solid #ffccc7;
|
|
288
|
+
border-radius: 12px;
|
|
289
|
+
padding: 16px;
|
|
290
|
+
`,waitingCard:t`
|
|
291
|
+
background: #fffbe6;
|
|
292
|
+
border: 1px solid #ffe58f;
|
|
293
|
+
border-radius: 12px;
|
|
294
|
+
padding: 16px;
|
|
295
|
+
display: flex;
|
|
296
|
+
flex-direction: column;
|
|
297
|
+
gap: 10px;
|
|
298
|
+
`,propRow:t`
|
|
299
|
+
display: flex;
|
|
300
|
+
align-items: center;
|
|
301
|
+
justify-content: space-between;
|
|
302
|
+
gap: 8px;
|
|
303
|
+
padding: 6px 0;
|
|
304
|
+
font-size: 13px;
|
|
305
|
+
`,propLabel:t`
|
|
306
|
+
color: ${e.colorTextTertiary};
|
|
307
|
+
flex-shrink: 0;
|
|
308
|
+
`,propValue:t`
|
|
309
|
+
color: ${e.colorText};
|
|
310
|
+
display: flex;
|
|
311
|
+
align-items: center;
|
|
312
|
+
gap: 6px;
|
|
313
|
+
min-width: 0;
|
|
314
|
+
`,statusBadge:t`
|
|
315
|
+
display: inline-flex;
|
|
316
|
+
align-items: center;
|
|
317
|
+
gap: 6px;
|
|
318
|
+
font-weight: 600;
|
|
319
|
+
`,quietButton:t`
|
|
320
|
+
appearance: none;
|
|
321
|
+
background: transparent;
|
|
322
|
+
border: 0;
|
|
323
|
+
color: inherit;
|
|
324
|
+
font: inherit;
|
|
325
|
+
margin: 0;
|
|
326
|
+
padding: 0;
|
|
327
|
+
text-align: inherit;
|
|
328
|
+
cursor: pointer;
|
|
329
|
+
&:active {
|
|
330
|
+
background: ${e.colorFillSecondary};
|
|
331
|
+
}
|
|
332
|
+
&:focus-visible {
|
|
333
|
+
outline: 2px solid ${e.colorPrimaryBorder};
|
|
334
|
+
outline-offset: 2px;
|
|
335
|
+
border-radius: 6px;
|
|
336
|
+
}
|
|
337
|
+
`,actionRow:t`
|
|
338
|
+
width: 100%;
|
|
339
|
+
&:hover {
|
|
340
|
+
background: ${e.colorFillTertiary};
|
|
341
|
+
}
|
|
342
|
+
`,compactAction:t`
|
|
343
|
+
min-height: 24px;
|
|
344
|
+
padding: 2px 4px;
|
|
345
|
+
@container task-detail-workbench (max-width: 639px) {
|
|
346
|
+
min-height: 32px;
|
|
347
|
+
}
|
|
348
|
+
`,statusTrigger:t`
|
|
349
|
+
border-radius: 6px;
|
|
350
|
+
&:hover {
|
|
351
|
+
background: ${e.colorFillTertiary};
|
|
352
|
+
}
|
|
353
|
+
`,statusDot:t`
|
|
354
|
+
width: 8px;
|
|
355
|
+
height: 8px;
|
|
356
|
+
border-radius: 50%;
|
|
357
|
+
flex-shrink: 0;
|
|
358
|
+
`,checklistItem:t`
|
|
359
|
+
display: flex;
|
|
360
|
+
align-items: flex-start;
|
|
361
|
+
gap: 8px;
|
|
362
|
+
padding: 4px 0;
|
|
363
|
+
font-size: 13px;
|
|
364
|
+
line-height: 1.5;
|
|
365
|
+
color: ${e.colorText};
|
|
366
|
+
`,checklistDone:t`
|
|
367
|
+
color: ${e.colorTextTertiary};
|
|
368
|
+
`,subtaskRow:t`
|
|
369
|
+
display: flex;
|
|
370
|
+
align-items: center;
|
|
371
|
+
gap: 8px;
|
|
372
|
+
padding: 6px 8px;
|
|
373
|
+
margin: 0 -8px;
|
|
374
|
+
border-radius: 6px;
|
|
375
|
+
font-size: 13px;
|
|
376
|
+
color: ${e.colorText};
|
|
377
|
+
transition: background 0.15s ease;
|
|
378
|
+
`,subtaskStatus:t`
|
|
379
|
+
flex-shrink: 0;
|
|
380
|
+
font-size: 12px;
|
|
381
|
+
white-space: nowrap;
|
|
382
|
+
`,subtaskTitle:t`
|
|
383
|
+
flex: 1;
|
|
384
|
+
min-width: 0;
|
|
385
|
+
overflow: hidden;
|
|
386
|
+
text-overflow: ellipsis;
|
|
387
|
+
white-space: nowrap;
|
|
388
|
+
`,fileRow:t`
|
|
389
|
+
display: flex;
|
|
390
|
+
align-items: center;
|
|
391
|
+
gap: 8px;
|
|
392
|
+
padding: 4px 0;
|
|
393
|
+
font-size: 13px;
|
|
394
|
+
color: ${e.colorText};
|
|
395
|
+
`,fileName:t`
|
|
396
|
+
flex: 1;
|
|
397
|
+
min-width: 0;
|
|
398
|
+
overflow: hidden;
|
|
399
|
+
text-overflow: ellipsis;
|
|
400
|
+
white-space: nowrap;
|
|
401
|
+
`,fileKind:t`
|
|
402
|
+
flex-shrink: 0;
|
|
403
|
+
font-size: 12px;
|
|
404
|
+
color: ${e.colorTextTertiary};
|
|
405
|
+
`,feedHeader:t`
|
|
406
|
+
display: flex;
|
|
407
|
+
align-items: center;
|
|
408
|
+
gap: 6px;
|
|
409
|
+
user-select: none;
|
|
410
|
+
width: fit-content;
|
|
411
|
+
min-height: 24px;
|
|
412
|
+
padding: 2px 4px;
|
|
413
|
+
&:hover {
|
|
414
|
+
color: ${e.colorPrimary};
|
|
415
|
+
}
|
|
416
|
+
@container task-detail-workbench (max-width: 639px) {
|
|
417
|
+
min-height: 32px;
|
|
418
|
+
}
|
|
419
|
+
`,feed:t`
|
|
420
|
+
display: flex;
|
|
421
|
+
flex-direction: column;
|
|
422
|
+
gap: 10px;
|
|
423
|
+
margin-top: 10px;
|
|
424
|
+
`,feedItem:t`
|
|
425
|
+
display: flex;
|
|
426
|
+
gap: 8px;
|
|
427
|
+
font-size: 13px;
|
|
428
|
+
`,feedSummary:t`
|
|
429
|
+
color: ${e.colorText};
|
|
430
|
+
`,feedMeta:t`
|
|
431
|
+
display: flex;
|
|
432
|
+
gap: 8px;
|
|
433
|
+
font-size: 12px;
|
|
434
|
+
color: ${e.colorTextTertiary};
|
|
435
|
+
`,threadLink:t`
|
|
436
|
+
display: inline-flex;
|
|
437
|
+
align-items: center;
|
|
438
|
+
gap: 4px;
|
|
439
|
+
color: ${e.colorInfo};
|
|
440
|
+
min-height: 24px;
|
|
441
|
+
padding: 2px 4px;
|
|
442
|
+
&:hover {
|
|
443
|
+
text-decoration: underline;
|
|
444
|
+
}
|
|
445
|
+
@container task-detail-workbench (max-width: 639px) {
|
|
446
|
+
min-height: 32px;
|
|
447
|
+
}
|
|
448
|
+
`,spinner:t`
|
|
449
|
+
display: flex;
|
|
450
|
+
align-items: center;
|
|
451
|
+
justify-content: center;
|
|
452
|
+
padding: 48px 0;
|
|
453
|
+
`})),Oe=({task:e,relatedTasks:t=[],onRelatedTaskClick:n,headingRef:m,workItems:c=[],loading:h=!1,activityError:g,actions:l,transitionPending:s=!1,subtaskProgress:x,subtasks:b,onSubtaskClick:u,parent:p,onParentClick:A,canGoBack:I=!1,onBack:P})=>{let{styles:i}=gt(),[D,E]=(0,k.useState)(!1),[M,y]=(0,k.useState)(!1),[C,xe]=(0,k.useState)(!1),be=(0,k.useId)(),ye=(0,k.useId)(),$=K[e.status]||K.pending,te=Ge[e.priority]||Ge.medium,j=e.context?.interruption,_=e.status==="interrupted"&&typeof j=="object"&&j!==null&&j.type==="review_required",ae=ge(e,c),G=l?.onViewChat,qe=(0,k.useMemo)(()=>_e({task:e,workItems:c,subtasks:b??[],relatedTasks:t}),[t,b,e,c]),U=_?j.evidenceId:void 0,ie=typeof U=="string"&&U.length>0,L=(0,k.useMemo)(()=>{let o=c.filter(d=>d.action==="completion_evidence");return ie?o.find(d=>d.id===U):[...o].sort((d,f)=>new Date(f.createdAt).getTime()-new Date(d.createdAt).getTime())[0]},[ie,U,c]),He=typeof L?.detail?.result=="string"&&L.detail.result.length>0,{checklistItems:ne,doneCount:Ke}=(0,k.useMemo)(()=>{if(!e.description)return{checklistItems:[],doneCount:0};let o=e.description.split(`
|
|
454
|
+
`).filter(d=>/^\s*[-*]\s*\[[ x]\]/i.test(d)).map(d=>({text:d.replace(/^\s*[-*]\s*\[[ x]\]\s*/i,""),done:/^\s*[-*]\s*\[[x]\]/i.test(d)}));return o.sort((d,f)=>Number(d.done)-Number(f.done)),{checklistItems:o,doneCount:o.filter(d=>d.done).length}},[e.description]),ve=(0,k.useMemo)(()=>e.description?Fe(e.description).split(`
|
|
455
|
+
`).filter(o=>!/^\s*[-*]\s*\[[ x]\]/i.test(o)).join(`
|
|
456
|
+
`).trim():"",[e.description]),je=typeof e.description=="string"&&e.description.trim().length>0,Ue=e.files?.filter(o=>o.addedBy==="agent")??[],Ye=e.files?.filter(o=>o.addedBy==="user")??[],Xe=e.files?.filter(o=>o.addedBy===void 0)??[],oe=(0,k.useMemo)(()=>c.length>0?[...c].sort((o,d)=>new Date(o.createdAt).getTime()-new Date(d.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: ${$.label}`,createdAt:e.updatedAt}],[c,e,$.label]),W=(0,k.useMemo)(()=>{let o=new Set,d=new Set;for(let f of oe){if(f.action==="completion_evidence")continue;let R=f.detail?.eventKey??f.eventKey;typeof R=="string"&&R.length>0&&o.add(R);let F=f.detail?.evidenceId;typeof F=="string"&&F.length>0&&d.add(F)}return oe.filter(f=>{if(f.action!=="completion_evidence")return!0;if(_&&f.id===L?.id)return!1;let R=f.detail?.eventKey??f.eventKey;return d.has(f.id)?!1:typeof R!="string"||!o.has(R)})},[oe,_,L?.id]),Je=g?0:W.length,Qe=M?W:W.slice(-3),Ze=D?b:b?.slice(0,5),re=(0,k.useMemo)(()=>b&&b.length>0?{done:b.filter(o=>o.status==="completed").length,total:b.length}:x,[b,x]),Y=(0,k.useMemo)(()=>{if(!l||e.ownerType==="agent")return[];let o=[];return e.status==="failed"&&(l.onRetry&&o.push({key:"retry",label:"Retry",onClick:l.onRetry}),l.onCancel&&o.push({key:"cancel",label:"Cancel task",danger:!0,onClick:l.onCancel})),o},[l,e.ownerType,e.status]);(0,k.useEffect)(()=>{xe(!1)},[e.id,e.status,s]),(0,k.useEffect)(()=>{E(!1),y(!1)},[e.id]);let ke=Y.length>0?(0,a.jsxs)("button",{type:"button",className:`${i.statusBadge} ${i.quietButton} ${i.compactAction} ${i.statusTrigger}`,style:{color:$.color},"data-testid":"status-badge","aria-label":`Change status, current status ${$.label}`,"aria-haspopup":"menu","aria-expanded":C,children:[(0,a.jsx)("span",{className:i.statusDot,style:{background:$.color}}),$.label,(0,a.jsx)(ce,{size:12})]}):(0,a.jsxs)("span",{className:i.statusBadge,style:{color:$.color},"data-testid":"status-badge",children:[(0,a.jsx)("span",{className:i.statusDot,style:{background:$.color}}),$.label]}),et=(0,a.jsxs)(a.Fragment,{children:[ve?(0,a.jsx)("div",{className:i.description,children:(0,a.jsx)(z,{content:ve})}):je?null:(0,a.jsx)("div",{className:i.feedMeta,children:"No task description"}),ne.length>0&&(0,a.jsxs)("div",{style:{marginTop:16},children:[(0,a.jsxs)("div",{className:i.sectionTitle,children:["Acceptance \u2713 ",Ke,"/",ne.length]}),ne.map((o,d)=>(0,a.jsxs)("div",{"data-testid":"checklist-item",className:`${i.checklistItem} ${o.done?i.checklistDone:""}`,children:[o.done?(0,a.jsx)(J,{size:14,style:{color:"#22c55e",flexShrink:0,marginTop:2}}):(0,a.jsx)("div",{style:{width:14,height:14,border:"2px solid #d9d9d9",borderRadius:3,flexShrink:0,marginTop:2}}),(0,a.jsx)("span",{children:o.text})]},d))]}),(0,a.jsx)(Pe,{description:e.description})]}),tt=(0,a.jsxs)("div",{className:i.main,children:[_&&(0,a.jsxs)("div",{className:i.waitingCard,"data-testid":"approval-waiting",children:[(0,a.jsx)("div",{className:i.sectionTitle,style:{color:"#b45309",margin:0},children:"Waiting for approval"}),L&&(0,a.jsx)(me,{item:L}),!L&&ie&&(0,a.jsx)("div",{className:i.feedMeta,children:h?"Approval evidence is loading...":"Approval evidence is unavailable."}),e.result!==void 0&&!He&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:i.sectionTitle,children:"Result"}),(0,a.jsx)("div",{className:i.description,children:e.result.length>0?(0,a.jsx)(z,{content:e.result}):"No text provided"})]}),!ae||!G?(0,a.jsx)("div",{className:i.feedMeta,children:"The agent conversation is unavailable because no thread is associated with this task."}):null]}),e.result!==void 0&&!_?(0,a.jsxs)("div",{className:i.resultCard,children:[(0,a.jsx)("h4",{className:i.sectionTitle,children:"Result"}),(0,a.jsx)("div",{className:i.description,children:e.result.length>0?(0,a.jsx)(z,{content:e.result}):"No text provided"})]}):_?null:(0,a.jsx)("div",{className:i.feedMeta,children:"No result recorded"}),e.failureReason!==void 0&&(0,a.jsxs)("div",{className:i.failureCard,children:[(0,a.jsx)("h4",{className:i.sectionTitle,style:{color:"#ef4444"},children:"Failure Reason"}),(0,a.jsx)("div",{className:i.description,children:e.failureReason.length>0?(0,a.jsx)(z,{content:e.failureReason}):"No text provided"})]}),e.failureReason===void 0&&(0,a.jsx)("div",{className:i.feedMeta,children:"No failure reason recorded"}),e.files&&e.files.length>0?(0,a.jsx)("div",{"data-testid":"files-section",children:[["Artifacts",Ue],["References",Ye],["Other files",Xe]].map(([o,d])=>d.length>0&&(0,a.jsxs)("div",{style:{marginTop:8},children:[(0,a.jsx)("h4",{className:i.sectionTitle,children:o}),d.map((f,R)=>{let F=ft(f),O=/^https?:\/\//.test(f.uri);return(0,a.jsxs)("div",{"data-testid":"file-row",className:i.fileRow,children:[(0,a.jsx)(Se,{size:13,style:{flexShrink:0,color:"#7A7A7A"}}),O?(0,a.jsx)("a",{href:f.uri,target:"_blank",rel:"noreferrer",className:i.fileName,children:F}):(0,a.jsx)("span",{className:i.fileName,title:f.uri,children:F})]},`${f.uri}-${R}`)})]},o))}):(0,a.jsx)("div",{className:i.feedMeta,children:"No files attached"}),!ae&&!_&&(0,a.jsx)("div",{className:i.feedMeta,children:"No conversation associated"})]}),at=(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:i.sectionTitle,children:["Activity (",Je,")"]}),(0,a.jsx)("div",{id:be,children:h?(0,a.jsx)("div",{className:i.spinner,"data-testid":"feed-loading",children:(0,a.jsx)(le,{size:"small"})}):g?(0,a.jsx)("div",{role:"alert",className:i.feedMeta,children:g}):W.length===0?(0,a.jsx)(se,{description:"No activity yet",image:se.PRESENTED_IMAGE_SIMPLE}):(0,a.jsx)("div",{className:i.feed,"data-testid":"activity-feed",children:Qe.map(o=>{let d=o.action==="activity"&&typeof o.detail?.markdown=="string",f=o.action==="completion_evidence",R=typeof o.detail?.result=="string"||Array.isArray(o.detail?.beliefImpact),F=d||f||R,O=o.threadId,st=O&&G?()=>G(O):void 0;return(0,a.jsxs)("div",{className:i.feedItem,"data-testid":o.action==="update_agent"?"feed-item-update_agent":"activity-item",style:o.action==="update_agent"?{borderLeft:"2px solid #6366f1",paddingLeft:8}:void 0,children:[(0,a.jsx)("span",{style:{flexShrink:0,marginTop:2},children:ut[o.action]||(0,a.jsx)(De,{size:14,style:{color:"#7A7A7A"}})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:i.feedSummary,children:f?"Completion evidence recorded":o.summary||o.action}),F&&(0,a.jsx)(me,{item:o,viewChat:st}),(0,a.jsxs)("div",{className:i.feedMeta,children:[(0,a.jsx)("span",{children:o.actor}),(0,a.jsx)("span",{title:he(o.createdAt),children:We(o.createdAt)}),o.attempt!==void 0&&o.attempt>1&&(0,a.jsxs)("span",{children:["Attempt #",o.attempt]}),O&&G&&!F&&(0,a.jsxs)("button",{type:"button",className:`${i.threadLink} ${i.quietButton}`,onClick:()=>G(O),children:[(0,a.jsx)(V,{size:12}),"View Chat"]})]})]})]},o.id)})})}),!h&&!g&&W.length>3&&(0,a.jsxs)("button",{type:"button",className:`${i.feedHeader} ${i.quietButton}`,onClick:()=>y(o=>!o),"aria-expanded":M,"aria-controls":be,children:[M?(0,a.jsx)(ce,{size:14}):null,M?"Show fewer activity items":`View all ${W.length} activity items`]})]}),it=s?(0,a.jsxs)("span",{className:i.statusBadge,style:{color:$.color},"data-testid":"status-pending",role:"status","aria-live":"polite","aria-label":`Updating task status; current status ${$.label}`,children:[(0,a.jsx)(le,{size:"small"}),"Updating \xB7 ",$.label]}):Y.length>0?(0,a.jsx)(we,{menu:{items:Y.map(({key:o,label:d,danger:f})=>({key:o,label:d,danger:f})),onClick:({key:o})=>Y.find(d=>d.key===o)?.onClick()},trigger:["click"],open:C,onOpenChange:xe,children:ke}):ke,nt=(0,a.jsxs)("span",{className:i.propValue,"data-testid":"priority-row",children:[(0,a.jsx)("span",{className:i.statusDot,style:{background:te.color}}),(0,a.jsx)("span",{style:{color:te.color,fontWeight:600},children:te.label})]}),ot=(0,a.jsxs)("div",{className:i.rail,"data-testid":"rail",children:[(0,a.jsxs)("div",{className:i.propRow,children:[(0,a.jsx)("span",{className:i.propLabel,children:"Created"}),(0,a.jsxs)("span",{className:i.propValue,children:[(0,a.jsx)(Ae,{size:13}),(0,a.jsx)("span",{title:he(e.createdAt),children:We(e.createdAt)})]})]}),e.dueDate&&(0,a.jsxs)("div",{className:i.propRow,children:[(0,a.jsx)("span",{className:i.propLabel,children:"Due"}),(0,a.jsx)("span",{className:i.propValue,children:he(e.dueDate)})]}),e.dependencies&&e.dependencies.length>0?[...new Set(e.dependencies)].map(o=>{let d=t.find(R=>R.id===o),f=d?K[d.status]?.label??d.status:void 0;return(0,a.jsxs)("div",{className:i.propRow,children:[(0,a.jsx)("span",{className:i.propLabel,children:"Dependency"}),d&&n?(0,a.jsxs)("button",{type:"button",className:`${i.propValue} ${i.quietButton} ${i.compactAction}`,"aria-label":`Dependency: ${d.title}, status ${f}`,onClick:()=>n(d),children:[d.title," \xB7 ",f]}):(0,a.jsx)("span",{className:i.propValue,children:d?`${d.title} \xB7 ${f}`:"Dependency unavailable"})]},o)}):(0,a.jsx)("div",{className:i.feedMeta,children:"No dependencies"})]}),rt=b&&b.length>0?(0,a.jsxs)("div",{"data-testid":"subtasks-section",children:[re&&(0,a.jsxs)("div",{className:i.sectionTitle,children:[re.done,"/",re.total," completed"]}),(0,a.jsx)("div",{id:ye,children:Ze?.map(o=>{let d=K[o.status]||K.pending,f=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:i.statusDot,style:{background:d.color}}),(0,a.jsx)("span",{className:i.subtaskTitle,children:o.title}),(0,a.jsx)("span",{className:i.subtaskStatus,style:{color:d.color},children:d.label})]});return u?(0,a.jsx)("button",{type:"button","data-testid":"subtask-row",className:`${i.subtaskRow} ${i.quietButton} ${i.actionRow}`,title:`${d.label} \xB7 ${o.title}`,"aria-label":`${o.title}, status ${d.label}`,onClick:()=>u(o),children:f},o.id):(0,a.jsx)("div",{"data-testid":"subtask-row",className:i.subtaskRow,title:`${d.label} \xB7 ${o.title}`,children:f},o.id)})}),b.length>5&&(0,a.jsx)("button",{type:"button",className:`${i.feedHeader} ${i.quietButton}`,onClick:()=>E(o=>!o),"aria-expanded":D,"aria-controls":ye,children:D?"Show fewer subtasks":`View all ${b.length} subtasks`})]}):x&&x.total>0?(0,a.jsxs)("div",{children:[x.done,"/",x.total," completed"]}):(0,a.jsx)("div",{className:i.feedMeta,children:"No subtasks"});return(0,a.jsx)(Me,{task:e,facts:qe,parent:p,canGoBack:I,onBack:P,onParentClick:A,headingRef:m,statusControl:it,priorityControl:nt,regions:{taskContent:et,context:ot,output:tt,subtasks:rt,activity:at},threadId:ae,onViewChat:G})};var Z=N(S()),xt=B(({css:e})=>({container:e`
|
|
457
|
+
display: flex;
|
|
458
|
+
flex-direction: column;
|
|
459
|
+
height: 100%;
|
|
460
|
+
overflow: hidden;
|
|
461
|
+
`,body:e`
|
|
462
|
+
flex: 1 1 auto;
|
|
463
|
+
min-height: 0;
|
|
464
|
+
overflow-y: auto;
|
|
465
|
+
padding: clamp(12px, 3cqi, 16px) clamp(16px, 4cqi, ${24}px);
|
|
466
|
+
`})),Jt=({task:e,relatedTasks:t,onRelatedTaskClick:n,workItems:m,loading:c,activityError:h,transitionPending:g=!1,onApprove:l,onReject:s,onRetry:x,onCancel:b,onViewChat:u,onBack:p,canGoBack:A=!0,maxHeight:I,focusKey:P,subtasks:i,onSubtaskClick:D,parent:E,onParentClick:M})=>{let{styles:y}=xt(),C=(0,ee.useRef)(null);return(0,ee.useEffect)(()=>{P!==void 0&&C.current?.focus()},[P]),(0,Z.jsx)("div",{className:y.container,"data-testid":"task-detail-panel",style:I===void 0?void 0:{maxHeight:I},children:(0,Z.jsx)("div",{className:y.body,children:(0,Z.jsx)(Oe,{task:e,relatedTasks:t,onRelatedTaskClick:n,headingRef:P===void 0?void 0:C,workItems:m,loading:c,activityError:h,transitionPending:g,actions:{onApprove:l,onReject:s,onRetry:x,onCancel:b,onViewChat:u},subtasks:i,onSubtaskClick:D,parent:E,onParentClick:M,canGoBack:A,onBack:p})})})};var Ve=N(X());function bt(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 ea=e=>{let{openSideApp:t}=Be();return(0,Ve.useCallback)(n=>{if(e)try{t(bt(e,n))}catch{console.warn("Cannot open task chat: ChatUIContextProvider is not mounted")}},[t,e])};export{fe as a,Ft as b,Jt as c,ea as d};
|