@stigmer/ink 3.12.2 → 3.12.4
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/components/ApprovalPrompt.d.ts.map +1 -1
- package/components/ApprovalPrompt.js +6 -1
- package/components/ApprovalPrompt.js.map +1 -1
- package/components/ToolCallItem.d.ts.map +1 -1
- package/components/ToolCallItem.js +11 -4
- package/components/ToolCallItem.js.map +1 -1
- package/package.json +4 -4
- package/src/__tests__/components.test.tsx +75 -0
- package/src/components/ApprovalPrompt.tsx +17 -0
- package/src/components/ToolCallItem.tsx +21 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApprovalPrompt.d.ts","sourceRoot":"","sources":["../../src/components/ApprovalPrompt.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kEAAkE,CAAC;AACxG,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;
|
|
1
|
+
{"version":3,"file":"ApprovalPrompt.d.ts","sourceRoot":"","sources":["../../src/components/ApprovalPrompt.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kEAAkE,CAAC;AACxG,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAQ9F,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC,8CAA8C;IAC9C,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,8CAA8C;IAC9C,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IACpD,gEAAgE;IAChE,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAuCD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,EAC7B,eAAe,EACf,QAAQ,EACR,YAAoB,EACpB,QAAe,GAChB,EAAE,mBAAmB,2CA0JrB"}
|
|
@@ -3,6 +3,7 @@ import { useMemo, useState } from "react";
|
|
|
3
3
|
import { Box, Text, useInput } from "ink";
|
|
4
4
|
import { ApprovalAction } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
5
5
|
import { ToolKind, resolveToolKindByName, describeApprovalPolicySource, } from "@stigmer/sdk";
|
|
6
|
+
import { extractShellIntentFromPreview } from "@stigmer/react";
|
|
6
7
|
/**
|
|
7
8
|
* Builds the truthful APPROVE_ALL option label for a pending approval's lease
|
|
8
9
|
* class — the terminal mirror of the React card's buildApproveAllLabel.
|
|
@@ -95,7 +96,11 @@ export function ApprovalPrompt({ pendingApproval, onSubmit, isSubmitting = false
|
|
|
95
96
|
// PendingApproval. Mirrors the React card's gate-reason line so the terminal
|
|
96
97
|
// surface explains the gate at parity. Empty for legacy executions.
|
|
97
98
|
const gateReason = describeApprovalPolicySource(pendingApproval.approvalPolicySource);
|
|
98
|
-
|
|
99
|
+
// Model-authored shell intent (stigmer#276), mirroring the React card's
|
|
100
|
+
// header treatment: supplementary context only — the command in the Args
|
|
101
|
+
// line stays foregrounded, because it is the content being approved.
|
|
102
|
+
const intent = extractShellIntentFromPreview(pendingApproval.toolName, pendingApproval.argsPreview, pendingApproval.mcpServerSlug, pendingApproval.toolKind);
|
|
103
|
+
return (_jsxs(Box, { flexDirection: "column", paddingLeft: 2, paddingTop: 1, paddingBottom: 1, borderStyle: "round", borderColor: "yellow", children: [_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: "yellow", bold: true, children: "\u26A0 Approval required" }), pendingApproval.fromSubAgent && (_jsxs(Text, { dimColor: true, children: ["via ", pendingApproval.subAgentSubject || pendingApproval.subAgentName] }))] }), _jsxs(Box, { paddingLeft: 2, marginTop: 1, flexDirection: "column", children: [_jsxs(Box, { gap: 1, children: [_jsx(Text, { dimColor: true, children: "Tool:" }), _jsx(Text, { bold: true, children: toolLabel })] }), intent && (_jsxs(Box, { gap: 1, children: [_jsx(Text, { dimColor: true, children: "Intent:" }), _jsx(Text, { wrap: "truncate-end", children: intent })] })), pendingApproval.argsPreview && (_jsxs(Box, { gap: 1, children: [_jsx(Text, { dimColor: true, children: "Args:" }), _jsx(Text, { wrap: "truncate-end", children: pendingApproval.argsPreview })] })), gateReason && (_jsxs(Box, { gap: 1, children: [_jsx(Text, { dimColor: true, children: "Why:" }), _jsx(Text, { dimColor: true, italic: true, children: gateReason })] }))] }), _jsx(Box, { gap: 2, marginTop: 1, paddingLeft: 2, children: options.map((opt, idx) => {
|
|
99
104
|
// When inactive, no option is selected and all read dim — the active
|
|
100
105
|
// prompt's highlight (vs. these dimmed rows) is the cue for which
|
|
101
106
|
// approval owns the keyboard, so no per-prompt hint is needed.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApprovalPrompt.js","sourceRoot":"","sources":["../../src/components/ApprovalPrompt.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAC9F,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ApprovalPrompt.js","sourceRoot":"","sources":["../../src/components/ApprovalPrompt.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAC9F,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,cAAc,CAAC;AACtB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}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolCallItem.d.ts","sourceRoot":"","sources":["../../src/components/ToolCallItem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iEAAiE,CAAC;
|
|
1
|
+
{"version":3,"file":"ToolCallItem.d.ts","sourceRoot":"","sources":["../../src/components/ToolCallItem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iEAAiE,CAAC;AAehG,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC,+BAA+B;IAC/B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAuCD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,QAAgB,EAAE,EAAE,iBAAiB,2CA0D7E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Text } from "ink";
|
|
3
3
|
import { ToolCallStatus } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
4
|
-
import { ToolKind, resolveToolKind, normalizeToolResult } from "@stigmer/sdk";
|
|
4
|
+
import { ToolKind, resolveToolKind, normalizeToolResult, extractShellIntent, } from "@stigmer/sdk";
|
|
5
5
|
import { extractPrimaryArg, useFileReviewRowState, } from "@stigmer/react";
|
|
6
6
|
const STATUS_INDICATOR = {
|
|
7
7
|
[ToolCallStatus.TOOL_CALL_RUNNING]: { symbol: "⠋", color: "yellow" },
|
|
@@ -12,8 +12,9 @@ const STATUS_INDICATOR = {
|
|
|
12
12
|
[ToolCallStatus.TOOL_CALL_INTERRUPTED]: { symbol: "⊘", color: "gray" },
|
|
13
13
|
};
|
|
14
14
|
// Harness-agnostic labels per kind. Classification is shared with the runner,
|
|
15
|
-
// React, and the
|
|
16
|
-
// PascalCase tools render with the same labels as native tools
|
|
15
|
+
// React, and the CLI's headless renderers via @stigmer/sdk's resolveToolKind,
|
|
16
|
+
// so Cursor's PascalCase tools render with the same labels as native tools
|
|
17
|
+
// here.
|
|
17
18
|
const KIND_LABEL = {
|
|
18
19
|
[ToolKind.FILE_READ]: "Read",
|
|
19
20
|
[ToolKind.FILE_WRITE]: "Write",
|
|
@@ -46,6 +47,12 @@ export function ToolCallItem({ toolCall, expanded = false }) {
|
|
|
46
47
|
const indicator = STATUS_INDICATOR[toolCall.status] ?? { symbol: "○" };
|
|
47
48
|
const kind = resolveToolKind(toolCall);
|
|
48
49
|
const label = toolLabel(toolCall, kind);
|
|
50
|
+
// Model-authored intent titles the row when present (stigmer#276), with
|
|
51
|
+
// the command demoted to dim secondary text — same convention as the web
|
|
52
|
+
// console, extraction shared via @stigmer/sdk.
|
|
53
|
+
const intent = extractShellIntent(toolCall);
|
|
54
|
+
const title = intent ?? label;
|
|
55
|
+
const commandSubtitle = intent ? extractPrimaryArg(toolCall) : undefined;
|
|
49
56
|
const view = normalizeToolResult(toolCall);
|
|
50
57
|
const resultText = expanded ? describeResultView(view) : null;
|
|
51
58
|
// A flowed file edit stamped with its change set id badges the set's live
|
|
@@ -54,7 +61,7 @@ export function ToolCallItem({ toolCall, expanded = false }) {
|
|
|
54
61
|
// and honest-degradation cases (missing/capturing set, superseded edit).
|
|
55
62
|
const reviewState = useFileReviewRowState(toolCall.fileChangeSetId, extractPrimaryArg(toolCall));
|
|
56
63
|
const reviewBadge = reviewState ? REVIEW_BADGE[reviewState] : null;
|
|
57
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: indicator.color, children: indicator.symbol }), _jsx(Text, { children:
|
|
64
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: indicator.color, children: indicator.symbol }), _jsx(Text, { children: title }), commandSubtitle && (_jsx(Text, { dimColor: true, wrap: "truncate-end", children: commandSubtitle })), toolCall.status === ToolCallStatus.TOOL_CALL_RUNNING && (_jsx(Text, { dimColor: true, children: "running" })), reviewBadge && _jsx(Text, { color: reviewBadge.color, children: reviewBadge.label })] }), view.type === "error" ? (expanded && (_jsx(Box, { paddingLeft: 3, children: _jsx(Text, { color: "red", wrap: "truncate-end", children: view.message }) }))) : (resultText && (_jsx(Box, { paddingLeft: 3, children: _jsx(Text, { dimColor: true, wrap: "truncate-end", children: resultText }) })))] }));
|
|
58
65
|
}
|
|
59
66
|
function toolLabel(toolCall, kind) {
|
|
60
67
|
if (toolCall.mcpServerSlug) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolCallItem.js","sourceRoot":"","sources":["../../src/components/ToolCallItem.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAC9F,OAAO,
|
|
1
|
+
{"version":3,"file":"ToolCallItem.js","sourceRoot":"","sources":["../../src/components/ToolCallItem.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAC9F,OAAO,EACL,QAAQ,EACR,eAAe,EACf,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,GAEtB,MAAM,gBAAgB,CAAC;AAUxB,MAAM,gBAAgB,GAAuD;IAC3E,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE;IACpE,CAAC,cAAc,CAAC,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,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I;QAAE,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;IACpE,IAAI,CAAC,IAAI,IAAI;QAAE,OAAO,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;IACpD,OAAO,GAAG,CAAC,IAAI,CAAC;AAClB,CAAC;AAED,SAAS,QAAQ,CAAC,CAAS,EAAE,QAAQ,GAAG,CAAC;IACvC,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5B,IAAI,KAAK,CAAC,MAAM,IAAI,QAAQ;QAAE,OAAO,CAAC,CAAC;IACvC,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,UAAU,KAAK,CAAC,MAAM,GAAG,QAAQ,cAAc,CAAC;AAC/F,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stigmer/ink",
|
|
3
|
-
"version": "3.12.
|
|
3
|
+
"version": "3.12.4",
|
|
4
4
|
"description": "Ink (React for terminals) components for rendering Stigmer agent sessions in the terminal",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@connectrpc/connect-node": "^2.1.1",
|
|
38
|
-
"@stigmer/react": "3.12.
|
|
38
|
+
"@stigmer/react": "3.12.4",
|
|
39
39
|
"ink-spinner": "^5.0.0",
|
|
40
40
|
"ink-text-input": "^6.0.0",
|
|
41
41
|
"marked": "^15.0.7",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@bufbuild/protobuf": "^2.0.0",
|
|
46
|
-
"@stigmer/protos": "3.12.
|
|
47
|
-
"@stigmer/sdk": "3.12.
|
|
46
|
+
"@stigmer/protos": "3.12.4",
|
|
47
|
+
"@stigmer/sdk": "3.12.4",
|
|
48
48
|
"ink": "^7.0.0",
|
|
49
49
|
"react": ">=19.0.0"
|
|
50
50
|
}
|
|
@@ -166,6 +166,49 @@ describe("ToolCallItem", () => {
|
|
|
166
166
|
expect(output).not.toContain("✓");
|
|
167
167
|
});
|
|
168
168
|
|
|
169
|
+
it("titles a shell row with the model-authored intent, command as dim secondary (stigmer#276)", () => {
|
|
170
|
+
const tc = create(ToolCallSchema);
|
|
171
|
+
tc.id = "tc-intent";
|
|
172
|
+
tc.name = "execute";
|
|
173
|
+
tc.status = ToolCallStatus.TOOL_CALL_COMPLETED;
|
|
174
|
+
tc.args = {
|
|
175
|
+
command: "npx vitest run src/parser",
|
|
176
|
+
description: "Run unit tests for the parser",
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const { lastFrame } = render(<ToolCallItem toolCall={tc} />);
|
|
180
|
+
const output = lastFrame() ?? "";
|
|
181
|
+
expect(output).toContain("Run unit tests for the parser");
|
|
182
|
+
expect(output).toContain("npx vitest run src/parser");
|
|
183
|
+
// The intent replaces the category label as the title.
|
|
184
|
+
expect(output).not.toContain("Shell");
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
it("falls back to the category label when no intent is present", () => {
|
|
188
|
+
const tc = create(ToolCallSchema);
|
|
189
|
+
tc.id = "tc-no-intent";
|
|
190
|
+
tc.name = "execute";
|
|
191
|
+
tc.status = ToolCallStatus.TOOL_CALL_COMPLETED;
|
|
192
|
+
tc.args = { command: "ls" };
|
|
193
|
+
|
|
194
|
+
const { lastFrame } = render(<ToolCallItem toolCall={tc} />);
|
|
195
|
+
const output = lastFrame() ?? "";
|
|
196
|
+
expect(output).toContain("Shell");
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
it("never titles a non-shell row from its description arg", () => {
|
|
200
|
+
const tc = create(ToolCallSchema);
|
|
201
|
+
tc.id = "tc-task";
|
|
202
|
+
tc.name = "task";
|
|
203
|
+
tc.status = ToolCallStatus.TOOL_CALL_COMPLETED;
|
|
204
|
+
tc.args = { description: "general-purpose research", prompt: "Find the docs" };
|
|
205
|
+
|
|
206
|
+
const { lastFrame } = render(<ToolCallItem toolCall={tc} />);
|
|
207
|
+
const output = lastFrame() ?? "";
|
|
208
|
+
// A task tool's description is the sub-agent subject, never a row title.
|
|
209
|
+
expect(output).toContain("Sub-agent");
|
|
210
|
+
});
|
|
211
|
+
|
|
169
212
|
it("shows MCP server slug prefix", () => {
|
|
170
213
|
const tc = create(ToolCallSchema);
|
|
171
214
|
tc.id = "tc-4";
|
|
@@ -196,6 +239,38 @@ describe("ApprovalPrompt", () => {
|
|
|
196
239
|
expect(output).toContain("[s] Skip");
|
|
197
240
|
});
|
|
198
241
|
|
|
242
|
+
it("renders the shell intent as supplementary context, args foregrounded (stigmer#276)", () => {
|
|
243
|
+
const pending = create(PendingApprovalSchema);
|
|
244
|
+
pending.toolCallId = "tc-1";
|
|
245
|
+
pending.toolName = "execute";
|
|
246
|
+
pending.argsPreview = JSON.stringify({
|
|
247
|
+
command: "make deploy",
|
|
248
|
+
description: "Deploy the staging build",
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
const { lastFrame } = render(
|
|
252
|
+
<ApprovalPrompt pendingApproval={pending} onSubmit={() => {}} />,
|
|
253
|
+
);
|
|
254
|
+
const output = lastFrame() ?? "";
|
|
255
|
+
expect(output).toContain("Intent:");
|
|
256
|
+
expect(output).toContain("Deploy the staging build");
|
|
257
|
+
// The command being approved stays visible in the Args line.
|
|
258
|
+
expect(output).toContain("make deploy");
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
it("renders no intent line when the shell call carries none", () => {
|
|
262
|
+
const pending = create(PendingApprovalSchema);
|
|
263
|
+
pending.toolCallId = "tc-1";
|
|
264
|
+
pending.toolName = "execute";
|
|
265
|
+
pending.argsPreview = JSON.stringify({ command: "ls" });
|
|
266
|
+
|
|
267
|
+
const { lastFrame } = render(
|
|
268
|
+
<ApprovalPrompt pendingApproval={pending} onSubmit={() => {}} />,
|
|
269
|
+
);
|
|
270
|
+
const output = lastFrame() ?? "";
|
|
271
|
+
expect(output).not.toContain("Intent:");
|
|
272
|
+
});
|
|
273
|
+
|
|
199
274
|
it("renders the why-gated line from the projected approval_policy_source", () => {
|
|
200
275
|
const pending = create(PendingApprovalSchema);
|
|
201
276
|
pending.toolCallId = "tc-1";
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
resolveToolKindByName,
|
|
8
8
|
describeApprovalPolicySource,
|
|
9
9
|
} from "@stigmer/sdk";
|
|
10
|
+
import { extractShellIntentFromPreview } from "@stigmer/react";
|
|
10
11
|
|
|
11
12
|
/** Props for {@link ApprovalPrompt}. */
|
|
12
13
|
export interface ApprovalPromptProps {
|
|
@@ -155,6 +156,16 @@ export function ApprovalPrompt({
|
|
|
155
156
|
pendingApproval.approvalPolicySource,
|
|
156
157
|
);
|
|
157
158
|
|
|
159
|
+
// Model-authored shell intent (stigmer#276), mirroring the React card's
|
|
160
|
+
// header treatment: supplementary context only — the command in the Args
|
|
161
|
+
// line stays foregrounded, because it is the content being approved.
|
|
162
|
+
const intent = extractShellIntentFromPreview(
|
|
163
|
+
pendingApproval.toolName,
|
|
164
|
+
pendingApproval.argsPreview,
|
|
165
|
+
pendingApproval.mcpServerSlug,
|
|
166
|
+
pendingApproval.toolKind,
|
|
167
|
+
);
|
|
168
|
+
|
|
158
169
|
return (
|
|
159
170
|
<Box
|
|
160
171
|
flexDirection="column"
|
|
@@ -180,6 +191,12 @@ export function ApprovalPrompt({
|
|
|
180
191
|
<Text dimColor>Tool:</Text>
|
|
181
192
|
<Text bold>{toolLabel}</Text>
|
|
182
193
|
</Box>
|
|
194
|
+
{intent && (
|
|
195
|
+
<Box gap={1}>
|
|
196
|
+
<Text dimColor>Intent:</Text>
|
|
197
|
+
<Text wrap="truncate-end">{intent}</Text>
|
|
198
|
+
</Box>
|
|
199
|
+
)}
|
|
183
200
|
{pendingApproval.argsPreview && (
|
|
184
201
|
<Box gap={1}>
|
|
185
202
|
<Text dimColor>Args:</Text>
|
|
@@ -2,7 +2,12 @@ import React from "react";
|
|
|
2
2
|
import { Box, Text } from "ink";
|
|
3
3
|
import type { ToolCall } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/message_pb";
|
|
4
4
|
import { ToolCallStatus } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
ToolKind,
|
|
7
|
+
resolveToolKind,
|
|
8
|
+
normalizeToolResult,
|
|
9
|
+
extractShellIntent,
|
|
10
|
+
} from "@stigmer/sdk";
|
|
6
11
|
import type { ToolResultView } from "@stigmer/sdk";
|
|
7
12
|
import {
|
|
8
13
|
extractPrimaryArg,
|
|
@@ -28,8 +33,9 @@ const STATUS_INDICATOR: Record<number, { symbol: string; color?: string }> = {
|
|
|
28
33
|
};
|
|
29
34
|
|
|
30
35
|
// Harness-agnostic labels per kind. Classification is shared with the runner,
|
|
31
|
-
// React, and the
|
|
32
|
-
// PascalCase tools render with the same labels as native tools
|
|
36
|
+
// React, and the CLI's headless renderers via @stigmer/sdk's resolveToolKind,
|
|
37
|
+
// so Cursor's PascalCase tools render with the same labels as native tools
|
|
38
|
+
// here.
|
|
33
39
|
const KIND_LABEL: Partial<Record<ToolKind, string>> = {
|
|
34
40
|
[ToolKind.FILE_READ]: "Read",
|
|
35
41
|
[ToolKind.FILE_WRITE]: "Write",
|
|
@@ -65,6 +71,12 @@ export function ToolCallItem({ toolCall, expanded = false }: ToolCallItemProps)
|
|
|
65
71
|
|
|
66
72
|
const kind = resolveToolKind(toolCall);
|
|
67
73
|
const label = toolLabel(toolCall, kind);
|
|
74
|
+
// Model-authored intent titles the row when present (stigmer#276), with
|
|
75
|
+
// the command demoted to dim secondary text — same convention as the web
|
|
76
|
+
// console, extraction shared via @stigmer/sdk.
|
|
77
|
+
const intent = extractShellIntent(toolCall);
|
|
78
|
+
const title = intent ?? label;
|
|
79
|
+
const commandSubtitle = intent ? extractPrimaryArg(toolCall) : undefined;
|
|
68
80
|
const view = normalizeToolResult(toolCall);
|
|
69
81
|
const resultText = expanded ? describeResultView(view) : null;
|
|
70
82
|
|
|
@@ -82,7 +94,12 @@ export function ToolCallItem({ toolCall, expanded = false }: ToolCallItemProps)
|
|
|
82
94
|
<Box flexDirection="column">
|
|
83
95
|
<Box gap={1}>
|
|
84
96
|
<Text color={indicator.color}>{indicator.symbol}</Text>
|
|
85
|
-
<Text>{
|
|
97
|
+
<Text>{title}</Text>
|
|
98
|
+
{commandSubtitle && (
|
|
99
|
+
<Text dimColor wrap="truncate-end">
|
|
100
|
+
{commandSubtitle}
|
|
101
|
+
</Text>
|
|
102
|
+
)}
|
|
86
103
|
{toolCall.status === ToolCallStatus.TOOL_CALL_RUNNING && (
|
|
87
104
|
<Text dimColor>running</Text>
|
|
88
105
|
)}
|