@oh-my-pi/pi-coding-agent 17.2.8 → 17.2.10
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 +94 -1
- package/dist/{CHANGELOG-0b0w17se.md → CHANGELOG-rhwzpexa.md} +94 -1
- package/dist/cli.js +13216 -15614
- package/dist/types/async/job-manager.d.ts +12 -0
- package/dist/types/cli/args.d.ts +1 -0
- package/dist/types/config/model-resolver.d.ts +13 -0
- package/dist/types/discovery/agents.d.ts +11 -0
- package/dist/types/extensibility/custom-commands/types.d.ts +5 -5
- package/dist/types/extensibility/custom-tools/types.d.ts +1 -1
- package/dist/types/extensibility/extensions/loader.d.ts +2 -2
- package/dist/types/extensibility/extensions/types.d.ts +34 -8
- package/dist/types/extensibility/hooks/types.d.ts +5 -5
- package/dist/types/extensibility/legacy-pi-coding-agent-shim.d.ts +10 -0
- package/dist/types/hindsight/state.d.ts +0 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/lsp/utils.d.ts +8 -0
- package/dist/types/main.d.ts +1 -1
- package/dist/types/modes/acp/acp-agent.d.ts +1 -1
- package/dist/types/modes/acp/acp-client-bridge.d.ts +1 -1
- package/dist/types/modes/acp/acp-event-mapper.d.ts +1 -1
- package/dist/types/modes/acp/acp-mode.d.ts +1 -1
- package/dist/types/modes/components/agent-hub-projection.d.ts +38 -0
- package/dist/types/modes/components/agent-hub-renderer.d.ts +41 -0
- package/dist/types/modes/components/agent-hub.d.ts +12 -5
- package/dist/types/modes/components/model-browser.d.ts +9 -1
- package/dist/types/modes/interactive-mode.d.ts +8 -1
- package/dist/types/modes/session-observer-registry.d.ts +2 -0
- package/dist/types/registry/agent-lifecycle.d.ts +1 -1
- package/dist/types/registry/agent-registry.d.ts +47 -0
- package/dist/types/registry/persisted-agents.d.ts +3 -1
- package/dist/types/session/agent-session-types.d.ts +7 -0
- package/dist/types/session/agent-session.d.ts +8 -4
- package/dist/types/session/session-entries.d.ts +10 -0
- package/dist/types/session/session-loader.d.ts +11 -1
- package/dist/types/session/session-manager.d.ts +9 -1
- package/dist/types/session/session-tools.d.ts +10 -1
- package/dist/types/session/turn-recovery.d.ts +6 -2
- package/dist/types/slash-commands/acp-builtins.d.ts +1 -1
- package/dist/types/slash-commands/available-commands.d.ts +1 -1
- package/dist/types/task/executor.d.ts +10 -0
- package/dist/types/task/index.d.ts +2 -3
- package/dist/types/task/read-only-policy.d.ts +3 -0
- package/dist/types/task/structured-subagent.d.ts +2 -0
- package/dist/types/task/types.d.ts +4 -0
- package/dist/types/tools/bash.d.ts +3 -3
- package/dist/types/tools/browser/launch.d.ts +3 -0
- package/dist/types/tools/browser/tab-worker.d.ts +2 -2
- package/dist/types/tools/path-utils.d.ts +8 -0
- package/dist/types/tools/read.d.ts +3 -5
- package/dist/types/tools/run-scope.d.ts +27 -1
- package/dist/types/tools/shell-tokenize.d.ts +21 -3
- package/dist/types/tools/terminal-output.d.ts +1 -1
- package/dist/types/utils/changelog.d.ts +3 -2
- package/dist/types/utils/late-cleanup.d.ts +2 -0
- package/dist/types/utils/turndown.d.ts +1 -1
- package/dist/types/vibe/runtime.d.ts +4 -3
- package/dist/types/web/scrapers/readthedocs.d.ts +0 -3
- package/dist/types/web/search/providers/browser-headers.d.ts +2 -3
- package/examples/custom-tools/README.md +1 -1
- package/examples/extensions/README.md +1 -1
- package/examples/extensions/api-demo.ts +5 -6
- package/examples/extensions/chalk-logger.ts +1 -1
- package/examples/extensions/hello.ts +2 -2
- package/examples/extensions/reload-runtime.ts +1 -1
- package/examples/extensions/tools.ts +2 -2
- package/examples/extensions/with-deps/index.ts +1 -1
- package/examples/sdk/06-extensions.ts +1 -1
- package/package.json +15 -31
- package/scripts/bundle-dist.ts +1 -11
- package/scripts/omp +11 -2
- package/src/advisor/runtime.ts +54 -0
- package/src/async/job-manager.ts +26 -0
- package/src/cli/agents-cli.ts +1 -1
- package/src/cli/args.ts +24 -2
- package/src/cli/auth-broker-cli.ts +1 -1
- package/src/cli/auth-gateway-cli.ts +1 -1
- package/src/cli/bench-cli.ts +1 -1
- package/src/cli/claude-trace-cli.ts +1 -1
- package/src/cli/config-cli.ts +1 -1
- package/src/cli/dry-balance-cli.ts +1 -1
- package/src/cli/file-processor.ts +1 -1
- package/src/cli/flag-tables.ts +4 -0
- package/src/cli/grep-cli.ts +1 -1
- package/src/cli/grievances-cli.ts +1 -1
- package/src/cli/help-extra.ts +1 -1
- package/src/cli/models-cli.ts +1 -1
- package/src/cli/plugin-cli.ts +1 -1
- package/src/cli/read-cli.ts +1 -1
- package/src/cli/setup-cli.ts +1 -1
- package/src/cli/shell-cli.ts +1 -1
- package/src/cli/ssh-cli.ts +1 -1
- package/src/cli/stats-cli.ts +4 -4
- package/src/cli/tiny-models-cli.ts +1 -1
- package/src/cli/ttsr-cli.ts +1 -1
- package/src/cli/update-cli.ts +3 -57
- package/src/cli/usage-cli.ts +1 -1
- package/src/cli/web-search-cli.ts +1 -1
- package/src/cli/worktree-cli.ts +1 -1
- package/src/commands/say.ts +1 -1
- package/src/commands/token.ts +1 -1
- package/src/commit/agentic/agent.ts +1 -1
- package/src/commit/cli.ts +1 -1
- package/src/config/config-file.ts +2 -2
- package/src/config/keybindings.ts +3 -3
- package/src/config/model-discovery.ts +36 -2
- package/src/config/model-registry.ts +4 -1
- package/src/config/model-resolver.ts +54 -7
- package/src/discovery/agents.ts +73 -3
- package/src/discovery/builtin-rules/ts-no-inline-cast-access.md +5 -4
- package/src/discovery/builtin-rules/ts-no-tiny-functions.md +1 -1
- package/src/discovery/claude.ts +8 -5
- package/src/discovery/cursor.ts +8 -5
- package/src/discovery/gemini.ts +11 -8
- package/src/discovery/vscode.ts +1 -0
- package/src/discovery/windsurf.ts +4 -2
- package/src/edit/hashline/filesystem.ts +7 -7
- package/src/eval/agent-bridge.ts +1 -3
- package/src/eval/jl/prelude.jl +4 -4
- package/src/eval/js/shared/prelude.txt +2 -2
- package/src/eval/py/prelude.py +0 -3
- package/src/eval/py/runner.py +38 -1
- package/src/eval/rb/prelude.rb +1 -2
- package/src/extensibility/custom-commands/loader.ts +4 -4
- package/src/extensibility/custom-commands/types.ts +5 -5
- package/src/extensibility/custom-tools/loader.ts +4 -4
- package/src/extensibility/custom-tools/types.ts +1 -1
- package/src/extensibility/extensions/loader.ts +7 -6
- package/src/extensibility/extensions/types.ts +39 -8
- package/src/extensibility/hooks/loader.ts +4 -5
- package/src/extensibility/hooks/types.ts +5 -5
- package/src/extensibility/legacy-pi-coding-agent-shim.ts +23 -0
- package/src/extensibility/plugins/legacy-pi-compat.ts +53 -0
- package/src/hindsight/state.ts +2 -22
- package/src/index.ts +2 -2
- package/src/internal-urls/memory-protocol.ts +33 -0
- package/src/launch/terminal-output.ts +1 -1
- package/src/lsp/client.ts +2 -2
- package/src/lsp/utils.ts +29 -0
- package/src/main.ts +85 -21
- package/src/markit/converters/docx.ts +1 -1
- package/src/markit/converters/epub.ts +1 -1
- package/src/markit/converters/pptx.ts +1 -1
- package/src/markit/converters/xlsx.ts +1 -1
- package/src/modes/acp/acp-agent.ts +7 -6
- package/src/modes/acp/acp-client-bridge.ts +1 -1
- package/src/modes/acp/acp-event-mapper.ts +1 -1
- package/src/modes/acp/acp-mode.ts +1 -1
- package/src/modes/components/agent-hub-projection.ts +248 -0
- package/src/modes/components/agent-hub-renderer.ts +194 -0
- package/src/modes/components/agent-hub.ts +670 -192
- package/src/modes/components/agent-transcript-viewer.ts +1 -3
- package/src/modes/components/assistant-message.ts +1 -1
- package/src/modes/components/bordered-loader.ts +1 -1
- package/src/modes/components/custom-editor.ts +2 -2
- package/src/modes/components/extensions/inspector-panel.ts +11 -6
- package/src/modes/components/footer.ts +1 -3
- package/src/modes/components/hook-input.ts +1 -1
- package/src/modes/components/hook-selector.ts +2 -2
- package/src/modes/components/model-browser.ts +11 -3
- package/src/modes/components/model-hub.ts +4 -1
- package/src/modes/components/session-selector.ts +2 -2
- package/src/modes/components/status-line/segments.ts +4 -3
- package/src/modes/controllers/event-controller.ts +188 -7
- package/src/modes/controllers/extension-ui-controller.ts +4 -3
- package/src/modes/controllers/mcp-command-controller.ts +81 -20
- package/src/modes/controllers/selector-controller.ts +40 -49
- package/src/modes/controllers/streaming-reveal.ts +1 -1
- package/src/modes/interactive-mode.ts +13 -2
- package/src/modes/print-mode.ts +29 -12
- package/src/modes/rpc/rpc-mode.ts +2 -2
- package/src/modes/runtime-init.ts +1 -1
- package/src/modes/session-observer-registry.ts +5 -0
- package/src/modes/theme/theme.ts +2 -2
- package/src/prompts/tools/computer.md +1 -1
- package/src/registry/agent-lifecycle.ts +35 -10
- package/src/registry/agent-registry.ts +65 -2
- package/src/registry/persisted-agents.ts +341 -16
- package/src/sdk.ts +11 -5
- package/src/session/agent-session-types.ts +8 -0
- package/src/session/agent-session.ts +177 -188
- package/src/session/session-entries.ts +10 -0
- package/src/session/session-listing.ts +1 -1
- package/src/session/session-loader.ts +74 -8
- package/src/session/session-manager.ts +22 -2
- package/src/session/session-paths.ts +105 -110
- package/src/session/session-tools.ts +28 -1
- package/src/session/settings-stream-fn.ts +7 -3
- package/src/session/turn-recovery.ts +236 -18
- package/src/session/unexpected-stop-classifier.ts +12 -3
- package/src/slash-commands/acp-builtins.ts +1 -1
- package/src/slash-commands/available-commands.ts +1 -1
- package/src/slash-commands/helpers/stats-dashboard.ts +2 -1
- package/src/task/agents.ts +1 -1
- package/src/task/executor.ts +173 -47
- package/src/task/index.ts +9 -28
- package/src/task/isolation-runner.ts +43 -12
- package/src/task/persisted-revive.ts +12 -5
- package/src/task/read-only-policy.ts +27 -0
- package/src/task/structured-subagent.ts +31 -6
- package/src/task/types.ts +4 -0
- package/src/tiny/worker.ts +1 -1
- package/src/tools/auto-generated-guard.ts +1 -1
- package/src/tools/bash-interactive.ts +4 -4
- package/src/tools/bash-interceptor.ts +8 -4
- package/src/tools/bash.ts +6 -6
- package/src/tools/browser/cmux/cmux-tab.ts +66 -18
- package/src/tools/browser/launch.ts +76 -19
- package/src/tools/browser/readable.ts +9 -9
- package/src/tools/browser/tab-supervisor.ts +12 -3
- package/src/tools/browser/tab-worker-entry.ts +1 -1
- package/src/tools/browser/tab-worker.ts +101 -12
- package/src/tools/fetch.ts +1 -1
- package/src/tools/glob.ts +4 -2
- package/src/tools/path-utils.ts +22 -5
- package/src/tools/read.ts +22 -5
- package/src/tools/run-scope.ts +290 -4
- package/src/tools/shell-tokenize.ts +38 -9
- package/src/tools/terminal-output.ts +1 -1
- package/src/tools/todo.ts +1 -1
- package/src/utils/changelog.ts +5 -4
- package/src/utils/clipboard.ts +10 -2
- package/src/utils/external-editor.ts +4 -2
- package/src/utils/jj.ts +1 -1
- package/src/utils/late-cleanup.ts +17 -0
- package/src/utils/turndown.ts +1 -2
- package/src/vibe/runtime.ts +202 -58
- package/src/web/scrapers/arxiv.ts +1 -1
- package/src/web/scrapers/go-pkg.ts +1 -1
- package/src/web/scrapers/hackage.ts +1 -12
- package/src/web/scrapers/iacr.ts +1 -1
- package/src/web/scrapers/readthedocs.ts +2 -1
- package/src/web/scrapers/twitter.ts +2 -2
- package/src/web/scrapers/types.ts +1 -1
- package/src/web/scrapers/wikipedia.ts +1 -1
- package/src/web/search/providers/browser-headers.ts +12 -39
- package/src/web/search/providers/codex.ts +3 -26
- package/src/web/search/providers/duckduckgo.ts +1 -1
- package/src/web/search/providers/ecosia.ts +2 -2
- package/src/web/search/providers/exa.ts +1 -1
- package/src/web/search/providers/firecrawl.ts +1 -1
- package/src/web/search/providers/google.ts +1 -1
- package/src/web/search/providers/mojeek.ts +2 -2
- package/src/web/search/providers/perplexity.ts +1 -1
- package/src/web/search/providers/public.ts +1 -1
- package/src/web/search/providers/startpage.ts +2 -2
- package/src/markit/converters/mammoth.d.ts +0 -24
|
@@ -65,6 +65,13 @@ export interface UsageFallbackConfirmation {
|
|
|
65
65
|
to: string;
|
|
66
66
|
remainingPercent: number | undefined;
|
|
67
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Confirms whether a reserve-triggered model fallback may proceed.
|
|
70
|
+
*
|
|
71
|
+
* Interactive callers use the confirmation details to present the pending
|
|
72
|
+
* route change; aborting `signal` cancels that pending confirmation.
|
|
73
|
+
*/
|
|
74
|
+
export type UsageFallbackConfirmer = (confirmation: UsageFallbackConfirmation, signal: AbortSignal) => Promise<boolean>;
|
|
68
75
|
/** Identifies a retry fallback chain already entered during startup model resolution. */
|
|
69
76
|
export interface InitialRetryFallbackState {
|
|
70
77
|
/** Role whose configured primary was unavailable. */
|
|
@@ -20,7 +20,7 @@ import { type Effort } from "@oh-my-pi/pi-ai";
|
|
|
20
20
|
import { type AdvisorConfig, type AdvisorRuntimeStatus } from "../advisor/index.js";
|
|
21
21
|
import { AsyncJobManager } from "../async/index.js";
|
|
22
22
|
import type { ModelRegistry } from "../config/model-registry.js";
|
|
23
|
-
import {
|
|
23
|
+
import type { ResolvedModelRoleValue } from "../config/model-resolver.js";
|
|
24
24
|
import { type PromptTemplate } from "../config/prompt-templates.js";
|
|
25
25
|
import type { Settings, SkillsSettings } from "../config/settings.js";
|
|
26
26
|
import { RawSseDebugBuffer } from "../debug/raw-sse-buffer.js";
|
|
@@ -29,7 +29,7 @@ import type { BashResult } from "../exec/bash-executor.js";
|
|
|
29
29
|
import type { TtsrManager } from "../export/ttsr.js";
|
|
30
30
|
import type { LoadedCustomCommand } from "../extensibility/custom-commands/index.js";
|
|
31
31
|
import type { CustomTool } from "../extensibility/custom-tools/types.js";
|
|
32
|
-
import type { ExtensionRunner, ExtensionUIContext } from "../extensibility/extensions/index.js";
|
|
32
|
+
import type { ExtensionRunner, ExtensionUIContext, ToolInfo } from "../extensibility/extensions/index.js";
|
|
33
33
|
import type { CompactOptions, ContextUsage } from "../extensibility/extensions/types.js";
|
|
34
34
|
import type { Skill, SkillWarning } from "../extensibility/skills.js";
|
|
35
35
|
import { type FileSlashCommand } from "../extensibility/slash-commands.js";
|
|
@@ -50,7 +50,7 @@ import type { TodoPhase } from "../tools/todo.js";
|
|
|
50
50
|
import type { InspectImageMode } from "../utils/inspect-image-mode.js";
|
|
51
51
|
import type { VibeModeState } from "../vibe/state.js";
|
|
52
52
|
import type { AgentSessionEventListener } from "./agent-session-events.js";
|
|
53
|
-
import type { AgentSessionConfig, AgentSessionDisposeOptions, AsyncJobSnapshot, CommandMetadataChangedListener, ContextUsageBreakdown, FollowUpOptions, FreshSessionResult, HandoffResult, ModelCycleResult, Prewalk, PromptOptions, ResetSessionContextResult, ResolvedRoleModel, RestoredQueuedMessage, RoleModelCycle, RoleModelCycleResult, SessionHandoffOptions, SessionOAuthAccountList, SessionStats,
|
|
53
|
+
import type { AgentSessionConfig, AgentSessionDisposeOptions, AsyncJobSnapshot, CommandMetadataChangedListener, ContextUsageBreakdown, FollowUpOptions, FreshSessionResult, HandoffResult, ModelCycleResult, Prewalk, PromptOptions, ResetSessionContextResult, ResolvedRoleModel, RestoredQueuedMessage, RoleModelCycle, RoleModelCycleResult, SessionHandoffOptions, SessionOAuthAccountList, SessionStats, UsageFallbackConfirmer } from "./agent-session-types.js";
|
|
54
54
|
import type { ClientBridge } from "./client-bridge.js";
|
|
55
55
|
import { type CustomMessage, type CustomMessagePayload } from "./messages.js";
|
|
56
56
|
import { type AdvisorStats } from "./session-advisors.js";
|
|
@@ -228,7 +228,7 @@ export declare class AgentSession {
|
|
|
228
228
|
/** Resolved selector while retry routing is using a fallback model. */
|
|
229
229
|
get retryFallbackModel(): string | undefined;
|
|
230
230
|
/** Install the interactive decision surface for reserve-triggered model changes. */
|
|
231
|
-
setUsageFallbackConfirmer(confirmer:
|
|
231
|
+
setUsageFallbackConfirmer(confirmer: UsageFallbackConfirmer | undefined): void;
|
|
232
232
|
/** Effective thinking level applied to the agent (the resolved level when `auto`). */
|
|
233
233
|
get thinkingLevel(): ThinkingLevel | undefined;
|
|
234
234
|
/** The selector the user configured: `auto` when auto mode is active, else the effective level. */
|
|
@@ -267,6 +267,8 @@ export declare class AgentSession {
|
|
|
267
267
|
getLastAssistantMessage(): AssistantMessage | undefined;
|
|
268
268
|
/** Current effective system prompt blocks (includes any per-turn extension modifications) */
|
|
269
269
|
get systemPrompt(): string[];
|
|
270
|
+
/** Marks streamed text as committed or buffered for turn-recovery replay decisions. */
|
|
271
|
+
setTextOutputCommitted(committed: boolean): void;
|
|
270
272
|
/** Current retry attempt (0 if not retrying) */
|
|
271
273
|
get retryAttempt(): number;
|
|
272
274
|
/** Names of tools currently exposed at the top level. */
|
|
@@ -283,6 +285,8 @@ export declare class AgentSession {
|
|
|
283
285
|
hasBuiltInTool(name: string): boolean;
|
|
284
286
|
/** Names of every registered tool. */
|
|
285
287
|
getAllToolNames(): string[];
|
|
288
|
+
/** Full metadata for every registered tool, including source provenance (backs `getAllTools()`). */
|
|
289
|
+
getAllToolInfos(): ToolInfo[];
|
|
286
290
|
/** Installs and activates the ephemeral vibe tool set. */
|
|
287
291
|
activateVibeTools(baseToolNames: string[]): Promise<void>;
|
|
288
292
|
/** Uninstalls vibe tools and activates the replacement set. */
|
|
@@ -71,6 +71,8 @@ export interface ModelChangeEntry extends SessionEntryBase {
|
|
|
71
71
|
model: string;
|
|
72
72
|
/** Role: "default", "smol", "slow", etc. Undefined treated as "default" */
|
|
73
73
|
role?: string;
|
|
74
|
+
/** True when this transition selected a retry-fallback model rather than the configured model. */
|
|
75
|
+
resolvedModelIsFallback?: boolean;
|
|
74
76
|
}
|
|
75
77
|
export interface ServiceTierChangeEntry extends SessionEntryBase {
|
|
76
78
|
type: "service_tier_change";
|
|
@@ -183,6 +185,14 @@ export interface SessionInitEntry extends SessionEntryBase {
|
|
|
183
185
|
task: string;
|
|
184
186
|
/** Tools available to the agent */
|
|
185
187
|
tools: string[];
|
|
188
|
+
/** Agent definition name (for example `scout` or `reviewer`). */
|
|
189
|
+
agent?: string;
|
|
190
|
+
/** Semantic model role declared by the agent, retained even after concrete model resolution. */
|
|
191
|
+
modelRole?: string;
|
|
192
|
+
/** Initially resolved provider/model selector for historical display. */
|
|
193
|
+
resolvedModel?: string;
|
|
194
|
+
/** Whether the agent definition is read-only, allowing an exact zero-LoC attribution. */
|
|
195
|
+
readOnly?: boolean;
|
|
186
196
|
/** Output schema if structured output was requested. */
|
|
187
197
|
outputSchema?: unknown;
|
|
188
198
|
/** Enforcement policy recorded with the output schema for faithful revival. */
|
|
@@ -3,13 +3,23 @@ import { BlobStore } from "./blob-store.js";
|
|
|
3
3
|
import { type FileEntry, type SessionTitleSlotEntry } from "./session-entries.js";
|
|
4
4
|
import { type SessionStorage } from "./session-storage.js";
|
|
5
5
|
import { type SessionTitleUpdate } from "./session-title-slot.js";
|
|
6
|
+
export interface VisitEntriesFromFileStreamOptions {
|
|
7
|
+
/** Stop after the visitor returns `false`. */
|
|
8
|
+
shouldContinue?: () => boolean;
|
|
9
|
+
/** Stop after this many valid or malformed JSONL records have been consumed. */
|
|
10
|
+
maxRecords?: number;
|
|
11
|
+
/** Yield to the macrotask queue after this many bytes have been consumed. */
|
|
12
|
+
yieldEveryBytes?: number;
|
|
13
|
+
/** Yield to the macrotask queue after this many entries have been visited. */
|
|
14
|
+
yieldEveryEntries?: number;
|
|
15
|
+
}
|
|
6
16
|
/** Parse session JSONL while stripping and folding the optional fixed title slot. */
|
|
7
17
|
export declare function parseSessionContent(content: string): {
|
|
8
18
|
entries: FileEntry[];
|
|
9
19
|
titleSlot: SessionTitleUpdate | undefined;
|
|
10
20
|
};
|
|
11
21
|
/** Parse session JSONL and visit each entry without retaining prior entries. */
|
|
12
|
-
export declare function visitEntriesFromFileStream(filePath: string, visit: (entry: FileEntry) => void): Promise<SessionTitleUpdate | undefined>;
|
|
22
|
+
export declare function visitEntriesFromFileStream(filePath: string, visit: (entry: FileEntry) => void | boolean, options?: VisitEntriesFromFileStreamOptions): Promise<SessionTitleUpdate | undefined>;
|
|
13
23
|
/** Exported for testing — the ≥8MiB streaming path (works on any file size). */
|
|
14
24
|
export declare function loadEntriesFromFileStream(filePath: string): Promise<{
|
|
15
25
|
entries: FileEntry[];
|
|
@@ -220,12 +220,17 @@ export declare class SessionManager {
|
|
|
220
220
|
* Append a model change as a child of the current leaf, then advance the leaf.
|
|
221
221
|
* @param model Model in "provider/modelId" format
|
|
222
222
|
* @param role Optional role (default: "default")
|
|
223
|
+
* @param resolvedModelIsFallback Whether this transition selected a retry-fallback model
|
|
223
224
|
*/
|
|
224
|
-
appendModelChange(model: string, role?: string): string;
|
|
225
|
+
appendModelChange(model: string, role?: string, resolvedModelIsFallback?: boolean): string;
|
|
225
226
|
appendSessionInit(init: {
|
|
226
227
|
systemPrompt: string;
|
|
227
228
|
task: string;
|
|
228
229
|
tools: string[];
|
|
230
|
+
agent?: string;
|
|
231
|
+
modelRole?: string;
|
|
232
|
+
resolvedModel?: string;
|
|
233
|
+
readOnly?: boolean;
|
|
229
234
|
outputSchema?: unknown;
|
|
230
235
|
outputSchemaMode?: StructuredSubagentSchemaMode;
|
|
231
236
|
restrictToolNames?: boolean;
|
|
@@ -375,6 +380,9 @@ export declare class SessionManager {
|
|
|
375
380
|
systemPrompt: string;
|
|
376
381
|
task: string;
|
|
377
382
|
tools: string[];
|
|
383
|
+
agent?: string;
|
|
384
|
+
modelRole?: string;
|
|
385
|
+
resolvedModel?: string;
|
|
378
386
|
outputSchema?: unknown;
|
|
379
387
|
outputSchemaMode?: StructuredSubagentSchemaMode;
|
|
380
388
|
restrictToolNames?: boolean;
|
|
@@ -3,7 +3,7 @@ import type { Model } from "@oh-my-pi/pi-ai";
|
|
|
3
3
|
import type { ModelRegistry } from "../config/model-registry.js";
|
|
4
4
|
import type { Settings, SkillsSettings } from "../config/settings.js";
|
|
5
5
|
import type { CustomTool } from "../extensibility/custom-tools/types.js";
|
|
6
|
-
import type { ExtensionRunner } from "../extensibility/extensions/index.js";
|
|
6
|
+
import type { ExtensionRunner, ToolInfo } from "../extensibility/extensions/index.js";
|
|
7
7
|
import { type Skill, type SkillWarning } from "../extensibility/skills.js";
|
|
8
8
|
import { type LocalProtocolOptions } from "../internal-urls/index.js";
|
|
9
9
|
import type { MemoryBackendStartOptions } from "../memory-backend/types.js";
|
|
@@ -132,6 +132,15 @@ export declare class SessionTools {
|
|
|
132
132
|
hasBuiltInTool(name: string): boolean;
|
|
133
133
|
/** Names of every registered tool. */
|
|
134
134
|
getAllToolNames(): string[];
|
|
135
|
+
/**
|
|
136
|
+
* Full metadata for every registered tool, including source provenance.
|
|
137
|
+
*
|
|
138
|
+
* Backs the `getAllTools()` ExtensionAPI method. Returns {@link ToolInfo}
|
|
139
|
+
* objects (not bare names) so extensions authored against upstream
|
|
140
|
+
* `@earendil-works/pi-coding-agent` — which promises `ToolInfo[]` — can read
|
|
141
|
+
* `sourceInfo.source` unchanged.
|
|
142
|
+
*/
|
|
143
|
+
getAllToolInfos(): ToolInfo[];
|
|
135
144
|
/** Installs and activates the ephemeral vibe tool set. */
|
|
136
145
|
activateVibeTools(baseToolNames: string[]): Promise<void>;
|
|
137
146
|
/** Uninstalls vibe tools and activates the replacement set. */
|
|
@@ -4,7 +4,7 @@ import type { ModelRegistry } from "../config/model-registry.js";
|
|
|
4
4
|
import type { Settings } from "../config/settings.js";
|
|
5
5
|
import { type ConfiguredThinkingLevel } from "../thinking.js";
|
|
6
6
|
import type { AgentSessionEvent } from "./agent-session-events.js";
|
|
7
|
-
import type { InitialRetryFallbackState } from "./agent-session-types.js";
|
|
7
|
+
import type { InitialRetryFallbackState, UsageFallbackConfirmer } from "./agent-session-types.js";
|
|
8
8
|
import { type RetryFallbackSelector } from "./retry-fallback-chains.js";
|
|
9
9
|
import type { SessionManager } from "./session-manager.js";
|
|
10
10
|
/** Result shape shared with automatic maintenance recovery. */
|
|
@@ -22,6 +22,8 @@ export interface TurnRecoveryHost {
|
|
|
22
22
|
modelRegistry: ModelRegistry;
|
|
23
23
|
configWarnings: string[];
|
|
24
24
|
model(): Model | undefined;
|
|
25
|
+
/** Whether streamed text has already been committed to the active output sink. */
|
|
26
|
+
textOutputCommitted(): boolean;
|
|
25
27
|
thinkingLevel(): ThinkingLevel | undefined;
|
|
26
28
|
configuredThinkingLevel(): ConfiguredThinkingLevel | undefined;
|
|
27
29
|
setThinkingLevel(level: ConfiguredThinkingLevel | undefined): void;
|
|
@@ -100,6 +102,8 @@ export declare class TurnRecovery {
|
|
|
100
102
|
}): Promise<RecoveryCompactionResult>;
|
|
101
103
|
/** Restores the configured primary after fallback cooldown expiry. */
|
|
102
104
|
maybeRestoreRetryFallbackPrimary(): Promise<void>;
|
|
105
|
+
/** Applies model fallback policy from live usage health before a turn starts. */
|
|
106
|
+
maybeApplyUsageAwareFallback(signal: AbortSignal, confirmer?: UsageFallbackConfirmer): Promise<boolean>;
|
|
103
107
|
/** Applies automatic retry, credential rotation, and model fallback policy. */
|
|
104
108
|
handleRetryableError(message: AssistantMessage, options?: {
|
|
105
109
|
allowModelFallback?: boolean;
|
|
@@ -181,7 +185,7 @@ export declare class TurnRecovery {
|
|
|
181
185
|
pinFallback?: boolean;
|
|
182
186
|
apiKey?: string;
|
|
183
187
|
signal?: AbortSignal;
|
|
184
|
-
}): Promise<
|
|
188
|
+
}): Promise<boolean>;
|
|
185
189
|
/**
|
|
186
190
|
* True when the current turn failed on a Fireworks Fast (`-fast`) model in a
|
|
187
191
|
* way that should degrade to the reliable base (Standard) model. Fast is a
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AvailableCommand } from "@
|
|
1
|
+
import type { AvailableCommand } from "@oh-my-pi/pi-utils/acp";
|
|
2
2
|
import type { AcpBuiltinSlashCommandResult, SlashCommandRuntime } from "./types.js";
|
|
3
3
|
export type { AcpBuiltinSlashCommandResult } from "./types.js";
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AvailableCommand } from "@
|
|
1
|
+
import type { AvailableCommand } from "@oh-my-pi/pi-utils/acp";
|
|
2
2
|
import type { SkillsSettings } from "../config/settings.js";
|
|
3
3
|
import type { LoadedCustomCommand } from "../extensibility/custom-commands/index.js";
|
|
4
4
|
import type { ExtensionRunner } from "../extensibility/extensions/index.js";
|
|
@@ -87,6 +87,8 @@ export interface ExecutorOptions {
|
|
|
87
87
|
*/
|
|
88
88
|
detached?: boolean;
|
|
89
89
|
modelOverride?: string | string[];
|
|
90
|
+
/** Explicit pre-expansion model role alias selected for this run. */
|
|
91
|
+
modelRole?: string;
|
|
90
92
|
/**
|
|
91
93
|
* Active model selector of the parent session, used as an auth-aware fallback
|
|
92
94
|
* if the resolved subagent model has no working credentials. See #985.
|
|
@@ -209,6 +211,8 @@ export interface ExecutorOptions {
|
|
|
209
211
|
* set this false so disposal unregisters them instead of leaving idle peers.
|
|
210
212
|
*/
|
|
211
213
|
keepAlive?: boolean;
|
|
214
|
+
/** Internal ownership handoff for cleanup that outlives the visible Task result. */
|
|
215
|
+
onCleanupDeferred?: (completion: Promise<void>) => void;
|
|
212
216
|
}
|
|
213
217
|
interface FinalizeSubprocessOutputArgs {
|
|
214
218
|
rawOutput: string;
|
|
@@ -258,6 +262,8 @@ export interface IrcWakeTurnMonitorOptions {
|
|
|
258
262
|
agent: AgentDefinition;
|
|
259
263
|
description?: string;
|
|
260
264
|
modelOverride?: string | string[];
|
|
265
|
+
/** Explicit pre-expansion model role alias selected for this run. */
|
|
266
|
+
modelRole?: string;
|
|
261
267
|
eventBus?: EventBus;
|
|
262
268
|
parentToolCallId?: string;
|
|
263
269
|
/** Fallback session file when the registry ref carries none. */
|
|
@@ -294,6 +300,8 @@ export declare function finalizeSubagentLifecycle(args: {
|
|
|
294
300
|
isolated: boolean;
|
|
295
301
|
agentIdleTtlMs: number;
|
|
296
302
|
reviveSession: AgentReviver | null;
|
|
303
|
+
cleanupDeadlineAt?: number;
|
|
304
|
+
onCleanupDeferred?: (completion: Promise<void>) => void;
|
|
297
305
|
}): Promise<void>;
|
|
298
306
|
/** Options for {@link runSubagentFollowUpTurn}. */
|
|
299
307
|
export interface FollowUpTurnOptions {
|
|
@@ -305,6 +313,8 @@ export interface FollowUpTurnOptions {
|
|
|
305
313
|
message: string;
|
|
306
314
|
index?: number;
|
|
307
315
|
description?: string;
|
|
316
|
+
/** Explicit pre-expansion model role alias retained from the original run. */
|
|
317
|
+
modelRole?: string;
|
|
308
318
|
/** Structured-output state retained from the original invocation. */
|
|
309
319
|
outputSchema?: unknown;
|
|
310
320
|
outputSchemaMode?: StructuredSubagentSchemaMode;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import type { ToolSession } from "../index.js";
|
|
3
3
|
import type { Theme } from "../modes/theme/theme.js";
|
|
4
|
-
import { type
|
|
4
|
+
import { type SingleResult, type TaskItem, type TaskToolDetails, type TaskToolSchemaInstance } from "./types.js";
|
|
5
5
|
import "../tools/review.js";
|
|
6
6
|
import { renderResult, renderCall as renderTaskCall } from "./render.js";
|
|
7
7
|
export { loadBundledAgents as BUNDLED_AGENTS } from "./agents.js";
|
|
8
8
|
export { discoverCommands, expandCommand, getCommand } from "./commands.js";
|
|
9
9
|
export { discoverAgents, getAgent } from "./discovery.js";
|
|
10
10
|
export { AgentOutputManager } from "./output-manager.js";
|
|
11
|
+
export * from "./read-only-policy.js";
|
|
11
12
|
export type { AgentDefinition, AgentProgress, SingleResult, SubagentEventPayload, SubagentLifecyclePayload, SubagentProgressPayload, TaskParams, TaskToolDetails, } from "./types.js";
|
|
12
13
|
export { TASK_SUBAGENT_EVENT_CHANNEL, TASK_SUBAGENT_LIFECYCLE_CHANNEL, TASK_SUBAGENT_PROGRESS_CHANNEL, taskSchema, } from "./types.js";
|
|
13
|
-
export declare const READ_ONLY_TOOL_NAMES: ReadonlySet<string>;
|
|
14
|
-
export declare function isReadOnlyAgent(agent: AgentDefinition): boolean;
|
|
15
14
|
/**
|
|
16
15
|
* Preview text for a child result. Falls back to "(no output)" — annotated
|
|
17
16
|
* with the request count when the child actually did work, so the parent can
|
|
@@ -74,6 +74,8 @@ export interface EffectiveSubagentPolicy {
|
|
|
74
74
|
agent: AgentDefinition;
|
|
75
75
|
effectiveAgent: AgentDefinition;
|
|
76
76
|
modelOverride?: string | string[];
|
|
77
|
+
/** Explicit pre-expansion model role alias selected for this run. */
|
|
78
|
+
modelRole?: string;
|
|
77
79
|
parentActiveModelPattern?: string;
|
|
78
80
|
schema: StructuredSubagentSchemaResolution;
|
|
79
81
|
planMode: boolean;
|
|
@@ -336,6 +336,8 @@ export interface AgentProgress {
|
|
|
336
336
|
cost: number;
|
|
337
337
|
durationMs: number;
|
|
338
338
|
modelOverride?: string | string[];
|
|
339
|
+
/** Explicit pre-expansion model role alias selected for this run. */
|
|
340
|
+
modelRole?: string;
|
|
339
341
|
/** Resolved model display string in the form `<provider>/<id>`, optionally suffixed with `:<thinkingLevel>` when the level was set explicitly. Undefined when the model could not be resolved. */
|
|
340
342
|
resolvedModel?: string;
|
|
341
343
|
/** True when {@link resolvedModel} is the target of an active retry fallback (not the originally configured model). Lets observer-only UIs (collab guests, Agent Hub rows with no live session) flag the fallback and keep the provider. */
|
|
@@ -404,6 +406,8 @@ export interface SingleResult {
|
|
|
404
406
|
/** Model's context window in tokens, when known. */
|
|
405
407
|
contextWindow?: number;
|
|
406
408
|
modelOverride?: string | string[];
|
|
409
|
+
/** Explicit pre-expansion model role alias selected for this run. */
|
|
410
|
+
modelRole?: string;
|
|
407
411
|
/** Resolved model display string in the form `<provider>/<id>`, optionally suffixed with `:<thinkingLevel>` when the level was set explicitly. Omitted from tool-result JSON when undefined to keep wire payloads small. */
|
|
408
412
|
resolvedModel?: string;
|
|
409
413
|
/** True when {@link resolvedModel} is the target of an active retry fallback. Mirrors {@link AgentProgress.resolvedModelIsFallback} onto the settled result. */
|
|
@@ -119,7 +119,7 @@ export declare class BashTool implements AgentTool<typeof bashSchemaBase | typeo
|
|
|
119
119
|
}
|
|
120
120
|
export interface BashRenderArgs {
|
|
121
121
|
command?: string;
|
|
122
|
-
env?: Record<string,
|
|
122
|
+
env?: Record<string, unknown>;
|
|
123
123
|
timeout?: number;
|
|
124
124
|
cwd?: string;
|
|
125
125
|
__partialJson?: string;
|
|
@@ -141,10 +141,10 @@ export interface ShellRendererConfig<TArgs> {
|
|
|
141
141
|
resolveTitle: (args: TArgs | undefined, options: RenderResultOptions) => string;
|
|
142
142
|
resolveCommand?: (args: TArgs | undefined) => string | undefined;
|
|
143
143
|
resolveCwd?: (args: TArgs | undefined) => string | undefined;
|
|
144
|
-
resolveEnv?: (args: TArgs | undefined) => Record<string,
|
|
144
|
+
resolveEnv?: (args: TArgs | undefined) => Record<string, unknown> | undefined;
|
|
145
145
|
showHeader?: boolean;
|
|
146
146
|
}
|
|
147
|
-
export declare function getBashEnvForDisplay(args: BashRenderArgs): Record<string,
|
|
147
|
+
export declare function getBashEnvForDisplay(args: BashRenderArgs): Record<string, unknown> | undefined;
|
|
148
148
|
/**
|
|
149
149
|
* Returns the bash command formatted for the result body: the dim `$ cd … &&`
|
|
150
150
|
* prefix joined with syntax-highlighted command lines. The prefix is applied
|
|
@@ -115,6 +115,9 @@ export declare function applyStealthPatches(browser: Browser, page: Page, state:
|
|
|
115
115
|
browserSession: CDPSession | null;
|
|
116
116
|
override: UserAgentOverride | null;
|
|
117
117
|
}): Promise<void>;
|
|
118
|
+
/** Exposes executable candidates for detection tests. */
|
|
119
|
+
export declare function systemChromiumCandidatesForTest(platform?: NodeJS.Platform, home?: string, which?: (name: string) => string | null | undefined): string[];
|
|
120
|
+
export declare function chromiumExecutableProbeForTest(executablePath: string): Promise<boolean>;
|
|
118
121
|
export declare function stealthIgnoreDefaultArgsForTest(executablePath: string | undefined): string[];
|
|
119
122
|
export declare function targetSupportsUserAgentOverrideForTest(target: Target): boolean;
|
|
120
123
|
export declare function configureUserAgentTargetsForTest(browser: Browser, state: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HTMLElement } from "
|
|
1
|
+
import type { HTMLElement } from "@oh-my-pi/pi-utils/dom";
|
|
2
2
|
import type { ElementHandle, Page } from "puppeteer-core";
|
|
3
3
|
import type { Transport } from "./tab-protocol.js";
|
|
4
4
|
declare module "puppeteer-core" {
|
|
@@ -72,7 +72,7 @@ export declare function preparePageForScreenshot(page: Pick<Page, "bringToFront"
|
|
|
72
72
|
export declare function describeInflight(inflight: Map<number, InflightOp>): string;
|
|
73
73
|
export declare class WorkerCore {
|
|
74
74
|
#private;
|
|
75
|
-
constructor(transport: Transport);
|
|
75
|
+
constructor(transport: Transport, isolated: boolean);
|
|
76
76
|
nextElementId(): number;
|
|
77
77
|
cacheElement(id: number, handle: ElementHandle): void;
|
|
78
78
|
}
|
|
@@ -44,6 +44,13 @@ export declare function splitPathAndSel(rawPath: string): {
|
|
|
44
44
|
* plus selector `1-2` (issue #4618). `lstat` inspects the entry itself, so a
|
|
45
45
|
* dangling symlink is still detected as present; ambiguous errors resolve to
|
|
46
46
|
* `"unknown"` so callers keep the raw path instead of guessing.
|
|
47
|
+
*
|
|
48
|
+
* `ENAMETOOLONG` resolves to `"missing"` rather than `"unknown"`: a path whose
|
|
49
|
+
* component or whole length exceeds the OS limit can never name a real single
|
|
50
|
+
* entry, so it is strictly stronger evidence of non-existence than `ENOENT`.
|
|
51
|
+
* Without this, a semicolon-joined `path` list long enough to trip the limit
|
|
52
|
+
* (bare filenames past `NAME_MAX`, or a total past `PATH_MAX`) was read as one
|
|
53
|
+
* literal path and the delimited split was suppressed (issue #7597).
|
|
47
54
|
*/
|
|
48
55
|
export declare function probeLiteralPathExists(filePath: string, cwd: string): Promise<"exists" | "missing" | "unknown">;
|
|
49
56
|
/**
|
|
@@ -178,6 +185,7 @@ type PathEntrySplitter = (item: string) => {
|
|
|
178
185
|
*/
|
|
179
186
|
export declare function splitDelimitedPathEntry(entry: string, cwd: string, options?: {
|
|
180
187
|
splitter?: PathEntrySplitter;
|
|
188
|
+
routedUrlPredicate?: (entry: string) => boolean;
|
|
181
189
|
}): Promise<string[] | null>;
|
|
182
190
|
/** Expand delimited entries in-place while preserving unsplit entries. */
|
|
183
191
|
export declare function expandDelimitedPathEntries(entries: readonly string[], cwd: string, options?: {
|
|
@@ -28,6 +28,8 @@ export interface ReadToolDetails {
|
|
|
28
28
|
meta?: OutputMeta;
|
|
29
29
|
/** Full on-disk byte size recorded before applying a file range. */
|
|
30
30
|
fileSize?: number;
|
|
31
|
+
/** Full source line count when the read reached EOF and the count is exact. */
|
|
32
|
+
totalLines?: number;
|
|
31
33
|
/** Raw text + start line for user-visible TUI rendering, set when content is text-like.
|
|
32
34
|
* Mirrors the same lines the model receives but without hashline/line-number prefixes,
|
|
33
35
|
* so the TUI can render the file content with its own gutter without re-parsing the formatted text. */
|
|
@@ -61,11 +63,7 @@ export declare class ReadTool implements AgentTool<typeof readSchema, ReadToolDe
|
|
|
61
63
|
readonly label = "Read";
|
|
62
64
|
readonly loadMode = "essential";
|
|
63
65
|
description: string;
|
|
64
|
-
|
|
65
|
-
path: string;
|
|
66
|
-
}, {
|
|
67
|
-
path: string;
|
|
68
|
-
}>;
|
|
66
|
+
get parameters(): typeof readSchema;
|
|
69
67
|
readonly strict = true;
|
|
70
68
|
constructor(session: ToolSession);
|
|
71
69
|
/**
|
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
/** Associates a browser operation failure with its owning evaluated run. */
|
|
2
|
+
export declare function markBrowserRunRejection<T>(reason: T, owner: object): T;
|
|
3
|
+
/** Returns whether a rejection was marked for the specified evaluated run. */
|
|
4
|
+
export declare function isBrowserRunRejection(reason: unknown, owner: object): boolean;
|
|
5
|
+
/** Returns whether a rejection belongs to the marked browser run or its evaluated source file. */
|
|
6
|
+
export declare function isBrowserRunOwnedRejection(reason: unknown, owner: object, filename: string): boolean;
|
|
7
|
+
type FloatingRejectionHandler = (reason: unknown) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Observes native promise-combinator results derived from browser promises for
|
|
10
|
+
* the duration of one evaluated run. Native `await` remains unchanged; dropped
|
|
11
|
+
* user continuations from `Promise.all` and `Promise.race` are routed to the
|
|
12
|
+
* owning run.
|
|
13
|
+
*/
|
|
14
|
+
export declare function withBrowserPromiseCombinatorTracking<T>(owner: object, onFloatingRejection: FloatingRejectionHandler, run: () => Promise<T>): Promise<T>;
|
|
15
|
+
/**
|
|
16
|
+
* Observes every explicit continuation of a browser promise without replacing
|
|
17
|
+
* the native promise. Browser failures remain contained; an unhandled error
|
|
18
|
+
* created by user continuation code is reported to the owning run.
|
|
19
|
+
*/
|
|
20
|
+
export declare function observeBrowserRunPromise<T>(promise: Promise<T>, owner: object, onFloatingRejection: FloatingRejectionHandler): Promise<T>;
|
|
21
|
+
/**
|
|
22
|
+
* Installs worker-realm rejection routing. Consumed browser-run failures stay in
|
|
23
|
+
* the worker; unrelated failures retain the default fatal worker behavior.
|
|
24
|
+
*/
|
|
25
|
+
export declare function installBrowserWorkerRejectionGuard(consume: (reason: unknown) => boolean): () => void;
|
|
1
26
|
/**
|
|
2
27
|
* Marks a run-scoped promise as observed without changing its behavior for awaited callers.
|
|
3
28
|
*
|
|
@@ -38,4 +63,5 @@ export declare function resolvePredicateTimeout(cellTimeoutMs: number, explicit?
|
|
|
38
63
|
*/
|
|
39
64
|
export declare function waitForRun(msOrPredicate: number | (() => unknown), signal: AbortSignal, opts?: WaitPredicateOptions): Promise<unknown>;
|
|
40
65
|
/** Binds a long-lived scope facade (page/tab/desktop objects) to one evaluated run's abort signal. */
|
|
41
|
-
export declare function bindRunFacade<T extends object>(target: T, signal: AbortSignal): T;
|
|
66
|
+
export declare function bindRunFacade<T extends object>(target: T, signal: AbortSignal, rejectionOwner?: object, onFloatingRejection?: FloatingRejectionHandler): T;
|
|
67
|
+
export {};
|
|
@@ -13,13 +13,31 @@
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function tokenizeShellSegments(command: string): string[][];
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* A flat shell command segment with the context needed to decide interception.
|
|
17
|
+
*
|
|
18
|
+
* @see extractFlatShellCommandSegments
|
|
19
|
+
*/
|
|
20
|
+
export interface FlatShellCommandSegment {
|
|
21
|
+
/** Original segment text with quoting and escaping preserved. */
|
|
22
|
+
text: string;
|
|
23
|
+
/**
|
|
24
|
+
* True when this segment consumes the previous stage's stdout via an
|
|
25
|
+
* unquoted `|` or `|&`. Blank and comment-only continuation lines preserve
|
|
26
|
+
* the pending pipe state. Such a stage reads piped stdin, so path-based
|
|
27
|
+
* dedicated tools (read/grep/glob) cannot replace it. `||`, `;`, `&`, and
|
|
28
|
+
* `&&` start an independent command and leave this false.
|
|
29
|
+
*/
|
|
30
|
+
pipedStdin: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Returns the flat shell command segments with the original text of each. Unlike
|
|
17
34
|
* `tokenizeShellSegments`, this preserves quoting and escaping so the results
|
|
18
|
-
* are safe to match against user-configured regular expressions
|
|
35
|
+
* are safe to match against user-configured regular expressions, and flags
|
|
36
|
+
* segments that receive piped stdin.
|
|
19
37
|
*
|
|
20
38
|
* The extractor deliberately declines to split syntax whose execution context
|
|
21
39
|
* cannot be determined with this small scanner (heredocs, command substitution,
|
|
22
40
|
* backticks, grouping, and malformed quoting). Callers must still check the
|
|
23
41
|
* complete input in that case.
|
|
24
42
|
*/
|
|
25
|
-
export declare function extractFlatShellCommandSegments(command: string):
|
|
43
|
+
export declare function extractFlatShellCommandSegments(command: string): FlatShellCommandSegment[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Terminal as XtermTerminal } from "@
|
|
1
|
+
import type { Terminal as XtermTerminal } from "@oh-my-pi/pi-utils/vterm";
|
|
2
2
|
/** Applies the active tool-output color while preserving safe styles from a virtual terminal row. */
|
|
3
3
|
export declare function styleTerminalRow(row: string, baseForeground: string): string;
|
|
4
4
|
/** Reads terminal screen rows as sanitized text plus only the styles the TUI may replay. */
|
|
@@ -39,9 +39,10 @@ export declare function formatStartupChangelogSummary(selection: StartupChangelo
|
|
|
39
39
|
export declare function resolveBundledChangelogPath(assetPath: string, moduleUrl: string | URL): string | URL;
|
|
40
40
|
export declare function parseChangelog(changelogPath: string | undefined): Promise<ChangelogEntry[]>;
|
|
41
41
|
/**
|
|
42
|
-
* Compare
|
|
42
|
+
* Compare changelog entries by their parsed version parts.
|
|
43
|
+
* Returns: -1 if v1 < v2, 0 if v1 === v2, 1 if v1 > v2
|
|
43
44
|
*/
|
|
44
|
-
export declare function
|
|
45
|
+
export declare function compareChangelogEntries(v1: ChangelogEntry, v2: ChangelogEntry): number;
|
|
45
46
|
/**
|
|
46
47
|
* Parse an omp changelog marker version into comparable parts.
|
|
47
48
|
*/
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { AsyncJobManager } from "../async/job-manager.js";
|
|
2
|
-
import type { SessionEntry } from "../session/session-entries.js";
|
|
3
2
|
import { SessionManager } from "../session/session-manager.js";
|
|
4
3
|
import type { ToolSession } from "../tools/index.js";
|
|
5
4
|
/** The two worker CLI flavors the director drives. */
|
|
@@ -87,8 +86,8 @@ export interface VibeWaitOutcome {
|
|
|
87
86
|
stillRunning: string[];
|
|
88
87
|
timedOut: boolean;
|
|
89
88
|
}
|
|
90
|
-
/** Child ids claimed by
|
|
91
|
-
export declare function persistedVibeChildIds(entries: Iterable<
|
|
89
|
+
/** Child ids claimed by valid Vibe spawn records from untrusted persisted JSON. */
|
|
90
|
+
export declare function persistedVibeChildIds(entries: Iterable<unknown>): Set<string>;
|
|
92
91
|
/** Thrown from a turn job body so the job manager marks the job failed while carrying the formatted result. */
|
|
93
92
|
export declare class VibeTurnError extends Error {
|
|
94
93
|
}
|
|
@@ -113,6 +112,8 @@ export declare class VibeSessionRegistry {
|
|
|
113
112
|
ownerId: string;
|
|
114
113
|
state?: VibeSessionState;
|
|
115
114
|
}): void;
|
|
115
|
+
/** Override the teardown grace period for deterministic lifecycle tests. */
|
|
116
|
+
setTeardownGraceForTesting(timeoutMs: number): void;
|
|
116
117
|
ownerScope(session: VibeParentSession): VibeOwnerScope;
|
|
117
118
|
/** Re-open spawn admission after an explicit Vibe-mode entry. */
|
|
118
119
|
activateScope(scope: VibeOwnerScope): void;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Build a fresh, internally consistent desktop navigation fingerprint for one HTTP request.
|
|
3
|
-
* By default, this randomizes across
|
|
4
|
-
*
|
|
5
|
-
* stable Mac Chrome identity.
|
|
3
|
+
* By default, this randomizes across coherent modern Chrome, Firefox, and Safari profiles.
|
|
4
|
+
* Set `randomized` to `false` when a fetch must preserve a stable Mac Chrome identity.
|
|
6
5
|
*/
|
|
7
6
|
export declare function buildBrowserNavigationHeaders(options?: {
|
|
8
7
|
randomized?: boolean;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* API Demo Extension
|
|
3
3
|
*
|
|
4
|
-
* Demonstrates using ExtensionAPI's logger, injected
|
|
5
|
-
*
|
|
6
|
-
* the CustomToolAPI interface.
|
|
4
|
+
* Demonstrates using ExtensionAPI's logger, injected schema builder, and pi
|
|
5
|
+
* module access.
|
|
7
6
|
*/
|
|
8
7
|
import type { ExtensionAPI } from "@oh-my-pi/pi-coding-agent";
|
|
9
8
|
|
|
10
9
|
export default function (pi: ExtensionAPI) {
|
|
11
|
-
const
|
|
10
|
+
const z = pi.zod;
|
|
12
11
|
|
|
13
12
|
// Access the logger for debugging
|
|
14
13
|
pi.logger.debug("API demo extension loaded");
|
|
@@ -16,7 +15,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
16
15
|
pi.registerTool({
|
|
17
16
|
name: "api_demo",
|
|
18
17
|
label: "API Demo",
|
|
19
|
-
description: "Demonstrates ExtensionAPI capabilities: logger,
|
|
18
|
+
description: "Demonstrates ExtensionAPI capabilities: logger, schema validation, and pi module access",
|
|
20
19
|
parameters: z.object({
|
|
21
20
|
message: z.string().describe("Test message"),
|
|
22
21
|
logLevel: z.enum(["error", "warn", "debug"]).default("debug").describe("Log level to use"),
|
|
@@ -48,7 +47,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
48
47
|
``,
|
|
49
48
|
`Features demonstrated:`,
|
|
50
49
|
`1. ✓ Logger access via pi.logger`,
|
|
51
|
-
`2. ✓
|
|
50
|
+
`2. ✓ Schema builder access via pi.arktype`,
|
|
52
51
|
`3. ✓ Pi module access via pi.pi`,
|
|
53
52
|
``,
|
|
54
53
|
`Context:`,
|