@ixo/editor 5.27.0 → 5.28.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.
@@ -269,6 +269,13 @@ function buildServicesFromHandlers(handlers) {
269
269
  loadBatches: async (params) => handlers.carbon.loadBatches(params),
270
270
  harvest: async (params) => handlers.carbon.harvest(params),
271
271
  retire: async (params) => handlers.carbon.retire(params)
272
+ } : void 0,
273
+ // Entity (domain) ownership service (IXO-2696). The consumer exposes a
274
+ // fully-formed `handlers.entity` service group; the transfer is user-signed
275
+ // inside the consumer handler (resolve recipient + IID guard + broadcast) —
276
+ // we only forward the call here.
277
+ entity: handlers?.entity?.transfer ? {
278
+ transfer: async (params) => handlers.entity.transfer(params)
272
279
  } : void 0
273
280
  };
274
281
  }
@@ -5373,6 +5380,50 @@ registerAction({
5373
5380
  }
5374
5381
  });
5375
5382
 
5383
+ // src/core/lib/actionRegistry/actions/entityTransfer/schemas.ts
5384
+ var ENTITY_TRANSFER_OUTPUT = [
5385
+ { path: "transactionHash", displayName: "Transaction Hash", type: "string", description: "The entity transfer transaction hash" },
5386
+ { path: "recipientDid", displayName: "Recipient DID", type: "string", description: "The new owner DID the entity was transferred to" },
5387
+ {
5388
+ path: "recipientResolved",
5389
+ displayName: "Resolved Recipient",
5390
+ type: "string",
5391
+ description: "The resolved recipient when a group entity was mapped to its DAO controller"
5392
+ },
5393
+ {
5394
+ path: "createdRecipientIid",
5395
+ displayName: "Created Recipient IID",
5396
+ type: "boolean",
5397
+ description: "True when the host created the recipient's IID document before transferring"
5398
+ }
5399
+ ];
5400
+
5401
+ // src/core/lib/actionRegistry/actions/entityTransfer/entityTransfer.ts
5402
+ registerAction({
5403
+ type: "qi/entity.transfer",
5404
+ can: "entity/transfer",
5405
+ sideEffect: true,
5406
+ defaultRequiresConfirmation: true,
5407
+ outputSchema: ENTITY_TRANSFER_OUTPUT,
5408
+ run: async (inputs, ctx) => {
5409
+ if (!ctx.services.entity?.transfer) {
5410
+ throw new Error("entity.transfer handler not available");
5411
+ }
5412
+ if (!inputs.entityDid) throw new Error("entityDid is required");
5413
+ if (!inputs.recipientDid) throw new Error("recipientDid is required");
5414
+ const result = await ctx.services.entity.transfer({
5415
+ entityDid: inputs.entityDid,
5416
+ recipientDid: inputs.recipientDid,
5417
+ ...inputs.ownerDid ? { ownerDid: inputs.ownerDid } : {},
5418
+ ...inputs.ownerAddress ? { ownerAddress: inputs.ownerAddress } : {}
5419
+ });
5420
+ if (!result?.transactionHash) {
5421
+ throw new Error("entity.transfer returned no transaction hash. Check the [entity:transfer] handler logs.");
5422
+ }
5423
+ return { output: { ...result, recipientDid: inputs.recipientDid } };
5424
+ }
5425
+ });
5426
+
5376
5427
  // src/core/lib/actionRegistry/actions/calendar/eventCreate.types.ts
5377
5428
  var EMPTY = {
5378
5429
  connection: null,
@@ -6202,9 +6253,9 @@ function renderNumber(value) {
6202
6253
  return formattedValue;
6203
6254
  }
6204
6255
  var formatCoin2 = (coin) => {
6205
- const USDC_DENOM2 = "ibc/6BBE9BD4246F8E04948D5A4EEE7164B2630263B9EBB5E7DC5F0A46C62A2FF97B";
6256
+ const USDC_DENOM3 = "ibc/6BBE9BD4246F8E04948D5A4EEE7164B2630263B9EBB5E7DC5F0A46C62A2FF97B";
6206
6257
  const DECIMALS = 6;
6207
- const denom = coin.denom === USDC_DENOM2 ? "USDC" : coin.denom === "uixo" ? "IXO" : coin.denom;
6258
+ const denom = coin.denom === USDC_DENOM3 ? "USDC" : coin.denom === "uixo" ? "IXO" : coin.denom;
6208
6259
  const raw = Number(coin.amount);
6209
6260
  const display = raw >= Math.pow(10, DECIMALS) ? raw / Math.pow(10, DECIMALS) : raw;
6210
6261
  return `${display} ${denom}`;
@@ -6982,9 +7033,18 @@ function roleLabel(value) {
6982
7033
  if (r === "evaluate") return "Evaluate (Evaluator)";
6983
7034
  return "Unknown role";
6984
7035
  }
7036
+ var IXO_DENOM = "uixo";
7037
+ var USDC_DENOM2 = "ibc/6BBE9BD4246F8E04948D5A4EEE7164B2630263B9EBB5E7DC5F0A46C62A2FF97B";
7038
+ function formatCoin4(value) {
7039
+ const coin = value;
7040
+ const denomValue = String(coin?.denom || "");
7041
+ const denom = denomValue === IXO_DENOM ? "IXO" : denomValue === USDC_DENOM2 ? "USDC" : denomValue;
7042
+ return `${String(coin?.amount || "")} ${denom}`.trim();
7043
+ }
6985
7044
  function diffAdd(inputs) {
6986
7045
  const results = [];
6987
7046
  const kind = String(inputs.granteeKind || "user");
7047
+ const role = String(inputs.role || "").trim().toLowerCase();
6988
7048
  results.push({ key: "role", label: "Role", before: null, after: roleLabel(inputs.role), changeType: "add" });
6989
7049
  if (inputs.collectionId) {
6990
7050
  results.push({ key: "collectionId", label: "Collection", before: null, after: String(inputs.collectionId), changeType: "add" });
@@ -7011,6 +7071,16 @@ function diffAdd(inputs) {
7011
7071
  changeType: "add",
7012
7072
  unit: formatQuota2(inputs.agentQuota) === "\u2014" ? void 0 : "claims"
7013
7073
  });
7074
+ if (role === "evaluate") {
7075
+ const maxAmount = Array.isArray(inputs.maxAmount) ? inputs.maxAmount : [];
7076
+ results.push({
7077
+ key: "maxAmount",
7078
+ label: "Max Amounts",
7079
+ before: null,
7080
+ after: maxAmount.length > 0 ? maxAmount.map(formatCoin4).join(", ") : "None",
7081
+ changeType: maxAmount.length > 0 ? "add" : "unchanged"
7082
+ });
7083
+ }
7014
7084
  return results;
7015
7085
  }
7016
7086
  function diffRevoke(inputs) {
@@ -7107,6 +7177,37 @@ registerDiffResolver("qi/carbon.retire", {
7107
7177
  }
7108
7178
  });
7109
7179
 
7180
+ // src/core/lib/actionRegistry/actions/entityTransfer/entityTransfer.diff.ts
7181
+ registerDiffResolver("qi/entity.transfer", {
7182
+ resolver: async (inputs, ctx) => {
7183
+ const recipient = String(inputs.recipientDid || "").trim();
7184
+ if (!recipient) return [];
7185
+ const entityDid = String(inputs.entityDid || "").trim();
7186
+ const currentOwner = String(inputs.ownerDid || "").trim() || ctx.actorDid || "current owner";
7187
+ const rows = [
7188
+ {
7189
+ key: "owner",
7190
+ label: "Owner",
7191
+ before: currentOwner,
7192
+ after: recipient,
7193
+ changeType: "replace",
7194
+ severity: "critical"
7195
+ }
7196
+ ];
7197
+ if (entityDid) {
7198
+ rows.push({
7199
+ key: "entity",
7200
+ label: "Entity",
7201
+ before: entityDid,
7202
+ after: entityDid,
7203
+ changeType: "unchanged",
7204
+ severity: "info"
7205
+ });
7206
+ }
7207
+ return rows;
7208
+ }
7209
+ });
7210
+
7110
7211
  // src/core/services/ucanService.ts
7111
7212
  import {
7112
7213
  createDelegation as ucanCreateDelegation,
@@ -11728,4 +11829,4 @@ export {
11728
11829
  executeQueuedFlowAgentCoreCommands,
11729
11830
  FlowAgentService
11730
11831
  };
11731
- //# sourceMappingURL=chunk-W5M4NLHK.mjs.map
11832
+ //# sourceMappingURL=chunk-47XOPWSV.mjs.map