@stigmer/client 0.1.3 → 0.2.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.
Files changed (61) hide show
  1. package/app-handover.d.ts +119 -0
  2. package/app-handover.d.ts.map +1 -0
  3. package/app-handover.js +523 -0
  4. package/app-handover.js.map +1 -0
  5. package/gen/organization.d.ts +2 -0
  6. package/gen/organization.d.ts.map +1 -1
  7. package/gen/organization.js +8 -0
  8. package/gen/organization.js.map +1 -1
  9. package/iam-principal.d.ts +11 -0
  10. package/iam-principal.d.ts.map +1 -1
  11. package/iam-principal.js +16 -0
  12. package/iam-principal.js.map +1 -1
  13. package/index.d.ts +11 -5
  14. package/index.d.ts.map +1 -1
  15. package/index.js +10 -3
  16. package/index.js.map +1 -1
  17. package/package.json +3 -3
  18. package/platform.d.ts +41 -3
  19. package/platform.d.ts.map +1 -1
  20. package/platform.js +56 -3
  21. package/platform.js.map +1 -1
  22. package/run/format-elapsed.d.ts +10 -0
  23. package/run/format-elapsed.d.ts.map +1 -0
  24. package/run/format-elapsed.js +25 -0
  25. package/run/format-elapsed.js.map +1 -0
  26. package/run/step-words.d.ts +78 -0
  27. package/run/step-words.d.ts.map +1 -0
  28. package/run/step-words.js +316 -0
  29. package/run/step-words.js.map +1 -0
  30. package/run/tool-view.d.ts +26 -2
  31. package/run/tool-view.d.ts.map +1 -1
  32. package/run/tool-view.js +83 -17
  33. package/run/tool-view.js.map +1 -1
  34. package/run/turn-activity.d.ts +9 -7
  35. package/run/turn-activity.d.ts.map +1 -1
  36. package/run/turn-activity.js +24 -144
  37. package/run/turn-activity.js.map +1 -1
  38. package/run/turn-ending.d.ts +59 -0
  39. package/run/turn-ending.d.ts.map +1 -0
  40. package/run/turn-ending.js +394 -0
  41. package/run/turn-ending.js.map +1 -0
  42. package/run/turn-steps.d.ts +16 -0
  43. package/run/turn-steps.d.ts.map +1 -0
  44. package/run/turn-steps.js +65 -0
  45. package/run/turn-steps.js.map +1 -0
  46. package/session-events.d.ts +3 -1
  47. package/session-events.d.ts.map +1 -1
  48. package/session-events.js +1 -0
  49. package/session-events.js.map +1 -1
  50. package/src/app-handover.ts +613 -0
  51. package/src/gen/organization.ts +7 -0
  52. package/src/iam-principal.ts +21 -0
  53. package/src/index.ts +49 -1
  54. package/src/platform.ts +80 -3
  55. package/src/run/format-elapsed.ts +22 -0
  56. package/src/run/step-words.ts +360 -0
  57. package/src/run/tool-view.ts +102 -19
  58. package/src/run/turn-activity.ts +27 -146
  59. package/src/run/turn-ending.ts +475 -0
  60. package/src/run/turn-steps.ts +81 -0
  61. package/src/session-events.ts +4 -1
@@ -0,0 +1,78 @@
1
+ import type { ToolUse } from "@stigmer/session-log";
2
+ import { type FileLineRange, type ToolKind, type ToolResultView } from "./tool-view.js";
3
+ /** How a step stands: running, returned, failed, or stopped before it returned (its turn ended). */
4
+ export type StepTense = "present" | "past" | "failed" | "stopped";
5
+ /** A step's words: the line, how it stands, and what it names beside the line. */
6
+ export interface StepPhrase {
7
+ /** The line: "Edited invoice.ts", "Searched for round( in src/billing", "Couldn't read notes.md". */
8
+ readonly text: string;
9
+ readonly tense: StepTense;
10
+ /** The folder of the file the line names, or where a search at work looks ("src/billing"); "" when it names none or the file sits at the root. */
11
+ readonly folder: string;
12
+ /** The connected app an MCP call belongs to; "" for a built-in tool. */
13
+ readonly app: string;
14
+ }
15
+ /** One form of a kind's words: with a target ("Reading" + " invoice.ts") and without one ("Reading a file"). */
16
+ type Form = readonly [withTarget: string, alone: string];
17
+ /** Every kind's words in each tense, and the past verb and noun a settled stretch counts it by. */
18
+ interface KindWords {
19
+ readonly present: Form;
20
+ readonly past: Form;
21
+ readonly failed: Form;
22
+ /** The roll-up's verb and counted noun; undefined for a kind the roll-up leaves out. */
23
+ readonly counted?: readonly [verb: string, noun: string];
24
+ }
25
+ /** The words of every kind (module header). */
26
+ export declare const KIND_WORDS: Readonly<Record<ToolKind, KindWords>>;
27
+ /** `form` with `target` after its verb, or alone when there is none. */
28
+ export declare function phraseOf(form: Form, target: string): string;
29
+ /** What a call acts on, in a few characters: a file's name, a search's pattern, a page's host, a subagent's task. */
30
+ export declare function targetOf(tool: Pick<ToolUse, "name" | "mcpServerName" | "input">): string;
31
+ /**
32
+ * How `tool` stands: open, returned, failed (an error result, a denial, or a
33
+ * command that exited non-zero), or stopped before it returned. A background
34
+ * command's own end is its status line's to say, never the step's.
35
+ */
36
+ export declare function stepTense(tool: ToolUse): StepTense;
37
+ /**
38
+ * `tool`'s line, in the tense it stands in (module header). A call that
39
+ * waits for a person's yes has done nothing yet: it reads as what the agent
40
+ * wants to do ("Wants to write rounding.ts").
41
+ */
42
+ export declare function stepPhrase(tool: ToolUse, options?: StepPhraseOptions): StepPhrase;
43
+ /** What a step's line may know beyond the call itself. */
44
+ export interface StepPhraseOptions {
45
+ /**
46
+ * The file a write wrote did not exist before its turn: the turn's file
47
+ * review says so (its change is `added`). Nothing in the call says it, so
48
+ * a session with no review reads "Wrote".
49
+ */
50
+ readonly created?: boolean;
51
+ }
52
+ /**
53
+ * Why a step failed, as a sentence a person reads, from its answer. Only the
54
+ * answer's first line is the engine's reason: the runner appends recovery
55
+ * hints for the model after it (`enrichErrorMessage`), which are never shown.
56
+ * A reason the engines are known to give reads in plain words ("The text to
57
+ * replace wasn't in the file, so nothing changed."); any other is the
58
+ * engine's own line, without an "Error:" label, as a sentence.
59
+ */
60
+ export declare function failureWords(text: string): string;
61
+ /**
62
+ * How many a search found, as its step says it: "4 files" for a search by
63
+ * name, "2 matches", and "2 matches in 2 files" once its matches name more
64
+ * than one file. Other views count nothing ("").
65
+ */
66
+ export declare function searchCountWords(view: ToolResultView): string;
67
+ /** The lines a step shows of a file, as words: "Lines 14–17 of 88", or "Lines 14–17" when the length is not known. */
68
+ export declare function lineRangeWords(range: FileLineRange): string;
69
+ /**
70
+ * A tool's name as words, in sentence case: `create_issue`, `createIssue`
71
+ * and `Create-Issue` all read "Create issue". A name with nothing to read
72
+ * reads "A tool".
73
+ */
74
+ export declare function humanizeToolName(name: string): string;
75
+ export declare function baseName(path: string): string;
76
+ export declare function short(value: string): string;
77
+ export {};
78
+ //# sourceMappingURL=step-words.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-words.d.ts","sourceRoot":"","sources":["../src/run/step-words.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAwC,KAAK,aAAa,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE9H,oGAAoG;AACpG,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAElE,kFAAkF;AAClF,MAAM,WAAW,UAAU;IACzB,qGAAqG;IACrG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,kJAAkJ;IAClJ,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,wEAAwE;IACxE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,gHAAgH;AAChH,KAAK,IAAI,GAAG,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAEzD,mGAAmG;AACnG,UAAU,SAAS;IACjB,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;IACtB,wFAAwF;IACxF,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;CAC1D;AAED,+CAA+C;AAC/C,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,CA8C5D,CAAC;AAEF,wEAAwE;AACxE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAE3D;AAmBD,qHAAqH;AACrH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,GAAG,OAAO,CAAC,GAAG,MAAM,CAsCxF;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,CAclD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,GAAE,iBAAsB,GAAG,UAAU,CAUrF;AAED,0DAA0D;AAC1D,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAwBD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOjD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAM7D;AAED,sHAAsH;AACtH,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAG3D;AAsCD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CASrD;AAWD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG7C;AAsBD,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG3C"}
@@ -0,0 +1,316 @@
1
+ // The words a tool call reads as: one table of every kind's verbs, in the
2
+ // present (while it runs), the past (once it returned) and the failed form,
3
+ // beside the noun a settled stretch counts it by. The working turn's phrase
4
+ // (`activityPhrase`), the settled stretch's roll-up (`settledStepsPhrase`)
5
+ // and each step's own line (`stepPhrase`) all read this table, so the three
6
+ // cannot describe one call three ways.
7
+ //
8
+ // A step's line reads only what the call carries: its kind
9
+ // (`resolveToolKind`), its input (a file's path, a search's pattern and
10
+ // folder, a page's address, the agent's own description of a command) and
11
+ // whether it returned, failed, or is still open. A command that exited
12
+ // non-zero failed even when the engine did not mark it an error.
13
+ //
14
+ // Trade-offs:
15
+ // - A connected app's tool (MCP) and a tool the kit does not know read as
16
+ // the tool's own name, humanized ("Create issue"), with no tense: a past
17
+ // tense guessed from an arbitrary name ("Get status", "List merge
18
+ // requests") would misread, and the name is exact.
19
+ // - A search for files by name (glob) reads "Found files matching", told
20
+ // apart from a search in files' text by the tool's name, as the kind
21
+ // table itself is.
22
+ // - Targets are cut short (`TARGET_MAX`) so a line stays one line.
23
+ import { normalizeToolResult, resolveToolKind } from "./tool-view.js";
24
+ /** The words of every kind (module header). */
25
+ export const KIND_WORDS = {
26
+ file_read: { present: ["Reading", "Reading a file"], past: ["Read", "Read a file"], failed: ["Couldn't read", "Couldn't read a file"], counted: ["read", "file"] },
27
+ file_write: { present: ["Writing", "Writing a file"], past: ["Wrote", "Wrote a file"], failed: ["Couldn't write", "Couldn't write a file"], counted: ["wrote", "file"] },
28
+ file_edit: { present: ["Editing", "Editing a file"], past: ["Edited", "Edited a file"], failed: ["Couldn't edit", "Couldn't edit a file"], counted: ["edited", "file"] },
29
+ file_delete: {
30
+ present: ["Deleting", "Deleting a file"],
31
+ past: ["Deleted", "Deleted a file"],
32
+ failed: ["Couldn't delete", "Couldn't delete a file"],
33
+ counted: ["deleted", "file"],
34
+ },
35
+ shell: { present: ["Running a command", "Running a command"], past: ["Ran a command", "Ran a command"], failed: ["Command failed", "Command failed"], counted: ["ran", "command"] },
36
+ search: { present: ["Searching for", "Searching"], past: ["Searched for", "Searched"], failed: ["Couldn't search for", "Couldn't search"], counted: ["searched", "pattern"] },
37
+ list: {
38
+ present: ["Looking in", "Looking through files"],
39
+ past: ["Looked in", "Looked through files"],
40
+ failed: ["Couldn't look in", "Couldn't look through files"],
41
+ counted: ["looked through", "folder"],
42
+ },
43
+ fetch: { present: ["Reading", "Reading a page"], past: ["Read", "Read a page"], failed: ["Couldn't read", "Couldn't read a page"], counted: ["read", "page"] },
44
+ web_search: {
45
+ present: ["Searching the web for", "Searching the web"],
46
+ past: ["Searched the web for", "Searched the web"],
47
+ failed: ["Couldn't search the web for", "Couldn't search the web"],
48
+ counted: ["searched the web", "time"],
49
+ },
50
+ think: { present: ["Thinking", "Thinking"], past: ["Thought it through", "Thought it through"], failed: ["Thought it through", "Thought it through"] },
51
+ todo: { present: ["Planning", "Planning"], past: ["Updated the plan", "Updated the plan"], failed: ["Couldn't update the plan", "Couldn't update the plan"] },
52
+ subagent: {
53
+ present: ["A helper is working on", "A helper is working"],
54
+ past: ["A helper worked on", "A helper worked"],
55
+ failed: ["A helper couldn't finish", "A helper couldn't finish"],
56
+ },
57
+ mcp: { present: ["Using", "Using a tool"], past: ["Used", "Used a tool"], failed: ["Couldn't use", "Couldn't use a tool"], counted: ["used", "tool"] },
58
+ memory: { present: ["Remembering", "Remembering"], past: ["Remembered", "Remembered"], failed: ["Couldn't remember", "Couldn't remember"] },
59
+ background_stop: {
60
+ present: ["Stopping a command", "Stopping a command"],
61
+ past: ["Stopped a command", "Stopped a command"],
62
+ failed: ["Couldn't stop a command", "Couldn't stop a command"],
63
+ },
64
+ skill: {
65
+ present: ["Using the skill", "Using a skill"],
66
+ past: ["Used the skill", "Used a skill"],
67
+ failed: ["Couldn't use the skill", "Couldn't use a skill"],
68
+ counted: ["used", "skill"],
69
+ },
70
+ unknown: { present: ["Working", "Working"], past: ["Used a tool", "Used a tool"], failed: ["A tool failed", "A tool failed"], counted: ["used", "tool"] },
71
+ };
72
+ /** `form` with `target` after its verb, or alone when there is none. */
73
+ export function phraseOf(form, target) {
74
+ return target === "" ? form[1] : `${form[0]} ${target}`;
75
+ }
76
+ /** The longest target a phrase carries before it is cut. */
77
+ const TARGET_MAX = 48;
78
+ /** Names that search for files by name, not in their text. */
79
+ const FILE_NAME_SEARCHES = new Set(["glob", "Glob", "find_files"]);
80
+ /** The input's text at `key`, or "". */
81
+ function textAt(tool, key) {
82
+ const value = tool.input[key];
83
+ return typeof value === "string" ? value : "";
84
+ }
85
+ /** The path a file call names, from the fields the engines use. */
86
+ function pathOf(tool) {
87
+ return textAt(tool, "path") || textAt(tool, "file_path") || textAt(tool, "notebook_path");
88
+ }
89
+ /** What a call acts on, in a few characters: a file's name, a search's pattern, a page's host, a subagent's task. */
90
+ export function targetOf(tool) {
91
+ const kind = resolveToolKind(tool);
92
+ switch (kind) {
93
+ case "file_read":
94
+ case "file_write":
95
+ case "file_edit":
96
+ case "file_delete":
97
+ return short(baseName(pathOf(tool)));
98
+ case "search":
99
+ return short(textAt(tool, "pattern") || textAt(tool, "query"));
100
+ case "fetch":
101
+ return short(hostOf(textAt(tool, "url")));
102
+ case "web_search":
103
+ return short(textAt(tool, "query"));
104
+ case "subagent":
105
+ return short(textAt(tool, "description"));
106
+ case "mcp":
107
+ return short(tool.name);
108
+ case "skill":
109
+ return short(textAt(tool, "skill") || textAt(tool, "name"));
110
+ case "list":
111
+ // The folder's last two segments ("src/billing"): its last alone
112
+ // ("billing") leaves a reader guessing which, and a whole absolute
113
+ // path crowds the line.
114
+ return short(folderWords(textAt(tool, "path")));
115
+ case "shell":
116
+ case "think":
117
+ case "todo":
118
+ case "memory":
119
+ case "background_stop":
120
+ case "unknown":
121
+ return "";
122
+ /* v8 ignore next -- @preserve: the exhaustiveness guard over ToolKind; resolveToolKind answers only the arms above */
123
+ default: {
124
+ const never = kind;
125
+ return never;
126
+ }
127
+ }
128
+ }
129
+ /**
130
+ * How `tool` stands: open, returned, failed (an error result, a denial, or a
131
+ * command that exited non-zero), or stopped before it returned. A background
132
+ * command's own end is its status line's to say, never the step's.
133
+ */
134
+ export function stepTense(tool) {
135
+ if (tool.state === "failed" || tool.state === "denied")
136
+ return "failed";
137
+ // Waiting: worded as what it would do (stepPhrase), standing as open.
138
+ if (tool.state === "waiting")
139
+ return "present";
140
+ if (tool.state === "stopped")
141
+ return "stopped";
142
+ if (tool.result === undefined)
143
+ return "present";
144
+ // An edit the Stigmer harness refused answers as a result, not an error
145
+ // ("Error: String not found in file"): nothing changed, so it failed.
146
+ if (resolveToolKind(tool) === "file_edit" && refusedEdit(tool.result.text))
147
+ return "failed";
148
+ if (resolveToolKind(tool) === "shell" && tool.background === undefined) {
149
+ const view = normalizeToolResult(tool);
150
+ if (view.type === "terminal" && view.exitCode !== undefined && view.exitCode !== 0)
151
+ return "failed";
152
+ }
153
+ return "past";
154
+ }
155
+ /**
156
+ * `tool`'s line, in the tense it stands in (module header). A call that
157
+ * waits for a person's yes has done nothing yet: it reads as what the agent
158
+ * wants to do ("Wants to write rounding.ts").
159
+ */
160
+ export function stepPhrase(tool, options = {}) {
161
+ const phrase = stepPhraseByTense(tool);
162
+ // A write that made the file reads as what it did ("Created rounding.test.ts").
163
+ if (options.created === true && phrase.tense === "past" && resolveToolKind(tool) === "file_write") {
164
+ const wrote = KIND_WORDS.file_write.past;
165
+ const created = phrase.text === wrote[1] ? CREATED[1] : phrase.text.startsWith(`${wrote[0]} `) ? `${CREATED[0]}${phrase.text.slice(wrote[0].length)}` : phrase.text;
166
+ return { ...phrase, text: created };
167
+ }
168
+ if (tool.state !== "waiting" || !phrase.text.startsWith("Couldn't "))
169
+ return phrase;
170
+ return { ...phrase, text: `Wants to ${phrase.text.slice("Couldn't ".length)}` };
171
+ }
172
+ /** A write that made its file, with a target and without one. */
173
+ const CREATED = ["Created", "Created a file"];
174
+ // The first lines the engines answer a refused edit with: the Stigmer
175
+ // harness answers it as a result in both its backends' words, which the
176
+ // conformance suite's classifier keys the same way
177
+ // (test/conformance/src/benchmark/tool-call-facts.ts).
178
+ const EDIT_NOT_FOUND = /^(?:Error: )?String not found in file/;
179
+ const EDIT_NOT_UNIQUE = /has multiple occurrences|^(?:Error: )?Multiple occurrences found in/;
180
+ const NO_SUCH_FILE = /no such file|ENOENT|file not found|does not exist/i;
181
+ /** The first line of an answer that reads, trimmed; "" when it has none. */
182
+ function firstLine(text) {
183
+ return (text.split("\n").find((line) => line.trim() !== "") ?? "").trim();
184
+ }
185
+ /** Whether an edit's answer says it changed nothing. */
186
+ function refusedEdit(text) {
187
+ const first = firstLine(text);
188
+ return EDIT_NOT_FOUND.test(first) || EDIT_NOT_UNIQUE.test(first);
189
+ }
190
+ /**
191
+ * Why a step failed, as a sentence a person reads, from its answer. Only the
192
+ * answer's first line is the engine's reason: the runner appends recovery
193
+ * hints for the model after it (`enrichErrorMessage`), which are never shown.
194
+ * A reason the engines are known to give reads in plain words ("The text to
195
+ * replace wasn't in the file, so nothing changed."); any other is the
196
+ * engine's own line, without an "Error:" label, as a sentence.
197
+ */
198
+ export function failureWords(text) {
199
+ const first = firstLine(text);
200
+ if (EDIT_NOT_FOUND.test(first))
201
+ return "The text to replace wasn't in the file, so nothing changed.";
202
+ if (EDIT_NOT_UNIQUE.test(first))
203
+ return "The text to replace was in the file more than once, so nothing changed.";
204
+ if (NO_SUCH_FILE.test(first))
205
+ return "The file wasn't there.";
206
+ const reason = first.replace(/^error:\s*/i, "");
207
+ return reason === "" ? "" : reason.charAt(0).toUpperCase() + reason.slice(1);
208
+ }
209
+ /**
210
+ * How many a search found, as its step says it: "4 files" for a search by
211
+ * name, "2 matches", and "2 matches in 2 files" once its matches name more
212
+ * than one file. Other views count nothing ("").
213
+ */
214
+ export function searchCountWords(view) {
215
+ if (view.type !== "search")
216
+ return "";
217
+ if (view.kind === "files")
218
+ return `${view.count} ${view.count === 1 ? "file" : "files"}`;
219
+ const matches = `${view.count} ${view.count === 1 ? "match" : "matches"}`;
220
+ const files = new Set(view.matches.flatMap((match) => (match.file === undefined ? [] : [match.file]))).size;
221
+ return files > 1 ? `${matches} in ${files} files` : matches;
222
+ }
223
+ /** The lines a step shows of a file, as words: "Lines 14–17 of 88", or "Lines 14–17" when the length is not known. */
224
+ export function lineRangeWords(range) {
225
+ const span = range.start === range.end ? `Line ${range.start}` : `Lines ${range.start}–${range.end}`;
226
+ return range.total === undefined ? span : `${span} of ${range.total}`;
227
+ }
228
+ function stepPhraseByTense(tool) {
229
+ const tense = stepTense(tool);
230
+ // A step its turn stopped did not get done: it reads as one that couldn't.
231
+ // A waiting one takes the same form, which stepPhrase turns into a want.
232
+ const form = tense === "stopped" || tool.state === "waiting" ? "failed" : tense;
233
+ const kind = resolveToolKind(tool);
234
+ const app = tool.mcpServerName;
235
+ if (kind === "mcp" || kind === "unknown")
236
+ return { text: humanizeToolName(tool.name), tense, folder: "", app };
237
+ if (kind === "shell") {
238
+ const description = textAt(tool, "description").replace(/\s+/g, " ").trim();
239
+ const words = tool.state === "waiting" ? "Wants to run a command" : phraseOf(KIND_WORDS.shell[form], "");
240
+ return { text: description === "" ? words : short(description), tense, folder: "", app };
241
+ }
242
+ if (kind === "search" && FILE_NAME_SEARCHES.has(tool.name)) {
243
+ const pattern = short(textAt(tool, "pattern"));
244
+ const words = {
245
+ present: ["Finding files matching", "Finding files"],
246
+ past: ["Found files matching", "Found files"],
247
+ failed: ["Couldn't find files matching", "Couldn't find files"],
248
+ };
249
+ return { text: phraseOf(words[form], pattern), tense, folder: "", app };
250
+ }
251
+ const target = targetOf(tool);
252
+ const text = phraseOf(KIND_WORDS[kind][form], target);
253
+ if (kind === "search") {
254
+ const where = target !== "" ? short(trimSeparators(textAt(tool, "path"))) : "";
255
+ // At work, a search has no counts yet: where it looks is its second line,
256
+ // as a file step's folder is ("Searching for round(", then "src/billing").
257
+ // Done, its counts take the second line and the folder joins its words.
258
+ if (form === "present")
259
+ return { text, tense, folder: where, app };
260
+ return { text: where !== "" ? `${text} in ${where}` : text, tense, folder: "", app };
261
+ }
262
+ const isFile = kind === "file_read" || kind === "file_write" || kind === "file_edit" || kind === "file_delete";
263
+ return { text, tense, folder: isFile && target !== "" ? short(folderOf(pathOf(tool))) : "", app };
264
+ }
265
+ /**
266
+ * A tool's name as words, in sentence case: `create_issue`, `createIssue`
267
+ * and `Create-Issue` all read "Create issue". A name with nothing to read
268
+ * reads "A tool".
269
+ */
270
+ export function humanizeToolName(name) {
271
+ const words = name
272
+ .replace(/([a-z0-9])([A-Z])/g, "$1 $2")
273
+ .split(/[\s_\-.:/]+/)
274
+ .filter((word) => word !== "")
275
+ .map((word) => word.toLowerCase());
276
+ if (words.length === 0)
277
+ return "A tool";
278
+ const text = words.join(" ");
279
+ return short(text.charAt(0).toUpperCase() + text.slice(1));
280
+ }
281
+ // The path is the model's, so the trailing separators are trimmed by a loop:
282
+ // a regular expression like /[\\/]+$/ backtracks quadratically on a long run
283
+ // of them, and the activity line reads this every second.
284
+ function trimSeparators(path) {
285
+ let end = path.length;
286
+ while (end > 0 && (path[end - 1] === "/" || path[end - 1] === "\\"))
287
+ end -= 1;
288
+ return path.slice(0, end);
289
+ }
290
+ export function baseName(path) {
291
+ const trimmed = trimSeparators(path);
292
+ return trimmed.slice(Math.max(trimmed.lastIndexOf("/"), trimmed.lastIndexOf("\\")) + 1);
293
+ }
294
+ /** The folder a path sits in, without its trailing separator; "" at the root or for a bare name. */
295
+ function folderOf(path) {
296
+ const trimmed = trimSeparators(path);
297
+ const at = Math.max(trimmed.lastIndexOf("/"), trimmed.lastIndexOf("\\"));
298
+ return at <= 0 ? "" : trimmed.slice(0, at);
299
+ }
300
+ function hostOf(url) {
301
+ try {
302
+ return new URL(url).host;
303
+ }
304
+ catch {
305
+ return "";
306
+ }
307
+ }
308
+ /** A folder as a step names it: its last two segments, "/workspace/app/src/billing" read as "src/billing". */
309
+ function folderWords(path) {
310
+ return trimSeparators(path).split(/[\\/]/).filter((segment) => segment !== "").slice(-2).join("/");
311
+ }
312
+ export function short(value) {
313
+ const flat = value.replace(/\s+/g, " ").trim();
314
+ return flat.length <= TARGET_MAX ? flat : `${flat.slice(0, TARGET_MAX - 1)}…`;
315
+ }
316
+ //# sourceMappingURL=step-words.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-words.js","sourceRoot":"","sources":["../src/run/step-words.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,4EAA4E;AAC5E,4EA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AC,IAAI,CAAC,CAAC,CAAC;IACzE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,MAAM,CAAC,GAAW;IACzB,IAAI,CAAC;QACH,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,8GAA8G;AAC9G,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACrG,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,KAAa;IACjC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/C,OAAO,IAAI,CAAC,MAAM,IAAI,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,GAAG,CAAC;AAChF,CAAC"}
@@ -31,6 +31,12 @@ export interface ToolContentBlock {
31
31
  * any unrecognized or truncated payload lands there, so this is never worse than
32
32
  * showing the raw result.
33
33
  */
34
+ /** The lines a read returned: 1-based, inclusive, and the file's length when the engine says it. */
35
+ export interface FileLineRange {
36
+ readonly start: number;
37
+ readonly end: number;
38
+ readonly total?: number;
39
+ }
34
40
  export type ToolResultView = {
35
41
  readonly type: "diff";
36
42
  readonly path: string;
@@ -42,6 +48,12 @@ export type ToolResultView = {
42
48
  readonly content: string;
43
49
  readonly language?: string;
44
50
  readonly truncated: boolean;
51
+ /**
52
+ * The lines a read returned, when its answer says (the Stigmer
53
+ * harness's `@@ lines A-B of T @@` frame; the Claude engine's
54
+ * numbered lines, which give no total): 1-based and inclusive.
55
+ */
56
+ readonly range?: FileLineRange;
45
57
  } | {
46
58
  readonly type: "terminal";
47
59
  readonly command?: string;
@@ -154,8 +166,20 @@ export declare function withoutOffloadTail(text: string): string;
154
166
  /**
155
167
  * Normalizes a tool use into a typed ToolResultView for rendering.
156
168
  *
157
- * A result that is an error always yields an `error` view. Otherwise the kind
158
- * drives interpretation, and anything unrecognized degrades to `json`/`text`.
169
+ * A result that is an error yields an `error` view, except a foreground
170
+ * command's: a command that failed is still a command, so it reads as its
171
+ * terminal (the command, what it printed, and the exit code when the output
172
+ * names one). Otherwise the kind drives interpretation, and anything
173
+ * unrecognized degrades to `json`/`text`.
174
+ */
175
+ /**
176
+ * What an edit tried to change, as the diff of its own input (the text it
177
+ * meant to replace and its replacement), whatever its answer: a failed edit
178
+ * opens to what it tried rather than to its error. `undefined` for a call
179
+ * that is not a file edit.
159
180
  */
181
+ export declare function editAttemptOf(tool: ToolViewInput): Extract<ToolResultView, {
182
+ type: "diff";
183
+ }> | undefined;
160
184
  export declare function normalizeToolResult(tool: ToolViewInput): ToolResultView;
161
185
  //# sourceMappingURL=tool-view.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-view.d.ts","sourceRoot":"","sources":["../src/run/tool-view.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAyB,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE3E;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,GAChB,SAAS,GACT,WAAW,GACX,YAAY,GACZ,WAAW,GACX,aAAa,GACb,OAAO,GACP,QAAQ,GACR,MAAM,GACN,OAAO,GACP,YAAY,GACZ,OAAO,GACP,MAAM,GACN,UAAU,GACV,KAAK,GACL,QAAQ,GACR,iBAAiB,GACjB,O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