pi2dsh 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.
- package/LICENSE +21 -0
- package/README.md +122 -0
- package/README.zh.md +122 -0
- package/dist/cli.d.mts +2 -0
- package/dist/cli.mjs +128 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/compat/pi-ai.d.mts +2597 -0
- package/dist/compat/pi-ai.d.mts.map +1 -0
- package/dist/compat/pi-ai.mjs +4669 -0
- package/dist/compat/pi-ai.mjs.map +1 -0
- package/dist/compat/pi-coding-agent.d.mts +745 -0
- package/dist/compat/pi-coding-agent.d.mts.map +1 -0
- package/dist/compat/pi-coding-agent.mjs +4 -0
- package/dist/compat/pi-tui.d.mts +3 -0
- package/dist/compat/pi-tui.mjs +3622 -0
- package/dist/compat/pi-tui.mjs.map +1 -0
- package/dist/host.d.mts +35 -0
- package/dist/host.d.mts.map +1 -0
- package/dist/host.mjs +197 -0
- package/dist/host.mjs.map +1 -0
- package/dist/index.d.mts +69 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +5 -0
- package/dist/mcp-config-jL9w70It.mjs +1535 -0
- package/dist/mcp-config-jL9w70It.mjs.map +1 -0
- package/dist/pi-coding-agent-Dsg6_0ua.mjs +2060 -0
- package/dist/pi-coding-agent-Dsg6_0ua.mjs.map +1 -0
- package/dist/pi-config-shim-CZ1wFzqM.mjs +27 -0
- package/dist/pi-config-shim-CZ1wFzqM.mjs.map +1 -0
- package/dist/pi-tui-iHoF2tFc.d.mts +1043 -0
- package/dist/pi-tui-iHoF2tFc.d.mts.map +1 -0
- package/dist/pi-tui-utils-CcaVtm-3.mjs +895 -0
- package/dist/pi-tui-utils-CcaVtm-3.mjs.map +1 -0
- package/dist/pi-types-KazmR2O5.d.mts +62 -0
- package/dist/pi-types-KazmR2O5.d.mts.map +1 -0
- package/dist/pi-uuid-Db8ShZsK.mjs +47 -0
- package/dist/pi-uuid-Db8ShZsK.mjs.map +1 -0
- package/dist/rolldown-runtime-C2Q2p085.mjs +15 -0
- package/dist/runtime-D84Hv_3m.mjs +1499 -0
- package/dist/runtime-D84Hv_3m.mjs.map +1 -0
- package/dist/runtime.d.mts +31 -0
- package/dist/runtime.d.mts.map +1 -0
- package/dist/runtime.mjs +3 -0
- package/dist/source-D7Ir-rPT.mjs +154 -0
- package/dist/source-D7Ir-rPT.mjs.map +1 -0
- package/dist/types-7IWJPPvS.d.mts +59 -0
- package/dist/types-7IWJPPvS.d.mts.map +1 -0
- package/package.json +135 -0
|
@@ -0,0 +1,745 @@
|
|
|
1
|
+
|
|
2
|
+
import { a as TextContent, i as Message, l as Usage, r as ImageContent, t as AgentMessage } from "../pi-types-KazmR2O5.mjs";
|
|
3
|
+
import { B as SettingsListTheme, F as SelectListTheme, i as Component } from "../pi-tui-iHoF2tFc.mjs";
|
|
4
|
+
//#region src/compat/vendor/pi-messages.d.ts
|
|
5
|
+
declare const COMPACTION_SUMMARY_PREFIX = "The conversation history before this point was compacted into the following summary:\n\n<summary>\n";
|
|
6
|
+
declare const COMPACTION_SUMMARY_SUFFIX = "\n</summary>";
|
|
7
|
+
declare const BRANCH_SUMMARY_PREFIX = "The following is a summary of a branch that this conversation came back from:\n\n<summary>\n";
|
|
8
|
+
declare const BRANCH_SUMMARY_SUFFIX = "</summary>";
|
|
9
|
+
/**
|
|
10
|
+
* Message type for bash executions via the ! command.
|
|
11
|
+
*/
|
|
12
|
+
interface BashExecutionMessage {
|
|
13
|
+
role: "bashExecution";
|
|
14
|
+
command: string;
|
|
15
|
+
output: string;
|
|
16
|
+
exitCode: number | undefined;
|
|
17
|
+
cancelled: boolean;
|
|
18
|
+
truncated: boolean;
|
|
19
|
+
fullOutputPath?: string;
|
|
20
|
+
timestamp: number;
|
|
21
|
+
/** If true, this message is excluded from LLM context (!! prefix) */
|
|
22
|
+
excludeFromContext?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Message type for extension-injected messages via sendMessage().
|
|
26
|
+
* These are custom messages that extensions can inject into the conversation.
|
|
27
|
+
*/
|
|
28
|
+
interface CustomMessage<T = unknown> {
|
|
29
|
+
role: "custom";
|
|
30
|
+
customType: string;
|
|
31
|
+
content: string | (TextContent | ImageContent)[];
|
|
32
|
+
display: boolean;
|
|
33
|
+
details?: T;
|
|
34
|
+
timestamp: number;
|
|
35
|
+
}
|
|
36
|
+
interface BranchSummaryMessage {
|
|
37
|
+
role: "branchSummary";
|
|
38
|
+
summary: string;
|
|
39
|
+
fromId: string;
|
|
40
|
+
timestamp: number;
|
|
41
|
+
}
|
|
42
|
+
interface CompactionSummaryMessage {
|
|
43
|
+
role: "compactionSummary";
|
|
44
|
+
summary: string;
|
|
45
|
+
tokensBefore: number;
|
|
46
|
+
timestamp: number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Convert a BashExecutionMessage to user message text for LLM context.
|
|
50
|
+
*/
|
|
51
|
+
declare function bashExecutionToText(msg: BashExecutionMessage): string;
|
|
52
|
+
declare function createBranchSummaryMessage(summary: string, fromId: string, timestamp: string): BranchSummaryMessage;
|
|
53
|
+
declare function createCompactionSummaryMessage(summary: string, tokensBefore: number, timestamp: string): CompactionSummaryMessage;
|
|
54
|
+
/** Convert CustomMessageEntry to AgentMessage format */
|
|
55
|
+
declare function createCustomMessage(customType: string, content: string | (TextContent | ImageContent)[], display: boolean, details: unknown | undefined, timestamp: string): CustomMessage;
|
|
56
|
+
/**
|
|
57
|
+
* Transform AgentMessages (including custom types) to LLM-compatible Messages.
|
|
58
|
+
*
|
|
59
|
+
* This is used by:
|
|
60
|
+
* - Agent's transormToLlm option (for prompt calls and queued messages)
|
|
61
|
+
* - Compaction's generateSummary (for summarization)
|
|
62
|
+
* - Custom extensions and tools
|
|
63
|
+
*/
|
|
64
|
+
declare function convertToLlm(messages: AgentMessage[]): Message[];
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/compat/vendor/pi-session-manager.d.ts
|
|
67
|
+
declare const CURRENT_SESSION_VERSION = 3;
|
|
68
|
+
interface SessionHeader {
|
|
69
|
+
type: "session";
|
|
70
|
+
version?: number;
|
|
71
|
+
id: string;
|
|
72
|
+
timestamp: string;
|
|
73
|
+
cwd: string;
|
|
74
|
+
parentSession?: string;
|
|
75
|
+
}
|
|
76
|
+
interface NewSessionOptions {
|
|
77
|
+
id?: string;
|
|
78
|
+
parentSession?: string;
|
|
79
|
+
}
|
|
80
|
+
interface SessionEntryBase {
|
|
81
|
+
type: string;
|
|
82
|
+
id: string;
|
|
83
|
+
parentId: string | null;
|
|
84
|
+
timestamp: string;
|
|
85
|
+
}
|
|
86
|
+
interface SessionMessageEntry extends SessionEntryBase {
|
|
87
|
+
type: "message";
|
|
88
|
+
message: AgentMessage;
|
|
89
|
+
}
|
|
90
|
+
interface ThinkingLevelChangeEntry extends SessionEntryBase {
|
|
91
|
+
type: "thinking_level_change";
|
|
92
|
+
thinkingLevel: string;
|
|
93
|
+
}
|
|
94
|
+
interface ModelChangeEntry extends SessionEntryBase {
|
|
95
|
+
type: "model_change";
|
|
96
|
+
provider: string;
|
|
97
|
+
modelId: string;
|
|
98
|
+
}
|
|
99
|
+
interface CompactionEntry<T = unknown> extends SessionEntryBase {
|
|
100
|
+
type: "compaction";
|
|
101
|
+
summary: string;
|
|
102
|
+
firstKeptEntryId: string;
|
|
103
|
+
tokensBefore: number;
|
|
104
|
+
/** Extension-specific data (e.g., ArtifactIndex, version markers for structured compaction) */
|
|
105
|
+
details?: T;
|
|
106
|
+
/** Usage from the LLM call(s) that generated this summary, if available */
|
|
107
|
+
usage?: Usage;
|
|
108
|
+
/** True if generated by an extension, undefined/false if pi-generated (backward compatible) */
|
|
109
|
+
fromHook?: boolean;
|
|
110
|
+
}
|
|
111
|
+
interface BranchSummaryEntry<T = unknown> extends SessionEntryBase {
|
|
112
|
+
type: "branch_summary";
|
|
113
|
+
fromId: string;
|
|
114
|
+
summary: string;
|
|
115
|
+
/** Extension-specific data (not sent to LLM) */
|
|
116
|
+
details?: T;
|
|
117
|
+
/** Usage from the LLM call that generated this summary, if available */
|
|
118
|
+
usage?: Usage;
|
|
119
|
+
/** True if generated by an extension, false if pi-generated */
|
|
120
|
+
fromHook?: boolean;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Custom entry for extensions to store extension-specific data in the session.
|
|
124
|
+
* Use customType to identify your extension's entries.
|
|
125
|
+
*
|
|
126
|
+
* Purpose: Persist extension state across session reloads. On reload, extensions can
|
|
127
|
+
* scan entries for their customType and reconstruct internal state.
|
|
128
|
+
*
|
|
129
|
+
* Does NOT participate in LLM context (ignored by buildSessionContext).
|
|
130
|
+
* For injecting content into context, see CustomMessageEntry.
|
|
131
|
+
*/
|
|
132
|
+
interface CustomEntry<T = unknown> extends SessionEntryBase {
|
|
133
|
+
type: "custom";
|
|
134
|
+
customType: string;
|
|
135
|
+
data?: T;
|
|
136
|
+
}
|
|
137
|
+
/** Label entry for user-defined bookmarks/markers on entries. */
|
|
138
|
+
interface LabelEntry extends SessionEntryBase {
|
|
139
|
+
type: "label";
|
|
140
|
+
targetId: string;
|
|
141
|
+
label: string | undefined;
|
|
142
|
+
}
|
|
143
|
+
/** Session metadata entry (e.g., user-defined display name). */
|
|
144
|
+
interface SessionInfoEntry extends SessionEntryBase {
|
|
145
|
+
type: "session_info";
|
|
146
|
+
name?: string;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Custom message entry for extensions to inject messages into LLM context.
|
|
150
|
+
* Use customType to identify your extension's entries.
|
|
151
|
+
*
|
|
152
|
+
* Unlike CustomEntry, this DOES participate in LLM context.
|
|
153
|
+
* The content is converted to a user message in buildSessionContext().
|
|
154
|
+
* Use details for extension-specific metadata (not sent to LLM).
|
|
155
|
+
*
|
|
156
|
+
* display controls TUI rendering:
|
|
157
|
+
* - false: hidden entirely
|
|
158
|
+
* - true: rendered with distinct styling (different from user messages)
|
|
159
|
+
*/
|
|
160
|
+
interface CustomMessageEntry<T = unknown> extends SessionEntryBase {
|
|
161
|
+
type: "custom_message";
|
|
162
|
+
customType: string;
|
|
163
|
+
content: string | (TextContent | ImageContent)[];
|
|
164
|
+
details?: T;
|
|
165
|
+
display: boolean;
|
|
166
|
+
}
|
|
167
|
+
/** Session entry - has id/parentId for tree structure (returned by "read" methods in SessionManager) */
|
|
168
|
+
type SessionEntry = SessionMessageEntry | ThinkingLevelChangeEntry | ModelChangeEntry | CompactionEntry | BranchSummaryEntry | CustomEntry | CustomMessageEntry | LabelEntry | SessionInfoEntry;
|
|
169
|
+
/** Raw file entry (includes header) */
|
|
170
|
+
type FileEntry = SessionHeader | SessionEntry;
|
|
171
|
+
/** Tree node for getTree() - defensive copy of session structure */
|
|
172
|
+
interface SessionTreeNode {
|
|
173
|
+
entry: SessionEntry;
|
|
174
|
+
children: SessionTreeNode[];
|
|
175
|
+
/** Resolved label for this entry, if any */
|
|
176
|
+
label?: string;
|
|
177
|
+
/** Timestamp of the latest label change for this entry, if any */
|
|
178
|
+
labelTimestamp?: string;
|
|
179
|
+
}
|
|
180
|
+
interface SessionContext {
|
|
181
|
+
messages: AgentMessage[];
|
|
182
|
+
thinkingLevel: string;
|
|
183
|
+
model: {
|
|
184
|
+
provider: string;
|
|
185
|
+
modelId: string;
|
|
186
|
+
} | null;
|
|
187
|
+
}
|
|
188
|
+
interface SessionInfo {
|
|
189
|
+
path: string;
|
|
190
|
+
id: string;
|
|
191
|
+
/** Working directory where the session was started. Empty string for old sessions. */
|
|
192
|
+
cwd: string;
|
|
193
|
+
/** User-defined display name from session_info entries. */
|
|
194
|
+
name?: string;
|
|
195
|
+
/** Path to the parent session (if this session was forked). */
|
|
196
|
+
parentSessionPath?: string;
|
|
197
|
+
created: Date;
|
|
198
|
+
modified: Date;
|
|
199
|
+
messageCount: number;
|
|
200
|
+
firstMessage: string;
|
|
201
|
+
allMessagesText: string;
|
|
202
|
+
}
|
|
203
|
+
declare function assertValidSessionId(id: string): void;
|
|
204
|
+
/** Exported for testing */
|
|
205
|
+
declare function migrateSessionEntries(entries: FileEntry[]): void;
|
|
206
|
+
/** Exported for compaction.test.ts */
|
|
207
|
+
declare function parseSessionEntries(content: string): FileEntry[];
|
|
208
|
+
declare function getLatestCompactionEntry(entries: SessionEntry[]): CompactionEntry | null;
|
|
209
|
+
/**
|
|
210
|
+
* Project one selected session entry into LLM/runtime messages.
|
|
211
|
+
* Plain custom entries are display/state entries and do not participate in context.
|
|
212
|
+
*/
|
|
213
|
+
declare function sessionEntryToContextMessages(entry: SessionEntry): AgentMessage[];
|
|
214
|
+
/**
|
|
215
|
+
* Build the active, compaction-aware session entry list.
|
|
216
|
+
*
|
|
217
|
+
* This follows the current leaf path. If the path contains compaction entries,
|
|
218
|
+
* the latest compaction is represented by the compaction entry itself, followed
|
|
219
|
+
* by the kept entries starting at firstKeptEntryId and all entries after the
|
|
220
|
+
* compaction entry. Older summarized entries are omitted.
|
|
221
|
+
*/
|
|
222
|
+
declare function buildContextEntries(entries: SessionEntry[], leafId?: string | null, byId?: Map<string, SessionEntry>): SessionEntry[];
|
|
223
|
+
/**
|
|
224
|
+
* Build the session context from entries using tree traversal.
|
|
225
|
+
* If leafId is provided, walks from that entry to root.
|
|
226
|
+
* Handles compaction and branch summaries along the path.
|
|
227
|
+
*/
|
|
228
|
+
declare function buildSessionContext(entries: SessionEntry[], leafId?: string | null, byId?: Map<string, SessionEntry>): SessionContext;
|
|
229
|
+
declare function getDefaultSessionDir(cwd: string, agentDir?: string): string;
|
|
230
|
+
/** Exported for testing */
|
|
231
|
+
declare function loadEntriesFromFile(filePath: string): FileEntry[];
|
|
232
|
+
/** Exported for testing */
|
|
233
|
+
declare function findMostRecentSession(sessionDir: string, cwd?: string): string | null;
|
|
234
|
+
type SessionListProgress = (loaded: number, total: number) => void;
|
|
235
|
+
/**
|
|
236
|
+
* Manages conversation sessions as append-only trees stored in JSONL files.
|
|
237
|
+
*
|
|
238
|
+
* Each session entry has an id and parentId forming a tree structure. The "leaf"
|
|
239
|
+
* pointer tracks the current position. Appending creates a child of the current leaf.
|
|
240
|
+
* Branching moves the leaf to an earlier entry, allowing new branches without
|
|
241
|
+
* modifying history.
|
|
242
|
+
*
|
|
243
|
+
* Use buildSessionContext() to get the resolved message list for the LLM, which
|
|
244
|
+
* handles compaction summaries and follows the path from root to current leaf.
|
|
245
|
+
*/
|
|
246
|
+
declare class SessionManager {
|
|
247
|
+
private sessionId;
|
|
248
|
+
private sessionFile;
|
|
249
|
+
private sessionDir;
|
|
250
|
+
private cwd;
|
|
251
|
+
private persist;
|
|
252
|
+
private flushed;
|
|
253
|
+
private fileEntries;
|
|
254
|
+
private byId;
|
|
255
|
+
private labelsById;
|
|
256
|
+
private labelTimestampsById;
|
|
257
|
+
private leafId;
|
|
258
|
+
private constructor();
|
|
259
|
+
/** Switch to a different session file (used for resume and branching) */
|
|
260
|
+
setSessionFile(sessionFile: string): void;
|
|
261
|
+
private _setSessionFile;
|
|
262
|
+
newSession(options?: NewSessionOptions): string | undefined;
|
|
263
|
+
private _buildIndex;
|
|
264
|
+
private _rewriteFile;
|
|
265
|
+
isPersisted(): boolean;
|
|
266
|
+
getCwd(): string;
|
|
267
|
+
getSessionDir(): string;
|
|
268
|
+
usesDefaultSessionDir(): boolean;
|
|
269
|
+
getSessionId(): string;
|
|
270
|
+
getSessionFile(): string | undefined;
|
|
271
|
+
_persist(entry: SessionEntry): void;
|
|
272
|
+
private _appendEntry;
|
|
273
|
+
/** Append a message as child of current leaf, then advance leaf. Returns entry id.
|
|
274
|
+
* Does not allow writing CompactionSummaryMessage and BranchSummaryMessage directly.
|
|
275
|
+
* Reason: we want these to be top-level entries in the session, not message session entries,
|
|
276
|
+
* so it is easier to find them.
|
|
277
|
+
* These need to be appended via appendCompaction() and appendBranchSummary() methods.
|
|
278
|
+
*/
|
|
279
|
+
appendMessage(message: Message | CustomMessage | BashExecutionMessage): string;
|
|
280
|
+
/** Append a thinking level change as child of current leaf, then advance leaf. Returns entry id. */
|
|
281
|
+
appendThinkingLevelChange(thinkingLevel: string): string;
|
|
282
|
+
/** Append a model change as child of current leaf, then advance leaf. Returns entry id. */
|
|
283
|
+
appendModelChange(provider: string, modelId: string): string;
|
|
284
|
+
/** Append a compaction summary as child of current leaf, then advance leaf. Returns entry id. */
|
|
285
|
+
appendCompaction<T = unknown>(summary: string, firstKeptEntryId: string, tokensBefore: number, details?: T, fromHook?: boolean, usage?: Usage): string;
|
|
286
|
+
/** Append a custom entry (for extensions) as child of current leaf, then advance leaf. Returns entry id. */
|
|
287
|
+
appendCustomEntry(customType: string, data?: unknown): string;
|
|
288
|
+
/** Append a session info entry (e.g., display name). Returns entry id. */
|
|
289
|
+
appendSessionInfo(name: string): string;
|
|
290
|
+
/** Get the current session name from the latest session_info entry, if any. */
|
|
291
|
+
getSessionName(): string | undefined;
|
|
292
|
+
/**
|
|
293
|
+
* Append a custom message entry (for extensions) that participates in LLM context.
|
|
294
|
+
* @param customType Extension identifier for filtering on reload
|
|
295
|
+
* @param content Message content (string or TextContent/ImageContent array)
|
|
296
|
+
* @param display Whether to show in TUI (true = styled display, false = hidden)
|
|
297
|
+
* @param details Optional extension-specific metadata (not sent to LLM)
|
|
298
|
+
* @returns Entry id
|
|
299
|
+
*/
|
|
300
|
+
appendCustomMessageEntry<T = unknown>(customType: string, content: string | (TextContent | ImageContent)[], display: boolean, details?: T): string;
|
|
301
|
+
getLeafId(): string | null;
|
|
302
|
+
getLeafEntry(): SessionEntry | undefined;
|
|
303
|
+
getEntry(id: string): SessionEntry | undefined;
|
|
304
|
+
/**
|
|
305
|
+
* Get all direct children of an entry.
|
|
306
|
+
*/
|
|
307
|
+
getChildren(parentId: string): SessionEntry[];
|
|
308
|
+
/**
|
|
309
|
+
* Get the label for an entry, if any.
|
|
310
|
+
*/
|
|
311
|
+
getLabel(id: string): string | undefined;
|
|
312
|
+
/**
|
|
313
|
+
* Set or clear a label on an entry.
|
|
314
|
+
* Labels are user-defined markers for bookmarking/navigation.
|
|
315
|
+
* Pass undefined or empty string to clear the label.
|
|
316
|
+
*/
|
|
317
|
+
appendLabelChange(targetId: string, label: string | undefined): string;
|
|
318
|
+
/**
|
|
319
|
+
* Walk from entry to root, returning all entries in path order.
|
|
320
|
+
* Includes all entry types (messages, compaction, model changes, etc.).
|
|
321
|
+
* Use buildSessionContext() to get the resolved messages for the LLM.
|
|
322
|
+
*/
|
|
323
|
+
getBranch(fromId?: string): SessionEntry[];
|
|
324
|
+
/**
|
|
325
|
+
* Build the active, compaction-aware entry list for context/rendering.
|
|
326
|
+
* Uses tree traversal from current leaf.
|
|
327
|
+
*/
|
|
328
|
+
buildContextEntries(): SessionEntry[];
|
|
329
|
+
/**
|
|
330
|
+
* Build the session context (what gets sent to the LLM).
|
|
331
|
+
* Uses tree traversal from current leaf.
|
|
332
|
+
*/
|
|
333
|
+
buildSessionContext(): SessionContext;
|
|
334
|
+
/**
|
|
335
|
+
* Get session header.
|
|
336
|
+
*/
|
|
337
|
+
getHeader(): SessionHeader | null;
|
|
338
|
+
/**
|
|
339
|
+
* Get all session entries (excludes header). Returns a shallow copy.
|
|
340
|
+
* The session is append-only: use appendXXX() to add entries, branch() to
|
|
341
|
+
* change the leaf pointer. Entries cannot be modified or deleted.
|
|
342
|
+
*/
|
|
343
|
+
getEntries(): SessionEntry[];
|
|
344
|
+
/**
|
|
345
|
+
* Get the session as a tree structure. Returns a shallow defensive copy of all entries.
|
|
346
|
+
* A well-formed session has exactly one root (first entry with parentId === null).
|
|
347
|
+
* Orphaned entries (broken parent chain) are also returned as roots.
|
|
348
|
+
*/
|
|
349
|
+
getTree(): SessionTreeNode[];
|
|
350
|
+
/**
|
|
351
|
+
* Start a new branch from an earlier entry.
|
|
352
|
+
* Moves the leaf pointer to the specified entry. The next appendXXX() call
|
|
353
|
+
* will create a child of that entry, forming a new branch. Existing entries
|
|
354
|
+
* are not modified or deleted.
|
|
355
|
+
*/
|
|
356
|
+
branch(branchFromId: string): void;
|
|
357
|
+
/**
|
|
358
|
+
* Reset the leaf pointer to null (before any entries).
|
|
359
|
+
* The next appendXXX() call will create a new root entry (parentId = null).
|
|
360
|
+
* Use this when navigating to re-edit the first user message.
|
|
361
|
+
*/
|
|
362
|
+
resetLeaf(): void;
|
|
363
|
+
/**
|
|
364
|
+
* Start a new branch with a summary of the abandoned path.
|
|
365
|
+
* Same as branch(), but also appends a branch_summary entry that captures
|
|
366
|
+
* context from the abandoned conversation path.
|
|
367
|
+
*/
|
|
368
|
+
branchWithSummary(branchFromId: string | null, summary: string, details?: unknown, fromHook?: boolean, usage?: Usage): string;
|
|
369
|
+
/**
|
|
370
|
+
* Create a new session file containing only the path from root to the specified leaf.
|
|
371
|
+
* Useful for extracting a single conversation path from a branched session.
|
|
372
|
+
* Returns the new session file path, or undefined if not persisting.
|
|
373
|
+
*/
|
|
374
|
+
createBranchedSession(leafId: string): string | undefined;
|
|
375
|
+
/**
|
|
376
|
+
* Create a new session.
|
|
377
|
+
* @param cwd Working directory (stored in session header)
|
|
378
|
+
* @param sessionDir Optional session directory. If omitted, uses default (~/.pi/agent/sessions/<encoded-cwd>/).
|
|
379
|
+
*/
|
|
380
|
+
static create(cwd: string, sessionDir?: string, options?: NewSessionOptions): SessionManager;
|
|
381
|
+
/**
|
|
382
|
+
* Open a specific session file.
|
|
383
|
+
* @param path Path to session file
|
|
384
|
+
* @param sessionDir Optional session directory for /new or /branch. If omitted, derives from file's parent.
|
|
385
|
+
* @param cwdOverride Optional cwd override instead of the session header cwd.
|
|
386
|
+
*/
|
|
387
|
+
static open(path: string, sessionDir?: string, cwdOverride?: string): SessionManager;
|
|
388
|
+
/**
|
|
389
|
+
* Continue the most recent session, or create new if none.
|
|
390
|
+
* @param cwd Working directory
|
|
391
|
+
* @param sessionDir Optional session directory. If omitted, uses default (~/.pi/agent/sessions/<encoded-cwd>/).
|
|
392
|
+
*/
|
|
393
|
+
static continueRecent(cwd: string, sessionDir?: string): SessionManager;
|
|
394
|
+
/** Create an in-memory session (no file persistence) */
|
|
395
|
+
static inMemory(cwd?: string, options?: NewSessionOptions): SessionManager;
|
|
396
|
+
/**
|
|
397
|
+
* Fork a session from another project directory into the current project.
|
|
398
|
+
* Creates a new session in the target cwd with the full history from the source session.
|
|
399
|
+
* @param sourcePath Path to the source session file
|
|
400
|
+
* @param targetCwd Target working directory (where the new session will be stored)
|
|
401
|
+
* @param sessionDir Optional session directory. If omitted, uses default for targetCwd.
|
|
402
|
+
*/
|
|
403
|
+
static forkFrom(sourcePath: string, targetCwd: string, sessionDir?: string, options?: NewSessionOptions): SessionManager;
|
|
404
|
+
/**
|
|
405
|
+
* List all sessions for a directory.
|
|
406
|
+
* @param cwd Working directory (used to compute default session directory)
|
|
407
|
+
* @param sessionDir Optional session directory. If omitted, uses default (~/.pi/agent/sessions/<encoded-cwd>/).
|
|
408
|
+
* @param onProgress Optional callback for progress updates (loaded, total)
|
|
409
|
+
*/
|
|
410
|
+
static list(cwd: string, sessionDir?: string, onProgress?: SessionListProgress): Promise<SessionInfo[]>;
|
|
411
|
+
/**
|
|
412
|
+
* List all sessions across all project directories.
|
|
413
|
+
* @param onProgress Optional callback for progress updates (loaded, total)
|
|
414
|
+
*/
|
|
415
|
+
static listAll(onProgress?: SessionListProgress): Promise<SessionInfo[]>;
|
|
416
|
+
static listAll(sessionDir?: string, onProgress?: SessionListProgress): Promise<SessionInfo[]>;
|
|
417
|
+
}
|
|
418
|
+
//#endregion
|
|
419
|
+
//#region src/compat/vendor/pi-truncate.d.ts
|
|
420
|
+
/**
|
|
421
|
+
* Shared truncation utilities for tool outputs.
|
|
422
|
+
*
|
|
423
|
+
* Truncation is based on two independent limits - whichever is hit first wins:
|
|
424
|
+
* - Line limit (default: 2000 lines)
|
|
425
|
+
* - Byte limit (default: 50KB)
|
|
426
|
+
*
|
|
427
|
+
* Never returns partial lines (except bash tail truncation edge case).
|
|
428
|
+
*/
|
|
429
|
+
declare const DEFAULT_MAX_LINES = 2000;
|
|
430
|
+
declare const DEFAULT_MAX_BYTES: number;
|
|
431
|
+
interface TruncationResult {
|
|
432
|
+
/** The truncated content */
|
|
433
|
+
content: string;
|
|
434
|
+
/** Whether truncation occurred */
|
|
435
|
+
truncated: boolean;
|
|
436
|
+
/** Which limit was hit: "lines", "bytes", or null if not truncated */
|
|
437
|
+
truncatedBy: "lines" | "bytes" | null;
|
|
438
|
+
/** Total number of lines in the original content */
|
|
439
|
+
totalLines: number;
|
|
440
|
+
/** Total number of bytes in the original content */
|
|
441
|
+
totalBytes: number;
|
|
442
|
+
/** Number of complete lines in the truncated output */
|
|
443
|
+
outputLines: number;
|
|
444
|
+
/** Number of bytes in the truncated output */
|
|
445
|
+
outputBytes: number;
|
|
446
|
+
/** Whether the last line was partially truncated (only for tail truncation edge case) */
|
|
447
|
+
lastLinePartial: boolean;
|
|
448
|
+
/** Whether the first line exceeded the byte limit (for head truncation) */
|
|
449
|
+
firstLineExceedsLimit: boolean;
|
|
450
|
+
/** The max lines limit that was applied */
|
|
451
|
+
maxLines: number;
|
|
452
|
+
/** The max bytes limit that was applied */
|
|
453
|
+
maxBytes: number;
|
|
454
|
+
}
|
|
455
|
+
interface TruncationOptions {
|
|
456
|
+
/** Maximum number of lines (default: 2000) */
|
|
457
|
+
maxLines?: number;
|
|
458
|
+
/** Maximum number of bytes (default: 50KB) */
|
|
459
|
+
maxBytes?: number;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Format bytes as human-readable size.
|
|
463
|
+
*/
|
|
464
|
+
declare function formatSize(bytes: number): string;
|
|
465
|
+
/**
|
|
466
|
+
* Truncate content from the head (keep first N lines/bytes).
|
|
467
|
+
* Suitable for file reads where you want to see the beginning.
|
|
468
|
+
*
|
|
469
|
+
* Never returns partial lines. If first line exceeds byte limit,
|
|
470
|
+
* returns empty content with firstLineExceedsLimit=true.
|
|
471
|
+
*/
|
|
472
|
+
declare function truncateHead(content: string, options?: TruncationOptions): TruncationResult;
|
|
473
|
+
/**
|
|
474
|
+
* Truncate content from the tail (keep last N lines/bytes).
|
|
475
|
+
* Suitable for bash output where you want to see the end (errors, final results).
|
|
476
|
+
*
|
|
477
|
+
* May return partial first line if the last line of original content exceeds byte limit.
|
|
478
|
+
*/
|
|
479
|
+
declare function truncateTail(content: string, options?: TruncationOptions): TruncationResult;
|
|
480
|
+
/**
|
|
481
|
+
* Truncate a single line to max characters, adding [truncated] suffix.
|
|
482
|
+
* Used for grep match lines.
|
|
483
|
+
*/
|
|
484
|
+
declare function truncateLine(line: string, maxChars?: number): {
|
|
485
|
+
text: string;
|
|
486
|
+
wasTruncated: boolean;
|
|
487
|
+
};
|
|
488
|
+
//#endregion
|
|
489
|
+
//#region src/compat/vendor/pi-file-mutation-queue.d.ts
|
|
490
|
+
/**
|
|
491
|
+
* Serialize file mutation operations targeting the same file.
|
|
492
|
+
* Operations for different files still run in parallel.
|
|
493
|
+
*/
|
|
494
|
+
declare function withFileMutationQueue<T>(filePath: string, fn: () => Promise<T>): Promise<T>;
|
|
495
|
+
//#endregion
|
|
496
|
+
//#region src/compat/vendor/pi-config-shim.d.ts
|
|
497
|
+
declare function getAgentDir(): string;
|
|
498
|
+
//#endregion
|
|
499
|
+
//#region src/compat/pi-coding-agent.d.ts
|
|
500
|
+
declare const CONFIG_DIR_NAME = ".pi";
|
|
501
|
+
declare const VERSION = "pi2dsh-compat";
|
|
502
|
+
declare function defineTool<T>(tool: T): T;
|
|
503
|
+
type ThemeColor = string;
|
|
504
|
+
type ThemeBg = string;
|
|
505
|
+
type ColorMode = 'truecolor' | '256' | '16' | 'none';
|
|
506
|
+
declare class Theme {
|
|
507
|
+
name: string;
|
|
508
|
+
constructor(name?: string);
|
|
509
|
+
fg(_color: ThemeColor, text: string): string;
|
|
510
|
+
bg(_color: ThemeBg, text: string): string;
|
|
511
|
+
bold(text: string): string;
|
|
512
|
+
italic(text: string): string;
|
|
513
|
+
underline(text: string): string;
|
|
514
|
+
inverse(text: string): string;
|
|
515
|
+
strikethrough(text: string): string;
|
|
516
|
+
getFgAnsi(_color: ThemeColor): string;
|
|
517
|
+
getBgAnsi(_color: ThemeBg): string;
|
|
518
|
+
getColorMode(): ColorMode;
|
|
519
|
+
getThinkingBorderColor(_level: unknown): (str: string) => string;
|
|
520
|
+
getBashModeBorderColor(): (str: string) => string;
|
|
521
|
+
}
|
|
522
|
+
declare const theme: Theme;
|
|
523
|
+
declare function initTheme(_themeName?: string, _enableWatcher?: boolean): void;
|
|
524
|
+
declare function getSettingsListTheme(): SettingsListTheme;
|
|
525
|
+
declare function getSelectListTheme(): SelectListTheme;
|
|
526
|
+
declare function getMarkdownTheme(): Record<string, unknown>;
|
|
527
|
+
declare function getLanguageFromPath(filePath: string): string | undefined;
|
|
528
|
+
declare function highlightCode(code: string, _lang?: string): string[];
|
|
529
|
+
declare class DynamicBorder implements Component {
|
|
530
|
+
private color;
|
|
531
|
+
constructor(color?: (str: string) => string);
|
|
532
|
+
render(width: number): string[];
|
|
533
|
+
invalidate(): void;
|
|
534
|
+
}
|
|
535
|
+
declare function estimateTokens(message: AgentMessage): number;
|
|
536
|
+
declare function calculateContextTokens(messages: AgentMessage[]): number;
|
|
537
|
+
declare const DEFAULT_COMPACTION_SETTINGS: Readonly<{
|
|
538
|
+
enabled: true;
|
|
539
|
+
reserveTokens: 30000;
|
|
540
|
+
keepRecentTokens: 20000;
|
|
541
|
+
}>;
|
|
542
|
+
declare function shouldCompact(..._args: unknown[]): boolean;
|
|
543
|
+
declare function compact(..._args: unknown[]): never;
|
|
544
|
+
declare function findCutPoint(..._args: unknown[]): never;
|
|
545
|
+
declare function generateSummary(..._args: unknown[]): never;
|
|
546
|
+
declare function generateSummaryWithUsage(..._args: unknown[]): never;
|
|
547
|
+
declare function generateBranchSummary(..._args: unknown[]): never;
|
|
548
|
+
declare function serializeConversation(messages: AgentMessage[]): string;
|
|
549
|
+
declare function parseFrontmatter(text: string): {
|
|
550
|
+
attributes: Record<string, string>;
|
|
551
|
+
body: string;
|
|
552
|
+
};
|
|
553
|
+
declare function stripFrontmatter(text: string): string;
|
|
554
|
+
declare function copyToClipboard(text: string): Promise<boolean>;
|
|
555
|
+
interface ImageResizeOptions {
|
|
556
|
+
maxWidth?: number;
|
|
557
|
+
maxHeight?: number;
|
|
558
|
+
[key: string]: unknown;
|
|
559
|
+
}
|
|
560
|
+
interface ResizedImage {
|
|
561
|
+
data: string;
|
|
562
|
+
mimeType: string;
|
|
563
|
+
width?: number;
|
|
564
|
+
height?: number;
|
|
565
|
+
[key: string]: unknown;
|
|
566
|
+
}
|
|
567
|
+
declare function resizeImage(data: string, mimeType: string, _options?: ImageResizeOptions): Promise<ResizedImage>;
|
|
568
|
+
declare function convertToPng(data: string, mimeType: string): Promise<ResizedImage>;
|
|
569
|
+
interface ShellConfig {
|
|
570
|
+
shell: string;
|
|
571
|
+
args: string[];
|
|
572
|
+
}
|
|
573
|
+
declare function getShellConfig(): ShellConfig;
|
|
574
|
+
declare function getPackageDir(): string;
|
|
575
|
+
interface StoredCredential {
|
|
576
|
+
type?: string;
|
|
577
|
+
[key: string]: unknown;
|
|
578
|
+
}
|
|
579
|
+
declare function readStoredCredential(providerId: string, authPath?: string): StoredCredential | undefined;
|
|
580
|
+
interface ParsedSkillBlock {
|
|
581
|
+
name: string;
|
|
582
|
+
content: string;
|
|
583
|
+
[key: string]: unknown;
|
|
584
|
+
}
|
|
585
|
+
declare function parseSkillBlock(text: string): ParsedSkillBlock | null;
|
|
586
|
+
declare function wrapRegisteredTool(..._args: unknown[]): never;
|
|
587
|
+
declare function getBinDir(): string;
|
|
588
|
+
type SettingsRecord = Record<string, unknown>;
|
|
589
|
+
interface SettingsManagerCreateOptions {
|
|
590
|
+
[key: string]: unknown;
|
|
591
|
+
}
|
|
592
|
+
interface RetrySettings {
|
|
593
|
+
enabled: boolean;
|
|
594
|
+
maxRetries: number;
|
|
595
|
+
baseDelayMs: number;
|
|
596
|
+
}
|
|
597
|
+
interface CompactionSettings {
|
|
598
|
+
enabled: boolean;
|
|
599
|
+
reserveTokens: number;
|
|
600
|
+
keepRecentTokens: number;
|
|
601
|
+
}
|
|
602
|
+
type DefaultProjectTrust = 'ask' | 'always' | 'never';
|
|
603
|
+
type TuiMode = 'regular' | 'fullscreen';
|
|
604
|
+
type PackageSource = string | Record<string, unknown>;
|
|
605
|
+
declare class SettingsManager {
|
|
606
|
+
private globalSettings;
|
|
607
|
+
private projectSettings;
|
|
608
|
+
private constructor();
|
|
609
|
+
static create(_cwd?: string, _agentDir?: string, options?: SettingsManagerCreateOptions): SettingsManager;
|
|
610
|
+
static fromStorage(_storage: unknown, options?: SettingsManagerCreateOptions): SettingsManager;
|
|
611
|
+
static inMemory(settings?: SettingsRecord, _options?: SettingsManagerCreateOptions): SettingsManager;
|
|
612
|
+
private get merged();
|
|
613
|
+
private read;
|
|
614
|
+
reload(): Promise<void>;
|
|
615
|
+
flush(): Promise<void>;
|
|
616
|
+
drainErrors(): unknown[];
|
|
617
|
+
applyOverrides(overrides: SettingsRecord): void;
|
|
618
|
+
getGlobalSettings(): SettingsRecord;
|
|
619
|
+
getProjectSettings(): SettingsRecord;
|
|
620
|
+
isProjectTrusted(): boolean;
|
|
621
|
+
setProjectTrusted(trusted: boolean): void;
|
|
622
|
+
getDefaultProjectTrust(): DefaultProjectTrust;
|
|
623
|
+
getDefaultProvider(): string | undefined;
|
|
624
|
+
getDefaultModel(): string | undefined;
|
|
625
|
+
setDefaultProvider(provider: string): void;
|
|
626
|
+
setDefaultModel(model: string): void;
|
|
627
|
+
setDefaultModelAndProvider(model: string, provider: string): void;
|
|
628
|
+
getDefaultThinkingLevel(): string | undefined;
|
|
629
|
+
getThemeSetting(): string | undefined;
|
|
630
|
+
getTheme(): string | undefined;
|
|
631
|
+
setTheme(themeName: string): void;
|
|
632
|
+
getCompactionSettings(): CompactionSettings;
|
|
633
|
+
getBranchSummarySettings(): {
|
|
634
|
+
reserveTokens: number;
|
|
635
|
+
skipPrompt: boolean;
|
|
636
|
+
};
|
|
637
|
+
getRetrySettings(): RetrySettings;
|
|
638
|
+
getProviderRetrySettings(): RetrySettings;
|
|
639
|
+
getHttpIdleTimeoutMs(): number;
|
|
640
|
+
getWebSocketConnectTimeoutMs(): number;
|
|
641
|
+
getPackages(): PackageSource[];
|
|
642
|
+
getExtensionPaths(): string[];
|
|
643
|
+
getSkillPaths(): string[];
|
|
644
|
+
getPromptTemplatePaths(): string[];
|
|
645
|
+
getThemePaths(): string[];
|
|
646
|
+
getTuiMode(): TuiMode;
|
|
647
|
+
getShowImages(): boolean;
|
|
648
|
+
getImageWidthCells(): number;
|
|
649
|
+
getClearOnShrink(): boolean;
|
|
650
|
+
getShowTerminalProgress(): boolean;
|
|
651
|
+
getHideThinkingBlock(): boolean;
|
|
652
|
+
getExternalEditorCommand(): string | undefined;
|
|
653
|
+
getSteeringMode(): 'all' | 'one-at-a-time';
|
|
654
|
+
getFollowUpMode(): string;
|
|
655
|
+
getShellPath(): string | undefined;
|
|
656
|
+
getShellCommandPrefix(): string | undefined;
|
|
657
|
+
getNpmCommand(): string[] | undefined;
|
|
658
|
+
getEnableSkillCommands(): boolean;
|
|
659
|
+
getEnableAnalytics(): boolean;
|
|
660
|
+
getTrackingId(): string | undefined;
|
|
661
|
+
}
|
|
662
|
+
declare class InMemorySettingsStorage {
|
|
663
|
+
settings: SettingsRecord;
|
|
664
|
+
constructor(settings?: SettingsRecord);
|
|
665
|
+
withLock<T>(_scope: string, fn: () => Promise<T> | T): Promise<T>;
|
|
666
|
+
}
|
|
667
|
+
declare class FileSettingsStorage extends InMemorySettingsStorage {}
|
|
668
|
+
declare const ProjectTrustStore: new (...args: unknown[]) => never;
|
|
669
|
+
declare const DefaultResourceLoader: new (...args: unknown[]) => never;
|
|
670
|
+
declare const DefaultPackageManager: new (...args: unknown[]) => never;
|
|
671
|
+
declare const ModelRuntime: new (...args: unknown[]) => never;
|
|
672
|
+
declare class ModelRegistry {
|
|
673
|
+
private models;
|
|
674
|
+
register(id: string, model: unknown): void;
|
|
675
|
+
get(id: string): unknown;
|
|
676
|
+
list(): unknown[];
|
|
677
|
+
}
|
|
678
|
+
declare function createAgentSession(..._args: unknown[]): never;
|
|
679
|
+
declare function createCodingTools(..._args: unknown[]): never;
|
|
680
|
+
declare function createReadOnlyTools(..._args: unknown[]): never;
|
|
681
|
+
declare function createBashTool(..._args: unknown[]): never;
|
|
682
|
+
declare function createReadTool(..._args: unknown[]): never;
|
|
683
|
+
declare function createEditTool(..._args: unknown[]): never;
|
|
684
|
+
declare function createWriteTool(..._args: unknown[]): never;
|
|
685
|
+
declare function createGrepTool(..._args: unknown[]): never;
|
|
686
|
+
declare function createFindTool(..._args: unknown[]): never;
|
|
687
|
+
declare function createLsTool(..._args: unknown[]): never;
|
|
688
|
+
declare function loadSkills(..._args: unknown[]): never;
|
|
689
|
+
declare function loadSkillsFromDir(..._args: unknown[]): never;
|
|
690
|
+
declare function formatSkillsForPrompt(..._args: unknown[]): never;
|
|
691
|
+
declare function createEventBus(): {
|
|
692
|
+
emit(channel: string, data: unknown): void;
|
|
693
|
+
on(channel: string, handler: (data: unknown) => void): () => void;
|
|
694
|
+
clear(): void;
|
|
695
|
+
};
|
|
696
|
+
declare class HeadlessComponent implements Component {
|
|
697
|
+
render(_width: number): string[];
|
|
698
|
+
invalidate(): void;
|
|
699
|
+
}
|
|
700
|
+
declare class ToolExecutionComponent extends HeadlessComponent {}
|
|
701
|
+
declare class FooterComponent extends HeadlessComponent {}
|
|
702
|
+
declare class BorderedLoader extends HeadlessComponent {
|
|
703
|
+
start(): void;
|
|
704
|
+
stop(): void;
|
|
705
|
+
dispose(): void;
|
|
706
|
+
}
|
|
707
|
+
declare class CustomMessageComponent extends HeadlessComponent {}
|
|
708
|
+
declare class AssistantMessageComponent extends HeadlessComponent {}
|
|
709
|
+
declare class UserMessageComponent extends HeadlessComponent {}
|
|
710
|
+
declare class ExtensionSelectorComponent extends HeadlessComponent {}
|
|
711
|
+
declare class ExtensionInputComponent extends HeadlessComponent {}
|
|
712
|
+
declare class ExtensionEditorComponent extends HeadlessComponent {}
|
|
713
|
+
declare class SettingsSelectorComponent extends HeadlessComponent {}
|
|
714
|
+
declare class CustomEditor extends HeadlessComponent {
|
|
715
|
+
private text;
|
|
716
|
+
onSubmit?: (text: string) => void;
|
|
717
|
+
onChange?: (text: string) => void;
|
|
718
|
+
getText(): string;
|
|
719
|
+
setText(text: string): void;
|
|
720
|
+
handleInput(data: string): void;
|
|
721
|
+
}
|
|
722
|
+
interface ToolExecutionOptions {
|
|
723
|
+
[key: string]: unknown;
|
|
724
|
+
}
|
|
725
|
+
interface SettingsConfig {
|
|
726
|
+
[key: string]: unknown;
|
|
727
|
+
}
|
|
728
|
+
interface SettingsCallbacks {
|
|
729
|
+
[key: string]: unknown;
|
|
730
|
+
}
|
|
731
|
+
interface RenderDiffOptions {
|
|
732
|
+
[key: string]: unknown;
|
|
733
|
+
}
|
|
734
|
+
declare function renderDiff(oldText: string, newText: string, _options?: RenderDiffOptions): string[];
|
|
735
|
+
interface VisualTruncateResult {
|
|
736
|
+
visualLines: string[];
|
|
737
|
+
skippedCount: number;
|
|
738
|
+
}
|
|
739
|
+
declare function truncateToVisualLines(text: string, maxVisualLines: number, width: number, paddingX?: number): VisualTruncateResult;
|
|
740
|
+
declare function keyHint(keybinding: string, description: string): string;
|
|
741
|
+
declare function keyText(keybinding: string): string;
|
|
742
|
+
declare function rawKeyHint(key: string, description: string): string;
|
|
743
|
+
//#endregion
|
|
744
|
+
export { AssistantMessageComponent, BRANCH_SUMMARY_PREFIX, BRANCH_SUMMARY_SUFFIX, type BashExecutionMessage, BorderedLoader, type BranchSummaryEntry, type BranchSummaryMessage, COMPACTION_SUMMARY_PREFIX, COMPACTION_SUMMARY_SUFFIX, CONFIG_DIR_NAME, CURRENT_SESSION_VERSION, ColorMode, type CompactionEntry, CompactionSettings, type CompactionSummaryMessage, CustomEditor, type CustomEntry, type CustomMessage, CustomMessageComponent, type CustomMessageEntry, DEFAULT_COMPACTION_SETTINGS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DefaultPackageManager, DefaultProjectTrust, DefaultResourceLoader, DynamicBorder, ExtensionEditorComponent, ExtensionInputComponent, ExtensionSelectorComponent, FileSettingsStorage, FooterComponent, ImageResizeOptions, InMemorySettingsStorage, type LabelEntry, type ModelChangeEntry, ModelRegistry, ModelRuntime, PackageSource, ParsedSkillBlock, ProjectTrustStore, RenderDiffOptions, ResizedImage, RetrySettings, type SessionContext, type SessionEntry, type SessionHeader, type SessionInfo, type SessionInfoEntry, SessionManager, type SessionMessageEntry, type SessionTreeNode, SettingsCallbacks, SettingsConfig, SettingsManager, SettingsManagerCreateOptions, SettingsSelectorComponent, ShellConfig, StoredCredential, Theme, ThemeBg, ThemeColor, type ThinkingLevelChangeEntry, ToolExecutionComponent, ToolExecutionOptions, type TruncationOptions, type TruncationResult, TuiMode, UserMessageComponent, VERSION, VisualTruncateResult, assertValidSessionId, bashExecutionToText, buildContextEntries, buildSessionContext, calculateContextTokens, compact, convertToLlm, convertToPng, copyToClipboard, createAgentSession, createBashTool, createBranchSummaryMessage, createCodingTools, createCompactionSummaryMessage, createCustomMessage, createEditTool, createEventBus, createFindTool, createGrepTool, createLsTool, createReadOnlyTools, createReadTool, createWriteTool, defineTool, estimateTokens, findCutPoint, findMostRecentSession, formatSize, formatSkillsForPrompt, generateBranchSummary, generateSummary, generateSummaryWithUsage, getAgentDir, getBinDir, getDefaultSessionDir, getLanguageFromPath, getLatestCompactionEntry, getMarkdownTheme, getPackageDir, getSelectListTheme, getSettingsListTheme, getShellConfig, highlightCode, initTheme, keyHint, keyText, loadEntriesFromFile, loadSkills, loadSkillsFromDir, migrateSessionEntries, parseFrontmatter, parseSessionEntries, parseSkillBlock, rawKeyHint, readStoredCredential, renderDiff, resizeImage, serializeConversation, sessionEntryToContextMessages, shouldCompact, stripFrontmatter, theme, truncateHead, truncateLine, truncateTail, truncateToVisualLines, withFileMutationQueue, wrapRegisteredTool };
|
|
745
|
+
//# sourceMappingURL=pi-coding-agent.d.mts.map
|