@powerhousedao/reactor-browser 6.2.3-dev.10 → 6.2.3-dev.101
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.
- package/dist/{attachment-service-BW1v0OAT.d.ts → attachment-service-DXfpfp98.d.ts} +767 -108
- package/dist/attachment-service-DXfpfp98.d.ts.map +1 -0
- package/dist/auth-DzIYxeEJ.d.ts +32 -0
- package/dist/auth-DzIYxeEJ.d.ts.map +1 -0
- package/dist/client-1n_ZUXeu.js +135 -0
- package/dist/client-1n_ZUXeu.js.map +1 -0
- package/dist/{client-CxJD0Ck2.d.ts → client-BFk0MY6A.d.ts} +4 -3
- package/dist/client-BFk0MY6A.d.ts.map +1 -0
- package/dist/{client-DjK30EQ-.js → client-BFnMV-EO.js} +39 -22
- package/dist/client-BFnMV-EO.js.map +1 -0
- package/dist/dispatch-Cylwl2Dk.js +1173 -0
- package/dist/dispatch-Cylwl2Dk.js.map +1 -0
- package/dist/document-by-id-DdvqanGR.js +16 -0
- package/dist/document-by-id-DdvqanGR.js.map +1 -0
- package/dist/document-model-modules-BG-61uke.js +710 -0
- package/dist/document-model-modules-BG-61uke.js.map +1 -0
- package/dist/document-operations-D5QXcJbV.js +4609 -0
- package/dist/document-operations-D5QXcJbV.js.map +1 -0
- package/dist/global-DAAmZGCO.d.ts +612 -0
- package/dist/global-DAAmZGCO.d.ts.map +1 -0
- package/dist/{index-CBjFO54H.d.ts → index-Bj1poVfa.d.ts} +31 -100
- package/dist/index-Bj1poVfa.d.ts.map +1 -0
- package/dist/{index-BIVDXw3K.d.ts → index-rtDmzViP.d.ts} +3 -3
- package/dist/index-rtDmzViP.d.ts.map +1 -0
- package/dist/index.d.ts +907 -411
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +851 -306
- package/dist/index.js.map +1 -1
- package/dist/inspector-proxy-DODqs15F.d.ts +25 -0
- package/dist/inspector-proxy-DODqs15F.d.ts.map +1 -0
- package/dist/make-ph-event-functions-B5GU5xcR.js +180 -0
- package/dist/make-ph-event-functions-B5GU5xcR.js.map +1 -0
- package/dist/{pglite-CntadC_p-9NDG14dS.d.ts → pglite-CntadC_p-DTkdF8sr.d.ts} +11 -33
- package/dist/pglite-CntadC_p-DTkdF8sr.d.ts.map +1 -0
- package/dist/{relational-D1RB45sA.js → relational-DZuyKp2y.js} +66 -5
- package/dist/relational-DZuyKp2y.js.map +1 -0
- package/dist/{renown-rqK8sokh.js → renown-B3MUaiq7.js} +61 -31
- package/dist/renown-B3MUaiq7.js.map +1 -0
- package/dist/renown-CBoTdGrg.js +394 -0
- package/dist/renown-CBoTdGrg.js.map +1 -0
- package/dist/{types-N3Jy6Nry.d.ts → schema-Bn6L3QR1.d.ts} +255 -65
- package/dist/schema-Bn6L3QR1.d.ts.map +1 -0
- package/dist/{client-D4bkR4pH.js → schema-D0G1oAo9.js} +247 -152
- package/dist/schema-D0G1oAo9.js.map +1 -0
- package/dist/src/ai/index.d.ts +313 -79
- package/dist/src/ai/index.d.ts.map +1 -1
- package/dist/src/ai/index.js +1030 -173
- package/dist/src/ai/index.js.map +1 -1
- package/dist/src/analytics/index.d.ts +36 -44
- package/dist/src/analytics/index.d.ts.map +1 -1
- package/dist/src/analytics/index.js +4 -4
- package/dist/src/analytics/index.js.map +1 -1
- package/dist/src/document-model.d.ts +3 -4
- package/dist/src/document-model.d.ts.map +1 -1
- package/dist/src/document-model.js.map +1 -1
- package/dist/src/graphql/client.d.ts +4 -3
- package/dist/src/graphql/client.js +1 -1
- package/dist/src/graphql-client/entry.d.ts +7 -4
- package/dist/src/graphql-client/entry.js +4 -4
- package/dist/src/relational/index.d.ts +15 -9
- package/dist/src/relational/index.d.ts.map +1 -1
- package/dist/src/relational/index.js +1 -1
- package/dist/src/renown/index.d.ts +3 -2
- package/dist/src/renown/index.js +3 -3
- package/dist/src/rpc/index.d.ts +217 -140
- package/dist/src/rpc/index.d.ts.map +1 -1
- package/dist/src/rpc/index.js +600 -623
- package/dist/src/rpc/index.js.map +1 -1
- package/dist/{store-BJYcr_FL.js → store-DInXcjal.js} +1 -1
- package/dist/{store-BJYcr_FL.js.map → store-DInXcjal.js.map} +1 -1
- package/dist/switchboard-directory-CWf5SRo7.js +435 -0
- package/dist/switchboard-directory-CWf5SRo7.js.map +1 -0
- package/dist/switchboards-D-_JBUbF.d.ts +75 -0
- package/dist/switchboards-D-_JBUbF.d.ts.map +1 -0
- package/dist/{types-6vDzbRRS.d.ts → types-520nWrB3.d.ts} +2 -2
- package/dist/types-520nWrB3.d.ts.map +1 -0
- package/dist/types-CyPDurGV.d.ts +63 -0
- package/dist/types-CyPDurGV.d.ts.map +1 -0
- package/package.json +24 -23
- package/dist/attachment-service-BW1v0OAT.d.ts.map +0 -1
- package/dist/client-CxJD0Ck2.d.ts.map +0 -1
- package/dist/client-D4bkR4pH.js.map +0 -1
- package/dist/client-DjK30EQ-.js.map +0 -1
- package/dist/document-by-id-B4FIzG1w.js +0 -519
- package/dist/document-by-id-B4FIzG1w.js.map +0 -1
- package/dist/document-model-modules-bTP87nyr.js +0 -419
- package/dist/document-model-modules-bTP87nyr.js.map +0 -1
- package/dist/document-operations-Cm4EtaZs.js +0 -2603
- package/dist/document-operations-Cm4EtaZs.js.map +0 -1
- package/dist/global-CgCouXuH.d.ts +0 -401
- package/dist/global-CgCouXuH.d.ts.map +0 -1
- package/dist/index-BIVDXw3K.d.ts.map +0 -1
- package/dist/index-CBjFO54H.d.ts.map +0 -1
- package/dist/inspector-proxy-6h5VKAwt.d.ts +0 -257
- package/dist/inspector-proxy-6h5VKAwt.d.ts.map +0 -1
- package/dist/make-ph-event-functions-DBq3iWYn.js +0 -53
- package/dist/make-ph-event-functions-DBq3iWYn.js.map +0 -1
- package/dist/pglite-CntadC_p-9NDG14dS.d.ts.map +0 -1
- package/dist/relational-D1RB45sA.js.map +0 -1
- package/dist/renown-BHxwP7xU.js +0 -97
- package/dist/renown-BHxwP7xU.js.map +0 -1
- package/dist/renown-rqK8sokh.js.map +0 -1
- package/dist/switchboard-CaXQ4-5Q.js +0 -271
- package/dist/switchboard-CaXQ4-5Q.js.map +0 -1
- package/dist/types-6vDzbRRS.d.ts.map +0 -1
- package/dist/types-N3Jy6Nry.d.ts.map +0 -1
package/dist/src/ai/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as BearerTokenProvider } from "../../auth-DzIYxeEJ.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";
|
|
2
5
|
import { ISyncManager } from "@powerhousedao/reactor";
|
|
3
|
-
import
|
|
4
|
-
import { LanguageModel, ModelMessage } from "ai";
|
|
5
|
-
|
|
6
|
+
import { LanguageModel, ModelMessage, ToolResultPart } from "ai";
|
|
6
7
|
//#region src/ai/types.d.ts
|
|
7
8
|
/**
|
|
8
9
|
* Browser-side AI chat over the reactor.
|
|
@@ -13,7 +14,7 @@ import { LanguageModel, ModelMessage } from "ai";
|
|
|
13
14
|
* same tool definitions drive both the MCP server and the in-browser chat.
|
|
14
15
|
*/
|
|
15
16
|
/** User-configured LLM connection settings, persisted in localStorage. */
|
|
16
|
-
interface AiSettings {
|
|
17
|
+
export interface AiSettings {
|
|
17
18
|
/** Master on/off for the in-browser assistant. Off by default. */
|
|
18
19
|
enabled: boolean;
|
|
19
20
|
/** OpenAI-compatible base URL, e.g. `https://api.openai.com/v1` */
|
|
@@ -28,33 +29,66 @@ interface AiSettings {
|
|
|
28
29
|
*/
|
|
29
30
|
autoApproveWrites: boolean;
|
|
30
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;
|
|
31
54
|
/** MCP-compatible annotation hints; structural, no MCP SDK dependency. */
|
|
32
|
-
type AiToolAnnotations = PhAiToolAnnotations;
|
|
55
|
+
export type AiToolAnnotations = PhAiToolAnnotations;
|
|
33
56
|
/**
|
|
34
57
|
* Provider-agnostic tool descriptor accepted by the chat agent.
|
|
35
58
|
*
|
|
36
59
|
* Structurally compatible with the MCP tool records produced by
|
|
37
|
-
* `
|
|
60
|
+
* `toMcpTool`: the callback parameter is `never` so any
|
|
38
61
|
* per-tool-args function type is assignable, and the result is `unknown`
|
|
39
62
|
* because the envelope shape (MCP `CallToolResult`) is unwrapped at the
|
|
40
63
|
* adapter boundary.
|
|
41
64
|
*/
|
|
42
|
-
type AiToolDescriptor = PhAiToolDescriptor;
|
|
65
|
+
export type AiToolDescriptor = PhAiToolDescriptor;
|
|
43
66
|
/** Tool descriptors the app resolves when the user sends a message. */
|
|
44
|
-
type AiToolsProvider = () => Promise<AiToolDescriptor[]>;
|
|
45
|
-
/**
|
|
46
|
-
|
|
67
|
+
export type AiToolsProvider = () => Promise<AiToolDescriptor[]>;
|
|
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
|
+
}
|
|
47
75
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
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.
|
|
51
79
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
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;
|
|
83
|
+
export type ToolCallState = "awaiting-approval" | "executing" | "done" | "error" | "rejected";
|
|
54
84
|
/** One rendered unit inside a chat message. */
|
|
55
|
-
type ChatPart = {
|
|
85
|
+
export type ChatPart = {
|
|
56
86
|
type: "text";
|
|
57
87
|
text: string;
|
|
88
|
+
} | {
|
|
89
|
+
type: "image";
|
|
90
|
+
dataUrl: string;
|
|
91
|
+
name?: string;
|
|
58
92
|
} | {
|
|
59
93
|
type: "tool";
|
|
60
94
|
toolCallId: string;
|
|
@@ -64,19 +98,19 @@ type ChatPart = {
|
|
|
64
98
|
result?: unknown;
|
|
65
99
|
error?: string;
|
|
66
100
|
};
|
|
67
|
-
interface ChatMessage {
|
|
101
|
+
export interface ChatMessage {
|
|
68
102
|
id: string;
|
|
69
103
|
role: "user" | "assistant";
|
|
70
104
|
parts: ChatPart[];
|
|
71
105
|
}
|
|
72
106
|
/** A write tool call the user must approve or reject. */
|
|
73
|
-
interface PendingApproval {
|
|
107
|
+
export interface PendingApproval {
|
|
74
108
|
toolCallId: string;
|
|
75
109
|
name: string;
|
|
76
110
|
args: unknown;
|
|
77
111
|
}
|
|
78
112
|
/** Context snapshot injected into the agent system prompt. */
|
|
79
|
-
interface ChatContext {
|
|
113
|
+
export interface ChatContext {
|
|
80
114
|
driveId?: string;
|
|
81
115
|
driveName?: string;
|
|
82
116
|
nodeId?: string;
|
|
@@ -85,11 +119,18 @@ interface ChatContext {
|
|
|
85
119
|
documentType?: string;
|
|
86
120
|
documentName?: string;
|
|
87
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. */
|
|
88
129
|
switchboardUrl?: string;
|
|
89
130
|
switchboardGraphqlUrl?: string;
|
|
90
131
|
}
|
|
91
132
|
/** Events the agent emits while running a turn. */
|
|
92
|
-
type AgentEvent = {
|
|
133
|
+
export type AgentEvent = {
|
|
93
134
|
type: "text-delta";
|
|
94
135
|
delta: string;
|
|
95
136
|
} | {
|
|
@@ -113,12 +154,12 @@ type AgentEvent = {
|
|
|
113
154
|
state: "done" | "error" | "rejected";
|
|
114
155
|
result?: unknown;
|
|
115
156
|
error?: string;
|
|
116
|
-
}
|
|
157
|
+
} |
|
|
117
158
|
/**
|
|
118
159
|
* Token accounting for the turn: the input tokens of the model's last
|
|
119
160
|
* step (i.e. the size of the context it was reasoning over).
|
|
120
161
|
*/
|
|
121
|
-
|
|
162
|
+
{
|
|
122
163
|
type: "usage";
|
|
123
164
|
inputTokens: number;
|
|
124
165
|
} | {
|
|
@@ -130,7 +171,7 @@ type AgentEvent = {
|
|
|
130
171
|
//#endregion
|
|
131
172
|
//#region src/ai/agent.d.ts
|
|
132
173
|
/** Hard cap on model round-trips per user message (each tool step counts). */
|
|
133
|
-
declare const MAX_AGENT_STEPS =
|
|
174
|
+
export declare const MAX_AGENT_STEPS = 250;
|
|
134
175
|
/**
|
|
135
176
|
* Hard cap on the characters of one tool result fed back to the model.
|
|
136
177
|
*
|
|
@@ -140,7 +181,7 @@ declare const MAX_AGENT_STEPS = 10;
|
|
|
140
181
|
* context and stall the turn. Over-budget results are truncated with a
|
|
141
182
|
* marker so the model re-queries more narrowly.
|
|
142
183
|
*/
|
|
143
|
-
declare const MAX_TOOL_RESULT_CHARS = 12000;
|
|
184
|
+
export declare const MAX_TOOL_RESULT_CHARS = 12000;
|
|
144
185
|
/**
|
|
145
186
|
* Number of the most recent turns whose tool results are kept in full in
|
|
146
187
|
* the committed history. Tool results are re-derivable (the store is the
|
|
@@ -148,36 +189,56 @@ declare const MAX_TOOL_RESULT_CHARS = 12000;
|
|
|
148
189
|
* one-line stubs: this is what keeps a long conversation from exhausting
|
|
149
190
|
* the model's context.
|
|
150
191
|
*/
|
|
151
|
-
declare const FULL_RESULT_TURNS = 2;
|
|
192
|
+
export declare const FULL_RESULT_TURNS = 2;
|
|
152
193
|
/** Tool results smaller than this are cheap to keep and are never stubbed. */
|
|
153
|
-
declare const STUB_MIN_CHARS = 500;
|
|
194
|
+
export declare const STUB_MIN_CHARS = 500;
|
|
154
195
|
/**
|
|
155
196
|
* Replaces tool results older than the last {@link FULL_RESULT_TURNS}
|
|
156
197
|
* turns with one-line stubs naming the tool and its arguments. User and
|
|
157
198
|
* assistant messages are never touched, and tool calls keep their input,
|
|
158
199
|
* so the model can re-query any stubbed result with the same arguments.
|
|
159
|
-
*
|
|
200
|
+
* A result with images is stubbed whatever its size. Idempotent: stubs are
|
|
201
|
+
* below {@link STUB_MIN_CHARS} and pass through.
|
|
202
|
+
*/
|
|
203
|
+
export declare function stubStaleToolResults(history: ModelMessage[]): ModelMessage[];
|
|
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.
|
|
160
209
|
*/
|
|
161
|
-
declare function
|
|
162
|
-
declare function createReactorChatModel(settings: AiSettings): LanguageModel;
|
|
210
|
+
export declare function createConnectionChatModel(connection: AiConnection): LanguageModel;
|
|
163
211
|
/**
|
|
164
212
|
* Unwraps the MCP `CallToolResult` envelope produced by the reactor tool
|
|
165
213
|
* core into a plain value for the AI SDK. Throws for error results so the
|
|
166
214
|
* SDK surfaces them as tool errors in the next model step.
|
|
167
215
|
*/
|
|
168
|
-
declare function unwrapToolResult(raw: unknown): unknown;
|
|
216
|
+
export declare function unwrapToolResult(raw: unknown): unknown;
|
|
169
217
|
/** Builds the system prompt, grounding the agent in the current selection. */
|
|
170
|
-
declare function buildSystemPrompt(context: ChatContext): string;
|
|
171
|
-
interface ReactorChatAgentOptions {
|
|
218
|
+
export declare function buildSystemPrompt(context: ChatContext): string;
|
|
219
|
+
export interface ReactorChatAgentOptions {
|
|
172
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;
|
|
173
230
|
tools: AiToolDescriptor[];
|
|
174
231
|
context: ChatContext;
|
|
232
|
+
/** The host's services, read for each tool call so a running turn sees changes. */
|
|
233
|
+
services?: () => AiToolServices;
|
|
175
234
|
onEvent: (event: AgentEvent) => void;
|
|
176
235
|
signal?: AbortSignal;
|
|
177
236
|
/** Test seam: override the model (e.g. a mock language model). */
|
|
178
237
|
model?: LanguageModel;
|
|
179
238
|
/** Prior conversation to continue (see {@link ReactorChatAgent.getHistory}). */
|
|
180
239
|
history?: ModelMessage[];
|
|
240
|
+
/** Images of that conversation (see {@link ReactorChatAgent.getChatImages}). */
|
|
241
|
+
chatImages?: AiChatImage[];
|
|
181
242
|
}
|
|
182
243
|
/**
|
|
183
244
|
* Runs one tool-loop conversation turn against an OpenAI-compatible model.
|
|
@@ -186,23 +247,29 @@ interface ReactorChatAgentOptions {
|
|
|
186
247
|
* gated by the AI SDK's tool approval: when auto-approval is off, the
|
|
187
248
|
* pending user decision is bridged through {@link approve}/{@link reject}.
|
|
188
249
|
*/
|
|
189
|
-
declare class ReactorChatAgent {
|
|
250
|
+
export declare class ReactorChatAgent {
|
|
190
251
|
private readonly options;
|
|
191
252
|
private history;
|
|
253
|
+
private chatImages;
|
|
192
254
|
private approvals;
|
|
255
|
+
private approvingAll;
|
|
193
256
|
constructor(options: ReactorChatAgentOptions);
|
|
194
257
|
/** The model history after the last completed turn, for the next agent. */
|
|
195
258
|
getHistory(): ModelMessage[];
|
|
259
|
+
/** The images attached so far, under their handles, for the next agent. */
|
|
260
|
+
getChatImages(): AiChatImage[];
|
|
196
261
|
/** Clears the conversation history (a fresh chat). */
|
|
197
262
|
reset(): void;
|
|
198
263
|
/** Approves a pending write tool call, resuming the agent loop. */
|
|
199
264
|
approve(toolCallId: string): void;
|
|
200
265
|
/** Rejects a pending write tool call; the rejection is fed to the model. */
|
|
201
266
|
reject(toolCallId: string): void;
|
|
267
|
+
/** Approves every pending write, and any more for the rest of this turn. */
|
|
268
|
+
approveAll(): void;
|
|
202
269
|
private resolveApproval;
|
|
203
270
|
private cancelPendingApprovals;
|
|
204
271
|
/** Runs one user turn: appends the message, streams the model, commits history. */
|
|
205
|
-
send(text: string): Promise<void>;
|
|
272
|
+
send(text: string, images?: ChatImage[]): Promise<void>;
|
|
206
273
|
/**
|
|
207
274
|
* Removes tool calls that were never executed (step cap or abort):
|
|
208
275
|
* OpenAI-compatible APIs reject a tool call without its tool result.
|
|
@@ -216,63 +283,99 @@ declare class ReactorChatAgent {
|
|
|
216
283
|
* In-chat approval card for a write tool call. Approving or rejecting
|
|
217
284
|
* resolves the pending approval inside the agent loop.
|
|
218
285
|
*/
|
|
219
|
-
declare function ApprovalCard({
|
|
220
|
-
approval,
|
|
221
|
-
onApprove,
|
|
222
|
-
onReject
|
|
223
|
-
}: {
|
|
286
|
+
export declare function ApprovalCard({ approval, onApprove, onApproveAll, onReject }: {
|
|
224
287
|
approval: PendingApproval;
|
|
225
288
|
onApprove: (toolCallId: string) => void;
|
|
289
|
+
/** Offers Approve all when given */
|
|
290
|
+
onApproveAll?: () => void;
|
|
226
291
|
onReject: (toolCallId: string) => void;
|
|
227
|
-
}):
|
|
292
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
228
293
|
//#endregion
|
|
229
294
|
//#region src/ai/use-reactor-chat.d.ts
|
|
230
|
-
interface UseReactorChatResult {
|
|
295
|
+
export interface UseReactorChatResult {
|
|
231
296
|
messages: ChatMessage[];
|
|
232
297
|
isStreaming: boolean;
|
|
233
298
|
pendingApprovals: PendingApproval[];
|
|
234
299
|
error: string | null;
|
|
235
300
|
settings: AiSettings;
|
|
236
301
|
configured: boolean;
|
|
237
|
-
send: (text: string) => void;
|
|
302
|
+
send: (text: string, images?: ChatImage[]) => void;
|
|
238
303
|
stop: () => void;
|
|
239
304
|
approve: (toolCallId: string) => void;
|
|
305
|
+
/** Approves what's waiting, and any more until this message is answered. */
|
|
306
|
+
approveAll: () => void;
|
|
240
307
|
reject: (toolCallId: string) => void;
|
|
241
308
|
clear: () => void;
|
|
242
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
|
+
}
|
|
243
318
|
/**
|
|
244
319
|
* Drives one in-browser chat conversation against the reactor tools.
|
|
245
320
|
*
|
|
246
321
|
* `toolsProvider` lazily resolves the tool descriptors (e.g. from
|
|
247
|
-
* `
|
|
322
|
+
* `toMcpTool` bound to `window.ph.reactorClient`) when the
|
|
248
323
|
* user sends a message, so the reactor does not need to be ready at render
|
|
249
324
|
* time.
|
|
250
325
|
*/
|
|
251
|
-
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;
|
|
252
346
|
//#endregion
|
|
253
347
|
//#region src/ai/components/chat-window.d.ts
|
|
254
348
|
/** The chat window panel, anchored above the FAB in the bottom-right. */
|
|
255
|
-
declare function ChatWindow({
|
|
256
|
-
chat,
|
|
257
|
-
onClose
|
|
258
|
-
}: {
|
|
349
|
+
export declare function ChatWindow({ chat, onClose }: {
|
|
259
350
|
chat: UseReactorChatResult;
|
|
260
351
|
onClose: () => void;
|
|
261
|
-
}):
|
|
352
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
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;
|
|
262
367
|
//#endregion
|
|
263
368
|
//#region src/ai/components/reactor-chat-fab.d.ts
|
|
264
369
|
/**
|
|
265
370
|
* Bottom-right floating action button that opens the reactor AI chat window.
|
|
266
371
|
*
|
|
267
372
|
* `getTools` lazily resolves the reactor tool descriptors (from
|
|
268
|
-
* `
|
|
373
|
+
* `toMcpTool` bound to the browser reactor client) when the
|
|
269
374
|
* user sends a message.
|
|
270
375
|
*/
|
|
271
|
-
declare function ReactorChatFab({
|
|
272
|
-
getTools
|
|
273
|
-
}: {
|
|
376
|
+
export declare function ReactorChatFab({ getTools }: {
|
|
274
377
|
getTools?: AiToolsProvider;
|
|
275
|
-
}):
|
|
378
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
276
379
|
//#endregion
|
|
277
380
|
//#region src/ai/context.d.ts
|
|
278
381
|
/**
|
|
@@ -280,28 +383,114 @@ declare function ReactorChatFab({
|
|
|
280
383
|
* chat context-aware: "create a budget here" targets the selected drive,
|
|
281
384
|
* "summarize this document" targets the selected document.
|
|
282
385
|
*/
|
|
283
|
-
declare function useChatContext(): ChatContext;
|
|
386
|
+
export declare function useChatContext(): ChatContext;
|
|
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>;
|
|
284
469
|
//#endregion
|
|
285
470
|
//#region src/ai/settings-store.d.ts
|
|
286
|
-
declare const DEFAULT_AI_SETTINGS: AiSettings;
|
|
471
|
+
export declare const DEFAULT_AI_SETTINGS: AiSettings;
|
|
287
472
|
type Listener = () => void;
|
|
288
473
|
/** Returns the current settings (stable snapshot for useSyncExternalStore). */
|
|
289
|
-
declare function getAiSettings(): AiSettings;
|
|
474
|
+
export declare function getAiSettings(): AiSettings;
|
|
290
475
|
/** Merges a partial update, persists, and notifies subscribers. */
|
|
291
|
-
declare function updateAiSettings(patch: Partial<AiSettings>): AiSettings;
|
|
476
|
+
export declare function updateAiSettings(patch: Partial<AiSettings>): AiSettings;
|
|
292
477
|
/** Clears all stored settings. */
|
|
293
|
-
declare function clearAiSettings(): void;
|
|
478
|
+
export declare function clearAiSettings(): void;
|
|
294
479
|
/** Subscribes to settings changes. Returns the unsubscribe function. */
|
|
295
|
-
declare function subscribeAiSettings(listener: Listener): () => void;
|
|
480
|
+
export declare function subscribeAiSettings(listener: Listener): () => void;
|
|
296
481
|
/** True when the endpoint, key and model are all configured. */
|
|
297
|
-
declare function isAiConfigured(settings: AiSettings): boolean;
|
|
482
|
+
export declare function isAiConfigured(settings: AiSettings): boolean;
|
|
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";
|
|
298
487
|
//#endregion
|
|
299
488
|
//#region src/ai/switchboard.d.ts
|
|
300
489
|
/**
|
|
301
490
|
* The switchboard serving a remote drive: the base URL the browser talks to
|
|
302
491
|
* and its GraphQL supergraph endpoint.
|
|
303
492
|
*/
|
|
304
|
-
interface DriveSwitchboard {
|
|
493
|
+
export interface DriveSwitchboard {
|
|
305
494
|
/** Switchboard base URL (e.g. `http://localhost:4001`). */
|
|
306
495
|
switchboardUrl: string;
|
|
307
496
|
/** GraphQL supergraph endpoint (`<base>/graphql`). */
|
|
@@ -312,9 +501,7 @@ interface DriveSwitchboard {
|
|
|
312
501
|
* `undefined` in non-browser environments or before the reactor client
|
|
313
502
|
* module is initialized.
|
|
314
503
|
*/
|
|
315
|
-
declare function getBrowserSyncManager(): ISyncManager | undefined;
|
|
316
|
-
/** Suffix of the per-drive GraphQL channel endpoint the switchboard serves. */
|
|
317
|
-
declare const GQL_CHANNEL_SUFFIX = "/graphql/r";
|
|
504
|
+
export declare function getBrowserSyncManager(): ISyncManager | undefined;
|
|
318
505
|
/**
|
|
319
506
|
* Resolves the switchboard that serves a drive, if any.
|
|
320
507
|
*
|
|
@@ -325,16 +512,19 @@ declare const GQL_CHANNEL_SUFFIX = "/graphql/r";
|
|
|
325
512
|
* than from a global setting) is what keeps multi-switchboard deployments
|
|
326
513
|
* correct. Drives that are not synced to a remote switchboard (local
|
|
327
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`).
|
|
328
518
|
*/
|
|
329
|
-
declare function resolveDriveSwitchboard(driveId: string | undefined, syncManager?: ISyncManager): DriveSwitchboard | undefined;
|
|
519
|
+
export declare function resolveDriveSwitchboard(driveId: string | undefined, syncManager?: ISyncManager): DriveSwitchboard | undefined;
|
|
330
520
|
/**
|
|
331
521
|
* Introspection over the switchboard supergraph's root query and mutation
|
|
332
522
|
* fields. Types are requested with three levels of `ofType` nesting so
|
|
333
523
|
* that common shapes like `[X!]!` (LIST(NON_NULL(LIST(X)))) render fully.
|
|
334
524
|
*/
|
|
335
|
-
declare const SWITCHBOARD_INTROSPECTION_QUERY: string;
|
|
525
|
+
export declare const SWITCHBOARD_INTROSPECTION_QUERY: string;
|
|
336
526
|
/** One root query or mutation field, reduced to a prompt-friendly line. */
|
|
337
|
-
type SchemaFieldSummary = {
|
|
527
|
+
export type SchemaFieldSummary = {
|
|
338
528
|
name: string;
|
|
339
529
|
description?: string;
|
|
340
530
|
args: string;
|
|
@@ -345,27 +535,71 @@ type SchemaFieldSummary = {
|
|
|
345
535
|
* object) to a compact summary of its root query and mutation fields.
|
|
346
536
|
* Accepts `unknown` because the payload arrives over the wire.
|
|
347
537
|
*/
|
|
348
|
-
declare function summarizeIntrospectionSchema(schema: unknown): {
|
|
538
|
+
export declare function summarizeIntrospectionSchema(schema: unknown): {
|
|
349
539
|
queries: SchemaFieldSummary[];
|
|
350
540
|
mutations: SchemaFieldSummary[];
|
|
351
541
|
truncated: boolean;
|
|
352
542
|
};
|
|
353
|
-
declare const SWITCHBOARD_SCHEMA_TOOL_NAME = "getSwitchboardSchema";
|
|
543
|
+
export declare const SWITCHBOARD_SCHEMA_TOOL_NAME = "getSwitchboardSchema";
|
|
354
544
|
/** Test seams for {@link createSwitchboardSchemaTool}. */
|
|
355
|
-
interface SwitchboardToolDeps {
|
|
356
|
-
getSyncManager?: () => ISyncManager | undefined;
|
|
357
|
-
getSelectedDriveId?: () => string | undefined;
|
|
545
|
+
export interface SwitchboardToolDeps {
|
|
358
546
|
tokenProvider?: () => Promise<string | undefined>;
|
|
359
547
|
fetchImpl?: typeof fetch;
|
|
360
548
|
timeoutMs?: number;
|
|
361
549
|
}
|
|
362
550
|
/**
|
|
363
551
|
* Creates the read-only `getSwitchboardSchema` tool: it introspects the
|
|
364
|
-
* GraphQL supergraph of
|
|
365
|
-
*
|
|
366
|
-
*
|
|
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.
|
|
556
|
+
*/
|
|
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.
|
|
367
598
|
*/
|
|
368
|
-
declare function
|
|
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;
|
|
369
602
|
//#endregion
|
|
370
|
-
export {
|
|
603
|
+
export type { ChatPanelProps };
|
|
604
|
+
export {};
|
|
371
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":"
|
|
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,c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