@powerhousedao/reactor-browser 6.2.3-dev.95 → 6.2.3-dev.96

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 (45) hide show
  1. package/dist/{attachment-service-10Qn5nIw.d.ts → attachment-service-DXfpfp98.d.ts} +4 -3
  2. package/dist/attachment-service-DXfpfp98.d.ts.map +1 -0
  3. package/dist/client-1n_ZUXeu.js +135 -0
  4. package/dist/client-1n_ZUXeu.js.map +1 -0
  5. package/dist/{client-C-NgSjoc.d.ts → client-BFk0MY6A.d.ts} +2 -2
  6. package/dist/client-BFk0MY6A.d.ts.map +1 -0
  7. package/dist/{document-model-modules-ChmfyIxT.js → document-model-modules-BG-61uke.js} +68 -2
  8. package/dist/document-model-modules-BG-61uke.js.map +1 -0
  9. package/dist/{document-operations-QtU34A52.js → document-operations-D5QXcJbV.js} +6 -61
  10. package/dist/document-operations-D5QXcJbV.js.map +1 -0
  11. package/dist/{global-bbfp3_1x.d.ts → global-DAAmZGCO.d.ts} +7 -44
  12. package/dist/global-DAAmZGCO.d.ts.map +1 -0
  13. package/dist/{index-Bfr_cWdi.d.ts → index-Bj1poVfa.d.ts} +2 -2
  14. package/dist/{index-Bfr_cWdi.d.ts.map → index-Bj1poVfa.d.ts.map} +1 -1
  15. package/dist/index.d.ts +78 -8
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +10 -187
  18. package/dist/index.js.map +1 -1
  19. package/dist/{client-BNMyQ_Z2.js → schema-D0G1oAo9.js} +2 -133
  20. package/dist/schema-D0G1oAo9.js.map +1 -0
  21. package/dist/src/ai/index.d.ts +41 -8
  22. package/dist/src/ai/index.d.ts.map +1 -1
  23. package/dist/src/ai/index.js +302 -6
  24. package/dist/src/ai/index.js.map +1 -1
  25. package/dist/src/graphql/client.d.ts +2 -2
  26. package/dist/src/graphql/client.js +1 -1
  27. package/dist/src/graphql-client/entry.d.ts +3 -2
  28. package/dist/src/graphql-client/entry.js +2 -2
  29. package/dist/src/renown/index.d.ts +1 -1
  30. package/dist/switchboard-directory-CWf5SRo7.js +435 -0
  31. package/dist/switchboard-directory-CWf5SRo7.js.map +1 -0
  32. package/dist/switchboards-D-_JBUbF.d.ts +75 -0
  33. package/dist/switchboards-D-_JBUbF.d.ts.map +1 -0
  34. package/dist/{types-CT44EMmw.d.ts → types-CyPDurGV.d.ts} +5 -1
  35. package/dist/types-CyPDurGV.d.ts.map +1 -0
  36. package/package.json +10 -10
  37. package/dist/attachment-service-10Qn5nIw.d.ts.map +0 -1
  38. package/dist/client-BNMyQ_Z2.js.map +0 -1
  39. package/dist/client-C-NgSjoc.d.ts.map +0 -1
  40. package/dist/document-model-modules-ChmfyIxT.js.map +0 -1
  41. package/dist/document-operations-QtU34A52.js.map +0 -1
  42. package/dist/global-bbfp3_1x.d.ts.map +0 -1
  43. package/dist/switchboard-B640iT1L.js +0 -321
  44. package/dist/switchboard-B640iT1L.js.map +0 -1
  45. package/dist/types-CT44EMmw.d.ts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"global-bbfp3_1x.d.ts","names":[],"sources":["../src/types/documents.ts","../src/types/reactor-browser-client.ts","../src/types/config.ts","../src/types/modals.ts","../src/types/package-discovery.ts","../src/types/timeline.ts","../src/types/toast.ts","../src/types/vetra.ts","../src/hooks/node-drag-and-drop.ts","../src/hooks/ph-store.tsx","../src/hooks/drive-nodes.ts","../src/types/global.ts"],"mappings":";;;;;;;;;;;;;;KAOY,iBAAiB,KAAK,QAAQ,KAAK,aAAa;KAEhD,iBAAiB,KAAK,QAAQ;EACxC;EACA,OAAO;;KAGG,gBAAgB,KAAK,QAAQ;EACvC;EACA;;KAGU,aAAa;EAEnB;;EAEA;EAAqB,OAAO;;EAC5B;EAAoB;;;KAGd;EACV;EACA;;UAGe;EACf,IAAI,YAAY,oBAAoB,QAAQ;EAC5C,SAAS,eAAe,oBAAoB,QAAQ;EACpD,UAAU,uBAAuB;;EAEjC,iBAAiB,aAAa;;;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UAAU;;EAGZ,SAAS,QAAQ;;EAEjB,cAAc,QAAQ;;EAEtB,SAAS,QAAQ;;EAEjB,UACE,SAAS,MAAM,2BAA2B,kBAC1C;IAAY;;;EAGd,mBAAmB;;EAEnB,sBAAsB;;;EAGtB;;;KAIU;EACV;;EAEA;;EAEA;;EAEA;;KAGU,aAAW;EACrB,aAAa;EACb;EACA,sBAAsB,+BAA6B;EACnD,gBAAgB;;EAEhB,UAAU;;EAEV,oBAAoB;EACpB,oBAAoB;EACpB,uBAAuB;EACvB,SAAS,UAAU;EACnB,sBAAsB;;EAEtB,gBAAgB,QAAQ;EACxB,SAAS;;;;;EAKT,cAAc;;EAEd,aAAa;EACb,gBAAgB;EAChB;EACA;EACA,eAAe;EACf,QAAQ;EACR;EACA,uBAAuB;EACvB,0BAA0B;EAC1B,WAAW;EACX,QAAQ;;KAGE,sBAAoB;KACpB,gBAAgB,WAAS;KAEzB,mBAAiB,eAAe,uBACxC;KAGQ,mBAAiB,eAAe,kBAC1C,OAAO;KAGG;KAEA,6BAA6B,OACvC,eACA;KAGU,SAAS,aAAa,iBAAe,eAC9C,OAAO,OAAO,WAAS;QAGlB;YACI;IACR,KAAK;;YAEG,uBAAuB"}
@@ -1,321 +0,0 @@
1
- import { c as getPHStore } from "./make-ph-event-functions-B5GU5xcR.js";
2
- import { M as NoSelectedDocumentError, j as DocumentTypeMismatchError } from "./dispatch-Cylwl2Dk.js";
3
- import { G as useDriveNode, O as useSelectedNodeId, P as useDriveContext, Q as ambientRenownTokenProvider, h as useSelectedDriveId, t as useDocumentModelModuleById } from "./document-model-modules-ChmfyIxT.js";
4
- import { t as useDocumentById } from "./document-by-id-DdvqanGR.js";
5
- import { createContext, useContext, useMemo } from "react";
6
- import { jsx } from "react/jsx-runtime";
7
- import { DriveCollectionId, ModuleNotFoundError } from "@powerhousedao/reactor";
8
- import { isFileNode } from "@powerhousedao/shared/document-drive";
9
- import { z } from "zod";
10
- //#region src/hooks/node-by-id.ts
11
- /** Returns a node in the selected drive by id. */
12
- function useNodeById(id) {
13
- return useDriveNode(useSelectedDriveId(), id);
14
- }
15
- //#endregion
16
- //#region src/hooks/selected-node.ts
17
- /** Returns the selected node. */
18
- function useSelectedNode() {
19
- return useNodeById(useSelectedNodeId());
20
- }
21
- //#endregion
22
- //#region src/hooks/document-of-type.ts
23
- /** Returns a document of a specific type, throws an error if the found document has a different type */
24
- function useDocumentOfType(documentId, documentType) {
25
- const [document, dispatch] = useDocumentById(documentId);
26
- const documentModelModule = useDocumentModelModuleById(documentType);
27
- if (!documentId || !documentType) return [];
28
- if (!document) throw new Error(`Document not found: ${documentId}`);
29
- if (!documentModelModule) throw new ModuleNotFoundError(documentType);
30
- if (document.header.documentType !== documentType) throw new DocumentTypeMismatchError(documentId, documentType, document.header.documentType);
31
- return [document, dispatch];
32
- }
33
- //#endregion
34
- //#region src/hooks/editor-context.tsx
35
- const EditorDocumentContext = createContext(void 0);
36
- /** Hosts render an editor inside this, with the same `document` and `dispatch`
37
- * as its props; `useSelected*Document` hooks below read them. */
38
- function EditorDocumentProvider(props) {
39
- const { document, dispatch } = props;
40
- const value = useMemo(() => [document, dispatch], [document, dispatch]);
41
- return /* @__PURE__ */ jsx(EditorDocumentContext.Provider, {
42
- value,
43
- children: props.children
44
- });
45
- }
46
- /** The nearest editor's document and dispatch, or undefined outside one. */
47
- function useEditorDocumentContext() {
48
- return useContext(EditorDocumentContext);
49
- }
50
- //#endregion
51
- //#region src/hooks/selected-document.ts
52
- /** Returns the selected document id: the editor's document, else the drive
53
- * app's open document, else the app's selection. */
54
- function useSelectedDocumentId() {
55
- const editor = useEditorDocumentContext();
56
- const drive = useDriveContext();
57
- const selectedNode = useSelectedNode();
58
- if (editor) return editor[0].header.id;
59
- if (drive?.nodeId && !drive.folder) return selectedNode && !isFileNode(selectedNode) ? void 0 : drive.nodeId;
60
- return selectedNode && isFileNode(selectedNode) ? selectedNode.id : void 0;
61
- }
62
- /** Returns the selected document. */
63
- function useSelectedDocument() {
64
- const [document, dispatch] = useSelectedDocumentSafe();
65
- if (!document) throw new NoSelectedDocumentError();
66
- return [document, dispatch];
67
- }
68
- /** Returns the selected document: the editor's, else the app's selection. */
69
- function useSelectedDocumentSafe() {
70
- const editor = useEditorDocumentContext();
71
- const selectedDocumentId = useSelectedDocumentId();
72
- const selected = useDocumentById(editor ? null : selectedDocumentId);
73
- return editor ?? selected;
74
- }
75
- function useSelectedDocumentOfType(documentType) {
76
- const editor = useEditorDocumentContext();
77
- const documentId = useSelectedDocumentId();
78
- const result = useDocumentOfType(documentType && !editor ? documentId : null, documentType);
79
- const documentModelModule = useDocumentModelModuleById(documentType);
80
- if (!documentType) return [];
81
- if (editor) {
82
- const [document, dispatch] = editor;
83
- if (!documentModelModule) throw new ModuleNotFoundError(documentType);
84
- if (document.header.documentType !== documentType) throw new DocumentTypeMismatchError(document.header.id, documentType, document.header.documentType);
85
- return [document, dispatch];
86
- }
87
- if (!documentId) throw new NoSelectedDocumentError();
88
- return result;
89
- }
90
- //#endregion
91
- //#region src/ai/switchboard.ts
92
- /**
93
- * Reads the tab-side sync manager from the browser global. Returns
94
- * `undefined` in non-browser environments or before the reactor client
95
- * module is initialized.
96
- */
97
- function getBrowserSyncManager() {
98
- if (typeof window === "undefined") return;
99
- return getPHStore()?.reactorClientModule?.reactorModule?.syncModule?.syncManager;
100
- }
101
- /** Suffix of the per-drive GraphQL channel endpoint the switchboard serves. */
102
- const GQL_CHANNEL_SUFFIX = "/graphql/r";
103
- /**
104
- * Resolves the switchboard that serves a drive, if any.
105
- *
106
- * Every remote drive stores its switchboard's exact GraphQL channel
107
- * endpoint in its sync remote — `channelConfig = { type: "gql",
108
- * parameters: { url: "<origin>/graphql/r" } }` — and the switchboard base
109
- * is that URL minus the `/graphql/r` suffix. Deriving it per drive (rather
110
- * than from a global setting) is what keeps multi-switchboard deployments
111
- * correct. Drives that are not synced to a remote switchboard (local
112
- * drives, other channel types, unexpected shapes) return `undefined`.
113
- */
114
- function resolveDriveSwitchboard(driveId, syncManager) {
115
- const manager = syncManager ?? getBrowserSyncManager();
116
- if (!driveId || !manager) return;
117
- const collectionId = DriveCollectionId.forDrive(driveId);
118
- const remote = manager.list().find((r) => r.meta.collectionId.equals(collectionId));
119
- if (!remote) return;
120
- const { channelConfig } = remote.meta;
121
- if (channelConfig.type !== "gql") return;
122
- const url = channelConfig.parameters.url;
123
- if (typeof url !== "string" || !url.endsWith("/graphql/r")) return;
124
- const switchboardUrl = url.slice(0, -10);
125
- return {
126
- switchboardUrl,
127
- graphqlUrl: `${switchboardUrl}/graphql`
128
- };
129
- }
130
- /**
131
- * Introspection over the switchboard supergraph's root query and mutation
132
- * fields. Types are requested with three levels of `ofType` nesting so
133
- * that common shapes like `[X!]!` (LIST(NON_NULL(LIST(X)))) render fully.
134
- */
135
- const SWITCHBOARD_INTROSPECTION_QUERY = `
136
- query SwitchboardIntrospection {
137
- __schema {
138
- queryType {
139
- fields {
140
- name
141
- description
142
- args {
143
- name
144
- type {
145
- kind
146
- name
147
- ofType {
148
- kind
149
- name
150
- ofType {
151
- kind
152
- name
153
- ofType {
154
- kind
155
- name
156
- }
157
- }
158
- }
159
- }
160
- }
161
- type {
162
- kind
163
- name
164
- ofType {
165
- kind
166
- name
167
- ofType {
168
- kind
169
- name
170
- ofType {
171
- kind
172
- name
173
- }
174
- }
175
- }
176
- }
177
- }
178
- }
179
- mutationType {
180
- fields {
181
- name
182
- description
183
- args {
184
- name
185
- type {
186
- kind
187
- name
188
- ofType {
189
- kind
190
- name
191
- ofType {
192
- kind
193
- name
194
- ofType {
195
- kind
196
- name
197
- }
198
- }
199
- }
200
- }
201
- }
202
- type {
203
- kind
204
- name
205
- ofType {
206
- kind
207
- name
208
- ofType {
209
- kind
210
- name
211
- ofType {
212
- kind
213
- name
214
- }
215
- }
216
- }
217
- }
218
- }
219
- }
220
- }
221
- }
222
- `;
223
- /**
224
- * Renders an introspected type reference as a GraphQL type string.
225
- * Recursion is bounded by the `ofType` nesting of the query, so it always
226
- * terminates.
227
- */
228
- function renderTypeRef(type) {
229
- if (!type) return "Unknown";
230
- switch (type.kind) {
231
- case "NON_NULL": return `${renderTypeRef(type.ofType)}!`;
232
- case "LIST": return `[${renderTypeRef(type.ofType)}]`;
233
- default: return type.name ?? "Unknown";
234
- }
235
- }
236
- /** Cap on the number of fields reported per root type. */
237
- const MAX_FIELDS_PER_ROOT = 200;
238
- function summarizeFields(fields) {
239
- const list = fields ?? [];
240
- return {
241
- fields: list.slice(0, MAX_FIELDS_PER_ROOT).map((field) => ({
242
- name: field.name,
243
- ...field.description ? { description: field.description } : {},
244
- args: field.args.map((arg) => `${arg.name}: ${renderTypeRef(arg.type)}`).join(", "),
245
- returns: renderTypeRef(field.type)
246
- })),
247
- truncated: list.length > MAX_FIELDS_PER_ROOT
248
- };
249
- }
250
- /**
251
- * Reduces a GraphQL `__schema` introspection payload (the `data.__schema`
252
- * object) to a compact summary of its root query and mutation fields.
253
- * Accepts `unknown` because the payload arrives over the wire.
254
- */
255
- function summarizeIntrospectionSchema(schema) {
256
- const introspection = schema ?? {};
257
- const queries = summarizeFields(introspection.queryType?.fields);
258
- const mutations = summarizeFields(introspection.mutationType?.fields);
259
- return {
260
- queries: queries.fields,
261
- mutations: mutations.fields,
262
- truncated: queries.truncated || mutations.truncated
263
- };
264
- }
265
- const SWITCHBOARD_SCHEMA_TOOL_NAME = "getSwitchboardSchema";
266
- /**
267
- * Creates the read-only `getSwitchboardSchema` tool: it introspects the
268
- * GraphQL supergraph of the switchboard serving a drive and returns a
269
- * summary of its root queries and mutations. It reads the schema only and
270
- * never modifies data.
271
- */
272
- function createSwitchboardSchemaTool(deps) {
273
- const getSyncManager = deps?.getSyncManager ?? getBrowserSyncManager;
274
- const getSelectedDriveId = deps?.getSelectedDriveId ?? (() => typeof window === "undefined" ? void 0 : getPHStore()?.selectedDriveId);
275
- const tokenProvider = deps?.tokenProvider ?? ambientRenownTokenProvider;
276
- const fetchImpl = deps?.fetchImpl ?? fetch;
277
- const timeoutMs = deps?.timeoutMs ?? 1e4;
278
- return {
279
- name: SWITCHBOARD_SCHEMA_TOOL_NAME,
280
- description: "Introspect the GraphQL endpoint of the switchboard serving a drive and list the queries and mutations it exposes (reactor operations, document-model read models, package subgraphs). Read-only: it reads the schema only and never modifies data. Omit driveId to introspect the currently selected drive.",
281
- inputSchema: { driveId: z.string().describe("Drive to introspect. Omit to use the currently selected drive.").optional() },
282
- annotations: { readOnlyHint: true },
283
- callback: async (input) => {
284
- const driveId = input?.driveId ?? getSelectedDriveId();
285
- const sb = resolveDriveSwitchboard(driveId, getSyncManager());
286
- if (!sb) throw new Error(driveId ? `Drive "${driveId}" has no switchboard: it is not synced to a remote switchboard.` : "No drive is currently selected and no driveId was given.");
287
- const token = await tokenProvider();
288
- let response;
289
- try {
290
- response = await fetchImpl(sb.graphqlUrl, {
291
- method: "POST",
292
- headers: {
293
- "content-type": "application/json",
294
- ...token ? { authorization: `Bearer ${token}` } : {}
295
- },
296
- body: JSON.stringify({ query: SWITCHBOARD_INTROSPECTION_QUERY }),
297
- signal: AbortSignal.timeout(timeoutMs)
298
- });
299
- } catch (error) {
300
- throw new Error(`Switchboard at ${sb.graphqlUrl} is not reachable: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
301
- }
302
- if (response.status === 401 || response.status === 403) throw new Error(`Switchboard at ${sb.graphqlUrl} refused the request (HTTP ${response.status}). Sign in to the switchboard (Renown) and try again.`);
303
- if (!response.ok) throw new Error(`Switchboard introspection failed: HTTP ${response.status} ${response.statusText} from ${sb.graphqlUrl}`);
304
- const body = await response.json();
305
- const schemaErrors = body?.errors;
306
- if (schemaErrors && schemaErrors.length > 0) throw new Error(schemaErrors.map((e) => e.message ?? "unknown error").join("; "));
307
- const schema = body?.data?.__schema;
308
- if (!schema?.queryType) throw new Error(`Switchboard at ${sb.graphqlUrl} did not return a GraphQL schema.`);
309
- const summary = summarizeIntrospectionSchema(schema);
310
- return {
311
- switchboardUrl: sb.switchboardUrl,
312
- graphqlUrl: sb.graphqlUrl,
313
- ...summary
314
- };
315
- }
316
- };
317
- }
318
- //#endregion
319
- export { getBrowserSyncManager as a, useSelectedDocument as c, useSelectedDocumentSafe as d, EditorDocumentProvider as f, useNodeById as g, useSelectedNode as h, createSwitchboardSchemaTool as i, useSelectedDocumentId as l, useDocumentOfType as m, SWITCHBOARD_INTROSPECTION_QUERY as n, resolveDriveSwitchboard as o, useEditorDocumentContext as p, SWITCHBOARD_SCHEMA_TOOL_NAME as r, summarizeIntrospectionSchema as s, GQL_CHANNEL_SUFFIX as t, useSelectedDocumentOfType as u };
320
-
321
- //# sourceMappingURL=switchboard-B640iT1L.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"switchboard-B640iT1L.js","names":[],"sources":["../src/hooks/node-by-id.ts","../src/hooks/selected-node.ts","../src/hooks/document-of-type.ts","../src/hooks/editor-context.tsx","../src/hooks/selected-document.ts","../src/ai/switchboard.ts"],"sourcesContent":["import type { Node } from \"@powerhousedao/shared/document-drive\";\nimport { useDriveNode } from \"./drive-nodes.js\";\nimport { useSelectedDriveId } from \"./selected-drive.js\";\n\n/** Returns a node in the selected drive by id. */\nexport function useNodeById(id: string | null | undefined): Node | undefined {\n return useDriveNode(useSelectedDriveId(), id);\n}\n","import type { Node } from \"@powerhousedao/shared/document-drive\";\nimport { useNodeById } from \"./node-by-id.js\";\nimport { useSelectedNodeId } from \"./set-selected-node.js\";\n\nexport {\n addResetSelectedNodeEventHandler,\n addSelectedNodeIdEventHandler,\n getNodeTarget,\n useNodeTarget,\n preloadNode,\n setSelectedNode,\n setSelectedNodeId,\n useOpenNode,\n usePreloadNode,\n useSetSelectedNode,\n} from \"./set-selected-node.js\";\nexport { addSetSelectedNodeOnPopStateEventHandler } from \"./sync-selection.js\";\n\n/** Returns the selected node. */\nexport function useSelectedNode(): Node | undefined {\n return useNodeById(useSelectedNodeId());\n}\n","import { ModuleNotFoundError } from \"@powerhousedao/reactor\";\nimport type { DocumentDispatch } from \"@powerhousedao/reactor-browser\";\nimport type { Action, PHDocument } from \"@powerhousedao/shared/document-model\";\nimport { DocumentTypeMismatchError } from \"../errors.js\";\nimport { useDocumentById } from \"./document-by-id.js\";\nimport { useDocumentModelModuleById } from \"./document-model-modules.js\";\n\n/** Returns a document of a specific type, throws an error if the found document has a different type */\nexport function useDocumentOfType<\n TDocument extends PHDocument,\n TAction extends Action,\n>(\n documentId: string | null | undefined,\n documentType: string | null | undefined,\n) {\n const [document, dispatch] = useDocumentById(documentId);\n const documentModelModule = useDocumentModelModuleById(documentType);\n\n if (!documentId || !documentType) return [];\n\n if (!document) {\n throw new Error(`Document not found: ${documentId}`);\n }\n if (!documentModelModule) {\n throw new ModuleNotFoundError(documentType);\n }\n\n if (document.header.documentType !== documentType) {\n throw new DocumentTypeMismatchError(\n documentId,\n documentType,\n document.header.documentType,\n );\n }\n\n return [document, dispatch] as [TDocument, DocumentDispatch<TAction>];\n}\n","import type {\n DocumentDispatch,\n PHDocument,\n} from \"@powerhousedao/shared/document-model\";\nimport type { ReactNode } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\n/** The document an editor is rendered with, and a dispatch bound to it. */\nexport type EditorDocumentContextValue = readonly [\n PHDocument,\n DocumentDispatch,\n];\n\nconst EditorDocumentContext = createContext<\n EditorDocumentContextValue | undefined\n>(undefined);\n\n/** Hosts render an editor inside this, with the same `document` and `dispatch`\n * as its props; `useSelected*Document` hooks below read them. */\nexport function EditorDocumentProvider(props: {\n document: PHDocument;\n dispatch: DocumentDispatch;\n children: ReactNode;\n}) {\n const { document, dispatch } = props;\n const value = useMemo(\n () => [document, dispatch] as const,\n [document, dispatch],\n );\n return (\n <EditorDocumentContext.Provider value={value}>\n {props.children}\n </EditorDocumentContext.Provider>\n );\n}\n\n/** The nearest editor's document and dispatch, or undefined outside one. */\nexport function useEditorDocumentContext() {\n return useContext(EditorDocumentContext);\n}\n","import { ModuleNotFoundError } from \"@powerhousedao/reactor\";\nimport type { DocumentDispatch } from \"@powerhousedao/reactor-browser\";\nimport { isFileNode } from \"@powerhousedao/shared/document-drive\";\nimport type { Action, PHDocument } from \"@powerhousedao/shared/document-model\";\nimport {\n DocumentTypeMismatchError,\n NoSelectedDocumentError,\n} from \"../errors.js\";\nimport type { DispatchFn, UseDispatchResult } from \"./dispatch.js\";\nimport { useDocumentById } from \"./document-by-id.js\";\nimport { useDocumentModelModuleById } from \"./document-model-modules.js\";\nimport { useDocumentOfType } from \"./document-of-type.js\";\nimport { useDriveContext } from \"./drive-context.js\";\nimport { useEditorDocumentContext } from \"./editor-context.js\";\nimport { useSelectedNode } from \"./selected-node.js\";\n\n/** Returns the selected document id: the editor's document, else the drive\n * app's open document, else the app's selection. */\nexport function useSelectedDocumentId(): string | undefined {\n const editor = useEditorDocumentContext();\n const drive = useDriveContext();\n const selectedNode = useSelectedNode();\n if (editor) return editor[0].header.id;\n // The drive may not list a document the route opened yet.\n if (drive?.nodeId && !drive.folder) {\n return selectedNode && !isFileNode(selectedNode) ? undefined : drive.nodeId;\n }\n return selectedNode && isFileNode(selectedNode) ? selectedNode.id : undefined;\n}\n\n/** Returns the selected document. */\nexport function useSelectedDocument(): readonly [\n PHDocument,\n DispatchFn<Action>,\n] {\n const [document, dispatch] = useSelectedDocumentSafe();\n if (!document) {\n throw new NoSelectedDocumentError();\n }\n return [document, dispatch] as const;\n}\n\n/** Returns the selected document: the editor's, else the app's selection. */\nexport function useSelectedDocumentSafe(): UseDispatchResult<\n PHDocument,\n Action\n> {\n const editor = useEditorDocumentContext();\n const selectedDocumentId = useSelectedDocumentId();\n const selected = useDocumentById(editor ? null : selectedDocumentId);\n return editor ?? selected;\n}\n\n/** Returns the selected document of a specific type, throws an error if the found document has a different type */\nexport function useSelectedDocumentOfType(\n documentType: null | undefined,\n): never[];\nexport function useSelectedDocumentOfType<\n TDocument extends PHDocument,\n TAction extends Action,\n>(documentType: string): [TDocument, DocumentDispatch<TAction>];\nexport function useSelectedDocumentOfType<\n TDocument extends PHDocument,\n TAction extends Action,\n>(\n documentType: string | null | undefined,\n): never[] | [TDocument, DocumentDispatch<TAction>] {\n const editor = useEditorDocumentContext();\n const documentId = useSelectedDocumentId();\n // Called on every render; without a type, or in an editor, it reads no document.\n const result = useDocumentOfType<TDocument, TAction>(\n documentType && !editor ? documentId : null,\n documentType,\n );\n const documentModelModule = useDocumentModelModuleById(documentType);\n\n if (!documentType) {\n return [];\n }\n if (editor) {\n const [document, dispatch] = editor;\n if (!documentModelModule) {\n throw new ModuleNotFoundError(documentType);\n }\n if (document.header.documentType !== documentType) {\n throw new DocumentTypeMismatchError(\n document.header.id,\n documentType,\n document.header.documentType,\n );\n }\n return [document as TDocument, dispatch];\n }\n if (!documentId) {\n throw new NoSelectedDocumentError();\n }\n return result;\n}\n","import { getPHStore } from \"../hooks/ph-store.js\";\nimport { DriveCollectionId, type ISyncManager } from \"@powerhousedao/reactor\";\nimport { z } from \"zod\";\nimport { ambientRenownTokenProvider } from \"../graphql-client/auth.js\";\nimport type { AiToolDescriptor } from \"./types.js\";\n\n/**\n * The switchboard serving a remote drive: the base URL the browser talks to\n * and its GraphQL supergraph endpoint.\n */\nexport interface DriveSwitchboard {\n /** Switchboard base URL (e.g. `http://localhost:4001`). */\n switchboardUrl: string;\n /** GraphQL supergraph endpoint (`<base>/graphql`). */\n graphqlUrl: string;\n}\n\n/**\n * Reads the tab-side sync manager from the browser global. Returns\n * `undefined` in non-browser environments or before the reactor client\n * module is initialized.\n */\nexport function getBrowserSyncManager(): ISyncManager | undefined {\n if (typeof window === \"undefined\") {\n return undefined;\n }\n return getPHStore()?.reactorClientModule?.reactorModule?.syncModule\n ?.syncManager;\n}\n\n/** Suffix of the per-drive GraphQL channel endpoint the switchboard serves. */\nexport const GQL_CHANNEL_SUFFIX = \"/graphql/r\";\n\n/**\n * Resolves the switchboard that serves a drive, if any.\n *\n * Every remote drive stores its switchboard's exact GraphQL channel\n * endpoint in its sync remote — `channelConfig = { type: \"gql\",\n * parameters: { url: \"<origin>/graphql/r\" } }` — and the switchboard base\n * is that URL minus the `/graphql/r` suffix. Deriving it per drive (rather\n * than from a global setting) is what keeps multi-switchboard deployments\n * correct. Drives that are not synced to a remote switchboard (local\n * drives, other channel types, unexpected shapes) return `undefined`.\n */\nexport function resolveDriveSwitchboard(\n driveId: string | undefined,\n syncManager?: ISyncManager,\n): DriveSwitchboard | undefined {\n const manager = syncManager ?? getBrowserSyncManager();\n if (!driveId || !manager) {\n return undefined;\n }\n const collectionId = DriveCollectionId.forDrive(driveId);\n const remote = manager\n .list()\n .find((r) => r.meta.collectionId.equals(collectionId));\n if (!remote) {\n return undefined;\n }\n const { channelConfig } = remote.meta;\n if (channelConfig.type !== \"gql\") {\n return undefined;\n }\n const url = channelConfig.parameters.url;\n if (typeof url !== \"string\" || !url.endsWith(GQL_CHANNEL_SUFFIX)) {\n return undefined;\n }\n const switchboardUrl = url.slice(0, -GQL_CHANNEL_SUFFIX.length);\n return { switchboardUrl, graphqlUrl: `${switchboardUrl}/graphql` };\n}\n\n/** A bounded introspected GraphQL type reference (see the query below). */\ntype IntrospectedTypeRef = {\n kind: string;\n name: string | null;\n ofType?: IntrospectedTypeRef | null;\n};\n\ntype IntrospectedField = {\n name: string;\n description: string | null;\n args: Array<{ name: string; type: IntrospectedTypeRef }>;\n type: IntrospectedTypeRef;\n};\n\ntype IntrospectedRootType = {\n fields: IntrospectedField[] | null;\n} | null;\n\ntype IntrospectedSchema = {\n queryType?: IntrospectedRootType;\n mutationType?: IntrospectedRootType;\n};\n\n/**\n * Introspection over the switchboard supergraph's root query and mutation\n * fields. Types are requested with three levels of `ofType` nesting so\n * that common shapes like `[X!]!` (LIST(NON_NULL(LIST(X)))) render fully.\n */\nexport const SWITCHBOARD_INTROSPECTION_QUERY: string = /* GraphQL */ `\n query SwitchboardIntrospection {\n __schema {\n queryType {\n fields {\n name\n description\n args {\n name\n type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n mutationType {\n fields {\n name\n description\n args {\n name\n type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n }\n`;\n\n/**\n * Renders an introspected type reference as a GraphQL type string.\n * Recursion is bounded by the `ofType` nesting of the query, so it always\n * terminates.\n */\nfunction renderTypeRef(type: IntrospectedTypeRef | null | undefined): string {\n if (!type) {\n return \"Unknown\";\n }\n switch (type.kind) {\n case \"NON_NULL\":\n return `${renderTypeRef(type.ofType)}!`;\n case \"LIST\":\n return `[${renderTypeRef(type.ofType)}]`;\n default:\n return type.name ?? \"Unknown\";\n }\n}\n\n/** One root query or mutation field, reduced to a prompt-friendly line. */\nexport type SchemaFieldSummary = {\n name: string;\n description?: string;\n args: string;\n returns: string;\n};\n\n/** Cap on the number of fields reported per root type. */\nconst MAX_FIELDS_PER_ROOT = 200;\n\nfunction summarizeFields(fields: IntrospectedField[] | null | undefined): {\n fields: SchemaFieldSummary[];\n truncated: boolean;\n} {\n const list = fields ?? [];\n return {\n fields: list.slice(0, MAX_FIELDS_PER_ROOT).map((field) => ({\n name: field.name,\n ...(field.description ? { description: field.description } : {}),\n args: field.args\n .map((arg) => `${arg.name}: ${renderTypeRef(arg.type)}`)\n .join(\", \"),\n returns: renderTypeRef(field.type),\n })),\n truncated: list.length > MAX_FIELDS_PER_ROOT,\n };\n}\n\n/**\n * Reduces a GraphQL `__schema` introspection payload (the `data.__schema`\n * object) to a compact summary of its root query and mutation fields.\n * Accepts `unknown` because the payload arrives over the wire.\n */\nexport function summarizeIntrospectionSchema(schema: unknown): {\n queries: SchemaFieldSummary[];\n mutations: SchemaFieldSummary[];\n truncated: boolean;\n} {\n const introspection = (schema ?? {}) as IntrospectedSchema;\n const queries = summarizeFields(introspection.queryType?.fields);\n const mutations = summarizeFields(introspection.mutationType?.fields);\n return {\n queries: queries.fields,\n mutations: mutations.fields,\n truncated: queries.truncated || mutations.truncated,\n };\n}\n\nexport const SWITCHBOARD_SCHEMA_TOOL_NAME = \"getSwitchboardSchema\";\n\n/** Test seams for {@link createSwitchboardSchemaTool}. */\nexport interface SwitchboardToolDeps {\n getSyncManager?: () => ISyncManager | undefined;\n getSelectedDriveId?: () => string | undefined;\n tokenProvider?: () => Promise<string | undefined>;\n fetchImpl?: typeof fetch;\n timeoutMs?: number;\n}\n\n/**\n * Creates the read-only `getSwitchboardSchema` tool: it introspects the\n * GraphQL supergraph of the switchboard serving a drive and returns a\n * summary of its root queries and mutations. It reads the schema only and\n * never modifies data.\n */\nexport function createSwitchboardSchemaTool(\n deps?: SwitchboardToolDeps,\n): AiToolDescriptor {\n const getSyncManager = deps?.getSyncManager ?? getBrowserSyncManager;\n const getSelectedDriveId =\n deps?.getSelectedDriveId ??\n ((): string | undefined =>\n typeof window === \"undefined\"\n ? undefined\n : getPHStore()?.selectedDriveId);\n const tokenProvider = deps?.tokenProvider ?? ambientRenownTokenProvider;\n const fetchImpl = deps?.fetchImpl ?? fetch;\n const timeoutMs = deps?.timeoutMs ?? 10_000;\n\n return {\n name: SWITCHBOARD_SCHEMA_TOOL_NAME,\n description:\n \"Introspect the GraphQL endpoint of the switchboard serving a drive and list the queries and mutations it exposes (reactor operations, document-model read models, package subgraphs). Read-only: it reads the schema only and never modifies data. Omit driveId to introspect the currently selected drive.\",\n inputSchema: {\n driveId: z\n .string()\n .describe(\n \"Drive to introspect. Omit to use the currently selected drive.\",\n )\n .optional(),\n },\n annotations: { readOnlyHint: true },\n callback: async (input: { driveId?: string } | undefined) => {\n const driveId = input?.driveId ?? getSelectedDriveId();\n const sb = resolveDriveSwitchboard(driveId, getSyncManager());\n if (!sb) {\n throw new Error(\n driveId\n ? `Drive \"${driveId}\" has no switchboard: it is not synced to a remote switchboard.`\n : \"No drive is currently selected and no driveId was given.\",\n );\n }\n\n const token = await tokenProvider();\n let response: Response;\n try {\n response = await fetchImpl(sb.graphqlUrl, {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n ...(token ? { authorization: `Bearer ${token}` } : {}),\n },\n body: JSON.stringify({ query: SWITCHBOARD_INTROSPECTION_QUERY }),\n signal: AbortSignal.timeout(timeoutMs),\n });\n } catch (error) {\n throw new Error(\n `Switchboard at ${sb.graphqlUrl} is not reachable: ${\n error instanceof Error ? error.message : String(error)\n }`,\n { cause: error },\n );\n }\n\n if (response.status === 401 || response.status === 403) {\n throw new Error(\n `Switchboard at ${sb.graphqlUrl} refused the request (HTTP ${response.status}). Sign in to the switchboard (Renown) and try again.`,\n );\n }\n if (!response.ok) {\n throw new Error(\n `Switchboard introspection failed: HTTP ${response.status} ${response.statusText} from ${sb.graphqlUrl}`,\n );\n }\n\n const body = (await response.json()) as {\n errors?: Array<{ message?: string }>;\n data?: { __schema?: unknown } | null;\n } | null;\n const schemaErrors = body?.errors;\n if (schemaErrors && schemaErrors.length > 0) {\n throw new Error(\n schemaErrors.map((e) => e.message ?? \"unknown error\").join(\"; \"),\n );\n }\n const schema = body?.data?.__schema as\n | IntrospectedSchema\n | null\n | undefined;\n if (!schema?.queryType) {\n throw new Error(\n `Switchboard at ${sb.graphqlUrl} did not return a GraphQL schema.`,\n );\n }\n\n const summary = summarizeIntrospectionSchema(schema);\n return {\n switchboardUrl: sb.switchboardUrl,\n graphqlUrl: sb.graphqlUrl,\n ...summary,\n };\n },\n };\n}\n"],"mappings":";;;;;;;;;;;AAKA,SAAgB,YAAY,IAAiD;CAC3E,OAAO,aAAa,mBAAmB,GAAG,EAAE;AAC9C;;;;ACYA,SAAgB,kBAAoC;CAClD,OAAO,YAAY,kBAAkB,CAAC;AACxC;;;;ACbA,SAAgB,kBAId,YACA,cACA;CACA,MAAM,CAAC,UAAU,YAAY,gBAAgB,UAAU;CACvD,MAAM,sBAAsB,2BAA2B,YAAY;CAEnE,IAAI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AM,UAAU,6BAA6B,MAAM;GACnD,OAAO;IACL,gBAAgB,GAAG;IACnB,YAAY,GAAG;IACf,GAAG;GACL;EACF;CACF;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-CT44EMmw.d.ts","names":[],"sources":["../src/graphql/constants.ts","../src/graphql/types.ts"],"mappings":";;;;cAAa;cACA;cACA;cAUA;cAMA;;;KCHR,yBAAyB;KAEzB,iBAAiB,YAAY;;KAGtB;;EAEV;;EAGA;;EAGA,UAAU;EAEV,YAAY;EACZ,iBAAiB;EACjB,SAAS;;KAGC,uBAAuB;;;;;;;EAOjC,cAAc,OAAO,SAAS,uBAAuB,QAAQ;;EAG7D,8BACE,SAAS,yBACT,UAAU,sCACP,QAAQ;;EAGb,kCACE,oBACA,MAAM,6BACN,SAAS,yBACT,UAAU,+BACP;IACH,UAAU;IACV,YAAY;;;KAIJ,6BAA6B;EACvC;;KAGU,8BAA8B;EACxC;;KAGU,4CACF;KAEE,6CACF;KAEE,wBAAwB,OAClC,mCACA;KAGU,yBAAyB,OACnC,oCACA;KAGU,4BAA4B,wBACtC;KAEU,wBAAwB,EAAE;EACpC,OAAO,EAAE"}