@ixo/editor 3.0.0-beta.28 → 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,10 +1,10 @@
1
- import { r as ActionDefinition, t as ActionServices } from '../setup-C5MpJdyr.mjs';
2
- export { P as ActionContext, Q as ActionResult, m as ActivationResult, V as ActorConstraint, l as AuthorizationContext, G as AuthorizationContextV2, A as AuthorizationResult, B as BaseUcanFlow, M as CapabilityGrant, Y as CompiledBlock, Z as CompiledEdge, q as CompiledFlow, _ as CompiledFlowNode, C as CompilerRegistry, T as ConditionRef, D as DelegationStore, O as DerivedCapability, E as ExecuteNodeParams, x as ExecuteNodeParamsV2, k as ExecutionContext, y as ExecutionContextV2, j as ExecutionOutcome, p as FlowCapability, F as FlowRuntimeStateManager, N as NodeActionResult, R as OutputSchemaField, X as RuntimeRef, S as SetupFlowOptions, o as SetupFlowResult, K as SimpleUCANManager, W as TTLConstraint, L as UCANManager, U as UcanService, I as UcanServiceConfig, J as UcanServiceHandlers, h as buildAuthzFromProps, g as buildFlowNodeFromBlock, u as clearRuntimeForTemplateClone, n as compileBaseUcanFlow, c as createDelegationStore, b as createMemoryDelegationStore, d as createRuntimeStateManager, H as createUcanService, e as executeNode, w as executeNodeWithInvocation, f as findValidCapability, i as isActorAuthorized, z as isActorAuthorizedV2, a as isNodeActive, $ as isRuntimeRef, s as setupFlowFromBaseUcan, v as validateCapabilityChain } from '../setup-C5MpJdyr.mjs';
3
- 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-BmOZ-1iJ.mjs';
4
- 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';
5
4
  import 'yjs';
6
5
  import 'matrix-js-sdk';
7
6
  import '@blocknote/core';
7
+ import '@ixo/ucan';
8
8
 
9
9
  declare function registerAction(definition: ActionDefinition): void;
10
10
  declare function getAction(type: string): ActionDefinition | undefined;
@@ -3,43 +3,35 @@ import {
3
3
  isRuntimeRef,
4
4
  resolveRuntimeRefs,
5
5
  setupFlowFromBaseUcan
6
- } from "../chunk-SZSEZY6Z.mjs";
6
+ } from "../chunk-5PHI3WWK.mjs";
7
7
  import {
8
- SimpleUCANManager,
9
8
  buildAuthzFromProps,
10
9
  buildFlowNodeFromBlock,
11
10
  buildServicesFromHandlers,
12
11
  canToType,
13
12
  clearRuntimeForTemplateClone,
14
- createDelegationStore,
15
13
  createInvocationStore,
16
- createMemoryDelegationStore,
17
14
  createMemoryInvocationStore,
18
15
  createMemoryUcanDelegationStore,
19
16
  createRuntimeStateManager,
20
17
  createUcanDelegationStore,
21
18
  createUcanService,
22
19
  executeNode,
23
- executeNodeWithInvocation,
24
- findValidCapability,
25
20
  getAction,
26
21
  getActionByCan,
27
22
  getAllActions,
28
23
  getAllCanMappings,
29
24
  hasAction,
30
- isActorAuthorized,
31
- isActorAuthorizedV2,
25
+ isAuthorized,
32
26
  isNodeActive,
33
27
  registerAction,
34
- typeToCan,
35
- validateCapabilityChain
36
- } from "../chunk-NOMJJJDB.mjs";
28
+ typeToCan
29
+ } from "../chunk-77R3T42S.mjs";
37
30
  import {
38
31
  computeCID,
39
32
  computeJsonCID
40
33
  } from "../chunk-VU34HOXM.mjs";
41
34
  export {
42
- SimpleUCANManager,
43
35
  buildAuthzFromProps,
44
36
  buildFlowNodeFromBlock,
45
37
  buildServicesFromHandlers,
@@ -48,30 +40,24 @@ export {
48
40
  compileBaseUcanFlow,
49
41
  computeCID,
50
42
  computeJsonCID,
51
- createDelegationStore,
52
43
  createInvocationStore,
53
- createMemoryDelegationStore,
54
44
  createMemoryInvocationStore,
55
45
  createMemoryUcanDelegationStore,
56
46
  createRuntimeStateManager,
57
47
  createUcanDelegationStore,
58
48
  createUcanService,
59
49
  executeNode,
60
- executeNodeWithInvocation,
61
- findValidCapability,
62
50
  getAction,
63
51
  getActionByCan,
64
52
  getAllActions,
65
53
  getAllCanMappings,
66
54
  hasAction,
67
- isActorAuthorized,
68
- isActorAuthorizedV2,
55
+ isAuthorized,
69
56
  isNodeActive,
70
57
  isRuntimeRef,
71
58
  registerAction,
72
59
  resolveRuntimeRefs,
73
60
  setupFlowFromBaseUcan,
74
- typeToCan,
75
- validateCapabilityChain
61
+ typeToCan
76
62
  };
77
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-BmOZ-1iJ.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
  }
@@ -2,6 +2,7 @@ import * as _blocknote_core from '@blocknote/core';
2
2
  import { BlockSchemaFromSpecs, InlineContentSchema, StyleSchema, BlockNoteEditor, PartialBlock } from '@blocknote/core';
3
3
  import { MatrixClient } from 'matrix-js-sdk';
4
4
  import { Map, Array as Array$1 } from 'yjs';
5
+ import { Delegation } from '@ixo/ucan';
5
6
 
6
7
  declare const blockSpecs: {
7
8
  checkbox: {
@@ -603,12 +604,6 @@ declare const blockSpecs: {
603
604
  readonly claimCollectionId: {
604
605
  readonly default: "";
605
606
  };
606
- readonly parentCapability: {
607
- readonly default: "";
608
- };
609
- readonly authorisedActors: {
610
- readonly default: "";
611
- };
612
607
  readonly linkedClaimCollectionId: {
613
608
  readonly default: "";
614
609
  };
@@ -666,12 +661,6 @@ declare const blockSpecs: {
666
661
  readonly claimCollectionId: {
667
662
  readonly default: "";
668
663
  };
669
- readonly parentCapability: {
670
- readonly default: "";
671
- };
672
- readonly authorisedActors: {
673
- readonly default: "";
674
- };
675
664
  readonly linkedClaimCollectionId: {
676
665
  readonly default: "";
677
666
  };
@@ -1578,12 +1567,6 @@ declare const blockSpecs: {
1578
1567
  readonly conditions: {
1579
1568
  readonly default: "";
1580
1569
  };
1581
- readonly parentCapability: {
1582
- readonly default: "";
1583
- };
1584
- readonly authorisedActors: {
1585
- readonly default: "";
1586
- };
1587
1570
  readonly activationUpstreamNodeId: {
1588
1571
  readonly default: "";
1589
1572
  };
@@ -1653,12 +1636,6 @@ declare const blockSpecs: {
1653
1636
  readonly conditions: {
1654
1637
  readonly default: "";
1655
1638
  };
1656
- readonly parentCapability: {
1657
- readonly default: "";
1658
- };
1659
- readonly authorisedActors: {
1660
- readonly default: "";
1661
- };
1662
1639
  readonly activationUpstreamNodeId: {
1663
1640
  readonly default: "";
1664
1641
  };
@@ -1876,7 +1853,6 @@ declare class MatrixMetadataManager {
1876
1853
  dispose(): void;
1877
1854
  }
1878
1855
 
1879
- type CapabilityURI = string;
1880
1856
  type DID = string;
1881
1857
  type ClaimCollectionURI = string;
1882
1858
  type EvaluationStatus = 'pending' | 'approved' | 'rejected';
@@ -1886,11 +1862,13 @@ interface LinkedClaim {
1886
1862
  interface ActivationCondition {
1887
1863
  upstreamNodeId: string;
1888
1864
  requiredStatus: EvaluationStatus;
1865
+ /**
1866
+ * When true, activation requires the upstream block to have been executed
1867
+ * with a valid UCAN invocation (i.e. lastInvocationCid is set).
1868
+ */
1889
1869
  requireAuthorisedActor?: boolean;
1890
1870
  }
1891
1871
  interface FlowNodeAuthzExtension {
1892
- parentCapability?: CapabilityURI;
1893
- authorisedActors?: DID[];
1894
1872
  linkedClaim?: LinkedClaim;
1895
1873
  activationCondition?: ActivationCondition;
1896
1874
  }
@@ -1937,8 +1915,6 @@ interface FlowNodeRuntimeState {
1937
1915
  submittedByDid?: DID;
1938
1916
  evaluationStatus?: EvaluationStatus;
1939
1917
  executionTimestamp?: number;
1940
- derivedUcan?: string;
1941
- authorisedActorsSnapshot?: DID[];
1942
1918
  }
1943
1919
  interface FlowNodeBase {
1944
1920
  id: string;
@@ -1992,8 +1968,8 @@ interface StoredDelegation {
1992
1968
  expiration?: number;
1993
1969
  /** When this delegation was created (milliseconds) */
1994
1970
  createdAt: number;
1995
- /** Format indicator: 'car' for new format, 'legacy' for old JSON format */
1996
- format: 'car' | 'legacy';
1971
+ /** Format indicator */
1972
+ format: 'car';
1997
1973
  /** CIDs of proof delegations in the chain */
1998
1974
  proofCids: string[];
1999
1975
  }
@@ -2085,22 +2061,6 @@ interface FindProofsResult {
2085
2061
  /** Error message if not found */
2086
2062
  error?: string;
2087
2063
  }
2088
- /**
2089
- * Report from migrating legacy delegations
2090
- */
2091
- interface MigrationReport {
2092
- /** Total number of legacy delegations found */
2093
- total: number;
2094
- /** Number successfully migrated */
2095
- migrated: number;
2096
- /** Number that failed migration */
2097
- failed: number;
2098
- /** Details of failures */
2099
- errors: Array<{
2100
- id: string;
2101
- error: string;
2102
- }>;
2103
- }
2104
2064
  /**
2105
2065
  * Parameters for creating a root delegation
2106
2066
  */
@@ -2158,68 +2118,7 @@ interface CreateInvocationParams {
2158
2118
  }
2159
2119
 
2160
2120
  /**
2161
- * Capability types for UCAN-based authorization
2162
- *
2163
- * NOTE: This module contains legacy types for backward compatibility.
2164
- * For new code, prefer using types from './ucan.ts' which align with @ixo/ucan.
2165
- */
2166
-
2167
- /**
2168
- * @deprecated Use UcanCapability from './ucan' for new code
2169
- */
2170
- interface Capability {
2171
- /** Action that can be performed, e.g., "flow/execute", "flow/block/execute" */
2172
- can: string;
2173
- /** Resource URI, e.g., "ixo:flow:abc123", "ixo:flow:abc123:blockId" */
2174
- with: string;
2175
- /** Additional constraints/caveats (optional) */
2176
- nb?: CapabilityCaveats;
2177
- }
2178
- /**
2179
- * @deprecated Use StoredDelegation from './ucan' for new code.
2180
- * SignedCapability uses JSON format; StoredDelegation uses CAR format.
2181
- */
2182
- interface SignedCapability {
2183
- /** Unique identifier (CID or generated ID) */
2184
- id: string;
2185
- /** DID of the issuer (entity or user who signed) */
2186
- issuer: string;
2187
- /** DID of the recipient */
2188
- audience: string;
2189
- /** Capabilities being granted */
2190
- capabilities: Capability[];
2191
- /** IDs of parent capabilities in the chain (empty for root) */
2192
- proofs: string[];
2193
- /** Unix timestamp when capability expires (optional) */
2194
- expiration?: number;
2195
- /** ISO timestamp when created */
2196
- issuedAt: string;
2197
- /** Base64 encoded signature */
2198
- signature: string;
2199
- }
2200
- interface CapabilityValidationResult {
2201
- valid: boolean;
2202
- error?: string;
2203
- /** The full chain from root to the validated capability */
2204
- chain?: SignedCapability[];
2205
- }
2206
- interface DelegationGrant {
2207
- /** DID of recipient */
2208
- audience: string;
2209
- /** Display name of recipient (for UI) */
2210
- audienceDisplayName?: string;
2211
- /** Capabilities to grant */
2212
- capabilities: Capability[];
2213
- /** IDs of proof capabilities */
2214
- proofs: string[];
2215
- /** Expiration timestamp (optional) */
2216
- expiration?: number;
2217
- /** Whether recipient can further delegate */
2218
- canDelegate?: boolean;
2219
- }
2220
-
2221
- /**
2222
- * UCAN Delegation Store with dual-mode support for CAR and legacy JSON formats
2121
+ * UCAN Delegation Store — stores CAR-serialized delegations
2223
2122
  */
2224
2123
  interface UcanDelegationStore {
2225
2124
  get: (cid: string) => StoredDelegation | null;
@@ -2233,15 +2132,9 @@ interface UcanDelegationStore {
2233
2132
  getByAudience: (audienceDid: string) => StoredDelegation[];
2234
2133
  getByIssuer: (issuerDid: string) => StoredDelegation[];
2235
2134
  findByCapability: (can: string, withUri: string) => StoredDelegation[];
2236
- getVersion: () => number;
2237
- setVersion: (version: number) => void;
2238
- getLegacy: (id: string) => SignedCapability | null;
2239
- hasLegacy: (id: string) => boolean;
2240
- getAllLegacy: () => SignedCapability[];
2241
- convertLegacyToStored: (legacy: SignedCapability) => StoredDelegation;
2242
2135
  }
2243
2136
  /**
2244
- * Create a UCAN delegation store backed by Y.Map with dual-mode support
2137
+ * Create a UCAN delegation store backed by Y.Map
2245
2138
  */
2246
2139
  declare const createUcanDelegationStore: (yMap: Map<unknown>) => UcanDelegationStore;
2247
2140
  /**
@@ -2289,6 +2182,174 @@ declare const createInvocationStore: (yMap: Map<unknown>) => InvocationStore;
2289
2182
  */
2290
2183
  declare const createMemoryInvocationStore: () => InvocationStore;
2291
2184
 
2185
+ /**
2186
+ * UCAN Service using @ixo/ucan directly
2187
+ *
2188
+ * This service provides a high-level API for:
2189
+ * - Creating and managing delegations (CAR format)
2190
+ * - Creating and validating invocations
2191
+ * - Executing actions with invocation-based authorization
2192
+ *
2193
+ * The host app only needs to provide the signer (private key) after PIN decryption.
2194
+ * All UCAN operations are performed using @ixo/ucan directly.
2195
+ */
2196
+
2197
+ /**
2198
+ * Signer session scope type
2199
+ */
2200
+ type SignerSessionScope = 'session' | 'operation';
2201
+ /**
2202
+ * Signer session returned by createSignerSession
2203
+ */
2204
+ interface SignerSessionInfo {
2205
+ sessionId: string;
2206
+ did: string;
2207
+ publicKey: string;
2208
+ keyId: string;
2209
+ expiresAt: number;
2210
+ scope: SignerSessionScope;
2211
+ }
2212
+ /**
2213
+ * Handler functions for getting signers from the host application
2214
+ * The host app handles PIN decryption and key management
2215
+ */
2216
+ interface UcanServiceHandlers {
2217
+ /**
2218
+ * Get a signer for the given DID after PIN verification
2219
+ * The host app decrypts the private key using the PIN
2220
+ *
2221
+ * @returns The private key in multibase format (for parseSigner)
2222
+ * @deprecated Prefer createSignerSession for better security
2223
+ */
2224
+ getPrivateKey?: (params: {
2225
+ did: string;
2226
+ didType: 'entity' | 'user';
2227
+ entityRoomId?: string;
2228
+ pin: string;
2229
+ }) => Promise<string>;
2230
+ /**
2231
+ * Get a signer from mnemonic (alternative to getPrivateKey)
2232
+ * The host app retrieves and decrypts the mnemonic using the PIN
2233
+ *
2234
+ * @returns The mnemonic phrase
2235
+ * @deprecated Prefer createSignerSession for better security
2236
+ */
2237
+ getMnemonic?: (params: {
2238
+ did: string;
2239
+ didType: 'entity' | 'user';
2240
+ entityRoomId?: string;
2241
+ pin: string;
2242
+ }) => Promise<string>;
2243
+ /**
2244
+ * Create a signer session that can be used for multiple sign operations.
2245
+ * The host app keeps the key material secure; the editor only receives an opaque handle.
2246
+ *
2247
+ * @param params.scope - 'session' for multiple operations, 'operation' for one-time use
2248
+ * @param params.ttlSeconds - Time-to-live for session scope (default: 300, max: 3600)
2249
+ */
2250
+ createSignerSession?: (params: {
2251
+ did: string;
2252
+ didType: 'entity' | 'user';
2253
+ entityRoomId?: string;
2254
+ pin: string;
2255
+ scope: SignerSessionScope;
2256
+ ttlSeconds?: number;
2257
+ }) => Promise<SignerSessionInfo>;
2258
+ /**
2259
+ * Sign data using an existing session.
2260
+ * For 'operation' scope, the session is automatically invalidated after this call.
2261
+ */
2262
+ signWithSession?: (params: {
2263
+ sessionId: string;
2264
+ data: string;
2265
+ algorithm?: 'Ed25519';
2266
+ }) => Promise<{
2267
+ signature: string;
2268
+ algorithm: 'Ed25519';
2269
+ keyId: string;
2270
+ }>;
2271
+ /**
2272
+ * Release a session before it expires.
2273
+ * Safe to call on already-released or expired sessions.
2274
+ */
2275
+ releaseSignerSession?: (params: {
2276
+ sessionId: string;
2277
+ }) => Promise<{
2278
+ released: boolean;
2279
+ reason?: string;
2280
+ }>;
2281
+ /**
2282
+ * Create a delegation directly in the host app.
2283
+ * The host handles all signing internally using session-based signing.
2284
+ * This is the preferred approach for security.
2285
+ */
2286
+ createDelegationWithSession?: (params: {
2287
+ sessionId: string;
2288
+ audience: string;
2289
+ capabilities: Array<{
2290
+ can: string;
2291
+ with: string;
2292
+ nb?: Record<string, unknown>;
2293
+ }>;
2294
+ proofs?: string[];
2295
+ expiration?: number;
2296
+ }) => Promise<{
2297
+ cid: string;
2298
+ delegation: string;
2299
+ }>;
2300
+ /**
2301
+ * Create an invocation directly in the host app.
2302
+ * The host handles all signing internally using session-based signing.
2303
+ * This is the preferred approach for security.
2304
+ */
2305
+ createInvocationWithSession?: (params: {
2306
+ sessionId: string;
2307
+ audience: string;
2308
+ capability: {
2309
+ can: string;
2310
+ with: string;
2311
+ nb?: Record<string, unknown>;
2312
+ };
2313
+ proofs: string[];
2314
+ }) => Promise<{
2315
+ cid: string;
2316
+ invocation: string;
2317
+ }>;
2318
+ }
2319
+ /**
2320
+ * Configuration for UcanService
2321
+ */
2322
+ interface UcanServiceConfig {
2323
+ delegationStore: UcanDelegationStore;
2324
+ invocationStore: InvocationStore;
2325
+ handlers: UcanServiceHandlers;
2326
+ flowOwnerDid: string;
2327
+ flowUri: string;
2328
+ }
2329
+ /**
2330
+ * UCAN Service interface
2331
+ */
2332
+ interface UcanService {
2333
+ createRootDelegation: (params: CreateRootDelegationParams) => Promise<StoredDelegation>;
2334
+ createDelegation: (params: CreateDelegationParams) => Promise<StoredDelegation>;
2335
+ revokeDelegation: (cid: string) => void;
2336
+ getDelegation: (cid: string) => StoredDelegation | null;
2337
+ getAllDelegations: () => StoredDelegation[];
2338
+ getRootDelegation: () => StoredDelegation | null;
2339
+ createAndValidateInvocation: (params: CreateInvocationParams, flowId: string, blockId?: string) => Promise<InvocationResult>;
2340
+ executeWithInvocation: <T>(params: CreateInvocationParams, action: () => Promise<T>, flowId: string, blockId?: string) => Promise<ExecutionWithInvocationResult & {
2341
+ actionResult?: T;
2342
+ }>;
2343
+ validateDelegationChain: (audienceDid: string, capability: UcanCapability) => Promise<DelegationChainValidationResult>;
2344
+ findValidProofs: (audienceDid: string, capability: UcanCapability) => Promise<FindProofsResult>;
2345
+ parseDelegationFromStore: (cid: string) => Promise<Delegation | null>;
2346
+ isConfigured: () => boolean;
2347
+ }
2348
+ /**
2349
+ * Create a UCAN service instance
2350
+ */
2351
+ declare const createUcanService: (config: UcanServiceConfig) => UcanService;
2352
+
2292
2353
  /**
2293
2354
  * The schema type for the IXO editor, derived from block specs
2294
2355
  */
@@ -2440,17 +2501,21 @@ interface IxoEditorType<BSchema extends IxoBlockSchema = IxoBlockSchema, ISchema
2440
2501
  */
2441
2502
  getFlowNode?: (nodeId: string) => FlowNode | null;
2442
2503
  /**
2443
- * Get a delegation by ID
2504
+ * Get the UCAN service for this flow
2505
+ */
2506
+ getUcanService?: () => UcanService | null;
2507
+ /**
2508
+ * Get a delegation by CID
2444
2509
  */
2445
- getDelegation?: (capabilityId: string) => SignedCapability | null;
2510
+ getDelegation?: (cid: string) => StoredDelegation | null;
2446
2511
  /**
2447
- * Store a delegation
2512
+ * Store a delegation (legacy compatibility — prefers UcanService)
2448
2513
  */
2449
- setDelegation?: (capability: SignedCapability) => void;
2514
+ setDelegation?: (delegation: any) => void;
2450
2515
  /**
2451
2516
  * Get the root capability for this flow
2452
2517
  */
2453
- getRootCapability?: () => SignedCapability | null;
2518
+ getRootCapability?: () => any | null;
2454
2519
  /**
2455
2520
  * Set the root capability ID
2456
2521
  */
@@ -2458,11 +2523,11 @@ interface IxoEditorType<BSchema extends IxoBlockSchema = IxoBlockSchema, ISchema
2458
2523
  /**
2459
2524
  * Get all delegations as array
2460
2525
  */
2461
- getAllDelegations?: () => SignedCapability[];
2526
+ getAllDelegations?: () => any[];
2462
2527
  /**
2463
2528
  * Remove a delegation (revoke)
2464
2529
  */
2465
- removeDelegation?: (capabilityId: string) => void;
2530
+ removeDelegation?: (cid: string) => void;
2466
2531
  /**
2467
2532
  * Add an invocation to the store (audit trail)
2468
2533
  */
@@ -2545,6 +2610,29 @@ interface IxoBlockProps<TBlock = any> {
2545
2610
  block: TBlock;
2546
2611
  }
2547
2612
 
2613
+ /**
2614
+ * Capability types for UCAN-based authorization
2615
+ */
2616
+
2617
+ /**
2618
+ * Grant request for delegating capabilities to a recipient.
2619
+ * Used by the GrantPermissionPanel UI.
2620
+ */
2621
+ interface DelegationGrant {
2622
+ /** DID of recipient */
2623
+ audience: string;
2624
+ /** Display name of recipient (for UI) */
2625
+ audienceDisplayName?: string;
2626
+ /** Capabilities to grant */
2627
+ capabilities: UcanCapability[];
2628
+ /** CIDs of proof delegations */
2629
+ proofs: string[];
2630
+ /** Expiration timestamp (optional) */
2631
+ expiration?: number;
2632
+ /** Whether recipient can further delegate */
2633
+ canDelegate?: boolean;
2634
+ }
2635
+
2548
2636
  type IxoEditorTheme = 'light' | 'dark';
2549
2637
  interface IxoEditorOptions {
2550
2638
  /**
@@ -2647,4 +2735,4 @@ interface IxoEditorConfig {
2647
2735
  tableHandles: boolean;
2648
2736
  }
2649
2737
 
2650
- export { type ActivationCondition as A, type CreateRootDelegationParams as B, type Capability as C, type DelegationGrant as D, type EvaluationStatus as E, type FlowNodeAuthzExtension as F, type CreateDelegationParams as G, type CreateInvocationParams as H, type IxoEditorOptions as I, type IxoEditorType as J, type IxoBlockProps as K, type LinkedClaim as L, type MigrationReport as M, type NodeState as N, type SignedCapability as S, type UcanDelegationStore as U, type CapabilityValidationResult as a, type IxoEditorTheme as b, type IxoEditorConfig as c, type IxoCollaborativeUser as d, type IxoCollaborativeEditorOptions as e, blockSpecs as f, getExtraSlashMenuItems as g, createUcanDelegationStore as h, createMemoryUcanDelegationStore as i, createInvocationStore as j, createMemoryInvocationStore as k, type InvocationStore as l, type CapabilityURI as m, type DID as n, type ClaimCollectionURI as o, type FlowNodeRuntimeState as p, type FlowNodeBase as q, type FlowNode as r, type UcanCapability as s, type StoredDelegation as t, type StoredInvocation as u, type InvocationRequest as v, type InvocationResult as w, type ExecutionWithInvocationResult as x, type DelegationChainValidationResult as y, type FindProofsResult as z };
2738
+ export { type ActivationCondition as A, type CreateRootDelegationParams as B, type ClaimCollectionURI as C, type DelegationChainValidationResult as D, type EvaluationStatus as E, type FlowNodeAuthzExtension as F, type CreateDelegationParams as G, type CreateInvocationParams as H, type InvocationStore as I, type IxoEditorType as J, type IxoBlockProps as K, type LinkedClaim as L, type NodeState as N, type StoredDelegation as S, type UcanDelegationStore as U, createMemoryUcanDelegationStore as a, createInvocationStore as b, createUcanDelegationStore as c, createMemoryInvocationStore as d, createUcanService as e, type UcanService as f, type UcanServiceConfig as g, type UcanServiceHandlers as h, type UcanCapability as i, type StoredInvocation as j, type DelegationGrant as k, type IxoEditorOptions as l, type IxoEditorTheme as m, type IxoEditorConfig as n, type IxoCollaborativeUser as o, type IxoCollaborativeEditorOptions as p, blockSpecs as q, getExtraSlashMenuItems as r, type DID as s, type FlowNodeRuntimeState as t, type FlowNodeBase as u, type FlowNode as v, type InvocationRequest as w, type InvocationResult as x, type ExecutionWithInvocationResult as y, type FindProofsResult as z };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { N as Addr, n as ApiRequestBlockProps, h as ApiRequestBlockSpec, A as AuthorizationTab, d as AuthorizationTabState, t as AuthzExecActionTypes, B as BlockPresenceUser, x as BlockRequirements, w as BlocknoteContextValue, v as BlocknoteHandlers, q as BlocknoteProvider, i as CheckboxBlockProps, g as CheckboxBlockSpec, Z as CosmosMsgForEmpty, C as CoverImage, c as CoverImageProps, a0 as Entity, a1 as EntityResponse, f as EntitySigningSetup, a2 as EntityVariables, E as EvaluationTab, e as EvaluationTabState, R as Expiration, F as FlowPermissionsPanel, G as GrantPermissionModal, a3 as GraphQLClient, a6 as GraphQLRequest, a5 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, _ as ProposalAction, m as ProposalBlockProps, P as ProposalBlockSpec, y as ProposalResponse, z as SingleChoiceProposal, S as StakeType, S as StakeTypeValue, W as Status, X as Threshold, T as Timestamp, Q as Uint128, U as User, V as ValidatorActionType, M as Vote, J as VoteInfo, D as VoteResponse, Y as Votes, $ as getEntity, a4 as ixoGraphQLClient, o as useBlockPresence, r as useBlocknoteContext, s as useBlocknoteHandlers, a as useCreateCollaborativeIxoEditor, u as useCreateIxoEditor, p as useTrackBlockFocus } from './graphql-client-CSiffz9I.mjs';
2
- export { m as ActivationResult, l as AuthorizationContext, A as AuthorizationResult, B as BaseUcanFlow, q as CompiledFlow, C as CompilerRegistry, D as DelegationStore, E as ExecuteNodeParams, k as ExecutionContext, j as ExecutionOutcome, p as FlowCapability, F as FlowRuntimeStateManager, N as NodeActionResult, S as SetupFlowOptions, o as SetupFlowResult, h as buildAuthzFromProps, g as buildFlowNodeFromBlock, n as compileBaseUcanFlow, c as createDelegationStore, b as createMemoryDelegationStore, d as createRuntimeStateManager, e as executeNode, f as findValidCapability, i as isActorAuthorized, a as isNodeActive, s as setupFlowFromBaseUcan, v as validateCapabilityChain } from './setup-C5MpJdyr.mjs';
3
- export { C as Capability, a as CapabilityValidationResult, D as DelegationGrant, e as IxoCollaborativeEditorOptions, d as IxoCollaborativeUser, c as IxoEditorConfig, I as IxoEditorOptions, b as IxoEditorTheme, S as SignedCapability, f as blockSpecs, g as getExtraSlashMenuItems } from './index-BmOZ-1iJ.mjs';
1
+ export { N as Addr, n as ApiRequestBlockProps, h as ApiRequestBlockSpec, A as AuthorizationTab, d as AuthorizationTabState, t as AuthzExecActionTypes, B as BlockPresenceUser, x as BlockRequirements, w as BlocknoteContextValue, v as BlocknoteHandlers, q as BlocknoteProvider, i as CheckboxBlockProps, g as CheckboxBlockSpec, Z as CosmosMsgForEmpty, C as CoverImage, c as CoverImageProps, a0 as Entity, a1 as EntityResponse, f as EntitySigningSetup, a2 as EntityVariables, E as EvaluationTab, e as EvaluationTabState, R as Expiration, F as FlowPermissionsPanel, G as GrantPermissionModal, a3 as GraphQLClient, a6 as GraphQLRequest, a5 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, _ as ProposalAction, m as ProposalBlockProps, P as ProposalBlockSpec, y as ProposalResponse, z as SingleChoiceProposal, S as StakeType, S as StakeTypeValue, W as Status, X as Threshold, T as Timestamp, Q as Uint128, U as User, V as ValidatorActionType, M as Vote, J as VoteInfo, D as VoteResponse, Y as Votes, $ as getEntity, a4 as ixoGraphQLClient, o as useBlockPresence, r as useBlocknoteContext, s as useBlocknoteHandlers, a as useCreateCollaborativeIxoEditor, u as useCreateIxoEditor, p as useTrackBlockFocus } from './graphql-client-D1Zgezg6.mjs';
2
+ export { h as ActivationResult, A as AuthorizationResult, B as BaseUcanFlow, m as CompiledFlow, C as CompilerRegistry, E as ExecuteNodeParams, g as ExecutionContext, f as ExecutionOutcome, l as FlowCapability, F as FlowRuntimeStateManager, N as NodeActionResult, S as SetupFlowOptions, k as SetupFlowResult, d as buildAuthzFromProps, b as buildFlowNodeFromBlock, j as compileBaseUcanFlow, c as createRuntimeStateManager, e as executeNode, i as isAuthorized, a as isNodeActive, s as setupFlowFromBaseUcan } from './setup-CahGoKeh.mjs';
3
+ export { D as DelegationChainValidationResult, k as DelegationGrant, I as InvocationStore, p as IxoCollaborativeEditorOptions, o as IxoCollaborativeUser, n as IxoEditorConfig, l as IxoEditorOptions, m as IxoEditorTheme, S as StoredDelegation, j as StoredInvocation, i as UcanCapability, U as UcanDelegationStore, f as UcanService, g as UcanServiceConfig, h as UcanServiceHandlers, q as blockSpecs, b as createInvocationStore, d as createMemoryInvocationStore, a as createMemoryUcanDelegationStore, c as createUcanDelegationStore, e as createUcanService, r as getExtraSlashMenuItems } from './index-7ptWHYA8.mjs';
4
4
  export { CloneDocumentResult, cloneDocument } from '@ixo/matrix-crdt';
5
5
  export { Block, BlockNoteEditor, BlockNoteSchema, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, PartialBlock } from '@blocknote/core';
6
6
  import 'yjs';
package/dist/index.mjs CHANGED
@@ -26,23 +26,24 @@ import {
26
26
  useCreateCollaborativeIxoEditor,
27
27
  useCreateIxoEditor,
28
28
  useTrackBlockFocus
29
- } from "./chunk-LQP2DPYM.mjs";
29
+ } from "./chunk-EDCITCO5.mjs";
30
30
  import {
31
31
  compileBaseUcanFlow,
32
32
  setupFlowFromBaseUcan
33
- } from "./chunk-SZSEZY6Z.mjs";
33
+ } from "./chunk-5PHI3WWK.mjs";
34
34
  import {
35
35
  buildAuthzFromProps,
36
36
  buildFlowNodeFromBlock,
37
- createDelegationStore,
38
- createMemoryDelegationStore,
37
+ createInvocationStore,
38
+ createMemoryInvocationStore,
39
+ createMemoryUcanDelegationStore,
39
40
  createRuntimeStateManager,
41
+ createUcanDelegationStore,
42
+ createUcanService,
40
43
  executeNode,
41
- findValidCapability,
42
- isActorAuthorized,
43
- isNodeActive,
44
- validateCapabilityChain
45
- } from "./chunk-NOMJJJDB.mjs";
44
+ isAuthorized,
45
+ isNodeActive
46
+ } from "./chunk-77R3T42S.mjs";
46
47
 
47
48
  // src/index.ts
48
49
  import { cloneDocument } from "@ixo/matrix-crdt";
@@ -69,14 +70,16 @@ export {
69
70
  buildFlowNodeFromBlock,
70
71
  cloneDocument,
71
72
  compileBaseUcanFlow,
72
- createDelegationStore,
73
- createMemoryDelegationStore,
73
+ createInvocationStore,
74
+ createMemoryInvocationStore,
75
+ createMemoryUcanDelegationStore,
74
76
  createRuntimeStateManager,
77
+ createUcanDelegationStore,
78
+ createUcanService,
75
79
  executeNode,
76
- findValidCapability,
77
80
  getEntity,
78
81
  getExtraSlashMenuItems,
79
- isActorAuthorized,
82
+ isAuthorized,
80
83
  isNodeActive,
81
84
  ixoGraphQLClient,
82
85
  setupFlowFromBaseUcan,
@@ -85,7 +88,6 @@ export {
85
88
  useBlocknoteHandlers,
86
89
  useCreateCollaborativeIxoEditor,
87
90
  useCreateIxoEditor,
88
- useTrackBlockFocus,
89
- validateCapabilityChain
91
+ useTrackBlockFocus
90
92
  };
91
93
  //# sourceMappingURL=index.mjs.map