@agentclientprotocol/claude-agent-acp 0.81.2 → 0.81.3-preview.2
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/README.md +8 -5
- package/dist/acp-agent.d.ts +32 -40
- package/dist/acp-agent.d.ts.map +1 -1
- package/dist/acp-agent.js +557 -577
- package/dist/acp-subagents.d.ts +6 -0
- package/dist/acp-subagents.d.ts.map +1 -1
- package/dist/air-extension.d.ts +31 -1
- package/dist/air-extension.d.ts.map +1 -1
- package/dist/air-extension.js +35 -1
- package/dist/async-tasks.d.ts +39 -2
- package/dist/async-tasks.d.ts.map +1 -1
- package/dist/async-tasks.js +147 -44
- package/dist/context-compaction-meta.d.ts +6 -5
- package/dist/context-compaction-meta.d.ts.map +1 -1
- package/dist/context-compaction-meta.js +10 -10
- package/dist/context-compaction.d.ts +3 -0
- package/dist/context-compaction.d.ts.map +1 -1
- package/dist/context-compaction.js +23 -57
- package/dist/diff.d.ts +73 -5
- package/dist/diff.d.ts.map +1 -1
- package/dist/diff.js +435 -64
- package/dist/elicitation.d.ts +1 -1
- package/dist/elicitation.d.ts.map +1 -1
- package/dist/elicitation.js +12 -14
- package/dist/hide-claude-auth.d.ts +2 -6
- package/dist/hide-claude-auth.d.ts.map +1 -1
- package/dist/hide-claude-auth.js +3 -21
- package/dist/native-subagents.d.ts +58 -0
- package/dist/native-subagents.d.ts.map +1 -1
- package/dist/native-subagents.js +186 -34
- package/dist/paths.d.ts +3 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +6 -0
- package/dist/permissions/presentation.d.ts +13 -2
- package/dist/permissions/presentation.d.ts.map +1 -1
- package/dist/permissions/presentation.js +49 -44
- package/dist/resumed-session.d.ts +11 -0
- package/dist/resumed-session.d.ts.map +1 -1
- package/dist/resumed-session.js +106 -4
- package/dist/session-failure-extension.js +1 -1
- package/dist/session-mode.d.ts +2 -0
- package/dist/session-mode.d.ts.map +1 -1
- package/dist/session-mode.js +12 -5
- package/dist/settings.js +2 -2
- package/dist/subagent-history.d.ts +20 -0
- package/dist/subagent-history.d.ts.map +1 -0
- package/dist/subagent-history.js +46 -0
- package/dist/tool-calls/background.d.ts +20 -0
- package/dist/tool-calls/background.d.ts.map +1 -0
- package/dist/tool-calls/background.js +41 -0
- package/dist/tool-calls/changed-meta-filter.d.ts +27 -0
- package/dist/tool-calls/changed-meta-filter.d.ts.map +1 -0
- package/dist/tool-calls/changed-meta-filter.js +102 -0
- package/dist/tool-calls/client-capabilities.d.ts +51 -0
- package/dist/tool-calls/client-capabilities.d.ts.map +1 -0
- package/dist/tool-calls/client-capabilities.js +43 -0
- package/dist/tool-calls/content.d.ts +59 -0
- package/dist/tool-calls/content.d.ts.map +1 -0
- package/dist/tool-calls/content.js +194 -0
- package/dist/tool-calls/facts.d.ts +116 -0
- package/dist/tool-calls/facts.d.ts.map +1 -0
- package/dist/tool-calls/facts.js +1 -0
- package/dist/tool-calls/field-tracker.d.ts +58 -0
- package/dist/tool-calls/field-tracker.d.ts.map +1 -0
- package/dist/tool-calls/field-tracker.js +167 -0
- package/dist/tool-calls/renderer.d.ts +216 -0
- package/dist/tool-calls/renderer.d.ts.map +1 -0
- package/dist/tool-calls/renderer.js +487 -0
- package/dist/tool-calls/reporters/agent.d.ts +7 -0
- package/dist/tool-calls/reporters/agent.d.ts.map +1 -0
- package/dist/tool-calls/reporters/agent.js +190 -0
- package/dist/tool-calls/reporters/bash.d.ts +9 -0
- package/dist/tool-calls/reporters/bash.d.ts.map +1 -0
- package/dist/tool-calls/reporters/bash.js +83 -0
- package/dist/tool-calls/reporters/compaction.d.ts +24 -0
- package/dist/tool-calls/reporters/compaction.d.ts.map +1 -0
- package/dist/tool-calls/reporters/compaction.js +66 -0
- package/dist/tool-calls/reporters/file-edit.d.ts +46 -0
- package/dist/tool-calls/reporters/file-edit.d.ts.map +1 -0
- package/dist/tool-calls/reporters/file-edit.js +180 -0
- package/dist/tool-calls/reporters/index.d.ts +4 -0
- package/dist/tool-calls/reporters/index.d.ts.map +1 -0
- package/dist/tool-calls/reporters/index.js +40 -0
- package/dist/tool-calls/reporters/interaction.d.ts +71 -0
- package/dist/tool-calls/reporters/interaction.d.ts.map +1 -0
- package/dist/tool-calls/reporters/interaction.js +222 -0
- package/dist/tool-calls/reporters/read.d.ts +7 -0
- package/dist/tool-calls/reporters/read.d.ts.map +1 -0
- package/dist/tool-calls/reporters/read.js +64 -0
- package/dist/tool-calls/reporters/search.d.ts +10 -0
- package/dist/tool-calls/reporters/search.d.ts.map +1 -0
- package/dist/tool-calls/reporters/search.js +50 -0
- package/dist/tool-calls/reporters/web.d.ts +11 -0
- package/dist/tool-calls/reporters/web.d.ts.map +1 -0
- package/dist/tool-calls/reporters/web.js +42 -0
- package/dist/tools.d.ts +32 -37
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +48 -970
- package/package.json +4 -1
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tool-call fields that a client overwrites when a `tool_call_update`
|
|
3
|
+
* carries them. ACP replaces a present `content` or `locations` list as a
|
|
4
|
+
* whole, and `rawInput` and `rawOutput` are whole values.
|
|
5
|
+
*/
|
|
6
|
+
const REPLACED_FIELDS = [
|
|
7
|
+
"status",
|
|
8
|
+
"title",
|
|
9
|
+
"kind",
|
|
10
|
+
"content",
|
|
11
|
+
"locations",
|
|
12
|
+
"rawInput",
|
|
13
|
+
"rawOutput",
|
|
14
|
+
];
|
|
15
|
+
/**
|
|
16
|
+
* Remembers what the client holds for each open tool call, so that a
|
|
17
|
+
* `tool_call_update` carries only the fields that changed.
|
|
18
|
+
*
|
|
19
|
+
* A client overwrites a field that an update carries and merges `_meta` by
|
|
20
|
+
* key. An update that repeats a field value therefore only costs bandwidth,
|
|
21
|
+
* and for a Write it repeats the whole file. The tracker drops such fields.
|
|
22
|
+
* It never drops `_meta`, because a client appends `terminal_output_delta`
|
|
23
|
+
* data.
|
|
24
|
+
*
|
|
25
|
+
* An entry starts at the `tool_call` and ends after both the tool_result and
|
|
26
|
+
* the PostToolUse hook callback, or when the session is torn down.
|
|
27
|
+
*/
|
|
28
|
+
export class ToolCallFieldTracker {
|
|
29
|
+
calls = new Map();
|
|
30
|
+
/**
|
|
31
|
+
* Records a `tool_call`, or removes the unchanged fields of a
|
|
32
|
+
* `tool_call_update` and records the rest.
|
|
33
|
+
*
|
|
34
|
+
* Returns false when the update carries nothing new: no replaced field
|
|
35
|
+
* remains, `_meta` has no key besides `claudeCode` and `jetbrains`, and
|
|
36
|
+
* every `claudeCode` and `jetbrains.air` key repeats its value. The caller
|
|
37
|
+
* then skips the update. An update for a tool call that the tracker does
|
|
38
|
+
* not know passes through unchanged.
|
|
39
|
+
*
|
|
40
|
+
* `replacePinnedContent` lets the final result of the tool replace an exact
|
|
41
|
+
* approval patch (see {@link pinContent}).
|
|
42
|
+
*/
|
|
43
|
+
apply(update, options) {
|
|
44
|
+
if (update.sessionUpdate === "tool_call") {
|
|
45
|
+
const entry = {
|
|
46
|
+
fields: new Map(),
|
|
47
|
+
mergedMeta: new Map(),
|
|
48
|
+
contentPinned: false,
|
|
49
|
+
resultSeen: false,
|
|
50
|
+
};
|
|
51
|
+
this.calls.set(update.toolCallId, entry);
|
|
52
|
+
for (const field of REPLACED_FIELDS) {
|
|
53
|
+
const value = update[field];
|
|
54
|
+
if (value !== undefined)
|
|
55
|
+
entry.fields.set(field, JSON.stringify(value));
|
|
56
|
+
}
|
|
57
|
+
recordMergedMeta(entry, update._meta);
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
if (update.sessionUpdate !== "tool_call_update")
|
|
61
|
+
return true;
|
|
62
|
+
const entry = this.calls.get(update.toolCallId);
|
|
63
|
+
if (!entry)
|
|
64
|
+
return true;
|
|
65
|
+
const fields = update;
|
|
66
|
+
let changed = false;
|
|
67
|
+
for (const field of REPLACED_FIELDS) {
|
|
68
|
+
const value = fields[field];
|
|
69
|
+
if (value === undefined)
|
|
70
|
+
continue;
|
|
71
|
+
if (field === "content" && entry.contentPinned) {
|
|
72
|
+
if (!options?.replacePinnedContent) {
|
|
73
|
+
delete fields[field];
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
entry.contentPinned = false;
|
|
77
|
+
}
|
|
78
|
+
const json = JSON.stringify(value);
|
|
79
|
+
if (entry.fields.get(field) === json) {
|
|
80
|
+
delete fields[field];
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
entry.fields.set(field, json);
|
|
84
|
+
changed = true;
|
|
85
|
+
}
|
|
86
|
+
const meta = update._meta;
|
|
87
|
+
if (meta && Object.keys(meta).some((key) => !MERGED_META_NAMESPACES.has(key)))
|
|
88
|
+
changed = true;
|
|
89
|
+
if (recordMergedMeta(entry, meta))
|
|
90
|
+
changed = true;
|
|
91
|
+
return changed;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Records the exact approval patch that the client shows for a tool call.
|
|
95
|
+
*
|
|
96
|
+
* The streamed tool input later refines the call with a standard diff of
|
|
97
|
+
* the Edit snippet. That diff must not replace the exact patch, so the
|
|
98
|
+
* content stays until an update passes `replacePinnedContent`.
|
|
99
|
+
*/
|
|
100
|
+
pinContent(toolCallId, content) {
|
|
101
|
+
const entry = this.calls.get(toolCallId);
|
|
102
|
+
if (!entry)
|
|
103
|
+
return;
|
|
104
|
+
entry.fields.set("content", JSON.stringify(content));
|
|
105
|
+
entry.contentPinned = true;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Marks the tool_result of a tool call. The entry ends now, or after the
|
|
109
|
+
* PostToolUse hook callback when `hookPending` is true.
|
|
110
|
+
*/
|
|
111
|
+
finishResult(toolCallId, hookPending) {
|
|
112
|
+
const entry = this.calls.get(toolCallId);
|
|
113
|
+
if (!entry)
|
|
114
|
+
return;
|
|
115
|
+
if (hookPending)
|
|
116
|
+
entry.resultSeen = true;
|
|
117
|
+
else
|
|
118
|
+
this.calls.delete(toolCallId);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Marks the end of the PostToolUse hook callback of a tool call. The entry
|
|
122
|
+
* ends when the tool_result was seen. Otherwise the tool_result ends it.
|
|
123
|
+
*/
|
|
124
|
+
finishHook(toolCallId) {
|
|
125
|
+
if (this.calls.get(toolCallId)?.resultSeen)
|
|
126
|
+
this.calls.delete(toolCallId);
|
|
127
|
+
}
|
|
128
|
+
/** Forgets one tool call. */
|
|
129
|
+
delete(toolCallId) {
|
|
130
|
+
this.calls.delete(toolCallId);
|
|
131
|
+
}
|
|
132
|
+
/** Forgets every tool call, when the session is torn down. */
|
|
133
|
+
clear() {
|
|
134
|
+
this.calls.clear();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/** The `_meta` namespaces that a client merges by key. */
|
|
138
|
+
const MERGED_META_NAMESPACES = new Set(["claudeCode", "jetbrains"]);
|
|
139
|
+
/** Merges the `claudeCode` and `jetbrains.air` keys of `meta`. Returns true
|
|
140
|
+
* when a key changed. */
|
|
141
|
+
function recordMergedMeta(entry, meta) {
|
|
142
|
+
let changed = false;
|
|
143
|
+
const record = (key, value) => {
|
|
144
|
+
const json = JSON.stringify(value);
|
|
145
|
+
if (entry.mergedMeta.get(key) === json)
|
|
146
|
+
return;
|
|
147
|
+
entry.mergedMeta.set(key, json);
|
|
148
|
+
changed = true;
|
|
149
|
+
};
|
|
150
|
+
const merge = (prefix, values) => {
|
|
151
|
+
if (!values || typeof values !== "object" || Array.isArray(values))
|
|
152
|
+
return;
|
|
153
|
+
for (const [key, value] of Object.entries(values))
|
|
154
|
+
record(prefix + key, value);
|
|
155
|
+
};
|
|
156
|
+
merge("claudeCode.", meta?.claudeCode);
|
|
157
|
+
const jetbrains = meta?.jetbrains;
|
|
158
|
+
if (jetbrains && typeof jetbrains === "object" && !Array.isArray(jetbrains)) {
|
|
159
|
+
for (const [key, value] of Object.entries(jetbrains)) {
|
|
160
|
+
if (key === "air")
|
|
161
|
+
merge("jetbrains.air.", value);
|
|
162
|
+
else
|
|
163
|
+
record(`jetbrains.${key}`, value);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return changed;
|
|
167
|
+
}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import type { ClientCapabilities as AcpClientCapabilities, RequestPermissionRequest, SessionNotification, ToolCallContent, ToolCallLocation } from "@agentclientprotocol/sdk";
|
|
2
|
+
import { ClientCapabilities } from "./client-capabilities.js";
|
|
3
|
+
import type { ToolResultContext, ToolResultFacts, ToolUse, ToolUseFacts } from "./facts.js";
|
|
4
|
+
export type ToolCallUpdate = SessionNotification["update"];
|
|
5
|
+
/** The `_meta` of a tool call report. */
|
|
6
|
+
export type ToolUpdateMeta = {
|
|
7
|
+
claudeCode?: {
|
|
8
|
+
toolName?: string;
|
|
9
|
+
toolResponse?: unknown;
|
|
10
|
+
parentToolUseId?: string;
|
|
11
|
+
nonExecutionKind?: string;
|
|
12
|
+
userFeedback?: string;
|
|
13
|
+
mcpServer?: {
|
|
14
|
+
name: string;
|
|
15
|
+
source: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
jetbrains?: {
|
|
19
|
+
air?: {
|
|
20
|
+
version?: number;
|
|
21
|
+
commandTitle?: string;
|
|
22
|
+
subagent?: true;
|
|
23
|
+
skill?: {
|
|
24
|
+
name: string;
|
|
25
|
+
path?: string;
|
|
26
|
+
};
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
is_mcp_tool_call?: true;
|
|
31
|
+
terminal_info?: {
|
|
32
|
+
terminal_id: string;
|
|
33
|
+
};
|
|
34
|
+
terminal_output?: {
|
|
35
|
+
terminal_id: string;
|
|
36
|
+
data: string;
|
|
37
|
+
};
|
|
38
|
+
terminal_output_delta?: {
|
|
39
|
+
terminal_id: string;
|
|
40
|
+
data: string;
|
|
41
|
+
};
|
|
42
|
+
terminal_exit?: {
|
|
43
|
+
terminal_id: string;
|
|
44
|
+
exit_code: number;
|
|
45
|
+
signal: string | null;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
/** The result fields of a tool call report, before the status and the tool name. */
|
|
49
|
+
export interface RenderedResult {
|
|
50
|
+
title?: string;
|
|
51
|
+
content?: ToolCallContent[];
|
|
52
|
+
locations?: ToolCallLocation[];
|
|
53
|
+
/** Present when the reporter decided the raw output. */
|
|
54
|
+
rawOutput?: unknown;
|
|
55
|
+
/** The plan file that `rawInput` names. See {@link ToolResultFacts.planFilePath}. */
|
|
56
|
+
planFilePath?: string;
|
|
57
|
+
/** See {@link ToolResultFacts.planFileReleased}. */
|
|
58
|
+
planFileReleased?: boolean;
|
|
59
|
+
_meta?: Pick<ToolUpdateMeta, "terminal_info" | "terminal_output" | "terminal_output_delta" | "terminal_exit">;
|
|
60
|
+
}
|
|
61
|
+
/** The SDK tool_result block that a result report reads. */
|
|
62
|
+
type ResultBlock = ToolResultContext["result"];
|
|
63
|
+
/**
|
|
64
|
+
* Turns tool facts into the fields of the standard ACP tool call report, as
|
|
65
|
+
* `docs/air-extensions.md#tool-call-contract` defines: each fact goes in one field.
|
|
66
|
+
*
|
|
67
|
+
* The {@link ToolReporter} of the tool reads the SDK data. The renderer
|
|
68
|
+
* decides the fields from the facts and the {@link ClientCapabilities}. The
|
|
69
|
+
* {@link ToolCallFieldTracker} runs after it and drops the fields that an
|
|
70
|
+
* earlier report of the same tool call already sent.
|
|
71
|
+
*/
|
|
72
|
+
export declare class AcpToolCallRenderer {
|
|
73
|
+
readonly capabilities: ClientCapabilities;
|
|
74
|
+
/** True when the renderer reports the history of a loaded session. */
|
|
75
|
+
readonly replay: boolean;
|
|
76
|
+
constructor(capabilities?: ClientCapabilities,
|
|
77
|
+
/** True when the renderer reports the history of a loaded session. */
|
|
78
|
+
replay?: boolean);
|
|
79
|
+
static for(capabilities: AcpClientCapabilities | null | undefined, replay?: boolean): AcpToolCallRenderer;
|
|
80
|
+
/** The facts of a tool use. */
|
|
81
|
+
facts(toolUse: Pick<ToolUse, "name" | "input">, cwd?: string): ToolUseFacts;
|
|
82
|
+
/** The standard fields of a tool use: the title, the kind, the content, and the locations. */
|
|
83
|
+
toolInfo(toolUse: ToolUse, cwd?: string): {
|
|
84
|
+
title: string;
|
|
85
|
+
kind: ToolUseFacts["kind"];
|
|
86
|
+
content: ToolCallContent[];
|
|
87
|
+
locations?: ToolCallLocation[];
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* The first report of a tool call. `rawInput` is left out while the input
|
|
91
|
+
* still streams: the consolidated message sends it once it is complete.
|
|
92
|
+
*/
|
|
93
|
+
toolCall(toolUse: ToolUse, options?: {
|
|
94
|
+
cwd?: string;
|
|
95
|
+
inputComplete?: boolean;
|
|
96
|
+
previewContent?: ToolCallContent[];
|
|
97
|
+
}): ToolCallUpdate;
|
|
98
|
+
/** The report of a tool call whose input is complete now. */
|
|
99
|
+
refinement(toolUse: ToolUse, cwd?: string): ToolCallUpdate;
|
|
100
|
+
/**
|
|
101
|
+
* The report of a tool call from the complete top-level fields of its still
|
|
102
|
+
* streaming input. It carries no content: content built from partial input
|
|
103
|
+
* is misleading (an Edit without its `new_string` renders as a deletion) or
|
|
104
|
+
* invalid. AIR gets no `rawInput`, which goes out once it is complete. Every
|
|
105
|
+
* other client gets the partial input as `rawInput`.
|
|
106
|
+
*/
|
|
107
|
+
partialRefinement(toolUse: Pick<ToolUse, "id" | "name">, input: unknown, cwd?: string): {
|
|
108
|
+
locations?: ToolCallLocation[] | undefined;
|
|
109
|
+
title: string;
|
|
110
|
+
kind: import("@agentclientprotocol/sdk").ToolKind;
|
|
111
|
+
rawInput?: unknown;
|
|
112
|
+
_meta: ToolUpdateMeta;
|
|
113
|
+
toolCallId: string;
|
|
114
|
+
sessionUpdate: "tool_call_update";
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* The tool call of a permission request: `toolCallId`, `title`, and
|
|
118
|
+
* `rawInput`. The client already holds the rest. The request adds only what
|
|
119
|
+
* it shows new: an exact preview patch, and a location that the tool call
|
|
120
|
+
* does not have.
|
|
121
|
+
*/
|
|
122
|
+
permissionToolCall(toolUse: ToolUse, options?: {
|
|
123
|
+
cwd?: string;
|
|
124
|
+
title?: string;
|
|
125
|
+
previewContent?: ToolCallContent[];
|
|
126
|
+
extraLocations?: ToolCallLocation[];
|
|
127
|
+
meta?: ToolUpdateMeta;
|
|
128
|
+
/** The content of a client that is not AIR, when the tool call has none. */
|
|
129
|
+
fallbackContent?: ToolCallContent[];
|
|
130
|
+
}): RequestPermissionRequest["toolCall"];
|
|
131
|
+
/** The facts of a tool result. */
|
|
132
|
+
resultFacts(toolUse: ToolUse, result: ResultBlock, structured?: unknown): ToolResultFacts;
|
|
133
|
+
/** The result fields of a tool result, before the status and the tool name. */
|
|
134
|
+
resultFields(toolUse: ToolUse, result: ResultBlock, structured?: unknown): RenderedResult;
|
|
135
|
+
/**
|
|
136
|
+
* The reports of a tool result. A command sends its output as a separate
|
|
137
|
+
* report first, like codex-acp: the output, then the exit and the status.
|
|
138
|
+
* The output travels once: the raw tool_result goes to `rawOutput` only
|
|
139
|
+
* when no other field carries the result.
|
|
140
|
+
*/
|
|
141
|
+
result(toolUse: ToolUse, result: ResultBlock, options?: {
|
|
142
|
+
structured?: unknown;
|
|
143
|
+
nonExecution?: Record<string, unknown>;
|
|
144
|
+
}): ToolCallUpdate[];
|
|
145
|
+
/**
|
|
146
|
+
* Whether AIR shows [toolUse] as the list of viewed files: a read or a
|
|
147
|
+
* search with a path in its locations or in the `path` of its input.
|
|
148
|
+
*/
|
|
149
|
+
private namesViewedFile;
|
|
150
|
+
/**
|
|
151
|
+
* The report of a PostToolUse hook: the final change of an edit tool, and
|
|
152
|
+
* the `status` and `isAsync` markers of the `tool_response`. The rest of the
|
|
153
|
+
* `tool_response` repeats output that the content already carries.
|
|
154
|
+
*/
|
|
155
|
+
hookResult(toolUse: Pick<ToolUse, "id" | "name">, toolResponse: unknown, cwd?: string): Promise<ToolCallUpdate | undefined>;
|
|
156
|
+
/**
|
|
157
|
+
* The report of a memory recall: a completed read tool call. A synthesis
|
|
158
|
+
* shows the recalled text, a plain recall shows the memory files.
|
|
159
|
+
*/
|
|
160
|
+
memoryRecall(recall: {
|
|
161
|
+
uuid: string;
|
|
162
|
+
mode: string;
|
|
163
|
+
memories: {
|
|
164
|
+
path: string;
|
|
165
|
+
content?: string;
|
|
166
|
+
}[];
|
|
167
|
+
}): ToolCallUpdate;
|
|
168
|
+
/**
|
|
169
|
+
* The report of a tool call that a rule, the classifier, or a mode denied
|
|
170
|
+
* before it ran. The reason is the result to show, so `toolResponse` keeps
|
|
171
|
+
* only the reason type, and the SDK message when it differs from the reason.
|
|
172
|
+
*/
|
|
173
|
+
permissionDenied(denial: {
|
|
174
|
+
toolCallId: string;
|
|
175
|
+
toolName: string;
|
|
176
|
+
parentToolUseId?: string;
|
|
177
|
+
decisionReasonType?: string;
|
|
178
|
+
decisionReason?: string;
|
|
179
|
+
message?: string;
|
|
180
|
+
}): ToolCallUpdate;
|
|
181
|
+
/**
|
|
182
|
+
* The report of a tool progress beat. The field tracker sends the
|
|
183
|
+
* `in_progress` status once, so a later beat carries only the progress.
|
|
184
|
+
*/
|
|
185
|
+
progress(beat: {
|
|
186
|
+
toolCallId: string;
|
|
187
|
+
toolName?: string;
|
|
188
|
+
parentToolUseId?: string;
|
|
189
|
+
elapsedTimeSeconds: number;
|
|
190
|
+
subagentType?: string;
|
|
191
|
+
subagentRetry?: unknown;
|
|
192
|
+
}): ToolCallUpdate;
|
|
193
|
+
/**
|
|
194
|
+
* `rawInput`. For AIR, without the file text that a diff holds, and with
|
|
195
|
+
* the path of the plan file in place of the plan text.
|
|
196
|
+
*/
|
|
197
|
+
rawInput(facts: ToolUseFacts, rawInput: unknown): unknown;
|
|
198
|
+
/**
|
|
199
|
+
* The content of a tool use. A command shows the terminal marker. An edit
|
|
200
|
+
* shows its change. A display copy of the input goes only to a client that
|
|
201
|
+
* does not render `rawInput` itself, and never next to a terminal.
|
|
202
|
+
*/
|
|
203
|
+
toolUseContent(toolCallId: string, facts: ToolUseFacts): ToolCallContent[];
|
|
204
|
+
/**
|
|
205
|
+
* The `_meta` of a tool use report: the tool name, and for AIR the tool
|
|
206
|
+
* flags under `_meta.jetbrains.air`. A shell description stays out of the
|
|
207
|
+
* standard `title`, which clients use as the command preview. Every other
|
|
208
|
+
* client gets only the upstream tool name.
|
|
209
|
+
*/
|
|
210
|
+
toolUseMeta(toolUse: {
|
|
211
|
+
name: string;
|
|
212
|
+
input?: unknown;
|
|
213
|
+
}, cwd?: string): ToolUpdateMeta;
|
|
214
|
+
}
|
|
215
|
+
export {};
|
|
216
|
+
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/tool-calls/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,IAAI,qBAAqB,EAC3C,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EACjB,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI5F,MAAM,MAAM,cAAc,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAK3D,yCAAyC;AACzC,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,CAAC,EAAE;QAIX,QAAQ,CAAC,EAAE,MAAM,CAAC;QAIlB,YAAY,CAAC,EAAE,OAAO,CAAC;QAIvB,eAAe,CAAC,EAAE,MAAM,CAAC;QAMzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAG1B,YAAY,CAAC,EAAE,MAAM,CAAC;QAEtB,SAAS,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;KAC9C,CAAC;IA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