@ixo/editor 3.0.0-beta.26 → 3.0.0-beta.28

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,16 +1,78 @@
1
1
  // src/core/lib/actionRegistry/registry.ts
2
2
  var actions = /* @__PURE__ */ new Map();
3
+ var ACTION_TYPE_ALIASES = {
4
+ bid: "qi/bid.submit",
5
+ claim: "qi/claim.submit",
6
+ evaluateBid: "qi/bid.evaluate",
7
+ evaluateClaim: "qi/claim.evaluate",
8
+ "email.send": "qi/email.send",
9
+ "http.request": "qi/http.request",
10
+ "form.submit": "qi/form.submit",
11
+ "human.form.submit": "qi/human.form.submit",
12
+ "human.checkbox.set": "qi/human.checkbox.set",
13
+ "notification.push": "qi/notification.push",
14
+ "proposal.create": "qi/proposal.create",
15
+ "proposal.vote": "qi/proposal.vote",
16
+ "protocol.select": "qi/protocol.select",
17
+ "domain.sign": "qi/domain.sign",
18
+ "domain.create": "qi/domain.create",
19
+ "credential.store": "qi/credential.store",
20
+ payment: "qi/payment.execute",
21
+ "matrix.dm": "qi/matrix.dm"
22
+ };
23
+ var aliases = new Map(Object.entries(ACTION_TYPE_ALIASES));
24
+ function resolveActionType(type) {
25
+ return aliases.get(type) ?? type;
26
+ }
3
27
  function registerAction(definition) {
4
28
  actions.set(definition.type, definition);
5
29
  }
6
30
  function getAction(type) {
7
- return actions.get(type);
31
+ return actions.get(resolveActionType(type));
8
32
  }
9
33
  function getAllActions() {
10
34
  return Array.from(actions.values());
11
35
  }
12
36
  function hasAction(type) {
13
- return actions.has(type);
37
+ return actions.has(resolveActionType(type));
38
+ }
39
+ function getActionByCan(can) {
40
+ for (const action of actions.values()) {
41
+ if (action.can === can) return action;
42
+ }
43
+ return void 0;
44
+ }
45
+
46
+ // src/core/lib/actionRegistry/canMapping.ts
47
+ var CAN_TO_TYPE = {
48
+ "bid/submit": "qi/bid.submit",
49
+ "bid/evaluate": "qi/bid.evaluate",
50
+ "claim/submit": "qi/claim.submit",
51
+ "claim/evaluate": "qi/claim.evaluate",
52
+ "email/send": "qi/email.send",
53
+ "notification/push": "qi/notification.push",
54
+ "matrix/dm": "qi/matrix.dm",
55
+ "proposal/create": "qi/proposal.create",
56
+ "proposal/vote": "qi/proposal.vote",
57
+ "domain/create": "qi/domain.create",
58
+ "domain/sign": "qi/domain.sign",
59
+ "credential/store": "qi/credential.store",
60
+ "payment/execute": "qi/payment.execute",
61
+ "http/request": "qi/http.request",
62
+ "protocol/select": "qi/protocol.select",
63
+ "human/checkbox": "qi/human.checkbox.set",
64
+ "human/form": "qi/human.form.submit",
65
+ "oracle/query": "oracle"
66
+ };
67
+ var TYPE_TO_CAN = Object.fromEntries(Object.entries(CAN_TO_TYPE).map(([can, type]) => [type, can]));
68
+ function canToType(can) {
69
+ return CAN_TO_TYPE[can];
70
+ }
71
+ function typeToCan(type) {
72
+ return TYPE_TO_CAN[type];
73
+ }
74
+ function getAllCanMappings() {
75
+ return Object.entries(CAN_TO_TYPE).map(([can, type]) => ({ can, type }));
14
76
  }
15
77
 
16
78
  // src/core/lib/actionRegistry/adapters.ts
@@ -134,7 +196,8 @@ async function sendDirectMessage(matrixClient, targetDid, message) {
134
196
 
135
197
  // src/core/lib/actionRegistry/actions/httpRequest.ts
136
198
  registerAction({
137
- type: "http.request",
199
+ type: "qi/http.request",
200
+ can: "http/request",
138
201
  sideEffect: false,
139
202
  defaultRequiresConfirmation: false,
140
203
  run: async (inputs, ctx) => {
@@ -171,7 +234,8 @@ registerAction({
171
234
 
172
235
  // src/core/lib/actionRegistry/actions/emailSend.ts
173
236
  registerAction({
174
- type: "email.send",
237
+ type: "qi/email.send",
238
+ can: "email/send",
175
239
  sideEffect: true,
176
240
  defaultRequiresConfirmation: true,
177
241
  requiredCapability: "email/send",
@@ -216,7 +280,8 @@ registerAction({
216
280
 
217
281
  // src/core/lib/actionRegistry/actions/humanCheckbox.ts
218
282
  registerAction({
219
- type: "human.checkbox.set",
283
+ type: "qi/human.checkbox.set",
284
+ can: "human/checkbox",
220
285
  sideEffect: true,
221
286
  defaultRequiresConfirmation: false,
222
287
  requiredCapability: "flow/execute",
@@ -247,9 +312,10 @@ function normalizeAnswers(rawAnswers) {
247
312
  }
248
313
  return rawAnswers;
249
314
  }
250
- function registerFormSubmitAction(type) {
315
+ function registerFormSubmitAction(type, can) {
251
316
  registerAction({
252
317
  type,
318
+ can,
253
319
  sideEffect: true,
254
320
  defaultRequiresConfirmation: false,
255
321
  requiredCapability: "flow/execute",
@@ -271,12 +337,13 @@ function registerFormSubmitAction(type) {
271
337
  }
272
338
  });
273
339
  }
274
- registerFormSubmitAction("form.submit");
275
- registerFormSubmitAction("human.form.submit");
340
+ registerFormSubmitAction("qi/form.submit", "form/submit");
341
+ registerFormSubmitAction("qi/human.form.submit", "human/form");
276
342
 
277
343
  // src/core/lib/actionRegistry/actions/notificationPush.ts
278
344
  registerAction({
279
- type: "notification.push",
345
+ type: "qi/notification.push",
346
+ can: "notification/push",
280
347
  sideEffect: true,
281
348
  defaultRequiresConfirmation: true,
282
349
  requiredCapability: "notify/send",
@@ -316,7 +383,8 @@ function normalizeBidRole(role) {
316
383
  throw new Error("Invalid bid role. Expected service_agent or evaluation_agent");
317
384
  }
318
385
  registerAction({
319
- type: "bid",
386
+ type: "qi/bid.submit",
387
+ can: "bid/submit",
320
388
  sideEffect: true,
321
389
  defaultRequiresConfirmation: true,
322
390
  requiredCapability: "flow/block/execute",
@@ -387,7 +455,8 @@ function isEvaluationAgentRole(role) {
387
455
  return normalized === "evaluation_agent" || normalized === "ea";
388
456
  }
389
457
  registerAction({
390
- type: "evaluateBid",
458
+ type: "qi/bid.evaluate",
459
+ can: "bid/evaluate",
391
460
  sideEffect: true,
392
461
  defaultRequiresConfirmation: true,
393
462
  requiredCapability: "flow/block/execute",
@@ -492,7 +561,8 @@ registerAction({
492
561
 
493
562
  // src/core/lib/actionRegistry/actions/claim.ts
494
563
  registerAction({
495
- type: "claim",
564
+ type: "qi/claim.submit",
565
+ can: "claim/submit",
496
566
  sideEffect: true,
497
567
  defaultRequiresConfirmation: true,
498
568
  requiredCapability: "flow/block/execute",
@@ -577,7 +647,8 @@ function isEvaluatorRole(role) {
577
647
  return normalized === "ea" || normalized === "evaluation_agent";
578
648
  }
579
649
  registerAction({
580
- type: "evaluateClaim",
650
+ type: "qi/claim.evaluate",
651
+ can: "claim/evaluate",
581
652
  sideEffect: true,
582
653
  defaultRequiresConfirmation: true,
583
654
  requiredCapability: "flow/block/execute",
@@ -709,7 +780,8 @@ registerAction({
709
780
 
710
781
  // src/core/lib/actionRegistry/actions/proposalCreate.ts
711
782
  registerAction({
712
- type: "proposal.create",
783
+ type: "qi/proposal.create",
784
+ can: "proposal/create",
713
785
  sideEffect: true,
714
786
  defaultRequiresConfirmation: true,
715
787
  requiredCapability: "flow/block/execute",
@@ -775,7 +847,8 @@ registerAction({
775
847
 
776
848
  // src/core/lib/actionRegistry/actions/proposalVote.ts
777
849
  registerAction({
778
- type: "proposal.vote",
850
+ type: "qi/proposal.vote",
851
+ can: "proposal/vote",
779
852
  sideEffect: true,
780
853
  defaultRequiresConfirmation: true,
781
854
  requiredCapability: "flow/block/execute",
@@ -820,7 +893,8 @@ registerAction({
820
893
 
821
894
  // src/core/lib/actionRegistry/actions/protocolSelect.ts
822
895
  registerAction({
823
- type: "protocol.select",
896
+ type: "qi/protocol.select",
897
+ can: "protocol/select",
824
898
  sideEffect: false,
825
899
  defaultRequiresConfirmation: false,
826
900
  outputSchema: [
@@ -939,7 +1013,8 @@ function buildGovernanceGroupLinkedEntities(linkedEntities) {
939
1013
 
940
1014
  // src/core/lib/actionRegistry/actions/domainSign.ts
941
1015
  registerAction({
942
- type: "domain.sign",
1016
+ type: "qi/domain.sign",
1017
+ can: "domain/sign",
943
1018
  sideEffect: true,
944
1019
  defaultRequiresConfirmation: true,
945
1020
  requiredCapability: "flow/block/execute",
@@ -1322,7 +1397,8 @@ function extractSurveyAnswersTemplate(surveyDef) {
1322
1397
 
1323
1398
  // src/core/lib/actionRegistry/actions/domainCreate.ts
1324
1399
  registerAction({
1325
- type: "domain.create",
1400
+ type: "qi/domain.create",
1401
+ can: "domain/create",
1326
1402
  sideEffect: true,
1327
1403
  defaultRequiresConfirmation: true,
1328
1404
  requiredCapability: "flow/block/execute",
@@ -1408,6 +1484,7 @@ registerAction({
1408
1484
  // src/core/lib/actionRegistry/actions/oracle.ts
1409
1485
  registerAction({
1410
1486
  type: "oracle",
1487
+ can: "oracle/query",
1411
1488
  sideEffect: false,
1412
1489
  defaultRequiresConfirmation: false,
1413
1490
  outputSchema: [{ path: "prompt", displayName: "Prompt", type: "string", description: "The prompt sent to the companion" }],
@@ -1426,7 +1503,8 @@ registerAction({
1426
1503
 
1427
1504
  // src/core/lib/actionRegistry/actions/credentialStore.ts
1428
1505
  registerAction({
1429
- type: "credential.store",
1506
+ type: "qi/credential.store",
1507
+ can: "credential/store",
1430
1508
  sideEffect: true,
1431
1509
  defaultRequiresConfirmation: true,
1432
1510
  requiredCapability: "flow/execute",
@@ -1477,7 +1555,8 @@ registerAction({
1477
1555
 
1478
1556
  // src/core/lib/actionRegistry/actions/payment.ts
1479
1557
  registerAction({
1480
- type: "payment",
1558
+ type: "qi/payment.execute",
1559
+ can: "payment/execute",
1481
1560
  sideEffect: true,
1482
1561
  defaultRequiresConfirmation: true,
1483
1562
  requiredCapability: "flow/block/execute",
@@ -1516,7 +1595,8 @@ ${configJson}`
1516
1595
 
1517
1596
  // src/core/lib/actionRegistry/actions/matrixDm.ts
1518
1597
  registerAction({
1519
- type: "matrix.dm",
1598
+ type: "qi/matrix.dm",
1599
+ can: "matrix/dm",
1520
1600
  sideEffect: true,
1521
1601
  defaultRequiresConfirmation: false,
1522
1602
  outputSchema: [
@@ -3070,10 +3150,15 @@ var SimpleUCANManager = class {
3070
3150
  };
3071
3151
 
3072
3152
  export {
3153
+ resolveActionType,
3073
3154
  registerAction,
3074
3155
  getAction,
3075
3156
  getAllActions,
3076
3157
  hasAction,
3158
+ getActionByCan,
3159
+ canToType,
3160
+ typeToCan,
3161
+ getAllCanMappings,
3077
3162
  buildServicesFromHandlers,
3078
3163
  buildVerifiableCredential,
3079
3164
  buildDomainCardLinkedResource,
@@ -3105,4 +3190,4 @@ export {
3105
3190
  createUcanService,
3106
3191
  SimpleUCANManager
3107
3192
  };
3108
- //# sourceMappingURL=chunk-SUFKRSSM.mjs.map
3193
+ //# sourceMappingURL=chunk-NOMJJJDB.mjs.map