@oh-my-pi/pi-coding-agent 16.1.18 → 16.1.20

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cli.js +15452 -15142
  3. package/dist/types/cli/gallery-cli.d.ts +6 -0
  4. package/dist/types/commands/gallery.d.ts +1 -1
  5. package/dist/types/config/service-tier.d.ts +34 -0
  6. package/dist/types/config/settings-schema.d.ts +36 -33
  7. package/dist/types/edit/hashline/filesystem.d.ts +1 -18
  8. package/dist/types/extensibility/plugins/legacy-pi-bundled-keys.d.ts +10 -0
  9. package/dist/types/extensibility/plugins/legacy-pi-bundled-registry.d.ts +4 -1
  10. package/dist/types/extensibility/plugins/legacy-pi-compat.d.ts +12 -0
  11. package/dist/types/internal-urls/skill-protocol.d.ts +2 -2
  12. package/dist/types/internal-urls/types.d.ts +3 -0
  13. package/dist/types/modes/components/custom-editor.d.ts +0 -2
  14. package/dist/types/modes/controllers/input-controller.d.ts +0 -1
  15. package/dist/types/session/agent-session.d.ts +2 -0
  16. package/dist/types/task/executor.d.ts +9 -1
  17. package/dist/types/task/parallel.d.ts +17 -1
  18. package/dist/types/tools/index.d.ts +3 -1
  19. package/dist/types/tools/path-utils.d.ts +3 -0
  20. package/package.json +13 -13
  21. package/scripts/build-binary.ts +20 -0
  22. package/scripts/generate-legacy-pi-bundled-registry.ts +404 -0
  23. package/src/cli/gallery-cli.ts +31 -2
  24. package/src/cli/gallery-fixtures/agentic.ts +13 -4
  25. package/src/commands/gallery.ts +11 -3
  26. package/src/config/service-tier.ts +87 -0
  27. package/src/config/settings-schema.ts +48 -23
  28. package/src/edit/hashline/filesystem.ts +14 -0
  29. package/src/eval/agent-bridge.ts +2 -0
  30. package/src/extensibility/plugins/legacy-pi-bundled-keys.ts +987 -0
  31. package/src/extensibility/plugins/legacy-pi-bundled-registry.ts +3330 -18
  32. package/src/extensibility/plugins/legacy-pi-compat.ts +29 -14
  33. package/src/internal-urls/local-protocol.ts +116 -9
  34. package/src/internal-urls/skill-protocol.ts +3 -3
  35. package/src/internal-urls/types.ts +3 -0
  36. package/src/main.ts +1 -0
  37. package/src/mcp/transports/stdio.ts +5 -0
  38. package/src/modes/components/custom-editor.test.ts +7 -5
  39. package/src/modes/components/custom-editor.ts +6 -16
  40. package/src/modes/controllers/input-controller.ts +143 -137
  41. package/src/sdk.ts +1 -0
  42. package/src/session/agent-session.ts +72 -15
  43. package/src/session/messages.ts +70 -47
  44. package/src/session/session-history-format.ts +21 -4
  45. package/src/task/executor.ts +79 -2
  46. package/src/task/index.ts +11 -6
  47. package/src/task/parallel.ts +59 -7
  48. package/src/tools/ast-edit.ts +1 -0
  49. package/src/tools/ast-grep.ts +1 -0
  50. package/src/tools/find.ts +1 -0
  51. package/src/tools/index.ts +3 -1
  52. package/src/tools/irc.ts +16 -2
  53. package/src/tools/path-utils.ts +4 -0
  54. package/src/tools/read.ts +43 -17
  55. package/src/tools/search.ts +4 -0
  56. package/src/utils/shell-snapshot-fn-env.sh +60 -0
  57. package/src/utils/shell-snapshot.ts +77 -20
@@ -2,6 +2,12 @@ import { type GalleryFixture } from "./gallery-fixtures";
2
2
  /** Lifecycle states the gallery renders, in display order. */
3
3
  export declare const GALLERY_STATES: readonly ["streaming", "progress", "success", "error"];
4
4
  export type GalleryState = (typeof GALLERY_STATES)[number];
5
+ /** User-facing labels printed above each rendered lifecycle state. */
6
+ export declare const GALLERY_STATE_LABELS: Record<GalleryState, string>;
7
+ /** Accepted `--state` tokens, including legacy lifecycle names and displayed labels. */
8
+ export declare const GALLERY_STATE_TOKENS: string[];
9
+ /** Normalize user-provided `--state` tokens to the internal gallery lifecycle states. */
10
+ export declare function parseGalleryStates(states: readonly string[] | undefined): GalleryState[] | undefined;
5
11
  export interface GalleryCommandArgs {
6
12
  /** Render width in columns (defaults to terminal width, clamped). */
7
13
  width?: number;
@@ -12,7 +12,7 @@ export default class Gallery extends Command {
12
12
  state: import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"string"> & {
13
13
  char: string;
14
14
  description: string;
15
- options: ("error" | "progress" | "streaming" | "success")[];
15
+ options: string[];
16
16
  multiple: true;
17
17
  };
18
18
  width: import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"integer"> & {
@@ -0,0 +1,34 @@
1
+ import type { ServiceTier } from "@oh-my-pi/pi-ai";
2
+ import type { SubmenuOption } from "./settings-schema";
3
+ /**
4
+ * Service-tier setting values shared by every "Service Tier" setting. `"none"`
5
+ * is the omit-the-parameter sentinel; the remaining values mirror
6
+ * {@link ServiceTier}.
7
+ */
8
+ export declare const SERVICE_TIER_SETTING_VALUES: readonly ["none", "auto", "default", "flex", "scale", "priority", "openai-only", "claude-only"];
9
+ export type ServiceTierSettingValue = (typeof SERVICE_TIER_SETTING_VALUES)[number];
10
+ /** Variant value set for scoped service-tier settings (subagent/advisor) that can defer to the main agent. */
11
+ export declare const SERVICE_TIER_INHERIT_SETTING_VALUES: readonly ["inherit", "none", "auto", "default", "flex", "scale", "priority", "openai-only", "claude-only"];
12
+ export type ServiceTierInheritSettingValue = (typeof SERVICE_TIER_INHERIT_SETTING_VALUES)[number];
13
+ /** Submenu descriptions shared by the base `serviceTier` setting. */
14
+ export declare const SERVICE_TIER_OPTIONS: ReadonlyArray<SubmenuOption<ServiceTierSettingValue>>;
15
+ /** Submenu descriptions for inherit-capable service-tier settings. */
16
+ export declare const SERVICE_TIER_INHERIT_OPTIONS: ReadonlyArray<SubmenuOption<ServiceTierInheritSettingValue>>;
17
+ /**
18
+ * Resolve a service-tier setting value to the wire {@link ServiceTier} (or
19
+ * `undefined` to omit). `"inherit"` defers to `inherited`; `"none"` omits.
20
+ */
21
+ export declare function resolveServiceTierSetting(value: string, inherited: ServiceTier | undefined): ServiceTier | undefined;
22
+ /**
23
+ * Resolve the `serviceTier` *setting value* to stamp onto a subagent's settings
24
+ * snapshot.
25
+ *
26
+ * - A concrete `subagentSetting` (`"none"` or a tier) wins outright.
27
+ * - `"inherit"` defers to the parent's live effective tier when the caller has a
28
+ * live session (`inherited` passed as `ServiceTier | null`, where `null` means
29
+ * the parent explicitly has no tier — e.g. `/fast off`). When no live session
30
+ * is available (`inherited === undefined`, e.g. cold subagent revive) it falls
31
+ * back to the parent's configured `serviceTier` setting so behavior matches a
32
+ * plain settings snapshot.
33
+ */
34
+ export declare function resolveSubagentServiceTier(subagentSetting: string, configuredTier: ServiceTierSettingValue, inherited: ServiceTier | null | undefined): ServiceTierSettingValue;
@@ -1153,39 +1153,32 @@ export declare const SETTINGS_SCHEMA: {
1153
1153
  readonly group: "Sampling";
1154
1154
  readonly label: "Service Tier";
1155
1155
  readonly description: 'Processing priority hint (none = omit). OpenAI accepts the tier values directly; Anthropic realizes `priority` as `speed: "fast"` on supported Opus models. Scoped values target one family.';
1156
- readonly options: readonly [{
1157
- readonly value: "none";
1158
- readonly label: "None";
1159
- readonly description: "Omit service_tier parameter";
1160
- }, {
1161
- readonly value: "auto";
1162
- readonly label: "Auto";
1163
- readonly description: "Use provider default tier selection (OpenAI)";
1164
- }, {
1165
- readonly value: "default";
1166
- readonly label: "Default";
1167
- readonly description: "Standard priority processing (OpenAI)";
1168
- }, {
1169
- readonly value: "flex";
1170
- readonly label: "Flex";
1171
- readonly description: "Flexible capacity tier when available (OpenAI)";
1172
- }, {
1173
- readonly value: "scale";
1174
- readonly label: "Scale";
1175
- readonly description: "Scale Tier credits when available (OpenAI)";
1176
- }, {
1177
- readonly value: "priority";
1178
- readonly label: "Priority";
1179
- readonly description: "Priority on every supported provider (OpenAI `service_tier`, Anthropic fast mode)";
1180
- }, {
1181
- readonly value: "openai-only";
1182
- readonly label: "Priority (OpenAI only)";
1183
- readonly description: "Priority on OpenAI/OpenAI-Codex requests; ignored elsewhere";
1184
- }, {
1185
- readonly value: "claude-only";
1186
- readonly label: "Priority (Claude only)";
1187
- readonly description: "Anthropic fast mode on direct Claude requests; ignored elsewhere (incl. Bedrock/Vertex)";
1188
- }];
1156
+ readonly options: readonly SubmenuOption<"auto" | "claude-only" | "default" | "flex" | "none" | "openai-only" | "priority" | "scale">[];
1157
+ };
1158
+ };
1159
+ readonly serviceTierSubagent: {
1160
+ readonly type: "enum";
1161
+ readonly values: readonly ["inherit", "none", "auto", "default", "flex", "scale", "priority", "openai-only", "claude-only"];
1162
+ readonly default: "inherit";
1163
+ readonly ui: {
1164
+ readonly tab: "model";
1165
+ readonly group: "Sampling";
1166
+ readonly label: "Service Tier - Subagent";
1167
+ readonly description: "Service Tier for spawned task/eval subagents. Inherit = match the main agent's live tier (tracks /fast); pick a value to scope subagents independently.";
1168
+ readonly options: readonly SubmenuOption<"auto" | "claude-only" | "default" | "flex" | "inherit" | "none" | "openai-only" | "priority" | "scale">[];
1169
+ };
1170
+ };
1171
+ readonly serviceTierAdvisor: {
1172
+ readonly type: "enum";
1173
+ readonly values: readonly ["inherit", "none", "auto", "default", "flex", "scale", "priority", "openai-only", "claude-only"];
1174
+ readonly default: "none";
1175
+ readonly ui: {
1176
+ readonly tab: "model";
1177
+ readonly group: "Sampling";
1178
+ readonly label: "Service Tier - Advisor";
1179
+ readonly description: "Service Tier for the advisor model. None = standard processing; Inherit = match the main agent's live tier; pick a value (e.g. Priority) to run the advisor on a faster serving path.";
1180
+ readonly options: readonly SubmenuOption<"auto" | "claude-only" | "default" | "flex" | "inherit" | "none" | "openai-only" | "priority" | "scale">[];
1181
+ readonly condition: "advisorEnabled";
1189
1182
  };
1190
1183
  };
1191
1184
  readonly fastModeScope: {
@@ -4243,6 +4236,16 @@ export declare const SETTINGS_SCHEMA: {
4243
4236
  readonly description: "Obfuscate secrets before sending to AI providers";
4244
4237
  };
4245
4238
  };
4239
+ readonly "providers.ollama-cloud.maxConcurrency": {
4240
+ readonly type: "number";
4241
+ readonly default: 3;
4242
+ readonly ui: {
4243
+ readonly tab: "providers";
4244
+ readonly group: "Services";
4245
+ readonly label: "Ollama Cloud Max Concurrency";
4246
+ readonly description: "Maximum concurrent Ollama Cloud subagent runs per process; 0 disables the provider-specific limit";
4247
+ };
4248
+ };
4246
4249
  readonly "providers.webSearch": {
4247
4250
  readonly type: "enum";
4248
4251
  readonly values: readonly ["auto", ...SearchProviderId[]];
@@ -1,21 +1,3 @@
1
- /**
2
- * Coding-agent specific {@link Filesystem} adapter for the hashline patcher.
3
- *
4
- * Wires hashline's storage abstraction to the agent runtime:
5
- *
6
- * - Section paths are resolved through the plan-mode redirect so a bare
7
- * `PLAN.md` lands at the canonical session artifact location.
8
- * - Reads go through `readEditFileText` (notebook-aware) and the
9
- * auto-generated-file guard.
10
- * - Writes go through `serializeEditFileText` (notebook-aware) and the
11
- * LSP writethrough, with FS-scan cache invalidation on success. The
12
- * resulting `FileDiagnosticsResult` is captured per-path so the
13
- * orchestrator can attach it to the tool result.
14
- *
15
- * Construct one per `executeHashlineSingle` call: per-section state
16
- * (batch request, diagnostics) lives on the instance and isn't safe to
17
- * share across concurrent edit tools.
18
- */
19
1
  import { Filesystem, type WriteResult } from "@oh-my-pi/hashline";
20
2
  import type { FileDiagnosticsResult, WritethroughCallback, WritethroughDeferredHandle } from "../../lsp";
21
3
  import type { ToolSession } from "../../tools";
@@ -50,6 +32,7 @@ export declare class HashlineFilesystem extends Filesystem {
50
32
  consumeDiagnostics(path: string): FileDiagnosticsResult | undefined;
51
33
  resolveAbsolute(relativePath: string): string;
52
34
  canonicalPath(relativePath: string): string;
35
+ allowTagPathRecovery(authoredPath: string, resolvedPath: string): boolean;
53
36
  readText(relativePath: string): Promise<string>;
54
37
  preflightWrite(relativePath: string): Promise<void>;
55
38
  writeText(relativePath: string, content: string): Promise<WriteResult>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Canonical keys served by the `omp-legacy-pi-bundled:` virtual namespace.
3
+ * Mirrors `Object.keys(BUNDLED_PI_REGISTRY)` from
4
+ * `legacy-pi-bundled-keys.ts`'s sibling registry file. `legacy-pi-compat.ts`
5
+ * statically imports this set to seed `LEGACY_PI_PACKAGE_ROOT_OVERRIDES` in
6
+ * compiled-binary mode without dragging the heavy registry's transitive
7
+ * graph into dev/test runs (the registry itself stays behind a dynamic
8
+ * import — see `ensureBundledRegistryLoaded` in `legacy-pi-compat.ts`).
9
+ */
10
+ export declare const BUNDLED_PI_REGISTRY_KEYS: ReadonlySet<string>;
@@ -2,6 +2,9 @@
2
2
  * Canonical specifier → live module namespace. Keys MUST match the right-hand
3
3
  * side of `bundledRegistryVirtualSpecifier(...)` calls in
4
4
  * `legacy-pi-compat.ts`; the synthesizer enumerates each namespace's own
5
- * enumerable exports at extension load time.
5
+ * enumerable exports at extension load time. The companion
6
+ * `legacy-pi-bundled-keys.ts` mirrors `Object.keys(BUNDLED_PI_REGISTRY)` and
7
+ * is statically imported by `legacy-pi-compat.ts` to seed the override map
8
+ * without paying the cascade above.
6
9
  */
7
10
  export declare const BUNDLED_PI_REGISTRY: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
@@ -49,6 +49,18 @@ export declare function __resolveTypeBoxShimPath(isCompiled: boolean, sourcePath
49
49
  * simulate the missing-entrypoint failure mode without touching the real FS.
50
50
  */
51
51
  export declare function __validateLegacyPiPackageRootOverrides(candidates: Record<string, string>, pathExistsSync?: (p: string) => boolean): Record<string, string>;
52
+ /**
53
+ * Compute the override map keyed by every canonical specifier the host serves
54
+ * directly: the pi-ai / pi-coding-agent roots (compat shims that re-attach
55
+ * legacy helpers) plus, in compiled-binary mode, every other canonical pi-*
56
+ * package root AND every non-wildcard subpath registered in the bundled
57
+ * registry (see `legacy-pi-bundled-keys.ts`). Subpath coverage is what stops
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.
62
+ */
63
+ export declare function __buildLegacyPiPackageRootOverrides(isCompiled: boolean): Record<string, string>;
52
64
  /**
53
65
  * Load a legacy Pi extension module from its real on-disk location.
54
66
  *
@@ -1,4 +1,4 @@
1
- import type { InternalResource, InternalUrl, ProtocolHandler, UrlCompletion } from "./types";
1
+ import type { InternalResource, InternalUrl, ProtocolHandler, ResolveContext, UrlCompletion } from "./types";
2
2
  /**
3
3
  * Validate that a path is safe (no traversal, no absolute paths).
4
4
  */
@@ -9,6 +9,6 @@ export declare function validateRelativePath(relativePath: string): void;
9
9
  export declare class SkillProtocolHandler implements ProtocolHandler {
10
10
  readonly scheme = "skill";
11
11
  readonly immutable = true;
12
- resolve(url: InternalUrl): Promise<InternalResource>;
12
+ resolve(url: InternalUrl, context?: ResolveContext): Promise<InternalResource>;
13
13
  complete(): Promise<UrlCompletion[]>;
14
14
  }
@@ -4,6 +4,7 @@
4
4
  * Internal URLs (`agent://`, `artifact://`, `history://`, `issue://`, `local://`, `mcp://`, `memory://`, `omp://`, `pr://`, `rule://`, `skill://`, and `vault://`) are resolved by tools like read,
5
5
  * providing access to agent outputs and server resources without exposing filesystem paths.
6
6
  */
7
+ import type { Skill } from "../extensibility/skills";
7
8
  import type { LocalProtocolOptions } from "./local-protocol";
8
9
  /**
9
10
  * Raw resource payload returned by protocol handlers. The `immutable` flag is
@@ -85,6 +86,8 @@ export interface ResolveContext {
85
86
  * [#1608](https://github.com/can1357/oh-my-pi/issues/1608).
86
87
  */
87
88
  localProtocolOptions?: LocalProtocolOptions;
89
+ /** Calling session's loaded skills. Prefer this over process-global skill state. */
90
+ skills?: readonly Skill[];
88
91
  }
89
92
  /**
90
93
  * Caller context for write operations dispatched to host-owned URI handlers.
@@ -87,8 +87,6 @@ export declare class CustomEditor extends Editor {
87
87
  onPasteImage?: () => Promise<boolean>;
88
88
  /** Called when a bracketed paste contains one or more image-file paths. */
89
89
  onPasteImagePath?: (path: string) => void | Promise<void>;
90
- /** Called when a bracketed paste contains one or more non-image file paths. */
91
- onPasteFilePath?: (path: string) => void | Promise<void>;
92
90
  /** Called when the configured raw text-paste shortcut is pressed. */
93
91
  onPasteTextRaw?: () => void;
94
92
  /** Called when the configured dequeue shortcut is pressed. */
@@ -38,7 +38,6 @@ export declare class InputController {
38
38
  abort?: boolean;
39
39
  currentText?: string;
40
40
  }): number;
41
- handleFilePathPaste(filePath: string): Promise<void>;
42
41
  handleImagePathPaste(path: string): Promise<void>;
43
42
  handleImagePaste(): Promise<boolean>;
44
43
  handleClipboardTextRawPaste(): Promise<void>;
@@ -760,6 +760,8 @@ export declare class AgentSession {
760
760
  abort(options?: {
761
761
  goalReason?: "interrupted" | "internal";
762
762
  reason?: string;
763
+ /** Internal `/compact` startup keeps the manual-compaction marker alive while aborting the active turn. */
764
+ preserveCompaction?: boolean;
763
765
  }): Promise<void>;
764
766
  /**
765
767
  * Start a new session, optionally with initial messages and parent tracking.
@@ -4,6 +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 { ServiceTier } from "@oh-my-pi/pi-ai";
7
8
  import type { Rule } from "../capability/rule";
8
9
  import { ModelRegistry } from "../config/model-registry";
9
10
  import type { PromptTemplate } from "../config/prompt-templates";
@@ -119,6 +120,13 @@ export interface ExecutorOptions {
119
120
  authStorage?: AuthStorage;
120
121
  modelRegistry?: ModelRegistry;
121
122
  settings?: Settings;
123
+ /**
124
+ * Parent session's live effective service tier, the source of truth for a
125
+ * subagent whose `serviceTierSubagent` is `"inherit"`. `null` = the parent
126
+ * explicitly has no tier (e.g. `/fast off`); omitted = no live session, so
127
+ * inherit falls back to the configured `serviceTier` setting.
128
+ */
129
+ parentServiceTier?: ServiceTier | null;
122
130
  /** Override local:// protocol options so subagent shares parent's local:// root */
123
131
  localProtocolOptions?: LocalProtocolOptions;
124
132
  /**
@@ -188,7 +196,7 @@ export declare function finalizeSubprocessOutput(args: FinalizeSubprocessOutputA
188
196
  * Create proxy tools that reuse the parent's MCP connections.
189
197
  */
190
198
  export declare function createMCPProxyTools(mcpManager: MCPManager): CustomTool[];
191
- export declare function createSubagentSettings(baseSettings: Settings, overrides?: Partial<Record<SettingPath, unknown>>): Settings;
199
+ export declare function createSubagentSettings(baseSettings: Settings, overrides?: Partial<Record<SettingPath, unknown>>, inheritedServiceTier?: ServiceTier | null): Settings;
192
200
  /**
193
201
  * Run a single agent in-process.
194
202
  */
@@ -33,6 +33,22 @@ export declare function mapWithConcurrencyLimit<T, R>(items: T[], concurrency: n
33
33
  export declare class Semaphore {
34
34
  #private;
35
35
  constructor(max: number);
36
- acquire(): Promise<void>;
36
+ /**
37
+ * Resolves when a slot is available. Pass an `AbortSignal` so callers that
38
+ * stop waiting (parent task cancelled, wall-clock budget elapsed) also stop
39
+ * occupying a queue slot — otherwise a later `release()` would resolve the
40
+ * abandoned waiter, permanently shrinking effective concurrency for the
41
+ * remaining lifetime of the process (issue #3464 review feedback).
42
+ */
43
+ acquire(signal?: AbortSignal): Promise<void>;
37
44
  release(): void;
45
+ /**
46
+ * Adjust the maximum concurrency in place. Raising the ceiling immediately
47
+ * admits queued waiters that now fit; lowering it lets in-flight holders
48
+ * drain naturally (new acquires keep blocking until `#current` falls below
49
+ * the new max). Resizing the single shared instance — instead of replacing
50
+ * it — keeps in-flight slots counted, so a runtime or mixed limit change can
51
+ * never push concurrency past the cap (issue #3464 review feedback).
52
+ */
53
+ resize(max: number): void;
38
54
  }
@@ -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, ToolChoice } from "@oh-my-pi/pi-ai";
3
+ import type { FetchImpl, ImageContent, Model, ServiceTier, 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,6 +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 effective service tier (undefined = none). Source of truth for subagent `serviceTierSubagent: inherit`. */
195
+ getServiceTier?: () => ServiceTier | undefined;
194
196
  /** Auth storage for passing to subagents (avoids re-discovery) */
195
197
  authStorage?: import("../session/auth-storage").AuthStorage;
196
198
  /** Model registry for passing to subagents (avoids re-discovery) */
@@ -1,3 +1,4 @@
1
+ import type { Skill } from "../extensibility/skills";
1
2
  import { type LocalProtocolOptions } from "../internal-urls";
2
3
  export declare function expandTilde(filePath: string, home?: string): string;
3
4
  export declare function expandPath(filePath: string): string;
@@ -189,6 +190,8 @@ export interface ToolScopeOptions {
189
190
  signal?: AbortSignal;
190
191
  /** Calling session's `local://` root mapping — pins resolutions to the calling session. */
191
192
  localProtocolOptions?: LocalProtocolOptions;
193
+ /** Calling session's loaded skills — lets skill:// resolve without process-global state. */
194
+ skills?: readonly Skill[];
192
195
  }
193
196
  export interface ToolScopeResolution {
194
197
  searchPath: string;
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": "16.1.18",
4
+ "version": "16.1.20",
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=4 test src",
38
+ "test": "bun ../../scripts/ci-test-ts.ts coding-agent-heavy --full",
39
39
  "fix": "biome check --write --unsafe . && bun run format-prompts",
40
40
  "fmt": "biome format --write . && bun run format-prompts",
41
41
  "format-prompts": "bun scripts/format-prompts.ts",
@@ -48,17 +48,17 @@
48
48
  "@agentclientprotocol/sdk": "0.25.0",
49
49
  "@babel/parser": "^7.29.7",
50
50
  "@mozilla/readability": "^0.6.0",
51
- "@oh-my-pi/hashline": "16.1.18",
52
- "@oh-my-pi/omp-stats": "16.1.18",
53
- "@oh-my-pi/pi-agent-core": "16.1.18",
54
- "@oh-my-pi/pi-ai": "16.1.18",
55
- "@oh-my-pi/pi-catalog": "16.1.18",
56
- "@oh-my-pi/pi-mnemopi": "16.1.18",
57
- "@oh-my-pi/pi-natives": "16.1.18",
58
- "@oh-my-pi/pi-tui": "16.1.18",
59
- "@oh-my-pi/pi-utils": "16.1.18",
60
- "@oh-my-pi/pi-wire": "16.1.18",
61
- "@oh-my-pi/snapcompact": "16.1.18",
51
+ "@oh-my-pi/hashline": "16.1.20",
52
+ "@oh-my-pi/omp-stats": "16.1.20",
53
+ "@oh-my-pi/pi-agent-core": "16.1.20",
54
+ "@oh-my-pi/pi-ai": "16.1.20",
55
+ "@oh-my-pi/pi-catalog": "16.1.20",
56
+ "@oh-my-pi/pi-mnemopi": "16.1.20",
57
+ "@oh-my-pi/pi-natives": "16.1.20",
58
+ "@oh-my-pi/pi-tui": "16.1.20",
59
+ "@oh-my-pi/pi-utils": "16.1.20",
60
+ "@oh-my-pi/pi-wire": "16.1.20",
61
+ "@oh-my-pi/snapcompact": "16.1.20",
62
62
  "@opentelemetry/api": "^1.9.1",
63
63
  "@opentelemetry/context-async-hooks": "^2.7.1",
64
64
  "@opentelemetry/exporter-trace-otlp-proto": "^0.218.0",
@@ -51,6 +51,17 @@ async function main(): Promise<void> {
51
51
  try {
52
52
  await runCommand(["bun", "--cwd=../stats", "scripts/generate-client-bundle.ts", "--generate"]);
53
53
  await runCommand(["bun", "scripts/generate-docs-index.ts", "--generate"]);
54
+ // `legacy-pi-bundled-registry.ts` static-imports
55
+ // `@oh-my-pi/pi-coding-agent/export/html` (one of pi-coding-agent's
56
+ // named subpath exports, see scripts/generate-legacy-pi-bundled-registry.ts),
57
+ // whose source pulls in `tool-views.generated.js`. The root
58
+ // `package.json` "prepare" lifecycle hook builds that file on
59
+ // `bun install`, but a clean binary build that skips install hooks
60
+ // would `bun build --compile` against the registry entry and fail
61
+ // resolving the missing generated bundle. Rebuilding the tool views
62
+ // here makes the compile self-contained and matches what `prepack`
63
+ // does for the npm bundle.
64
+ await runCommand(["bun", "--cwd=../collab-web", "run", "build:tool-views"]);
54
65
  await runCommand(
55
66
  ["bun", "--cwd=../natives", "run", "embed:native"],
56
67
  crossTarget
@@ -58,6 +69,15 @@ async function main(): Promise<void> {
58
69
  : Bun.env,
59
70
  );
60
71
  await runCommand(["bun", "scripts/embed-mupdf-wasm.ts", "--generate"]);
72
+ // Regenerate the bundled-pi registry + key set before the compile so any
73
+ // new pi-* subpath export added under `packages/*/package.json` is served
74
+ // from the host's in-process copy. Without this, `bun build --compile`
75
+ // would freeze whatever the committed registry happened to enumerate at
76
+ // the time of the last manual `--generate`, and a new subpath added
77
+ // since then would crash extension validation with `Cannot find module`
78
+ // (issue #3442). The generator also normalizes formatting, so the diff
79
+ // against the committed copy stays clean.
80
+ await runCommand(["bun", "scripts/generate-legacy-pi-bundled-registry.ts", "--generate"]);
61
81
  try {
62
82
  const buildEnv = shouldAdhocSignDarwinBinary() ? { ...Bun.env, BUN_NO_CODESIGN_MACHO_BINARY: "1" } : Bun.env;
63
83
  await runCommand(