@ixo/editor 5.12.0 → 5.14.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.
@@ -0,0 +1,63 @@
1
+ import {
2
+ isRuntimeRef
3
+ } from "./chunk-JAB2IBVH.mjs";
4
+
5
+ // src/core/lib/flowCompiler/resolveRefs.ts
6
+ function resolveRuntimeRefs(nb, getNodeOutput, triggerContext) {
7
+ return resolveValue(nb, getNodeOutput, triggerContext);
8
+ }
9
+ function resolveValue(value, getNodeOutput, triggerContext) {
10
+ if (isRuntimeRef(value)) {
11
+ return resolveRef(value.$ref, getNodeOutput, triggerContext);
12
+ }
13
+ if (Array.isArray(value)) {
14
+ return value.map((item) => resolveValue(item, getNodeOutput, triggerContext));
15
+ }
16
+ if (typeof value === "object" && value !== null) {
17
+ const result = {};
18
+ for (const [key, val] of Object.entries(value)) {
19
+ result[key] = resolveValue(val, getNodeOutput, triggerContext);
20
+ }
21
+ return result;
22
+ }
23
+ return value;
24
+ }
25
+ function resolveRef(ref, getNodeOutput, triggerContext) {
26
+ if (ref.startsWith("trigger.payload.")) {
27
+ if (!triggerContext) {
28
+ throw new Error(`Trigger ref "${ref}" used outside of a listener invocation context. trigger.payload.* refs are only valid on block.event-triggered blocks.`);
29
+ }
30
+ const fieldPath2 = ref.slice("trigger.payload.".length);
31
+ return getNestedValue(triggerContext.payload, fieldPath2);
32
+ }
33
+ if (triggerContext && Object.prototype.hasOwnProperty.call(triggerContext.refSnapshots, ref)) {
34
+ return triggerContext.refSnapshots[ref];
35
+ }
36
+ const outputIndex = ref.indexOf(".output.");
37
+ if (outputIndex === -1) {
38
+ throw new Error(`Invalid runtime reference "${ref}". Expected format: "nodeId.output.fieldPath" or "trigger.payload.fieldPath"`);
39
+ }
40
+ const nodeId = ref.slice(0, outputIndex);
41
+ const fieldPath = ref.slice(outputIndex + ".output.".length);
42
+ const output = getNodeOutput(nodeId);
43
+ if (!output) {
44
+ return void 0;
45
+ }
46
+ return getNestedValue(output, fieldPath);
47
+ }
48
+ function getNestedValue(obj, path) {
49
+ const parts = path.split(".");
50
+ let current = obj;
51
+ for (const part of parts) {
52
+ if (current == null || typeof current !== "object") {
53
+ return void 0;
54
+ }
55
+ current = current[part];
56
+ }
57
+ return current;
58
+ }
59
+
60
+ export {
61
+ resolveRuntimeRefs
62
+ };
63
+ //# sourceMappingURL=chunk-ZEKC5FGC.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/lib/flowCompiler/resolveRefs.ts"],"sourcesContent":["import { isRuntimeRef } from '../../types/baseUcan';\n\n/**\n * Context passed to resolveRuntimeRefs when resolving inputs for a triggered\n * listener block. The runtime constructs this from a PendingInvocation when\n * the assignee invokes the listener.\n *\n * - `payload`: the frozen event payload, used to resolve `trigger.payload.*` refs\n * - `refSnapshots`: frozen `nodeId.output.*` values captured at queue time,\n * used to resolve those refs against the moment of emission rather than\n * current state. See docs/events-and-triggers-plan.md §3.5.1 for the\n * Sally → Mike scenario this fixes.\n */\nexport interface TriggerResolutionContext {\n payload: Record<string, unknown>;\n refSnapshots: Record<string, unknown>;\n}\n\n/**\n * Resolve runtime references in an nb (caveats) object.\n *\n * At compile time, `{ \"$ref\": \"nodeId.output.fieldPath\" }` values are serialized\n * as-is into the block's `inputs` JSON string. At execution time, this function\n * replaces them with actual output values from upstream nodes.\n *\n * Two ref namespaces are supported:\n * - `nodeId.output.fieldPath` — looked up via `getNodeOutput`. When a\n * `triggerContext` is provided AND `refSnapshots[ref]` exists, the\n * snapshot is preferred over the live lookup. This is the load-bearing\n * fix for the lag-time scenario where multiple pending invocations are\n * queued and the source block re-runs before the assignee acts on them.\n * - `trigger.payload.fieldPath` — looked up in `triggerContext.payload`.\n * Only valid when `triggerContext` is provided (i.e. resolving inputs\n * for a triggered listener invocation). Compile-time validation in\n * compiler.ts guarantees these only appear on `block.event`-triggered\n * blocks.\n *\n * @param nb - The caveats object (may contain nested RuntimeRef values)\n * @param getNodeOutput - Lookup function for upstream node outputs\n * @param triggerContext - Optional, present only for triggered listener invocations\n * @returns A new object with all $ref values resolved\n */\nexport function resolveRuntimeRefs(\n nb: Record<string, unknown>,\n getNodeOutput: (nodeId: string) => Record<string, unknown> | undefined,\n triggerContext?: TriggerResolutionContext\n): Record<string, unknown> {\n return resolveValue(nb, getNodeOutput, triggerContext) as Record<string, unknown>;\n}\n\nfunction resolveValue(value: unknown, getNodeOutput: (nodeId: string) => Record<string, unknown> | undefined, triggerContext?: TriggerResolutionContext): unknown {\n if (isRuntimeRef(value)) {\n return resolveRef(value.$ref, getNodeOutput, triggerContext);\n }\n\n if (Array.isArray(value)) {\n return value.map((item) => resolveValue(item, getNodeOutput, triggerContext));\n }\n\n if (typeof value === 'object' && value !== null) {\n const result: Record<string, unknown> = {};\n for (const [key, val] of Object.entries(value)) {\n result[key] = resolveValue(val, getNodeOutput, triggerContext);\n }\n return result;\n }\n\n return value;\n}\n\n/**\n * Resolve a single $ref string.\n *\n * Supported forms:\n * - \"trigger.payload.fieldPath\" — looked up in triggerContext.payload\n * - \"nodeId.output.fieldPath\" — looked up in triggerContext.refSnapshots first\n * (if present), falling back to getNodeOutput. Snapshot preference is\n * what makes the Sally → Mike scenario produce frozen values per pending\n * invocation.\n */\nfunction resolveRef(ref: string, getNodeOutput: (nodeId: string) => Record<string, unknown> | undefined, triggerContext?: TriggerResolutionContext): unknown {\n // trigger.payload.* — only valid when a triggerContext is provided\n if (ref.startsWith('trigger.payload.')) {\n if (!triggerContext) {\n throw new Error(`Trigger ref \"${ref}\" used outside of a listener invocation context. trigger.payload.* refs are only valid on block.event-triggered blocks.`);\n }\n const fieldPath = ref.slice('trigger.payload.'.length);\n return getNestedValue(triggerContext.payload, fieldPath);\n }\n\n // nodeId.output.fieldPath — prefer the snapshot if we're inside a trigger context\n if (triggerContext && Object.prototype.hasOwnProperty.call(triggerContext.refSnapshots, ref)) {\n return triggerContext.refSnapshots[ref];\n }\n\n // Parse \"nodeId.output.fieldPath\"\n const outputIndex = ref.indexOf('.output.');\n if (outputIndex === -1) {\n throw new Error(`Invalid runtime reference \"${ref}\". Expected format: \"nodeId.output.fieldPath\" or \"trigger.payload.fieldPath\"`);\n }\n\n const nodeId = ref.slice(0, outputIndex);\n const fieldPath = ref.slice(outputIndex + '.output.'.length);\n\n const output = getNodeOutput(nodeId);\n if (!output) {\n return undefined;\n }\n\n // Traverse the field path (supports dot notation)\n return getNestedValue(output, fieldPath);\n}\n\nfunction getNestedValue(obj: Record<string, unknown>, path: string): unknown {\n const parts = path.split('.');\n let current: unknown = obj;\n\n for (const part of parts) {\n if (current == null || typeof current !== 'object') {\n return undefined;\n }\n current = (current as Record<string, unknown>)[part];\n }\n\n return current;\n}\n"],"mappings":";;;;;AA0CO,SAAS,mBACd,IACA,eACA,gBACyB;AACzB,SAAO,aAAa,IAAI,eAAe,cAAc;AACvD;AAEA,SAAS,aAAa,OAAgB,eAAwE,gBAAoD;AAChK,MAAI,aAAa,KAAK,GAAG;AACvB,WAAO,WAAW,MAAM,MAAM,eAAe,cAAc;AAAA,EAC7D;AAEA,MAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,WAAO,MAAM,IAAI,CAAC,SAAS,aAAa,MAAM,eAAe,cAAc,CAAC;AAAA,EAC9E;AAEA,MAAI,OAAO,UAAU,YAAY,UAAU,MAAM;AAC/C,UAAM,SAAkC,CAAC;AACzC,eAAW,CAAC,KAAK,GAAG,KAAK,OAAO,QAAQ,KAAK,GAAG;AAC9C,aAAO,GAAG,IAAI,aAAa,KAAK,eAAe,cAAc;AAAA,IAC/D;AACA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAYA,SAAS,WAAW,KAAa,eAAwE,gBAAoD;AAE3J,MAAI,IAAI,WAAW,kBAAkB,GAAG;AACtC,QAAI,CAAC,gBAAgB;AACnB,YAAM,IAAI,MAAM,gBAAgB,GAAG,yHAAyH;AAAA,IAC9J;AACA,UAAMA,aAAY,IAAI,MAAM,mBAAmB,MAAM;AACrD,WAAO,eAAe,eAAe,SAASA,UAAS;AAAA,EACzD;AAGA,MAAI,kBAAkB,OAAO,UAAU,eAAe,KAAK,eAAe,cAAc,GAAG,GAAG;AAC5F,WAAO,eAAe,aAAa,GAAG;AAAA,EACxC;AAGA,QAAM,cAAc,IAAI,QAAQ,UAAU;AAC1C,MAAI,gBAAgB,IAAI;AACtB,UAAM,IAAI,MAAM,8BAA8B,GAAG,8EAA8E;AAAA,EACjI;AAEA,QAAM,SAAS,IAAI,MAAM,GAAG,WAAW;AACvC,QAAM,YAAY,IAAI,MAAM,cAAc,WAAW,MAAM;AAE3D,QAAM,SAAS,cAAc,MAAM;AACnC,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,EACT;AAGA,SAAO,eAAe,QAAQ,SAAS;AACzC;AAEA,SAAS,eAAe,KAA8B,MAAuB;AAC3E,QAAM,QAAQ,KAAK,MAAM,GAAG;AAC5B,MAAI,UAAmB;AAEvB,aAAW,QAAQ,OAAO;AACxB,QAAI,WAAW,QAAQ,OAAO,YAAY,UAAU;AAClD,aAAO;AAAA,IACT;AACA,cAAW,QAAoC,IAAI;AAAA,EACrD;AAEA,SAAO;AACT;","names":["fieldPath"]}
@@ -1,7 +1,7 @@
1
- import { a5 as ActionDefinition, a6 as ActionServices, a2 as FlowAgentNodeSnapshot, a7 as FlowAgentBlockerCause, a3 as FlowAgentPublicNodeState } from '../store-BT916StR.mjs';
2
- export { aj as AcquireFlowAgentLeaseParams, a9 as ActionContext, aa as ActionResult, ax as ActorConstraint, A as AuthorizationResult, B as BaseUcanFlow, X as BuildFlowAgentContextParams, aA as CompiledBlock, aB as CompiledEdge, v as CompiledFlow, aC as CompiledFlowNode, C as CompilerRegistry, aw as ConditionRef, ak as CreateAgentCommandParams, al as EvaluateFlowAgentPolicyParams, E as ExecuteNodeParams, f as ExecutionContext, d as ExecutionOutcome, Y as FlowAgentActor, Z as FlowAgentCommand, ao as FlowAgentCommandBase, _ as FlowAgentCommandResult, ap as FlowAgentCommandStatus, aq as FlowAgentCommandType, $ as FlowAgentContext, a0 as FlowAgentExecutor, a1 as FlowAgentLease, ar as FlowAgentLedgerEvent, as as FlowAgentLedgerEventType, at as FlowAgentMaps, am as FlowAgentOrchestratorOptions, au as FlowAgentPolicyDecision, av as FlowAgentRunPhase, x as FlowAgentService, an as FlowAgentServiceOptions, a4 as FlowAgentTickResult, u as FlowCapability, F as FlowRuntimeStateManager, w as FlowStrategy, M as MergeResult, N as NodeActionResult, ab as OutputSchemaField, R as ReadFlowOptions, q as ReadFlowResult, az as RuntimeRef, S as SetupFlowOptions, p as SetupFlowResult, ay as TTLConstraint, aD as TriggerSpec, y as acquireFlowAgentLease, z as appendAgentLedgerEvent, a as buildAuthzFromProps, D as buildFlowAgentContext, b as buildFlowNodeFromBlock, ac as canMatches, G as cleanupExpiredFlowAgentLeases, a8 as clearRuntimeForTemplateClone, l as compileBaseUcanFlow, ad 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, ae as isCapabilityMatch, af as isExternalMutation, aE 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, ag as requiredCapabilityForCommand, ah as resourceMatches, j as setActiveEditor, s as setupFlowFromBaseUcan, U as tickFlowAgent, ai as updateAgentCommand, V as validateAgentCommand, W as validateFlowAgentLease } from '../store-BT916StR.mjs';
3
- import { W as IxoEditorType, X as FlowNodeRuntimeState, Y as FlowMetadata, Z as FlowNode } from '../index-C0ikjICf.mjs';
4
- export { $ as ClaimCollectionURI, aa as CreateDelegationParams, ab as CreateInvocationParams, a9 as CreateRootDelegationParams, _ as DID, D as DelegationChainValidationResult, k as DelegationGrant, a0 as EvaluationStatus, a7 as ExecutionWithInvocationResult, a8 as FindProofsResult, a2 as FlowNodeAuthzExtension, a4 as FlowNodeBase, a5 as InvocationRequest, a6 as InvocationResult, I as InvocationStore, a1 as LinkedClaim, a3 as NodeState, S as StoredDelegation, j as StoredInvocation, i as UcanCapability, U as UcanDelegationStore, f as UcanService, g as UcanServiceConfig, h as UcanServiceHandlers, b as createInvocationStore, d as createMemoryInvocationStore, a as createMemoryUcanDelegationStore, c as createUcanDelegationStore, e as createUcanService } from '../index-C0ikjICf.mjs';
1
+ import { a5 as ActionDefinition, a6 as ActionServices, Z as FlowAgentCommand, $ as FlowAgentContext, _ as FlowAgentCommandResult, a0 as FlowAgentExecutor, a2 as FlowAgentNodeSnapshot, a7 as FlowAgentBlockerCause, a3 as FlowAgentPublicNodeState } from '../store-CEGM2mJP.mjs';
2
+ export { aj as AcquireFlowAgentLeaseParams, a9 as ActionContext, aa as ActionResult, ax as ActorConstraint, A as AuthorizationResult, B as BaseUcanFlow, X as BuildFlowAgentContextParams, aA as CompiledBlock, aB as CompiledEdge, v as CompiledFlow, aC as CompiledFlowNode, C as CompilerRegistry, aw as ConditionRef, ak as CreateAgentCommandParams, al as EvaluateFlowAgentPolicyParams, E as ExecuteNodeParams, f as ExecutionContext, d as ExecutionOutcome, Y as FlowAgentActor, ao as FlowAgentCommandBase, ap as FlowAgentCommandStatus, aq as FlowAgentCommandType, a1 as FlowAgentLease, ar as FlowAgentLedgerEvent, as as FlowAgentLedgerEventType, at as FlowAgentMaps, am as FlowAgentOrchestratorOptions, au as FlowAgentPolicyDecision, av as FlowAgentRunPhase, x as FlowAgentService, an as FlowAgentServiceOptions, a4 as FlowAgentTickResult, u as FlowCapability, F as FlowRuntimeStateManager, w as FlowStrategy, M as MergeResult, N as NodeActionResult, ab as OutputSchemaField, R as ReadFlowOptions, q as ReadFlowResult, az as RuntimeRef, S as SetupFlowOptions, p as SetupFlowResult, ay as TTLConstraint, aD as TriggerSpec, y as acquireFlowAgentLease, z as appendAgentLedgerEvent, a as buildAuthzFromProps, D as buildFlowAgentContext, b as buildFlowNodeFromBlock, ac as canMatches, G as cleanupExpiredFlowAgentLeases, a8 as clearRuntimeForTemplateClone, l as compileBaseUcanFlow, ad 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, ae as isCapabilityMatch, af as isExternalMutation, aE 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, ag as requiredCapabilityForCommand, ah as resourceMatches, j as setActiveEditor, s as setupFlowFromBaseUcan, U as tickFlowAgent, ai as updateAgentCommand, V as validateAgentCommand, W as validateFlowAgentLease } from '../store-CEGM2mJP.mjs';
3
+ import { W as IxoEditorType, f as UcanService, U as UcanDelegationStore, S as StoredDelegation, I as InvocationStore, X as FlowNodeRuntimeState, Y as FlowMetadata, Z as FlowNode } from '../index-1Y4fIZa7.mjs';
4
+ export { $ as ClaimCollectionURI, aa as CreateDelegationParams, ab as CreateInvocationParams, a9 as CreateRootDelegationParams, _ as DID, D as DelegationChainValidationResult, k as DelegationGrant, a0 as EvaluationStatus, a7 as ExecutionWithInvocationResult, a8 as FindProofsResult, a2 as FlowNodeAuthzExtension, a4 as FlowNodeBase, a5 as InvocationRequest, a6 as InvocationResult, a1 as LinkedClaim, a3 as NodeState, 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-1Y4fIZa7.mjs';
5
5
  import * as Y from 'yjs';
6
6
  import 'matrix-js-sdk';
7
7
  import '@blocknote/core';
@@ -330,6 +330,26 @@ interface TriggerResolutionContext {
330
330
  */
331
331
  declare function resolveRuntimeRefs(nb: Record<string, unknown>, getNodeOutput: (nodeId: string) => Record<string, unknown> | undefined, triggerContext?: TriggerResolutionContext): Record<string, unknown>;
332
332
 
333
+ interface ExecuteFlowAgentCoreCommandOptions {
334
+ ucanService: UcanService;
335
+ pin: string;
336
+ actorType: 'entity' | 'user';
337
+ entityRoomId?: string;
338
+ actionServices?: ActionServices;
339
+ delegationStore?: UcanDelegationStore;
340
+ delegations?: StoredDelegation[];
341
+ invocationStore?: InvocationStore;
342
+ leaseTtlMs?: number;
343
+ schemaVersion?: string;
344
+ now?: () => number;
345
+ }
346
+ interface ExecuteQueuedFlowAgentCoreCommandsOptions extends ExecuteFlowAgentCoreCommandOptions {
347
+ executor?: FlowAgentExecutor;
348
+ commandTypes?: FlowAgentCommand['type'][];
349
+ }
350
+ declare function executeFlowAgentCoreCommand(command: FlowAgentCommand, context: FlowAgentContext, options: ExecuteFlowAgentCoreCommandOptions): Promise<FlowAgentCommandResult>;
351
+ declare function executeQueuedFlowAgentCoreCommands(context: FlowAgentContext, options: ExecuteQueuedFlowAgentCoreCommandsOptions): Promise<FlowAgentCommandResult[]>;
352
+
333
353
  interface ClassifyNodeStateInput {
334
354
  block: unknown;
335
355
  runtime: FlowNodeRuntimeState;
@@ -467,4 +487,4 @@ declare function createOracleInitFlowTemplate(): {
467
487
  nodes: FlowNode[];
468
488
  };
469
489
 
470
- export { ActionDefinition, ActionServices, type ClassifyNodeStateInput, type FailedListenerRun, FlowAgentBlockerCause, FlowAgentNodeSnapshot, FlowAgentPublicNodeState, FlowNode, FlowNodeRuntimeState, type PendingInvocation, RUN_RECORD_AUDIT_TYPE, type RunRecordDetails, type TriggerResolutionContext, appendRunRecord, buildServicesFromHandlers, canToType, classifyBlockerCause, classifyNodeState, computeCID, computeJsonCID, computePendingInvocationId, createOracleInitFlowTemplate, findFailedListenersForSourceRun, getAction, getActionByCan, getActionForBlock, getAllActions, getAllCanMappings, getOrCreateBlockPendingMap, getPendingInvocationsMap, hasAction, oracleInitSurveySchema, queuePendingInvocation, readPendingInvocations, readRunRecords, reconcilePendingInvocations, registerAction, removePendingInvocation, replayFailedListenerRun, resolveRuntimeRefs, snapshotInputRefs, snapshotNode, typeToCan, writeRunRecordAndReconcile };
490
+ export { ActionDefinition, ActionServices, type ClassifyNodeStateInput, type ExecuteFlowAgentCoreCommandOptions, type ExecuteQueuedFlowAgentCoreCommandsOptions, type FailedListenerRun, FlowAgentBlockerCause, FlowAgentCommand, FlowAgentCommandResult, FlowAgentContext, FlowAgentExecutor, FlowAgentNodeSnapshot, FlowAgentPublicNodeState, FlowNode, FlowNodeRuntimeState, InvocationStore, type PendingInvocation, RUN_RECORD_AUDIT_TYPE, type RunRecordDetails, StoredDelegation, type TriggerResolutionContext, UcanDelegationStore, UcanService, appendRunRecord, buildServicesFromHandlers, canToType, classifyBlockerCause, classifyNodeState, computeCID, computeJsonCID, computePendingInvocationId, createOracleInitFlowTemplate, executeFlowAgentCoreCommand, executeQueuedFlowAgentCoreCommands, findFailedListenersForSourceRun, getAction, getActionByCan, getActionForBlock, getAllActions, getAllCanMappings, getOrCreateBlockPendingMap, getPendingInvocationsMap, hasAction, oracleInitSurveySchema, queuePendingInvocation, readPendingInvocations, readRunRecords, reconcilePendingInvocations, registerAction, removePendingInvocation, replayFailedListenerRun, resolveRuntimeRefs, snapshotInputRefs, snapshotNode, typeToCan, writeRunRecordAndReconcile };
@@ -1,43 +1,26 @@
1
+ import {
2
+ resolveRuntimeRefs
3
+ } from "../chunk-ZEKC5FGC.mjs";
1
4
  import {
2
5
  FlowAgentService,
6
+ RUN_RECORD_AUDIT_TYPE,
3
7
  acquireFlowAgentLease,
4
8
  appendAgentLedgerEvent,
5
- buildFlowAgentContext,
6
- canMatches,
7
- classifyBlockerCause,
8
- classifyNodeState,
9
- cleanupExpiredFlowAgentLeases,
10
- computeAgentCommandId,
11
- createAgentCommand,
12
- evaluateFlowAgentPolicy,
13
- executeQueuedAgentCommands,
14
- getFlowAgentMaps,
15
- isCapabilityMatch,
16
- isExternalMutation,
17
- planRalphLoopCommands,
18
- queueAgentCommand,
19
- readAgentLedgerEvents,
20
- readQueuedAgentCommands,
21
- releaseFlowAgentLease,
22
- requiredCapabilityForCommand,
23
- resolveRuntimeRefs,
24
- resourceMatches,
25
- snapshotNode,
26
- tickFlowAgent,
27
- updateAgentCommand,
28
- validateAgentCommand,
29
- validateFlowAgentLease
30
- } from "../chunk-7ZKV7F6Z.mjs";
31
- import {
32
- RUN_RECORD_AUDIT_TYPE,
33
9
  appendRunRecord,
34
10
  buildAuthzFromProps,
11
+ buildFlowAgentContext,
35
12
  buildFlowNodeFromBlock,
36
13
  buildServicesFromHandlers,
14
+ canMatches,
37
15
  canToType,
16
+ classifyBlockerCause,
17
+ classifyNodeState,
18
+ cleanupExpiredFlowAgentLeases,
38
19
  clearRuntimeForTemplateClone,
39
20
  compileBaseUcanFlow,
21
+ computeAgentCommandId,
40
22
  computePendingInvocationId,
23
+ createAgentCommand,
41
24
  createInvocationStore,
42
25
  createMemoryInvocationStore,
43
26
  createMemoryUcanDelegationStore,
@@ -45,7 +28,11 @@ import {
45
28
  createUcanDelegationStore,
46
29
  createUcanService,
47
30
  decompileToBaseUcanFlow,
31
+ evaluateFlowAgentPolicy,
32
+ executeFlowAgentCoreCommand,
48
33
  executeNode,
34
+ executeQueuedAgentCommands,
35
+ executeQueuedFlowAgentCoreCommands,
49
36
  findFailedListenersForSourceRun,
50
37
  getAction,
51
38
  getActionByCan,
@@ -53,29 +40,44 @@ import {
53
40
  getActiveEditor,
54
41
  getAllActions,
55
42
  getAllCanMappings,
43
+ getFlowAgentMaps,
56
44
  getOrCreateBlockPendingMap,
57
45
  getPendingInvocationsMap,
58
46
  hasAction,
59
47
  isAuthorized,
48
+ isCapabilityMatch,
49
+ isExternalMutation,
60
50
  isRuntimeRef,
61
51
  mergeCompiledFlows,
52
+ planRalphLoopCommands,
53
+ queueAgentCommand,
62
54
  queuePendingInvocation,
55
+ readAgentLedgerEvents,
63
56
  readCompiledFlowFromYDoc,
64
57
  readFlow,
65
58
  readFlowAsBaseUcan,
66
59
  readFlowFromEditor,
67
60
  readPendingInvocations,
61
+ readQueuedAgentCommands,
68
62
  readRunRecords,
69
63
  reconcilePendingInvocations,
70
64
  registerAction,
65
+ releaseFlowAgentLease,
71
66
  removePendingInvocation,
72
67
  replayFailedListenerRun,
68
+ requiredCapabilityForCommand,
69
+ resourceMatches,
73
70
  setActiveEditor,
74
71
  setupFlowFromBaseUcan,
75
72
  snapshotInputRefs,
73
+ snapshotNode,
74
+ tickFlowAgent,
76
75
  typeToCan,
76
+ updateAgentCommand,
77
+ validateAgentCommand,
78
+ validateFlowAgentLease,
77
79
  writeRunRecordAndReconcile
78
- } from "../chunk-GCR6VY7O.mjs";
80
+ } from "../chunk-JAB2IBVH.mjs";
79
81
  import {
80
82
  computeCID,
81
83
  computeJsonCID
@@ -491,8 +493,10 @@ export {
491
493
  createUcanService,
492
494
  decompileToBaseUcanFlow,
493
495
  evaluateFlowAgentPolicy,
496
+ executeFlowAgentCoreCommand,
494
497
  executeNode,
495
498
  executeQueuedAgentCommands,
499
+ executeQueuedFlowAgentCoreCommands,
496
500
  findFailedListenersForSourceRun,
497
501
  getAction,
498
502
  getActionByCan,
@@ -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;A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,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
+ {"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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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from '@blocknote/core';
2
- import { ac as IxoBlockProps, l as IxoEditorOptions, W as IxoEditorType, p as IxoCollaborativeEditorOptions, w as BlocknoteHandlers, y as BlockRequirements, aj as UnlMapConfig, af as DynamicListDataProvider, ag as DynamicListPanelRenderer, ah as DomainCardRenderer, R as Translate, k as DelegationGrant } from './index-C0ikjICf.mjs';
2
+ import { ac as IxoBlockProps, l as IxoEditorOptions, W as IxoEditorType, p as IxoCollaborativeEditorOptions, w as BlocknoteHandlers, y as BlockRequirements, aj as UnlMapConfig, af as DynamicListDataProvider, ag as DynamicListPanelRenderer, ah as DomainCardRenderer, R as Translate, k as DelegationGrant } from './index-1Y4fIZa7.mjs';
3
3
  import { Text, Doc, Map, Array as Array$1 } from 'yjs';
4
4
  import React__default from 'react';
5
5
 
@@ -533,6 +533,11 @@ interface CoverImageProps {
533
533
  }
534
534
  declare function CoverImage({ coverImageUrl, logoUrl }: CoverImageProps): React__default.ReactElement | null;
535
535
 
536
+ declare function DevUcanGrantButton({ editor, handlers: propHandlers }: {
537
+ editor: IxoEditorType;
538
+ handlers?: BlocknoteHandlers;
539
+ }): React__default.JSX.Element;
540
+
536
541
  /** @deprecated The activation gating fields were removed; this type is kept
537
542
  * empty for any external imports during the transition. */
538
543
  type AuthorizationTabState = Record<string, never>;
@@ -688,4 +693,4 @@ declare class GraphQLClient {
688
693
  }
689
694
  declare const ixoGraphQLClient: GraphQLClient;
690
695
 
691
- export { AuthorizationTab as A, type BlockPresenceUser as B, CoverImage as C, type DropPosition as D, EvaluationTab as E, FlowPermissionsPanel as F, GrantPermissionModal as G, type HttpMethod as H, IxoEditor as I, 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 };
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 };
@@ -1659,6 +1659,8 @@ interface BlocknoteHandlers {
1659
1659
  }>;
1660
1660
  /** CIDs of proof delegations */
1661
1661
  proofs?: string[];
1662
+ /** Base64-encoded CAR proof delegations, aligned by index with proofs. */
1663
+ proofDelegations?: string[];
1662
1664
  /** Expiration timestamp (milliseconds) */
1663
1665
  expiration?: number;
1664
1666
  /** PIN to decrypt signing mnemonic */
@@ -1699,6 +1701,8 @@ interface BlocknoteHandlers {
1699
1701
  }>;
1700
1702
  /**
1701
1703
  * Validate an invocation against its proof chain
1704
+ * @deprecated Invocation validation should move into the shared UCAN runtime;
1705
+ * host apps should implement createInvocation plus the signer-session handlers.
1702
1706
  */
1703
1707
  validateInvocation?: (params: {
1704
1708
  /** Base64-encoded CAR invocation */
@@ -2176,6 +2180,39 @@ interface BlocknoteHandlers {
2176
2180
  /** Reason if not released (e.g., already expired) */
2177
2181
  reason?: string;
2178
2182
  }>;
2183
+ /**
2184
+ * @deprecated Use createDelegation with createSignerSession/signWithSession/releaseSignerSession.
2185
+ */
2186
+ createDelegationWithSession?: (params: {
2187
+ sessionId: string;
2188
+ audience: string;
2189
+ capabilities: Array<{
2190
+ can: string;
2191
+ with: string;
2192
+ nb?: Record<string, unknown>;
2193
+ }>;
2194
+ proofs?: string[];
2195
+ expiration?: number;
2196
+ }) => Promise<{
2197
+ cid: string;
2198
+ delegation: string;
2199
+ }>;
2200
+ /**
2201
+ * @deprecated Use createInvocation with createSignerSession/signWithSession/releaseSignerSession.
2202
+ */
2203
+ createInvocationWithSession?: (params: {
2204
+ sessionId: string;
2205
+ audience: string;
2206
+ capability: {
2207
+ can: string;
2208
+ with: string;
2209
+ nb?: Record<string, unknown>;
2210
+ };
2211
+ proofs: string[];
2212
+ }) => Promise<{
2213
+ cid: string;
2214
+ invocation: string;
2215
+ }>;
2179
2216
  /**
2180
2217
  * Validate an MCP server URL and optionally authenticate with it.
2181
2218
  * Returns the list of tools the server exposes on success.
@@ -4798,7 +4835,7 @@ interface UcanServiceHandlers {
4798
4835
  /**
4799
4836
  * Create a delegation directly in the host app.
4800
4837
  * The host handles all signing internally using session-based signing.
4801
- * This is the preferred approach for security.
4838
+ * @deprecated Use createDelegation on BlocknoteHandlers instead.
4802
4839
  */
4803
4840
  createDelegationWithSession?: (params: {
4804
4841
  sessionId: string;
@@ -4817,7 +4854,7 @@ interface UcanServiceHandlers {
4817
4854
  /**
4818
4855
  * Create an invocation directly in the host app.
4819
4856
  * The host handles all signing internally using session-based signing.
4820
- * This is the preferred approach for security.
4857
+ * @deprecated Use createInvocation on BlocknoteHandlers instead.
4821
4858
  */
4822
4859
  createInvocationWithSession?: (params: {
4823
4860
  sessionId: string;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
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, 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-DP4rq5no.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-BT916StR.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, I as InvocationStore, p as IxoCollaborativeEditorOptions, o as IxoCollaborativeUser, n as IxoEditorConfig, l as IxoEditorOptions, m as IxoEditorTheme, Q as ProposalAction, P as ProposalResponse, z as SingleChoiceProposal, v as StakeType, v as StakeTypeValue, L as Status, S as StoredDelegation, j as StoredInvocation, M as Threshold, T as Timestamp, R 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-C0ikjICf.mjs';
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-BjgWToqz.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-CEGM2mJP.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, I as InvocationStore, p as IxoCollaborativeEditorOptions, o as IxoCollaborativeUser, n as IxoEditorConfig, l as IxoEditorOptions, m as IxoEditorTheme, Q as ProposalAction, P as ProposalResponse, z as SingleChoiceProposal, v as StakeType, v as StakeTypeValue, L as Status, S as StoredDelegation, j as StoredInvocation, M as Threshold, T as Timestamp, R 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-1Y4fIZa7.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';
package/dist/index.mjs CHANGED
@@ -5,6 +5,7 @@ import {
5
5
  BlocknoteProvider,
6
6
  CheckboxBlockSpec,
7
7
  CoverImage,
8
+ DevUcanGrantButton,
8
9
  EntitySigningSetup,
9
10
  EvaluationTab,
10
11
  FlowPermissionsPanel,
@@ -27,30 +28,18 @@ import {
27
28
  useCreateIxoEditor,
28
29
  useTrackBlockFocus,
29
30
  useTranslate
30
- } from "./chunk-WYOHC4AF.mjs";
31
+ } from "./chunk-UVZZ52PF.mjs";
32
+ import "./chunk-ZEKC5FGC.mjs";
31
33
  import {
32
34
  FlowAgentService,
33
35
  acquireFlowAgentLease,
34
36
  appendAgentLedgerEvent,
35
- buildFlowAgentContext,
36
- cleanupExpiredFlowAgentLeases,
37
- createAgentCommand,
38
- evaluateFlowAgentPolicy,
39
- executeQueuedAgentCommands,
40
- getFlowAgentMaps,
41
- planRalphLoopCommands,
42
- queueAgentCommand,
43
- readAgentLedgerEvents,
44
- readQueuedAgentCommands,
45
- releaseFlowAgentLease,
46
- tickFlowAgent,
47
- validateAgentCommand,
48
- validateFlowAgentLease
49
- } from "./chunk-7ZKV7F6Z.mjs";
50
- import {
51
37
  buildAuthzFromProps,
38
+ buildFlowAgentContext,
52
39
  buildFlowNodeFromBlock,
40
+ cleanupExpiredFlowAgentLeases,
53
41
  compileBaseUcanFlow,
42
+ createAgentCommand,
54
43
  createInvocationStore,
55
44
  createMemoryInvocationStore,
56
45
  createMemoryUcanDelegationStore,
@@ -58,17 +47,28 @@ import {
58
47
  createUcanDelegationStore,
59
48
  createUcanService,
60
49
  decompileToBaseUcanFlow,
50
+ evaluateFlowAgentPolicy,
61
51
  executeNode,
52
+ executeQueuedAgentCommands,
62
53
  getActiveEditor,
54
+ getFlowAgentMaps,
63
55
  isAuthorized,
64
56
  mergeCompiledFlows,
57
+ planRalphLoopCommands,
58
+ queueAgentCommand,
59
+ readAgentLedgerEvents,
65
60
  readCompiledFlowFromYDoc,
66
61
  readFlow,
67
62
  readFlowAsBaseUcan,
68
63
  readFlowFromEditor,
64
+ readQueuedAgentCommands,
65
+ releaseFlowAgentLease,
69
66
  setActiveEditor,
70
- setupFlowFromBaseUcan
71
- } from "./chunk-GCR6VY7O.mjs";
67
+ setupFlowFromBaseUcan,
68
+ tickFlowAgent,
69
+ validateAgentCommand,
70
+ validateFlowAgentLease
71
+ } from "./chunk-JAB2IBVH.mjs";
72
72
 
73
73
  // src/index.ts
74
74
  import { cloneDocument } from "@ixo/matrix-crdt";
@@ -79,6 +79,7 @@ export {
79
79
  BlocknoteProvider,
80
80
  CheckboxBlockSpec,
81
81
  CoverImage,
82
+ DevUcanGrantButton,
82
83
  EntitySigningSetup,
83
84
  EvaluationTab,
84
85
  FlowAgentService,
@@ -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';\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 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoJA,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 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 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqJA,SAAS,qBAAqB;","names":[]}
@@ -1,7 +1,7 @@
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 DropPosition, r as Entity, s as EntityResponse, f as EntitySigningSetup, t as EntityVariables, E as EvaluationTab, e as EvaluationTabState, z as ExternalDropZone, 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-DP4rq5no.mjs';
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, J as DropPosition, r as Entity, s as EntityResponse, f as EntitySigningSetup, t as EntityVariables, E as EvaluationTab, e as EvaluationTabState, z as ExternalDropZone, 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-BjgWToqz.mjs';
2
2
  import React__default, { PropsWithChildren } from 'react';
3
- import { ac as IxoBlockProps, W as IxoEditorType, X as FlowNodeRuntimeState, w as BlocknoteHandlers } from '../index-C0ikjICf.mjs';
4
- export { H as Addr, A as AuthzExecActionTypes, y as BlockRequirements, x as BlocknoteContextValue, B as BlocknoteProvider, O as CosmosMsgForEmpty, ai as DomainCardData, ah as DomainCardRenderer, ae as DynamicListData, af as DynamicListDataProvider, ag as DynamicListPanelRenderer, K as Expiration, p as IxoCollaborativeEditorOptions, o as IxoCollaborativeUser, n as IxoEditorConfig, l as IxoEditorOptions, m as IxoEditorTheme, Q as ProposalAction, P as ProposalResponse, z as SingleChoiceProposal, v as StakeType, v as StakeTypeValue, L as Status, M as Threshold, T as Timestamp, J as Uint128, G as User, V as ValidatorActionType, ad as VisualizationRenderer, F as Vote, E as VoteInfo, C as VoteResponse, N as Votes, q as blockSpecs, r as getExtraSlashMenuItems, u as useBlocknoteContext, s as useBlocknoteHandlers } from '../index-C0ikjICf.mjs';
3
+ import { ac as IxoBlockProps, W as IxoEditorType, w as BlocknoteHandlers, X as FlowNodeRuntimeState } from '../index-1Y4fIZa7.mjs';
4
+ export { H as Addr, A as AuthzExecActionTypes, y as BlockRequirements, x as BlocknoteContextValue, B as BlocknoteProvider, O as CosmosMsgForEmpty, ai as DomainCardData, ah as DomainCardRenderer, ae as DynamicListData, af as DynamicListDataProvider, ag as DynamicListPanelRenderer, K as Expiration, p as IxoCollaborativeEditorOptions, o as IxoCollaborativeUser, n as IxoEditorConfig, l as IxoEditorOptions, m as IxoEditorTheme, Q as ProposalAction, P as ProposalResponse, z as SingleChoiceProposal, v as StakeType, v as StakeTypeValue, L as Status, M as Threshold, T as Timestamp, J as Uint128, G as User, V as ValidatorActionType, ad as VisualizationRenderer, F as Vote, E as VoteInfo, C as VoteResponse, N as Votes, q as blockSpecs, r as getExtraSlashMenuItems, u as useBlocknoteContext, s as useBlocknoteHandlers } from '../index-1Y4fIZa7.mjs';
5
5
  import * as zustand from 'zustand';
6
6
  import * as _blocknote_core from '@blocknote/core';
7
7
  export { Block, BlockNoteEditor, BlockNoteSchema, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, PartialBlock } from '@blocknote/core';
@@ -143,8 +143,9 @@ interface DynamicListPanelConfig {
143
143
  actions?: DynamicListAction[];
144
144
  }
145
145
 
146
- declare function DebugButton({ editor }: {
146
+ declare function DebugButton({ editor, handlers }: {
147
147
  editor: IxoEditorType;
148
+ handlers?: BlocknoteHandlers;
148
149
  }): React__default.JSX.Element;
149
150
 
150
151
  interface BaseIconPickerProps {