@oh-my-pi/pi-coding-agent 15.12.3 → 15.12.4

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 (231) hide show
  1. package/CHANGELOG.md +43 -1
  2. package/dist/cli.js +1120 -870
  3. package/dist/types/autoresearch/tools/init-experiment.d.ts +1 -1
  4. package/dist/types/autoresearch/tools/log-experiment.d.ts +1 -1
  5. package/dist/types/autoresearch/tools/run-experiment.d.ts +1 -1
  6. package/dist/types/autoresearch/tools/update-notes.d.ts +1 -1
  7. package/dist/types/cli/args.d.ts +0 -1
  8. package/dist/types/cli/models-cli.d.ts +49 -0
  9. package/dist/types/commands/launch.d.ts +0 -3
  10. package/dist/types/commands/models.d.ts +33 -0
  11. package/dist/types/commands/token.d.ts +25 -0
  12. package/dist/types/commit/agentic/tools/analyze-file.d.ts +1 -1
  13. package/dist/types/commit/agentic/tools/git-file-diff.d.ts +1 -1
  14. package/dist/types/commit/agentic/tools/git-hunk.d.ts +1 -1
  15. package/dist/types/commit/agentic/tools/git-overview.d.ts +1 -1
  16. package/dist/types/commit/agentic/tools/propose-changelog.d.ts +1 -1
  17. package/dist/types/commit/agentic/tools/propose-commit.d.ts +1 -1
  18. package/dist/types/commit/agentic/tools/recent-commits.d.ts +1 -1
  19. package/dist/types/commit/agentic/tools/schemas.d.ts +1 -1
  20. package/dist/types/commit/agentic/tools/split-commit.d.ts +1 -1
  21. package/dist/types/commit/changelog/generate.d.ts +1 -1
  22. package/dist/types/commit/shared-llm.d.ts +1 -1
  23. package/dist/types/config/model-registry.d.ts +7 -0
  24. package/dist/types/config/models-config-schema.d.ts +1 -1
  25. package/dist/types/config/settings-schema.d.ts +20 -0
  26. package/dist/types/edit/hashline/params.d.ts +1 -1
  27. package/dist/types/edit/modes/apply-patch.d.ts +1 -1
  28. package/dist/types/edit/modes/patch.d.ts +1 -1
  29. package/dist/types/edit/modes/replace.d.ts +1 -1
  30. package/dist/types/extensibility/custom-commands/types.d.ts +2 -2
  31. package/dist/types/extensibility/custom-tools/types.d.ts +2 -2
  32. package/dist/types/extensibility/extensions/types.d.ts +2 -2
  33. package/dist/types/extensibility/hooks/types.d.ts +2 -2
  34. package/dist/types/goals/tools/goal-tool.d.ts +1 -1
  35. package/dist/types/lsp/types.d.ts +1 -1
  36. package/dist/types/mcp/manager.d.ts +8 -0
  37. package/dist/types/mnemopi/config.d.ts +28 -0
  38. package/dist/types/modes/acp/acp-agent.d.ts +1 -2
  39. package/dist/types/modes/components/index.d.ts +1 -0
  40. package/dist/types/modes/components/logout-account-selector.d.ts +8 -0
  41. package/dist/types/modes/components/status-line/component.d.ts +9 -5
  42. package/dist/types/modes/components/status-line/types.d.ts +2 -1
  43. package/dist/types/modes/controllers/event-controller.d.ts +0 -17
  44. package/dist/types/modes/interactive-mode.d.ts +0 -3
  45. package/dist/types/modes/types.d.ts +0 -5
  46. package/dist/types/session/agent-session.d.ts +14 -33
  47. package/dist/types/session/agent-storage.d.ts +2 -1
  48. package/dist/types/session/indexed-session-storage.d.ts +1 -0
  49. package/dist/types/session/messages.d.ts +8 -10
  50. package/dist/types/session/session-manager.d.ts +15 -0
  51. package/dist/types/session/session-storage.d.ts +5 -0
  52. package/dist/types/slash-commands/helpers/logout.d.ts +15 -0
  53. package/dist/types/task/types.d.ts +1 -1
  54. package/dist/types/tools/ask.d.ts +1 -1
  55. package/dist/types/tools/ast-edit.d.ts +1 -1
  56. package/dist/types/tools/ast-grep.d.ts +1 -1
  57. package/dist/types/tools/bash.d.ts +1 -1
  58. package/dist/types/tools/browser/cmux/cmux-tab.d.ts +202 -0
  59. package/dist/types/tools/browser/cmux/rpc.d.ts +70 -0
  60. package/dist/types/tools/browser/cmux/socket-client.d.ts +19 -0
  61. package/dist/types/tools/browser/registry.d.ts +16 -3
  62. package/dist/types/tools/browser/render.d.ts +2 -0
  63. package/dist/types/tools/browser/tab-protocol.d.ts +2 -0
  64. package/dist/types/tools/browser/tab-supervisor.d.ts +16 -4
  65. package/dist/types/tools/browser.d.ts +3 -1
  66. package/dist/types/tools/checkpoint.d.ts +1 -1
  67. package/dist/types/tools/debug.d.ts +1 -1
  68. package/dist/types/tools/eval.d.ts +1 -1
  69. package/dist/types/tools/find.d.ts +1 -1
  70. package/dist/types/tools/gh.d.ts +1 -1
  71. package/dist/types/tools/image-gen.d.ts +1 -1
  72. package/dist/types/tools/index.d.ts +3 -1
  73. package/dist/types/tools/inspect-image.d.ts +1 -1
  74. package/dist/types/tools/irc.d.ts +1 -1
  75. package/dist/types/tools/job.d.ts +1 -1
  76. package/dist/types/tools/memory-edit.d.ts +1 -1
  77. package/dist/types/tools/memory-recall.d.ts +1 -1
  78. package/dist/types/tools/memory-reflect.d.ts +1 -1
  79. package/dist/types/tools/memory-retain.d.ts +1 -1
  80. package/dist/types/tools/read.d.ts +1 -1
  81. package/dist/types/tools/render-mermaid.d.ts +1 -1
  82. package/dist/types/tools/resolve.d.ts +1 -1
  83. package/dist/types/tools/review.d.ts +1 -1
  84. package/dist/types/tools/search-tool-bm25.d.ts +1 -1
  85. package/dist/types/tools/search.d.ts +1 -1
  86. package/dist/types/tools/ssh.d.ts +1 -1
  87. package/dist/types/tools/todo.d.ts +1 -1
  88. package/dist/types/tools/tts.d.ts +1 -1
  89. package/dist/types/tools/write.d.ts +1 -1
  90. package/dist/types/utils/clipboard.d.ts +4 -3
  91. package/dist/types/utils/image-loading.d.ts +18 -1
  92. package/dist/types/utils/thinking-display.d.ts +17 -0
  93. package/dist/types/web/search/index.d.ts +1 -1
  94. package/package.json +14 -14
  95. package/src/autoresearch/storage.ts +2 -1
  96. package/src/autoresearch/tools/init-experiment.ts +1 -1
  97. package/src/autoresearch/tools/log-experiment.ts +1 -1
  98. package/src/autoresearch/tools/run-experiment.ts +1 -1
  99. package/src/autoresearch/tools/update-notes.ts +1 -1
  100. package/src/cli/args.ts +0 -8
  101. package/src/cli/auth-gateway-cli.ts +1 -1
  102. package/src/cli/bench-cli.ts +1 -1
  103. package/src/cli/dry-balance-cli.ts +1 -1
  104. package/src/cli/models-cli.ts +427 -0
  105. package/src/cli-commands.ts +2 -0
  106. package/src/collab/host.ts +9 -12
  107. package/src/commands/launch.ts +0 -3
  108. package/src/commands/models.ts +61 -0
  109. package/src/commands/token.ts +89 -0
  110. package/src/commit/agentic/tools/analyze-file.ts +1 -1
  111. package/src/commit/agentic/tools/git-file-diff.ts +1 -1
  112. package/src/commit/agentic/tools/git-hunk.ts +1 -1
  113. package/src/commit/agentic/tools/git-overview.ts +1 -1
  114. package/src/commit/agentic/tools/propose-changelog.ts +1 -1
  115. package/src/commit/agentic/tools/propose-commit.ts +1 -1
  116. package/src/commit/agentic/tools/recent-commits.ts +1 -1
  117. package/src/commit/agentic/tools/schemas.ts +1 -1
  118. package/src/commit/agentic/tools/split-commit.ts +1 -1
  119. package/src/commit/analysis/summary.ts +1 -1
  120. package/src/commit/changelog/generate.ts +1 -1
  121. package/src/commit/shared-llm.ts +1 -1
  122. package/src/config/model-registry.ts +15 -12
  123. package/src/config/model-resolver.ts +2 -2
  124. package/src/config/models-config-schema.ts +1 -1
  125. package/src/config/settings-schema.ts +18 -0
  126. package/src/edit/hashline/params.ts +1 -1
  127. package/src/edit/modes/apply-patch.ts +1 -1
  128. package/src/edit/modes/patch.ts +1 -1
  129. package/src/edit/modes/replace.ts +1 -1
  130. package/src/eval/agent-bridge.ts +1 -1
  131. package/src/eval/completion-bridge.ts +1 -1
  132. package/src/export/html/template.js +24 -2
  133. package/src/export/html/tool-views.generated.js +2 -2
  134. package/src/extensibility/custom-commands/loader.ts +1 -1
  135. package/src/extensibility/custom-commands/types.ts +2 -2
  136. package/src/extensibility/custom-tools/loader.ts +1 -1
  137. package/src/extensibility/custom-tools/types.ts +2 -2
  138. package/src/extensibility/extensions/loader.ts +2 -2
  139. package/src/extensibility/extensions/types.ts +2 -2
  140. package/src/extensibility/hooks/loader.ts +1 -1
  141. package/src/extensibility/hooks/types.ts +2 -2
  142. package/src/extensibility/skills.ts +18 -3
  143. package/src/goals/tools/goal-tool.ts +1 -1
  144. package/src/internal-urls/docs-index.generated.ts +5 -2
  145. package/src/lsp/types.ts +1 -1
  146. package/src/main.ts +0 -25
  147. package/src/mcp/config-writer.ts +7 -3
  148. package/src/mcp/manager.ts +11 -0
  149. package/src/memories/index.ts +3 -1
  150. package/src/memories/storage.ts +2 -1
  151. package/src/mnemopi/config.ts +95 -11
  152. package/src/modes/acp/acp-agent.ts +5 -48
  153. package/src/modes/acp/acp-event-mapper.ts +5 -1
  154. package/src/modes/components/agent-hub.ts +2 -1
  155. package/src/modes/components/assistant-message.ts +8 -7
  156. package/src/modes/components/index.ts +1 -0
  157. package/src/modes/components/logout-account-selector.ts +130 -0
  158. package/src/modes/components/mcp-add-wizard.ts +1 -1
  159. package/src/modes/components/model-selector.ts +2 -2
  160. package/src/modes/components/status-line/component.ts +54 -157
  161. package/src/modes/components/status-line/segments.ts +1 -1
  162. package/src/modes/components/status-line/types.ts +2 -1
  163. package/src/modes/controllers/command-controller.ts +0 -12
  164. package/src/modes/controllers/event-controller.ts +23 -62
  165. package/src/modes/controllers/input-controller.ts +53 -30
  166. package/src/modes/controllers/mcp-command-controller.ts +44 -3
  167. package/src/modes/controllers/selector-controller.ts +56 -10
  168. package/src/modes/controllers/streaming-reveal.ts +4 -3
  169. package/src/modes/interactive-mode.ts +2 -8
  170. package/src/modes/theme/theme.ts +1 -1
  171. package/src/modes/types.ts +0 -5
  172. package/src/modes/utils/ui-helpers.ts +2 -1
  173. package/src/prompts/system/empty-stop-retry.md +4 -6
  174. package/src/sdk.ts +15 -19
  175. package/src/session/agent-session.ts +125 -234
  176. package/src/session/agent-storage.ts +18 -9
  177. package/src/session/history-storage.ts +2 -1
  178. package/src/session/indexed-session-storage.ts +7 -0
  179. package/src/session/messages.ts +9 -11
  180. package/src/session/session-dump-format.ts +4 -2
  181. package/src/session/session-manager.ts +116 -0
  182. package/src/session/session-storage.ts +20 -0
  183. package/src/slash-commands/builtin-registry.ts +15 -1
  184. package/src/slash-commands/helpers/logout.ts +88 -0
  185. package/src/task/types.ts +1 -1
  186. package/src/tools/ask.ts +1 -1
  187. package/src/tools/ast-edit.ts +1 -1
  188. package/src/tools/ast-grep.ts +1 -1
  189. package/src/tools/bash.ts +1 -1
  190. package/src/tools/browser/cmux/cmux-tab.ts +1264 -0
  191. package/src/tools/browser/cmux/rpc.ts +156 -0
  192. package/src/tools/browser/cmux/socket-client.ts +309 -0
  193. package/src/tools/browser/registry.ts +37 -3
  194. package/src/tools/browser/render.ts +6 -1
  195. package/src/tools/browser/tab-protocol.ts +2 -0
  196. package/src/tools/browser/tab-supervisor.ts +189 -18
  197. package/src/tools/browser/tab-worker.ts +1 -1
  198. package/src/tools/browser.ts +16 -1
  199. package/src/tools/checkpoint.ts +1 -1
  200. package/src/tools/debug.ts +1 -1
  201. package/src/tools/eval.ts +11 -6
  202. package/src/tools/fetch.ts +13 -2
  203. package/src/tools/find.ts +1 -1
  204. package/src/tools/gh.ts +1 -1
  205. package/src/tools/github-cache.ts +2 -1
  206. package/src/tools/image-gen.ts +1 -1
  207. package/src/tools/index.ts +3 -1
  208. package/src/tools/inspect-image.ts +3 -1
  209. package/src/tools/irc.ts +1 -1
  210. package/src/tools/job.ts +1 -1
  211. package/src/tools/memory-edit.ts +1 -1
  212. package/src/tools/memory-recall.ts +1 -1
  213. package/src/tools/memory-reflect.ts +1 -1
  214. package/src/tools/memory-retain.ts +1 -1
  215. package/src/tools/read.ts +8 -2
  216. package/src/tools/render-mermaid.ts +1 -1
  217. package/src/tools/report-tool-issue.ts +3 -2
  218. package/src/tools/resolve.ts +1 -1
  219. package/src/tools/review.ts +1 -1
  220. package/src/tools/search-tool-bm25.ts +1 -1
  221. package/src/tools/search.ts +1 -1
  222. package/src/tools/ssh.ts +1 -1
  223. package/src/tools/todo.ts +1 -1
  224. package/src/tools/tts.ts +1 -1
  225. package/src/tools/write.ts +1 -1
  226. package/src/utils/clipboard.ts +35 -18
  227. package/src/utils/image-loading.ts +35 -4
  228. package/src/utils/thinking-display.ts +37 -0
  229. package/src/web/search/index.ts +1 -1
  230. package/dist/types/cli/list-models.d.ts +0 -30
  231. package/src/cli/list-models.ts +0 -194
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import { z } from "zod/v4";
2
2
  import type { CommitAgentState } from "../../../commit/agentic/state";
3
3
  import { CHANGELOG_CATEGORIES, type ChangelogCategory } from "../../../commit/types";
4
4
  import type { CustomTool } from "../../../extensibility/custom-tools/types";
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import { z } from "zod/v4";
2
2
  import type { CommitAgentState } from "../../../commit/agentic/state";
3
3
  import {
4
4
  capDetails,
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import { z } from "zod/v4";
2
2
  import type { CustomTool } from "../../../extensibility/custom-tools/types";
3
3
  import * as git from "../../../utils/git";
4
4
 
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import { z } from "zod/v4";
2
2
 
3
3
  export const commitTypeSchema = z.enum([
4
4
  "feat",
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import { z } from "zod/v4";
2
2
  import type { CommitAgentState, SplitCommitGroup, SplitCommitPlan } from "../../../commit/agentic/state";
3
3
  import { computeDependencyOrder } from "../../../commit/agentic/topo-sort";
4
4
  import {
@@ -2,7 +2,7 @@ import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
2
2
  import type { Api, ApiKey, AssistantMessage, Model } from "@oh-my-pi/pi-ai";
3
3
  import { completeSimple, validateToolCall } from "@oh-my-pi/pi-ai";
4
4
  import { prompt } from "@oh-my-pi/pi-utils";
5
- import * as z from "zod/v4";
5
+ import { z } from "zod/v4";
6
6
  import summarySystemPrompt from "../../commit/prompts/summary-system.md" with { type: "text" };
7
7
  import summaryUserPrompt from "../../commit/prompts/summary-user.md" with { type: "text" };
8
8
  import type { CommitSummary } from "../../commit/types";
@@ -2,7 +2,7 @@ import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
2
2
  import type { Api, ApiKey, AssistantMessage, Model } from "@oh-my-pi/pi-ai";
3
3
  import { completeSimple, validateToolCall } from "@oh-my-pi/pi-ai";
4
4
  import { prompt } from "@oh-my-pi/pi-utils";
5
- import * as z from "zod/v4";
5
+ import { z } from "zod/v4";
6
6
  import changelogSystemPrompt from "../../commit/prompts/changelog-system.md" with { type: "text" };
7
7
  import changelogUserPrompt from "../../commit/prompts/changelog-user.md" with { type: "text" };
8
8
  import { CHANGELOG_CATEGORIES, type ChangelogCategory, type ChangelogGenerationResult } from "../../commit/types";
@@ -1,6 +1,6 @@
1
1
  import type { AssistantMessage } from "@oh-my-pi/pi-ai";
2
2
  import { validateToolCall } from "@oh-my-pi/pi-ai";
3
- import * as z from "zod/v4";
3
+ import { z } from "zod/v4";
4
4
  import type { ChangelogCategory, ConventionalAnalysis } from "./types";
5
5
  import { extractTextContent, extractToolCall, normalizeAnalysis, parseJsonPayload } from "./utils";
6
6
 
@@ -17,8 +17,6 @@ import {
17
17
  googleGeminiCliModelManagerOptions,
18
18
  openaiCodexModelManagerOptions,
19
19
  PROVIDER_DESCRIPTORS,
20
- UNK_CONTEXT_WINDOW,
21
- UNK_MAX_TOKENS,
22
20
  } from "@oh-my-pi/pi-catalog/provider-models";
23
21
  import {
24
22
  collapseBuiltModelVariants,
@@ -530,9 +528,8 @@ function finalizeCustomModel(model: CustomModelOverlay, options: CustomModelBuil
530
528
  thinking: resolvedModel.thinking ?? reference?.thinking,
531
529
  input: input as ("text" | "image")[],
532
530
  cost,
533
- contextWindow:
534
- resolvedModel.contextWindow ?? reference?.contextWindow ?? (options.useDefaults ? 128000 : undefined),
535
- maxTokens: resolvedModel.maxTokens ?? reference?.maxTokens ?? (options.useDefaults ? 16384 : undefined),
531
+ contextWindow: resolvedModel.contextWindow ?? reference?.contextWindow ?? (options.useDefaults ? 128000 : null),
532
+ maxTokens: resolvedModel.maxTokens ?? reference?.maxTokens ?? (options.useDefaults ? 16384 : null),
536
533
  headers: resolvedModel.headers,
537
534
  omitMaxOutputTokens: resolvedModel.omitMaxOutputTokens ?? reference?.omitMaxOutputTokens,
538
535
  compat: mergeCompat(reference?.compatConfig, resolvedModel.compat),
@@ -866,11 +863,8 @@ export class ModelRegistry {
866
863
  if (!existing) return replacementModel;
867
864
  return {
868
865
  ...replacementModel,
869
- contextWindow:
870
- replacementModel.contextWindow === UNK_CONTEXT_WINDOW
871
- ? existing.contextWindow
872
- : replacementModel.contextWindow,
873
- maxTokens: replacementModel.maxTokens === UNK_MAX_TOKENS ? existing.maxTokens : replacementModel.maxTokens,
866
+ contextWindow: replacementModel.contextWindow ?? existing.contextWindow,
867
+ maxTokens: replacementModel.maxTokens ?? existing.maxTokens,
874
868
  };
875
869
  });
876
870
  }
@@ -1739,11 +1733,20 @@ export class ModelRegistry {
1739
1733
  * paths that pre-flight auth before model resolution) can probe a model
1740
1734
  * without resolving an API key. Returns true for keyless providers as well
1741
1735
  * as providers with stored credentials. See issue #993.
1736
+ *
1737
+ * Side-effect-free and synchronous: a command-backed key (`!cmd`) counts as
1738
+ * configured by its presence alone — the program is NOT executed — and OAuth
1739
+ * tokens are NOT refreshed (`authStorage.hasAuth`). This is what keeps the
1740
+ * model-switch pre-flight off the event loop's hot path; the real key
1741
+ * (command execution + OAuth refresh) is resolved lazily per request via
1742
+ * {@link ModelRegistry.resolver}.
1742
1743
  */
1743
1744
  hasConfiguredAuth(model: Model<Api>): boolean {
1744
- const commandKey = this.#resolveCommandBackedApiKey(model.provider);
1745
+ const keyConfig = this.#customProviderApiKeys.get(model.provider);
1745
1746
  return (
1746
- commandKey.configured || this.#keylessProviders.has(model.provider) || this.authStorage.hasAuth(model.provider)
1747
+ isCommandConfigValue(keyConfig) ||
1748
+ this.#keylessProviders.has(model.provider) ||
1749
+ this.authStorage.hasAuth(model.provider)
1747
1750
  );
1748
1751
  }
1749
1752
 
@@ -1247,7 +1247,7 @@ export function resolveCliModel(options: {
1247
1247
  model: undefined,
1248
1248
  selector: undefined,
1249
1249
  warning: undefined,
1250
- error: `Unknown provider "${cliProvider}". Use --list-models to see available providers/models.`,
1250
+ error: `Unknown provider "${cliProvider}". Run "omp models" to see available providers/models.`,
1251
1251
  };
1252
1252
  }
1253
1253
 
@@ -1337,7 +1337,7 @@ export function resolveCliModel(options: {
1337
1337
  selector: undefined,
1338
1338
  thinkingLevel: undefined,
1339
1339
  warning,
1340
- error: `Model "${display}" not found. Use --list-models to see available models.`,
1340
+ error: `Model "${display}" not found. Run "omp models" to see available models.`,
1341
1341
  };
1342
1342
  }
1343
1343
 
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import { z } from "zod/v4";
2
2
 
3
3
  const OpenRouterRoutingSchema = z.object({
4
4
  only: z.array(z.string()).optional(),
@@ -3024,6 +3024,18 @@ export const SETTINGS_SCHEMA = {
3024
3024
  description: "Launch browser in headless mode (disable to show browser UI)",
3025
3025
  },
3026
3026
  },
3027
+
3028
+ "browser.cmux": {
3029
+ type: "boolean",
3030
+ default: true,
3031
+ ui: {
3032
+ tab: "tools",
3033
+ group: "Search & Browser",
3034
+ label: "cmux Browser",
3035
+ description:
3036
+ "Use cmux WKWebView surfaces for browser automation when a cmux socket is available. Set PI_BROWSER_CMUX=0 or PI_BROWSER_CMUX=1 to override.",
3037
+ },
3038
+ },
3027
3039
  "browser.screenshotDir": {
3028
3040
  type: "string",
3029
3041
  default: undefined,
@@ -3527,6 +3539,10 @@ export const SETTINGS_SCHEMA = {
3527
3539
 
3528
3540
  "skills.enablePiProject": { type: "boolean", default: true },
3529
3541
 
3542
+ "skills.enableAgentsUser": { type: "boolean", default: true },
3543
+
3544
+ "skills.enableAgentsProject": { type: "boolean", default: true },
3545
+
3530
3546
  "skills.customDirectories": { type: "array", default: [] as string[] },
3531
3547
 
3532
3548
  "skills.ignoredSkills": { type: "array", default: [] as string[] },
@@ -4138,6 +4154,8 @@ export interface SkillsSettings {
4138
4154
  enableClaudeProject?: boolean;
4139
4155
  enablePiUser?: boolean;
4140
4156
  enablePiProject?: boolean;
4157
+ enableAgentsUser?: boolean;
4158
+ enableAgentsProject?: boolean;
4141
4159
  customDirectories?: string[];
4142
4160
  ignoredSkills?: string[];
4143
4161
  includeSkills?: string[];
@@ -4,7 +4,7 @@
4
4
  * keys without rejection; only `input` is required. `_input` is accepted as a
5
5
  * provider-emitted alias for `input`.
6
6
  */
7
- import * as z from "zod/v4";
7
+ import { z } from "zod/v4";
8
8
 
9
9
  export const hashlineEditParamsSchema = z.preprocess(raw => {
10
10
  if (!raw || typeof raw !== "object" || Array.isArray(raw)) return raw;
@@ -8,7 +8,7 @@
8
8
  * the `patch` mode.
9
9
  */
10
10
 
11
- import * as z from "zod/v4";
11
+ import { z } from "zod/v4";
12
12
  import { parseApplyPatch, parseApplyPatchStreaming } from "../apply-patch/parser";
13
13
  import { ApplyPatchError } from "../diff";
14
14
  import type { PatchEditEntry } from "./patch";
@@ -9,7 +9,7 @@ import * as fs from "node:fs";
9
9
  import * as path from "node:path";
10
10
  import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
11
11
  import { isEnoent } from "@oh-my-pi/pi-utils";
12
- import * as z from "zod/v4";
12
+ import { z } from "zod/v4";
13
13
  import {
14
14
  type FileDiagnosticsResult,
15
15
  flushLspWritethroughBatch,
@@ -5,7 +5,7 @@
5
5
  * fallback strategies for finding text in files.
6
6
  */
7
7
  import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
8
- import * as z from "zod/v4";
8
+ import { z } from "zod/v4";
9
9
  import type { WritethroughCallback, WritethroughDeferredHandle } from "../../lsp";
10
10
  import type { ToolSession } from "../../tools";
11
11
  import { invalidateFsScanAfterWrite } from "../../tools/fs-cache-invalidation";
@@ -5,7 +5,7 @@ import * as fs from "node:fs/promises";
5
5
  import * as os from "node:os";
6
6
  import * as path from "node:path";
7
7
  import { prompt, Snowflake } from "@oh-my-pi/pi-utils";
8
- import * as z from "zod/v4";
8
+ import { z } from "zod/v4";
9
9
  import { resolveAgentModelPatterns } from "../config/model-resolver";
10
10
  import type { LocalProtocolOptions } from "../internal-urls";
11
11
  import { MCPManager } from "../mcp/manager";
@@ -14,7 +14,7 @@
14
14
  import { instrumentedCompleteSimple, resolveTelemetry } from "@oh-my-pi/pi-agent-core";
15
15
  import { type Api, Effort, type Model, type Tool } from "@oh-my-pi/pi-ai";
16
16
  import { getSupportedEfforts } from "@oh-my-pi/pi-catalog/model-thinking";
17
- import * as z from "zod/v4";
17
+ import { z } from "zod/v4";
18
18
  import { extractTextContent, extractToolCall, parseJsonPayload } from "../commit/utils";
19
19
 
20
20
  import {
@@ -450,6 +450,26 @@
450
450
  return div.innerHTML;
451
451
  }
452
452
 
453
+ function isDotOnlyThinking(text) {
454
+ let sawDot = false;
455
+ for (let i = 0; i < text.length; i++) {
456
+ const code = text.charCodeAt(i);
457
+ if (code === 0x2e || code === 0x2026) {
458
+ sawDot = true;
459
+ continue;
460
+ }
461
+ if (code === 0x20 || code === 0x09 || code === 0x0a || code === 0x0d) continue;
462
+ return false;
463
+ }
464
+ return sawDot;
465
+ }
466
+
467
+ function visibleThinkingText(block) {
468
+ const text = block.thinking.trim();
469
+ if (!text) return '';
470
+ return isDotOnlyThinking(text) ? '' : text;
471
+ }
472
+
453
473
  /**
454
474
  * Truncate string to maxLen chars, append "..." if truncated.
455
475
  */
@@ -1056,9 +1076,11 @@
1056
1076
  for (const block of msg.content) {
1057
1077
  if (block.type === 'text' && block.text.trim()) {
1058
1078
  html += `<div class="assistant-text markdown-content">${safeMarkedParse(block.text)}</div>`;
1059
- } else if (block.type === 'thinking' && block.thinking.trim()) {
1079
+ } else if (block.type === 'thinking') {
1080
+ const thinking = visibleThinkingText(block);
1081
+ if (!thinking) continue;
1060
1082
  html += `<div class="thinking-block">
1061
- <div class="thinking-text">${escapeHtml(block.thinking)}</div>
1083
+ <div class="thinking-text">${escapeHtml(thinking)}</div>
1062
1084
  <div class="thinking-collapsed">Thinking ...</div>
1063
1085
  </div>`;
1064
1086
  }