@oh-my-pi/pi-coding-agent 16.3.14 → 16.4.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.
Files changed (76) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/cli.js +3053 -3158
  3. package/dist/types/advisor/config.d.ts +7 -0
  4. package/dist/types/cli/args.d.ts +1 -0
  5. package/dist/types/config/model-resolver.d.ts +1 -1
  6. package/dist/types/config/models-config-schema.d.ts +28 -15
  7. package/dist/types/config/models-config.d.ts +6 -0
  8. package/dist/types/config/settings-schema.d.ts +7 -2
  9. package/dist/types/dap/config.d.ts +13 -1
  10. package/dist/types/extensibility/extensions/types.d.ts +6 -0
  11. package/dist/types/lsp/config.d.ts +7 -1
  12. package/dist/types/main.d.ts +2 -0
  13. package/dist/types/mcp/transports/stdio.d.ts +8 -3
  14. package/dist/types/modes/components/hook-selector.d.ts +2 -0
  15. package/dist/types/modes/theme/defaults/index.d.ts +2 -0
  16. package/dist/types/modes/theme/theme.d.ts +3 -2
  17. package/dist/types/sdk.d.ts +2 -0
  18. package/dist/types/session/agent-session.d.ts +5 -3
  19. package/dist/types/session/session-context.test.d.ts +1 -0
  20. package/dist/types/session/session-entries.d.ts +4 -0
  21. package/dist/types/thinking.d.ts +6 -3
  22. package/dist/types/utils/file-display-mode.d.ts +1 -1
  23. package/package.json +12 -12
  24. package/src/advisor/__tests__/config.test.ts +84 -0
  25. package/src/advisor/config.ts +28 -0
  26. package/src/cli/args.ts +1 -0
  27. package/src/cli/flag-tables.ts +3 -0
  28. package/src/config/model-registry.ts +1 -1
  29. package/src/config/model-resolver.ts +14 -12
  30. package/src/config/models-config-schema.ts +3 -2
  31. package/src/config/settings-schema.ts +5 -2
  32. package/src/dap/config.ts +136 -39
  33. package/src/dap/defaults.json +1 -1
  34. package/src/eval/js/shared/runtime.ts +20 -4
  35. package/src/eval/js/worker-core.ts +9 -2
  36. package/src/exec/bash-executor.ts +8 -1
  37. package/src/extensibility/extensions/types.ts +6 -0
  38. package/src/internal-urls/docs-index.generated.txt +1 -1
  39. package/src/lsp/config.ts +27 -13
  40. package/src/lsp/index.ts +114 -29
  41. package/src/main.ts +21 -1
  42. package/src/mcp/transports/stdio.test.ts +12 -0
  43. package/src/mcp/transports/stdio.ts +14 -8
  44. package/src/modes/components/hook-selector.ts +9 -2
  45. package/src/modes/controllers/extension-ui-controller.ts +3 -0
  46. package/src/modes/controllers/input-controller.ts +4 -4
  47. package/src/modes/controllers/selector-controller.ts +1 -1
  48. package/src/modes/theme/defaults/dark-poimandres.json +6 -5
  49. package/src/modes/theme/defaults/light-poimandres.json +6 -5
  50. package/src/modes/theme/theme-schema.json +6 -2
  51. package/src/modes/theme/theme.ts +24 -18
  52. package/src/prompts/agents/init.md +1 -1
  53. package/src/prompts/agents/plan.md +2 -2
  54. package/src/prompts/agents/reviewer.md +1 -1
  55. package/src/prompts/agents/{explore.md → scout.md} +3 -2
  56. package/src/prompts/system/plan-mode-active.md +2 -2
  57. package/src/prompts/system/system-prompt.md +5 -3
  58. package/src/prompts/tools/ast-grep.md +1 -1
  59. package/src/prompts/tools/debug.md +4 -4
  60. package/src/prompts/tools/grep.md +1 -1
  61. package/src/prompts/tools/task.md +2 -2
  62. package/src/sdk.ts +68 -45
  63. package/src/session/agent-session.ts +215 -64
  64. package/src/session/session-context.test.ts +83 -0
  65. package/src/session/session-context.ts +1 -0
  66. package/src/session/session-entries.ts +4 -0
  67. package/src/session/session-manager.ts +9 -1
  68. package/src/system-prompt.test.ts +20 -11
  69. package/src/task/agents.ts +2 -5
  70. package/src/task/executor.ts +111 -74
  71. package/src/thinking.ts +16 -7
  72. package/src/tools/ask.ts +51 -13
  73. package/src/tools/browser/cmux/cmux-tab.ts +21 -12
  74. package/src/tools/debug.ts +41 -11
  75. package/src/utils/file-display-mode.ts +1 -1
  76. package/src/prompts/agents/tester.md +0 -111
@@ -29,6 +29,13 @@ export interface DiscoveredAdvisors {
29
29
  * survives; callers dedupe collisions.
30
30
  */
31
31
  export declare function slugifyAdvisorName(name: string): string;
32
+ /**
33
+ * Returns a stable provider-facing UUIDv7 for one advisor within one primary session.
34
+ *
35
+ * Codex treats `session_id`/`conversation_id` as a UUID-shaped routing identity,
36
+ * so advisor labels such as `-advisor` stay local-only.
37
+ */
38
+ export declare function getOrCreateAdvisorProviderSessionId(ids: Map<string, string>, primarySessionId: string | undefined, slug: string, randomSessionId?: () => string): string | undefined;
32
39
  /**
33
40
  * Discover advisor configs from `WATCHDOG.yml`/`WATCHDOG.yaml` files on the same
34
41
  * user + project search path as `WATCHDOG.md`. Advisors are keyed by slug; a
@@ -26,6 +26,7 @@ export interface Args {
26
26
  noSession?: boolean;
27
27
  sessionDir?: string;
28
28
  providerSessionId?: string;
29
+ providerPromptCacheKey?: string;
29
30
  fork?: string;
30
31
  /** Collab link to join at startup (set by the `join` subcommand; no CLI flag). */
31
32
  join?: string;
@@ -34,7 +34,7 @@ export interface ScopedModel {
34
34
  explicitThinkingLevel: boolean;
35
35
  }
36
36
  interface ThinkingSuffixOptions {
37
- allowMaxAlias?: boolean;
37
+ allowMaxSuffix?: boolean;
38
38
  allowAutoAlias?: boolean;
39
39
  }
40
40
  interface ModelStringParseOptions extends ThinkingSuffixOptions {
@@ -9,6 +9,7 @@ export declare const OpenAICompatSchema: import("arktype/internal/variants/objec
9
9
  medium?: string | undefined;
10
10
  high?: string | undefined;
11
11
  xhigh?: string | undefined;
12
+ max?: string | undefined;
12
13
  } | undefined;
13
14
  maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
14
15
  supportsUsageInStreaming?: boolean | undefined;
@@ -58,6 +59,7 @@ export declare const OpenAICompatSchema: import("arktype/internal/variants/objec
58
59
  medium?: string | undefined;
59
60
  high?: string | undefined;
60
61
  xhigh?: string | undefined;
62
+ max?: string | undefined;
61
63
  } | undefined;
62
64
  maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
63
65
  supportsUsageInStreaming?: boolean | undefined;
@@ -103,19 +105,20 @@ export declare const ModelOverrideSchema: import("arktype/internal/variants/obje
103
105
  reasoning?: boolean | undefined;
104
106
  thinking?: ((In: {
105
107
  mode: "anthropic-adaptive" | "anthropic-budget-effort" | "budget" | "effort" | "google-level";
106
- efforts?: ("high" | "low" | "medium" | "minimal" | "xhigh")[] | undefined;
107
- defaultLevel?: "high" | "low" | "medium" | "minimal" | "xhigh" | undefined;
108
+ efforts?: ("high" | "low" | "max" | "medium" | "minimal" | "xhigh")[] | undefined;
109
+ defaultLevel?: "high" | "low" | "max" | "medium" | "minimal" | "xhigh" | undefined;
108
110
  effortMap?: {
109
111
  minimal?: string | undefined;
110
112
  low?: string | undefined;
111
113
  medium?: string | undefined;
112
114
  high?: string | undefined;
113
115
  xhigh?: string | undefined;
116
+ max?: string | undefined;
114
117
  } | undefined;
115
118
  supportsDisplay?: boolean | undefined;
116
- minLevel?: "high" | "low" | "medium" | "minimal" | "xhigh" | undefined;
117
- maxLevel?: "high" | "low" | "medium" | "minimal" | "xhigh" | undefined;
118
- levels?: ("high" | "low" | "medium" | "minimal" | "xhigh")[] | undefined;
119
+ minLevel?: "high" | "low" | "max" | "medium" | "minimal" | "xhigh" | undefined;
120
+ maxLevel?: "high" | "low" | "max" | "medium" | "minimal" | "xhigh" | undefined;
121
+ levels?: ("high" | "low" | "max" | "medium" | "minimal" | "xhigh")[] | undefined;
119
122
  }) => import("arktype").Out<{
120
123
  mode: any;
121
124
  efforts: any;
@@ -149,6 +152,7 @@ export declare const ModelOverrideSchema: import("arktype/internal/variants/obje
149
152
  medium?: string | undefined;
150
153
  high?: string | undefined;
151
154
  xhigh?: string | undefined;
155
+ max?: string | undefined;
152
156
  } | undefined;
153
157
  maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
154
158
  supportsUsageInStreaming?: boolean | undefined;
@@ -198,6 +202,7 @@ export declare const ModelOverrideSchema: import("arktype/internal/variants/obje
198
202
  medium?: string | undefined;
199
203
  high?: string | undefined;
200
204
  xhigh?: string | undefined;
205
+ max?: string | undefined;
201
206
  } | undefined;
202
207
  maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
203
208
  supportsUsageInStreaming?: boolean | undefined;
@@ -277,6 +282,7 @@ export declare const ModelsConfigSchema: import("arktype/internal/variants/objec
277
282
  medium?: string | undefined;
278
283
  high?: string | undefined;
279
284
  xhigh?: string | undefined;
285
+ max?: string | undefined;
280
286
  } | undefined;
281
287
  maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
282
288
  supportsUsageInStreaming?: boolean | undefined;
@@ -326,6 +332,7 @@ export declare const ModelsConfigSchema: import("arktype/internal/variants/objec
326
332
  medium?: string | undefined;
327
333
  high?: string | undefined;
328
334
  xhigh?: string | undefined;
335
+ max?: string | undefined;
329
336
  } | undefined;
330
337
  maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
331
338
  supportsUsageInStreaming?: boolean | undefined;
@@ -388,19 +395,20 @@ export declare const ModelsConfigSchema: import("arktype/internal/variants/objec
388
395
  reasoning?: boolean | undefined;
389
396
  thinking?: ((In: {
390
397
  mode: "anthropic-adaptive" | "anthropic-budget-effort" | "budget" | "effort" | "google-level";
391
- efforts?: ("high" | "low" | "medium" | "minimal" | "xhigh")[] | undefined;
392
- defaultLevel?: "high" | "low" | "medium" | "minimal" | "xhigh" | undefined;
398
+ efforts?: ("high" | "low" | "max" | "medium" | "minimal" | "xhigh")[] | undefined;
399
+ defaultLevel?: "high" | "low" | "max" | "medium" | "minimal" | "xhigh" | undefined;
393
400
  effortMap?: {
394
401
  minimal?: string | undefined;
395
402
  low?: string | undefined;
396
403
  medium?: string | undefined;
397
404
  high?: string | undefined;
398
405
  xhigh?: string | undefined;
406
+ max?: string | undefined;
399
407
  } | undefined;
400
408
  supportsDisplay?: boolean | undefined;
401
- minLevel?: "high" | "low" | "medium" | "minimal" | "xhigh" | undefined;
402
- maxLevel?: "high" | "low" | "medium" | "minimal" | "xhigh" | undefined;
403
- levels?: ("high" | "low" | "medium" | "minimal" | "xhigh")[] | undefined;
409
+ minLevel?: "high" | "low" | "max" | "medium" | "minimal" | "xhigh" | undefined;
410
+ maxLevel?: "high" | "low" | "max" | "medium" | "minimal" | "xhigh" | undefined;
411
+ levels?: ("high" | "low" | "max" | "medium" | "minimal" | "xhigh")[] | undefined;
404
412
  }) => import("arktype").Out<{
405
413
  mode: any;
406
414
  efforts: any;
@@ -434,6 +442,7 @@ export declare const ModelsConfigSchema: import("arktype/internal/variants/objec
434
442
  medium?: string | undefined;
435
443
  high?: string | undefined;
436
444
  xhigh?: string | undefined;
445
+ max?: string | undefined;
437
446
  } | undefined;
438
447
  maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
439
448
  supportsUsageInStreaming?: boolean | undefined;
@@ -483,6 +492,7 @@ export declare const ModelsConfigSchema: import("arktype/internal/variants/objec
483
492
  medium?: string | undefined;
484
493
  high?: string | undefined;
485
494
  xhigh?: string | undefined;
495
+ max?: string | undefined;
486
496
  } | undefined;
487
497
  maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
488
498
  supportsUsageInStreaming?: boolean | undefined;
@@ -541,19 +551,20 @@ export declare const ModelsConfigSchema: import("arktype/internal/variants/objec
541
551
  reasoning?: boolean | undefined;
542
552
  thinking?: ((In: {
543
553
  mode: "anthropic-adaptive" | "anthropic-budget-effort" | "budget" | "effort" | "google-level";
544
- efforts?: ("high" | "low" | "medium" | "minimal" | "xhigh")[] | undefined;
545
- defaultLevel?: "high" | "low" | "medium" | "minimal" | "xhigh" | undefined;
554
+ efforts?: ("high" | "low" | "max" | "medium" | "minimal" | "xhigh")[] | undefined;
555
+ defaultLevel?: "high" | "low" | "max" | "medium" | "minimal" | "xhigh" | undefined;
546
556
  effortMap?: {
547
557
  minimal?: string | undefined;
548
558
  low?: string | undefined;
549
559
  medium?: string | undefined;
550
560
  high?: string | undefined;
551
561
  xhigh?: string | undefined;
562
+ max?: string | undefined;
552
563
  } | undefined;
553
564
  supportsDisplay?: boolean | undefined;
554
- minLevel?: "high" | "low" | "medium" | "minimal" | "xhigh" | undefined;
555
- maxLevel?: "high" | "low" | "medium" | "minimal" | "xhigh" | undefined;
556
- levels?: ("high" | "low" | "medium" | "minimal" | "xhigh")[] | undefined;
565
+ minLevel?: "high" | "low" | "max" | "medium" | "minimal" | "xhigh" | undefined;
566
+ maxLevel?: "high" | "low" | "max" | "medium" | "minimal" | "xhigh" | undefined;
567
+ levels?: ("high" | "low" | "max" | "medium" | "minimal" | "xhigh")[] | undefined;
557
568
  }) => import("arktype").Out<{
558
569
  mode: any;
559
570
  efforts: any;
@@ -587,6 +598,7 @@ export declare const ModelsConfigSchema: import("arktype/internal/variants/objec
587
598
  medium?: string | undefined;
588
599
  high?: string | undefined;
589
600
  xhigh?: string | undefined;
601
+ max?: string | undefined;
590
602
  } | undefined;
591
603
  maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
592
604
  supportsUsageInStreaming?: boolean | undefined;
@@ -636,6 +648,7 @@ export declare const ModelsConfigSchema: import("arktype/internal/variants/objec
636
648
  medium?: string | undefined;
637
649
  high?: string | undefined;
638
650
  xhigh?: string | undefined;
651
+ max?: string | undefined;
639
652
  } | undefined;
640
653
  maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
641
654
  supportsUsageInStreaming?: boolean | undefined;
@@ -47,6 +47,7 @@ export declare const ModelsConfigFile: ConfigFile<{
47
47
  medium?: string | undefined;
48
48
  high?: string | undefined;
49
49
  xhigh?: string | undefined;
50
+ max?: string | undefined;
50
51
  } | undefined;
51
52
  maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
52
53
  supportsUsageInStreaming?: boolean | undefined;
@@ -96,6 +97,7 @@ export declare const ModelsConfigFile: ConfigFile<{
96
97
  medium?: string | undefined;
97
98
  high?: string | undefined;
98
99
  xhigh?: string | undefined;
100
+ max?: string | undefined;
99
101
  } | undefined;
100
102
  maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
101
103
  supportsUsageInStreaming?: boolean | undefined;
@@ -189,6 +191,7 @@ export declare const ModelsConfigFile: ConfigFile<{
189
191
  medium?: string | undefined;
190
192
  high?: string | undefined;
191
193
  xhigh?: string | undefined;
194
+ max?: string | undefined;
192
195
  } | undefined;
193
196
  maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
194
197
  supportsUsageInStreaming?: boolean | undefined;
@@ -238,6 +241,7 @@ export declare const ModelsConfigFile: ConfigFile<{
238
241
  medium?: string | undefined;
239
242
  high?: string | undefined;
240
243
  xhigh?: string | undefined;
244
+ max?: string | undefined;
241
245
  } | undefined;
242
246
  maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
243
247
  supportsUsageInStreaming?: boolean | undefined;
@@ -327,6 +331,7 @@ export declare const ModelsConfigFile: ConfigFile<{
327
331
  medium?: string | undefined;
328
332
  high?: string | undefined;
329
333
  xhigh?: string | undefined;
334
+ max?: string | undefined;
330
335
  } | undefined;
331
336
  maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
332
337
  supportsUsageInStreaming?: boolean | undefined;
@@ -376,6 +381,7 @@ export declare const ModelsConfigFile: ConfigFile<{
376
381
  medium?: string | undefined;
377
382
  high?: string | undefined;
378
383
  xhigh?: string | undefined;
384
+ max?: string | undefined;
379
385
  } | undefined;
380
386
  maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
381
387
  supportsUsageInStreaming?: boolean | undefined;
@@ -872,7 +872,7 @@ export declare const SETTINGS_SCHEMA: {
872
872
  };
873
873
  readonly defaultThinkingLevel: {
874
874
  readonly type: "enum";
875
- readonly values: readonly [...import("@oh-my-pi/pi-catalog").Effort[], "auto", "max"];
875
+ readonly values: readonly [...import("@oh-my-pi/pi-catalog").Effort[], "auto"];
876
876
  readonly default: "high";
877
877
  readonly ui: {
878
878
  readonly tab: "model";
@@ -4296,7 +4296,7 @@ export declare const SETTINGS_SCHEMA: {
4296
4296
  readonly tab: "tasks";
4297
4297
  readonly group: "Subagents";
4298
4298
  readonly label: "Soft Subagent Request Budget";
4299
- readonly description: "Soft per-subagent request budget (assistant requests per run). Crossing it can inject a steering notice when task.softRequestBudgetNotice is enabled; at 1.5x the budget the run is aborted gracefully, salvaging partial output. 0 disables the guard. Bundled explore/sonic agents use a lower built-in budget.";
4299
+ readonly description: "Soft per-subagent request budget (assistant requests per run). Crossing it can inject a steering notice when task.softRequestBudgetNotice is enabled; at 1.5x the budget the run is aborted gracefully, salvaging partial output. 0 disables the guard. Bundled scout/sonic agents use a lower built-in budget.";
4300
4300
  readonly options: readonly [{
4301
4301
  readonly value: "0";
4302
4302
  readonly label: "Disabled";
@@ -5440,6 +5440,10 @@ export declare const SETTINGS_SCHEMA: {
5440
5440
  readonly type: "number";
5441
5441
  readonly default: 32768;
5442
5442
  };
5443
+ readonly "thinkingBudgets.max": {
5444
+ readonly type: "number";
5445
+ readonly default: 32768;
5446
+ };
5443
5447
  };
5444
5448
  type Schema = typeof SETTINGS_SCHEMA;
5445
5449
  /** All valid setting paths */
@@ -5604,6 +5608,7 @@ export interface ThinkingBudgetsSettings {
5604
5608
  medium: number;
5605
5609
  high: number;
5606
5610
  xhigh: number;
5611
+ max: number;
5607
5612
  }
5608
5613
  export interface SttSettings {
5609
5614
  enabled: boolean;
@@ -2,7 +2,19 @@ import type { DapAdapterConfig, DapResolvedAdapter } from "./types.js";
2
2
  export declare function getAdapterConfigs(cwd?: string): Record<string, DapAdapterConfig>;
3
3
  export declare function resolveAdapter(adapterName: string, cwd: string): DapResolvedAdapter | null;
4
4
  export declare function getAvailableAdapters(cwd: string): DapResolvedAdapter[];
5
- export declare function selectLaunchAdapter(program: string, cwd: string, adapterName?: string, programKind?: LaunchProgramKind): DapResolvedAdapter | null;
5
+ /** Launch adapter selection, including a configured adapter whose command is unavailable. */
6
+ export type LaunchAdapterSelection = {
7
+ kind: "adapter";
8
+ adapter: DapResolvedAdapter;
9
+ } | {
10
+ kind: "unavailable";
11
+ adapterName: string;
12
+ command: string;
13
+ } | {
14
+ kind: "none";
15
+ };
16
+ /** Selects a launch adapter or reports why matching configuration cannot run. */
17
+ export declare function selectLaunchAdapter(program: string, cwd: string, adapterName?: string, programKind?: LaunchProgramKind): LaunchAdapterSelection;
6
18
  export declare function selectAttachAdapter(cwd: string, adapterName?: string, port?: number): DapResolvedAdapter | null;
7
19
  /** How the launch `program` resolves on disk. `"missing"` is reserved for
8
20
  * programs the adapter creates on demand (rare); we treat them like files. */
@@ -51,6 +51,10 @@ export interface ExtensionUIDialogOptions {
51
51
  timeout?: number;
52
52
  /** Invoked when the UI times out while waiting for a selection/input */
53
53
  onTimeout?: () => void;
54
+ /** Invoked when the UI-managed timeout countdown starts */
55
+ onTimeoutStart?: () => void;
56
+ /** Invoked when user input resets a UI-managed timeout countdown */
57
+ onTimeoutReset?: () => void;
54
58
  /** Initial cursor position for select dialogs (0-indexed) */
55
59
  initialIndex?: number;
56
60
  /** Render an outlined list for select dialogs */
@@ -96,6 +100,8 @@ export type AutocompleteProviderFactory = (current: AutocompleteProvider) => Aut
96
100
  * Each mode (interactive, RPC, print) provides its own implementation.
97
101
  */
98
102
  export interface ExtensionUIContext {
103
+ /** True when selector timeouts start only after the dialog is presented. */
104
+ timeoutStartsOnPresentation?: boolean;
99
105
  /** Show a selector and return the selected label, even when an option also includes a description. */
100
106
  select(title: string, options: ExtensionUISelectItem[], dialogOptions?: ExtensionUIDialogOptions): Promise<string | undefined>;
101
107
  /** Show a confirmation dialog. */
@@ -1,3 +1,4 @@
1
+ import { type WhichOptions } from "@oh-my-pi/pi-utils";
1
2
  import type { ServerConfig } from "./types.js";
2
3
  export interface LspConfig {
3
4
  servers: Record<string, ServerConfig>;
@@ -12,6 +13,11 @@ export declare function hasRootMarkers(cwd: string, markers: string[]): boolean;
12
13
  * Check whether any ancestor directory of a file is an LSP project root.
13
14
  */
14
15
  export declare function hasRootMarkerAncestor(filePath: string, markers: string[]): boolean;
16
+ /** Controls project-local and PATH executable lookup. */
17
+ export interface ResolveCommandOptions extends Pick<WhichOptions, "cache" | "PATH"> {
18
+ /** Ordered project roots checked before PATH; defaults to the command cwd. */
19
+ localRoots?: readonly string[];
20
+ }
15
21
  /**
16
22
  * Resolve a command to an executable path.
17
23
  * Checks project-local bin directories first, then falls back to $PATH.
@@ -20,7 +26,7 @@ export declare function hasRootMarkerAncestor(filePath: string, markers: string[
20
26
  * @param cwd - Working directory to search from
21
27
  * @returns Absolute path to the executable, or null if not found
22
28
  */
23
- export declare function resolveCommand(command: string, cwd: string): string | null;
29
+ export declare function resolveCommand(command: string, cwd: string, options?: ResolveCommandOptions): string | null;
24
30
  /**
25
31
  * Load LSP configuration.
26
32
  *
@@ -57,6 +57,8 @@ export declare class SessionResolutionError extends Error {
57
57
  export declare function createSessionManager(parsed: Args, cwd: string, activeSettings?: Settings, askToForkSession?: SessionPrompt, askToMoveSession?: SessionPrompt): Promise<SessionManager | undefined>;
58
58
  /** Apply resolved CLI/discovered prompt files without bypassing system prompt templates. */
59
59
  export declare function applyResolvedSystemPromptInputs(options: CreateAgentSessionOptions, resolvedSystemPrompt: string | undefined, resolvedAppendPrompt: string | undefined): void;
60
+ /** Builds startup session options from parsed CLI flags, scoped models, and resolved session lineage. */
61
+ export declare function buildSessionOptions(parsed: Args, scopedModels: ScopedModel[], sessionManager: SessionManager | undefined, modelRegistry: ModelRegistry, activeSettings: Settings): Promise<CreateAgentSessionOptions>;
60
62
  interface RunRootCommandDependencies {
61
63
  createAgentSession?: typeof createAgentSession;
62
64
  discoverAuthStorage?: typeof discoverAuthStorage;
@@ -20,13 +20,18 @@ export interface StdioSpawnCommand {
20
20
  */
21
21
  windowsHide?: boolean;
22
22
  /**
23
- * Run the subprocess in its own session.
23
+ * Run the subprocess in its own session when the platform can safely do so.
24
24
  *
25
- * POSIX: `true`. Detach → `setsid`, so the MCP process tree has no
26
- * controlling terminal and terminal job-control signals (Ctrl+Z SIGTSTP,
25
+ * Linux/other POSIX: `true`. Detach → `setsid`, so the MCP process tree has
26
+ * no controlling terminal and terminal job-control signals (Ctrl+Z SIGTSTP,
27
27
  * background-read SIGTTIN) cannot stop stdio servers such as
28
28
  * `chrome-devtools-mcp` and leave our read loop blocked on silent pipes.
29
29
  *
30
+ * macOS: `false`. LaunchServices/TCC attributes Apple Events automation to
31
+ * the responsible terminal process only while the child stays in the
32
+ * inherited session; detaching via `setsid` prevents the permission prompt
33
+ * for servers such as `xcrun mcpbridge` (#4987).
34
+ *
30
35
  * Windows: `false`. There is no SIGTSTP/SIGTTIN to escape, and Windows
31
36
  * wrapper chains must stay in the OMP console session so nested console
32
37
  * grandchildren keep stdout routed through our pipe (#3544).
@@ -31,6 +31,8 @@ export interface HookSelectorOptions {
31
31
  tui?: TUI;
32
32
  timeout?: number;
33
33
  onTimeout?: () => void;
34
+ onTimeoutStart?: () => void;
35
+ onTimeoutReset?: () => void;
34
36
  initialIndex?: number;
35
37
  outline?: boolean;
36
38
  maxVisible?: number;
@@ -2917,6 +2917,7 @@ export declare const defaultThemes: {
2917
2917
  "thinking.medium": string;
2918
2918
  "thinking.high": string;
2919
2919
  "thinking.xhigh": string;
2920
+ "thinking.max": string;
2920
2921
  "icon.model": string;
2921
2922
  "icon.plan": string;
2922
2923
  "icon.goal": string;
@@ -7435,6 +7436,7 @@ export declare const defaultThemes: {
7435
7436
  "thinking.medium": string;
7436
7437
  "thinking.high": string;
7437
7438
  "thinking.xhigh": string;
7439
+ "thinking.max": string;
7438
7440
  "icon.model": string;
7439
7441
  "icon.plan": string;
7440
7442
  "icon.goal": string;
@@ -6,9 +6,9 @@ export type SymbolPreset = "unicode" | "nerd" | "ascii";
6
6
  /**
7
7
  * All available symbol keys organized by category.
8
8
  */
9
- export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted" | "status.done" | "nav.cursor" | "nav.selected" | "nav.expand" | "nav.collapse" | "nav.back" | "tree.branch" | "tree.last" | "tree.vertical" | "tree.horizontal" | "tree.hook" | "boxRound.topLeft" | "boxRound.topRight" | "boxRound.bottomLeft" | "boxRound.bottomRight" | "boxRound.horizontal" | "boxRound.vertical" | "boxSharp.topLeft" | "boxSharp.topRight" | "boxSharp.bottomLeft" | "boxSharp.bottomRight" | "boxSharp.horizontal" | "boxSharp.vertical" | "boxSharp.cross" | "boxSharp.teeDown" | "boxSharp.teeUp" | "boxSharp.teeRight" | "boxSharp.teeLeft" | "sep.powerline" | "sep.powerlineThin" | "sep.powerlineLeft" | "sep.powerlineRight" | "sep.powerlineThinLeft" | "sep.powerlineThinRight" | "sep.block" | "sep.space" | "sep.asciiLeft" | "sep.asciiRight" | "sep.dot" | "sep.slash" | "sep.pipe" | "icon.model" | "icon.plan" | "icon.goal" | "icon.pause" | "icon.loop" | "icon.folder" | "icon.worktree" | "icon.search" | "icon.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.time" | "icon.pi" | "icon.ghost" | "icon.agents" | "icon.job" | "icon.cache" | "icon.cacheMiss" | "icon.input" | "icon.output" | "icon.throughput" | "icon.host" | "icon.session" | "icon.package" | "icon.warning" | "icon.rewind" | "icon.auto" | "icon.fast" | "icon.extensionSkill" | "icon.extensionTool" | "icon.extensionSlashCommand" | "icon.extensionMcp" | "icon.extensionRule" | "icon.extensionHook" | "icon.extensionPrompt" | "icon.extensionContextFile" | "icon.extensionInstruction" | "icon.mic" | "icon.camera" | "thinking.minimal" | "thinking.low" | "thinking.medium" | "thinking.high" | "thinking.xhigh" | "thinking.autoPending" | "checkbox.checked" | "checkbox.unchecked" | "radio.selected" | "radio.unselected" | "format.bullet" | "format.dash" | "format.bracketLeft" | "format.bracketRight" | "md.quoteBorder" | "md.hrChar" | "md.bullet" | "md.colorSwatch" | "advisor.rail" | "lang.default" | "lang.typescript" | "lang.javascript" | "lang.python" | "lang.rust" | "lang.go" | "lang.java" | "lang.c" | "lang.cpp" | "lang.csharp" | "lang.ruby" | "lang.julia" | "lang.php" | "lang.swift" | "lang.kotlin" | "lang.shell" | "lang.html" | "lang.css" | "lang.json" | "lang.yaml" | "lang.markdown" | "lang.sql" | "lang.docker" | "lang.lua" | "lang.text" | "lang.env" | "lang.toml" | "lang.xml" | "lang.ini" | "lang.conf" | "lang.log" | "lang.csv" | "lang.tsv" | "lang.image" | "lang.pdf" | "lang.archive" | "lang.binary" | "tab.appearance" | "tab.model" | "tab.interaction" | "tab.context" | "tab.files" | "tab.shell" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers" | "tool.write" | "tool.edit" | "tool.bash" | "tool.ssh" | "tool.lsp" | "tool.gh" | "tool.webSearch" | "tool.exa" | "tool.browser" | "tool.eval" | "tool.debug" | "tool.mcp" | "tool.job" | "tool.task" | "tool.todo" | "tool.memory" | "tool.ask" | "tool.resolve" | "tool.review" | "tool.inspectImage" | "tool.goal" | "tool.irc" | "tool.delete" | "tool.move";
9
+ export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted" | "status.done" | "nav.cursor" | "nav.selected" | "nav.expand" | "nav.collapse" | "nav.back" | "tree.branch" | "tree.last" | "tree.vertical" | "tree.horizontal" | "tree.hook" | "boxRound.topLeft" | "boxRound.topRight" | "boxRound.bottomLeft" | "boxRound.bottomRight" | "boxRound.horizontal" | "boxRound.vertical" | "boxSharp.topLeft" | "boxSharp.topRight" | "boxSharp.bottomLeft" | "boxSharp.bottomRight" | "boxSharp.horizontal" | "boxSharp.vertical" | "boxSharp.cross" | "boxSharp.teeDown" | "boxSharp.teeUp" | "boxSharp.teeRight" | "boxSharp.teeLeft" | "sep.powerline" | "sep.powerlineThin" | "sep.powerlineLeft" | "sep.powerlineRight" | "sep.powerlineThinLeft" | "sep.powerlineThinRight" | "sep.block" | "sep.space" | "sep.asciiLeft" | "sep.asciiRight" | "sep.dot" | "sep.slash" | "sep.pipe" | "icon.model" | "icon.plan" | "icon.goal" | "icon.pause" | "icon.loop" | "icon.folder" | "icon.worktree" | "icon.search" | "icon.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.time" | "icon.pi" | "icon.ghost" | "icon.agents" | "icon.job" | "icon.cache" | "icon.cacheMiss" | "icon.input" | "icon.output" | "icon.throughput" | "icon.host" | "icon.session" | "icon.package" | "icon.warning" | "icon.rewind" | "icon.auto" | "icon.fast" | "icon.extensionSkill" | "icon.extensionTool" | "icon.extensionSlashCommand" | "icon.extensionMcp" | "icon.extensionRule" | "icon.extensionHook" | "icon.extensionPrompt" | "icon.extensionContextFile" | "icon.extensionInstruction" | "icon.mic" | "icon.camera" | "thinking.minimal" | "thinking.low" | "thinking.medium" | "thinking.high" | "thinking.xhigh" | "thinking.max" | "thinking.autoPending" | "checkbox.checked" | "checkbox.unchecked" | "radio.selected" | "radio.unselected" | "format.bullet" | "format.dash" | "format.bracketLeft" | "format.bracketRight" | "md.quoteBorder" | "md.hrChar" | "md.bullet" | "md.colorSwatch" | "advisor.rail" | "lang.default" | "lang.typescript" | "lang.javascript" | "lang.python" | "lang.rust" | "lang.go" | "lang.java" | "lang.c" | "lang.cpp" | "lang.csharp" | "lang.ruby" | "lang.julia" | "lang.php" | "lang.swift" | "lang.kotlin" | "lang.shell" | "lang.html" | "lang.css" | "lang.json" | "lang.yaml" | "lang.markdown" | "lang.sql" | "lang.docker" | "lang.lua" | "lang.text" | "lang.env" | "lang.toml" | "lang.xml" | "lang.ini" | "lang.conf" | "lang.log" | "lang.csv" | "lang.tsv" | "lang.image" | "lang.pdf" | "lang.archive" | "lang.binary" | "tab.appearance" | "tab.model" | "tab.interaction" | "tab.context" | "tab.files" | "tab.shell" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers" | "tool.write" | "tool.edit" | "tool.bash" | "tool.ssh" | "tool.lsp" | "tool.gh" | "tool.webSearch" | "tool.exa" | "tool.browser" | "tool.eval" | "tool.debug" | "tool.mcp" | "tool.job" | "tool.task" | "tool.todo" | "tool.memory" | "tool.ask" | "tool.resolve" | "tool.review" | "tool.inspectImage" | "tool.goal" | "tool.irc" | "tool.delete" | "tool.move";
10
10
  export type SpinnerType = "status" | "activity";
11
- export type ThemeColor = "accent" | "border" | "borderAccent" | "borderMuted" | "success" | "error" | "warning" | "muted" | "dim" | "text" | "thinkingText" | "userMessageText" | "customMessageText" | "customMessageLabel" | "toolTitle" | "toolOutput" | "mdHeading" | "mdLink" | "mdLinkUrl" | "mdCode" | "mdCodeBlock" | "mdCodeBlockBorder" | "mdQuote" | "mdQuoteBorder" | "mdHr" | "mdListBullet" | "toolDiffAdded" | "toolDiffRemoved" | "toolDiffContext" | "syntaxComment" | "syntaxKeyword" | "syntaxFunction" | "syntaxVariable" | "syntaxString" | "syntaxNumber" | "syntaxType" | "syntaxOperator" | "syntaxPunctuation" | "thinkingOff" | "thinkingMinimal" | "thinkingLow" | "thinkingMedium" | "thinkingHigh" | "thinkingXhigh" | "bashMode" | "pythonMode" | "statusLineSep" | "statusLineModel" | "statusLinePath" | "statusLineGitClean" | "statusLineGitDirty" | "statusLineContext" | "statusLineSpend" | "statusLineStaged" | "statusLineDirty" | "statusLineUntracked" | "statusLineOutput" | "statusLineCost" | "statusLineSubagents";
11
+ export type ThemeColor = "accent" | "border" | "borderAccent" | "borderMuted" | "success" | "error" | "warning" | "muted" | "dim" | "text" | "thinkingText" | "userMessageText" | "customMessageText" | "customMessageLabel" | "toolTitle" | "toolOutput" | "mdHeading" | "mdLink" | "mdLinkUrl" | "mdCode" | "mdCodeBlock" | "mdCodeBlockBorder" | "mdQuote" | "mdQuoteBorder" | "mdHr" | "mdListBullet" | "toolDiffAdded" | "toolDiffRemoved" | "toolDiffContext" | "syntaxComment" | "syntaxKeyword" | "syntaxFunction" | "syntaxVariable" | "syntaxString" | "syntaxNumber" | "syntaxType" | "syntaxOperator" | "syntaxPunctuation" | "thinkingOff" | "thinkingMinimal" | "thinkingLow" | "thinkingMedium" | "thinkingHigh" | "thinkingXhigh" | "thinkingMax" | "bashMode" | "pythonMode" | "statusLineSep" | "statusLineModel" | "statusLinePath" | "statusLineGitClean" | "statusLineGitDirty" | "statusLineContext" | "statusLineSpend" | "statusLineStaged" | "statusLineDirty" | "statusLineUntracked" | "statusLineOutput" | "statusLineCost" | "statusLineSubagents";
12
12
  /** Check if a string is a valid ThemeColor value */
13
13
  export declare function isValidThemeColor(color: string): color is ThemeColor;
14
14
  export type ThemeBg = "selectedBg" | "userMessageBg" | "customMessageBg" | "toolPendingBg" | "toolSuccessBg" | "toolErrorBg" | "statusLineBg";
@@ -208,6 +208,7 @@ export declare class Theme {
208
208
  medium: string;
209
209
  high: string;
210
210
  xhigh: string;
211
+ max: string;
211
212
  autoPending: string;
212
213
  };
213
214
  get checkbox(): {
@@ -72,6 +72,8 @@ export interface CreateAgentSessionOptions {
72
72
  providerSessionId?: string;
73
73
  /** Optional provider-facing prompt cache key, distinct from request lineage. */
74
74
  providerPromptCacheKey?: string;
75
+ /** Whether `providerPromptCacheKey` is caller-pinned or inherited from a full fork. */
76
+ providerPromptCacheKeySource?: "explicit" | "fork";
75
77
  /** Absolute wall-clock deadline in Unix epoch milliseconds. */
76
78
  deadline?: number;
77
79
  /** Custom tools to register (in addition to built-in tools). Accepts both CustomTool and ToolDefinition. */
@@ -284,6 +284,8 @@ export interface AgentSessionConfig {
284
284
  * so that credential sticky selection is consistent with the session's streaming calls.
285
285
  */
286
286
  providerSessionId?: string;
287
+ /** Marks `agent.promptCacheKey` as fork-inherited so incompatible route changes can clear it. */
288
+ providerPromptCacheKeySource?: "explicit" | "fork";
287
289
  /**
288
290
  * Full advisor toolset, pre-built in `createAgentSession` against a distinct,
289
291
  * advisor-scoped `ToolSession` (its own `-advisor` session/agent id) so the
@@ -662,8 +664,8 @@ export declare class AgentSession {
662
664
  *
663
665
  * @param mcpTools The new MCP tools to register.
664
666
  * @param options.activateAll When true, force-activates every newly registered MCP tool
665
- * regardless of prior selection state. Used when an ACP client provisions MCP servers
666
- * for a session where MCP discovery is disabled.
667
+ * regardless of prior selection state. Used when MCP discovery is disabled and tools
668
+ * arrive after initial session activation.
667
669
  */
668
670
  refreshMCPTools(mcpTools: CustomTool[], options?: {
669
671
  activateAll?: boolean;
@@ -969,7 +971,7 @@ export declare class AgentSession {
969
971
  */
970
972
  setThinkingLevel(level: ConfiguredThinkingLevel | undefined, persist?: boolean): void;
971
973
  /**
972
- * Cycle to next thinking level: off → auto → minimal..xhigh → off.
974
+ * Cycle to next thinking level: off → auto → minimal..max → off.
973
975
  * @returns New selector, or undefined if model doesn't support thinking
974
976
  */
975
977
  cycleThinkingLevel(): ConfiguredThinkingLevel | undefined;
@@ -0,0 +1 @@
1
+ export {};
@@ -24,9 +24,13 @@ export interface SessionHeader {
24
24
  timestamp: string;
25
25
  cwd: string;
26
26
  parentSession?: string;
27
+ /** Provider prompt-cache identity inherited by exact-route full forks. */
28
+ providerPromptCacheKey?: string;
27
29
  }
28
30
  export interface NewSessionOptions {
29
31
  parentSession?: string;
32
+ /** Provider prompt-cache identity to seed on the new session header. */
33
+ providerPromptCacheKey?: string;
30
34
  /** Skip flushing the current session and delete it instead of saving. */
31
35
  drop?: boolean;
32
36
  }
@@ -59,14 +59,14 @@ export declare function parseConfiguredThinkingLevel(value: string | null | unde
59
59
  export declare function getConfiguredThinkingLevelMetadata(level: ConfiguredThinkingLevel): ConfiguredThinkingLevelMetadata;
60
60
  /**
61
61
  * Thinking selectors accepted by the `--thinking` CLI flag, in display order:
62
- * `off`, every concrete effort (`minimal`..`xhigh`), then `auto`. Single source
62
+ * `off`, every concrete effort (`minimal`..`max`), then `auto`. Single source
63
63
  * for the flag's `options` list, shell completions, and the "invalid level"
64
64
  * warning so all three stay in sync.
65
65
  */
66
66
  export declare const CLI_THINKING_LEVELS: readonly string[];
67
67
  /**
68
68
  * Parses a `--thinking` CLI value. Accepts every {@link parseConfiguredThinkingLevel}
69
- * selector (`off`, `auto`, `minimal`..`xhigh`, plus the `max` alias) but rejects
69
+ * selector (`off`, `auto`, `minimal`..`max`) but rejects
70
70
  * `inherit`: an explicit `inherit` on the command line would suppress the
71
71
  * settings/scoped-model fallback during startup resolution only to resolve back
72
72
  * to the provider default, which is never what the user means.
@@ -91,6 +91,9 @@ export declare function clampAutoThinkingEffort(model: Model | undefined, effort
91
91
  /**
92
92
  * The provisional concrete level shown while `auto` is configured but before a
93
93
  * turn has been classified. Prefers the model's `defaultLevel`, otherwise High,
94
- * clamped into the auto range. Returns `undefined` for non-reasoning models.
94
+ * clamped into the auto range. Auto never provisions {@link Effort.Max} (the
95
+ * classifier ceiling is XHigh; only an explicit user request reaches Max), so a
96
+ * `defaultLevel` of `max` is capped at XHigh before clamping. Returns
97
+ * `undefined` for non-reasoning models.
95
98
  */
96
99
  export declare function resolveProvisionalAutoLevel(model: Model | undefined): Effort | undefined;
@@ -16,7 +16,7 @@ export interface FileDisplayModeSession {
16
16
  /**
17
17
  * Computes effective line display mode from session settings/env.
18
18
  * Hashline mode takes precedence and implies line-addressed output everywhere.
19
- * Hashlines are suppressed when the edit tool is not available (e.g. explore agents),
19
+ * Hashlines are suppressed when the edit tool is not available (e.g. scout agents),
20
20
  * when the caller signals a `raw` read, and when the source is `immutable`
21
21
  * (e.g. internal URLs like artifact://, agent://, memory:// — there is no edit
22
22
  * path that could consume the anchors). Raw output is returned as-is.
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.3.14",
4
+ "version": "16.4.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",
@@ -56,17 +56,17 @@
56
56
  "@agentclientprotocol/sdk": "0.25.0",
57
57
  "@babel/parser": "^7.29.7",
58
58
  "@mozilla/readability": "^0.6.0",
59
- "@oh-my-pi/hashline": "16.3.14",
60
- "@oh-my-pi/omp-stats": "16.3.14",
61
- "@oh-my-pi/pi-agent-core": "16.3.14",
62
- "@oh-my-pi/pi-ai": "16.3.14",
63
- "@oh-my-pi/pi-catalog": "16.3.14",
64
- "@oh-my-pi/pi-mnemopi": "16.3.14",
65
- "@oh-my-pi/pi-natives": "16.3.14",
66
- "@oh-my-pi/pi-tui": "16.3.14",
67
- "@oh-my-pi/pi-utils": "16.3.14",
68
- "@oh-my-pi/pi-wire": "16.3.14",
69
- "@oh-my-pi/snapcompact": "16.3.14",
59
+ "@oh-my-pi/hashline": "16.4.0",
60
+ "@oh-my-pi/omp-stats": "16.4.0",
61
+ "@oh-my-pi/pi-agent-core": "16.4.0",
62
+ "@oh-my-pi/pi-ai": "16.4.0",
63
+ "@oh-my-pi/pi-catalog": "16.4.0",
64
+ "@oh-my-pi/pi-mnemopi": "16.4.0",
65
+ "@oh-my-pi/pi-natives": "16.4.0",
66
+ "@oh-my-pi/pi-tui": "16.4.0",
67
+ "@oh-my-pi/pi-utils": "16.4.0",
68
+ "@oh-my-pi/pi-wire": "16.4.0",
69
+ "@oh-my-pi/snapcompact": "16.4.0",
70
70
  "@opentelemetry/api": "^1.9.1",
71
71
  "@opentelemetry/context-async-hooks": "^2.7.1",
72
72
  "@opentelemetry/exporter-trace-otlp-proto": "^0.218.0",