pi-namespace-patch 0.85.1 → 0.86.1-namespace.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 +110 -0
- package/README.md +26 -705
- package/dist/bundle/chunks/anthropic-messages-MYU5ZMRF.js +6 -0
- package/dist/bundle/chunks/azure-openai-responses-HUSQ3GP2.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +47 -38
- package/dist/bundle/chunks/chunk-4YJERF5N.js +2 -0
- package/dist/bundle/chunks/chunk-A3JYRWB6.js +2 -0
- package/dist/bundle/chunks/chunk-CVPNLAPW.js +1562 -0
- package/dist/bundle/chunks/chunk-DTD7JQ7Y.js +42 -0
- package/dist/bundle/chunks/chunk-FUXEF6JQ.js +44 -0
- package/dist/bundle/chunks/{chunk-IDDQWTHI.js → chunk-RCZIEVGO.js} +10 -1
- package/dist/bundle/chunks/chunk-S7SZN6Z3.js +2 -0
- package/dist/bundle/chunks/chunk-WIUZI2CJ.js +11 -0
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/google-generative-ai-IMS5EK2Y.js +2 -0
- package/dist/bundle/chunks/google-vertex-O4YJEQUW.js +2 -0
- package/dist/bundle/chunks/jiti-loader-C3NU2SDH.js +21 -0
- package/dist/bundle/chunks/jiti-static-loader-E6ANQD5T.js +2 -0
- package/dist/bundle/chunks/meta.js +2 -0
- package/dist/bundle/chunks/mistral-conversations-NOSQHBEY.js +5 -0
- package/dist/bundle/chunks/{node-KG362ECQ.js → node-O3RIBJRH.js} +1 -1
- package/dist/bundle/chunks/openai-codex-responses-QDSOTBBO.js +10 -0
- package/dist/bundle/chunks/openai-completions-CYGM3XXP.js +7 -0
- package/dist/bundle/chunks/openai-responses-HWEUZ6WZ.js +2 -0
- package/dist/bundle/chunks/{pi-messages-PML4SPVJ.js → pi-messages-GFKBWJHZ.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-R7YYFUSE.js +2 -0
- package/dist/bundle/cli-runtime.js +3 -0
- package/dist/bundle/cli.js +4 -2
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +1 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/session-picker.d.ts +1 -1
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +56 -6
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +294 -157
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/bug-report-upload.d.ts +12 -0
- package/dist/core/bug-report-upload.d.ts.map +1 -0
- package/dist/core/bug-report-upload.js +22 -0
- package/dist/core/bug-report-upload.js.map +1 -0
- package/dist/core/bug-report.d.ts +176 -0
- package/dist/core/bug-report.d.ts.map +1 -0
- package/dist/core/bug-report.js +292 -0
- package/dist/core/bug-report.js.map +1 -0
- package/dist/core/cache-stats.d.ts.map +1 -1
- package/dist/core/cache-stats.js +12 -1
- package/dist/core/cache-stats.js.map +1 -1
- package/dist/core/cache-warmer.d.ts +102 -0
- package/dist/core/cache-warmer.d.ts.map +1 -0
- package/dist/core/cache-warmer.js +342 -0
- package/dist/core/cache-warmer.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +2 -2
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +2 -2
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +11 -12
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/crash-log.d.ts +22 -0
- package/dist/core/crash-log.d.ts.map +1 -0
- package/dist/core/crash-log.js +71 -0
- package/dist/core/crash-log.js.map +1 -0
- package/dist/core/experimental.d.ts +0 -4
- package/dist/core/experimental.d.ts.map +1 -1
- package/dist/core/experimental.js +0 -4
- package/dist/core/experimental.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/jiti-loader.d.ts +2 -0
- package/dist/core/extensions/jiti-loader.d.ts.map +1 -0
- package/dist/core/extensions/jiti-loader.js +4 -0
- package/dist/core/extensions/jiti-loader.js.map +1 -0
- package/dist/core/extensions/jiti-static-loader.d.ts +2 -0
- package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -0
- package/dist/core/extensions/jiti-static-loader.js +4 -0
- package/dist/core/extensions/jiti-static-loader.js.map +1 -0
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +38 -51
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +10 -7
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +85 -67
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +60 -50
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/virtual-modules.d.ts +3 -0
- package/dist/core/extensions/virtual-modules.d.ts.map +1 -0
- package/dist/core/extensions/virtual-modules.js +38 -0
- package/dist/core/extensions/virtual-modules.js.map +1 -0
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +1 -20
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/index.d.ts +2 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/keybindings.d.ts +1 -1
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +1 -1
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +1 -0
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-config.d.ts +101 -20
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +25 -18
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts +5 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +8 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +2 -1
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +5 -3
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/provider-composer.d.ts +3 -2
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +2 -0
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/radius.d.ts +3 -0
- package/dist/core/radius.d.ts.map +1 -1
- package/dist/core/radius.js +6 -0
- package/dist/core/radius.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +60 -38
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-export.d.ts +6 -2
- package/dist/core/session-export.d.ts.map +1 -1
- package/dist/core/session-export.js +14 -13
- package/dist/core/session-export.js.map +1 -1
- package/dist/core/session-manager.d.ts +29 -6
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +159 -96
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +20 -4
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +43 -7
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts +49 -6
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +121 -92
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +2 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +10 -4
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +1 -2
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +1 -2
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/renderers/bash.d.ts.map +1 -1
- package/dist/core/tools/renderers/bash.js +9 -1
- package/dist/core/tools/renderers/bash.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +1 -2
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/usage-totals.d.ts +1 -1
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +5 -1
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/extensions/llama/client.d.ts +2 -0
- package/dist/extensions/llama/client.d.ts.map +1 -1
- package/dist/extensions/llama/client.js +7 -3
- package/dist/extensions/llama/client.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +20 -5
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +13 -9
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +2 -2
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/bug-report.d.ts +16 -0
- package/dist/modes/interactive/bug-report.d.ts.map +1 -0
- package/dist/modes/interactive/bug-report.js +206 -0
- package/dist/modes/interactive/bug-report.js.map +1 -0
- package/dist/modes/interactive/chat-viewport.d.ts.map +1 -1
- package/dist/modes/interactive/chat-viewport.js +1 -1
- package/dist/modes/interactive/chat-viewport.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +12 -5
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +12 -5
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +3 -3
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +4 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +7 -2
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts +2 -0
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-input.js +6 -0
- package/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts +1 -0
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +4 -0
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +4 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +5 -5
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +74 -48
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +11 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +11 -4
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +2 -2
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-indicator.js +7 -7
- package/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +18 -9
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +2 -0
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +15 -2
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +227 -84
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/session-share.d.ts +2 -0
- package/dist/modes/interactive/session-share.d.ts.map +1 -1
- package/dist/modes/interactive/session-share.js +8 -4
- package/dist/modes/interactive/session-share.js.map +1 -1
- package/dist/modes/interactive/tui-renderer.d.ts.map +1 -1
- package/dist/modes/interactive/tui-renderer.js +2 -2
- package/dist/modes/interactive/tui-renderer.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +2 -2
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/utils/clipboard-command.d.ts +7 -0
- package/dist/utils/clipboard-command.d.ts.map +1 -0
- package/dist/utils/clipboard-command.js +45 -0
- package/dist/utils/clipboard-command.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +53 -81
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +111 -121
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +11 -4
- package/dist/utils/version-check.js.map +1 -1
- package/dist/utils/wsl.d.ts +3 -0
- package/dist/utils/wsl.d.ts.map +1 -0
- package/dist/utils/wsl.js +15 -0
- package/dist/utils/wsl.js.map +1 -0
- package/dist/utils/zip.d.ts +7 -0
- package/dist/utils/zip.d.ts.map +1 -0
- package/dist/utils/zip.js +60 -0
- package/dist/utils/zip.js.map +1 -0
- package/docs/compaction.md +39 -13
- package/docs/custom-provider.md +22 -13
- package/docs/development.md +4 -4
- package/docs/docs.json +4 -0
- package/docs/environment-variables.md +1 -0
- package/docs/extensions.md +57 -43
- package/docs/json.md +4 -4
- package/docs/models.md +33 -2
- package/docs/providers.md +10 -2
- package/docs/sdk.md +4 -2
- package/docs/security.md +1 -1
- package/docs/session-format.md +82 -40
- package/docs/sessions.md +27 -0
- package/docs/settings.md +60 -1
- package/docs/termux.md +0 -1
- package/docs/tui.md +2 -2
- package/docs/usage.md +1 -0
- package/examples/extensions/README.md +0 -1
- package/examples/extensions/custom-provider-anthropic/index.ts +18 -12
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +2 -2
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/prompt-customizer.ts +19 -67
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +435 -762
- package/package.json +17 -23
- package/dist/bundle/chunks/anthropic-messages-VWZZOSJQ.js +0 -6
- package/dist/bundle/chunks/azure-openai-responses-BJLAM6CD.js +0 -2
- package/dist/bundle/chunks/chunk-AXIIZGTV.js +0 -2
- package/dist/bundle/chunks/chunk-CLNPYIDP.js +0 -42
- package/dist/bundle/chunks/chunk-GMWCTUPB.js +0 -2
- package/dist/bundle/chunks/chunk-JJ2YFCJF.js +0 -1547
- package/dist/bundle/chunks/chunk-OUXLLA64.js +0 -11
- package/dist/bundle/chunks/chunk-U6ZMQKGD.js +0 -50
- package/dist/bundle/chunks/chunk-UAQELI3K.js +0 -2
- package/dist/bundle/chunks/google-generative-ai-Q2K7FBDI.js +0 -2
- package/dist/bundle/chunks/google-vertex-7UJBF4S7.js +0 -2
- package/dist/bundle/chunks/mistral-conversations-4M6BZBX6.js +0 -5
- package/dist/bundle/chunks/openai-codex-responses-R6VYZTVY.js +0 -10
- package/dist/bundle/chunks/openai-completions-EKZT2IH2.js +0 -7
- package/dist/bundle/chunks/openai-responses-TFDINO6W.js +0 -2
- package/dist/utils/clipboard-native.d.ts +0 -11
- package/dist/utils/clipboard-native.d.ts.map +0 -1
- package/dist/utils/clipboard-native.js +0 -20
- package/dist/utils/clipboard-native.js.map +0 -1
- package/examples/extensions/kimi-deferred-tools.ts +0 -61
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import type { Agent, AgentEvent, AgentMessage, AgentState, AgentTool, ThinkingLevel } from "@earendil-works/pi-agent-core";
|
|
16
16
|
import type { ImageContent, Model, TextContent } from "@earendil-works/pi-ai/compat";
|
|
17
17
|
import { type BashResult } from "./bash-executor.ts";
|
|
18
|
+
import type { CacheWarmer, CacheWarmingStatus } from "./cache-warmer.ts";
|
|
18
19
|
import { type CompactionResult } from "./compaction/index.ts";
|
|
19
20
|
import { type ContextUsage, type ExtensionCommandContextActions, type ExtensionErrorListener, type ExtensionMode, ExtensionRunner, type ExtensionUIContext, type InputSource, type ReplacedSessionContext, type SessionStartEvent, type ShutdownHandler, type ToolDefinition, type ToolInfo } from "./extensions/index.ts";
|
|
20
21
|
import type { CustomMessage } from "./messages.ts";
|
|
@@ -22,7 +23,7 @@ import type { ModelRuntime } from "./model-runtime.ts";
|
|
|
22
23
|
import { type PromptTemplate } from "./prompt-templates.ts";
|
|
23
24
|
import type { ResourceLoader } from "./resource-loader.ts";
|
|
24
25
|
import type { BranchSummaryEntry, SessionEntry, SessionManager } from "./session-manager.ts";
|
|
25
|
-
import type { SettingsManager } from "./settings-manager.ts";
|
|
26
|
+
import type { CacheWarmingMode, SettingsManager } from "./settings-manager.ts";
|
|
26
27
|
import { type BashOperations } from "./tools/bash.ts";
|
|
27
28
|
/** Parsed skill block from a user message */
|
|
28
29
|
export interface ParsedSkillBlock {
|
|
@@ -117,6 +118,8 @@ export interface AgentSessionConfig {
|
|
|
117
118
|
customTools?: ToolDefinition[];
|
|
118
119
|
/** Canonical model/auth runtime used by coding-agent internals. */
|
|
119
120
|
modelRuntime: ModelRuntime;
|
|
121
|
+
/** Keeps the prompt cache entry of the last session request warm. */
|
|
122
|
+
cacheWarmer?: Pick<CacheWarmer, "cancel" | "status" | "onAgentSettled" | "onModeChanged" | "onWarmed">;
|
|
120
123
|
/** Initial active built-in tool names. Default: [read, bash, edit, write] */
|
|
121
124
|
initialActiveToolNames?: string[];
|
|
122
125
|
/** Optional allowlist of tool names. When provided, only these tool names are exposed. */
|
|
@@ -197,6 +200,7 @@ export declare class AgentSession {
|
|
|
197
200
|
private _unsubscribeAgent?;
|
|
198
201
|
private _eventListeners;
|
|
199
202
|
private _isAgentRunActive;
|
|
203
|
+
private _agentRunAbortRequested;
|
|
200
204
|
private _idleWaitPromise;
|
|
201
205
|
private _resolveIdleWait;
|
|
202
206
|
/** Tracks pending steering messages for UI display. Removed when delivered. */
|
|
@@ -235,13 +239,14 @@ export declare class AgentSession {
|
|
|
235
239
|
private _extensionErrorListener?;
|
|
236
240
|
private _extensionErrorUnsubscriber?;
|
|
237
241
|
private _modelRuntime;
|
|
242
|
+
private _cacheWarmer?;
|
|
238
243
|
private _toolRegistry;
|
|
239
244
|
private _toolDefinitions;
|
|
240
245
|
private _toolPromptSnippets;
|
|
241
246
|
private _toolPromptGuidelines;
|
|
242
|
-
private _baseSystemPrompt;
|
|
243
247
|
private _baseSystemPromptOptions;
|
|
244
|
-
|
|
248
|
+
/** Prompt options after before_agent_start mutations for the active run. */
|
|
249
|
+
private _runSystemPromptOptions?;
|
|
245
250
|
constructor(config: AgentSessionConfig);
|
|
246
251
|
get modelRuntime(): ModelRuntime;
|
|
247
252
|
private _getRequiredRequestAuth;
|
|
@@ -287,6 +292,10 @@ export declare class AgentSession {
|
|
|
287
292
|
dispose(): void;
|
|
288
293
|
/** Full agent state */
|
|
289
294
|
get state(): AgentState;
|
|
295
|
+
/** Current cache-warming state and the policy inputs that produced it. */
|
|
296
|
+
get cacheWarmingStatus(): CacheWarmingStatus | undefined;
|
|
297
|
+
/** Persist the cache-warming mode and immediately reconcile active warming. */
|
|
298
|
+
setCacheWarmingMode(mode: CacheWarmingMode): void;
|
|
290
299
|
/** Current model (may be undefined if not yet selected) */
|
|
291
300
|
get model(): Model<any> | undefined;
|
|
292
301
|
/** Current thinking level */
|
|
@@ -295,7 +304,7 @@ export declare class AgentSession {
|
|
|
295
304
|
get isStreaming(): boolean;
|
|
296
305
|
/** Whether the session has no active agent run, compaction, branch summary, retry, or queued continuation. */
|
|
297
306
|
get isIdle(): boolean;
|
|
298
|
-
/** Current effective system prompt
|
|
307
|
+
/** Current effective system prompt, including changes not yet sent to the model. */
|
|
299
308
|
get systemPrompt(): string;
|
|
300
309
|
/** Current retry attempt (0 if not retrying) */
|
|
301
310
|
get retryAttempt(): number;
|
|
@@ -345,8 +354,33 @@ export declare class AgentSession {
|
|
|
345
354
|
private _normalizePromptSnippet;
|
|
346
355
|
private _normalizePromptGuidelines;
|
|
347
356
|
private _rebuildSystemPrompt;
|
|
357
|
+
/**
|
|
358
|
+
* Apply a prompt and tool loadout for the next request. Sets the executable tools and
|
|
359
|
+
* returns a system message patching the prompt sections the model currently has (replayed
|
|
360
|
+
* from `messages`), or undefined when the prompt is unchanged. Tool changes are declared by
|
|
361
|
+
* the agent loop before the request.
|
|
362
|
+
*
|
|
363
|
+
* A forced prompt does not affect the transcript: the structured sections are still diffed
|
|
364
|
+
* and persisted, and the forced text is projected onto the request by
|
|
365
|
+
* {@link _installAgentForcedPromptProjection}.
|
|
366
|
+
*/
|
|
367
|
+
private _preparePromptAndToolLoadout;
|
|
368
|
+
/**
|
|
369
|
+
* Send a forced prompt as the provider's leading system prompt without recording it.
|
|
370
|
+
*
|
|
371
|
+
* A `before_agent_start` handler that returns `systemPrompt` needs that exact text at the
|
|
372
|
+
* head of the request; a mid-conversation system message would leave the original prompt
|
|
373
|
+
* in place. The forced text is a rendering of the current prompt, so the transcript keeps
|
|
374
|
+
* its structured sections and the request is projected instead: the system messages
|
|
375
|
+
* collapse into one head holding the forced text and the current tools. Runs after the
|
|
376
|
+
* `context` extension handlers.
|
|
377
|
+
*/
|
|
378
|
+
private _installAgentForcedPromptProjection;
|
|
379
|
+
/** Restore the active tool loadout declared by the session transcript, if it declares one. */
|
|
380
|
+
private _restoreToolsFromTranscript;
|
|
348
381
|
private _runAgentPrompt;
|
|
349
382
|
private _handlePostAgentRun;
|
|
383
|
+
private _runInputHandlers;
|
|
350
384
|
/**
|
|
351
385
|
* Send a prompt to the agent.
|
|
352
386
|
* - Handles extension commands (registered via pi.registerCommand) immediately, even during streaming
|
|
@@ -373,23 +407,30 @@ export declare class AgentSession {
|
|
|
373
407
|
*/
|
|
374
408
|
private _expandBareNamespaceSkillCommand;
|
|
375
409
|
private _buildSkillBlockOrOriginal;
|
|
410
|
+
private _queueUserInput;
|
|
376
411
|
/**
|
|
377
412
|
* Queue a steering message while the agent is running.
|
|
378
413
|
* Delivered after the current assistant turn finishes executing its tool calls,
|
|
379
414
|
* before the next LLM call.
|
|
380
415
|
* Expands skill commands and prompt templates. Errors on extension commands.
|
|
381
416
|
* @param images Optional image attachments to include with the message
|
|
417
|
+
* @param options Input source; defaults to interactive
|
|
382
418
|
* @throws Error if text is an extension command
|
|
383
419
|
*/
|
|
384
|
-
steer(text: string, images?: ImageContent[]
|
|
420
|
+
steer(text: string, images?: ImageContent[], options?: {
|
|
421
|
+
source?: InputSource;
|
|
422
|
+
}): Promise<void>;
|
|
385
423
|
/**
|
|
386
424
|
* Queue a follow-up message to be processed after the agent finishes.
|
|
387
425
|
* Delivered only when agent has no more tool calls or steering messages.
|
|
388
426
|
* Expands skill commands and prompt templates. Errors on extension commands.
|
|
389
427
|
* @param images Optional image attachments to include with the message
|
|
428
|
+
* @param options Input source; defaults to interactive
|
|
390
429
|
* @throws Error if text is an extension command
|
|
391
430
|
*/
|
|
392
|
-
followUp(text: string, images?: ImageContent[]
|
|
431
|
+
followUp(text: string, images?: ImageContent[], options?: {
|
|
432
|
+
source?: InputSource;
|
|
433
|
+
}): Promise<void>;
|
|
393
434
|
private _queueSteer;
|
|
394
435
|
private _queueFollowUp;
|
|
395
436
|
/**
|
|
@@ -562,6 +603,7 @@ export declare class AgentSession {
|
|
|
562
603
|
* the TUI needs to render the retry and recreate the underlying indicator.
|
|
563
604
|
*/
|
|
564
605
|
private _summarizationRetryCallbacks;
|
|
606
|
+
private _finishCancelledRetry;
|
|
565
607
|
private _prepareRetry;
|
|
566
608
|
/**
|
|
567
609
|
* Cancel in-progress retry.
|
|
@@ -665,6 +707,14 @@ export declare class AgentSession {
|
|
|
665
707
|
* @returns The resolved output file path.
|
|
666
708
|
*/
|
|
667
709
|
exportToJsonl(outputPath?: string): string;
|
|
710
|
+
/**
|
|
711
|
+
* Ask the current model to describe what went wrong in this session for a bug report.
|
|
712
|
+
* Used when the user declines to share the transcript itself.
|
|
713
|
+
*/
|
|
714
|
+
summarizeForBugReport(options: {
|
|
715
|
+
hint?: string;
|
|
716
|
+
signal: AbortSignal;
|
|
717
|
+
}): Promise<string>;
|
|
668
718
|
/**
|
|
669
719
|
* Get text content of last assistant message.
|
|
670
720
|
* Useful for /copy command.
|