@oh-my-pi/pi-coding-agent 16.4.2 → 16.4.3
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 +42 -0
- package/dist/cli.js +17514 -17799
- package/dist/types/advisor/config.d.ts +4 -3
- package/dist/types/commit/agentic/agent.d.ts +1 -0
- package/dist/types/config/settings-schema.d.ts +28 -0
- package/dist/types/extensibility/plugins/legacy-pi-compat.d.ts +10 -22
- package/dist/types/lsp/deferred-diagnostics.d.ts +11 -0
- package/dist/types/modes/components/move-overlay.d.ts +1 -1
- package/dist/types/modes/components/status-line/component.d.ts +3 -0
- package/dist/types/modes/components/status-line/types.d.ts +3 -0
- package/dist/types/modes/interactive-mode.d.ts +8 -0
- package/dist/types/modes/types.d.ts +2 -0
- package/dist/types/session/agent-session.d.ts +16 -0
- package/dist/types/task/executor.d.ts +31 -0
- package/dist/types/tools/__tests__/vibe-render.test.d.ts +1 -0
- package/dist/types/tools/browser/cmux/cmux-tab.d.ts +3 -1
- package/dist/types/tools/browser/cmux/rpc.d.ts +20 -0
- package/dist/types/tools/browser/run-output.d.ts +25 -0
- package/dist/types/tools/browser/tab-worker.d.ts +16 -0
- package/dist/types/tools/index.d.ts +1 -0
- package/dist/types/tools/vibe.d.ts +161 -0
- package/dist/types/utils/changelog.d.ts +35 -1
- package/dist/types/vibe/runtime.d.ts +124 -0
- package/dist/types/vibe/state.d.ts +4 -0
- package/dist/types/web/search/provider.d.ts +2 -0
- package/dist/types/web/search/providers/bing.d.ts +14 -0
- package/dist/types/web/search/providers/browser-headers.d.ts +9 -0
- package/dist/types/web/search/providers/browser-page.d.ts +32 -0
- package/dist/types/web/search/providers/ecosia.d.ts +14 -0
- package/dist/types/web/search/providers/google.d.ts +13 -0
- package/dist/types/web/search/providers/mojeek.d.ts +14 -0
- package/dist/types/web/search/providers/public.d.ts +37 -0
- package/dist/types/web/search/providers/startpage.d.ts +14 -0
- package/dist/types/web/search/providers/yahoo.d.ts +14 -0
- package/dist/types/web/search/types.d.ts +28 -0
- package/package.json +15 -18
- package/scripts/build-binary.ts +56 -73
- package/scripts/bundle-dist.ts +36 -40
- package/scripts/compile-binary.ts +68 -0
- package/scripts/generate-docs-index.ts +3 -93
- package/scripts/legacy-pi-virtual-module.ts +192 -0
- package/src/advisor/__tests__/advisor.test.ts +13 -0
- package/src/advisor/__tests__/config.test.ts +36 -0
- package/src/advisor/config.ts +11 -8
- package/src/commit/agentic/agent.ts +4 -0
- package/src/commit/agentic/index.ts +46 -21
- package/src/edit/index.ts +10 -76
- package/src/exec/non-interactive-env.ts +0 -1
- package/src/extensibility/plugins/legacy-pi-compat.ts +328 -162
- package/src/extensibility/plugins/legacy-pi-virtual-modules.d.ts +4 -0
- package/src/internal-urls/docs-index.ts +2 -1
- package/src/internal-urls/skill-protocol.ts +1 -1
- package/src/lsp/deferred-diagnostics.ts +66 -0
- package/src/main.ts +13 -13
- package/src/mcp/transports/stdio.test.ts +45 -1
- package/src/mcp/transports/stdio.ts +6 -3
- package/src/modes/acp/acp-agent.ts +65 -1
- package/src/modes/acp/acp-event-mapper.ts +5 -0
- package/src/modes/acp/acp-mode.ts +11 -0
- package/src/modes/components/__tests__/move-overlay.test.ts +16 -1
- package/src/modes/components/advisor-config.ts +15 -7
- package/src/modes/components/move-overlay.ts +2 -3
- package/src/modes/components/status-line/component.ts +6 -0
- package/src/modes/components/status-line/segments.ts +6 -0
- package/src/modes/components/status-line/types.ts +3 -0
- package/src/modes/controllers/command-controller.ts +8 -10
- package/src/modes/interactive-mode.ts +117 -1
- package/src/modes/types.ts +2 -0
- package/src/prompts/system/eager-task.md +2 -2
- package/src/prompts/system/system-prompt.md +9 -2
- package/src/prompts/system/vibe-mode-active.md +23 -0
- package/src/prompts/tools/browser.md +3 -3
- package/src/prompts/tools/grep.md +1 -1
- package/src/prompts/tools/vibe-kill.md +3 -0
- package/src/prompts/tools/vibe-list.md +3 -0
- package/src/prompts/tools/vibe-send.md +9 -0
- package/src/prompts/tools/vibe-spawn.md +10 -0
- package/src/prompts/tools/vibe-turn-result.md +19 -0
- package/src/prompts/tools/vibe-wait.md +8 -0
- package/src/sdk.ts +5 -0
- package/src/session/agent-session.ts +103 -13
- package/src/session/snapcompact-inline.ts +3 -19
- package/src/slash-commands/builtin-registry.ts +24 -8
- package/src/task/agents.ts +0 -2
- package/src/task/executor.ts +105 -0
- package/src/tools/__tests__/vibe-render.test.ts +210 -0
- package/src/tools/bash-skill-urls.ts +1 -1
- package/src/tools/browser/cmux/cmux-tab.ts +46 -48
- package/src/tools/browser/cmux/rpc.ts +50 -0
- package/src/tools/browser/run-output.ts +76 -0
- package/src/tools/browser/tab-worker.ts +264 -129
- package/src/tools/glob.ts +20 -6
- package/src/tools/index.ts +1 -0
- package/src/tools/read.ts +17 -9
- package/src/tools/renderers.ts +6 -0
- package/src/tools/vibe.ts +608 -0
- package/src/tools/write.ts +15 -2
- package/src/utils/changelog.ts +106 -9
- package/src/utils/git.ts +0 -1
- package/src/utils/title-generator.ts +70 -7
- package/src/vibe/runtime.ts +710 -0
- package/src/vibe/state.ts +4 -0
- package/src/web/search/index.ts +14 -6
- package/src/web/search/provider.ts +37 -1
- package/src/web/search/providers/bing.ts +197 -0
- package/src/web/search/providers/browser-headers.ts +92 -0
- package/src/web/search/providers/browser-page.ts +123 -0
- package/src/web/search/providers/duckduckgo.ts +13 -34
- package/src/web/search/providers/ecosia.ts +178 -0
- package/src/web/search/providers/google.ts +193 -0
- package/src/web/search/providers/mojeek.ts +206 -0
- package/src/web/search/providers/public.ts +201 -0
- package/src/web/search/providers/startpage.ts +213 -0
- package/src/web/search/providers/yahoo.ts +179 -0
- package/src/web/search/types.ts +35 -0
- package/dist/types/extensibility/plugins/legacy-pi-bundled-keys.d.ts +0 -10
- package/dist/types/extensibility/plugins/legacy-pi-bundled-registry.d.ts +0 -10
- package/scripts/generate-legacy-pi-bundled-registry.ts +0 -420
- package/src/extensibility/plugins/legacy-pi-bundled-keys.ts +0 -1011
- package/src/extensibility/plugins/legacy-pi-bundled-registry.ts +0 -3430
- package/src/internal-urls/docs-index.generated.txt +0 -2
- package/src/prompts/agents/plan.md +0 -47
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
* with an optional `:level` thinking suffix (e.g. `x-ai/grok-code-fast:high`),
|
|
4
4
|
* resolved exactly like any other model override; `tools` is a subset of
|
|
5
5
|
* `BUILTIN_TOOL_NAMES` — any built-in name, including mutating tools such as
|
|
6
|
-
* `edit`/`write`/`bash` (the advisor is a full agent). Omitted
|
|
7
|
-
*
|
|
8
|
-
* advisor's specialization, appended to the shared
|
|
6
|
+
* `edit`/`write`/`bash` (the advisor is a full agent). Omitted falls back to
|
|
7
|
+
* the default `read`/`grep`/`glob` subset; an explicit empty list grants no
|
|
8
|
+
* tools. `instructions` is the advisor's specialization, appended to the shared
|
|
9
|
+
* baseline.
|
|
9
10
|
*/
|
|
10
11
|
export interface AdvisorConfig {
|
|
11
12
|
name: string;
|
|
@@ -20,6 +20,7 @@ export interface CommitAgentInput {
|
|
|
20
20
|
requireChangelog: boolean;
|
|
21
21
|
diffText?: string;
|
|
22
22
|
existingChangelogEntries?: ExistingChangelogEntries[];
|
|
23
|
+
onComplete?: (state: CommitAgentState) => Promise<void> | void;
|
|
23
24
|
}
|
|
24
25
|
export interface ExistingChangelogEntries {
|
|
25
26
|
path: string;
|
|
@@ -4569,10 +4569,38 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4569
4569
|
readonly value: "searxng";
|
|
4570
4570
|
readonly label: "SearXNG";
|
|
4571
4571
|
readonly description: "Requires SEARXNG_ENDPOINT or searxng.endpoint";
|
|
4572
|
+
}, {
|
|
4573
|
+
readonly value: "startpage";
|
|
4574
|
+
readonly label: "Startpage";
|
|
4575
|
+
readonly description: "Credential-free scrape of Startpage (Google-backed) results; may be bot-challenged";
|
|
4572
4576
|
}, {
|
|
4573
4577
|
readonly value: "duckduckgo";
|
|
4574
4578
|
readonly label: "DuckDuckGo";
|
|
4575
4579
|
readonly description: "Credential-free best-effort fallback; may be bot-challenged on datacenter/shared-egress IPs";
|
|
4580
|
+
}, {
|
|
4581
|
+
readonly value: "bing";
|
|
4582
|
+
readonly label: "Bing";
|
|
4583
|
+
readonly description: "Credential-free HTML scrape of Bing results; may be bot-challenged";
|
|
4584
|
+
}, {
|
|
4585
|
+
readonly value: "yahoo";
|
|
4586
|
+
readonly label: "Yahoo";
|
|
4587
|
+
readonly description: "Credential-free HTML scrape of Yahoo (Bing-backed) results";
|
|
4588
|
+
}, {
|
|
4589
|
+
readonly value: "ecosia";
|
|
4590
|
+
readonly label: "Ecosia";
|
|
4591
|
+
readonly description: "Credential-free browser-backed scrape of Ecosia (Google-backed) results";
|
|
4592
|
+
}, {
|
|
4593
|
+
readonly value: "google";
|
|
4594
|
+
readonly label: "Google";
|
|
4595
|
+
readonly description: "Credential-free browser-backed fallback; slower and may be bot-challenged";
|
|
4596
|
+
}, {
|
|
4597
|
+
readonly value: "mojeek";
|
|
4598
|
+
readonly label: "Mojeek";
|
|
4599
|
+
readonly description: "Credential-free browser-backed scrape of Mojeek's independent index";
|
|
4600
|
+
}, {
|
|
4601
|
+
readonly value: "public";
|
|
4602
|
+
readonly label: "Public Web";
|
|
4603
|
+
readonly description: "Queries every credential-free engine in parallel and consolidates deduplicated results";
|
|
4576
4604
|
}];
|
|
4577
4605
|
};
|
|
4578
4606
|
};
|
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
import * as path from "node:path";
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
export declare function __synthesizeLegacyPiBundledSourceWithRegistry(registryKey: string, registry: Readonly<Record<string, Readonly<Record<string, unknown>>>>): string;
|
|
8
|
-
/**
|
|
9
|
-
* Test seam: returns the globalThis key the synthetic loader reads from. Tests
|
|
10
|
-
* assert that the emitted source addresses the exact stash key the install
|
|
11
|
-
* function writes to, so a rename can't break extension loads silently.
|
|
12
|
-
*/
|
|
13
|
-
export declare function __getLegacyPiBundledRegistryGlobal(): string;
|
|
2
|
+
/** Test seam for the virtual module's named/default export forwarding. */
|
|
3
|
+
export declare function __synthesizeLegacyPiBundledSourceWithModules(moduleKey: string, modules: Readonly<Record<string, Readonly<Record<string, unknown>>>>): string;
|
|
4
|
+
/** Test seam for the global bridge key shared with synthetic module source. */
|
|
5
|
+
export declare function __getLegacyPiBundledModulesGlobal(): string;
|
|
14
6
|
/**
|
|
15
7
|
* Compute the package root for the npm prebuilt `dist/cli.js` bundle.
|
|
16
8
|
*
|
|
@@ -42,8 +34,8 @@ export declare function __resolveTypeBoxShimPath(isCompiled: boolean, sourcePath
|
|
|
42
34
|
/**
|
|
43
35
|
* Drop overrides whose filesystem targets are missing so they can fall
|
|
44
36
|
* through to the canonical-resolution path. Virtual `omp-legacy-pi-bundled:`
|
|
45
|
-
* entries always pass —
|
|
46
|
-
* compiled
|
|
37
|
+
* entries always pass — live bundled module references are the source of truth
|
|
38
|
+
* in compiled mode where bunfs paths are unreachable (issue #3423).
|
|
47
39
|
*
|
|
48
40
|
* `pathExistsSync` defaults to `fs.existsSync`; tests inject a stub to
|
|
49
41
|
* simulate the missing-entrypoint failure mode without touching the real FS.
|
|
@@ -52,15 +44,11 @@ export declare function __validateLegacyPiPackageRootOverrides(candidates: Recor
|
|
|
52
44
|
/**
|
|
53
45
|
* Compute the override map keyed by every canonical specifier the host serves
|
|
54
46
|
* directly: the pi-ai / pi-coding-agent roots (compat shims that re-attach
|
|
55
|
-
* legacy helpers) plus, in compiled
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* `@(scope)/pi-ai/oauth` and friends from falling through to the extension's
|
|
59
|
-
* own — possibly absent — peer install when bunfs filesystem walks fail
|
|
60
|
-
* (issue #3442 follow-up to #3423). Exported as a test seam so the
|
|
61
|
-
* compiled-binary branch is verifiable from dev tests.
|
|
47
|
+
* legacy helpers) plus, in compiled mode, every build-supplied module key.
|
|
48
|
+
* Subpath coverage stops `@(scope)/pi-ai/oauth` and friends from falling
|
|
49
|
+
* through to the extension's absent peer install when bunfs walks fail.
|
|
62
50
|
*/
|
|
63
|
-
export declare function __buildLegacyPiPackageRootOverrides(isCompiled: boolean): Record<string, string>;
|
|
51
|
+
export declare function __buildLegacyPiPackageRootOverrides(isCompiled: boolean, bundledModuleKeys?: Iterable<string>): Record<string, string>;
|
|
64
52
|
/** Test seam for compiled-binary legacy extension source rewriting. */
|
|
65
53
|
export declare function __rewriteLegacyExtensionSourceForTests(source: string, importerPath: string, mtimeTag?: string | null): Promise<string>;
|
|
66
54
|
/**
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ToolSession } from "../tools/index.js";
|
|
2
|
+
import type { WritethroughDeferredHandle } from "./index.js";
|
|
3
|
+
/** Coordinates late LSP diagnostics for one mutation tool instance. */
|
|
4
|
+
export declare class DeferredDiagnostics {
|
|
5
|
+
#private;
|
|
6
|
+
private readonly session;
|
|
7
|
+
private readonly deduplicate;
|
|
8
|
+
constructor(session: ToolSession, deduplicate: boolean);
|
|
9
|
+
/** Begin a file mutation and return the handle consumed by LSP writethrough. */
|
|
10
|
+
begin(path: string): WritethroughDeferredHandle;
|
|
11
|
+
}
|
|
@@ -18,6 +18,6 @@ export declare class MoveOverlay implements Component, Focusable {
|
|
|
18
18
|
get focused(): boolean;
|
|
19
19
|
set focused(value: boolean);
|
|
20
20
|
handleInput(data: string): void;
|
|
21
|
-
render(
|
|
21
|
+
render(width: number): readonly string[];
|
|
22
22
|
invalidate(): void;
|
|
23
23
|
}
|
|
@@ -62,6 +62,9 @@ export declare class StatusLineComponent implements Component {
|
|
|
62
62
|
enabled: boolean;
|
|
63
63
|
paused: boolean;
|
|
64
64
|
} | undefined): void;
|
|
65
|
+
setVibeModeStatus(status: {
|
|
66
|
+
enabled: boolean;
|
|
67
|
+
} | undefined): void;
|
|
65
68
|
setCollabStatus(status: CollabStatus | null): void;
|
|
66
69
|
setHookStatus(key: string, text: string | undefined): void;
|
|
67
70
|
watchBranch(onBranchChange: () => void): void;
|
|
@@ -105,6 +105,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
105
105
|
planModePaused: boolean;
|
|
106
106
|
goalModeEnabled: boolean;
|
|
107
107
|
goalModePaused: boolean;
|
|
108
|
+
vibeModeEnabled: boolean;
|
|
108
109
|
planModePlanFilePath: string | undefined;
|
|
109
110
|
loopModeEnabled: boolean;
|
|
110
111
|
loopPrompt: string | undefined;
|
|
@@ -243,6 +244,13 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
243
244
|
slider?: HookSelectorSlider;
|
|
244
245
|
}): Promise<string | undefined>;
|
|
245
246
|
handlePlanModeCommand(initialPrompt?: string): Promise<void>;
|
|
247
|
+
/**
|
|
248
|
+
* `/vibe` toggle. Entering installs the ephemeral vibe tools, strips the
|
|
249
|
+
* active toolset down to `read` plus those tools, and injects the director
|
|
250
|
+
* context. Exiting unregisters them, restores the previous toolset, and kills
|
|
251
|
+
* every worker session so workers cannot outlive the mode that directs them.
|
|
252
|
+
*/
|
|
253
|
+
handleVibeModeCommand(initialPrompt?: string): Promise<void>;
|
|
246
254
|
handleGoalModeCommand(rest?: string): Promise<void>;
|
|
247
255
|
handleGuidedGoalCommand(rest?: string): Promise<void>;
|
|
248
256
|
/** Manually (re-)open the plan-review overlay — bound to `/plan-review`. Lets
|
|
@@ -133,6 +133,7 @@ export interface InteractiveModeContext {
|
|
|
133
133
|
toolOutputExpanded: boolean;
|
|
134
134
|
todoExpanded: boolean;
|
|
135
135
|
planModeEnabled: boolean;
|
|
136
|
+
vibeModeEnabled: boolean;
|
|
136
137
|
goalModeEnabled: boolean;
|
|
137
138
|
goalModePaused: boolean;
|
|
138
139
|
loopModeEnabled: boolean;
|
|
@@ -369,6 +370,7 @@ export interface InteractiveModeContext {
|
|
|
369
370
|
openExternalEditor(): void;
|
|
370
371
|
registerExtensionShortcuts(): void;
|
|
371
372
|
handlePlanModeCommand(initialPrompt?: string): Promise<void>;
|
|
373
|
+
handleVibeModeCommand(initialPrompt?: string): Promise<void>;
|
|
372
374
|
handleGoalModeCommand(rest?: string): Promise<void>;
|
|
373
375
|
handleGuidedGoalCommand(rest?: string): Promise<void>;
|
|
374
376
|
handleLoopCommand(args?: string): Promise<string | undefined>;
|
|
@@ -47,6 +47,7 @@ import { type ConfiguredThinkingLevel } from "../thinking.js";
|
|
|
47
47
|
import { type DiscoverableTool, type DiscoverableToolSearchIndex } from "../tool-discovery/tool-index.js";
|
|
48
48
|
import type { CheckpointState, CompletedRewindState } from "../tools/checkpoint.js";
|
|
49
49
|
import { type TodoItem, type TodoPhase } from "../tools/todo.js";
|
|
50
|
+
import type { VibeModeState } from "../vibe/state.js";
|
|
50
51
|
import type { ClientBridge } from "./client-bridge.js";
|
|
51
52
|
import { type CustomMessage, type CustomMessagePayload } from "./messages.js";
|
|
52
53
|
import type { BuildSessionContextOptions, SessionContext } from "./session-context.js";
|
|
@@ -182,6 +183,8 @@ export interface AgentSessionConfig {
|
|
|
182
183
|
modelRegistry: ModelRegistry;
|
|
183
184
|
/** Tool registry for LSP and settings */
|
|
184
185
|
toolRegistry?: Map<string, AgentTool>;
|
|
186
|
+
/** Creates the tools registered only while `/vibe` mode is active. */
|
|
187
|
+
createVibeTools?: () => AgentTool[];
|
|
185
188
|
/** Tool names whose current registry entry is still the built-in implementation. */
|
|
186
189
|
builtInToolNames?: Iterable<string>;
|
|
187
190
|
/** Update tool-session predicates that render guidance from the live active tool set. */
|
|
@@ -624,6 +627,14 @@ export declare class AgentSession {
|
|
|
624
627
|
* Get all configured tool names (built-in via --tools or default, plus custom tools).
|
|
625
628
|
*/
|
|
626
629
|
getAllToolNames(): string[];
|
|
630
|
+
/**
|
|
631
|
+
* Registers the ephemeral vibe tools and activates them alongside `baseToolNames`.
|
|
632
|
+
*
|
|
633
|
+
* @throws When this session cannot create vibe tools or the factory returns duplicate names.
|
|
634
|
+
*/
|
|
635
|
+
activateVibeTools(baseToolNames: string[]): Promise<void>;
|
|
636
|
+
/** Removes tools installed by {@link activateVibeTools} and activates `nextToolNames`. */
|
|
637
|
+
deactivateVibeTools(nextToolNames: string[]): Promise<void>;
|
|
627
638
|
isMCPDiscoveryEnabled(): boolean;
|
|
628
639
|
/**
|
|
629
640
|
* Flip MCP discovery on after deferred discovery learns the real tool count.
|
|
@@ -728,6 +739,8 @@ export declare class AgentSession {
|
|
|
728
739
|
setPlanModeState(state: PlanModeState | undefined): void;
|
|
729
740
|
getGoalModeState(): GoalModeState | undefined;
|
|
730
741
|
setGoalModeState(state: GoalModeState | undefined): void;
|
|
742
|
+
getVibeModeState(): VibeModeState | undefined;
|
|
743
|
+
setVibeModeState(state: VibeModeState | undefined): void;
|
|
731
744
|
get goalRuntime(): GoalRuntime;
|
|
732
745
|
markPlanReferenceSent(): void;
|
|
733
746
|
setPlanReferencePath(path: string): void;
|
|
@@ -746,6 +759,9 @@ export declare class AgentSession {
|
|
|
746
759
|
sendGoalModeContext(options?: {
|
|
747
760
|
deliverAs?: "steer" | "followUp" | "nextTurn";
|
|
748
761
|
}): Promise<void>;
|
|
762
|
+
sendVibeModeContext(options?: {
|
|
763
|
+
deliverAs?: "steer" | "followUp" | "nextTurn";
|
|
764
|
+
}): Promise<void>;
|
|
749
765
|
resolveRoleModel(role: string): Model | undefined;
|
|
750
766
|
/**
|
|
751
767
|
* Resolve a role to its model AND thinking level.
|
|
@@ -208,6 +208,37 @@ export declare function finalizeSubagentLifecycle(args: {
|
|
|
208
208
|
agentIdleTtlMs: number;
|
|
209
209
|
reviveSession: (() => Promise<AgentSession>) | null;
|
|
210
210
|
}): Promise<void>;
|
|
211
|
+
/** Options for {@link runSubagentFollowUpTurn}. */
|
|
212
|
+
export interface FollowUpTurnOptions {
|
|
213
|
+
/** Registry id of the (live or parked) subagent to continue. */
|
|
214
|
+
id: string;
|
|
215
|
+
/** Agent definition the session was originally spawned with (drives progress labels + finalize). */
|
|
216
|
+
agent: AgentDefinition;
|
|
217
|
+
/** The follow-up message; sent as the turn's user prompt. */
|
|
218
|
+
message: string;
|
|
219
|
+
index?: number;
|
|
220
|
+
description?: string;
|
|
221
|
+
signal?: AbortSignal;
|
|
222
|
+
onProgress?: (progress: AgentProgress) => void;
|
|
223
|
+
eventBus?: EventBus;
|
|
224
|
+
parentToolCallId?: string;
|
|
225
|
+
/** When set, the turn's raw output is (re)written to `<artifactsDir>/<id>.md` so `agent://<id>` tracks the latest turn. */
|
|
226
|
+
artifactsDir?: string;
|
|
227
|
+
/** Wall-clock cap in ms for this turn; 0 disables. */
|
|
228
|
+
maxRuntimeMs?: number;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Continue a previously spawned (keep-alive) subagent with one more monitored
|
|
232
|
+
* turn: revive it if parked, send `message` as a real prompt, drive it to
|
|
233
|
+
* `yield`, and finalize a {@link SingleResult} exactly like a first run.
|
|
234
|
+
*
|
|
235
|
+
* The session's full conversation history is retained (live session, or JSONL
|
|
236
|
+
* replay through the lifecycle reviver), so the turn sees all prior context.
|
|
237
|
+
* Unlike {@link runSubprocess}, the session is NOT torn down afterwards — it
|
|
238
|
+
* stays adopted by the {@link AgentLifecycleManager} (idle → TTL park →
|
|
239
|
+
* revive), and an aborted turn only aborts the in-flight turn.
|
|
240
|
+
*/
|
|
241
|
+
export declare function runSubagentFollowUpTurn(options: FollowUpTurnOptions): Promise<SingleResult>;
|
|
211
242
|
/**
|
|
212
243
|
* Run a single agent in-process.
|
|
213
244
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import { JsRuntime } from "../../../eval/js/shared/runtime.js";
|
|
|
2
2
|
import type { ToolSession } from "../../index.js";
|
|
3
3
|
import { type AriaSnapshotOptions } from "../aria/aria-snapshot.js";
|
|
4
4
|
import { type ReadableFormat } from "../readable.js";
|
|
5
|
+
import { RunOutput } from "../run-output.js";
|
|
5
6
|
import type { Observation, ReadyInfo, RunResultOk, ScreenshotResult, SessionSnapshot } from "../tab-protocol.js";
|
|
6
7
|
import type { CmuxSocketClient } from "./socket-client.js";
|
|
7
8
|
interface ScreenshotOptions {
|
|
@@ -17,7 +18,7 @@ interface ObserveOptions {
|
|
|
17
18
|
}
|
|
18
19
|
interface RunContext {
|
|
19
20
|
session: SessionSnapshot;
|
|
20
|
-
|
|
21
|
+
output: RunOutput;
|
|
21
22
|
screenshots: ScreenshotResult[];
|
|
22
23
|
signal: AbortSignal;
|
|
23
24
|
timeoutMs: number;
|
|
@@ -142,6 +143,7 @@ declare class CmuxElementHandle {
|
|
|
142
143
|
click(): Promise<void>;
|
|
143
144
|
type(text: string): Promise<void>;
|
|
144
145
|
fill(value: string): Promise<void>;
|
|
146
|
+
press(key: string): Promise<void>;
|
|
145
147
|
focus(): Promise<void>;
|
|
146
148
|
hover(): Promise<void>;
|
|
147
149
|
evaluate<TResult, TArgs extends unknown[]>(fn: (element: unknown, ...args: TArgs) => TResult | Promise<TResult>, ...args: TArgs): Promise<TResult>;
|
|
@@ -62,6 +62,26 @@ export interface CmuxGeometry {
|
|
|
62
62
|
export declare const GEOMETRY_SCRIPT = "(() => ({ innerWidth: window.innerWidth, innerHeight: window.innerHeight, dpr: window.devicePixelRatio||1, scrollX: window.scrollX, scrollY: window.scrollY, scrollWidth: document.documentElement.scrollWidth, scrollHeight: document.documentElement.scrollHeight }))()";
|
|
63
63
|
export declare function cmuxSnapshotToObservation(result: CmuxSnapshotResult, viewport: Observation["viewport"], geometry: CmuxGeometry): Observation;
|
|
64
64
|
export declare function serializeEval(fn: string | ((...args: unknown[]) => unknown), args: unknown[]): string;
|
|
65
|
+
/**
|
|
66
|
+
* Like {@link serializeEval}, but wraps the expression in a page-side
|
|
67
|
+
* try/catch envelope so a throwing script surfaces its message + stack
|
|
68
|
+
* instead of the daemon's opaque `js_error: A JavaScript exception occurred`,
|
|
69
|
+
* and a Promise return (which the daemon cannot serialize) is flagged
|
|
70
|
+
* explicitly rather than failing as "unsupported type".
|
|
71
|
+
*
|
|
72
|
+
* String scripts run through indirect eval to keep global-scope semantics;
|
|
73
|
+
* function sources are already expressions and are invoked directly.
|
|
74
|
+
* `undefined` results come back as `null` (JSON cannot carry `undefined`).
|
|
75
|
+
* Decode with {@link unwrapEvalEnvelope}.
|
|
76
|
+
*/
|
|
77
|
+
export declare function serializeEvalWithEnvelope(fn: string | ((...args: unknown[]) => unknown), args: unknown[]): string;
|
|
78
|
+
/**
|
|
79
|
+
* Decode a {@link serializeEvalWithEnvelope} result: rethrow page-side
|
|
80
|
+
* exceptions as rich {@link ToolError}s, reject unserializable Promise
|
|
81
|
+
* returns with an actionable message, and pass through values from daemons
|
|
82
|
+
* that did not run the wrapper.
|
|
83
|
+
*/
|
|
84
|
+
export declare function unwrapEvalEnvelope<TResult>(value: unknown, label: string): TResult;
|
|
65
85
|
export declare function mapWaitUntil(waitUntil: string | undefined): "interactive" | "complete";
|
|
66
86
|
export interface ResolveCmuxKindOptions {
|
|
67
87
|
surface?: string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ImageContent, TextContent } from "@oh-my-pi/pi-ai";
|
|
2
|
+
import type { JsDisplayOutput } from "../../eval/js/shared/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Accumulates a browser run's result entries: explicit `display()` payloads,
|
|
5
|
+
* screenshot captions/images, and buffered stream text (`console.*`, `print`,
|
|
6
|
+
* `display()` of strings/primitives — `JsRuntime.displayValue` emits those via
|
|
7
|
+
* `onText`). Stream text is buffered and flushed as one entry before the next
|
|
8
|
+
* display/screenshot (and on `finish()`) so it reaches the tool result in
|
|
9
|
+
* order instead of vanishing into the debug log.
|
|
10
|
+
*/
|
|
11
|
+
export declare class RunOutput {
|
|
12
|
+
#private;
|
|
13
|
+
/** Buffer a stream-text chunk; it joins the entries at the next push or on finish(). */
|
|
14
|
+
pushText(chunk: string): void;
|
|
15
|
+
/** Append a `display()` payload (image/json/status), flushing buffered text first. */
|
|
16
|
+
pushDisplay(output: JsDisplayOutput): void;
|
|
17
|
+
/** Append a pre-built entry (e.g. a screenshot caption/image), flushing buffered text first. */
|
|
18
|
+
push(entry: TextContent | ImageContent): void;
|
|
19
|
+
/** Flush any remaining stream text and return the ordered entries. */
|
|
20
|
+
finish(): Array<TextContent | ImageContent>;
|
|
21
|
+
}
|
|
22
|
+
/** JSON.stringify that never throws (cycles/BigInt → String(value)). */
|
|
23
|
+
export declare function safeJsonStringify(value: unknown): string;
|
|
24
|
+
/** Pass a return value across the run boundary: structured-cloneable as-is, else JSON round-trip, else String. */
|
|
25
|
+
export declare function cloneSafe(value: unknown): unknown;
|
|
@@ -37,6 +37,22 @@ interface ScreenshotOptions {
|
|
|
37
37
|
silent?: boolean;
|
|
38
38
|
}
|
|
39
39
|
export declare function normalizeSelector(selector: string): string;
|
|
40
|
+
/** ElementHandle enriched with the `fill()` the tool docs promise on handles from `tab.id()`/`tab.ref()`/`tab.waitFor()`. */
|
|
41
|
+
export type ActionableHandle = ElementHandle & {
|
|
42
|
+
fill(value: string): Promise<void>;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Attach `fill()` to a puppeteer ElementHandle before handing it to user code.
|
|
46
|
+
* Puppeteer handles expose `type()` but no `fill()`; the semantics mirror the
|
|
47
|
+
* selector-based `tab.fill()`: focus, clear any existing value, then type.
|
|
48
|
+
*/
|
|
49
|
+
export declare function toActionableHandle(handle: ElementHandle): ActionableHandle;
|
|
50
|
+
/**
|
|
51
|
+
* Hint appended to a selector op's fail-fast timeout, given the selector's current
|
|
52
|
+
* match count: a missing element (consent wall, wrong page) reads differently from
|
|
53
|
+
* a present-but-unactionable one.
|
|
54
|
+
*/
|
|
55
|
+
export declare function formatSelectorMatchHint(count: number): string;
|
|
40
56
|
export interface InflightOp {
|
|
41
57
|
label: string;
|
|
42
58
|
startedAt: number;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vibe mode tools — the director's entire non-read surface.
|
|
3
|
+
*
|
|
4
|
+
* Five thin tools over {@link VibeSessionRegistry}: spawn/send/wait/kill/list
|
|
5
|
+
* persistent worker sessions ("fast"/"good" CLIs). Spawns and sends return
|
|
6
|
+
* immediately; turn results self-deliver through the async job manager.
|
|
7
|
+
*
|
|
8
|
+
* The TUI renderers lean into the "you are driving little CLIs" fiction:
|
|
9
|
+
* spawn/send draw a mini composer (a message typed into a tiny Claude-Code-like
|
|
10
|
+
* terminal), and wait/list draw the "TV wall" — one live screen per worker,
|
|
11
|
+
* stacked, each showing its tool calls and streamed text as it works.
|
|
12
|
+
*/
|
|
13
|
+
import type { AgentTool, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
14
|
+
import type { Component } from "@oh-my-pi/pi-tui";
|
|
15
|
+
import type { RenderResultOptions } from "../extensibility/custom-tools/types.js";
|
|
16
|
+
import type { Theme } from "../modes/theme/theme.js";
|
|
17
|
+
import { type VibeCli, type VibeKillOutcome, type VibeScreenSnapshot, type VibeSendOutcome } from "../vibe/runtime.js";
|
|
18
|
+
import type { Tool, ToolSession } from "./index.js";
|
|
19
|
+
export declare const VIBE_TOOL_NAMES: readonly ["vibe_spawn", "vibe_send", "vibe_wait", "vibe_kill", "vibe_list"];
|
|
20
|
+
declare const vibeSpawnSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
21
|
+
cli: "fast" | "good";
|
|
22
|
+
name?: string | undefined;
|
|
23
|
+
prompt: string;
|
|
24
|
+
}, {}>;
|
|
25
|
+
declare const vibeSendSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
26
|
+
session: string;
|
|
27
|
+
message: string;
|
|
28
|
+
}, {}>;
|
|
29
|
+
declare const vibeWaitSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
30
|
+
sessions?: string[] | undefined;
|
|
31
|
+
timeout?: number | undefined;
|
|
32
|
+
}, {}>;
|
|
33
|
+
declare const vibeKillSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
34
|
+
session: string;
|
|
35
|
+
}, {}>;
|
|
36
|
+
declare const vibeListSchema: import("arktype/internal/variants/object.ts").ObjectType<object, {}>;
|
|
37
|
+
type VibeOp = "spawn" | "send" | "wait" | "kill" | "list";
|
|
38
|
+
/** Details payload shared by every vibe tool for TUI rendering. */
|
|
39
|
+
export interface VibeToolDetails {
|
|
40
|
+
op: VibeOp;
|
|
41
|
+
/** Live TV-wall snapshot of the owner's worker sessions at (or during) the call. */
|
|
42
|
+
screens: VibeScreenSnapshot[];
|
|
43
|
+
spawned?: {
|
|
44
|
+
id: string;
|
|
45
|
+
cli: VibeCli;
|
|
46
|
+
jobId: string;
|
|
47
|
+
};
|
|
48
|
+
send?: VibeSendOutcome;
|
|
49
|
+
wait?: {
|
|
50
|
+
settled: Array<{
|
|
51
|
+
id: string;
|
|
52
|
+
jobId: string;
|
|
53
|
+
status: "completed" | "failed" | "cancelled";
|
|
54
|
+
}>;
|
|
55
|
+
stillRunning: string[];
|
|
56
|
+
timedOut: boolean;
|
|
57
|
+
/** True on interim progress emissions while the wait is still blocking. */
|
|
58
|
+
waiting?: boolean;
|
|
59
|
+
};
|
|
60
|
+
killed?: VibeKillOutcome;
|
|
61
|
+
}
|
|
62
|
+
export declare class VibeSpawnTool implements AgentTool<typeof vibeSpawnSchema, VibeToolDetails> {
|
|
63
|
+
private readonly session;
|
|
64
|
+
readonly name = "vibe_spawn";
|
|
65
|
+
readonly approval: "exec";
|
|
66
|
+
readonly label = "Vibe Spawn";
|
|
67
|
+
readonly summary = "Start a persistent fast/good worker session";
|
|
68
|
+
readonly description: string;
|
|
69
|
+
readonly parameters: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
70
|
+
cli: "fast" | "good";
|
|
71
|
+
name?: string | undefined;
|
|
72
|
+
prompt: string;
|
|
73
|
+
}, {}>;
|
|
74
|
+
readonly strict = true;
|
|
75
|
+
constructor(session: ToolSession);
|
|
76
|
+
execute(_toolCallId: string, params: typeof vibeSpawnSchema.infer): Promise<AgentToolResult<VibeToolDetails>>;
|
|
77
|
+
}
|
|
78
|
+
export declare class VibeSendTool implements AgentTool<typeof vibeSendSchema, VibeToolDetails> {
|
|
79
|
+
private readonly session;
|
|
80
|
+
readonly name = "vibe_send";
|
|
81
|
+
readonly approval: "exec";
|
|
82
|
+
readonly label = "Vibe Send";
|
|
83
|
+
readonly summary = "Message a worker session (steer or next turn)";
|
|
84
|
+
readonly description: string;
|
|
85
|
+
readonly parameters: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
86
|
+
session: string;
|
|
87
|
+
message: string;
|
|
88
|
+
}, {}>;
|
|
89
|
+
readonly strict = true;
|
|
90
|
+
constructor(session: ToolSession);
|
|
91
|
+
execute(_toolCallId: string, params: typeof vibeSendSchema.infer): Promise<AgentToolResult<VibeToolDetails>>;
|
|
92
|
+
}
|
|
93
|
+
export declare class VibeWaitTool implements AgentTool<typeof vibeWaitSchema, VibeToolDetails> {
|
|
94
|
+
private readonly session;
|
|
95
|
+
readonly name = "vibe_wait";
|
|
96
|
+
readonly approval: "read";
|
|
97
|
+
readonly label = "Vibe Wait";
|
|
98
|
+
readonly summary = "Block until a worker session finishes its turn";
|
|
99
|
+
readonly description: string;
|
|
100
|
+
readonly parameters: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
101
|
+
sessions?: string[] | undefined;
|
|
102
|
+
timeout?: number | undefined;
|
|
103
|
+
}, {}>;
|
|
104
|
+
readonly strict = true;
|
|
105
|
+
readonly interruptible = true;
|
|
106
|
+
constructor(session: ToolSession);
|
|
107
|
+
execute(_toolCallId: string, params: typeof vibeWaitSchema.infer, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<VibeToolDetails>): Promise<AgentToolResult<VibeToolDetails>>;
|
|
108
|
+
}
|
|
109
|
+
export declare class VibeKillTool implements AgentTool<typeof vibeKillSchema, VibeToolDetails> {
|
|
110
|
+
private readonly session;
|
|
111
|
+
readonly name = "vibe_kill";
|
|
112
|
+
readonly approval: "read";
|
|
113
|
+
readonly label = "Vibe Kill";
|
|
114
|
+
readonly summary = "Terminate a worker session";
|
|
115
|
+
readonly description: string;
|
|
116
|
+
readonly parameters: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
117
|
+
session: string;
|
|
118
|
+
}, {}>;
|
|
119
|
+
readonly strict = true;
|
|
120
|
+
constructor(session: ToolSession);
|
|
121
|
+
execute(_toolCallId: string, params: typeof vibeKillSchema.infer): Promise<AgentToolResult<VibeToolDetails>>;
|
|
122
|
+
}
|
|
123
|
+
export declare class VibeListTool implements AgentTool<typeof vibeListSchema, VibeToolDetails> {
|
|
124
|
+
private readonly session;
|
|
125
|
+
readonly name = "vibe_list";
|
|
126
|
+
readonly approval: "read";
|
|
127
|
+
readonly label = "Vibe List";
|
|
128
|
+
readonly summary = "List worker sessions and their states";
|
|
129
|
+
readonly description: string;
|
|
130
|
+
readonly parameters: import("arktype/internal/variants/object.ts").ObjectType<object, {}>;
|
|
131
|
+
readonly strict = true;
|
|
132
|
+
constructor(session: ToolSession);
|
|
133
|
+
execute(): Promise<AgentToolResult<VibeToolDetails>>;
|
|
134
|
+
}
|
|
135
|
+
/** Creates the ephemeral tools installed while `/vibe` mode is active. */
|
|
136
|
+
export declare function createVibeTools(session: ToolSession): Tool[];
|
|
137
|
+
interface VibeRenderArgs {
|
|
138
|
+
cli?: VibeCli;
|
|
139
|
+
prompt?: string;
|
|
140
|
+
name?: string;
|
|
141
|
+
session?: string;
|
|
142
|
+
message?: string;
|
|
143
|
+
sessions?: string[];
|
|
144
|
+
}
|
|
145
|
+
/** Build the shared vibe renderer for one tool name. */
|
|
146
|
+
export declare function createVibeToolRenderer(op: VibeOp): {
|
|
147
|
+
inline: boolean;
|
|
148
|
+
mergeCallAndResult: boolean;
|
|
149
|
+
animatedPendingPreview: boolean;
|
|
150
|
+
animatedPartialResult: boolean;
|
|
151
|
+
renderCall(args: VibeRenderArgs, options: RenderResultOptions, uiTheme: Theme): Component;
|
|
152
|
+
renderResult(result: {
|
|
153
|
+
content: Array<{
|
|
154
|
+
type: string;
|
|
155
|
+
text?: string;
|
|
156
|
+
}>;
|
|
157
|
+
details?: VibeToolDetails;
|
|
158
|
+
isError?: boolean;
|
|
159
|
+
}, options: RenderResultOptions, uiTheme: Theme, args?: VibeRenderArgs): Component;
|
|
160
|
+
};
|
|
161
|
+
export {};
|
|
@@ -4,6 +4,24 @@ export interface ChangelogEntry {
|
|
|
4
4
|
patch: number;
|
|
5
5
|
content: string;
|
|
6
6
|
}
|
|
7
|
+
/** Number of changelog releases shown by automatic and default recent views. */
|
|
8
|
+
export declare const RECENT_CHANGELOG_ENTRY_LIMIT = 3;
|
|
9
|
+
/** Maximum Markdown source bytes allowed in automatic startup release notes. */
|
|
10
|
+
export declare const STARTUP_CHANGELOG_MAX_BYTES: number;
|
|
11
|
+
/** Hint appended when automatic startup release notes are truncated. */
|
|
12
|
+
export declare const STARTUP_CHANGELOG_FULL_HINT = "Use `/changelog full` to view the complete changelog.";
|
|
13
|
+
/** Markdown generated from selected changelog entries and whether it hit a size cap. */
|
|
14
|
+
export interface RenderedChangelog {
|
|
15
|
+
markdown: string;
|
|
16
|
+
truncated: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** Automatic startup changelog decision, including whether the marker should advance. */
|
|
19
|
+
export interface StartupChangelogSelection {
|
|
20
|
+
markdown: string | undefined;
|
|
21
|
+
persistCurrentVersion: boolean;
|
|
22
|
+
truncated: boolean;
|
|
23
|
+
selectedEntries: number;
|
|
24
|
+
}
|
|
7
25
|
/**
|
|
8
26
|
* Parse changelog entries from the file at `changelogPath`. Scans for `## [x.y.z]`
|
|
9
27
|
* headings and collects each block until the next heading or EOF.
|
|
@@ -19,9 +37,25 @@ export declare function parseChangelog(changelogPath: string | undefined): Promi
|
|
|
19
37
|
*/
|
|
20
38
|
export declare function compareVersions(v1: ChangelogEntry, v2: ChangelogEntry): number;
|
|
21
39
|
/**
|
|
22
|
-
*
|
|
40
|
+
* Parse an omp changelog marker version into comparable parts.
|
|
41
|
+
*/
|
|
42
|
+
export declare function parseChangelogVersion(version: string | undefined): ChangelogEntry | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Get entries newer than lastVersion.
|
|
23
45
|
*/
|
|
24
46
|
export declare function getNewEntries(entries: ChangelogEntry[], lastVersion: string): ChangelogEntry[];
|
|
47
|
+
/**
|
|
48
|
+
* Render changelog entries oldest-first by default and optionally cap the Markdown source size.
|
|
49
|
+
*/
|
|
50
|
+
export declare function renderChangelogEntries(entries: ChangelogEntry[], options?: {
|
|
51
|
+
maxBytes?: number;
|
|
52
|
+
truncationHint?: string;
|
|
53
|
+
oldestFirst?: boolean;
|
|
54
|
+
}): RenderedChangelog;
|
|
55
|
+
/**
|
|
56
|
+
* Select bounded release notes for interactive startup.
|
|
57
|
+
*/
|
|
58
|
+
export declare function selectStartupChangelog(entries: ChangelogEntry[], lastVersion: string | undefined, currentVersion: string): StartupChangelogSelection;
|
|
25
59
|
export { getChangelogPath } from "../config.js";
|
|
26
60
|
/**
|
|
27
61
|
* Last omp version whose changelog the user has seen. Stored as a plain-text
|