@sema-agent/client-core 0.97.1 → 0.98.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.
Files changed (281) hide show
  1. package/CHANGELOG.md +408 -0
  2. package/README.md +74 -37
  3. package/dist/adapt/arms.d.ts +1 -0
  4. package/dist/adapt/arms.js +128 -34
  5. package/dist/adapt/ids.d.ts +12 -1
  6. package/dist/adapt/ids.js +59 -8
  7. package/dist/adapt/instanceLedger.d.ts +50 -0
  8. package/dist/adapt/instanceLedger.js +147 -0
  9. package/dist/adapt/textStream.d.ts +1 -0
  10. package/dist/adapt/textStream.js +24 -7
  11. package/dist/adapt/toolCards.d.ts +27 -5
  12. package/dist/adapt/toolCards.js +39 -6
  13. package/dist/adapt/wireShapes.js +6 -2
  14. package/dist/adapt.d.ts +2 -0
  15. package/dist/adapt.js +8 -3
  16. package/dist/adapter/activeRunSelfHeal.d.ts +5 -0
  17. package/dist/adapter/activeRunSelfHeal.js +51 -28
  18. package/dist/adapter/downstream/eventToSdkMessage.d.ts +2 -5
  19. package/dist/adapter/downstream/eventToSdkMessage.js +27 -34
  20. package/dist/adapter/downstream/terminalToSdkResult.js +11 -4
  21. package/dist/adapter/downstream/turnUsageToModelUsage.d.ts +5 -2
  22. package/dist/adapter/downstream/turnUsageToModelUsage.js +2 -0
  23. package/dist/adapter/runStream.js +29 -13
  24. package/dist/adapter/types.d.ts +4 -4
  25. package/dist/agentSession/backgroundView.js +2 -1
  26. package/dist/agentSession/engineAgentRegistryRead.d.ts +2 -2
  27. package/dist/agentSession/engineAgentRegistryRead.js +12 -13
  28. package/dist/agentsWireCaps.d.ts +8 -8
  29. package/dist/agentsWireCaps.js +168 -175
  30. package/dist/approvalDecidedByCapability.d.ts +0 -4
  31. package/dist/approvalDecidedByCapability.js +0 -6
  32. package/dist/approvalsStreamLiveCapability.d.ts +0 -4
  33. package/dist/approvalsStreamLiveCapability.js +0 -6
  34. package/dist/assistantInbox.d.ts +34 -0
  35. package/dist/assistantInbox.js +118 -0
  36. package/dist/centerWiringCapability.js +9 -1
  37. package/dist/clientSlice.d.ts +0 -9
  38. package/dist/clientSlice.js +0 -3
  39. package/dist/cloudConfigWireCaps.d.ts +4 -2
  40. package/dist/cloudConfigWireCaps.js +81 -61
  41. package/dist/compensations.js +1 -1
  42. package/dist/connectorStatus.d.ts +21 -0
  43. package/dist/connectorStatus.js +112 -0
  44. package/dist/controlRouter.d.ts +14 -1
  45. package/dist/controlRouter.js +68 -17
  46. package/dist/coreValuePorts.d.ts +3 -3
  47. package/dist/decideReceipt.d.ts +2 -2
  48. package/dist/decideReceipt.js +5 -2
  49. package/dist/declared/supportFloorDeclared.js +3 -3
  50. package/dist/deviceExecutorManagementCapability.d.ts +0 -4
  51. package/dist/deviceExecutorManagementCapability.js +0 -6
  52. package/dist/deviceRebind.d.ts +49 -1
  53. package/dist/deviceRebind.js +221 -3
  54. package/dist/displayUntrusted.d.ts +1 -0
  55. package/dist/displayUntrusted.js +250 -76
  56. package/dist/engineAgentAbsence.d.ts +1 -1
  57. package/dist/engineAgentPanelStore.d.ts +5 -4
  58. package/dist/engineAgentPanelStore.js +3 -12
  59. package/dist/engineCapReader.d.ts +0 -4
  60. package/dist/engineCapReader.js +1 -5
  61. package/dist/engineCapsCache.d.ts +4 -0
  62. package/dist/engineCapsCache.js +17 -12
  63. package/dist/engineClosedSets.d.ts +1 -0
  64. package/dist/engineClosedSets.js +4 -1
  65. package/dist/engineErrorCodes.d.ts +9 -2
  66. package/dist/engineErrorCodes.js +9 -1
  67. package/dist/engineIdentity.d.ts +1 -0
  68. package/dist/engineIdentity.js +8 -0
  69. package/dist/engineRowRef.d.ts +28 -0
  70. package/dist/engineRowRef.js +111 -0
  71. package/dist/engineSessionMessages.d.ts +67 -0
  72. package/dist/engineSessionMessages.js +364 -0
  73. package/dist/engineToolDirectory.d.ts +0 -9
  74. package/dist/engineToolDirectory.js +1 -94
  75. package/dist/engineUrl.d.ts +18 -0
  76. package/dist/engineUrl.js +52 -0
  77. package/dist/env/uiLanguage.d.ts +9 -0
  78. package/dist/env/uiLanguage.js +35 -0
  79. package/dist/eventLeg.d.ts +92 -0
  80. package/dist/eventLeg.js +285 -0
  81. package/dist/executionLaneCapability.d.ts +0 -4
  82. package/dist/executionLaneCapability.js +3 -16
  83. package/dist/fileHistoryCaptureCapability.d.ts +0 -4
  84. package/dist/fileHistoryCaptureCapability.js +5 -7
  85. package/dist/fleet/fleetLedger.d.ts +0 -3
  86. package/dist/fleet/fleetLedger.js +21 -36
  87. package/dist/fleet/fleetProjection.d.ts +2 -2
  88. package/dist/fleet/fleetProjection.js +10 -8
  89. package/dist/frameBinding.d.ts +5 -0
  90. package/dist/frameBinding.js +23 -0
  91. package/dist/gateFailureCodes.d.ts +2 -0
  92. package/dist/gateFailureCodes.js +15 -0
  93. package/dist/gateOutcome.d.ts +3 -1
  94. package/dist/gateOutcome.js +25 -6
  95. package/dist/gateVocabulary.d.ts +5 -0
  96. package/dist/gateVocabulary.js +64 -2
  97. package/dist/generated/engineAskFaceTables.js +2 -2
  98. package/dist/generated/engineFactTables.d.ts +6 -3
  99. package/dist/generated/engineFactTables.js +22 -4
  100. package/dist/generated/engineNoticeTables.js +9 -0
  101. package/dist/generated/toolNameTables.d.ts +1 -0
  102. package/dist/generated/toolNameTables.js +1 -0
  103. package/dist/hitl/allowRuleShadow.d.ts +6 -1
  104. package/dist/hitl/allowRuleShadow.js +21 -17
  105. package/dist/hitl/approvalCardReading.d.ts +15 -0
  106. package/dist/hitl/approvalCardReading.js +154 -0
  107. package/dist/hitl/approvalCardReasons.d.ts +13 -0
  108. package/dist/hitl/approvalCardReasons.js +120 -0
  109. package/dist/hitl/approvalHolds.d.ts +47 -15
  110. package/dist/hitl/approvalHolds.js +134 -28
  111. package/dist/hitl/approvalResolution.d.ts +51 -26
  112. package/dist/hitl/approvalResolution.js +86 -122
  113. package/dist/hitl/approvalsFeed.js +6 -18
  114. package/dist/hitl/askClassPair.d.ts +2 -0
  115. package/dist/hitl/askClassPair.js +1 -0
  116. package/dist/hitl/askGateWire.d.ts +20 -2
  117. package/dist/hitl/askGateWire.js +49 -1
  118. package/dist/hitl/askParkRowRouting.d.ts +5 -0
  119. package/dist/hitl/askParkRowRouting.js +32 -1
  120. package/dist/hitl/askSettlementLine.d.ts +18 -0
  121. package/dist/hitl/askSettlementLine.js +79 -0
  122. package/dist/hitl/automaticAnswerVerdict.d.ts +1 -1
  123. package/dist/hitl/automaticAnswerVerdict.js +21 -5
  124. package/dist/hitl/crashConverged.d.ts +11 -20
  125. package/dist/hitl/crashConverged.js +56 -0
  126. package/dist/hitl/crashConvergedNotice.d.ts +3 -1
  127. package/dist/hitl/crashConvergedNotice.js +48 -11
  128. package/dist/hitl/decisionConflict.js +3 -10
  129. package/dist/hitl/decisionRefusal.d.ts +40 -1
  130. package/dist/hitl/decisionRefusal.js +199 -42
  131. package/dist/hitl/frameRouter.d.ts +5 -2
  132. package/dist/hitl/frameRouter.js +20 -16
  133. package/dist/hitl/gateLedger.d.ts +2 -0
  134. package/dist/hitl/gateLedger.js +50 -13
  135. package/dist/hitl/hitlBridge.d.ts +1 -2
  136. package/dist/hitl/hitlBridge.js +10 -7
  137. package/dist/hitl/livePendingAsk.d.ts +3 -3
  138. package/dist/hitl/livePendingAsk.js +7 -18
  139. package/dist/hitl/parkResolver.d.ts +2 -24
  140. package/dist/hitl/parkResolver.js +61 -97
  141. package/dist/hitl/persistedRulesWire.d.ts +24 -0
  142. package/dist/hitl/persistedRulesWire.js +122 -2
  143. package/dist/hitl/planReviewWire.d.ts +26 -13
  144. package/dist/hitl/planReviewWire.js +112 -78
  145. package/dist/hitl/refusedToolNameProse.d.ts +0 -1
  146. package/dist/hitl/refusedToolNameProse.js +0 -3
  147. package/dist/hitl/replayedApproval.d.ts +4 -3
  148. package/dist/hitl/replayedApproval.js +7 -4
  149. package/dist/hitl/sessionPolicyDeliverable.js +2 -4
  150. package/dist/hitl/sessionPolicyWire.d.ts +32 -20
  151. package/dist/hitl/sessionPolicyWire.js +162 -52
  152. package/dist/hitl/standingRows.d.ts +20 -2
  153. package/dist/hitl/standingRows.js +69 -8
  154. package/dist/hitl/toolApprovalWire.d.ts +87 -152
  155. package/dist/hitl/toolApprovalWire.js +591 -380
  156. package/dist/hookMatcherVerdict.d.ts +6 -1
  157. package/dist/hookMatcherVerdict.js +14 -7
  158. package/dist/hooksWireCaps.d.ts +2 -2
  159. package/dist/hooksWireCaps.js +59 -55
  160. package/dist/i18n/messages.en.d.ts +121 -0
  161. package/dist/i18n/messages.en.js +119 -0
  162. package/dist/i18n/messages.zh.d.ts +3 -0
  163. package/dist/i18n/messages.zh.js +120 -0
  164. package/dist/i18n/translate.d.ts +25 -0
  165. package/dist/i18n/translate.js +127 -0
  166. package/dist/index.d.ts +53 -20
  167. package/dist/index.js +38 -11
  168. package/dist/inheritEnvCapability.d.ts +31 -0
  169. package/dist/inheritEnvCapability.js +104 -0
  170. package/dist/liveModelCatalog.d.ts +1 -2
  171. package/dist/liveModelCatalog.js +2 -6
  172. package/dist/liveQuestionStore.d.ts +2 -21
  173. package/dist/mcpLiveness.d.ts +2 -1
  174. package/dist/mcpProbeWire.d.ts +6 -1
  175. package/dist/mcpProbeWire.js +1 -1
  176. package/dist/mcpWireCaps.d.ts +13 -2
  177. package/dist/mcpWireCaps.js +48 -0
  178. package/dist/memoryEntriesWire.d.ts +4 -9
  179. package/dist/model/modelSupplyRules.d.ts +0 -2
  180. package/dist/model/modelSupplyRules.js +3 -12
  181. package/dist/model/modelsPolicy.d.ts +0 -5
  182. package/dist/model/modelsPolicy.js +6 -36
  183. package/dist/model/subagentModelWord.d.ts +31 -0
  184. package/dist/model/subagentModelWord.js +261 -0
  185. package/dist/notifications.d.ts +6 -0
  186. package/dist/notifications.js +71 -23
  187. package/dist/outputStyleSeatCapability.d.ts +0 -3
  188. package/dist/outputStyleSeatCapability.js +0 -3
  189. package/dist/ownKey.d.ts +15 -0
  190. package/dist/ownKey.js +60 -3
  191. package/dist/panelReduce.d.ts +15 -9
  192. package/dist/panelReduce.js +680 -549
  193. package/dist/panelStateHolder.d.ts +3 -7
  194. package/dist/panelStateHolder.js +14 -130
  195. package/dist/peerLaneCapability.d.ts +0 -4
  196. package/dist/peerLaneCapability.js +0 -6
  197. package/dist/permissionRulesWriteCapability.d.ts +0 -4
  198. package/dist/permissionRulesWriteCapability.js +0 -6
  199. package/dist/permissionWireCaps.d.ts +2 -2
  200. package/dist/permissionWireCaps.js +2 -0
  201. package/dist/permissionsAllowGrantCapability.d.ts +0 -4
  202. package/dist/permissionsAllowGrantCapability.js +0 -6
  203. package/dist/permissionsDeclaration.d.ts +0 -11
  204. package/dist/permissionsDeclaration.js +60 -53
  205. package/dist/pluginHooksWire.d.ts +1 -1
  206. package/dist/pluginHooksWire.js +3 -6
  207. package/dist/preemptWire.d.ts +44 -0
  208. package/dist/preemptWire.js +83 -0
  209. package/dist/printToolResultFrame.js +15 -4
  210. package/dist/replayBody.d.ts +3 -0
  211. package/dist/replayBody.js +14 -0
  212. package/dist/request/taskRequest.d.ts +0 -1
  213. package/dist/request/taskRequest.js +0 -3
  214. package/dist/resumeRefusalCopy.d.ts +2 -1
  215. package/dist/resumeRefusalCopy.js +38 -2
  216. package/dist/retryStatus.d.ts +8 -0
  217. package/dist/retryStatus.js +106 -1
  218. package/dist/rewindArchiveCapability.d.ts +0 -4
  219. package/dist/rewindArchiveCapability.js +2 -10
  220. package/dist/rewindArchiveReading.d.ts +0 -1
  221. package/dist/rewindArchiveReading.js +0 -3
  222. package/dist/runCancelContext.d.ts +2 -1
  223. package/dist/runCancelContext.js +4 -2
  224. package/dist/runReattachPolicy.d.ts +31 -0
  225. package/dist/runReattachPolicy.js +46 -0
  226. package/dist/runTerminal.d.ts +3 -6
  227. package/dist/runTerminal.js +8 -9
  228. package/dist/sandboxWire.d.ts +3 -1
  229. package/dist/sandboxWire.js +76 -27
  230. package/dist/scenarioWire.js +1 -1
  231. package/dist/seam.d.ts +24 -2
  232. package/dist/seam.js +15 -3
  233. package/dist/seatContract.d.ts +53 -10
  234. package/dist/seatContract.js +132 -81
  235. package/dist/sessionPolicyCapability.d.ts +0 -4
  236. package/dist/sessionPolicyCapability.js +0 -6
  237. package/dist/sessionSyncFileHistoryCapability.d.ts +0 -3
  238. package/dist/sessionSyncFileHistoryCapability.js +0 -3
  239. package/dist/skillToolListsCapability.d.ts +0 -3
  240. package/dist/skillToolListsCapability.js +0 -3
  241. package/dist/sqlEngineCapability.d.ts +0 -4
  242. package/dist/sqlEngineCapability.js +0 -6
  243. package/dist/steerPriorityCapability.d.ts +0 -3
  244. package/dist/steerPriorityCapability.js +0 -3
  245. package/dist/streamDrainingLegs.d.ts +4 -0
  246. package/dist/streamDrainingLegs.js +6 -1
  247. package/dist/subagent/engineCompactWire.d.ts +0 -1
  248. package/dist/subagent/engineCompactWire.js +7 -5
  249. package/dist/subagent/engineTaskHandleWire.js +4 -7
  250. package/dist/subagentContentStore.js +1 -11
  251. package/dist/submitReopen.d.ts +24 -0
  252. package/dist/submitReopen.js +75 -0
  253. package/dist/terminalStatuses.d.ts +3 -0
  254. package/dist/terminalStatuses.js +10 -2
  255. package/dist/toolResult.d.ts +10 -1
  256. package/dist/toolResult.js +34 -6
  257. package/dist/toolRoster.d.ts +0 -2
  258. package/dist/toolRoster.js +0 -2
  259. package/dist/turnFailurePresentation.d.ts +28 -0
  260. package/dist/turnFailurePresentation.js +205 -0
  261. package/dist/userInvokedSkillsCapability.d.ts +0 -3
  262. package/dist/userInvokedSkillsCapability.js +0 -3
  263. package/dist/webSearchBackendCapability.d.ts +0 -4
  264. package/dist/webSearchBackendCapability.js +0 -6
  265. package/dist/wireErrorTriage.js +5 -24
  266. package/dist/wireFailureShape.d.ts +62 -5
  267. package/dist/wireFailureShape.js +105 -5
  268. package/dist/wireRefusalCopy.d.ts +12 -2
  269. package/dist/wireRefusalCopy.js +50 -52
  270. package/dist/workflowsJournalCapability.d.ts +0 -4
  271. package/dist/workflowsJournalCapability.js +0 -6
  272. package/dist/writeProtectionCapability.d.ts +0 -4
  273. package/dist/writeProtectionCapability.js +0 -6
  274. package/docs/INTEGRATION-CLIENTS.md +1253 -46
  275. package/package.json +5 -4
  276. package/dist/attachmentSeatCapability.d.ts +0 -12
  277. package/dist/attachmentSeatCapability.js +0 -23
  278. package/dist/hitl/approvalOutcomeNote.d.ts +0 -10
  279. package/dist/hitl/approvalOutcomeNote.js +0 -29
  280. package/dist/sessionReadRedactionCapability.d.ts +0 -13
  281. package/dist/sessionReadRedactionCapability.js +0 -35
@@ -44,7 +44,7 @@ export function readEngineActiveBgTasksFor(sessionKey) {
44
44
  for (const view of viewsFor(sessionKey)) {
45
45
  try {
46
46
  const r = view.read();
47
- if (r.connected)
47
+ if (r.fresh)
48
48
  fresh = true;
49
49
  for (const row of r.rows)
50
50
  byId.set(row.id, row);
@@ -146,7 +146,6 @@ export function createFleetLedger(hooks = {}, opts = {}) {
146
146
  let droppedUnknownFrame = 0;
147
147
  let droppedForeignBgNotification = 0;
148
148
  let droppedStaleIngress = 0;
149
- let connected = false;
150
149
  let version = null;
151
150
  let scoped = null;
152
151
  let sessionScopedMeta;
@@ -154,12 +153,12 @@ export function createFleetLedger(hooks = {}, opts = {}) {
154
153
  let disposed = false;
155
154
  let epochSeq = 0;
156
155
  let liveStreamEpoch = 0;
156
+ let deliveredStreamEpoch = 0;
157
157
  let liveSnapshotEpoch = 0;
158
158
  let streamAnchor;
159
- let everIssuedStream = false;
160
159
  let contentAnchor;
161
160
  let contentAnchorSet = false;
162
- let ledgerWrites = 0;
161
+ const streamDelivering = () => !disposed && liveStreamEpoch !== 0 && deliveredStreamEpoch === liveStreamEpoch;
163
162
  const debug = (line) => {
164
163
  if (engineWireDebugEnabled())
165
164
  hostLog('debug', line);
@@ -242,7 +241,7 @@ export function createFleetLedger(hooks = {}, opts = {}) {
242
241
  continue;
243
242
  rows.push(toBgTask(r.row, true));
244
243
  }
245
- return { connected, rows };
244
+ return { fresh: streamDelivering(), rows };
246
245
  },
247
246
  sessionScoped: () => sessionScopedMeta,
248
247
  clearRetained: () => {
@@ -259,7 +258,6 @@ export function createFleetLedger(hooks = {}, opts = {}) {
259
258
  views.add(bgView);
260
259
  }
261
260
  function applyFrame(frame, ing) {
262
- ledgerWrites++;
263
261
  switch (frame.type) {
264
262
  case 'meta': {
265
263
  version = frame.version;
@@ -324,7 +322,7 @@ export function createFleetLedger(hooks = {}, opts = {}) {
324
322
  if (parentOwned)
325
323
  recordOwnEngineRun(childTid);
326
324
  if (parentOwned || sessionScopedMeta === true) {
327
- recordBgParentRun(childTid, parentTid, ing?.session, ing?.sessionKey);
325
+ recordBgParentRun(childTid, parentTid, ing.session, ing.sessionKey);
328
326
  }
329
327
  else {
330
328
  debug(`[fleet-frame] task row parent-map SKIPPED foreign/unowned(row=${row.id} parent=${parentTid})`);
@@ -409,7 +407,7 @@ export function createFleetLedger(hooks = {}, opts = {}) {
409
407
  return;
410
408
  }
411
409
  const serverFailClosed = bgNotifyFailClosedMeta && sessionScopedMeta === true;
412
- const anchor = ing !== null ? ing.session : engineSessionParamFor(sessionKey);
410
+ const anchor = ing.session;
413
411
  const ownByRoot = typeof n.rootSessionId === 'string' &&
414
412
  n.rootSessionId.length > 0 &&
415
413
  n.rootSessionId === anchor;
@@ -423,16 +421,14 @@ export function createFleetLedger(hooks = {}, opts = {}) {
423
421
  return;
424
422
  }
425
423
  const defaultSlot = sessionKey === DEFAULT_SESSION_KEY;
426
- const viaIngress = ing !== null;
427
- const ownRootTrusted = defaultSlot || viaIngress;
428
424
  const serverFailClosedTrusted = defaultSlot;
429
425
  const trustedSessionArm = serverFailClosed && serverFailClosedTrusted
430
426
  ? 'server_fail_closed'
431
- : ownByRoot && ownRootTrusted
427
+ : ownByRoot
432
428
  ? 'own_root'
433
429
  : undefined;
434
430
  const evidence = trustedSessionArm ??
435
- (serverFailClosed || ownByRoot
431
+ (serverFailClosed
436
432
  ? 'session_anchor_untrusted'
437
433
  : typeof n.parentTaskId === 'string' && n.parentTaskId.length > 0
438
434
  ? 'own_parent'
@@ -446,7 +442,7 @@ export function createFleetLedger(hooks = {}, opts = {}) {
446
442
  }
447
443
  if (isSdkFleetTaskTerminal(n.status)) {
448
444
  if (typeof n.parentTaskId === 'string' && n.parentTaskId) {
449
- recordBgParentRun(n.taskId, n.parentTaskId, ing?.session, ing?.sessionKey);
445
+ recordBgParentRun(n.taskId, n.parentTaskId, ing.session, ing.sessionKey);
450
446
  }
451
447
  if (typeof n.transcriptId === 'string' && n.transcriptId.length > 0) {
452
448
  recordEngineTranscriptId(n.taskId, n.transcriptId);
@@ -629,9 +625,13 @@ export function createFleetLedger(hooks = {}, opts = {}) {
629
625
  ` type=${String(frame.type)})`);
630
626
  return;
631
627
  }
632
- applyFrame(frame, { session, sessionKey });
628
+ if (kind === 'stream')
629
+ deliveredStreamEpoch = epoch;
630
+ else
631
+ closed = true;
633
632
  contentAnchor = session;
634
633
  contentAnchorSet = true;
634
+ applyFrame(frame, { session, sessionKey });
635
635
  },
636
636
  close() {
637
637
  closed = true;
@@ -649,8 +649,7 @@ export function createFleetLedger(hooks = {}, opts = {}) {
649
649
  bgNotifyFailClosedMeta = false;
650
650
  debug(`[fleet-frame] 连接级 meta 复位(${why})—— 新连接自报之前不许沿用上一条连接的让位/信任位`);
651
651
  };
652
- const hasLedgerContent = () => taskMap.size > 0 || wfMap.size > 0 || retained.size > 0;
653
- const shouldResetContentFor = (session) => contentAnchorSet ? contentAnchor !== session : hasLedgerContent();
652
+ const shouldResetContentFor = (session) => contentAnchorSet && contentAnchor !== session;
654
653
  const resetLedgerContentOnSessionChange = (from, to) => {
655
654
  taskMap.clear();
656
655
  wfMap.clear();
@@ -664,21 +663,14 @@ export function createFleetLedger(hooks = {}, opts = {}) {
664
663
  '(换会话不是重连:再渲上一会话的行就是跨会话残影)');
665
664
  };
666
665
  return {
667
- applyFrame(frame) {
668
- if (disposed)
669
- return;
670
- applyFrame(frame, null);
671
- },
672
666
  issueStream() {
673
667
  const session = engineSessionParamFor(sessionKey);
674
- if (shouldResetContentFor(session)) {
675
- resetLedgerContentOnSessionChange(contentAnchorSet ? contentAnchor : '<兼容入口,归属不可知>', session);
676
- }
668
+ if (shouldResetContentFor(session))
669
+ resetLedgerContentOnSessionChange(contentAnchor, session);
677
670
  resetConnectionMeta('新 stream ingress');
678
671
  const epoch = ++epochSeq;
679
672
  liveStreamEpoch = epoch;
680
673
  streamAnchor = session;
681
- everIssuedStream = true;
682
674
  liveSnapshotEpoch = 0;
683
675
  debug(`[fleet-frame] ingress issued(kind=stream key=${sessionKey} epoch=${epoch} session=${session ?? '-'})`);
684
676
  return {
@@ -688,13 +680,11 @@ export function createFleetLedger(hooks = {}, opts = {}) {
688
680
  },
689
681
  issueSnapshot(snapOpts) {
690
682
  const inStreamMode = liveStreamEpoch !== 0;
691
- const compatStreamLive = !inStreamMode && connected && !everIssuedStream;
692
- const duringLiveStream = inStreamMode || compatStreamLive;
683
+ const duringLiveStream = inStreamMode;
693
684
  const session = inStreamMode ? streamAnchor : engineSessionParamFor(sessionKey);
694
685
  if (!duringLiveStream) {
695
- if (shouldResetContentFor(session)) {
696
- resetLedgerContentOnSessionChange(contentAnchorSet ? contentAnchor : '<兼容入口,归属不可知>', session);
697
- }
686
+ if (shouldResetContentFor(session))
687
+ resetLedgerContentOnSessionChange(contentAnchor, session);
698
688
  resetConnectionMeta('快照连接:SDK 封装吞掉了它自己的 meta,不许沿用别条连接的信任位');
699
689
  }
700
690
  if (inStreamMode) {
@@ -704,9 +694,8 @@ export function createFleetLedger(hooks = {}, opts = {}) {
704
694
  const epoch = ++epochSeq;
705
695
  liveSnapshotEpoch = epoch;
706
696
  debug(`[fleet-frame] ingress issued(kind=snapshot key=${sessionKey} epoch=${epoch} session=${session ?? '-'})`);
707
- const writesAtIssue = ledgerWrites;
708
697
  const issuedDuringStream = duringLiveStream;
709
- const base = makeIngress('snapshot', epoch, session, () => liveSnapshotEpoch === epoch && !issuedDuringStream && ledgerWrites === writesAtIssue);
698
+ const base = makeIngress('snapshot', epoch, session, () => liveSnapshotEpoch === epoch && !issuedDuringStream);
710
699
  return {
711
700
  ...base,
712
701
  applySnapshot(snapshot) {
@@ -723,12 +712,8 @@ export function createFleetLedger(hooks = {}, opts = {}) {
723
712
  },
724
713
  };
725
714
  },
726
- setConnected(v) {
727
- connected = v;
728
- },
729
715
  project,
730
716
  status: () => ({
731
- connected,
732
717
  version,
733
718
  scoped,
734
719
  sessionScoped: sessionScopedMeta,
@@ -1,5 +1,5 @@
1
- import type { FleetTaskRow, FleetWorkflowRow } from '@sema-agent/sdk';
2
- export type FleetTaskStatus = 'queued' | 'running' | 'waiting' | 'stopping' | 'awaiting approval' | 'idle' | 'completed' | 'failed' | 'killed';
1
+ import type { FleetTaskRow, FleetWorkflowRow, FleetTaskStatus } from '@sema-agent/sdk';
2
+ export type { FleetTaskStatus };
3
3
  export interface FleetTaskView {
4
4
  id: string;
5
5
  name: string;
@@ -4,7 +4,10 @@ import { cycleSeqValue } from '../cycleOrder.js';
4
4
  import { frozenSet } from '../frozenSet.js';
5
5
  import { CORE_RESERVED_AGENT_NAMES } from '../generated/engineFactTables.js';
6
6
  export function coerceTaskStatus(s) {
7
- switch (s) {
7
+ if (s === 'parked')
8
+ return 'awaiting approval';
9
+ const word = s;
10
+ switch (word) {
8
11
  case 'queued':
9
12
  case 'running':
10
13
  case 'waiting':
@@ -14,11 +17,12 @@ export function coerceTaskStatus(s) {
14
17
  case 'completed':
15
18
  case 'failed':
16
19
  case 'killed':
17
- return s;
18
- case 'parked':
19
- return 'awaiting approval';
20
- default:
20
+ return word;
21
+ default: {
22
+ const unhandled = word;
23
+ void unhandled;
21
24
  return 'idle';
25
+ }
22
26
  }
23
27
  }
24
28
  export function coerceWorkflowStatus(s) {
@@ -49,11 +53,9 @@ function deriveAgentLabel(agentType, agentName, name, id) {
49
53
  const tail = rowIdTail(id).slice(-8);
50
54
  return tail ? `agent ${tail}` : 'agent';
51
55
  }
52
- const CONTROL_VERB_LEGACY_NAMES = ['Task', 'Fork'];
53
56
  const CONTROL_VERB_GOAL_NAMES = ['DeclareDone'];
54
57
  export const CONTROL_TOOL_VERBS = frozenSet([
55
58
  ...CORE_RESERVED_AGENT_NAMES,
56
- ...CONTROL_VERB_LEGACY_NAMES,
57
59
  ...CONTROL_VERB_GOAL_NAMES,
58
60
  ]);
59
61
  export function projectDescription(description) {
@@ -350,5 +352,5 @@ export const FLEET_TASK_ROW_KEYS_NOT_PROJECTED = {
350
352
  },
351
353
  };
352
354
  export const FLEET_WORKFLOW_ROW_KEYS_NOT_PROJECTED = {};
353
- const _fleetViewKeyPins = [true, true, true, true, true, true, true, true, true, true];
355
+ const _fleetViewKeyPins = [true, true, true, true, true, true, true, true];
354
356
  void _fleetViewKeyPins;
@@ -0,0 +1,5 @@
1
+ import type { AgentEvent } from '@sema-agent/sdk';
2
+ import type { EngineBoundRun } from './engineRowRef.js';
3
+ export declare function registerFrameBinding(frame: AgentEvent, binding: EngineBoundRun): void;
4
+ export declare function frameBindingOf(frame: AgentEvent): EngineBoundRun | undefined;
5
+ export declare function inheritFrameBinding<T extends AgentEvent>(from: AgentEvent, to: T): T;
@@ -0,0 +1,23 @@
1
+ const frameBindings = new WeakMap();
2
+ export function registerFrameBinding(frame, binding) {
3
+ if (typeof frame !== 'object' || frame === null)
4
+ return;
5
+ if (binding.taskId === undefined && binding.sessionId === undefined)
6
+ return;
7
+ if (frameBindings.has(frame))
8
+ return;
9
+ frameBindings.set(frame, binding);
10
+ }
11
+ export function frameBindingOf(frame) {
12
+ if (typeof frame !== 'object' || frame === null)
13
+ return undefined;
14
+ return frameBindings.get(frame);
15
+ }
16
+ export function inheritFrameBinding(from, to) {
17
+ if (typeof from !== 'object' || from === null || typeof to !== 'object' || to === null || from === to)
18
+ return to;
19
+ const binding = frameBindings.get(from);
20
+ if (binding !== undefined && !frameBindings.has(to))
21
+ frameBindings.set(to, binding);
22
+ return to;
23
+ }
@@ -0,0 +1,2 @@
1
+ export declare function isGateStandingErrorCode(code: string | null | undefined, retriable?: boolean): boolean;
2
+ export declare function isCodeClassifiedGateFailure(code: string | null | undefined, retriable?: boolean): boolean;
@@ -0,0 +1,15 @@
1
+ import { DECIDE_WORKFLOW_PARK_FORKED, DECIDE_WORKFLOW_PARKS_UNREADABLE, PARKED_RESUME_STARTUP_FAILED, RESUME_POLICY_FOLD_CODE, RESUME_REOPEN_CODES, RESUME_RETRY_LATER_CODES, isRefusedParkCode } from './engineErrorCodes.js';
2
+ import { RESUME_REFUSAL_CODES } from './resumeRefusalCopy.js';
3
+ export function isGateStandingErrorCode(code, retriable) {
4
+ return (code === RESUME_POLICY_FOLD_CODE ||
5
+ code === 'corrupt' ||
6
+ (isRefusedParkCode(code) && retriable === true) ||
7
+ (typeof code === 'string' && RESUME_REOPEN_CODES.includes(code) && retriable === true) ||
8
+ code === DECIDE_WORKFLOW_PARKS_UNREADABLE ||
9
+ code === DECIDE_WORKFLOW_PARK_FORKED);
10
+ }
11
+ export function isCodeClassifiedGateFailure(code, retriable) {
12
+ return (isGateStandingErrorCode(code, retriable) ||
13
+ code === PARKED_RESUME_STARTUP_FAILED ||
14
+ (typeof code === 'string' && (RESUME_RETRY_LATER_CODES.includes(code) || RESUME_REFUSAL_CODES.includes(code))));
15
+ }
@@ -32,7 +32,7 @@ export interface GateModeReleaseView {
32
32
  mandate?: string;
33
33
  reason?: string;
34
34
  }
35
- export declare const GATE_MODE_RELEASE_REASON_WORDS: readonly ["rule_unreadable", "target_unresolved"];
35
+ export declare const GATE_MODE_RELEASE_REASON_WORDS: readonly ["target_unresolved"];
36
36
  export type GateModeReleaseReasonWord = (typeof CORE_MODE_RELEASE_REASONS)[number];
37
37
  export declare function isGateModeReleaseReasonWord(v: unknown): v is GateModeReleaseReasonWord;
38
38
  export declare function modeReleaseReasonSentence(reason: string | null | undefined): string | undefined;
@@ -58,10 +58,12 @@ export interface SettlementView {
58
58
  when?: number;
59
59
  note?: string;
60
60
  }
61
+ export type GateRecordSeat = 'settlement' | 'cause' | 'classifier';
61
62
  export interface GateOutcomeView {
62
63
  disposition: GateDispositionView;
63
64
  settlement?: SettlementView;
64
65
  origin?: string;
66
+ unreadable?: readonly GateRecordSeat[];
65
67
  }
66
68
  export declare function gateOutcomeOf(frame: unknown): GateOutcomeView | undefined;
67
69
  export declare function isGateParkedToolEnd(frame: unknown): boolean;
@@ -10,7 +10,6 @@ export function isGateModeReleaseReasonWord(v) {
10
10
  return typeof v === 'string' && CORE_MODE_RELEASE_REASONS.includes(v);
11
11
  }
12
12
  const MODE_RELEASE_SENTENCE_BY_REASON = Object.freeze({
13
- rule_unreadable: 'The permission mode let this call run without asking, even though it could not be checked against your saved permission rules.',
14
13
  target_unresolved: 'The permission mode let this call run without asking, even though it could not be determined where its write lands on disk, so whether it lands on a guarded location is unknown.',
15
14
  });
16
15
  const MODE_RELEASE_UNRECOGNISED_SENTENCE = 'The permission mode let this call run without asking, for a reason this client does not recognise.';
@@ -65,6 +64,9 @@ export function createReleaseDisclosureLedger() {
65
64
  });
66
65
  }
67
66
  export const SETTLEMENT_KIND_WORDS = CORE_SETTLEMENT_KINDS;
67
+ function isGateRecordSeat(x) {
68
+ return x === 'settlement' || x === 'cause' || x === 'classifier';
69
+ }
68
70
  function readWho(v) {
69
71
  if (typeof v !== 'object' || v === null || Array.isArray(v))
70
72
  return undefined;
@@ -151,6 +153,15 @@ function readClassifierRound(raw) {
151
153
  }
152
154
  return view;
153
155
  }
156
+ function carriedUnreadableSeats(v) {
157
+ const out = new Set();
158
+ if (!Array.isArray(v))
159
+ return out;
160
+ for (const x of v)
161
+ if (isGateRecordSeat(x))
162
+ out.add(x);
163
+ return out;
164
+ }
154
165
  function readGateRecord(frame) {
155
166
  if (typeof frame !== 'object' || frame === null || Array.isArray(frame))
156
167
  return undefined;
@@ -158,6 +169,7 @@ function readGateRecord(frame) {
158
169
  if (typeof g !== 'object' || g === null || Array.isArray(g))
159
170
  return undefined;
160
171
  const raw = g;
172
+ const carried = carriedUnreadableSeats(raw.unreadable);
161
173
  const d = raw.disposition;
162
174
  if (typeof d !== 'object' || d === null || Array.isArray(d))
163
175
  return undefined;
@@ -180,7 +192,7 @@ function readGateRecord(frame) {
180
192
  if (deniedBy === undefined)
181
193
  return undefined;
182
194
  const causeRaw = dr.cause;
183
- causePresent = causeRaw !== undefined;
195
+ causePresent = causeRaw !== undefined || carried.has('cause');
184
196
  const cause = str(causeRaw);
185
197
  const mode = str(dr.mode);
186
198
  const askClass = str(dr.askClass);
@@ -201,15 +213,24 @@ function readGateRecord(frame) {
201
213
  const settlementRaw = raw.settlement;
202
214
  const settlement = readSettlement(settlementRaw);
203
215
  const origin = readAskOrigin(raw);
216
+ const settlementPresent = settlementRaw !== undefined || carried.has('settlement');
217
+ const classifierPresent = classifierRaw !== undefined || carried.has('classifier');
218
+ const missing = {
219
+ settlement: settlementPresent && settlement === undefined,
220
+ cause: causePresent && disposition.kind === 'denied' && disposition.cause === undefined,
221
+ classifier: classifierPresent && disposition.classifier === undefined,
222
+ };
223
+ const unreadable = Object.keys(missing).filter((seat) => missing[seat]);
204
224
  return {
205
225
  view: {
206
226
  disposition,
207
227
  ...(settlement !== undefined ? { settlement } : {}),
208
228
  ...(origin !== undefined ? { origin } : {}),
229
+ ...(unreadable.length > 0 ? { unreadable: Object.freeze(unreadable) } : {}),
209
230
  },
210
- settlementPresent: settlementRaw !== undefined,
231
+ settlementPresent,
211
232
  causePresent,
212
- classifierPresent: classifierRaw !== undefined,
233
+ classifierPresent,
213
234
  };
214
235
  }
215
236
  export function gateOutcomeOf(frame) {
@@ -257,8 +278,6 @@ export function ccToolDenialKindForToolEnd(frame) {
257
278
  const stamped = frame._sema_denial_kind;
258
279
  if (isCcToolDenialKind(stamped))
259
280
  return stamped;
260
- if (frame._sema_denial_unclassified === true)
261
- return undefined;
262
281
  const record = readGateRecord(frame);
263
282
  const outcome = record?.view;
264
283
  const kind = outcome?.settlement?.kind;
@@ -9,6 +9,11 @@ export declare const GATE_DENIED_BY_WORDS: readonly GateDeniedByWord[];
9
9
  export declare function isGateDeniedByWord(v: unknown): v is GateDeniedByWord;
10
10
  export declare function gateDeniedByDetail(deniedBy: unknown): string;
11
11
  export declare function askOriginDetail(origin: unknown): string;
12
+ export declare function askOriginNoteOf(origin: string | undefined): string | undefined;
13
+ export declare function ruleOffersAbsenceDetail(reason: string | undefined, opts?: {
14
+ readonly deploymentListSessionRow?: boolean;
15
+ }): string | undefined;
16
+ export declare function ruleOfferUncoveredDetail(reason: string | undefined): string;
12
17
  export declare function mandatedApprovalDetail(): string;
13
18
  export declare const APPROVAL_MANDATE_WORDS: readonly (typeof CORE_PERSISTED_RULE_MANDATES)[number][];
14
19
  export type ApprovalMandateWord = (typeof APPROVAL_MANDATE_WORDS)[number];
@@ -1,4 +1,5 @@
1
1
  import { CORE_DENIED_BY_VALUES, CORE_PERSISTED_RULE_MANDATES } from './generated/engineFactTables.js';
2
+ import { guardedRead, readOwnDataValue } from './ownKey.js';
2
3
  export const CC_TOOL_DENIAL_KINDS = Object.freeze([
3
4
  'user-rejected',
4
5
  'permission-rule',
@@ -48,6 +49,7 @@ export function gateDeniedByDetail(deniedBy) {
48
49
  }
49
50
  const ASK_ORIGIN_SENTENCES = Object.freeze({
50
51
  content_question: 'the tool itself asked you a question',
52
+ plan_review: 'the model paused its run for your verdict on the plan it proposed',
51
53
  ancestor_marked: 'an ancestor marked this call (an inherited approver-unavailable float, or a durable mandate; this client cannot tell which from the origin alone): it must reach the park with no synchronous decision-maker in between',
52
54
  org_unavailable: 'the organization policy was unavailable, so this call asks',
53
55
  org_rule: 'an organization rule asks about this call',
@@ -57,7 +59,7 @@ const ASK_ORIGIN_SENTENCES = Object.freeze({
57
59
  denial_limit_fallback: 'the auto-mode classifier hit its denial limit and handed this call back to you',
58
60
  shell_gate_tighten: 'the coarse shell check rates this command above the tier it lets through, so it asks',
59
61
  safety_tighten: 'the gate tightened on this call’s own facts (network egress, irreversibility, or a protected write; this client cannot tell which from the origin alone)',
60
- policy: 'this deployment’s permission policy asks about this call',
62
+ policy: 'this deployment’s permission policy, or the permission mode’s default, asks about this call',
61
63
  });
62
64
  export function askOriginDetail(origin) {
63
65
  const known = typeof origin === 'string' && Object.hasOwn(ASK_ORIGIN_SENTENCES, origin)
@@ -66,7 +68,67 @@ export function askOriginDetail(origin) {
66
68
  if (known !== undefined)
67
69
  return known;
68
70
  const word = typeof origin === 'string' && origin.length > 0 ? origin : '(none)';
69
- return `this call asks; its origin ${word} is a word newer than this client, so answer it as usual`;
71
+ return unknownAskOriginSentence(word);
72
+ }
73
+ function unknownAskOriginSentence(word) {
74
+ return `this call asks; its origin ${word === undefined ? '' : `${word} `}is a word newer than this client, so answer it as usual`;
75
+ }
76
+ const ASK_ORIGIN_QUIET = Object.freeze({
77
+ content_question: true,
78
+ plan_review: true,
79
+ ancestor_marked: false,
80
+ org_unavailable: false,
81
+ org_rule: false,
82
+ rule_store_unavailable: false,
83
+ hook: false,
84
+ ask_rule: true,
85
+ denial_limit_fallback: false,
86
+ shell_gate_tighten: false,
87
+ safety_tighten: false,
88
+ policy: true,
89
+ });
90
+ export function askOriginNoteOf(origin) {
91
+ if (typeof origin !== 'string' || origin === '')
92
+ return undefined;
93
+ if (Object.hasOwn(ASK_ORIGIN_QUIET, origin)) {
94
+ return ASK_ORIGIN_QUIET[origin] === true ? undefined : askOriginDetail(origin);
95
+ }
96
+ return unknownAskOriginSentence(undefined);
97
+ }
98
+ const NO_REMEMBER_HEAD = 'no "don\'t ask again" option here';
99
+ const RULE_OFFERS_ABSENCE_LINES = Object.freeze({
100
+ mandated: { line: null },
101
+ allow_outranked: {
102
+ line: `${NO_REMEMBER_HEAD}: an allow rule already matches this call, but this question outranks it — another allow rule would be outranked the same way`,
103
+ },
104
+ ask_rule_matched: {
105
+ line: `${NO_REMEMBER_HEAD}: an ask rule matches this call and keeps asking — an allow rule changes nothing while it stands; to stop being asked, review your ask rules`,
106
+ deploymentList: `${NO_REMEMBER_HEAD}: this deployment asks about every call to this tool and your own rules cannot switch that off — the "in this session" option stops it asking again until the session ends`,
107
+ },
108
+ lane_cannot_speak: { line: `${NO_REMEMBER_HEAD}: this approval lane cannot persist rules` },
109
+ });
110
+ export function ruleOffersAbsenceDetail(reason, opts) {
111
+ if (typeof reason !== 'string' || reason === '')
112
+ return undefined;
113
+ if (Object.hasOwn(RULE_OFFERS_ABSENCE_LINES, reason)) {
114
+ const entry = RULE_OFFERS_ABSENCE_LINES[reason];
115
+ if (entry.line === null)
116
+ return undefined;
117
+ const onList = guardedRead(() => readOwnDataValue(opts, 'deploymentListSessionRow')) === true;
118
+ return onList && entry.deploymentList !== undefined ? entry.deploymentList : entry.line;
119
+ }
120
+ return `${NO_REMEMBER_HEAD} (the reason is one this build does not know yet)`;
121
+ }
122
+ const RULE_OFFER_UNCOVERED_LINES = Object.freeze({
123
+ redirection: 'always asks (shell redirection)',
124
+ no_rule_form: 'no coverable rule form',
125
+ cap_overflow: 'trimmed by the offer cap',
126
+ });
127
+ export function ruleOfferUncoveredDetail(reason) {
128
+ if (typeof reason === 'string' && Object.hasOwn(RULE_OFFER_UNCOVERED_LINES, reason)) {
129
+ return RULE_OFFER_UNCOVERED_LINES[reason];
130
+ }
131
+ return 'a reason this build does not know yet';
70
132
  }
71
133
  export function mandatedApprovalDetail() {
72
134
  return 'no saved allow rule and no remembered answer can retire this question; each call is settled on its own — by you here or by an automatic check the deployment runs — and an answer covers only that call';
@@ -7,6 +7,6 @@ export const CORE_SHELL_FACE_TOOL_NAMES = Object.freeze([
7
7
  "Monitor",
8
8
  ]);
9
9
  export const CORE_RELEASABLE_ASK_CLASSES_BY_FACE = Object.freeze({
10
- "shell": Object.freeze(["transcript_write", "rule_unreadable", "target_unresolved", "probe", "write_protection", "tool_marks_mcp", "tool_marks_a2a", "artifact_shared_read", "mode", "unstated", "ordinary"]),
11
- "other": Object.freeze(["transcript_write", "rule_unreadable", "probe", "write_protection", "tool_marks_mcp", "tool_marks_a2a", "artifact_shared_read", "mode", "unstated", "ordinary"]),
10
+ "shell": Object.freeze(["transcript_write", "target_unresolved", "probe", "write_protection", "tool_marks_mcp", "tool_marks_a2a", "artifact_shared_read", "mode", "unstated", "ordinary"]),
11
+ "other": Object.freeze(["transcript_write", "probe", "write_protection", "tool_marks_mcp", "tool_marks_a2a", "artifact_shared_read", "mode", "unstated", "ordinary"]),
12
12
  });
@@ -8,7 +8,7 @@ export declare const CORE_DENIED_BY_VALUES: readonly ["policy", "hook", "org", "
8
8
  export declare const CORE_PERMISSION_MODE_FOLD_REASONS: readonly string[];
9
9
  export declare const CORE_ENGINE_CARD_TYPES: readonly string[];
10
10
  export declare const CORE_TOOL_DECLARATION_CODES: readonly string[];
11
- export declare const CORE_MODE_RELEASE_REASONS: readonly ["rule_unreadable", "target_unresolved"];
11
+ export declare const CORE_MODE_RELEASE_REASONS: readonly ["target_unresolved"];
12
12
  export declare const CORE_HOOK_TOOL_ALIASES: Readonly<Record<string, string>>;
13
13
  export declare const CORE_ASK_EVIDENCE_ABSENCE_VALUES: readonly ["not_wired", "not_adjudicated", "unavailable", "no_match", "not_reported"];
14
14
  export declare const CORE_SYSTEM_INJECTION_PRIORITIES: readonly ["now", "next", "later"];
@@ -21,9 +21,9 @@ export interface CoreModeArbitrationRow {
21
21
  readonly ruleMayClear: boolean;
22
22
  readonly hookAskFloor: boolean;
23
23
  }
24
- export declare const CORE_MODE_ARBITRATION: Readonly<Record<"content_question" | "hook" | "ancestor" | "dangerous_delete" | "unverifiable_delete" | "unverifiable_shell_text" | "transcript_write" | "org_rule" | "governance_unavailable" | "rule_unreadable" | "ask_rule" | "denial_limit_fallback" | "classifier_no_ruling" | "requires_user_interaction" | "operator_forced" | "shell_floor" | "target_unresolved" | "probe" | "write_protection" | "tool_marks_mcp" | "tool_marks_a2a" | "policy_rra" | "artifact_shared_read" | "mode" | "unstated" | "ordinary", CoreModeArbitrationRow>>;
24
+ export declare const CORE_MODE_ARBITRATION: Readonly<Record<"content_question" | "hook" | "ancestor" | "dangerous_delete" | "unverifiable_delete" | "unverifiable_shell_text" | "transcript_write" | "org_rule" | "rule_unreadable" | "ask_rule" | "denial_limit_fallback" | "classifier_no_ruling" | "requires_user_interaction" | "operator_forced" | "shell_floor" | "target_unresolved" | "probe" | "write_protection" | "tool_marks_mcp" | "tool_marks_a2a" | "policy_rra" | "artifact_shared_read" | "mode" | "unstated" | "ordinary", CoreModeArbitrationRow>>;
25
25
  export declare const CORE_SKILL_GRANT_ORIGINS: readonly ["model", "user", "inherited"];
26
- export declare const CORE_ALLOW_ENTRY_INERT_REASONS: readonly ["wildcard_all", "namespace_wildcard", "content_unsupported", "grammar", "tool_name", "near_miss"];
26
+ export declare const CORE_ALLOW_ENTRY_INERT_REASONS: readonly ["wildcard_all", "namespace_wildcard", "content_unsupported", "grammar", "tool_name", "near_miss", "earlier_grammar"];
27
27
  export declare const CORE_ALLOW_RULE_MEMBERS: readonly ["hook", "deployment", "persisted", "skill", "request"];
28
28
  export declare const CORE_RULE_TOOL_NAME_VERDICTS: readonly ["current", "retired", "unprefixed_namespace", "unmintable_segment"];
29
29
  export declare const CORE_SETTLEMENT_KINDS: readonly ["human_allowed", "human_refused", "approval_window_expired", "denial_limit_window_expired", "park_sla_expired", "no_approver", "approver_unavailable", "approver_error", "approver_contract", "presentation_failed", "blanket_allow_refused", "policy_allowed", "policy_refused", "task_aborted"];
@@ -42,3 +42,6 @@ export declare const CORE_PROMPT_BLOCK_CAUSES: readonly ["block", "crashed", "ti
42
42
  export declare const CORE_PERMISSION_MODES: readonly ["default", "acceptEdits", "plan", "auto", "bypassPermissions", "dontAsk"];
43
43
  export declare const CORE_APPROVAL_REACH: readonly ["none"];
44
44
  export declare const CORE_PERSISTED_RULE_MANDATES: readonly ["operator_always", "tool_marks", "probe_mandate", "probe_unanswered", "write_protection", "target_unresolved"];
45
+ export declare const CORE_TASK_NOTIFICATION_TERMINAL_STATUSES: readonly ["completed", "failed", "killed", "cancelled"];
46
+ export declare const CORE_RESUME_STARTUP_CAUSES: readonly ["environment", "session_gone", "tool_unavailable", "configuration", "decision_rejected"];
47
+ export declare const CORE_BUILTIN_SUBAGENT_TYPES: readonly ["Explore", "Plan", "fork", "general-purpose"];
@@ -112,7 +112,6 @@ export const CORE_TOOL_DECLARATION_CODES = Object.freeze([
112
112
  "config.reserved_tool_name",
113
113
  ]);
114
114
  export const CORE_MODE_RELEASE_REASONS = Object.freeze([
115
- "rule_unreadable",
116
115
  "target_unresolved",
117
116
  ]);
118
117
  export const CORE_HOOK_TOOL_ALIASES = Object.freeze(Object.assign(Object.create(null), Object.fromEntries([
@@ -146,12 +145,11 @@ export const CORE_MODE_ARBITRATION = Object.freeze({
146
145
  "hook": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: false }),
147
146
  "ancestor": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: false }),
148
147
  "dangerous_delete": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: true }),
149
- "unverifiable_delete": Object.freeze({ bypassImmune: true, classifierEligible: true, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: true }),
148
+ "unverifiable_delete": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: true }),
150
149
  "unverifiable_shell_text": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: true }),
151
150
  "transcript_write": Object.freeze({ bypassImmune: false, classifierEligible: true, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: true }),
152
151
  "org_rule": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: false }),
153
- "governance_unavailable": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: false }),
154
- "rule_unreadable": Object.freeze({ bypassImmune: false, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: false }),
152
+ "rule_unreadable": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: false }),
155
153
  "ask_rule": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: true }),
156
154
  "denial_limit_fallback": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: false }),
157
155
  "classifier_no_ruling": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: false }),
@@ -181,6 +179,7 @@ export const CORE_ALLOW_ENTRY_INERT_REASONS = Object.freeze([
181
179
  "grammar",
182
180
  "tool_name",
183
181
  "near_miss",
182
+ "earlier_grammar",
184
183
  ]);
185
184
  export const CORE_ALLOW_RULE_MEMBERS = Object.freeze([
186
185
  "hook",
@@ -281,3 +280,22 @@ export const CORE_PERSISTED_RULE_MANDATES = Object.freeze([
281
280
  "write_protection",
282
281
  "target_unresolved",
283
282
  ]);
283
+ export const CORE_TASK_NOTIFICATION_TERMINAL_STATUSES = Object.freeze([
284
+ "completed",
285
+ "failed",
286
+ "killed",
287
+ "cancelled",
288
+ ]);
289
+ export const CORE_RESUME_STARTUP_CAUSES = Object.freeze([
290
+ "environment",
291
+ "session_gone",
292
+ "tool_unavailable",
293
+ "configuration",
294
+ "decision_rejected",
295
+ ]);
296
+ export const CORE_BUILTIN_SUBAGENT_TYPES = Object.freeze([
297
+ "Explore",
298
+ "Plan",
299
+ "fork",
300
+ "general-purpose",
301
+ ]);