@bastani/atomic 0.9.50 → 0.9.51-alpha.1
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/CHANGELOG.md +12 -0
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/modes/interactive/chat-input-actions.d.ts +7 -0
- package/dist/modes/interactive/chat-input-actions.d.ts.map +1 -1
- package/dist/modes/interactive/chat-input-actions.js +13 -0
- package/dist/modes/interactive/chat-input-actions.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.d.ts +2 -1
- package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.js +7 -5
- package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
- package/dist/modes/interactive/interactive-process-lifecycle.js +17 -1
- package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
- package/npm-shrinkwrap.json +32 -32
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.9.51-alpha.1] - 2026-10-29
|
|
6
|
+
|
|
7
|
+
Windows sessions resume as printed, and stay open.
|
|
8
|
+
|
|
9
|
+
- **Resume commands that work in cmd.exe:** the command Atomic prints on exit quotes paths for Windows shells, so pasting it into `cmd.exe` or PowerShell resumes the session instead of failing to open the session store ([#4095](https://github.com/bastani-inc/atomic/issues/4095))
|
|
10
|
+
- **No exits from stray signals:** a Ctrl+C signal that another process sends to the console no longer clears the editor or ends an idle session; it can still interrupt work that is running ([#4096](https://github.com/bastani-inc/atomic/issues/4096))
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- The resume command printed on exit quotes paths for the shell on Windows: none for a plain path, double quotes for one with spaces, never single quotes, which `cmd.exe` passed through as part of the path ([#4095](https://github.com/bastani-inc/atomic/issues/4095))
|
|
15
|
+
- A SIGINT signal that didn't come from the keyboard, such as a console control event another process in the same Windows console raises, no longer clears the editor or counts toward the double-Ctrl+C exit while the terminal is in raw mode; it still interrupts a running response, bash command, compaction or retry ([#4096](https://github.com/bastani-inc/atomic/issues/4096))
|
|
16
|
+
|
|
5
17
|
## [0.9.50] - 2026-10-28
|
|
6
18
|
|
|
7
19
|
RPC clients can answer questions.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/intercom",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.51-alpha.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension providing a private coordination channel between parent and child agent sessions. Fork of: https://github.com/nicobailon/pi-intercom",
|
|
6
6
|
"contributors": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/subagents",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.51-alpha.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension for delegating tasks to subagents with parallel execution. Fork of: https://github.com/nicobailon/pi-subagents",
|
|
6
6
|
"contributors": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/web-access",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.51-alpha.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension for web search, URL fetching, GitHub repo cloning, PDF/video extraction. Fork of: https://github.com/nicobailon/pi-web-access",
|
|
6
6
|
"contributors": [
|
|
@@ -16,6 +16,13 @@ export interface ClipboardImageEditorOptions {
|
|
|
16
16
|
}
|
|
17
17
|
export declare function cleanupStaleClipboardFiles(now?: number): void;
|
|
18
18
|
export declare function combineQueuedMessagesForEditor(queuedMessages: readonly string[], currentText: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Quote an argument for the shell a person pastes a command into on `platform`: double quotes on
|
|
21
|
+
* Windows, where cmd.exe passes single quotes through as part of the argument, and POSIX single
|
|
22
|
+
* quotes elsewhere. A Windows path needs no quotes unless it has a space or another special
|
|
23
|
+
* character.
|
|
24
|
+
*/
|
|
25
|
+
export declare function quoteForShell(value: string, platform?: NodeJS.Platform): string;
|
|
19
26
|
/** Quote a shell argument unless it only contains characters that need no quoting. */
|
|
20
27
|
export declare function quoteIfNeeded(value: string): string;
|
|
21
28
|
export interface ClipboardImageEditorTarget {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-input-actions.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/chat-input-actions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAMlD,MAAM,WAAW,kBAAkB;IAClC,IAAI,IAAI,IAAI,CAAC;IACb,KAAK,IAAI,IAAI,CAAC;IACd,aAAa,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,qBAAqB;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,MAAM,WAAW,2BAA2B;IAC3C,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gFAAgF;IAChF,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AAoBD,wBAAgB,0BAA0B,CAAC,GAAG,SAAa,GAAG,IAAI,CAkBjE;AAED,wBAAgB,8BAA8B,CAAC,c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BAA0B,GACjC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAgB7B"}
|
|
@@ -48,6 +48,19 @@ export function cleanupStaleClipboardFiles(now = Date.now()) {
|
|
|
48
48
|
export function combineQueuedMessagesForEditor(queuedMessages, currentText) {
|
|
49
49
|
return [...queuedMessages, ...(currentText.trim() ? [currentText] : [])].join("\n\n");
|
|
50
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Quote an argument for the shell a person pastes a command into on `platform`: double quotes on
|
|
53
|
+
* Windows, where cmd.exe passes single quotes through as part of the argument, and POSIX single
|
|
54
|
+
* quotes elsewhere. A Windows path needs no quotes unless it has a space or another special
|
|
55
|
+
* character.
|
|
56
|
+
*/
|
|
57
|
+
export function quoteForShell(value, platform = process.platform) {
|
|
58
|
+
if (platform !== "win32")
|
|
59
|
+
return quoteIfNeeded(value);
|
|
60
|
+
if (value.length > 0 && !/[^a-zA-Z0-9_\-./\\~:@]/.test(value))
|
|
61
|
+
return value;
|
|
62
|
+
return `"${value.replace(/"/g, '""')}"`;
|
|
63
|
+
}
|
|
51
64
|
/** Quote a shell argument unless it only contains characters that need no quoting. */
|
|
52
65
|
export function quoteIfNeeded(value) {
|
|
53
66
|
if (value.length > 0 && !/[^a-zA-Z0-9_\-./~:@]/.test(value)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-input-actions.js","sourceRoot":"","sources":["../../../src/modes/interactive/chat-input-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,yBAAyB,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Aa,CAAC,CAAC;IAC1D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,WAAW,EAAE,CACpB,mCAAmC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC3F,CAAC;QACF,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC9C,IAAY,EACZ,IAAwE,EACxE,OAAO,GAA0B,EAAE;IAEnC,MAAM,aAAa,GAAG,4BAA4B,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC1E,IAAI,CAAC,IAAI,EAAE,CAAC;IACZ,IAAI,CAAC;QACJ,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC;YACzC,OAAO,EAAE,aAAa;YACtB,OAAO,EAAE,IAAI;SACb,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAClE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,WAAW,EAAE,CAAC,0BAA0B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC1G,OAAO,SAAS,CAAC;IAClB,CAAC;YAAS,CAAC;QACV,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;AACF,CAAC","sourcesContent":["import * as crypto from \"node:crypto\";\nimport * as fs from \"node:fs\";\nimport * as os from \"node:os\";\nimport * as path from \"node:path\";\nimport type { TUI } from \"@earendil-works/pi-tui\";\nimport { APP_NAME } from \"../../config.js\";\nimport { readClipboardFilePaths, readClipboardText } from \"../../utils/clipboard.js\";\nimport { extensionForImageMimeType, readClipboardImage } from \"../../utils/clipboard-image.ts\";\nimport { editInExternalEditor, resolveExternalEditorCommand } from \"./external-editor.ts\";\n\nexport interface ExternalEditorHost {\n\tstop(): void;\n\tstart(): void;\n\trequestRender(force?: boolean): void;\n}\n\nexport interface ExternalEditorOptions {\n\teditorCommand?: string;\n\tshowWarning?: (message: string) => void;\n}\n\nexport interface ClipboardImageEditorOptions {\n\tshowWarning?: (message: string) => void;\n\tcleanupDelayMs?: number;\n\t/** Bash mode shell-quotes pasted file paths and separates them as arguments. */\n\tisBashMode?: boolean;\n}\n\nconst CLIPBOARD_CLEANUP_DELAY_MS = 60 * 60 * 1000;\nconst CLIPBOARD_STALE_AGE_MS = 24 * 60 * 60 * 1000;\n\nfunction appTempPrefix(kind: string): string {\n\treturn `${APP_NAME}-${kind}-`;\n}\n\nfunction scheduleTempFileCleanup(filePath: string, delayMs: number): void {\n\tconst timer = setTimeout(() => {\n\t\ttry {\n\t\t\tfs.unlinkSync(filePath);\n\t\t} catch {\n\t\t\t// Ignore best-effort cleanup failures.\n\t\t}\n\t}, delayMs);\n\ttimer.unref?.();\n}\n\nexport function cleanupStaleClipboardFiles(now = Date.now()): void {\n\tconst prefix = appTempPrefix(\"clipboard\");\n\tlet entries: string[];\n\ttry {\n\t\tentries = fs.readdirSync(os.tmpdir());\n\t} catch {\n\t\treturn;\n\t}\n\tfor (const entry of entries) {\n\t\tif (!entry.startsWith(prefix)) continue;\n\t\tconst filePath = path.join(os.tmpdir(), entry);\n\t\ttry {\n\t\t\tconst stat = fs.statSync(filePath);\n\t\t\tif (stat.isFile() && now - stat.mtimeMs >= CLIPBOARD_STALE_AGE_MS) fs.unlinkSync(filePath);\n\t\t} catch {\n\t\t\t// Ignore best-effort cleanup failures.\n\t\t}\n\t}\n}\n\nexport function combineQueuedMessagesForEditor(queuedMessages: readonly string[], currentText: string): string {\n\treturn [...queuedMessages, ...(currentText.trim() ? [currentText] : [])].join(\"\\n\\n\");\n}\n\n/** Quote a shell argument unless it only contains characters that need no quoting. */\nexport function quoteIfNeeded(value: string): string {\n\tif (value.length > 0 && !/[^a-zA-Z0-9_\\-./~:@]/.test(value)) {\n\t\treturn value;\n\t}\n\treturn `'${value.replace(/'/g, `'\\\\''`)}'`;\n}\n\nexport interface ClipboardImageEditorTarget {\n\tinsertTextAtCursor?: (text: string) => void;\n\tgetText?: () => string;\n\tsetText?: (text: string) => void;\n\tgetCursor?: () => { line: number; col: number };\n}\n\nfunction insertIntoEditor(editor: ClipboardImageEditorTarget, text: string, requestRender?: () => void): boolean {\n\tif (editor.insertTextAtCursor) editor.insertTextAtCursor(text);\n\telse if (editor.getText && editor.setText) editor.setText(`${editor.getText()}${text}`);\n\telse return false;\n\trequestRender?.();\n\treturn true;\n}\n\n/** Copied file paths, separated from adjacent text on the cursor's line. */\nfunction formatClipboardFilePaths(\n\teditor: ClipboardImageEditorTarget,\n\tfilePaths: readonly string[],\n\tisBashMode: boolean,\n): string {\n\tif (filePaths.some((filePath) => /\\p{Cc}/u.test(filePath))) {\n\t\tthrow new Error(\"Clipboard file path contains control characters\");\n\t}\n\tconst paths = isBashMode ? filePaths.map(quoteIfNeeded).join(\" \") : filePaths.join(\"\\n\");\n\tconst cursor = editor.getCursor?.();\n\tconst currentLine = cursor ? (editor.getText?.().split(\"\\n\")[cursor.line] ?? \"\") : \"\";\n\tconst characterBeforeCursor = cursor && cursor.col > 0 ? currentLine[cursor.col - 1] : \"\";\n\tconst characterAfterCursor = cursor ? currentLine[cursor.col] : \"\";\n\tconst leadingSpace = characterBeforeCursor && !/\\s/.test(characterBeforeCursor) ? \" \" : \"\";\n\tconst trailingSpace = characterAfterCursor && !/\\s/.test(characterAfterCursor) ? \" \" : \"\";\n\treturn `${leadingSpace}${paths}${trailingSpace}`;\n}\n\n/**\n * Paste from the clipboard: copied files by their original paths (macOS), images via temporary\n * files, and plain text as the final fallback.\n */\nexport async function pasteClipboardImageToEditor(\n\teditor: ClipboardImageEditorTarget,\n\trequestRender?: () => void,\n\toptions: ClipboardImageEditorOptions = {},\n): Promise<boolean> {\n\ttry {\n\t\tcleanupStaleClipboardFiles();\n\t\t// Finder copies also carry the file icon as an image; the paths are what the user copied.\n\t\tconst filePaths = await readClipboardFilePaths();\n\t\tif (filePaths) {\n\t\t\treturn insertIntoEditor(\n\t\t\t\teditor,\n\t\t\t\tformatClipboardFilePaths(editor, filePaths, options.isBashMode ?? false),\n\t\t\t\trequestRender,\n\t\t\t);\n\t\t}\n\n\t\tconst image = await readClipboardImage();\n\t\tif (!image) {\n\t\t\tconst text = await readClipboardText();\n\t\t\tif (!text) return false;\n\t\t\treturn insertIntoEditor(editor, text, requestRender);\n\t\t}\n\n\t\tconst ext = extensionForImageMimeType(image.mimeType) ?? \"png\";\n\t\tconst fileName = `${appTempPrefix(\"clipboard\")}${crypto.randomUUID()}.${ext}`;\n\t\tconst filePath = path.join(os.tmpdir(), fileName);\n\t\tfs.writeFileSync(filePath, Buffer.from(image.bytes), { flag: \"wx\", mode: 0o600 });\n\t\tscheduleTempFileCleanup(filePath, options.cleanupDelayMs ?? CLIPBOARD_CLEANUP_DELAY_MS);\n\n\t\treturn insertIntoEditor(editor, filePath, requestRender);\n\t} catch (error) {\n\t\toptions.showWarning?.(\n\t\t\t`Failed to paste from clipboard: ${error instanceof Error ? error.message : String(error)}`,\n\t\t);\n\t\treturn false;\n\t}\n}\n\nexport async function openExternalEditorForText(\n\ttext: string,\n\thost: Pick<TUI, \"stop\" | \"start\" | \"requestRender\"> | ExternalEditorHost,\n\toptions: ExternalEditorOptions = {},\n): Promise<string | undefined> {\n\tconst editorCommand = resolveExternalEditorCommand(options.editorCommand);\n\thost.stop();\n\ttry {\n\t\tconst result = await editInExternalEditor({\n\t\t\tcommand: editorCommand,\n\t\t\tcontent: text,\n\t\t});\n\t\treturn result.status === \"complete\" ? result.content : undefined;\n\t} catch (error) {\n\t\toptions.showWarning?.(`Failed to open editor: ${error instanceof Error ? error.message : String(error)}`);\n\t\treturn undefined;\n\t} finally {\n\t\thost.start();\n\t\thost.requestRender(true);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"chat-input-actions.js","sourceRoot":"","sources":["../../../src/modes/interactive/chat-input-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAC/F,OAAO,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAoB1F,MAAM,0BAA0B,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAClD,MAAM,sBAAsB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEnD,SAAS,aAAa,CAAC,IAAY;IAClC,OAAO,GAAG,QAAQ,IAAI,IAAI,GAAG,CAAC;AAC/B,CAAC;AAED,SAAS,uBAAuB,CAAC,QAAgB,EAAE,OAAe;IACjE,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;QAC7B,IAAI,CAAC;YACJ,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QACzB,CAAC;QAAC,MAAM,CAAC;YACR,uCAAuC;QACxC,CAAC;IACF,CAAC,EAAE,OAAO,CAAC,CAAC;IACZ,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE;IAC1D,MAAM,MAAM,GAAG,aAAa,CAAC,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A4B,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC1E,IAAI,CAAC,IAAI,EAAE,CAAC;IACZ,IAAI,CAAC;QACJ,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC;YACzC,OAAO,EAAE,aAAa;YACtB,OAAO,EAAE,IAAI;SACb,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAClE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,WAAW,EAAE,CAAC,0BAA0B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC1G,OAAO,SAAS,CAAC;IAClB,CAAC;YAAS,CAAC;QACV,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;AACF,CAAC","sourcesContent":["import * as crypto from \"node:crypto\";\nimport * as fs from \"node:fs\";\nimport * as os from \"node:os\";\nimport * as path from \"node:path\";\nimport type { TUI } from \"@earendil-works/pi-tui\";\nimport { APP_NAME } from \"../../config.js\";\nimport { readClipboardFilePaths, readClipboardText } from \"../../utils/clipboard.js\";\nimport { extensionForImageMimeType, readClipboardImage } from \"../../utils/clipboard-image.ts\";\nimport { editInExternalEditor, resolveExternalEditorCommand } from \"./external-editor.ts\";\n\nexport interface ExternalEditorHost {\n\tstop(): void;\n\tstart(): void;\n\trequestRender(force?: boolean): void;\n}\n\nexport interface ExternalEditorOptions {\n\teditorCommand?: string;\n\tshowWarning?: (message: string) => void;\n}\n\nexport interface ClipboardImageEditorOptions {\n\tshowWarning?: (message: string) => void;\n\tcleanupDelayMs?: number;\n\t/** Bash mode shell-quotes pasted file paths and separates them as arguments. */\n\tisBashMode?: boolean;\n}\n\nconst CLIPBOARD_CLEANUP_DELAY_MS = 60 * 60 * 1000;\nconst CLIPBOARD_STALE_AGE_MS = 24 * 60 * 60 * 1000;\n\nfunction appTempPrefix(kind: string): string {\n\treturn `${APP_NAME}-${kind}-`;\n}\n\nfunction scheduleTempFileCleanup(filePath: string, delayMs: number): void {\n\tconst timer = setTimeout(() => {\n\t\ttry {\n\t\t\tfs.unlinkSync(filePath);\n\t\t} catch {\n\t\t\t// Ignore best-effort cleanup failures.\n\t\t}\n\t}, delayMs);\n\ttimer.unref?.();\n}\n\nexport function cleanupStaleClipboardFiles(now = Date.now()): void {\n\tconst prefix = appTempPrefix(\"clipboard\");\n\tlet entries: string[];\n\ttry {\n\t\tentries = fs.readdirSync(os.tmpdir());\n\t} catch {\n\t\treturn;\n\t}\n\tfor (const entry of entries) {\n\t\tif (!entry.startsWith(prefix)) continue;\n\t\tconst filePath = path.join(os.tmpdir(), entry);\n\t\ttry {\n\t\t\tconst stat = fs.statSync(filePath);\n\t\t\tif (stat.isFile() && now - stat.mtimeMs >= CLIPBOARD_STALE_AGE_MS) fs.unlinkSync(filePath);\n\t\t} catch {\n\t\t\t// Ignore best-effort cleanup failures.\n\t\t}\n\t}\n}\n\nexport function combineQueuedMessagesForEditor(queuedMessages: readonly string[], currentText: string): string {\n\treturn [...queuedMessages, ...(currentText.trim() ? [currentText] : [])].join(\"\\n\\n\");\n}\n\n/**\n * Quote an argument for the shell a person pastes a command into on `platform`: double quotes on\n * Windows, where cmd.exe passes single quotes through as part of the argument, and POSIX single\n * quotes elsewhere. A Windows path needs no quotes unless it has a space or another special\n * character.\n */\nexport function quoteForShell(value: string, platform: NodeJS.Platform = process.platform): string {\n\tif (platform !== \"win32\") return quoteIfNeeded(value);\n\tif (value.length > 0 && !/[^a-zA-Z0-9_\\-./\\\\~:@]/.test(value)) return value;\n\treturn `\"${value.replace(/\"/g, '\"\"')}\"`;\n}\n\n/** Quote a shell argument unless it only contains characters that need no quoting. */\nexport function quoteIfNeeded(value: string): string {\n\tif (value.length > 0 && !/[^a-zA-Z0-9_\\-./~:@]/.test(value)) {\n\t\treturn value;\n\t}\n\treturn `'${value.replace(/'/g, `'\\\\''`)}'`;\n}\n\nexport interface ClipboardImageEditorTarget {\n\tinsertTextAtCursor?: (text: string) => void;\n\tgetText?: () => string;\n\tsetText?: (text: string) => void;\n\tgetCursor?: () => { line: number; col: number };\n}\n\nfunction insertIntoEditor(editor: ClipboardImageEditorTarget, text: string, requestRender?: () => void): boolean {\n\tif (editor.insertTextAtCursor) editor.insertTextAtCursor(text);\n\telse if (editor.getText && editor.setText) editor.setText(`${editor.getText()}${text}`);\n\telse return false;\n\trequestRender?.();\n\treturn true;\n}\n\n/** Copied file paths, separated from adjacent text on the cursor's line. */\nfunction formatClipboardFilePaths(\n\teditor: ClipboardImageEditorTarget,\n\tfilePaths: readonly string[],\n\tisBashMode: boolean,\n): string {\n\tif (filePaths.some((filePath) => /\\p{Cc}/u.test(filePath))) {\n\t\tthrow new Error(\"Clipboard file path contains control characters\");\n\t}\n\tconst paths = isBashMode ? filePaths.map(quoteIfNeeded).join(\" \") : filePaths.join(\"\\n\");\n\tconst cursor = editor.getCursor?.();\n\tconst currentLine = cursor ? (editor.getText?.().split(\"\\n\")[cursor.line] ?? \"\") : \"\";\n\tconst characterBeforeCursor = cursor && cursor.col > 0 ? currentLine[cursor.col - 1] : \"\";\n\tconst characterAfterCursor = cursor ? currentLine[cursor.col] : \"\";\n\tconst leadingSpace = characterBeforeCursor && !/\\s/.test(characterBeforeCursor) ? \" \" : \"\";\n\tconst trailingSpace = characterAfterCursor && !/\\s/.test(characterAfterCursor) ? \" \" : \"\";\n\treturn `${leadingSpace}${paths}${trailingSpace}`;\n}\n\n/**\n * Paste from the clipboard: copied files by their original paths (macOS), images via temporary\n * files, and plain text as the final fallback.\n */\nexport async function pasteClipboardImageToEditor(\n\teditor: ClipboardImageEditorTarget,\n\trequestRender?: () => void,\n\toptions: ClipboardImageEditorOptions = {},\n): Promise<boolean> {\n\ttry {\n\t\tcleanupStaleClipboardFiles();\n\t\t// Finder copies also carry the file icon as an image; the paths are what the user copied.\n\t\tconst filePaths = await readClipboardFilePaths();\n\t\tif (filePaths) {\n\t\t\treturn insertIntoEditor(\n\t\t\t\teditor,\n\t\t\t\tformatClipboardFilePaths(editor, filePaths, options.isBashMode ?? false),\n\t\t\t\trequestRender,\n\t\t\t);\n\t\t}\n\n\t\tconst image = await readClipboardImage();\n\t\tif (!image) {\n\t\t\tconst text = await readClipboardText();\n\t\t\tif (!text) return false;\n\t\t\treturn insertIntoEditor(editor, text, requestRender);\n\t\t}\n\n\t\tconst ext = extensionForImageMimeType(image.mimeType) ?? \"png\";\n\t\tconst fileName = `${appTempPrefix(\"clipboard\")}${crypto.randomUUID()}.${ext}`;\n\t\tconst filePath = path.join(os.tmpdir(), fileName);\n\t\tfs.writeFileSync(filePath, Buffer.from(image.bytes), { flag: \"wx\", mode: 0o600 });\n\t\tscheduleTempFileCleanup(filePath, options.cleanupDelayMs ?? CLIPBOARD_CLEANUP_DELAY_MS);\n\n\t\treturn insertIntoEditor(editor, filePath, requestRender);\n\t} catch (error) {\n\t\toptions.showWarning?.(\n\t\t\t`Failed to paste from clipboard: ${error instanceof Error ? error.message : String(error)}`,\n\t\t);\n\t\treturn false;\n\t}\n}\n\nexport async function openExternalEditorForText(\n\ttext: string,\n\thost: Pick<TUI, \"stop\" | \"start\" | \"requestRender\"> | ExternalEditorHost,\n\toptions: ExternalEditorOptions = {},\n): Promise<string | undefined> {\n\tconst editorCommand = resolveExternalEditorCommand(options.editorCommand);\n\thost.stop();\n\ttry {\n\t\tconst result = await editInExternalEditor({\n\t\t\tcommand: editorCommand,\n\t\t\tcontent: text,\n\t\t});\n\t\treturn result.status === \"complete\" ? result.content : undefined;\n\t} catch (error) {\n\t\toptions.showWarning?.(`Failed to open editor: ${error instanceof Error ? error.message : String(error)}`);\n\t\treturn undefined;\n\t} finally {\n\t\thost.start();\n\t\thost.requestRender(true);\n\t}\n}\n"]}
|
|
@@ -18,7 +18,8 @@ export declare const ANTHROPIC_SUBSCRIPTION_AUTH_WARNING = "Anthropic subscripti
|
|
|
18
18
|
export declare const BUILTIN_SLASH_COMMAND_NAMES: Set<string>;
|
|
19
19
|
export declare function isAnthropicSubscriptionAuthKey(apiKey: string | undefined): boolean;
|
|
20
20
|
export declare function isUnknownModel(model: Model<Api> | undefined): boolean;
|
|
21
|
-
|
|
21
|
+
/** The command that resumes this session, quoted for the shell people use on `platform`. */
|
|
22
|
+
export declare function formatResumeCommand(sessionManager: SessionManager, platform?: NodeJS.Platform): string | undefined;
|
|
22
23
|
export declare function hasDefaultModelProvider(providerId: string): providerId is keyof typeof defaultModelPerProvider;
|
|
23
24
|
export declare const BEDROCK_PROVIDER_ID = "amazon-bedrock";
|
|
24
25
|
/** @deprecated Login options are now built directly from provider auth metadata. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-mode-helpers.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode-helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAEN,KAAK,GAAG,EAER,uBAAuB,EAEvB,KAAK,KAAK,EACV,KAAK,cAAc,EACnB,IAAI,EACJ,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,UAAU,CAE5D;AAED,qBAAa,cAAe,SAAQ,IAAK,YAAW,UAAU;IAC7D,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,YAAY,CAAqB;IACzC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IAEtC,iBAAyB,gBAAgB,CAA6B;IACtE,iBAAyB,eAAe,CAA6B;IAErE,YACC,gBAAgB,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,EAC5C,eAAe,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,K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1,6 @@
|
|
|
1
1
|
import { builtinProviders } from "@bastani/pi-ai/providers/all";
|
|
2
2
|
import { sqliteSessionResumeArgs } from "../../core/session-resume-args.js";
|
|
3
|
-
import {
|
|
3
|
+
import { quoteForShell } from "./chat-input-actions.js";
|
|
4
4
|
import { APP_NAME, BUILTIN_SLASH_COMMANDS, defaultModelPerProvider, fs, Text, } from "./interactive-mode-deps.js";
|
|
5
5
|
export function isExpandable(obj) {
|
|
6
6
|
return typeof obj === "object" && obj !== null && "setExpanded" in obj && typeof obj.setExpanded === "function";
|
|
@@ -68,7 +68,8 @@ export function isAnthropicSubscriptionAuthKey(apiKey) {
|
|
|
68
68
|
export function isUnknownModel(model) {
|
|
69
69
|
return !!model && model.provider === "unknown" && model.id === "unknown" && model.api === "unknown";
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
/** The command that resumes this session, quoted for the shell people use on `platform`. */
|
|
72
|
+
export function formatResumeCommand(sessionManager, platform = process.platform) {
|
|
72
73
|
if (!process.stdout.isTTY)
|
|
73
74
|
return undefined;
|
|
74
75
|
if (!sessionManager.isPersisted())
|
|
@@ -76,14 +77,15 @@ export function formatResumeCommand(sessionManager) {
|
|
|
76
77
|
const sessionFile = sessionManager.getSessionFile();
|
|
77
78
|
if (sessionFile && !fs.existsSync(sessionFile))
|
|
78
79
|
return undefined;
|
|
80
|
+
const quote = (value) => quoteForShell(value, platform);
|
|
79
81
|
const args = [APP_NAME];
|
|
80
82
|
if (sessionManager.getSessionStore().descriptor.adapter === "jsonl") {
|
|
81
|
-
args.push("--session-dir",
|
|
83
|
+
args.push("--session-dir", quote(sessionManager.getSessionDir()));
|
|
82
84
|
}
|
|
83
85
|
else {
|
|
84
|
-
args.push(...sqliteSessionResumeArgs(sessionManager.getSessionStore()).map(
|
|
86
|
+
args.push(...sqliteSessionResumeArgs(sessionManager.getSessionStore()).map(quote));
|
|
85
87
|
}
|
|
86
|
-
args.push("--session",
|
|
88
|
+
args.push("--session", quote(sessionManager.getSessionId()));
|
|
87
89
|
return args.join(" ");
|
|
88
90
|
}
|
|
89
91
|
export function hasDefaultModelProvider(providerId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-mode-helpers.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EACN,QAAQ,EAER,sBAAsB,EACtB,uBAAuB,EACvB,EAAE,EAGF,IAAI,GACJ,MAAM,4BAA4B,CAAC;AAGpC,MAAM,UAAU,YAAY,CAAC,GAAY;IACxC,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,aAAa,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,WAAW,KAAK,UAAU,CAAC;AACjH,CAAC;AAED,MAAM,OAAO,cAAe,SAAQ,IAAI;IAC/B,QAAQ,CAAU;IAClB,YAAY,CAAqB;IACxB,YAAY,CAAS;IAKtC,YACC,gBAA4C,EAC5C,eAA2C,EAC3C,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,CAAC,EACZ,QAAQ,GAAG,CAAC;QAEZ,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,gBAAgB,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC7E,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC;IAC9B,CAAC;IAED,WAAW,CAAC,QAAiB;QAC5B,IAAI,CAAC,QAAQ,GAAG,QAAQ,C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ED,MAAM,UAAU,uBAAuB,CAAC,UAAkB;IACzD,OAAO,UAAU,IAAI,uBAAuB,CAAC;AAC9C,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AAEpD,oFAAoF;AACpF,MAAM,UAAU,qBAAqB,CACpC,UAAkB,EAClB,gBAAqC,EACrC,mBAAyC;IAEzC,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,KAAK,UAAU,CAAC,CAAC;IAClF,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC/F,CAAC","sourcesContent":["import { builtinProviders } from \"@bastani/pi-ai/providers/all\";\nimport { sqliteSessionResumeArgs } from \"../../core/session-resume-args.js\";\nimport { quoteIfNeeded } from \"./chat-input-actions.ts\";\nimport {\n\tAPP_NAME,\n\ttype Api,\n\tBUILTIN_SLASH_COMMANDS,\n\tdefaultModelPerProvider,\n\tfs,\n\ttype Model,\n\ttype SessionManager,\n\tText,\n} from \"./interactive-mode-deps.ts\";\nimport type { Expandable } from \"./interactive-mode-types.ts\";\n\nexport function isExpandable(obj: unknown): obj is Expandable {\n\treturn typeof obj === \"object\" && obj !== null && \"setExpanded\" in obj && typeof obj.setExpanded === \"function\";\n}\n\nexport class ExpandableText extends Text implements Expandable {\n\tprivate expanded: boolean;\n\tprivate contentWidth: number | undefined;\n\tprivate readonly textPaddingX: number;\n\n\tprivate declare readonly getCollapsedText: (width?: number) => string;\n\tprivate declare readonly getExpandedText: (width?: number) => string;\n\n\tconstructor(\n\t\tgetCollapsedText: (width?: number) => string,\n\t\tgetExpandedText: (width?: number) => string,\n\t\texpanded = false,\n\t\tpaddingX = 0,\n\t\tpaddingY = 0,\n\t) {\n\t\tsuper(expanded ? getExpandedText() : getCollapsedText(), paddingX, paddingY);\n\t\tthis.getCollapsedText = getCollapsedText;\n\t\tthis.getExpandedText = getExpandedText;\n\t\tthis.expanded = expanded;\n\t\tthis.textPaddingX = paddingX;\n\t}\n\n\tsetExpanded(expanded: boolean): void {\n\t\tthis.expanded = expanded;\n\t\tthis.refresh();\n\t}\n\n\trefresh(): void {\n\t\tconst width = this.contentWidth;\n\t\tthis.setText(this.expanded ? this.getExpandedText(width) : this.getCollapsedText(width));\n\t}\n\n\toverride render(width: number): string[] {\n\t\t// Text getters may adapt their layout to the available content width\n\t\t// (e.g. the startup banner drops its side-by-side meta column on narrow\n\t\t// terminals), so refresh whenever the render width changes.\n\t\tconst contentWidth = Math.max(1, width - this.textPaddingX * 2);\n\t\tif (contentWidth !== this.contentWidth) {\n\t\t\tthis.contentWidth = contentWidth;\n\t\t\tthis.refresh();\n\t\t}\n\t\treturn super.render(width);\n\t}\n}\n\nconst DEAD_TERMINAL_ERROR_CODES = new Set([\"EIO\", \"EPIPE\", \"ENOTCONN\", \"ENOTTY\"]);\n\nexport function isDeadTerminalError(error: unknown): boolean {\n\tif (!error || typeof error !== \"object\" || !(\"code\" in error)) {\n\t\treturn false;\n\t}\n\tconst code = (error as NodeJS.ErrnoException).code;\n\treturn code !== undefined && DEAD_TERMINAL_ERROR_CODES.has(code);\n}\n\nexport function formatCrashExtensionHint(extensionMatches: readonly string[] | undefined): string | undefined {\n\tconst matches = Array.isArray(extensionMatches)\n\t\t? extensionMatches.filter((match): match is string => typeof match === \"string\" && match.length > 0)\n\t\t: [];\n\tif (matches.length === 0) return undefined;\n\tconst quoted = matches.map((match) => `\\`${match}\\``);\n\tconst labels =\n\t\tquoted.length === 1\n\t\t\t? quoted[0]\n\t\t\t: quoted.length === 2\n\t\t\t\t? quoted.join(\" and \")\n\t\t\t\t: `${quoted.slice(0, -1).join(\", \")}, and ${quoted[quoted.length - 1]}`;\n\tconst noun = matches.length === 1 ? \"extension\" : \"extensions\";\n\tconst pronoun = matches.length === 1 ? \"it\" : \"them\";\n\treturn `A stack frame came from loaded ${noun} ${labels}, which may be involved. Try disabling ${pronoun} with \\`${APP_NAME} config\\`, or run \\`${APP_NAME} -ne\\` to confirm.`;\n}\n\nexport const ANTHROPIC_SUBSCRIPTION_AUTH_WARNING =\n\t\"Anthropic subscription auth is active. Third-party harness usage draws from extra usage and is billed per token, not your Claude plan limits. Manage extra usage at https://claude.ai/settings/usage.\";\n\nexport const BUILTIN_SLASH_COMMAND_NAMES = new Set(BUILTIN_SLASH_COMMANDS.map((command) => command.name));\n\nexport function isAnthropicSubscriptionAuthKey(apiKey: string | undefined): boolean {\n\treturn typeof apiKey === \"string\" && apiKey.startsWith(\"sk-ant-oat\");\n}\n\nexport function isUnknownModel(model: Model<Api> | undefined): boolean {\n\treturn !!model && model.provider === \"unknown\" && model.id === \"unknown\" && model.api === \"unknown\";\n}\n\nexport function formatResumeCommand(sessionManager: SessionManager): string | undefined {\n\tif (!process.stdout.isTTY) return undefined;\n\tif (!sessionManager.isPersisted()) return undefined;\n\n\tconst sessionFile = sessionManager.getSessionFile();\n\tif (sessionFile && !fs.existsSync(sessionFile)) return undefined;\n\n\tconst args = [APP_NAME];\n\tif (sessionManager.getSessionStore().descriptor.adapter === \"jsonl\") {\n\t\targs.push(\"--session-dir\", quoteIfNeeded(sessionManager.getSessionDir()));\n\t} else {\n\t\targs.push(...sqliteSessionResumeArgs(sessionManager.getSessionStore()).map(quoteIfNeeded));\n\t}\n\targs.push(\"--session\", quoteIfNeeded(sessionManager.getSessionId()));\n\treturn args.join(\" \");\n}\n\nexport function hasDefaultModelProvider(providerId: string): providerId is keyof typeof defaultModelPerProvider {\n\treturn providerId in defaultModelPerProvider;\n}\n\nexport const BEDROCK_PROVIDER_ID = \"amazon-bedrock\";\n\n/** @deprecated Login options are now built directly from provider auth metadata. */\nexport function isApiKeyLoginProvider(\n\tproviderId: string,\n\toauthProviderIds: ReadonlySet<string>,\n\t_builtInProviderIds?: ReadonlySet<string>,\n): boolean {\n\tconst builtin = builtinProviders().find((provider) => provider.id === providerId);\n\treturn builtin ? builtin.auth.apiKey?.login !== undefined : !oauthProviderIds.has(providerId);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interactive-mode-helpers.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EACN,QAAQ,EAER,sBAAsB,EACtB,uBAAuB,EACvB,EAAE,EAGF,IAAI,GACJ,MAAM,4BAA4B,CAAC;AAGpC,MAAM,UAAU,YAAY,CAAC,GAAY;IACxC,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,aAAa,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,WAAW,KAAK,UAAU,CAAC;AACjH,CAAC;AAED,MAAM,OAAO,cAAe,SAAQ,IAAI;IAC/B,QAAQ,CAAU;IAClB,YAAY,CAAqB;IACxB,YAAY,CAAS;IAKtC,YACC,gBAA4C,EAC5C,eAA2C,EAC3C,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,CAAC,EACZ,QAAQ,GAAG,CAAC;QAEZ,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,gBAAgB,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC7E,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC;IAC9B,CAAC;IAED,WAAW,CAAC,QAAiB;QAC5B,IAAI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CAAC;IACpF,CAAC;IACD,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IAC7D,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,UAAkB;IACzD,OAAO,UAAU,IAAI,uBAAuB,CAAC;AAC9C,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AAEpD,oFAAoF;AACpF,MAAM,UAAU,qBAAqB,CACpC,UAAkB,EAClB,gBAAqC,EACrC,mBAAyC;IAEzC,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,KAAK,UAAU,CAAC,CAAC;IAClF,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC/F,CAAC","sourcesContent":["import { builtinProviders } from \"@bastani/pi-ai/providers/all\";\nimport { sqliteSessionResumeArgs } from \"../../core/session-resume-args.js\";\nimport { quoteForShell } from \"./chat-input-actions.ts\";\nimport {\n\tAPP_NAME,\n\ttype Api,\n\tBUILTIN_SLASH_COMMANDS,\n\tdefaultModelPerProvider,\n\tfs,\n\ttype Model,\n\ttype SessionManager,\n\tText,\n} from \"./interactive-mode-deps.ts\";\nimport type { Expandable } from \"./interactive-mode-types.ts\";\n\nexport function isExpandable(obj: unknown): obj is Expandable {\n\treturn typeof obj === \"object\" && obj !== null && \"setExpanded\" in obj && typeof obj.setExpanded === \"function\";\n}\n\nexport class ExpandableText extends Text implements Expandable {\n\tprivate expanded: boolean;\n\tprivate contentWidth: number | undefined;\n\tprivate readonly textPaddingX: number;\n\n\tprivate declare readonly getCollapsedText: (width?: number) => string;\n\tprivate declare readonly getExpandedText: (width?: number) => string;\n\n\tconstructor(\n\t\tgetCollapsedText: (width?: number) => string,\n\t\tgetExpandedText: (width?: number) => string,\n\t\texpanded = false,\n\t\tpaddingX = 0,\n\t\tpaddingY = 0,\n\t) {\n\t\tsuper(expanded ? getExpandedText() : getCollapsedText(), paddingX, paddingY);\n\t\tthis.getCollapsedText = getCollapsedText;\n\t\tthis.getExpandedText = getExpandedText;\n\t\tthis.expanded = expanded;\n\t\tthis.textPaddingX = paddingX;\n\t}\n\n\tsetExpanded(expanded: boolean): void {\n\t\tthis.expanded = expanded;\n\t\tthis.refresh();\n\t}\n\n\trefresh(): void {\n\t\tconst width = this.contentWidth;\n\t\tthis.setText(this.expanded ? this.getExpandedText(width) : this.getCollapsedText(width));\n\t}\n\n\toverride render(width: number): string[] {\n\t\t// Text getters may adapt their layout to the available content width\n\t\t// (e.g. the startup banner drops its side-by-side meta column on narrow\n\t\t// terminals), so refresh whenever the render width changes.\n\t\tconst contentWidth = Math.max(1, width - this.textPaddingX * 2);\n\t\tif (contentWidth !== this.contentWidth) {\n\t\t\tthis.contentWidth = contentWidth;\n\t\t\tthis.refresh();\n\t\t}\n\t\treturn super.render(width);\n\t}\n}\n\nconst DEAD_TERMINAL_ERROR_CODES = new Set([\"EIO\", \"EPIPE\", \"ENOTCONN\", \"ENOTTY\"]);\n\nexport function isDeadTerminalError(error: unknown): boolean {\n\tif (!error || typeof error !== \"object\" || !(\"code\" in error)) {\n\t\treturn false;\n\t}\n\tconst code = (error as NodeJS.ErrnoException).code;\n\treturn code !== undefined && DEAD_TERMINAL_ERROR_CODES.has(code);\n}\n\nexport function formatCrashExtensionHint(extensionMatches: readonly string[] | undefined): string | undefined {\n\tconst matches = Array.isArray(extensionMatches)\n\t\t? extensionMatches.filter((match): match is string => typeof match === \"string\" && match.length > 0)\n\t\t: [];\n\tif (matches.length === 0) return undefined;\n\tconst quoted = matches.map((match) => `\\`${match}\\``);\n\tconst labels =\n\t\tquoted.length === 1\n\t\t\t? quoted[0]\n\t\t\t: quoted.length === 2\n\t\t\t\t? quoted.join(\" and \")\n\t\t\t\t: `${quoted.slice(0, -1).join(\", \")}, and ${quoted[quoted.length - 1]}`;\n\tconst noun = matches.length === 1 ? \"extension\" : \"extensions\";\n\tconst pronoun = matches.length === 1 ? \"it\" : \"them\";\n\treturn `A stack frame came from loaded ${noun} ${labels}, which may be involved. Try disabling ${pronoun} with \\`${APP_NAME} config\\`, or run \\`${APP_NAME} -ne\\` to confirm.`;\n}\n\nexport const ANTHROPIC_SUBSCRIPTION_AUTH_WARNING =\n\t\"Anthropic subscription auth is active. Third-party harness usage draws from extra usage and is billed per token, not your Claude plan limits. Manage extra usage at https://claude.ai/settings/usage.\";\n\nexport const BUILTIN_SLASH_COMMAND_NAMES = new Set(BUILTIN_SLASH_COMMANDS.map((command) => command.name));\n\nexport function isAnthropicSubscriptionAuthKey(apiKey: string | undefined): boolean {\n\treturn typeof apiKey === \"string\" && apiKey.startsWith(\"sk-ant-oat\");\n}\n\nexport function isUnknownModel(model: Model<Api> | undefined): boolean {\n\treturn !!model && model.provider === \"unknown\" && model.id === \"unknown\" && model.api === \"unknown\";\n}\n\n/** The command that resumes this session, quoted for the shell people use on `platform`. */\nexport function formatResumeCommand(\n\tsessionManager: SessionManager,\n\tplatform: NodeJS.Platform = process.platform,\n): string | undefined {\n\tif (!process.stdout.isTTY) return undefined;\n\tif (!sessionManager.isPersisted()) return undefined;\n\n\tconst sessionFile = sessionManager.getSessionFile();\n\tif (sessionFile && !fs.existsSync(sessionFile)) return undefined;\n\n\tconst quote = (value: string) => quoteForShell(value, platform);\n\tconst args = [APP_NAME];\n\tif (sessionManager.getSessionStore().descriptor.adapter === \"jsonl\") {\n\t\targs.push(\"--session-dir\", quote(sessionManager.getSessionDir()));\n\t} else {\n\t\targs.push(...sqliteSessionResumeArgs(sessionManager.getSessionStore()).map(quote));\n\t}\n\targs.push(\"--session\", quote(sessionManager.getSessionId()));\n\treturn args.join(\" \");\n}\n\nexport function hasDefaultModelProvider(providerId: string): providerId is keyof typeof defaultModelPerProvider {\n\treturn providerId in defaultModelPerProvider;\n}\n\nexport const BEDROCK_PROVIDER_ID = \"amazon-bedrock\";\n\n/** @deprecated Login options are now built directly from provider auth metadata. */\nexport function isApiKeyLoginProvider(\n\tproviderId: string,\n\toauthProviderIds: ReadonlySet<string>,\n\t_builtInProviderIds?: ReadonlySet<string>,\n): boolean {\n\tconst builtin = builtinProviders().find((provider) => provider.id === providerId);\n\treturn builtin ? builtin.auth.apiKey?.login !== undefined : !oauthProviderIds.has(providerId);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-mode-surface.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode-surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,4EAA4E;AAE5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAChH,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,KAAK,EACX,YAAY,EACZ,iBAAiB,EACjB,GAAG,EACH,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACxB,SAAS,EACT,SAAS,EACT,aAAa,EACb,uBAAuB,EACvB,eAAe,EACf,k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B,iBAAiB,IAAI,IAAI,CAAC;QAC1B,oBAAoB,IAAI,IAAI,CAAC;QAC7B,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAChF,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,oBAAoB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;KACxD;CACD"}
|
|
1
|
+
{"version":3,"file":"interactive-mode-surface.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode-surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,4EAA4E;AAE5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAChH,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,KAAK,EACX,YAAY,EACZ,iBAAiB,EACjB,GAAG,EACH,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACxB,SAAS,EACT,SAAS,EACT,aAAa,EACb,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,wBAAwB,EACxB,sBAAsB,EACtB,iBAAiB,EACjB,yBAAyB,EACzB,UAAU,EACV,kBAAkB,EAClB,sBAAsB,EAC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AiB,CAAC,OAAO,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAChF,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,oBAAoB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;KACxD;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-mode-surface.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode-surface.ts"],"names":[],"mappings":"","sourcesContent":["import type { AssistantMessage, Usage } from \"@bastani/pi-ai/compat\";\nimport type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\n/** Method surface installed onto InteractiveModeBase by sibling modules. */\n\nimport type { MarkdownTransformer, SessionRecoveryReason, ToolRenderers } from \"../../core/extensions/types.ts\";\nimport type { CustomEntry, SessionEntry } from \"../../core/session-manager.ts\";\nimport type { FullscreenExitOutput } from \"../../core/settings-manager.ts\";\nimport type { ToolStatus } from \"../../utils/tools-manager.ts\";\nimport type { JsonAgentSessionEvent } from \"../json-event.ts\";\nimport type { AtomicWorkingLoader } from \"./components/atomic-working-status.ts\";\nimport type {\n\tAgentMessage,\n\tAgentSessionEvent,\n\tApi,\n\tAppKeybinding,\n\tAuthSelectorProvider,\n\tAutocompleteProvider,\n\tChatMessageEntry,\n\tChatMessageRenderOptions,\n\tComponent,\n\tContainer,\n\tEditorFactory,\n\tExtensionCommandContext,\n\tExtensionRunner,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tHostCustomUiState,\n\tHostCustomUiStateListener,\n\tKeybinding,\n\tKeybindingsManager,\n\tLoaderIndicatorOptions,\n\tLoginDialogComponent,\n\tMarkdownTheme,\n\tMessage,\n\tMissingSessionCwdError,\n\tModel,\n\tOAuthSelectPrompt,\n\tOverlayHandle,\n\tOverlayOptions,\n\tProjectTrustContext,\n\tReadonlyFooterDataProvider,\n\tResourceDiagnostic,\n\tSessionContext,\n\tSlashCommand,\n\tSourceInfo,\n\tTheme,\n\tTUI,\n\tVerbatimCompactionResult,\n} from \"./interactive-mode-deps.ts\";\nimport type { InteractiveSubmission } from \"./interactive-submission.ts\";\nimport type { BlockedStatus } from \"./program-status-reporter.ts\";\n\ndeclare module \"./interactive-mode-base.ts\" {\n\tinterface InteractiveModeBase {\n\t\tgetAutocompleteSourceTag(sourceInfo?: SourceInfo): string | undefined;\n\t\tprefixAutocompleteDescription(description: string | undefined, sourceInfo?: SourceInfo): string | undefined;\n\t\tgetBuiltInCommandConflictDiagnostics(extensionRunner: ExtensionRunner): ResourceDiagnostic[];\n\t\tcreateBaseAutocompleteProvider(): AutocompleteProvider;\n\t\tbuildRemoteSlashCommands(localCommands: SlashCommand[]): SlashCommand[];\n\t\tsetupAutocompleteProvider(): void;\n\t\tshowStartupNoticesIfNeeded(targetContainer?: Container): void;\n\t\treportModelCatalogWarning(targetContainer?: Container): void;\n\t\treportedModelCatalogWarning: string | undefined;\n\t\thadLastChangelogVersionAtStartup: boolean;\n\t\tfirstRunNoticeVisible: boolean;\n\t\tfirstRunOnboardingNoticeComponents: Component[];\n\t\tinitializeFirstRunOnboardingMarkers(): void;\n\t\tisFirstRunOnboardingEligible(): boolean;\n\t\tclearFirstRunOnboardingUi(): void;\n\t\tinit(): Promise<void>;\n\t\tcompleteDeferredStartup(): Promise<void>;\n\t\tretryDeferredModelRestore(targetContainer?: Container): Promise<void>;\n\t\tupdateTerminalTitle(): void;\n\t\trun(): Promise<void>;\n\t\tcheckForPackageUpdates(): Promise<string[]>;\n\t\tcheckTmuxKeyboardSetup(): Promise<string | undefined>;\n\t\tgetChangelogForDisplay(): string | undefined;\n\t\treportInstallTelemetry(version: string): void;\n\t\tgetMarkdownThemeWithSettings(): MarkdownTheme;\n\t\tgetMarkdownTransformers(): MarkdownTransformer[];\n\t\tformatDisplayPath(p: string): string;\n\t\tformatExtensionDisplayPath(path: string): string;\n\t\tformatContextPath(p: string): string;\n\t\tgetStartupModelLabel(): string;\n\t\tgetStartupIdentityText(maxWidth?: number, gap?: number, manifestoPhase?: number): string;\n\t\tgetAtomicAnsiMarkLines(gap?: number): string[];\n\t\tgetStartupExpansionState(): boolean;\n\t\tshouldShowStartupHeader(): boolean;\n\t\tshouldShowStartupDetails(): boolean;\n\t\tgetShortPath(fullPath: string, sourceInfo?: SourceInfo): string;\n\t\tgetCompactPathLabel(resourcePath: string, sourceInfo?: SourceInfo): string;\n\t\tgetCompactPackageSourceLabel(sourceInfo?: SourceInfo): string;\n\t\tgetCompactExtensionLabel(resourcePath: string, sourceInfo?: SourceInfo): string;\n\t\tgetCompactDisplayPathSegments(resourcePath: string): string[];\n\t\tgetCompactNonPackageExtensionLabel(\n\t\t\tresourcePath: string,\n\t\t\tindex: number,\n\t\t\tallPaths: Array<{ path: string; segments: string[] }>,\n\t\t): string;\n\t\tgetCompactExtensionLabels(extensions: Array<{ path: string; sourceInfo?: SourceInfo }>): string[];\n\t\tgetDisplaySourceInfo(sourceInfo?: SourceInfo): {\n\t\t\tlabel: string;\n\t\t\tscopeLabel?: string;\n\t\t\tcolor: \"accent\" | \"muted\";\n\t\t};\n\t\tgetScopeGroup(sourceInfo?: SourceInfo): \"user\" | \"project\" | \"path\";\n\t\tisPackageSource(sourceInfo?: SourceInfo): boolean;\n\t\tbuildScopeGroups(items: Array<{ path: string; sourceInfo?: SourceInfo }>): Array<{\n\t\t\tscope: \"user\" | \"project\" | \"path\";\n\t\t\tpaths: Array<{ path: string; sourceInfo?: SourceInfo }>;\n\t\t\tpackages: Map<string, Array<{ path: string; sourceInfo?: SourceInfo }>>;\n\t\t}>;\n\t\tformatScopeGroups(\n\t\t\tgroups: Array<{\n\t\t\t\tscope: \"user\" | \"project\" | \"path\";\n\t\t\t\tpaths: Array<{ path: string; sourceInfo?: SourceInfo }>;\n\t\t\t\tpackages: Map<string, Array<{ path: string; sourceInfo?: SourceInfo }>>;\n\t\t\t}>,\n\t\t\toptions: {\n\t\t\t\tformatPath: (item: { path: string; sourceInfo?: SourceInfo }) => string;\n\t\t\t\tformatPackagePath: (item: { path: string; sourceInfo?: SourceInfo }, source: string) => string;\n\t\t\t},\n\t\t): string;\n\t\tfindSourceInfoForPath(p: string, sourceInfos: Map<string, SourceInfo>): SourceInfo | undefined;\n\t\tformatPathWithSource(p: string, sourceInfo?: SourceInfo): string;\n\t\tformatDiagnostics(diagnostics: readonly ResourceDiagnostic[], sourceInfos: Map<string, SourceInfo>): string;\n\t\taddResourceDisclosure(options: {\n\t\t\tcontextFiles: ReadonlyArray<{ path: string }>;\n\t\t\tskills: ReadonlyArray<{ filePath: string; name: string }>;\n\t\t\tprompts: ReadonlyArray<{ filePath: string; name: string }>;\n\t\t\textensions: ReadonlyArray<{ path: string; sourceInfo?: SourceInfo }>;\n\t\t\texpandedSections: {\n\t\t\t\tcontext?: string;\n\t\t\t\tskills?: string;\n\t\t\t\tprompts?: string;\n\t\t\t\textensions?: string;\n\t\t\t};\n\t\t\ttargetContainer?: Container;\n\t\t}): void;\n\t\tshowLoadedResources(options?: {\n\t\t\textensions?: Array<{ path: string; sourceInfo?: SourceInfo }>;\n\t\t\tforce?: boolean;\n\t\t\tshowDiagnosticsWhenQuiet?: boolean;\n\t\t\ttargetContainer?: Container;\n\t\t}): void;\n\t\tbindCurrentSessionExtensions(): Promise<void>;\n\t\tapplyRuntimeSettings(): void;\n\t\trebindCurrentSession(): Promise<void>;\n\t\thandleFatalRuntimeError(prefix: string, error: unknown): Promise<never>;\n\t\trenderCurrentSessionState(): void;\n\t\tstartSessionRecovery(reason: SessionRecoveryReason): void;\n\t\tgetRegisteredToolDefinition(toolName: string): ToolRenderers | undefined;\n\t\tsetupExtensionShortcuts(extensionRunner: ExtensionRunner): void;\n\t\tsetExtensionStatus(key: string, text: string | undefined): void;\n\t\tgetWorkingLoaderMessage(): string;\n\t\tcreateWorkingLoader(): AtomicWorkingLoader;\n\t\tclearWorkingLoader(): void;\n\t\tstopWorkingLoader(): void;\n\t\tshowWorkingLoaderNow(): void;\n\t\tsetWorkingVisible(visible: boolean): void;\n\t\tsetWorkingIndicator(options?: LoaderIndicatorOptions): void;\n\t\tsetHiddenThinkingLabel(label?: string): void;\n\t\tsetExtensionWidget(\n\t\t\tkey: string,\n\t\t\tcontent: string[] | ((tui: TUI, thm: Theme) => Component & { dispose?(): void }) | undefined,\n\t\t\toptions?: ExtensionWidgetOptions,\n\t\t): void;\n\t\tclearExtensionWidgets(): void;\n\t\tresetExtensionUI(): void;\n\t\trenderWidgets(): void;\n\t\trenderWidgetContainer(\n\t\t\tcontainer: Container,\n\t\t\twidgets: Map<string, Component & { dispose?(): void }>,\n\t\t\tspacerWhenEmpty: boolean,\n\t\t\tleadingSpacer: boolean,\n\t\t): void;\n\t\tsetExtensionFooter(\n\t\t\tfactory:\n\t\t\t\t| ((tui: TUI, thm: Theme, footerData: ReadonlyFooterDataProvider) => Component & { dispose?(): void })\n\t\t\t\t| undefined,\n\t\t): void;\n\t\tsetExtensionHeader(factory: ((tui: TUI, thm: Theme) => Component & { dispose?(): void }) | undefined): void;\n\t\taddExtensionTerminalInputListener(\n\t\t\thandler: (data: string) => { consume?: boolean; data?: string } | undefined,\n\t\t): () => void;\n\t\tclearExtensionTerminalInputListeners(): void;\n\t\tgetHostCustomUiState(): HostCustomUiState;\n\t\tnotifyHostCustomUiStateListeners(): void;\n\t\tbeginHostInlineCustomUi(purpose?: \"prompt\" | \"navigation\"): () => void;\n\t\tbeginInlineCustomUiFocusDeferral(): () => void;\n\t\tshouldDeferInlineCustomUiFocus(): boolean;\n\t\tfocusHostInlineCustomUi(): boolean;\n\t\tonHostCustomUiStateChange(listener: HostCustomUiStateListener): () => void;\n\t\tonExtensionWidgetRelease(key: string, listener: () => void): () => void;\n\t\tnotifyExtensionWidgetRelease(key: string): void;\n\t\tcreateProjectTrustContext(cwd: string): ProjectTrustContext;\n\t\tcreateExtensionUIContext(): ExtensionUIContext;\n\t\tshowExtensionSelector(\n\t\t\ttitle: string,\n\t\t\toptions: string[],\n\t\t\topts?: ExtensionUIDialogOptions,\n\t\t\tblocked?: BlockedStatus,\n\t\t): Promise<string | undefined>;\n\t\tshowExtensionConfirm(title: string, message: string, opts?: ExtensionUIDialogOptions): Promise<boolean>;\n\t\tpromptForMissingSessionCwd(error: MissingSessionCwdError): Promise<string | undefined>;\n\t\tshowExtensionInput(\n\t\t\ttitle: string,\n\t\t\tplaceholder?: string,\n\t\t\topts?: ExtensionUIDialogOptions,\n\t\t): Promise<string | undefined>;\n\t\tshowExtensionEditor(\n\t\t\ttitle: string,\n\t\t\tprefill?: string,\n\t\t\topts?: ExtensionUIDialogOptions,\n\t\t): Promise<string | undefined>;\n\t\tsetCustomEditorComponent(factory: EditorFactory | undefined): void;\n\t\tshowExtensionNotify(message: string, type?: \"info\" | \"warning\" | \"error\"): void;\n\t\tshowExtensionCustom<T>(\n\t\t\tfactory: (\n\t\t\t\ttui: TUI,\n\t\t\t\ttheme: Theme,\n\t\t\t\tkeybindings: KeybindingsManager,\n\t\t\t\tdone: (result: T) => void,\n\t\t\t) => (Component & { dispose?(): void }) | Promise<Component & { dispose?(): void }>,\n\t\t\toptions?: {\n\t\t\t\tpurpose?: \"prompt\" | \"navigation\";\n\t\t\t\toverlay?: boolean;\n\t\t\t\tdeferInlineCustomUiFocus?: boolean;\n\t\t\t\thandlesInternalUiAction?: boolean;\n\t\t\t\t/** Overlay-only: bound the overlay and reserve transcript scroll extent. */\n\t\t\t\treserveTranscriptRows?: boolean;\n\t\t\t\tsignal?: AbortSignal;\n\t\t\t\toverlayOptions?: OverlayOptions | (() => OverlayOptions);\n\t\t\t\tonHandle?: (handle: OverlayHandle) => void;\n\t\t\t\tblocked?: BlockedStatus;\n\t\t\t},\n\t\t): Promise<T>;\n\t\tshowExtensionError(extensionPath: string, error: string, stack?: string): void;\n\t\tsetupKeyHandlers(): void;\n\t\thandleClipboardImagePaste(): Promise<void>;\n\t\tsetupEditorSubmitHandler(): void;\n\t\tdeliverStartupReplayPrompt(text: string): void;\n\t\tdrainStartupReplayCommands(): Promise<void>;\n\t\tadvanceStartupInputReplay(submittedText: string): void;\n\t\tsubscribeToAgent(): void;\n\t\thandleEvent(event: AgentSessionEvent | JsonAgentSessionEvent): Promise<void>;\n\t\tgetUserMessageText(message: Message): string;\n\t\tshowStatus(message: string, persist?: boolean): void;\n\t\t/** Report a managed-tool (fd/rg) readiness update inside the transcript. */\n\t\tshowManagedToolStatus(status: ToolStatus): void;\n\t\t/** Bring fd/rg to readiness after first paint; progress lands in the transcript. */\n\t\tensureManagedToolsReady(): Promise<void>;\n\t\tchatMessageRenderOptions(): ChatMessageRenderOptions;\n\t\taddRenderedChatEntry(entry: ChatMessageEntry): Component;\n\t\taddCompactionBoundaryToChat(result: VerbatimCompactionResult): void;\n\t\taddCompactionCostNotice(kind: \"compaction\" | \"branch_summary\", usage: Usage): void;\n\t\tmaybeShowAssistantDiagnostics(message: AssistantMessage): void;\n\t\tmaybeShowInstallChangeWarning(): boolean;\n\t\taddMessageToChat(message: AgentMessage, options?: { populateHistory?: boolean }): void;\n\t\taddCustomEntryToChat(entry: CustomEntry): void;\n\t\trenderSessionContext(\n\t\t\tsessionContext: SessionContext,\n\t\t\toptions?: { updateFooter?: boolean; populateHistory?: boolean },\n\t\t): void;\n\t\trenderSessionEntries(\n\t\t\tentries: SessionEntry[],\n\t\t\toptions?: {\n\t\t\t\tupdateFooter?: boolean;\n\t\t\t\tpopulateHistory?: boolean;\n\t\t\t\tsuppressCompactionBoundary?: VerbatimCompactionResult;\n\t\t\t},\n\t\t): void;\n\t\trenderInitialMessages(): void;\n\t\tattachStartupNoticesContainer(options?: { resetDetached?: boolean }): void;\n\t\tgetUserInput(): Promise<InteractiveSubmission>;\n\t\trunUserPromptTurn(submission: InteractiveSubmission | string): Promise<void>;\n\t\trenderDeferredUserInput(text: string): void;\n\t\tconsumeDeferredRenderedUserInput(text: string): boolean;\n\t\tdiscardDeferredRenderedUserInput(text: string): void;\n\t\tensureDeferredStartupComplete(): Promise<void>;\n\t\trebuildChatFromMessages(options?: {\n\t\t\tsuppressCompactionBoundary?: VerbatimCompactionResult;\n\t\t\tresetStartupDisclosure?: boolean;\n\t\t}): void;\n\t\thandleCtrlC(): void;\n\t\tinterruptActiveOperation(): boolean;\n\t\thandleCtrlD(): void;\n\t\tshutdown(options?: { fromSignal?: boolean }): Promise<void>;\n\t\temergencyTerminalExit(): never;\n\t\tuncaughtCrash(error: Error): never;\n\t\tgetCrashExtensionHint(error: unknown): string | undefined;\n\t\tcheckShutdownRequested(): Promise<void>;\n\t\tregisterSignalHandlers(): void;\n\t\tunregisterSignalHandlers(): void;\n\t\thandleCtrlZ(): void;\n\t\thandleFollowUp(): Promise<void>;\n\t\thandleDequeue(): void;\n\t\trefreshBuiltInHeader(): void;\n\t\tupdateEditorBorderColor(): void;\n\t\tcycleThinkingLevel(): Promise<void>;\n\t\tcycleModel(direction: \"forward\" | \"backward\"): Promise<void>;\n\t\ttoggleToolOutputExpansion(): void;\n\t\tsetToolsExpanded(expanded: boolean): void;\n\t\ttoggleThinkingBlockVisibility(): void;\n\t\tupdateThinkingBlockVisibility(): void;\n\t\topenExternalEditor(): Promise<void>;\n\t\tclearEditor(): void;\n\t\tshowError(errorMessage: string): void;\n\t\tshowWarning(warningMessage: string, targetContainer?: Container): void;\n\t\tshowNewVersionNotification(newVersion: string, targetContainer?: Container): void;\n\t\tshowPackageUpdateNotification(packages: string[], targetContainer?: Container): void;\n\t\tgetAllQueuedMessages(): { steering: string[]; followUp: string[] };\n\t\tclearAllQueues(options?: { preserveUnprotectedCustomMessages?: boolean }): {\n\t\t\tsteering: string[];\n\t\t\tfollowUp: string[];\n\t\t};\n\t\tupdatePendingMessagesDisplay(): void;\n\t\trestoreQueuedMessagesToEditor(options?: {\n\t\t\tabort?: boolean;\n\t\t\tcurrentText?: string;\n\t\t\tpreserveUnprotectedCustomMessages?: boolean;\n\t\t}): number;\n\t\tqueueCompactionMessage(text: string, mode: \"steer\" | \"followUp\"): void;\n\t\tisExtensionCommand(text: string): boolean;\n\t\tflushCompactionQueue(options?: { willRetry?: boolean; afterPrompt?: boolean }): Promise<void>;\n\t\tflushPendingBashComponents(): void;\n\t\tshowSelector(\n\t\t\tcreate: (done: () => void) => { component: Component; focus: Component; dispose?: () => void },\n\t\t): void;\n\t\tshowSettingsSelector(): void;\n\t\thandleModelCommand(searchTerm?: string): Promise<void>;\n\t\thandleThinkingCommand(searchTerm?: string): Promise<void>;\n\t\tselectThinkingLevel(level: ThinkingLevel): Promise<void>;\n\t\tshowThinkingSelector(): void;\n\t\tfindExactModelMatch(searchTerm: string): Promise<Model<Api> | undefined>;\n\t\tgetModelCandidates(): Promise<Model<Api>[]>;\n\t\tupdateAvailableProviderCount(): Promise<void>;\n\t\tmaybeWarnAboutAnthropicSubscriptionAuth(\n\t\t\tmodel?: Model<Api> | undefined,\n\t\t\ttargetContainer?: Container,\n\t\t): Promise<void>;\n\t\tshowModelSelector(initialSearchInput?: string): void;\n\t\tshowModelsSelector(): void;\n\t\tshowUserMessageSelector(): Promise<void>;\n\t\thandleCloneCommand(): Promise<void>;\n\t\tmaybeSaveImplicitProjectTrustAfterReload(): boolean;\n\t\tshowTrustSelector(): void;\n\t\tshowTreeSelector(initialSelectedId?: string): Promise<void>;\n\t\tshowSessionSelector(): void;\n\t\thandleResumeSession(\n\t\t\tsessionId: string,\n\t\t\toptions?: Parameters<ExtensionCommandContext[\"switchSession\"]>[1],\n\t\t\tsessionDirectory?: string,\n\t\t): Promise<{ cancelled: boolean }>;\n\t\tgetLoginProviderOptions(authType?: \"oauth\" | \"api_key\"): AuthSelectorProvider[];\n\t\tgetLogoutProviderOptions(): AuthSelectorProvider[];\n\t\thandleLoginCommand(providerRef?: string): Promise<void>;\n\t\tstartProviderLogin(providerOption: AuthSelectorProvider, onBack?: () => void): Promise<void>;\n\t\tshowLoginAuthTypeSelector(providerOptions?: AuthSelectorProvider[]): void;\n\t\tshowLoginProviderSelector(authType?: \"oauth\" | \"api_key\", initialSearchInput?: string): void;\n\t\tshowOAuthSelector(mode: \"login\" | \"logout\", initialSearchInput?: string): Promise<void>;\n\t\tcompleteProviderAuthentication(\n\t\t\tproviderId: string,\n\t\t\tproviderName: string,\n\t\t\tauthType: \"oauth\" | \"api_key\",\n\t\t\tpreviousModel: Model<Api> | undefined,\n\t\t\toptions?: { modelsRefreshed?: boolean },\n\t\t): Promise<void>;\n\t\tshowBedrockSetupDialog(providerId: string, providerName: string, onBack?: () => void): void;\n\t\tshowApiKeyLoginDialog(providerId: string, providerName: string, onBack?: () => void): Promise<void>;\n\t\tshowOAuthLoginSelect(dialog: LoginDialogComponent, prompt: OAuthSelectPrompt): Promise<string | undefined>;\n\t\tshowLoginDialog(providerId: string, providerName: string, onBack?: () => void): Promise<void>;\n\t\thandleReloadCommand(): Promise<void>;\n\t\thandleExportCommand(text: string): Promise<void>;\n\t\tgetPathCommandArgument(text: string, command: \"/export\" | \"/import\"): string | undefined;\n\t\thandleImportCommand(text: string): Promise<void>;\n\t\thandleShareCommand(): Promise<void>;\n\t\thandleCopyCommand(): Promise<void>;\n\t\thandleNameCommand(text: string): Promise<void>;\n\t\thandleSessionCommand(): void;\n\t\thandleToolsCommand(): Promise<void>;\n\t\thandleChangelogCommand(): void;\n\t\tgetAppKeyDisplay(action: AppKeybinding): string;\n\t\tgetEditorKeyDisplay(action: Keybinding): string;\n\t\tjumpToTranscriptEnd(): void;\n\t\tsetFullscreenCopyOnSelect(enabled: boolean): void;\n\t\thandleHotkeysCommand(): void;\n\t\thandleClearCommand(): Promise<void>;\n\t\thandleDebugCommand(): void;\n\t\thandleArminSaysHi(): void;\n\t\thandleDementedDelves(): void;\n\t\thandleBashCommand(command: string, excludeFromContext?: boolean): Promise<void>;\n\t\thandleCompactCommand(): Promise<void>;\n\t\tstop(fullscreenExitOutput?: FullscreenExitOutput): void;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interactive-mode-surface.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode-surface.ts"],"names":[],"mappings":"","sourcesContent":["import type { AssistantMessage, Usage } from \"@bastani/pi-ai/compat\";\nimport type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\n/** Method surface installed onto InteractiveModeBase by sibling modules. */\n\nimport type { MarkdownTransformer, SessionRecoveryReason, ToolRenderers } from \"../../core/extensions/types.ts\";\nimport type { CustomEntry, SessionEntry } from \"../../core/session-manager.ts\";\nimport type { FullscreenExitOutput } from \"../../core/settings-manager.ts\";\nimport type { ToolStatus } from \"../../utils/tools-manager.ts\";\nimport type { JsonAgentSessionEvent } from \"../json-event.ts\";\nimport type { AtomicWorkingLoader } from \"./components/atomic-working-status.ts\";\nimport type {\n\tAgentMessage,\n\tAgentSessionEvent,\n\tApi,\n\tAppKeybinding,\n\tAuthSelectorProvider,\n\tAutocompleteProvider,\n\tChatMessageEntry,\n\tChatMessageRenderOptions,\n\tComponent,\n\tContainer,\n\tEditorFactory,\n\tExtensionCommandContext,\n\tExtensionRunner,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tHostCustomUiState,\n\tHostCustomUiStateListener,\n\tKeybinding,\n\tKeybindingsManager,\n\tLoaderIndicatorOptions,\n\tLoginDialogComponent,\n\tMarkdownTheme,\n\tMessage,\n\tMissingSessionCwdError,\n\tModel,\n\tOAuthSelectPrompt,\n\tOverlayHandle,\n\tOverlayOptions,\n\tProjectTrustContext,\n\tReadonlyFooterDataProvider,\n\tResourceDiagnostic,\n\tSessionContext,\n\tSlashCommand,\n\tSourceInfo,\n\tTheme,\n\tTUI,\n\tVerbatimCompactionResult,\n} from \"./interactive-mode-deps.ts\";\nimport type { InteractiveSubmission } from \"./interactive-submission.ts\";\nimport type { BlockedStatus } from \"./program-status-reporter.ts\";\n\ndeclare module \"./interactive-mode-base.ts\" {\n\tinterface InteractiveModeBase {\n\t\tgetAutocompleteSourceTag(sourceInfo?: SourceInfo): string | undefined;\n\t\tprefixAutocompleteDescription(description: string | undefined, sourceInfo?: SourceInfo): string | undefined;\n\t\tgetBuiltInCommandConflictDiagnostics(extensionRunner: ExtensionRunner): ResourceDiagnostic[];\n\t\tcreateBaseAutocompleteProvider(): AutocompleteProvider;\n\t\tbuildRemoteSlashCommands(localCommands: SlashCommand[]): SlashCommand[];\n\t\tsetupAutocompleteProvider(): void;\n\t\tshowStartupNoticesIfNeeded(targetContainer?: Container): void;\n\t\treportModelCatalogWarning(targetContainer?: Container): void;\n\t\treportedModelCatalogWarning: string | undefined;\n\t\thadLastChangelogVersionAtStartup: boolean;\n\t\tfirstRunNoticeVisible: boolean;\n\t\tfirstRunOnboardingNoticeComponents: Component[];\n\t\tinitializeFirstRunOnboardingMarkers(): void;\n\t\tisFirstRunOnboardingEligible(): boolean;\n\t\tclearFirstRunOnboardingUi(): void;\n\t\tinit(): Promise<void>;\n\t\tcompleteDeferredStartup(): Promise<void>;\n\t\tretryDeferredModelRestore(targetContainer?: Container): Promise<void>;\n\t\tupdateTerminalTitle(): void;\n\t\trun(): Promise<void>;\n\t\tcheckForPackageUpdates(): Promise<string[]>;\n\t\tcheckTmuxKeyboardSetup(): Promise<string | undefined>;\n\t\tgetChangelogForDisplay(): string | undefined;\n\t\treportInstallTelemetry(version: string): void;\n\t\tgetMarkdownThemeWithSettings(): MarkdownTheme;\n\t\tgetMarkdownTransformers(): MarkdownTransformer[];\n\t\tformatDisplayPath(p: string): string;\n\t\tformatExtensionDisplayPath(path: string): string;\n\t\tformatContextPath(p: string): string;\n\t\tgetStartupModelLabel(): string;\n\t\tgetStartupIdentityText(maxWidth?: number, gap?: number, manifestoPhase?: number): string;\n\t\tgetAtomicAnsiMarkLines(gap?: number): string[];\n\t\tgetStartupExpansionState(): boolean;\n\t\tshouldShowStartupHeader(): boolean;\n\t\tshouldShowStartupDetails(): boolean;\n\t\tgetShortPath(fullPath: string, sourceInfo?: SourceInfo): string;\n\t\tgetCompactPathLabel(resourcePath: string, sourceInfo?: SourceInfo): string;\n\t\tgetCompactPackageSourceLabel(sourceInfo?: SourceInfo): string;\n\t\tgetCompactExtensionLabel(resourcePath: string, sourceInfo?: SourceInfo): string;\n\t\tgetCompactDisplayPathSegments(resourcePath: string): string[];\n\t\tgetCompactNonPackageExtensionLabel(\n\t\t\tresourcePath: string,\n\t\t\tindex: number,\n\t\t\tallPaths: Array<{ path: string; segments: string[] }>,\n\t\t): string;\n\t\tgetCompactExtensionLabels(extensions: Array<{ path: string; sourceInfo?: SourceInfo }>): string[];\n\t\tgetDisplaySourceInfo(sourceInfo?: SourceInfo): {\n\t\t\tlabel: string;\n\t\t\tscopeLabel?: string;\n\t\t\tcolor: \"accent\" | \"muted\";\n\t\t};\n\t\tgetScopeGroup(sourceInfo?: SourceInfo): \"user\" | \"project\" | \"path\";\n\t\tisPackageSource(sourceInfo?: SourceInfo): boolean;\n\t\tbuildScopeGroups(items: Array<{ path: string; sourceInfo?: SourceInfo }>): Array<{\n\t\t\tscope: \"user\" | \"project\" | \"path\";\n\t\t\tpaths: Array<{ path: string; sourceInfo?: SourceInfo }>;\n\t\t\tpackages: Map<string, Array<{ path: string; sourceInfo?: SourceInfo }>>;\n\t\t}>;\n\t\tformatScopeGroups(\n\t\t\tgroups: Array<{\n\t\t\t\tscope: \"user\" | \"project\" | \"path\";\n\t\t\t\tpaths: Array<{ path: string; sourceInfo?: SourceInfo }>;\n\t\t\t\tpackages: Map<string, Array<{ path: string; sourceInfo?: SourceInfo }>>;\n\t\t\t}>,\n\t\t\toptions: {\n\t\t\t\tformatPath: (item: { path: string; sourceInfo?: SourceInfo }) => string;\n\t\t\t\tformatPackagePath: (item: { path: string; sourceInfo?: SourceInfo }, source: string) => string;\n\t\t\t},\n\t\t): string;\n\t\tfindSourceInfoForPath(p: string, sourceInfos: Map<string, SourceInfo>): SourceInfo | undefined;\n\t\tformatPathWithSource(p: string, sourceInfo?: SourceInfo): string;\n\t\tformatDiagnostics(diagnostics: readonly ResourceDiagnostic[], sourceInfos: Map<string, SourceInfo>): string;\n\t\taddResourceDisclosure(options: {\n\t\t\tcontextFiles: ReadonlyArray<{ path: string }>;\n\t\t\tskills: ReadonlyArray<{ filePath: string; name: string }>;\n\t\t\tprompts: ReadonlyArray<{ filePath: string; name: string }>;\n\t\t\textensions: ReadonlyArray<{ path: string; sourceInfo?: SourceInfo }>;\n\t\t\texpandedSections: {\n\t\t\t\tcontext?: string;\n\t\t\t\tskills?: string;\n\t\t\t\tprompts?: string;\n\t\t\t\textensions?: string;\n\t\t\t};\n\t\t\ttargetContainer?: Container;\n\t\t}): void;\n\t\tshowLoadedResources(options?: {\n\t\t\textensions?: Array<{ path: string; sourceInfo?: SourceInfo }>;\n\t\t\tforce?: boolean;\n\t\t\tshowDiagnosticsWhenQuiet?: boolean;\n\t\t\ttargetContainer?: Container;\n\t\t}): void;\n\t\tbindCurrentSessionExtensions(): Promise<void>;\n\t\tapplyRuntimeSettings(): void;\n\t\trebindCurrentSession(): Promise<void>;\n\t\thandleFatalRuntimeError(prefix: string, error: unknown): Promise<never>;\n\t\trenderCurrentSessionState(): void;\n\t\tstartSessionRecovery(reason: SessionRecoveryReason): void;\n\t\tgetRegisteredToolDefinition(toolName: string): ToolRenderers | undefined;\n\t\tsetupExtensionShortcuts(extensionRunner: ExtensionRunner): void;\n\t\tsetExtensionStatus(key: string, text: string | undefined): void;\n\t\tgetWorkingLoaderMessage(): string;\n\t\tcreateWorkingLoader(): AtomicWorkingLoader;\n\t\tclearWorkingLoader(): void;\n\t\tstopWorkingLoader(): void;\n\t\tshowWorkingLoaderNow(): void;\n\t\tsetWorkingVisible(visible: boolean): void;\n\t\tsetWorkingIndicator(options?: LoaderIndicatorOptions): void;\n\t\tsetHiddenThinkingLabel(label?: string): void;\n\t\tsetExtensionWidget(\n\t\t\tkey: string,\n\t\t\tcontent: string[] | ((tui: TUI, thm: Theme) => Component & { dispose?(): void }) | undefined,\n\t\t\toptions?: ExtensionWidgetOptions,\n\t\t): void;\n\t\tclearExtensionWidgets(): void;\n\t\tresetExtensionUI(): void;\n\t\trenderWidgets(): void;\n\t\trenderWidgetContainer(\n\t\t\tcontainer: Container,\n\t\t\twidgets: Map<string, Component & { dispose?(): void }>,\n\t\t\tspacerWhenEmpty: boolean,\n\t\t\tleadingSpacer: boolean,\n\t\t): void;\n\t\tsetExtensionFooter(\n\t\t\tfactory:\n\t\t\t\t| ((tui: TUI, thm: Theme, footerData: ReadonlyFooterDataProvider) => Component & { dispose?(): void })\n\t\t\t\t| undefined,\n\t\t): void;\n\t\tsetExtensionHeader(factory: ((tui: TUI, thm: Theme) => Component & { dispose?(): void }) | undefined): void;\n\t\taddExtensionTerminalInputListener(\n\t\t\thandler: (data: string) => { consume?: boolean; data?: string } | undefined,\n\t\t): () => void;\n\t\tclearExtensionTerminalInputListeners(): void;\n\t\tgetHostCustomUiState(): HostCustomUiState;\n\t\tnotifyHostCustomUiStateListeners(): void;\n\t\tbeginHostInlineCustomUi(purpose?: \"prompt\" | \"navigation\"): () => void;\n\t\tbeginInlineCustomUiFocusDeferral(): () => void;\n\t\tshouldDeferInlineCustomUiFocus(): boolean;\n\t\tfocusHostInlineCustomUi(): boolean;\n\t\tonHostCustomUiStateChange(listener: HostCustomUiStateListener): () => void;\n\t\tonExtensionWidgetRelease(key: string, listener: () => void): () => void;\n\t\tnotifyExtensionWidgetRelease(key: string): void;\n\t\tcreateProjectTrustContext(cwd: string): ProjectTrustContext;\n\t\tcreateExtensionUIContext(): ExtensionUIContext;\n\t\tshowExtensionSelector(\n\t\t\ttitle: string,\n\t\t\toptions: string[],\n\t\t\topts?: ExtensionUIDialogOptions,\n\t\t\tblocked?: BlockedStatus,\n\t\t): Promise<string | undefined>;\n\t\tshowExtensionConfirm(title: string, message: string, opts?: ExtensionUIDialogOptions): Promise<boolean>;\n\t\tpromptForMissingSessionCwd(error: MissingSessionCwdError): Promise<string | undefined>;\n\t\tshowExtensionInput(\n\t\t\ttitle: string,\n\t\t\tplaceholder?: string,\n\t\t\topts?: ExtensionUIDialogOptions,\n\t\t): Promise<string | undefined>;\n\t\tshowExtensionEditor(\n\t\t\ttitle: string,\n\t\t\tprefill?: string,\n\t\t\topts?: ExtensionUIDialogOptions,\n\t\t): Promise<string | undefined>;\n\t\tsetCustomEditorComponent(factory: EditorFactory | undefined): void;\n\t\tshowExtensionNotify(message: string, type?: \"info\" | \"warning\" | \"error\"): void;\n\t\tshowExtensionCustom<T>(\n\t\t\tfactory: (\n\t\t\t\ttui: TUI,\n\t\t\t\ttheme: Theme,\n\t\t\t\tkeybindings: KeybindingsManager,\n\t\t\t\tdone: (result: T) => void,\n\t\t\t) => (Component & { dispose?(): void }) | Promise<Component & { dispose?(): void }>,\n\t\t\toptions?: {\n\t\t\t\tpurpose?: \"prompt\" | \"navigation\";\n\t\t\t\toverlay?: boolean;\n\t\t\t\tdeferInlineCustomUiFocus?: boolean;\n\t\t\t\thandlesInternalUiAction?: boolean;\n\t\t\t\t/** Overlay-only: bound the overlay and reserve transcript scroll extent. */\n\t\t\t\treserveTranscriptRows?: boolean;\n\t\t\t\tsignal?: AbortSignal;\n\t\t\t\toverlayOptions?: OverlayOptions | (() => OverlayOptions);\n\t\t\t\tonHandle?: (handle: OverlayHandle) => void;\n\t\t\t\tblocked?: BlockedStatus;\n\t\t\t},\n\t\t): Promise<T>;\n\t\tshowExtensionError(extensionPath: string, error: string, stack?: string): void;\n\t\tsetupKeyHandlers(): void;\n\t\thandleClipboardImagePaste(): Promise<void>;\n\t\tsetupEditorSubmitHandler(): void;\n\t\tdeliverStartupReplayPrompt(text: string): void;\n\t\tdrainStartupReplayCommands(): Promise<void>;\n\t\tadvanceStartupInputReplay(submittedText: string): void;\n\t\tsubscribeToAgent(): void;\n\t\thandleEvent(event: AgentSessionEvent | JsonAgentSessionEvent): Promise<void>;\n\t\tgetUserMessageText(message: Message): string;\n\t\tshowStatus(message: string, persist?: boolean): void;\n\t\t/** Report a managed-tool (fd/rg) readiness update inside the transcript. */\n\t\tshowManagedToolStatus(status: ToolStatus): void;\n\t\t/** Bring fd/rg to readiness after first paint; progress lands in the transcript. */\n\t\tensureManagedToolsReady(): Promise<void>;\n\t\tchatMessageRenderOptions(): ChatMessageRenderOptions;\n\t\taddRenderedChatEntry(entry: ChatMessageEntry): Component;\n\t\taddCompactionBoundaryToChat(result: VerbatimCompactionResult): void;\n\t\taddCompactionCostNotice(kind: \"compaction\" | \"branch_summary\", usage: Usage): void;\n\t\tmaybeShowAssistantDiagnostics(message: AssistantMessage): void;\n\t\tmaybeShowInstallChangeWarning(): boolean;\n\t\taddMessageToChat(message: AgentMessage, options?: { populateHistory?: boolean }): void;\n\t\taddCustomEntryToChat(entry: CustomEntry): void;\n\t\trenderSessionContext(\n\t\t\tsessionContext: SessionContext,\n\t\t\toptions?: { updateFooter?: boolean; populateHistory?: boolean },\n\t\t): void;\n\t\trenderSessionEntries(\n\t\t\tentries: SessionEntry[],\n\t\t\toptions?: {\n\t\t\t\tupdateFooter?: boolean;\n\t\t\t\tpopulateHistory?: boolean;\n\t\t\t\tsuppressCompactionBoundary?: VerbatimCompactionResult;\n\t\t\t},\n\t\t): void;\n\t\trenderInitialMessages(): void;\n\t\tattachStartupNoticesContainer(options?: { resetDetached?: boolean }): void;\n\t\tgetUserInput(): Promise<InteractiveSubmission>;\n\t\trunUserPromptTurn(submission: InteractiveSubmission | string): Promise<void>;\n\t\trenderDeferredUserInput(text: string): void;\n\t\tconsumeDeferredRenderedUserInput(text: string): boolean;\n\t\tdiscardDeferredRenderedUserInput(text: string): void;\n\t\tensureDeferredStartupComplete(): Promise<void>;\n\t\trebuildChatFromMessages(options?: {\n\t\t\tsuppressCompactionBoundary?: VerbatimCompactionResult;\n\t\t\tresetStartupDisclosure?: boolean;\n\t\t}): void;\n\t\thandleCtrlC(): void;\n\t\thandleSigintSignal(): void;\n\t\tinterruptActiveOperation(): boolean;\n\t\thandleCtrlD(): void;\n\t\tshutdown(options?: { fromSignal?: boolean }): Promise<void>;\n\t\temergencyTerminalExit(): never;\n\t\tuncaughtCrash(error: Error): never;\n\t\tgetCrashExtensionHint(error: unknown): string | undefined;\n\t\tcheckShutdownRequested(): Promise<void>;\n\t\tregisterSignalHandlers(): void;\n\t\tunregisterSignalHandlers(): void;\n\t\thandleCtrlZ(): void;\n\t\thandleFollowUp(): Promise<void>;\n\t\thandleDequeue(): void;\n\t\trefreshBuiltInHeader(): void;\n\t\tupdateEditorBorderColor(): void;\n\t\tcycleThinkingLevel(): Promise<void>;\n\t\tcycleModel(direction: \"forward\" | \"backward\"): Promise<void>;\n\t\ttoggleToolOutputExpansion(): void;\n\t\tsetToolsExpanded(expanded: boolean): void;\n\t\ttoggleThinkingBlockVisibility(): void;\n\t\tupdateThinkingBlockVisibility(): void;\n\t\topenExternalEditor(): Promise<void>;\n\t\tclearEditor(): void;\n\t\tshowError(errorMessage: string): void;\n\t\tshowWarning(warningMessage: string, targetContainer?: Container): void;\n\t\tshowNewVersionNotification(newVersion: string, targetContainer?: Container): void;\n\t\tshowPackageUpdateNotification(packages: string[], targetContainer?: Container): void;\n\t\tgetAllQueuedMessages(): { steering: string[]; followUp: string[] };\n\t\tclearAllQueues(options?: { preserveUnprotectedCustomMessages?: boolean }): {\n\t\t\tsteering: string[];\n\t\t\tfollowUp: string[];\n\t\t};\n\t\tupdatePendingMessagesDisplay(): void;\n\t\trestoreQueuedMessagesToEditor(options?: {\n\t\t\tabort?: boolean;\n\t\t\tcurrentText?: string;\n\t\t\tpreserveUnprotectedCustomMessages?: boolean;\n\t\t}): number;\n\t\tqueueCompactionMessage(text: string, mode: \"steer\" | \"followUp\"): void;\n\t\tisExtensionCommand(text: string): boolean;\n\t\tflushCompactionQueue(options?: { willRetry?: boolean; afterPrompt?: boolean }): Promise<void>;\n\t\tflushPendingBashComponents(): void;\n\t\tshowSelector(\n\t\t\tcreate: (done: () => void) => { component: Component; focus: Component; dispose?: () => void },\n\t\t): void;\n\t\tshowSettingsSelector(): void;\n\t\thandleModelCommand(searchTerm?: string): Promise<void>;\n\t\thandleThinkingCommand(searchTerm?: string): Promise<void>;\n\t\tselectThinkingLevel(level: ThinkingLevel): Promise<void>;\n\t\tshowThinkingSelector(): void;\n\t\tfindExactModelMatch(searchTerm: string): Promise<Model<Api> | undefined>;\n\t\tgetModelCandidates(): Promise<Model<Api>[]>;\n\t\tupdateAvailableProviderCount(): Promise<void>;\n\t\tmaybeWarnAboutAnthropicSubscriptionAuth(\n\t\t\tmodel?: Model<Api> | undefined,\n\t\t\ttargetContainer?: Container,\n\t\t): Promise<void>;\n\t\tshowModelSelector(initialSearchInput?: string): void;\n\t\tshowModelsSelector(): void;\n\t\tshowUserMessageSelector(): Promise<void>;\n\t\thandleCloneCommand(): Promise<void>;\n\t\tmaybeSaveImplicitProjectTrustAfterReload(): boolean;\n\t\tshowTrustSelector(): void;\n\t\tshowTreeSelector(initialSelectedId?: string): Promise<void>;\n\t\tshowSessionSelector(): void;\n\t\thandleResumeSession(\n\t\t\tsessionId: string,\n\t\t\toptions?: Parameters<ExtensionCommandContext[\"switchSession\"]>[1],\n\t\t\tsessionDirectory?: string,\n\t\t): Promise<{ cancelled: boolean }>;\n\t\tgetLoginProviderOptions(authType?: \"oauth\" | \"api_key\"): AuthSelectorProvider[];\n\t\tgetLogoutProviderOptions(): AuthSelectorProvider[];\n\t\thandleLoginCommand(providerRef?: string): Promise<void>;\n\t\tstartProviderLogin(providerOption: AuthSelectorProvider, onBack?: () => void): Promise<void>;\n\t\tshowLoginAuthTypeSelector(providerOptions?: AuthSelectorProvider[]): void;\n\t\tshowLoginProviderSelector(authType?: \"oauth\" | \"api_key\", initialSearchInput?: string): void;\n\t\tshowOAuthSelector(mode: \"login\" | \"logout\", initialSearchInput?: string): Promise<void>;\n\t\tcompleteProviderAuthentication(\n\t\t\tproviderId: string,\n\t\t\tproviderName: string,\n\t\t\tauthType: \"oauth\" | \"api_key\",\n\t\t\tpreviousModel: Model<Api> | undefined,\n\t\t\toptions?: { modelsRefreshed?: boolean },\n\t\t): Promise<void>;\n\t\tshowBedrockSetupDialog(providerId: string, providerName: string, onBack?: () => void): void;\n\t\tshowApiKeyLoginDialog(providerId: string, providerName: string, onBack?: () => void): Promise<void>;\n\t\tshowOAuthLoginSelect(dialog: LoginDialogComponent, prompt: OAuthSelectPrompt): Promise<string | undefined>;\n\t\tshowLoginDialog(providerId: string, providerName: string, onBack?: () => void): Promise<void>;\n\t\thandleReloadCommand(): Promise<void>;\n\t\thandleExportCommand(text: string): Promise<void>;\n\t\tgetPathCommandArgument(text: string, command: \"/export\" | \"/import\"): string | undefined;\n\t\thandleImportCommand(text: string): Promise<void>;\n\t\thandleShareCommand(): Promise<void>;\n\t\thandleCopyCommand(): Promise<void>;\n\t\thandleNameCommand(text: string): Promise<void>;\n\t\thandleSessionCommand(): void;\n\t\thandleToolsCommand(): Promise<void>;\n\t\thandleChangelogCommand(): void;\n\t\tgetAppKeyDisplay(action: AppKeybinding): string;\n\t\tgetEditorKeyDisplay(action: Keybinding): string;\n\t\tjumpToTranscriptEnd(): void;\n\t\tsetFullscreenCopyOnSelect(enabled: boolean): void;\n\t\thandleHotkeysCommand(): void;\n\t\thandleClearCommand(): Promise<void>;\n\t\thandleDebugCommand(): void;\n\t\thandleArminSaysHi(): void;\n\t\thandleDementedDelves(): void;\n\t\thandleBashCommand(command: string, excludeFromContext?: boolean): Promise<void>;\n\t\thandleCompactCommand(): Promise<void>;\n\t\tstop(fullscreenExitOutput?: FullscreenExitOutput): void;\n\t}\n}\n"]}
|
|
@@ -29,6 +29,22 @@ InteractiveModeBase.prototype.handleCtrlC = function () {
|
|
|
29
29
|
this.lastSigintTime = now;
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* A SIGINT signal, as opposed to the Ctrl+C key. In raw mode the keyboard sends Ctrl+C to the
|
|
34
|
+
* editor as input, so a signal came from outside the TUI: on Windows, any process attached to
|
|
35
|
+
* the same console that raises a console control event. It may interrupt running work, as the
|
|
36
|
+
* key does, but never clears the editor or counts toward the double-press exit.
|
|
37
|
+
*/
|
|
38
|
+
InteractiveModeBase.prototype.handleSigintSignal = function () {
|
|
39
|
+
if (!process.stdin.isTTY || !process.stdin.isRaw) {
|
|
40
|
+
this.handleCtrlC();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (isWindowsSubshellActive(this))
|
|
44
|
+
return;
|
|
45
|
+
if (this.interruptActiveOperation())
|
|
46
|
+
this.lastSigintTime = 0;
|
|
47
|
+
};
|
|
32
48
|
InteractiveModeBase.prototype.interruptActiveOperation = function () {
|
|
33
49
|
// Mirror the Escape interrupt paths so Ctrl+C aborts whichever operation is
|
|
34
50
|
// currently running. Returns true when something was aborted.
|
|
@@ -154,7 +170,7 @@ InteractiveModeBase.prototype.registerSignalHandlers = function () {
|
|
|
154
170
|
this.signalCleanupHandlers.push(() => process.off(signal, handler));
|
|
155
171
|
}
|
|
156
172
|
const sigintHandler = () => {
|
|
157
|
-
this.
|
|
173
|
+
this.handleSigintSignal();
|
|
158
174
|
};
|
|
159
175
|
process.prependListener("SIGINT", sigintHandler);
|
|
160
176
|
this.signalCleanupHandlers.push(() => process.off("SIGINT", sigintHandler));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-process-lifecycle.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-process-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAC3F,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACnH,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAA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AAQ,EAAE,CAAC;QAC/B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;AACF,CAAC,CAAC;AAEF,mBAAmB,CAAC,SAAS,CAAC,aAAa,GAAG;IAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,6BAA6B,EAAE,CAAC;IACtD,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACpB,IAAI,CAAC,UAAU,CAAC,+BAA+B,CAAC,CAAC;IAClD,CAAC;AACF,CAAC,CAAC","sourcesContent":["import { findExtensionStackMatches } from \"../../core/crash-log.ts\";\nimport { terminateInteractiveEngine } from \"../interactive-engine/extension-ui-bridge.ts\";\nimport { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { APP_TITLE, chalk, killTrackedDetachedChildren } from \"./interactive-mode-deps.ts\";\nimport { formatCrashExtensionHint, formatResumeCommand, isDeadTerminalError } from \"./interactive-mode-helpers.ts\";\nimport { pauseAndAbortInteractiveSession } from \"./interactive-pause.ts\";\nimport { restoreFailedSubmissionDraft } from \"./interactive-prompt-restore.ts\";\nimport { isWindowsSubshellActive, openWindowsSubshell } from \"./interactive-windows-subshell.ts\";\n\nconst SHUTDOWN_INPUT_DRAIN_MAX_MS = 250;\nconst SHUTDOWN_INPUT_DRAIN_IDLE_MS = 50;\n\nInteractiveModeBase.prototype.handleCtrlC = function (this: InteractiveModeBase): void {\n\tif (isWindowsSubshellActive(this)) return;\n\t// When the agent is doing work, Ctrl+C interrupts it (matching Escape and\n\t// common CLI muscle memory) instead of clearing/exiting the editor. Only\n\t// fall back to the clear / double-press-exit behavior when idle.\n\tif (this.interruptActiveOperation()) {\n\t\t// Reset the double-press window so a follow-up Ctrl+C after the abort\n\t\t// does not immediately exit.\n\t\tthis.lastSigintTime = 0;\n\t\treturn;\n\t}\n\tconst now = Date.now();\n\tif (now - this.lastSigintTime < 500) {\n\t\tvoid this.shutdown();\n\t} else {\n\t\tthis.clearEditor();\n\t\tthis.lastSigintTime = now;\n\t}\n};\n\nInteractiveModeBase.prototype.interruptActiveOperation = function (this: InteractiveModeBase): boolean {\n\t// Mirror the Escape interrupt paths so Ctrl+C aborts whichever operation is\n\t// currently running. Returns true when something was aborted.\n\t//\n\t// Escalate first when the interactive engine owes a cooperative abort or the\n\t// heartbeat watchdog calls it unresponsive: that is the explicit termination\n\t// the watchdog advertises with \"Esc interrupt · Ctrl+C terminate\". Every\n\t// cooperative route below would otherwise queue another request for a child\n\t// that cannot answer.\n\tif (terminateInteractiveEngine(this.runtimeHost)) {\n\t\treturn true;\n\t}\n\tif (this.session.isStreaming || this.session.agent.hasQueuedMessages()) {\n\t\tpauseAndAbortInteractiveSession(this);\n\t\treturn true;\n\t}\n\tif (this.session.isBashRunning) {\n\t\tthis.session.abortBash();\n\t\treturn true;\n\t}\n\tif (this.session.isCompacting) {\n\t\tthis.session.abortCompaction();\n\t\treturn true;\n\t}\n\tif (this.session.isRetrying) {\n\t\tthis.session.abortRetry();\n\t\treturn true;\n\t}\n\treturn false;\n};\n\nInteractiveModeBase.prototype.handleCtrlD = function (this: InteractiveModeBase): void {\n\t// Only called when editor is empty (enforced by CustomEditor)\n\tvoid this.shutdown();\n};\n\nInteractiveModeBase.prototype.shutdown = async function (\n\tthis: InteractiveModeBase,\n\toptions?: { fromSignal?: boolean },\n): Promise<void> {\n\tif (this.isShuttingDown) return;\n\tthis.isShuttingDown = true;\n\t// Keep signal handlers registered until terminal cleanup has completed.\n\t// `signal-exit` checks the listener list during the same SIGTERM/SIGHUP\n\t// dispatch and re-sends the signal if only its own listeners remain.\n\n\tif (options?.fromSignal) {\n\t\tawait this.runtimeHost.dispose({ fromSignal: true });\n\t\tthis.themeController.disableAutoSync();\n\t\t// Drain any in-flight Kitty key release events briefly before stopping.\n\t\t// Keep this bounded so Ctrl+C exits do not feel stalled on Windows.\n\t\tawait this.ui.terminal.drainInput(SHUTDOWN_INPUT_DRAIN_MAX_MS, SHUTDOWN_INPUT_DRAIN_IDLE_MS);\n\t\tthis.stop();\n\t\tprocess.exit(0);\n\t}\n\n\t// Drain any in-flight Kitty key release events briefly before stopping.\n\t// Keep this bounded so Ctrl+C exits do not feel stalled on Windows.\n\tthis.themeController.disableAutoSync();\n\tawait this.ui.terminal.drainInput(SHUTDOWN_INPUT_DRAIN_MAX_MS, SHUTDOWN_INPUT_DRAIN_IDLE_MS);\n\n\tthis.stop();\n\tawait this.runtimeHost.dispose();\n\tconst resumeCommand = formatResumeCommand(this.sessionManager);\n\tif (resumeCommand) {\n\t\tprocess.stdout.write(`${chalk.dim(\"To resume this session:\")} ${resumeCommand}\\n`);\n\t}\n\tprocess.exit(0);\n};\n\nInteractiveModeBase.prototype.emergencyTerminalExit = function (this: InteractiveModeBase): never {\n\tthis.isShuttingDown = true;\n\tthis.unregisterSignalHandlers();\n\tkillTrackedDetachedChildren();\n\t// The terminal is gone. Do not run normal shutdown because TUI and\n\t// extension cleanup can write restore sequences and re-trigger EIO.\n\tprocess.exit(129);\n};\n\nInteractiveModeBase.prototype.uncaughtCrash = function (this: InteractiveModeBase, error: Error): never {\n\tif (isDeadTerminalError(error) && (error as NodeJS.ErrnoException).syscall === \"setRawMode\") {\n\t\tthis.emergencyTerminalExit();\n\t}\n\tif (this.isShuttingDown) {\n\t\tprocess.exit(1);\n\t}\n\tthis.isShuttingDown = true;\n\ttry {\n\t\tthis.unregisterSignalHandlers();\n\t} catch {}\n\ttry {\n\t\tkillTrackedDetachedChildren();\n\t} catch {}\n\ttry {\n\t\tthis.ui.stop();\n\t} catch {}\n\tconsole.error(`${APP_TITLE} exiting due to uncaughtException:`);\n\tconsole.error(error);\n\tconst extensionHint = this.getCrashExtensionHint(error);\n\tif (extensionHint) console.error(`\\n${extensionHint}`);\n\tprocess.exit(1);\n};\n\nInteractiveModeBase.prototype.getCrashExtensionHint = function (\n\tthis: InteractiveModeBase,\n\terror: unknown,\n): string | undefined {\n\ttry {\n\t\treturn formatCrashExtensionHint(\n\t\t\tfindExtensionStackMatches(\n\t\t\t\terror instanceof Error ? error.stack : undefined,\n\t\t\t\tthis.session.resourceLoader.getExtensions().extensions,\n\t\t\t),\n\t\t);\n\t} catch {\n\t\treturn undefined;\n\t}\n};\n\nInteractiveModeBase.prototype.checkShutdownRequested = async function (this: InteractiveModeBase): Promise<void> {\n\tif (!this.shutdownRequested) return;\n\tawait this.shutdown();\n};\n\nInteractiveModeBase.prototype.registerSignalHandlers = function (this: InteractiveModeBase): void {\n\tthis.unregisterSignalHandlers();\n\n\tconst signals: NodeJS.Signals[] = [\"SIGTERM\"];\n\tif (process.platform !== \"win32\") {\n\t\tsignals.push(\"SIGHUP\");\n\t}\n\n\tfor (const signal of signals) {\n\t\tconst handler = () => {\n\t\t\tkillTrackedDetachedChildren();\n\t\t\tvoid this.shutdown({ fromSignal: true });\n\t\t};\n\t\tprocess.prependListener(signal, handler);\n\t\tthis.signalCleanupHandlers.push(() => process.off(signal, handler));\n\t}\n\n\tconst sigintHandler = () => {\n\t\tthis.handleCtrlC();\n\t};\n\tprocess.prependListener(\"SIGINT\", sigintHandler);\n\tthis.signalCleanupHandlers.push(() => process.off(\"SIGINT\", sigintHandler));\n\n\tconst terminalErrorHandler = (error: Error) => {\n\t\tif (isDeadTerminalError(error)) {\n\t\t\tthis.emergencyTerminalExit();\n\t\t}\n\t\tthrow error;\n\t};\n\tfor (const stream of [process.stdin, process.stdout, process.stderr]) {\n\t\tstream.on(\"error\", terminalErrorHandler);\n\t\tthis.signalCleanupHandlers.push(() => stream.off(\"error\", terminalErrorHandler));\n\t}\n\n\t// Restore the terminal before the process dies on any uncaught throw.\n\t// Without this, an unhandled exception from extension code (or anywhere\n\t// in pi) leaves the terminal in raw mode with no cursor.\n\tconst uncaughtExceptionHandler = (error: Error) => this.uncaughtCrash(error);\n\tprocess.prependListener(\"uncaughtException\", uncaughtExceptionHandler);\n\tthis.signalCleanupHandlers.push(() => process.off(\"uncaughtException\", uncaughtExceptionHandler));\n};\n\nInteractiveModeBase.prototype.unregisterSignalHandlers = function (this: InteractiveModeBase): void {\n\tfor (const cleanup of this.signalCleanupHandlers) {\n\t\tcleanup();\n\t}\n\tthis.signalCleanupHandlers = [];\n};\n\nInteractiveModeBase.prototype.handleCtrlZ = function (this: InteractiveModeBase): void {\n\tif (process.platform === \"win32\") {\n\t\tvoid openWindowsSubshell(this).catch((error: Error) =>\n\t\t\tthis.showStatus(`PowerShell subshell failed: ${error.message}`),\n\t\t);\n\t\treturn;\n\t}\n\n\t// Keep the event loop alive while suspended. Without this, stopping the TUI\n\t// can leave Node with no ref'ed handles, causing the process to exit on fg\n\t// before the SIGCONT handler gets a chance to restore the terminal.\n\tconst suspendKeepAlive = setInterval(() => {}, 2 ** 30);\n\n\t// Ignore SIGINT while suspended so Ctrl+C in the terminal does not\n\t// kill the backgrounded process. The handler is removed on resume.\n\tconst ignoreSigint = () => {};\n\tprocess.on(\"SIGINT\", ignoreSigint);\n\n\t// Set up handler to restore TUI when resumed\n\tprocess.once(\"SIGCONT\", () => {\n\t\tclearInterval(suspendKeepAlive);\n\t\tprocess.removeListener(\"SIGINT\", ignoreSigint);\n\t\tthis.ui.start();\n\t\tthis.ui.requestRender(true);\n\t});\n\n\ttry {\n\t\t// Stop the TUI (restore terminal to normal mode)\n\t\tthis.ui.stop();\n\n\t\t// Send SIGTSTP to process group (pid=0 means all processes in group)\n\t\tprocess.kill(0, \"SIGTSTP\");\n\t} catch (error) {\n\t\tclearInterval(suspendKeepAlive);\n\t\tprocess.removeListener(\"SIGINT\", ignoreSigint);\n\t\tthrow error;\n\t}\n};\n\nInteractiveModeBase.prototype.handleFollowUp = async function (this: InteractiveModeBase): Promise<void> {\n\tconst rawText = this.editor.getExpandedText?.() ?? this.editor.getText();\n\tconst text = rawText.trim();\n\tif (!text) return;\n\n\t// Alt+Enter dispatches straight to the engine, exactly like the direct\n\t// branches of the Enter handler, so it needs the same send-failure restore:\n\t// otherwise a queued follow-up submitted while the engine is gone is lost.\n\tconst dispatch = async (send: () => Promise<void>): Promise<void> => {\n\t\ttry {\n\t\t\tawait send();\n\t\t} catch (error) {\n\t\t\tif (!restoreFailedSubmissionDraft(this, error, rawText)) throw error;\n\t\t}\n\t};\n\n\t// Queue input behind compaction-queued messages (extension commands execute immediately)\n\tif (\n\t\tthis.compactionActive ||\n\t\t(!this.session.queuedMessagesPaused && (this.compactionFlushPending || this.compactionSendFailed))\n\t) {\n\t\tif (this.isExtensionCommand(text)) {\n\t\t\tthis.editor.addToHistory?.(text);\n\t\t\tthis.editor.setText(\"\");\n\t\t\tawait dispatch(() => this.session.prompt(text));\n\t\t} else {\n\t\t\tthis.queueCompactionMessage(text, \"followUp\");\n\t\t}\n\t\treturn;\n\t}\n\n\t// A paused submission releases the session queue before its own turn, so move held\n\t// messages there first to keep them ahead of this one.\n\tif (this.session.queuedMessagesPaused && this.compactionSendFailed && !this.compactionFlushPending) {\n\t\tawait this.flushCompactionQueue({ willRetry: false });\n\t}\n\n\t// Alt+Enter queues a follow-up message (waits until agent finishes)\n\t// This handles extension commands (execute immediately), prompt template expansion, and queueing\n\tif (this.session.isStreaming) {\n\t\tthis.editor.addToHistory?.(text);\n\t\tthis.editor.setText(\"\");\n\t\tawait dispatch(async () => {\n\t\t\tawait this.session.prompt(text, { streamingBehavior: \"followUp\" });\n\t\t\tthis.updatePendingMessagesDisplay();\n\t\t\tthis.ui.requestRender();\n\t\t});\n\t}\n\t// If not streaming, Alt+Enter acts like regular Enter (trigger onSubmit).\n\t// Hand over the raw expanded buffer, not the trimmed text: Alt+Enter is an\n\t// app action, so CustomEditor returns before its own pre-trim snapshot runs\n\t// and the submit handler's only draft is this argument. It trims the value\n\t// itself for delivery, so the agent still receives the normalized prompt.\n\telse if (this.editor.onSubmit) {\n\t\tthis.editor.setText(\"\");\n\t\tthis.editor.onSubmit(rawText);\n\t}\n};\n\nInteractiveModeBase.prototype.handleDequeue = function (this: InteractiveModeBase): void {\n\tconst restored = this.restoreQueuedMessagesToEditor();\n\tif (restored === 0) {\n\t\tthis.showStatus(\"No queued messages to restore\");\n\t}\n};\n"]}
|
|
1
|
+
{"version":3,"file":"interactive-process-lifecycle.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-process-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAC3F,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACnH,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAEjG,MAAM,2BAA2B,GAAG,GAAG,CAAC;AACxC,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAExC,mBAAmB,CAAC,SAAS,CAAC,WAAW,GAAG;IAC3C,IAAI,uBAAuB,CAAC,IAAI,CAAC;QAAE,OAAO;IAC1C,0EAA0E;IAC1E,yEAAyE;IACzE,iEAAiE;IACjE,IAAI,IAAI,CAAC,wBAAwB,EAAE,EAAE,CAAC;QACrC,sEAAsE;QACtE,6BAA6B;QAC7B,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;QACxB,OAAO;IACR,CAAC;IACD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,IAAI,GAAG,GAAG,IAAI,CAAC,cAAc,GAAG,GAAG,EAAE,CAAC;QACrC,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;IACtB,CAAC;SAAM,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M,QAAQ,GAAG,IAAI,CAAC,6BAA6B,EAAE,CAAC;IACtD,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACpB,IAAI,CAAC,UAAU,CAAC,+BAA+B,CAAC,CAAC;IAClD,CAAC;AACF,CAAC,CAAC","sourcesContent":["import { findExtensionStackMatches } from \"../../core/crash-log.ts\";\nimport { terminateInteractiveEngine } from \"../interactive-engine/extension-ui-bridge.ts\";\nimport { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { APP_TITLE, chalk, killTrackedDetachedChildren } from \"./interactive-mode-deps.ts\";\nimport { formatCrashExtensionHint, formatResumeCommand, isDeadTerminalError } from \"./interactive-mode-helpers.ts\";\nimport { pauseAndAbortInteractiveSession } from \"./interactive-pause.ts\";\nimport { restoreFailedSubmissionDraft } from \"./interactive-prompt-restore.ts\";\nimport { isWindowsSubshellActive, openWindowsSubshell } from \"./interactive-windows-subshell.ts\";\n\nconst SHUTDOWN_INPUT_DRAIN_MAX_MS = 250;\nconst SHUTDOWN_INPUT_DRAIN_IDLE_MS = 50;\n\nInteractiveModeBase.prototype.handleCtrlC = function (this: InteractiveModeBase): void {\n\tif (isWindowsSubshellActive(this)) return;\n\t// When the agent is doing work, Ctrl+C interrupts it (matching Escape and\n\t// common CLI muscle memory) instead of clearing/exiting the editor. Only\n\t// fall back to the clear / double-press-exit behavior when idle.\n\tif (this.interruptActiveOperation()) {\n\t\t// Reset the double-press window so a follow-up Ctrl+C after the abort\n\t\t// does not immediately exit.\n\t\tthis.lastSigintTime = 0;\n\t\treturn;\n\t}\n\tconst now = Date.now();\n\tif (now - this.lastSigintTime < 500) {\n\t\tvoid this.shutdown();\n\t} else {\n\t\tthis.clearEditor();\n\t\tthis.lastSigintTime = now;\n\t}\n};\n\n/**\n * A SIGINT signal, as opposed to the Ctrl+C key. In raw mode the keyboard sends Ctrl+C to the\n * editor as input, so a signal came from outside the TUI: on Windows, any process attached to\n * the same console that raises a console control event. It may interrupt running work, as the\n * key does, but never clears the editor or counts toward the double-press exit.\n */\nInteractiveModeBase.prototype.handleSigintSignal = function (this: InteractiveModeBase): void {\n\tif (!process.stdin.isTTY || !process.stdin.isRaw) {\n\t\tthis.handleCtrlC();\n\t\treturn;\n\t}\n\tif (isWindowsSubshellActive(this)) return;\n\tif (this.interruptActiveOperation()) this.lastSigintTime = 0;\n};\n\nInteractiveModeBase.prototype.interruptActiveOperation = function (this: InteractiveModeBase): boolean {\n\t// Mirror the Escape interrupt paths so Ctrl+C aborts whichever operation is\n\t// currently running. Returns true when something was aborted.\n\t//\n\t// Escalate first when the interactive engine owes a cooperative abort or the\n\t// heartbeat watchdog calls it unresponsive: that is the explicit termination\n\t// the watchdog advertises with \"Esc interrupt · Ctrl+C terminate\". Every\n\t// cooperative route below would otherwise queue another request for a child\n\t// that cannot answer.\n\tif (terminateInteractiveEngine(this.runtimeHost)) {\n\t\treturn true;\n\t}\n\tif (this.session.isStreaming || this.session.agent.hasQueuedMessages()) {\n\t\tpauseAndAbortInteractiveSession(this);\n\t\treturn true;\n\t}\n\tif (this.session.isBashRunning) {\n\t\tthis.session.abortBash();\n\t\treturn true;\n\t}\n\tif (this.session.isCompacting) {\n\t\tthis.session.abortCompaction();\n\t\treturn true;\n\t}\n\tif (this.session.isRetrying) {\n\t\tthis.session.abortRetry();\n\t\treturn true;\n\t}\n\treturn false;\n};\n\nInteractiveModeBase.prototype.handleCtrlD = function (this: InteractiveModeBase): void {\n\t// Only called when editor is empty (enforced by CustomEditor)\n\tvoid this.shutdown();\n};\n\nInteractiveModeBase.prototype.shutdown = async function (\n\tthis: InteractiveModeBase,\n\toptions?: { fromSignal?: boolean },\n): Promise<void> {\n\tif (this.isShuttingDown) return;\n\tthis.isShuttingDown = true;\n\t// Keep signal handlers registered until terminal cleanup has completed.\n\t// `signal-exit` checks the listener list during the same SIGTERM/SIGHUP\n\t// dispatch and re-sends the signal if only its own listeners remain.\n\n\tif (options?.fromSignal) {\n\t\tawait this.runtimeHost.dispose({ fromSignal: true });\n\t\tthis.themeController.disableAutoSync();\n\t\t// Drain any in-flight Kitty key release events briefly before stopping.\n\t\t// Keep this bounded so Ctrl+C exits do not feel stalled on Windows.\n\t\tawait this.ui.terminal.drainInput(SHUTDOWN_INPUT_DRAIN_MAX_MS, SHUTDOWN_INPUT_DRAIN_IDLE_MS);\n\t\tthis.stop();\n\t\tprocess.exit(0);\n\t}\n\n\t// Drain any in-flight Kitty key release events briefly before stopping.\n\t// Keep this bounded so Ctrl+C exits do not feel stalled on Windows.\n\tthis.themeController.disableAutoSync();\n\tawait this.ui.terminal.drainInput(SHUTDOWN_INPUT_DRAIN_MAX_MS, SHUTDOWN_INPUT_DRAIN_IDLE_MS);\n\n\tthis.stop();\n\tawait this.runtimeHost.dispose();\n\tconst resumeCommand = formatResumeCommand(this.sessionManager);\n\tif (resumeCommand) {\n\t\tprocess.stdout.write(`${chalk.dim(\"To resume this session:\")} ${resumeCommand}\\n`);\n\t}\n\tprocess.exit(0);\n};\n\nInteractiveModeBase.prototype.emergencyTerminalExit = function (this: InteractiveModeBase): never {\n\tthis.isShuttingDown = true;\n\tthis.unregisterSignalHandlers();\n\tkillTrackedDetachedChildren();\n\t// The terminal is gone. Do not run normal shutdown because TUI and\n\t// extension cleanup can write restore sequences and re-trigger EIO.\n\tprocess.exit(129);\n};\n\nInteractiveModeBase.prototype.uncaughtCrash = function (this: InteractiveModeBase, error: Error): never {\n\tif (isDeadTerminalError(error) && (error as NodeJS.ErrnoException).syscall === \"setRawMode\") {\n\t\tthis.emergencyTerminalExit();\n\t}\n\tif (this.isShuttingDown) {\n\t\tprocess.exit(1);\n\t}\n\tthis.isShuttingDown = true;\n\ttry {\n\t\tthis.unregisterSignalHandlers();\n\t} catch {}\n\ttry {\n\t\tkillTrackedDetachedChildren();\n\t} catch {}\n\ttry {\n\t\tthis.ui.stop();\n\t} catch {}\n\tconsole.error(`${APP_TITLE} exiting due to uncaughtException:`);\n\tconsole.error(error);\n\tconst extensionHint = this.getCrashExtensionHint(error);\n\tif (extensionHint) console.error(`\\n${extensionHint}`);\n\tprocess.exit(1);\n};\n\nInteractiveModeBase.prototype.getCrashExtensionHint = function (\n\tthis: InteractiveModeBase,\n\terror: unknown,\n): string | undefined {\n\ttry {\n\t\treturn formatCrashExtensionHint(\n\t\t\tfindExtensionStackMatches(\n\t\t\t\terror instanceof Error ? error.stack : undefined,\n\t\t\t\tthis.session.resourceLoader.getExtensions().extensions,\n\t\t\t),\n\t\t);\n\t} catch {\n\t\treturn undefined;\n\t}\n};\n\nInteractiveModeBase.prototype.checkShutdownRequested = async function (this: InteractiveModeBase): Promise<void> {\n\tif (!this.shutdownRequested) return;\n\tawait this.shutdown();\n};\n\nInteractiveModeBase.prototype.registerSignalHandlers = function (this: InteractiveModeBase): void {\n\tthis.unregisterSignalHandlers();\n\n\tconst signals: NodeJS.Signals[] = [\"SIGTERM\"];\n\tif (process.platform !== \"win32\") {\n\t\tsignals.push(\"SIGHUP\");\n\t}\n\n\tfor (const signal of signals) {\n\t\tconst handler = () => {\n\t\t\tkillTrackedDetachedChildren();\n\t\t\tvoid this.shutdown({ fromSignal: true });\n\t\t};\n\t\tprocess.prependListener(signal, handler);\n\t\tthis.signalCleanupHandlers.push(() => process.off(signal, handler));\n\t}\n\n\tconst sigintHandler = () => {\n\t\tthis.handleSigintSignal();\n\t};\n\tprocess.prependListener(\"SIGINT\", sigintHandler);\n\tthis.signalCleanupHandlers.push(() => process.off(\"SIGINT\", sigintHandler));\n\n\tconst terminalErrorHandler = (error: Error) => {\n\t\tif (isDeadTerminalError(error)) {\n\t\t\tthis.emergencyTerminalExit();\n\t\t}\n\t\tthrow error;\n\t};\n\tfor (const stream of [process.stdin, process.stdout, process.stderr]) {\n\t\tstream.on(\"error\", terminalErrorHandler);\n\t\tthis.signalCleanupHandlers.push(() => stream.off(\"error\", terminalErrorHandler));\n\t}\n\n\t// Restore the terminal before the process dies on any uncaught throw.\n\t// Without this, an unhandled exception from extension code (or anywhere\n\t// in pi) leaves the terminal in raw mode with no cursor.\n\tconst uncaughtExceptionHandler = (error: Error) => this.uncaughtCrash(error);\n\tprocess.prependListener(\"uncaughtException\", uncaughtExceptionHandler);\n\tthis.signalCleanupHandlers.push(() => process.off(\"uncaughtException\", uncaughtExceptionHandler));\n};\n\nInteractiveModeBase.prototype.unregisterSignalHandlers = function (this: InteractiveModeBase): void {\n\tfor (const cleanup of this.signalCleanupHandlers) {\n\t\tcleanup();\n\t}\n\tthis.signalCleanupHandlers = [];\n};\n\nInteractiveModeBase.prototype.handleCtrlZ = function (this: InteractiveModeBase): void {\n\tif (process.platform === \"win32\") {\n\t\tvoid openWindowsSubshell(this).catch((error: Error) =>\n\t\t\tthis.showStatus(`PowerShell subshell failed: ${error.message}`),\n\t\t);\n\t\treturn;\n\t}\n\n\t// Keep the event loop alive while suspended. Without this, stopping the TUI\n\t// can leave Node with no ref'ed handles, causing the process to exit on fg\n\t// before the SIGCONT handler gets a chance to restore the terminal.\n\tconst suspendKeepAlive = setInterval(() => {}, 2 ** 30);\n\n\t// Ignore SIGINT while suspended so Ctrl+C in the terminal does not\n\t// kill the backgrounded process. The handler is removed on resume.\n\tconst ignoreSigint = () => {};\n\tprocess.on(\"SIGINT\", ignoreSigint);\n\n\t// Set up handler to restore TUI when resumed\n\tprocess.once(\"SIGCONT\", () => {\n\t\tclearInterval(suspendKeepAlive);\n\t\tprocess.removeListener(\"SIGINT\", ignoreSigint);\n\t\tthis.ui.start();\n\t\tthis.ui.requestRender(true);\n\t});\n\n\ttry {\n\t\t// Stop the TUI (restore terminal to normal mode)\n\t\tthis.ui.stop();\n\n\t\t// Send SIGTSTP to process group (pid=0 means all processes in group)\n\t\tprocess.kill(0, \"SIGTSTP\");\n\t} catch (error) {\n\t\tclearInterval(suspendKeepAlive);\n\t\tprocess.removeListener(\"SIGINT\", ignoreSigint);\n\t\tthrow error;\n\t}\n};\n\nInteractiveModeBase.prototype.handleFollowUp = async function (this: InteractiveModeBase): Promise<void> {\n\tconst rawText = this.editor.getExpandedText?.() ?? this.editor.getText();\n\tconst text = rawText.trim();\n\tif (!text) return;\n\n\t// Alt+Enter dispatches straight to the engine, exactly like the direct\n\t// branches of the Enter handler, so it needs the same send-failure restore:\n\t// otherwise a queued follow-up submitted while the engine is gone is lost.\n\tconst dispatch = async (send: () => Promise<void>): Promise<void> => {\n\t\ttry {\n\t\t\tawait send();\n\t\t} catch (error) {\n\t\t\tif (!restoreFailedSubmissionDraft(this, error, rawText)) throw error;\n\t\t}\n\t};\n\n\t// Queue input behind compaction-queued messages (extension commands execute immediately)\n\tif (\n\t\tthis.compactionActive ||\n\t\t(!this.session.queuedMessagesPaused && (this.compactionFlushPending || this.compactionSendFailed))\n\t) {\n\t\tif (this.isExtensionCommand(text)) {\n\t\t\tthis.editor.addToHistory?.(text);\n\t\t\tthis.editor.setText(\"\");\n\t\t\tawait dispatch(() => this.session.prompt(text));\n\t\t} else {\n\t\t\tthis.queueCompactionMessage(text, \"followUp\");\n\t\t}\n\t\treturn;\n\t}\n\n\t// A paused submission releases the session queue before its own turn, so move held\n\t// messages there first to keep them ahead of this one.\n\tif (this.session.queuedMessagesPaused && this.compactionSendFailed && !this.compactionFlushPending) {\n\t\tawait this.flushCompactionQueue({ willRetry: false });\n\t}\n\n\t// Alt+Enter queues a follow-up message (waits until agent finishes)\n\t// This handles extension commands (execute immediately), prompt template expansion, and queueing\n\tif (this.session.isStreaming) {\n\t\tthis.editor.addToHistory?.(text);\n\t\tthis.editor.setText(\"\");\n\t\tawait dispatch(async () => {\n\t\t\tawait this.session.prompt(text, { streamingBehavior: \"followUp\" });\n\t\t\tthis.updatePendingMessagesDisplay();\n\t\t\tthis.ui.requestRender();\n\t\t});\n\t}\n\t// If not streaming, Alt+Enter acts like regular Enter (trigger onSubmit).\n\t// Hand over the raw expanded buffer, not the trimmed text: Alt+Enter is an\n\t// app action, so CustomEditor returns before its own pre-trim snapshot runs\n\t// and the submit handler's only draft is this argument. It trims the value\n\t// itself for delivery, so the agent still receives the normalized prompt.\n\telse if (this.editor.onSubmit) {\n\t\tthis.editor.setText(\"\");\n\t\tthis.editor.onSubmit(rawText);\n\t}\n};\n\nInteractiveModeBase.prototype.handleDequeue = function (this: InteractiveModeBase): void {\n\tconst restored = this.restoreQueuedMessagesToEditor();\n\tif (restored === 0) {\n\t\tthis.showStatus(\"No queued messages to restore\");\n\t}\n};\n"]}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/atomic",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.51-alpha.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@bastani/atomic",
|
|
9
|
-
"version": "0.9.
|
|
9
|
+
"version": "0.9.51-alpha.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@bastani/atomic-natives": "0.9.
|
|
13
|
-
"@bastani/pi-ai": "0.9.
|
|
12
|
+
"@bastani/atomic-natives": "0.9.51-alpha.1",
|
|
13
|
+
"@bastani/pi-ai": "0.9.51-alpha.1",
|
|
14
14
|
"@earendil-works/pi-agent-core": "1.4.0",
|
|
15
15
|
"@earendil-works/pi-codemode": "1.4.0",
|
|
16
16
|
"@earendil-works/pi-tui": "1.4.0",
|
|
@@ -427,18 +427,18 @@
|
|
|
427
427
|
}
|
|
428
428
|
},
|
|
429
429
|
"node_modules/@bastani/atomic-natives": {
|
|
430
|
-
"version": "0.9.
|
|
431
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.
|
|
430
|
+
"version": "0.9.51-alpha.1",
|
|
431
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.51-alpha.1.tgz",
|
|
432
432
|
"license": "MIT",
|
|
433
433
|
"optionalDependencies": {
|
|
434
|
-
"@bastani/atomic-natives-darwin-arm64": "0.9.
|
|
435
|
-
"@bastani/atomic-natives-darwin-x64": "0.9.
|
|
436
|
-
"@bastani/atomic-natives-linux-arm64-gnu": "0.9.
|
|
437
|
-
"@bastani/atomic-natives-linux-arm64-musl": "0.9.
|
|
438
|
-
"@bastani/atomic-natives-linux-x64-gnu": "0.9.
|
|
439
|
-
"@bastani/atomic-natives-linux-x64-musl": "0.9.
|
|
440
|
-
"@bastani/atomic-natives-win32-arm64-msvc": "0.9.
|
|
441
|
-
"@bastani/atomic-natives-win32-x64-msvc": "0.9.
|
|
434
|
+
"@bastani/atomic-natives-darwin-arm64": "0.9.51-alpha.1",
|
|
435
|
+
"@bastani/atomic-natives-darwin-x64": "0.9.51-alpha.1",
|
|
436
|
+
"@bastani/atomic-natives-linux-arm64-gnu": "0.9.51-alpha.1",
|
|
437
|
+
"@bastani/atomic-natives-linux-arm64-musl": "0.9.51-alpha.1",
|
|
438
|
+
"@bastani/atomic-natives-linux-x64-gnu": "0.9.51-alpha.1",
|
|
439
|
+
"@bastani/atomic-natives-linux-x64-musl": "0.9.51-alpha.1",
|
|
440
|
+
"@bastani/atomic-natives-win32-arm64-msvc": "0.9.51-alpha.1",
|
|
441
|
+
"@bastani/atomic-natives-win32-x64-msvc": "0.9.51-alpha.1"
|
|
442
442
|
},
|
|
443
443
|
"engines": {
|
|
444
444
|
"bun": ">=1.4.2",
|
|
@@ -446,8 +446,8 @@
|
|
|
446
446
|
}
|
|
447
447
|
},
|
|
448
448
|
"node_modules/@bastani/atomic-natives-darwin-arm64": {
|
|
449
|
-
"version": "0.9.
|
|
450
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.
|
|
449
|
+
"version": "0.9.51-alpha.1",
|
|
450
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.51-alpha.1.tgz",
|
|
451
451
|
"license": "MIT",
|
|
452
452
|
"os": [
|
|
453
453
|
"darwin"
|
|
@@ -458,8 +458,8 @@
|
|
|
458
458
|
"optional": true
|
|
459
459
|
},
|
|
460
460
|
"node_modules/@bastani/atomic-natives-darwin-x64": {
|
|
461
|
-
"version": "0.9.
|
|
462
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.
|
|
461
|
+
"version": "0.9.51-alpha.1",
|
|
462
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.51-alpha.1.tgz",
|
|
463
463
|
"license": "MIT",
|
|
464
464
|
"os": [
|
|
465
465
|
"darwin"
|
|
@@ -470,8 +470,8 @@
|
|
|
470
470
|
"optional": true
|
|
471
471
|
},
|
|
472
472
|
"node_modules/@bastani/atomic-natives-linux-arm64-gnu": {
|
|
473
|
-
"version": "0.9.
|
|
474
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.
|
|
473
|
+
"version": "0.9.51-alpha.1",
|
|
474
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.51-alpha.1.tgz",
|
|
475
475
|
"license": "MIT",
|
|
476
476
|
"os": [
|
|
477
477
|
"linux"
|
|
@@ -485,8 +485,8 @@
|
|
|
485
485
|
"optional": true
|
|
486
486
|
},
|
|
487
487
|
"node_modules/@bastani/atomic-natives-linux-arm64-musl": {
|
|
488
|
-
"version": "0.9.
|
|
489
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.
|
|
488
|
+
"version": "0.9.51-alpha.1",
|
|
489
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.51-alpha.1.tgz",
|
|
490
490
|
"license": "MIT",
|
|
491
491
|
"os": [
|
|
492
492
|
"linux"
|
|
@@ -500,8 +500,8 @@
|
|
|
500
500
|
"optional": true
|
|
501
501
|
},
|
|
502
502
|
"node_modules/@bastani/atomic-natives-linux-x64-gnu": {
|
|
503
|
-
"version": "0.9.
|
|
504
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.
|
|
503
|
+
"version": "0.9.51-alpha.1",
|
|
504
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.51-alpha.1.tgz",
|
|
505
505
|
"license": "MIT",
|
|
506
506
|
"os": [
|
|
507
507
|
"linux"
|
|
@@ -515,8 +515,8 @@
|
|
|
515
515
|
"optional": true
|
|
516
516
|
},
|
|
517
517
|
"node_modules/@bastani/atomic-natives-linux-x64-musl": {
|
|
518
|
-
"version": "0.9.
|
|
519
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.
|
|
518
|
+
"version": "0.9.51-alpha.1",
|
|
519
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.51-alpha.1.tgz",
|
|
520
520
|
"license": "MIT",
|
|
521
521
|
"os": [
|
|
522
522
|
"linux"
|
|
@@ -530,8 +530,8 @@
|
|
|
530
530
|
"optional": true
|
|
531
531
|
},
|
|
532
532
|
"node_modules/@bastani/atomic-natives-win32-arm64-msvc": {
|
|
533
|
-
"version": "0.9.
|
|
534
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.
|
|
533
|
+
"version": "0.9.51-alpha.1",
|
|
534
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.51-alpha.1.tgz",
|
|
535
535
|
"license": "MIT",
|
|
536
536
|
"os": [
|
|
537
537
|
"win32"
|
|
@@ -542,8 +542,8 @@
|
|
|
542
542
|
"optional": true
|
|
543
543
|
},
|
|
544
544
|
"node_modules/@bastani/atomic-natives-win32-x64-msvc": {
|
|
545
|
-
"version": "0.9.
|
|
546
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.
|
|
545
|
+
"version": "0.9.51-alpha.1",
|
|
546
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.51-alpha.1.tgz",
|
|
547
547
|
"license": "MIT",
|
|
548
548
|
"os": [
|
|
549
549
|
"win32"
|
|
@@ -554,8 +554,8 @@
|
|
|
554
554
|
"optional": true
|
|
555
555
|
},
|
|
556
556
|
"node_modules/@bastani/pi-ai": {
|
|
557
|
-
"version": "0.9.
|
|
558
|
-
"resolved": "https://registry.npmjs.org/@bastani/pi-ai/-/pi-ai-0.9.
|
|
557
|
+
"version": "0.9.51-alpha.1",
|
|
558
|
+
"resolved": "https://registry.npmjs.org/@bastani/pi-ai/-/pi-ai-0.9.51-alpha.1.tgz",
|
|
559
559
|
"license": "MIT",
|
|
560
560
|
"dependencies": {
|
|
561
561
|
"@anthropic-ai/sdk": "0.129.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/atomic",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.51-alpha.1",
|
|
4
4
|
"description": "Atomic coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"atomicConfig": {
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
"prepublishOnly": "bun run clean && bun run build && bun run shrinkwrap"
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"@bastani/atomic-natives": "0.9.
|
|
93
|
-
"@bastani/pi-ai": "0.9.
|
|
92
|
+
"@bastani/atomic-natives": "0.9.51-alpha.1",
|
|
93
|
+
"@bastani/pi-ai": "0.9.51-alpha.1",
|
|
94
94
|
"@earendil-works/pi-agent-core": "1.4.0",
|
|
95
95
|
"@earendil-works/pi-codemode": "1.4.0",
|
|
96
96
|
"@earendil-works/pi-tui": "1.4.0",
|