@agimon-ai/po-task 0.0.0-alpha.7 → 0.0.0-alpha.71

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.
Files changed (93) hide show
  1. package/LICENSE +149 -21
  2. package/README.md +12 -2
  3. package/dist/apiContracts.cjs +1 -0
  4. package/dist/apiContracts.cjs.map +1 -1
  5. package/dist/apiContracts.mjs +1 -0
  6. package/dist/apiContracts.mjs.map +1 -1
  7. package/dist/{delegation-Dsqf7fUM.mjs → delegation-5TOl_dEq.mjs} +4 -3
  8. package/dist/delegation-5TOl_dEq.mjs.map +1 -0
  9. package/dist/{delegation-frvEXhIz.cjs → delegation-BJtAUTVg.cjs} +4 -3
  10. package/dist/delegation-BJtAUTVg.cjs.map +1 -0
  11. package/dist/delegationManager.cjs +1 -1
  12. package/dist/delegationManager.d.mts +1 -1
  13. package/dist/delegationManager.mjs +1 -1
  14. package/dist/extensions/mcp.cjs +60 -61
  15. package/dist/extensions/mcp.cjs.map +1 -1
  16. package/dist/extensions/mcp.mjs +60 -61
  17. package/dist/extensions/mcp.mjs.map +1 -1
  18. package/dist/extensions/native.mjs +420 -315
  19. package/dist/extensions/native.mjs.map +1 -1
  20. package/dist/extensions/server.cjs +398 -136
  21. package/dist/extensions/server.cjs.map +1 -1
  22. package/dist/extensions/server.d.mts +2 -2
  23. package/dist/extensions/server.d.mts.map +1 -1
  24. package/dist/extensions/server.mjs +397 -135
  25. package/dist/extensions/server.mjs.map +1 -1
  26. package/dist/extensions/web.mjs +254 -206
  27. package/dist/extensions/web.mjs.map +1 -1
  28. package/dist/{index-DlmXKyhQ.d.mts → index-CdJx5tdI.d.mts} +2 -2
  29. package/dist/{index-DlmXKyhQ.d.mts.map → index-CdJx5tdI.d.mts.map} +1 -1
  30. package/dist/{index-B1JPJdpZ.d.mts → index-DrE00rrP.d.mts} +3 -3
  31. package/dist/{index-B1JPJdpZ.d.mts.map → index-DrE00rrP.d.mts.map} +1 -1
  32. package/dist/{index-qQGWsPum.d.mts → index-DuT-Lbxy.d.mts} +2 -3
  33. package/dist/index-DuT-Lbxy.d.mts.map +1 -0
  34. package/dist/{index-CUWCvh-E.d.mts → index-nx0ueNkm.d.mts} +2 -2
  35. package/dist/{index-CUWCvh-E.d.mts.map → index-nx0ueNkm.d.mts.map} +1 -1
  36. package/dist/{index-B9QNwUBr.d.mts → index-sahNy7Hg.d.mts} +3 -3
  37. package/dist/{index-B9QNwUBr.d.mts.map → index-sahNy7Hg.d.mts.map} +1 -1
  38. package/dist/{index-CA4Opp4r.d.mts → index-tAu1TIyi.d.mts} +4 -6
  39. package/dist/index-tAu1TIyi.d.mts.map +1 -0
  40. package/dist/index.cjs +3 -5
  41. package/dist/index.d.mts +10 -10
  42. package/dist/index.mjs +4 -4
  43. package/dist/{logSinkTelemetry-BhbKdn-x.mjs → logSinkTelemetry-3GMazFYa.mjs} +2 -2
  44. package/dist/logSinkTelemetry-3GMazFYa.mjs.map +1 -0
  45. package/dist/{logSinkTelemetry-BGb8WQBz.cjs → logSinkTelemetry-DhzIQMsV.cjs} +3 -3
  46. package/dist/logSinkTelemetry-DhzIQMsV.cjs.map +1 -0
  47. package/dist/logSinkTelemetry.cjs +1 -1
  48. package/dist/logSinkTelemetry.d.mts +1 -1
  49. package/dist/logSinkTelemetry.mjs +1 -1
  50. package/dist/{paths-P-XvOUuH.cjs → paths-CWVDY8Yd.cjs} +12 -78
  51. package/dist/paths-CWVDY8Yd.cjs.map +1 -0
  52. package/dist/{paths-DajceJig.mjs → paths-CjATVpi8.mjs} +12 -66
  53. package/dist/paths-CjATVpi8.mjs.map +1 -0
  54. package/dist/storeInvariants.d.mts +1 -1
  55. package/dist/storePaths.cjs +1 -3
  56. package/dist/storePaths.d.mts +2 -2
  57. package/dist/storePaths.mjs +1 -1
  58. package/dist/storeReconcile.d.mts +1 -1
  59. package/dist/storeReducer.d.mts +1 -1
  60. package/dist/storeTaskGraph.d.mts +1 -1
  61. package/dist/storeTaskStore.cjs +1 -1
  62. package/dist/storeTaskStore.d.mts +1 -1
  63. package/dist/storeTaskStore.mjs +1 -1
  64. package/dist/storeTypes.d.mts +1 -1
  65. package/dist/{task-4HeGAS8o.d.mts → task--hlnpS7L.d.mts} +2 -2
  66. package/dist/{task-4HeGAS8o.d.mts.map → task--hlnpS7L.d.mts.map} +1 -1
  67. package/dist/task-CXF9VULl.cjs.map +1 -1
  68. package/dist/{task-DJpTteeJ.d.mts → task-DdTKZNtU.d.mts} +3 -1
  69. package/dist/task-DdTKZNtU.d.mts.map +1 -0
  70. package/dist/task-giCbpKzV.mjs.map +1 -1
  71. package/dist/{taskGraph-D0zFHF2p.d.mts → taskGraph-CB8ffMCz.d.mts} +2 -2
  72. package/dist/{taskGraph-D0zFHF2p.d.mts.map → taskGraph-CB8ffMCz.d.mts.map} +1 -1
  73. package/dist/{taskStore-C4vcUOzA.cjs → taskStore-B-BbY2Ci.cjs} +30 -36
  74. package/dist/taskStore-B-BbY2Ci.cjs.map +1 -0
  75. package/dist/{taskStore-BAi54FKL.mjs → taskStore-wuXXFCZT.mjs} +29 -35
  76. package/dist/taskStore-wuXXFCZT.mjs.map +1 -0
  77. package/dist/toolResponseEnvelope.d.mts +1 -1
  78. package/dist/toolSchema.d.mts +1 -1
  79. package/llms.txt +11 -0
  80. package/package.json +18 -17
  81. package/src/prompts/codemode-how-to-task/SKILL.md +40 -0
  82. package/src/types/webTasks.ts +1 -0
  83. package/dist/delegation-Dsqf7fUM.mjs.map +0 -1
  84. package/dist/delegation-frvEXhIz.cjs.map +0 -1
  85. package/dist/index-CA4Opp4r.d.mts.map +0 -1
  86. package/dist/index-qQGWsPum.d.mts.map +0 -1
  87. package/dist/logSinkTelemetry-BGb8WQBz.cjs.map +0 -1
  88. package/dist/logSinkTelemetry-BhbKdn-x.mjs.map +0 -1
  89. package/dist/paths-DajceJig.mjs.map +0 -1
  90. package/dist/paths-P-XvOUuH.cjs.map +0 -1
  91. package/dist/task-DJpTteeJ.d.mts.map +0 -1
  92. package/dist/taskStore-BAi54FKL.mjs.map +0 -1
  93. package/dist/taskStore-C4vcUOzA.cjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { defineActivityGroup, defineChannelFile, defineFill, defineSessionStore, defineToolRenderer, defineWebPlugin } from "@agimon-ai/po-core/web";
2
- import { Button, ChevronDownIcon, ChevronRightIcon, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Dot, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, EditIcon, Input, KebabIcon, MessageIcon, MessageItem, MessageItemBody, MessageItemHeader, MessageItemStatus, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, TaskIcon, Textarea, TrashIcon, toolTone } from "@agimon-ai/po-web-components";
2
+ import { AgentAvatar, Badge, Button, ChevronDownIcon, ChevronRightIcon, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Dot, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, EditIcon, Input, KebabIcon, MessageIcon, MessageItem, MessageItemBody, MessageItemHeader, MessageItemStatus, Progress, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, TaskIcon, Textarea, TrashIcon, toolTone } from "@agimon-ai/po-web-components";
3
3
  import { useStore } from "@tanstack/react-store";
4
4
  import { useState } from "react";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -32,6 +32,7 @@ function parseTask(value) {
32
32
  if (isRecord$1(value.delegation)) {
33
33
  task.delegation = {};
34
34
  if (typeof value.delegation.agent === "string") task.delegation.agent = value.delegation.agent;
35
+ if (typeof value.delegation.identity === "string") task.delegation.identity = value.delegation.identity;
35
36
  if (typeof value.delegation.state === "string") task.delegation.state = value.delegation.state;
36
37
  }
37
38
  return task;
@@ -44,6 +45,11 @@ function parseTasksPayload(input) {
44
45
  rev: input.rev
45
46
  };
46
47
  }
48
+ /** Same first-name presentation as the Agents panel, without changing routing identity. */
49
+ function taskAgentName(delegation) {
50
+ const first = delegation?.identity?.split("-")[0];
51
+ return first ? first.charAt(0).toUpperCase() + first.slice(1) : delegation?.agent;
52
+ }
47
53
  function taskEditDraft(task) {
48
54
  return {
49
55
  subject: task.subject,
@@ -136,6 +142,15 @@ var tasks_web_default = defineActivityGroup({
136
142
  //#region src/extensions/workspaces/sessions/(frontend)/channel/task-graph.web.ts
137
143
  var task_graph_web_default = defineChannelFile(tasksChannel);
138
144
  //#endregion
145
+ //#region src/extensions/workspaces/sessions/(frontend)/fill/_lib/taskStatusTone.ts
146
+ const TASK_STATUS_TONE = {
147
+ pending: "muted",
148
+ in_progress: "green",
149
+ completed: "neutral",
150
+ failed: "red",
151
+ deleted: "muted"
152
+ };
153
+ //#endregion
139
154
  //#region src/extensions/workspaces/sessions/(frontend)/fill/_lib/TaskDetailDialog.tsx
140
155
  const STATUS_CHOICES = [
141
156
  "pending",
@@ -157,58 +172,56 @@ function Field({ label, children }) {
157
172
  children: [/* @__PURE__ */ jsx(FieldLabel, { children: label }), children]
158
173
  });
159
174
  }
160
- function ReadOnlyValue({ value, testId }) {
161
- return /* @__PURE__ */ jsx("span", {
175
+ /** One term and its value in the facts list. */
176
+ function Fact({ term, testId, children }) {
177
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
178
+ className: "text-base text-po-dim",
179
+ children: term
180
+ }), /* @__PURE__ */ jsx("dd", {
162
181
  "data-testid": testId,
163
- className: "whitespace-pre-wrap break-words text-base leading-relaxed text-po-dim",
164
- children: value
165
- });
182
+ className: "flex min-w-0 items-center gap-1.5 break-words text-base text-po-text",
183
+ children
184
+ })] });
166
185
  }
167
186
  function TaskFacts({ task }) {
168
- return /* @__PURE__ */ jsxs("div", {
169
- className: "flex flex-wrap gap-5",
187
+ const agent = taskAgentName(task.delegation);
188
+ return /* @__PURE__ */ jsxs("dl", {
189
+ className: "grid grid-cols-[auto_minmax(0,1fr)] gap-x-6 gap-y-2.5",
170
190
  children: [
171
- /* @__PURE__ */ jsx(Field, {
172
- label: "Status",
173
- children: /* @__PURE__ */ jsx(ReadOnlyValue, {
174
- testId: "task-detail-status",
175
- value: task.status.replace("_", " ")
176
- })
177
- }),
178
- task.activeForm ? /* @__PURE__ */ jsx(Field, {
179
- label: "Active form",
180
- children: /* @__PURE__ */ jsx(ReadOnlyValue, {
181
- testId: "task-detail-active-form",
182
- value: task.activeForm
183
- })
191
+ agent ? /* @__PURE__ */ jsxs(Fact, {
192
+ term: "Agent",
193
+ testId: "task-detail-agent",
194
+ children: [
195
+ /* @__PURE__ */ jsx(AgentAvatar, {
196
+ name: agent,
197
+ size: "sm"
198
+ }),
199
+ agent,
200
+ task.delegation?.state ? /* @__PURE__ */ jsx("span", {
201
+ className: "text-po-dim",
202
+ children: task.delegation.state
203
+ }) : null
204
+ ]
184
205
  }) : null,
185
- task.owner ? /* @__PURE__ */ jsx(Field, {
186
- label: "Owner",
187
- children: /* @__PURE__ */ jsx(ReadOnlyValue, {
188
- testId: "task-detail-owner",
189
- value: task.owner
190
- })
206
+ task.activeForm ? /* @__PURE__ */ jsx(Fact, {
207
+ term: "Doing now",
208
+ testId: "task-detail-active-form",
209
+ children: task.activeForm
191
210
  }) : null,
192
- task.delegation?.agent ? /* @__PURE__ */ jsx(Field, {
193
- label: "Delegated to",
194
- children: /* @__PURE__ */ jsx(ReadOnlyValue, {
195
- testId: "task-detail-agent",
196
- value: task.delegation.state ? `${task.delegation.agent} · ${task.delegation.state}` : task.delegation.agent
197
- })
211
+ task.blockedBy.length > 0 ? /* @__PURE__ */ jsx(Fact, {
212
+ term: "Waits for",
213
+ testId: "task-detail-blocked-by",
214
+ children: task.blockedBy.map((id) => `#${id}`).join(", ")
198
215
  }) : null,
199
- task.blockedBy.length > 0 ? /* @__PURE__ */ jsx(Field, {
200
- label: "Blocked by",
201
- children: /* @__PURE__ */ jsx(ReadOnlyValue, {
202
- testId: "task-detail-blocked-by",
203
- value: task.blockedBy.map((id) => `#${id}`).join(", ")
204
- })
216
+ task.owner ? /* @__PURE__ */ jsx(Fact, {
217
+ term: "Owner",
218
+ testId: "task-detail-owner",
219
+ children: task.owner
205
220
  }) : null,
206
- task.updatedAt ? /* @__PURE__ */ jsx(Field, {
207
- label: "Updated",
208
- children: /* @__PURE__ */ jsx(ReadOnlyValue, {
209
- testId: "task-detail-updated",
210
- value: task.updatedAt
211
- })
221
+ task.updatedAt ? /* @__PURE__ */ jsx(Fact, {
222
+ term: "Updated",
223
+ testId: "task-detail-updated",
224
+ children: task.updatedAt
212
225
  }) : null
213
226
  ]
214
227
  });
@@ -222,6 +235,7 @@ function TaskDetailDialog({ task, sessionId, mode: initialMode, send, onClose })
222
235
  const [draft, setDraft] = useState(() => taskEditDraft(task));
223
236
  const [message, setMessage] = useState("");
224
237
  const agent = task.delegation?.agent;
238
+ const agentName = taskAgentName(task.delegation);
225
239
  const submitEdit = () => {
226
240
  if (requestTaskEdit(send, sessionId, task, draft)) onClose();
227
241
  };
@@ -242,22 +256,31 @@ function TaskDetailDialog({ task, sessionId, mode: initialMode, send, onClose })
242
256
  "aria-describedby": void 0,
243
257
  children: [/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsxs("div", {
244
258
  className: "flex min-w-0 flex-col items-start gap-1 sm:flex-row sm:items-center sm:gap-2.5",
245
- children: [/* @__PURE__ */ jsxs("span", {
246
- className: "text-sm text-po-dim",
247
- children: ["task #", task.id]
248
- }), /* @__PURE__ */ jsx(DialogTitle, {
249
- "data-testid": "task-detail-title",
250
- className: "max-w-full break-words",
251
- children: task.subject
252
- })]
259
+ children: [
260
+ /* @__PURE__ */ jsxs("span", {
261
+ className: "font-mono text-sm text-po-faint",
262
+ children: ["#", task.id]
263
+ }),
264
+ /* @__PURE__ */ jsx(DialogTitle, {
265
+ "data-testid": "task-detail-title",
266
+ className: "max-w-full break-words",
267
+ children: task.subject
268
+ }),
269
+ /* @__PURE__ */ jsxs(Badge, {
270
+ "data-testid": "task-detail-status",
271
+ className: "shrink-0 items-center gap-1.5",
272
+ children: [/* @__PURE__ */ jsx(Dot, {
273
+ tone: TASK_STATUS_TONE[task.status],
274
+ pulse: task.status === "in_progress"
275
+ }), task.status.replace("_", " ")]
276
+ })
277
+ ]
253
278
  }) }), /* @__PURE__ */ jsxs(DialogBody, { children: [
254
279
  mode === "view" ? /* @__PURE__ */ jsxs(Fragment, { children: [
255
- /* @__PURE__ */ jsx(Field, {
256
- label: "Description",
257
- children: /* @__PURE__ */ jsx(ReadOnlyValue, {
258
- testId: "task-detail-description",
259
- value: task.description ?? "no description on this task"
260
- })
280
+ /* @__PURE__ */ jsx("p", {
281
+ "data-testid": "task-detail-description",
282
+ className: `whitespace-pre-wrap break-words text-base leading-relaxed ${task.description ? "text-po-text" : "text-po-dim"}`,
283
+ children: task.description ?? "No description on this task."
261
284
  }),
262
285
  /* @__PURE__ */ jsx(TaskFacts, { task }),
263
286
  /* @__PURE__ */ jsxs(DialogFooter, { children: [
@@ -267,14 +290,14 @@ function TaskDetailDialog({ task, sessionId, mode: initialMode, send, onClose })
267
290
  size: "xs",
268
291
  "data-testid": "task-detail-open-message",
269
292
  onClick: () => setMode("message"),
270
- children: "message agent"
293
+ children: "Message agent"
271
294
  }) : null,
272
295
  /* @__PURE__ */ jsx(Button, {
273
296
  variant: "primary",
274
297
  size: "xs",
275
298
  "data-testid": "task-detail-open-edit",
276
299
  onClick: () => setMode("edit"),
277
- children: "edit"
300
+ children: "Edit"
278
301
  })
279
302
  ] })
280
303
  ] }) : null,
@@ -297,7 +320,7 @@ function TaskDetailDialog({ task, sessionId, mode: initialMode, send, onClose })
297
320
  "data-testid": "task-detail-description-input",
298
321
  rows: DESCRIPTION_ROWS,
299
322
  value: draft.description,
300
- placeholder: "what this task covers",
323
+ placeholder: "What this task covers",
301
324
  onChange: (event) => setDraft({
302
325
  ...draft,
303
326
  description: event.target.value
@@ -327,7 +350,7 @@ function TaskDetailDialog({ task, sessionId, mode: initialMode, send, onClose })
327
350
  children: [
328
351
  /* @__PURE__ */ jsx("span", {
329
352
  className: "w-full text-sm text-po-dim sm:w-auto",
330
- children: "saved as one prompt naming only the fields you changed"
353
+ children: "Saved as one prompt naming only the fields you changed"
331
354
  }),
332
355
  /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1" }),
333
356
  /* @__PURE__ */ jsx(Button, {
@@ -335,26 +358,26 @@ function TaskDetailDialog({ task, sessionId, mode: initialMode, send, onClose })
335
358
  size: "xs",
336
359
  "data-testid": "task-detail-cancel",
337
360
  onClick: onClose,
338
- children: "cancel"
361
+ children: "Cancel"
339
362
  }),
340
363
  /* @__PURE__ */ jsx(Button, {
341
364
  variant: "primary",
342
365
  size: "xs",
343
366
  "data-testid": "task-detail-save",
344
367
  onClick: submitEdit,
345
- children: "save"
368
+ children: "Save"
346
369
  })
347
370
  ]
348
371
  })
349
372
  ] }) : null,
350
373
  mode === "message" && agent ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Field, {
351
- label: `Message to ${agent}`,
374
+ label: `Message to ${agentName}`,
352
375
  children: /* @__PURE__ */ jsx(Textarea, {
353
376
  "data-testid": "task-detail-message-input",
354
377
  autoFocus: true,
355
378
  rows: MESSAGE_ROWS,
356
379
  value: message,
357
- placeholder: "guidance for the run working on this task",
380
+ placeholder: "Guidance for the run working on this task",
358
381
  onChange: (event) => setMessage(event.target.value)
359
382
  })
360
383
  }), /* @__PURE__ */ jsxs(DialogFooter, {
@@ -362,7 +385,7 @@ function TaskDetailDialog({ task, sessionId, mode: initialMode, send, onClose })
362
385
  children: [
363
386
  /* @__PURE__ */ jsx("span", {
364
387
  className: "w-full text-sm text-po-dim sm:w-auto",
365
- children: "steers the run, it does not edit the task"
388
+ children: "Steers the run, it does not edit the task"
366
389
  }),
367
390
  /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1" }),
368
391
  /* @__PURE__ */ jsx(Button, {
@@ -370,14 +393,14 @@ function TaskDetailDialog({ task, sessionId, mode: initialMode, send, onClose })
370
393
  size: "xs",
371
394
  "data-testid": "task-detail-cancel",
372
395
  onClick: onClose,
373
- children: "cancel"
396
+ children: "Cancel"
374
397
  }),
375
398
  /* @__PURE__ */ jsx(Button, {
376
399
  variant: "primary",
377
400
  size: "xs",
378
401
  "data-testid": "task-detail-send",
379
402
  onClick: submitMessage,
380
- children: "send"
403
+ children: "Send"
381
404
  })
382
405
  ]
383
406
  })] }) : null
@@ -387,87 +410,91 @@ function TaskDetailDialog({ task, sessionId, mode: initialMode, send, onClose })
387
410
  }
388
411
  //#endregion
389
412
  //#region src/extensions/workspaces/sessions/(frontend)/fill/_lib/TasksActivitySection.tsx
390
- const STATUS_TONE$1 = {
391
- pending: "muted",
392
- in_progress: "yellow",
393
- completed: "green",
394
- failed: "red",
395
- deleted: "muted"
396
- };
413
+ const STATUS_TONE = TASK_STATUS_TONE;
397
414
  function TaskRow({ task, sessionId, sendSessionFrame, openDialog }) {
398
- const detail = task.status === "in_progress" ? task.activeForm : task.description;
399
- const agent = task.delegation?.agent;
415
+ const doing = task.status === "in_progress" ? task.activeForm : void 0;
416
+ const agent = taskAgentName(task.delegation);
417
+ const waits = task.blockedBy.length > 0 ? `Waits for ${task.blockedBy.map((id) => `#${id}`).join(", ")}` : "";
418
+ const finished = task.status === "completed" || task.status === "failed";
400
419
  return /* @__PURE__ */ jsxs("div", {
401
420
  "data-testid": `activity-task-${task.id}`,
402
421
  "data-task-status": task.status,
403
- className: "flex flex-col gap-1 rounded-md px-1 py-1",
404
- children: [/* @__PURE__ */ jsxs("div", {
405
- className: "grid min-w-0 grid-cols-[auto_minmax(0,1fr)_auto_auto] items-center gap-x-1.5",
406
- children: [
407
- /* @__PURE__ */ jsx(Dot, {
408
- tone: STATUS_TONE$1[task.status],
409
- pulse: task.status === "in_progress"
410
- }),
411
- /* @__PURE__ */ jsxs("button", {
422
+ className: "group flex items-start gap-2 rounded-md px-1 py-1.5 hover:bg-po-panel",
423
+ children: [
424
+ /* @__PURE__ */ jsx(Dot, {
425
+ className: "mt-2",
426
+ tone: STATUS_TONE[task.status],
427
+ pulse: task.status === "in_progress"
428
+ }),
429
+ /* @__PURE__ */ jsxs("div", {
430
+ className: "flex min-w-0 flex-1 flex-col gap-1",
431
+ children: [/* @__PURE__ */ jsxs("button", {
412
432
  type: "button",
413
433
  "data-testid": `activity-task-title-${task.id}`,
414
- title: task.subject,
415
434
  onClick: () => openDialog("view"),
416
- className: `min-h-6 min-w-0 truncate text-left text-base font-semibold hover:underline ${task.status === "failed" ? "text-po-red" : task.status === "completed" ? "text-po-dim" : "text-po-hi"}`,
435
+ className: `min-h-6 text-left text-base font-medium break-words hover:underline ${finished ? "text-po-dim" : "text-po-hi"}`,
417
436
  children: [
418
437
  /* @__PURE__ */ jsxs("span", {
419
- className: "text-po-dim",
438
+ className: "font-mono text-sm text-po-faint",
420
439
  children: ["#", task.id]
421
440
  }),
422
441
  " ",
423
442
  task.subject
424
443
  ]
425
- }),
426
- /* @__PURE__ */ jsx("span", {
427
- className: "shrink-0 text-sm text-po-dim",
428
- children: task.status.replace("_", " ")
429
- }),
430
- task.status !== "completed" && task.status !== "deleted" ? /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
431
- asChild: true,
432
- children: /* @__PURE__ */ jsx(Button, {
433
- variant: "ghost",
434
- size: "icon",
435
- "data-testid": `activity-task-menu-${task.id}`,
436
- "aria-label": `task #${task.id} actions`,
437
- title: `task #${task.id} actions`,
438
- className: "self-center shrink-0 text-po-faint hover:bg-po-deep hover:text-po-hi data-[state=open]:bg-po-deep data-[state=open]:text-po-hi",
439
- children: /* @__PURE__ */ jsx(KebabIcon, { className: "h-3 w-3" })
440
- })
441
- }), /* @__PURE__ */ jsxs(DropdownMenuContent, {
442
- "data-testid": `activity-task-menu-list-${task.id}`,
444
+ }), agent || doing || waits ? /* @__PURE__ */ jsxs("span", {
445
+ className: "flex min-w-0 items-center gap-1.5 text-sm text-po-dim",
443
446
  children: [
444
- /* @__PURE__ */ jsxs(DropdownMenuItem, {
445
- "data-testid": `activity-task-edit-${task.id}`,
446
- onSelect: () => openDialog("edit"),
447
- children: [/* @__PURE__ */ jsx(EditIcon, { className: "h-3 w-3" }), "Edit"]
448
- }),
449
- agent ? /* @__PURE__ */ jsxs(DropdownMenuItem, {
450
- "data-testid": `activity-task-message-${task.id}`,
451
- onSelect: () => openDialog("message"),
452
- children: [/* @__PURE__ */ jsx(MessageIcon, { className: "h-3 w-3" }), "Message agent"]
447
+ agent ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(AgentAvatar, {
448
+ name: agent,
449
+ size: "sm"
450
+ }), /* @__PURE__ */ jsx("span", {
451
+ className: "shrink-0 text-po-text",
452
+ children: agent
453
+ })] }) : null,
454
+ doing ? /* @__PURE__ */ jsx("span", {
455
+ className: "truncate",
456
+ children: doing
453
457
  }) : null,
454
- /* @__PURE__ */ jsxs(DropdownMenuItem, {
455
- variant: "destructive",
456
- "data-testid": `activity-task-remove-${task.id}`,
457
- onSelect: () => requestTaskRemoval(sendSessionFrame, sessionId, task.id),
458
- children: [/* @__PURE__ */ jsx(TrashIcon, { className: "h-3 w-3" }), "Remove"]
459
- })
458
+ waits ? /* @__PURE__ */ jsx("span", {
459
+ className: "truncate",
460
+ children: waits
461
+ }) : null
460
462
  ]
461
- })] }) : null
462
- ]
463
- }), detail || agent || task.blockedBy.length > 0 ? /* @__PURE__ */ jsxs("span", {
464
- className: "truncate pl-3 text-sm text-po-dim",
465
- children: [
466
- agent ? `[${agent}] ` : "",
467
- detail ?? "",
468
- task.blockedBy.length > 0 ? ` · blocked by ${task.blockedBy.map((id) => `#${id}`).join(", ")}` : ""
469
- ]
470
- }) : null]
463
+ }) : null]
464
+ }),
465
+ task.status !== "completed" && task.status !== "deleted" ? /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
466
+ asChild: true,
467
+ children: /* @__PURE__ */ jsx(Button, {
468
+ variant: "ghost",
469
+ size: "icon",
470
+ "data-testid": `activity-task-menu-${task.id}`,
471
+ "aria-label": `task #${task.id} actions`,
472
+ title: `task #${task.id} actions`,
473
+ className: "shrink-0 text-po-faint opacity-0 group-hover:opacity-100 focus-visible:opacity-100 hover:bg-po-deep hover:text-po-hi data-[state=open]:bg-po-deep data-[state=open]:text-po-hi data-[state=open]:opacity-100 [@media(hover:none)]:opacity-100",
474
+ children: /* @__PURE__ */ jsx(KebabIcon, { className: "h-3 w-3" })
475
+ })
476
+ }), /* @__PURE__ */ jsxs(DropdownMenuContent, {
477
+ "data-testid": `activity-task-menu-list-${task.id}`,
478
+ children: [
479
+ /* @__PURE__ */ jsxs(DropdownMenuItem, {
480
+ "data-testid": `activity-task-edit-${task.id}`,
481
+ onSelect: () => openDialog("edit"),
482
+ children: [/* @__PURE__ */ jsx(EditIcon, { className: "h-3 w-3" }), "Edit"]
483
+ }),
484
+ agent ? /* @__PURE__ */ jsxs(DropdownMenuItem, {
485
+ "data-testid": `activity-task-message-${task.id}`,
486
+ onSelect: () => openDialog("message"),
487
+ children: [/* @__PURE__ */ jsx(MessageIcon, { className: "h-3 w-3" }), "Message agent"]
488
+ }) : null,
489
+ /* @__PURE__ */ jsxs(DropdownMenuItem, {
490
+ variant: "destructive",
491
+ "data-testid": `activity-task-remove-${task.id}`,
492
+ onSelect: () => requestTaskRemoval(sendSessionFrame, sessionId, task.id),
493
+ children: [/* @__PURE__ */ jsx(TrashIcon, { className: "h-3 w-3" }), "Remove"]
494
+ })
495
+ ]
496
+ })] }) : null
497
+ ]
471
498
  });
472
499
  }
473
500
  /**
@@ -475,7 +502,8 @@ function TaskRow({ task, sessionId, sendSessionFrame, openDialog }) {
475
502
  *
476
503
  * This fills the `tasks` activity group, so the dock has already drawn the
477
504
  * heading, the key chip and the section frame. Rendering rows only keeps the
478
- * group titled once.
505
+ * group titled once. Finished and failed work folds away by default so the
506
+ * dock shows what is still moving.
479
507
  */
480
508
  function TasksActivitySection({ sessionId, sendSessionFrame }) {
481
509
  const sessionTasks = useStore(tasks.store, (state) => tasks.select(state, sessionId).tasks);
@@ -484,52 +512,70 @@ function TasksActivitySection({ sessionId, sendSessionFrame }) {
484
512
  if (sessionId === null || sessionTasks.length === 0) return null;
485
513
  const active = sessionTasks.filter((task) => task.status === "pending" || task.status === "in_progress");
486
514
  const history = sessionTasks.filter((task) => task.status === "completed" || task.status === "failed");
515
+ const done = history.length - history.filter((task) => task.status === "failed").length;
516
+ const failed = history.length - done;
517
+ const total = active.length + history.length;
487
518
  const dialogTask = dialog ? sessionTasks.find((task) => task.id === dialog.taskId) : void 0;
519
+ const row = (task) => /* @__PURE__ */ jsx(TaskRow, {
520
+ task,
521
+ sessionId,
522
+ sendSessionFrame,
523
+ openDialog: (mode) => setDialog({
524
+ taskId: task.id,
525
+ mode
526
+ })
527
+ }, task.id);
488
528
  return /* @__PURE__ */ jsxs("div", {
489
529
  className: "flex flex-col gap-2",
490
530
  children: [
531
+ total > 0 ? /* @__PURE__ */ jsxs("div", {
532
+ "data-testid": "activity-task-progress",
533
+ className: "flex flex-col gap-1.5 px-1",
534
+ children: [/* @__PURE__ */ jsxs("span", {
535
+ className: "text-sm text-po-dim",
536
+ children: [
537
+ done,
538
+ " of ",
539
+ total,
540
+ " done"
541
+ ]
542
+ }), /* @__PURE__ */ jsx(Progress, {
543
+ value: done / total * 100,
544
+ "aria-label": `${done} of ${total} tasks done`,
545
+ className: "[&>[data-slot=progress-indicator]]:bg-po-green"
546
+ })]
547
+ }) : null,
491
548
  active.length > 0 ? /* @__PURE__ */ jsx("div", {
492
- className: "flex flex-col gap-0.5",
493
- children: active.map((task) => /* @__PURE__ */ jsx(TaskRow, {
494
- task,
495
- sessionId,
496
- sendSessionFrame,
497
- openDialog: (mode) => setDialog({
498
- taskId: task.id,
499
- mode
500
- })
501
- }, task.id))
549
+ className: "flex flex-col",
550
+ children: active.map(row)
502
551
  }) : null,
503
552
  history.length > 0 ? /* @__PURE__ */ jsxs("div", {
504
- className: "flex flex-col gap-0.5",
553
+ className: "flex flex-col",
505
554
  children: [/* @__PURE__ */ jsxs(Button, {
506
555
  variant: "ghost",
507
556
  size: "xs",
557
+ "data-testid": "activity-task-history-toggle",
508
558
  "aria-expanded": historyOpen,
509
559
  onClick: () => setHistoryOpen((open) => !open),
510
560
  className: "justify-start gap-1.5 rounded-md px-1 py-0.5 hover:bg-po-panel",
511
561
  children: [
512
562
  historyOpen ? /* @__PURE__ */ jsx(ChevronDownIcon, { className: "h-2.5 w-2.5 text-po-faint" }) : /* @__PURE__ */ jsx(ChevronRightIcon, { className: "h-2.5 w-2.5 text-po-faint" }),
513
563
  /* @__PURE__ */ jsx("span", {
514
- className: "text-base font-medium text-po-dim",
515
- children: "session"
564
+ className: "text-sm font-medium text-po-dim",
565
+ children: "Finished"
516
566
  }),
517
567
  /* @__PURE__ */ jsx("span", {
518
- className: "text-2xs text-po-faint",
568
+ className: "text-sm text-po-faint",
519
569
  children: history.length
520
- })
570
+ }),
571
+ failed > 0 ? /* @__PURE__ */ jsxs("span", {
572
+ className: "text-sm text-po-red",
573
+ children: [failed, " failed"]
574
+ }) : null
521
575
  ]
522
576
  }), historyOpen ? /* @__PURE__ */ jsx("div", {
523
- className: "flex flex-col gap-0.5 pl-2",
524
- children: history.map((task) => /* @__PURE__ */ jsx(TaskRow, {
525
- task,
526
- sessionId,
527
- sendSessionFrame,
528
- openDialog: (mode) => setDialog({
529
- taskId: task.id,
530
- mode
531
- })
532
- }, task.id))
577
+ className: "flex flex-col",
578
+ children: history.map(row)
533
579
  }) : null]
534
580
  }) : null,
535
581
  dialog && dialogTask ? /* @__PURE__ */ jsx(TaskDetailDialog, {
@@ -547,6 +593,12 @@ function TasksActivitySection({ sessionId, sendSessionFrame }) {
547
593
  var Tasks_activity_tasks_web_default = defineFill({ component: TasksActivitySection });
548
594
  //#endregion
549
595
  //#region src/extensions/workspaces/sessions/(frontend)/tool/_lib/taskToolFormat.ts
596
+ /**
597
+ * Pure view logic for the task tool card, the browser counterpart of
598
+ * the session frontend's shared format helpers (renderTaskCall, renderTaskResult). The plugin may reach
599
+ * only its own files and src/types, so the store shapes it reads are
600
+ * restated here as the wire JSON of a tool_execution frame.
601
+ */
550
602
  const STATUS_GLYPH = {
551
603
  pending: "○",
552
604
  in_progress: "◐",
@@ -618,6 +670,7 @@ function taskView(value) {
618
670
  if (isRecord(value.delegation)) {
619
671
  task.delegation = {};
620
672
  if (typeof value.delegation.agent === "string") task.delegation.agent = value.delegation.agent;
673
+ if (typeof value.delegation.identity === "string") task.delegation.identity = value.delegation.identity;
621
674
  if (typeof value.delegation.state === "string") task.delegation.state = value.delegation.state;
622
675
  }
623
676
  return task;
@@ -708,7 +761,8 @@ function taskRow(task) {
708
761
  closed: task.status === "completed" || task.status === "deleted",
709
762
  blockedBy: task.blockedBy ?? []
710
763
  };
711
- if (task.delegation?.agent) row.agent = inlineText(task.delegation.agent);
764
+ const agent = taskAgentName(task.delegation);
765
+ if (agent) row.agent = inlineText(agent);
712
766
  if (task.status === "in_progress" && task.activeForm) row.activeForm = inlineText(task.activeForm);
713
767
  return row;
714
768
  }
@@ -839,12 +893,13 @@ function taskResultView(input) {
839
893
  }
840
894
  //#endregion
841
895
  //#region src/extensions/workspaces/sessions/(frontend)/tool/_lib/TaskToolMessage.tsx
842
- const STATUS_TONE = {
843
- pending: "text-po-dim",
844
- in_progress: "text-po-yellow",
845
- completed: "text-po-green",
896
+ /** One colour per row, on the glyph only: jade while Po works on it, red only for a real failure. */
897
+ const GLYPH_TONE = {
898
+ pending: "text-po-faint",
899
+ in_progress: "text-po-green",
900
+ completed: "text-po-faint",
846
901
  failed: "text-po-red",
847
- deleted: "text-po-dim"
902
+ deleted: "text-po-faint"
848
903
  };
849
904
  const RESULT_TONE = {
850
905
  running: "running",
@@ -852,52 +907,45 @@ const RESULT_TONE = {
852
907
  error: "error",
853
908
  warning: "running"
854
909
  };
855
- /** One task row: status glyph, id, subject and chips on the left, the status label flushed right. */
910
+ /** One task row: status glyph, id and subject, with who is on it and what it waits for on a quiet line below. */
856
911
  function TaskRowLine({ row }) {
912
+ const waits = row.blockedBy.length > 0 ? `waits for ${row.blockedBy.map((id) => `#${id}`).join(", ")}` : "";
913
+ const meta = [
914
+ row.agent,
915
+ row.activeForm,
916
+ waits
917
+ ].filter(Boolean).join(" · ");
857
918
  return /* @__PURE__ */ jsxs("li", {
858
919
  "data-testid": "tool-result-task-row",
859
920
  "data-task-id": row.id,
860
921
  className: "flex items-baseline gap-2",
861
- children: [
862
- /* @__PURE__ */ jsx("span", {
863
- className: `shrink-0 ${STATUS_TONE[row.status]}`,
864
- children: row.glyph
865
- }),
866
- /* @__PURE__ */ jsxs("span", {
867
- className: "shrink-0 text-po-dim",
868
- children: ["#", row.id]
869
- }),
870
- /* @__PURE__ */ jsxs("span", {
871
- className: `min-w-0 flex-1 truncate text-base font-semibold ${row.closed ? "text-po-dim line-through" : row.status === "in_progress" ? "text-po-blue" : "text-po-hi"}`,
922
+ children: [/* @__PURE__ */ jsx("span", {
923
+ "aria-hidden": true,
924
+ className: `w-3 shrink-0 text-center ${GLYPH_TONE[row.status]}`,
925
+ children: row.glyph
926
+ }), /* @__PURE__ */ jsxs("span", {
927
+ className: "flex min-w-0 flex-1 flex-col",
928
+ children: [/* @__PURE__ */ jsxs("span", {
929
+ className: "flex min-w-0 items-baseline gap-1.5",
872
930
  children: [
873
- row.subject,
874
- row.agent ? /* @__PURE__ */ jsxs("span", {
875
- className: "text-po-dim",
876
- children: [
877
- " [",
878
- row.agent,
879
- "]"
880
- ]
881
- }) : null,
882
- row.activeForm ? /* @__PURE__ */ jsxs("span", {
883
- className: "text-po-dim",
884
- children: [
885
- " (",
886
- row.activeForm,
887
- ")"
888
- ]
889
- }) : null,
890
- row.blockedBy.length > 0 ? /* @__PURE__ */ jsxs("span", {
891
- className: "text-po-dim",
892
- children: [" ⛓ ", row.blockedBy.map((id) => `#${id}`).join(",")]
893
- }) : null
931
+ /* @__PURE__ */ jsxs("span", {
932
+ className: "shrink-0 font-mono text-sm text-po-faint",
933
+ children: ["#", row.id]
934
+ }),
935
+ /* @__PURE__ */ jsx("span", {
936
+ className: `min-w-0 truncate text-base font-medium ${row.closed ? "text-po-dim" : "text-po-hi"}`,
937
+ children: row.subject
938
+ }),
939
+ /* @__PURE__ */ jsx("span", {
940
+ className: "sr-only",
941
+ children: STATUS_LABEL[row.status]
942
+ })
894
943
  ]
895
- }),
896
- /* @__PURE__ */ jsx("span", {
897
- className: `shrink-0 ${STATUS_TONE[row.status]}`,
898
- children: STATUS_LABEL[row.status]
899
- })
900
- ]
944
+ }), meta ? /* @__PURE__ */ jsx("span", {
945
+ className: "truncate text-sm text-po-dim",
946
+ children: meta
947
+ }) : null]
948
+ })]
901
949
  });
902
950
  }
903
951
  /**
@@ -947,7 +995,7 @@ function TaskToolMessage({ args, result, output, running, isError }) {
947
995
  ]
948
996
  }),
949
997
  call.subject ? /* @__PURE__ */ jsx("span", {
950
- className: `min-w-0 truncate text-base font-semibold ${call.subjectTone === "accent" ? "text-po-blue" : "text-po-hi"}`,
998
+ className: `min-w-0 truncate text-base font-semibold ${call.subjectTone === "accent" ? "text-po-green" : "text-po-hi"}`,
951
999
  children: call.subject
952
1000
  }) : null,
953
1001
  call.detail ? /* @__PURE__ */ jsx("span", {