@sema-agent/client-core 0.94.0 → 0.95.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.
- package/CHANGELOG.md +341 -0
- package/README.md +70 -47
- package/dist/adapt/arms.js +5 -6
- package/dist/adapt/panelTasks.js +4 -10
- package/dist/adapt/toolCards.js +2 -2
- package/dist/adapt/wireShapes.js +3 -8
- package/dist/adapter/activeRunSelfHeal.d.ts +8 -3
- package/dist/adapter/activeRunSelfHeal.js +20 -12
- package/dist/adapter/downstream/eventToSdkMessage.js +24 -17
- package/dist/adapter/downstream/terminalToSdkResult.js +11 -3
- package/dist/adapter/runStream.js +2 -1
- package/dist/adapter/types.d.ts +7 -0
- package/dist/adapter/types.js +15 -0
- package/dist/agentSession/backgroundView.js +5 -1
- package/dist/agentSession/engineAgentRegistryRead.js +2 -1
- package/dist/agentSession/engineSessionBackgroundStop.js +3 -2
- package/dist/agentsWireCaps.d.ts +2 -0
- package/dist/approvalDecidedByCapability.d.ts +0 -1
- package/dist/approvalDecidedByCapability.js +2 -7
- package/dist/approvalsStreamLiveCapability.d.ts +0 -1
- package/dist/approvalsStreamLiveCapability.js +2 -6
- package/dist/atMostOnce.d.ts +8 -0
- package/dist/atMostOnce.js +36 -0
- package/dist/attachmentSeatCapability.d.ts +0 -1
- package/dist/attachmentSeatCapability.js +0 -3
- package/dist/attachmentsWireCaps.js +11 -6
- package/dist/bashExitReading.d.ts +10 -0
- package/dist/bashExitReading.js +12 -0
- package/dist/callerCwdCapability.d.ts +0 -1
- package/dist/callerCwdCapability.js +2 -7
- package/dist/centerWiringCapability.d.ts +1 -3
- package/dist/centerWiringCapability.js +18 -21
- package/dist/classifierStatus.js +4 -4
- package/dist/cloudConfigWireCaps.js +43 -21
- package/dist/compensations.js +1 -1
- package/dist/cycleOrder.d.ts +15 -0
- package/dist/cycleOrder.js +45 -0
- package/dist/decideFailureNote.js +4 -1
- package/dist/decideReceipt.d.ts +2 -1
- package/dist/decideReceipt.js +41 -13
- package/dist/declared/supportFloorDeclared.d.ts +1 -0
- package/dist/declared/supportFloorDeclared.js +5 -0
- package/dist/deviceExecutorManagementCapability.d.ts +0 -1
- package/dist/deviceExecutorManagementCapability.js +7 -16
- package/dist/deviceRebind.d.ts +88 -0
- package/dist/deviceRebind.js +242 -0
- package/dist/displayUntrusted.d.ts +1 -0
- package/dist/displayUntrusted.js +313 -11
- package/dist/engineAgentAbsence.d.ts +2 -2
- package/dist/engineAgentPanelStore.d.ts +8 -18
- package/dist/engineAgentPanelStore.js +19 -537
- package/dist/engineCapReader.d.ts +6 -6
- package/dist/engineCapReader.js +30 -43
- package/dist/engineCapsCache.d.ts +7 -2
- package/dist/engineCapsCache.js +64 -26
- package/dist/engineCredentialRequirement.d.ts +9 -0
- package/dist/engineCredentialRequirement.js +23 -0
- package/dist/engineEnvSourcing.d.ts +53 -0
- package/dist/engineEnvSourcing.js +81 -0
- package/dist/engineErrorCodes.d.ts +14 -3
- package/dist/engineErrorCodes.js +31 -10
- package/dist/engineIdentity.js +2 -0
- package/dist/engineWireSdk.js +2 -2
- package/dist/executionLaneCapability.d.ts +2 -3
- package/dist/executionLaneCapability.js +18 -23
- package/dist/fileHistoryCaptureCapability.d.ts +0 -1
- package/dist/fileHistoryCaptureCapability.js +2 -6
- package/dist/fileHistoryLegNotice.d.ts +3 -2
- package/dist/fileHistoryLegNotice.js +51 -2
- package/dist/fleet/fleetLedger.d.ts +2 -0
- package/dist/fleet/fleetLedger.js +69 -52
- package/dist/fleet/fleetProjection.d.ts +0 -3
- package/dist/fleet/fleetProjection.js +9 -16
- package/dist/fleetAgentPanelProjection.d.ts +4 -17
- package/dist/fleetAgentPanelProjection.js +7 -197
- package/dist/fleetAgentRowLike.d.ts +16 -0
- package/dist/fleetAgentRowLike.js +1 -0
- package/dist/gateOutcome.js +30 -18
- package/dist/generated/sdkFactTables.d.ts +2 -0
- package/dist/generated/sdkFactTables.js +17 -0
- package/dist/generated/settingsSchemaFns.d.ts +10 -0
- package/dist/generated/settingsSchemaFns.js +22 -0
- package/dist/headlessPermissionModeWire.d.ts +1 -1
- package/dist/headlessPermissionModeWire.js +1 -1
- package/dist/headlessReconnectWire.js +49 -20
- package/dist/hitl/allowRuleShadow.d.ts +1 -1
- package/dist/hitl/allowRuleShadow.js +49 -8
- package/dist/hitl/approvalCompleteParked.d.ts +1 -0
- package/dist/hitl/approvalCompleteParked.js +14 -0
- package/dist/hitl/approvalEndingCause.d.ts +5 -0
- package/dist/hitl/approvalEndingCause.js +61 -0
- package/dist/hitl/approvalHolds.d.ts +12 -2
- package/dist/hitl/approvalHolds.js +53 -2
- package/dist/hitl/approvalsFeed.js +23 -11
- package/dist/hitl/askGateWire.d.ts +2 -1
- package/dist/hitl/askGateWire.js +26 -1
- package/dist/hitl/automaticAnswerVerdict.js +2 -2
- package/dist/hitl/crashConverged.js +2 -0
- package/dist/hitl/decisionConflict.d.ts +3 -0
- package/dist/hitl/decisionConflict.js +43 -0
- package/dist/hitl/decisionRefusal.d.ts +4 -0
- package/dist/hitl/decisionRefusal.js +26 -1
- package/dist/hitl/frameRouter.js +26 -43
- package/dist/hitl/gateLedger.d.ts +5 -0
- package/dist/hitl/gateLedger.js +21 -0
- package/dist/hitl/hitlBridge.d.ts +12 -1
- package/dist/hitl/hitlBridge.js +68 -53
- package/dist/hitl/hitlHostSurface.js +3 -11
- package/dist/hitl/livePendingAsk.d.ts +16 -6
- package/dist/hitl/livePendingAsk.js +36 -4
- package/dist/hitl/parkExpiryJudgements.d.ts +19 -0
- package/dist/hitl/parkExpiryJudgements.js +46 -0
- package/dist/hitl/parkResolver.d.ts +3 -7
- package/dist/hitl/parkResolver.js +50 -26
- package/dist/hitl/persistedRulesWire.js +5 -1
- package/dist/hitl/planReviewWire.d.ts +2 -2
- package/dist/hitl/planReviewWire.js +56 -30
- package/dist/hitl/replayedApproval.d.ts +8 -0
- package/dist/hitl/replayedApproval.js +125 -10
- package/dist/hitl/resumeRunningCard.d.ts +2 -0
- package/dist/hitl/resumeRunningCard.js +15 -4
- package/dist/hitl/toolApprovalWire.d.ts +24 -4
- package/dist/hitl/toolApprovalWire.js +115 -38
- package/dist/hooksWireCaps.js +38 -6
- package/dist/host.d.ts +5 -0
- package/dist/host.js +3 -1
- package/dist/hostCallbackGuard.d.ts +1 -0
- package/dist/hostCallbackGuard.js +25 -0
- package/dist/index.d.ts +30 -11
- package/dist/index.js +20 -8
- package/dist/interactiveInterrupt.d.ts +8 -0
- package/dist/interactiveInterrupt.js +54 -0
- package/dist/limitsWire.d.ts +5 -0
- package/dist/limitsWire.js +49 -3
- package/dist/liveModelCatalog.d.ts +95 -0
- package/dist/liveModelCatalog.js +297 -32
- package/dist/mcpEngineLeg.d.ts +25 -0
- package/dist/mcpEngineLeg.js +71 -15
- package/dist/mcpPanel.js +2 -1
- package/dist/mcpProbeCapability.d.ts +0 -1
- package/dist/mcpProbeCapability.js +2 -6
- package/dist/mcpReconnect.d.ts +1 -3
- package/dist/mcpReconnect.js +10 -5
- package/dist/memoryComplianceCapability.d.ts +0 -1
- package/dist/memoryComplianceCapability.js +2 -6
- package/dist/memoryOriginCapability.d.ts +0 -1
- package/dist/memoryOriginCapability.js +2 -6
- package/dist/memoryVerbsWire.d.ts +1 -1
- package/dist/memoryVerbsWire.js +4 -0
- package/dist/model/liveCatalogShape.d.ts +14 -0
- package/dist/model/liveCatalogShape.js +71 -0
- package/dist/model/modelSupplyRules.d.ts +1 -0
- package/dist/model/modelSupplyRules.js +30 -9
- package/dist/model/modelsPolicy.d.ts +21 -0
- package/dist/model/modelsPolicy.js +90 -0
- package/dist/modelIdentityResolvability.d.ts +1 -1
- package/dist/modelIdentityResolvability.js +5 -12
- package/dist/modelSwitchFallback.d.ts +69 -0
- package/dist/modelSwitchFallback.js +206 -0
- package/dist/notifications.js +12 -11
- package/dist/outputStyleSeatCapability.d.ts +0 -1
- package/dist/outputStyleSeatCapability.js +2 -7
- package/dist/ownKey.d.ts +6 -0
- package/dist/ownKey.js +48 -0
- package/dist/panelReduce.d.ts +114 -0
- package/dist/panelReduce.js +1135 -0
- package/dist/panelStateHolder.d.ts +17 -0
- package/dist/panelStateHolder.js +201 -0
- package/dist/peerLaneCapability.d.ts +0 -1
- package/dist/peerLaneCapability.js +2 -6
- package/dist/permissionModesCapability.d.ts +0 -1
- package/dist/permissionModesCapability.js +5 -10
- package/dist/permissionRulesWriteCapability.d.ts +0 -1
- package/dist/permissionRulesWriteCapability.js +2 -6
- package/dist/permissionsAllowGrantCapability.d.ts +0 -1
- package/dist/permissionsAllowGrantCapability.js +3 -9
- package/dist/permissionsDeclaration.d.ts +6 -0
- package/dist/permissionsDeclaration.js +45 -0
- package/dist/printToolResultFrame.js +2 -10
- package/dist/promptDelivery.js +0 -8
- package/dist/resumeRefusalCopy.d.ts +18 -1
- package/dist/resumeRefusalCopy.js +126 -15
- package/dist/rewindArchiveCapability.d.ts +2 -1
- package/dist/rewindArchiveCapability.js +15 -7
- package/dist/rewindEngineAction.d.ts +21 -0
- package/dist/rewindEngineAction.js +36 -0
- package/dist/rewindWireCaps.d.ts +2 -1
- package/dist/rewindWireCaps.js +1 -0
- package/dist/runTerminal.d.ts +0 -11
- package/dist/runTerminal.js +4 -27
- package/dist/sdkRegistryTransit.d.ts +2 -1
- package/dist/sdkRegistryTransit.js +1 -0
- package/dist/sealedKeyCapability.d.ts +0 -1
- package/dist/sealedKeyCapability.js +3 -9
- package/dist/seatContract.d.ts +54 -25
- package/dist/seatContract.js +394 -171
- package/dist/sessionIdSegment.d.ts +1 -0
- package/dist/sessionIdSegment.js +11 -0
- package/dist/sessionMemoryErase.d.ts +1 -1
- package/dist/sessionMemoryErase.js +6 -1
- package/dist/sessionMemoryStatus.js +3 -2
- package/dist/sessionPolicyCapability.d.ts +0 -1
- package/dist/sessionPolicyCapability.js +2 -6
- package/dist/sessionReadRedactionCapability.d.ts +0 -1
- package/dist/sessionReadRedactionCapability.js +2 -7
- package/dist/sessionSyncFileHistoryCapability.d.ts +0 -1
- package/dist/sessionSyncFileHistoryCapability.js +2 -6
- package/dist/skillToolListsCapability.d.ts +0 -1
- package/dist/skillToolListsCapability.js +2 -6
- package/dist/skillsWireCaps.d.ts +4 -0
- package/dist/skillsWireCaps.js +66 -1
- package/dist/sqlEngineCapability.d.ts +0 -1
- package/dist/sqlEngineCapability.js +9 -14
- package/dist/steerPriorityCapability.d.ts +0 -1
- package/dist/steerPriorityCapability.js +3 -9
- package/dist/storePostureCapability.d.ts +1 -1
- package/dist/storePostureCapability.js +16 -16
- package/dist/streamDrainingLegs.d.ts +6 -0
- package/dist/streamDrainingLegs.js +23 -0
- package/dist/subagent/engineCompactWire.js +13 -38
- package/dist/subagent/engineDelegatedPrompt.js +10 -6
- package/dist/subagent/engineSubagentOutput.d.ts +0 -1
- package/dist/subagent/engineSubagentOutput.js +5 -20
- package/dist/subagent/engineSubagentTail.d.ts +0 -1
- package/dist/subagent/engineSubagentTail.js +7 -32
- package/dist/subagentContentStore.js +3 -3
- package/dist/supportFloor.js +2 -5
- package/dist/terminalStatuses.d.ts +30 -0
- package/dist/terminalStatuses.js +67 -0
- package/dist/toolResult.d.ts +5 -0
- package/dist/toolResult.js +88 -36
- package/dist/types/engineState.d.ts +2 -1
- package/dist/usageAnalytics.d.ts +146 -0
- package/dist/usageAnalytics.js +311 -0
- package/dist/userInvokedSkillsCapability.d.ts +0 -1
- package/dist/userInvokedSkillsCapability.js +2 -6
- package/dist/webSearchBackendCapability.d.ts +0 -1
- package/dist/webSearchBackendCapability.js +3 -7
- package/dist/webSearchWireCaps.js +3 -11
- package/dist/wireFailureShape.d.ts +4 -0
- package/dist/wireFailureShape.js +42 -2
- package/dist/wireRefusalCopy.js +2 -18
- package/dist/workflowClient.js +7 -11
- package/dist/workflowsJournalCapability.d.ts +0 -1
- package/dist/workflowsJournalCapability.js +2 -6
- package/dist/writeProtectionCapability.d.ts +0 -1
- package/dist/writeProtectionCapability.js +5 -10
- package/docs/INTEGRATION-CLIENTS.md +1033 -26
- package/package.json +5 -5
- package/dist/engineCapsGenerationGuard.d.ts +0 -4
- package/dist/engineCapsGenerationGuard.js +0 -19
- package/dist/panelRunningHistory.d.ts +0 -22
- package/dist/panelRunningHistory.js +0 -82
- package/dist/registryConflict.d.ts +0 -3
- package/dist/registryConflict.js +0 -44
package/dist/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export { __resetSubagentContentStoreConfigForTests, __resetSubagentOwnerLedgerFo
|
|
|
15
15
|
export * from './engineAgentPanelStore.js';
|
|
16
16
|
export * from './engineAgentAbsence.js';
|
|
17
17
|
export * from './fleetAgentPanelProjection.js';
|
|
18
|
+
export { reducePanelFrame, createPanelReduceState, PANEL_DELTA_OPS } from './panelReduce.js';
|
|
18
19
|
export { _resetLiveQuestionStore, hasLocalQuestionResponder, hasQuestionOverlay, hasQuestionOverlayFor, onQuestionFrame, onQuestionFrameFor, publishQuestionFrame, publishQuestionFrameFor, registerLocalQuestionResponder, respondToQuestion, setQuestionRespond, } from './liveQuestionStore.js';
|
|
19
20
|
export * from './engineInlineTaskStats.js';
|
|
20
21
|
export * from './printToolResultFrame.js';
|
|
@@ -26,7 +27,7 @@ export * from './executionLaneCapability.js';
|
|
|
26
27
|
export * from './approvalsStreamLiveCapability.js';
|
|
27
28
|
export * from './peerLaneCapability.js';
|
|
28
29
|
export * from './permissionRulesWriteCapability.js';
|
|
29
|
-
export { __resetPermissionsAllowGrantReadingsForTests,
|
|
30
|
+
export { __resetPermissionsAllowGrantReadingsForTests, noteEngineCapsForPermissionsAllowGrant, observedPermissionsAllowGrant, permissionsAllowGrantAvailable, permissionsAllowGrantDoctorDetail, projectPermissionsAllowGrantCapability, } from './permissionsAllowGrantCapability.js';
|
|
30
31
|
export * from './sessionPolicyCapability.js';
|
|
31
32
|
export * from './memoryComplianceCapability.js';
|
|
32
33
|
export * from './memoryOriginCapability.js';
|
|
@@ -34,9 +35,11 @@ export * from './memoryEntriesWire.js';
|
|
|
34
35
|
export * from './memoryVerbsWire.js';
|
|
35
36
|
export * from './deviceExecutorManagementCapability.js';
|
|
36
37
|
export * from './mcpReconnect.js';
|
|
38
|
+
export * from './hitl/parkExpiryJudgements.js';
|
|
39
|
+
export * from './usageAnalytics.js';
|
|
37
40
|
export * from './leaderConflict.js';
|
|
38
41
|
export * from './runTerminal.js';
|
|
39
|
-
export {
|
|
42
|
+
export { CORE_SEMA_TASK_TERMINAL_STATUSES, CORE_TASK_NOTIFICATION_TERMINAL_STATUSES, CORE_TERMINAL_CAUSE_KINDS, SDK_FLEET_TASK_TERMINAL_STATUSES, SDK_RUN_TERMINAL_STATUSES, ccTaskTerminalStatusOf, isCoreSemaTaskTerminal, isCoreTaskNotificationTerminal, isCoreTaskNotificationTerminalNotSuccess, isCoreTerminalCauseKind, isSdkFleetTaskTerminal, isSdkFleetTaskTerminalNotSuccess, isSdkRunTerminal, isSdkRunTerminalNotSuccess, } from './terminalStatuses.js';
|
|
40
43
|
export * from './runCancelContext.js';
|
|
41
44
|
export * from './argvFlagValue.js';
|
|
42
45
|
export * from './readFacePosture.js';
|
|
@@ -94,6 +97,7 @@ export * from './retainBackgroundWireCaps.js';
|
|
|
94
97
|
export * from './oneShotWireCaps.js';
|
|
95
98
|
export * from './rewindWireCaps.js';
|
|
96
99
|
export * from './rewindArchiveCapability.js';
|
|
100
|
+
export * from './rewindEngineAction.js';
|
|
97
101
|
export * from './fileHistoryCaptureCapability.js';
|
|
98
102
|
export { FILE_HISTORY_LEG_VERDICTS, fileHistoryLegNoticeVerdict, fileHistoryLegNoticeSentence, fileHistoryDeclarationOfBody, createFileHistoryDeclarationLedger, } from './fileHistoryLegNotice.js';
|
|
99
103
|
export * from './callerCwdCapability.js';
|
|
@@ -111,6 +115,7 @@ export * from './liveModelCatalog.js';
|
|
|
111
115
|
export * from './modelBudgetRule.js';
|
|
112
116
|
export * from './modelIdentityResolvability.js';
|
|
113
117
|
export * from './sessionModelLatch.js';
|
|
118
|
+
export * from './modelSwitchFallback.js';
|
|
114
119
|
export * from './effortWire.js';
|
|
115
120
|
export * from './adapter/types.js';
|
|
116
121
|
export * from './adapter/downstream/turnUsageToModelUsage.js';
|
|
@@ -122,7 +127,7 @@ export * from './adapter/activeRunSelfHeal.js';
|
|
|
122
127
|
export * from './request/taskRequest.js';
|
|
123
128
|
export { disableSkillsDeclaration, disableSkillsDeclarationSettled } from './disableSkillsWire.js';
|
|
124
129
|
export { approvalReachDeclaration, approvalReachDeclarationSettled } from './approvalReachWire.js';
|
|
125
|
-
export { PERMISSIONS_KEPT_REASONS, WIRE_RULE_TRUST_ORDER, permissionsDeclaration, permissionsDeclarationReport } from './permissionsDeclaration.js';
|
|
130
|
+
export { PERMISSIONS_KEPT_REASONS, WIRE_RULE_TRUST_ORDER, permissionsAllowKeptNotice, permissionsDeclaration, permissionsDeclarationReport } from './permissionsDeclaration.js';
|
|
126
131
|
export * from './clientSlice.js';
|
|
127
132
|
export * from './host.js';
|
|
128
133
|
export { abortableSleep } from './abortableSleep.js';
|
|
@@ -137,7 +142,7 @@ export * from './limitsWire.js';
|
|
|
137
142
|
export * from './interactiveToolsWire.js';
|
|
138
143
|
export * from './headlessPermissionModeWire.js';
|
|
139
144
|
export * from './headlessReconnectWire.js';
|
|
140
|
-
export { coerceTaskStatus, coerceWorkflowStatus, CONTROL_TOOL_VERBS, FLEET_TASK_ROW_KEYS_NOT_PROJECTED, FLEET_TASK_ROW_WIRE_KEYS, FLEET_TASK_VIEW_KEYS, FLEET_WORKFLOW_ROW_KEYS_NOT_PROJECTED, FLEET_WORKFLOW_ROW_WIRE_KEYS, FLEET_WORKFLOW_VIEW_KEYS, projectDescription, projectTasks, projectWorkflows,
|
|
145
|
+
export { coerceTaskStatus, coerceWorkflowStatus, CONTROL_TOOL_VERBS, FLEET_TASK_ROW_KEYS_NOT_PROJECTED, FLEET_TASK_ROW_WIRE_KEYS, FLEET_TASK_VIEW_KEYS, FLEET_WORKFLOW_ROW_KEYS_NOT_PROJECTED, FLEET_WORKFLOW_ROW_WIRE_KEYS, FLEET_WORKFLOW_VIEW_KEYS, projectDescription, projectTasks, projectWorkflows, wireResumable, wireRowUsage, } from './fleet/fleetProjection.js';
|
|
141
146
|
export * from './fleet/fleetLedger.js';
|
|
142
147
|
export * from './fleet/workflowSizeWarning.js';
|
|
143
148
|
export * from './subagent/engineDelegatedPrompt.js';
|
|
@@ -158,12 +163,11 @@ export * from './corruptSession.js';
|
|
|
158
163
|
export * from './corruptSessionCopy.js';
|
|
159
164
|
export { classifyToolHistoryMismatch, readToolHistoryMismatchKey, resolveToolHistoryRewindTarget } from './toolHistoryMismatch.js';
|
|
160
165
|
export { toolHistoryBadTurnSentence } from './toolHistoryBadTurn.js';
|
|
161
|
-
export { classifyRegistryConflict, isScopeGoneError } from './registryConflict.js';
|
|
162
166
|
export { deviceFlowPollingPlan } from './deviceFlowPolling.js';
|
|
163
167
|
export { createPromptDeliveryLedger, promptKnownUndelivered, withoutUndeliveredPrompts } from './promptDelivery.js';
|
|
164
168
|
export { mintUserAttachmentEnvelope } from './userAttachmentEnvelope.js';
|
|
165
169
|
export { encodeHumanTurn, deliveredUuidsOf } from './humanTurn.js';
|
|
166
|
-
export { noteEngineCapsForAttachmentSeat, observedAttachmentSeat,
|
|
170
|
+
export { noteEngineCapsForAttachmentSeat, observedAttachmentSeat, __resetAttachmentSeatReadingsForTests, } from './attachmentSeatCapability.js';
|
|
167
171
|
export * from './resumeRefusalCopy.js';
|
|
168
172
|
export * from './wireRefusalCopy.js';
|
|
169
173
|
export * from './inheritEnvWire.js';
|
|
@@ -206,15 +210,21 @@ export * from './hitl/sessionPolicyWire.js';
|
|
|
206
210
|
export * from './hitl/sessionPolicyDeliverable.js';
|
|
207
211
|
export * from './hitl/approvalsFeed.js';
|
|
208
212
|
export * from './hitl/livePendingAsk.js';
|
|
209
|
-
export { replayedApprovalDisposition } from './hitl/replayedApproval.js';
|
|
213
|
+
export { replayedApprovalDisposition, replayedApprovalSentence } from './hitl/replayedApproval.js';
|
|
214
|
+
export { hasLedgerPositionKey } from './hitl/gateLedger.js';
|
|
210
215
|
export { MODE_ARBITRATION, automaticAnswerVerdict, mandatedApprovalDetailOf, permissionRequestHookScope, } from './hitl/automaticAnswerVerdict.js';
|
|
211
216
|
export { classifyDecisionRefusal, liveAskPendingReading, decisionRefusalClosesOut, undeliverableDecisionContent, } from './hitl/decisionRefusal.js';
|
|
212
217
|
export { noAllowCauseOf } from './hitl/noAllowCause.js';
|
|
213
218
|
export { policyDenyReason } from './hitl/frameRouter.js';
|
|
214
|
-
export { readApprovalAllowRuleShadow, approvalAllowRuleShadowed, } from './hitl/allowRuleShadow.js';
|
|
219
|
+
export { readApprovalAllowRuleShadow, approvalAllowRuleShadowed, allowRuleShadowSentence, } from './hitl/allowRuleShadow.js';
|
|
215
220
|
export { projectCrashConverged } from './hitl/crashConverged.js';
|
|
216
221
|
export * from './hitl/crashConvergedNotice.js';
|
|
222
|
+
export { approvalCompleteParked } from './hitl/approvalCompleteParked.js';
|
|
223
|
+
export { approvalCompleteCauseOf } from './hitl/approvalEndingCause.js';
|
|
217
224
|
export * from './interactiveHalt.js';
|
|
225
|
+
export { fireInteractiveInterrupt } from './interactiveInterrupt.js';
|
|
226
|
+
export { listDevices, readSessionBinding, rebindSession, reconcileRebindOutcome, rebindProvesRequestNotApplied } from './deviceRebind.js';
|
|
227
|
+
export { resolveEngineEnvSourcing, engineEnvView } from './engineEnvSourcing.js';
|
|
218
228
|
export * from './compensations.js';
|
|
219
229
|
export * from './request/printNotification.js';
|
|
220
230
|
export * from './seatContract.js';
|
|
@@ -235,3 +245,5 @@ export * from './env/localeGeo.js';
|
|
|
235
245
|
export * from './env/localeTag.js';
|
|
236
246
|
export * from './env/uiLanguage.js';
|
|
237
247
|
export * from './ruleRemovalConsequence.js';
|
|
248
|
+
export { engineCredentialRequirementOf } from './engineCredentialRequirement.js';
|
|
249
|
+
export { isSessionIdPathSegment } from './sessionIdSegment.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AgentClient } from '@sema-agent/sdk';
|
|
2
|
+
import type { InteractiveHaltInterruptOutcome } from './interactiveHalt.js';
|
|
3
|
+
export type InteractiveInterruptRuns = Pick<AgentClient['runs'], 'interrupt'>;
|
|
4
|
+
export interface InteractiveInterruptOptions {
|
|
5
|
+
readonly sessionId?: string | undefined;
|
|
6
|
+
readonly signal?: AbortSignal | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare function fireInteractiveInterrupt(runs: InteractiveInterruptRuns | null | undefined, taskId: string, opts?: InteractiveInterruptOptions): Promise<InteractiveHaltInterruptOutcome>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { atMostOnceVerdictOf } from './atMostOnce.js';
|
|
2
|
+
import { readOwnDataValue } from './ownKey.js';
|
|
3
|
+
function guardedSlot(e, key) {
|
|
4
|
+
if (e === null || (typeof e !== 'object' && typeof e !== 'function'))
|
|
5
|
+
return undefined;
|
|
6
|
+
try {
|
|
7
|
+
return e[key];
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function outcomeOfFailure(e) {
|
|
14
|
+
const v = atMostOnceVerdictOf(e);
|
|
15
|
+
if (v.status === undefined && v.name === 'SyntaxError')
|
|
16
|
+
return { kind: 'halted' };
|
|
17
|
+
if (v.delivery === 'rejected' && v.status !== undefined) {
|
|
18
|
+
return { kind: 'refused', status: v.status, ...(v.code !== undefined ? { errorCode: v.code } : {}) };
|
|
19
|
+
}
|
|
20
|
+
return { kind: 'transport', ...(v.name !== undefined ? { detail: v.name } : {}) };
|
|
21
|
+
}
|
|
22
|
+
function turnCutOf(receipt) {
|
|
23
|
+
if (receipt === null || typeof receipt !== 'object')
|
|
24
|
+
return undefined;
|
|
25
|
+
try {
|
|
26
|
+
if (Array.isArray(receipt))
|
|
27
|
+
return undefined;
|
|
28
|
+
const v = readOwnDataValue(receipt, 'turnCut');
|
|
29
|
+
return typeof v === 'boolean' ? v : undefined;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export async function fireInteractiveInterrupt(runs, taskId, opts = {}) {
|
|
36
|
+
const verb = guardedSlot(runs, 'interrupt');
|
|
37
|
+
if (typeof verb !== 'function')
|
|
38
|
+
return { kind: 'unarmed' };
|
|
39
|
+
const sessionId = guardedSlot(opts, 'sessionId');
|
|
40
|
+
const signal = guardedSlot(opts, 'signal');
|
|
41
|
+
const callOpts = {
|
|
42
|
+
...(typeof sessionId === 'string' && sessionId.length > 0 ? { session: sessionId } : {}),
|
|
43
|
+
...(signal !== undefined && signal !== null ? { signal } : {}),
|
|
44
|
+
};
|
|
45
|
+
let receipt;
|
|
46
|
+
try {
|
|
47
|
+
receipt = await verb.call(runs, taskId, undefined, callOpts);
|
|
48
|
+
}
|
|
49
|
+
catch (e) {
|
|
50
|
+
return outcomeOfFailure(e);
|
|
51
|
+
}
|
|
52
|
+
const turnCut = turnCutOf(receipt);
|
|
53
|
+
return { kind: 'halted', ...(turnCut !== undefined ? { turnCut } : {}) };
|
|
54
|
+
}
|
package/dist/limitsWire.d.ts
CHANGED
|
@@ -21,6 +21,11 @@ export type LimitsParseResult = {
|
|
|
21
21
|
error: string;
|
|
22
22
|
};
|
|
23
23
|
export declare function parseLimitsArgv(argv: string[]): LimitsParseResult;
|
|
24
|
+
export declare function explicitLimitFlagNames(parsed: LimitsParseResult): string[];
|
|
25
|
+
export declare function limitsSupportNotice(reading: {
|
|
26
|
+
observed: boolean;
|
|
27
|
+
version?: unknown;
|
|
28
|
+
}, flags: readonly string[]): string | undefined;
|
|
24
29
|
export type HeadlessEnvLimitsResult = {
|
|
25
30
|
ok: true;
|
|
26
31
|
limits: HeadlessLimits | undefined;
|
package/dist/limitsWire.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { hostEnv } from './hostEnv.js';
|
|
2
2
|
import { lastFlagValue } from './argvFlagValue.js';
|
|
3
|
+
import { engineVersionTier, SUPPORT_FLOOR } from './supportFloor.js';
|
|
4
|
+
import { readThrownSlot } from './wireFailureShape.js';
|
|
3
5
|
export const HEADLESS_DEADLINE_ENV = 'SEMA_HEADLESS_DEADLINE_SEC';
|
|
4
6
|
export const HEADLESS_MAX_TURNS_ENV = 'SEMA_HEADLESS_MAX_TURNS';
|
|
5
7
|
export const HEADLESS_MAX_TOKENS_ENV = 'SEMA_HEADLESS_MAX_TOKENS';
|
|
@@ -10,6 +12,11 @@ export const MAX_TURNS_MAX = Number.MAX_SAFE_INTEGER;
|
|
|
10
12
|
export const MAX_TOKENS_MIN = 1;
|
|
11
13
|
export const MAX_TOKENS_MAX = Number.MAX_SAFE_INTEGER;
|
|
12
14
|
const SEC_TO_MS = 1_000;
|
|
15
|
+
const LIMIT_FLAG_OF_KEY = {
|
|
16
|
+
maxWalltimeMs: '--deadline',
|
|
17
|
+
maxTurns: '--max-turns',
|
|
18
|
+
maxOutputTokens: '--max-tokens',
|
|
19
|
+
};
|
|
13
20
|
const DEADLINE_USAGE = `sema: --deadline expects a whole number of seconds between ${DEADLINE_SEC_MIN} and ${DEADLINE_SEC_MAX}.\n` +
|
|
14
21
|
' --deadline <sec> wall-clock budget for this run (sema superset — no upstream equivalent):\n' +
|
|
15
22
|
' reaching it ends the run LOUDLY (failed / limits.max_walltime_exceeded)\n' +
|
|
@@ -39,21 +46,21 @@ function hasAnyLimit(l) {
|
|
|
39
46
|
}
|
|
40
47
|
export function parseLimitsArgv(argv) {
|
|
41
48
|
const limits = {};
|
|
42
|
-
const dl = lastFlagValue(argv,
|
|
49
|
+
const dl = lastFlagValue(argv, LIMIT_FLAG_OF_KEY.maxWalltimeMs);
|
|
43
50
|
if (dl.present) {
|
|
44
51
|
const n = dl.raw !== undefined ? parseIntInDomain(dl.raw, DEADLINE_SEC_MIN, DEADLINE_SEC_MAX) : null;
|
|
45
52
|
if (n === null)
|
|
46
53
|
return { ok: false, error: DEADLINE_USAGE };
|
|
47
54
|
limits.maxWalltimeMs = n * SEC_TO_MS;
|
|
48
55
|
}
|
|
49
|
-
const mt = lastFlagValue(argv,
|
|
56
|
+
const mt = lastFlagValue(argv, LIMIT_FLAG_OF_KEY.maxTurns);
|
|
50
57
|
if (mt.present) {
|
|
51
58
|
const n = mt.raw !== undefined ? parseIntInDomain(mt.raw, MAX_TURNS_MIN, MAX_TURNS_MAX) : null;
|
|
52
59
|
if (n === null)
|
|
53
60
|
return { ok: false, error: MAX_TURNS_USAGE };
|
|
54
61
|
limits.maxTurns = n;
|
|
55
62
|
}
|
|
56
|
-
const mk = lastFlagValue(argv,
|
|
63
|
+
const mk = lastFlagValue(argv, LIMIT_FLAG_OF_KEY.maxOutputTokens);
|
|
57
64
|
if (mk.present) {
|
|
58
65
|
const n = mk.raw !== undefined ? parseIntInDomain(mk.raw, MAX_TOKENS_MIN, MAX_TOKENS_MAX) : null;
|
|
59
66
|
if (n === null)
|
|
@@ -62,6 +69,45 @@ export function parseLimitsArgv(argv) {
|
|
|
62
69
|
}
|
|
63
70
|
return { ok: true, ...(hasAnyLimit(limits) ? { limits } : {}) };
|
|
64
71
|
}
|
|
72
|
+
export function explicitLimitFlagNames(parsed) {
|
|
73
|
+
if (typeof parsed !== 'object' || parsed === null || parsed.ok !== true)
|
|
74
|
+
return [];
|
|
75
|
+
const limits = parsed.limits;
|
|
76
|
+
if (typeof limits !== 'object' || limits === null)
|
|
77
|
+
return [];
|
|
78
|
+
return Object.keys(LIMIT_FLAG_OF_KEY).filter((k) => limits[k] !== undefined).map((k) => LIMIT_FLAG_OF_KEY[k]);
|
|
79
|
+
}
|
|
80
|
+
const LIMIT_FLAGS_READ_MAX = 64;
|
|
81
|
+
function limitFlagWordsIn(flags) {
|
|
82
|
+
const all = Object.values(LIMIT_FLAG_OF_KEY);
|
|
83
|
+
if (typeof flags !== 'object' || flags === null)
|
|
84
|
+
return all;
|
|
85
|
+
const length = readThrownSlot(flags, 'length');
|
|
86
|
+
if (typeof length !== 'number' || !Number.isInteger(length) || length <= 0)
|
|
87
|
+
return all;
|
|
88
|
+
const given = new Set();
|
|
89
|
+
for (let i = 0; i < Math.min(length, LIMIT_FLAGS_READ_MAX); i++)
|
|
90
|
+
given.add(readThrownSlot(flags, String(i)));
|
|
91
|
+
const shown = all.filter((w) => given.has(w));
|
|
92
|
+
return shown.length > 0 ? shown : all;
|
|
93
|
+
}
|
|
94
|
+
export function limitsSupportNotice(reading, flags) {
|
|
95
|
+
if (typeof reading !== 'object' || reading === null)
|
|
96
|
+
return undefined;
|
|
97
|
+
if (readThrownSlot(reading, 'observed') !== true)
|
|
98
|
+
return undefined;
|
|
99
|
+
const rawVersion = readThrownSlot(reading, 'version');
|
|
100
|
+
const version = typeof rawVersion === 'string' ? rawVersion : undefined;
|
|
101
|
+
const tier = engineVersionTier(version);
|
|
102
|
+
if (tier === 'engine')
|
|
103
|
+
return undefined;
|
|
104
|
+
const shown = limitFlagWordsIn(flags);
|
|
105
|
+
const text = shown.join(' / ');
|
|
106
|
+
if (tier === 'legacy') {
|
|
107
|
+
return `[sema] The engine reports version ${String(version)}, older than ${SUPPORT_FLOOR.server} (the oldest engine this client supports); it may ignore ${text}.`;
|
|
108
|
+
}
|
|
109
|
+
return `[sema] The engine did not report a version this client can read, so it cannot be confirmed that it honors ${text}; ${shown.length > 1 ? 'they were' : 'it was'} sent anyway.`;
|
|
110
|
+
}
|
|
65
111
|
export function headlessLimitsFromEnv(env = hostEnv()) {
|
|
66
112
|
const out = {};
|
|
67
113
|
const dl = env[HEADLESS_DEADLINE_ENV]?.trim();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AgentClient } from '@sema-agent/sdk';
|
|
1
2
|
export interface LiveModelInfo {
|
|
2
3
|
name: string;
|
|
3
4
|
id?: string;
|
|
@@ -6,11 +7,20 @@ export interface LiveModelInfo {
|
|
|
6
7
|
vision?: boolean;
|
|
7
8
|
routePairing?: string;
|
|
8
9
|
supportedEffortLevels?: string[];
|
|
10
|
+
contextWindow?: number;
|
|
11
|
+
maxOutputTokens?: number;
|
|
12
|
+
atMentionable?: boolean;
|
|
13
|
+
compat?: LiveModelCompat;
|
|
9
14
|
[k: string]: unknown;
|
|
10
15
|
}
|
|
11
16
|
export interface LiveModelCatalog {
|
|
12
17
|
models: LiveModelInfo[];
|
|
13
18
|
default: string;
|
|
19
|
+
defaultModel?: {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly name?: string;
|
|
22
|
+
};
|
|
23
|
+
droppedEntries?: readonly LiveModelDroppedEntry[];
|
|
14
24
|
}
|
|
15
25
|
export declare function setLiveModelCatalog(next: LiveModelCatalog | null): void;
|
|
16
26
|
export declare function setLiveModelCatalogRefresher(fn: (() => Promise<LiveModelCatalog | null>) | null): void;
|
|
@@ -33,8 +43,93 @@ export type EffortLevelsReading = {
|
|
|
33
43
|
export declare function effortLevelsOf(model: string | undefined, catalog?: LiveModelCatalog | null): EffortLevelsReading;
|
|
34
44
|
export declare function effortLevelHonored(reading: EffortLevelsReading, level: string): 'yes' | 'no' | 'unknown';
|
|
35
45
|
export declare function liveDefaultModelName(): string | null;
|
|
46
|
+
type SdkModelsListResult = Awaited<ReturnType<AgentClient['models']['list']>>;
|
|
47
|
+
type SdkDroppedEntry = SdkModelsListResult extends {
|
|
48
|
+
droppedEntries?: ReadonlyArray<infer E>;
|
|
49
|
+
} ? E : never;
|
|
50
|
+
type SdkModelInfo = SdkModelsListResult extends {
|
|
51
|
+
models: ReadonlyArray<infer M>;
|
|
52
|
+
} ? M : never;
|
|
53
|
+
export type LiveModelCompat = NonNullable<SdkModelInfo extends {
|
|
54
|
+
compat?: infer C;
|
|
55
|
+
} ? C : never>;
|
|
56
|
+
export type LiveModelDroppedEntry = SdkDroppedEntry extends {
|
|
57
|
+
reasonCode: infer R;
|
|
58
|
+
} ? Omit<SdkDroppedEntry, 'reasonCode'> & {
|
|
59
|
+
readonly reasonCode: R | (string & {});
|
|
60
|
+
} : SdkDroppedEntry;
|
|
61
|
+
export type ModelDroppedEntriesReading = {
|
|
62
|
+
readonly kind: 'reported';
|
|
63
|
+
readonly entries: readonly LiveModelDroppedEntry[];
|
|
64
|
+
readonly unreadable: number;
|
|
65
|
+
} | {
|
|
66
|
+
readonly kind: 'not_reported';
|
|
67
|
+
} | {
|
|
68
|
+
readonly kind: 'unknown';
|
|
69
|
+
readonly why: 'no_catalog' | 'malformed' | 'unreadable';
|
|
70
|
+
};
|
|
71
|
+
export declare function droppedModelEntriesOf(catalog?: LiveModelCatalog | null): ModelDroppedEntriesReading;
|
|
36
72
|
export interface RoutePairingVerdict {
|
|
37
73
|
verdict: 'ok' | 'broken' | 'unknown';
|
|
38
74
|
posture?: string;
|
|
39
75
|
}
|
|
40
76
|
export declare function routePairingVerdict(v: unknown): RoutePairingVerdict;
|
|
77
|
+
export type LiveModelCatalogReading = {
|
|
78
|
+
readonly kind: 'read';
|
|
79
|
+
readonly catalog: LiveModelCatalog;
|
|
80
|
+
readonly unreadableRows: number;
|
|
81
|
+
readonly defaultModelMalformed?: true;
|
|
82
|
+
} | {
|
|
83
|
+
readonly kind: 'unreadable';
|
|
84
|
+
readonly why: 'not_an_object' | 'models_not_array' | 'default_missing' | 'unreadable';
|
|
85
|
+
};
|
|
86
|
+
export declare function readLiveModelCatalog(body: unknown): LiveModelCatalogReading;
|
|
87
|
+
export type LiveDefaultModelReading = {
|
|
88
|
+
readonly kind: 'listed';
|
|
89
|
+
readonly name: string;
|
|
90
|
+
readonly from: 'defaultModel.name' | 'defaultModel.id';
|
|
91
|
+
} | {
|
|
92
|
+
readonly kind: 'not_listed';
|
|
93
|
+
readonly id: string;
|
|
94
|
+
} | {
|
|
95
|
+
readonly kind: 'unknown';
|
|
96
|
+
readonly why: 'no_catalog' | 'not_reported' | 'unreadable';
|
|
97
|
+
};
|
|
98
|
+
export declare function liveDefaultModelOf(catalog?: LiveModelCatalog | null): LiveDefaultModelReading;
|
|
99
|
+
export type AtMentionReading = {
|
|
100
|
+
readonly kind: 'allowed';
|
|
101
|
+
} | {
|
|
102
|
+
readonly kind: 'refused';
|
|
103
|
+
} | {
|
|
104
|
+
readonly kind: 'not_governed';
|
|
105
|
+
} | {
|
|
106
|
+
readonly kind: 'unknown';
|
|
107
|
+
readonly why: 'no_catalog' | 'model_not_listed' | 'malformed' | 'unreadable';
|
|
108
|
+
};
|
|
109
|
+
export declare function atMentionOf(model: string | undefined, catalog?: LiveModelCatalog | null): AtMentionReading;
|
|
110
|
+
export type ModelCompatReading = {
|
|
111
|
+
readonly kind: 'declared';
|
|
112
|
+
readonly compat: Readonly<LiveModelCompat>;
|
|
113
|
+
} | {
|
|
114
|
+
readonly kind: 'not_declared';
|
|
115
|
+
} | {
|
|
116
|
+
readonly kind: 'unknown';
|
|
117
|
+
readonly why: 'no_catalog' | 'model_not_listed' | 'malformed' | 'unreadable';
|
|
118
|
+
};
|
|
119
|
+
export declare function modelCompatOf(model: string | undefined, catalog?: LiveModelCatalog | null): ModelCompatReading;
|
|
120
|
+
export interface LiveModelRowView {
|
|
121
|
+
readonly name: string;
|
|
122
|
+
readonly id?: string;
|
|
123
|
+
readonly provider?: string;
|
|
124
|
+
readonly reasoning?: boolean;
|
|
125
|
+
readonly contextWindow?: number;
|
|
126
|
+
readonly maxOutputTokens?: number;
|
|
127
|
+
readonly isDefault: boolean;
|
|
128
|
+
readonly vision: ImageVision;
|
|
129
|
+
readonly effort: EffortLevelsReading;
|
|
130
|
+
readonly routePairing: RoutePairingVerdict;
|
|
131
|
+
readonly atMention: AtMentionReading;
|
|
132
|
+
readonly compat: ModelCompatReading;
|
|
133
|
+
}
|
|
134
|
+
export declare function liveModelRowsOf(catalog?: LiveModelCatalog | null): readonly LiveModelRowView[] | null;
|
|
135
|
+
export {};
|