@powerhousedao/reactor-browser 6.2.3 → 6.3.0-dev.10

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 (87) hide show
  1. package/dist/{attachment-service-But1Xljo.d.ts → attachment-service-B-AmTrs2.d.ts} +605 -56
  2. package/dist/attachment-service-B-AmTrs2.d.ts.map +1 -0
  3. package/dist/auth-DRbzRdeC.d.ts +32 -0
  4. package/dist/auth-DRbzRdeC.d.ts.map +1 -0
  5. package/dist/{client-BiJAJ9dW.js → client-BFnMV-EO.js} +39 -22
  6. package/dist/client-BFnMV-EO.js.map +1 -0
  7. package/dist/{client-CngU4mtn.d.ts → client-BP0hXjqq.d.ts} +3 -2
  8. package/dist/client-BP0hXjqq.d.ts.map +1 -0
  9. package/dist/client-wwavHFfs.js +135 -0
  10. package/dist/client-wwavHFfs.js.map +1 -0
  11. package/dist/{dispatch-qRXS70fh.js → dispatch-Cylwl2Dk.js} +363 -44
  12. package/dist/dispatch-Cylwl2Dk.js.map +1 -0
  13. package/dist/{document-by-id-B_8DA4yZ.js → document-by-id-DdvqanGR.js} +2 -2
  14. package/dist/{document-by-id-B_8DA4yZ.js.map → document-by-id-DdvqanGR.js.map} +1 -1
  15. package/dist/document-model-modules-BG-61uke.js +710 -0
  16. package/dist/document-model-modules-BG-61uke.js.map +1 -0
  17. package/dist/{document-operations-Bt-1-ThH.js → document-operations-DRMMwmGZ.js} +2160 -181
  18. package/dist/document-operations-DRMMwmGZ.js.map +1 -0
  19. package/dist/global-iARBhxNI.d.ts +612 -0
  20. package/dist/global-iARBhxNI.d.ts.map +1 -0
  21. package/dist/{index-BABMK8cO.d.ts → index-CNS_9THu.d.ts} +14 -4
  22. package/dist/index-CNS_9THu.d.ts.map +1 -0
  23. package/dist/index.d.ts +560 -79
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +790 -317
  26. package/dist/index.js.map +1 -1
  27. package/dist/inspector-proxy-DODqs15F.d.ts +25 -0
  28. package/dist/inspector-proxy-DODqs15F.d.ts.map +1 -0
  29. package/dist/make-ph-event-functions-B5GU5xcR.js +180 -0
  30. package/dist/make-ph-event-functions-B5GU5xcR.js.map +1 -0
  31. package/dist/{relational-ChC_AWAK.js → relational-DZuyKp2y.js} +65 -5
  32. package/dist/relational-DZuyKp2y.js.map +1 -0
  33. package/dist/{renown-C9pYZRqf.js → renown-B3MUaiq7.js} +56 -25
  34. package/dist/renown-B3MUaiq7.js.map +1 -0
  35. package/dist/renown-CBoTdGrg.js +394 -0
  36. package/dist/renown-CBoTdGrg.js.map +1 -0
  37. package/dist/{client-VV9M73s_.js → schema-B5lftDPf.js} +295 -195
  38. package/dist/schema-B5lftDPf.js.map +1 -0
  39. package/dist/{types-B7-_l_wE.d.ts → schema-C6ECceaN.d.ts} +272 -82
  40. package/dist/schema-C6ECceaN.d.ts.map +1 -0
  41. package/dist/src/ai/index.d.ts +269 -24
  42. package/dist/src/ai/index.d.ts.map +1 -1
  43. package/dist/src/ai/index.js +1028 -168
  44. package/dist/src/ai/index.js.map +1 -1
  45. package/dist/src/analytics/index.js +3 -3
  46. package/dist/src/graphql/client.d.ts +2 -2
  47. package/dist/src/graphql/client.js +1 -1
  48. package/dist/src/graphql-client/entry.d.ts +6 -4
  49. package/dist/src/graphql-client/entry.js +4 -4
  50. package/dist/src/relational/index.d.ts +8 -1
  51. package/dist/src/relational/index.d.ts.map +1 -1
  52. package/dist/src/relational/index.js +1 -1
  53. package/dist/src/renown/index.d.ts +2 -2
  54. package/dist/src/renown/index.js +3 -3
  55. package/dist/src/rpc/index.d.ts +201 -144
  56. package/dist/src/rpc/index.d.ts.map +1 -1
  57. package/dist/src/rpc/index.js +562 -634
  58. package/dist/src/rpc/index.js.map +1 -1
  59. package/dist/switchboard-directory-vH6qtkh-.js +435 -0
  60. package/dist/switchboard-directory-vH6qtkh-.js.map +1 -0
  61. package/dist/switchboards-D-_JBUbF.d.ts +75 -0
  62. package/dist/switchboards-D-_JBUbF.d.ts.map +1 -0
  63. package/dist/types-BWx6FPO4.d.ts +63 -0
  64. package/dist/types-BWx6FPO4.d.ts.map +1 -0
  65. package/package.json +19 -17
  66. package/dist/attachment-service-But1Xljo.d.ts.map +0 -1
  67. package/dist/client-BiJAJ9dW.js.map +0 -1
  68. package/dist/client-CngU4mtn.d.ts.map +0 -1
  69. package/dist/client-VV9M73s_.js.map +0 -1
  70. package/dist/dispatch-qRXS70fh.js.map +0 -1
  71. package/dist/document-model-modules-D6I-UUXq.js +0 -386
  72. package/dist/document-model-modules-D6I-UUXq.js.map +0 -1
  73. package/dist/document-operations-Bt-1-ThH.js.map +0 -1
  74. package/dist/global-fql2bmb0.d.ts +0 -438
  75. package/dist/global-fql2bmb0.d.ts.map +0 -1
  76. package/dist/index-BABMK8cO.d.ts.map +0 -1
  77. package/dist/inspector-proxy-DCowaeeH.d.ts +0 -264
  78. package/dist/inspector-proxy-DCowaeeH.d.ts.map +0 -1
  79. package/dist/make-ph-event-functions-FzpvQtj6.js +0 -53
  80. package/dist/make-ph-event-functions-FzpvQtj6.js.map +0 -1
  81. package/dist/relational-ChC_AWAK.js.map +0 -1
  82. package/dist/renown-C9pYZRqf.js.map +0 -1
  83. package/dist/renown-Def5iO8k.js +0 -97
  84. package/dist/renown-Def5iO8k.js.map +0 -1
  85. package/dist/switchboard-CFyD_5_e.js +0 -323
  86. package/dist/switchboard-CFyD_5_e.js.map +0 -1
  87. package/dist/types-B7-_l_wE.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-C6ECceaN.d.ts","names":[],"sources":["../src/graphql/gen/schema.ts"],"mappings":";;KAGY,WAAW,KAAK;KAChB,MAAM;GAAa;QAC5B,WAAW,IAAI,EAAE;KAiBf,8BAA8B;;KAEvB;EACV;IAAM;IAAe;;EACrB;IAAU;IAAe;;EACzB;IAAW;IAAgB;;EAC3B;IAAO;IAAe;;EACtB;IAAS;IAAe;;EACxB;IAAY,gBAAgB;IAAM,iBAAiB;;E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R,QAAQ;EAcX,gBAAe,WACF,kCAAgC,iBAC1B,6BAA2B,SACnC,wBACR,QAAQ;EAcX,mBAAkB,WACL,qCAAmC,iBAC7B,6BAA2B,SACnC,wBACR,QAAQ;EAcX,mBAAkB,WACL,qCAAmC,iBAC7B,6BAA2B,SACnC,wBACR,QAAQ;EAcX,iBAAgB,WACH,mCAAiC,iBAC3B,6BAA2B,SACnC,wBACR,QAAQ;EAcX,eAAc,WACD,iCAA+B,iBACzB,6BAA2B,SACnC,wBACR,QAAQ;EAcX,gBAAe,WACF,kCAAgC,iBAC1B,6BAA2B,SACnC,wBACR,QAAQ;EAcX,gBAAe,YACD,sCAAoC,iBAC/B,6BAA2B,SACnC,wBACR,QAAQ;EAcX,WAAU,WACG,iCAA+B,iBACzB,6BAA2B,SACnC,wBACR,QAAQ;EAcX,kBAAiB,WACJ,iCAA+B,iBACzB,6BAA2B,SACnC,wBACR,QAAQ;EAcX,aAAY,WACC,+BAA6B,iBACvB,6BAA2B,SACnC,wBACR,QAAQ;EAcX,kBAAiB,WACJ,oCAAkC,iBAC5B,6BAA2B,SACnC,wBACR,QAAQ;;KAgBH,MAAM,kBAAkB"}
@@ -1,6 +1,9 @@
1
+ import { t as BearerTokenProvider } from "../../auth-DRbzRdeC.js";
2
+ import { s as ReactorBrowserHalves, t as SwitchboardDirectory } from "../../switchboards-D-_JBUbF.js";
3
+ import { ReactNode } from "react";
4
+ import { PhAiChatImage, PhAiToolAnnotations, PhAiToolContext, PhAiToolDescriptor } from "@powerhousedao/shared/document-model";
1
5
  import { ISyncManager } from "@powerhousedao/reactor";
2
- import { PhAiToolAnnotations, PhAiToolDescriptor } from "@powerhousedao/shared/document-model";
3
- import { LanguageModel, ModelMessage } from "ai";
6
+ import { LanguageModel, ModelMessage, ToolResultPart } from "ai";
4
7
  //#region src/ai/types.d.ts
5
8
  /**
6
9
  * Browser-side AI chat over the reactor.
@@ -26,13 +29,35 @@ export interface AiSettings {
26
29
  */
27
30
  autoApproveWrites: boolean;
28
31
  }
32
+ /**
33
+ * An endpoint the host app picked for the chat, which takes the place of the
34
+ * user's settings. It holds no API key: the endpoint holds its own (see
35
+ * `gatewayConnection`), and write tools always ask for approval.
36
+ */
37
+ export interface AiConnection {
38
+ /** OpenAI-compatible base URL; a relative path resolves against the page. */
39
+ baseUrl: string;
40
+ /** Model id, sent as is. A gateway may answer with its own. */
41
+ model: string;
42
+ /** Sets each request's credentials, e.g. the user's bearer. */
43
+ fetch?: typeof fetch;
44
+ }
45
+ /** An image attached to a user message. */
46
+ export interface ChatImage {
47
+ /** `data:<mediaType>;base64,...` */
48
+ dataUrl: string;
49
+ mediaType: string;
50
+ name?: string;
51
+ }
52
+ /** A sent image, under the handle tools reach it by. */
53
+ export type AiChatImage = PhAiChatImage;
29
54
  /** MCP-compatible annotation hints; structural, no MCP SDK dependency. */
30
55
  export type AiToolAnnotations = PhAiToolAnnotations;
31
56
  /**
32
57
  * Provider-agnostic tool descriptor accepted by the chat agent.
33
58
  *
34
59
  * Structurally compatible with the MCP tool records produced by
35
- * `createReactorMcpProvider`: the callback parameter is `never` so any
60
+ * `toMcpTool`: the callback parameter is `never` so any
36
61
  * per-tool-args function type is assignable, and the result is `unknown`
37
62
  * because the envelope shape (MCP `CallToolResult`) is unwrapped at the
38
63
  * adapter boundary.
@@ -40,19 +65,30 @@ export type AiToolAnnotations = PhAiToolAnnotations;
40
65
  export type AiToolDescriptor = PhAiToolDescriptor;
41
66
  /** Tool descriptors the app resolves when the user sends a message. */
42
67
  export type AiToolsProvider = () => Promise<AiToolDescriptor[]>;
43
- /** Tool names whose execution mutates the reactor and requires approval. */
44
- export declare const WRITE_TOOLS: ReadonlySet<string>;
68
+ /** The host's services a tool may use, handed over on each call. */
69
+ export interface AiToolServices {
70
+ /** The switchboards the host reaches; pass it to `resolveSwitchboard`. */
71
+ switchboards?: SwitchboardDirectory;
72
+ /** The host's reactor client, read and write halves. */
73
+ reactor?: ReactorBrowserHalves;
74
+ }
45
75
  /**
46
- * Whether executing the tool mutates state and requires user approval:
47
- * the built-in write tools, or any tool flagged destructive in its
48
- * annotations (covers package-provided tools outside the built-in set).
76
+ * What the agent passes a tool next to its arguments: the turn's signal and
77
+ * images, and the host's services. A tool reads what it needs from here, not
78
+ * from a global.
49
79
  */
50
- export declare function isWriteTool(name: string, annotations?: AiToolAnnotations): boolean;
80
+ export type AiToolContext = PhAiToolContext & AiToolServices;
81
+ /** Whether running the tool needs approval: anything not annotated read-only. */
82
+ export declare function isWriteTool(annotations?: AiToolAnnotations): boolean;
51
83
  export type ToolCallState = "awaiting-approval" | "executing" | "done" | "error" | "rejected";
52
84
  /** One rendered unit inside a chat message. */
53
85
  export type ChatPart = {
54
86
  type: "text";
55
87
  text: string;
88
+ } | {
89
+ type: "image";
90
+ dataUrl: string;
91
+ name?: string;
56
92
  } | {
57
93
  type: "tool";
58
94
  toolCallId: string;
@@ -83,6 +119,13 @@ export interface ChatContext {
83
119
  documentType?: string;
84
120
  documentName?: string;
85
121
  documentId?: string;
122
+ /** The switchboards the host reaches; absent when it gives no directory. */
123
+ switchboards?: {
124
+ name: string;
125
+ url: string;
126
+ workflows: boolean | "unknown";
127
+ }[];
128
+ /** The selected drive's synced switchboard, for a host with no directory. */
86
129
  switchboardUrl?: string;
87
130
  switchboardGraphqlUrl?: string;
88
131
  }
@@ -128,7 +171,7 @@ export type AgentEvent = {
128
171
  //#endregion
129
172
  //#region src/ai/agent.d.ts
130
173
  /** Hard cap on model round-trips per user message (each tool step counts). */
131
- export declare const MAX_AGENT_STEPS = 10;
174
+ export declare const MAX_AGENT_STEPS = 250;
132
175
  /**
133
176
  * Hard cap on the characters of one tool result fed back to the model.
134
177
  *
@@ -154,10 +197,17 @@ export declare const STUB_MIN_CHARS = 500;
154
197
  * turns with one-line stubs naming the tool and its arguments. User and
155
198
  * assistant messages are never touched, and tool calls keep their input,
156
199
  * so the model can re-query any stubbed result with the same arguments.
157
- * Idempotent: stubs are below {@link STUB_MIN_CHARS} and pass through.
200
+ * A result with images is stubbed whatever its size. Idempotent: stubs are
201
+ * below {@link STUB_MIN_CHARS} and pass through.
158
202
  */
159
203
  export declare function stubStaleToolResults(history: ModelMessage[]): ModelMessage[];
160
204
  export declare function createReactorChatModel(settings: AiSettings): LanguageModel;
205
+ /**
206
+ * Creates the chat language model for a connection the host app picked. No
207
+ * API key is involved: the endpoint holds it, and {@link AiConnection.fetch}
208
+ * carries the caller's own credentials.
209
+ */
210
+ export declare function createConnectionChatModel(connection: AiConnection): LanguageModel;
161
211
  /**
162
212
  * Unwraps the MCP `CallToolResult` envelope produced by the reactor tool
163
213
  * core into a plain value for the AI SDK. Throws for error results so the
@@ -168,14 +218,27 @@ export declare function unwrapToolResult(raw: unknown): unknown;
168
218
  export declare function buildSystemPrompt(context: ChatContext): string;
169
219
  export interface ReactorChatAgentOptions {
170
220
  settings: AiSettings;
221
+ /** Used instead of {@link settings}, whose auto-approval then doesn't apply. */
222
+ connection?: AiConnection;
223
+ /**
224
+ * With a {@link connection}: whether writes run without asking. Called for
225
+ * each one, so switching it off stops what's still to come.
226
+ */
227
+ autoApprove?: () => boolean;
228
+ /** Added to the system prompt, for what the host app knows about itself. */
229
+ instructions?: string;
171
230
  tools: AiToolDescriptor[];
172
231
  context: ChatContext;
232
+ /** The host's services, read for each tool call so a running turn sees changes. */
233
+ services?: () => AiToolServices;
173
234
  onEvent: (event: AgentEvent) => void;
174
235
  signal?: AbortSignal;
175
236
  /** Test seam: override the model (e.g. a mock language model). */
176
237
  model?: LanguageModel;
177
238
  /** Prior conversation to continue (see {@link ReactorChatAgent.getHistory}). */
178
239
  history?: ModelMessage[];
240
+ /** Images of that conversation (see {@link ReactorChatAgent.getChatImages}). */
241
+ chatImages?: AiChatImage[];
179
242
  }
180
243
  /**
181
244
  * Runs one tool-loop conversation turn against an OpenAI-compatible model.
@@ -187,20 +250,26 @@ export interface ReactorChatAgentOptions {
187
250
  export declare class ReactorChatAgent {
188
251
  private readonly options;
189
252
  private history;
253
+ private chatImages;
190
254
  private approvals;
255
+ private approvingAll;
191
256
  constructor(options: ReactorChatAgentOptions);
192
257
  /** The model history after the last completed turn, for the next agent. */
193
258
  getHistory(): ModelMessage[];
259
+ /** The images attached so far, under their handles, for the next agent. */
260
+ getChatImages(): AiChatImage[];
194
261
  /** Clears the conversation history (a fresh chat). */
195
262
  reset(): void;
196
263
  /** Approves a pending write tool call, resuming the agent loop. */
197
264
  approve(toolCallId: string): void;
198
265
  /** Rejects a pending write tool call; the rejection is fed to the model. */
199
266
  reject(toolCallId: string): void;
267
+ /** Approves every pending write, and any more for the rest of this turn. */
268
+ approveAll(): void;
200
269
  private resolveApproval;
201
270
  private cancelPendingApprovals;
202
271
  /** Runs one user turn: appends the message, streams the model, commits history. */
203
- send(text: string): Promise<void>;
272
+ send(text: string, images?: ChatImage[]): Promise<void>;
204
273
  /**
205
274
  * Removes tool calls that were never executed (step cap or abort):
206
275
  * OpenAI-compatible APIs reject a tool call without its tool result.
@@ -214,9 +283,11 @@ export declare class ReactorChatAgent {
214
283
  * In-chat approval card for a write tool call. Approving or rejecting
215
284
  * resolves the pending approval inside the agent loop.
216
285
  */
217
- export declare function ApprovalCard({ approval, onApprove, onReject }: {
286
+ export declare function ApprovalCard({ approval, onApprove, onApproveAll, onReject }: {
218
287
  approval: PendingApproval;
219
288
  onApprove: (toolCallId: string) => void;
289
+ /** Offers Approve all when given */
290
+ onApproveAll?: () => void;
220
291
  onReject: (toolCallId: string) => void;
221
292
  }): import("react/jsx-runtime").JSX.Element;
222
293
  //#endregion
@@ -228,21 +299,50 @@ export interface UseReactorChatResult {
228
299
  error: string | null;
229
300
  settings: AiSettings;
230
301
  configured: boolean;
231
- send: (text: string) => void;
302
+ send: (text: string, images?: ChatImage[]) => void;
232
303
  stop: () => void;
233
304
  approve: (toolCallId: string) => void;
305
+ /** Approves what's waiting, and any more until this message is answered. */
306
+ approveAll: () => void;
234
307
  reject: (toolCallId: string) => void;
235
308
  clear: () => void;
236
309
  }
310
+ export interface UseReactorChatOptions {
311
+ /** Talk to this endpoint instead of the one in the user's settings. */
312
+ connection?: AiConnection;
313
+ /** Added to the agent's system prompt. */
314
+ instructions?: string;
315
+ /** With a {@link connection}: writes run without asking. */
316
+ autoApprove?: boolean;
317
+ }
237
318
  /**
238
319
  * Drives one in-browser chat conversation against the reactor tools.
239
320
  *
240
321
  * `toolsProvider` lazily resolves the tool descriptors (e.g. from
241
- * `createReactorMcpProvider` bound to `window.ph.reactorClient`) when the
322
+ * `toMcpTool` bound to `window.ph.reactorClient`) when the
242
323
  * user sends a message, so the reactor does not need to be ready at render
243
324
  * time.
244
325
  */
245
- export declare function useReactorChat(toolsProvider?: AiToolsProvider): UseReactorChatResult;
326
+ export declare function useReactorChat(toolsProvider?: AiToolsProvider, options?: UseReactorChatOptions): UseReactorChatResult;
327
+ //#endregion
328
+ //#region src/ai/components/chat-panel.d.ts
329
+ interface ChatPanelProps {
330
+ chat: UseReactorChatResult;
331
+ className?: string;
332
+ /** What shows while the conversation is empty. */
333
+ emptyState?: ReactNode;
334
+ /** One-click starting points, shown while the conversation is empty. */
335
+ suggestions?: readonly string[];
336
+ /** Lets the user attach images by paste, drop or the file picker. */
337
+ allowImages?: boolean;
338
+ }
339
+ /**
340
+ * The conversation and its composer, with no position of its own: it fills
341
+ * whatever the host gives it (see `ChatWindow` for the floating one). Tailwind
342
+ * utilities style it for Connect; the `ph-chat-*` classes are for hosts that
343
+ * bring their own styles.
344
+ */
345
+ export declare function ChatPanel({ chat, className, emptyState, suggestions, allowImages }: ChatPanelProps): import("react/jsx-runtime").JSX.Element;
246
346
  //#endregion
247
347
  //#region src/ai/components/chat-window.d.ts
248
348
  /** The chat window panel, anchored above the FAB in the bottom-right. */
@@ -251,12 +351,26 @@ export declare function ChatWindow({ chat, onClose }: {
251
351
  onClose: () => void;
252
352
  }): import("react/jsx-runtime").JSX.Element;
253
353
  //#endregion
354
+ //#region src/ai/components/markdown.d.ts
355
+ /**
356
+ * Markdown renderer for assistant messages.
357
+ *
358
+ * Uses react-markdown, which builds React elements from the markdown AST and
359
+ * does not execute raw HTML — safe for model-generated content. remark-gfm
360
+ * adds the table/strikethrough/task-list syntax the agent emits. Element
361
+ * styling is scoped to the chat window's text-sm scale via Tailwind
362
+ * utilities, so no extra CSS is needed.
363
+ */
364
+ export declare function Markdown({ text }: {
365
+ text: string;
366
+ }): import("react/jsx-runtime").JSX.Element;
367
+ //#endregion
254
368
  //#region src/ai/components/reactor-chat-fab.d.ts
255
369
  /**
256
370
  * Bottom-right floating action button that opens the reactor AI chat window.
257
371
  *
258
372
  * `getTools` lazily resolves the reactor tool descriptors (from
259
- * `createReactorMcpProvider` bound to the browser reactor client) when the
373
+ * `toMcpTool` bound to the browser reactor client) when the
260
374
  * user sends a message.
261
375
  */
262
376
  export declare function ReactorChatFab({ getTools }: {
@@ -271,6 +385,88 @@ export declare function ReactorChatFab({ getTools }: {
271
385
  */
272
386
  export declare function useChatContext(): ChatContext;
273
387
  //#endregion
388
+ //#region src/ai/gateway.d.ts
389
+ /**
390
+ * The switchboard's AI gateway (`@powerhousedao/switchboard/plugins/ai`). It
391
+ * sits under `/api/`, which every Connect served next to its switchboard
392
+ * proxies, so by default the browser calls its own origin.
393
+ */
394
+ export declare const AI_GATEWAY_PATH = "/api/@powerhousedao/switchboard/ai";
395
+ export interface AiGatewayStatus {
396
+ configured: boolean;
397
+ /** Masked, e.g. `sk-or-v1-…abcd`. The key itself is never sent. */
398
+ keyHint: string | null;
399
+ keySetBy: string | null;
400
+ keySetAt: string | null;
401
+ model: string;
402
+ /** This host can set a demo key of its own, which it never sends here. */
403
+ demoKeyAvailable: boolean;
404
+ }
405
+ /**
406
+ * What the signed-in user may do with the gateway: `none` when they are not
407
+ * an admin, are not signed in, or this host has no gateway at all.
408
+ */
409
+ export type AiGatewayAccess = {
410
+ access: "none";
411
+ } | {
412
+ access: "admin";
413
+ status: AiGatewayStatus;
414
+ } | {
415
+ access: "error";
416
+ message: string;
417
+ };
418
+ export interface AiGatewayOptions {
419
+ /** The gateway's URL; defaults to {@link AI_GATEWAY_PATH} on this origin. */
420
+ url?: string;
421
+ /** Test seams. */
422
+ tokenProvider?: BearerTokenProvider;
423
+ fetchImpl?: typeof fetch;
424
+ }
425
+ /** A fetch that adds the user's bearer, resolved per request so it stays fresh. */
426
+ export declare function gatewayFetch(options?: AiGatewayOptions): typeof fetch;
427
+ /** The chat connection to a gateway: no key, only the user's own bearer. */
428
+ export declare function gatewayConnection(model: string, options?: AiGatewayOptions): AiConnection;
429
+ export declare function fetchAiGatewayAccess(options?: AiGatewayOptions): Promise<AiGatewayAccess>;
430
+ /** Tested against the provider before it is stored; a refusal throws. */
431
+ export declare function setAiGatewayKey(value: string, options?: AiGatewayOptions): Promise<AiGatewayStatus>;
432
+ /** Asks the host to use its demo key, tested as a typed one is. */
433
+ export declare function setAiGatewayDemoKey(options?: AiGatewayOptions): Promise<AiGatewayStatus>;
434
+ export declare function resetAiGatewayKey(options?: AiGatewayOptions): Promise<AiGatewayStatus>;
435
+ export declare function setAiGatewayModel(model: string, options?: AiGatewayOptions): Promise<AiGatewayStatus>;
436
+ export interface UseAiGatewayResult {
437
+ /** `undefined` until the first answer. */
438
+ gateway: AiGatewayAccess | undefined;
439
+ /** Connection for {@link useReactorChat}, once the gateway has a key. */
440
+ connection: AiConnection | undefined;
441
+ setKey: (value: string) => Promise<void>;
442
+ setDemoKey: () => Promise<void>;
443
+ resetKey: () => Promise<void>;
444
+ }
445
+ /**
446
+ * Reports what the gateway answers, asking again while it answers with an error.
447
+ * Waiting can change that one: a host stopped hard holds its workflow lease for
448
+ * up to a minute, so the runtime the gateway needs arrives after it serves.
449
+ *
450
+ * @returns Stops asking
451
+ */
452
+ export declare function watchAiGatewayAccess(onAnswer: (access: AiGatewayAccess) => void, options?: AiGatewayOptions, retryMs?: number): () => void;
453
+ /** The gateway as the signed-in user sees it; asks again when they change. */
454
+ export declare function useAiGateway(): UseAiGatewayResult;
455
+ //#endregion
456
+ //#region src/ai/host-tools.d.ts
457
+ /**
458
+ * The tools of the Connect this page runs in: the reactor's own plus every
459
+ * package's `aiTools`. For a page a package adds to Connect, which can't import
460
+ * Connect itself. Pass it to `useReactorChat`.
461
+ */
462
+ export declare function getHostAiTools(): Promise<AiToolDescriptor[]>;
463
+ //#endregion
464
+ //#region src/ai/images.d.ts
465
+ /** What the chat offers in its file picker and accepts on paste and drop. */
466
+ export declare const CHAT_IMAGE_TYPES: readonly string[];
467
+ /** Turns a picked, pasted or dropped file into an attachment for the chat. */
468
+ export declare function readChatImage(file: File): Promise<ChatImage>;
469
+ //#endregion
274
470
  //#region src/ai/settings-store.d.ts
275
471
  export declare const DEFAULT_AI_SETTINGS: AiSettings;
276
472
  type Listener = () => void;
@@ -285,6 +481,10 @@ export declare function subscribeAiSettings(listener: Listener): () => void;
285
481
  /** True when the endpoint, key and model are all configured. */
286
482
  export declare function isAiConfigured(settings: AiSettings): boolean;
287
483
  //#endregion
484
+ //#region src/utils/gql-channel.d.ts
485
+ /** Suffix of the per-drive GraphQL channel endpoint the switchboard serves. */
486
+ export declare const GQL_CHANNEL_SUFFIX = "/graphql/r";
487
+ //#endregion
288
488
  //#region src/ai/switchboard.d.ts
289
489
  /**
290
490
  * The switchboard serving a remote drive: the base URL the browser talks to
@@ -302,8 +502,6 @@ export interface DriveSwitchboard {
302
502
  * module is initialized.
303
503
  */
304
504
  export declare function getBrowserSyncManager(): ISyncManager | undefined;
305
- /** Suffix of the per-drive GraphQL channel endpoint the switchboard serves. */
306
- export declare const GQL_CHANNEL_SUFFIX = "/graphql/r";
307
505
  /**
308
506
  * Resolves the switchboard that serves a drive, if any.
309
507
  *
@@ -314,6 +512,9 @@ export declare const GQL_CHANNEL_SUFFIX = "/graphql/r";
314
512
  * than from a global setting) is what keeps multi-switchboard deployments
315
513
  * correct. Drives that are not synced to a remote switchboard (local
316
514
  * drives, other channel types, unexpected shapes) return `undefined`.
515
+ *
516
+ * @deprecated Reads synced drives only, so it finds nothing for a remote
517
+ * client's drives. Use the host's switchboard directory (`resolveSwitchboard`).
317
518
  */
318
519
  export declare function resolveDriveSwitchboard(driveId: string | undefined, syncManager?: ISyncManager): DriveSwitchboard | undefined;
319
520
  /**
@@ -342,19 +543,63 @@ export declare function summarizeIntrospectionSchema(schema: unknown): {
342
543
  export declare const SWITCHBOARD_SCHEMA_TOOL_NAME = "getSwitchboardSchema";
343
544
  /** Test seams for {@link createSwitchboardSchemaTool}. */
344
545
  export interface SwitchboardToolDeps {
345
- getSyncManager?: () => ISyncManager | undefined;
346
- getSelectedDriveId?: () => string | undefined;
347
546
  tokenProvider?: () => Promise<string | undefined>;
348
547
  fetchImpl?: typeof fetch;
349
548
  timeoutMs?: number;
350
549
  }
351
550
  /**
352
551
  * Creates the read-only `getSwitchboardSchema` tool: it introspects the
353
- * GraphQL supergraph of the switchboard serving a drive and returns a
354
- * summary of its root queries and mutations. It reads the schema only and
355
- * never modifies data.
552
+ * GraphQL supergraph of a switchboard the host reaches and returns a summary
553
+ * of its root queries and mutations. It reads the schema only and never
554
+ * modifies data. The switchboard comes from the host's directory, which the
555
+ * agent hands every call.
356
556
  */
357
557
  export declare function createSwitchboardSchemaTool(deps?: SwitchboardToolDeps): AiToolDescriptor;
558
+ export declare const LIST_SWITCHBOARDS_TOOL_NAME = "listSwitchboards";
559
+ /**
560
+ * Creates the read-only `listSwitchboards` tool: the switchboards the host
561
+ * reaches, by the names other tools take as `switchboard`.
562
+ */
563
+ export declare function createListSwitchboardsTool(): AiToolDescriptor;
564
+ //#endregion
565
+ //#region src/ai/tool-images.d.ts
566
+ /**
567
+ * Most characters of image data one request carries, kept well under the
568
+ * gateway's 32 MB body limit: every step resends the whole conversation.
569
+ */
570
+ export declare const MAX_REQUEST_IMAGE_CHARS = 20000000;
571
+ /** Most images one request carries; models start refusing large ones past this. */
572
+ export declare const MAX_REQUEST_IMAGES = 20;
573
+ /** An image a tool returned: an MCP `image` content block. */
574
+ export interface ToolImage {
575
+ /** Base64, without a `data:` prefix. */
576
+ data: string;
577
+ mediaType: string;
578
+ }
579
+ type ToolOutput = ToolResultPart["output"];
580
+ /** The `image` blocks of a tool's `CallToolResult`, if it returned any. */
581
+ export declare function toolResultImages(raw: unknown): ToolImage[];
582
+ /**
583
+ * A tool's result as it enters the history. Images travel inside it, so they
584
+ * age with the result and are stubbed along with it.
585
+ */
586
+ export declare function toolOutput(value: unknown, images?: ToolImage[]): ToolOutput;
587
+ /** How many images a stored tool result holds. */
588
+ export declare function toolOutputImageCount(output: unknown): number;
589
+ /** The characters a stored tool result takes, image data aside. */
590
+ export declare function toolOutputTextChars(output: unknown): number;
591
+ /**
592
+ * The conversation as one request carries it. An OpenAI-compatible tool message
593
+ * holds text only, and the provider would send an image in one as a block of
594
+ * base64 text, so a result's images move to a user message right after it. Only
595
+ * the newest fit: the result says how many it left out, and the model asks again
596
+ * if it needs them. The history keeps them in the result, so each step decides
597
+ * this afresh.
598
+ */
599
+ export declare function withToolImages(messages: ModelMessage[]): ModelMessage[];
600
+ /** Whether any tool result in the conversation holds images. */
601
+ export declare function hasToolImages(messages: ModelMessage[]): boolean;
358
602
  //#endregion
603
+ export type { ChatPanelProps };
359
604
  export {};
360
605
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/ai/types.ts","../../../src/ai/agent.ts","../../../src/ai/components/approval-card.tsx","../../../src/ai/use-reactor-chat.ts","../../../src/ai/components/chat-window.tsx","../../../src/ai/components/reactor-chat-fab.tsx","../../../src/ai/context.ts","../../../src/ai/settings-store.ts","../../../src/ai/switchboard.ts"],"mappings":";;;;;;;;;;;;;iBAeiB;;EAEf;;EAEA;;EAEA;;EAEA;;;;;EAKA;;;YAIU,oBAAoB;;;;;;;;;;YAWpB,mBAAmB;;YAGnB,wBAAwB,QAAQ;;qBAG/B,aAAa;;;;;;wBAcV,YACd,cACA,cAAc;YAKJ;;YAQA;EACN;EAAc;;EAEd;EACA;EACA;EACA;EACA,OAAO;EACP;EACA;;iBAGW;EAC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Q5B;;;;;;;;;;;;wBAaG,wBACd,6BACA,cAAc,eACb;;;;;;qBAoDU;;YA6GD;EACV;EACA;EACA;EACA;;;;;;;wBA6Bc,6BAA6B;EAC3C,SAAS;EACT,WAAW;EACX;;qBAYW;;iBAGI;EACf,uBAAuB;EACvB;EACA,sBAAsB;EACtB,mBAAmB;EACnB;;;;;;;;wBASc,4BACd,OAAO,sBACN"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/ai/types.ts","../../../src/ai/agent.ts","../../../src/ai/components/approval-card.tsx","../../../src/ai/use-reactor-chat.ts","../../../src/ai/components/chat-panel.tsx","../../../src/ai/components/chat-window.tsx","../../../src/ai/components/markdown.tsx","../../../src/ai/components/reactor-chat-fab.tsx","../../../src/ai/context.ts","../../../src/ai/gateway.ts","../../../src/ai/host-tools.ts","../../../src/ai/images.ts","../../../src/ai/settings-store.ts","../../../src/utils/gql-channel.ts","../../../src/ai/switchboard.ts","../../../src/ai/tool-images.ts"],"mappings":";;;;;;;;;;;;;;;;iBAmBiB;;EAEf;;EAEA;;EAEA;;EAEA;;;;;EAKA;;;;;;;iBAQe;;EAEf;;EAEA;;EAEA,eAAe;;;iBAIA;;EAEf;EACA;EACA;;;YAIU,cAAc;;YAGd,oBAAoB;;;;;;;;;;YAWpB,mBAAmB;;YAGnB,wBAAwB,QAAQ;;iBAG3B;;EAEf,eAAe;;EAEf,UAAU;;;;;;;YAQA,gBAAgB,kBAAkB;;wBAG9B,YAAY,cAAc;YAI9B;;YAQA;EACN;EAAc;;EACd;EAAe;EAAiB;;EAEhC;EACA;EACA;EACA;EACA,OAAO;EACP;EACA;;iBAGW;EACf;EACA;EACA,OAAO;;;iBAIQ;EACf;EACA;EACA;;;iBAIe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;IACE;IACA;IACA;;;EAGF;EACA;;;YAIU;EACN;EAAoB;;EAEpB;EACA;EACA;EACA;;EAGA;EACA;EACA;EACA;;EAEA;EAA2B;EAAo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