@sema-agent/client-core 0.93.0 → 0.94.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 (156) hide show
  1. package/CHANGELOG.md +261 -0
  2. package/README.md +31 -18
  3. package/dist/adapt/arms.js +8 -5
  4. package/dist/adapter/downstream/terminalToSdkResult.js +2 -3
  5. package/dist/agentSession/engineSessionBackgroundStop.js +2 -1
  6. package/dist/agentsWireCaps.d.ts +15 -0
  7. package/dist/agentsWireCaps.js +111 -1
  8. package/dist/approvalReachWire.d.ts +18 -0
  9. package/dist/approvalReachWire.js +58 -0
  10. package/dist/approvalsStreamLiveCapability.js +16 -11
  11. package/dist/callerCwdCapability.d.ts +16 -0
  12. package/dist/callerCwdCapability.js +47 -0
  13. package/dist/controlRouter.js +3 -10
  14. package/dist/coreValuePorts.d.ts +64 -1
  15. package/dist/coreValuePorts.js +30 -0
  16. package/dist/detachWire.d.ts +1 -4
  17. package/dist/detachWire.js +1 -1
  18. package/dist/deviceExecutorManagementCapability.js +39 -34
  19. package/dist/deviceFlowPolling.d.ts +5 -0
  20. package/dist/deviceFlowPolling.js +28 -0
  21. package/dist/displayUntrusted.js +652 -21
  22. package/dist/engineErrorCodes.d.ts +5 -1
  23. package/dist/engineErrorCodes.js +9 -12
  24. package/dist/engineNoticeCodes.d.ts +22 -2
  25. package/dist/engineNoticeCodes.js +73 -6
  26. package/dist/engineRefusedToolName.d.ts +1 -0
  27. package/dist/engineRefusedToolName.js +8 -0
  28. package/dist/executionLaneCapability.js +14 -9
  29. package/dist/fileHistoryCaptureCapability.js +14 -9
  30. package/dist/fileHistoryLegNotice.d.ts +11 -0
  31. package/dist/fileHistoryLegNotice.js +50 -13
  32. package/dist/fleet/fleetLedger.js +5 -0
  33. package/dist/gateOutcome.d.ts +2 -1
  34. package/dist/gateOutcome.js +3 -0
  35. package/dist/gateVocabulary.js +1 -1
  36. package/dist/generated/engineAskFaceTables.d.ts +3 -0
  37. package/dist/generated/engineAskFaceTables.js +12 -0
  38. package/dist/generated/engineFactTables.d.ts +4 -2
  39. package/dist/generated/engineFactTables.js +13 -0
  40. package/dist/generated/engineNoticeTables.d.ts +5 -0
  41. package/dist/generated/engineNoticeTables.js +7 -0
  42. package/dist/generated/sdkFactTables.d.ts +3 -0
  43. package/dist/generated/sdkFactTables.js +17 -0
  44. package/dist/generated/settingsSchemaTables.d.ts +3 -0
  45. package/dist/generated/settingsSchemaTables.js +3 -0
  46. package/dist/headlessPermissionModeWire.d.ts +2 -2
  47. package/dist/headlessPermissionModeWire.js +11 -21
  48. package/dist/hitl/approvalHolds.d.ts +36 -0
  49. package/dist/hitl/approvalHolds.js +89 -0
  50. package/dist/hitl/approvalOutcomeNote.js +2 -1
  51. package/dist/hitl/approvalResolution.d.ts +3 -2
  52. package/dist/hitl/approvalResolution.js +21 -0
  53. package/dist/hitl/approvalsFeed.js +5 -0
  54. package/dist/hitl/askGateWire.js +3 -0
  55. package/dist/hitl/automaticAnswerVerdict.d.ts +8 -2
  56. package/dist/hitl/automaticAnswerVerdict.js +69 -21
  57. package/dist/hitl/decisionRefusal.d.ts +19 -0
  58. package/dist/hitl/decisionRefusal.js +63 -0
  59. package/dist/hitl/frameRouter.d.ts +10 -0
  60. package/dist/hitl/frameRouter.js +59 -3
  61. package/dist/hitl/gateLedger.d.ts +3 -0
  62. package/dist/hitl/gateLedger.js +17 -0
  63. package/dist/hitl/hitlBridge.d.ts +2 -2
  64. package/dist/hitl/hitlBridge.js +8 -10
  65. package/dist/hitl/hitlHostSurface.d.ts +6 -0
  66. package/dist/hitl/hitlHostSurface.js +25 -4
  67. package/dist/hitl/localAllowRule.js +2 -1
  68. package/dist/hitl/noAllowCause.d.ts +9 -0
  69. package/dist/hitl/noAllowCause.js +26 -0
  70. package/dist/hitl/parkResolver.js +6 -3
  71. package/dist/hitl/parkRowBirthWait.js +2 -1
  72. package/dist/hitl/persistedRulesWire.d.ts +6 -1
  73. package/dist/hitl/persistedRulesWire.js +12 -4
  74. package/dist/hitl/planReviewWire.d.ts +0 -1
  75. package/dist/hitl/planReviewWire.js +30 -9
  76. package/dist/hitl/sessionPolicyDeliverable.d.ts +1 -1
  77. package/dist/hitl/sessionPolicyDeliverable.js +3 -8
  78. package/dist/hitl/sessionPolicyWire.js +1 -1
  79. package/dist/hitl/toolApprovalWire.d.ts +37 -2
  80. package/dist/hitl/toolApprovalWire.js +392 -13
  81. package/dist/humanTurnRead.d.ts +15 -1
  82. package/dist/humanTurnRead.js +28 -2
  83. package/dist/index.d.ts +18 -6
  84. package/dist/index.js +14 -5
  85. package/dist/limitsWire.d.ts +0 -1
  86. package/dist/limitsWire.js +2 -10
  87. package/dist/liveModelCatalog.d.ts +14 -0
  88. package/dist/liveModelCatalog.js +61 -0
  89. package/dist/mcpProbeCapability.js +14 -9
  90. package/dist/mcpReconnect.js +13 -8
  91. package/dist/memoryComplianceCapability.js +15 -10
  92. package/dist/memoryOriginCapability.js +15 -10
  93. package/dist/modelIdentityResolvability.d.ts +4 -2
  94. package/dist/modelIdentityResolvability.js +31 -4
  95. package/dist/outputStyleSeatCapability.d.ts +16 -0
  96. package/dist/outputStyleSeatCapability.js +47 -0
  97. package/dist/ownKey.d.ts +1 -0
  98. package/dist/ownKey.js +10 -0
  99. package/dist/peerLaneCapability.js +16 -11
  100. package/dist/permissionRuleIssue.js +1 -1
  101. package/dist/permissionRulesWriteCapability.js +16 -11
  102. package/dist/permissionsAllowGrantCapability.d.ts +2 -0
  103. package/dist/permissionsAllowGrantCapability.js +38 -16
  104. package/dist/permissionsDeclaration.d.ts +10 -1
  105. package/dist/permissionsDeclaration.js +97 -15
  106. package/dist/protocolSegment.d.ts +1 -0
  107. package/dist/protocolSegment.js +13 -1
  108. package/dist/request/taskRequest.d.ts +11 -3
  109. package/dist/request/taskRequest.js +13 -1
  110. package/dist/resultFrameKeys.d.ts +4 -0
  111. package/dist/resultFrameKeys.js +13 -0
  112. package/dist/resumeRefusalCopy.js +6 -16
  113. package/dist/retryStatus.js +6 -4
  114. package/dist/rewindArchiveCapability.js +13 -8
  115. package/dist/{hitl/rosterMountedNames.d.ts → rosterMountedNames.d.ts} +1 -1
  116. package/dist/runCancelContext.js +2 -1
  117. package/dist/sealedKeyCapability.js +19 -14
  118. package/dist/seatContract.d.ts +33 -5
  119. package/dist/seatContract.js +143 -2
  120. package/dist/sessionPolicyCapability.js +15 -10
  121. package/dist/sessionReadRedactionCapability.d.ts +16 -0
  122. package/dist/sessionReadRedactionCapability.js +47 -0
  123. package/dist/sessionSyncFileHistoryCapability.js +14 -9
  124. package/dist/skillToolListsCapability.js +14 -9
  125. package/dist/sqlEngineCapability.js +18 -13
  126. package/dist/steerPriorityCapability.js +21 -16
  127. package/dist/subagent/agentStateDetail.d.ts +1 -0
  128. package/dist/subagent/agentStateDetail.js +41 -0
  129. package/dist/subagent/engineCompactWire.d.ts +15 -0
  130. package/dist/subagent/engineCompactWire.js +75 -13
  131. package/dist/supportFloor.js +1 -1
  132. package/dist/taskRequestWords.d.ts +2 -4
  133. package/dist/taskRequestWords.js +3 -2
  134. package/dist/types/engineState.d.ts +1 -1
  135. package/dist/userAttachmentEnvelope.d.ts +22 -1
  136. package/dist/userAttachmentEnvelope.js +90 -2
  137. package/dist/userInvokedSkillsCapability.js +14 -9
  138. package/dist/webSearchBackendCapability.js +21 -16
  139. package/dist/wireErrorTriage.d.ts +11 -0
  140. package/dist/wireErrorTriage.js +35 -0
  141. package/dist/wireFailureShape.d.ts +6 -0
  142. package/dist/wireFailureShape.js +30 -3
  143. package/dist/wireRefusalCopy.d.ts +6 -1
  144. package/dist/wireRefusalCopy.js +22 -8
  145. package/dist/wiringInstructionsAttribution.d.ts +10 -0
  146. package/dist/wiringInstructionsAttribution.js +67 -0
  147. package/dist/workflowClient.js +22 -1
  148. package/dist/workflowsJournalCapability.js +14 -9
  149. package/dist/writeProtectionCapability.js +28 -23
  150. package/docs/INTEGRATION-CLIENTS.md +817 -45
  151. package/package.json +5 -5
  152. package/dist/askSurvivesStandingAnswer.d.ts +0 -13
  153. package/dist/askSurvivesStandingAnswer.js +0 -53
  154. package/dist/hitl/askSurvivesPosture.d.ts +0 -20
  155. package/dist/hitl/askSurvivesPosture.js +0 -48
  156. /package/dist/{hitl/rosterMountedNames.js → rosterMountedNames.js} +0 -0
@@ -5,41 +5,46 @@ function ownRead(o, key) {
5
5
  return Object.hasOwn(o, key) ? o[key] : undefined;
6
6
  }
7
7
  export function projectDeviceExecutorManagementCapability(caps) {
8
- if (caps === null || typeof caps !== 'object' || Array.isArray(caps))
9
- return undefined;
10
- const c = caps;
11
- if (!Object.hasOwn(c, 'deviceExecutor'))
12
- return { kind: 'not_reported', why: 'capability_absent' };
13
- const d = c.deviceExecutor;
14
- if (d === undefined)
15
- return { kind: 'not_reported', why: 'capability_absent' };
16
- if (d === false)
17
- return { kind: 'lane_absent' };
18
- if (d === null || typeof d !== 'object' || Array.isArray(d))
19
- return undefined;
20
- const o = d;
21
- if (ownRead(o, 'enabled') !== true)
22
- return undefined;
23
- const mgmt = ownRead(o, 'management');
24
- let management;
25
- if (mgmt === undefined)
26
- management = 'absent';
27
- else if (mgmt === true)
28
- management = 'present-true';
29
- else if (mgmt === false)
30
- management = 'present-false';
31
- else
8
+ try {
9
+ if (caps === null || typeof caps !== 'object' || Array.isArray(caps))
10
+ return undefined;
11
+ const c = caps;
12
+ if (!Object.hasOwn(c, 'deviceExecutor'))
13
+ return { kind: 'not_reported', why: 'capability_absent' };
14
+ const d = c.deviceExecutor;
15
+ if (d === undefined)
16
+ return { kind: 'not_reported', why: 'capability_absent' };
17
+ if (d === false)
18
+ return { kind: 'lane_absent' };
19
+ if (d === null || typeof d !== 'object' || Array.isArray(d))
20
+ return undefined;
21
+ const o = d;
22
+ if (ownRead(o, 'enabled') !== true)
23
+ return undefined;
24
+ const mgmt = ownRead(o, 'management');
25
+ let management;
26
+ if (mgmt === undefined)
27
+ management = 'absent';
28
+ else if (mgmt === true)
29
+ management = 'present-true';
30
+ else if (mgmt === false)
31
+ management = 'present-false';
32
+ else
33
+ return undefined;
34
+ const pv = ownRead(o, 'protocolVersion');
35
+ const mi = ownRead(o, 'maxInflightPerDevice');
36
+ const ws = ownRead(o, 'wsPath');
37
+ return {
38
+ kind: 'present',
39
+ management,
40
+ ...(typeof pv === 'number' && Number.isFinite(pv) ? { protocolVersion: pv } : {}),
41
+ ...(typeof mi === 'number' && Number.isFinite(mi) && mi >= 0 ? { maxInflightPerDevice: mi } : {}),
42
+ ...(typeof ws === 'string' && ws.length > 0 ? { wsPath: ws } : {}),
43
+ };
44
+ }
45
+ catch {
32
46
  return undefined;
33
- const pv = ownRead(o, 'protocolVersion');
34
- const mi = ownRead(o, 'maxInflightPerDevice');
35
- const ws = ownRead(o, 'wsPath');
36
- return {
37
- kind: 'present',
38
- management,
39
- ...(typeof pv === 'number' && Number.isFinite(pv) ? { protocolVersion: pv } : {}),
40
- ...(typeof mi === 'number' && Number.isFinite(mi) && mi >= 0 ? { maxInflightPerDevice: mi } : {}),
41
- ...(typeof ws === 'string' && ws.length > 0 ? { wsPath: ws } : {}),
42
- };
47
+ }
43
48
  }
44
49
  const reader = createEngineCapReader({
45
50
  name: 'deviceExecutor.management',
@@ -0,0 +1,5 @@
1
+ export interface DeviceFlowPollingPlan {
2
+ readonly timeoutMs: number;
3
+ readonly intervalSeconds: number;
4
+ }
5
+ export declare function deviceFlowPollingPlan(reading: unknown): DeviceFlowPollingPlan | undefined;
@@ -0,0 +1,28 @@
1
+ import { SETTINGS_DEVICE_CODE_TTL_SECONDS, SETTINGS_DEVICE_POLL_INTERVAL_SECONDS } from './generated/settingsSchemaTables.js';
2
+ function positiveSecondsOf(reading, key) {
3
+ try {
4
+ const desc = Object.getOwnPropertyDescriptor(reading, key);
5
+ if (desc === undefined || !('value' in desc))
6
+ return undefined;
7
+ const v = desc.value;
8
+ return typeof v === 'number' && Number.isFinite(v) && v > 0 ? v : undefined;
9
+ }
10
+ catch {
11
+ return undefined;
12
+ }
13
+ }
14
+ export function deviceFlowPollingPlan(reading) {
15
+ let isObjectReading = false;
16
+ try {
17
+ isObjectReading = typeof reading === 'object' && reading !== null && !Array.isArray(reading);
18
+ }
19
+ catch {
20
+ isObjectReading = false;
21
+ }
22
+ if (!isObjectReading)
23
+ return undefined;
24
+ const r = reading;
25
+ const ttlSeconds = positiveSecondsOf(r, 'expires_in') ?? SETTINGS_DEVICE_CODE_TTL_SECONDS;
26
+ const intervalSeconds = Math.max(1, positiveSecondsOf(r, 'interval') ?? SETTINGS_DEVICE_POLL_INTERVAL_SECONDS);
27
+ return Object.freeze({ timeoutMs: ttlSeconds * 1000, intervalSeconds });
28
+ }