@ixo/editor 2.26.0 → 2.27.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.
- package/dist/{chunk-CZDCWQZR.mjs → chunk-HT2SFUTR.mjs} +3165 -1729
- package/dist/chunk-HT2SFUTR.mjs.map +1 -0
- package/dist/{graphql-client-sR5y0LAb.d.ts → graphql-client-C6wosaS5.d.ts} +392 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.mjs +1 -1
- package/dist/mantine/index.d.ts +157 -3
- package/dist/mantine/index.mjs +19 -1
- package/package.json +2 -1
- package/dist/chunk-CZDCWQZR.mjs.map +0 -1
|
@@ -1544,6 +1544,7 @@ interface BlocknoteHandlers {
|
|
|
1544
1544
|
}>;
|
|
1545
1545
|
/**
|
|
1546
1546
|
* Sign a capability delegation
|
|
1547
|
+
* @deprecated Use createDelegation instead for @ixo/ucan CAR format
|
|
1547
1548
|
*/
|
|
1548
1549
|
signCapability?: (params: {
|
|
1549
1550
|
/** DID of issuer (entity or user) */
|
|
@@ -1573,6 +1574,7 @@ interface BlocknoteHandlers {
|
|
|
1573
1574
|
}>;
|
|
1574
1575
|
/**
|
|
1575
1576
|
* Verify a capability signature against issuer's DID document
|
|
1577
|
+
* @deprecated Use validateInvocation instead
|
|
1576
1578
|
*/
|
|
1577
1579
|
verifyCapabilitySignature?: (params: {
|
|
1578
1580
|
/** Raw capability JSON */
|
|
@@ -1583,6 +1585,101 @@ interface BlocknoteHandlers {
|
|
|
1583
1585
|
valid: boolean;
|
|
1584
1586
|
error?: string;
|
|
1585
1587
|
}>;
|
|
1588
|
+
/**
|
|
1589
|
+
* Create a delegation using @ixo/ucan (CAR format)
|
|
1590
|
+
*/
|
|
1591
|
+
createDelegation?: (params: {
|
|
1592
|
+
/** DID of issuer */
|
|
1593
|
+
issuerDid: string;
|
|
1594
|
+
/** Whether signing as entity or user */
|
|
1595
|
+
issuerType: 'entity' | 'user';
|
|
1596
|
+
/** Entity room ID (required if issuerType is 'entity') */
|
|
1597
|
+
entityRoomId?: string;
|
|
1598
|
+
/** DID of recipient */
|
|
1599
|
+
audience: string;
|
|
1600
|
+
/** Capabilities to grant */
|
|
1601
|
+
capabilities: Array<{
|
|
1602
|
+
can: string;
|
|
1603
|
+
with: string;
|
|
1604
|
+
nb?: Record<string, unknown>;
|
|
1605
|
+
}>;
|
|
1606
|
+
/** CIDs of proof delegations */
|
|
1607
|
+
proofs?: string[];
|
|
1608
|
+
/** Expiration timestamp (milliseconds) */
|
|
1609
|
+
expiration?: number;
|
|
1610
|
+
/** PIN to decrypt signing mnemonic */
|
|
1611
|
+
pin: string;
|
|
1612
|
+
}) => Promise<{
|
|
1613
|
+
/** Content ID of the delegation */
|
|
1614
|
+
cid: string;
|
|
1615
|
+
/** Base64-encoded CAR bytes */
|
|
1616
|
+
delegation: string;
|
|
1617
|
+
}>;
|
|
1618
|
+
/**
|
|
1619
|
+
* Create an invocation using @ixo/ucan (CAR format)
|
|
1620
|
+
*/
|
|
1621
|
+
createInvocation?: (params: {
|
|
1622
|
+
/** DID of invoker */
|
|
1623
|
+
invokerDid: string;
|
|
1624
|
+
/** Whether signing as entity or user */
|
|
1625
|
+
invokerType: 'entity' | 'user';
|
|
1626
|
+
/** Entity room ID (required if invokerType is 'entity') */
|
|
1627
|
+
entityRoomId?: string;
|
|
1628
|
+
/** Capability to invoke */
|
|
1629
|
+
capability: {
|
|
1630
|
+
can: string;
|
|
1631
|
+
with: string;
|
|
1632
|
+
nb?: Record<string, unknown>;
|
|
1633
|
+
};
|
|
1634
|
+
/** CIDs of proof delegations */
|
|
1635
|
+
proofs: string[];
|
|
1636
|
+
/** Additional facts/context */
|
|
1637
|
+
facts?: Record<string, unknown>;
|
|
1638
|
+
/** PIN to decrypt signing mnemonic */
|
|
1639
|
+
pin: string;
|
|
1640
|
+
}) => Promise<{
|
|
1641
|
+
/** Content ID of the invocation */
|
|
1642
|
+
cid: string;
|
|
1643
|
+
/** Base64-encoded CAR bytes */
|
|
1644
|
+
invocation: string;
|
|
1645
|
+
}>;
|
|
1646
|
+
/**
|
|
1647
|
+
* Validate an invocation against its proof chain
|
|
1648
|
+
*/
|
|
1649
|
+
validateInvocation?: (params: {
|
|
1650
|
+
/** Base64-encoded CAR invocation */
|
|
1651
|
+
invocation: string;
|
|
1652
|
+
/** Base64-encoded CAR delegations (proofs) */
|
|
1653
|
+
delegations: string[];
|
|
1654
|
+
}) => Promise<{
|
|
1655
|
+
valid: boolean;
|
|
1656
|
+
error?: string;
|
|
1657
|
+
/** Issuer DID if valid */
|
|
1658
|
+
issuer?: string;
|
|
1659
|
+
/** Validated capability if valid */
|
|
1660
|
+
capability?: {
|
|
1661
|
+
can: string;
|
|
1662
|
+
with: string;
|
|
1663
|
+
nb?: Record<string, unknown>;
|
|
1664
|
+
};
|
|
1665
|
+
}>;
|
|
1666
|
+
/**
|
|
1667
|
+
* Parse a delegation from Base64 CAR format
|
|
1668
|
+
*/
|
|
1669
|
+
parseDelegation?: (
|
|
1670
|
+
/** Base64-encoded CAR delegation */
|
|
1671
|
+
delegation: string) => Promise<{
|
|
1672
|
+
cid: string;
|
|
1673
|
+
issuer: string;
|
|
1674
|
+
audience: string;
|
|
1675
|
+
capabilities: Array<{
|
|
1676
|
+
can: string;
|
|
1677
|
+
with: string;
|
|
1678
|
+
nb?: Record<string, unknown>;
|
|
1679
|
+
}>;
|
|
1680
|
+
expiration?: number;
|
|
1681
|
+
proofs: string[];
|
|
1682
|
+
}>;
|
|
1586
1683
|
/**
|
|
1587
1684
|
* Search for users by name or DID
|
|
1588
1685
|
*/
|
|
@@ -1842,6 +1939,105 @@ interface BlocknoteHandlers {
|
|
|
1842
1939
|
status: 'not_started' | 'in_progress' | 'completed';
|
|
1843
1940
|
completedAt?: string;
|
|
1844
1941
|
}>;
|
|
1942
|
+
/**
|
|
1943
|
+
* Create a new signer session for handle-based signing.
|
|
1944
|
+
*
|
|
1945
|
+
* This allows the editor to request signing operations without receiving
|
|
1946
|
+
* raw key material. The host app manages the session lifecycle and key security.
|
|
1947
|
+
*
|
|
1948
|
+
* @example
|
|
1949
|
+
* ```typescript
|
|
1950
|
+
* // Create a session-scoped signer for batch operations
|
|
1951
|
+
* const session = await handlers.createSignerSession({
|
|
1952
|
+
* did: 'did:ixo:entity:abc123',
|
|
1953
|
+
* didType: 'entity',
|
|
1954
|
+
* entityRoomId: '!room:matrix.ixo.world',
|
|
1955
|
+
* pin: '123456',
|
|
1956
|
+
* scope: 'session',
|
|
1957
|
+
* ttlSeconds: 300
|
|
1958
|
+
* });
|
|
1959
|
+
*
|
|
1960
|
+
* // Use for multiple signatures without re-entering PIN
|
|
1961
|
+
* const sig1 = await handlers.signWithSession({ sessionId: session.sessionId, data: '...' });
|
|
1962
|
+
* const sig2 = await handlers.signWithSession({ sessionId: session.sessionId, data: '...' });
|
|
1963
|
+
*
|
|
1964
|
+
* // Release when done
|
|
1965
|
+
* await handlers.releaseSignerSession({ sessionId: session.sessionId });
|
|
1966
|
+
* ```
|
|
1967
|
+
*/
|
|
1968
|
+
createSignerSession?: (params: {
|
|
1969
|
+
/** DID of the signer (entity or user) */
|
|
1970
|
+
did: string;
|
|
1971
|
+
/** Whether signing as entity or user */
|
|
1972
|
+
didType: 'entity' | 'user';
|
|
1973
|
+
/** Entity room ID (required if didType is 'entity') */
|
|
1974
|
+
entityRoomId?: string;
|
|
1975
|
+
/** PIN to decrypt signing mnemonic */
|
|
1976
|
+
pin: string;
|
|
1977
|
+
/**
|
|
1978
|
+
* Session scope:
|
|
1979
|
+
* - 'session': Remains valid for multiple sign operations until TTL or explicit release
|
|
1980
|
+
* - 'operation': Automatically invalidated after first sign operation
|
|
1981
|
+
*/
|
|
1982
|
+
scope: 'session' | 'operation';
|
|
1983
|
+
/**
|
|
1984
|
+
* Time-to-live in seconds (only applicable for 'session' scope)
|
|
1985
|
+
* Default: 300 (5 minutes), Maximum: 3600 (1 hour)
|
|
1986
|
+
*/
|
|
1987
|
+
ttlSeconds?: number;
|
|
1988
|
+
}) => Promise<{
|
|
1989
|
+
/** Opaque session identifier */
|
|
1990
|
+
sessionId: string;
|
|
1991
|
+
/** DID of the signer */
|
|
1992
|
+
did: string;
|
|
1993
|
+
/** Public key in multibase format (for verification) */
|
|
1994
|
+
publicKey: string;
|
|
1995
|
+
/** Key ID (verification method ID) */
|
|
1996
|
+
keyId: string;
|
|
1997
|
+
/** Unix timestamp when the session expires */
|
|
1998
|
+
expiresAt: number;
|
|
1999
|
+
/** The scope this session was created with */
|
|
2000
|
+
scope: 'session' | 'operation';
|
|
2001
|
+
}>;
|
|
2002
|
+
/**
|
|
2003
|
+
* Sign data using an existing signer session.
|
|
2004
|
+
*
|
|
2005
|
+
* For 'operation' scoped sessions, the session is automatically
|
|
2006
|
+
* invalidated after this call succeeds.
|
|
2007
|
+
*
|
|
2008
|
+
* @throws If session not found, expired, or signing fails
|
|
2009
|
+
*/
|
|
2010
|
+
signWithSession?: (params: {
|
|
2011
|
+
/** The session ID returned from createSignerSession */
|
|
2012
|
+
sessionId: string;
|
|
2013
|
+
/** Data to sign (passed as-is to Ed25519 sign) */
|
|
2014
|
+
data: string;
|
|
2015
|
+
/** Algorithm hint (currently only Ed25519 supported) */
|
|
2016
|
+
algorithm?: 'Ed25519';
|
|
2017
|
+
}) => Promise<{
|
|
2018
|
+
/** The signature in hex format */
|
|
2019
|
+
signature: string;
|
|
2020
|
+
/** The algorithm used */
|
|
2021
|
+
algorithm: 'Ed25519';
|
|
2022
|
+
/** Key ID that was used for signing */
|
|
2023
|
+
keyId: string;
|
|
2024
|
+
}>;
|
|
2025
|
+
/**
|
|
2026
|
+
* Release a signer session before it expires.
|
|
2027
|
+
*
|
|
2028
|
+
* This immediately clears the session from host memory, preventing
|
|
2029
|
+
* any further signing operations. Idempotent - safe to call on
|
|
2030
|
+
* already-expired or released sessions.
|
|
2031
|
+
*/
|
|
2032
|
+
releaseSignerSession?: (params: {
|
|
2033
|
+
/** The session ID to release */
|
|
2034
|
+
sessionId: string;
|
|
2035
|
+
}) => Promise<{
|
|
2036
|
+
/** Whether the session was successfully released */
|
|
2037
|
+
released: boolean;
|
|
2038
|
+
/** Reason if not released (e.g., already expired) */
|
|
2039
|
+
reason?: string;
|
|
2040
|
+
}>;
|
|
1845
2041
|
}
|
|
1846
2042
|
type DocType = 'template' | 'page' | 'flow';
|
|
1847
2043
|
/**
|
|
@@ -2812,6 +3008,9 @@ declare const blockSpecs: {
|
|
|
2812
3008
|
readonly activationRequireAuthorisedActor: {
|
|
2813
3009
|
readonly default: false;
|
|
2814
3010
|
};
|
|
3011
|
+
readonly hookedActions: {
|
|
3012
|
+
readonly default: "";
|
|
3013
|
+
};
|
|
2815
3014
|
readonly assignment: {
|
|
2816
3015
|
readonly default: string;
|
|
2817
3016
|
};
|
|
@@ -2854,6 +3053,9 @@ declare const blockSpecs: {
|
|
|
2854
3053
|
readonly activationRequireAuthorisedActor: {
|
|
2855
3054
|
readonly default: false;
|
|
2856
3055
|
};
|
|
3056
|
+
readonly hookedActions: {
|
|
3057
|
+
readonly default: "";
|
|
3058
|
+
};
|
|
2857
3059
|
readonly assignment: {
|
|
2858
3060
|
readonly default: string;
|
|
2859
3061
|
};
|
|
@@ -3507,6 +3709,9 @@ declare const blockSpecs: {
|
|
|
3507
3709
|
readonly afterCreate: {
|
|
3508
3710
|
readonly default: "";
|
|
3509
3711
|
};
|
|
3712
|
+
readonly hookedActions: {
|
|
3713
|
+
readonly default: "";
|
|
3714
|
+
};
|
|
3510
3715
|
};
|
|
3511
3716
|
readonly content: "none";
|
|
3512
3717
|
};
|
|
@@ -3543,6 +3748,9 @@ declare const blockSpecs: {
|
|
|
3543
3748
|
readonly afterCreate: {
|
|
3544
3749
|
readonly default: "";
|
|
3545
3750
|
};
|
|
3751
|
+
readonly hookedActions: {
|
|
3752
|
+
readonly default: "";
|
|
3753
|
+
};
|
|
3546
3754
|
};
|
|
3547
3755
|
readonly content: "none";
|
|
3548
3756
|
}, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
|
|
@@ -3696,17 +3904,108 @@ interface FlowNodeBase {
|
|
|
3696
3904
|
}
|
|
3697
3905
|
type FlowNode = FlowNodeBase & FlowNodeAuthzExtension;
|
|
3698
3906
|
|
|
3907
|
+
/**
|
|
3908
|
+
* UCAN types for @ixo/ucan integration
|
|
3909
|
+
*
|
|
3910
|
+
* These types support the new invocation-based execution model where:
|
|
3911
|
+
* - Delegations grant permissions (stored as Base64 CAR)
|
|
3912
|
+
* - Invocations exercise permissions (stored for audit trail)
|
|
3913
|
+
*/
|
|
3914
|
+
/**
|
|
3915
|
+
* Caveats/constraints for a capability
|
|
3916
|
+
*/
|
|
3917
|
+
interface CapabilityCaveats {
|
|
3918
|
+
/** Intent - user-provided description of the purpose of this capability */
|
|
3919
|
+
int?: string;
|
|
3920
|
+
/** Additional custom caveats */
|
|
3921
|
+
[key: string]: unknown;
|
|
3922
|
+
}
|
|
3923
|
+
/**
|
|
3924
|
+
* Capability definition aligned with @ixo/ucan
|
|
3925
|
+
*/
|
|
3926
|
+
interface UcanCapability {
|
|
3927
|
+
/** Action that can be performed, e.g., "flow/execute", "flow/block/execute" */
|
|
3928
|
+
can: string;
|
|
3929
|
+
/** Resource URI, e.g., "ixo:flow:abc123", "ixo:flow:abc123:blockId" */
|
|
3930
|
+
with: string;
|
|
3931
|
+
/** Additional constraints/caveats (optional) */
|
|
3932
|
+
nb?: CapabilityCaveats;
|
|
3933
|
+
}
|
|
3934
|
+
/**
|
|
3935
|
+
* Stored delegation in new CAR format or legacy JSON format
|
|
3936
|
+
*/
|
|
3937
|
+
interface StoredDelegation {
|
|
3938
|
+
/** CID of the delegation (content-addressed ID) */
|
|
3939
|
+
cid: string;
|
|
3940
|
+
/** Base64-encoded CAR bytes (for 'car' format) or empty string for legacy */
|
|
3941
|
+
delegation: string;
|
|
3942
|
+
/** Issuer DID (for quick lookup without parsing) */
|
|
3943
|
+
issuerDid: string;
|
|
3944
|
+
/** Audience DID (for quick lookup without parsing) */
|
|
3945
|
+
audienceDid: string;
|
|
3946
|
+
/** Capabilities granted (for quick lookup without parsing) */
|
|
3947
|
+
capabilities: UcanCapability[];
|
|
3948
|
+
/** Expiration timestamp in milliseconds (for quick expiry checks) */
|
|
3949
|
+
expiration?: number;
|
|
3950
|
+
/** When this delegation was created (milliseconds) */
|
|
3951
|
+
createdAt: number;
|
|
3952
|
+
/** Format indicator: 'car' for new format, 'legacy' for old JSON format */
|
|
3953
|
+
format: 'car' | 'legacy';
|
|
3954
|
+
/** CIDs of proof delegations in the chain */
|
|
3955
|
+
proofCids: string[];
|
|
3956
|
+
}
|
|
3957
|
+
/**
|
|
3958
|
+
* Stored invocation for audit trail and replay protection
|
|
3959
|
+
*/
|
|
3960
|
+
interface StoredInvocation {
|
|
3961
|
+
/** CID of the invocation (content-addressed ID) */
|
|
3962
|
+
cid: string;
|
|
3963
|
+
/** Base64-encoded CAR bytes */
|
|
3964
|
+
invocation: string;
|
|
3965
|
+
/** DID of the invoker */
|
|
3966
|
+
invokerDid: string;
|
|
3967
|
+
/** Capability being invoked */
|
|
3968
|
+
capability: UcanCapability;
|
|
3969
|
+
/** When this invocation was executed (milliseconds) */
|
|
3970
|
+
executedAt: number;
|
|
3971
|
+
/** Flow ID context */
|
|
3972
|
+
flowId: string;
|
|
3973
|
+
/** Block ID if block-level execution */
|
|
3974
|
+
blockId?: string;
|
|
3975
|
+
/** Execution result */
|
|
3976
|
+
result: 'success' | 'failure';
|
|
3977
|
+
/** Error message if failed */
|
|
3978
|
+
error?: string;
|
|
3979
|
+
/** CIDs of the proof delegation chain */
|
|
3980
|
+
proofCids: string[];
|
|
3981
|
+
/** Linked claim ID if this invocation created a claim */
|
|
3982
|
+
claimId?: string;
|
|
3983
|
+
/** Transaction hash if submitted to blockchain */
|
|
3984
|
+
transactionHash?: string;
|
|
3985
|
+
}
|
|
3986
|
+
|
|
3699
3987
|
/**
|
|
3700
3988
|
* Capability types for UCAN-based authorization
|
|
3989
|
+
*
|
|
3990
|
+
* NOTE: This module contains legacy types for backward compatibility.
|
|
3991
|
+
* For new code, prefer using types from './ucan.ts' which align with @ixo/ucan.
|
|
3992
|
+
*/
|
|
3993
|
+
|
|
3994
|
+
/**
|
|
3995
|
+
* @deprecated Use UcanCapability from './ucan' for new code
|
|
3701
3996
|
*/
|
|
3702
3997
|
interface Capability {
|
|
3703
3998
|
/** Action that can be performed, e.g., "flow/execute", "flow/block/execute" */
|
|
3704
3999
|
can: string;
|
|
3705
4000
|
/** Resource URI, e.g., "ixo:flow:abc123", "ixo:flow:abc123:blockId" */
|
|
3706
4001
|
with: string;
|
|
3707
|
-
/** Additional constraints (optional) */
|
|
3708
|
-
nb?:
|
|
4002
|
+
/** Additional constraints/caveats (optional) */
|
|
4003
|
+
nb?: CapabilityCaveats;
|
|
3709
4004
|
}
|
|
4005
|
+
/**
|
|
4006
|
+
* @deprecated Use StoredDelegation from './ucan' for new code.
|
|
4007
|
+
* SignedCapability uses JSON format; StoredDelegation uses CAR format.
|
|
4008
|
+
*/
|
|
3710
4009
|
interface SignedCapability {
|
|
3711
4010
|
/** Unique identifier (CID or generated ID) */
|
|
3712
4011
|
id: string;
|
|
@@ -3746,6 +4045,61 @@ interface DelegationGrant {
|
|
|
3746
4045
|
canDelegate?: boolean;
|
|
3747
4046
|
}
|
|
3748
4047
|
|
|
4048
|
+
/**
|
|
4049
|
+
* UCAN Delegation Store with dual-mode support for CAR and legacy JSON formats
|
|
4050
|
+
*/
|
|
4051
|
+
interface UcanDelegationStore {
|
|
4052
|
+
get: (cid: string) => StoredDelegation | null;
|
|
4053
|
+
set: (delegation: StoredDelegation) => void;
|
|
4054
|
+
remove: (cid: string) => void;
|
|
4055
|
+
has: (cid: string) => boolean;
|
|
4056
|
+
getRoot: () => StoredDelegation | null;
|
|
4057
|
+
setRootCid: (cid: string) => void;
|
|
4058
|
+
getRootCid: () => string | null;
|
|
4059
|
+
getAll: () => StoredDelegation[];
|
|
4060
|
+
getByAudience: (audienceDid: string) => StoredDelegation[];
|
|
4061
|
+
getByIssuer: (issuerDid: string) => StoredDelegation[];
|
|
4062
|
+
findByCapability: (can: string, withUri: string) => StoredDelegation[];
|
|
4063
|
+
getVersion: () => number;
|
|
4064
|
+
setVersion: (version: number) => void;
|
|
4065
|
+
getLegacy: (id: string) => SignedCapability | null;
|
|
4066
|
+
hasLegacy: (id: string) => boolean;
|
|
4067
|
+
getAllLegacy: () => SignedCapability[];
|
|
4068
|
+
convertLegacyToStored: (legacy: SignedCapability) => StoredDelegation;
|
|
4069
|
+
}
|
|
4070
|
+
|
|
4071
|
+
/**
|
|
4072
|
+
* Invocation Store for storing and querying invocations
|
|
4073
|
+
*
|
|
4074
|
+
* Invocations are stored for:
|
|
4075
|
+
* - Audit trail: Cryptographic proof of who did what, when, with what authority
|
|
4076
|
+
* - Replay protection: Prevent same invocation being used twice
|
|
4077
|
+
* - Dispute resolution: Evidence if actions are contested
|
|
4078
|
+
* - Blockchain submission: Submit proofs to chain for immutable record
|
|
4079
|
+
* - Analytics: Understand flow execution patterns
|
|
4080
|
+
*/
|
|
4081
|
+
interface InvocationStore {
|
|
4082
|
+
add: (invocation: StoredInvocation) => void;
|
|
4083
|
+
get: (cid: string) => StoredInvocation | null;
|
|
4084
|
+
remove: (cid: string) => void;
|
|
4085
|
+
getAll: () => StoredInvocation[];
|
|
4086
|
+
getByInvoker: (invokerDid: string) => StoredInvocation[];
|
|
4087
|
+
getByFlow: (flowId: string) => StoredInvocation[];
|
|
4088
|
+
getByBlock: (flowId: string, blockId: string) => StoredInvocation[];
|
|
4089
|
+
getByCapability: (can: string, withUri: string) => StoredInvocation[];
|
|
4090
|
+
hasBeenInvoked: (cid: string) => boolean;
|
|
4091
|
+
getInDateRange: (startMs: number, endMs: number) => StoredInvocation[];
|
|
4092
|
+
getSuccessful: () => StoredInvocation[];
|
|
4093
|
+
getFailures: () => StoredInvocation[];
|
|
4094
|
+
getPendingSubmission: () => StoredInvocation[];
|
|
4095
|
+
markSubmitted: (cid: string, transactionHash: string) => void;
|
|
4096
|
+
getCount: () => number;
|
|
4097
|
+
getCountByResult: () => {
|
|
4098
|
+
success: number;
|
|
4099
|
+
failure: number;
|
|
4100
|
+
};
|
|
4101
|
+
}
|
|
4102
|
+
|
|
3749
4103
|
/**
|
|
3750
4104
|
* The schema type for the IXO editor, derived from block specs
|
|
3751
4105
|
*/
|
|
@@ -3815,6 +4169,22 @@ interface IxoEditorType<BSchema extends IxoBlockSchema = IxoBlockSchema, ISchema
|
|
|
3815
4169
|
* @internal
|
|
3816
4170
|
*/
|
|
3817
4171
|
_yDelegations?: Map<any>;
|
|
4172
|
+
/**
|
|
4173
|
+
* Y.Map for storing invocations (audit trail)
|
|
4174
|
+
* @internal
|
|
4175
|
+
*/
|
|
4176
|
+
_yInvocations?: Map<any>;
|
|
4177
|
+
/**
|
|
4178
|
+
* UCAN delegation store (new @ixo/ucan integration)
|
|
4179
|
+
* Supports both CAR format (new) and JSON format (legacy)
|
|
4180
|
+
* @internal
|
|
4181
|
+
*/
|
|
4182
|
+
_ucanDelegationStore?: UcanDelegationStore;
|
|
4183
|
+
/**
|
|
4184
|
+
* Invocation store for audit trail and replay protection
|
|
4185
|
+
* @internal
|
|
4186
|
+
*/
|
|
4187
|
+
_invocationStore?: InvocationStore;
|
|
3818
4188
|
/**
|
|
3819
4189
|
* Current editor mode (flow, template, readonly)
|
|
3820
4190
|
*/
|
|
@@ -3902,6 +4272,26 @@ interface IxoEditorType<BSchema extends IxoBlockSchema = IxoBlockSchema, ISchema
|
|
|
3902
4272
|
* Remove a delegation (revoke)
|
|
3903
4273
|
*/
|
|
3904
4274
|
removeDelegation?: (capabilityId: string) => void;
|
|
4275
|
+
/**
|
|
4276
|
+
* Add an invocation to the store (audit trail)
|
|
4277
|
+
*/
|
|
4278
|
+
addInvocation?: (invocation: StoredInvocation) => void;
|
|
4279
|
+
/**
|
|
4280
|
+
* Get an invocation by CID
|
|
4281
|
+
*/
|
|
4282
|
+
getInvocation?: (cid: string) => StoredInvocation | null;
|
|
4283
|
+
/**
|
|
4284
|
+
* Get all invocations
|
|
4285
|
+
*/
|
|
4286
|
+
getAllInvocations?: () => StoredInvocation[];
|
|
4287
|
+
/**
|
|
4288
|
+
* Get invocations for a specific block
|
|
4289
|
+
*/
|
|
4290
|
+
getInvocationsByBlock?: (flowId: string, blockId: string) => StoredInvocation[];
|
|
4291
|
+
/**
|
|
4292
|
+
* Check if an invocation has already been used (replay protection)
|
|
4293
|
+
*/
|
|
4294
|
+
hasBeenInvoked?: (cid: string) => boolean;
|
|
3905
4295
|
/**
|
|
3906
4296
|
* Matrix metadata manager for page metadata (cover, icon)
|
|
3907
4297
|
* @internal
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FlowNode, a as FlowNodeAuthzExtension, b as FlowNodeRuntimeState, I as IxoEditorType, S as SignedCapability, E as EvaluationStatus, C as Capability, c as CapabilityValidationResult } from './graphql-client-
|
|
2
|
-
export { a3 as Addr, J as ApiRequestBlockProps, t as ApiRequestBlockSpec, A as AuthorizationTab, i as AuthorizationTabState, U as AuthzExecActionTypes, Y as BlockRequirements, X as BlocknoteContextValue, W as BlocknoteHandlers, N as BlocknoteProvider, x as CheckboxBlockProps, s as CheckboxBlockSpec, aa as CosmosMsgForEmpty, g as CoverImage, h as CoverImageProps, D as DelegationGrant, ad as Entity, ae as EntityResponse, l as EntitySigningSetup, af as EntityVariables, j as EvaluationTab, k as EvaluationTabState, a6 as Expiration, m as FlowPermissionsPanel, G as GrantPermissionModal, ag as GraphQLClient, aj as GraphQLRequest, ai as GraphQLResponse, K as HttpMethod, r as IxoCollaborativeEditorOptions, q as IxoCollaborativeUser, e as IxoEditor, p as IxoEditorConfig, n as IxoEditorOptions, f as IxoEditorProps, o as IxoEditorTheme, M as KeyValuePair, z as ListBlockProps, y as ListBlockSettings, L as ListBlockSpec, O as OverviewBlock, B as OverviewBlockProps, ab as ProposalAction, H as ProposalBlockProps, P as ProposalBlockSpec, Z as ProposalResponse, _ as SingleChoiceProposal, T as StakeType, T as StakeTypeValue, a7 as Status, a8 as Threshold, a5 as Timestamp, a4 as Uint128, a2 as User, V as ValidatorActionType, a1 as Vote, a0 as VoteInfo, $ as VoteResponse, a9 as Votes, v as blockSpecs, ac as getEntity, w as getExtraSlashMenuItems, ah as ixoGraphQLClient, Q as useBlocknoteContext, R as useBlocknoteHandlers, d as useCreateCollaborativeIxoEditor, u as useCreateIxoEditor } from './graphql-client-
|
|
1
|
+
import { F as FlowNode, a as FlowNodeAuthzExtension, b as FlowNodeRuntimeState, I as IxoEditorType, S as SignedCapability, E as EvaluationStatus, C as Capability, c as CapabilityValidationResult } from './graphql-client-C6wosaS5.mjs';
|
|
2
|
+
export { a3 as Addr, J as ApiRequestBlockProps, t as ApiRequestBlockSpec, A as AuthorizationTab, i as AuthorizationTabState, U as AuthzExecActionTypes, Y as BlockRequirements, X as BlocknoteContextValue, W as BlocknoteHandlers, N as BlocknoteProvider, x as CheckboxBlockProps, s as CheckboxBlockSpec, aa as CosmosMsgForEmpty, g as CoverImage, h as CoverImageProps, D as DelegationGrant, ad as Entity, ae as EntityResponse, l as EntitySigningSetup, af as EntityVariables, j as EvaluationTab, k as EvaluationTabState, a6 as Expiration, m as FlowPermissionsPanel, G as GrantPermissionModal, ag as GraphQLClient, aj as GraphQLRequest, ai as GraphQLResponse, K as HttpMethod, r as IxoCollaborativeEditorOptions, q as IxoCollaborativeUser, e as IxoEditor, p as IxoEditorConfig, n as IxoEditorOptions, f as IxoEditorProps, o as IxoEditorTheme, M as KeyValuePair, z as ListBlockProps, y as ListBlockSettings, L as ListBlockSpec, O as OverviewBlock, B as OverviewBlockProps, ab as ProposalAction, H as ProposalBlockProps, P as ProposalBlockSpec, Z as ProposalResponse, _ as SingleChoiceProposal, T as StakeType, T as StakeTypeValue, a7 as Status, a8 as Threshold, a5 as Timestamp, a4 as Uint128, a2 as User, V as ValidatorActionType, a1 as Vote, a0 as VoteInfo, $ as VoteResponse, a9 as Votes, v as blockSpecs, ac as getEntity, w as getExtraSlashMenuItems, ah as ixoGraphQLClient, Q as useBlocknoteContext, R as useBlocknoteHandlers, d as useCreateCollaborativeIxoEditor, u as useCreateIxoEditor } from './graphql-client-C6wosaS5.mjs';
|
|
3
3
|
import { Map } from 'yjs';
|
|
4
4
|
export { Block, BlockNoteEditor, BlockNoteSchema, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, PartialBlock } from '@blocknote/core';
|
|
5
5
|
import 'react';
|
|
@@ -71,6 +71,8 @@ interface ExecutionOutcome {
|
|
|
71
71
|
error?: string;
|
|
72
72
|
result?: NodeActionResult;
|
|
73
73
|
capabilityId?: string;
|
|
74
|
+
/** Invocation CID (new @ixo/ucan) */
|
|
75
|
+
invocationCid?: string;
|
|
74
76
|
}
|
|
75
77
|
interface ExecuteNodeParams {
|
|
76
78
|
node: FlowNode;
|
|
@@ -84,6 +86,8 @@ interface AuthorizationResult {
|
|
|
84
86
|
authorized: boolean;
|
|
85
87
|
reason?: string;
|
|
86
88
|
capabilityId?: string;
|
|
89
|
+
/** Proof chain CIDs for creating invocations (new @ixo/ucan) */
|
|
90
|
+
proofCids?: string[];
|
|
87
91
|
/** @deprecated */
|
|
88
92
|
derived?: DerivedCapability;
|
|
89
93
|
}
|
package/dist/index.mjs
CHANGED
package/dist/mantine/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ak as IxoBlockProps } from '../graphql-client-
|
|
2
|
-
export { a3 as Addr, J as ApiRequestBlockProps, t as ApiRequestBlockSpec, A as AuthorizationTab, i as AuthorizationTabState, U as AuthzExecActionTypes, Y as BlockRequirements, X as BlocknoteContextValue,
|
|
1
|
+
import { ak as IxoBlockProps, W as BlocknoteHandlers } from '../graphql-client-C6wosaS5.mjs';
|
|
2
|
+
export { a3 as Addr, J as ApiRequestBlockProps, t as ApiRequestBlockSpec, A as AuthorizationTab, i as AuthorizationTabState, U as AuthzExecActionTypes, Y as BlockRequirements, X as BlocknoteContextValue, N as BlocknoteProvider, x as CheckboxBlockProps, s as CheckboxBlockSpec, aa as CosmosMsgForEmpty, g as CoverImage, h as CoverImageProps, av as DomainCardData, au as DomainCardRenderer, am as DropPosition, ar as DynamicListData, as as DynamicListDataProvider, at as DynamicListPanelRenderer, ad as Entity, ae as EntityResponse, l as EntitySigningSetup, af as EntityVariables, j as EvaluationTab, k as EvaluationTabState, a6 as Expiration, al as ExternalDropZone, m as FlowPermissionsPanel, G as GrantPermissionModal, ag as GraphQLClient, aj as GraphQLRequest, ai as GraphQLResponse, K as HttpMethod, r as IxoCollaborativeEditorOptions, q as IxoCollaborativeUser, e as IxoEditor, p as IxoEditorConfig, n as IxoEditorOptions, f as IxoEditorProps, o as IxoEditorTheme, I as IxoEditorType, M as KeyValuePair, z as ListBlockProps, y as ListBlockSettings, L as ListBlockSpec, O as OverviewBlock, B as OverviewBlockProps, an as PageHeader, ap as PageHeaderMenuItem, ao as PageHeaderProps, ab as ProposalAction, H as ProposalBlockProps, P as ProposalBlockSpec, Z as ProposalResponse, _ as SingleChoiceProposal, T as StakeType, T as StakeTypeValue, a7 as Status, a8 as Threshold, a5 as Timestamp, a4 as Uint128, a2 as User, V as ValidatorActionType, aq as VisualizationRenderer, a1 as Vote, a0 as VoteInfo, $ as VoteResponse, a9 as Votes, v as blockSpecs, ac as getEntity, w as getExtraSlashMenuItems, ah as ixoGraphQLClient, Q as useBlocknoteContext, R as useBlocknoteHandlers, d as useCreateCollaborativeIxoEditor, u as useCreateIxoEditor } from '../graphql-client-C6wosaS5.mjs';
|
|
3
3
|
import React$1, { PropsWithChildren } from 'react';
|
|
4
4
|
import * as zustand from 'zustand';
|
|
5
5
|
import * as _blocknote_core from '@blocknote/core';
|
|
@@ -182,4 +182,158 @@ declare const useListBlocksUIStore: zustand.UseBoundStore<zustand.StoreApi<ListB
|
|
|
182
182
|
*/
|
|
183
183
|
declare const useListBlocksUI: () => ListBlocksUIContextValue;
|
|
184
184
|
|
|
185
|
-
|
|
185
|
+
/**
|
|
186
|
+
* Defines a payload field available from a block action
|
|
187
|
+
*/
|
|
188
|
+
interface PayloadField {
|
|
189
|
+
key: string;
|
|
190
|
+
label: string;
|
|
191
|
+
type: 'string' | 'number' | 'boolean' | 'object';
|
|
192
|
+
description?: string;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Defines an action that a block can perform and its resulting payload
|
|
196
|
+
*/
|
|
197
|
+
interface BlockActionDefinition {
|
|
198
|
+
actionId: string;
|
|
199
|
+
label: string;
|
|
200
|
+
description: string;
|
|
201
|
+
payloadSchema: PayloadField[];
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Configuration field for a hooked action type
|
|
205
|
+
*/
|
|
206
|
+
interface HookedActionConfigField {
|
|
207
|
+
key: string;
|
|
208
|
+
label: string;
|
|
209
|
+
type: 'string' | 'select' | 'blockSelect' | 'templateSelect';
|
|
210
|
+
required: boolean;
|
|
211
|
+
description?: string;
|
|
212
|
+
placeholder?: string;
|
|
213
|
+
blockTypes?: string[];
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Context provided to hooked action execute functions
|
|
217
|
+
*/
|
|
218
|
+
interface HookedActionContext {
|
|
219
|
+
handlers: BlocknoteHandlers;
|
|
220
|
+
editor: any;
|
|
221
|
+
sourceBlock: any;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Defines a type of hooked action (e.g., sendEmail, addLinkedEntity)
|
|
225
|
+
*/
|
|
226
|
+
interface HookedActionType {
|
|
227
|
+
type: string;
|
|
228
|
+
label: string;
|
|
229
|
+
description: string;
|
|
230
|
+
configSchema: HookedActionConfigField[];
|
|
231
|
+
/**
|
|
232
|
+
* Execute the hooked action
|
|
233
|
+
* @param config - The action configuration from block props
|
|
234
|
+
* @param payload - The payload from the triggering action
|
|
235
|
+
* @param context - Handlers, editor, and source block
|
|
236
|
+
*/
|
|
237
|
+
execute: (config: HookedActionInstanceConfig, payload: Record<string, any>, context: HookedActionContext) => Promise<void>;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Configuration for a single hooked action instance on a block
|
|
241
|
+
*/
|
|
242
|
+
interface HookedActionInstanceConfig {
|
|
243
|
+
id: string;
|
|
244
|
+
type: string;
|
|
245
|
+
enabled: boolean;
|
|
246
|
+
config: Record<string, any>;
|
|
247
|
+
/**
|
|
248
|
+
* Maps action config fields to payload values
|
|
249
|
+
* e.g., { 'to': '{{payload.agentAddress}}', 'claimId': '{{payload.claimId}}' }
|
|
250
|
+
*/
|
|
251
|
+
variableMappings: Record<string, string>;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Configuration for all hooked actions on a block, organized by action ID
|
|
255
|
+
*/
|
|
256
|
+
interface HookedActionsConfig {
|
|
257
|
+
[actionId: string]: HookedActionInstanceConfig[];
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Result from executing hooked actions
|
|
261
|
+
*/
|
|
262
|
+
interface HookedActionsExecutionResult {
|
|
263
|
+
executed: number;
|
|
264
|
+
errors: string[];
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Register a hooked action type
|
|
269
|
+
*/
|
|
270
|
+
declare function registerHookedActionType(actionType: HookedActionType): void;
|
|
271
|
+
/**
|
|
272
|
+
* Get a hooked action type by its type ID
|
|
273
|
+
*/
|
|
274
|
+
declare function getHookedActionType(type: string): HookedActionType | undefined;
|
|
275
|
+
/**
|
|
276
|
+
* Get all registered hooked action types
|
|
277
|
+
*/
|
|
278
|
+
declare function getAllHookedActionTypes(): HookedActionType[];
|
|
279
|
+
/**
|
|
280
|
+
* Register block action definitions for a block type
|
|
281
|
+
*/
|
|
282
|
+
declare function registerBlockActions(blockType: string, actions: BlockActionDefinition[]): void;
|
|
283
|
+
/**
|
|
284
|
+
* Get action definitions for a block type
|
|
285
|
+
*/
|
|
286
|
+
declare function getBlockActions(blockType: string): BlockActionDefinition[];
|
|
287
|
+
|
|
288
|
+
interface UseHookedActionsProps {
|
|
289
|
+
block: any;
|
|
290
|
+
editor: any;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Hook for executing hooked actions on a block
|
|
294
|
+
*
|
|
295
|
+
* @example
|
|
296
|
+
* ```tsx
|
|
297
|
+
* const { executeHookedActions } = useHookedActions({ block, editor });
|
|
298
|
+
*
|
|
299
|
+
* // After main action completes
|
|
300
|
+
* const result = await handleCreate();
|
|
301
|
+
* executeHookedActions('create', {
|
|
302
|
+
* coreAddress: result.coreAddress,
|
|
303
|
+
* groupAddress: result.groupAddress,
|
|
304
|
+
* transactionHash: result.transactionHash,
|
|
305
|
+
* });
|
|
306
|
+
* ```
|
|
307
|
+
*/
|
|
308
|
+
declare function useHookedActions({ block, editor }: UseHookedActionsProps): {
|
|
309
|
+
executeHookedActions: (actionId: string, payload: Record<string, any>) => void;
|
|
310
|
+
executeHookedActionsWithResults: (actionId: string, payload: Record<string, any>) => Promise<HookedActionsExecutionResult>;
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Register all built-in hooked action types
|
|
315
|
+
* Call this at app initialization
|
|
316
|
+
*/
|
|
317
|
+
declare function registerBuiltInActionTypes(): void;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Initialize the hooked actions system.
|
|
321
|
+
* This registers all built-in action types and block action definitions.
|
|
322
|
+
* Should be called once at app startup.
|
|
323
|
+
*/
|
|
324
|
+
declare function initializeHookedActions(): void;
|
|
325
|
+
|
|
326
|
+
interface HookedActionsTabProps {
|
|
327
|
+
editor: any;
|
|
328
|
+
block: any;
|
|
329
|
+
/** Block action definitions - what actions this block exposes */
|
|
330
|
+
blockActions: BlockActionDefinition[];
|
|
331
|
+
/** Current hookedActions JSON string from block props */
|
|
332
|
+
hookedActions: string;
|
|
333
|
+
/** Callback when hookedActions config changes */
|
|
334
|
+
onHookedActionsChange: (value: string) => void;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
declare const HookedActionsTab: React$1.FC<HookedActionsTabProps>;
|
|
338
|
+
|
|
339
|
+
export { BaseIconPicker, type BlockActionDefinition, BlocknoteHandlers, type CollapseEvent, type ColumnPosition, type DataSource, type DynamicListAction, type DynamicListBlockProps, DynamicListBlockSpec, type DynamicListColumn, type DynamicListPanelConfig, type HookedActionInstanceConfig, type HookedActionType, type HookedActionsConfig, HookedActionsTab, type ListBlocksUIContextValue, type Listener, type PayloadField, getAllHookedActionTypes, getBlockActions, getHookedActionType, initializeHookedActions, registerBlockActions, registerBuiltInActionTypes, registerHookedActionType, useHookedActions, useListBlocksUI, useListBlocksUIStore, usePanel, usePanelStore };
|