@bastani/atomic 0.9.35 → 0.9.36
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 +16 -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/core/model-runtime.d.ts +2 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +23 -8
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +11 -1
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +15 -1
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/runtime-credentials.d.ts +1 -0
- package/dist/core/runtime-credentials.d.ts.map +1 -1
- package/dist/core/runtime-credentials.js +3 -0
- package/dist/core/runtime-credentials.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-actions.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-actions.js +23 -21
- package/dist/modes/interactive/components/chat-session-host-actions.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-events.js +1 -3
- package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.js +1 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.d.ts +5 -2
- package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
- package/dist/modes/interactive/interactive-agent-events.js +1 -1
- package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
- package/dist/modes/interactive/interactive-queueing.js +5 -0
- package/dist/modes/interactive/interactive-queueing.js.map +1 -1
- package/docs/models/reference.md +4 -4
- package/docs/providers.md +2 -0
- package/docs/usage.md +2 -0
- package/npm-shrinkwrap.json +32 -32
- package/package.json +3 -3
|
@@ -92,6 +92,11 @@ InteractiveModeBase.prototype.flushCompactionQueue = async function (options) {
|
|
|
92
92
|
this.showError(`Failed to send queued message${queuedMessages.length > 1 ? "s" : ""}: ${error instanceof Error ? error.message : String(error)}`);
|
|
93
93
|
};
|
|
94
94
|
try {
|
|
95
|
+
if (!options?.willRetry && (this.session.isStreaming || this.session.queuedMessagesPaused)) {
|
|
96
|
+
await Promise.all(queuedMessages.map((message) => this.session.prompt(message.text, { streamingBehavior: message.mode })));
|
|
97
|
+
this.updatePendingMessagesDisplay();
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
95
100
|
if (options?.willRetry) {
|
|
96
101
|
// When retry is pending, queue messages for the retry turn
|
|
97
102
|
for (const message of queuedMessages) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-queueing.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-queueing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAE1G,mBAAmB,CAAC,SAAS,CAAC,oBAAoB,GAAG;IAIpD,OAAO;QACN,QAAQ,EAAE;YACT,GAAG,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE;YACrC,GAAG,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC;SAC7F;QACD,QAAQ,EAAE;YACT,GAAG,IAAI,CAAC,OA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CAAC,qBAAqB,GAAG,EAAE,CAAC;AACjC,CAAC,CAAC","sourcesContent":["import { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { combineQueuedMessagesForEditor, Spacer, TruncatedText, theme } from \"./interactive-mode-deps.ts\";\n\nInteractiveModeBase.prototype.getAllQueuedMessages = function (this: InteractiveModeBase): {\n\tsteering: string[];\n\tfollowUp: string[];\n} {\n\treturn {\n\t\tsteering: [\n\t\t\t...this.session.getSteeringMessages(),\n\t\t\t...this.compactionQueuedMessages.filter((msg) => msg.mode === \"steer\").map((msg) => msg.text),\n\t\t],\n\t\tfollowUp: [\n\t\t\t...this.session.getFollowUpMessages(),\n\t\t\t...this.compactionQueuedMessages.filter((msg) => msg.mode === \"followUp\").map((msg) => msg.text),\n\t\t],\n\t};\n};\n\nInteractiveModeBase.prototype.clearAllQueues = function (\n\tthis: InteractiveModeBase,\n\toptions?: { preserveUnprotectedCustomMessages?: boolean },\n): {\n\tsteering: string[];\n\tfollowUp: string[];\n} {\n\tconst { steering, followUp } = this.session.clearQueue(options);\n\tconst compactionSteering = this.compactionQueuedMessages\n\t\t.filter((msg) => msg.mode === \"steer\")\n\t\t.map((msg) => msg.text);\n\tconst compactionFollowUp = this.compactionQueuedMessages\n\t\t.filter((msg) => msg.mode === \"followUp\")\n\t\t.map((msg) => msg.text);\n\tthis.compactionQueuedMessages = [];\n\treturn {\n\t\tsteering: [...steering, ...compactionSteering],\n\t\tfollowUp: [...followUp, ...compactionFollowUp],\n\t};\n};\n\nInteractiveModeBase.prototype.updatePendingMessagesDisplay = function (this: InteractiveModeBase): void {\n\tthis.pendingMessagesContainer.clear();\n\tconst { steering: steeringMessages, followUp: followUpMessages } = this.getAllQueuedMessages();\n\tif (steeringMessages.length > 0 || followUpMessages.length > 0) {\n\t\tthis.pendingMessagesContainer.addChild(new Spacer(1));\n\t\tfor (const message of steeringMessages) {\n\t\t\tconst text = theme.fg(\"dim\", `Steering: ${message}`);\n\t\t\tthis.pendingMessagesContainer.addChild(new TruncatedText(text, 1, 0));\n\t\t}\n\t\tfor (const message of followUpMessages) {\n\t\t\tconst text = theme.fg(\"dim\", `Follow-up: ${message}`);\n\t\t\tthis.pendingMessagesContainer.addChild(new TruncatedText(text, 1, 0));\n\t\t}\n\t\tconst dequeueHint = this.getAppKeyDisplay(\"app.message.dequeue\");\n\t\tconst hintText = theme.fg(\"dim\", `↳ ${dequeueHint} to edit all queued messages`);\n\t\tthis.pendingMessagesContainer.addChild(new TruncatedText(hintText, 1, 0));\n\t}\n};\n\nInteractiveModeBase.prototype.restoreQueuedMessagesToEditor = function (\n\tthis: InteractiveModeBase,\n\toptions?: {\n\t\tabort?: boolean;\n\t\tcurrentText?: string;\n\t\tpreserveUnprotectedCustomMessages?: boolean;\n\t},\n): number {\n\tconst { steering, followUp } = this.clearAllQueues(options);\n\tconst allQueued = [...steering, ...followUp];\n\tif (allQueued.length === 0) {\n\t\tthis.updatePendingMessagesDisplay();\n\t\tif (options?.abort) {\n\t\t\tvoid this.session.abort();\n\t\t}\n\t\treturn 0;\n\t}\n\tconst currentText = options?.currentText ?? this.editor.getText();\n\tconst combinedText = combineQueuedMessagesForEditor(allQueued, currentText);\n\tthis.editor.setText(combinedText);\n\tthis.updatePendingMessagesDisplay();\n\tif (options?.abort) {\n\t\tvoid this.session.abort();\n\t}\n\treturn allQueued.length;\n};\n\nInteractiveModeBase.prototype.queueCompactionMessage = function (\n\tthis: InteractiveModeBase,\n\ttext: string,\n\tmode: \"steer\" | \"followUp\",\n): void {\n\tthis.compactionQueuedMessages.push({ text, mode });\n\tthis.editor.addToHistory?.(text);\n\tthis.editor.setText(\"\");\n\tthis.updatePendingMessagesDisplay();\n\tthis.showStatus(\"Queued message for after compaction\");\n};\n\nInteractiveModeBase.prototype.isExtensionCommand = function (this: InteractiveModeBase, text: string): boolean {\n\tif (!text.startsWith(\"/\")) return false;\n\n\tconst extensionRunner = this.session.extensionRunner;\n\n\tconst spaceIndex = text.indexOf(\" \");\n\tconst commandName = spaceIndex === -1 ? text.slice(1) : text.slice(1, spaceIndex);\n\treturn !!extensionRunner.getCommand(commandName);\n};\n\nInteractiveModeBase.prototype.flushCompactionQueue = async function (\n\tthis: InteractiveModeBase,\n\toptions?: {\n\t\twillRetry?: boolean;\n\t},\n): Promise<void> {\n\tif (this.compactionQueuedMessages.length === 0) {\n\t\treturn;\n\t}\n\n\tconst queuedMessages = [...this.compactionQueuedMessages];\n\tthis.compactionQueuedMessages = [];\n\tthis.updatePendingMessagesDisplay();\n\n\tconst restoreQueue = (error: unknown) => {\n\t\tthis.session.clearQueue();\n\t\tthis.compactionQueuedMessages = queuedMessages;\n\t\tthis.updatePendingMessagesDisplay();\n\t\tthis.showError(\n\t\t\t`Failed to send queued message${queuedMessages.length > 1 ? \"s\" : \"\"}: ${\n\t\t\t\terror instanceof Error ? error.message : String(error)\n\t\t\t}`,\n\t\t);\n\t};\n\n\ttry {\n\t\tif (options?.willRetry) {\n\t\t\t// When retry is pending, queue messages for the retry turn\n\t\t\tfor (const message of queuedMessages) {\n\t\t\t\tif (this.isExtensionCommand(message.text)) {\n\t\t\t\t\tawait this.session.prompt(message.text);\n\t\t\t\t} else if (message.mode === \"followUp\") {\n\t\t\t\t\tawait this.session.followUp(message.text);\n\t\t\t\t} else {\n\t\t\t\t\tawait this.session.steer(message.text);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.updatePendingMessagesDisplay();\n\t\t\treturn;\n\t\t}\n\n\t\t// Find first non-extension-command message to use as prompt\n\t\tconst firstPromptIndex = queuedMessages.findIndex((message) => !this.isExtensionCommand(message.text));\n\t\tif (firstPromptIndex === -1) {\n\t\t\t// All extension commands - execute them all\n\t\t\tfor (const message of queuedMessages) {\n\t\t\t\tawait this.session.prompt(message.text);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Execute any extension commands before the first prompt\n\t\tconst preCommands = queuedMessages.slice(0, firstPromptIndex);\n\t\tconst firstPrompt = queuedMessages[firstPromptIndex];\n\t\tconst rest = queuedMessages.slice(firstPromptIndex + 1);\n\n\t\tfor (const message of preCommands) {\n\t\t\tawait this.session.prompt(message.text);\n\t\t}\n\n\t\t// Start a prompt when idle, or preserve its delivery mode if a run is\n\t\t// still winding down after compaction.\n\t\tconst promptPromise = this.session\n\t\t\t.prompt(firstPrompt.text, { streamingBehavior: firstPrompt.mode })\n\t\t\t.catch((error) => {\n\t\t\t\trestoreQueue(error);\n\t\t\t});\n\n\t\t// Queue remaining messages\n\t\tfor (const message of rest) {\n\t\t\tif (this.isExtensionCommand(message.text)) {\n\t\t\t\tawait this.session.prompt(message.text);\n\t\t\t} else if (message.mode === \"followUp\") {\n\t\t\t\tawait this.session.followUp(message.text);\n\t\t\t} else {\n\t\t\t\tawait this.session.steer(message.text);\n\t\t\t}\n\t\t}\n\t\tthis.updatePendingMessagesDisplay();\n\t\tvoid promptPromise;\n\t} catch (error) {\n\t\trestoreQueue(error);\n\t}\n};\n\nInteractiveModeBase.prototype.flushPendingBashComponents = function (this: InteractiveModeBase): void {\n\tfor (const component of this.pendingBashComponents) {\n\t\tthis.pendingMessagesContainer.removeChild(component);\n\t\tthis.chatContainer.addChild(component);\n\t}\n\tthis.pendingBashComponents = [];\n};\n"]}
|
|
1
|
+
{"version":3,"file":"interactive-queueing.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-queueing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAE1G,mBAAmB,CAAC,SAAS,CAAC,oBAAoB,GAAG;IAIpD,OAAO;QACN,QAAQ,EAAE;YACT,GAAG,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE;YACrC,GAAG,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,OAAO,CAAC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AAM,CAAC;gBACP,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACxC,CAAC;QACF,CAAC;QACD,IAAI,CAAC,4BAA4B,EAAE,CAAC;QACpC,KAAK,aAAa,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,YAAY,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;AACF,CAAC,CAAC;AAEF,mBAAmB,CAAC,SAAS,CAAC,0BAA0B,GAAG;IAC1D,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,qBAAqB,EAAE,CAAC;QACpD,IAAI,CAAC,wBAAwB,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QACrD,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;IACD,IAAI,CAAC,qBAAqB,GAAG,EAAE,CAAC;AACjC,CAAC,CAAC","sourcesContent":["import { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { combineQueuedMessagesForEditor, Spacer, TruncatedText, theme } from \"./interactive-mode-deps.ts\";\n\nInteractiveModeBase.prototype.getAllQueuedMessages = function (this: InteractiveModeBase): {\n\tsteering: string[];\n\tfollowUp: string[];\n} {\n\treturn {\n\t\tsteering: [\n\t\t\t...this.session.getSteeringMessages(),\n\t\t\t...this.compactionQueuedMessages.filter((msg) => msg.mode === \"steer\").map((msg) => msg.text),\n\t\t],\n\t\tfollowUp: [\n\t\t\t...this.session.getFollowUpMessages(),\n\t\t\t...this.compactionQueuedMessages.filter((msg) => msg.mode === \"followUp\").map((msg) => msg.text),\n\t\t],\n\t};\n};\n\nInteractiveModeBase.prototype.clearAllQueues = function (\n\tthis: InteractiveModeBase,\n\toptions?: { preserveUnprotectedCustomMessages?: boolean },\n): {\n\tsteering: string[];\n\tfollowUp: string[];\n} {\n\tconst { steering, followUp } = this.session.clearQueue(options);\n\tconst compactionSteering = this.compactionQueuedMessages\n\t\t.filter((msg) => msg.mode === \"steer\")\n\t\t.map((msg) => msg.text);\n\tconst compactionFollowUp = this.compactionQueuedMessages\n\t\t.filter((msg) => msg.mode === \"followUp\")\n\t\t.map((msg) => msg.text);\n\tthis.compactionQueuedMessages = [];\n\treturn {\n\t\tsteering: [...steering, ...compactionSteering],\n\t\tfollowUp: [...followUp, ...compactionFollowUp],\n\t};\n};\n\nInteractiveModeBase.prototype.updatePendingMessagesDisplay = function (this: InteractiveModeBase): void {\n\tthis.pendingMessagesContainer.clear();\n\tconst { steering: steeringMessages, followUp: followUpMessages } = this.getAllQueuedMessages();\n\tif (steeringMessages.length > 0 || followUpMessages.length > 0) {\n\t\tthis.pendingMessagesContainer.addChild(new Spacer(1));\n\t\tfor (const message of steeringMessages) {\n\t\t\tconst text = theme.fg(\"dim\", `Steering: ${message}`);\n\t\t\tthis.pendingMessagesContainer.addChild(new TruncatedText(text, 1, 0));\n\t\t}\n\t\tfor (const message of followUpMessages) {\n\t\t\tconst text = theme.fg(\"dim\", `Follow-up: ${message}`);\n\t\t\tthis.pendingMessagesContainer.addChild(new TruncatedText(text, 1, 0));\n\t\t}\n\t\tconst dequeueHint = this.getAppKeyDisplay(\"app.message.dequeue\");\n\t\tconst hintText = theme.fg(\"dim\", `↳ ${dequeueHint} to edit all queued messages`);\n\t\tthis.pendingMessagesContainer.addChild(new TruncatedText(hintText, 1, 0));\n\t}\n};\n\nInteractiveModeBase.prototype.restoreQueuedMessagesToEditor = function (\n\tthis: InteractiveModeBase,\n\toptions?: {\n\t\tabort?: boolean;\n\t\tcurrentText?: string;\n\t\tpreserveUnprotectedCustomMessages?: boolean;\n\t},\n): number {\n\tconst { steering, followUp } = this.clearAllQueues(options);\n\tconst allQueued = [...steering, ...followUp];\n\tif (allQueued.length === 0) {\n\t\tthis.updatePendingMessagesDisplay();\n\t\tif (options?.abort) {\n\t\t\tvoid this.session.abort();\n\t\t}\n\t\treturn 0;\n\t}\n\tconst currentText = options?.currentText ?? this.editor.getText();\n\tconst combinedText = combineQueuedMessagesForEditor(allQueued, currentText);\n\tthis.editor.setText(combinedText);\n\tthis.updatePendingMessagesDisplay();\n\tif (options?.abort) {\n\t\tvoid this.session.abort();\n\t}\n\treturn allQueued.length;\n};\n\nInteractiveModeBase.prototype.queueCompactionMessage = function (\n\tthis: InteractiveModeBase,\n\ttext: string,\n\tmode: \"steer\" | \"followUp\",\n): void {\n\tthis.compactionQueuedMessages.push({ text, mode });\n\tthis.editor.addToHistory?.(text);\n\tthis.editor.setText(\"\");\n\tthis.updatePendingMessagesDisplay();\n\tthis.showStatus(\"Queued message for after compaction\");\n};\n\nInteractiveModeBase.prototype.isExtensionCommand = function (this: InteractiveModeBase, text: string): boolean {\n\tif (!text.startsWith(\"/\")) return false;\n\n\tconst extensionRunner = this.session.extensionRunner;\n\n\tconst spaceIndex = text.indexOf(\" \");\n\tconst commandName = spaceIndex === -1 ? text.slice(1) : text.slice(1, spaceIndex);\n\treturn !!extensionRunner.getCommand(commandName);\n};\n\nInteractiveModeBase.prototype.flushCompactionQueue = async function (\n\tthis: InteractiveModeBase,\n\toptions?: {\n\t\twillRetry?: boolean;\n\t},\n): Promise<void> {\n\tif (this.compactionQueuedMessages.length === 0) {\n\t\treturn;\n\t}\n\n\tconst queuedMessages = [...this.compactionQueuedMessages];\n\tthis.compactionQueuedMessages = [];\n\tthis.updatePendingMessagesDisplay();\n\n\tconst restoreQueue = (error: unknown) => {\n\t\tthis.session.clearQueue();\n\t\tthis.compactionQueuedMessages = queuedMessages;\n\t\tthis.updatePendingMessagesDisplay();\n\t\tthis.showError(\n\t\t\t`Failed to send queued message${queuedMessages.length > 1 ? \"s\" : \"\"}: ${\n\t\t\t\terror instanceof Error ? error.message : String(error)\n\t\t\t}`,\n\t\t);\n\t};\n\n\ttry {\n\t\tif (!options?.willRetry && (this.session.isStreaming || this.session.queuedMessagesPaused)) {\n\t\t\tawait Promise.all(\n\t\t\t\tqueuedMessages.map((message) => this.session.prompt(message.text, { streamingBehavior: message.mode })),\n\t\t\t);\n\t\t\tthis.updatePendingMessagesDisplay();\n\t\t\treturn;\n\t\t}\n\t\tif (options?.willRetry) {\n\t\t\t// When retry is pending, queue messages for the retry turn\n\t\t\tfor (const message of queuedMessages) {\n\t\t\t\tif (this.isExtensionCommand(message.text)) {\n\t\t\t\t\tawait this.session.prompt(message.text);\n\t\t\t\t} else if (message.mode === \"followUp\") {\n\t\t\t\t\tawait this.session.followUp(message.text);\n\t\t\t\t} else {\n\t\t\t\t\tawait this.session.steer(message.text);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.updatePendingMessagesDisplay();\n\t\t\treturn;\n\t\t}\n\n\t\t// Find first non-extension-command message to use as prompt\n\t\tconst firstPromptIndex = queuedMessages.findIndex((message) => !this.isExtensionCommand(message.text));\n\t\tif (firstPromptIndex === -1) {\n\t\t\t// All extension commands - execute them all\n\t\t\tfor (const message of queuedMessages) {\n\t\t\t\tawait this.session.prompt(message.text);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Execute any extension commands before the first prompt\n\t\tconst preCommands = queuedMessages.slice(0, firstPromptIndex);\n\t\tconst firstPrompt = queuedMessages[firstPromptIndex];\n\t\tconst rest = queuedMessages.slice(firstPromptIndex + 1);\n\n\t\tfor (const message of preCommands) {\n\t\t\tawait this.session.prompt(message.text);\n\t\t}\n\n\t\t// Start a prompt when idle, or preserve its delivery mode if a run is\n\t\t// still winding down after compaction.\n\t\tconst promptPromise = this.session\n\t\t\t.prompt(firstPrompt.text, { streamingBehavior: firstPrompt.mode })\n\t\t\t.catch((error) => {\n\t\t\t\trestoreQueue(error);\n\t\t\t});\n\n\t\t// Queue remaining messages\n\t\tfor (const message of rest) {\n\t\t\tif (this.isExtensionCommand(message.text)) {\n\t\t\t\tawait this.session.prompt(message.text);\n\t\t\t} else if (message.mode === \"followUp\") {\n\t\t\t\tawait this.session.followUp(message.text);\n\t\t\t} else {\n\t\t\t\tawait this.session.steer(message.text);\n\t\t\t}\n\t\t}\n\t\tthis.updatePendingMessagesDisplay();\n\t\tvoid promptPromise;\n\t} catch (error) {\n\t\trestoreQueue(error);\n\t}\n};\n\nInteractiveModeBase.prototype.flushPendingBashComponents = function (this: InteractiveModeBase): void {\n\tfor (const component of this.pendingBashComponents) {\n\t\tthis.pendingMessagesContainer.removeChild(component);\n\t\tthis.chatContainer.addChild(component);\n\t}\n\tthis.pendingBashComponents = [];\n};\n"]}
|
package/docs/models/reference.md
CHANGED
|
@@ -150,11 +150,11 @@ On OpenAI Responses, Astra uses the newer prompt-cache payload. `cacheRetention:
|
|
|
150
150
|
|
|
151
151
|
### GPT-6.1 Sol
|
|
152
152
|
|
|
153
|
-
Select `openai/gpt-6.1-sol` with API-key authentication or `openai-codex/gpt-6.1-sol` with a ChatGPT subscription. Both accept text and images and support `low`, `medium`, `high`, `xhigh`, and `max`. Reasoning cannot be turned off. Codex also offers a `minimal` UI alias that sends `low`, not a separate API effort.
|
|
153
|
+
Select `openai/gpt-6.1-sol` with either API-key authentication or ChatGPT subscription sign-in, or `openai-codex/gpt-6.1-sol` with a ChatGPT subscription. Both accept text and images and support `low`, `medium`, `high`, `xhigh`, and `max`. Reasoning cannot be turned off. Codex also offers a `minimal` UI alias that sends `low`, not a separate API effort.
|
|
154
154
|
|
|
155
|
-
`openai-codex/gpt-6.1-sol`
|
|
155
|
+
With ChatGPT subscription sign-in, `openai/gpt-6.1-sol` and `openai-codex/gpt-6.1-sol` use a 500,000-token context and a 128,000-token output limit. Account aliases inherit the limits for their own login method. Subscription usage has no long-context price tier on Standard, Fast, or Ultrafast.
|
|
156
156
|
|
|
157
|
-
`openai/gpt-6.1-sol`
|
|
157
|
+
With API-key authentication, `openai/gpt-6.1-sol` and `openai-api/gpt-6.1-sol` use a 272,000-token default context and a 128,000-token output limit. Increase `contextWindow` through a model override only when you intend to use the larger API window and its whole-request long-context prices:
|
|
158
158
|
|
|
159
159
|
| Aggregate input | Input | Cached input | Cache write | Output |
|
|
160
160
|
| --- | ---: | ---: | ---: | ---: |
|
|
@@ -163,7 +163,7 @@ Select `openai/gpt-6.1-sol` with API-key authentication or `openai-codex/gpt-6.1
|
|
|
163
163
|
|
|
164
164
|
Rates are per million tokens. Derived `openai/gpt-6.1-sol-fast` and `openai-codex/gpt-6.1-sol-fast` choices send the same upstream model with priority routing. Fast costs twice the applicable rates; do not pre-multiply catalog costs. [Published evaluations](/models/evals) describe base-model results and measured efforts, not separate Fast measurements.
|
|
165
165
|
|
|
166
|
-
`openai/gpt-6.1-sol-ultrafast` (also `openai-api/` and `openai-codex/`) sends `service_tier: "ultrafast"`. It uses OpenAI's published Ultrafast rates of $12 input and $60 output per million tokens
|
|
166
|
+
`openai/gpt-6.1-sol-ultrafast` (also `openai-api/` and `openai-codex/`) sends `service_tier: "ultrafast"`. It uses OpenAI's published Ultrafast rates of $12 input and $60 output per million tokens. OpenAI has not listed Sol Ultrafast cache rates, so Atomic derives them at the same six-times-Standard ratio: $0.60 cached input and $15 cache write. With an API key, the usual long-context multipliers apply above 272,000 input tokens. Subscription sign-in keeps flat rates across the 500,000-token window. See [provider tier caveats](/providers#fast-models).
|
|
167
167
|
|
|
168
168
|
### Image Input Limits
|
|
169
169
|
|
package/docs/providers.md
CHANGED
|
@@ -94,6 +94,8 @@ GPT-6.1 Sol is selectable as `openai/gpt-6.1-sol` and `openai-codex/gpt-6.1-sol`
|
|
|
94
94
|
|
|
95
95
|
GPT-6.1 Sol also has an `-ultrafast` choice on `openai/*`, `openai-api/*` and `openai-codex/*`, for example `openai/gpt-6.1-sol-ultrafast`.
|
|
96
96
|
|
|
97
|
+
ChatGPT sign-in through either `openai` or `openai-codex` gives GPT-6.1 Sol a 500,000-token context on Standard, Fast, and Ultrafast, without long-context fees. API-key sign-in through `openai` or `openai-api` keeps the 272,000-token default and API long-context pricing. Account aliases follow their own authentication method. Fast and Ultrafast choices work with either authentication method when the account supports the requested tier.
|
|
98
|
+
|
|
97
99
|
#### Fast and Ultrafast tiers
|
|
98
100
|
|
|
99
101
|
Atomic offers a tier only for the models that advertise it, following Codex's per-model catalog and OpenAI's published API pricing:
|
package/docs/usage.md
CHANGED
|
@@ -100,6 +100,8 @@ You can submit messages while the agent is still working:
|
|
|
100
100
|
- **Ctrl+C** aborts active/queued work and pauses queued messages in place. They remain queued, in their original per-queue order, until you submit the next ordinary chat message; that submission resumes the chat and makes each queued item eligible once. After the abort settles, a later idle Ctrl+C clears the editor without releasing the hold, and a second quick idle press exits.
|
|
101
101
|
- **ALT+Up** explicitly retrieves queued messages back to the editor without aborting active work or resuming a paused session. Even when retrieval empties the queue, the pause remains active until the next ordinary submission.
|
|
102
102
|
|
|
103
|
+
Each queue preserves submission order, and steering messages take priority over follow-ups. Messages submitted during compaction keep their queue type and join that queue when compaction finishes or is cancelled, even if the agent is still working.
|
|
104
|
+
|
|
103
105
|
Both interrupts hold a queued message only while it is still waiting in the queue. A message the agent has already picked up is written into the transcript, and an interrupt that cancels its reply before any output appears no longer strands it: Atomic answers it instead of returning it to the editor. A reply that had already started printing is left as-is and is not restarted. Sending a message while that recovered reply is still streaming is safe — it is delivered as soon as the reply finishes.
|
|
104
106
|
|
|
105
107
|
Both abort routes ask the agent to stop cooperatively. Escape waits as long as the agent needs, and neither route terminates the engine during normal cancellation.
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/atomic",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.36",
|
|
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.36",
|
|
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.36",
|
|
13
|
+
"@bastani/pi-ai": "0.9.36",
|
|
14
14
|
"@dbos-inc/dbos-sdk": "4.25.14",
|
|
15
15
|
"@earendil-works/pi-agent-core": "1.2.0",
|
|
16
16
|
"@earendil-works/pi-codemode": "1.2.0",
|
|
@@ -430,18 +430,18 @@
|
|
|
430
430
|
}
|
|
431
431
|
},
|
|
432
432
|
"node_modules/@bastani/atomic-natives": {
|
|
433
|
-
"version": "0.9.
|
|
434
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.
|
|
433
|
+
"version": "0.9.36",
|
|
434
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.36.tgz",
|
|
435
435
|
"license": "MIT",
|
|
436
436
|
"optionalDependencies": {
|
|
437
|
-
"@bastani/atomic-natives-darwin-arm64": "0.9.
|
|
438
|
-
"@bastani/atomic-natives-darwin-x64": "0.9.
|
|
439
|
-
"@bastani/atomic-natives-linux-arm64-gnu": "0.9.
|
|
440
|
-
"@bastani/atomic-natives-linux-arm64-musl": "0.9.
|
|
441
|
-
"@bastani/atomic-natives-linux-x64-gnu": "0.9.
|
|
442
|
-
"@bastani/atomic-natives-linux-x64-musl": "0.9.
|
|
443
|
-
"@bastani/atomic-natives-win32-arm64-msvc": "0.9.
|
|
444
|
-
"@bastani/atomic-natives-win32-x64-msvc": "0.9.
|
|
437
|
+
"@bastani/atomic-natives-darwin-arm64": "0.9.36",
|
|
438
|
+
"@bastani/atomic-natives-darwin-x64": "0.9.36",
|
|
439
|
+
"@bastani/atomic-natives-linux-arm64-gnu": "0.9.36",
|
|
440
|
+
"@bastani/atomic-natives-linux-arm64-musl": "0.9.36",
|
|
441
|
+
"@bastani/atomic-natives-linux-x64-gnu": "0.9.36",
|
|
442
|
+
"@bastani/atomic-natives-linux-x64-musl": "0.9.36",
|
|
443
|
+
"@bastani/atomic-natives-win32-arm64-msvc": "0.9.36",
|
|
444
|
+
"@bastani/atomic-natives-win32-x64-msvc": "0.9.36"
|
|
445
445
|
},
|
|
446
446
|
"engines": {
|
|
447
447
|
"bun": ">=1.4.2",
|
|
@@ -449,8 +449,8 @@
|
|
|
449
449
|
}
|
|
450
450
|
},
|
|
451
451
|
"node_modules/@bastani/atomic-natives-darwin-arm64": {
|
|
452
|
-
"version": "0.9.
|
|
453
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.
|
|
452
|
+
"version": "0.9.36",
|
|
453
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.36.tgz",
|
|
454
454
|
"license": "MIT",
|
|
455
455
|
"os": [
|
|
456
456
|
"darwin"
|
|
@@ -461,8 +461,8 @@
|
|
|
461
461
|
"optional": true
|
|
462
462
|
},
|
|
463
463
|
"node_modules/@bastani/atomic-natives-darwin-x64": {
|
|
464
|
-
"version": "0.9.
|
|
465
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.
|
|
464
|
+
"version": "0.9.36",
|
|
465
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.36.tgz",
|
|
466
466
|
"license": "MIT",
|
|
467
467
|
"os": [
|
|
468
468
|
"darwin"
|
|
@@ -473,8 +473,8 @@
|
|
|
473
473
|
"optional": true
|
|
474
474
|
},
|
|
475
475
|
"node_modules/@bastani/atomic-natives-linux-arm64-gnu": {
|
|
476
|
-
"version": "0.9.
|
|
477
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.
|
|
476
|
+
"version": "0.9.36",
|
|
477
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.36.tgz",
|
|
478
478
|
"license": "MIT",
|
|
479
479
|
"os": [
|
|
480
480
|
"linux"
|
|
@@ -488,8 +488,8 @@
|
|
|
488
488
|
"optional": true
|
|
489
489
|
},
|
|
490
490
|
"node_modules/@bastani/atomic-natives-linux-arm64-musl": {
|
|
491
|
-
"version": "0.9.
|
|
492
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.
|
|
491
|
+
"version": "0.9.36",
|
|
492
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.36.tgz",
|
|
493
493
|
"license": "MIT",
|
|
494
494
|
"os": [
|
|
495
495
|
"linux"
|
|
@@ -503,8 +503,8 @@
|
|
|
503
503
|
"optional": true
|
|
504
504
|
},
|
|
505
505
|
"node_modules/@bastani/atomic-natives-linux-x64-gnu": {
|
|
506
|
-
"version": "0.9.
|
|
507
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.
|
|
506
|
+
"version": "0.9.36",
|
|
507
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.36.tgz",
|
|
508
508
|
"license": "MIT",
|
|
509
509
|
"os": [
|
|
510
510
|
"linux"
|
|
@@ -518,8 +518,8 @@
|
|
|
518
518
|
"optional": true
|
|
519
519
|
},
|
|
520
520
|
"node_modules/@bastani/atomic-natives-linux-x64-musl": {
|
|
521
|
-
"version": "0.9.
|
|
522
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.
|
|
521
|
+
"version": "0.9.36",
|
|
522
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.36.tgz",
|
|
523
523
|
"license": "MIT",
|
|
524
524
|
"os": [
|
|
525
525
|
"linux"
|
|
@@ -533,8 +533,8 @@
|
|
|
533
533
|
"optional": true
|
|
534
534
|
},
|
|
535
535
|
"node_modules/@bastani/atomic-natives-win32-arm64-msvc": {
|
|
536
|
-
"version": "0.9.
|
|
537
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.
|
|
536
|
+
"version": "0.9.36",
|
|
537
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.36.tgz",
|
|
538
538
|
"license": "MIT",
|
|
539
539
|
"os": [
|
|
540
540
|
"win32"
|
|
@@ -545,8 +545,8 @@
|
|
|
545
545
|
"optional": true
|
|
546
546
|
},
|
|
547
547
|
"node_modules/@bastani/atomic-natives-win32-x64-msvc": {
|
|
548
|
-
"version": "0.9.
|
|
549
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.
|
|
548
|
+
"version": "0.9.36",
|
|
549
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.36.tgz",
|
|
550
550
|
"license": "MIT",
|
|
551
551
|
"os": [
|
|
552
552
|
"win32"
|
|
@@ -557,8 +557,8 @@
|
|
|
557
557
|
"optional": true
|
|
558
558
|
},
|
|
559
559
|
"node_modules/@bastani/pi-ai": {
|
|
560
|
-
"version": "0.9.
|
|
561
|
-
"resolved": "https://registry.npmjs.org/@bastani/pi-ai/-/pi-ai-0.9.
|
|
560
|
+
"version": "0.9.36",
|
|
561
|
+
"resolved": "https://registry.npmjs.org/@bastani/pi-ai/-/pi-ai-0.9.36.tgz",
|
|
562
562
|
"license": "MIT",
|
|
563
563
|
"dependencies": {
|
|
564
564
|
"@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.36",
|
|
4
4
|
"description": "Atomic coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"atomicConfig": {
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"prepublishOnly": "bun run clean && bun run build && bun run shrinkwrap"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@bastani/atomic-natives": "0.9.
|
|
82
|
-
"@bastani/pi-ai": "0.9.
|
|
81
|
+
"@bastani/atomic-natives": "0.9.36",
|
|
82
|
+
"@bastani/pi-ai": "0.9.36",
|
|
83
83
|
"@dbos-inc/dbos-sdk": "4.25.14",
|
|
84
84
|
"@earendil-works/pi-agent-core": "1.2.0",
|
|
85
85
|
"@earendil-works/pi-codemode": "1.2.0",
|