@sema-agent/client-core 0.104.0 → 0.105.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 (92) hide show
  1. package/CHANGELOG.md +99 -0
  2. package/README.md +13 -5
  3. package/dist/adapt/arms.js +14 -6
  4. package/dist/adapter/activeRunSelfHeal.d.ts +1 -0
  5. package/dist/adapter/activeRunSelfHeal.js +10 -5
  6. package/dist/adapter/downstream/eventToSdkMessage.js +4 -4
  7. package/dist/adapter/downstream/wiringManifestView.d.ts +6 -0
  8. package/dist/adapter/downstream/wiringManifestView.js +25 -0
  9. package/dist/adapter/runStream.js +5 -1
  10. package/dist/cloudConfigWireCaps.js +3 -0
  11. package/dist/compensations.js +6 -6
  12. package/dist/coreValuePorts.d.ts +3 -1
  13. package/dist/coreValuePorts.js +4 -0
  14. package/dist/displayUntrusted.d.ts +4 -2
  15. package/dist/displayUntrusted.js +45 -22
  16. package/dist/engineGenerationPort.d.ts +11 -2
  17. package/dist/engineGenerationPort.js +63 -9
  18. package/dist/engineHealthFacts.d.ts +5 -0
  19. package/dist/engineHealthFacts.js +11 -0
  20. package/dist/eventLeg.d.ts +1 -1
  21. package/dist/eventLeg.js +23 -3
  22. package/dist/generated/engineFactTables.d.ts +1 -0
  23. package/dist/generated/engineFactTables.js +1 -0
  24. package/dist/generated/sdkFactTables.d.ts +2 -0
  25. package/dist/generated/sdkFactTables.js +9 -0
  26. package/dist/headlessReconnectWire.js +31 -4
  27. package/dist/hitl/askGateWire.js +26 -2
  28. package/dist/hitl/frameRouter.d.ts +4 -0
  29. package/dist/hitl/frameRouter.js +14 -0
  30. package/dist/hitl/gateIdentity.d.ts +1 -0
  31. package/dist/hitl/gateIdentity.js +3 -0
  32. package/dist/hitl/livePendingAsk.d.ts +2 -1
  33. package/dist/hitl/livePendingAsk.js +7 -1
  34. package/dist/hitl/planReviewCard.d.ts +21 -0
  35. package/dist/hitl/planReviewCard.js +229 -0
  36. package/dist/hitl/planReviewWire.d.ts +38 -13
  37. package/dist/hitl/planReviewWire.js +355 -133
  38. package/dist/hitl/toolApprovalWire.d.ts +2 -2
  39. package/dist/hitl/toolApprovalWire.js +53 -32
  40. package/dist/hostSettingsSource.d.ts +1 -1
  41. package/dist/hostSettingsSource.js +8 -4
  42. package/dist/hostTurnSettings.d.ts +1 -1
  43. package/dist/hostTurnSettings.js +29 -10
  44. package/dist/i18n/messages.en.d.ts +50 -0
  45. package/dist/i18n/messages.en.js +50 -0
  46. package/dist/i18n/messages.zh.js +51 -0
  47. package/dist/index.d.ts +15 -3
  48. package/dist/index.js +9 -1
  49. package/dist/mcpTransportKindsCapability.d.ts +18 -0
  50. package/dist/mcpTransportKindsCapability.js +75 -0
  51. package/dist/mcpWireCaps.d.ts +4 -1
  52. package/dist/mcpWireCaps.js +24 -13
  53. package/dist/notifications.d.ts +9 -0
  54. package/dist/notifications.js +11 -2
  55. package/dist/ownKey.d.ts +4 -0
  56. package/dist/ownKey.js +8 -0
  57. package/dist/permissionModeWriteCapability.d.ts +13 -0
  58. package/dist/permissionModeWriteCapability.js +35 -0
  59. package/dist/permissionsAllowGrantCapability.d.ts +3 -0
  60. package/dist/permissionsAllowGrantCapability.js +26 -3
  61. package/dist/permissionsDeclaration.d.ts +23 -1
  62. package/dist/permissionsDeclaration.js +60 -30
  63. package/dist/planReviewCardFacts.d.ts +116 -0
  64. package/dist/planReviewCardFacts.js +469 -0
  65. package/dist/reattachWindow.d.ts +8 -1
  66. package/dist/reattachWindow.js +44 -12
  67. package/dist/runFollow.d.ts +30 -0
  68. package/dist/runFollow.js +117 -0
  69. package/dist/runLedgerSnapshot.d.ts +20 -0
  70. package/dist/runLedgerSnapshot.js +272 -0
  71. package/dist/runPermissionModeSwitch.d.ts +57 -0
  72. package/dist/runPermissionModeSwitch.js +135 -0
  73. package/dist/runReattachPolicy.d.ts +13 -5
  74. package/dist/runReattachPolicy.js +58 -23
  75. package/dist/seam.d.ts +3 -0
  76. package/dist/seam.js +1 -1
  77. package/dist/seatContract.js +1 -0
  78. package/dist/sessionMemoryErase.d.ts +1 -1
  79. package/dist/sessionMemoryErase.js +5 -0
  80. package/dist/sessionMemoryStatus.d.ts +27 -1
  81. package/dist/sessionMemoryStatus.js +117 -0
  82. package/dist/sseIdleTriage.d.ts +3 -1
  83. package/dist/sseIdleTriage.js +19 -4
  84. package/dist/steering.d.ts +1 -0
  85. package/dist/steering.js +34 -26
  86. package/dist/subagent/engineSubagentTail.js +2 -0
  87. package/dist/subagentContentStore.d.ts +3 -0
  88. package/dist/subagentContentStore.js +10 -1
  89. package/dist/turnFailurePresentation.d.ts +5 -2
  90. package/dist/turnFailurePresentation.js +12 -4
  91. package/docs/INTEGRATION-CLIENTS.md +587 -10
  92. package/package.json +2 -2
@@ -1,6 +1,7 @@
1
1
  import { msg, renderMessage } from './i18n/translate.js';
2
2
  import { classifyTurnWireError, isPreStreamDrainingReject } from './wireErrorTriage.js';
3
3
  import { isSseIdleError } from './sseIdleTriage.js';
4
+ import { runNotFollowedOf } from './runFollow.js';
4
5
  import { isCodeClassifiedGateFailure } from './gateFailureCodes.js';
5
6
  import { CORRUPT_ROW_ERROR_CODE, CORRUPT_SESSION_ERROR_CODE, MEMORY_CONTROL_PLANE_CORRUPT, SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE } from './engineErrorCodes.js';
6
7
  import { admissionWallRefusalContent, admissionWallRefusalFromError, bodyShapeRefusalFromError, bodyShapeRefusalTouchesSettings, fleetLeaseUnavailableContent, fleetLeaseUnavailableFromError, hostPostureRefusalContent, hostPostureRefusalFromError, fieldLimitRefusalContent, fieldLimitRefusalFromError, toolDeclarationRefusalContent, toolDeclarationRefusalFromError, usageWindowExhaustedContent, usageWindowExhaustedFromError, quotaExhaustedContent, quotaExhaustedFromError, userAttachmentRefusalFromError, } from './wireRefusalCopy.js';
@@ -158,7 +159,12 @@ export function turnFailurePresentation(err, evidence, notesCtx, lang) {
158
159
  const status = verdict.kind === 'http' ? verdict.status : undefined;
159
160
  const errorCode = verdict.kind === 'http' ? httpCode : undefined;
160
161
  const wireRetriable = readThrownSlot(subject, 'retriable', 'data') === true && !isCodeClassifiedGateFailure(errorCode, true);
161
- const retry = wireRetriable && shape.category !== 'parked' ? { offer: true, basis: 'wire' } : { offer: shape.offer, basis: 'category' };
162
+ const notFollowed = runNotFollowedOf(err) !== undefined;
163
+ const retry = notFollowed
164
+ ? { offer: false, basis: 'not_followed' }
165
+ : wireRetriable && shape.category !== 'parked'
166
+ ? { offer: true, basis: 'wire' }
167
+ : { offer: shape.offer, basis: 'category' };
162
168
  const waitSec = waitSecOf(subject);
163
169
  const chain = turnFailureNotesOf(subject, verdict, notesCtx, waitSec, lang);
164
170
  const headline = headlineKey !== undefined ? renderMessage(msg(headlineKey), lang) : undefined;
@@ -298,7 +304,7 @@ export function seatTurnFailureOf(err, evidence) {
298
304
  const p = turnFailurePresentation(err, evidence);
299
305
  return {
300
306
  category: p.category,
301
- retry: { offer: p.retry.offer, basis: p.retry.basis },
307
+ retry: p.retry.basis === 'not_followed' ? { offer: false, basis: 'not_followed' } : { offer: p.retry.offer, basis: p.retry.basis },
302
308
  ...(p.waitSec !== undefined ? { waitSec: p.waitSec } : {}),
303
309
  ...(p.headline !== undefined ? { headline: p.headline } : {}),
304
310
  ...(p.errorCode !== undefined ? { errorCode: p.errorCode } : {}),
@@ -333,7 +339,9 @@ function seatTurnFailureShapeOf(event) {
333
339
  return undefined;
334
340
  const offer = seatDataField(retry, 'offer');
335
341
  const basis = seatDataField(retry, 'basis');
336
- if (typeof offer !== 'boolean' || (basis !== 'wire' && basis !== 'category'))
342
+ if (typeof offer !== 'boolean' || (basis !== 'wire' && basis !== 'category' && basis !== 'not_followed'))
343
+ return undefined;
344
+ if (basis === 'not_followed' && offer !== false)
337
345
  return undefined;
338
346
  const waitSec = seatDataField(raw, 'waitSec');
339
347
  if (waitSec !== undefined && !(typeof waitSec === 'number' && Number.isInteger(waitSec) && waitSec >= 1))
@@ -346,7 +354,7 @@ function seatTurnFailureShapeOf(event) {
346
354
  return undefined;
347
355
  return Object.freeze({
348
356
  category: category,
349
- retry: Object.freeze({ offer, basis }),
357
+ retry: Object.freeze(basis === 'not_followed' ? { offer: false, basis } : { offer, basis }),
350
358
  ...(waitSec !== undefined ? { waitSec } : {}),
351
359
  ...(headline !== undefined ? { headline } : {}),
352
360
  ...(errorCode !== undefined ? { errorCode } : {}),