@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.
- package/LICENSE +149 -21
- package/README.md +12 -2
- package/dist/apiContracts.cjs +1 -0
- package/dist/apiContracts.cjs.map +1 -1
- package/dist/apiContracts.mjs +1 -0
- package/dist/apiContracts.mjs.map +1 -1
- package/dist/{delegation-Dsqf7fUM.mjs → delegation-5TOl_dEq.mjs} +4 -3
- package/dist/delegation-5TOl_dEq.mjs.map +1 -0
- package/dist/{delegation-frvEXhIz.cjs → delegation-BJtAUTVg.cjs} +4 -3
- package/dist/delegation-BJtAUTVg.cjs.map +1 -0
- package/dist/delegationManager.cjs +1 -1
- package/dist/delegationManager.d.mts +1 -1
- package/dist/delegationManager.mjs +1 -1
- package/dist/extensions/mcp.cjs +60 -61
- package/dist/extensions/mcp.cjs.map +1 -1
- package/dist/extensions/mcp.mjs +60 -61
- package/dist/extensions/mcp.mjs.map +1 -1
- package/dist/extensions/native.mjs +420 -315
- package/dist/extensions/native.mjs.map +1 -1
- package/dist/extensions/server.cjs +398 -136
- package/dist/extensions/server.cjs.map +1 -1
- package/dist/extensions/server.d.mts +2 -2
- package/dist/extensions/server.d.mts.map +1 -1
- package/dist/extensions/server.mjs +397 -135
- package/dist/extensions/server.mjs.map +1 -1
- package/dist/extensions/web.mjs +254 -206
- package/dist/extensions/web.mjs.map +1 -1
- package/dist/{index-DlmXKyhQ.d.mts → index-CdJx5tdI.d.mts} +2 -2
- package/dist/{index-DlmXKyhQ.d.mts.map → index-CdJx5tdI.d.mts.map} +1 -1
- package/dist/{index-B1JPJdpZ.d.mts → index-DrE00rrP.d.mts} +3 -3
- package/dist/{index-B1JPJdpZ.d.mts.map → index-DrE00rrP.d.mts.map} +1 -1
- package/dist/{index-qQGWsPum.d.mts → index-DuT-Lbxy.d.mts} +2 -3
- package/dist/index-DuT-Lbxy.d.mts.map +1 -0
- package/dist/{index-CUWCvh-E.d.mts → index-nx0ueNkm.d.mts} +2 -2
- package/dist/{index-CUWCvh-E.d.mts.map → index-nx0ueNkm.d.mts.map} +1 -1
- package/dist/{index-B9QNwUBr.d.mts → index-sahNy7Hg.d.mts} +3 -3
- package/dist/{index-B9QNwUBr.d.mts.map → index-sahNy7Hg.d.mts.map} +1 -1
- package/dist/{index-CA4Opp4r.d.mts → index-tAu1TIyi.d.mts} +4 -6
- package/dist/index-tAu1TIyi.d.mts.map +1 -0
- package/dist/index.cjs +3 -5
- package/dist/index.d.mts +10 -10
- package/dist/index.mjs +4 -4
- package/dist/{logSinkTelemetry-BhbKdn-x.mjs → logSinkTelemetry-3GMazFYa.mjs} +2 -2
- package/dist/logSinkTelemetry-3GMazFYa.mjs.map +1 -0
- package/dist/{logSinkTelemetry-BGb8WQBz.cjs → logSinkTelemetry-DhzIQMsV.cjs} +3 -3
- package/dist/logSinkTelemetry-DhzIQMsV.cjs.map +1 -0
- package/dist/logSinkTelemetry.cjs +1 -1
- package/dist/logSinkTelemetry.d.mts +1 -1
- package/dist/logSinkTelemetry.mjs +1 -1
- package/dist/{paths-P-XvOUuH.cjs → paths-CWVDY8Yd.cjs} +12 -78
- package/dist/paths-CWVDY8Yd.cjs.map +1 -0
- package/dist/{paths-DajceJig.mjs → paths-CjATVpi8.mjs} +12 -66
- package/dist/paths-CjATVpi8.mjs.map +1 -0
- package/dist/storeInvariants.d.mts +1 -1
- package/dist/storePaths.cjs +1 -3
- package/dist/storePaths.d.mts +2 -2
- package/dist/storePaths.mjs +1 -1
- package/dist/storeReconcile.d.mts +1 -1
- package/dist/storeReducer.d.mts +1 -1
- package/dist/storeTaskGraph.d.mts +1 -1
- package/dist/storeTaskStore.cjs +1 -1
- package/dist/storeTaskStore.d.mts +1 -1
- package/dist/storeTaskStore.mjs +1 -1
- package/dist/storeTypes.d.mts +1 -1
- package/dist/{task-4HeGAS8o.d.mts → task--hlnpS7L.d.mts} +2 -2
- package/dist/{task-4HeGAS8o.d.mts.map → task--hlnpS7L.d.mts.map} +1 -1
- package/dist/task-CXF9VULl.cjs.map +1 -1
- package/dist/{task-DJpTteeJ.d.mts → task-DdTKZNtU.d.mts} +3 -1
- package/dist/task-DdTKZNtU.d.mts.map +1 -0
- package/dist/task-giCbpKzV.mjs.map +1 -1
- package/dist/{taskGraph-D0zFHF2p.d.mts → taskGraph-CB8ffMCz.d.mts} +2 -2
- package/dist/{taskGraph-D0zFHF2p.d.mts.map → taskGraph-CB8ffMCz.d.mts.map} +1 -1
- package/dist/{taskStore-C4vcUOzA.cjs → taskStore-B-BbY2Ci.cjs} +30 -36
- package/dist/taskStore-B-BbY2Ci.cjs.map +1 -0
- package/dist/{taskStore-BAi54FKL.mjs → taskStore-wuXXFCZT.mjs} +29 -35
- package/dist/taskStore-wuXXFCZT.mjs.map +1 -0
- package/dist/toolResponseEnvelope.d.mts +1 -1
- package/dist/toolSchema.d.mts +1 -1
- package/llms.txt +11 -0
- package/package.json +18 -17
- package/src/prompts/codemode-how-to-task/SKILL.md +40 -0
- package/src/types/webTasks.ts +1 -0
- package/dist/delegation-Dsqf7fUM.mjs.map +0 -1
- package/dist/delegation-frvEXhIz.cjs.map +0 -1
- package/dist/index-CA4Opp4r.d.mts.map +0 -1
- package/dist/index-qQGWsPum.d.mts.map +0 -1
- package/dist/logSinkTelemetry-BGb8WQBz.cjs.map +0 -1
- package/dist/logSinkTelemetry-BhbKdn-x.mjs.map +0 -1
- package/dist/paths-DajceJig.mjs.map +0 -1
- package/dist/paths-P-XvOUuH.cjs.map +0 -1
- package/dist/task-DJpTteeJ.d.mts.map +0 -1
- package/dist/taskStore-BAi54FKL.mjs.map +0 -1
- package/dist/taskStore-C4vcUOzA.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineActivityGroup, defineChannelFile, defineFill, defineNativePlugin, defineSessionStore, defineToolRenderer } from "@agimon-ai/po-core/native";
|
|
2
|
-
import { Badge, Button, ChevronDownIcon, ChevronRightIcon, CodeBlock, Dot, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, EditIcon, Input, KebabIcon, Label, ListRow, MessageIcon, MessageItem, MessageItemBody, MessageItemHeader, MessageItemStatus, SegmentedControl, Sheet, SheetBody, SheetContent, SheetHeader, SheetTitle,
|
|
2
|
+
import { AgentAvatar, Badge, Button, ChevronDownIcon, ChevronRightIcon, CodeBlock, Dot, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, EditIcon, Input, KebabIcon, Label, ListRow, MessageIcon, MessageItem, MessageItemBody, MessageItemHeader, MessageItemStatus, SegmentedControl, Sheet, SheetBody, SheetContent, SheetHeader, SheetTitle, TaskIcon, Textarea, TrashIcon, toolTone } from "@agimon-ai/po-native-components";
|
|
3
3
|
import { createElement, useCallback, useState, useSyncExternalStore } from "react";
|
|
4
4
|
import { View } from "react-native-unistyles/components/native/View";
|
|
5
5
|
import { Text } from "react-native-unistyles/components/native/Text";
|
|
@@ -42,6 +42,7 @@ function parseTask(value) {
|
|
|
42
42
|
if (isRecord$1(value.delegation)) {
|
|
43
43
|
task.delegation = {};
|
|
44
44
|
if (typeof value.delegation.agent === "string") task.delegation.agent = value.delegation.agent;
|
|
45
|
+
if (typeof value.delegation.identity === "string") task.delegation.identity = value.delegation.identity;
|
|
45
46
|
if (typeof value.delegation.state === "string") task.delegation.state = value.delegation.state;
|
|
46
47
|
}
|
|
47
48
|
return task;
|
|
@@ -54,6 +55,11 @@ function parseTasksPayload(input) {
|
|
|
54
55
|
rev: input.rev
|
|
55
56
|
};
|
|
56
57
|
}
|
|
58
|
+
/** Same first-name presentation as the Agents panel, without changing routing identity. */
|
|
59
|
+
function taskAgentName(delegation) {
|
|
60
|
+
const first = delegation?.identity?.split("-")[0];
|
|
61
|
+
return first ? first.charAt(0).toUpperCase() + first.slice(1) : delegation?.agent;
|
|
62
|
+
}
|
|
57
63
|
function taskEditDraft(task) {
|
|
58
64
|
return {
|
|
59
65
|
subject: task.subject,
|
|
@@ -149,6 +155,15 @@ var tasks_native_default = defineActivityGroup({
|
|
|
149
155
|
//#region src/extensions/workspaces/sessions/(frontend)/channel/task-graph.native.ts
|
|
150
156
|
var task_graph_native_default = defineChannelFile(tasksChannel);
|
|
151
157
|
//#endregion
|
|
158
|
+
//#region src/extensions/workspaces/sessions/(frontend)/fill/_lib/taskStatusTone.ts
|
|
159
|
+
const TASK_STATUS_TONE = {
|
|
160
|
+
pending: "muted",
|
|
161
|
+
in_progress: "green",
|
|
162
|
+
completed: "neutral",
|
|
163
|
+
failed: "red",
|
|
164
|
+
deleted: "muted"
|
|
165
|
+
};
|
|
166
|
+
//#endregion
|
|
152
167
|
//#region src/extensions/workspaces/sessions/(frontend)/fill/_lib/TaskDetailSheet.native.tsx
|
|
153
168
|
const STATUS_CHOICES = [
|
|
154
169
|
"pending",
|
|
@@ -164,11 +179,18 @@ function Field({ label, children }) {
|
|
|
164
179
|
children: [/* @__PURE__ */ jsx(Label, { children: label }), children]
|
|
165
180
|
});
|
|
166
181
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
style: styles$2.
|
|
171
|
-
children:
|
|
182
|
+
/** One term and its value in the facts list. */
|
|
183
|
+
function Fact({ term, testID, children }) {
|
|
184
|
+
return /* @__PURE__ */ jsxs(View, {
|
|
185
|
+
style: styles$2.fact,
|
|
186
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
187
|
+
style: styles$2.term,
|
|
188
|
+
children: term
|
|
189
|
+
}), /* @__PURE__ */ jsx(View, {
|
|
190
|
+
testID,
|
|
191
|
+
style: styles$2.factValue,
|
|
192
|
+
children
|
|
193
|
+
})]
|
|
172
194
|
});
|
|
173
195
|
}
|
|
174
196
|
function SheetAction({ label, variant, testID, onPress }) {
|
|
@@ -180,49 +202,58 @@ function SheetAction({ label, variant, testID, onPress }) {
|
|
|
180
202
|
});
|
|
181
203
|
}
|
|
182
204
|
function TaskFacts({ task }) {
|
|
205
|
+
const agent = taskAgentName(task.delegation);
|
|
183
206
|
return /* @__PURE__ */ jsxs(View, {
|
|
184
207
|
style: styles$2.facts,
|
|
185
208
|
children: [
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
209
|
+
agent ? /* @__PURE__ */ jsxs(Fact, {
|
|
210
|
+
term: "Agent",
|
|
211
|
+
testID: "task-detail-agent",
|
|
212
|
+
children: [
|
|
213
|
+
/* @__PURE__ */ jsx(AgentAvatar, {
|
|
214
|
+
name: agent,
|
|
215
|
+
size: "sm"
|
|
216
|
+
}),
|
|
217
|
+
/* @__PURE__ */ jsx(Text, {
|
|
218
|
+
style: styles$2.value,
|
|
219
|
+
children: agent
|
|
220
|
+
}),
|
|
221
|
+
task.delegation?.state ? /* @__PURE__ */ jsx(Text, {
|
|
222
|
+
style: styles$2.hint,
|
|
223
|
+
children: task.delegation.state
|
|
224
|
+
}) : null
|
|
225
|
+
]
|
|
199
226
|
}) : null,
|
|
200
|
-
task.
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
227
|
+
task.activeForm ? /* @__PURE__ */ jsx(Fact, {
|
|
228
|
+
term: "Doing now",
|
|
229
|
+
testID: "task-detail-active-form",
|
|
230
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
231
|
+
style: styles$2.value,
|
|
232
|
+
children: task.activeForm
|
|
205
233
|
})
|
|
206
234
|
}) : null,
|
|
207
|
-
task.
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
235
|
+
task.blockedBy.length > 0 ? /* @__PURE__ */ jsx(Fact, {
|
|
236
|
+
term: "Waits for",
|
|
237
|
+
testID: "task-detail-blocked-by",
|
|
238
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
239
|
+
style: styles$2.value,
|
|
240
|
+
children: task.blockedBy.map((id) => `#${id}`).join(", ")
|
|
212
241
|
})
|
|
213
242
|
}) : null,
|
|
214
|
-
task.
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
243
|
+
task.owner ? /* @__PURE__ */ jsx(Fact, {
|
|
244
|
+
term: "Owner",
|
|
245
|
+
testID: "task-detail-owner",
|
|
246
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
247
|
+
style: styles$2.value,
|
|
248
|
+
children: task.owner
|
|
219
249
|
})
|
|
220
250
|
}) : null,
|
|
221
|
-
task.updatedAt ? /* @__PURE__ */ jsx(
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
251
|
+
task.updatedAt ? /* @__PURE__ */ jsx(Fact, {
|
|
252
|
+
term: "Updated",
|
|
253
|
+
testID: "task-detail-updated",
|
|
254
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
255
|
+
style: styles$2.value,
|
|
256
|
+
children: task.updatedAt
|
|
226
257
|
})
|
|
227
258
|
}) : null
|
|
228
259
|
]
|
|
@@ -238,6 +269,7 @@ function TaskDetailSheet({ task, sessionId, mode: initialMode, send, onClose })
|
|
|
238
269
|
const [draft, setDraft] = useState(() => taskEditDraft(task));
|
|
239
270
|
const [message, setMessage] = useState("");
|
|
240
271
|
const agent = task.delegation?.agent;
|
|
272
|
+
const agentName = taskAgentName(task.delegation);
|
|
241
273
|
const submitEdit = () => {
|
|
242
274
|
if (requestTaskEdit(send, sessionId, task, draft)) onClose();
|
|
243
275
|
};
|
|
@@ -251,138 +283,152 @@ function TaskDetailSheet({ task, sessionId, mode: initialMode, send, onClose })
|
|
|
251
283
|
onOpenChange: (open) => {
|
|
252
284
|
if (!open) onClose();
|
|
253
285
|
},
|
|
254
|
-
children: /* @__PURE__ */ jsxs(SheetContent, {
|
|
255
|
-
|
|
256
|
-
children: /* @__PURE__ */ jsx(
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
label: "Description",
|
|
267
|
-
children: /* @__PURE__ */ jsx(ReadOnlyValue, {
|
|
268
|
-
testID: "task-detail-description",
|
|
269
|
-
value: task.description ?? "no description on this task"
|
|
270
|
-
})
|
|
271
|
-
}),
|
|
272
|
-
/* @__PURE__ */ jsx(TaskFacts, { task }),
|
|
286
|
+
children: /* @__PURE__ */ jsxs(SheetContent, {
|
|
287
|
+
keep: mode !== "view",
|
|
288
|
+
children: [/* @__PURE__ */ jsx(SheetHeader, {
|
|
289
|
+
closeLabel: "close task",
|
|
290
|
+
children: /* @__PURE__ */ jsx(SheetTitle, {
|
|
291
|
+
testID: "task-detail-title",
|
|
292
|
+
accessibilityLabel: `task #${task.id}: ${task.subject}`,
|
|
293
|
+
children: task.subject
|
|
294
|
+
})
|
|
295
|
+
}), /* @__PURE__ */ jsxs(SheetBody, {
|
|
296
|
+
testID: "task-detail-dialog",
|
|
297
|
+
children: [
|
|
273
298
|
/* @__PURE__ */ jsxs(View, {
|
|
274
|
-
style: styles$2.
|
|
275
|
-
children: [
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
onPress: () => setMode("edit")
|
|
299
|
+
style: styles$2.status,
|
|
300
|
+
children: [/* @__PURE__ */ jsxs(Text, {
|
|
301
|
+
style: styles$2.id,
|
|
302
|
+
children: ["#", task.id]
|
|
303
|
+
}), /* @__PURE__ */ jsxs(Badge, {
|
|
304
|
+
testID: "task-detail-status",
|
|
305
|
+
children: [/* @__PURE__ */ jsx(Dot, {
|
|
306
|
+
tone: TASK_STATUS_TONE[task.status],
|
|
307
|
+
pulse: task.status === "in_progress"
|
|
308
|
+
}), task.status.replace("_", " ")]
|
|
285
309
|
})]
|
|
286
|
-
})
|
|
287
|
-
] }) : null,
|
|
288
|
-
mode === "edit" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
289
|
-
/* @__PURE__ */ jsx(Field, {
|
|
290
|
-
label: "Subject",
|
|
291
|
-
children: /* @__PURE__ */ jsx(Input, {
|
|
292
|
-
testID: "task-detail-subject-input",
|
|
293
|
-
accessibilityLabel: "Subject",
|
|
294
|
-
autoFocus: true,
|
|
295
|
-
value: draft.subject,
|
|
296
|
-
onChangeText: (subject) => setDraft({
|
|
297
|
-
...draft,
|
|
298
|
-
subject
|
|
299
|
-
})
|
|
300
|
-
})
|
|
301
310
|
}),
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
311
|
+
mode === "view" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
312
|
+
/* @__PURE__ */ jsx(Text, {
|
|
313
|
+
testID: "task-detail-description",
|
|
314
|
+
style: task.description ? styles$2.body : styles$2.hint,
|
|
315
|
+
children: task.description ?? "No description on this task."
|
|
316
|
+
}),
|
|
317
|
+
/* @__PURE__ */ jsx(TaskFacts, { task }),
|
|
318
|
+
/* @__PURE__ */ jsxs(View, {
|
|
319
|
+
style: styles$2.footer,
|
|
320
|
+
children: [agent ? /* @__PURE__ */ jsx(SheetAction, {
|
|
321
|
+
label: "Message agent",
|
|
322
|
+
variant: "ghost",
|
|
323
|
+
testID: "task-detail-open-message",
|
|
324
|
+
onPress: () => setMode("message")
|
|
325
|
+
}) : null, /* @__PURE__ */ jsx(SheetAction, {
|
|
326
|
+
label: "Edit",
|
|
327
|
+
variant: "primary",
|
|
328
|
+
testID: "task-detail-open-edit",
|
|
329
|
+
onPress: () => setMode("edit")
|
|
330
|
+
})]
|
|
314
331
|
})
|
|
315
|
-
}),
|
|
316
|
-
/* @__PURE__ */
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
332
|
+
] }) : null,
|
|
333
|
+
mode === "edit" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
334
|
+
/* @__PURE__ */ jsx(Field, {
|
|
335
|
+
label: "Subject",
|
|
336
|
+
children: /* @__PURE__ */ jsx(Input, {
|
|
337
|
+
testID: "task-detail-subject-input",
|
|
338
|
+
accessibilityLabel: "Subject",
|
|
339
|
+
autoFocus: true,
|
|
340
|
+
value: draft.subject,
|
|
341
|
+
onChangeText: (subject) => setDraft({
|
|
342
|
+
...draft,
|
|
343
|
+
subject
|
|
344
|
+
})
|
|
345
|
+
})
|
|
346
|
+
}),
|
|
347
|
+
/* @__PURE__ */ jsx(Field, {
|
|
348
|
+
label: "Description",
|
|
349
|
+
children: /* @__PURE__ */ jsx(Textarea, {
|
|
350
|
+
testID: "task-detail-description-input",
|
|
351
|
+
accessibilityLabel: "Description",
|
|
352
|
+
numberOfLines: DESCRIPTION_LINES,
|
|
353
|
+
value: draft.description,
|
|
354
|
+
placeholder: "What this task covers",
|
|
355
|
+
onChangeText: (description) => setDraft({
|
|
327
356
|
...draft,
|
|
328
|
-
|
|
329
|
-
})
|
|
330
|
-
}
|
|
357
|
+
description
|
|
358
|
+
})
|
|
359
|
+
})
|
|
360
|
+
}),
|
|
361
|
+
/* @__PURE__ */ jsx(Field, {
|
|
362
|
+
label: "Status",
|
|
363
|
+
children: /* @__PURE__ */ jsx(SegmentedControl, {
|
|
364
|
+
accessibilityLabel: "Status",
|
|
365
|
+
options: STATUS_CHOICES.map((status) => ({
|
|
366
|
+
value: status,
|
|
367
|
+
label: status.replace("_", " ")
|
|
368
|
+
})),
|
|
369
|
+
value: draft.status,
|
|
370
|
+
onValueChange: (status) => {
|
|
371
|
+
if (STATUS_CHOICES.includes(status)) setDraft({
|
|
372
|
+
...draft,
|
|
373
|
+
status
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
})
|
|
377
|
+
}),
|
|
378
|
+
/* @__PURE__ */ jsx(Text, {
|
|
379
|
+
style: styles$2.hint,
|
|
380
|
+
children: "Saved as one prompt naming only the fields you changed"
|
|
381
|
+
}),
|
|
382
|
+
/* @__PURE__ */ jsxs(View, {
|
|
383
|
+
style: styles$2.footer,
|
|
384
|
+
children: [/* @__PURE__ */ jsx(SheetAction, {
|
|
385
|
+
label: "Cancel",
|
|
386
|
+
variant: "ghost",
|
|
387
|
+
testID: "task-detail-cancel",
|
|
388
|
+
onPress: onClose
|
|
389
|
+
}), /* @__PURE__ */ jsx(SheetAction, {
|
|
390
|
+
label: "Save",
|
|
391
|
+
variant: "primary",
|
|
392
|
+
testID: "task-detail-save",
|
|
393
|
+
onPress: submitEdit
|
|
394
|
+
})]
|
|
331
395
|
})
|
|
332
|
-
}),
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
})
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
396
|
+
] }) : null,
|
|
397
|
+
mode === "message" && agent ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
398
|
+
/* @__PURE__ */ jsx(Field, {
|
|
399
|
+
label: `Message to ${agentName}`,
|
|
400
|
+
children: /* @__PURE__ */ jsx(Textarea, {
|
|
401
|
+
testID: "task-detail-message-input",
|
|
402
|
+
accessibilityLabel: "Message to agent",
|
|
403
|
+
autoFocus: true,
|
|
404
|
+
numberOfLines: MESSAGE_LINES,
|
|
405
|
+
value: message,
|
|
406
|
+
placeholder: "Guidance for the run working on this task",
|
|
407
|
+
onChangeText: setMessage
|
|
408
|
+
})
|
|
409
|
+
}),
|
|
410
|
+
/* @__PURE__ */ jsx(Text, {
|
|
411
|
+
style: styles$2.hint,
|
|
412
|
+
children: "Steers the run, it does not edit the task"
|
|
413
|
+
}),
|
|
414
|
+
/* @__PURE__ */ jsxs(View, {
|
|
415
|
+
style: styles$2.footer,
|
|
416
|
+
children: [/* @__PURE__ */ jsx(SheetAction, {
|
|
417
|
+
label: "Cancel",
|
|
418
|
+
variant: "ghost",
|
|
419
|
+
testID: "task-detail-cancel",
|
|
420
|
+
onPress: onClose
|
|
421
|
+
}), /* @__PURE__ */ jsx(SheetAction, {
|
|
422
|
+
label: "Send",
|
|
423
|
+
variant: "primary",
|
|
424
|
+
testID: "task-detail-send",
|
|
425
|
+
onPress: submitMessage
|
|
426
|
+
})]
|
|
363
427
|
})
|
|
364
|
-
})
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}),
|
|
369
|
-
/* @__PURE__ */ jsxs(View, {
|
|
370
|
-
style: styles$2.footer,
|
|
371
|
-
children: [/* @__PURE__ */ jsx(SheetAction, {
|
|
372
|
-
label: "cancel",
|
|
373
|
-
variant: "ghost",
|
|
374
|
-
testID: "task-detail-cancel",
|
|
375
|
-
onPress: onClose
|
|
376
|
-
}), /* @__PURE__ */ jsx(SheetAction, {
|
|
377
|
-
label: "send",
|
|
378
|
-
variant: "primary",
|
|
379
|
-
testID: "task-detail-send",
|
|
380
|
-
onPress: submitMessage
|
|
381
|
-
})]
|
|
382
|
-
})
|
|
383
|
-
] }) : null
|
|
384
|
-
]
|
|
385
|
-
})] })
|
|
428
|
+
] }) : null
|
|
429
|
+
]
|
|
430
|
+
})]
|
|
431
|
+
})
|
|
386
432
|
});
|
|
387
433
|
}
|
|
388
434
|
const styles$2 = StyleSheet.create((theme) => ({
|
|
@@ -390,16 +436,53 @@ const styles$2 = StyleSheet.create((theme) => ({
|
|
|
390
436
|
gap: theme.spacing(1.5),
|
|
391
437
|
uni__dependencies: [0]
|
|
392
438
|
},
|
|
439
|
+
status: {
|
|
440
|
+
flexDirection: "row",
|
|
441
|
+
alignItems: "center",
|
|
442
|
+
gap: theme.spacing(2),
|
|
443
|
+
uni__dependencies: [0]
|
|
444
|
+
},
|
|
445
|
+
id: {
|
|
446
|
+
fontSize: theme.fontSize.sm,
|
|
447
|
+
lineHeight: theme.lineHeight.sm,
|
|
448
|
+
color: theme.colors.faint,
|
|
449
|
+
uni__dependencies: [0]
|
|
450
|
+
},
|
|
451
|
+
body: {
|
|
452
|
+
fontSize: theme.fontSize.base,
|
|
453
|
+
lineHeight: theme.lineHeight.lg,
|
|
454
|
+
color: theme.colors.text,
|
|
455
|
+
uni__dependencies: [0]
|
|
456
|
+
},
|
|
393
457
|
facts: {
|
|
458
|
+
gap: theme.spacing(2.5),
|
|
459
|
+
uni__dependencies: [0]
|
|
460
|
+
},
|
|
461
|
+
fact: {
|
|
462
|
+
flexDirection: "row",
|
|
463
|
+
alignItems: "center",
|
|
464
|
+
gap: theme.spacing(4),
|
|
465
|
+
uni__dependencies: [0]
|
|
466
|
+
},
|
|
467
|
+
term: {
|
|
468
|
+
width: theme.spacing(20),
|
|
469
|
+
fontSize: theme.fontSize.base,
|
|
470
|
+
lineHeight: theme.lineHeight.base,
|
|
471
|
+
color: theme.colors.dim,
|
|
472
|
+
uni__dependencies: [0]
|
|
473
|
+
},
|
|
474
|
+
factValue: {
|
|
475
|
+
flex: 1,
|
|
394
476
|
flexDirection: "row",
|
|
477
|
+
alignItems: "center",
|
|
395
478
|
flexWrap: "wrap",
|
|
396
|
-
gap: theme.spacing(5),
|
|
479
|
+
gap: theme.spacing(1.5),
|
|
397
480
|
uni__dependencies: [0]
|
|
398
481
|
},
|
|
399
482
|
value: {
|
|
400
483
|
fontSize: theme.fontSize.base,
|
|
401
|
-
lineHeight: theme.lineHeight.
|
|
402
|
-
color: theme.colors.
|
|
484
|
+
lineHeight: theme.lineHeight.base,
|
|
485
|
+
color: theme.colors.text,
|
|
403
486
|
uni__dependencies: [0]
|
|
404
487
|
},
|
|
405
488
|
hint: {
|
|
@@ -416,19 +499,9 @@ const styles$2 = StyleSheet.create((theme) => ({
|
|
|
416
499
|
}
|
|
417
500
|
}));
|
|
418
501
|
//#endregion
|
|
419
|
-
//#region src/extensions/workspaces/sessions/(frontend)/fill/_lib/taskStatusTone.ts
|
|
420
|
-
const TASK_STATUS_TONE = {
|
|
421
|
-
pending: "muted",
|
|
422
|
-
in_progress: "yellow",
|
|
423
|
-
completed: "green",
|
|
424
|
-
failed: "red",
|
|
425
|
-
deleted: "muted"
|
|
426
|
-
};
|
|
427
|
-
//#endregion
|
|
428
502
|
//#region src/extensions/workspaces/sessions/(frontend)/fill/_lib/TasksActivitySection.native.tsx
|
|
429
503
|
function titleInk(status) {
|
|
430
|
-
|
|
431
|
-
return status === "completed" ? "dim" : "hi";
|
|
504
|
+
return status === "completed" || status === "failed" ? "dim" : "hi";
|
|
432
505
|
}
|
|
433
506
|
/** The session's tasks, read from the native store without @tanstack/react-store, which the app does not provide. */
|
|
434
507
|
function useSessionTasks(sessionId) {
|
|
@@ -439,8 +512,9 @@ function useSessionTasks(sessionId) {
|
|
|
439
512
|
return useSyncExternalStore(subscribe, () => tasks.select(tasks.store.state, sessionId).tasks);
|
|
440
513
|
}
|
|
441
514
|
function TaskRow({ task, sessionId, sendSessionFrame, openSheet }) {
|
|
442
|
-
const
|
|
443
|
-
const agent = task.delegation
|
|
515
|
+
const doing = task.status === "in_progress" ? task.activeForm : void 0;
|
|
516
|
+
const agent = taskAgentName(task.delegation);
|
|
517
|
+
const detail = [doing, task.blockedBy.length > 0 ? `Waits for ${task.blockedBy.map((id) => `#${id}`).join(", ")}` : ""].filter(Boolean).join(" · ");
|
|
444
518
|
return /* @__PURE__ */ jsx(View, {
|
|
445
519
|
testID: `activity-task-${task.id}`,
|
|
446
520
|
children: /* @__PURE__ */ jsx(ListRow, {
|
|
@@ -453,60 +527,67 @@ function TaskRow({ task, sessionId, sendSessionFrame, openSheet }) {
|
|
|
453
527
|
testID: `activity-task-title-${task.id}`,
|
|
454
528
|
accessibilityLabel: task.subject,
|
|
455
529
|
onPress: () => openSheet("view"),
|
|
530
|
+
style: styles$1.titleButton,
|
|
456
531
|
children: /* @__PURE__ */ jsxs(Text, {
|
|
457
|
-
numberOfLines:
|
|
532
|
+
numberOfLines: 2,
|
|
458
533
|
style: styles$1.title(titleInk(task.status)),
|
|
459
534
|
children: [
|
|
460
|
-
|
|
461
|
-
|
|
535
|
+
/* @__PURE__ */ jsxs(Text, {
|
|
536
|
+
style: styles$1.id,
|
|
537
|
+
children: ["#", task.id]
|
|
538
|
+
}),
|
|
462
539
|
" ",
|
|
463
540
|
task.subject
|
|
464
541
|
]
|
|
465
542
|
})
|
|
466
543
|
}),
|
|
467
|
-
description:
|
|
468
|
-
|
|
469
|
-
style: styles$1.meta,
|
|
544
|
+
description: agent || detail ? /* @__PURE__ */ jsxs(View, {
|
|
545
|
+
style: styles$1.line,
|
|
470
546
|
children: [
|
|
471
|
-
agent ?
|
|
472
|
-
|
|
473
|
-
|
|
547
|
+
agent ? /* @__PURE__ */ jsx(AgentAvatar, {
|
|
548
|
+
name: agent,
|
|
549
|
+
size: "sm"
|
|
550
|
+
}) : null,
|
|
551
|
+
agent ? /* @__PURE__ */ jsx(Text, {
|
|
552
|
+
style: styles$1.agent,
|
|
553
|
+
children: agent
|
|
554
|
+
}) : null,
|
|
555
|
+
detail ? /* @__PURE__ */ jsx(Text, {
|
|
556
|
+
numberOfLines: 1,
|
|
557
|
+
style: styles$1.meta,
|
|
558
|
+
children: detail
|
|
559
|
+
}) : null
|
|
474
560
|
]
|
|
475
561
|
}) : void 0,
|
|
476
|
-
trailing: /* @__PURE__ */ jsxs(
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
variant: "destructive",
|
|
498
|
-
onSelect: () => requestTaskRemoval(sendSessionFrame, sessionId, task.id),
|
|
499
|
-
children: [/* @__PURE__ */ jsx(TrashIcon, { color: "red" }), "Remove"]
|
|
500
|
-
})
|
|
501
|
-
] })] }) : null]
|
|
502
|
-
})
|
|
562
|
+
trailing: task.status !== "completed" && task.status !== "deleted" ? /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
563
|
+
variant: "ghost",
|
|
564
|
+
size: "icon",
|
|
565
|
+
testID: `activity-task-menu-${task.id}`,
|
|
566
|
+
accessibilityLabel: `task #${task.id} actions`,
|
|
567
|
+
children: /* @__PURE__ */ jsx(KebabIcon, {})
|
|
568
|
+
}), /* @__PURE__ */ jsxs(DropdownMenuContent, { children: [
|
|
569
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
570
|
+
onSelect: () => openSheet("edit"),
|
|
571
|
+
children: [/* @__PURE__ */ jsx(EditIcon, {}), "Edit"]
|
|
572
|
+
}),
|
|
573
|
+
agent ? /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
574
|
+
onSelect: () => openSheet("message"),
|
|
575
|
+
children: [/* @__PURE__ */ jsx(MessageIcon, {}), "Message agent"]
|
|
576
|
+
}) : null,
|
|
577
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
578
|
+
variant: "destructive",
|
|
579
|
+
onSelect: () => requestTaskRemoval(sendSessionFrame, sessionId, task.id),
|
|
580
|
+
children: [/* @__PURE__ */ jsx(TrashIcon, { color: "red" }), "Remove"]
|
|
581
|
+
})
|
|
582
|
+
] })] }) : void 0
|
|
503
583
|
})
|
|
504
584
|
});
|
|
505
585
|
}
|
|
506
586
|
/**
|
|
507
587
|
* The session task graph in the app's Activity list, mirroring the web
|
|
508
|
-
* section: active rows
|
|
509
|
-
* sheet for reading or changing one task. Empty graphs render
|
|
588
|
+
* section: a done count, active rows, finished and failed ones folded away by
|
|
589
|
+
* default, and a sheet for reading or changing one task. Empty graphs render
|
|
590
|
+
* nothing.
|
|
510
591
|
*/
|
|
511
592
|
function TasksActivitySection({ sessionId, sendSessionFrame }) {
|
|
512
593
|
const sessionTasks = useSessionTasks(sessionId);
|
|
@@ -515,6 +596,9 @@ function TasksActivitySection({ sessionId, sendSessionFrame }) {
|
|
|
515
596
|
if (sessionId === null || sessionTasks.length === 0) return null;
|
|
516
597
|
const active = sessionTasks.filter((task) => task.status === "pending" || task.status === "in_progress");
|
|
517
598
|
const history = sessionTasks.filter((task) => task.status === "completed" || task.status === "failed");
|
|
599
|
+
const failed = history.filter((task) => task.status === "failed").length;
|
|
600
|
+
const done = history.length - failed;
|
|
601
|
+
const total = active.length + history.length;
|
|
518
602
|
const sheetTask = sheet ? sessionTasks.find((task) => task.id === sheet.taskId) : void 0;
|
|
519
603
|
const row = (task) => /* @__PURE__ */ jsx(TaskRow, {
|
|
520
604
|
task,
|
|
@@ -528,6 +612,29 @@ function TasksActivitySection({ sessionId, sendSessionFrame }) {
|
|
|
528
612
|
return /* @__PURE__ */ jsxs(View, {
|
|
529
613
|
style: styles$1.section,
|
|
530
614
|
children: [
|
|
615
|
+
total > 0 ? /* @__PURE__ */ jsxs(View, {
|
|
616
|
+
testID: "activity-task-progress",
|
|
617
|
+
accessible: true,
|
|
618
|
+
accessibilityRole: "progressbar",
|
|
619
|
+
accessibilityValue: {
|
|
620
|
+
min: 0,
|
|
621
|
+
max: total,
|
|
622
|
+
now: done
|
|
623
|
+
},
|
|
624
|
+
style: styles$1.progress,
|
|
625
|
+
children: [/* @__PURE__ */ jsxs(Text, {
|
|
626
|
+
style: styles$1.meta,
|
|
627
|
+
children: [
|
|
628
|
+
done,
|
|
629
|
+
" of ",
|
|
630
|
+
total,
|
|
631
|
+
" done"
|
|
632
|
+
]
|
|
633
|
+
}), /* @__PURE__ */ jsx(View, {
|
|
634
|
+
style: styles$1.track,
|
|
635
|
+
children: /* @__PURE__ */ jsx(View, { style: [styles$1.fill, { width: `${done / total * 100}%` }] })
|
|
636
|
+
})]
|
|
637
|
+
}) : null,
|
|
531
638
|
active.length > 0 ? /* @__PURE__ */ jsx(View, {
|
|
532
639
|
style: styles$1.group,
|
|
533
640
|
children: active.map(row)
|
|
@@ -536,6 +643,7 @@ function TasksActivitySection({ sessionId, sendSessionFrame }) {
|
|
|
536
643
|
style: styles$1.group,
|
|
537
644
|
children: [/* @__PURE__ */ jsxs(Button, {
|
|
538
645
|
variant: "ghost",
|
|
646
|
+
testID: "activity-task-history-toggle",
|
|
539
647
|
accessibilityState: { expanded: historyOpen },
|
|
540
648
|
onPress: () => setHistoryOpen((open) => !open),
|
|
541
649
|
style: styles$1.historyToggle,
|
|
@@ -543,12 +651,16 @@ function TasksActivitySection({ sessionId, sendSessionFrame }) {
|
|
|
543
651
|
/* @__PURE__ */ jsx(Fragment, { children: historyOpen ? /* @__PURE__ */ jsx(ChevronDownIcon, {}) : /* @__PURE__ */ jsx(ChevronRightIcon, {}) }),
|
|
544
652
|
/* @__PURE__ */ jsx(Text, {
|
|
545
653
|
style: styles$1.historyLabel,
|
|
546
|
-
children: "
|
|
654
|
+
children: "Finished"
|
|
547
655
|
}),
|
|
548
|
-
/* @__PURE__ */ jsx(Badge, { children: history.length })
|
|
656
|
+
/* @__PURE__ */ jsx(Badge, { children: history.length }),
|
|
657
|
+
failed > 0 ? /* @__PURE__ */ jsxs(Text, {
|
|
658
|
+
style: styles$1.failed,
|
|
659
|
+
children: [failed, " failed"]
|
|
660
|
+
}) : null
|
|
549
661
|
]
|
|
550
662
|
}), historyOpen ? /* @__PURE__ */ jsx(View, {
|
|
551
|
-
style:
|
|
663
|
+
style: styles$1.group,
|
|
552
664
|
children: history.map(row)
|
|
553
665
|
}) : null]
|
|
554
666
|
}) : null,
|
|
@@ -571,15 +683,21 @@ const styles$1 = StyleSheet.create((theme) => ({
|
|
|
571
683
|
gap: theme.spacing(.5),
|
|
572
684
|
uni__dependencies: [0]
|
|
573
685
|
},
|
|
574
|
-
|
|
575
|
-
|
|
686
|
+
progress: {
|
|
687
|
+
gap: theme.spacing(1.5),
|
|
688
|
+
paddingHorizontal: theme.spacing(1),
|
|
576
689
|
uni__dependencies: [0]
|
|
577
690
|
},
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
691
|
+
track: {
|
|
692
|
+
height: theme.spacing(1),
|
|
693
|
+
borderRadius: theme.borderRadius.full,
|
|
694
|
+
overflow: "hidden",
|
|
695
|
+
backgroundColor: theme.colors.deep,
|
|
696
|
+
uni__dependencies: [0]
|
|
697
|
+
},
|
|
698
|
+
fill: {
|
|
699
|
+
height: "100%",
|
|
700
|
+
backgroundColor: theme.colors.green,
|
|
583
701
|
uni__dependencies: [0]
|
|
584
702
|
},
|
|
585
703
|
line: {
|
|
@@ -588,54 +706,60 @@ const styles$1 = StyleSheet.create((theme) => ({
|
|
|
588
706
|
gap: theme.spacing(1.5),
|
|
589
707
|
uni__dependencies: [0]
|
|
590
708
|
},
|
|
709
|
+
titleButton: {
|
|
710
|
+
height: "auto",
|
|
711
|
+
justifyContent: "flex-start",
|
|
712
|
+
paddingHorizontal: 0,
|
|
713
|
+
paddingVertical: theme.spacing(.5),
|
|
714
|
+
uni__dependencies: [0]
|
|
715
|
+
},
|
|
591
716
|
title: (ink) => ({
|
|
592
717
|
fontSize: theme.fontSize.base,
|
|
593
718
|
lineHeight: theme.lineHeight.base,
|
|
594
|
-
fontWeight: "
|
|
719
|
+
fontWeight: "500",
|
|
595
720
|
color: theme.colors[ink],
|
|
596
721
|
uni__dependencies: [0]
|
|
597
722
|
}),
|
|
598
723
|
id: {
|
|
599
|
-
|
|
724
|
+
fontSize: theme.fontSize.sm,
|
|
725
|
+
color: theme.colors.faint,
|
|
726
|
+
uni__dependencies: [0]
|
|
727
|
+
},
|
|
728
|
+
agent: {
|
|
729
|
+
fontSize: theme.fontSize.sm,
|
|
730
|
+
lineHeight: theme.lineHeight.sm,
|
|
731
|
+
color: theme.colors.text,
|
|
600
732
|
uni__dependencies: [0]
|
|
601
733
|
},
|
|
602
734
|
meta: {
|
|
735
|
+
flexShrink: 1,
|
|
603
736
|
fontSize: theme.fontSize.sm,
|
|
604
737
|
lineHeight: theme.lineHeight.sm,
|
|
605
738
|
color: theme.colors.dim,
|
|
606
739
|
uni__dependencies: [0]
|
|
607
740
|
},
|
|
608
|
-
|
|
609
|
-
|
|
741
|
+
failed: {
|
|
742
|
+
fontSize: theme.fontSize.sm,
|
|
743
|
+
lineHeight: theme.lineHeight.sm,
|
|
744
|
+
color: theme.colors.red,
|
|
610
745
|
uni__dependencies: [0]
|
|
611
746
|
},
|
|
612
747
|
historyToggle: {
|
|
613
748
|
flexDirection: "row",
|
|
614
749
|
alignItems: "center",
|
|
750
|
+
justifyContent: "flex-start",
|
|
615
751
|
gap: theme.spacing(1.5),
|
|
616
752
|
minHeight: theme.spacing(11),
|
|
617
753
|
paddingHorizontal: theme.spacing(1),
|
|
618
754
|
borderRadius: theme.borderRadius.md,
|
|
619
755
|
uni__dependencies: [0]
|
|
620
756
|
},
|
|
621
|
-
|
|
757
|
+
historyLabel: {
|
|
622
758
|
fontSize: theme.fontSize.sm,
|
|
623
759
|
lineHeight: theme.lineHeight.sm,
|
|
624
|
-
color: theme.colors.faint,
|
|
625
|
-
uni__dependencies: [0]
|
|
626
|
-
},
|
|
627
|
-
historyLabel: {
|
|
628
|
-
fontSize: theme.fontSize.base,
|
|
629
|
-
lineHeight: theme.lineHeight.base,
|
|
630
760
|
fontWeight: "500",
|
|
631
761
|
color: theme.colors.dim,
|
|
632
762
|
uni__dependencies: [0]
|
|
633
|
-
},
|
|
634
|
-
count: {
|
|
635
|
-
fontSize: theme.fontSize["2xs"],
|
|
636
|
-
lineHeight: theme.lineHeight["2xs"],
|
|
637
|
-
color: theme.colors.faint,
|
|
638
|
-
uni__dependencies: [0]
|
|
639
763
|
}
|
|
640
764
|
}));
|
|
641
765
|
//#endregion
|
|
@@ -643,6 +767,12 @@ const styles$1 = StyleSheet.create((theme) => ({
|
|
|
643
767
|
var Tasks_activity_tasks_native_default = defineFill({ component: TasksActivitySection });
|
|
644
768
|
//#endregion
|
|
645
769
|
//#region src/extensions/workspaces/sessions/(frontend)/tool/_lib/taskToolFormat.ts
|
|
770
|
+
/**
|
|
771
|
+
* Pure view logic for the task tool card, the browser counterpart of
|
|
772
|
+
* the session frontend's shared format helpers (renderTaskCall, renderTaskResult). The plugin may reach
|
|
773
|
+
* only its own files and src/types, so the store shapes it reads are
|
|
774
|
+
* restated here as the wire JSON of a tool_execution frame.
|
|
775
|
+
*/
|
|
646
776
|
const STATUS_GLYPH = {
|
|
647
777
|
pending: "○",
|
|
648
778
|
in_progress: "◐",
|
|
@@ -714,6 +844,7 @@ function taskView(value) {
|
|
|
714
844
|
if (isRecord(value.delegation)) {
|
|
715
845
|
task.delegation = {};
|
|
716
846
|
if (typeof value.delegation.agent === "string") task.delegation.agent = value.delegation.agent;
|
|
847
|
+
if (typeof value.delegation.identity === "string") task.delegation.identity = value.delegation.identity;
|
|
717
848
|
if (typeof value.delegation.state === "string") task.delegation.state = value.delegation.state;
|
|
718
849
|
}
|
|
719
850
|
return task;
|
|
@@ -804,7 +935,8 @@ function taskRow(task) {
|
|
|
804
935
|
closed: task.status === "completed" || task.status === "deleted",
|
|
805
936
|
blockedBy: task.blockedBy ?? []
|
|
806
937
|
};
|
|
807
|
-
|
|
938
|
+
const agent = taskAgentName(task.delegation);
|
|
939
|
+
if (agent) row.agent = inlineText(agent);
|
|
808
940
|
if (task.status === "in_progress" && task.activeForm) row.activeForm = inlineText(task.activeForm);
|
|
809
941
|
return row;
|
|
810
942
|
}
|
|
@@ -935,23 +1067,17 @@ function taskResultView(input) {
|
|
|
935
1067
|
}
|
|
936
1068
|
//#endregion
|
|
937
1069
|
//#region src/extensions/workspaces/sessions/(frontend)/tool/_lib/TaskToolMessage.native.tsx
|
|
1070
|
+
/** One colour per row, on the dot only: jade while Po works on it, red only for a real failure. */
|
|
938
1071
|
const STATUS_DOT = {
|
|
939
1072
|
pending: "muted",
|
|
940
|
-
in_progress: "
|
|
941
|
-
completed: "
|
|
1073
|
+
in_progress: "green",
|
|
1074
|
+
completed: "neutral",
|
|
942
1075
|
failed: "red",
|
|
943
1076
|
deleted: "muted"
|
|
944
1077
|
};
|
|
945
1078
|
const CALL_INK = {
|
|
946
1079
|
dim: "hi",
|
|
947
|
-
accent: "
|
|
948
|
-
};
|
|
949
|
-
const STATUS_TONE = {
|
|
950
|
-
pending: "neutral",
|
|
951
|
-
in_progress: "running",
|
|
952
|
-
completed: "ok",
|
|
953
|
-
failed: "error",
|
|
954
|
-
deleted: "neutral"
|
|
1080
|
+
accent: "green"
|
|
955
1081
|
};
|
|
956
1082
|
const RESULT_TONE = {
|
|
957
1083
|
running: "running",
|
|
@@ -959,60 +1085,42 @@ const RESULT_TONE = {
|
|
|
959
1085
|
error: "error",
|
|
960
1086
|
warning: "running"
|
|
961
1087
|
};
|
|
962
|
-
|
|
963
|
-
if (row.closed) return "dim";
|
|
964
|
-
return row.status === "in_progress" ? "blue" : "hi";
|
|
965
|
-
}
|
|
966
|
-
/** One task row: status glyph, id, subject and chips on the left, the status label flushed right. */
|
|
1088
|
+
/** One task row: status dot, id and subject, with who is on it and what it waits for on a quiet line below. */
|
|
967
1089
|
function TaskRowLine({ row }) {
|
|
1090
|
+
const waits = row.blockedBy.length > 0 ? `waits for ${row.blockedBy.map((id) => `#${id}`).join(", ")}` : "";
|
|
1091
|
+
const meta = [
|
|
1092
|
+
row.agent,
|
|
1093
|
+
row.activeForm,
|
|
1094
|
+
waits
|
|
1095
|
+
].filter(Boolean).join(" · ");
|
|
968
1096
|
return /* @__PURE__ */ jsxs(View, {
|
|
969
1097
|
testID: "tool-result-task-row",
|
|
1098
|
+
accessible: true,
|
|
1099
|
+
accessibilityLabel: `task #${row.id}, ${row.subject}, ${STATUS_LABEL[row.status]}`,
|
|
970
1100
|
style: styles.row,
|
|
971
|
-
children: [
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
children: ["#", row.id]
|
|
979
|
-
}),
|
|
980
|
-
/* @__PURE__ */ jsxs(Text, {
|
|
1101
|
+
children: [/* @__PURE__ */ jsx(Dot, {
|
|
1102
|
+
tone: STATUS_DOT[row.status],
|
|
1103
|
+
pulse: row.status === "in_progress",
|
|
1104
|
+
style: styles.dot
|
|
1105
|
+
}), /* @__PURE__ */ jsxs(View, {
|
|
1106
|
+
style: styles.rowText,
|
|
1107
|
+
children: [/* @__PURE__ */ jsxs(Text, {
|
|
981
1108
|
numberOfLines: 1,
|
|
982
|
-
style: [
|
|
983
|
-
|
|
984
|
-
styles.
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
row.activeForm ? /* @__PURE__ */ jsxs(Text, {
|
|
998
|
-
style: styles.meta,
|
|
999
|
-
children: [
|
|
1000
|
-
" (",
|
|
1001
|
-
row.activeForm,
|
|
1002
|
-
")"
|
|
1003
|
-
]
|
|
1004
|
-
}) : null,
|
|
1005
|
-
row.blockedBy.length > 0 ? /* @__PURE__ */ jsxs(Text, {
|
|
1006
|
-
style: styles.meta,
|
|
1007
|
-
children: [" ⛓ ", row.blockedBy.map((id) => `#${id}`).join(",")]
|
|
1008
|
-
}) : null
|
|
1009
|
-
]
|
|
1010
|
-
}),
|
|
1011
|
-
/* @__PURE__ */ jsx(StatusBadge, {
|
|
1012
|
-
tone: STATUS_TONE[row.status],
|
|
1013
|
-
children: STATUS_LABEL[row.status]
|
|
1014
|
-
})
|
|
1015
|
-
]
|
|
1109
|
+
style: [styles.rowSubject, styles.ink(row.closed ? "dim" : "hi")],
|
|
1110
|
+
children: [/* @__PURE__ */ jsxs(Text, {
|
|
1111
|
+
style: styles.meta,
|
|
1112
|
+
children: [
|
|
1113
|
+
"#",
|
|
1114
|
+
row.id,
|
|
1115
|
+
" "
|
|
1116
|
+
]
|
|
1117
|
+
}), row.subject]
|
|
1118
|
+
}), meta ? /* @__PURE__ */ jsx(Text, {
|
|
1119
|
+
numberOfLines: 1,
|
|
1120
|
+
style: styles.meta,
|
|
1121
|
+
children: meta
|
|
1122
|
+
}) : null]
|
|
1123
|
+
})]
|
|
1016
1124
|
});
|
|
1017
1125
|
}
|
|
1018
1126
|
/**
|
|
@@ -1119,30 +1227,27 @@ const styles = StyleSheet.create((theme) => ({
|
|
|
1119
1227
|
},
|
|
1120
1228
|
row: {
|
|
1121
1229
|
flexDirection: "row",
|
|
1122
|
-
alignItems: "
|
|
1230
|
+
alignItems: "flex-start",
|
|
1123
1231
|
gap: theme.spacing(2),
|
|
1124
1232
|
uni__dependencies: [0]
|
|
1125
1233
|
},
|
|
1234
|
+
dot: {
|
|
1235
|
+
marginTop: theme.spacing(1.5),
|
|
1236
|
+
uni__dependencies: [0]
|
|
1237
|
+
},
|
|
1238
|
+
rowText: { flex: 1 },
|
|
1126
1239
|
rowSubject: {
|
|
1127
|
-
flex: 1,
|
|
1128
1240
|
fontSize: theme.fontSize.base,
|
|
1129
1241
|
lineHeight: theme.lineHeight.base,
|
|
1130
|
-
fontWeight: "
|
|
1242
|
+
fontWeight: "500",
|
|
1131
1243
|
uni__dependencies: [0]
|
|
1132
1244
|
},
|
|
1133
|
-
struck: { textDecorationLine: "line-through" },
|
|
1134
1245
|
meta: {
|
|
1135
1246
|
fontSize: theme.fontSize.sm,
|
|
1136
1247
|
lineHeight: theme.lineHeight.sm,
|
|
1137
1248
|
color: theme.colors.dim,
|
|
1138
1249
|
uni__dependencies: [0]
|
|
1139
1250
|
},
|
|
1140
|
-
statusGlyph: {
|
|
1141
|
-
fontSize: theme.fontSize.sm,
|
|
1142
|
-
lineHeight: theme.lineHeight.sm,
|
|
1143
|
-
fontWeight: "600",
|
|
1144
|
-
uni__dependencies: [0]
|
|
1145
|
-
},
|
|
1146
1251
|
ink: (token) => ({
|
|
1147
1252
|
color: theme.colors[token],
|
|
1148
1253
|
uni__dependencies: [0]
|