@oh-my-pi/pi-coding-agent 16.2.6 → 16.2.7
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 +23 -0
- package/dist/cli.js +2656 -2651
- package/dist/types/cli/bench-cli.d.ts +3 -3
- package/dist/types/commands/bench.d.ts +1 -1
- package/dist/types/config/service-tier.d.ts +39 -24
- package/dist/types/config/settings-schema.d.ts +36 -36
- package/dist/types/mcp/config-writer.d.ts +48 -0
- package/dist/types/mcp/types.d.ts +3 -0
- package/dist/types/session/agent-session.d.ts +33 -13
- package/dist/types/session/messages.d.ts +1 -1
- package/dist/types/session/session-context.d.ts +2 -2
- package/dist/types/session/session-entries.d.ts +2 -2
- package/dist/types/session/session-manager.d.ts +2 -2
- package/dist/types/system-prompt.test.d.ts +1 -0
- package/dist/types/task/executor.d.ts +6 -6
- package/dist/types/task/types.d.ts +6 -0
- package/dist/types/task/worktree.d.ts +32 -6
- package/dist/types/tiny/title-client.d.ts +5 -1
- package/dist/types/tools/index.d.ts +3 -3
- package/dist/types/utils/git.d.ts +17 -0
- package/package.json +12 -12
- package/src/cli/bench-cli.ts +19 -12
- package/src/cli/tiny-models-cli.ts +18 -4
- package/src/commands/bench.ts +3 -3
- package/src/config/mcp-schema.json +10 -1
- package/src/config/service-tier.ts +85 -56
- package/src/config/settings-schema.ts +42 -36
- package/src/config/settings.ts +47 -0
- package/src/eval/agent-bridge.ts +4 -2
- package/src/internal-urls/docs-index.generated.txt +1 -1
- package/src/main.ts +1 -1
- package/src/mcp/config-writer.ts +121 -0
- package/src/mcp/config.ts +10 -6
- package/src/mcp/types.ts +3 -0
- package/src/modes/components/extensions/extension-dashboard.ts +46 -0
- package/src/modes/components/extensions/state-manager.ts +24 -3
- package/src/modes/controllers/event-controller.ts +7 -0
- package/src/modes/utils/transcript-render-helpers.ts +2 -2
- package/src/sdk.ts +12 -11
- package/src/session/agent-session.ts +186 -76
- package/src/session/messages.ts +1 -1
- package/src/session/session-context.ts +4 -4
- package/src/session/session-entries.ts +2 -2
- package/src/session/session-manager.ts +9 -2
- package/src/slash-commands/builtin-registry.ts +2 -10
- package/src/system-prompt.test.ts +158 -0
- package/src/system-prompt.ts +69 -26
- package/src/task/executor.ts +23 -16
- package/src/task/index.ts +7 -5
- package/src/task/isolation-runner.ts +15 -1
- package/src/task/types.ts +6 -0
- package/src/task/worktree.ts +219 -38
- package/src/tiny/title-client.ts +19 -13
- package/src/tools/index.ts +3 -3
- package/src/tools/irc.ts +9 -3
- package/src/tools/read.ts +28 -28
- package/src/utils/file-mentions.ts +10 -1
- package/src/utils/git.ts +38 -0
- package/src/web/search/providers/duckduckgo.ts +17 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ResolvedThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
2
|
-
import type { Api, ApiKeyResolver, AssistantMessageEventStream, Context, Model,
|
|
2
|
+
import type { Api, ApiKeyResolver, AssistantMessageEventStream, Context, Model, ServiceTierByFamily, SimpleStreamOptions } from "@oh-my-pi/pi-ai";
|
|
3
3
|
import { type CanonicalModelVariant } from "@oh-my-pi/pi-catalog/identity";
|
|
4
4
|
import type { ApiKeyResolverModel } from "../config/api-key-resolver";
|
|
5
5
|
import { type CanonicalModelQueryOptions } from "../config/model-registry";
|
|
@@ -65,8 +65,8 @@ export interface BenchSummary {
|
|
|
65
65
|
maxTokens: number;
|
|
66
66
|
models: BenchModelReport[];
|
|
67
67
|
failures: number;
|
|
68
|
-
/** Requested service
|
|
69
|
-
|
|
68
|
+
/** Requested per-family service tiers, resolved per model before reaching the wire. */
|
|
69
|
+
serviceTierByFamily?: ServiceTierByFamily;
|
|
70
70
|
}
|
|
71
71
|
type BenchStreamSimple = (model: Model<Api>, context: Context, options?: SimpleStreamOptions) => AssistantMessageEventStream;
|
|
72
72
|
export interface BenchDependencies {
|
|
@@ -22,7 +22,7 @@ export default class Bench extends Command {
|
|
|
22
22
|
};
|
|
23
23
|
"service-tier": import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"string"> & {
|
|
24
24
|
description: string;
|
|
25
|
-
options: readonly ["none", "auto", "default", "flex", "scale", "priority"
|
|
25
|
+
options: readonly ["none", "auto", "default", "flex", "scale", "priority"];
|
|
26
26
|
};
|
|
27
27
|
json: import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"boolean"> & {
|
|
28
28
|
description: string;
|
|
@@ -1,34 +1,49 @@
|
|
|
1
|
-
import type { ServiceTier } from "@oh-my-pi/pi-ai";
|
|
1
|
+
import type { ServiceTier, ServiceTierByFamily } from "@oh-my-pi/pi-ai";
|
|
2
2
|
import type { SubmenuOption } from "./settings-schema";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Per-family service-tier setting values. `"none"` is the omit-the-parameter
|
|
5
|
+
* sentinel; the rest mirror the wire {@link ServiceTier} values each provider
|
|
6
|
+
* family actually realizes. OpenAI accepts the full set; Anthropic realizes
|
|
7
|
+
* only `priority` (fast mode); Google (Gemini API + Vertex) realizes
|
|
8
|
+
* `flex`/`priority`.
|
|
7
9
|
*/
|
|
8
|
-
export declare const
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
export
|
|
10
|
+
export declare const SERVICE_TIER_OPENAI_VALUES: readonly ["none", "auto", "default", "flex", "scale", "priority"];
|
|
11
|
+
export declare const SERVICE_TIER_ANTHROPIC_VALUES: readonly ["none", "priority"];
|
|
12
|
+
export declare const SERVICE_TIER_GOOGLE_VALUES: readonly ["none", "flex", "priority"];
|
|
13
|
+
export type ServiceTierOpenAISettingValue = (typeof SERVICE_TIER_OPENAI_VALUES)[number];
|
|
14
|
+
export type ServiceTierAnthropicSettingValue = (typeof SERVICE_TIER_ANTHROPIC_VALUES)[number];
|
|
15
|
+
export type ServiceTierGoogleSettingValue = (typeof SERVICE_TIER_GOOGLE_VALUES)[number];
|
|
16
|
+
/**
|
|
17
|
+
* Inherit-capable single value for the subagent/advisor tiers. The chosen tier
|
|
18
|
+
* is broadcast across families and applied to whichever family the spawned
|
|
19
|
+
* model belongs to (clamped to what that family realizes); `"inherit"` defers
|
|
20
|
+
* to the main agent's live per-family selection.
|
|
21
|
+
*/
|
|
22
|
+
export declare const SERVICE_TIER_INHERIT_SETTING_VALUES: readonly ["inherit", "none", "auto", "default", "flex", "scale", "priority"];
|
|
12
23
|
export type ServiceTierInheritSettingValue = (typeof SERVICE_TIER_INHERIT_SETTING_VALUES)[number];
|
|
13
|
-
|
|
14
|
-
export declare const
|
|
15
|
-
|
|
24
|
+
export declare const SERVICE_TIER_OPENAI_OPTIONS: ReadonlyArray<SubmenuOption<ServiceTierOpenAISettingValue>>;
|
|
25
|
+
export declare const SERVICE_TIER_ANTHROPIC_OPTIONS: ReadonlyArray<SubmenuOption<ServiceTierAnthropicSettingValue>>;
|
|
26
|
+
export declare const SERVICE_TIER_GOOGLE_OPTIONS: ReadonlyArray<SubmenuOption<ServiceTierGoogleSettingValue>>;
|
|
16
27
|
export declare const SERVICE_TIER_INHERIT_OPTIONS: ReadonlyArray<SubmenuOption<ServiceTierInheritSettingValue>>;
|
|
28
|
+
/** Map a per-family setting value to a wire {@link ServiceTier}, or `undefined` to omit. */
|
|
29
|
+
export declare function serviceTierSettingToTier(value: string): ServiceTier | undefined;
|
|
30
|
+
/** Assemble the live per-family tier map from the three `tier.*` setting values. */
|
|
31
|
+
export declare function buildServiceTierByFamily(openai: string, anthropic: string, google: string): ServiceTierByFamily;
|
|
17
32
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
33
|
+
* Broadcast a single chosen tier across families, clamped to what each family
|
|
34
|
+
* realizes: OpenAI takes any tier, Anthropic only `priority`, Google only
|
|
35
|
+
* `flex`/`priority`. Used by the subagent/advisor single-value settings and the
|
|
36
|
+
* `omp bench --service-tier` flag, which apply one tier to whatever family the
|
|
37
|
+
* target model belongs to.
|
|
20
38
|
*/
|
|
21
|
-
export declare function
|
|
39
|
+
export declare function serviceTierForAllFamilies(tier: ServiceTier | undefined): ServiceTierByFamily;
|
|
22
40
|
/**
|
|
23
|
-
* Resolve
|
|
24
|
-
* snapshot.
|
|
41
|
+
* Resolve a subagent/advisor service-tier setting to a per-family map.
|
|
25
42
|
*
|
|
26
|
-
* - A concrete
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* back to the parent's configured `serviceTier` setting so behavior matches a
|
|
32
|
-
* plain settings snapshot.
|
|
43
|
+
* - A concrete tier is broadcast across families (see
|
|
44
|
+
* {@link serviceTierForAllFamilies}).
|
|
45
|
+
* - `"none"` yields an empty map.
|
|
46
|
+
* - `"inherit"` defers to `inherited` — the parent's live per-family tiers when
|
|
47
|
+
* a live session supplied them, else the empty map.
|
|
33
48
|
*/
|
|
34
|
-
export declare function resolveSubagentServiceTier(
|
|
49
|
+
export declare function resolveSubagentServiceTier(setting: string, inherited: ServiceTierByFamily): ServiceTierByFamily;
|
|
@@ -1232,65 +1232,65 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1232
1232
|
}];
|
|
1233
1233
|
};
|
|
1234
1234
|
};
|
|
1235
|
-
readonly
|
|
1235
|
+
readonly "tier.openai": {
|
|
1236
1236
|
readonly type: "enum";
|
|
1237
|
-
readonly values: readonly ["none", "auto", "default", "flex", "scale", "priority"
|
|
1237
|
+
readonly values: readonly ["none", "auto", "default", "flex", "scale", "priority"];
|
|
1238
1238
|
readonly default: "none";
|
|
1239
1239
|
readonly ui: {
|
|
1240
1240
|
readonly tab: "model";
|
|
1241
1241
|
readonly group: "Sampling";
|
|
1242
|
-
readonly label: "Service Tier";
|
|
1243
|
-
readonly description:
|
|
1244
|
-
readonly options: readonly SubmenuOption<"auto" | "
|
|
1242
|
+
readonly label: "Service Tier — OpenAI";
|
|
1243
|
+
readonly description: "Processing tier for OpenAI / OpenAI-Codex requests, and OpenAI-family models routed via OpenRouter (none = omit). Sent as `service_tier`.";
|
|
1244
|
+
readonly options: readonly SubmenuOption<"auto" | "default" | "flex" | "none" | "priority" | "scale">[];
|
|
1245
1245
|
};
|
|
1246
1246
|
};
|
|
1247
|
-
readonly
|
|
1247
|
+
readonly "tier.anthropic": {
|
|
1248
1248
|
readonly type: "enum";
|
|
1249
|
-
readonly values: readonly ["
|
|
1250
|
-
readonly default: "
|
|
1249
|
+
readonly values: readonly ["none", "priority"];
|
|
1250
|
+
readonly default: "none";
|
|
1251
1251
|
readonly ui: {
|
|
1252
1252
|
readonly tab: "model";
|
|
1253
1253
|
readonly group: "Sampling";
|
|
1254
|
-
readonly label: "Service Tier
|
|
1255
|
-
readonly description:
|
|
1256
|
-
readonly options: readonly SubmenuOption<"
|
|
1254
|
+
readonly label: "Service Tier — Anthropic";
|
|
1255
|
+
readonly description: 'Processing tier for Claude requests. `priority` realizes fast mode (`speed: "fast"`) on supported direct Anthropic models; ignored on Bedrock/Vertex Claude and via OpenRouter.';
|
|
1256
|
+
readonly options: readonly SubmenuOption<"none" | "priority">[];
|
|
1257
1257
|
};
|
|
1258
1258
|
};
|
|
1259
|
-
readonly
|
|
1259
|
+
readonly "tier.google": {
|
|
1260
1260
|
readonly type: "enum";
|
|
1261
|
-
readonly values: readonly ["
|
|
1261
|
+
readonly values: readonly ["none", "flex", "priority"];
|
|
1262
1262
|
readonly default: "none";
|
|
1263
1263
|
readonly ui: {
|
|
1264
1264
|
readonly tab: "model";
|
|
1265
1265
|
readonly group: "Sampling";
|
|
1266
|
-
readonly label: "Service Tier
|
|
1267
|
-
readonly description: "
|
|
1268
|
-
readonly options: readonly SubmenuOption<"
|
|
1269
|
-
readonly condition: "advisorEnabled";
|
|
1266
|
+
readonly label: "Service Tier — Google";
|
|
1267
|
+
readonly description: "Processing tier for Gemini (Google AI Studio + Vertex) requests, and Google-family models routed via OpenRouter (none = omit). Sent as the top-level `serviceTier` field.";
|
|
1268
|
+
readonly options: readonly SubmenuOption<"flex" | "none" | "priority">[];
|
|
1270
1269
|
};
|
|
1271
1270
|
};
|
|
1272
|
-
readonly
|
|
1271
|
+
readonly "tier.subagent": {
|
|
1273
1272
|
readonly type: "enum";
|
|
1274
|
-
readonly values: readonly ["
|
|
1275
|
-
readonly default: "
|
|
1273
|
+
readonly values: readonly ["inherit", "none", "auto", "default", "flex", "scale", "priority"];
|
|
1274
|
+
readonly default: "inherit";
|
|
1276
1275
|
readonly ui: {
|
|
1277
1276
|
readonly tab: "model";
|
|
1278
1277
|
readonly group: "Sampling";
|
|
1279
|
-
readonly label: "
|
|
1280
|
-
readonly description:
|
|
1281
|
-
readonly options: readonly [
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1278
|
+
readonly label: "Service Tier — Subagent";
|
|
1279
|
+
readonly description: "Service Tier for spawned task/eval subagents. Inherit = match the main agent's live per-family tiers (tracks /fast); pick a value to apply it to whichever family the subagent's model belongs to.";
|
|
1280
|
+
readonly options: readonly SubmenuOption<"auto" | "default" | "flex" | "inherit" | "none" | "priority" | "scale">[];
|
|
1281
|
+
};
|
|
1282
|
+
};
|
|
1283
|
+
readonly "tier.advisor": {
|
|
1284
|
+
readonly type: "enum";
|
|
1285
|
+
readonly values: readonly ["inherit", "none", "auto", "default", "flex", "scale", "priority"];
|
|
1286
|
+
readonly default: "none";
|
|
1287
|
+
readonly ui: {
|
|
1288
|
+
readonly tab: "model";
|
|
1289
|
+
readonly group: "Sampling";
|
|
1290
|
+
readonly label: "Service Tier — Advisor";
|
|
1291
|
+
readonly description: "Service Tier for the advisor model. None = standard processing; Inherit = match the main agent's live per-family tiers; pick a value to apply it to the advisor model's family.";
|
|
1292
|
+
readonly options: readonly SubmenuOption<"auto" | "default" | "flex" | "inherit" | "none" | "priority" | "scale">[];
|
|
1293
|
+
readonly condition: "advisorEnabled";
|
|
1294
1294
|
};
|
|
1295
1295
|
};
|
|
1296
1296
|
readonly "retry.enabled": {
|
|
@@ -2228,7 +2228,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
2228
2228
|
};
|
|
2229
2229
|
readonly "snapcompact.shape": {
|
|
2230
2230
|
readonly type: "enum";
|
|
2231
|
-
readonly values: readonly ["auto", ...("11on16-bw" | "5x8-bw" | "5x8-sent" | "6x12-dim" | "6x6u-bw" | "6x6u-sent" | "8on16-bw" | "8on22-bw" | "8x13-bw" | "8x8r-bw" | "8x8r-sent" | "8x8u-bw" | "8x8u-sent" | "doc-8on16-bw" | "doc-8on16-sent" | "doc-8on16-sent-dim")[]];
|
|
2231
|
+
readonly values: readonly ["auto", ...("11on16-bw" | "5x8-bw" | "5x8-sent" | "6x12-dim" | "6x6u-bw" | "6x6u-sent" | "8on16-bw" | "8on22-bw" | "8x13-bw" | "8x8r-bw" | "8x8r-sent" | "8x8u-bw" | "8x8u-sent" | "doc-8on16-bw" | "doc-8on16-sent" | "doc-8on16-sent-dim" | "silver16-bw")[]];
|
|
2232
2232
|
readonly default: "auto";
|
|
2233
2233
|
readonly ui: {
|
|
2234
2234
|
readonly tab: "context";
|
|
@@ -51,3 +51,51 @@ export declare function readDisabledServers(filePath: string): Promise<string[]>
|
|
|
51
51
|
* Add or remove a server name from the disabled servers list.
|
|
52
52
|
*/
|
|
53
53
|
export declare function setServerDisabled(filePath: string, name: string, disabled: boolean): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Read the user-level force-enable list (allowlist that overrides a
|
|
56
|
+
* non-writable source config's `enabled: false`).
|
|
57
|
+
*/
|
|
58
|
+
export declare function readEnabledServers(filePath: string): Promise<string[]>;
|
|
59
|
+
/**
|
|
60
|
+
* Add or remove a server name from the user-level force-enable list.
|
|
61
|
+
* The list overrides a discovered server's `enabled: false` flag but does
|
|
62
|
+
* NOT override the `disabledServers` denylist.
|
|
63
|
+
*/
|
|
64
|
+
export declare function setServerForceEnabled(filePath: string, name: string, force: boolean): Promise<void>;
|
|
65
|
+
/** Paths and target state for toggling one MCP server across known config files. */
|
|
66
|
+
export interface SetMcpServerEnabledOptions {
|
|
67
|
+
userPath: string;
|
|
68
|
+
projectPath: string;
|
|
69
|
+
/**
|
|
70
|
+
* Absolute path to the loaded row's source mcp.json. Provide ONLY for
|
|
71
|
+
* formats this codebase owns (native `.omp/mcp.json` and `mcp-json`
|
|
72
|
+
* `mcp.json`/`.mcp.json`). Tool-owned configs (opencode.json, claude.json,
|
|
73
|
+
* settings.json …) MUST be omitted; we never mutate another tool's file.
|
|
74
|
+
*/
|
|
75
|
+
sourcePath?: string;
|
|
76
|
+
name: string;
|
|
77
|
+
enabled: boolean;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Flip a server's enabled/disabled state regardless of where it lives.
|
|
81
|
+
*
|
|
82
|
+
* Resolution order, mirroring `/mcp enable` / `/mcp disable` plus the dashboard
|
|
83
|
+
* fix for non-writable source configs:
|
|
84
|
+
*
|
|
85
|
+
* - Server found in `sourcePath` (writable) → write `enabled` on that entry.
|
|
86
|
+
* - Else server in project mcp.json → write `enabled` there.
|
|
87
|
+
* - Else server in user mcp.json → write `enabled` there.
|
|
88
|
+
* - Else (server defined in a tool-owned source like opencode.json, OR a
|
|
89
|
+
* purely discovered server):
|
|
90
|
+
* - Disable → add to the user-level `disabledServers` denylist.
|
|
91
|
+
* - Enable → add to the user-level `enabledServers` allowlist so the
|
|
92
|
+
* dashboard / runtime override the non-writable source's
|
|
93
|
+
* `enabled: false` flag.
|
|
94
|
+
*
|
|
95
|
+
* Cleanup invariants — on every call:
|
|
96
|
+
* - Re-enable clears any stale denylist entry so a server disabled via
|
|
97
|
+
* `/mcp disable` and re-enabled here doesn't stay suppressed.
|
|
98
|
+
* - Disable clears any stale allowlist entry so re-disabling a
|
|
99
|
+
* force-enabled server actually takes effect.
|
|
100
|
+
*/
|
|
101
|
+
export declare function setMcpServerEnabled(options: SetMcpServerEnabledOptions): Promise<void>;
|
|
@@ -88,7 +88,10 @@ export declare const MCP_CONFIG_SCHEMA_URL = "https://raw.githubusercontent.com/
|
|
|
88
88
|
export interface MCPConfigFile {
|
|
89
89
|
$schema?: string;
|
|
90
90
|
mcpServers?: Record<string, MCPServerConfig>;
|
|
91
|
+
/** Names to hide regardless of any source `enabled` flag. Highest precedence. */
|
|
91
92
|
disabledServers?: string[];
|
|
93
|
+
/** Names to force-enable when a non-writable source reports `enabled: false`. */
|
|
94
|
+
enabledServers?: string[];
|
|
92
95
|
}
|
|
93
96
|
/** MCP implementation info */
|
|
94
97
|
export interface MCPImplementation {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import type { InMemorySnapshotStore } from "@oh-my-pi/hashline";
|
|
16
16
|
import { Agent, type AgentEvent, type AgentMessage, type AgentState, type AgentTool, type StreamFn, ThinkingLevel, type ToolChoiceDirective } from "@oh-my-pi/pi-agent-core";
|
|
17
17
|
import { type CompactionResult, type ShakeConfig } from "@oh-my-pi/pi-agent-core/compaction";
|
|
18
|
-
import type { AssistantMessage, Context, ImageContent, Message, MessageAttribution, Model, ProviderSessionState, ResetCreditAccountStatus, ResetCreditRedeemOutcome, ResetCreditTarget, ServiceTier, SimpleStreamOptions, TextContent, ToolChoice, UsageReport } from "@oh-my-pi/pi-ai";
|
|
18
|
+
import type { AssistantMessage, Context, ImageContent, Message, MessageAttribution, Model, ProviderSessionState, ResetCreditAccountStatus, ResetCreditRedeemOutcome, ResetCreditTarget, ServiceTier, ServiceTierByFamily, ServiceTierFamily, SimpleStreamOptions, TextContent, ToolChoice, UsageReport } from "@oh-my-pi/pi-ai";
|
|
19
19
|
import { Effort } from "@oh-my-pi/pi-ai";
|
|
20
20
|
import { type AdvisorConfig } from "../advisor";
|
|
21
21
|
import { type AsyncJob, type AsyncJobDeliveryState, AsyncJobManager } from "../async";
|
|
@@ -141,6 +141,8 @@ export interface AgentSessionConfig {
|
|
|
141
141
|
}>;
|
|
142
142
|
/** Initial session thinking selector. */
|
|
143
143
|
thinkingLevel?: ConfiguredThinkingLevel;
|
|
144
|
+
/** Initial per-family service tiers (OpenAI / Anthropic / Google) for the live session. */
|
|
145
|
+
serviceTierByFamily?: ServiceTierByFamily;
|
|
144
146
|
/** Prompt templates for expansion */
|
|
145
147
|
promptTemplates?: PromptTemplate[];
|
|
146
148
|
/** File-based slash commands for expansion */
|
|
@@ -546,7 +548,8 @@ export declare class AgentSession {
|
|
|
546
548
|
get isAutoThinking(): boolean;
|
|
547
549
|
/** The level `auto` resolved to for the current turn (undefined until classified). */
|
|
548
550
|
autoResolvedThinkingLevel(): Effort | undefined;
|
|
549
|
-
|
|
551
|
+
/** Live per-family service tiers (OpenAI / Anthropic / Google). */
|
|
552
|
+
get serviceTierByFamily(): ServiceTierByFamily;
|
|
550
553
|
/** Whether agent is currently streaming a response */
|
|
551
554
|
get isStreaming(): boolean;
|
|
552
555
|
get isAborting(): boolean;
|
|
@@ -919,23 +922,29 @@ export declare class AgentSession {
|
|
|
919
922
|
*/
|
|
920
923
|
cycleThinkingLevel(): ConfiguredThinkingLevel | undefined;
|
|
921
924
|
/**
|
|
922
|
-
* True when
|
|
923
|
-
*
|
|
924
|
-
*
|
|
925
|
-
*
|
|
925
|
+
* True when the currently selected model's family is set to `priority` — the
|
|
926
|
+
* `/fast` on/off state for the active model. Returns false when no model is
|
|
927
|
+
* selected or the model exposes no service-tier family (e.g. Fireworks, which
|
|
928
|
+
* has its own Providers › Fireworks Tier toggle).
|
|
926
929
|
*
|
|
927
|
-
* For "is
|
|
928
|
-
* {@link isFastModeActive} instead
|
|
930
|
+
* For "is priority actually applied to the next request?" use
|
|
931
|
+
* {@link isFastModeActive} instead.
|
|
929
932
|
*/
|
|
930
933
|
isFastModeEnabled(): boolean;
|
|
931
934
|
/**
|
|
932
|
-
* True when
|
|
933
|
-
*
|
|
934
|
-
*
|
|
935
|
-
* no model is selected.
|
|
935
|
+
* True when `priority` is actually realized on the wire for the currently
|
|
936
|
+
* selected model (OpenAI/Google `service_tier`, direct Anthropic fast mode,
|
|
937
|
+
* or Fireworks priority). Returns false for tiers the active model can't
|
|
938
|
+
* realize and when no model is selected.
|
|
936
939
|
*/
|
|
937
940
|
isFastModeActive(): boolean;
|
|
938
|
-
|
|
941
|
+
/** Set one family's tier (or clear it with `undefined`); persists the change. */
|
|
942
|
+
setServiceTierFamily(family: ServiceTierFamily, tier: ServiceTier | undefined): void;
|
|
943
|
+
/**
|
|
944
|
+
* `/fast on|off` targets the family of the currently selected model: it sets
|
|
945
|
+
* (or clears) that family's `priority` tier. Models without a service-tier
|
|
946
|
+
* family (Fireworks, or providers with no tier knob) have nothing to toggle.
|
|
947
|
+
*/
|
|
939
948
|
setFastMode(enabled: boolean): void;
|
|
940
949
|
toggleFastMode(): boolean;
|
|
941
950
|
/**
|
|
@@ -1102,6 +1111,17 @@ export declare class AgentSession {
|
|
|
1102
1111
|
get isEvalRunning(): boolean;
|
|
1103
1112
|
/** Whether there are pending Python messages waiting to be flushed */
|
|
1104
1113
|
get hasPendingPythonMessages(): boolean;
|
|
1114
|
+
/**
|
|
1115
|
+
* Surfaces (and consumes) IRC incoming asides that have reached this running
|
|
1116
|
+
* session but have not yet been folded into the next model step.
|
|
1117
|
+
*
|
|
1118
|
+
* The inbox tool injects the formatted body into the tool result, so the
|
|
1119
|
+
* model sees it once via the result. Leaving the record in
|
|
1120
|
+
* {@link #pendingIrcAsides} would let the aside provider deliver it a second
|
|
1121
|
+
* time at the next step boundary — including on `peek`, which is why peek
|
|
1122
|
+
* also drains here.
|
|
1123
|
+
*/
|
|
1124
|
+
drainPendingIrcInboxMessages(agentId: string): IrcMessage[];
|
|
1105
1125
|
/**
|
|
1106
1126
|
* Deliver an IRC message into this session (recipient side; called by the
|
|
1107
1127
|
* IrcBus). Emits the `irc_message` session event for UI cards and injects
|
|
@@ -184,7 +184,7 @@ export interface FileMentionMessage {
|
|
|
184
184
|
/** File size in bytes, if known. */
|
|
185
185
|
byteSize?: number;
|
|
186
186
|
/** Why the file contents were omitted from auto-read. */
|
|
187
|
-
skippedReason?: "tooLarge";
|
|
187
|
+
skippedReason?: "tooLarge" | "binary";
|
|
188
188
|
image?: ImageContent;
|
|
189
189
|
}>;
|
|
190
190
|
timestamp: number;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
2
|
-
import type
|
|
2
|
+
import { type ServiceTierByFamily } from "@oh-my-pi/pi-ai";
|
|
3
3
|
import { type CompactionEntry, type SessionEntry } from "./session-entries";
|
|
4
4
|
export interface SessionContext {
|
|
5
5
|
messages: AgentMessage[];
|
|
6
6
|
thinkingLevel?: string;
|
|
7
7
|
/** Configured thinking selector (`"auto"` or a concrete level) from the latest change. */
|
|
8
8
|
configuredThinkingLevel?: string;
|
|
9
|
-
serviceTier?:
|
|
9
|
+
serviceTier?: ServiceTierByFamily;
|
|
10
10
|
/** Model roles: { default: "provider/modelId", small: "provider/modelId", ... } */
|
|
11
11
|
models: Record<string, string>;
|
|
12
12
|
/** Names of TTSR rules that have been injected this session */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
2
|
-
import type { ImageContent, MessageAttribution,
|
|
2
|
+
import type { ImageContent, MessageAttribution, ServiceTierByFamily, TextContent } from "@oh-my-pi/pi-ai";
|
|
3
3
|
export declare const CURRENT_SESSION_VERSION = 3;
|
|
4
4
|
export declare const SESSION_TITLE_SLOT_BYTES = 256;
|
|
5
5
|
export declare const SESSION_TITLE_SLOT_ENTRY_TYPE = "title";
|
|
@@ -59,7 +59,7 @@ export interface ModelChangeEntry extends SessionEntryBase {
|
|
|
59
59
|
}
|
|
60
60
|
export interface ServiceTierChangeEntry extends SessionEntryBase {
|
|
61
61
|
type: "service_tier_change";
|
|
62
|
-
serviceTier:
|
|
62
|
+
serviceTier: ServiceTierByFamily | null;
|
|
63
63
|
}
|
|
64
64
|
export interface CompactionEntry<T = unknown> extends SessionEntryBase {
|
|
65
65
|
type: "compaction";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ImageContent, Message, MessageAttribution,
|
|
1
|
+
import type { ImageContent, Message, MessageAttribution, ServiceTierByFamily, TextContent } from "@oh-my-pi/pi-ai";
|
|
2
2
|
import { ArtifactManager } from "./artifacts";
|
|
3
3
|
import { type BlobPutOptions, type BlobPutResult } from "./blob-store";
|
|
4
4
|
import { type BashExecutionMessage, type CustomMessage, type FileMentionMessage, type HookMessage, type PythonExecutionMessage } from "./messages";
|
|
@@ -141,7 +141,7 @@ export declare class SessionManager {
|
|
|
141
141
|
appendMessage(message: Message | CustomMessage | HookMessage | BashExecutionMessage | PythonExecutionMessage | FileMentionMessage): string;
|
|
142
142
|
/** Append a thinking level change as child of current leaf, then advance leaf. Returns entry id. */
|
|
143
143
|
appendThinkingLevelChange(thinkingLevel?: string, configured?: string): string;
|
|
144
|
-
appendServiceTierChange(serviceTier:
|
|
144
|
+
appendServiceTierChange(serviceTier: ServiceTierByFamily | null): string;
|
|
145
145
|
appendModeChange(mode: string, data?: Record<string, unknown>): string;
|
|
146
146
|
/**
|
|
147
147
|
* Append a model change as a child of the current leaf, then advance the leaf.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Runs each subagent on the main thread and forwards AgentEvents for progress tracking.
|
|
5
5
|
*/
|
|
6
6
|
import type { AgentTelemetryConfig, ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
7
|
-
import type {
|
|
7
|
+
import type { ServiceTierByFamily } from "@oh-my-pi/pi-ai";
|
|
8
8
|
import type { Rule } from "../capability/rule";
|
|
9
9
|
import { ModelRegistry } from "../config/model-registry";
|
|
10
10
|
import type { PromptTemplate } from "../config/prompt-templates";
|
|
@@ -123,12 +123,12 @@ export interface ExecutorOptions {
|
|
|
123
123
|
modelRegistry?: ModelRegistry;
|
|
124
124
|
settings?: Settings;
|
|
125
125
|
/**
|
|
126
|
-
* Parent session's live
|
|
127
|
-
* subagent whose `
|
|
126
|
+
* Parent session's live per-family service tiers, the source of truth for a
|
|
127
|
+
* subagent whose `tier.subagent` is `"inherit"`. `null` = the parent
|
|
128
128
|
* explicitly has no tier (e.g. `/fast off`); omitted = no live session, so
|
|
129
|
-
* inherit falls back to the configured `
|
|
129
|
+
* inherit falls back to the subagent's configured `tier.*` settings.
|
|
130
130
|
*/
|
|
131
|
-
parentServiceTier?:
|
|
131
|
+
parentServiceTier?: ServiceTierByFamily | null;
|
|
132
132
|
/** Override local:// protocol options so subagent shares parent's local:// root */
|
|
133
133
|
localProtocolOptions?: LocalProtocolOptions;
|
|
134
134
|
/**
|
|
@@ -191,7 +191,7 @@ export declare function finalizeSubprocessOutput(args: FinalizeSubprocessOutputA
|
|
|
191
191
|
* Create proxy tools that reuse the parent's MCP connections.
|
|
192
192
|
*/
|
|
193
193
|
export declare function createMCPProxyTools(mcpManager: MCPManager): CustomTool[];
|
|
194
|
-
export declare function createSubagentSettings(baseSettings: Settings, overrides?: Partial<Record<SettingPath, unknown>>, inheritedServiceTier?:
|
|
194
|
+
export declare function createSubagentSettings(baseSettings: Settings, overrides?: Partial<Record<SettingPath, unknown>>, inheritedServiceTier?: ServiceTierByFamily | null): Settings;
|
|
195
195
|
export declare function finalizeSubagentLifecycle(args: {
|
|
196
196
|
id: string;
|
|
197
197
|
session: AgentSession;
|
|
@@ -334,6 +334,12 @@ export interface SingleResult {
|
|
|
334
334
|
patchPath?: string;
|
|
335
335
|
/** Branch name for isolated branch-mode output */
|
|
336
336
|
branchName?: string;
|
|
337
|
+
/**
|
|
338
|
+
* Baseline commit SHA the task branch was created from. Passed to
|
|
339
|
+
* `mergeTaskBranches` so cherry-pick uses the inclusive range
|
|
340
|
+
* `branchBaseSha..branchName` and preserves every agent commit's message.
|
|
341
|
+
*/
|
|
342
|
+
branchBaseSha?: string;
|
|
337
343
|
/** Nested repo patches to apply after parent merge */
|
|
338
344
|
nestedPatches?: NestedRepoPatch[];
|
|
339
345
|
/** Data extracted by registered subprocess tool handlers (keyed by tool name) */
|
|
@@ -80,11 +80,32 @@ export declare function cleanupIsolation(handle: IsolationHandle): Promise<void>
|
|
|
80
80
|
export interface CommitToBranchResult {
|
|
81
81
|
branchName?: string;
|
|
82
82
|
nestedPatches: NestedRepoPatch[];
|
|
83
|
+
/**
|
|
84
|
+
* SHA of the parent-repo commit the task branch was created on top of, so
|
|
85
|
+
* {@link mergeTaskBranches} can cherry-pick the range `baseSha..branchName`
|
|
86
|
+
* and preserve every agent commit's message and author.
|
|
87
|
+
*/
|
|
88
|
+
baseSha?: string;
|
|
83
89
|
}
|
|
84
90
|
/**
|
|
85
|
-
*
|
|
86
|
-
* Only root
|
|
87
|
-
* separately
|
|
91
|
+
* Capture task-only changes from the isolation worktree onto a parent-repo
|
|
92
|
+
* branch named `omp/task/${taskId}`. Only root-repo changes go on the branch;
|
|
93
|
+
* nested-repo patches are returned separately because the parent git can't
|
|
94
|
+
* track files inside gitlinks.
|
|
95
|
+
*
|
|
96
|
+
* If the agent committed inside isolation (HEAD moved past
|
|
97
|
+
* `baseline.root.headCommit`), clean-baseline runs fetch the raw commit range
|
|
98
|
+
* into the parent repo and later cherry-pick `baseSha..branchName`, preserving
|
|
99
|
+
* every message and author verbatim. Dirty-baseline runs rewrite each agent
|
|
100
|
+
* commit against the captured baseline WIP before committing it to the task
|
|
101
|
+
* branch, so user staged/unstaged/untracked changes present at isolation
|
|
102
|
+
* start are not replayed into the parent commit history.
|
|
103
|
+
*
|
|
104
|
+
* If the agent did not commit, the captured delta is collapsed onto a single
|
|
105
|
+
* branch commit with an AI-generated (or fallback) message — the legacy
|
|
106
|
+
* behaviour.
|
|
107
|
+
*
|
|
108
|
+
* Returns `null` when no root or nested changes exist.
|
|
88
109
|
*/
|
|
89
110
|
export declare function commitToBranch(isolationDir: string, baseline: WorktreeBaseline, taskId: string, description: string | undefined, commitMessage?: (diff: string) => Promise<string | null>): Promise<CommitToBranchResult | null>;
|
|
90
111
|
export interface MergeBranchResult {
|
|
@@ -95,14 +116,19 @@ export interface MergeBranchResult {
|
|
|
95
116
|
stashConflict?: string;
|
|
96
117
|
}
|
|
97
118
|
/**
|
|
98
|
-
* Cherry-pick task branch commits sequentially onto HEAD.
|
|
99
|
-
*
|
|
100
|
-
*
|
|
119
|
+
* Cherry-pick task branch commits sequentially onto HEAD. When `baseSha` is
|
|
120
|
+
* provided the cherry-pick uses the inclusive range `baseSha..branchName`,
|
|
121
|
+
* replaying every commit individually and preserving each commit's message
|
|
122
|
+
* and author. When omitted, the branch is cherry-picked as a single commit
|
|
123
|
+
* (legacy callers).
|
|
124
|
+
*
|
|
125
|
+
* Stops on the first conflict and reports which branches succeeded.
|
|
101
126
|
*/
|
|
102
127
|
export declare function mergeTaskBranches(repoRoot: string, branches: Array<{
|
|
103
128
|
branchName: string;
|
|
104
129
|
taskId: string;
|
|
105
130
|
description?: string;
|
|
131
|
+
baseSha?: string;
|
|
106
132
|
}>): Promise<MergeBranchResult>;
|
|
107
133
|
/** Clean up temporary task branches. */
|
|
108
134
|
export declare function cleanupTaskBranches(repoRoot: string, branches: string[]): Promise<void>;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type RefCountedWorkerHandle, type SpawnedSubprocess } from "../subprocess/worker-client";
|
|
2
2
|
import type { TinyTitleProgressEvent, TinyTitleWorkerInbound, TinyTitleWorkerOutbound } from "./title-protocol";
|
|
3
|
+
export interface TinyTitleDownloadResult {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
error?: string;
|
|
6
|
+
}
|
|
3
7
|
export interface TinyTitleDownloadOptions {
|
|
4
8
|
signal?: AbortSignal;
|
|
5
9
|
onProgress?: (event: TinyTitleProgressEvent) => void;
|
|
@@ -52,7 +56,7 @@ export declare class TinyTitleClient {
|
|
|
52
56
|
maxTokens?: number;
|
|
53
57
|
signal?: AbortSignal;
|
|
54
58
|
}): Promise<string | null>;
|
|
55
|
-
downloadModel(modelKey: string, options?: TinyTitleDownloadOptions): Promise<
|
|
59
|
+
downloadModel(modelKey: string, options?: TinyTitleDownloadOptions): Promise<TinyTitleDownloadResult>;
|
|
56
60
|
terminate(): Promise<void>;
|
|
57
61
|
}
|
|
58
62
|
export declare const tinyTitleClient: TinyTitleClient;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InMemorySnapshotStore } from "@oh-my-pi/hashline";
|
|
2
2
|
import type { AgentTelemetryConfig, AgentTool } from "@oh-my-pi/pi-agent-core";
|
|
3
|
-
import type { FetchImpl, ImageContent, Model,
|
|
3
|
+
import type { FetchImpl, ImageContent, Model, ServiceTierByFamily, ToolChoice } from "@oh-my-pi/pi-ai";
|
|
4
4
|
import type { AsyncJobManager } from "../async/job-manager";
|
|
5
5
|
import type { Rule } from "../capability/rule";
|
|
6
6
|
import type { PromptTemplate } from "../config/prompt-templates";
|
|
@@ -191,8 +191,8 @@ export interface ToolSession {
|
|
|
191
191
|
getActiveModelString?: () => string | undefined;
|
|
192
192
|
/** Get the current session model object (provider/api capabilities), regardless of how it was chosen. */
|
|
193
193
|
getActiveModel?: () => Model | undefined;
|
|
194
|
-
/** Get the session's live
|
|
195
|
-
|
|
194
|
+
/** Get the session's live per-family service tiers (undefined = none). Source of truth for subagent `tier.subagent: inherit`. */
|
|
195
|
+
getServiceTierByFamily?: () => ServiceTierByFamily | undefined;
|
|
196
196
|
/** Auth storage for passing to subagents (avoids re-discovery) */
|
|
197
197
|
authStorage?: import("../session/auth-storage").AuthStorage;
|
|
198
198
|
/** Model registry for passing to subagents (avoids re-discovery) */
|