@kabmo-labs/kabmo 0.54.0 → 0.55.0
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/client/index.html +1 -1
- package/dist/client/index.js +445 -445
- package/dist/client/static/js/{Body-x5grdps8.js → Body-a4dwe3hh.js} +1 -1
- package/dist/client/static/js/{CsvGrid-248v9yzf.js → CsvGrid-ppj80brw.js} +1 -1
- package/dist/client/static/js/{DocxView-5we92k2h.js → DocxView-ef0bd2pg.js} +1 -1
- package/dist/client/static/js/{DrawioView-c6xmw4qq.js → DrawioView-44tpkzbd.js} +1 -1
- package/dist/client/static/js/{HtmlPreview-r3qxgqg6.js → HtmlPreview-w654aykz.js} +1 -1
- package/dist/client/static/js/{ImageView-cr4fea18.js → ImageView-kg0skt5s.js} +1 -1
- package/dist/client/static/js/{LayoutWrapper-j12z0djx.js → LayoutWrapper-qepkrtd8.js} +1 -1
- package/dist/client/static/js/MergeDiffView-n2h8vv0j.js +1 -0
- package/dist/client/static/js/{Modal-cqceypcn.js → Modal-8d299emm.js} +16 -16
- package/dist/client/static/js/{PdfView-xdgn31cm.js → PdfView-eq7fnqa2.js} +1 -1
- package/dist/client/static/js/{SessionsView-ms6z44e2.js → SessionsView-tedh2es3.js} +1 -1
- package/dist/client/static/js/{SheetView-peqm9vft.js → SheetView-5xm33kgk.js} +1 -1
- package/dist/client/static/js/{SvgPreview-rdf4wbzr.js → SvgPreview-tp1m8r4t.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-48z2x5vg.js → abnfDiagram-O67JEVCF-xppr9jf1.js} +1 -1
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-n1pr5s6j.js → architectureDiagram-NJMV4G6O-s23e6vtk.js} +1 -1
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-p19shaft.js → blockDiagram-BEXU5L5S-7ws8yq9e.js} +1 -1
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-qcd46ts2.js → c4Diagram-YGBWAQC7-517yhfzj.js} +1 -1
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-scyhe133.js → classDiagram-v2-NBCMYWYE-tcad3rst.js} +1 -1
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-srnnj3f7.js → cose-bilkent-JH36ORCC-a76vf82p.js} +1 -1
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-1zfrnyay.js → cynefinDiagram-VND7K2PF-9kety453.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-hepk25pz.js → dagre-6A5THRUB-6g6gsp6b.js} +1 -1
- package/dist/client/static/js/{diagram-22UHCM2B-wy2y0323.js → diagram-22UHCM2B-ngj4fyg3.js} +1 -1
- package/dist/client/static/js/{diagram-3UASUU5V-j904f93p.js → diagram-3UASUU5V-xw2m99qa.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-2mmxccm2.js → diagram-ATOU4E4O-hz3bd083.js} +1 -1
- package/dist/client/static/js/{diagram-CDSNMT55-cfhk73ty.js → diagram-CDSNMT55-vfhtemve.js} +1 -1
- package/dist/client/static/js/{diagram-MLGK6HIB-ryf8j6hf.js → diagram-MLGK6HIB-22cjvj5g.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-8k5e36sd.js → diagram-MPIPVDR6-xv8fsecp.js} +1 -1
- package/dist/client/static/js/{dockerfile-1e7deann.js → dockerfile-491tyqmj.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-5kkbbbhv.js → ebnfDiagram-ZINNZB2B-m6mkn986.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-jqc4mzvc.js → elk-276RUBZZ-jccw706n.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-kx15t6f0.js → erDiagram-OPXOYQCR-rxk86jsf.js} +1 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-aegwx04w.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-3hv8pej4.js → ganttDiagram-FUAMR5RP-veweech7.js} +1 -1
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-a4mq8vwz.js → gitGraphDiagram-X574FWY7-7dyqcj8r.js} +1 -1
- package/dist/client/static/js/{index-1ye834yz.js → index-088gwjbz.js} +1 -1
- package/dist/client/static/js/{index-k4kwrze2.js → index-0ak5wdz1.js} +1 -1
- package/dist/client/static/js/{index-937bn0d2.js → index-0qmpqtp2.js} +1 -1
- package/dist/client/static/js/{index-40fdtqvw.js → index-0xh8402w.js} +1 -1
- package/dist/client/static/js/{index-0z7kerp1.js → index-2asa0faw.js} +1 -1
- package/dist/client/static/js/{index-w4dep7k6.js → index-2cfw7wem.js} +1 -1
- package/dist/client/static/js/{index-0j5ng1qc.js → index-39mr4tym.js} +1 -1
- package/dist/client/static/js/{index-kvker1ps.js → index-3x88fxzj.js} +1 -1
- package/dist/client/static/js/{index-8hnem33f.js → index-4m94cbms.js} +1 -1
- package/dist/client/static/js/{index-9gddw5qy.js → index-5701gj1f.js} +1 -1
- package/dist/client/static/js/{index-m85c740p.js → index-60fjqzdw.js} +1 -1
- package/dist/client/static/js/{index-exyg9sna.js → index-637my5h0.js} +1 -1
- package/dist/client/static/js/{index-jvn2xfpt.js → index-7ckzdf4r.js} +153 -151
- package/dist/client/static/js/{index-317v49ey.js → index-7ehep28z.js} +1 -1
- package/dist/client/static/js/{index-br27jz2t.js → index-bfy437re.js} +1 -1
- package/dist/client/static/js/{index-vxe4e903.js → index-bhst1c2x.js} +1 -1
- package/dist/client/static/js/{index-9cr6p86f.js → index-cz80n8yc.js} +1 -1
- package/dist/client/static/js/{index-demg0p74.js → index-d9dz0wt0.js} +1 -1
- package/dist/client/static/js/{index-51wzt3ma.js → index-dg714jam.js} +1 -1
- package/dist/client/static/js/{index-n3cts2j1.js → index-e6tjaccf.js} +1 -1
- package/dist/client/static/js/{index-eb43hnd3.js → index-gsw1zh30.js} +1 -1
- package/dist/client/static/js/{index-3kenmzbe.js → index-j0qt8gaj.js} +1 -1
- package/dist/client/static/js/{index-pszsxhjr.js → index-kfcpkx7h.js} +1 -1
- package/dist/client/static/js/{index-v90zd3sq.js → index-na95tr1k.js} +1 -1
- package/dist/client/static/js/{index-g3x4w48f.js → index-nzjc24v9.js} +1 -1
- package/dist/client/static/js/{index-n5194pe6.js → index-pqmvhqmj.js} +2 -2
- package/dist/client/static/js/{index-e2y4hkps.js → index-r51fqzb5.js} +1 -1
- package/dist/client/static/js/{index-40ydm28n.js → index-sx5x2q80.js} +1 -1
- package/dist/client/static/js/{index-p8bta9ae.js → index-tk1vr8q2.js} +1 -1
- package/dist/client/static/js/{index-x5c5yxhj.js → index-trpn9gxs.js} +1 -1
- package/dist/client/static/js/{index-01rdknec.js → index-twjq786a.js} +1 -1
- package/dist/client/static/js/{index-fanhvjk8.js → index-wa234c7k.js} +1 -1
- package/dist/client/static/js/{index-rtfw07hy.js → index-wp7tsava.js} +1 -1
- package/dist/client/static/js/{index-kz5d00m5.js → index-wvqwzgpx.js} +1 -1
- package/dist/client/static/js/{index-xhcbaaga.js → index-xbvjpa60.js} +2 -2
- package/dist/client/static/js/{index-n4pm0hrh.js → index-xm3691yp.js} +1 -1
- package/dist/client/static/js/{index-kevqayd9.js → index-xq78fj64.js} +1 -1
- package/dist/client/static/js/{index-bf54x0w8.js → index-zjc8yfbe.js} +1 -1
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-wtnqb06v.js → infoDiagram-VRGFBTTK-ksz9cvq3.js} +1 -1
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-eta0jnvr.js → ishikawaDiagram-OU5B5YK6-g8symmrp.js} +1 -1
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-4e572kkp.js → journeyDiagram-ZHPQQLJL-qs2e3hdf.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-yrtnn4zy.js → kanban-definition-PNTS6WVX-pzef80sz.js} +1 -1
- package/dist/client/static/js/{mermaid.core-195b0fb6.js → mermaid.core-chfcvkkc.js} +2 -2
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-pphjnkvt.js → mindmap-definition-NLK3R4M7-sds2e243.js} +1 -1
- package/dist/client/static/js/one-dark-pro-5fvhpb1t.js +1 -0
- package/dist/client/static/js/one-light-pwj40vbr.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-kgffb9p3.js → pegDiagram-GJSIUBJH-m8199cy0.js} +1 -1
- package/dist/client/static/js/{pieDiagram-5QR66LMP-efech3mm.js → pieDiagram-5QR66LMP-wqz5k5w6.js} +1 -1
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-khf9cv3t.js → quadrantDiagram-O4NWA36T-rjszd8an.js} +1 -1
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-ye68kdx2.js → railroadDiagram-XR7U4H2S-qv0be7dh.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-3s4smnme.js → requirementDiagram-PLB6GJNP-b87kqbr7.js} +1 -1
- package/dist/client/static/js/{rust-tdrnaxp3.js → rust-m7ma3tq9.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-9pqd25mc.js → sankeyDiagram-IPEJSGJF-dh5we479.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-rka8ct43.js → sequenceDiagram-PO4LG4MO-e6fg0x45.js} +1 -1
- package/dist/client/static/js/{sizeCapture-INFHLROL-g5wkzry8.js → sizeCapture-INFHLROL-mam6cagq.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-gy1zab2j.js → stateDiagram-v2-GCMORJYK-htwar22v.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-kr35nmd2.js → swimlanes-2SLR337P-5g26cnkr.js} +1 -1
- package/dist/client/static/js/{swimlanesDiagram-TC7HE7FX-qnhxxmjr.js → swimlanesDiagram-TC7HE7FX-rseba3zs.js} +1 -1
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-sg151mkc.js → timeline-definition-EJHVYXUP-5km8n8mj.js} +1 -1
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-f91g61p3.js → usecaseDiagram-POWQR4AR-0vt6ms5g.js} +1 -1
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-zbhr4eqf.js → vennDiagram-UO4OBE2U-k425105a.js} +1 -1
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-6302414n.js → wardleyDiagram-VNRHLVJA-s0gd4jg1.js} +1 -1
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-0a47th65.js → xychartDiagram-PMCCYNJV-2nrdzp7p.js} +1 -1
- package/package.json +5 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/index.tsx +2 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/AgentAdmin.test.tsx +67 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/AgentAdmin.tsx +89 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.test.tsx +91 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.tsx +8 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.test.ts +9 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.tsx +16 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/WebSearch.test.tsx +59 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/WebSearch.tsx +11 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/agent-admin-rows.test.ts +119 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/agent-admin-rows.ts +174 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/task-rows.ts +14 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.test.ts +22 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.ts +14 -0
- package/src/client/data/settings/omp-schema.json +445 -165
- package/src/server/routes/fs/raw.test.ts +33 -0
- package/src/server/routes/fs/raw.ts +31 -11
- package/src/shared/lib/chat/timeline/tool-phrases.test.ts +4 -0
- package/src/shared/lib/chat/timeline/tool-phrases.ts +2 -0
- package/src/shared/lib/models/provider/glyph.test.ts +13 -11
- package/src/shared/lib/models/provider/glyph.ts +1 -0
- package/src/shared/lib/models/provider/label.ts +3 -0
- package/src/shared/lib/omp/config/schema-releases-19-3.test.ts +64 -0
- package/src/shared/lib/omp/config/schema-releases.test.ts +6 -4
- package/src/shared/lib/omp/session/wait-idle.test.ts +12 -2
- package/src/shared/lib/omp/session/wait-idle.ts +11 -6
- package/dist/client/static/js/MergeDiffView-y0we0194.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-dpjz82p8.js +0 -1
- package/dist/client/static/js/one-dark-pro-asy2qj2p.js +0 -1
- package/dist/client/static/js/one-light-fya1pbbx.js +0 -1
package/src/client/components/workspace/chat-timeline/tool-renderers/panels/agent-admin-rows.ts
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The rows the agent-control panel draws, from the arguments of the tools that
|
|
8
|
+
* manage the agent itself.
|
|
9
|
+
*
|
|
10
|
+
* Measured on `agy acp` 1.5.3: `manage_task`, `manage_subagents`,
|
|
11
|
+
* `define_subagent`, `send_message`, `schedule` and `ask_question` arrive as
|
|
12
|
+
* `kind:"other"` with capitalised argument keys (`Action`, `Prompt`, `Role`, …)
|
|
13
|
+
* and NO result payload. They were left to the JSON fallback, which hid the one
|
|
14
|
+
* fact the call carries — its action and target — behind a raw document.
|
|
15
|
+
*
|
|
16
|
+
* The normalizer is pure so the panel is presentation only. It reads the
|
|
17
|
+
* adapter's spelling, never invents a field: a result the agent did not report
|
|
18
|
+
* is named as missing, and an unknown argument is printed under its own key.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import type { ToolCallData } from '@kabmo-labs/kabmo-chat/contracts/chat';
|
|
22
|
+
|
|
23
|
+
export interface AgentAdminField {
|
|
24
|
+
label: string;
|
|
25
|
+
value: string;
|
|
26
|
+
mono?: boolean;
|
|
27
|
+
block?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface AgentAdminQuestion {
|
|
31
|
+
question: string;
|
|
32
|
+
options: string[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface AgentAdminView {
|
|
36
|
+
/** The card's own noun ("Subagent", "Scheduled run", …). */
|
|
37
|
+
title: string;
|
|
38
|
+
/** The verb the call names (`list`, `kill`, `send_input`). */
|
|
39
|
+
action?: string;
|
|
40
|
+
questions: AgentAdminQuestion[];
|
|
41
|
+
fields: AgentAdminField[];
|
|
42
|
+
/** A sentence for a fact the adapter did not send (no result, no answer). */
|
|
43
|
+
note?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const TITLES: Readonly<Record<string, string>> = {
|
|
47
|
+
manage_task: 'Background task',
|
|
48
|
+
manage_subagents: 'Subagent',
|
|
49
|
+
define_subagent: 'Subagent definition',
|
|
50
|
+
send_message: 'Message',
|
|
51
|
+
schedule: 'Scheduled run',
|
|
52
|
+
ask_question: 'Question',
|
|
53
|
+
// opencode's spelling of the same control-plane verb.
|
|
54
|
+
question: 'Question',
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const LABELS: Readonly<Record<string, string>> = {
|
|
58
|
+
Name: 'Name',
|
|
59
|
+
Description: 'Description',
|
|
60
|
+
Recipient: 'Recipient',
|
|
61
|
+
TaskId: 'Task id',
|
|
62
|
+
ConversationIds: 'Conversation ids',
|
|
63
|
+
DurationSeconds: 'Duration',
|
|
64
|
+
Prompt: 'Prompt',
|
|
65
|
+
Message: 'Message',
|
|
66
|
+
SystemPrompt: 'System prompt',
|
|
67
|
+
Role: 'Role',
|
|
68
|
+
TypeName: 'Type',
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const BLOCK_KEYS: Readonly<Record<string, true>> = {
|
|
72
|
+
Description: true,
|
|
73
|
+
Prompt: true,
|
|
74
|
+
Message: true,
|
|
75
|
+
SystemPrompt: true,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const MONO_KEYS: Readonly<Record<string, true>> = {
|
|
79
|
+
Recipient: true,
|
|
80
|
+
TaskId: true,
|
|
81
|
+
ConversationIds: true,
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/** Identity before prose, so the card reads the same whatever order the
|
|
85
|
+
* adapter serialised its arguments in. */
|
|
86
|
+
const FIELD_ORDER: readonly string[] = [
|
|
87
|
+
'Name', 'Role', 'TypeName', 'Recipient', 'TaskId', 'ConversationIds',
|
|
88
|
+
'DurationSeconds', 'Description', 'Prompt', 'Message', 'SystemPrompt',
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
function asText(value: unknown): string {
|
|
92
|
+
if (typeof value === 'string') return value;
|
|
93
|
+
if (typeof value === 'number' || typeof value === 'boolean') return String(value);
|
|
94
|
+
if (Array.isArray(value)) return value.map((entry) => (typeof entry === 'string' ? entry : JSON.stringify(entry))).join('\n');
|
|
95
|
+
return JSON.stringify(value, null, 2) ?? '';
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function readQuestions(value: unknown): AgentAdminQuestion[] {
|
|
99
|
+
if (!Array.isArray(value)) return [];
|
|
100
|
+
const questions: AgentAdminQuestion[] = [];
|
|
101
|
+
for (const entry of value) {
|
|
102
|
+
if (!entry || typeof entry !== 'object') continue;
|
|
103
|
+
const record = entry as Record<string, unknown>;
|
|
104
|
+
const question = typeof record.question === 'string' ? record.question.trim() : '';
|
|
105
|
+
if (!question) continue;
|
|
106
|
+
const options = Array.isArray(record.options)
|
|
107
|
+
? record.options.flatMap((option) => {
|
|
108
|
+
if (typeof option === 'string') return option ? [option] : [];
|
|
109
|
+
if (!option || typeof option !== 'object') return [];
|
|
110
|
+
const label = (option as Record<string, unknown>).label;
|
|
111
|
+
return typeof label === 'string' && label ? [label] : [];
|
|
112
|
+
})
|
|
113
|
+
: [];
|
|
114
|
+
questions.push({ question, options });
|
|
115
|
+
}
|
|
116
|
+
return questions;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function humanKey(key: string): string {
|
|
120
|
+
return LABELS[key] ?? key.replace(/([a-z0-9])([A-Z])/g, '$1 $2').replace(/_/g, ' ');
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function agentAdminView(tool: ToolCallData): AgentAdminView {
|
|
124
|
+
const input = tool.input && typeof tool.input === 'object' && !Array.isArray(tool.input)
|
|
125
|
+
? (tool.input as Record<string, unknown>)
|
|
126
|
+
: {};
|
|
127
|
+
const name = (tool.name ?? tool.type ?? '').toLowerCase();
|
|
128
|
+
const action = typeof input.Action === 'string' && input.Action ? input.Action : undefined;
|
|
129
|
+
const questions = readQuestions(input.questions);
|
|
130
|
+
const collected: Array<{ key: string; field: AgentAdminField }> = [];
|
|
131
|
+
|
|
132
|
+
for (const [key, value] of Object.entries(input)) {
|
|
133
|
+
if (key === 'Action' || key === 'questions') continue;
|
|
134
|
+
if (value === undefined || value === null || value === '') continue;
|
|
135
|
+
const duration = key === 'DurationSeconds' && typeof value === 'number'
|
|
136
|
+
? `${value} second${value === 1 ? '' : 's'}`
|
|
137
|
+
: undefined;
|
|
138
|
+
collected.push({
|
|
139
|
+
key,
|
|
140
|
+
field: {
|
|
141
|
+
label: humanKey(key),
|
|
142
|
+
value: duration ?? asText(value),
|
|
143
|
+
...(MONO_KEYS[key] ? { mono: true } : {}),
|
|
144
|
+
...(BLOCK_KEYS[key] ? { block: true } : {}),
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const rank = (key: string) => {
|
|
150
|
+
const index = FIELD_ORDER.indexOf(key);
|
|
151
|
+
return index === -1 ? FIELD_ORDER.length : index;
|
|
152
|
+
};
|
|
153
|
+
collected.sort((a, b) => rank(a.key) - rank(b.key));
|
|
154
|
+
const fields = collected.map((entry) => entry.field);
|
|
155
|
+
|
|
156
|
+
const settled = tool.status === 'success' || tool.status === 'error' || tool.status === 'aborted';
|
|
157
|
+
// A settled ask says nothing about an answer: the next user message IS the
|
|
158
|
+
// answer channel, so the card cannot know whether one arrived.
|
|
159
|
+
const note = name === 'ask_question' || name === 'question'
|
|
160
|
+
? settled
|
|
161
|
+
? undefined
|
|
162
|
+
: 'The agent waits for your next message as the answer.'
|
|
163
|
+
: settled && !tool.output
|
|
164
|
+
? 'The agent did not report a result for this call.'
|
|
165
|
+
: undefined;
|
|
166
|
+
|
|
167
|
+
return {
|
|
168
|
+
title: TITLES[name] ?? 'Agent call',
|
|
169
|
+
...(action ? { action } : {}),
|
|
170
|
+
questions,
|
|
171
|
+
fields,
|
|
172
|
+
...(note ? { note } : {}),
|
|
173
|
+
};
|
|
174
|
+
}
|
|
@@ -31,13 +31,25 @@ export function acpDelegationRow(
|
|
|
31
31
|
): TaskRowShape | null {
|
|
32
32
|
if (!input) return null;
|
|
33
33
|
const description = typeof input.description === 'string' ? input.description.trim() : '';
|
|
34
|
-
|
|
34
|
+
// antigravity's `invoke_subagent` reports `Prompt`/`Role`/`TypeName` (capital
|
|
35
|
+
// letters). Reading only the lowercase spellings left `acpRow` null, so the
|
|
36
|
+
// panel returned null and the delegation card rendered EMPTY.
|
|
37
|
+
const prompt =
|
|
38
|
+
typeof input.prompt === 'string' && input.prompt.trim()
|
|
39
|
+
? input.prompt.trim()
|
|
40
|
+
: typeof input.Prompt === 'string' && input.Prompt.trim()
|
|
41
|
+
? input.Prompt.trim()
|
|
42
|
+
: '';
|
|
35
43
|
const subagent =
|
|
36
44
|
typeof input.subagent_type === 'string' && input.subagent_type.trim()
|
|
37
45
|
? input.subagent_type.trim()
|
|
38
46
|
: typeof input.agent === 'string' && input.agent.trim()
|
|
39
47
|
? input.agent.trim()
|
|
40
|
-
: ''
|
|
48
|
+
: typeof input.Role === 'string' && input.Role.trim()
|
|
49
|
+
? input.Role.trim()
|
|
50
|
+
: typeof input.TypeName === 'string' && input.TypeName.trim()
|
|
51
|
+
? input.TypeName.trim()
|
|
52
|
+
: '';
|
|
41
53
|
const wrapped = input._toolName === 'task';
|
|
42
54
|
const task = description || prompt;
|
|
43
55
|
if (!task && !wrapped && !subagent) return null;
|
package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.test.ts
CHANGED
|
@@ -55,6 +55,28 @@ describe('toolCardHeader — device calls', () => {
|
|
|
55
55
|
});
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
+
describe('toolCardHeader — shell', () => {
|
|
59
|
+
test('an adapter that reports the command as the title does not title-case it', () => {
|
|
60
|
+
// opencode 2.2.5 sends `title: "pwd && ls -la"`; the generic rule produced
|
|
61
|
+
// `Pwd && Ls La`. The family names the card and the command is the detail.
|
|
62
|
+
expect(header({
|
|
63
|
+
type: 'tool',
|
|
64
|
+
name: 'shell',
|
|
65
|
+
title: 'pwd && ls -la',
|
|
66
|
+
input: { command: 'pwd && ls -la', workdir: '/tmp/x' },
|
|
67
|
+
})).toEqual({ title: 'Bash', subtitle: 'pwd && ls -la' });
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
test('a multi-line command keeps only its first line in the header', () => {
|
|
71
|
+
expect(header({
|
|
72
|
+
type: 'bash',
|
|
73
|
+
name: 'bash',
|
|
74
|
+
title: 'python3 - <<PY',
|
|
75
|
+
input: { command: 'python3 - <<PY\nprint(1)\nPY' },
|
|
76
|
+
})).toEqual({ title: 'Bash', subtitle: 'python3 - <<PY' });
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
|
|
58
80
|
describe('toolCardHeader — self-naming tools', () => {
|
|
59
81
|
test('an eval uses omp’s own label for the cell', () => {
|
|
60
82
|
expect(header({ type: 'eval', input: { title: 'open app and locate composer' } }))
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
import type { ToolCallData } from '@kabmo-labs/kabmo-chat/contracts/chat';
|
|
21
21
|
import { toTitleCase } from '@/shared/lib/chat/title-case';
|
|
22
|
+
import { isRecord } from '@kabmo-labs/kabmo-guards';
|
|
22
23
|
import { parseAskQuestions } from '@/shared/lib/chat/ask-questions';
|
|
23
24
|
import { procOpLabel, procPathOf, procViewOf } from '@kabmo-labs/kabmo-omp/proc/proc';
|
|
24
25
|
import { waitViewOf } from '@/shared/lib/omp/session/wait';
|
|
@@ -86,6 +87,19 @@ export function toolCardHeader(tool: ToolCallData, toolKey: string): ToolCardHea
|
|
|
86
87
|
return { title: toolKey === 'resolve' ? 'Resolve Proposal' : 'Reject Proposal' };
|
|
87
88
|
}
|
|
88
89
|
|
|
90
|
+
// ── shell: the command is the identity, never a title to capitalize ───────
|
|
91
|
+
// opencode reports the command as the tool title (`pwd && ls -la`), and the
|
|
92
|
+
// generic rule title-cased it into `Pwd && Ls La`. The body already draws
|
|
93
|
+
// the command; the header names the family and repeats the first line so a
|
|
94
|
+
// collapsed card still says what ran.
|
|
95
|
+
if (toolKey === 'bash') {
|
|
96
|
+
const input = isRecord(tool.input) ? tool.input : undefined;
|
|
97
|
+
const command = typeof input?.command === 'string'
|
|
98
|
+
? input.command.split('\n')[0]
|
|
99
|
+
: undefined;
|
|
100
|
+
if (command) return { title: 'Bash', subtitle: clip(command) };
|
|
101
|
+
}
|
|
102
|
+
|
|
89
103
|
// ── todo / ask ────────────────────────────────────────────────────────────
|
|
90
104
|
// A todo's progress is a FACT, not a title line: `toolSummary` derives it from
|
|
91
105
|
// `details.phases` — the same source the Todo panel reads — so it renders as a
|