@oh-my-pi/pi-coding-agent 15.10.12 → 15.11.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 (158) hide show
  1. package/CHANGELOG.md +90 -4
  2. package/dist/cli.js +869 -825
  3. package/dist/types/async/index.d.ts +0 -1
  4. package/dist/types/capability/mcp.d.ts +1 -0
  5. package/dist/types/cli/gallery-fixtures/types.d.ts +5 -0
  6. package/dist/types/config/keybindings.d.ts +6 -1
  7. package/dist/types/config/settings-schema.d.ts +66 -34
  8. package/dist/types/export/html/template.generated.d.ts +1 -1
  9. package/dist/types/extensibility/custom-tools/types.d.ts +2 -2
  10. package/dist/types/extensibility/shared-events.d.ts +2 -2
  11. package/dist/types/internal-urls/history-protocol.d.ts +14 -0
  12. package/dist/types/internal-urls/index.d.ts +1 -0
  13. package/dist/types/internal-urls/types.d.ts +1 -1
  14. package/dist/types/irc/bus.d.ts +66 -0
  15. package/dist/types/mcp/oauth-discovery.d.ts +2 -0
  16. package/dist/types/mcp/oauth-flow.d.ts +6 -1
  17. package/dist/types/mcp/transports/stdio.d.ts +1 -0
  18. package/dist/types/mcp/types.d.ts +2 -0
  19. package/dist/types/modes/components/agent-hub.d.ts +30 -0
  20. package/dist/types/modes/components/assistant-message.d.ts +1 -0
  21. package/dist/types/modes/components/compaction-summary-message.d.ts +10 -4
  22. package/dist/types/modes/components/custom-editor.d.ts +2 -0
  23. package/dist/types/modes/components/mcp-add-wizard.d.ts +2 -1
  24. package/dist/types/modes/components/settings-selector.d.ts +1 -0
  25. package/dist/types/modes/components/status-line/types.d.ts +3 -0
  26. package/dist/types/modes/components/tool-execution.d.ts +8 -0
  27. package/dist/types/modes/components/transcript-container.d.ts +3 -2
  28. package/dist/types/modes/components/ttsr-notification.d.ts +5 -1
  29. package/dist/types/modes/components/welcome.d.ts +3 -9
  30. package/dist/types/modes/controllers/selector-controller.d.ts +1 -1
  31. package/dist/types/modes/controllers/tool-args-reveal.d.ts +43 -0
  32. package/dist/types/modes/interactive-mode.d.ts +3 -2
  33. package/dist/types/modes/theme/theme.d.ts +3 -1
  34. package/dist/types/modes/types.d.ts +3 -2
  35. package/dist/types/modes/utils/ui-helpers.d.ts +1 -1
  36. package/dist/types/registry/agent-lifecycle.d.ts +51 -0
  37. package/dist/types/registry/agent-registry.d.ts +16 -5
  38. package/dist/types/session/agent-session.d.ts +35 -30
  39. package/dist/types/session/messages.d.ts +2 -4
  40. package/dist/types/session/session-history-format.d.ts +12 -0
  41. package/dist/types/session/session-manager.d.ts +21 -3
  42. package/dist/types/session/streaming-output.d.ts +23 -0
  43. package/dist/types/task/executor.d.ts +11 -2
  44. package/dist/types/task/index.d.ts +11 -4
  45. package/dist/types/task/output-manager.d.ts +0 -7
  46. package/dist/types/task/repair-args.d.ts +8 -7
  47. package/dist/types/task/types.d.ts +55 -51
  48. package/dist/types/tools/browser/tab-worker.d.ts +3 -1
  49. package/dist/types/tools/find.d.ts +0 -11
  50. package/dist/types/tools/grouped-file-output.d.ts +0 -49
  51. package/dist/types/tools/index.d.ts +1 -3
  52. package/dist/types/tools/irc.d.ts +76 -38
  53. package/dist/types/tools/job.d.ts +7 -1
  54. package/dist/types/tools/render-utils.d.ts +22 -0
  55. package/examples/extensions/with-deps/package.json +1 -0
  56. package/package.json +11 -10
  57. package/scripts/bundle-dist.ts +28 -19
  58. package/src/async/index.ts +0 -1
  59. package/src/capability/mcp.ts +1 -0
  60. package/src/cli/gallery-cli.ts +6 -5
  61. package/src/cli/gallery-fixtures/agentic.ts +230 -115
  62. package/src/cli/gallery-fixtures/types.ts +5 -0
  63. package/src/cli.ts +20 -6
  64. package/src/commit/agentic/tools/analyze-file.ts +38 -19
  65. package/src/config/keybindings.ts +6 -1
  66. package/src/config/mcp-schema.json +4 -0
  67. package/src/config/settings-schema.ts +68 -41
  68. package/src/config/settings.ts +7 -0
  69. package/src/edit/renderer.ts +96 -46
  70. package/src/eval/__tests__/agent-bridge.test.ts +5 -3
  71. package/src/eval/agent-bridge.ts +3 -16
  72. package/src/eval/js/shared/prelude.txt +1 -1
  73. package/src/eval/py/prelude.py +5 -6
  74. package/src/export/html/template.generated.ts +1 -1
  75. package/src/export/html/template.js +44 -14
  76. package/src/extensibility/custom-tools/types.ts +2 -2
  77. package/src/extensibility/shared-events.ts +2 -2
  78. package/src/internal-urls/docs-index.generated.ts +9 -9
  79. package/src/internal-urls/history-protocol.ts +113 -0
  80. package/src/internal-urls/index.ts +1 -0
  81. package/src/internal-urls/router.ts +3 -1
  82. package/src/internal-urls/types.ts +1 -1
  83. package/src/irc/bus.ts +292 -0
  84. package/src/main.ts +8 -60
  85. package/src/mcp/manager.ts +3 -0
  86. package/src/mcp/oauth-discovery.ts +27 -2
  87. package/src/mcp/oauth-flow.ts +47 -1
  88. package/src/mcp/transports/stdio.ts +3 -0
  89. package/src/mcp/types.ts +2 -0
  90. package/src/modes/components/{session-observer-overlay.ts → agent-hub.ts} +586 -367
  91. package/src/modes/components/assistant-message.ts +15 -0
  92. package/src/modes/components/btw-panel.ts +5 -1
  93. package/src/modes/components/compaction-summary-message.ts +68 -32
  94. package/src/modes/components/custom-editor.ts +10 -0
  95. package/src/modes/components/mcp-add-wizard.ts +13 -0
  96. package/src/modes/components/settings-selector.ts +2 -0
  97. package/src/modes/components/status-line/component.ts +22 -12
  98. package/src/modes/components/status-line/types.ts +3 -0
  99. package/src/modes/components/tool-execution.ts +31 -1
  100. package/src/modes/components/transcript-container.ts +99 -18
  101. package/src/modes/components/tree-selector.ts +6 -1
  102. package/src/modes/components/ttsr-notification.ts +72 -30
  103. package/src/modes/components/welcome.ts +9 -33
  104. package/src/modes/controllers/event-controller.ts +93 -4
  105. package/src/modes/controllers/extension-ui-controller.ts +8 -8
  106. package/src/modes/controllers/input-controller.ts +18 -2
  107. package/src/modes/controllers/mcp-command-controller.ts +34 -2
  108. package/src/modes/controllers/selector-controller.ts +25 -17
  109. package/src/modes/controllers/tool-args-reveal.ts +174 -0
  110. package/src/modes/interactive-mode.ts +17 -15
  111. package/src/modes/theme/theme.ts +24 -5
  112. package/src/modes/types.ts +3 -5
  113. package/src/modes/utils/hotkeys-markdown.ts +1 -0
  114. package/src/modes/utils/ui-helpers.ts +51 -49
  115. package/src/prompts/system/irc-incoming.md +3 -4
  116. package/src/prompts/system/orchestrate-notice.md +2 -2
  117. package/src/prompts/system/subagent-system-prompt.md +0 -5
  118. package/src/prompts/system/system-prompt.md +1 -0
  119. package/src/prompts/system/workflow-notice.md +2 -2
  120. package/src/prompts/tools/eval.md +3 -3
  121. package/src/prompts/tools/irc.md +29 -19
  122. package/src/prompts/tools/read.md +2 -2
  123. package/src/prompts/tools/task-summary.md +5 -16
  124. package/src/prompts/tools/task.md +43 -29
  125. package/src/registry/agent-lifecycle.ts +218 -0
  126. package/src/registry/agent-registry.ts +16 -5
  127. package/src/sdk.ts +29 -9
  128. package/src/session/agent-session.ts +268 -241
  129. package/src/session/messages.ts +11 -78
  130. package/src/session/session-history-format.ts +246 -0
  131. package/src/session/session-manager.ts +59 -5
  132. package/src/session/streaming-output.ts +60 -0
  133. package/src/task/executor.ts +855 -466
  134. package/src/task/index.ts +723 -794
  135. package/src/task/output-manager.ts +0 -11
  136. package/src/task/render.ts +142 -66
  137. package/src/task/repair-args.ts +21 -9
  138. package/src/task/types.ts +73 -66
  139. package/src/tools/ask.ts +4 -2
  140. package/src/tools/bash.ts +15 -5
  141. package/src/tools/browser/tab-worker.ts +26 -7
  142. package/src/tools/browser.ts +28 -1
  143. package/src/tools/find.ts +2 -27
  144. package/src/tools/grouped-file-output.ts +1 -118
  145. package/src/tools/index.ts +4 -12
  146. package/src/tools/irc.ts +596 -171
  147. package/src/tools/job.ts +41 -7
  148. package/src/tools/read.ts +57 -1
  149. package/src/tools/render-utils.ts +56 -0
  150. package/src/tools/renderers.ts +2 -0
  151. package/src/tools/resolve.ts +4 -1
  152. package/src/tools/write.ts +65 -47
  153. package/src/web/search/providers/anthropic.ts +29 -4
  154. package/dist/types/async/support.d.ts +0 -2
  155. package/dist/types/modes/components/session-observer-overlay.d.ts +0 -11
  156. package/dist/types/task/simple-mode.d.ts +0 -8
  157. package/src/async/support.ts +0 -5
  158. package/src/task/simple-mode.ts +0 -27
@@ -1,58 +1,62 @@
1
1
  /**
2
- * IRC tool — agent-to-agent messaging.
2
+ * IRC tool — agent-to-agent messaging over the process-global IrcBus.
3
3
  *
4
- * Lets any live agent send a short prose message to any other live agent in
5
- * this process and (optionally) get a prose reply.
6
- *
7
- * Routing happens via the global AgentRegistry. Replies are produced by an
8
- * ephemeral side-channel call (`AgentSession.respondAsBackground`) that
9
- * mirrors `/btw`: the recipient's current model, system prompt, and message
10
- * history are used to compute a reply without persisting it through the
11
- * normal stream path. After the reply is generated, both the incoming
12
- * message and the auto-reply are queued for injection into the recipient's
13
- * persisted history (deferred until the recipient is idle), so the model
14
- * sees the exchange on its next turn.
15
- *
16
- * This avoids the deadlock that arises when the recipient is blocked on a
17
- * long-running tool call: the side-channel call does not depend on the
18
- * recipient's main agent loop being free.
4
+ * `send` is fire-and-forget: the bus routes the message to the recipient
5
+ * (waking idle agents with a real turn, reviving parked ones via the
6
+ * lifecycle manager, injecting a non-interrupting aside into busy ones) and
7
+ * returns delivery receipts immediately. Replies are real turns by the
8
+ * recipient, observed with `wait` (or the `await: true` send sugar). `inbox`
9
+ * drains pending messages; `list` shows every addressable peer.
19
10
  */
20
11
  import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
12
+ import { type Component } from "@oh-my-pi/pi-tui";
21
13
  import * as z from "zod/v4";
14
+ import type { Settings } from "../config/settings";
15
+ import type { RenderResultOptions } from "../extensibility/custom-tools/types";
16
+ import { type IrcDeliveryReceipt, type IrcMessage } from "../irc/bus";
17
+ import type { Theme } from "../modes/theme/theme";
22
18
  import type { ToolSession } from ".";
19
+ /**
20
+ * IRC availability: there must be someone to chat with. True for every
21
+ * subagent (it always has a parent, and possibly siblings) and for any
22
+ * session that can still spawn subagents through the task tool. Only a
23
+ * top-level session with task spawning unavailable has no peers — no irc.
24
+ */
25
+ export declare function isIrcEnabled(settings: Settings, taskDepth: number): boolean;
23
26
  declare const ircSchema: z.ZodObject<{
24
27
  op: z.ZodEnum<{
28
+ inbox: "inbox";
25
29
  list: "list";
26
30
  send: "send";
31
+ wait: "wait";
27
32
  }>;
28
33
  to: z.ZodOptional<z.ZodString>;
29
34
  message: z.ZodOptional<z.ZodString>;
30
- awaitReply: z.ZodOptional<z.ZodBoolean>;
35
+ replyTo: z.ZodOptional<z.ZodString>;
36
+ await: z.ZodOptional<z.ZodBoolean>;
37
+ from: z.ZodOptional<z.ZodString>;
38
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
39
+ peek: z.ZodOptional<z.ZodBoolean>;
31
40
  }, z.core.$strip>;
32
41
  type IrcParams = z.infer<typeof ircSchema>;
33
- interface IrcReply {
34
- from: string;
35
- text: string;
42
+ interface IrcPeerInfo {
43
+ id: string;
44
+ displayName: string;
45
+ kind: string;
46
+ status: string;
47
+ parentId?: string;
48
+ unread: number;
49
+ lastActivity: number;
36
50
  }
37
51
  export interface IrcDetails {
38
- op: "send" | "list";
52
+ op: "send" | "wait" | "inbox" | "list";
39
53
  from?: string;
40
54
  to?: string;
41
- delivered?: string[];
42
- replies?: IrcReply[];
43
- failed?: Array<{
44
- id: string;
45
- error: string;
46
- }>;
47
- notFound?: string[];
48
- peers?: Array<{
49
- id: string;
50
- displayName: string;
51
- kind: string;
52
- status: string;
53
- parentId?: string;
54
- }>;
55
- channels?: string[];
55
+ receipts?: IrcDeliveryReceipt[];
56
+ /** Message consumed by `wait` / `send await:true`; null when the wait timed out. */
57
+ waited?: IrcMessage | null;
58
+ inbox?: IrcMessage[];
59
+ peers?: IrcPeerInfo[];
56
60
  }
57
61
  export declare class IrcTool implements AgentTool<typeof ircSchema, IrcDetails> {
58
62
  #private;
@@ -60,16 +64,22 @@ export declare class IrcTool implements AgentTool<typeof ircSchema, IrcDetails>
60
64
  readonly name = "irc";
61
65
  readonly approval: "read";
62
66
  readonly label = "IRC";
63
- readonly summary = "Send and receive messages between agents over IRC-like channels";
67
+ readonly summary = "Send and receive messages between agents";
64
68
  readonly description: string;
65
69
  readonly parameters: z.ZodObject<{
66
70
  op: z.ZodEnum<{
71
+ inbox: "inbox";
67
72
  list: "list";
68
73
  send: "send";
74
+ wait: "wait";
69
75
  }>;
70
76
  to: z.ZodOptional<z.ZodString>;
71
77
  message: z.ZodOptional<z.ZodString>;
72
- awaitReply: z.ZodOptional<z.ZodBoolean>;
78
+ replyTo: z.ZodOptional<z.ZodString>;
79
+ await: z.ZodOptional<z.ZodBoolean>;
80
+ from: z.ZodOptional<z.ZodString>;
81
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
82
+ peek: z.ZodOptional<z.ZodBoolean>;
73
83
  }, z.core.$strip>;
74
84
  readonly strict = true;
75
85
  readonly loadMode = "discoverable";
@@ -77,4 +87,32 @@ export declare class IrcTool implements AgentTool<typeof ircSchema, IrcDetails>
77
87
  static createIf(session: ToolSession): IrcTool | null;
78
88
  execute(_toolCallId: string, params: IrcParams, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback<IrcDetails>, _context?: AgentToolContext): Promise<AgentToolResult<IrcDetails>>;
79
89
  }
90
+ type IrcRenderArgs = Partial<IrcParams>;
91
+ /**
92
+ * Display-only transcript card for live IRC traffic: `irc:incoming` DMs
93
+ * delivered to this session and `irc:relay` observations of agent↔agent
94
+ * traffic. Shares the tool renderer's glyph + quote-border conventions so
95
+ * cards and `irc` tool output look identical in the transcript.
96
+ */
97
+ export declare function createIrcMessageCard(card: {
98
+ kind: "incoming" | "relay";
99
+ from?: string;
100
+ to?: string;
101
+ body?: string;
102
+ replyTo?: string;
103
+ timestamp?: number;
104
+ }, getExpanded: () => boolean, uiTheme: Theme): Component;
105
+ export declare const ircToolRenderer: {
106
+ inline: boolean;
107
+ mergeCallAndResult: boolean;
108
+ renderCall(args: IrcRenderArgs, _options: RenderResultOptions, uiTheme: Theme): Component;
109
+ renderResult(result: {
110
+ content: Array<{
111
+ type: string;
112
+ text?: string;
113
+ }>;
114
+ details?: IrcDetails;
115
+ isError?: boolean;
116
+ }, options: RenderResultOptions, uiTheme: Theme, args?: IrcRenderArgs): Component;
117
+ };
80
118
  export {};
@@ -27,6 +27,13 @@ export interface JobToolDetails {
27
27
  status: CancelStatus;
28
28
  }[];
29
29
  }
30
+ /**
31
+ * A poll snapshot where every watched job is still running and nothing was
32
+ * cancelled — pure "still waiting" noise once a newer poll exists. The TUI
33
+ * keeps such a block un-finalized (displaceable) so a follow-up `job` call
34
+ * replaces it instead of stacking another waiting frame in the transcript.
35
+ */
36
+ export declare function isWaitingPollDetails(details: unknown): boolean;
30
37
  export declare class JobTool implements AgentTool<typeof jobSchema, JobToolDetails> {
31
38
  #private;
32
39
  private readonly session;
@@ -43,7 +50,6 @@ export declare class JobTool implements AgentTool<typeof jobSchema, JobToolDetai
43
50
  readonly strict = true;
44
51
  readonly loadMode = "discoverable";
45
52
  constructor(session: ToolSession);
46
- static createIf(session: ToolSession): JobTool | null;
47
53
  execute(_toolCallId: string, params: JobParams, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<JobToolDetails>, _context?: AgentToolContext): Promise<AgentToolResult<JobToolDetails>>;
48
54
  }
49
55
  interface JobRenderArgs {
@@ -173,6 +173,28 @@ export declare function capParseErrors(errors: string[] | undefined, limit?: num
173
173
  export declare function createCachedComponent(getExpanded: () => boolean, compute: (width: number, expanded: boolean) => string[], options?: {
174
174
  paddingX?: number;
175
175
  }): Component;
176
+ /**
177
+ * Single-slot memo for an expensive rendered string (syntax highlighting, diff
178
+ * coloring) keyed by the exact inputs that shape the bytes: theme instance,
179
+ * expanded state, a caller-chosen salt (path/language), and the source content.
180
+ * Field-wise comparison instead of a concatenated key string: a cache hit costs
181
+ * one string value-compare (engines short-circuit on length) and a miss never
182
+ * allocates a key. Comparing the {@link Theme} by reference is sound because
183
+ * theme switches replace the instance wholesale (`setTheme`/`previewTheme`/
184
+ * `setSymbolPreset` in modes/theme/theme.ts) — themes are never mutated in
185
+ * place.
186
+ */
187
+ export interface RenderedStringCache {
188
+ theme: Theme | null;
189
+ expanded: boolean;
190
+ salt: string;
191
+ content: string;
192
+ value: string;
193
+ }
194
+ export declare function createRenderedStringCache(): RenderedStringCache;
195
+ /** Drop the memo so the next lookup re-renders (e.g. the render function identity changed). */
196
+ export declare function invalidateRenderedStringCache(cache: RenderedStringCache): void;
197
+ export declare function cachedRenderedString(cache: RenderedStringCache | undefined, theme: Theme, expanded: boolean, salt: string, content: string, render: () => string): string;
176
198
  /**
177
199
  * Append the indented bullet list of parse errors (capped at
178
200
  * {@link PARSE_ERRORS_LIMIT}) to `lines`, with an overflow summary line if the
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
3
  "version": "1.0.0",
4
+ "homepage": "https://omp.sh",
4
5
  "type": "module",
5
6
  "omp": {
6
7
  "extensions": [
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": "15.10.12",
4
+ "version": "15.11.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",
@@ -47,15 +47,16 @@
47
47
  "@agentclientprotocol/sdk": "0.22.1",
48
48
  "@babel/parser": "^7.29.7",
49
49
  "@mozilla/readability": "^0.6.0",
50
- "@oh-my-pi/hashline": "15.10.12",
51
- "@oh-my-pi/omp-stats": "15.10.12",
52
- "@oh-my-pi/pi-agent-core": "15.10.12",
53
- "@oh-my-pi/pi-ai": "15.10.12",
54
- "@oh-my-pi/pi-catalog": "15.10.12",
55
- "@oh-my-pi/pi-mnemopi": "15.10.12",
56
- "@oh-my-pi/pi-natives": "15.10.12",
57
- "@oh-my-pi/pi-tui": "15.10.12",
58
- "@oh-my-pi/pi-utils": "15.10.12",
50
+ "@oh-my-pi/hashline": "15.11.1",
51
+ "@oh-my-pi/omp-stats": "15.11.1",
52
+ "@oh-my-pi/pi-agent-core": "15.11.1",
53
+ "@oh-my-pi/pi-ai": "15.11.1",
54
+ "@oh-my-pi/pi-catalog": "15.11.1",
55
+ "@oh-my-pi/pi-mnemopi": "15.11.1",
56
+ "@oh-my-pi/pi-natives": "15.11.1",
57
+ "@oh-my-pi/pi-tui": "15.11.1",
58
+ "@oh-my-pi/pi-utils": "15.11.1",
59
+ "@oh-my-pi/snapcompact": "15.11.1",
59
60
  "@opentelemetry/api": "^1.9.1",
60
61
  "@opentelemetry/context-async-hooks": "^2.7.1",
61
62
  "@opentelemetry/exporter-trace-otlp-proto": "^0.218.0",
@@ -51,25 +51,34 @@ async function cleanBundleOutputs(): Promise<void> {
51
51
  async function main(): Promise<void> {
52
52
  const start = Bun.nanoseconds();
53
53
  await cleanBundleOutputs();
54
- await runCommand([
55
- "bun",
56
- "build",
57
- "--target=bun",
58
- "--outdir",
59
- "dist",
60
- "--minify-whitespace",
61
- "--minify-syntax",
62
- "--keep-names",
63
- "--external",
64
- "mupdf",
65
- "--external",
66
- "@oh-my-pi/pi-natives",
67
- "--external",
68
- "@huggingface/transformers",
69
- "--define",
70
- 'process.env.PI_BUNDLED="true"',
71
- "./src/cli.ts",
72
- ]);
54
+ // The npm bundle ships no stats dashboard sources or prebuilt dist/client,
55
+ // so embed the dashboard archive the same way compiled binaries do
56
+ // (scripts/build-binary.ts). Reset afterwards to keep the checked-in
57
+ // placeholder empty.
58
+ await runCommand(["bun", "--cwd=../stats", "scripts/generate-client-bundle.ts", "--generate"]);
59
+ try {
60
+ await runCommand([
61
+ "bun",
62
+ "build",
63
+ "--target=bun",
64
+ "--outdir",
65
+ "dist",
66
+ "--minify-whitespace",
67
+ "--minify-syntax",
68
+ "--keep-names",
69
+ "--external",
70
+ "mupdf",
71
+ "--external",
72
+ "@oh-my-pi/pi-natives",
73
+ "--external",
74
+ "@huggingface/transformers",
75
+ "--define",
76
+ 'process.env.PI_BUNDLED="true"',
77
+ "./src/cli.ts",
78
+ ]);
79
+ } finally {
80
+ await runCommand(["bun", "--cwd=../stats", "scripts/generate-client-bundle.ts", "--reset"]);
81
+ }
73
82
  await ensureShebang();
74
83
  const stat = await fs.stat(cliPath);
75
84
  const elapsedMs = (Bun.nanoseconds() - start) / 1_000_000;
@@ -1,2 +1 @@
1
1
  export * from "./job-manager";
2
- export * from "./support";
@@ -36,6 +36,7 @@ export interface MCPServer {
36
36
  tokenUrl?: string;
37
37
  clientId?: string;
38
38
  clientSecret?: string;
39
+ resource?: string;
39
40
  };
40
41
  /** OAuth configuration (clientId, clientSecret, redirectUri, callbackPort, callbackPath) for servers requiring explicit client credentials */
41
42
  oauth?: {
@@ -69,7 +69,7 @@ function fakeToolFor(name: string, fixture: GalleryFixture | undefined): AgentTo
69
69
  if (!fixture?.label && !fixture?.editMode && !fixture?.customRendered) return undefined;
70
70
  const tool: Record<string, unknown> = { name, label: fixture.label ?? name, mode: fixture.editMode };
71
71
  if (fixture.customRendered) {
72
- const renderer = toolRenderers[name] as
72
+ const renderer = toolRenderers[fixture.renderer ?? name] as
73
73
  | { renderCall?: unknown; renderResult?: unknown; mergeCallAndResult?: unknown; inline?: unknown }
74
74
  | undefined;
75
75
  if (renderer) {
@@ -111,10 +111,11 @@ export async function renderGalleryState(
111
111
 
112
112
  const tool = fakeToolFor(name, fixture);
113
113
  const streamingArgs = state === "streaming" ? (fixture.streamingArgs ?? fixture.args) : fixture.args;
114
- // The component only calls `requestRender` during a static render;
115
- // `imageBudget` is consulted solely when images render, which the gallery
116
- // disables. A cast avoids constructing a real terminal.
117
- const ui = { requestRender() {} } as unknown as TUI;
114
+ // The component only calls `requestRender`/`requestComponentRender` (via
115
+ // its loader) during a static render; `imageBudget` is consulted solely
116
+ // when images render, which the gallery disables. A cast avoids
117
+ // constructing a real terminal.
118
+ const ui = { requestRender() {}, requestComponentRender() {} } as unknown as TUI;
118
119
  const component = new ToolExecutionComponent(name, streamingArgs, { showImages: false }, tool, ui, getProjectDir());
119
120
  component.setExpanded(expanded);
120
121