@ixo/editor 5.36.1 → 5.37.0

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.
@@ -1,11 +1,16 @@
1
1
  import {
2
+ COMPILED_BLOCK_TYPE,
3
+ compileBlockProps,
4
+ createYMapFromNode,
5
+ getAction,
2
6
  readBlocksFromFragment,
3
7
  readCompiledFlowFromYDoc,
4
8
  removeAllFlowBlocks,
5
9
  removeBlockFromFragment,
6
10
  replaceBlockInFragment,
11
+ swapBlocksInFragment,
7
12
  writeCompiledBlocksToFragment
8
- } from "./chunk-MCFRBVCB.mjs";
13
+ } from "./chunk-OOPKMGYW.mjs";
9
14
 
10
15
  // src/core/lib/flowCompiler/authoring.ts
11
16
  import * as Y from "yjs";
@@ -41,6 +46,42 @@ function readFlowDocument(yDoc) {
41
46
  nodes
42
47
  };
43
48
  }
49
+ function addFlowNode(yDoc, opts) {
50
+ const action = getAction(opts.type);
51
+ if (!action) return null;
52
+ const nodeId = `node_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;
53
+ const blockId = `flow_block_${nodeId}`;
54
+ const flowId = yDoc.getMap("qi.flow.meta").get("flowId") || "";
55
+ const withUri = flowId ? `ixo:flow:${flowId}:${nodeId}` : `ixo:flow:${nodeId}`;
56
+ const can = action.can ?? "";
57
+ const title = opts.title || can || action.type;
58
+ const cap = { id: nodeId, can, with: withUri, title, nb: {} };
59
+ const props = { ...compileBlockProps(cap, action.type), triggerMode: "manual", ...opts.props ?? {} };
60
+ const node = {
61
+ id: nodeId,
62
+ blockId,
63
+ can,
64
+ with: withUri,
65
+ registryType: action.type,
66
+ title,
67
+ description: "",
68
+ props
69
+ };
70
+ yDoc.transact(() => {
71
+ writeCompiledBlocksToFragment(yDoc.getXmlFragment("document"), [{ id: blockId, type: COMPILED_BLOCK_TYPE, props }]);
72
+ yDoc.getMap("qi.flow.nodes").set(nodeId, createYMapFromNode(node));
73
+ yDoc.getMap("qi.flow.blockIndex").set(nodeId, blockId);
74
+ const order = yDoc.getArray("qi.flow.order");
75
+ if (opts.afterNodeId) {
76
+ const idx = order.toArray().indexOf(opts.afterNodeId);
77
+ if (idx >= 0) order.insert(idx + 1, [nodeId]);
78
+ else order.push([nodeId]);
79
+ } else {
80
+ order.push([nodeId]);
81
+ }
82
+ });
83
+ return { nodeId, blockId };
84
+ }
44
85
  function setBlockProps(yDoc, blockId, partial) {
45
86
  const fragment = yDoc.getXmlFragment("document");
46
87
  const existing = readBlocksFromFragment(fragment).find((b) => b.id === blockId);
@@ -113,6 +154,33 @@ function reorderFlowNodes(yDoc, order) {
113
154
  });
114
155
  return true;
115
156
  }
157
+ function swapFlowBlocks(yDoc, blockIdA, blockIdB) {
158
+ const fragment = yDoc.getXmlFragment("document");
159
+ let ok = false;
160
+ yDoc.transact(() => {
161
+ ok = swapBlocksInFragment(fragment, blockIdA, blockIdB);
162
+ if (!ok) return;
163
+ const blockIndex = yDoc.getMap("qi.flow.blockIndex");
164
+ let nodeA;
165
+ let nodeB;
166
+ for (const [nodeId, bId] of blockIndex.entries()) {
167
+ if (bId === blockIdA) nodeA = nodeId;
168
+ else if (bId === blockIdB) nodeB = nodeId;
169
+ }
170
+ if (nodeA && nodeB) {
171
+ const order = yDoc.getArray("qi.flow.order");
172
+ const arr = order.toArray();
173
+ const ia = arr.indexOf(nodeA);
174
+ const ib = arr.indexOf(nodeB);
175
+ if (ia >= 0 && ib >= 0) {
176
+ [arr[ia], arr[ib]] = [arr[ib], arr[ia]];
177
+ order.delete(0, order.length);
178
+ order.push(arr);
179
+ }
180
+ }
181
+ });
182
+ return ok;
183
+ }
116
184
  function updateNodeRuntime(yDoc, blockId, partial) {
117
185
  const runtimeMap = yDoc.getMap("runtime");
118
186
  const prev = runtimeMap.get(blockId);
@@ -180,11 +248,13 @@ function fragmentHasContentBlocks(fragment) {
180
248
 
181
249
  export {
182
250
  readFlowDocument,
251
+ addFlowNode,
183
252
  setBlockProps,
184
253
  removeFlowNode,
185
254
  reorderFlowNodes,
255
+ swapFlowBlocks,
186
256
  updateNodeRuntime,
187
257
  resetStepRuntime,
188
258
  setFormAnswers
189
259
  };
190
- //# sourceMappingURL=chunk-OXIWTOZ5.mjs.map
260
+ //# sourceMappingURL=chunk-SBSTGR5L.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/lib/flowCompiler/authoring.ts"],"sourcesContent":["import * as Y from 'yjs';\nimport type { Doc as YDoc } from 'yjs';\nimport type { ActorConstraint, CompiledBlock, CompiledEdge, CompiledFlow, CompiledFlowNode, FlowCapability } from '../../types/baseUcan';\nimport type { FlowNodeRuntimeState } from '../../types/authorization';\nimport { getAction } from '../actionRegistry/registry';\nimport { readCompiledFlowFromYDoc } from './readFlow';\nimport { compileBlockProps, COMPILED_BLOCK_TYPE } from './blockMapping';\nimport { createYMapFromNode } from './hydrate';\nimport {\n readBlocksFromFragment,\n replaceBlockInFragment,\n removeBlockFromFragment,\n removeAllFlowBlocks,\n writeCompiledBlocksToFragment,\n swapBlocksInFragment,\n} from './documentFragment';\n\n/**\n * A single flow node as read from a live Y.Doc, assembled from all three sources:\n * structure (`qi.flow.*`), per-block `props` (the `document` fragment), and per-block\n * `runtime` (the `runtime` map). `props` and `runtime` are what the graph map cannot provide.\n */\nexport interface FlowDocumentNode {\n nodeId: string;\n blockId: string;\n can: string;\n with: string;\n title: string;\n description: string;\n /** Authoritative per-block props, recovered from the document fragment. */\n props: Record<string, string>;\n /** Per-block runtime; `{}` for a fresh/never-run node (e.g. a template). */\n runtime: FlowNodeRuntimeState;\n}\n\nexport interface FlowDocumentRead {\n meta: CompiledFlow['meta'];\n order: string[];\n edges: CompiledEdge[];\n blockIndex: Record<string, string>;\n nodes: FlowDocumentNode[];\n}\n\n// ─── Read ─────────────────────────────────────────────────────────────────────\n\n/**\n * Read a flow document **losslessly** from a headless Y.Doc, in one call.\n *\n * Why this exists: `readCompiledFlowFromYDoc` returns nodes with **empty `props`** (the\n * `qi.flow.nodes` map omits props — they live only in the `document` fragment), and\n * `decompileToBaseUcanFlow` is lossy for the same reason. `readFlowDocument` merges the three\n * sources so a consumer (e.g. an authoring agent) sees the *true* current flow:\n *\n * - structure ← `readCompiledFlowFromYDoc` (nodes, order, edges, `can`/`with`)\n * - per-block props ← `readBlocksFromFragment` (inputs/conditions/trigger/ttl/icon/…)\n * - per-block runtime ← the `runtime` Y.Map (state/output/error/…)\n *\n * Fragment props are authoritative for the denormalized fields (`title`/`description`); the\n * node-map copy is used only as a fallback when the fragment didn't persist them.\n *\n * Returns `null` when the doc has no flow at all (mirrors `readCompiledFlowFromYDoc`).\n */\nexport function readFlowDocument(yDoc: YDoc): FlowDocumentRead | null {\n const compiled = readCompiledFlowFromYDoc(yDoc);\n if (!compiled) return null;\n\n const propsByBlockId = new Map<string, Record<string, string>>();\n for (const block of readBlocksFromFragment(yDoc.getXmlFragment('document'))) {\n propsByBlockId.set(block.id, block.props);\n }\n\n const runtimeMap = yDoc.getMap('runtime');\n\n const nodes: FlowDocumentNode[] = compiled.order\n .filter((nodeId) => compiled.nodes[nodeId])\n .map((nodeId) => {\n const node = compiled.nodes[nodeId];\n const props = propsByBlockId.get(node.blockId) ?? {};\n const rawRuntime = runtimeMap.get(node.blockId);\n const runtime: FlowNodeRuntimeState = rawRuntime && typeof rawRuntime === 'object' ? (rawRuntime as FlowNodeRuntimeState) : {};\n\n return {\n nodeId,\n blockId: node.blockId,\n can: node.can,\n with: node.with,\n title: props.title ?? node.title,\n description: props.description ?? node.description,\n props,\n runtime,\n };\n });\n\n return {\n meta: compiled.meta,\n order: compiled.order,\n edges: compiled.edges,\n blockIndex: compiled.blockIndex,\n nodes,\n };\n}\n\n// ─── Add (template authoring — the inverse of removeFlowNode) ─────────────────\n\nexport interface AddFlowNodeOptions {\n /** Registry action type, e.g. `'qi/form.submit'`. Must exist in the registry. */\n type: string;\n /** Insert into the logical order right after this node id; appended to the end if omitted. */\n afterNodeId?: string;\n /** Optional starting title (defaults to the action's `can` / type). */\n title?: string;\n /** Optional extra block props merged over the compiled defaults. */\n props?: Record<string, string>;\n}\n\n/**\n * Add a step to the flow document — the inverse of `removeFlowNode`. Inserts an\n * attr-only `action` block into the `document` fragment and registers the\n * matching `qi.flow.*` structure (`nodes`, `blockIndex`, `order`) in one\n * transaction, mirroring exactly what the compiler's `hydrate` writes for a\n * single node. No recompile, no runtime entry (a template node is never-run).\n *\n * Returns the new ids, or `null` if `type` is not a known registry action.\n */\nexport function addFlowNode(yDoc: YDoc, opts: AddFlowNodeOptions): { nodeId: string; blockId: string } | null {\n const action = getAction(opts.type);\n if (!action) return null;\n\n const nodeId = `node_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;\n const blockId = `flow_block_${nodeId}`;\n\n const flowId = (yDoc.getMap('qi.flow.meta').get('flowId') as string | undefined) || '';\n const withUri = flowId ? `ixo:flow:${flowId}:${nodeId}` : `ixo:flow:${nodeId}`;\n const can = action.can ?? '';\n const title = opts.title || can || action.type;\n\n const cap: FlowCapability = { id: nodeId, can, with: withUri, title, nb: {} };\n const props: Record<string, string> = { ...compileBlockProps(cap, action.type), triggerMode: 'manual', ...(opts.props ?? {}) };\n\n const node: CompiledFlowNode = {\n id: nodeId,\n blockId,\n can,\n with: withUri,\n registryType: action.type,\n title,\n description: '',\n props,\n };\n\n yDoc.transact(() => {\n writeCompiledBlocksToFragment(yDoc.getXmlFragment('document'), [{ id: blockId, type: COMPILED_BLOCK_TYPE, props }]);\n yDoc.getMap('qi.flow.nodes').set(nodeId, createYMapFromNode(node));\n yDoc.getMap('qi.flow.blockIndex').set(nodeId, blockId);\n\n const order = yDoc.getArray<string>('qi.flow.order');\n if (opts.afterNodeId) {\n const idx = order.toArray().indexOf(opts.afterNodeId);\n if (idx >= 0) order.insert(idx + 1, [nodeId]);\n else order.push([nodeId]);\n } else {\n order.push([nodeId]);\n }\n });\n\n return { nodeId, blockId };\n}\n\n// ─── Per-block config writes (template authoring — surgical, no recompile) ─────\n\n/**\n * Edit one block's config props in place, in the `document` fragment. Surgical: it touches\n * only the target block (siblings untouched), does **not** recompile, and does **not** touch\n * the `runtime` map. Pass `''` for a prop to clear it (the writer drops empty values).\n *\n * Keeps the denormalized node-map fields in sync — `title`/`description` and the `actor`\n * object (derived from `authorisedActors`/`parentCapability`) live in BOTH the fragment and\n * `qi.flow.nodes`, so a fragment-only write would desync structural readers.\n *\n * Returns `false` when no block with `blockId` exists.\n */\nexport function setBlockProps(yDoc: YDoc, blockId: string, partial: Record<string, string>): boolean {\n const fragment = yDoc.getXmlFragment('document');\n const existing = readBlocksFromFragment(fragment).find((b) => b.id === blockId);\n if (!existing) return false;\n\n const merged: Record<string, string> = { ...existing.props, ...partial };\n\n let ok = false;\n yDoc.transact(() => {\n ok = replaceBlockInFragment(fragment, { id: blockId, type: existing.type, props: merged });\n\n const nodeId = findNodeIdForBlock(yDoc, blockId);\n if (nodeId) {\n const node = yDoc.getMap('qi.flow.nodes').get(nodeId);\n if (node instanceof Y.Map) {\n if ('title' in partial) node.set('title', merged.title ?? '');\n if ('description' in partial) node.set('description', merged.description ?? '');\n if ('authorisedActors' in partial || 'parentCapability' in partial) {\n const actor = actorFromProps(merged);\n if (actor) node.set('actor', actor);\n else node.delete('actor');\n }\n }\n }\n });\n\n return ok;\n}\n\n/**\n * Remove one step from the flow document — fragment block + `qi.flow.*` entries + its\n * `runtime` entry + any edges touching it — in one transaction. Siblings untouched.\n *\n * Guards against orphaning references: if another node's trigger, condition, or a\n * `{{nodeId.output.*}}` input ref points at this node, removal is refused and the referring\n * node ids are returned so the caller can surface them.\n */\nexport function removeFlowNode(yDoc: YDoc, nodeId: string): { ok: true } | { ok: false; referencedBy: string[] } {\n const doc = readFlowDocument(yDoc);\n if (!doc) return { ok: false, referencedBy: [] };\n\n const target = doc.nodes.find((n) => n.nodeId === nodeId);\n if (!target) return { ok: false, referencedBy: [] };\n\n const referencedBy = doc.nodes.filter((n) => n.nodeId !== nodeId && nodeReferences(n, nodeId, target.blockId)).map((n) => n.nodeId);\n if (referencedBy.length > 0) return { ok: false, referencedBy };\n\n const blockId = target.blockId;\n yDoc.transact(() => {\n removeBlockFromFragment(yDoc.getXmlFragment('document'), blockId);\n yDoc.getMap('qi.flow.nodes').delete(nodeId);\n yDoc.getMap('qi.flow.blockIndex').delete(nodeId);\n\n const order = yDoc.getArray<string>('qi.flow.order');\n const idx = order.toArray().indexOf(nodeId);\n if (idx >= 0) order.delete(idx, 1);\n\n const edges = yDoc.getMap('qi.flow.edges');\n for (const key of [...edges.keys()]) {\n const e = edges.get(key);\n if (e instanceof Y.Map && (e.get('source') === nodeId || e.get('target') === nodeId)) edges.delete(key);\n }\n\n yDoc.getMap('runtime').delete(blockId);\n });\n\n return { ok: true };\n}\n\n/**\n * Reorder the flow's steps. Always rewrites the logical order (`qi.flow.order`). Also\n * reorders the visual `document` fragment to match — but only when every block is an\n * attr-only compiled block; if the doc contains inline prose, the fragment is left untouched\n * (recreating it would lose content) and only the logical order changes.\n *\n * `order` must be a permutation of the current `qi.flow.order` (same ids, no dups); returns\n * `false` otherwise.\n */\nexport function reorderFlowNodes(yDoc: YDoc, order: string[]): boolean {\n const orderArr = yDoc.getArray<string>('qi.flow.order');\n const current = orderArr.toArray();\n if (order.length !== current.length) return false;\n if (new Set(order).size !== order.length) return false;\n const currentSet = new Set(current);\n if (!order.every((id) => currentSet.has(id))) return false;\n\n const blockIndex = yDoc.getMap('qi.flow.blockIndex');\n const fragment = yDoc.getXmlFragment('document');\n\n yDoc.transact(() => {\n orderArr.delete(0, orderArr.length);\n orderArr.push(order);\n\n if (!fragmentHasContentBlocks(fragment)) {\n const blocks = readBlocksFromFragment(fragment);\n const byId = new Map(blocks.map((b) => [b.id, b] as const));\n const orderedIds = order.map((nid) => blockIndex.get(nid) as string | undefined).filter((id): id is string => !!id);\n const ordered = orderedIds.map((id) => byId.get(id)).filter((b): b is CompiledBlock => !!b);\n const extras = blocks.filter((b) => !orderedIds.includes(b.id));\n removeAllFlowBlocks(fragment);\n writeCompiledBlocksToFragment(fragment, [...ordered, ...extras]);\n }\n });\n\n return true;\n}\n\n/**\n * Swap two step blocks by document position — the move-up/move-down primitive\n * for template authoring. Reorders the visual `document` fragment (so the change\n * is what the author sees), and keeps `qi.flow.order` consistent when BOTH\n * blocks are graph-registered nodes. Works for slash-menu (\"legacy\") blocks too,\n * since it operates on document position rather than the graph.\n *\n * Returns `false` if either block id is missing.\n */\nexport function swapFlowBlocks(yDoc: YDoc, blockIdA: string, blockIdB: string): boolean {\n const fragment = yDoc.getXmlFragment('document');\n let ok = false;\n yDoc.transact(() => {\n ok = swapBlocksInFragment(fragment, blockIdA, blockIdB);\n if (!ok) return;\n\n // Mirror the swap in the logical order for graph-registered nodes.\n const blockIndex = yDoc.getMap<string>('qi.flow.blockIndex');\n let nodeA: string | undefined;\n let nodeB: string | undefined;\n for (const [nodeId, bId] of blockIndex.entries()) {\n if (bId === blockIdA) nodeA = nodeId;\n else if (bId === blockIdB) nodeB = nodeId;\n }\n if (nodeA && nodeB) {\n const order = yDoc.getArray<string>('qi.flow.order');\n const arr = order.toArray();\n const ia = arr.indexOf(nodeA);\n const ib = arr.indexOf(nodeB);\n if (ia >= 0 && ib >= 0) {\n [arr[ia], arr[ib]] = [arr[ib], arr[ia]];\n order.delete(0, order.length);\n order.push(arr);\n }\n }\n });\n return ok;\n}\n\n// ─── Runtime writes (copilot on a running flow — benign, non-executing) ────────\n\n/** Merge a partial into a node's runtime entry — the headless twin of the React `updateRuntime`. */\nexport function updateNodeRuntime(yDoc: YDoc, blockId: string, partial: Partial<FlowNodeRuntimeState>): void {\n const runtimeMap = yDoc.getMap('runtime');\n const prev = runtimeMap.get(blockId);\n const base: FlowNodeRuntimeState = prev && typeof prev === 'object' ? (prev as FlowNodeRuntimeState) : {};\n runtimeMap.set(blockId, { ...base, ...partial });\n}\n\n/**\n * Clear a failed step back to idle so the user can cleanly re-run it. The headless twin of\n * the editor's \"Reset\" recovery affordance — benign and non-executing.\n */\nexport function resetStepRuntime(yDoc: YDoc, blockId: string): void {\n updateNodeRuntime(yDoc, blockId, { state: 'idle', error: undefined, output: {} });\n}\n\n/**\n * Pre-fill a (live) form step's answers at `runtime.output.form.answers` (a JSON string,\n * matching `FormPanel`). Merges into existing `output`; **never** sets `state:'completed'` —\n * submission stays the user's action.\n */\nexport function setFormAnswers(yDoc: YDoc, blockId: string, answers: Record<string, unknown>): void {\n const runtimeMap = yDoc.getMap('runtime');\n const prev = runtimeMap.get(blockId);\n const base: FlowNodeRuntimeState = prev && typeof prev === 'object' ? (prev as FlowNodeRuntimeState) : {};\n const output: Record<string, any> = base.output && typeof base.output === 'object' ? base.output : {};\n const form: Record<string, any> = output.form && typeof output.form === 'object' ? output.form : {};\n runtimeMap.set(blockId, { ...base, output: { ...output, form: { ...form, answers: JSON.stringify(answers) } } });\n}\n\n// ─── Internal helpers ──────────────────────────────────────────────────────────\n\nfunction safeParseJson<T>(value: unknown, fallback: T): T {\n if (typeof value !== 'string' || value.length === 0) return fallback;\n try {\n return JSON.parse(value) as T;\n } catch {\n return fallback;\n }\n}\n\nfunction findNodeIdForBlock(yDoc: YDoc, blockId: string): string | undefined {\n const blockIndex = yDoc.getMap('qi.flow.blockIndex');\n for (const [nodeId, bId] of blockIndex.entries()) {\n if (bId === blockId) return nodeId;\n }\n return undefined;\n}\n\nfunction actorFromProps(props: Record<string, string>): ActorConstraint | undefined {\n const authorisedActors = safeParseJson<string[] | undefined>(props.authorisedActors, undefined);\n const parentCapability = props.parentCapability && props.parentCapability.length > 0 ? props.parentCapability : undefined;\n const hasActors = Array.isArray(authorisedActors) && authorisedActors.length > 0;\n if (!hasActors && !parentCapability) return undefined;\n const actor: ActorConstraint = {};\n if (hasActors) actor.authorisedActors = authorisedActors as string[];\n if (parentCapability) actor.parentCapability = parentCapability;\n return actor;\n}\n\nfunction nodeReferences(node: FlowDocumentNode, nodeId: string, blockId: string): boolean {\n const trigger = safeParseJson<{ sourceBlockId?: string; sources?: Array<{ sourceBlockId?: string }> } | undefined>(node.props.trigger, undefined);\n if (trigger?.sourceBlockId === nodeId) return true;\n if (Array.isArray(trigger?.sources) && trigger.sources.some((s) => s?.sourceBlockId === nodeId)) return true;\n\n const cond = safeParseJson<{ conditions?: Array<{ sourceBlockId?: string }> } | undefined>(node.props.conditions, undefined);\n if (Array.isArray(cond?.conditions) && cond.conditions.some((c) => c?.sourceBlockId === blockId)) return true;\n\n const inputs = typeof node.props.inputs === 'string' ? node.props.inputs : '';\n if (inputs.includes(`${nodeId}.output`)) return true;\n\n return false;\n}\n\nfunction fragmentHasContentBlocks(fragment: Y.XmlFragment): boolean {\n if (fragment.length === 0) return false;\n const root = fragment.get(0);\n if (!(root instanceof Y.XmlElement) || root.nodeName !== 'blockGroup') return false;\n for (let i = 0; i < root.length; i++) {\n const container = root.get(i);\n if (!(container instanceof Y.XmlElement)) continue;\n const content = container.get(0);\n if (content instanceof Y.XmlElement && content.length > 0) return true; // inline children = prose\n }\n return false;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,YAAY,OAAO;AA8DZ,SAAS,iBAAiB,MAAqC;AACpE,QAAM,WAAW,yBAAyB,IAAI;AAC9C,MAAI,CAAC,SAAU,QAAO;AAEtB,QAAM,iBAAiB,oBAAI,IAAoC;AAC/D,aAAW,SAAS,uBAAuB,KAAK,eAAe,UAAU,CAAC,GAAG;AAC3E,mBAAe,IAAI,MAAM,IAAI,MAAM,KAAK;AAAA,EAC1C;AAEA,QAAM,aAAa,KAAK,OAAO,SAAS;AAExC,QAAM,QAA4B,SAAS,MACxC,OAAO,CAAC,WAAW,SAAS,MAAM,MAAM,CAAC,EACzC,IAAI,CAAC,WAAW;AACf,UAAM,OAAO,SAAS,MAAM,MAAM;AAClC,UAAM,QAAQ,eAAe,IAAI,KAAK,OAAO,KAAK,CAAC;AACnD,UAAM,aAAa,WAAW,IAAI,KAAK,OAAO;AAC9C,UAAM,UAAgC,cAAc,OAAO,eAAe,WAAY,aAAsC,CAAC;AAE7H,WAAO;AAAA,MACL;AAAA,M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AY,MAAS;AAC3H,MAAI,MAAM,QAAQ,MAAM,UAAU,KAAK,KAAK,WAAW,KAAK,CAAC,MAAM,GAAG,kBAAkB,OAAO,EAAG,QAAO;AAEzG,QAAM,SAAS,OAAO,KAAK,MAAM,WAAW,WAAW,KAAK,MAAM,SAAS;AAC3E,MAAI,OAAO,SAAS,GAAG,MAAM,SAAS,EAAG,QAAO;AAEhD,SAAO;AACT;AAEA,SAAS,yBAAyB,UAAkC;AAClE,MAAI,SAAS,WAAW,EAAG,QAAO;AAClC,QAAM,OAAO,SAAS,IAAI,CAAC;AAC3B,MAAI,EAAE,gBAAkB,iBAAe,KAAK,aAAa,aAAc,QAAO;AAC9E,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,YAAY,KAAK,IAAI,CAAC;AAC5B,QAAI,EAAE,qBAAuB,cAAa;AAC1C,UAAM,UAAU,UAAU,IAAI,CAAC;AAC/B,QAAI,mBAAqB,gBAAc,QAAQ,SAAS,EAAG,QAAO;AAAA,EACpE;AACA,SAAO;AACT;","names":[]}
@@ -1,7 +1,7 @@
1
- import { a5 as ActionDefinition, a6 as ActionEventDefinition, a7 as OutputSchemaField, a8 as ActionServices, a9 as CompiledBlock, v as CompiledFlow, aa as CompiledEdge, Z as FlowAgentCommand, $ as FlowAgentContext, _ as FlowAgentCommandResult, a0 as FlowAgentExecutor, a2 as FlowAgentNodeSnapshot, ab as FlowAgentBlockerCause, a3 as FlowAgentPublicNodeState } from '../store-C2NG2nTB.mjs';
2
- export { am as AcquireFlowAgentLeaseParams, ad as ActionContext, ae as ActionResult, aA as ActorConstraint, A as AuthorizationResult, B as BaseUcanFlow, X as BuildFlowAgentContextParams, aD as CompiledFlowNode, C as CompilerRegistry, az as ConditionRef, an as CreateAgentCommandParams, ao as EvaluateFlowAgentPolicyParams, E as ExecuteNodeParams, f as ExecutionContext, d as ExecutionOutcome, Y as FlowAgentActor, ar as FlowAgentCommandBase, as as FlowAgentCommandStatus, at as FlowAgentCommandType, a1 as FlowAgentLease, au as FlowAgentLedgerEvent, av as FlowAgentLedgerEventType, aw as FlowAgentMaps, ap as FlowAgentOrchestratorOptions, ax as FlowAgentPolicyDecision, ay as FlowAgentRunPhase, x as FlowAgentService, aq as FlowAgentServiceOptions, a4 as FlowAgentTickResult, u as FlowCapability, F as FlowRuntimeStateManager, w as FlowStrategy, M as MergeResult, N as NodeActionResult, R as ReadFlowOptions, q as ReadFlowResult, aC as RuntimeRef, S as SetupFlowOptions, p as SetupFlowResult, aB as TTLConstraint, aE as TriggerSpec, y as acquireFlowAgentLease, z as appendAgentLedgerEvent, a as buildAuthzFromProps, D as buildFlowAgentContext, b as buildFlowNodeFromBlock, af as canMatches, G as cleanupExpiredFlowAgentLeases, ac as clearRuntimeForTemplateClone, l as compileBaseUcanFlow, ag as computeAgentCommandId, H as createAgentCommand, c as createRuntimeStateManager, o as decompileToBaseUcanFlow, I as evaluateFlowAgentPolicy, e as executeNode, J as executeQueuedAgentCommands, k as getActiveEditor, K as getFlowAgentMaps, i as isAuthorized, ah as isCapabilityMatch, ai as isExternalMutation, aF as isRuntimeRef, n as mergeCompiledFlows, L as planRalphLoopCommands, O as queueAgentCommand, P as readAgentLedgerEvents, m as readCompiledFlowFromYDoc, h as readFlow, r as readFlowAsBaseUcan, g as readFlowFromEditor, Q as readQueuedAgentCommands, T as releaseFlowAgentLease, aj as requiredCapabilityForCommand, ak as resourceMatches, j as setActiveEditor, s as setupFlowFromBaseUcan, U as tickFlowAgent, al as updateAgentCommand, V as validateAgentCommand, W as validateFlowAgentLease } from '../store-C2NG2nTB.mjs';
3
- import { a4 as IxoEditorType, a5 as FlowNodeRuntimeState, f as UcanService, U as UcanDelegationStore, S as StoredDelegation, I as InvocationStore, a6 as FlowMetadata, a7 as FlowNode } from '../index-DUqLNz0c.mjs';
4
- export { af as ActionReadBackMetadata, a9 as ClaimCollectionURI, am as CreateDelegationParams, an as CreateInvocationParams, al as CreateRootDelegationParams, a8 as DID, D as DelegationChainValidationResult, k as DelegationGrant, aa as EvaluationStatus, aj as ExecutionWithInvocationResult, ak as FindProofsResult, ac as FlowNodeAuthzExtension, ag as FlowNodeBase, ah as InvocationRequest, ai as InvocationResult, ab as LinkedClaim, ad as NodeState, ae as ReadBackTerminalState, j as StoredInvocation, i as UcanCapability, g as UcanServiceConfig, h as UcanServiceHandlers, b as createInvocationStore, d as createMemoryInvocationStore, a as createMemoryUcanDelegationStore, c as createUcanDelegationStore, e as createUcanService } from '../index-DUqLNz0c.mjs';
1
+ import { a5 as ActionDefinition, a6 as ActionEventDefinition, a7 as OutputSchemaField, a8 as ActionServices, a9 as CompiledBlock, v as CompiledFlow, aa as CompiledEdge, Z as FlowAgentCommand, $ as FlowAgentContext, _ as FlowAgentCommandResult, a0 as FlowAgentExecutor, a2 as FlowAgentNodeSnapshot, ab as FlowAgentBlockerCause, a3 as FlowAgentPublicNodeState } from '../store-ChkNN7b4.mjs';
2
+ export { am as AcquireFlowAgentLeaseParams, ad as ActionContext, ae as ActionResult, aA as ActorConstraint, A as AuthorizationResult, B as BaseUcanFlow, X as BuildFlowAgentContextParams, aD as CompiledFlowNode, C as CompilerRegistry, az as ConditionRef, an as CreateAgentCommandParams, ao as EvaluateFlowAgentPolicyParams, E as ExecuteNodeParams, f as ExecutionContext, d as ExecutionOutcome, Y as FlowAgentActor, ar as FlowAgentCommandBase, as as FlowAgentCommandStatus, at as FlowAgentCommandType, a1 as FlowAgentLease, au as FlowAgentLedgerEvent, av as FlowAgentLedgerEventType, aw as FlowAgentMaps, ap as FlowAgentOrchestratorOptions, ax as FlowAgentPolicyDecision, ay as FlowAgentRunPhase, x as FlowAgentService, aq as FlowAgentServiceOptions, a4 as FlowAgentTickResult, u as FlowCapability, F as FlowRuntimeStateManager, w as FlowStrategy, M as MergeResult, N as NodeActionResult, R as ReadFlowOptions, q as ReadFlowResult, aC as RuntimeRef, S as SetupFlowOptions, p as SetupFlowResult, aB as TTLConstraint, aE as TriggerSpec, y as acquireFlowAgentLease, z as appendAgentLedgerEvent, a as buildAuthzFromProps, D as buildFlowAgentContext, b as buildFlowNodeFromBlock, af as canMatches, G as cleanupExpiredFlowAgentLeases, ac as clearRuntimeForTemplateClone, l as compileBaseUcanFlow, ag as computeAgentCommandId, H as createAgentCommand, c as createRuntimeStateManager, o as decompileToBaseUcanFlow, I as evaluateFlowAgentPolicy, e as executeNode, J as executeQueuedAgentCommands, k as getActiveEditor, K as getFlowAgentMaps, i as isAuthorized, ah as isCapabilityMatch, ai as isExternalMutation, aF as isRuntimeRef, n as mergeCompiledFlows, L as planRalphLoopCommands, O as queueAgentCommand, P as readAgentLedgerEvents, m as readCompiledFlowFromYDoc, h as readFlow, r as readFlowAsBaseUcan, g as readFlowFromEditor, Q as readQueuedAgentCommands, T as releaseFlowAgentLease, aj as requiredCapabilityForCommand, ak as resourceMatches, j as setActiveEditor, s as setupFlowFromBaseUcan, U as tickFlowAgent, al as updateAgentCommand, V as validateAgentCommand, W as validateFlowAgentLease } from '../store-ChkNN7b4.mjs';
3
+ import { a4 as IxoEditorType, a5 as FlowNodeRuntimeState, f as UcanService, U as UcanDelegationStore, S as StoredDelegation, I as InvocationStore, a6 as FlowMetadata, a7 as FlowNode } from '../index-1drTq85A.mjs';
4
+ export { af as ActionReadBackMetadata, a9 as ClaimCollectionURI, am as CreateDelegationParams, an as CreateInvocationParams, al as CreateRootDelegationParams, a8 as DID, D as DelegationChainValidationResult, k as DelegationGrant, aa as EvaluationStatus, aj as ExecutionWithInvocationResult, ak as FindProofsResult, ac as FlowNodeAuthzExtension, ag as FlowNodeBase, ah as InvocationRequest, ai as InvocationResult, ab as LinkedClaim, ad as NodeState, ae as ReadBackTerminalState, j as StoredInvocation, i as UcanCapability, g as UcanServiceConfig, h as UcanServiceHandlers, b as createInvocationStore, d as createMemoryInvocationStore, a as createMemoryUcanDelegationStore, c as createUcanDelegationStore, e as createUcanService } from '../index-1drTq85A.mjs';
5
5
  import * as Y from 'yjs';
6
6
  import { Doc } from 'yjs';
7
7
  import 'matrix-js-sdk';
@@ -434,6 +434,29 @@ interface FlowDocumentRead {
434
434
  * Returns `null` when the doc has no flow at all (mirrors `readCompiledFlowFromYDoc`).
435
435
  */
436
436
  declare function readFlowDocument(yDoc: Doc): FlowDocumentRead | null;
437
+ interface AddFlowNodeOptions {
438
+ /** Registry action type, e.g. `'qi/form.submit'`. Must exist in the registry. */
439
+ type: string;
440
+ /** Insert into the logical order right after this node id; appended to the end if omitted. */
441
+ afterNodeId?: string;
442
+ /** Optional starting title (defaults to the action's `can` / type). */
443
+ title?: string;
444
+ /** Optional extra block props merged over the compiled defaults. */
445
+ props?: Record<string, string>;
446
+ }
447
+ /**
448
+ * Add a step to the flow document — the inverse of `removeFlowNode`. Inserts an
449
+ * attr-only `action` block into the `document` fragment and registers the
450
+ * matching `qi.flow.*` structure (`nodes`, `blockIndex`, `order`) in one
451
+ * transaction, mirroring exactly what the compiler's `hydrate` writes for a
452
+ * single node. No recompile, no runtime entry (a template node is never-run).
453
+ *
454
+ * Returns the new ids, or `null` if `type` is not a known registry action.
455
+ */
456
+ declare function addFlowNode(yDoc: Doc, opts: AddFlowNodeOptions): {
457
+ nodeId: string;
458
+ blockId: string;
459
+ } | null;
437
460
  /**
438
461
  * Edit one block's config props in place, in the `document` fragment. Surgical: it touches
439
462
  * only the target block (siblings untouched), does **not** recompile, and does **not** touch
@@ -470,6 +493,16 @@ declare function removeFlowNode(yDoc: Doc, nodeId: string): {
470
493
  * `false` otherwise.
471
494
  */
472
495
  declare function reorderFlowNodes(yDoc: Doc, order: string[]): boolean;
496
+ /**
497
+ * Swap two step blocks by document position — the move-up/move-down primitive
498
+ * for template authoring. Reorders the visual `document` fragment (so the change
499
+ * is what the author sees), and keeps `qi.flow.order` consistent when BOTH
500
+ * blocks are graph-registered nodes. Works for slash-menu ("legacy") blocks too,
501
+ * since it operates on document position rather than the graph.
502
+ *
503
+ * Returns `false` if either block id is missing.
504
+ */
505
+ declare function swapFlowBlocks(yDoc: Doc, blockIdA: string, blockIdB: string): boolean;
473
506
  /** Merge a partial into a node's runtime entry — the headless twin of the React `updateRuntime`. */
474
507
  declare function updateNodeRuntime(yDoc: Doc, blockId: string, partial: Partial<FlowNodeRuntimeState>): void;
475
508
  /**
@@ -682,4 +715,4 @@ declare function createOracleInitFlowTemplate(): {
682
715
  nodes: FlowNode[];
683
716
  };
684
717
 
685
- export { ActionDefinition, ActionServices, type BlockConditionInput, type ClassifyNodeStateInput, CompiledBlock, CompiledEdge, CompiledFlow, type EvaluatorOperator, type ExecuteFlowAgentCoreCommandOptions, type ExecuteQueuedFlowAgentCoreCommandsOptions, type FailedListenerRun, FlowAgentBlockerCause, FlowAgentCommand, FlowAgentCommandResult, FlowAgentContext, FlowAgentExecutor, FlowAgentNodeSnapshot, FlowAgentPublicNodeState, type FlowDocumentNode, type FlowDocumentRead, FlowNode, FlowNodeRuntimeState, InvocationStore, OutputSchemaField, type PendingInvocation, RUN_RECORD_AUDIT_TYPE, type RunRecordDetails, StoredDelegation, type TriggerResolutionContext, UcanDelegationStore, UcanService, appendRunRecord, buildBlockConditionsProp, buildServicesFromHandlers, canToType, classifyBlockerCause, classifyNodeState, computeCID, computeJsonCID, computePendingInvocationId, createOracleInitFlowTemplate, executeFlowAgentCoreCommand, executeQueuedFlowAgentCoreCommands, findFailedListenersForSourceRun, getAction, getActionByCan, getActionForBlock, getAllActions, getAllCanMappings, getEventsForBlock, getOrCreateBlockPendingMap, getOutputSchemaForBlock, getPendingInvocationsMap, hasAction, oracleInitSurveySchema, queuePendingInvocation, readBlocksFromFragment, readFlowDocument, readPendingInvocations, readRunRecords, reconcilePendingInvocations, registerAction, removeBlockFromFragment, removeFlowNode, removePendingInvocation, reorderFlowNodes, replaceBlockInFragment, replayFailedListenerRun, resetStepRuntime, resolveRuntimeRefs, setBlockProps, setFormAnswers, snapshotInputRefs, snapshotNode, toEvaluatorOperator, typeToCan, updateNodeRuntime, writeCompiledBlocksToFragment, writeRunRecordAndReconcile };
718
+ export { ActionDefinition, ActionServices, type AddFlowNodeOptions, type BlockConditionInput, type ClassifyNodeStateInput, CompiledBlock, CompiledEdge, CompiledFlow, type EvaluatorOperator, type ExecuteFlowAgentCoreCommandOptions, type ExecuteQueuedFlowAgentCoreCommandsOptions, type FailedListenerRun, FlowAgentBlockerCause, FlowAgentCommand, FlowAgentCommandResult, FlowAgentContext, FlowAgentExecutor, FlowAgentNodeSnapshot, FlowAgentPublicNodeState, type FlowDocumentNode, type FlowDocumentRead, FlowNode, FlowNodeRuntimeState, InvocationStore, OutputSchemaField, type PendingInvocation, RUN_RECORD_AUDIT_TYPE, type RunRecordDetails, StoredDelegation, type TriggerResolutionContext, UcanDelegationStore, UcanService, addFlowNode, appendRunRecord, buildBlockConditionsProp, buildServicesFromHandlers, canToType, classifyBlockerCause, classifyNodeState, computeCID, computeJsonCID, computePendingInvocationId, createOracleInitFlowTemplate, executeFlowAgentCoreCommand, executeQueuedFlowAgentCoreCommands, findFailedListenersForSourceRun, getAction, getActionByCan, getActionForBlock, getAllActions, getAllCanMappings, getEventsForBlock, getOrCreateBlockPendingMap, getOutputSchemaForBlock, getPendingInvocationsMap, hasAction, oracleInitSurveySchema, queuePendingInvocation, readBlocksFromFragment, readFlowDocument, readPendingInvocations, readRunRecords, reconcilePendingInvocations, registerAction, removeBlockFromFragment, removeFlowNode, removePendingInvocation, reorderFlowNodes, replaceBlockInFragment, replayFailedListenerRun, resetStepRuntime, resolveRuntimeRefs, setBlockProps, setFormAnswers, snapshotInputRefs, snapshotNode, swapFlowBlocks, toEvaluatorOperator, typeToCan, updateNodeRuntime, writeCompiledBlocksToFragment, writeRunRecordAndReconcile };
@@ -1,12 +1,14 @@
1
1
  import {
2
+ addFlowNode,
2
3
  readFlowDocument,
3
4
  removeFlowNode,
4
5
  reorderFlowNodes,
5
6
  resetStepRuntime,
6
7
  setBlockProps,
7
8
  setFormAnswers,
9
+ swapFlowBlocks,
8
10
  updateNodeRuntime
9
- } from "../chunk-OXIWTOZ5.mjs";
11
+ } from "../chunk-SBSTGR5L.mjs";
10
12
  import {
11
13
  FlowAgentService,
12
14
  RUN_RECORD_AUDIT_TYPE,
@@ -92,7 +94,7 @@ import {
92
94
  validateFlowAgentLease,
93
95
  writeCompiledBlocksToFragment,
94
96
  writeRunRecordAndReconcile
95
- } from "../chunk-MCFRBVCB.mjs";
97
+ } from "../chunk-OOPKMGYW.mjs";
96
98
  import {
97
99
  computeCID,
98
100
  computeJsonCID
@@ -481,6 +483,7 @@ export {
481
483
  FlowAgentService,
482
484
  RUN_RECORD_AUDIT_TYPE,
483
485
  acquireFlowAgentLease,
486
+ addFlowNode,
484
487
  appendAgentLedgerEvent,
485
488
  appendRunRecord,
486
489
  buildAuthzFromProps,
@@ -564,6 +567,7 @@ export {
564
567
  setupFlowFromBaseUcan,
565
568
  snapshotInputRefs,
566
569
  snapshotNode,
570
+ swapFlowBlocks,
567
571
  tickFlowAgent,
568
572
  toEvaluatorOperator,
569
573
  typeToCan,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/core/templates/oracleInitFlow.ts"],"sourcesContent":["import type { FlowMetadata } from '../types/editor';\nimport type { FlowNode } from '../types/authorization';\n\n// ---------------------------------------------------------------------------\n// SurveyJS schema for the oracle configuration form\n// ---------------------------------------------------------------------------\n\nexport const oracleInitSurveySchema = {\n title: 'Oracle Configuration',\n description: 'Provide the details needed to initialise a new oracle on the IXO network.',\n logoPosition: 'right',\n pages: [\n {\n name: 'basicInfo',\n title: 'Basic Information',\n elements: [\n {\n type: 'text',\n name: 'projectName',\n title: 'Project Name',\n description: 'Used as the folder name — no spaces or special characters.',\n isRequired: true,\n validators: [\n {\n type: 'regex',\n text: 'Only lowercase letters, numbers, and hyphens are allowed (no spaces or special characters).',\n regex: '^[a-z0-9]+(-[a-z0-9]+)*$',\n },\n ],\n },\n {\n type: 'text',\n name: 'pin',\n title: 'PIN',\n description: 'A 6-digit PIN used to secure wallet operations.',\n isRequired: true,\n inputType: 'password',\n maxLength: 6,\n validators: [\n {\n type: 'regex',\n text: 'PIN must be exactly 6 digits.',\n regex: '^\\\\d{6}$',\n },\n ],\n },\n ],\n },\n {\n name: 'oracleDetails',\n title: 'Oracle Details',\n elements: [\n {\n type: 'text',\n name: 'oracleName',\n title: 'Oracle Name',\n isRequired: true,\n },\n {\n type: 'text',\n name: 'orgName',\n title: 'Organisation Name',\n isRequired: true,\n },\n {\n type: 'comment',\n name: 'description',\n title: 'Description',\n isRequired: true,\n },\n {\n type: 'text',\n name: 'location',\n title: 'Location',\n isRequired: true,\n },\n {\n type: 'text',\n name: 'logoUrl',\n title: 'Logo URL',\n isRequired: true,\n inputType: 'url',\n validators: [{ type: 'url' }],\n },\n {\n type: 'text',\n name: 'coverImageUrl',\n title: 'Cover Image URL',\n isRequired: true,\n inputType: 'url',\n validators: [{ type: 'url' }],\n },\n ],\n },\n {\n name: 'serviceConfig',\n title: 'Service Configuration',\n elements: [\n {\n type: 'text',\n name: 'apiUrl',\n title: 'API URL',\n isRequired: true,\n inputType: 'url',\n defaultValue: 'http://localhost:4000',\n validators: [{ type: 'url' }],\n },\n {\n type: 'text',\n name: 'price',\n title: 'Price',\n description: 'Service price in IXO tokens (minimum 1).',\n isRequired: true,\n inputType: 'number',\n defaultValue: 100,\n validators: [\n {\n type: 'numeric',\n text: 'Price must be at least 1.',\n minValue: 1,\n },\n ],\n },\n {\n type: 'dropdown',\n name: 'llmModel',\n title: 'LLM Model',\n isRequired: true,\n choices: [\n { value: 'kimi-k2.5', text: 'Kimi K2.5' },\n { value: 'claude-sonnet', text: 'Claude Sonnet' },\n { value: 'gpt-4o', text: 'GPT-4o' },\n { value: 'gemini-2.5', text: 'Gemini 2.5' },\n { value: 'llama-4', text: 'Llama 4' },\n { value: 'custom', text: 'Custom' },\n ],\n },\n {\n type: 'comment',\n name: 'opening',\n title: 'Opening Message',\n description: 'The greeting or introduction the agent uses when starting a conversation.',\n isRequired: false,\n },\n {\n type: 'comment',\n name: 'communicationStyle',\n title: 'Communication Style',\n description: 'How the agent should communicate (e.g. formal, friendly, concise).',\n isRequired: false,\n },\n {\n type: 'comment',\n name: 'capabilities',\n title: 'What can the agent do?',\n description: 'Describe what this agent is capable of doing for users.',\n isRequired: false,\n },\n ],\n },\n ],\n};\n\n// ---------------------------------------------------------------------------\n// Template generator\n// ---------------------------------------------------------------------------\n\nexport function createOracleInitFlowTemplate(): {\n metadata: FlowMetadata;\n nodes: FlowNode[];\n} {\n const metadata: FlowMetadata = {\n '@context': 'https://schema.ixo.world/flow/v1',\n _type: 'flow/oracle-init',\n schema_version: '1.0.0',\n doc_id: '',\n title: 'Oracle Init Flow',\n createdAt: new Date().toISOString(),\n createdBy: '',\n flowOwnerDid: '',\n };\n\n const nodes: FlowNode[] = [\n // ------------------------------------------------------------------\n // [1] Form — collects all oracle configuration\n // ------------------------------------------------------------------\n {\n id: 'oracle-form',\n type: 'form',\n props: {\n title: 'Oracle Configuration',\n description: 'Enter the details for your new oracle.',\n icon: 'checklist',\n surveySchema: JSON.stringify(oracleInitSurveySchema),\n },\n },\n\n // ------------------------------------------------------------------\n // [2] Skills — skill/MCP configuration\n // ------------------------------------------------------------------\n {\n id: 'oracle-skills',\n type: 'skills',\n props: {\n title: 'Oracle Skills & MCP Servers',\n description: 'Configure skills and MCP servers for the oracle.',\n icon: 'tools',\n skills: '[]',\n entityDid: '',\n mcpServers: '[]',\n status: 'pending',\n },\n activationCondition: {\n upstreamNodeId: 'oracle-form',\n requiredStatus: 'approved',\n },\n },\n\n // ------------------------------------------------------------------\n // [3] Action — Generate & Fund Wallet\n // Generates a new wallet and funds it in one step.\n // ------------------------------------------------------------------\n {\n id: 'oracle-wallet',\n type: 'action',\n props: {\n title: 'Generate & Fund Wallet',\n description: 'Generate a new IXO wallet and fund it with tokens.',\n icon: 'bolt',\n actionType: 'qi/wallet.generateAndFund',\n inputs: JSON.stringify({}),\n requiresConfirmation: '',\n },\n activationCondition: {\n upstreamNodeId: 'oracle-skills',\n requiredStatus: 'approved',\n },\n },\n\n // ------------------------------------------------------------------\n // [4] Action — Create Identity (IID + Matrix)\n // Creates the on-chain IID document, then registers the Matrix account.\n // ------------------------------------------------------------------\n {\n id: 'oracle-identity',\n type: 'action',\n props: {\n title: 'Create Identity',\n description: 'Create on-chain DID document and register Matrix account.',\n icon: 'bolt',\n actionType: 'qi/identity.create',\n inputs: JSON.stringify({\n mnemonic: '{{oracle-wallet.output.mnemonic}}',\n did: '{{oracle-wallet.output.did}}',\n address: '{{oracle-wallet.output.address}}',\n pubKey: '{{oracle-wallet.output.pubKey}}',\n formAnswers: '{{oracle-form.output.form.answers}}',\n }),\n requiresConfirmation: '',\n },\n activationCondition: {\n upstreamNodeId: 'oracle-wallet',\n requiredStatus: 'approved',\n },\n },\n\n // ------------------------------------------------------------------\n // [5] Action — Create Oracle Entity\n // On-chain entity creation with P-256 encryption key.\n // ------------------------------------------------------------------\n {\n id: 'oracle-entity-create',\n type: 'action',\n props: {\n title: 'Create Oracle Entity',\n description: 'Create the oracle entity on the IXO network.',\n icon: 'bolt',\n actionType: 'qi/entity.createOracle',\n inputs: JSON.stringify({\n // Wallet outputs\n mnemonic: '{{oracle-wallet.output.mnemonic}}',\n address: '{{oracle-wallet.output.address}}',\n did: '{{oracle-wallet.output.did}}',\n pubKey: '{{oracle-wallet.output.pubKey}}',\n // Matrix outputs (from identity block)\n matrixAccessToken: '{{oracle-identity.output.matrixAccessToken}}',\n matrixRoomId: '{{oracle-identity.output.matrixRoomId}}',\n // Form outputs — whole blob, action parses & destructures\n formAnswers: '{{oracle-form.output.form.answers}}',\n }),\n requiresConfirmation: '',\n },\n activationCondition: {\n upstreamNodeId: 'oracle-identity',\n requiredStatus: 'approved',\n },\n },\n\n // ------------------------------------------------------------------\n // [6] Action — Configure Oracle (contract + secrets + config)\n // Creates the user↔oracle DM room, encrypts secrets, stores config.\n // ------------------------------------------------------------------\n {\n id: 'oracle-configure',\n type: 'action',\n props: {\n title: 'Configure Oracle',\n description: 'Contract oracle, encrypt secrets, and store configuration.',\n icon: 'bolt',\n actionType: 'qi/oracle.configureOracle',\n inputs: JSON.stringify({\n // Contract input\n oracleEntityDid: '{{oracle-entity-create.output.entityDid}}',\n // Secrets routing (matrixRoomId comes from contract phase, not inputs)\n publicKeyMultibase: '{{oracle-entity-create.output.encryptionPublicKeyMultibase}}',\n verificationMethodId: '{{oracle-entity-create.output.encryptionVerificationMethodId}}',\n // Fresh mxLogin params\n matrixHomeServerUrl: '{{oracle-identity.output.matrixHomeServerUrl}}',\n matrixUsername: '{{oracle-identity.output.matrixUserId}}',\n // Sensitive plaintext values\n mnemonic: '{{oracle-wallet.output.mnemonic}}',\n matrixPassword: '{{oracle-identity.output.matrixPassword}}',\n matrixRecoveryPhrase: '{{oracle-identity.output.matrixRecoveryPhrase}}',\n // MCP auth secrets (already JWE-encrypted by skills block FlowDetail)\n mcpAuthSecrets: '{{oracle-skills.output.mcpAuthSecrets}}',\n // Skills outputs\n skills: '{{oracle-skills.output.skills}}',\n mcpServers: '{{oracle-skills.output.mcpServers}}',\n // Identifiers\n matrixUserId: '{{oracle-identity.output.matrixUserId}}',\n matrixAccountRoomId: '{{oracle-identity.output.matrixRoomId}}',\n entityDid: '{{oracle-entity-create.output.entityDid}}',\n oracleAddress: '{{oracle-wallet.output.address}}',\n oracleDid: '{{oracle-wallet.output.did}}',\n // Form outputs — whole blob, action parses & destructures\n formAnswers: '{{oracle-form.output.form.answers}}',\n }),\n requiresConfirmation: '',\n },\n activationCondition: {\n upstreamNodeId: 'oracle-entity-create',\n requiredStatus: 'approved',\n },\n },\n\n // ------------------------------------------------------------------\n // [7] Action — Deploy Oracle (setup + start)\n // Clones repo, writes config, builds, then starts the process.\n // ------------------------------------------------------------------\n {\n id: 'oracle-deploy',\n type: 'action',\n props: {\n title: 'Deploy Oracle',\n description: 'Set up environment and start the oracle process.',\n icon: 'bolt',\n actionType: 'qi/oracle.deploy',\n inputs: JSON.stringify({\n entityDid: '{{oracle-entity-create.output.entityDid}}',\n roomId: '{{oracle-configure.output.userOracleRoomId}}',\n skills: '{{oracle-skills.output.skills}}',\n mcpServers: '{{oracle-skills.output.mcpServers}}',\n mnemonic: '{{oracle-wallet.output.mnemonic}}',\n matrixPassword: '{{oracle-identity.output.matrixPassword}}',\n matrixRecoveryPhrase: '{{oracle-identity.output.matrixRecoveryPhrase}}',\n matrixUsername: '{{oracle-identity.output.matrixUserId}}',\n matrixAccountRoomId: '{{oracle-identity.output.matrixRoomId}}',\n freshAccessToken: '{{oracle-configure.output.freshAccessToken}}',\n openRouterApiKey: '{{oracle-configure.output.openRouterApiKeyPlaintext}}',\n // Form outputs — whole blob, action parses & destructures\n formAnswers: '{{oracle-form.output.form.answers}}',\n }),\n requiresConfirmation: '',\n },\n activationCondition: {\n upstreamNodeId: 'oracle-configure',\n requiredStatus: 'approved',\n },\n },\n\n // ------------------------------------------------------------------\n // [8] Secrets — display credentials and download\n // ------------------------------------------------------------------\n {\n id: 'oracle-secrets',\n type: 'secrets',\n props: {\n title: 'Oracle Credentials',\n description: 'Download your oracle credentials after setup is complete.',\n icon: 'key',\n downloadEndpoint: '',\n entityDid: '{{oracle-entity-create.output.entityDid}}',\n },\n activationCondition: {\n upstreamNodeId: 'oracle-deploy',\n requiredStatus: 'approved',\n },\n },\n ];\n\n return { metadata, nodes };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOO,IAAM,yBAAyB;AAAA,EACpC,OAAO;AAAA,EACP,aAAa;AAAA,EACb,cAAc;AAAA,EACd,OAAO;AAAA,IACL;AAAA,MACE,MAAM;AAAA,MACN,OAAO;AAAA,MACP,UAAU;AAAA,QACR;AAAA,UACE,MAAM;AAAA,UACN,MAAM;AAAA,UACN,OAAO;AAAA,UACP,aAAa;AAAA,UACb,YAAY;AAAA,UACZ,YAAY;AAAA,YACV;AAAA,cACE,MAAM;AAAA,cACN,MAAM;AAAA,c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MACJ,MAAM;AAAA,MACN,OAAO;AAAA,QACL,OAAO;AAAA,QACP,aAAa;AAAA,QACb,MAAM;AAAA,QACN,YAAY;AAAA,QACZ,QAAQ,KAAK,UAAU;AAAA,UACrB,WAAW;AAAA,UACX,QAAQ;AAAA,UACR,QAAQ;AAAA,UACR,YAAY;AAAA,UACZ,UAAU;AAAA,UACV,gBAAgB;AAAA,UAChB,sBAAsB;AAAA,UACtB,gBAAgB;AAAA,UAChB,qBAAqB;AAAA,UACrB,kBAAkB;AAAA,UAClB,kBAAkB;AAAA;AAAA,UAElB,aAAa;AAAA,QACf,CAAC;AAAA,QACD,sBAAsB;AAAA,MACxB;AAAA,MACA,qBAAqB;AAAA,QACnB,gBAAgB;AAAA,QAChB,gBAAgB;AAAA,MAClB;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA,MACE,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,QACL,OAAO;AAAA,QACP,aAAa;AAAA,QACb,MAAM;AAAA,QACN,kBAAkB;AAAA,QAClB,WAAW;AAAA,MACb;AAAA,MACA,qBAAqB;AAAA,QACnB,gBAAgB;AAAA,QAChB,gBAAgB;AAAA,MAClB;AAAA,IACF;AAAA,EACF;AAEA,SAAO,EAAE,UAAU,MAAM;AAC3B;","names":[]}
1
+ {"version":3,"sources":["../../src/core/templates/oracleInitFlow.ts"],"sourcesContent":["import type { FlowMetadata } from '../types/editor';\nimport type { FlowNode } from '../types/authorization';\n\n// ---------------------------------------------------------------------------\n// SurveyJS schema for the oracle configuration form\n// ---------------------------------------------------------------------------\n\nexport const oracleInitSurveySchema = {\n title: 'Oracle Configuration',\n description: 'Provide the details needed to initialise a new oracle on the IXO network.',\n logoPosition: 'right',\n pages: [\n {\n name: 'basicInfo',\n title: 'Basic Information',\n elements: [\n {\n type: 'text',\n name: 'projectName',\n title: 'Project Name',\n description: 'Used as the folder name — no spaces or special characters.',\n isRequired: true,\n validators: [\n {\n type: 'regex',\n text: 'Only lowercase letters, numbers, and hyphens are allowed (no spaces or special characters).',\n regex: '^[a-z0-9]+(-[a-z0-9]+)*$',\n },\n ],\n },\n {\n type: 'text',\n name: 'pin',\n title: 'PIN',\n description: 'A 6-digit PIN used to secure wallet operations.',\n isRequired: true,\n inputType: 'password',\n maxLength: 6,\n validators: [\n {\n type: 'regex',\n text: 'PIN must be exactly 6 digits.',\n regex: '^\\\\d{6}$',\n },\n ],\n },\n ],\n },\n {\n name: 'oracleDetails',\n title: 'Oracle Details',\n elements: [\n {\n type: 'text',\n name: 'oracleName',\n title: 'Oracle Name',\n isRequired: true,\n },\n {\n type: 'text',\n name: 'orgName',\n title: 'Organisation Name',\n isRequired: true,\n },\n {\n type: 'comment',\n name: 'description',\n title: 'Description',\n isRequired: true,\n },\n {\n type: 'text',\n name: 'location',\n title: 'Location',\n isRequired: true,\n },\n {\n type: 'text',\n name: 'logoUrl',\n title: 'Logo URL',\n isRequired: true,\n inputType: 'url',\n validators: [{ type: 'url' }],\n },\n {\n type: 'text',\n name: 'coverImageUrl',\n title: 'Cover Image URL',\n isRequired: true,\n inputType: 'url',\n validators: [{ type: 'url' }],\n },\n ],\n },\n {\n name: 'serviceConfig',\n title: 'Service Configuration',\n elements: [\n {\n type: 'text',\n name: 'apiUrl',\n title: 'API URL',\n isRequired: true,\n inputType: 'url',\n defaultValue: 'http://localhost:4000',\n validators: [{ type: 'url' }],\n },\n {\n type: 'text',\n name: 'price',\n title: 'Price',\n description: 'Service price in IXO tokens (minimum 1).',\n isRequired: true,\n inputType: 'number',\n defaultValue: 100,\n validators: [\n {\n type: 'numeric',\n text: 'Price must be at least 1.',\n minValue: 1,\n },\n ],\n },\n {\n type: 'dropdown',\n name: 'llmModel',\n title: 'LLM Model',\n isRequired: true,\n choices: [\n { value: 'kimi-k2.5', text: 'Kimi K2.5' },\n { value: 'claude-sonnet', text: 'Claude Sonnet' },\n { value: 'gpt-4o', text: 'GPT-4o' },\n { value: 'gemini-2.5', text: 'Gemini 2.5' },\n { value: 'llama-4', text: 'Llama 4' },\n { value: 'custom', text: 'Custom' },\n ],\n },\n {\n type: 'comment',\n name: 'opening',\n title: 'Opening Message',\n description: 'The greeting or introduction the agent uses when starting a conversation.',\n isRequired: false,\n },\n {\n type: 'comment',\n name: 'communicationStyle',\n title: 'Communication Style',\n description: 'How the agent should communicate (e.g. formal, friendly, concise).',\n isRequired: false,\n },\n {\n type: 'comment',\n name: 'capabilities',\n title: 'What can the agent do?',\n description: 'Describe what this agent is capable of doing for users.',\n isRequired: false,\n },\n ],\n },\n ],\n};\n\n// ---------------------------------------------------------------------------\n// Template generator\n// ---------------------------------------------------------------------------\n\nexport function createOracleInitFlowTemplate(): {\n metadata: FlowMetadata;\n nodes: FlowNode[];\n} {\n const metadata: FlowMetadata = {\n '@context': 'https://schema.ixo.world/flow/v1',\n _type: 'flow/oracle-init',\n schema_version: '1.0.0',\n doc_id: '',\n title: 'Oracle Init Flow',\n createdAt: new Date().toISOString(),\n createdBy: '',\n flowOwnerDid: '',\n };\n\n const nodes: FlowNode[] = [\n // ------------------------------------------------------------------\n // [1] Form — collects all oracle configuration\n // ------------------------------------------------------------------\n {\n id: 'oracle-form',\n type: 'form',\n props: {\n title: 'Oracle Configuration',\n description: 'Enter the details for your new oracle.',\n icon: 'checklist',\n surveySchema: JSON.stringify(oracleInitSurveySchema),\n },\n },\n\n // ------------------------------------------------------------------\n // [2] Skills — skill/MCP configuration\n // ------------------------------------------------------------------\n {\n id: 'oracle-skills',\n type: 'skills',\n props: {\n title: 'Oracle Skills & MCP Servers',\n description: 'Configure skills and MCP servers for the oracle.',\n icon: 'tools',\n skills: '[]',\n entityDid: '',\n mcpServers: '[]',\n status: 'pending',\n },\n activationCondition: {\n upstreamNodeId: 'oracle-form',\n requiredStatus: 'approved',\n },\n },\n\n // ------------------------------------------------------------------\n // [3] Action — Generate & Fund Wallet\n // Generates a new wallet and funds it in one step.\n // ------------------------------------------------------------------\n {\n id: 'oracle-wallet',\n type: 'action',\n props: {\n title: 'Generate & Fund Wallet',\n description: 'Generate a new IXO wallet and fund it with tokens.',\n icon: 'bolt',\n actionType: 'qi/wallet.generateAndFund',\n inputs: JSON.stringify({}),\n requiresConfirmation: '',\n },\n activationCondition: {\n upstreamNodeId: 'oracle-skills',\n requiredStatus: 'approved',\n },\n },\n\n // ------------------------------------------------------------------\n // [4] Action — Create Identity (IID + Matrix)\n // Creates the on-chain IID document, then registers the Matrix account.\n // ------------------------------------------------------------------\n {\n id: 'oracle-identity',\n type: 'action',\n props: {\n title: 'Create Identity',\n description: 'Create on-chain DID document and register Matrix account.',\n icon: 'bolt',\n actionType: 'qi/identity.create',\n inputs: JSON.stringify({\n mnemonic: '{{oracle-wallet.output.mnemonic}}',\n did: '{{oracle-wallet.output.did}}',\n address: '{{oracle-wallet.output.address}}',\n pubKey: '{{oracle-wallet.output.pubKey}}',\n formAnswers: '{{oracle-form.output.form.answers}}',\n }),\n requiresConfirmation: '',\n },\n activationCondition: {\n upstreamNodeId: 'oracle-wallet',\n requiredStatus: 'approved',\n },\n },\n\n // ------------------------------------------------------------------\n // [5] Action — Create Oracle Entity\n // On-chain entity creation with P-256 encryption key.\n // ------------------------------------------------------------------\n {\n id: 'oracle-entity-create',\n type: 'action',\n props: {\n title: 'Create Oracle Entity',\n description: 'Create the oracle entity on the IXO network.',\n icon: 'bolt',\n actionType: 'qi/entity.createOracle',\n inputs: JSON.stringify({\n // Wallet outputs\n mnemonic: '{{oracle-wallet.output.mnemonic}}',\n address: '{{oracle-wallet.output.address}}',\n did: '{{oracle-wallet.output.did}}',\n pubKey: '{{oracle-wallet.output.pubKey}}',\n // Matrix outputs (from identity block)\n matrixAccessToken: '{{oracle-identity.output.matrixAccessToken}}',\n matrixRoomId: '{{oracle-identity.output.matrixRoomId}}',\n // Form outputs — whole blob, action parses & destructures\n formAnswers: '{{oracle-form.output.form.answers}}',\n }),\n requiresConfirmation: '',\n },\n activationCondition: {\n upstreamNodeId: 'oracle-identity',\n requiredStatus: 'approved',\n },\n },\n\n // ------------------------------------------------------------------\n // [6] Action — Configure Oracle (contract + secrets + config)\n // Creates the user↔oracle DM room, encrypts secrets, stores config.\n // ------------------------------------------------------------------\n {\n id: 'oracle-configure',\n type: 'action',\n props: {\n title: 'Configure Oracle',\n description: 'Contract oracle, encrypt secrets, and store configuration.',\n icon: 'bolt',\n actionType: 'qi/oracle.configureOracle',\n inputs: JSON.stringify({\n // Contract input\n oracleEntityDid: '{{oracle-entity-create.output.entityDid}}',\n // Secrets routing (matrixRoomId comes from contract phase, not inputs)\n publicKeyMultibase: '{{oracle-entity-create.output.encryptionPublicKeyMultibase}}',\n verificationMethodId: '{{oracle-entity-create.output.encryptionVerificationMethodId}}',\n // Fresh mxLogin params\n matrixHomeServerUrl: '{{oracle-identity.output.matrixHomeServerUrl}}',\n matrixUsername: '{{oracle-identity.output.matrixUserId}}',\n // Sensitive plaintext values\n mnemonic: '{{oracle-wallet.output.mnemonic}}',\n matrixPassword: '{{oracle-identity.output.matrixPassword}}',\n matrixRecoveryPhrase: '{{oracle-identity.output.matrixRecoveryPhrase}}',\n // MCP auth secrets (already JWE-encrypted by skills block FlowDetail)\n mcpAuthSecrets: '{{oracle-skills.output.mcpAuthSecrets}}',\n // Skills outputs\n skills: '{{oracle-skills.output.skills}}',\n mcpServers: '{{oracle-skills.output.mcpServers}}',\n // Identifiers\n matrixUserId: '{{oracle-identity.output.matrixUserId}}',\n matrixAccountRoomId: '{{oracle-identity.output.matrixRoomId}}',\n entityDid: '{{oracle-entity-create.output.entityDid}}',\n oracleAddress: '{{oracle-wallet.output.address}}',\n oracleDid: '{{oracle-wallet.output.did}}',\n // Form outputs — whole blob, action parses & destructures\n formAnswers: '{{oracle-form.output.form.answers}}',\n }),\n requiresConfirmation: '',\n },\n activationCondition: {\n upstreamNodeId: 'oracle-entity-create',\n requiredStatus: 'approved',\n },\n },\n\n // ------------------------------------------------------------------\n // [7] Action — Deploy Oracle (setup + start)\n // Clones repo, writes config, builds, then starts the process.\n // ------------------------------------------------------------------\n {\n id: 'oracle-deploy',\n type: 'action',\n props: {\n title: 'Deploy Oracle',\n description: 'Set up environment and start the oracle process.',\n icon: 'bolt',\n actionType: 'qi/oracle.deploy',\n inputs: JSON.stringify({\n entityDid: '{{oracle-entity-create.output.entityDid}}',\n roomId: '{{oracle-configure.output.userOracleRoomId}}',\n skills: '{{oracle-skills.output.skills}}',\n mcpServers: '{{oracle-skills.output.mcpServers}}',\n mnemonic: '{{oracle-wallet.output.mnemonic}}',\n matrixPassword: '{{oracle-identity.output.matrixPassword}}',\n matrixRecoveryPhrase: '{{oracle-identity.output.matrixRecoveryPhrase}}',\n matrixUsername: '{{oracle-identity.output.matrixUserId}}',\n matrixAccountRoomId: '{{oracle-identity.output.matrixRoomId}}',\n freshAccessToken: '{{oracle-configure.output.freshAccessToken}}',\n openRouterApiKey: '{{oracle-configure.output.openRouterApiKeyPlaintext}}',\n // Form outputs — whole blob, action parses & destructures\n formAnswers: '{{oracle-form.output.form.answers}}',\n }),\n requiresConfirmation: '',\n },\n activationCondition: {\n upstreamNodeId: 'oracle-configure',\n requiredStatus: 'approved',\n },\n },\n\n // ------------------------------------------------------------------\n // [8] Secrets — display credentials and download\n // ------------------------------------------------------------------\n {\n id: 'oracle-secrets',\n type: 'secrets',\n props: {\n title: 'Oracle Credentials',\n description: 'Download your oracle credentials after setup is complete.',\n icon: 'key',\n downloadEndpoint: '',\n entityDid: '{{oracle-entity-create.output.entityDid}}',\n },\n activationCondition: {\n upstreamNodeId: 'oracle-deploy',\n requiredStatus: 'approved',\n },\n },\n ];\n\n return { metadata, nodes };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOO,IAAM,yBAAyB;AAAA,EACpC,OAAO;AAAA,EACP,aAAa;AAAA,EACb,cAAc;AAAA,EACd,OAAO;AAAA,IACL;AAAA,MACE,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A,UAEX,aAAa;AAAA,QACf,CAAC;AAAA,QACD,sBAAsB;AAAA,MACxB;AAAA,MACA,qBAAqB;AAAA,QACnB,gBAAgB;AAAA,QAChB,gBAAgB;AAAA,MAClB;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA;AAAA,MACE,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,QACL,OAAO;AAAA,QACP,aAAa;AAAA,QACb,MAAM;AAAA,QACN,YAAY;AAAA,QACZ,QAAQ,KAAK,UAAU;AAAA,UACrB,WAAW;AAAA,UACX,QAAQ;AAAA,UACR,QAAQ;AAAA,UACR,YAAY;AAAA,UACZ,UAAU;AAAA,UACV,gBAAgB;AAAA,UAChB,sBAAsB;AAAA,UACtB,gBAAgB;AAAA,UAChB,qBAAqB;AAAA,UACrB,kBAAkB;AAAA,UAClB,kBAAkB;AAAA;AAAA,UAElB,aAAa;AAAA,QACf,CAAC;AAAA,QACD,sBAAsB;AAAA,MACxB;AAAA,MACA,qBAAqB;AAAA,QACnB,gBAAgB;AAAA,QAChB,gBAAgB;AAAA,MAClB;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA,MACE,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,QACL,OAAO;AAAA,QACP,aAAa;AAAA,QACb,MAAM;AAAA,QACN,kBAAkB;AAAA,QAClB,WAAW;AAAA,MACb;AAAA,MACA,qBAAqB;AAAA,QACnB,gBAAgB;AAAA,QAChB,gBAAgB;AAAA,MAClB;AAAA,IACF;AAAA,EACF;AAEA,SAAO,EAAE,UAAU,MAAM;AAC3B;","names":[]}
@@ -1,7 +1,8 @@
1
1
  import * as _blocknote_core from '@blocknote/core';
2
- import { ao as IxoBlockProps, l as IxoEditorOptions, a4 as IxoEditorType, p as IxoCollaborativeEditorOptions, w as BlocknoteHandlers, y as BlockRequirements, av as UnlMapConfig, ar as DynamicListDataProvider, as as DynamicListPanelRenderer, at as DomainCardRenderer, a3 as Translate, k as DelegationGrant } from './index-DUqLNz0c.mjs';
2
+ import { ao as IxoBlockProps, l as IxoEditorOptions, a4 as IxoEditorType, p as IxoCollaborativeEditorOptions, w as BlocknoteHandlers, y as BlockRequirements, av as UnlMapConfig, ar as DynamicListDataProvider, as as DynamicListPanelRenderer, at as DomainCardRenderer, a3 as Translate, k as DelegationGrant } from './index-1drTq85A.mjs';
3
3
  import { Text, Doc, Map, Array as Array$1 } from 'yjs';
4
4
  import React__default from 'react';
5
+ import * as _tiptap_core from '@tiptap/core';
5
6
 
6
7
  declare const CheckboxBlockSpec: {
7
8
  config: {
@@ -500,6 +501,9 @@ interface IxoEditorProps {
500
501
  getDynamicListData?: DynamicListDataProvider;
501
502
  dynamicListPanelRenderer?: DynamicListPanelRenderer;
502
503
  domainCardRenderer?: DomainCardRenderer;
504
+ /** Called when an inline flow-step reference chip (`@`-mention of an action
505
+ * block) is clicked, with the referenced node id. The host opens that step. */
506
+ onFlowStepRefClick?: (nodeId: string) => void;
503
507
  /** Callback when external content is dropped into the editor (receives position only) */
504
508
  onExternalDrop?: (position: DropPosition) => void;
505
509
  /** MIME type to accept for external drops (default: 'application/x-artifact') */
@@ -525,7 +529,7 @@ interface IxoEditorProps {
525
529
  /**
526
530
  * IxoEditor component - A customized BlockNote editor for IXO (Mantine UI)
527
531
  */
528
- declare function IxoEditor({ editor, editable, className, onChange, onSelectionChange, children, mantineTheme: _mantineTheme, handlers, blockRequirements, isPanelVisible, coverImageUrl, logoUrl, visualizationRenderer, getDynamicListData, dynamicListPanelRenderer, domainCardRenderer, onExternalDrop, externalDropType, dropIndicator, isPlacementMode, onPlacementCancel, mapConfig, connectedUsers, awarenessInstance, belowTitleSlot, translate, }: IxoEditorProps): React__default.ReactElement | null;
532
+ declare function IxoEditor({ editor, editable, className, onChange, onSelectionChange, children, mantineTheme: _mantineTheme, handlers, blockRequirements, isPanelVisible, coverImageUrl, logoUrl, visualizationRenderer, getDynamicListData, dynamicListPanelRenderer, domainCardRenderer, onFlowStepRefClick, onExternalDrop, externalDropType, dropIndicator, isPlacementMode, onPlacementCancel, mapConfig, connectedUsers, awarenessInstance, belowTitleSlot, translate, }: IxoEditorProps): React__default.ReactElement | null;
529
533
 
530
534
  interface CoverImageProps {
531
535
  coverImageUrl?: string;
@@ -609,6 +613,55 @@ interface GrantPermissionModalProps {
609
613
  }
610
614
  declare const GrantPermissionModal: React__default.FC<GrantPermissionModalProps>;
611
615
 
616
+ declare const FlowStepRefSpec: {
617
+ config: {
618
+ type: "flowStepRef";
619
+ propSchema: {
620
+ nodeId: {
621
+ default: string;
622
+ };
623
+ label: {
624
+ default: string;
625
+ };
626
+ };
627
+ content: "none";
628
+ };
629
+ implementation: {
630
+ node: _tiptap_core.Node;
631
+ };
632
+ };
633
+ interface FlowStepRefProps {
634
+ /** The referenced action block's node id. */
635
+ nodeId: string;
636
+ /** Cached display title, resolved from the action's title at insert time. */
637
+ label: string;
638
+ }
639
+
640
+ /**
641
+ * Aggregate of IXO custom inline content specs, spread into the editor schema
642
+ * alongside BlockNote's `defaultInlineContentSpecs` (text/link). Mirrors how
643
+ * `blockSpecs` aggregates custom block specs.
644
+ */
645
+ declare const inlineContentSpecs: {
646
+ flowStepRef: {
647
+ config: {
648
+ type: "flowStepRef";
649
+ propSchema: {
650
+ nodeId: {
651
+ default: string;
652
+ };
653
+ label: {
654
+ default: string;
655
+ };
656
+ };
657
+ content: "none";
658
+ };
659
+ implementation: {
660
+ node: _tiptap_core.Node;
661
+ };
662
+ };
663
+ };
664
+
612
665
  interface BlockPresenceUser {
613
666
  clientId: string;
614
667
  name: string;
@@ -693,4 +746,4 @@ declare class GraphQLClient {
693
746
  }
694
747
  declare const ixoGraphQLClient: GraphQLClient;
695
748
 
696
- export { AuthorizationTab as A, type BlockPresenceUser as B, CoverImage as C, DevUcanGrantButton as D, EvaluationTab as E, FlowPermissionsPanel as F, GrantPermissionModal as G, type HttpMethod as H, IxoEditor as I, type DropPosition as J, type KeyValuePair as K, ListBlockSpec as L, OverviewBlock as O, ProposalBlockSpec as P, useCreateCollaborativeIxoEditor as a, type IxoEditorProps as b, type CoverImageProps as c, type AuthorizationTabState as d, type EvaluationTabState as e, EntitySigningSetup as f, CheckboxBlockSpec as g, ApiRequestBlockSpec as h, type CheckboxBlockProps as i, type ListBlockSettings as j, type ListBlockProps as k, type OverviewBlockProps as l, type ProposalBlockProps as m, type ApiRequestBlockProps as n, useBlockPresence as o, useTrackBlockFocus as p, getEntity as q, type Entity as r, type EntityResponse as s, type EntityVariables as t, useCreateIxoEditor as u, GraphQLClient as v, ixoGraphQLClient as w, type GraphQLResponse as x, type GraphQLRequest as y, ExternalDropZone as z };
749
+ export { AuthorizationTab as A, type BlockPresenceUser as B, CoverImage as C, DevUcanGrantButton as D, EvaluationTab as E, FlowPermissionsPanel as F, GrantPermissionModal as G, type HttpMethod as H, IxoEditor as I, type GraphQLResponse as J, type KeyValuePair as K, ListBlockSpec as L, type GraphQLRequest as M, ExternalDropZone as N, OverviewBlock as O, ProposalBlockSpec as P, type DropPosition as Q, useCreateCollaborativeIxoEditor as a, type IxoEditorProps as b, type CoverImageProps as c, type AuthorizationTabState as d, type EvaluationTabState as e, EntitySigningSetup as f, CheckboxBlockSpec as g, ApiRequestBlockSpec as h, type CheckboxBlockProps as i, type ListBlockSettings as j, type ListBlockProps as k, FlowStepRefSpec as l, inlineContentSpecs as m, type FlowStepRefProps as n, type OverviewBlockProps as o, type ProposalBlockProps as p, type ApiRequestBlockProps as q, useBlockPresence as r, useTrackBlockFocus as s, getEntity as t, useCreateIxoEditor as u, type Entity as v, type EntityResponse as w, type EntityVariables as x, GraphQLClient as y, ixoGraphQLClient as z };
@@ -2679,6 +2679,9 @@ interface BlocknoteContextValue {
2679
2679
  getDynamicListData?: DynamicListDataProvider;
2680
2680
  dynamicListPanelRenderer?: DynamicListPanelRenderer;
2681
2681
  domainCardRenderer?: DomainCardRenderer;
2682
+ /** Called when an inline flow-step reference chip is clicked, with the
2683
+ * referenced action block's node id. The host opens that step. */
2684
+ onFlowStepRefClick?: (nodeId: string) => void;
2682
2685
  connectedUsers?: Array<{
2683
2686
  clientId: string;
2684
2687
  state: any;
@@ -2696,6 +2699,7 @@ declare const BlocknoteProvider: React__default.FC<{
2696
2699
  getDynamicListData?: DynamicListDataProvider;
2697
2700
  dynamicListPanelRenderer?: DynamicListPanelRenderer;
2698
2701
  domainCardRenderer?: DomainCardRenderer;
2702
+ onFlowStepRefClick?: (nodeId: string) => void;
2699
2703
  mapConfig?: UnlMapConfig;
2700
2704
  connectedUsers?: Array<{
2701
2705
  clientId: string;
package/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- export { n as ApiRequestBlockProps, h as ApiRequestBlockSpec, A as AuthorizationTab, d as AuthorizationTabState, B as BlockPresenceUser, i as CheckboxBlockProps, g as CheckboxBlockSpec, C as CoverImage, c as CoverImageProps, D as DevUcanGrantButton, r as Entity, s as EntityResponse, f as EntitySigningSetup, t as EntityVariables, E as EvaluationTab, e as EvaluationTabState, F as FlowPermissionsPanel, G as GrantPermissionModal, v as GraphQLClient, y as GraphQLRequest, x as GraphQLResponse, H as HttpMethod, I as IxoEditor, b as IxoEditorProps, K as KeyValuePair, k as ListBlockProps, j as ListBlockSettings, L as ListBlockSpec, O as OverviewBlock, l as OverviewBlockProps, m as ProposalBlockProps, P as ProposalBlockSpec, q as getEntity, w as ixoGraphQLClient, o as useBlockPresence, a as useCreateCollaborativeIxoEditor, u as useCreateIxoEditor, p as useTrackBlockFocus } from './graphql-client-DsWWkro-.mjs';
2
- export { A as AuthorizationResult, B as BaseUcanFlow, X as BuildFlowAgentContextParams, v as CompiledFlow, C as CompilerRegistry, E as ExecuteNodeParams, f as ExecutionContext, d as ExecutionOutcome, Y as FlowAgentActor, Z as FlowAgentCommand, _ as FlowAgentCommandResult, $ as FlowAgentContext, a0 as FlowAgentExecutor, a1 as FlowAgentLease, a2 as FlowAgentNodeSnapshot, a3 as FlowAgentPublicNodeState, x as FlowAgentService, a4 as FlowAgentTickResult, u as FlowCapability, F as FlowRuntimeStateManager, w as FlowStrategy, M as MergeResult, N as NodeActionResult, R as ReadFlowOptions, q as ReadFlowResult, t as ReadableEditor, S as SetupFlowOptions, p as SetupFlowResult, y as acquireFlowAgentLease, z as appendAgentLedgerEvent, a as buildAuthzFromProps, D as buildFlowAgentContext, b as buildFlowNodeFromBlock, G as cleanupExpiredFlowAgentLeases, l as compileBaseUcanFlow, H as createAgentCommand, c as createRuntimeStateManager, o as decompileToBaseUcanFlow, I as evaluateFlowAgentPolicy, e as executeNode, J as executeQueuedAgentCommands, k as getActiveEditor, K as getFlowAgentMaps, i as isAuthorized, n as mergeCompiledFlows, L as planRalphLoopCommands, O as queueAgentCommand, P as readAgentLedgerEvents, m as readCompiledFlowFromYDoc, h as readFlow, r as readFlowAsBaseUcan, g as readFlowFromEditor, Q as readQueuedAgentCommands, T as releaseFlowAgentLease, j as setActiveEditor, s as setupFlowFromBaseUcan, U as tickFlowAgent, V as validateAgentCommand, W as validateFlowAgentLease } from './store-C2NG2nTB.mjs';
3
- export { H as Addr, A as AuthzExecActionTypes, y as BlockRequirements, x as BlocknoteContextValue, w as BlocknoteHandlers, B as BlocknoteProvider, O as CosmosMsgForEmpty, D as DelegationChainValidationResult, k as DelegationGrant, K as Expiration, Z as ImportProtocolTemplateResult, Y as ImportProtocolTemplatesToSpaceParams, I as InvocationStore, p as IxoCollaborativeEditorOptions, o as IxoCollaborativeUser, n as IxoEditorConfig, l as IxoEditorOptions, m as IxoEditorTheme, R as ListProtocolDeedsWithTemplatesParams, _ as MatrixPrivacySettings, $ as MatrixRoom, a0 as MatrixSpace, a2 as MatrixSpaceStructure, a1 as MatrixSubspace, Q as ProposalAction, P as ProposalResponse, W as ProtocolDeedWithTemplates, X as ProtocolTemplateSummary, z as SingleChoiceProposal, v as StakeType, v as StakeTypeValue, L as Status, S as StoredDelegation, j as StoredInvocation, M as Threshold, T as Timestamp, a3 as Translate, i as UcanCapability, U as UcanDelegationStore, f as UcanService, g as UcanServiceConfig, h as UcanServiceHandlers, J as Uint128, G as User, V as ValidatorActionType, F as Vote, E as VoteInfo, C as VoteResponse, N as Votes, q as blockSpecs, b as createInvocationStore, d as createMemoryInvocationStore, a as createMemoryUcanDelegationStore, c as createUcanDelegationStore, e as createUcanService, r as getExtraSlashMenuItems, u as useBlocknoteContext, s as useBlocknoteHandlers, t as useTranslate } from './index-DUqLNz0c.mjs';
1
+ export { q as ApiRequestBlockProps, h as ApiRequestBlockSpec, A as AuthorizationTab, d as AuthorizationTabState, B as BlockPresenceUser, i as CheckboxBlockProps, g as CheckboxBlockSpec, C as CoverImage, c as CoverImageProps, D as DevUcanGrantButton, v as Entity, w as EntityResponse, f as EntitySigningSetup, x as EntityVariables, E as EvaluationTab, e as EvaluationTabState, F as FlowPermissionsPanel, n as FlowStepRefProps, l as FlowStepRefSpec, G as GrantPermissionModal, y as GraphQLClient, M as GraphQLRequest, J as GraphQLResponse, H as HttpMethod, I as IxoEditor, b as IxoEditorProps, K as KeyValuePair, k as ListBlockProps, j as ListBlockSettings, L as ListBlockSpec, O as OverviewBlock, o as OverviewBlockProps, p as ProposalBlockProps, P as ProposalBlockSpec, t as getEntity, m as inlineContentSpecs, z as ixoGraphQLClient, r as useBlockPresence, a as useCreateCollaborativeIxoEditor, u as useCreateIxoEditor, s as useTrackBlockFocus } from './graphql-client-7RPUfOZ7.mjs';
2
+ export { A as AuthorizationResult, B as BaseUcanFlow, X as BuildFlowAgentContextParams, v as CompiledFlow, C as CompilerRegistry, E as ExecuteNodeParams, f as ExecutionContext, d as ExecutionOutcome, Y as FlowAgentActor, Z as FlowAgentCommand, _ as FlowAgentCommandResult, $ as FlowAgentContext, a0 as FlowAgentExecutor, a1 as FlowAgentLease, a2 as FlowAgentNodeSnapshot, a3 as FlowAgentPublicNodeState, x as FlowAgentService, a4 as FlowAgentTickResult, u as FlowCapability, F as FlowRuntimeStateManager, w as FlowStrategy, M as MergeResult, N as NodeActionResult, R as ReadFlowOptions, q as ReadFlowResult, t as ReadableEditor, S as SetupFlowOptions, p as SetupFlowResult, y as acquireFlowAgentLease, z as appendAgentLedgerEvent, a as buildAuthzFromProps, D as buildFlowAgentContext, b as buildFlowNodeFromBlock, G as cleanupExpiredFlowAgentLeases, l as compileBaseUcanFlow, H as createAgentCommand, c as createRuntimeStateManager, o as decompileToBaseUcanFlow, I as evaluateFlowAgentPolicy, e as executeNode, J as executeQueuedAgentCommands, k as getActiveEditor, K as getFlowAgentMaps, i as isAuthorized, n as mergeCompiledFlows, L as planRalphLoopCommands, O as queueAgentCommand, P as readAgentLedgerEvents, m as readCompiledFlowFromYDoc, h as readFlow, r as readFlowAsBaseUcan, g as readFlowFromEditor, Q as readQueuedAgentCommands, T as releaseFlowAgentLease, j as setActiveEditor, s as setupFlowFromBaseUcan, U as tickFlowAgent, V as validateAgentCommand, W as validateFlowAgentLease } from './store-ChkNN7b4.mjs';
3
+ export { H as Addr, A as AuthzExecActionTypes, y as BlockRequirements, x as BlocknoteContextValue, w as BlocknoteHandlers, B as BlocknoteProvider, O as CosmosMsgForEmpty, D as DelegationChainValidationResult, k as DelegationGrant, K as Expiration, Z as ImportProtocolTemplateResult, Y as ImportProtocolTemplatesToSpaceParams, I as InvocationStore, p as IxoCollaborativeEditorOptions, o as IxoCollaborativeUser, n as IxoEditorConfig, l as IxoEditorOptions, m as IxoEditorTheme, R as ListProtocolDeedsWithTemplatesParams, _ as MatrixPrivacySettings, $ as MatrixRoom, a0 as MatrixSpace, a2 as MatrixSpaceStructure, a1 as MatrixSubspace, Q as ProposalAction, P as ProposalResponse, W as ProtocolDeedWithTemplates, X as ProtocolTemplateSummary, z as SingleChoiceProposal, v as StakeType, v as StakeTypeValue, L as Status, S as StoredDelegation, j as StoredInvocation, M as Threshold, T as Timestamp, a3 as Translate, i as UcanCapability, U as UcanDelegationStore, f as UcanService, g as UcanServiceConfig, h as UcanServiceHandlers, J as Uint128, G as User, V as ValidatorActionType, F as Vote, E as VoteInfo, C as VoteResponse, N as Votes, q as blockSpecs, b as createInvocationStore, d as createMemoryInvocationStore, a as createMemoryUcanDelegationStore, c as createUcanDelegationStore, e as createUcanService, r as getExtraSlashMenuItems, u as useBlocknoteContext, s as useBlocknoteHandlers, t as useTranslate } from './index-1drTq85A.mjs';
4
4
  export { Block, BlockNoteEditor, BlockNoteSchema, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, PartialBlock } from '@blocknote/core';
5
5
  export { CloneDocumentResult, cloneDocument } from '@ixo/matrix-crdt';
6
6
  import 'yjs';
7
7
  import 'react';
8
+ import '@tiptap/core';
8
9
  import 'matrix-js-sdk';
9
10
  import '@ixo/ucan';
package/dist/index.mjs CHANGED
@@ -9,6 +9,7 @@ import {
9
9
  EntitySigningSetup,
10
10
  EvaluationTab,
11
11
  FlowPermissionsPanel,
12
+ FlowStepRefSpec,
12
13
  GrantPermissionModal,
13
14
  GraphQLClient,
14
15
  IxoEditor,
@@ -20,6 +21,7 @@ import {
20
21
  blockSpecs,
21
22
  getEntity,
22
23
  getExtraSlashMenuItems,
24
+ inlineContentSpecs,
23
25
  ixoGraphQLClient,
24
26
  useBlockPresence,
25
27
  useBlocknoteContext,
@@ -28,8 +30,8 @@ import {
28
30
  useCreateIxoEditor,
29
31
  useTrackBlockFocus,
30
32
  useTranslate
31
- } from "./chunk-CDBCSQQA.mjs";
32
- import "./chunk-OXIWTOZ5.mjs";
33
+ } from "./chunk-MNPEDF2U.mjs";
34
+ import "./chunk-SBSTGR5L.mjs";
33
35
  import {
34
36
  FlowAgentService,
35
37
  acquireFlowAgentLease,
@@ -68,7 +70,7 @@ import {
68
70
  tickFlowAgent,
69
71
  validateAgentCommand,
70
72
  validateFlowAgentLease
71
- } from "./chunk-MCFRBVCB.mjs";
73
+ } from "./chunk-OOPKMGYW.mjs";
72
74
 
73
75
  // src/index.ts
74
76
  import { cloneDocument } from "@ixo/matrix-crdt";
@@ -84,6 +86,7 @@ export {
84
86
  EvaluationTab,
85
87
  FlowAgentService,
86
88
  FlowPermissionsPanel,
89
+ FlowStepRefSpec,
87
90
  GrantPermissionModal,
88
91
  GraphQLClient,
89
92
  IxoEditor,
@@ -116,6 +119,7 @@ export {
116
119
  getEntity,
117
120
  getExtraSlashMenuItems,
118
121
  getFlowAgentMaps,
122
+ inlineContentSpecs,
119
123
  isAuthorized,
120
124
  ixoGraphQLClient,
121
125
  mergeCompiledFlows,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Main exports for ixo-editor package\n// This exports the mantine version by default\n// For explicit mantine imports, use:\n// - import { ... } from \"@ixo/editor/mantine\"\n\n// Export the main hook (mantine version by default)\nexport { useCreateIxoEditor } from './mantine/hooks/useCreateIxoEditor';\nexport { useCreateCollaborativeIxoEditor } from './mantine/hooks/useCollaborativeIxoEditor';\n\n// Export the main component (mantine version by default)\nexport { IxoEditor, type IxoEditorProps } from './mantine/IxoEditor';\n\n// Export CoverImage component\nexport { CoverImage, type CoverImageProps } from './mantine/components/CoverImage';\nexport { DevUcanGrantButton } from './mantine/components/DevUcanGrantButton';\n\n// Export authorization components\nexport { AuthorizationTab, type AuthorizationTabState } from './mantine/components/AuthorizationTab';\nexport { EvaluationTab, type EvaluationTabState } from './mantine/components/EvaluationTab';\nexport { EntitySigningSetup } from './mantine/components/EntitySigningSetup';\nexport { FlowPermissionsPanel } from './mantine/components/FlowPermissionsPanel';\nexport { GrantPermissionModal } from './mantine/components/GrantPermissionModal';\n\n// Export flow engine\nexport {\n executeNode,\n isAuthorized,\n createRuntimeStateManager,\n buildFlowNodeFromBlock,\n buildAuthzFromProps,\n createUcanDelegationStore,\n createMemoryUcanDelegationStore,\n createInvocationStore,\n createMemoryInvocationStore,\n createUcanService,\n} from './core/lib/flowEngine';\nexport type {\n ExecuteNodeParams,\n ExecutionOutcome,\n NodeActionResult,\n ExecutionContext,\n AuthorizationResult,\n UcanDelegationStore,\n InvocationStore,\n UcanService,\n UcanServiceConfig,\n UcanServiceHandlers,\n FlowRuntimeStateManager,\n} from './core/lib/flowEngine';\n\n// Export UCAN types\nexport type { UcanCapability, StoredDelegation, StoredInvocation, DelegationChainValidationResult } from './core/types/ucan';\nexport type { DelegationGrant } from './core/types/capability';\n\n// Export types from core\nexport type { IxoEditorOptions, IxoEditorTheme, IxoEditorConfig, IxoCollaborativeUser, IxoCollaborativeEditorOptions } from './core/types';\n\n// Export custom blocks (mantine version by default)\nexport { CheckboxBlockSpec, ListBlockSpec, OverviewBlock, ProposalBlockSpec, ApiRequestBlockSpec, blockSpecs, getExtraSlashMenuItems } from './mantine/blocks';\nexport type { CheckboxBlockProps, ListBlockSettings, ListBlockProps } from './mantine/blocks';\nexport type { OverviewBlockProps } from './mantine/blocks';\nexport type { ProposalBlockProps } from './mantine/blocks';\nexport type { ApiRequestBlockProps, HttpMethod, KeyValuePair } from './mantine/blocks';\n\n// Export block presence hooks\nexport { useBlockPresence, type BlockPresenceUser } from './mantine/hooks/useBlockPresence';\nexport { useTrackBlockFocus } from './mantine/hooks/useTrackBlockFocus';\n\n// Export context and handlers\nexport { BlocknoteProvider, useBlocknoteContext, useBlocknoteHandlers, useTranslate, StakeType, AuthzExecActionTypes, ValidatorActionType } from './mantine/context';\nexport type {\n BlocknoteHandlers,\n BlocknoteContextValue,\n BlockRequirements,\n ProposalResponse,\n SingleChoiceProposal,\n VoteResponse,\n VoteInfo,\n Vote,\n User,\n Addr,\n Uint128,\n Timestamp,\n Expiration,\n Status,\n Threshold,\n Votes,\n CosmosMsgForEmpty,\n ProposalAction,\n StakeTypeValue,\n ListProtocolDeedsWithTemplatesParams,\n ProtocolDeedWithTemplates,\n ProtocolTemplateSummary,\n ImportProtocolTemplatesToSpaceParams,\n ImportProtocolTemplateResult,\n MatrixPrivacySettings,\n MatrixRoom,\n MatrixSpace,\n MatrixSubspace,\n MatrixSpaceStructure,\n Translate,\n} from './mantine/context';\n\n// Export GraphQL client and queries from core\nexport { getEntity } from './core/lib/graphql-queries';\nexport type { Entity, EntityResponse, EntityVariables } from './core/lib/graphql-queries';\nexport { GraphQLClient, ixoGraphQLClient } from './core/lib/graphql-client';\nexport type { GraphQLResponse, GraphQLRequest } from './core/lib/graphql-client';\n\n// Export flow compiler (Base UCAN → flow setup)\nexport {\n setupFlowFromBaseUcan,\n readFlowAsBaseUcan,\n readFlowFromEditor,\n readFlow,\n setActiveEditor,\n getActiveEditor,\n compileBaseUcanFlow,\n readCompiledFlowFromYDoc,\n mergeCompiledFlows,\n decompileToBaseUcanFlow,\n} from './core/lib/flowCompiler';\nexport type { SetupFlowOptions, SetupFlowResult, ReadFlowOptions, ReadFlowResult, ReadableEditor, CompilerRegistry, MergeResult } from './core/lib/flowCompiler';\nexport type { BaseUcanFlow, FlowCapability, CompiledFlow, FlowStrategy } from './core/types/baseUcan';\n\n// Export Flow Agent runtime\nexport {\n FlowAgentService,\n acquireFlowAgentLease,\n appendAgentLedgerEvent,\n buildFlowAgentContext,\n cleanupExpiredFlowAgentLeases,\n createAgentCommand,\n evaluateFlowAgentPolicy,\n executeQueuedAgentCommands,\n getFlowAgentMaps,\n planRalphLoopCommands,\n queueAgentCommand,\n readAgentLedgerEvents,\n readQueuedAgentCommands,\n releaseFlowAgentLease,\n tickFlowAgent,\n validateAgentCommand,\n validateFlowAgentLease,\n type BuildFlowAgentContextParams,\n} from './core/lib/flowAgent';\nexport type {\n FlowAgentActor,\n FlowAgentCommand,\n FlowAgentCommandResult,\n FlowAgentContext,\n FlowAgentExecutor,\n FlowAgentLease,\n FlowAgentNodeSnapshot,\n FlowAgentPublicNodeState,\n FlowAgentTickResult,\n} from './core/types/flowAgent';\n\n// Re-export cloneDocument from matrix-crdt\nexport { cloneDocument } from '@ixo/matrix-crdt';\nexport type { CloneDocumentResult } from '@ixo/matrix-crdt';\n\n// Re-export useful BlockNote types that users might need\nexport type { BlockNoteEditor, BlockNoteSchema, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, PartialBlock, Block } from '@blocknote/core';\n\n// Note: Additional BlockNote utilities can be imported directly from @blocknote/react if needed\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+JA,SAAS,qBAAqB;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Main exports for ixo-editor package\n// This exports the mantine version by default\n// For explicit mantine imports, use:\n// - import { ... } from \"@ixo/editor/mantine\"\n\n// Export the main hook (mantine version by default)\nexport { useCreateIxoEditor } from './mantine/hooks/useCreateIxoEditor';\nexport { useCreateCollaborativeIxoEditor } from './mantine/hooks/useCollaborativeIxoEditor';\n\n// Export the main component (mantine version by default)\nexport { IxoEditor, type IxoEditorProps } from './mantine/IxoEditor';\n\n// Export CoverImage component\nexport { CoverImage, type CoverImageProps } from './mantine/components/CoverImage';\nexport { DevUcanGrantButton } from './mantine/components/DevUcanGrantButton';\n\n// Export authorization components\nexport { AuthorizationTab, type AuthorizationTabState } from './mantine/components/AuthorizationTab';\nexport { EvaluationTab, type EvaluationTabState } from './mantine/components/EvaluationTab';\nexport { EntitySigningSetup } from './mantine/components/EntitySigningSetup';\nexport { FlowPermissionsPanel } from './mantine/components/FlowPermissionsPanel';\nexport { GrantPermissionModal } from './mantine/components/GrantPermissionModal';\n\n// Export flow engine\nexport {\n executeNode,\n isAuthorized,\n createRuntimeStateManager,\n buildFlowNodeFromBlock,\n buildAuthzFromProps,\n createUcanDelegationStore,\n createMemoryUcanDelegationStore,\n createInvocationStore,\n createMemoryInvocationStore,\n createUcanService,\n} from './core/lib/flowEngine';\nexport type {\n ExecuteNodeParams,\n ExecutionOutcome,\n NodeActionResult,\n ExecutionContext,\n AuthorizationResult,\n UcanDelegationStore,\n InvocationStore,\n UcanService,\n UcanServiceConfig,\n UcanServiceHandlers,\n FlowRuntimeStateManager,\n} from './core/lib/flowEngine';\n\n// Export UCAN types\nexport type { UcanCapability, StoredDelegation, StoredInvocation, DelegationChainValidationResult } from './core/types/ucan';\nexport type { DelegationGrant } from './core/types/capability';\n\n// Export types from core\nexport type { IxoEditorOptions, IxoEditorTheme, IxoEditorConfig, IxoCollaborativeUser, IxoCollaborativeEditorOptions } from './core/types';\n\n// Export custom blocks (mantine version by default)\nexport { CheckboxBlockSpec, ListBlockSpec, OverviewBlock, ProposalBlockSpec, ApiRequestBlockSpec, blockSpecs, getExtraSlashMenuItems } from './mantine/blocks';\nexport type { CheckboxBlockProps, ListBlockSettings, ListBlockProps } from './mantine/blocks';\nexport { FlowStepRefSpec, inlineContentSpecs } from './mantine/inline';\nexport type { FlowStepRefProps } from './mantine/inline';\nexport type { OverviewBlockProps } from './mantine/blocks';\nexport type { ProposalBlockProps } from './mantine/blocks';\nexport type { ApiRequestBlockProps, HttpMethod, KeyValuePair } from './mantine/blocks';\n\n// Export block presence hooks\nexport { useBlockPresence, type BlockPresenceUser } from './mantine/hooks/useBlockPresence';\nexport { useTrackBlockFocus } from './mantine/hooks/useTrackBlockFocus';\n\n// Export context and handlers\nexport { BlocknoteProvider, useBlocknoteContext, useBlocknoteHandlers, useTranslate, StakeType, AuthzExecActionTypes, ValidatorActionType } from './mantine/context';\nexport type {\n BlocknoteHandlers,\n BlocknoteContextValue,\n BlockRequirements,\n ProposalResponse,\n SingleChoiceProposal,\n VoteResponse,\n VoteInfo,\n Vote,\n User,\n Addr,\n Uint128,\n Timestamp,\n Expiration,\n Status,\n Threshold,\n Votes,\n CosmosMsgForEmpty,\n ProposalAction,\n StakeTypeValue,\n ListProtocolDeedsWithTemplatesParams,\n ProtocolDeedWithTemplates,\n ProtocolTemplateSummary,\n ImportProtocolTemplatesToSpaceParams,\n ImportProtocolTemplateResult,\n MatrixPrivacySettings,\n MatrixRoom,\n MatrixSpace,\n MatrixSubspace,\n MatrixSpaceStructure,\n Translate,\n} from './mantine/context';\n\n// Export GraphQL client and queries from core\nexport { getEntity } from './core/lib/graphql-queries';\nexport type { Entity, EntityResponse, EntityVariables } from './core/lib/graphql-queries';\nexport { GraphQLClient, ixoGraphQLClient } from './core/lib/graphql-client';\nexport type { GraphQLResponse, GraphQLRequest } from './core/lib/graphql-client';\n\n// Export flow compiler (Base UCAN → flow setup)\nexport {\n setupFlowFromBaseUcan,\n readFlowAsBaseUcan,\n readFlowFromEditor,\n readFlow,\n setActiveEditor,\n getActiveEditor,\n compileBaseUcanFlow,\n readCompiledFlowFromYDoc,\n mergeCompiledFlows,\n decompileToBaseUcanFlow,\n} from './core/lib/flowCompiler';\nexport type { SetupFlowOptions, SetupFlowResult, ReadFlowOptions, ReadFlowResult, ReadableEditor, CompilerRegistry, MergeResult } from './core/lib/flowCompiler';\nexport type { BaseUcanFlow, FlowCapability, CompiledFlow, FlowStrategy } from './core/types/baseUcan';\n\n// Export Flow Agent runtime\nexport {\n FlowAgentService,\n acquireFlowAgentLease,\n appendAgentLedgerEvent,\n buildFlowAgentContext,\n cleanupExpiredFlowAgentLeases,\n createAgentCommand,\n evaluateFlowAgentPolicy,\n executeQueuedAgentCommands,\n getFlowAgentMaps,\n planRalphLoopCommands,\n queueAgentCommand,\n readAgentLedgerEvents,\n readQueuedAgentCommands,\n releaseFlowAgentLease,\n tickFlowAgent,\n validateAgentCommand,\n validateFlowAgentLease,\n type BuildFlowAgentContextParams,\n} from './core/lib/flowAgent';\nexport type {\n FlowAgentActor,\n FlowAgentCommand,\n FlowAgentCommandResult,\n FlowAgentContext,\n FlowAgentExecutor,\n FlowAgentLease,\n FlowAgentNodeSnapshot,\n FlowAgentPublicNodeState,\n FlowAgentTickResult,\n} from './core/types/flowAgent';\n\n// Re-export cloneDocument from matrix-crdt\nexport { cloneDocument } from '@ixo/matrix-crdt';\nexport type { CloneDocumentResult } from '@ixo/matrix-crdt';\n\n// Re-export useful BlockNote types that users might need\nexport type { BlockNoteEditor, BlockNoteSchema, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, PartialBlock, Block } from '@blocknote/core';\n\n// Note: Additional BlockNote utilities can be imported directly from @blocknote/react if needed\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiKA,SAAS,qBAAqB;","names":[]}