@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 { ToolDefinition } from "../../extensibility/extensions";
3
3
  import type { AutoresearchToolFactoryOptions, ExperimentState } from "../types";
4
4
  export declare const HARNESS_FILENAME = "autoresearch.sh";
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import { z } from "zod/v4";
2
2
  import type { ToolDefinition } from "../../extensibility/extensions";
3
3
  import type { AutoresearchToolFactoryOptions, LogDetails } from "../types";
4
4
  declare const logExperimentSchema: z.ZodObject<{
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import { z } from "zod/v4";
2
2
  import type { ToolDefinition } from "../../extensibility/extensions";
3
3
  import type { AutoresearchToolFactoryOptions, RunDetails, RunExperimentProgressDetails } from "../types";
4
4
  declare const runExperimentSchema: z.ZodObject<{
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import { z } from "zod/v4";
2
2
  import type { ToolDefinition } from "../../extensibility/extensions";
3
3
  import type { AutoresearchToolFactoryOptions } from "../types";
4
4
  declare const updateNotesSchema: z.ZodObject<{
@@ -42,7 +42,6 @@ export interface Args {
42
42
  noSkills?: boolean;
43
43
  skills?: string[];
44
44
  noRules?: boolean;
45
- listModels?: string | true;
46
45
  noTitle?: boolean;
47
46
  autoApprove?: boolean;
48
47
  approvalMode?: "always-ask" | "write" | "yolo";
@@ -0,0 +1,49 @@
1
+ import { ModelRegistry } from "../config/model-registry";
2
+ export type ModelsAction = "ls" | "find" | "refresh" | "canonical";
3
+ export interface ModelsCommandArgs {
4
+ action: ModelsAction;
5
+ /** Search substring for `find`, or optional filter for `ls`. */
6
+ pattern?: string;
7
+ flags: {
8
+ json?: boolean;
9
+ /** CLI `-e <path>` extension paths to load before listing (issue #905). */
10
+ extensions?: string[];
11
+ /** Skip extension discovery; only load explicit `extensions`. */
12
+ noExtensions?: boolean;
13
+ /** Extra `config.yml` overlays to apply for this invocation. */
14
+ config?: string[];
15
+ };
16
+ }
17
+ /** Resolve the two positional args into an action + filter (provider names fall through to `ls`). */
18
+ export declare function resolveModelsArgs(first: string | undefined, second: string | undefined): {
19
+ action: ModelsAction;
20
+ pattern: string | undefined;
21
+ };
22
+ /**
23
+ * Options for {@link runModelsListing}: render the catalog from a caller-supplied
24
+ * registry. Loads extensions (CLI `-e` paths and configured `settings.extensions`)
25
+ * and discovers their providers before rendering so extension-contributed models
26
+ * appear (issue #905). The caller is responsible for refreshing built-in providers.
27
+ */
28
+ export interface RunModelsListingOptions {
29
+ modelRegistry: ModelRegistry;
30
+ cwd: string;
31
+ action?: ModelsAction;
32
+ pattern?: string;
33
+ json?: boolean;
34
+ /** CLI-supplied extension paths (e.g. from `-e <path>`). */
35
+ additionalExtensionPaths?: string[];
36
+ /** Extension paths configured under `extensions:` in user settings. */
37
+ settingsExtensions?: string[];
38
+ /** Disabled extension ids from settings (`disabledExtensions`). */
39
+ disabledExtensionIds?: string[];
40
+ /** When true, skip discovery and only load `additionalExtensionPaths`. */
41
+ disableExtensionDiscovery?: boolean;
42
+ }
43
+ export declare function runModelsListing(options: RunModelsListingOptions): Promise<void>;
44
+ /**
45
+ * Entry point for the standalone `omp models` command: bootstraps auth storage,
46
+ * settings, and the model registry, force/cache-refreshes built-in providers per
47
+ * the chosen action, then delegates to {@link runModelsListing}.
48
+ */
49
+ export declare function runModelsCommand(command: ModelsCommandArgs): Promise<void>;
@@ -115,9 +115,6 @@ export default class Index extends Command {
115
115
  export: import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"string"> & {
116
116
  description: string;
117
117
  };
118
- "list-models": import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"string"> & {
119
- description: string;
120
- };
121
118
  "no-title": import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"boolean"> & {
122
119
  description: string;
123
120
  };
@@ -0,0 +1,33 @@
1
+ import { Command } from "@oh-my-pi/pi-utils/cli";
2
+ export default class Models extends Command {
3
+ static description: string;
4
+ static args: {
5
+ action: import("@oh-my-pi/pi-utils/cli").ArgDescriptor & {
6
+ description: string;
7
+ required: false;
8
+ };
9
+ pattern: import("@oh-my-pi/pi-utils/cli").ArgDescriptor & {
10
+ description: string;
11
+ required: false;
12
+ };
13
+ };
14
+ static flags: {
15
+ json: import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"boolean"> & {
16
+ description: string;
17
+ };
18
+ extension: import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"string"> & {
19
+ char: string;
20
+ description: string;
21
+ multiple: true;
22
+ };
23
+ "no-extensions": import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"boolean"> & {
24
+ description: string;
25
+ };
26
+ config: import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"string"> & {
27
+ description: string;
28
+ multiple: true;
29
+ };
30
+ };
31
+ static examples: string[];
32
+ run(): Promise<void>;
33
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Get the API key or OAuth token for a provider.
3
+ */
4
+ import { Command } from "@oh-my-pi/pi-utils/cli";
5
+ export default class Token extends Command {
6
+ static description: string;
7
+ static args: {
8
+ provider: import("@oh-my-pi/pi-utils/cli").ArgDescriptor & {
9
+ description: string;
10
+ required: true;
11
+ };
12
+ };
13
+ static flags: {
14
+ raw: import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"boolean"> & {
15
+ description: string;
16
+ default: boolean;
17
+ };
18
+ "force-refresh": import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"boolean"> & {
19
+ description: string;
20
+ default: boolean;
21
+ };
22
+ };
23
+ static examples: string[];
24
+ run(): Promise<void>;
25
+ }
@@ -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 type { ModelRegistry } from "../../../config/model-registry";
4
4
  import type { Settings } from "../../../config/settings";
@@ -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 type { CustomTool } from "../../../extensibility/custom-tools/types";
4
4
  export declare function getFilePriority(filename: string): number;
@@ -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
  declare const gitHunkSchema: z.ZodObject<{
4
4
  file: z.ZodString;
@@ -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 type { CustomTool } from "../../../extensibility/custom-tools/types";
4
4
  declare const gitOverviewSchema: z.ZodObject<{
@@ -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 type { CustomTool } from "../../../extensibility/custom-tools/types";
4
4
  declare const proposeChangelogSchema: z.ZodObject<{
@@ -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 type { CustomTool } from "../../../extensibility/custom-tools/types";
4
4
  declare const proposeCommitSchema: z.ZodObject<{
@@ -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
  declare const recentCommitsSchema: z.ZodObject<{
4
4
  count: z.ZodOptional<z.ZodNumber>;
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import { z } from "zod/v4";
2
2
  export declare const commitTypeSchema: z.ZodEnum<{
3
3
  build: "build";
4
4
  chore: "chore";
@@ -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 type { CustomTool } from "../../../extensibility/custom-tools/types";
4
4
  declare const splitCommitSchema: z.ZodObject<{
@@ -1,6 +1,6 @@
1
1
  import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
2
2
  import type { Api, ApiKey, Model } from "@oh-my-pi/pi-ai";
3
- import * as z from "zod/v4";
3
+ import { z } from "zod/v4";
4
4
  import { type ChangelogGenerationResult } from "../../commit/types";
5
5
  export declare const changelogTool: {
6
6
  name: string;
@@ -1,5 +1,5 @@
1
1
  import type { AssistantMessage } from "@oh-my-pi/pi-ai";
2
- import * as z from "zod/v4";
2
+ import { z } from "zod/v4";
3
3
  import type { ConventionalAnalysis } from "./types";
4
4
  /**
5
5
  * Shared Zod schema for the `create_conventional_analysis` tool used by
@@ -123,6 +123,13 @@ export declare class ModelRegistry {
123
123
  * paths that pre-flight auth before model resolution) can probe a model
124
124
  * without resolving an API key. Returns true for keyless providers as well
125
125
  * as providers with stored credentials. See issue #993.
126
+ *
127
+ * Side-effect-free and synchronous: a command-backed key (`!cmd`) counts as
128
+ * configured by its presence alone — the program is NOT executed — and OAuth
129
+ * tokens are NOT refreshed (`authStorage.hasAuth`). This is what keeps the
130
+ * model-switch pre-flight off the event loop's hot path; the real key
131
+ * (command execution + OAuth refresh) is resolved lazily per request via
132
+ * {@link ModelRegistry.resolver}.
126
133
  */
127
134
  hasConfiguredAuth(model: Model<Api>): boolean;
128
135
  getDiscoverableProviders(): string[];
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import { z } from "zod/v4";
2
2
  export declare const OpenAICompatSchema: z.ZodObject<{
3
3
  supportsStore: z.ZodOptional<z.ZodBoolean>;
4
4
  supportsDeveloperRole: z.ZodOptional<z.ZodBoolean>;
@@ -3197,6 +3197,16 @@ export declare const SETTINGS_SCHEMA: {
3197
3197
  readonly description: "Launch browser in headless mode (disable to show browser UI)";
3198
3198
  };
3199
3199
  };
3200
+ readonly "browser.cmux": {
3201
+ readonly type: "boolean";
3202
+ readonly default: true;
3203
+ readonly ui: {
3204
+ readonly tab: "tools";
3205
+ readonly group: "Search & Browser";
3206
+ readonly label: "cmux Browser";
3207
+ readonly description: "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.";
3208
+ };
3209
+ };
3200
3210
  readonly "browser.screenshotDir": {
3201
3211
  readonly type: "string";
3202
3212
  readonly default: undefined;
@@ -3758,6 +3768,14 @@ export declare const SETTINGS_SCHEMA: {
3758
3768
  readonly type: "boolean";
3759
3769
  readonly default: true;
3760
3770
  };
3771
+ readonly "skills.enableAgentsUser": {
3772
+ readonly type: "boolean";
3773
+ readonly default: true;
3774
+ };
3775
+ readonly "skills.enableAgentsProject": {
3776
+ readonly type: "boolean";
3777
+ readonly default: true;
3778
+ };
3761
3779
  readonly "skills.customDirectories": {
3762
3780
  readonly type: "array";
3763
3781
  readonly default: string[];
@@ -4564,6 +4582,8 @@ export interface SkillsSettings {
4564
4582
  enableClaudeProject?: boolean;
4565
4583
  enablePiUser?: boolean;
4566
4584
  enablePiProject?: boolean;
4585
+ enableAgentsUser?: boolean;
4586
+ enableAgentsProject?: boolean;
4567
4587
  customDirectories?: string[];
4568
4588
  ignoredSkills?: string[];
4569
4589
  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
  export declare const hashlineEditParamsSchema: z.ZodPreprocess<z.ZodObject<{
9
9
  input: z.ZodString;
10
10
  }, z.core.$loose>>;
@@ -7,7 +7,7 @@
7
7
  * LSP writethrough, fs-cache invalidation, diagnostics) is shared with
8
8
  * the `patch` mode.
9
9
  */
10
- import * as z from "zod/v4";
10
+ import { z } from "zod/v4";
11
11
  import type { PatchEditEntry } from "./patch";
12
12
  export declare const applyPatchSchema: z.ZodObject<{
13
13
  input: z.ZodString;
@@ -5,7 +5,7 @@
5
5
  * for robust handling of whitespace and formatting differences.
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, type WritethroughDeferredHandle } from "../../lsp";
10
10
  import type { ToolSession } from "../../tools";
11
11
  import type { EditToolDetails, LspBatchRequest } from "../renderer";
@@ -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 type { EditToolDetails, LspBatchRequest } from "../renderer";
@@ -5,7 +5,7 @@
5
5
  * Unlike markdown commands which expand to prompts, custom commands can execute
6
6
  * arbitrary logic with full access to the hook context.
7
7
  */
8
- import type * as Zod from "zod/v4";
8
+ import type { z } from "zod/v4";
9
9
  import type { ExecOptions, ExecResult, HookCommandContext } from "../../extensibility/hooks/types";
10
10
  import type * as PiCodingAgent from "../../index";
11
11
  import type * as TypeBox from "../typebox";
@@ -22,7 +22,7 @@ export interface CustomCommandAPI {
22
22
  /** Injected zod-backed typebox shim (legacy/compat). */
23
23
  typebox: typeof TypeBox;
24
24
  /** Injected zod module for Zod-authored custom commands. */
25
- zod: typeof Zod;
25
+ zod: typeof z;
26
26
  /** Injected pi-coding-agent exports */
27
27
  pi: typeof PiCodingAgent;
28
28
  }
@@ -9,7 +9,7 @@ import type { CompactionResult } from "@oh-my-pi/pi-agent-core/compaction";
9
9
  import type { FetchImpl, Model, Static, TSchema } from "@oh-my-pi/pi-ai";
10
10
  import type { Component } from "@oh-my-pi/pi-tui";
11
11
  import type { logger as PiLogger } from "@oh-my-pi/pi-utils";
12
- import type * as Zod from "zod/v4";
12
+ import type { z } from "zod/v4";
13
13
  import type { Rule } from "../../capability/rule";
14
14
  import type { ModelRegistry } from "../../config/model-registry";
15
15
  import type { Settings } from "../../config/settings";
@@ -53,7 +53,7 @@ export interface CustomToolAPI {
53
53
  /** Injected zod-backed typebox shim (legacy/compat — Zod-authored tools are preferred). */
54
54
  typebox: typeof TypeBox;
55
55
  /** Injected zod module for Zod-authored custom tools. */
56
- zod: typeof Zod;
56
+ zod: typeof z;
57
57
  /** Injected pi-coding-agent exports */
58
58
  pi: typeof PiCodingAgent;
59
59
  /** Push a preview action that can later be resolved with the hidden resolve tool */
@@ -13,7 +13,7 @@ import type { Api, AssistantMessageEvent, AssistantMessageEventStream, Context,
13
13
  import type { OAuthCredentials, OAuthLoginCallbacks } from "@oh-my-pi/pi-ai/oauth/types";
14
14
  import type { AutocompleteItem, Component, EditorTheme, KeyId, TUI } from "@oh-my-pi/pi-tui";
15
15
  import type { logger as PiLogger } from "@oh-my-pi/pi-utils";
16
- import type * as Zod from "zod/v4";
16
+ import type { z } from "zod/v4";
17
17
  import type { KeybindingsManager } from "../../config/keybindings";
18
18
  import type { ModelRegistry } from "../../config/model-registry";
19
19
  import type { EditToolDetails } from "../../edit";
@@ -558,7 +558,7 @@ export interface ExtensionAPI {
558
558
  /** Injected zod-backed typebox shim for legacy `Type.Object(...)` parameter authoring. */
559
559
  typebox: typeof TypeBox;
560
560
  /** Injected zod module for Zod-authored extension tools (canonical going forward). */
561
- zod: typeof Zod;
561
+ zod: typeof z;
562
562
  /** Injected pi-coding-agent exports for accessing SDK utilities */
563
563
  pi: typeof PiCodingAgent;
564
564
  on(event: "resources_discover", handler: ExtensionHandler<ResourcesDiscoverEvent, ResourcesDiscoverResult>): void;
@@ -1,7 +1,7 @@
1
1
  import type { ImageContent, Message, Model, TextContent } from "@oh-my-pi/pi-ai";
2
2
  import type { Component, TUI } from "@oh-my-pi/pi-tui";
3
3
  import type { logger as PiLogger } from "@oh-my-pi/pi-utils";
4
- import type * as Zod from "zod/v4";
4
+ import type { z } from "zod/v4";
5
5
  import type { ModelRegistry } from "../../config/model-registry";
6
6
  import type { EditToolDetails } from "../../edit";
7
7
  import type { ExecOptions, ExecResult } from "../../exec/exec";
@@ -420,7 +420,7 @@ export interface HookAPI {
420
420
  /** Injected zod-backed typebox shim (legacy/compat — prefer `zod`). */
421
421
  typebox: typeof TypeBox;
422
422
  /** Injected zod module for Zod-authored hooks. */
423
- zod: typeof Zod;
423
+ zod: typeof z;
424
424
  /** Injected pi-coding-agent exports */
425
425
  pi: typeof PiCodingAgent;
426
426
  }
@@ -1,6 +1,6 @@
1
1
  import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
2
2
  import type { Component } from "@oh-my-pi/pi-tui";
3
- import * as z from "zod/v4";
3
+ import { z } from "zod/v4";
4
4
  import type { RenderResultOptions } from "../../extensibility/custom-tools/types";
5
5
  import type { Theme } from "../../modes/theme/theme";
6
6
  import type { ToolSession } from "../../tools";
@@ -1,5 +1,5 @@
1
1
  import type { ptree } from "@oh-my-pi/pi-utils";
2
- import * as z from "zod/v4";
2
+ import { z } from "zod/v4";
3
3
  export declare const lspSchema: z.ZodObject<{
4
4
  action: z.ZodEnum<{
5
5
  capabilities: "capabilities";
@@ -104,6 +104,14 @@ export declare class MCPManager {
104
104
  * Get the source metadata for a server.
105
105
  */
106
106
  getSource(name: string): SourceMeta | undefined;
107
+ /**
108
+ * Get the preserved (pre-auth) config for a known server — whether currently
109
+ * connected or merely discovered (a connect was attempted but may have failed,
110
+ * e.g. an OAuth server that has not been authorized yet). Mirrors the
111
+ * reconnect lookup at {@link reconnectServer} so callers like `/mcp reauth`
112
+ * can recover a discovered server's config without re-reading config files.
113
+ */
114
+ getServerConfig(name: string): MCPServerConfig | undefined;
107
115
  /**
108
116
  * Wait for a connection to complete (or fail).
109
117
  */
@@ -28,4 +28,32 @@ export interface MnemopiBackendConfig {
28
28
  llmModel?: string;
29
29
  }
30
30
  export declare function loadMnemopiConfig(settings: Settings, agentDir: string): MnemopiBackendConfig;
31
+ export interface MnemopiBankScope {
32
+ baseBank: string;
33
+ bank: string;
34
+ globalBank: string;
35
+ retainBank: string;
36
+ recallBanks: readonly string[];
37
+ }
38
+ /**
39
+ * Resolve write/recall banks for a session.
40
+ *
41
+ * Mnemopi has no tag-filtered recall, so `per-project-tagged` maps to a
42
+ * project-local write bank plus a shared recall-visible bank. The project
43
+ * bank is derived purely from {@link cwd} — see {@link projectBank} for the
44
+ * stability contract.
45
+ */
46
+ export declare function computeMnemopiBankScope(configured: string | undefined, cwd: string, scoping: MnemopiScoping): MnemopiBankScope;
47
+ /**
48
+ * Discover sibling banks under `<dbDir>/banks/` whose `working_memory` rows
49
+ * already carry the active `cwd` in `metadata_json.$.cwd`, and add them to
50
+ * the recall set. This rescues memories stranded by a previous, less-stable
51
+ * bank derivation (#2412) without changing the write target — only recall is
52
+ * widened.
53
+ *
54
+ * Robust by design: a missing banks directory, unreadable bank dir, or
55
+ * corrupt SQLite file is silently skipped. Scanning is capped at
56
+ * {@link LEGACY_BANK_SCAN_LIMIT} to bound startup cost.
57
+ */
58
+ export declare function extendRecallWithLegacyBanks(resolved: readonly string[], dbPath: string, cwd: string): readonly string[];
31
59
  export declare function truncateApproxTokens(text: string, tokenLimit: number): string;
@@ -1,4 +1,4 @@
1
- import { type Agent, type AgentSideConnection, type AuthenticateRequest, type AuthenticateResponse, type ClientCapabilities, type CloseSessionRequest, type CloseSessionResponse, type ForkSessionRequest, type ForkSessionResponse, type InitializeRequest, type InitializeResponse, type ListSessionsRequest, type ListSessionsResponse, type LoadSessionRequest, type LoadSessionResponse, type NewSessionRequest, type NewSessionResponse, type PromptRequest, type PromptResponse, type ResumeSessionRequest, type ResumeSessionResponse, type SetSessionConfigOptionRequest, type SetSessionConfigOptionResponse, type SetSessionModelRequest, type SetSessionModelResponse, type SetSessionModeRequest, type SetSessionModeResponse } from "@agentclientprotocol/sdk";
1
+ import { type Agent, type AgentSideConnection, type AuthenticateRequest, type AuthenticateResponse, type ClientCapabilities, type CloseSessionRequest, type CloseSessionResponse, type ForkSessionRequest, type ForkSessionResponse, type InitializeRequest, type InitializeResponse, type ListSessionsRequest, type ListSessionsResponse, type LoadSessionRequest, type LoadSessionResponse, type NewSessionRequest, type NewSessionResponse, type PromptRequest, type PromptResponse, type ResumeSessionRequest, type ResumeSessionResponse, type SetSessionConfigOptionRequest, type SetSessionConfigOptionResponse, type SetSessionModeRequest, type SetSessionModeResponse } from "@agentclientprotocol/sdk";
2
2
  import { type ExtensionUIContext } from "../../extensibility/extensions";
3
3
  import type { AgentSession } from "../../session/agent-session";
4
4
  /**
@@ -42,7 +42,6 @@ export declare class AcpAgent implements Agent {
42
42
  closeSession(params: CloseSessionRequest): Promise<CloseSessionResponse>;
43
43
  setSessionMode(params: SetSessionModeRequest): Promise<SetSessionModeResponse>;
44
44
  setSessionConfigOption(params: SetSessionConfigOptionRequest): Promise<SetSessionConfigOptionResponse>;
45
- unstable_setSessionModel(params: SetSessionModelRequest): Promise<SetSessionModelResponse>;
46
45
  prompt(params: PromptRequest): Promise<PromptResponse>;
47
46
  cancel(params: {
48
47
  sessionId: string;
@@ -15,6 +15,7 @@ export * from "./hook-message";
15
15
  export * from "./hook-selector";
16
16
  export * from "./keybinding-hints";
17
17
  export * from "./login-dialog";
18
+ export * from "./logout-account-selector";
18
19
  export * from "./model-selector";
19
20
  export * from "./oauth-selector";
20
21
  export * from "./queue-mode-selector";
@@ -0,0 +1,8 @@
1
+ import { Container } from "@oh-my-pi/pi-tui";
2
+ import type { LogoutAccount } from "../../slash-commands/helpers/logout";
3
+ /** Account picker for `/logout` after the provider has been selected. */
4
+ export declare class LogoutAccountSelectorComponent extends Container {
5
+ #private;
6
+ constructor(providerName: string, accounts: LogoutAccount[], onSelect: (account: LogoutAccount) => void, onCancel: () => void);
7
+ handleInput(keyData: string): void;
8
+ }
@@ -40,13 +40,17 @@ export declare class StatusLineComponent implements Component {
40
40
  */
41
41
  refreshUsageInBackground(): void;
42
42
  /**
43
- * Compute the (cached) used-tokens / context-window totals for the
44
- * status-line context% segment. Exposed (non-private) so unit tests can
45
- * verify the incremental-cache invariants; not part of any external
46
- * API.
43
+ * Used-tokens / context-window totals for the status-line context% segment,
44
+ * memoized so the per-event redraw stays O(1) when nothing changed.
45
+ *
46
+ * The numerator comes from `session.getContextUsage()`, which anchors on the
47
+ * last assistant's real prompt-token count — so the bar matches the provider
48
+ * and the `/context` panel — and reports `null` while that count is unknown
49
+ * (right after compaction, before the next response). Exposed (non-private)
50
+ * for unit tests and the collab host's state broadcast.
47
51
  */
48
52
  getCachedContextBreakdown(): {
49
- usedTokens: number;
53
+ usedTokens: number | null;
50
54
  contextWindow: number;
51
55
  };
52
56
  getTopBorder(width: number): {
@@ -70,7 +70,8 @@ export interface SegmentContext {
70
70
  cost: number;
71
71
  tokensPerSecond: number | null;
72
72
  };
73
- contextPercent: number;
73
+ /** Context usage percent, or null when unknown (e.g. right after compaction). */
74
+ contextPercent: number | null;
74
75
  contextWindow: number;
75
76
  autoCompactEnabled: boolean;
76
77
  subagentCount: number;
@@ -1,27 +1,10 @@
1
1
  import type { InteractiveModeContext } from "../../modes/types";
2
2
  import type { AgentSessionEvent } from "../../session/agent-session";
3
- /**
4
- * Loader label shown the instant a user interrupt (Esc) is requested, kept until
5
- * the agent turn fully unwinds. Esc fires the abort synchronously, but the loop
6
- * only stops the spinner at `agent_end`, which it cannot reach until every
7
- * in-flight tool settles its abort in `executeToolCalls` (`Promise.allSettled`).
8
- * Swapping the steady "Working…" for this acknowledges the keypress instead of
9
- * reading as an ignored Esc for the seconds a slow tool takes to tear down.
10
- */
11
- export declare const INTERRUPTING_WORKING_MESSAGE = "Interrupting\u2026";
12
3
  export declare class EventController {
13
4
  #private;
14
5
  private ctx;
15
6
  constructor(ctx: InteractiveModeContext);
16
7
  dispose(): void;
17
- /**
18
- * Acknowledge a user interrupt (Esc) immediately: switch the loader to
19
- * `INTERRUPTING_WORKING_MESSAGE` and freeze intent-driven working-message
20
- * updates for the rest of the turn so a late `tool_execution_start` intent
21
- * cannot repaint a "Working…/<intent>" line over the acknowledgment. Reset at
22
- * the next `agent_start`. No-op outside an active turn or if already set.
23
- */
24
- notifyInterrupting(): void;
25
8
  subscribeToAgent(): void;
26
9
  /**
27
10
  * Clear every transcript-anchored/turn-scoped piece of state. Used by the
@@ -107,8 +107,6 @@ export declare class InteractiveMode implements InteractiveModeContext {
107
107
  loadingAnimation: Loader | undefined;
108
108
  autoCompactionLoader: Loader | undefined;
109
109
  retryLoader: Loader | undefined;
110
- autoCompactionEscapeHandler?: () => void;
111
- retryEscapeHandler?: () => void;
112
110
  unsubscribe?: () => void;
113
111
  onInputCallback?: (input: SubmittedUserInput) => void;
114
112
  optimisticUserMessageSignature: string | undefined;
@@ -218,7 +216,6 @@ export declare class InteractiveMode implements InteractiveModeContext {
218
216
  ensureLoadingAnimation(): void;
219
217
  setWorkingMessage(message?: string): void;
220
218
  applyPendingWorkingMessage(): void;
221
- notifyInterrupting(): void;
222
219
  showNewVersionNotification(newVersion: string): void;
223
220
  clearEditor(): void;
224
221
  updatePendingMessagesDisplay(): void;
@@ -130,8 +130,6 @@ export interface InteractiveModeContext {
130
130
  loadingAnimation: Loader | undefined;
131
131
  autoCompactionLoader: Loader | undefined;
132
132
  retryLoader: Loader | undefined;
133
- autoCompactionEscapeHandler?: () => void;
134
- retryEscapeHandler?: () => void;
135
133
  unsubscribe?: () => void;
136
134
  onInputCallback?: (input: SubmittedUserInput) => void;
137
135
  optimisticUserMessageSignature: string | undefined;
@@ -188,9 +186,6 @@ export interface InteractiveModeContext {
188
186
  flushPendingModelSwitch(): Promise<void>;
189
187
  setWorkingMessage(message?: string): void;
190
188
  applyPendingWorkingMessage(): void;
191
- /** Acknowledge a user interrupt (Esc) by switching the loader to an
192
- * "Interrupting…" label until the agent turn unwinds. */
193
- notifyInterrupting(): void;
194
189
  ensureLoadingAnimation(): void;
195
190
  startPendingSubmission(input: {
196
191
  text: string;