@ixo/editor 5.26.0 → 5.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { a5 as ActionDefinition, a6 as ActionServices, Z as FlowAgentCommand, $ as FlowAgentContext, _ as FlowAgentCommandResult, a0 as FlowAgentExecutor, a2 as FlowAgentNodeSnapshot, a7 as FlowAgentBlockerCause, a3 as FlowAgentPublicNodeState } from '../store-tdIRq7y0.mjs';
2
- export { aj as AcquireFlowAgentLeaseParams, a9 as ActionContext, aa as ActionResult, ax as ActorConstraint, A as AuthorizationResult, B as BaseUcanFlow, X as BuildFlowAgentContextParams, aA as CompiledBlock, aB as CompiledEdge, v as CompiledFlow, aC as CompiledFlowNode, C as CompilerRegistry, aw as ConditionRef, ak as CreateAgentCommandParams, al as EvaluateFlowAgentPolicyParams, E as ExecuteNodeParams, f as ExecutionContext, d as ExecutionOutcome, Y as FlowAgentActor, ao as FlowAgentCommandBase, ap as FlowAgentCommandStatus, aq as FlowAgentCommandType, a1 as FlowAgentLease, ar as FlowAgentLedgerEvent, as as FlowAgentLedgerEventType, at as FlowAgentMaps, am as FlowAgentOrchestratorOptions, au as FlowAgentPolicyDecision, av as FlowAgentRunPhase, x as FlowAgentService, an as FlowAgentServiceOptions, a4 as FlowAgentTickResult, u as FlowCapability, F as FlowRuntimeStateManager, w as FlowStrategy, M as MergeResult, N as NodeActionResult, ab as OutputSchemaField, R as ReadFlowOptions, q as ReadFlowResult, az as RuntimeRef, S as SetupFlowOptions, p as SetupFlowResult, ay as TTLConstraint, aD as TriggerSpec, y as acquireFlowAgentLease, z as appendAgentLedgerEvent, a as buildAuthzFromProps, D as buildFlowAgentContext, b as buildFlowNodeFromBlock, ac as canMatches, G as cleanupExpiredFlowAgentLeases, a8 as clearRuntimeForTemplateClone, l as compileBaseUcanFlow, ad as computeAgentCommandId, H as createAgentCommand, c as createRuntimeStateManager, o as decompileToBaseUcanFlow, I as evaluateFlowAgentPolicy, e as executeNode, J as executeQueuedAgentCommands, k as getActiveEditor, K as getFlowAgentMaps, i as isAuthorized, ae as isCapabilityMatch, af as isExternalMutation, aE as isRuntimeRef, n as mergeCompiledFlows, L as planRalphLoopCommands, O as queueAgentCommand, P as readAgentLedgerEvents, m as readCompiledFlowFromYDoc, h as readFlow, r as readFlowAsBaseUcan, g as readFlowFromEditor, Q as readQueuedAgentCommands, T as releaseFlowAgentLease, ag as requiredCapabilityForCommand, ah as resourceMatches, j as setActiveEditor, s as setupFlowFromBaseUcan, U as tickFlowAgent, ai as updateAgentCommand, V as validateAgentCommand, W as validateFlowAgentLease } from '../store-tdIRq7y0.mjs';
1
+ import { a5 as ActionDefinition, a6 as ActionServices, Z as FlowAgentCommand, $ as FlowAgentContext, _ as FlowAgentCommandResult, a0 as FlowAgentExecutor, a2 as FlowAgentNodeSnapshot, a7 as FlowAgentBlockerCause, a3 as FlowAgentPublicNodeState } from '../store-CiuZEEsv.mjs';
2
+ export { aj as AcquireFlowAgentLeaseParams, a9 as ActionContext, aa as ActionResult, ax as ActorConstraint, A as AuthorizationResult, B as BaseUcanFlow, X as BuildFlowAgentContextParams, aA as CompiledBlock, aB as CompiledEdge, v as CompiledFlow, aC as CompiledFlowNode, C as CompilerRegistry, aw as ConditionRef, ak as CreateAgentCommandParams, al as EvaluateFlowAgentPolicyParams, E as ExecuteNodeParams, f as ExecutionContext, d as ExecutionOutcome, Y as FlowAgentActor, ao as FlowAgentCommandBase, ap as FlowAgentCommandStatus, aq as FlowAgentCommandType, a1 as FlowAgentLease, ar as FlowAgentLedgerEvent, as as FlowAgentLedgerEventType, at as FlowAgentMaps, am as FlowAgentOrchestratorOptions, au as FlowAgentPolicyDecision, av as FlowAgentRunPhase, x as FlowAgentService, an as FlowAgentServiceOptions, a4 as FlowAgentTickResult, u as FlowCapability, F as FlowRuntimeStateManager, w as FlowStrategy, M as MergeResult, N as NodeActionResult, ab as OutputSchemaField, R as ReadFlowOptions, q as ReadFlowResult, az as RuntimeRef, S as SetupFlowOptions, p as SetupFlowResult, ay as TTLConstraint, aD as TriggerSpec, y as acquireFlowAgentLease, z as appendAgentLedgerEvent, a as buildAuthzFromProps, D as buildFlowAgentContext, b as buildFlowNodeFromBlock, ac as canMatches, G as cleanupExpiredFlowAgentLeases, a8 as clearRuntimeForTemplateClone, l as compileBaseUcanFlow, ad as computeAgentCommandId, H as createAgentCommand, c as createRuntimeStateManager, o as decompileToBaseUcanFlow, I as evaluateFlowAgentPolicy, e as executeNode, J as executeQueuedAgentCommands, k as getActiveEditor, K as getFlowAgentMaps, i as isAuthorized, ae as isCapabilityMatch, af as isExternalMutation, aE as isRuntimeRef, n as mergeCompiledFlows, L as planRalphLoopCommands, O as queueAgentCommand, P as readAgentLedgerEvents, m as readCompiledFlowFromYDoc, h as readFlow, r as readFlowAsBaseUcan, g as readFlowFromEditor, Q as readQueuedAgentCommands, T as releaseFlowAgentLease, ag as requiredCapabilityForCommand, ah as resourceMatches, j as setActiveEditor, s as setupFlowFromBaseUcan, U as tickFlowAgent, ai as updateAgentCommand, V as validateAgentCommand, W as validateFlowAgentLease } from '../store-CiuZEEsv.mjs';
3
3
  import { a4 as IxoEditorType, f as UcanService, U as UcanDelegationStore, S as StoredDelegation, I as InvocationStore, a5 as FlowNodeRuntimeState, a6 as FlowMetadata, a7 as FlowNode } from '../index-Bdh5jcT4.mjs';
4
4
  export { af as ActionReadBackMetadata, a9 as ClaimCollectionURI, am as CreateDelegationParams, an as CreateInvocationParams, al as CreateRootDelegationParams, a8 as DID, D as DelegationChainValidationResult, k as DelegationGrant, aa as EvaluationStatus, aj as ExecutionWithInvocationResult, ak as FindProofsResult, ac as FlowNodeAuthzExtension, ag as FlowNodeBase, ah as InvocationRequest, ai as InvocationResult, ab as LinkedClaim, ad as NodeState, ae as ReadBackTerminalState, j as StoredInvocation, i as UcanCapability, g as UcanServiceConfig, h as UcanServiceHandlers, b as createInvocationStore, d as createMemoryInvocationStore, a as createMemoryUcanDelegationStore, c as createUcanDelegationStore, e as createUcanService } from '../index-Bdh5jcT4.mjs';
5
5
  import * as Y from 'yjs';
@@ -76,7 +76,7 @@ import {
76
76
  validateAgentCommand,
77
77
  validateFlowAgentLease,
78
78
  writeRunRecordAndReconcile
79
- } from "../chunk-RIDIYR53.mjs";
79
+ } from "../chunk-W5M4NLHK.mjs";
80
80
  import {
81
81
  computeCID,
82
82
  computeJsonCID
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { n as ApiRequestBlockProps, h as ApiRequestBlockSpec, A as AuthorizationTab, d as AuthorizationTabState, B as BlockPresenceUser, i as CheckboxBlockProps, g as CheckboxBlockSpec, C as CoverImage, c as CoverImageProps, D as DevUcanGrantButton, r as Entity, s as EntityResponse, f as EntitySigningSetup, t as EntityVariables, E as EvaluationTab, e as EvaluationTabState, F as FlowPermissionsPanel, G as GrantPermissionModal, v as GraphQLClient, y as GraphQLRequest, x as GraphQLResponse, H as HttpMethod, I as IxoEditor, b as IxoEditorProps, K as KeyValuePair, k as ListBlockProps, j as ListBlockSettings, L as ListBlockSpec, O as OverviewBlock, l as OverviewBlockProps, m as ProposalBlockProps, P as ProposalBlockSpec, q as getEntity, w as ixoGraphQLClient, o as useBlockPresence, a as useCreateCollaborativeIxoEditor, u as useCreateIxoEditor, p as useTrackBlockFocus } from './graphql-client-C2YnVMPy.mjs';
2
- export { A as AuthorizationResult, B as BaseUcanFlow, X as BuildFlowAgentContextParams, v as CompiledFlow, C as CompilerRegistry, E as ExecuteNodeParams, f as ExecutionContext, d as ExecutionOutcome, Y as FlowAgentActor, Z as FlowAgentCommand, _ as FlowAgentCommandResult, $ as FlowAgentContext, a0 as FlowAgentExecutor, a1 as FlowAgentLease, a2 as FlowAgentNodeSnapshot, a3 as FlowAgentPublicNodeState, x as FlowAgentService, a4 as FlowAgentTickResult, u as FlowCapability, F as FlowRuntimeStateManager, w as FlowStrategy, M as MergeResult, N as NodeActionResult, R as ReadFlowOptions, q as ReadFlowResult, t as ReadableEditor, S as SetupFlowOptions, p as SetupFlowResult, y as acquireFlowAgentLease, z as appendAgentLedgerEvent, a as buildAuthzFromProps, D as buildFlowAgentContext, b as buildFlowNodeFromBlock, G as cleanupExpiredFlowAgentLeases, l as compileBaseUcanFlow, H as createAgentCommand, c as createRuntimeStateManager, o as decompileToBaseUcanFlow, I as evaluateFlowAgentPolicy, e as executeNode, J as executeQueuedAgentCommands, k as getActiveEditor, K as getFlowAgentMaps, i as isAuthorized, n as mergeCompiledFlows, L as planRalphLoopCommands, O as queueAgentCommand, P as readAgentLedgerEvents, m as readCompiledFlowFromYDoc, h as readFlow, r as readFlowAsBaseUcan, g as readFlowFromEditor, Q as readQueuedAgentCommands, T as releaseFlowAgentLease, j as setActiveEditor, s as setupFlowFromBaseUcan, U as tickFlowAgent, V as validateAgentCommand, W as validateFlowAgentLease } from './store-tdIRq7y0.mjs';
2
+ export { A as AuthorizationResult, B as BaseUcanFlow, X as BuildFlowAgentContextParams, v as CompiledFlow, C as CompilerRegistry, E as ExecuteNodeParams, f as ExecutionContext, d as ExecutionOutcome, Y as FlowAgentActor, Z as FlowAgentCommand, _ as FlowAgentCommandResult, $ as FlowAgentContext, a0 as FlowAgentExecutor, a1 as FlowAgentLease, a2 as FlowAgentNodeSnapshot, a3 as FlowAgentPublicNodeState, x as FlowAgentService, a4 as FlowAgentTickResult, u as FlowCapability, F as FlowRuntimeStateManager, w as FlowStrategy, M as MergeResult, N as NodeActionResult, R as ReadFlowOptions, q as ReadFlowResult, t as ReadableEditor, S as SetupFlowOptions, p as SetupFlowResult, y as acquireFlowAgentLease, z as appendAgentLedgerEvent, a as buildAuthzFromProps, D as buildFlowAgentContext, b as buildFlowNodeFromBlock, G as cleanupExpiredFlowAgentLeases, l as compileBaseUcanFlow, H as createAgentCommand, c as createRuntimeStateManager, o as decompileToBaseUcanFlow, I as evaluateFlowAgentPolicy, e as executeNode, J as executeQueuedAgentCommands, k as getActiveEditor, K as getFlowAgentMaps, i as isAuthorized, n as mergeCompiledFlows, L as planRalphLoopCommands, O as queueAgentCommand, P as readAgentLedgerEvents, m as readCompiledFlowFromYDoc, h as readFlow, r as readFlowAsBaseUcan, g as readFlowFromEditor, Q as readQueuedAgentCommands, T as releaseFlowAgentLease, j as setActiveEditor, s as setupFlowFromBaseUcan, U as tickFlowAgent, V as validateAgentCommand, W as validateFlowAgentLease } from './store-CiuZEEsv.mjs';
3
3
  export { H as Addr, A as AuthzExecActionTypes, y as BlockRequirements, x as BlocknoteContextValue, w as BlocknoteHandlers, B as BlocknoteProvider, O as CosmosMsgForEmpty, D as DelegationChainValidationResult, k as DelegationGrant, K as Expiration, Z as ImportProtocolTemplateResult, Y as ImportProtocolTemplatesToSpaceParams, I as InvocationStore, p as IxoCollaborativeEditorOptions, o as IxoCollaborativeUser, n as IxoEditorConfig, l as IxoEditorOptions, m as IxoEditorTheme, R as ListProtocolDeedsWithTemplatesParams, _ as MatrixPrivacySettings, $ as MatrixRoom, a0 as MatrixSpace, a2 as MatrixSpaceStructure, a1 as MatrixSubspace, Q as ProposalAction, P as ProposalResponse, W as ProtocolDeedWithTemplates, X as ProtocolTemplateSummary, z as SingleChoiceProposal, v as StakeType, v as StakeTypeValue, L as Status, S as StoredDelegation, j as StoredInvocation, M as Threshold, T as Timestamp, a3 as Translate, i as UcanCapability, U as UcanDelegationStore, f as UcanService, g as UcanServiceConfig, h as UcanServiceHandlers, J as Uint128, G as User, V as ValidatorActionType, F as Vote, E as VoteInfo, C as VoteResponse, N as Votes, q as blockSpecs, b as createInvocationStore, d as createMemoryInvocationStore, a as createMemoryUcanDelegationStore, c as createUcanDelegationStore, e as createUcanService, r as getExtraSlashMenuItems, u as useBlocknoteContext, s as useBlocknoteHandlers, t as useTranslate } from './index-Bdh5jcT4.mjs';
4
4
  export { Block, BlockNoteEditor, BlockNoteSchema, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, PartialBlock } from '@blocknote/core';
5
5
  export { CloneDocumentResult, cloneDocument } from '@ixo/matrix-crdt';
package/dist/index.mjs CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  useCreateIxoEditor,
29
29
  useTrackBlockFocus,
30
30
  useTranslate
31
- } from "./chunk-5AC7MHLH.mjs";
31
+ } from "./chunk-MP7Q5F3L.mjs";
32
32
  import "./chunk-OK2W66I7.mjs";
33
33
  import {
34
34
  FlowAgentService,
@@ -68,7 +68,7 @@ import {
68
68
  tickFlowAgent,
69
69
  validateAgentCommand,
70
70
  validateFlowAgentLease
71
- } from "./chunk-RIDIYR53.mjs";
71
+ } from "./chunk-W5M4NLHK.mjs";
72
72
 
73
73
  // src/index.ts
74
74
  import { cloneDocument } from "@ixo/matrix-crdt";
@@ -54,13 +54,13 @@ import {
54
54
  usePanelStore,
55
55
  useRegisterOpenSurvey,
56
56
  useTrackBlockFocus
57
- } from "../chunk-5AC7MHLH.mjs";
57
+ } from "../chunk-MP7Q5F3L.mjs";
58
58
  import {
59
59
  didToMatrixUserId,
60
60
  findOrCreateDMRoom,
61
61
  getHomeserver,
62
62
  sendDirectMessage
63
- } from "../chunk-RIDIYR53.mjs";
63
+ } from "../chunk-W5M4NLHK.mjs";
64
64
  export {
65
65
  ApiRequestBlockSpec,
66
66
  AuthorizationTab,
@@ -445,6 +445,49 @@ interface AddressClassification {
445
445
  canExerciseGrant: boolean;
446
446
  };
447
447
  }
448
+ /**
449
+ * Provenance/identity of a carbon batch (= a CARBON token group; the batch id
450
+ * is the on-chain token id). `entityDid` + `adminAddress` identify the entity
451
+ * admin account the batch was minted from — both are REQUIRED to construct a
452
+ * harvest (the authz grant + exec transfer target that account). The host
453
+ * `loadBatches` handler performs provenance recovery for transferred batches so
454
+ * these are populated before the editor ever sees them. See the carbon-credit
455
+ * technical doc §4–§5 (IXO-2675).
456
+ */
457
+ interface CarbonBatchRef {
458
+ /** Token/batch id. */
459
+ id: string;
460
+ /** Minter entity DID. */
461
+ entityDid: string;
462
+ /** Entity admin account address (the FROM account for a harvest transfer). */
463
+ adminAddress: string;
464
+ /** Human-readable entity name, for display. */
465
+ alsoKnownAs?: string;
466
+ }
467
+ /**
468
+ * A harvestable batch: held on an entity admin account the user owns but not
469
+ * yet pulled into their wallet. `claimable` = the admin-held amount that
470
+ * becomes the user's on harvest.
471
+ */
472
+ interface CarbonHarvestableBatch extends CarbonBatchRef {
473
+ /** Harvestable amount (admin-held; becomes user `amount` after harvest). */
474
+ claimable: number;
475
+ }
476
+ /**
477
+ * A retireable batch: credits the user already holds in their wallet and can
478
+ * burn/offset. `entityDid` is best-effort (display/provenance) and not required
479
+ * to retire — retirement is a single owner-signed message.
480
+ */
481
+ interface CarbonRetireableBatch {
482
+ /** Token/batch id. */
483
+ id: string;
484
+ /** Amount available in the user's wallet to retire. */
485
+ amount: number;
486
+ /** Minter entity DID, when known. */
487
+ entityDid?: string;
488
+ /** Human-readable entity name, for display. */
489
+ alsoKnownAs?: string;
490
+ }
448
491
  interface ActionServices {
449
492
  http?: {
450
493
  request: (params: {
@@ -927,6 +970,67 @@ interface ActionServices {
927
970
  transactionHash: string;
928
971
  }>;
929
972
  };
973
+ /**
974
+ * Carbon credit batch service (IXO-2675). The editor declares the contract
975
+ * only; the consumer app implements each method (run the owner/admin
976
+ * reconciliation read, build + broadcast the harvest grant/exec pair and the
977
+ * retire message, sign via its own wallet/SignX). Both writes are USER-signed
978
+ * — the editor never signs on the user's behalf.
979
+ */
980
+ carbon?: {
981
+ /**
982
+ * Reconcile the user's owner-side and entity-admin-side batches into the
983
+ * unified view. Pure read (no signing). Performs provenance recovery for
984
+ * transferred batches so every `harvestableBatch` carries `entityDid` +
985
+ * `adminAddress`. See technical doc §3–§4.
986
+ */
987
+ loadBatches: (params: {
988
+ ownerAddress: string;
989
+ }) => Promise<{
990
+ harvestableBatches: CarbonHarvestableBatch[];
991
+ retireableBatches: CarbonRetireableBatch[];
992
+ totalClaimable: number;
993
+ totalAvailable: number;
994
+ totalRetired: number;
995
+ }>;
996
+ /**
997
+ * Harvest (claim) the given batches: per entity, grant the owner authz to
998
+ * transfer out of the entity admin account, then exec that transfer into
999
+ * the owner's wallet (ordered pairs, 30-min grant). User-signed. See §5.2.
1000
+ */
1001
+ harvest: (params: {
1002
+ ownerAddress: string;
1003
+ tokens: Array<{
1004
+ id: string;
1005
+ entityDid: string;
1006
+ adminAddress: string;
1007
+ claimable: number;
1008
+ }>;
1009
+ }) => Promise<{
1010
+ transactionHash: string;
1011
+ harvestedBatchIds: string[];
1012
+ harvestedAmount: number;
1013
+ }>;
1014
+ /**
1015
+ * Retire (burn/offset) the given amounts from the owner's wallet. Single
1016
+ * owner-signed `MsgRetireToken`. Irreversible. `jurisdiction` arrives
1017
+ * pre-composed as a string (default "Global"); `reason` defaults to
1018
+ * "offset". See §5.1.
1019
+ */
1020
+ retire: (params: {
1021
+ owner: string;
1022
+ reason?: string;
1023
+ jurisdiction?: string;
1024
+ tokens: Array<{
1025
+ id: string;
1026
+ amount: number;
1027
+ }>;
1028
+ }) => Promise<{
1029
+ transactionHash: string;
1030
+ retiredBatchIds: string[];
1031
+ retiredAmount: number;
1032
+ }>;
1033
+ };
930
1034
  }
931
1035
  interface OutputSchemaField {
932
1036
  path: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ixo/editor",
3
- "version": "5.26.0",
3
+ "version": "5.27.0",
4
4
  "description": "A custom BlockNote editor wrapper for IXO team",
5
5
  "main": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",