@ixo/editor 5.19.0 → 5.20.0-experimental.1

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,4 +1,4 @@
1
- import { Z as FlowNode, a2 as FlowNodeAuthzExtension, X as FlowNodeRuntimeState, W as IxoEditorType, f as UcanService, I as InvocationStore, a0 as EvaluationStatus, i as UcanCapability, U as UcanDelegationStore, S as StoredDelegation } from './index-BoRWeiDg.mjs';
1
+ import { a7 as FlowNode, ac as FlowNodeAuthzExtension, a5 as FlowNodeRuntimeState, a4 as IxoEditorType, f as UcanService, I as InvocationStore, aa as EvaluationStatus, i as UcanCapability, U as UcanDelegationStore, S as StoredDelegation } from './index-DMNPdv6v.mjs';
2
2
  import * as Y from 'yjs';
3
3
  import { Doc, Map } from 'yjs';
4
4
  import { MatrixClient } from 'matrix-js-sdk';
@@ -219,71 +219,6 @@ declare const createRuntimeStateManager: (editor?: IxoEditorType | null) => Flow
219
219
  */
220
220
  declare function clearRuntimeForTemplateClone(yDoc: Doc): void;
221
221
 
222
- interface NodeActionResult {
223
- claimId?: string;
224
- evaluationStatus?: EvaluationStatus;
225
- submittedByDid?: string;
226
- payload?: any;
227
- }
228
- interface ExecutionContext {
229
- runtime: FlowRuntimeStateManager;
230
- /** UCAN service — optional for v0.x flows, required for v1.0.0+ */
231
- ucanService?: UcanService;
232
- /** Invocation store — optional for v0.x flows */
233
- invocationStore?: InvocationStore;
234
- flowUri: string;
235
- flowId: string;
236
- flowOwnerDid: string;
237
- /** Flow schema version. When set, controls whether UCAN is enforced. */
238
- schemaVersion?: string;
239
- now?: () => number;
240
- }
241
- interface ExecutionOutcome {
242
- success: boolean;
243
- stage: 'authorization' | 'claim' | 'action' | 'complete';
244
- error?: string;
245
- result?: NodeActionResult;
246
- capabilityId?: string;
247
- invocationCid?: string;
248
- }
249
- interface ExecuteNodeParams {
250
- node: FlowNode;
251
- actorDid: string;
252
- actorType: 'entity' | 'user';
253
- entityRoomId?: string;
254
- context: ExecutionContext;
255
- action: () => Promise<NodeActionResult>;
256
- pin: string;
257
- }
258
- /**
259
- * Execute a node.
260
- *
261
- * The pipeline adapts based on the flow's schema version (via context.schemaVersion):
262
- *
263
- * **v0.x (legacy):** activation → action → runtime update.
264
- * UCAN authorization and invocations are skipped when ucanService is not available.
265
- *
266
- * **v1.0.0+:** activation → UCAN authorization → invocation → action → runtime update.
267
- * Requires a configured ucanService with valid delegation chains.
268
- */
269
- declare const executeNode: ({ node, actorDid, actorType, entityRoomId, context, action, pin }: ExecuteNodeParams) => Promise<ExecutionOutcome>;
270
-
271
- interface AuthorizationResult {
272
- authorized: boolean;
273
- reason?: string;
274
- capabilityId?: string;
275
- proofCids?: string[];
276
- }
277
- /**
278
- * Check if an actor is authorized to execute a block.
279
- *
280
- * Behaviour depends on the flow's schema version:
281
- * - v0.x (or no version): UCAN is optional. If ucanService is unavailable,
282
- * execution is allowed without a delegation chain.
283
- * - v1.0.0+: UCAN is required. A valid delegation chain must exist.
284
- */
285
- declare const isAuthorized: (blockId: string, actorDid: string, ucanService: UcanService | undefined, flowUri: string, schemaVersion?: string) => Promise<AuthorizationResult>;
286
-
287
222
  interface ActionContext {
288
223
  actorDid: string;
289
224
  flowId: string;
@@ -294,6 +229,7 @@ interface ActionContext {
294
229
  flowUri?: string;
295
230
  handlers?: any;
296
231
  editor?: any;
232
+ pendingInvocation?: any;
297
233
  }
298
234
  interface ActionServices {
299
235
  http?: {
@@ -755,8 +691,79 @@ interface ActionResult {
755
691
  name: string;
756
692
  payload: Record<string, any>;
757
693
  }>;
694
+ completion?: {
695
+ state?: 'completed' | 'awaiting_readback';
696
+ readBack?: Record<string, any>;
697
+ };
758
698
  }
759
699
 
700
+ interface NodeActionResult {
701
+ claimId?: string;
702
+ evaluationStatus?: EvaluationStatus;
703
+ submittedByDid?: string;
704
+ payload?: any;
705
+ }
706
+ interface ExecutionContext {
707
+ runtime: FlowRuntimeStateManager;
708
+ /** UCAN service — optional for v0.x flows, required for v1.0.0+ */
709
+ ucanService?: UcanService;
710
+ /** Invocation store — optional for v0.x flows */
711
+ invocationStore?: InvocationStore;
712
+ flowUri: string;
713
+ flowId: string;
714
+ flowOwnerDid: string;
715
+ /** Flow schema version. When set, controls whether UCAN is enforced. */
716
+ schemaVersion?: string;
717
+ now?: () => number;
718
+ }
719
+ interface ExecutionOutcome {
720
+ success: boolean;
721
+ stage: 'authorization' | 'claim' | 'action' | 'complete';
722
+ error?: string;
723
+ result?: NodeActionResult;
724
+ capabilityId?: string;
725
+ invocationCid?: string;
726
+ }
727
+ interface ExecuteNodeParams {
728
+ node: FlowNode;
729
+ actorDid: string;
730
+ actorType: 'entity' | 'user';
731
+ entityRoomId?: string;
732
+ context: ExecutionContext;
733
+ action: () => Promise<NodeActionResult>;
734
+ pin: string;
735
+ }
736
+ /**
737
+ * Execute a node.
738
+ *
739
+ * The pipeline adapts based on the flow's schema version (via context.schemaVersion):
740
+ *
741
+ * **v0.x (legacy):** activation → action → runtime update.
742
+ * UCAN authorization and invocations are skipped when ucanService is not available.
743
+ *
744
+ * **v1.0.0+:** activation → UCAN authorization → invocation → action → runtime update.
745
+ * Requires a configured ucanService with valid delegation chains.
746
+ */
747
+ declare const executeNode: ({ node, actorDid, actorType, entityRoomId, context, action, pin }: ExecuteNodeParams) => Promise<ExecutionOutcome>;
748
+
749
+ type ActionExecutionCompletionState = 'completed' | 'failed' | 'awaiting_readback';
750
+
751
+ interface AuthorizationResult {
752
+ authorized: boolean;
753
+ reason?: string;
754
+ capabilityId?: string;
755
+ proofCids?: string[];
756
+ }
757
+ /**
758
+ * Check if an actor is authorized to execute a block.
759
+ *
760
+ * Behaviour depends on the flow's schema version:
761
+ * - v0.x (or no version): UCAN is optional. If ucanService is unavailable,
762
+ * execution is allowed without a delegation chain.
763
+ * - v1.0.0+: UCAN is required. A valid delegation chain must exist.
764
+ */
765
+ declare const isAuthorized: (blockId: string, actorDid: string, ucanService: UcanService | undefined, flowUri: string, schemaVersion?: string) => Promise<AuthorizationResult>;
766
+
760
767
  /** Registry interface expected by the compiler (keeps it pure / testable). */
761
768
  interface CompilerRegistry {
762
769
  getActionByCan(can: string): ActionDefinition | undefined;
@@ -959,7 +966,7 @@ type FlowAgentPublicNodeState = 'Pending' | 'Blocked' | 'Overdue' | 'Done';
959
966
  type FlowAgentRunPhase = 'Running' | 'Validating' | 'Failed' | 'Archived';
960
967
  type FlowAgentBlockerCause = 'missing_input' | 'failed_upstream' | 'missing_ucan' | 'stale_config' | 'service_error' | 'external_confirmation_pending' | 'validation_mismatch' | 'unknown';
961
968
  type FlowAgentCommandType = 'diagnose_blocker' | 'assign_actor' | 'notify_actor' | 'execute_action' | 'validate_external_state' | 'submit_claim' | 'watch_udid' | 'archive_flow' | 'propose_config_change';
962
- type FlowAgentCommandStatus = 'queued' | 'leased' | 'running' | 'confirmed' | 'failed' | 'skipped';
969
+ type FlowAgentCommandStatus = 'queued' | 'leased' | 'running' | 'confirmed' | 'awaiting_readback' | 'failed' | 'skipped';
963
970
  type FlowAgentLedgerEventType = 'agent.decision' | 'agent.command' | 'agent.validation' | 'agent.escalation' | 'agent.memory';
964
971
  interface FlowAgentActor {
965
972
  did: string;
@@ -1040,6 +1047,8 @@ interface FlowAgentCommandResult {
1040
1047
  success: boolean;
1041
1048
  output?: Record<string, unknown>;
1042
1049
  confirmed?: boolean;
1050
+ completionState?: ActionExecutionCompletionState;
1051
+ status?: FlowAgentCommandStatus;
1043
1052
  error?: string;
1044
1053
  }
1045
1054
  interface FlowAgentExecutor {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ixo/editor",
3
- "version": "5.19.0",
3
+ "version": "5.20.0-experimental.1",
4
4
  "description": "A custom BlockNote editor wrapper for IXO team",
5
5
  "main": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",