@molecule/app-ide-panel-logic 0.0.0-stage → 1.1.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/LICENSE +202 -0
- package/README.md +2927 -2
- package/dist/chatTimelineOrdering.d.ts +50 -0
- package/dist/chatTimelineOrdering.d.ts.map +1 -0
- package/dist/chatTimelineOrdering.js +46 -0
- package/dist/chatTimelineOrdering.js.map +1 -0
- package/dist/command-metadata.d.ts +117 -0
- package/dist/command-metadata.d.ts.map +1 -0
- package/dist/command-metadata.js +271 -0
- package/dist/command-metadata.js.map +1 -0
- package/dist/components/activity-utilities.d.ts +107 -0
- package/dist/components/activity-utilities.d.ts.map +1 -0
- package/dist/components/activity-utilities.js +154 -0
- package/dist/components/activity-utilities.js.map +1 -0
- package/dist/components/chat-autocommit-utilities.d.ts +172 -0
- package/dist/components/chat-autocommit-utilities.d.ts.map +1 -0
- package/dist/components/chat-autocommit-utilities.js +185 -0
- package/dist/components/chat-autocommit-utilities.js.map +1 -0
- package/dist/components/chat-card-style.d.ts +81 -0
- package/dist/components/chat-card-style.d.ts.map +1 -0
- package/dist/components/chat-card-style.js +78 -0
- package/dist/components/chat-card-style.js.map +1 -0
- package/dist/components/chat-commands.d.ts +17 -0
- package/dist/components/chat-commands.d.ts.map +1 -0
- package/dist/components/chat-commands.js +17 -0
- package/dist/components/chat-commands.js.map +1 -0
- package/dist/components/chat-commit-utilities.d.ts +29 -0
- package/dist/components/chat-commit-utilities.d.ts.map +1 -0
- package/dist/components/chat-commit-utilities.js +31 -0
- package/dist/components/chat-commit-utilities.js.map +1 -0
- package/dist/components/chat-cost-utilities.d.ts +62 -0
- package/dist/components/chat-cost-utilities.d.ts.map +1 -0
- package/dist/components/chat-cost-utilities.js +66 -0
- package/dist/components/chat-cost-utilities.js.map +1 -0
- package/dist/components/chat-effort-utilities.d.ts +104 -0
- package/dist/components/chat-effort-utilities.d.ts.map +1 -0
- package/dist/components/chat-effort-utilities.js +99 -0
- package/dist/components/chat-effort-utilities.js.map +1 -0
- package/dist/components/chat-help-utilities.d.ts +89 -0
- package/dist/components/chat-help-utilities.d.ts.map +1 -0
- package/dist/components/chat-help-utilities.js +131 -0
- package/dist/components/chat-help-utilities.js.map +1 -0
- package/dist/components/chat-model-mode-utilities.d.ts +169 -0
- package/dist/components/chat-model-mode-utilities.d.ts.map +1 -0
- package/dist/components/chat-model-mode-utilities.js +221 -0
- package/dist/components/chat-model-mode-utilities.js.map +1 -0
- package/dist/components/chat-models-utilities.d.ts +162 -0
- package/dist/components/chat-models-utilities.d.ts.map +1 -0
- package/dist/components/chat-models-utilities.js +302 -0
- package/dist/components/chat-models-utilities.js.map +1 -0
- package/dist/components/chat-report-utilities.d.ts +149 -0
- package/dist/components/chat-report-utilities.d.ts.map +1 -0
- package/dist/components/chat-report-utilities.js +151 -0
- package/dist/components/chat-report-utilities.js.map +1 -0
- package/dist/components/chat-scripts-utilities.d.ts +185 -0
- package/dist/components/chat-scripts-utilities.d.ts.map +1 -0
- package/dist/components/chat-scripts-utilities.js +199 -0
- package/dist/components/chat-scripts-utilities.js.map +1 -0
- package/dist/components/chat-settings-utilities.d.ts +72 -0
- package/dist/components/chat-settings-utilities.d.ts.map +1 -0
- package/dist/components/chat-settings-utilities.js +56 -0
- package/dist/components/chat-settings-utilities.js.map +1 -0
- package/dist/components/chat-share-utilities.d.ts +110 -0
- package/dist/components/chat-share-utilities.d.ts.map +1 -0
- package/dist/components/chat-share-utilities.js +90 -0
- package/dist/components/chat-share-utilities.js.map +1 -0
- package/dist/components/chat-skills-utilities.d.ts +242 -0
- package/dist/components/chat-skills-utilities.d.ts.map +1 -0
- package/dist/components/chat-skills-utilities.js +433 -0
- package/dist/components/chat-skills-utilities.js.map +1 -0
- package/dist/components/chat-stream-utilities.d.ts +74 -0
- package/dist/components/chat-stream-utilities.d.ts.map +1 -0
- package/dist/components/chat-stream-utilities.js +103 -0
- package/dist/components/chat-stream-utilities.js.map +1 -0
- package/dist/components/chat-timestamps-utilities.d.ts +123 -0
- package/dist/components/chat-timestamps-utilities.d.ts.map +1 -0
- package/dist/components/chat-timestamps-utilities.js +177 -0
- package/dist/components/chat-timestamps-utilities.js.map +1 -0
- package/dist/components/chat-tips-utilities.d.ts +108 -0
- package/dist/components/chat-tips-utilities.d.ts.map +1 -0
- package/dist/components/chat-tips-utilities.js +137 -0
- package/dist/components/chat-tips-utilities.js.map +1 -0
- package/dist/components/device-cycle.d.ts +84 -0
- package/dist/components/device-cycle.d.ts.map +1 -0
- package/dist/components/device-cycle.js +77 -0
- package/dist/components/device-cycle.js.map +1 -0
- package/dist/components/fileExplorerPersistence.d.ts +50 -0
- package/dist/components/fileExplorerPersistence.d.ts.map +1 -0
- package/dist/components/fileExplorerPersistence.js +63 -0
- package/dist/components/fileExplorerPersistence.js.map +1 -0
- package/dist/components/search-utilities.d.ts +15 -0
- package/dist/components/search-utilities.d.ts.map +1 -0
- package/dist/components/search-utilities.js +26 -0
- package/dist/components/search-utilities.js.map +1 -0
- package/dist/components/tests-bar-utilities.d.ts +106 -0
- package/dist/components/tests-bar-utilities.d.ts.map +1 -0
- package/dist/components/tests-bar-utilities.js +167 -0
- package/dist/components/tests-bar-utilities.js.map +1 -0
- package/dist/components/tests-card-utilities.d.ts +280 -0
- package/dist/components/tests-card-utilities.d.ts.map +1 -0
- package/dist/components/tests-card-utilities.js +591 -0
- package/dist/components/tests-card-utilities.js.map +1 -0
- package/dist/components/tool-call-utilities.d.ts +262 -0
- package/dist/components/tool-call-utilities.d.ts.map +1 -0
- package/dist/components/tool-call-utilities.js +1007 -0
- package/dist/components/tool-call-utilities.js.map +1 -0
- package/dist/components/user-avatar-utilities.d.ts +41 -0
- package/dist/components/user-avatar-utilities.d.ts.map +1 -0
- package/dist/components/user-avatar-utilities.js +56 -0
- package/dist/components/user-avatar-utilities.js.map +1 -0
- package/dist/components/workspace-layout-utilities.d.ts +37 -0
- package/dist/components/workspace-layout-utilities.d.ts.map +1 -0
- package/dist/components/workspace-layout-utilities.js +58 -0
- package/dist/components/workspace-layout-utilities.js.map +1 -0
- package/dist/customEventCards.d.ts +147 -0
- package/dist/customEventCards.d.ts.map +1 -0
- package/dist/customEventCards.js +36 -0
- package/dist/customEventCards.js.map +1 -0
- package/dist/icon-names.d.ts +26 -0
- package/dist/icon-names.d.ts.map +1 -0
- package/dist/icon-names.js +14 -0
- package/dist/icon-names.js.map +1 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/keyboard-shortcut-utilities.d.ts +63 -0
- package/dist/keyboard-shortcut-utilities.d.ts.map +1 -0
- package/dist/keyboard-shortcut-utilities.js +100 -0
- package/dist/keyboard-shortcut-utilities.js.map +1 -0
- package/dist/panels.d.ts +26 -0
- package/dist/panels.d.ts.map +1 -0
- package/dist/panels.js +26 -0
- package/dist/panels.js.map +1 -0
- package/dist/settings-metadata.d.ts +78 -0
- package/dist/settings-metadata.d.ts.map +1 -0
- package/dist/settings-metadata.js +137 -0
- package/dist/settings-metadata.js.map +1 -0
- package/dist/types.d.ts +588 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/dist/viewport-queries.d.ts +19 -0
- package/dist/viewport-queries.d.ts.map +1 -0
- package/dist/viewport-queries.js +19 -0
- package/dist/viewport-queries.js.map +1 -0
- package/package.json +74 -4
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure utility functions for tool call display.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from ToolCallCard for testability — these functions have no
|
|
5
|
+
* React dependencies and can be unit-tested directly.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
/** Raw tool output shape. */
|
|
10
|
+
export type ToolOutput = Record<string, unknown> | string | null | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Read a model-supplied field as a string.
|
|
13
|
+
*
|
|
14
|
+
* Tool input is authored by a language model. Its schema says a field is a string; that
|
|
15
|
+
* is a request, and models miss it — `{ label: 'x' }` where a string was declared is the
|
|
16
|
+
* shape that blanked production on 2026-08-14. `as string` on one of these fields is a
|
|
17
|
+
* lie the compiler cannot catch, so every field this module reads goes through here
|
|
18
|
+
* instead: anything that isn't string-like becomes `undefined` and each call site's
|
|
19
|
+
* existing empty-value handling takes over.
|
|
20
|
+
*
|
|
21
|
+
* @param value - The raw field value.
|
|
22
|
+
* @returns The string, or `undefined` when the value cannot be one.
|
|
23
|
+
*/
|
|
24
|
+
export declare function str(value: unknown): string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Read a model-supplied field as a number.
|
|
27
|
+
*
|
|
28
|
+
* The numeric twin of {@link str}, and it hides in the same way: `out.exitCode as number`
|
|
29
|
+
* on an object passes `!= null` and `!== 0`, so the guard reads as satisfied and the
|
|
30
|
+
* object goes straight into JSX. Numeric-looking strings are accepted because providers
|
|
31
|
+
* routinely send them.
|
|
32
|
+
*
|
|
33
|
+
* @param value - The raw field value.
|
|
34
|
+
* @returns The number, or `undefined` when the value cannot be one.
|
|
35
|
+
*/
|
|
36
|
+
export declare function num(value: unknown): number | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Extracts the last path segment from a file path (e.g. "a/b/c.ts" → "c.ts").
|
|
39
|
+
* @param path - The file path to extract the basename from.
|
|
40
|
+
* @returns The basename string, or empty string if path is undefined.
|
|
41
|
+
*/
|
|
42
|
+
export declare function basename(path: string | undefined): string;
|
|
43
|
+
/**
|
|
44
|
+
* Path of a `@molecule/*` package's README.md inside the sandbox, where every
|
|
45
|
+
* package is pre-installed. Used by the find_package / read_molecule_doc cards
|
|
46
|
+
* so clicking a package opens its docs in the editor. The filename here must
|
|
47
|
+
* stay the one npm tarballs actually ship — `molecule-doc-path-reality.test.ts`
|
|
48
|
+
* anchors it against the real installed fleet, because a doc-file rename that
|
|
49
|
+
* missed this consumer (MOLECULE.md → README.md, 2026-08-04) silently broke
|
|
50
|
+
* every card click: the editor opened a path that no longer existed.
|
|
51
|
+
* @param packageName - The package name, with or without the `@molecule/` prefix.
|
|
52
|
+
* @returns The absolute sandbox path to the package's README.md, or null for
|
|
53
|
+
* a name that isn't a plain molecule package slug.
|
|
54
|
+
*/
|
|
55
|
+
export declare function moleculeDocPath(packageName: string | undefined): string | null;
|
|
56
|
+
/**
|
|
57
|
+
* The files a `read_file` call asked for. The tool takes either one `path` or
|
|
58
|
+
* several in `paths` (a batch read); every place that shows the call reads
|
|
59
|
+
* both through here so a batch never renders as a bare "Read".
|
|
60
|
+
* @param input - The raw `read_file` input payload.
|
|
61
|
+
* @returns The requested paths, in order (empty while the input is still streaming in).
|
|
62
|
+
*/
|
|
63
|
+
export declare function readFilePaths(input: unknown): string[];
|
|
64
|
+
/**
|
|
65
|
+
* The `read_file` paths that contribute a NAME to the card label, each paired
|
|
66
|
+
* with the name it renders as. A path with no basename (`src/`, `/`) names
|
|
67
|
+
* nothing, so it is dropped here — and because the label's `code` segments and
|
|
68
|
+
* their click targets are indexed off the SAME list, dropping it here keeps
|
|
69
|
+
* them aligned. Deriving the click target from {@link readFilePaths} instead
|
|
70
|
+
* made every name after a nameless path open the wrong file (a batch of
|
|
71
|
+
* `['src/', 'App.tsx']` rendered `` `App.tsx` `` but opened `src/`).
|
|
72
|
+
*
|
|
73
|
+
* @param input - The raw `read_file` input payload.
|
|
74
|
+
* @returns The named entries, in request order (empty while input streams in).
|
|
75
|
+
*/
|
|
76
|
+
export declare function readFileLabelEntries(input: unknown): Array<{
|
|
77
|
+
name: string;
|
|
78
|
+
path: string;
|
|
79
|
+
}>;
|
|
80
|
+
/**
|
|
81
|
+
* Human-readable label for a tool call (e.g. "Edit `ChatPanel.tsx`").
|
|
82
|
+
* @param name - The tool name (e.g. "write_file", "exec_command").
|
|
83
|
+
* @param input - The raw tool input payload.
|
|
84
|
+
* @returns A formatted label string with backtick-wrapped filenames.
|
|
85
|
+
*/
|
|
86
|
+
export declare function toolLabel(name: string, input: unknown): string;
|
|
87
|
+
/**
|
|
88
|
+
* Whether a tool result says the PERSON skipped this call.
|
|
89
|
+
*
|
|
90
|
+
* It is the honest third outcome, and it has to be recognisable on sight:
|
|
91
|
+
* a skipped call did not fail (nothing went wrong) and it did not succeed
|
|
92
|
+
* (the work never happened). Reading it as either one is the lie this
|
|
93
|
+
* predicate exists to prevent — so the summary word, the status dot, and the
|
|
94
|
+
* card's error handling all ask here rather than each deciding for themselves.
|
|
95
|
+
*
|
|
96
|
+
* @param output - The raw tool output payload.
|
|
97
|
+
* @returns True when the call was skipped by the user.
|
|
98
|
+
*/
|
|
99
|
+
export declare function isSkippedByUser(output: unknown): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Whether a tool result says a server restart cut this call off mid-run.
|
|
102
|
+
*
|
|
103
|
+
* Like a skip, it is neither a success nor a failure: whether the call took
|
|
104
|
+
* effect is unknown. The summary, the status dot and the card body all ask
|
|
105
|
+
* here so none of them shows it as "done".
|
|
106
|
+
*
|
|
107
|
+
* @param output - The raw tool output payload.
|
|
108
|
+
* @returns True when the call was interrupted by a restart.
|
|
109
|
+
*/
|
|
110
|
+
export declare function isInterruptedByRestart(output: unknown): boolean;
|
|
111
|
+
/**
|
|
112
|
+
* The sentence a card shows for a call a restart interrupted.
|
|
113
|
+
*
|
|
114
|
+
* @returns The localized sentence.
|
|
115
|
+
*/
|
|
116
|
+
export declare function interruptedByRestartLine(): string;
|
|
117
|
+
/**
|
|
118
|
+
* The one line a subagent card shows when the run failed, or '' when it did not.
|
|
119
|
+
*
|
|
120
|
+
* The server's `error` is already a plain sentence and is shown as is; raw
|
|
121
|
+
* error text (`Error: fetch failed`) and a failure with no `error` at all
|
|
122
|
+
* get the translated fallback instead.
|
|
123
|
+
*
|
|
124
|
+
* @param error - The result's `error` field.
|
|
125
|
+
* @param report - The result's `report` field (model-facing).
|
|
126
|
+
* @returns The line to show, or '' for a run that did not fail.
|
|
127
|
+
*/
|
|
128
|
+
export declare function subagentErrorLine(error: unknown, report: string): string;
|
|
129
|
+
/**
|
|
130
|
+
* One-line result summary shown beneath the label.
|
|
131
|
+
* @param name - The tool name.
|
|
132
|
+
* @param output - The raw tool output payload.
|
|
133
|
+
* @param status - The execution status (pending, running, done, error).
|
|
134
|
+
* @returns A brief summary string describing the result.
|
|
135
|
+
*/
|
|
136
|
+
export declare function toolSummary(name: string, output: ToolOutput, status: string): string;
|
|
137
|
+
/** A single `ask_user` option after coercion — label is always safe as a React child. */
|
|
138
|
+
export interface AskUserOption {
|
|
139
|
+
/** The clickable answer text — also the string sent back as the response. */
|
|
140
|
+
label: string;
|
|
141
|
+
/** One-line explanation rendered under the label (rich options only). */
|
|
142
|
+
description?: string;
|
|
143
|
+
/** Markdown artifact shown side-by-side for comparing options (rich options only). */
|
|
144
|
+
preview?: string;
|
|
145
|
+
}
|
|
146
|
+
/** The `ask_user` tool input, after coercion — every field safe to render. */
|
|
147
|
+
export interface AskUserInput {
|
|
148
|
+
/** The question text (markdown). */
|
|
149
|
+
question: string;
|
|
150
|
+
/** Clickable answers; a plain string or a rich { label, description?, preview? }. */
|
|
151
|
+
options: AskUserOption[];
|
|
152
|
+
/** Checkboxes — several options may be chosen at once. */
|
|
153
|
+
multiSelect: boolean;
|
|
154
|
+
/** Whether the free-text box is offered. `undefined` means "model didn't say" (defaults on). */
|
|
155
|
+
allowFreeText: boolean | undefined;
|
|
156
|
+
/** Optional hint shown under the options. */
|
|
157
|
+
hint: string;
|
|
158
|
+
/** Present only on the plan-approval card — renders the rich review layout. */
|
|
159
|
+
planReview: AskUserPlanReview | undefined;
|
|
160
|
+
}
|
|
161
|
+
/** Plan-review metadata carried by the plan-approval ask_user card. */
|
|
162
|
+
export interface AskUserPlanReview {
|
|
163
|
+
/** Plan file path relative to the workspace (clickable in the card). */
|
|
164
|
+
path: string | null;
|
|
165
|
+
/** The plan's display name, when the model gave one. */
|
|
166
|
+
name: string | null;
|
|
167
|
+
/** Total checklist steps in the plan. */
|
|
168
|
+
steps: number;
|
|
169
|
+
/** First few checklist step texts, for the in-card preview. */
|
|
170
|
+
preview: string[];
|
|
171
|
+
/**
|
|
172
|
+
* True when approving the plan lets the platform publish the app itself (it
|
|
173
|
+
* publishes once and runs the test suite on the live app) — the card says so
|
|
174
|
+
* under the step count, so approval is informed. Absent/falsy = not stated.
|
|
175
|
+
*/
|
|
176
|
+
goesLive?: boolean;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Normalize raw `ask_user` tool input into renderable strings.
|
|
180
|
+
*
|
|
181
|
+
* The model is told `options` is a list of strings or `{ label, description?,
|
|
182
|
+
* preview? }` objects, and weaker models routinely send stranger shapes —
|
|
183
|
+
* `[{ label, value }]`, nested arrays, quote-escaped pseudo-JSON. Rendering one
|
|
184
|
+
* of those directly is React error #31, which crashes the entire IDE at the
|
|
185
|
+
* moment the user submits their first prompt. Everything the card renders goes
|
|
186
|
+
* through here.
|
|
187
|
+
*
|
|
188
|
+
* @param input - The raw tool input, straight off the model.
|
|
189
|
+
* @returns The same fields, coerced so each is safe as a React child.
|
|
190
|
+
*/
|
|
191
|
+
export declare function normalizeAskUserInput(input: unknown): AskUserInput;
|
|
192
|
+
/** One row of an `update_task_list` call, after coercion — safe to render. */
|
|
193
|
+
export interface TaskListRow {
|
|
194
|
+
content: string;
|
|
195
|
+
status: 'pending' | 'in_progress' | 'completed';
|
|
196
|
+
priority?: 'high' | 'medium' | 'low';
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Coerce raw `update_task_list` input into renderable rows. The input comes
|
|
200
|
+
* straight off the model — every field is degraded to a safe default rather
|
|
201
|
+
* than rendered raw (same contract as `normalizeAskUserInput`).
|
|
202
|
+
*
|
|
203
|
+
* @param input - The raw tool input.
|
|
204
|
+
* @returns The rows worth rendering; empty when the model sent nothing usable.
|
|
205
|
+
*/
|
|
206
|
+
export declare function normalizeTaskListInput(input: unknown): TaskListRow[];
|
|
207
|
+
/** A parsed judge-subagent verdict. */
|
|
208
|
+
export interface JudgeVerdict {
|
|
209
|
+
verdict: 'PASS' | 'FAIL';
|
|
210
|
+
/** Concrete failure lines (the `- one line per failure` block under ISSUES:). */
|
|
211
|
+
issues: string[];
|
|
212
|
+
/** The report with the verdict scaffold stripped, for the expandable body. */
|
|
213
|
+
rest: string;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Parse a judge subagent's report into a structured verdict.
|
|
217
|
+
*
|
|
218
|
+
* The judge system prompt fixes the shape (`VERDICT: PASS|FAIL` then optional
|
|
219
|
+
* `ISSUES:` bullets then per-criterion evidence), but the model is the author —
|
|
220
|
+
* parse defensively (case-insensitive, leading whitespace tolerated) and return
|
|
221
|
+
* `null` when no verdict line is present so the card renders the plain report.
|
|
222
|
+
*
|
|
223
|
+
* @param report - The judge subagent's final report text.
|
|
224
|
+
* @returns The structured verdict, or null when the report carries none.
|
|
225
|
+
*/
|
|
226
|
+
export declare function parseJudgeVerdict(report: string): JudgeVerdict | null;
|
|
227
|
+
/**
|
|
228
|
+
* Count truly added/removed lines between two line arrays using LCS.
|
|
229
|
+
*
|
|
230
|
+
* Bounded by construction, so a whole-file edit cannot allocate a quadratic
|
|
231
|
+
* table here: the longest common prefix and suffix are trimmed first (exact —
|
|
232
|
+
* those lines belong to every optimal diff, and on the usual small edit they
|
|
233
|
+
* shrink the table to the edited span), and what is left is capped
|
|
234
|
+
* (see {@link lcsLength}).
|
|
235
|
+
*
|
|
236
|
+
* @param oldLines - The original lines array.
|
|
237
|
+
* @param modifiedLines - The modified lines array.
|
|
238
|
+
* @returns An object with the number of added and removed lines.
|
|
239
|
+
*/
|
|
240
|
+
export declare function diffLineCount(oldLines: string[], newLines: string[]): {
|
|
241
|
+
added: number;
|
|
242
|
+
removed: number;
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* Compute lines added/removed from a file-changing tool call.
|
|
246
|
+
* @param name - The tool name (edit_file or write_file).
|
|
247
|
+
* @param input - The raw tool input payload.
|
|
248
|
+
* @param output - The raw tool output payload.
|
|
249
|
+
* @returns Diff stats with added and removed line counts, or null if not applicable.
|
|
250
|
+
*/
|
|
251
|
+
export declare function fileDiffStats(name: string, input: unknown, output: unknown): {
|
|
252
|
+
added: number;
|
|
253
|
+
removed: number;
|
|
254
|
+
} | null;
|
|
255
|
+
/**
|
|
256
|
+
* Extracts the primary file path from a tool's input, if it operates on a single file.
|
|
257
|
+
* @param name - The tool name.
|
|
258
|
+
* @param input - The raw tool input payload.
|
|
259
|
+
* @returns The file path string, or null if the tool doesn't target a single file.
|
|
260
|
+
*/
|
|
261
|
+
export declare function extractFilePath(name: string, input: unknown): string | null;
|
|
262
|
+
//# sourceMappingURL=tool-call-utilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-call-utilities.d.ts","sourceRoot":"","sources":["../../src/components/tool-call-utilities.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,6BAA6B;AAC7B,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;AAE5E;;;;;;;;;;;;GAYG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAItD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAOtD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGzD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAK9E;AAUD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAMtD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,K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