@oh-my-pi/pi-coding-agent 15.13.3 → 16.0.0
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 +40 -0
- package/dist/cli.js +506 -443
- package/dist/types/advisor/__tests__/advisor.test.d.ts +1 -0
- package/dist/types/advisor/advise-tool.d.ts +58 -0
- package/dist/types/advisor/index.d.ts +3 -0
- package/dist/types/advisor/runtime.d.ts +52 -0
- package/dist/types/advisor/watchdog.d.ts +5 -0
- package/dist/types/config/model-roles.d.ts +1 -1
- package/dist/types/config/settings-schema.d.ts +44 -5
- package/dist/types/modes/components/advisor-message.d.ts +9 -0
- package/dist/types/modes/components/assistant-message.d.ts +1 -0
- package/dist/types/modes/controllers/command-controller.d.ts +3 -1
- package/dist/types/modes/interactive-mode.d.ts +3 -1
- package/dist/types/modes/types.d.ts +3 -1
- package/dist/types/sdk.d.ts +3 -3
- package/dist/types/session/agent-session.d.ts +71 -2
- package/dist/types/session/session-history-format.d.ts +4 -0
- package/dist/types/session/yield-queue.d.ts +2 -0
- package/dist/types/tools/path-utils.d.ts +1 -0
- package/dist/types/tools/report-tool-issue.d.ts +0 -1
- package/package.json +13 -13
- package/src/advisor/__tests__/advisor.test.ts +586 -0
- package/src/advisor/advise-tool.ts +87 -0
- package/src/advisor/index.ts +3 -0
- package/src/advisor/runtime.ts +248 -0
- package/src/advisor/watchdog.ts +83 -0
- package/src/config/model-roles.ts +13 -1
- package/src/config/settings-schema.ts +42 -5
- package/src/internal-urls/docs-index.generated.ts +6 -5
- package/src/main.ts +4 -0
- package/src/modes/components/advisor-message.ts +99 -0
- package/src/modes/components/agent-hub.ts +7 -0
- package/src/modes/components/assistant-message.ts +86 -0
- package/src/modes/components/status-line/segments.ts +20 -7
- package/src/modes/controllers/command-controller.ts +69 -2
- package/src/modes/interactive-mode.ts +12 -2
- package/src/modes/types.ts +3 -1
- package/src/modes/utils/ui-helpers.ts +9 -0
- package/src/prompts/advisor/advise-tool.md +1 -0
- package/src/prompts/advisor/system.md +31 -0
- package/src/sdk.ts +52 -13
- package/src/session/agent-session.ts +560 -13
- package/src/session/session-dump-format.ts +15 -131
- package/src/session/session-history-format.ts +30 -11
- package/src/session/yield-queue.ts +5 -1
- package/src/slash-commands/builtin-registry.ts +102 -4
- package/src/system-prompt.ts +1 -1
- package/src/tools/path-utils.ts +33 -2
- package/src/tools/report-tool-issue.ts +2 -7
- package/src/web/scrapers/docs-rs.ts +2 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
|
+
declare const adviseSchema: z.ZodObject<{
|
|
4
|
+
note: z.ZodString;
|
|
5
|
+
severity: z.ZodOptional<z.ZodEnum<{
|
|
6
|
+
blocker: "blocker";
|
|
7
|
+
concern: "concern";
|
|
8
|
+
nit: "nit";
|
|
9
|
+
}>>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type AdviseParams = z.infer<typeof adviseSchema>;
|
|
12
|
+
export type AdvisorSeverity = "nit" | "concern" | "blocker";
|
|
13
|
+
export interface AdviseDetails {
|
|
14
|
+
note: string;
|
|
15
|
+
severity?: AdvisorSeverity;
|
|
16
|
+
}
|
|
17
|
+
/** One queued advice note. */
|
|
18
|
+
export interface AdvisorNote {
|
|
19
|
+
note: string;
|
|
20
|
+
severity?: AdvisorSeverity;
|
|
21
|
+
}
|
|
22
|
+
/** Details payload on the batched `advisor` custom message rendered in the transcript. */
|
|
23
|
+
export interface AdvisorMessageDetails {
|
|
24
|
+
notes: AdvisorNote[];
|
|
25
|
+
}
|
|
26
|
+
/** Render one advisor card body from a batch of notes (prefix + one bullet per note). */
|
|
27
|
+
export declare function formatAdvisorBatchContent(notes: readonly AdvisorNote[]): string;
|
|
28
|
+
/**
|
|
29
|
+
* Whether advice at this severity should interrupt the running agent (delivered
|
|
30
|
+
* via the steering channel, aborting in-flight tools) rather than ride the
|
|
31
|
+
* non-interrupting aside queue that lands at the next step boundary. `concern`
|
|
32
|
+
* and `blocker` interrupt; a plain `nit` queues.
|
|
33
|
+
*/
|
|
34
|
+
export declare function isInterruptingSeverity(severity: AdvisorSeverity | undefined): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Side-effect-free investigation tools handed to the advisor agent so it can
|
|
37
|
+
* inspect the workspace before weighing in. Names match the primary session's
|
|
38
|
+
* tool instances, which the advisor reuses.
|
|
39
|
+
*/
|
|
40
|
+
export declare const ADVISOR_READONLY_TOOL_NAMES: ReadonlySet<string>;
|
|
41
|
+
export declare class AdviseTool implements AgentTool<typeof adviseSchema, AdviseDetails> {
|
|
42
|
+
private readonly onAdvice;
|
|
43
|
+
readonly name = "advise";
|
|
44
|
+
readonly label = "Advise";
|
|
45
|
+
readonly description: string;
|
|
46
|
+
readonly parameters: z.ZodObject<{
|
|
47
|
+
note: z.ZodString;
|
|
48
|
+
severity: z.ZodOptional<z.ZodEnum<{
|
|
49
|
+
blocker: "blocker";
|
|
50
|
+
concern: "concern";
|
|
51
|
+
nit: "nit";
|
|
52
|
+
}>>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
readonly intent: "omit";
|
|
55
|
+
constructor(onAdvice: (note: string, severity?: AdviseDetails["severity"]) => void);
|
|
56
|
+
execute(_toolCallId: string, args: AdviseParams, _signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback<AdviseDetails>, _context?: AgentToolContext): Promise<AgentToolResult<AdviseDetails>>;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
2
|
+
/** Minimal slice of `Agent` the runtime drives — satisfied by pi-agent-core `Agent`. */
|
|
3
|
+
export interface AdvisorAgent {
|
|
4
|
+
prompt(input: string): Promise<void>;
|
|
5
|
+
abort(reason?: unknown): void;
|
|
6
|
+
reset(): void;
|
|
7
|
+
readonly state: {
|
|
8
|
+
messages: AgentMessage[];
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface AdvisorRuntimeHost {
|
|
12
|
+
/** Live primary transcript (use `agent.state.messages`). */
|
|
13
|
+
snapshotMessages(): AgentMessage[];
|
|
14
|
+
/** Surface one advice note to the primary (enqueues into the session YieldQueue). */
|
|
15
|
+
enqueueAdvice(note: string, severity?: "nit" | "concern" | "blocker"): void;
|
|
16
|
+
/**
|
|
17
|
+
* Pre-prompt context maintenance for the advisor's own append-only context.
|
|
18
|
+
* Promotes the advisor model to a larger sibling when its context nears the
|
|
19
|
+
* window (mirroring the primary's promote-first policy) and resolves `true`
|
|
20
|
+
* when the advisor should re-prime — reset and replay the current
|
|
21
|
+
* primary-bounded transcript — because promotion did not free enough room.
|
|
22
|
+
* Optional: hosts that omit it get no maintenance (context only shrinks when
|
|
23
|
+
* the primary's next compaction triggers {@link AdvisorRuntime.reset}).
|
|
24
|
+
*/
|
|
25
|
+
maintainContext?(incomingTokens: number): Promise<boolean>;
|
|
26
|
+
}
|
|
27
|
+
export declare class AdvisorRuntime {
|
|
28
|
+
#private;
|
|
29
|
+
private readonly agent;
|
|
30
|
+
private readonly host;
|
|
31
|
+
private readonly retryDelayMs;
|
|
32
|
+
disposed: boolean;
|
|
33
|
+
constructor(agent: AdvisorAgent, host: AdvisorRuntimeHost, retryDelayMs?: number);
|
|
34
|
+
get backlog(): number;
|
|
35
|
+
onTurnEnd(messages?: AgentMessage[]): void;
|
|
36
|
+
waitForCatchup(maxMs: number, threshold: number, signal?: AbortSignal): Promise<void>;
|
|
37
|
+
dispose(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Re-prime the advisor after a history rewrite (compaction, session
|
|
40
|
+
* switch/resume, branch). Clears the advisor's own (non-persisted) context
|
|
41
|
+
* and rewinds the cursor to 0 so the NEXT turn replays the full current —
|
|
42
|
+
* post-compaction — transcript, giving the advisor fresh context instead of
|
|
43
|
+
* leaving it blind to everything before the rewrite.
|
|
44
|
+
*/
|
|
45
|
+
reset(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Seed the cursor to the current transcript length when the advisor is enabled
|
|
48
|
+
* mid-session. Prevents the next turn from replaying the entire history to the
|
|
49
|
+
* advisor (which would be expensive and likely stale).
|
|
50
|
+
*/
|
|
51
|
+
seedTo(count: number): void;
|
|
52
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discover and load WATCHDOG.md files walking up from cwd, project .omp folder, and user agent dir.
|
|
3
|
+
* Returns formatted watchdog file blocks ready to be appended to the advisor system prompt.
|
|
4
|
+
*/
|
|
5
|
+
export declare function discoverWatchdogFiles(cwd: string, agentDir?: string): Promise<string[]>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { type ThemeColor } from "../modes/theme/theme";
|
|
5
5
|
import type { Settings } from "./settings";
|
|
6
|
-
export type ModelRole = "default" | "smol" | "slow" | "vision" | "plan" | "designer" | "commit" | "title" | "task";
|
|
6
|
+
export type ModelRole = "default" | "smol" | "slow" | "vision" | "plan" | "designer" | "commit" | "title" | "task" | "advisor";
|
|
7
7
|
export interface ModelRoleInfo {
|
|
8
8
|
tag?: string;
|
|
9
9
|
name: string;
|
|
@@ -177,6 +177,37 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
177
177
|
readonly description: "Keep the display from idle-sleeping while a session is open (caffeinate -d)";
|
|
178
178
|
};
|
|
179
179
|
};
|
|
180
|
+
readonly "advisor.enabled": {
|
|
181
|
+
readonly type: "boolean";
|
|
182
|
+
readonly default: false;
|
|
183
|
+
readonly ui: {
|
|
184
|
+
readonly tab: "model";
|
|
185
|
+
readonly group: "Advisor";
|
|
186
|
+
readonly label: "Enable Advisor";
|
|
187
|
+
readonly description: "Pair a second model (assigned to the 'advisor' role) that passively reviews each turn and injects notes.";
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
readonly "advisor.subagents": {
|
|
191
|
+
readonly type: "boolean";
|
|
192
|
+
readonly default: false;
|
|
193
|
+
readonly ui: {
|
|
194
|
+
readonly tab: "model";
|
|
195
|
+
readonly group: "Advisor";
|
|
196
|
+
readonly label: "Advisor for Subagents";
|
|
197
|
+
readonly description: "Also enable the advisor on spawned task/eval subagents.";
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
readonly "advisor.syncBacklog": {
|
|
201
|
+
readonly type: "enum";
|
|
202
|
+
readonly values: readonly ["off", "1", "3", "5"];
|
|
203
|
+
readonly default: "off";
|
|
204
|
+
readonly ui: {
|
|
205
|
+
readonly tab: "model";
|
|
206
|
+
readonly group: "Advisor";
|
|
207
|
+
readonly label: "Advisor Sync Backlog";
|
|
208
|
+
readonly description: "Pause the main agent for up to 30 seconds if the advisor falls behind by this many turns. Off disables catch-up delays.";
|
|
209
|
+
};
|
|
210
|
+
};
|
|
180
211
|
readonly shellPath: {
|
|
181
212
|
readonly type: "string";
|
|
182
213
|
readonly default: undefined;
|
|
@@ -1843,13 +1874,13 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1843
1874
|
};
|
|
1844
1875
|
readonly "tools.format": {
|
|
1845
1876
|
readonly type: "enum";
|
|
1846
|
-
readonly values: readonly ["auto", "native", "glm", "hermes", "kimi", "xml", "anthropic", "deepseek", "harmony", "pi", "qwen3"];
|
|
1877
|
+
readonly values: readonly ["auto", "native", "glm", "hermes", "kimi", "xml", "anthropic", "deepseek", "harmony", "pi", "qwen3", "gemini", "gemma"];
|
|
1847
1878
|
readonly default: "auto";
|
|
1848
1879
|
readonly ui: {
|
|
1849
1880
|
readonly tab: "context";
|
|
1850
1881
|
readonly group: "Experimental";
|
|
1851
|
-
readonly label: "Tool
|
|
1852
|
-
readonly description: "Controls how tools are exposed to the model. Auto uses native tool calls unless the selected model is marked as not supporting
|
|
1882
|
+
readonly label: "Tool Calling Mode";
|
|
1883
|
+
readonly description: "Controls how tools are exposed to the model. Auto uses provider-native tool calls unless the selected model is marked as not supporting them, then falls back to the GLM owned dialect. Native forces provider-native tools; the other values force the named owned dialect. Applies on session start.";
|
|
1853
1884
|
readonly options: readonly [{
|
|
1854
1885
|
readonly value: "auto";
|
|
1855
1886
|
readonly label: "Auto";
|
|
@@ -1889,11 +1920,19 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1889
1920
|
}, {
|
|
1890
1921
|
readonly value: "pi";
|
|
1891
1922
|
readonly label: "Pi";
|
|
1892
|
-
readonly description: "Use Pi
|
|
1923
|
+
readonly description: "Use the Pi owned dialect.";
|
|
1893
1924
|
}, {
|
|
1894
1925
|
readonly value: "qwen3";
|
|
1895
1926
|
readonly label: "Qwen3";
|
|
1896
|
-
readonly description: "Use Qwen3
|
|
1927
|
+
readonly description: "Use the Qwen3 owned dialect.";
|
|
1928
|
+
}, {
|
|
1929
|
+
readonly value: "gemini";
|
|
1930
|
+
readonly label: "Gemini";
|
|
1931
|
+
readonly description: "Use the Gemini owned dialect.";
|
|
1932
|
+
}, {
|
|
1933
|
+
readonly value: "gemma";
|
|
1934
|
+
readonly label: "Gemma";
|
|
1935
|
+
readonly description: "Use the Gemma owned dialect.";
|
|
1897
1936
|
}];
|
|
1898
1937
|
};
|
|
1899
1938
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Component } from "@oh-my-pi/pi-tui";
|
|
2
|
+
import type { AdvisorMessageDetails } from "../../advisor";
|
|
3
|
+
import type { Theme } from "../theme/theme";
|
|
4
|
+
/**
|
|
5
|
+
* Display-only transcript card for advisor notes injected into the primary
|
|
6
|
+
* session. Mirrors the IRC card's glyph + quote-border conventions so passive
|
|
7
|
+
* advice reads as a distinct, non-interrupting aside rather than a user turn.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createAdvisorMessageCard(details: AdvisorMessageDetails | undefined, getExpanded: () => boolean, uiTheme: Theme): Component;
|
|
@@ -13,6 +13,7 @@ export declare class AssistantMessageComponent extends Container {
|
|
|
13
13
|
constructor(message?: AssistantMessage, hideThinkingBlock?: boolean, onImageUpdate?: (() => void) | undefined, thinkingRenderers?: readonly AssistantThinkingRenderer[], imageBudget?: ImageBudget | undefined);
|
|
14
14
|
invalidate(): void;
|
|
15
15
|
setHideThinkingBlock(hide: boolean): void;
|
|
16
|
+
dispose(): void;
|
|
16
17
|
/**
|
|
17
18
|
* Toggle suppression of the inline `Error: …` line while the same error is
|
|
18
19
|
* pinned in the banner above the editor. Re-renders so the change is visible.
|
|
@@ -10,10 +10,12 @@ export declare class CommandController {
|
|
|
10
10
|
constructor(ctx: InteractiveModeContext);
|
|
11
11
|
openInBrowser(urlOrPath: string): void;
|
|
12
12
|
handleExportCommand(text: string): Promise<void>;
|
|
13
|
-
handleDumpCommand(): void;
|
|
13
|
+
handleDumpCommand(isRaw?: boolean): void;
|
|
14
|
+
handleAdvisorDumpCommand(isRaw?: boolean): void;
|
|
14
15
|
handleDebugTranscriptCommand(): Promise<void>;
|
|
15
16
|
handleShareCommand(): Promise<void>;
|
|
16
17
|
handleSessionCommand(): Promise<void>;
|
|
18
|
+
handleAdvisorStatusCommand(): Promise<void>;
|
|
17
19
|
handleJobsCommand(): Promise<void>;
|
|
18
20
|
handleUsageCommand(reports?: UsageReport[] | null): Promise<void>;
|
|
19
21
|
handleChangelogCommand(showFull?: boolean): Promise<void>;
|
|
@@ -268,11 +268,13 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
268
268
|
findLastAssistantMessage(): AssistantMessage | undefined;
|
|
269
269
|
extractAssistantText(message: AssistantMessage): string;
|
|
270
270
|
handleExportCommand(text: string): Promise<void>;
|
|
271
|
-
handleDumpCommand(): void;
|
|
271
|
+
handleDumpCommand(isRaw?: boolean): void;
|
|
272
|
+
handleAdvisorDumpCommand(isRaw?: boolean): void;
|
|
272
273
|
handleDebugTranscriptCommand(): Promise<void>;
|
|
273
274
|
handleShareCommand(): Promise<void>;
|
|
274
275
|
handleTodoCommand(args: string): Promise<void>;
|
|
275
276
|
handleSessionCommand(): Promise<void>;
|
|
277
|
+
handleAdvisorStatusCommand(): Promise<void>;
|
|
276
278
|
handleJobsCommand(): Promise<void>;
|
|
277
279
|
handleUsageCommand(reports?: UsageReport[] | null): Promise<void>;
|
|
278
280
|
handleChangelogCommand(showFull?: boolean): Promise<void>;
|
|
@@ -250,13 +250,15 @@ export interface InteractiveModeContext {
|
|
|
250
250
|
handleShareCommand(): Promise<void>;
|
|
251
251
|
handleTodoCommand(args: string): Promise<void>;
|
|
252
252
|
handleSessionCommand(): Promise<void>;
|
|
253
|
+
handleAdvisorStatusCommand(): Promise<void>;
|
|
253
254
|
handleJobsCommand(): Promise<void>;
|
|
254
255
|
handleUsageCommand(reports?: UsageReport[] | null): Promise<void>;
|
|
255
256
|
handleChangelogCommand(showFull?: boolean): Promise<void>;
|
|
256
257
|
handleHotkeysCommand(): void;
|
|
257
258
|
handleToolsCommand(): void;
|
|
258
259
|
handleContextCommand(): void;
|
|
259
|
-
handleDumpCommand(): void;
|
|
260
|
+
handleDumpCommand(isRaw?: boolean): void;
|
|
261
|
+
handleAdvisorDumpCommand(isRaw?: boolean): void;
|
|
260
262
|
handleDebugTranscriptCommand(): Promise<void>;
|
|
261
263
|
handleClearCommand(): Promise<void>;
|
|
262
264
|
handleFreshCommand(): Promise<void>;
|
package/dist/types/sdk.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AgentTelemetryConfig, type ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import { type Model } from "@oh-my-pi/pi-ai";
|
|
3
|
-
import type {
|
|
3
|
+
import type { Dialect } from "@oh-my-pi/pi-ai/dialect";
|
|
4
4
|
import { type Rule } from "./capability/rule";
|
|
5
5
|
import { ModelRegistry } from "./config/model-registry";
|
|
6
6
|
import { type PromptTemplate } from "./config/prompt-templates";
|
|
@@ -184,8 +184,8 @@ export interface CreateAgentSessionResult {
|
|
|
184
184
|
/** Shared event bus for tool/extension communication */
|
|
185
185
|
eventBus: EventBus;
|
|
186
186
|
}
|
|
187
|
-
export type
|
|
188
|
-
export declare function
|
|
187
|
+
export type DialectFormat = "auto" | "native" | Dialect;
|
|
188
|
+
export declare function resolveDialect(format: DialectFormat, model: Pick<Model, "supportsTools"> | undefined): Dialect | undefined;
|
|
189
189
|
export type { PromptTemplate } from "./config/prompt-templates";
|
|
190
190
|
export { Settings, type SkillsSettings } from "./config/settings";
|
|
191
191
|
export type { CustomCommand, CustomCommandFactory } from "./extensibility/custom-commands/types";
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* Modes use this class and add their own I/O layer on top.
|
|
14
14
|
*/
|
|
15
15
|
import type { InMemorySnapshotStore } from "@oh-my-pi/hashline";
|
|
16
|
-
import {
|
|
16
|
+
import { Agent, type AgentEvent, type AgentMessage, type AgentState, type AgentTool, ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
17
17
|
import { type CompactionResult, type ShakeConfig } from "@oh-my-pi/pi-agent-core/compaction";
|
|
18
18
|
import type { AssistantMessage, ImageContent, Message, MessageAttribution, Model, ProviderSessionState, ResetCreditAccountStatus, ResetCreditRedeemOutcome, ResetCreditTarget, ServiceTier, SimpleStreamOptions, TextContent, ToolChoice, UsageReport } from "@oh-my-pi/pi-ai";
|
|
19
19
|
import { Effort } from "@oh-my-pi/pi-ai";
|
|
@@ -228,6 +228,15 @@ export interface AgentSessionConfig {
|
|
|
228
228
|
* so that credential sticky selection is consistent with the session's streaming calls.
|
|
229
229
|
*/
|
|
230
230
|
providerSessionId?: string;
|
|
231
|
+
/**
|
|
232
|
+
* Hard-isolated read-only tools (read/search/find) for the advisor agent,
|
|
233
|
+
* pre-built in `createAgentSession` against a distinct `ToolSession` so the
|
|
234
|
+
* advisor's reads never share the primary's snapshot/seen-lines/conflict
|
|
235
|
+
* caches. Undefined when the advisor is disabled.
|
|
236
|
+
*/
|
|
237
|
+
advisorReadOnlyTools?: AgentTool[];
|
|
238
|
+
/** Preloaded watchdog prompt content for the advisor. */
|
|
239
|
+
advisorWatchdogPrompt?: string;
|
|
231
240
|
}
|
|
232
241
|
/** Options for AgentSession.prompt() */
|
|
233
242
|
export interface PromptOptions {
|
|
@@ -301,6 +310,27 @@ export interface SessionStats {
|
|
|
301
310
|
premiumRequests: number;
|
|
302
311
|
cost: number;
|
|
303
312
|
}
|
|
313
|
+
/** Advisor statistics for /advisor status command. */
|
|
314
|
+
export interface AdvisorStats {
|
|
315
|
+
configured: boolean;
|
|
316
|
+
active: boolean;
|
|
317
|
+
model?: Model;
|
|
318
|
+
contextWindow: number;
|
|
319
|
+
contextTokens: number;
|
|
320
|
+
tokens: {
|
|
321
|
+
input: number;
|
|
322
|
+
output: number;
|
|
323
|
+
cacheRead: number;
|
|
324
|
+
cacheWrite: number;
|
|
325
|
+
total: number;
|
|
326
|
+
};
|
|
327
|
+
cost: number;
|
|
328
|
+
messages: {
|
|
329
|
+
user: number;
|
|
330
|
+
assistant: number;
|
|
331
|
+
total: number;
|
|
332
|
+
};
|
|
333
|
+
}
|
|
304
334
|
export interface FreshSessionResult {
|
|
305
335
|
previousSessionId: string;
|
|
306
336
|
sessionId: string;
|
|
@@ -1095,7 +1125,46 @@ export declare class AgentSession {
|
|
|
1095
1125
|
* Format the entire session as plain text for clipboard export.
|
|
1096
1126
|
* Includes user messages, assistant text, thinking blocks, tool calls, and tool results.
|
|
1097
1127
|
*/
|
|
1098
|
-
formatSessionAsText(
|
|
1128
|
+
formatSessionAsText(options?: {
|
|
1129
|
+
compact?: boolean;
|
|
1130
|
+
}): string;
|
|
1131
|
+
/**
|
|
1132
|
+
* Enable or disable the advisor for this session. The setting is persisted,
|
|
1133
|
+
* and the runtime is started or stopped to match.
|
|
1134
|
+
*
|
|
1135
|
+
* @returns true when the advisor is actively running after the call.
|
|
1136
|
+
*/
|
|
1137
|
+
setAdvisorEnabled(enabled: boolean): boolean;
|
|
1138
|
+
/**
|
|
1139
|
+
* Toggle the advisor setting and start/stop the runtime accordingly.
|
|
1140
|
+
*
|
|
1141
|
+
* @returns true when the advisor is actively running after the call.
|
|
1142
|
+
*/
|
|
1143
|
+
toggleAdvisorEnabled(): boolean;
|
|
1144
|
+
/**
|
|
1145
|
+
* Whether a live advisor agent is attached to this session. True only when
|
|
1146
|
+
* `advisor.enabled` is set AND a model resolved for the `advisor` role AND
|
|
1147
|
+
* the advisor applies to this agent kind — i.e. the actual runtime exists,
|
|
1148
|
+
* not merely the setting. Drives the status-line badge and `/dump advisor`.
|
|
1149
|
+
*/
|
|
1150
|
+
isAdvisorActive(): boolean;
|
|
1151
|
+
/**
|
|
1152
|
+
* Return structured advisor stats for the status command and TUI panel.
|
|
1153
|
+
*/
|
|
1154
|
+
getAdvisorStats(): AdvisorStats;
|
|
1155
|
+
/**
|
|
1156
|
+
* Format a concise advisor status line for ACP/text output.
|
|
1157
|
+
*/
|
|
1158
|
+
formatAdvisorStatus(): string;
|
|
1159
|
+
/**
|
|
1160
|
+
* Format the advisor agent's own transcript (its system prompt, config,
|
|
1161
|
+
* tools, and the markdown deltas it received plus its thinking/advise/read
|
|
1162
|
+
* calls) as plain text — the advisor-side equivalent of
|
|
1163
|
+
* {@link formatSessionAsText}. Returns null when no advisor is active.
|
|
1164
|
+
*/
|
|
1165
|
+
formatAdvisorHistoryAsText(options?: {
|
|
1166
|
+
compact?: boolean;
|
|
1167
|
+
}): string | null;
|
|
1099
1168
|
/**
|
|
1100
1169
|
* Check if extensions have handlers for a specific event type.
|
|
1101
1170
|
*/
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export interface HistoryFormatOptions {
|
|
2
2
|
/** Optional H1 prepended to the transcript. */
|
|
3
3
|
title?: string;
|
|
4
|
+
/** Render assistant thinking blocks (default: elided). */
|
|
5
|
+
includeThinking?: boolean;
|
|
6
|
+
/** Render tool intent comment before tool call lines. */
|
|
7
|
+
includeToolIntent?: boolean;
|
|
4
8
|
}
|
|
5
9
|
/**
|
|
6
10
|
* Format a session's message array as a concise markdown transcript.
|
|
@@ -4,6 +4,8 @@ export interface YieldDispatcher<P> {
|
|
|
4
4
|
isStale?(entry: P): boolean;
|
|
5
5
|
/** Produce one batched AgentMessage from non-stale entries. Return null to skip. */
|
|
6
6
|
build(survivors: P[]): AgentMessage | null;
|
|
7
|
+
/** If true, entries for this kind are drained only by {@link drainLazy} and never trigger the idle flush. */
|
|
8
|
+
skipIdleFlush?: boolean;
|
|
7
9
|
}
|
|
8
10
|
export interface YieldQueueOptions {
|
|
9
11
|
isStreaming: () => boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type LocalProtocolOptions } from "../internal-urls";
|
|
2
2
|
export declare function expandTilde(filePath: string, home?: string): string;
|
|
3
3
|
export declare function expandPath(filePath: string): string;
|
|
4
|
+
export declare function normalizeWindowsDriveAliasPath(filePath: string, platform?: NodeJS.Platform): string;
|
|
4
5
|
/**
|
|
5
6
|
* Inclusive line range describing one selector segment (e.g. `50-100`,
|
|
6
7
|
* `301-`, or `50+10`). `endLine` is `undefined` for open-ended ranges.
|
|
@@ -66,7 +66,6 @@ export declare function __resetAutoQaConsentForTests(): void;
|
|
|
66
66
|
* permanently locked into the false branch.
|
|
67
67
|
*/
|
|
68
68
|
export declare function resolveAutoQaConsent(settings: Settings | undefined): Promise<boolean>;
|
|
69
|
-
export declare function getAutoQaDbPath(): string;
|
|
70
69
|
/**
|
|
71
70
|
* Open (or return the cached handle for) the auto-QA SQLite database at
|
|
72
71
|
* `~/.omp/agent/autoqa.db`. Idempotently runs schema creation, the
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-coding-agent",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "16.0.0",
|
|
5
5
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"check": "biome check . && bun run check:types",
|
|
36
36
|
"check:types": "tsgo -p tsconfig.json --noEmit",
|
|
37
37
|
"lint": "biome lint .",
|
|
38
|
-
"test": "bun test --parallel
|
|
38
|
+
"test": "bun test --parallel",
|
|
39
39
|
"fix": "biome check --write --unsafe . && bun run format-prompts && bun run generate-docs-index",
|
|
40
40
|
"fmt": "biome format --write . && bun run format-prompts",
|
|
41
41
|
"format-prompts": "bun scripts/format-prompts.ts",
|
|
@@ -47,17 +47,17 @@
|
|
|
47
47
|
"@agentclientprotocol/sdk": "0.25.0",
|
|
48
48
|
"@babel/parser": "^7.29.7",
|
|
49
49
|
"@mozilla/readability": "^0.6.0",
|
|
50
|
-
"@oh-my-pi/hashline": "
|
|
51
|
-
"@oh-my-pi/omp-stats": "
|
|
52
|
-
"@oh-my-pi/pi-agent-core": "
|
|
53
|
-
"@oh-my-pi/pi-ai": "
|
|
54
|
-
"@oh-my-pi/pi-catalog": "
|
|
55
|
-
"@oh-my-pi/pi-mnemopi": "
|
|
56
|
-
"@oh-my-pi/pi-natives": "
|
|
57
|
-
"@oh-my-pi/pi-tui": "
|
|
58
|
-
"@oh-my-pi/pi-utils": "
|
|
59
|
-
"@oh-my-pi/pi-wire": "
|
|
60
|
-
"@oh-my-pi/snapcompact": "
|
|
50
|
+
"@oh-my-pi/hashline": "16.0.0",
|
|
51
|
+
"@oh-my-pi/omp-stats": "16.0.0",
|
|
52
|
+
"@oh-my-pi/pi-agent-core": "16.0.0",
|
|
53
|
+
"@oh-my-pi/pi-ai": "16.0.0",
|
|
54
|
+
"@oh-my-pi/pi-catalog": "16.0.0",
|
|
55
|
+
"@oh-my-pi/pi-mnemopi": "16.0.0",
|
|
56
|
+
"@oh-my-pi/pi-natives": "16.0.0",
|
|
57
|
+
"@oh-my-pi/pi-tui": "16.0.0",
|
|
58
|
+
"@oh-my-pi/pi-utils": "16.0.0",
|
|
59
|
+
"@oh-my-pi/pi-wire": "16.0.0",
|
|
60
|
+
"@oh-my-pi/snapcompact": "16.0.0",
|
|
61
61
|
"@opentelemetry/api": "^1.9.1",
|
|
62
62
|
"@opentelemetry/context-async-hooks": "^2.7.1",
|
|
63
63
|
"@opentelemetry/exporter-trace-otlp-proto": "^0.218.0",
|