@oh-my-pi/pi-coding-agent 16.5.0 → 16.5.1

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 (121) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/cli.js +3336 -3318
  3. package/dist/types/advisor/advise-tool.d.ts +12 -1
  4. package/dist/types/advisor/runtime.d.ts +41 -1
  5. package/dist/types/cli/args.d.ts +2 -0
  6. package/dist/types/cli/update-cli.d.ts +4 -1
  7. package/dist/types/cli/usage-cli.d.ts +3 -0
  8. package/dist/types/cli/usage-error.d.ts +4 -0
  9. package/dist/types/config/api-key-resolver.d.ts +2 -2
  10. package/dist/types/config/model-registry.d.ts +3 -3
  11. package/dist/types/config/model-resolver.d.ts +8 -1
  12. package/dist/types/config/models-config.d.ts +1 -1
  13. package/dist/types/eval/__tests__/process-entry-import.test.d.ts +1 -0
  14. package/dist/types/eval/bridge-timeout.d.ts +9 -1
  15. package/dist/types/eval/js/context-manager.d.ts +5 -3
  16. package/dist/types/eval/js/process-entry.d.ts +6 -0
  17. package/dist/types/eval/js/worker-core.d.ts +15 -1
  18. package/dist/types/eval/py/spawn-options.d.ts +10 -0
  19. package/dist/types/eval/py/tool-bridge.d.ts +1 -0
  20. package/dist/types/extensibility/custom-tools/types.d.ts +3 -0
  21. package/dist/types/extensibility/extensions/runner.d.ts +3 -1
  22. package/dist/types/extensibility/extensions/types.d.ts +3 -0
  23. package/dist/types/internal-urls/memory-protocol.d.ts +6 -7
  24. package/dist/types/main.d.ts +1 -0
  25. package/dist/types/modes/components/transcript-container.d.ts +3 -2
  26. package/dist/types/modes/magic-keyword-boundary.d.ts +9 -0
  27. package/dist/types/modes/orchestrate.d.ts +1 -1
  28. package/dist/types/modes/rpc/host-tools.d.ts +2 -0
  29. package/dist/types/modes/rpc/rpc-mode.d.ts +26 -6
  30. package/dist/types/modes/ultrathink.d.ts +1 -1
  31. package/dist/types/modes/utils/transcript-render-helpers.d.ts +12 -0
  32. package/dist/types/modes/workflow.d.ts +1 -1
  33. package/dist/types/session/agent-session.d.ts +6 -0
  34. package/dist/types/session/exit-diagnostics.d.ts +11 -0
  35. package/dist/types/slash-commands/helpers/active-oauth-account.d.ts +11 -0
  36. package/dist/types/subprocess/worker-client.d.ts +6 -0
  37. package/dist/types/tools/bash-skill-urls.d.ts +1 -0
  38. package/dist/types/web/search/provider.d.ts +10 -3
  39. package/dist/types/web/search/providers/codex.d.ts +5 -4
  40. package/package.json +12 -12
  41. package/src/advisor/__tests__/advisor.test.ts +830 -42
  42. package/src/advisor/advise-tool.ts +17 -1
  43. package/src/advisor/runtime.ts +288 -67
  44. package/src/autolearn/controller.ts +15 -3
  45. package/src/cli/args.ts +12 -0
  46. package/src/cli/auth-broker-cli.ts +30 -11
  47. package/src/cli/auth-gateway-cli.ts +5 -1
  48. package/src/cli/dry-balance-cli.ts +14 -4
  49. package/src/cli/flag-tables.ts +21 -7
  50. package/src/cli/update-cli.ts +62 -11
  51. package/src/cli/usage-cli.ts +58 -5
  52. package/src/cli/usage-error.ts +7 -0
  53. package/src/cli.ts +23 -1
  54. package/src/commands/acp.ts +11 -2
  55. package/src/commands/launch.ts +12 -3
  56. package/src/commands/token.ts +3 -1
  57. package/src/config/api-key-resolver.ts +12 -3
  58. package/src/config/config-file.ts +30 -12
  59. package/src/config/model-registry.ts +7 -7
  60. package/src/config/model-resolver.ts +21 -7
  61. package/src/config/models-config.ts +1 -1
  62. package/src/eval/__tests__/agent-bridge.test.ts +19 -14
  63. package/src/eval/__tests__/bridge-timeout.test.ts +106 -0
  64. package/src/eval/__tests__/js-context-manager.test.ts +158 -1
  65. package/src/eval/__tests__/kernel-spawn.test.ts +12 -0
  66. package/src/eval/__tests__/process-entry-import.test.ts +27 -0
  67. package/src/eval/agent-bridge.ts +121 -116
  68. package/src/eval/bridge-timeout.ts +20 -2
  69. package/src/eval/executor-base.ts +85 -7
  70. package/src/eval/jl/kernel.ts +2 -1
  71. package/src/eval/js/context-manager.ts +109 -32
  72. package/src/eval/js/process-entry.ts +27 -0
  73. package/src/eval/js/shared/runtime.ts +1 -1
  74. package/src/eval/js/worker-core.ts +70 -9
  75. package/src/eval/js/worker-entry.ts +1 -1
  76. package/src/eval/py/kernel.ts +2 -1
  77. package/src/eval/py/spawn-options.ts +13 -0
  78. package/src/eval/py/tool-bridge.ts +13 -14
  79. package/src/eval/rb/kernel.ts +2 -1
  80. package/src/extensibility/custom-tools/types.ts +3 -0
  81. package/src/extensibility/extensions/runner.ts +3 -0
  82. package/src/extensibility/extensions/types.ts +3 -0
  83. package/src/extensibility/plugins/manager.ts +21 -0
  84. package/src/internal-urls/memory-protocol.ts +13 -9
  85. package/src/lsp/client.ts +7 -1
  86. package/src/main.ts +29 -0
  87. package/src/mcp/tool-bridge.ts +57 -6
  88. package/src/modes/components/chat-transcript-builder.ts +22 -1
  89. package/src/modes/components/status-line/component.ts +10 -1
  90. package/src/modes/components/transcript-container.ts +110 -7
  91. package/src/modes/controllers/command-controller.ts +12 -4
  92. package/src/modes/controllers/event-controller.ts +80 -15
  93. package/src/modes/controllers/selector-controller.ts +15 -3
  94. package/src/modes/magic-keyword-boundary.ts +23 -0
  95. package/src/modes/orchestrate.ts +6 -5
  96. package/src/modes/print-mode.ts +9 -0
  97. package/src/modes/rpc/host-tools.ts +15 -0
  98. package/src/modes/rpc/rpc-mode.ts +123 -48
  99. package/src/modes/ultrathink.ts +6 -5
  100. package/src/modes/utils/transcript-render-helpers.ts +54 -0
  101. package/src/modes/utils/ui-helpers.ts +27 -1
  102. package/src/modes/workflow.ts +6 -5
  103. package/src/prompts/advisor/system.md +1 -0
  104. package/src/sdk.ts +33 -3
  105. package/src/session/agent-session.ts +239 -17
  106. package/src/session/exit-diagnostics.ts +108 -0
  107. package/src/session/streaming-output.ts +40 -12
  108. package/src/slash-commands/helpers/active-oauth-account.ts +22 -2
  109. package/src/slash-commands/helpers/logout.ts +23 -3
  110. package/src/slash-commands/helpers/usage-report.ts +14 -2
  111. package/src/subprocess/worker-client.ts +9 -2
  112. package/src/task/executor.ts +8 -0
  113. package/src/task/render.test.ts +36 -0
  114. package/src/task/render.ts +55 -43
  115. package/src/tools/bash-skill-urls.ts +4 -1
  116. package/src/tools/bash.ts +1 -0
  117. package/src/tools/write.ts +82 -9
  118. package/src/tools/yield.ts +29 -1
  119. package/src/web/search/index.ts +39 -22
  120. package/src/web/search/provider.ts +33 -16
  121. package/src/web/search/providers/codex.ts +68 -21
@@ -4,6 +4,17 @@ import type { OAuthAccountIdentity } from "../../session/auth-storage.js";
4
4
  * True when a single usage-limit column belongs to the given OAuth identity.
5
5
  *
6
6
  * Single definition of the matching rules for both `/usage` renderers:
7
+ * - `orgId` ↔ report metadata `orgId` — a GATE that QUALIFIES the base
8
+ * identity, never a replacement for it. Mismatched org presence or
9
+ * different orgs never match: two subscriptions (orgs) can share one
10
+ * email, so an org-scoped identity matches only its own org's reports and
11
+ * an org-less legacy identity never claims an org-attributed report via
12
+ * the shared email. A SHARED org still requires the base-identity match
13
+ * below — Anthropic Team seats have per-user pools yet share the org id
14
+ * in report metadata. Only an org-only identity (no base identifiers
15
+ * recovered at all) matches on the org alone. When neither side carries
16
+ * an org, the base fallback applies unchanged (providers without orgs
17
+ * keep their former behavior).
7
18
  * - `accountId` ↔ report metadata `accountId`/`account_id` or `limit.scope.accountId`
8
19
  * - `email` ↔ report metadata `email`
9
20
  * - `projectId` ↔ report metadata `projectId` or `limit.scope.projectId`
@@ -118,6 +118,12 @@ export declare function createWorkerSubprocess<Outbound>(options: {
118
118
  spawnCommand: WorkerSpawnCommand;
119
119
  env: Record<string, string>;
120
120
  exitLabel: string;
121
+ /** Start the child as a new process-group/session leader where Bun supports it. */
122
+ detached?: boolean;
123
+ /** Treat exit code 0 as unexpected; eval cells can call process.exit(0). */
124
+ reportCleanExit?: boolean;
125
+ /** Whether an idle worker should stop keeping the parent event loop alive. */
126
+ unref?: boolean;
121
127
  }): SpawnedSubprocess<Outbound>;
122
128
  /**
123
129
  * Wrap a {@link SpawnedSubprocess} as a {@link WorkerHandle}. The `send`
@@ -10,6 +10,7 @@ export interface InternalUrlExpansionOptions {
10
10
  noEscape?: boolean;
11
11
  internalRouter?: InternalUrlResolver;
12
12
  localOptions?: LocalProtocolOptions;
13
+ cwd?: string;
13
14
  ensureLocalParentDirs?: boolean;
14
15
  }
15
16
  /**
@@ -24,9 +24,16 @@ export declare function setPreferredSearchProvider(provider: SearchProviderId |
24
24
  export declare function setExcludedSearchProviders(providers: readonly SearchProviderId[]): void;
25
25
  /** `true` when settings exclude `id` from web search (auto chain and the Public Web fan-out). */
26
26
  export declare function isSearchProviderExcluded(id: SearchProviderId): boolean;
27
+ export interface SearchProviderCandidate {
28
+ id: SearchProviderId;
29
+ explicit: boolean;
30
+ }
31
+ /** Return provider candidates in fallback order without loading their modules. */
32
+ export declare function resolveProviderCandidates(preferredProvider?: SearchProviderId | "auto"): SearchProviderCandidate[];
27
33
  /**
28
- * Determine which providers are configured and currently available.
29
- * Each candidate is loaded (and its `isAvailable()` called) only as the chain
30
- * is walked, so unconfigured providers never pay the load cost.
34
+ * Resolve the complete available provider chain.
35
+ *
36
+ * This compatibility helper loads every candidate. Search execution should use
37
+ * {@link resolveProviderCandidates} so fallback modules load only when reached.
31
38
  */
32
39
  export declare function resolveProviderChain(authStorage: AuthStorage, preferredProvider?: SearchProviderId | "auto"): Promise<SearchProvider[]>;
@@ -17,10 +17,11 @@ export interface CodexSearchParams {
17
17
  * Default-model behavior:
18
18
  * - If `PI_CODEX_WEB_SEARCH_MODEL` is set, use it exactly once and surface any
19
19
  * upstream error verbatim.
20
- * - Otherwise prefer ChatGPT-account-safe bundled defaults (GPT-5.4, GPT-5
21
- * Codex, GPT-5, …) and retry the next candidate only when Codex returns the
22
- * known 400 "model is not supported" family. This avoids selecting
23
- * `gpt-5-codex-mini` first on ChatGPT accounts, which OpenAI rejects.
20
+ * - Otherwise prefer ChatGPT-account-safe bundled defaults (GPT-5.6 Luna,
21
+ * Terra, Sol, GPT-5.5, …) and retry the next candidate only when Codex
22
+ * returns the known 400 "model is not supported" family. This avoids
23
+ * selecting `gpt-5-codex-mini` first on ChatGPT accounts, which OpenAI
24
+ * rejects.
24
25
  */
25
26
  export declare function searchCodex(params: SearchParams): Promise<SearchResponse>;
26
27
  /**
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.5.0",
4
+ "version": "16.5.1",
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",
@@ -52,17 +52,17 @@
52
52
  "@agentclientprotocol/sdk": "1.2.1",
53
53
  "@babel/parser": "^7.29.7",
54
54
  "@mozilla/readability": "^0.6.0",
55
- "@oh-my-pi/hashline": "16.5.0",
56
- "@oh-my-pi/omp-stats": "16.5.0",
57
- "@oh-my-pi/pi-agent-core": "16.5.0",
58
- "@oh-my-pi/pi-ai": "16.5.0",
59
- "@oh-my-pi/pi-catalog": "16.5.0",
60
- "@oh-my-pi/pi-mnemopi": "16.5.0",
61
- "@oh-my-pi/pi-natives": "16.5.0",
62
- "@oh-my-pi/pi-tui": "16.5.0",
63
- "@oh-my-pi/pi-utils": "16.5.0",
64
- "@oh-my-pi/pi-wire": "16.5.0",
65
- "@oh-my-pi/snapcompact": "16.5.0",
55
+ "@oh-my-pi/hashline": "16.5.1",
56
+ "@oh-my-pi/omp-stats": "16.5.1",
57
+ "@oh-my-pi/pi-agent-core": "16.5.1",
58
+ "@oh-my-pi/pi-ai": "16.5.1",
59
+ "@oh-my-pi/pi-catalog": "16.5.1",
60
+ "@oh-my-pi/pi-mnemopi": "16.5.1",
61
+ "@oh-my-pi/pi-natives": "16.5.1",
62
+ "@oh-my-pi/pi-tui": "16.5.1",
63
+ "@oh-my-pi/pi-utils": "16.5.1",
64
+ "@oh-my-pi/pi-wire": "16.5.1",
65
+ "@oh-my-pi/snapcompact": "16.5.1",
66
66
  "@opentelemetry/api": "^1.9.1",
67
67
  "@opentelemetry/context-async-hooks": "^2.7.1",
68
68
  "@opentelemetry/exporter-trace-otlp-proto": "^0.220.0",