@ixo/editor 3.0.0-beta.27 → 3.0.0-beta.29

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,180 +1,31 @@
1
- export { m as ActivationResult, l as AuthorizationContext, s as AuthorizationContextV2, A as AuthorizationResult, C as CapabilityGrant, D as DelegationStore, y as DerivedCapability, E as ExecuteNodeParams, p as ExecuteNodeParamsV2, k as ExecutionContext, q as ExecutionContextV2, j as ExecutionOutcome, F as FlowRuntimeStateManager, N as NodeActionResult, S as SimpleUCANManager, x as UCANManager, U as UcanService, u as UcanServiceConfig, w as UcanServiceHandlers, h as buildAuthzFromProps, g as buildFlowNodeFromBlock, n as clearRuntimeForTemplateClone, c as createDelegationStore, b as createMemoryDelegationStore, d as createRuntimeStateManager, t as createUcanService, e as executeNode, o as executeNodeWithInvocation, f as findValidCapability, i as isActorAuthorized, r as isActorAuthorizedV2, a as isNodeActive, v as validateCapabilityChain } from '../capabilityValidation-BSzFr-F6.mjs';
2
- export { A as ActivationCondition, C as Capability, m as CapabilityURI, a as CapabilityValidationResult, o as ClaimCollectionURI, G as CreateDelegationParams, H as CreateInvocationParams, B as CreateRootDelegationParams, n as DID, y as DelegationChainValidationResult, D as DelegationGrant, E as EvaluationStatus, x as ExecutionWithInvocationResult, z as FindProofsResult, r as FlowNode, F as FlowNodeAuthzExtension, q as FlowNodeBase, p as FlowNodeRuntimeState, v as InvocationRequest, w as InvocationResult, l as InvocationStore, L as LinkedClaim, M as MigrationReport, N as NodeState, S as SignedCapability, t as StoredDelegation, u as StoredInvocation, s as UcanCapability, U as UcanDelegationStore, j as createInvocationStore, k as createMemoryInvocationStore, i as createMemoryUcanDelegationStore, h as createUcanDelegationStore } from '../index-aAHFla8N.mjs';
3
- import '@ixo/ucan';
1
+ import { n as ActionDefinition, o as ActionServices } from '../setup-CahGoKeh.mjs';
2
+ export { q as ActionContext, r as ActionResult, h as ActivationResult, u as ActorConstraint, A as AuthorizationResult, B as BaseUcanFlow, v as CompiledBlock, w as CompiledEdge, m as CompiledFlow, x as CompiledFlowNode, C as CompilerRegistry, t as ConditionRef, E as ExecuteNodeParams, g as ExecutionContext, f as ExecutionOutcome, l as FlowCapability, F as FlowRuntimeStateManager, N as NodeActionResult, O as OutputSchemaField, R as RuntimeRef, S as SetupFlowOptions, k as SetupFlowResult, T as TTLConstraint, d as buildAuthzFromProps, b as buildFlowNodeFromBlock, p as clearRuntimeForTemplateClone, j as compileBaseUcanFlow, c as createRuntimeStateManager, e as executeNode, i as isAuthorized, a as isNodeActive, y as isRuntimeRef, s as setupFlowFromBaseUcan } from '../setup-CahGoKeh.mjs';
3
+ export { A as ActivationCondition, C as ClaimCollectionURI, G as CreateDelegationParams, H as CreateInvocationParams, B as CreateRootDelegationParams, s as DID, D as DelegationChainValidationResult, k as DelegationGrant, E as EvaluationStatus, y as ExecutionWithInvocationResult, z as FindProofsResult, v as FlowNode, F as FlowNodeAuthzExtension, u as FlowNodeBase, t as FlowNodeRuntimeState, w as InvocationRequest, x as InvocationResult, I as InvocationStore, L as LinkedClaim, N 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-7ptWHYA8.mjs';
4
4
  import 'yjs';
5
- import '@blocknote/core';
6
5
  import 'matrix-js-sdk';
7
-
8
- interface ActionContext {
9
- actorDid: string;
10
- flowId: string;
11
- nodeId: string;
12
- services: ActionServices;
13
- flowNode?: any;
14
- runtime?: any;
15
- delegationStore?: any;
16
- verifySignature?: (capabilityRaw: string, issuerDid: string) => Promise<{
17
- valid: boolean;
18
- error?: string;
19
- }>;
20
- rootIssuer?: string;
21
- flowUri?: string;
22
- handlers?: any;
23
- editor?: any;
24
- }
25
- interface ActionServices {
26
- http?: {
27
- request: (params: {
28
- url: string;
29
- method: string;
30
- headers?: Record<string, string>;
31
- body?: any;
32
- }) => Promise<{
33
- status: number;
34
- headers: Record<string, string>;
35
- data: any;
36
- }>;
37
- };
38
- email?: {
39
- send: (params: {
40
- to: string;
41
- subject: string;
42
- template: string;
43
- templateVersion?: string;
44
- variables?: Record<string, any>;
45
- cc?: string;
46
- bcc?: string;
47
- replyTo?: string;
48
- }) => Promise<{
49
- messageId: string;
50
- sentAt: string;
51
- }>;
52
- };
53
- notify?: {
54
- send: (params: {
55
- channel: string;
56
- to: string[];
57
- cc?: string[];
58
- bcc?: string[];
59
- subject?: string;
60
- body?: string;
61
- bodyType?: 'text' | 'html';
62
- from?: string;
63
- replyTo?: string;
64
- }) => Promise<{
65
- messageId: string;
66
- sentAt: string;
67
- }>;
68
- };
69
- bid?: {
70
- submitBid: (params: {
71
- collectionId: string;
72
- role: string;
73
- surveyAnswers: Record<string, any>;
74
- }) => Promise<any>;
75
- approveBid: (params: {
76
- bidId: string;
77
- collectionId: string;
78
- did: string;
79
- }) => Promise<any>;
80
- rejectBid: (params: {
81
- bidId: string;
82
- collectionId: string;
83
- did: string;
84
- reason: string;
85
- }) => Promise<any>;
86
- approveServiceAgentApplication: (params: {
87
- adminAddress: string;
88
- collectionId: string;
89
- agentQuota: number;
90
- deedDid: string;
91
- currentUserAddress: string;
92
- }) => Promise<void>;
93
- approveEvaluatorApplication: (params: {
94
- adminAddress: string;
95
- collectionId: string;
96
- deedDid: string;
97
- evaluatorAddress: string;
98
- agentQuota?: number;
99
- claimIds?: string[];
100
- maxAmounts?: Array<{
101
- denom: string;
102
- amount: string;
103
- }>;
104
- }) => Promise<void>;
105
- };
106
- claim?: {
107
- requestPin: (config?: {
108
- title?: string;
109
- description?: string;
110
- submitText?: string;
111
- }) => Promise<string>;
112
- submitClaim: (params: {
113
- surveyData: any;
114
- deedDid: string;
115
- collectionId: string;
116
- adminAddress: string;
117
- pin: string;
118
- }) => Promise<{
119
- transactionHash: string;
120
- claimId: string;
121
- }>;
122
- evaluateClaim: (granteeAddress: string, did: string, payload: {
123
- claimId: string;
124
- collectionId: string;
125
- adminAddress: string;
126
- status?: number;
127
- verificationProof: string;
128
- amount?: {
129
- denom: string;
130
- amount: string;
131
- } | Array<{
132
- denom: string;
133
- amount: string;
134
- }>;
135
- }) => Promise<void>;
136
- getCurrentUser: () => {
137
- address: string;
138
- };
139
- createUdid?: (params: any) => Promise<any>;
140
- };
141
- matrix?: {
142
- storeCredential: (params: {
143
- roomId: string;
144
- credentialKey: string;
145
- credential: Record<string, any>;
146
- cid: string;
147
- }) => Promise<{
148
- storedAt: string;
149
- duplicate: boolean;
150
- }>;
151
- };
152
- }
153
- interface OutputSchemaField {
154
- path: string;
155
- displayName: string;
156
- type: 'string' | 'number' | 'boolean' | 'object' | 'array';
157
- description?: string;
158
- }
159
- interface ActionDefinition {
160
- type: string;
161
- sideEffect: boolean;
162
- defaultRequiresConfirmation: boolean;
163
- requiredCapability?: string;
164
- inputSchema?: object;
165
- /** Static output schema for action types with predictable output (e.g. email.send).
166
- * For action types with dynamic output (e.g. http.request), the schema is user-defined in inputs. */
167
- outputSchema?: OutputSchemaField[];
168
- run: (inputs: Record<string, any>, ctx: ActionContext) => Promise<ActionResult>;
169
- }
170
- interface ActionResult {
171
- output: Record<string, any>;
172
- }
6
+ import '@blocknote/core';
7
+ import '@ixo/ucan';
173
8
 
174
9
  declare function registerAction(definition: ActionDefinition): void;
175
10
  declare function getAction(type: string): ActionDefinition | undefined;
176
11
  declare function getAllActions(): ActionDefinition[];
177
12
  declare function hasAction(type: string): boolean;
13
+ /** Look up an action by its UCAN `can` ability string, e.g., "bid/submit". */
14
+ declare function getActionByCan(can: string): ActionDefinition | undefined;
15
+
16
+ /**
17
+ * Bidirectional mapping between UCAN `can` vocabulary and registry `type` strings.
18
+ * Derived mechanically: strip "qi/", replace "." with "/".
19
+ */
20
+ /** Resolve a `can` ability string to the registry `type` string. */
21
+ declare function canToType(can: string): string | undefined;
22
+ /** Resolve a registry `type` string to the `can` ability string. */
23
+ declare function typeToCan(type: string): string | undefined;
24
+ /** Get all registered can↔type mappings. */
25
+ declare function getAllCanMappings(): ReadonlyArray<{
26
+ can: string;
27
+ type: string;
28
+ }>;
178
29
 
179
30
  /**
180
31
  * Builds an ActionServices map from BlocknoteHandlers.
@@ -185,6 +36,19 @@ declare function hasAction(type: string): boolean;
185
36
  */
186
37
  declare function buildServicesFromHandlers(handlers: any): ActionServices;
187
38
 
39
+ /**
40
+ * Resolve runtime references in an nb (caveats) object.
41
+ *
42
+ * At compile time, `{ "$ref": "nodeId.output.fieldPath" }` values are serialized
43
+ * as-is into the block's `inputs` JSON string. At execution time, this function
44
+ * replaces them with actual output values from upstream nodes.
45
+ *
46
+ * @param nb - The caveats object (may contain nested RuntimeRef values)
47
+ * @param getNodeOutput - Lookup function for upstream node outputs
48
+ * @returns A new object with all $ref values resolved
49
+ */
50
+ declare function resolveRuntimeRefs(nb: Record<string, unknown>, getNodeOutput: (nodeId: string) => Record<string, unknown> | undefined): Record<string, unknown>;
51
+
188
52
  /**
189
53
  * Compute an IPFS-compatible CID for arbitrary content.
190
54
  * Dependencies are lazy-loaded to avoid bundling IPFS libraries
@@ -198,4 +62,4 @@ declare function computeCID(content: Uint8Array): Promise<string>;
198
62
  */
199
63
  declare function computeJsonCID(obj: Record<string, any>): Promise<string>;
200
64
 
201
- export { type ActionContext, type ActionDefinition, type ActionResult, type ActionServices, type OutputSchemaField, buildServicesFromHandlers, computeCID, computeJsonCID, getAction, getAllActions, hasAction, registerAction };
65
+ export { ActionDefinition, ActionServices, buildServicesFromHandlers, canToType, computeCID, computeJsonCID, getAction, getActionByCan, getAllActions, getAllCanMappings, hasAction, registerAction, resolveRuntimeRefs, typeToCan };
@@ -1,59 +1,63 @@
1
1
  import {
2
- SimpleUCANManager,
2
+ compileBaseUcanFlow,
3
+ isRuntimeRef,
4
+ resolveRuntimeRefs,
5
+ setupFlowFromBaseUcan
6
+ } from "../chunk-5PHI3WWK.mjs";
7
+ import {
3
8
  buildAuthzFromProps,
4
9
  buildFlowNodeFromBlock,
5
10
  buildServicesFromHandlers,
11
+ canToType,
6
12
  clearRuntimeForTemplateClone,
7
- createDelegationStore,
8
13
  createInvocationStore,
9
- createMemoryDelegationStore,
10
14
  createMemoryInvocationStore,
11
15
  createMemoryUcanDelegationStore,
12
16
  createRuntimeStateManager,
13
17
  createUcanDelegationStore,
14
18
  createUcanService,
15
19
  executeNode,
16
- executeNodeWithInvocation,
17
- findValidCapability,
18
20
  getAction,
21
+ getActionByCan,
19
22
  getAllActions,
23
+ getAllCanMappings,
20
24
  hasAction,
21
- isActorAuthorized,
22
- isActorAuthorizedV2,
25
+ isAuthorized,
23
26
  isNodeActive,
24
27
  registerAction,
25
- validateCapabilityChain
26
- } from "../chunk-SUFKRSSM.mjs";
28
+ typeToCan
29
+ } from "../chunk-77R3T42S.mjs";
27
30
  import {
28
31
  computeCID,
29
32
  computeJsonCID
30
33
  } from "../chunk-VU34HOXM.mjs";
31
34
  export {
32
- SimpleUCANManager,
33
35
  buildAuthzFromProps,
34
36
  buildFlowNodeFromBlock,
35
37
  buildServicesFromHandlers,
38
+ canToType,
36
39
  clearRuntimeForTemplateClone,
40
+ compileBaseUcanFlow,
37
41
  computeCID,
38
42
  computeJsonCID,
39
- createDelegationStore,
40
43
  createInvocationStore,
41
- createMemoryDelegationStore,
42
44
  createMemoryInvocationStore,
43
45
  createMemoryUcanDelegationStore,
44
46
  createRuntimeStateManager,
45
47
  createUcanDelegationStore,
46
48
  createUcanService,
47
49
  executeNode,
48
- executeNodeWithInvocation,
49
- findValidCapability,
50
50
  getAction,
51
+ getActionByCan,
51
52
  getAllActions,
53
+ getAllCanMappings,
52
54
  hasAction,
53
- isActorAuthorized,
54
- isActorAuthorizedV2,
55
+ isAuthorized,
55
56
  isNodeActive,
57
+ isRuntimeRef,
56
58
  registerAction,
57
- validateCapabilityChain
59
+ resolveRuntimeRefs,
60
+ setupFlowFromBaseUcan,
61
+ typeToCan
58
62
  };
59
63
  //# sourceMappingURL=index.mjs.map
@@ -1,5 +1,5 @@
1
1
  import * as _blocknote_core from '@blocknote/core';
2
- import { K as IxoBlockProps, J as IxoEditorType, I as IxoEditorOptions, e as IxoCollaborativeEditorOptions, D as DelegationGrant } from './index-aAHFla8N.mjs';
2
+ import { K as IxoBlockProps, J as IxoEditorType, l as IxoEditorOptions, p as IxoCollaborativeEditorOptions, k as DelegationGrant } from './index-7ptWHYA8.mjs';
3
3
  import { Text, Doc, Map, Array as Array$1 } from 'yjs';
4
4
  import React from 'react';
5
5
  import { MatrixClient } from 'matrix-js-sdk';
@@ -2691,8 +2691,6 @@ interface CoverImageProps {
2691
2691
  declare function CoverImage({ coverImageUrl, logoUrl }: CoverImageProps): React.ReactElement | null;
2692
2692
 
2693
2693
  type AuthorizationTabState = {
2694
- parentCapability: string;
2695
- authorisedActors: string;
2696
2694
  activationUpstreamNodeId: string;
2697
2695
  activationRequiredStatus: 'pending' | 'approved' | 'rejected' | '';
2698
2696
  activationRequireAuthorisedActor: boolean;
@@ -2702,11 +2700,6 @@ interface AuthorizationTabProps extends IxoBlockProps {
2702
2700
  flowUri?: string;
2703
2701
  /** Entity DID that owns this flow */
2704
2702
  entityDid?: string;
2705
- /** Flow permissions (actors with flow-level access) */
2706
- flowActors?: Array<{
2707
- did: string;
2708
- displayName: string;
2709
- }>;
2710
2703
  /** Callback to open flow permissions panel */
2711
2704
  onOpenFlowPermissions?: () => void;
2712
2705
  }