@ixo/editor 6.5.0 → 6.7.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.
@@ -54,10 +54,6 @@ function getAction(type) {
54
54
  function getAllActions() {
55
55
  return Array.from(actions.values());
56
56
  }
57
- function isRepeatableAction(type) {
58
- if (!type) return false;
59
- return getAction(type)?.cardinality === "many";
60
- }
61
57
  function getAliasEntries() {
62
58
  return Array.from(aliases.entries());
63
59
  }
@@ -238,6 +234,33 @@ function getAllCanMappings() {
238
234
  return Object.entries(CAN_TO_TYPE).map(([can, type]) => ({ can, type }));
239
235
  }
240
236
 
237
+ // src/core/lib/actionRegistry/serviceCan.ts
238
+ var SERVICE_VERBS = ["report", "format", "advise"];
239
+ function isActionCanShape(can) {
240
+ if (typeof can !== "string" || can.length === 0) return false;
241
+ const segments = can.split("/");
242
+ return segments.length >= 2 && segments.every((segment) => segment.length > 0) && !SERVICE_VERBS.includes(segments[segments.length - 1]);
243
+ }
244
+ function serviceCan(can, verb) {
245
+ if (!SERVICE_VERBS.includes(verb)) {
246
+ throw new Error(`serviceCan: unknown service verb '${String(verb)}' \u2014 expected one of: ${SERVICE_VERBS.join(", ")}`);
247
+ }
248
+ if (!isActionCanShape(can)) {
249
+ throw new Error(`serviceCan: invalid action can '${can}' \u2014 expected a non-empty '<namespace>/<verb>' shaped string that is not itself a service can, e.g. 'claim/evaluate'`);
250
+ }
251
+ return `${can}/${verb}`;
252
+ }
253
+ function parseServiceCan(value) {
254
+ if (typeof value !== "string" || value.length === 0) return null;
255
+ const lastSlash = value.lastIndexOf("/");
256
+ if (lastSlash <= 0) return null;
257
+ const verb = value.slice(lastSlash + 1);
258
+ if (!SERVICE_VERBS.includes(verb)) return null;
259
+ const actionCan = value.slice(0, lastSlash);
260
+ if (!isActionCanShape(actionCan)) return null;
261
+ return { actionCan, verb };
262
+ }
263
+
241
264
  // src/core/lib/actionRegistry/adapters.ts
242
265
  var SERVICE_GROUP_REQUIRED_HANDLERS = {
243
266
  bid: ["submitBid", "approveBid", "rejectBid", "approveServiceAgentApplication", "approveEvaluatorApplication"],
@@ -11530,9 +11553,6 @@ function verifyCompletion(params) {
11530
11553
  if (runtime.manuallyVerified === true) {
11531
11554
  return { status: "verified" };
11532
11555
  }
11533
- if (actionType && isRepeatableAction(actionType)) {
11534
- return { status: "verified" };
11535
- }
11536
11556
  if (actionType) {
11537
11557
  const action = getAction(actionType);
11538
11558
  if (action) {
@@ -12689,6 +12709,17 @@ var migration_0_3_to_1_0_0 = {
12689
12709
  };
12690
12710
  registerMigration(migration_0_3_to_1_0_0);
12691
12711
 
12712
+ // src/core/types/nodeContext.ts
12713
+ var NODE_CONTEXT_MAP_NAME = "nodeContext";
12714
+ var NODE_CONTEXT_OVERRIDES_MAP_NAME = "nodeContextOverrides";
12715
+ function isNodeContextRecord(value) {
12716
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
12717
+ return false;
12718
+ }
12719
+ const record = value;
12720
+ return typeof record.kind === "string" && typeof record.shapeVersion === "number" && typeof record.sourceDigest === "string" && Boolean(record.values) && typeof record.values === "object" && !Array.isArray(record.values) && Boolean(record.fieldProvenance) && typeof record.fieldProvenance === "object" && !Array.isArray(record.fieldProvenance) && typeof record.inferredAt === "string";
12721
+ }
12722
+
12692
12723
  // src/core/lib/flowCompiler/conditions.ts
12693
12724
  var OPERATOR_MAP = {
12694
12725
  // BaseUcan ConditionRef vocabulary
@@ -13802,7 +13833,10 @@ function queueAgentCommand(yDoc, command) {
13802
13833
  const { outbox } = getFlowAgentMaps(yDoc);
13803
13834
  const existing = outbox.get(command.id);
13804
13835
  if (existing) {
13805
- if (existing.type === "assign_actor" && existing.status === "failed") {
13836
+ const retryFailedAssignment = existing.type === "assign_actor" && existing.status === "failed";
13837
+ const retryFailedDiagnosis = existing.type === "diagnose_blocker" && existing.status === "failed";
13838
+ const retryUnprovenDiagnosis = existing.type === "diagnose_blocker" && existing.status === "confirmed" && typeof existing.payload.delegatedInvocationId !== "string";
13839
+ if (retryFailedAssignment || retryFailedDiagnosis || retryUnprovenDiagnosis) {
13806
13840
  const retried = {
13807
13841
  ...existing,
13808
13842
  status: "queued",
@@ -13828,7 +13862,8 @@ function queueAgentCommand(yDoc, command) {
13828
13862
  status: retried.status,
13829
13863
  idempotencyKey: retried.idempotencyKey,
13830
13864
  reason: retried.reason,
13831
- retry: true
13865
+ retry: true,
13866
+ retryCause: retryFailedDiagnosis ? "diagnosis_failed" : retryUnprovenDiagnosis ? "missing_delegated_invocation" : "assignment_failed"
13832
13867
  }
13833
13868
  });
13834
13869
  } catch (error) {
@@ -13938,8 +13973,6 @@ var COMMAND_CAPABILITIES = {
13938
13973
  notify_actor: "flow/notify",
13939
13974
  execute_action: "flow/node/execute",
13940
13975
  validate_external_state: "flow/mutation/execute",
13941
- submit_oracle_claim: "flow/oracle-claim/submit",
13942
- watch_oracle_udid: "flow/observe",
13943
13976
  archive_flow: "flow/archive",
13944
13977
  propose_config_change: "flow/config/propose"
13945
13978
  };
@@ -14117,15 +14150,7 @@ function classifyBlockerCause(block, runtime) {
14117
14150
  }
14118
14151
  return void 0;
14119
14152
  }
14120
- function classifyNodeState({
14121
- block,
14122
- runtime,
14123
- now,
14124
- pendingInvocationCount = 0,
14125
- completionVerification,
14126
- isRepeatable = false
14127
- }) {
14128
- if (isRepeatable && runtime.state === "completed") return "Active";
14153
+ function classifyNodeState({ block, runtime, now, pendingInvocationCount = 0, completionVerification }) {
14129
14154
  if (runtime.state === "completed" && completionVerification?.status === "unverified") return "Blocked";
14130
14155
  if (runtime.state === "completed" || runtime.state === "cancelled") return "Done";
14131
14156
  if (runtime.state === "needs_verification") return "Blocked";
@@ -14135,12 +14160,12 @@ function classifyNodeState({
14135
14160
  if (pendingInvocationCount > 0) return "Pending";
14136
14161
  return "Pending";
14137
14162
  }
14138
- function snapshotNode(block, runtime, now, pendingInvocationCount = 0, completionVerification, isRepeatable = false) {
14163
+ function snapshotNode(block, runtime, now, pendingInvocationCount = 0, completionVerification) {
14139
14164
  const nodeId = getBlockId(block);
14140
14165
  if (!nodeId) {
14141
14166
  throw new Error("Cannot snapshot a block without an id");
14142
14167
  }
14143
- const publicState = classifyNodeState({ block, runtime, now, pendingInvocationCount, completionVerification, isRepeatable });
14168
+ const publicState = classifyNodeState({ block, runtime, now, pendingInvocationCount, completionVerification });
14144
14169
  const dueAt = getDueAt(block);
14145
14170
  const assigneeDid = getAssigneeDid(block);
14146
14171
  const snapshot = {
@@ -14352,22 +14377,7 @@ function statusForResult(result) {
14352
14377
  function planForSnapshot(context, options, block, snapshot) {
14353
14378
  const queued = [];
14354
14379
  const actionType = getBlockActionType(block);
14355
- const queueClaimUdidWatch = () => {
14356
- const runtime = snapshot.runtime;
14357
- if (actionType === "qi/claim.submit" && runtime.output?.claimId && !runtime.output?.udid) {
14358
- const command = queueIfAuthorized(context, options, "watch_oracle_udid", snapshot.nodeId, "Oracle claim submitted but UDID is not yet observed", {
14359
- claimId: runtime.output.claimId,
14360
- timeoutMs: 864e5
14361
- });
14362
- if (command) queued.push(command);
14363
- }
14364
- };
14365
- if (snapshot.publicState === "Active") {
14366
- queueClaimUdidWatch();
14367
- return queued;
14368
- }
14369
14380
  if (snapshot.publicState === "Done") {
14370
- queueClaimUdidWatch();
14371
14381
  return queued;
14372
14382
  }
14373
14383
  if (snapshot.publicState === "Overdue") {
@@ -14407,13 +14417,6 @@ function planForSnapshot(context, options, block, snapshot) {
14407
14417
  if (command) queued.push(command);
14408
14418
  return queued;
14409
14419
  }
14410
- if (actionType === "qi/claim.submit") {
14411
- const command = queueIfAuthorized(context, options, "submit_oracle_claim", snapshot.nodeId, "Oracle claim action is pending and agent is authorized to submit", {
14412
- actionType
14413
- });
14414
- if (command) queued.push(command);
14415
- return queued;
14416
- }
14417
14420
  if (actionType && canQueueCommand("execute_action", snapshot.nodeId, context, options)) {
14418
14421
  const pendingInvocation = readPendingInvocations(context.yDoc, snapshot.nodeId)[0];
14419
14422
  const payload = {
@@ -14468,7 +14471,7 @@ function planRalphLoopCommands(context, options = {}) {
14468
14471
  getInvocation,
14469
14472
  schemaVersion
14470
14473
  });
14471
- const snapshot = snapshotNode(block, runtime, now, pendingInvocationCount, completionVerification, isRepeatableAction(actionType));
14474
+ const snapshot = snapshotNode(block, runtime, now, pendingInvocationCount, completionVerification);
14472
14475
  snapshots.push(snapshot);
14473
14476
  queuedCommands.push(...planForSnapshot(context, options, block, snapshot));
14474
14477
  }
@@ -14491,10 +14494,6 @@ async function callExecutor(command, context, executor) {
14491
14494
  return executor.notifyActor ? executor.notifyActor(command, context) : { commandId: command.id, success: false, error: "No notifyActor handler configured" };
14492
14495
  case "validate_external_state":
14493
14496
  return executor.validateExternalState ? executor.validateExternalState(command, context) : { commandId: command.id, success: false, error: "No validateExternalState handler configured" };
14494
- case "submit_oracle_claim":
14495
- return executor.submitOracleClaim ? executor.submitOracleClaim(command, context) : { commandId: command.id, success: false, error: "No submitOracleClaim handler configured" };
14496
- case "watch_oracle_udid":
14497
- return executor.watchOracleUdid ? executor.watchOracleUdid(command, context) : { commandId: command.id, success: false, error: "No watchOracleUdid handler configured" };
14498
14497
  case "archive_flow":
14499
14498
  return executor.archiveFlow ? executor.archiveFlow(command, context) : { commandId: command.id, success: false, error: "No archiveFlow handler configured" };
14500
14499
  case "propose_config_change":
@@ -15055,7 +15054,6 @@ export {
15055
15054
  registerAction,
15056
15055
  getAction,
15057
15056
  getAllActions,
15058
- isRepeatableAction,
15059
15057
  getAliasEntries,
15060
15058
  hasAction,
15061
15059
  getActionByCan,
@@ -15065,6 +15063,9 @@ export {
15065
15063
  canToType,
15066
15064
  typeToCan,
15067
15065
  getAllCanMappings,
15066
+ SERVICE_VERBS,
15067
+ serviceCan,
15068
+ parseServiceCan,
15068
15069
  buildServicesFromHandlers,
15069
15070
  getDiffResolver,
15070
15071
  hasDiffResolver,
@@ -15163,6 +15164,9 @@ export {
15163
15164
  createMemoryUcanDelegationStore,
15164
15165
  createInvocationStore,
15165
15166
  createMemoryInvocationStore,
15167
+ NODE_CONTEXT_MAP_NAME,
15168
+ NODE_CONTEXT_OVERRIDES_MAP_NAME,
15169
+ isNodeContextRecord,
15166
15170
  compileBlockProps,
15167
15171
  COMPILED_BLOCK_TYPE,
15168
15172
  toEvaluatorOperator,
@@ -15214,4 +15218,4 @@ export {
15214
15218
  executeQueuedFlowAgentCoreCommands,
15215
15219
  FlowAgentService
15216
15220
  };
15217
- //# sourceMappingURL=chunk-EULL3QTC.js.map
15221
+ //# sourceMappingURL=chunk-JS7P4DUX.js.map