@sema-agent/client-core 0.92.0 → 0.93.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.
Files changed (125) hide show
  1. package/CHANGELOG.md +227 -0
  2. package/README.md +25 -16
  3. package/dist/adapt/arms.js +2 -0
  4. package/dist/adapt/toolCards.js +6 -4
  5. package/dist/adapt.d.ts +1 -1
  6. package/dist/adapt.js +1 -1
  7. package/dist/adapter/runStream.js +3 -1
  8. package/dist/agentsWireCaps.js +1 -1
  9. package/dist/approvalDecidedByCapability.d.ts +16 -0
  10. package/dist/approvalDecidedByCapability.js +47 -0
  11. package/dist/approvalsStreamLiveCapability.js +3 -3
  12. package/dist/askSurvivesStandingAnswer.d.ts +1 -1
  13. package/dist/centerWiringCapability.js +1 -1
  14. package/dist/cloudConfigWireCaps.js +5 -5
  15. package/dist/compensations.js +2 -2
  16. package/dist/decideReceipt.d.ts +2 -0
  17. package/dist/decideReceipt.js +34 -9
  18. package/dist/detachWire.d.ts +2 -14
  19. package/dist/detachWire.js +1 -47
  20. package/dist/deviceExecutorManagementCapability.d.ts +6 -2
  21. package/dist/deviceExecutorManagementCapability.js +61 -15
  22. package/dist/engineConfigDrift.d.ts +20 -0
  23. package/dist/engineConfigDrift.js +54 -0
  24. package/dist/engineErrorCodes.d.ts +3 -0
  25. package/dist/engineErrorCodes.js +12 -4
  26. package/dist/engineInlineTaskStats.d.ts +1 -0
  27. package/dist/engineNoticeCodes.d.ts +2 -2
  28. package/dist/engineWireFor.d.ts +22 -0
  29. package/dist/engineWireFor.js +154 -9
  30. package/dist/engineWireSdk.d.ts +0 -1
  31. package/dist/engineWireSdk.js +0 -3
  32. package/dist/executionLaneCapability.js +2 -2
  33. package/dist/fileHistoryCaptureCapability.d.ts +1 -1
  34. package/dist/fileHistoryCaptureCapability.js +1 -6
  35. package/dist/fileHistoryLegNotice.d.ts +1 -1
  36. package/dist/fileHistoryLegNotice.js +1 -6
  37. package/dist/gateVocabulary.d.ts +1 -5
  38. package/dist/gateVocabulary.js +4 -22
  39. package/dist/generated/engineFactTables.d.ts +4 -3
  40. package/dist/generated/engineFactTables.js +10 -0
  41. package/dist/generated/engineNoticeTables.d.ts +1 -1
  42. package/dist/generated/engineNoticeTables.js +1 -1
  43. package/dist/goalStopHook.d.ts +1 -8
  44. package/dist/goalStopHook.js +2 -58
  45. package/dist/headlessPermissionModeWire.d.ts +3 -2
  46. package/dist/headlessPermissionModeWire.js +46 -5
  47. package/dist/hitl/approvalResolution.d.ts +3 -2
  48. package/dist/hitl/approvalResolution.js +13 -0
  49. package/dist/hitl/askParkRowRouting.js +2 -2
  50. package/dist/hitl/frameRouter.js +7 -2
  51. package/dist/hitl/gateLedger.d.ts +1 -0
  52. package/dist/hitl/gateLedger.js +3 -0
  53. package/dist/hitl/hitlBridge.d.ts +1 -0
  54. package/dist/hitl/hitlBridge.js +6 -1
  55. package/dist/hitl/hitlHostSurface.d.ts +6 -2
  56. package/dist/hitl/hitlHostSurface.js +29 -3
  57. package/dist/hitl/parkResolver.js +22 -4
  58. package/dist/hitl/persistedRulesWire.js +29 -17
  59. package/dist/hitl/planReviewWire.d.ts +0 -2
  60. package/dist/hitl/planReviewWire.js +1 -18
  61. package/dist/hitl/sessionPolicyDeliverable.js +3 -3
  62. package/dist/hitl/sessionPolicyWire.d.ts +2 -0
  63. package/dist/hitl/sessionPolicyWire.js +7 -4
  64. package/dist/hitl/toolApprovalWire.d.ts +32 -7
  65. package/dist/hitl/toolApprovalWire.js +282 -59
  66. package/dist/hooksWireCaps.d.ts +1 -1
  67. package/dist/hooksWireCaps.js +1 -1
  68. package/dist/index.d.ts +7 -2
  69. package/dist/index.js +6 -2
  70. package/dist/inheritEnvWire.d.ts +1 -4
  71. package/dist/inheritEnvWire.js +0 -18
  72. package/dist/limitsWire.d.ts +0 -6
  73. package/dist/limitsWire.js +0 -38
  74. package/dist/mcpProbeCapability.js +1 -1
  75. package/dist/mcpProbeWire.js +10 -12
  76. package/dist/mcpReconnect.d.ts +5 -0
  77. package/dist/mcpReconnect.js +28 -0
  78. package/dist/memoryComplianceCapability.js +2 -2
  79. package/dist/memoryOriginCapability.js +2 -2
  80. package/dist/memoryVerbsWire.js +14 -13
  81. package/dist/ownKey.d.ts +2 -0
  82. package/dist/ownKey.js +15 -0
  83. package/dist/peerLaneCapability.js +2 -2
  84. package/dist/permissionModesCapability.d.ts +16 -0
  85. package/dist/permissionModesCapability.js +71 -0
  86. package/dist/permissionRuleIssue.js +1 -1
  87. package/dist/permissionRulesWriteCapability.js +2 -2
  88. package/dist/permissionWireCaps.d.ts +2 -0
  89. package/dist/permissionWireCaps.js +8 -1
  90. package/dist/permissionsAllowGrantCapability.js +7 -2
  91. package/dist/postureKnob.js +1 -1
  92. package/dist/protocolSegment.d.ts +2 -0
  93. package/dist/protocolSegment.js +3 -0
  94. package/dist/readFacePosture.js +1 -1
  95. package/dist/resumeRefusalCopy.d.ts +1 -0
  96. package/dist/resumeRefusalCopy.js +26 -3
  97. package/dist/retryStatus.js +2 -1
  98. package/dist/rewindArchiveCapability.js +2 -2
  99. package/dist/runTerminal.d.ts +16 -0
  100. package/dist/runTerminal.js +32 -3
  101. package/dist/seam.d.ts +1 -0
  102. package/dist/sessionPolicyCapability.js +1 -1
  103. package/dist/sessionSyncFileHistoryCapability.js +2 -2
  104. package/dist/skillToolListsCapability.js +1 -1
  105. package/dist/sqlEngineCapability.js +1 -1
  106. package/dist/steerPriorityCapability.js +1 -1
  107. package/dist/storePostureCapability.js +2 -2
  108. package/dist/supportFloor.d.ts +1 -0
  109. package/dist/supportFloor.js +13 -3
  110. package/dist/taskRequestWords.d.ts +4 -2
  111. package/dist/taskRequestWords.js +1 -1
  112. package/dist/toolHistoryBadTurn.js +1 -2
  113. package/dist/toolResult.d.ts +2 -1
  114. package/dist/toolResult.js +33 -3
  115. package/dist/userInvokedSkillsCapability.js +1 -1
  116. package/dist/webSearchBackendCapability.js +2 -2
  117. package/dist/webSearchWireCaps.d.ts +1 -1
  118. package/dist/webSearchWireCaps.js +40 -2
  119. package/dist/wireFailureShape.js +2 -2
  120. package/dist/wireRefusalCopy.d.ts +9 -3
  121. package/dist/wireRefusalCopy.js +41 -4
  122. package/dist/workflowsJournalCapability.js +1 -1
  123. package/dist/writeProtectionCapability.js +1 -1
  124. package/docs/INTEGRATION-CLIENTS.md +999 -15
  125. package/package.json +2 -2
@@ -1,15 +1,16 @@
1
1
  import { APPROVAL_CARD_PORT_KEY_MISMATCH_REASON, DEFAULT_DENY_REASON, DecideTransportRetryExhaustedError, HitlBridge, NO_APPROVAL_CARD_PORT_REASON, HitlSafetyError, denyReasonForWire, findPendingForTask, readDecideCurrentPending, readWireErrorCode, } from './hitlBridge.js';
2
2
  import { askParkRowArm } from './askParkRowRouting.js';
3
3
  import { hostLog } from '../host.js';
4
- import { readOwnNonEmptyString } from '../ownKey.js';
4
+ import { readOwnDataNonEmptyString, readOwnDataValue, readOwnNonEmptyString } from '../ownKey.js';
5
5
  import { readAskClassPair } from './askClassPair.js';
6
6
  import { legacyShadowedRuleTextOf, readAllowRuleShadowFromWire } from './allowRuleShadow.js';
7
7
  import { createSessionSlot, DEFAULT_SESSION_KEY } from '../sessionSlot.js';
8
8
  import { readEngineActiveBgTasks } from '../fleet/fleetLedger.js';
9
- import { observeCancelByDeny, surfaceRememberNotApplied, surfaceEditNotForwarded, surfaceEditRefusedOnBlindAsk, surfaceRuleArmNotSent, surfaceRuleArmRejected } from './hitlHostSurface.js';
9
+ import { observeCancelByDeny, surfaceApprovalParking, surfaceRememberNotApplied, surfaceEditNotForwarded, surfaceEditRefusedOnBlindAsk, surfaceRuleArmNotSent, surfaceRuleArmRejected } from './hitlHostSurface.js';
10
10
  import { approvalCallKey, liveFrameCallKey } from './gateIdentity.js';
11
11
  import { isApprovalMandateWord } from '../gateVocabulary.js';
12
12
  import { denyAttributionRefusalFromError } from '../wireRefusalCopy.js';
13
+ import { approvalDecidedByAdmitted } from '../approvalDecidedByCapability.js';
13
14
  import { decideFailureNote } from '../decideFailureNote.js';
14
15
  import { refusalSaysStillPending } from '../engineErrorCodes.js';
15
16
  import { readDecideReceipt } from '../decideReceipt.js';
@@ -169,10 +170,117 @@ function isParkRowInputSizeMarker(v) {
169
170
  const o = v;
170
171
  return o.truncated === true && typeof o.bytes === 'number' && Number.isFinite(o.bytes) && o.bytes >= 0;
171
172
  }
173
+ const durableDecisionHolds = { inFlight: new Map(), settled: new Map(), openReads: new Set(), clock: 0 };
174
+ function durableHoldKey(row, callKey) {
175
+ return JSON.stringify([typeof row.sessionId === 'string' ? row.sessionId : null, typeof row.taskId === 'string' ? row.taskId : null, callKey]);
176
+ }
177
+ function openDurableRead() {
178
+ const mark = ++durableDecisionHolds.clock;
179
+ durableDecisionHolds.openReads.add(mark);
180
+ return mark;
181
+ }
182
+ function closeDurableRead(mark) {
183
+ const h = durableDecisionHolds;
184
+ h.openReads.delete(mark);
185
+ let oldest = Infinity;
186
+ for (const m of h.openReads)
187
+ if (m < oldest)
188
+ oldest = m;
189
+ for (const [key, s] of h.settled)
190
+ if (s.at <= oldest)
191
+ h.settled.delete(key);
192
+ }
193
+ function heldDurableDecision(holdKey, readMark) {
194
+ const live = durableDecisionHolds.inFlight.get(holdKey);
195
+ if (live !== undefined)
196
+ return live;
197
+ const recent = durableDecisionHolds.settled.get(holdKey);
198
+ return recent !== undefined && recent.at > readMark ? recent.hold : undefined;
199
+ }
200
+ function holdDurableDecision(holdKey, callerSignal, decide) {
201
+ const h = durableDecisionHolds;
202
+ const interruption = new AbortController();
203
+ let settled = false;
204
+ const interrupt = () => {
205
+ if (!settled && !interruption.signal.aborted)
206
+ interruption.abort();
207
+ };
208
+ if (callerSignal?.aborted === true)
209
+ interrupt();
210
+ else
211
+ callerSignal?.addEventListener('abort', interrupt, { once: true });
212
+ let resolveOutcome = () => { };
213
+ let rejectOutcome = () => { };
214
+ const outcome = new Promise((resolve, reject) => {
215
+ resolveOutcome = resolve;
216
+ rejectOutcome = reject;
217
+ });
218
+ const hold = { outcome, presented: false, interrupt, cardSignal: interruption.signal };
219
+ h.inFlight.set(holdKey, hold);
220
+ const release = () => {
221
+ if (h.inFlight.get(holdKey) === hold)
222
+ h.inFlight.delete(holdKey);
223
+ if (h.openReads.size > 0)
224
+ h.settled.set(holdKey, { at: ++h.clock, hold });
225
+ };
226
+ const settle = (give) => {
227
+ settled = true;
228
+ callerSignal?.removeEventListener('abort', interrupt);
229
+ const trailing = hold.trailing;
230
+ if (trailing === undefined) {
231
+ release();
232
+ give();
233
+ return;
234
+ }
235
+ give();
236
+ trailing.then(release, release);
237
+ };
238
+ decide(hold).then((o) => settle(() => resolveOutcome(o)), (e) => settle(() => rejectOutcome(e)));
239
+ return outcome;
240
+ }
241
+ async function joinDurableDecision(hold, deps, signal) {
242
+ if (signal?.aborted === true)
243
+ hold.interrupt();
244
+ else
245
+ signal?.addEventListener('abort', hold.interrupt, { once: true });
246
+ let o;
247
+ try {
248
+ o = await hold.outcome;
249
+ }
250
+ finally {
251
+ signal?.removeEventListener('abort', hold.interrupt);
252
+ }
253
+ if (hold.presented) {
254
+ try {
255
+ deps.onPresented?.();
256
+ }
257
+ catch {
258
+ }
259
+ }
260
+ return { ...o, joinedInFlight: true };
261
+ }
172
262
  export async function surfaceFsApprovalAndDecide(deps, taskId, argsByCall, signal, parkGatedCallId) {
173
- const found = await findPendingForTask(deps.client, taskId, (toolName) => toolName !== undefined && (toolNameIsFsWrite(toolName) || toolNameIsShellExec(toolName)), signal ? { signal } : undefined, parkGatedCallId, (row) => askParkRowArm(row) === 'tool-gate');
263
+ const decidedByReading = decidedByReadingSnapshotOf(deps);
264
+ const readMark = openDurableRead();
265
+ let found;
266
+ let held;
267
+ try {
268
+ found = await findPendingForTask(deps.client, taskId, (toolName) => toolName !== undefined && (toolNameIsFsWrite(toolName) || toolNameIsShellExec(toolName)), signal ? { signal } : undefined, parkGatedCallId, (row) => askParkRowArm(row) === 'tool-gate');
269
+ if (found.ok)
270
+ held = heldDurableDecision(durableHoldKey(found.pending, approvalCallKey(found.gatedCallId, taskId)), readMark);
271
+ }
272
+ finally {
273
+ closeDurableRead(readMark);
274
+ }
174
275
  if (!found.ok)
175
276
  return { kind: 'failed', stage: 'fetch', reason: found.reason, ...(found.code !== undefined ? { code: found.code } : {}) };
277
+ if (held !== undefined)
278
+ return joinDurableDecision(held, deps, signal);
279
+ const callKey = approvalCallKey(found.gatedCallId, taskId);
280
+ const fetched = found;
281
+ return holdDurableDecision(durableHoldKey(fetched.pending, callKey), signal, (hold) => presentFsApprovalAndDecide(deps, taskId, argsByCall, signal, fetched, decidedByReading, callKey, hold));
282
+ }
283
+ async function presentFsApprovalAndDecide(deps, taskId, argsByCall, signal, found, decidedByReading, callKey, hold) {
176
284
  const { pending, gatedCallId } = found;
177
285
  const toolName = typeof pending.toolName === 'string' ? pending.toolName : '';
178
286
  const streamArgs = gatedCallId !== undefined ? argsByCall.get(gatedCallId) : undefined;
@@ -189,18 +297,18 @@ export async function surfaceFsApprovalAndDecide(deps, taskId, argsByCall, signa
189
297
  return { kind: 'failed', stage: 'input', gatedCallId, reason: 'gate has no tool input payload' };
190
298
  }
191
299
  const bridge = new HitlBridge(deps.client, taskId, deps.onDecideOperation ? { onDecideOperation: deps.onDecideOperation } : undefined);
192
- const callKey = approvalCallKey(gatedCallId, taskId);
193
- const ruleOffersReadOnly = readRuleOfferSupply(pending.ruleOffers, pending.ruleSuggestions);
300
+ const ruleOffersReadOnly = readRuleOffers(pending.ruleOffers);
194
301
  const durableProbeCause = pending.riskDescriptor?.probeCause;
195
302
  const durableProbeReason = readProbeReason(pending.riskDescriptor);
196
303
  const durableShadow = readAllowRuleShadowFromWire(pending, 'row');
197
304
  const durableRuleOffersAbsence = pending.ruleOffersAbsence;
305
+ hold.presented = true;
198
306
  deps.onPresented?.();
199
307
  const card = await surfaceApprovalCard({
200
308
  toolName,
201
309
  args,
202
310
  callKey,
203
- ...(signal ? { signal } : {}),
311
+ signal: hold.cardSignal,
204
312
  ...(rowArgsGap !== undefined
205
313
  ? {
206
314
  argsUnavailable: true,
@@ -243,7 +351,11 @@ export async function surfaceFsApprovalAndDecide(deps, taskId, argsByCall, signa
243
351
  hostLog('debug', `liveHitlAskWire: approval card retracted without a decision for ${gatedCallId ?? '(no call)'} — nothing sent`);
244
352
  return { kind: 'retracted', gatedCallId };
245
353
  case 'aborted':
246
- observeCancelByDeny(bridge.decideTool({ decision: 'deny', reason: 'Interrupted by user' }, gatedCallId, undefined, pending), taskId);
354
+ {
355
+ const cancelDeny = bridge.decideTool({ decision: 'deny', reason: 'Interrupted by user' }, gatedCallId, undefined, pending);
356
+ hold.trailing = cancelDeny;
357
+ observeCancelByDeny(cancelDeny, taskId);
358
+ }
247
359
  return { kind: 'aborted', gatedCallId };
248
360
  case 'allow':
249
361
  try {
@@ -295,31 +407,56 @@ export async function surfaceFsApprovalAndDecide(deps, taskId, argsByCall, signa
295
407
  }
296
408
  case 'deny': {
297
409
  const denySettledByForWire = readApprovalDenySettledBy(card);
410
+ const attributionKeys = decisionAttributionKeyOf(decidedByReading, denySettledByForWire);
298
411
  const denyReasonSnapshot = typeof card.reason === 'string' ? card.reason : undefined;
299
412
  let lastSendCarriedAttribution = false;
300
413
  try {
301
414
  const denyBody = {
302
415
  decision: 'deny',
303
416
  reason: denyReasonForWire(denyReasonSnapshot, `task ${taskId}`) ?? DEFAULT_DENY_REASON,
304
- ...(denySettledByForWire === 'policy' ? { settledBy: 'policy' } : {}),
417
+ ...attributionKeys,
305
418
  };
306
419
  let attributionDropped = false;
420
+ let attributionRenamed = false;
307
421
  let raw;
308
- lastSendCarriedAttribution = denySettledByForWire === 'policy';
422
+ lastSendCarriedAttribution = carriesAttributionKey(attributionKeys);
309
423
  try {
310
424
  raw = await bridge.decideTool(denyBody, gatedCallId, decideOpts, pending);
311
425
  }
312
426
  catch (first) {
313
- if (!shouldResendWithoutAttribution(first, lastSendCarriedAttribution, signal))
427
+ if (shouldResendWithoutAttribution(first, lastSendCarriedAttribution, signal)) {
428
+ const withoutAttribution = withoutAttributionKey(denyBody);
429
+ lastSendCarriedAttribution = false;
430
+ hostLog('debug', `liveToolApprovalWire: decide(deny) for task ${taskId} was refused because the settlement note is not part of ` +
431
+ 'what this deployment signs — re-sending the SAME decision exactly once with that one key removed ' +
432
+ '(the refusal happened before the approval was judged, so nothing was consumed and this is a re-delivery, not a second act)');
433
+ raw = await bridge.decideTool(withoutAttribution, gatedCallId, decideOpts, pending);
434
+ attributionDropped = true;
435
+ }
436
+ else if (shouldResendUnderSuccessorKey(first, Object.hasOwn(denyBody, 'settledBy'), signal)) {
437
+ const renamed = withAttributionKeyRenamed(denyBody);
438
+ hostLog('debug', `liveToolApprovalWire: decide(deny) for task ${taskId} was refused because the settlement note was sent under a name ` +
439
+ 'this engine has retired — re-sending the SAME decision exactly once with that one key renamed to the name the refusal points to ' +
440
+ '(the refusal happened before the approval was judged, so nothing was consumed and this is a re-delivery, not a second act)');
441
+ try {
442
+ raw = await bridge.decideTool(renamed, gatedCallId, decideOpts, pending);
443
+ attributionRenamed = true;
444
+ }
445
+ catch (second) {
446
+ if (!shouldResendWithoutAttribution(second, true, signal))
447
+ throw second;
448
+ const renamedWithoutAttribution = withoutAttributionKey(renamed);
449
+ lastSendCarriedAttribution = false;
450
+ hostLog('debug', `liveToolApprovalWire: decide(deny) for task ${taskId} was refused again because the settlement note is not part of ` +
451
+ 'what this deployment signs — re-sending the SAME decision exactly once more with that key removed ' +
452
+ '(still before the approval was judged)');
453
+ raw = await bridge.decideTool(renamedWithoutAttribution, gatedCallId, decideOpts, pending);
454
+ attributionDropped = true;
455
+ }
456
+ }
457
+ else {
314
458
  throw first;
315
- const { settledBy: _droppedKey, ...withoutAttribution } = denyBody;
316
- void _droppedKey;
317
- lastSendCarriedAttribution = false;
318
- hostLog('debug', `liveToolApprovalWire: decide(deny) for task ${taskId} was refused because the settlement note is not part of ` +
319
- 'what this deployment signs — re-sending the SAME decision exactly once with that one key removed ' +
320
- '(the refusal happened before the approval was judged, so nothing was consumed and this is a re-delivery, not a second act)');
321
- raw = await bridge.decideTool(withoutAttribution, gatedCallId, decideOpts, pending);
322
- attributionDropped = true;
459
+ }
323
460
  }
324
461
  const receipt = readDecideReceipt(raw);
325
462
  const denySettledBy = denySettledByForWire;
@@ -331,6 +468,7 @@ export async function surfaceFsApprovalAndDecide(deps, taskId, argsByCall, signa
331
468
  ...(denySettledBy !== undefined ? { denySettledBy } : {}),
332
469
  ...(denyReason !== undefined ? { denyReason } : {}),
333
470
  ...(attributionDropped ? { denyAttributionDropped: true } : {}),
471
+ ...(attributionRenamed ? { denyAttributionRenamed: true } : {}),
334
472
  ...(receipt !== undefined ? { receipt } : {}),
335
473
  };
336
474
  }
@@ -360,6 +498,8 @@ export async function surfaceFsApprovalAndDecide(deps, taskId, argsByCall, signa
360
498
  decideSpan.close();
361
499
  }
362
500
  }
501
+ const _boundGrantsPin = [true, true, true];
502
+ void _boundGrantsPin;
363
503
  function readReadRootCandidate(v) {
364
504
  if (typeof v !== 'object' || v === null)
365
505
  return undefined;
@@ -382,11 +522,9 @@ export const TOOL_APPROVAL_FRAME_KEYS_MIRROR = [
382
522
  'args',
383
523
  'argsOmitted',
384
524
  'governanceForced',
385
- 'ruleSuggestions',
386
525
  'ruleOffers',
387
526
  'ruleOffersAbsence',
388
527
  'denialLimitFallback',
389
- 'ruleStoreUnreadable',
390
528
  'readRootCandidate',
391
529
  'mandated',
392
530
  'mandate',
@@ -400,6 +538,9 @@ export const TOOL_APPROVAL_FRAME_KEYS_MIRROR = [
400
538
  'probeCause',
401
539
  'probeReason',
402
540
  'rememberRefused',
541
+ 'boundGrantDigest',
542
+ 'boundGrants',
543
+ 'classifierNoRuling',
403
544
  'ruleEvidence',
404
545
  'requiresRealApproval',
405
546
  'expiresInMs',
@@ -515,6 +656,27 @@ export function readToolApprovalRespondAck(v) {
515
656
  }
516
657
  return out;
517
658
  }
659
+ function readToolApprovalRespondParking(v) {
660
+ if (typeof v !== 'object' || v === null)
661
+ return undefined;
662
+ const read = (fn) => {
663
+ try {
664
+ return fn();
665
+ }
666
+ catch {
667
+ return undefined;
668
+ }
669
+ };
670
+ if (read(() => readOwnDataNonEmptyString(v, 'reason')) !== 'parking_in_progress')
671
+ return undefined;
672
+ const approvalId = read(() => readOwnDataNonEmptyString(v, 'approvalId'));
673
+ if (approvalId === undefined)
674
+ return { kind: 'claimed_unreadable' };
675
+ const hint = read(() => readOwnDataValue(v, 'retryAfterMs'));
676
+ const retryAfterMs = typeof hint === 'number' && Number.isFinite(hint) && hint >= 0 ? hint : undefined;
677
+ const decidePath = read(() => readOwnDataNonEmptyString(v, 'decidePath'));
678
+ return { kind: 'parking', view: { approvalId, ...(retryAfterMs !== undefined ? { retryAfterMs } : {}), ...(decidePath !== undefined ? { decidePath } : {}) } };
679
+ }
518
680
  function isNonEmptyStringArray(v) {
519
681
  return Array.isArray(v) && v.length > 0 && v.every(x => typeof x === 'string' && x !== '');
520
682
  }
@@ -550,13 +712,50 @@ function readPersistedRuleAnchors(v) {
550
712
  function isNonNegativeSafeInt(v) {
551
713
  return typeof v === 'number' && Number.isSafeInteger(v) && v >= 0;
552
714
  }
553
- function shouldResendWithoutAttribution(e, sentSettledBy, signal) {
554
- if (!sentSettledBy)
715
+ function shouldResendWithoutAttribution(e, sentAttributionKey, signal) {
716
+ if (!sentAttributionKey)
555
717
  return false;
556
718
  if (signal?.aborted === true)
557
719
  return false;
558
720
  return denyAttributionRefusalFromError(e, true)?.kind === 'not_in_proof';
559
721
  }
722
+ function shouldResendUnderSuccessorKey(e, lastSendCarriedRetiredKey, signal) {
723
+ if (!lastSendCarriedRetiredKey)
724
+ return false;
725
+ if (signal?.aborted === true)
726
+ return false;
727
+ return denyAttributionRefusalFromError(e, true)?.kind === 'retired_key';
728
+ }
729
+ export function decisionAttributionKeyOf(reading, denySettledBy) {
730
+ if (denySettledBy !== 'policy')
731
+ return {};
732
+ return approvalDecidedByAdmitted(reading) ? { decidedBy: 'policy' } : { settledBy: 'policy' };
733
+ }
734
+ function carriesAttributionKey(body) {
735
+ return Object.hasOwn(body, 'settledBy') || Object.hasOwn(body, 'decidedBy');
736
+ }
737
+ function withoutAttributionKey(body) {
738
+ const { settledBy: _droppedSettledBy, decidedBy: _droppedDecidedBy, ...rest } = body;
739
+ void _droppedSettledBy;
740
+ void _droppedDecidedBy;
741
+ return rest;
742
+ }
743
+ function withAttributionKeyRenamed(body) {
744
+ const { settledBy, decidedBy: _replaced, ...rest } = body;
745
+ void _replaced;
746
+ return settledBy === undefined ? rest : { ...rest, decidedBy: settledBy };
747
+ }
748
+ function readDecidedByReadingOf(holder) {
749
+ try {
750
+ return readOwnDataValue(holder, 'approvalDecidedBy');
751
+ }
752
+ catch {
753
+ return undefined;
754
+ }
755
+ }
756
+ function decidedByReadingSnapshotOf(holder) {
757
+ return approvalDecidedByAdmitted(readDecidedByReadingOf(holder)) ? Object.freeze({ kind: 'present', value: true }) : undefined;
758
+ }
560
759
  export function readToolApprovalRespondRefusal(err) {
561
760
  const pick = (key) => {
562
761
  try {
@@ -789,24 +988,8 @@ export function readRuleOffers(v) {
789
988
  }
790
989
  return out.length > 0 ? out : undefined;
791
990
  }
792
- function readLegacyRuleSuggestions(v) {
793
- if (!Array.isArray(v))
794
- return undefined;
795
- if (v.length === 0 || v.length > MAX_RULE_OFFERS_TOLERATED)
796
- return undefined;
797
- const out = [];
798
- for (let i = 0; i < v.length; i++) {
799
- const triple = readRuleTriple(v[i]);
800
- if (triple === undefined)
801
- continue;
802
- out.push({ kind: 'single', offerIndex: i, ...triple });
803
- }
804
- return out.length > 0 ? out : undefined;
805
- }
806
- export function readRuleOfferSupply(offers, legacy) {
807
- if (offers !== undefined && offers !== null)
808
- return readRuleOffers(offers);
809
- return readLegacyRuleSuggestions(legacy);
991
+ export function readRuleOfferSupply(offers) {
992
+ return readRuleOffers(offers);
810
993
  }
811
994
  function subagentBadgeFor(frame) {
812
995
  let name = typeof frame.sourceAgentName === 'string' && frame.sourceAgentName.length > 0 ? frame.sourceAgentName : '';
@@ -830,6 +1013,7 @@ const MAX_RESPOND_NOTE_CHARS = 2048;
830
1013
  export async function surfaceToolApprovalFrameAndRespond(frame, respond, streamArgs, signal, lane) {
831
1014
  const approvalId = frame.approvalId;
832
1015
  const frameToolCallId = typeof frame.toolCallId === 'string' && frame.toolCallId !== '' ? frame.toolCallId : undefined;
1016
+ const decidedByReading = decidedByReadingSnapshotOf(lane);
833
1017
  const toolName = typeof frame.toolName === 'string' ? frame.toolName : 'Write';
834
1018
  let args = streamArgs !== undefined && streamArgs !== null
835
1019
  ? streamArgs
@@ -854,7 +1038,7 @@ export async function surfaceToolApprovalFrameAndRespond(frame, respond, streamA
854
1038
  }
855
1039
  }
856
1040
  const argsNotRealInput = argsFallback || lane?.argsUnavailable === true;
857
- const ruleOffers = readRuleOfferSupply(frame.ruleOffers, frame.ruleSuggestions);
1041
+ const ruleOffers = readRuleOffers(frame.ruleOffers);
858
1042
  const denialLimitFallback = readDenialLimitFallback(frame.denialLimitFallback);
859
1043
  const frameShadow = readAllowRuleShadowFromWire(frame, 'frame');
860
1044
  const card = await surfaceApprovalCard({
@@ -912,8 +1096,9 @@ export async function surfaceToolApprovalFrameAndRespond(frame, respond, streamA
912
1096
  }
913
1097
  const decision = card.kind === 'allow' ? (card.allowSession ? 'allow_session' : 'allow') : 'deny';
914
1098
  const denySettledByForWire = card.kind === 'deny' ? readApprovalDenySettledBy(card) : undefined;
915
- const sentSettledBy = decision === 'deny' && denySettledByForWire === 'policy';
916
- let lastSendCarriedAttribution = sentSettledBy;
1099
+ const attributionKeys = decision === 'deny' ? decisionAttributionKeyOf(decidedByReading, denySettledByForWire) : {};
1100
+ const sentAttributionKey = carriesAttributionKey(attributionKeys);
1101
+ let lastSendCarriedAttribution = sentAttributionKey;
917
1102
  const denyReasonSnapshot = card.kind === 'deny' && typeof card.reason === 'string' ? card.reason : undefined;
918
1103
  if (card.kind === 'failed') {
919
1104
  hostLog('debug', `liveToolApprovalWire: approval card unavailable (${card.reason}) — fail-closed deny for ${approvalId}`);
@@ -940,14 +1125,14 @@ export async function surfaceToolApprovalFrameAndRespond(frame, respond, streamA
940
1125
  let persistRuleBatchOfferIndex;
941
1126
  let batchArmTarget;
942
1127
  let ruleArmDroppedForCaps = false;
943
- let ruleArmDroppedForCheck = false;
1128
+ let ruleArmDroppedForCheck;
944
1129
  const wantsTextArm = card.kind === 'allow' && typeof card.persistRule === 'string' && card.persistRule !== '';
945
1130
  const wantsBatchArm = card.kind === 'allow' && card.persistRuleBatchOfferIndex !== undefined;
946
1131
  if (wantsTextArm && wantsBatchArm) {
947
1132
  hostLog('error', `liveToolApprovalWire: DROPPING the whole persistRule arm for ${approvalId} — the card returned BOTH a rule ` +
948
1133
  'text and a batchOfferIndex; the server rejects that combination with a 400 that would take the decision down ' +
949
1134
  'with it, and picking one arm here would be deciding on the user\'s behalf (the decision itself still goes through)');
950
- ruleArmDroppedForCheck = true;
1135
+ ruleArmDroppedForCheck = 'both_arms';
951
1136
  }
952
1137
  else if (card.kind === 'allow' &&
953
1138
  card.persistRuleBatchOfferIndex !== undefined &&
@@ -972,7 +1157,7 @@ export async function surfaceToolApprovalFrameAndRespond(frame, respond, streamA
972
1157
  hostLog('error', `liveToolApprovalWire: DROPPING persistRuleBatchOfferIndex(${String(idx)}) for ${approvalId} — that wire ` +
973
1158
  'index is not a batch offer on this frame (out of range, a single offer, or not a non-negative integer); ' +
974
1159
  'never redeeming an index the engine did not offer as a batch');
975
- ruleArmDroppedForCheck = true;
1160
+ ruleArmDroppedForCheck = 'index_not_a_batch_offer';
976
1161
  }
977
1162
  }
978
1163
  else if (wantsTextArm && card.kind === 'allow' && typeof card.persistRule === 'string' && decision !== 'deny') {
@@ -994,7 +1179,7 @@ export async function surfaceToolApprovalFrameAndRespond(frame, respond, streamA
994
1179
  }
995
1180
  else {
996
1181
  hostLog('error', `liveToolApprovalWire: DROPPING persistRule for ${approvalId} — the card returned a rule that is not among the frame's SINGLE offers (a batch member's text is not a selectable candidate either: a conjunction batch is redeemed by index, all-or-nothing) — never sending un-offered text to the rule store`);
997
- ruleArmDroppedForCheck = true;
1182
+ ruleArmDroppedForCheck = 'text_not_offered';
998
1183
  }
999
1184
  }
1000
1185
  const respondOpts = {
@@ -1004,24 +1189,61 @@ export async function surfaceToolApprovalFrameAndRespond(frame, respond, streamA
1004
1189
  ...(persistRuleEdited !== undefined ? { persistRuleEdited } : {}),
1005
1190
  ...(persistRuleBatchOfferIndex !== undefined ? { persistRuleBatchOfferIndex } : {}),
1006
1191
  ...(note !== undefined ? { note } : {}),
1007
- ...(sentSettledBy ? { settledBy: 'policy' } : {}),
1192
+ ...attributionKeys,
1008
1193
  };
1009
1194
  let attributionDropped = false;
1195
+ let attributionRenamed = false;
1010
1196
  let raw;
1011
1197
  try {
1012
1198
  raw = await respond(approvalId, decision, respondOpts);
1013
1199
  }
1014
1200
  catch (first) {
1015
- if (!shouldResendWithoutAttribution(first, lastSendCarriedAttribution, signal))
1201
+ if (shouldResendWithoutAttribution(first, lastSendCarriedAttribution, signal)) {
1202
+ const withoutAttribution = withoutAttributionKey(respondOpts);
1203
+ lastSendCarriedAttribution = false;
1204
+ hostLog('debug', `liveToolApprovalWire: respond(deny) for ${approvalId} was refused because the settlement note is not part of ` +
1205
+ 'what this deployment signs — re-sending the SAME decision exactly once with that one key removed ' +
1206
+ '(the refusal happened before the approval was judged, so nothing was consumed and this is a re-delivery, not a second act)');
1207
+ raw = await respond(approvalId, decision, withoutAttribution);
1208
+ attributionDropped = true;
1209
+ }
1210
+ else if (shouldResendUnderSuccessorKey(first, Object.hasOwn(respondOpts, 'settledBy'), signal)) {
1211
+ const renamed = withAttributionKeyRenamed(respondOpts);
1212
+ hostLog('debug', `liveToolApprovalWire: respond(deny) for ${approvalId} was refused because the settlement note was sent under a name ` +
1213
+ 'this engine has retired — re-sending the SAME decision exactly once with that one key renamed to the name the refusal points to ' +
1214
+ '(the refusal happened before the approval was judged, so nothing was consumed and this is a re-delivery, not a second act)');
1215
+ try {
1216
+ raw = await respond(approvalId, decision, renamed);
1217
+ attributionRenamed = true;
1218
+ }
1219
+ catch (second) {
1220
+ if (!shouldResendWithoutAttribution(second, true, signal))
1221
+ throw second;
1222
+ const renamedWithoutAttribution = withoutAttributionKey(renamed);
1223
+ lastSendCarriedAttribution = false;
1224
+ hostLog('debug', `liveToolApprovalWire: respond(deny) for ${approvalId} was refused again because the settlement note is not part of ` +
1225
+ 'what this deployment signs — re-sending the SAME decision exactly once more with that key removed ' +
1226
+ '(still before the approval was judged)');
1227
+ raw = await respond(approvalId, decision, renamedWithoutAttribution);
1228
+ attributionDropped = true;
1229
+ }
1230
+ }
1231
+ else {
1016
1232
  throw first;
1017
- const { settledBy: _droppedKey, ...withoutAttribution } = respondOpts;
1018
- void _droppedKey;
1019
- lastSendCarriedAttribution = false;
1020
- hostLog('debug', `liveToolApprovalWire: respond(deny) for ${approvalId} was refused because the settlement note is not part of ` +
1021
- 'what this deployment signs — re-sending the SAME decision exactly once with that one key removed ' +
1022
- '(the refusal happened before the approval was judged, so nothing was consumed and this is a re-delivery, not a second act)');
1023
- raw = await respond(approvalId, decision, withoutAttribution);
1024
- attributionDropped = true;
1233
+ }
1234
+ }
1235
+ const parkingBody = readToolApprovalRespondParking(raw);
1236
+ if (parkingBody !== undefined) {
1237
+ const parking = parkingBody.kind === 'parking' && parkingBody.view.approvalId === approvalId ? parkingBody.view : undefined;
1238
+ if (parking !== undefined) {
1239
+ hostLog('debug', `liveToolApprovalWire: respond(${decision}) for ${approvalId} answered 202 parking_in_progress${parking.retryAfterMs !== undefined ? ` (retryAfterMs=${parking.retryAfterMs})` : ''} — ` +
1240
+ `the answer did NOT take effect${parking.decidePath !== undefined ? ' (the engine pointed at a decide path for the parked card)' : ''}; not re-sent, not reported as decided; the user is told to answer again on the parked card`);
1241
+ surfaceApprovalParking(parking.retryAfterMs);
1242
+ return { decision: 'unresolved', parking };
1243
+ }
1244
+ hostLog('error', `liveToolApprovalWire: 202 parking body for ${approvalId} is ${parkingBody.kind === 'parking' ? `for another approval (${parkingBody.view.approvalId})` : 'unreadable (approvalId is not usable)'} — ` +
1245
+ 'reporting the answer as NOT settled (never as decided, never as parked); not re-sent');
1246
+ return { decision: 'unresolved' };
1025
1247
  }
1026
1248
  const parsed = readToolApprovalRespondAck(raw);
1027
1249
  let ack = parsed;
@@ -1077,8 +1299,8 @@ export async function surfaceToolApprovalFrameAndRespond(frame, respond, streamA
1077
1299
  }
1078
1300
  if (ruleArmDroppedForCaps)
1079
1301
  surfaceRuleArmNotSent();
1080
- if (ruleArmDroppedForCheck)
1081
- surfaceRuleArmRejected();
1302
+ if (ruleArmDroppedForCheck !== undefined)
1303
+ surfaceRuleArmRejected(ruleArmDroppedForCheck);
1082
1304
  if (decision === 'allow_session' && ack?.rememberApplied === false) {
1083
1305
  logAfterDecided(`liveToolApprovalWire: ${approvalId} allow_session ack rememberApplied=false — grant not stored, surfacing honest notice`);
1084
1306
  surfaceRememberNotApplied();
@@ -1094,6 +1316,7 @@ export async function surfaceToolApprovalFrameAndRespond(frame, respond, streamA
1094
1316
  const denyAttribution = decision === 'deny'
1095
1317
  ? {
1096
1318
  ...(attributionDropped ? { denyAttributionDropped: true } : {}),
1319
+ ...(attributionRenamed ? { denyAttributionRenamed: true } : {}),
1097
1320
  ...(denySettledByForWire !== undefined ? { denySettledBy: denySettledByForWire } : {}),
1098
1321
  ...(denyReasonSnapshot !== undefined && denyReasonSnapshot.trim() !== ''
1099
1322
  ? { denyReason: denyReasonSnapshot }
@@ -1,7 +1,7 @@
1
1
  import { type HooksWirePlan, type HooksWirePlanOptions } from './pluginHooksWire.js';
2
2
  import { type HookFailureNotice } from './notifications.js';
3
3
  import type { WireHooksConfig } from './finalVerifyWire.js';
4
- export { GOAL_STOP_HOOK_WIRE_ENV, CC_STOP_SEMANTICS_MIN_SERVER, ccStopSemanticsFromVersion, engineCcStopSemantics, isGoalStopHookWireArmed, setWireSessionStopHook, getWireSessionStopHook, getWireSessionStopHookCcSemantics, buildGoalStopHookPrompt, } from './goalStopHook.js';
4
+ export { GOAL_STOP_HOOK_WIRE_ENV, isGoalStopHookWireArmed, setWireSessionStopHook, getWireSessionStopHook, } from './goalStopHook.js';
5
5
  export type { WireHooksConfig };
6
6
  export interface HooksForWireOptions {
7
7
  readonly plan?: HooksWirePlan;
@@ -5,7 +5,7 @@ import { hostLog, hostSettings } from './host.js';
5
5
  import { createSettingsHookJudge, decidePluginHooks, dedupeSettingsHookGroups, filterSettingsHookGroups, occupancyOf, settingsHookDropText, } from './pluginHooksWire.js';
6
6
  import { MAX_HOOK_NOTICE_TEXT_CHARS } from './notifications.js';
7
7
  import { goalStopHookMatcher, __resetGoalStopHookForTests } from './goalStopHook.js';
8
- export { GOAL_STOP_HOOK_WIRE_ENV, CC_STOP_SEMANTICS_MIN_SERVER, ccStopSemanticsFromVersion, engineCcStopSemantics, isGoalStopHookWireArmed, setWireSessionStopHook, getWireSessionStopHook, getWireSessionStopHookCcSemantics, buildGoalStopHookPrompt, } from './goalStopHook.js';
8
+ export { GOAL_STOP_HOOK_WIRE_ENV, isGoalStopHookWireArmed, setWireSessionStopHook, getWireSessionStopHook, } from './goalStopHook.js';
9
9
  const EDITABLE_HOOK_SOURCES = ['userSettings', 'projectSettings', 'localSettings'];
10
10
  const ALL_HOOK_SOURCES = ['policySettings', ...EDITABLE_HOOK_SOURCES, 'flagSettings'];
11
11
  const _hookSourceListsPin = [true, true];
package/dist/index.d.ts CHANGED
@@ -55,11 +55,16 @@ export * from './workflowsJournalCapability.js';
55
55
  export * from './userInvokedSkillsCapability.js';
56
56
  export * from './skillToolListsCapability.js';
57
57
  export * from './steerPriorityCapability.js';
58
+ export * from './permissionModesCapability.js';
59
+ export * from './approvalDecidedByCapability.js';
58
60
  export * from './mcpProbeWire.js';
59
61
  export * from './effectiveFacts.js';
60
62
  export * from './gateOutcome.js';
61
63
  export * from './postureKnob.js';
62
64
  export * from './engineIdentity.js';
65
+ export { transportFailureScene } from './engineWireFor.js';
66
+ export type { EngineWireNoAnswerKind, TransportFailureChainEnd, TransportFailureLayer, TransportFailureScene, TransportFailureSocket } from './engineWireFor.js';
67
+ export * from './engineConfigDrift.js';
63
68
  export * from './gateVocabulary.js';
64
69
  export * from './permissionRuleIssue.js';
65
70
  export * from './toolRoster.js';
@@ -81,7 +86,7 @@ export * from './engineWireSdk.js';
81
86
  export * from './classifierVerdictWire.js';
82
87
  export { stripSystemReminderBlocks, unwrapSystemReminder } from './systemReminderTag.js';
83
88
  export { findSystemReminderOpenTag, type SystemReminderOpenTagSpan } from './systemReminderTag.js';
84
- export { ACTIVE_RUN_BUSY_ERROR_CODE, APPROVAL_EXPIRED, ASK_GONE, asModelFallbackReason, CAPABILITY_OPERATOR_PRINCIPALS_REQUIRED, CAPABILITY_SELF_ORCHESTRATION_REQUIRED, CONFIG_DELEGATION_ENTRY_CAPS, CONFIG_IMAGE_INVALID, CONFIG_LEGACY_TOOL_NAME, CONFIG_LIMIT_INVALID, CONFIG_LIMIT_UNKNOWN_KEY, CONFIG_MEMORY_PROJECT_KEY_SPELLING, CONFIG_MEMORY_WRITE_SCOPE_MISMATCH, CONFIG_REFUSAL_CODES, CONFIG_STRATEGY_FIND_LIMIT_INVALID, CONFIG_STRATEGY_MAX_SIZE_INVALID, CORRUPT_SESSION_ERROR_CODE, DECIDE_CLAIM_LOST, DECIDE_GATE_MOVED, DECIDE_NOT_PARKED, DECIDE_PARK_MOVED_CODES, DECIDE_WORKFLOW_HOST_UNKNOWN, DECIDE_WORKFLOW_LANE_CODES, DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED, DELEGATION_CAP_CODES, DELEGATION_CONCURRENCY_CAP, DELEGATION_SESSION_CAP, delegationCapDispositionOf, DRAINING_ERROR_CODE, ENGINE_STOP_REASONS, engineStopReasonToCc, ENV_LIFETIME_EXPIRED, FLEET_LEASE_UNAVAILABLE, GATE_PARKED_ERROR_CODE, imageInvalidFailureNoteOf, isConfigRefusalCode, isCorruptSessionCode, isDecideParkMovedCode, isDelegationCapCode, isInterruptedToolEndCode, isLimitsExceededCode, isRewindFamilyCode, isRulesRefusalCode, isStatusDerivedCoarseCode, isWorkflowParkRefusalCode, LIMITS_MAX_COST_EXCEEDED, LIMITS_MAX_TOKENS_EXCEEDED, LIMITS_MAX_TURNS_EXCEEDED, LIMITS_MAX_WALLTIME_EXCEEDED, MCP_SERVER_REVOKED, MODEL_FALLBACK_INHERIT_NO_TIER_BINDING, operatorGateRefusalContent, OUTPUT_INVALID, PARKED_RESUME_STARTUP_FAILED, RESUME_AT_ERROR_CODE_PREFIX, RESUME_CONTEXT_UNAVAILABLE, RESUME_ENV_FAILED, RESUME_PLACEMENT_MISMATCH, RESUME_POLICY_FOLD_CODE, RESUME_PREFLIGHT_REJECTED, RESUME_REOPEN_CODES, RESUME_RETRY_LATER_CODES, RESUME_TOOL_CONTRACT_MISMATCH, RESUME_TOOL_UNAVAILABLE, RESUME_USAGE_WINDOW_EXHAUSTED, REWIND_ERROR_CODE_PREFIXES, RULES_LEGACY_TOOL_NAME, RUN_DEATH_VERDICT_CODES, RUN_ORPHANED, RUN_STALLED, runDeathVerdictNoteOf, SCENARIO_NOT_ALLOWED_ERROR_CODE, STATUS_DERIVED_COARSE_CODES, STOP_CONFLICT_CODES, STREAM_MAX_DURATION, TOOL_END_INTERRUPTED_NEVER_STARTED, TOOL_END_INTERRUPTED_OUTCOME_UNKNOWN, USAGE_WINDOW_EXHAUSTED, WORKFLOW_PARK_REFUSAL_CODES, } from './engineErrorCodes.js';
89
+ export { ACTIVE_RUN_BUSY_ERROR_CODE, APPROVAL_EXPIRED, ASK_GONE, asModelFallbackReason, CAPABILITY_OPERATOR_PRINCIPALS_REQUIRED, CAPABILITY_SELF_ORCHESTRATION_REQUIRED, CONFIG_DELEGATION_ENTRY_CAPS, CONFIG_IMAGE_INVALID, CONFIG_LEGACY_TOOL_NAME, CONFIG_LIMIT_INVALID, CONFIG_LIMIT_UNKNOWN_KEY, CONFIG_MEMORY_PROJECT_KEY_SPELLING, CONFIG_MEMORY_WRITE_SCOPE_MISMATCH, CONFIG_REFUSAL_CODES, CONFIG_STRATEGY_FIND_LIMIT_INVALID, CONFIG_STRATEGY_MAX_SIZE_INVALID, CORRUPT_SESSION_ERROR_CODE, DECIDE_CLAIM_LOST, DECIDE_GATE_MOVED, DECIDE_NOT_PARKED, DECIDE_PARK_MOVED_CODES, DECIDE_WORKFLOW_HOST_UNKNOWN, DECIDE_WORKFLOW_LANE_CODES, DECIDE_WORKFLOW_PARK_FORKED, DECIDE_WORKFLOW_PARKS_UNREADABLE, DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED, DELEGATION_CAP_CODES, DELEGATION_CONCURRENCY_CAP, DELEGATION_SESSION_CAP, delegationCapDispositionOf, DRAINING_ERROR_CODE, ENGINE_STOP_REASONS, engineStopReasonToCc, ENV_LIFETIME_EXPIRED, FLEET_LEASE_UNAVAILABLE, GATE_PARKED_ERROR_CODE, imageInvalidFailureNoteOf, isConfigRefusalCode, isCorruptSessionCode, isDecideParkMovedCode, isDelegationCapCode, isInterruptedToolEndCode, isLimitsExceededCode, isRewindFamilyCode, isRulesRefusalCode, isStatusDerivedCoarseCode, isWorkflowParkRefusalCode, LIMITS_MAX_COST_EXCEEDED, LIMITS_MAX_TOKENS_EXCEEDED, LIMITS_MAX_TURNS_EXCEEDED, LIMITS_MAX_WALLTIME_EXCEEDED, MCP_SERVER_REVOKED, MODEL_FALLBACK_INHERIT_NO_TIER_BINDING, operatorGateRefusalContent, OUTPUT_INVALID, PARKED_RESUME_STARTUP_FAILED, RESUME_AT_ERROR_CODE_PREFIX, RESUME_CONTEXT_UNAVAILABLE, RESUME_ENV_FAILED, RESUME_PLACEMENT_MISMATCH, RESUME_POLICY_FOLD_CODE, RESUME_PREFLIGHT_REJECTED, RESUME_REOPEN_CODES, RESUME_RETRY_LATER_CODES, RESUME_TOOL_CONTRACT_MISMATCH, RESUME_TOOL_UNAVAILABLE, RESUME_USAGE_WINDOW_EXHAUSTED, REWIND_ERROR_CODE_PREFIXES, RULES_LEGACY_TOOL_NAME, RUN_DEATH_VERDICT_CODES, RUN_ORPHANED, RUN_STALLED, runDeathVerdictNoteOf, SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE, SCENARIO_NOT_ALLOWED_ERROR_CODE, STATUS_DERIVED_COARSE_CODES, STOP_CONFLICT_CODES, STREAM_MAX_DURATION, TOOL_END_INTERRUPTED_NEVER_STARTED, TOOL_END_INTERRUPTED_OUTCOME_UNKNOWN, USAGE_WINDOW_EXHAUSTED, WORKFLOW_PARK_REFUSAL_CODES, } from './engineErrorCodes.js';
85
90
  export type { DelegationCapDisposition, ModelFallbackReason, OperatorGateRefusal, RunDeathVerdictCode, } from './engineErrorCodes.js';
86
91
  export * from './agentsWireCaps.js';
87
92
  export * from './attachmentsWireCaps.js';
@@ -177,7 +182,7 @@ export type { AttachmentSeatReading } from './attachmentSeatCapability.js';
177
182
  export * from './resumeRefusalCopy.js';
178
183
  export * from './wireRefusalCopy.js';
179
184
  export * from './inheritEnvWire.js';
180
- export { SUPPORT_FLOOR, supportFloorOf, engineVersionTier } from './supportFloor.js';
185
+ export { SUPPORT_FLOOR, supportFloorOf, engineVersionTier, coreVersionTier } from './supportFloor.js';
181
186
  export type { SupportFloor, SupportFloorComponent, EngineVersionTier } from './supportFloor.js';
182
187
  export * from './decideReceipt.js';
183
188
  export * from './sessionMap.js';
package/dist/index.js CHANGED
@@ -49,11 +49,15 @@ export * from './workflowsJournalCapability.js';
49
49
  export * from './userInvokedSkillsCapability.js';
50
50
  export * from './skillToolListsCapability.js';
51
51
  export * from './steerPriorityCapability.js';
52
+ export * from './permissionModesCapability.js';
53
+ export * from './approvalDecidedByCapability.js';
52
54
  export * from './mcpProbeWire.js';
53
55
  export * from './effectiveFacts.js';
54
56
  export * from './gateOutcome.js';
55
57
  export * from './postureKnob.js';
56
58
  export * from './engineIdentity.js';
59
+ export { transportFailureScene } from './engineWireFor.js';
60
+ export * from './engineConfigDrift.js';
57
61
  export * from './gateVocabulary.js';
58
62
  export * from './permissionRuleIssue.js';
59
63
  export * from './toolRoster.js';
@@ -73,7 +77,7 @@ export * from './engineWireSdk.js';
73
77
  export * from './classifierVerdictWire.js';
74
78
  export { stripSystemReminderBlocks, unwrapSystemReminder } from './systemReminderTag.js';
75
79
  export { findSystemReminderOpenTag } from './systemReminderTag.js';
76
- export { ACTIVE_RUN_BUSY_ERROR_CODE, APPROVAL_EXPIRED, ASK_GONE, asModelFallbackReason, CAPABILITY_OPERATOR_PRINCIPALS_REQUIRED, CAPABILITY_SELF_ORCHESTRATION_REQUIRED, CONFIG_DELEGATION_ENTRY_CAPS, CONFIG_IMAGE_INVALID, CONFIG_LEGACY_TOOL_NAME, CONFIG_LIMIT_INVALID, CONFIG_LIMIT_UNKNOWN_KEY, CONFIG_MEMORY_PROJECT_KEY_SPELLING, CONFIG_MEMORY_WRITE_SCOPE_MISMATCH, CONFIG_REFUSAL_CODES, CONFIG_STRATEGY_FIND_LIMIT_INVALID, CONFIG_STRATEGY_MAX_SIZE_INVALID, CORRUPT_SESSION_ERROR_CODE, DECIDE_CLAIM_LOST, DECIDE_GATE_MOVED, DECIDE_NOT_PARKED, DECIDE_PARK_MOVED_CODES, DECIDE_WORKFLOW_HOST_UNKNOWN, DECIDE_WORKFLOW_LANE_CODES, DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED, DELEGATION_CAP_CODES, DELEGATION_CONCURRENCY_CAP, DELEGATION_SESSION_CAP, delegationCapDispositionOf, DRAINING_ERROR_CODE, ENGINE_STOP_REASONS, engineStopReasonToCc, ENV_LIFETIME_EXPIRED, FLEET_LEASE_UNAVAILABLE, GATE_PARKED_ERROR_CODE, imageInvalidFailureNoteOf, isConfigRefusalCode, isCorruptSessionCode, isDecideParkMovedCode, isDelegationCapCode, isInterruptedToolEndCode, isLimitsExceededCode, isRewindFamilyCode, isRulesRefusalCode, isStatusDerivedCoarseCode, isWorkflowParkRefusalCode, LIMITS_MAX_COST_EXCEEDED, LIMITS_MAX_TOKENS_EXCEEDED, LIMITS_MAX_TURNS_EXCEEDED, LIMITS_MAX_WALLTIME_EXCEEDED, MCP_SERVER_REVOKED, MODEL_FALLBACK_INHERIT_NO_TIER_BINDING, operatorGateRefusalContent, OUTPUT_INVALID, PARKED_RESUME_STARTUP_FAILED, RESUME_AT_ERROR_CODE_PREFIX, RESUME_CONTEXT_UNAVAILABLE, RESUME_ENV_FAILED, RESUME_PLACEMENT_MISMATCH, RESUME_POLICY_FOLD_CODE, RESUME_PREFLIGHT_REJECTED, RESUME_REOPEN_CODES, RESUME_RETRY_LATER_CODES, RESUME_TOOL_CONTRACT_MISMATCH, RESUME_TOOL_UNAVAILABLE, RESUME_USAGE_WINDOW_EXHAUSTED, REWIND_ERROR_CODE_PREFIXES, RULES_LEGACY_TOOL_NAME, RUN_DEATH_VERDICT_CODES, RUN_ORPHANED, RUN_STALLED, runDeathVerdictNoteOf, SCENARIO_NOT_ALLOWED_ERROR_CODE, STATUS_DERIVED_COARSE_CODES, STOP_CONFLICT_CODES, STREAM_MAX_DURATION, TOOL_END_INTERRUPTED_NEVER_STARTED, TOOL_END_INTERRUPTED_OUTCOME_UNKNOWN, USAGE_WINDOW_EXHAUSTED, WORKFLOW_PARK_REFUSAL_CODES, } from './engineErrorCodes.js';
80
+ export { ACTIVE_RUN_BUSY_ERROR_CODE, APPROVAL_EXPIRED, ASK_GONE, asModelFallbackReason, CAPABILITY_OPERATOR_PRINCIPALS_REQUIRED, CAPABILITY_SELF_ORCHESTRATION_REQUIRED, CONFIG_DELEGATION_ENTRY_CAPS, CONFIG_IMAGE_INVALID, CONFIG_LEGACY_TOOL_NAME, CONFIG_LIMIT_INVALID, CONFIG_LIMIT_UNKNOWN_KEY, CONFIG_MEMORY_PROJECT_KEY_SPELLING, CONFIG_MEMORY_WRITE_SCOPE_MISMATCH, CONFIG_REFUSAL_CODES, CONFIG_STRATEGY_FIND_LIMIT_INVALID, CONFIG_STRATEGY_MAX_SIZE_INVALID, CORRUPT_SESSION_ERROR_CODE, DECIDE_CLAIM_LOST, DECIDE_GATE_MOVED, DECIDE_NOT_PARKED, DECIDE_PARK_MOVED_CODES, DECIDE_WORKFLOW_HOST_UNKNOWN, DECIDE_WORKFLOW_LANE_CODES, DECIDE_WORKFLOW_PARK_FORKED, DECIDE_WORKFLOW_PARKS_UNREADABLE, DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED, DELEGATION_CAP_CODES, DELEGATION_CONCURRENCY_CAP, DELEGATION_SESSION_CAP, delegationCapDispositionOf, DRAINING_ERROR_CODE, ENGINE_STOP_REASONS, engineStopReasonToCc, ENV_LIFETIME_EXPIRED, FLEET_LEASE_UNAVAILABLE, GATE_PARKED_ERROR_CODE, imageInvalidFailureNoteOf, isConfigRefusalCode, isCorruptSessionCode, isDecideParkMovedCode, isDelegationCapCode, isInterruptedToolEndCode, isLimitsExceededCode, isRewindFamilyCode, isRulesRefusalCode, isStatusDerivedCoarseCode, isWorkflowParkRefusalCode, LIMITS_MAX_COST_EXCEEDED, LIMITS_MAX_TOKENS_EXCEEDED, LIMITS_MAX_TURNS_EXCEEDED, LIMITS_MAX_WALLTIME_EXCEEDED, MCP_SERVER_REVOKED, MODEL_FALLBACK_INHERIT_NO_TIER_BINDING, operatorGateRefusalContent, OUTPUT_INVALID, PARKED_RESUME_STARTUP_FAILED, RESUME_AT_ERROR_CODE_PREFIX, RESUME_CONTEXT_UNAVAILABLE, RESUME_ENV_FAILED, RESUME_PLACEMENT_MISMATCH, RESUME_POLICY_FOLD_CODE, RESUME_PREFLIGHT_REJECTED, RESUME_REOPEN_CODES, RESUME_RETRY_LATER_CODES, RESUME_TOOL_CONTRACT_MISMATCH, RESUME_TOOL_UNAVAILABLE, RESUME_USAGE_WINDOW_EXHAUSTED, REWIND_ERROR_CODE_PREFIXES, RULES_LEGACY_TOOL_NAME, RUN_DEATH_VERDICT_CODES, RUN_ORPHANED, RUN_STALLED, runDeathVerdictNoteOf, SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE, SCENARIO_NOT_ALLOWED_ERROR_CODE, STATUS_DERIVED_COARSE_CODES, STOP_CONFLICT_CODES, STREAM_MAX_DURATION, TOOL_END_INTERRUPTED_NEVER_STARTED, TOOL_END_INTERRUPTED_OUTCOME_UNKNOWN, USAGE_WINDOW_EXHAUSTED, WORKFLOW_PARK_REFUSAL_CODES, } from './engineErrorCodes.js';
77
81
  export * from './agentsWireCaps.js';
78
82
  export * from './attachmentsWireCaps.js';
79
83
  export * from './clientContextWireCaps.js';
@@ -155,7 +159,7 @@ export { noteEngineCapsForAttachmentSeat, observedAttachmentSeat, forgetAttachme
155
159
  export * from './resumeRefusalCopy.js';
156
160
  export * from './wireRefusalCopy.js';
157
161
  export * from './inheritEnvWire.js';
158
- export { SUPPORT_FLOOR, supportFloorOf, engineVersionTier } from './supportFloor.js';
162
+ export { SUPPORT_FLOOR, supportFloorOf, engineVersionTier, coreVersionTier } from './supportFloor.js';
159
163
  export * from './decideReceipt.js';
160
164
  export * from './sessionMap.js';
161
165
  export * from './detachWire.js';