@sema-agent/client-core 0.94.0 → 0.96.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 +521 -0
- package/README.md +104 -57
- package/dist/adapt/arms.js +12 -7
- package/dist/adapt/panelTasks.js +4 -10
- package/dist/adapt/toolCards.d.ts +1 -0
- package/dist/adapt/toolCards.js +18 -5
- package/dist/adapt/wireShapes.js +5 -24
- package/dist/adapter/activeRunSelfHeal.d.ts +12 -3
- package/dist/adapter/activeRunSelfHeal.js +50 -16
- package/dist/adapter/downstream/eventToSdkMessage.js +33 -18
- package/dist/adapter/downstream/terminalToSdkResult.js +19 -12
- package/dist/adapter/runStream.js +30 -46
- 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 +7 -5
- package/dist/agentSession/engineSessionBackgroundStop.js +25 -17
- package/dist/agentsWireCaps.d.ts +2 -0
- package/dist/agentsWireCaps.js +13 -2
- 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 -5
- package/dist/callerCwdCapability.js +2 -13
- package/dist/centerWiringCapability.d.ts +1 -7
- package/dist/centerWiringCapability.js +18 -27
- package/dist/classifierStatus.js +4 -4
- package/dist/classifierVerdictWire.js +4 -16
- package/dist/clientSlice.js +1 -1
- package/dist/cloudConfigWireCaps.d.ts +3 -3
- package/dist/cloudConfigWireCaps.js +85 -43
- package/dist/compensations.js +1 -1
- package/dist/coreValuePorts.d.ts +11 -7
- package/dist/coreValuePorts.js +5 -8
- package/dist/credentialProvenance.d.ts +28 -0
- package/dist/credentialProvenance.js +76 -0
- package/dist/cycleOrder.d.ts +15 -0
- package/dist/cycleOrder.js +45 -0
- package/dist/decideFailureNote.js +7 -2
- package/dist/decideReceipt.d.ts +2 -1
- package/dist/decideReceipt.js +39 -14
- 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 +8 -3
- package/dist/displayUntrusted.js +661 -63
- 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 +13 -2
- package/dist/engineCapsCache.js +276 -44
- package/dist/engineCredentialRequirement.d.ts +9 -0
- package/dist/engineCredentialRequirement.js +23 -0
- package/dist/engineDirectory.d.ts +79 -0
- package/dist/engineDirectory.js +186 -0
- package/dist/engineEnvSourcing.d.ts +53 -0
- package/dist/engineEnvSourcing.js +81 -0
- package/dist/engineErrorCodes.d.ts +28 -4
- package/dist/engineErrorCodes.js +68 -25
- package/dist/engineIdentity.js +2 -0
- package/dist/engineNoticeCodes.d.ts +17 -0
- package/dist/engineNoticeCodes.js +57 -3
- package/dist/engineWireSdk.js +2 -2
- package/dist/engineWordRenames.d.ts +8 -0
- package/dist/engineWordRenames.js +13 -0
- package/dist/executionLaneCapability.d.ts +2 -3
- package/dist/executionLaneCapability.js +18 -23
- package/dist/fileHistoryCaptureCapability.d.ts +14 -1
- package/dist/fileHistoryCaptureCapability.js +72 -6
- package/dist/fileHistoryLegNotice.d.ts +3 -2
- package/dist/fileHistoryLegNotice.js +51 -2
- package/dist/fleet/bgSubagentRow.d.ts +15 -0
- package/dist/fleet/bgSubagentRow.js +67 -0
- package/dist/fleet/fleetLedger.d.ts +3 -0
- package/dist/fleet/fleetLedger.js +153 -122
- package/dist/fleet/fleetProjection.d.ts +1 -3
- package/dist/fleet/fleetProjection.js +19 -19
- 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/fleetTaskDesc.js +4 -17
- package/dist/gateOutcome.d.ts +12 -1
- package/dist/gateOutcome.js +87 -18
- package/dist/gateVocabulary.d.ts +7 -2
- package/dist/gateVocabulary.js +5 -1
- package/dist/generated/engineAskFaceTables.js +1 -1
- package/dist/generated/engineFactTables.d.ts +5 -3
- package/dist/generated/engineFactTables.js +17 -4
- package/dist/generated/engineNoticeTables.js +12 -3
- package/dist/generated/sdkFactTables.d.ts +2 -0
- package/dist/generated/sdkFactTables.js +17 -0
- package/dist/generated/settingsSchemaFns.d.ts +13 -0
- package/dist/generated/settingsSchemaFns.js +75 -0
- package/dist/generated/toolNameTables.d.ts +1 -0
- package/dist/generated/toolNameTables.js +1 -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 +7 -0
- package/dist/hitl/approvalEndingCause.js +71 -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/askParkRowRouting.js +1 -1
- package/dist/hitl/automaticAnswerVerdict.d.ts +1 -1
- package/dist/hitl/automaticAnswerVerdict.js +15 -10
- package/dist/hitl/crashConverged.js +2 -0
- package/dist/hitl/decisionConflict.d.ts +3 -0
- package/dist/hitl/decisionConflict.js +41 -0
- package/dist/hitl/decisionRefusal.d.ts +12 -0
- package/dist/hitl/decisionRefusal.js +63 -4
- package/dist/hitl/frameRouter.d.ts +0 -1
- package/dist/hitl/frameRouter.js +32 -57
- package/dist/hitl/gateLedger.d.ts +5 -0
- package/dist/hitl/gateLedger.js +21 -0
- package/dist/hitl/hitlBridge.d.ts +17 -2
- package/dist/hitl/hitlBridge.js +91 -55
- 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/localAllowRule.d.ts +1 -0
- package/dist/hitl/localAllowRule.js +2 -2
- package/dist/hitl/noAllowCause.d.ts +2 -1
- package/dist/hitl/noAllowCause.js +3 -2
- package/dist/hitl/parkExpiryJudgements.d.ts +19 -0
- package/dist/hitl/parkExpiryJudgements.js +46 -0
- package/dist/hitl/parkResolver.d.ts +4 -7
- package/dist/hitl/parkResolver.js +12 -34
- package/dist/hitl/parkRowBirthWait.d.ts +1 -0
- package/dist/hitl/parkRowBirthWait.js +2 -2
- package/dist/hitl/persistedRulesWire.js +5 -1
- package/dist/hitl/planReviewWire.d.ts +3 -2
- package/dist/hitl/planReviewWire.js +154 -50
- package/dist/hitl/replayedApproval.d.ts +9 -0
- package/dist/hitl/replayedApproval.js +139 -10
- package/dist/hitl/resumeRunningCard.d.ts +2 -0
- package/dist/hitl/resumeRunningCard.js +15 -4
- package/dist/hitl/sessionPolicyDeliverable.js +8 -6
- package/dist/hitl/standingRows.d.ts +18 -0
- package/dist/hitl/standingRows.js +127 -0
- package/dist/hitl/toolApprovalWire.d.ts +39 -7
- package/dist/hitl/toolApprovalWire.js +351 -61
- package/dist/hookMatcherVerdict.d.ts +1 -9
- package/dist/hookMatcherVerdict.js +21 -61
- package/dist/hooksWireCaps.js +40 -8
- package/dist/host.d.ts +5 -0
- package/dist/host.js +3 -1
- package/dist/hostCallbackGuard.d.ts +2 -0
- package/dist/hostCallbackGuard.js +31 -0
- package/dist/index.d.ts +48 -17
- package/dist/index.js +36 -15
- 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 -5
- package/dist/mcpProbeCapability.js +2 -12
- package/dist/mcpReconnect.d.ts +1 -3
- package/dist/mcpReconnect.js +10 -5
- package/dist/memoryComplianceCapability.d.ts +0 -5
- package/dist/memoryComplianceCapability.js +2 -12
- package/dist/memoryOriginCapability.d.ts +0 -5
- package/dist/memoryOriginCapability.js +2 -12
- package/dist/memorySpecWire.js +2 -2
- 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 +2 -2
- package/dist/modelIdentityResolvability.js +14 -12
- package/dist/modelSwitchFallback.d.ts +69 -0
- package/dist/modelSwitchFallback.js +206 -0
- package/dist/noticePresentation.d.ts +68 -0
- package/dist/noticePresentation.js +247 -0
- package/dist/notifications.js +12 -11
- package/dist/outputStyleSeatCapability.d.ts +0 -2
- package/dist/outputStyleSeatCapability.js +2 -10
- package/dist/ownKey.d.ts +8 -0
- package/dist/ownKey.js +66 -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/peerFrames.js +13 -9
- package/dist/peerLaneCapability.d.ts +0 -1
- package/dist/peerLaneCapability.js +2 -6
- package/dist/permissionModesCapability.d.ts +0 -5
- package/dist/permissionModesCapability.js +5 -16
- package/dist/permissionRuleIssue.js +0 -3
- 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 +8 -0
- package/dist/permissionsDeclaration.js +101 -41
- package/dist/printPermissionOutcome.d.ts +12 -0
- package/dist/printPermissionOutcome.js +50 -0
- package/dist/printToolResultFrame.d.ts +1 -0
- package/dist/printToolResultFrame.js +5 -17
- package/dist/promptBlockedCopy.d.ts +5 -0
- package/dist/promptBlockedCopy.js +35 -0
- package/dist/promptDelivery.js +0 -8
- package/dist/protocolSegment.d.ts +9 -6
- package/dist/protocolSegment.js +31 -21
- package/dist/providerRejection.d.ts +4 -0
- package/dist/providerRejection.js +75 -14
- package/dist/replayBody.d.ts +12 -0
- package/dist/replayBody.js +25 -0
- package/dist/resumeRefusalCopy.d.ts +18 -1
- package/dist/resumeRefusalCopy.js +127 -32
- package/dist/retryStatus.d.ts +9 -1
- package/dist/retryStatus.js +9 -2
- package/dist/rewindArchiveCapability.d.ts +5 -14
- package/dist/rewindArchiveCapability.js +18 -61
- package/dist/rewindArchiveReading.d.ts +15 -0
- package/dist/rewindArchiveReading.js +56 -0
- 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/ruleCompileVerdict.d.ts +9 -1
- package/dist/ruleCompileVerdict.js +29 -4
- package/dist/runTerminal.d.ts +15 -12
- package/dist/runTerminal.js +60 -35
- package/dist/sandboxWire.js +13 -0
- package/dist/sdkRegistryTransit.d.ts +2 -1
- package/dist/sdkRegistryTransit.js +1 -0
- package/dist/sealedKeyCapability.d.ts +0 -5
- package/dist/sealedKeyCapability.js +3 -15
- package/dist/seam.js +4 -2
- package/dist/seatContract.d.ts +125 -34
- package/dist/seatContract.js +583 -179
- 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 -5
- package/dist/sessionReadRedactionCapability.js +2 -13
- package/dist/sessionSyncFileHistory.d.ts +4 -0
- package/dist/sessionSyncFileHistory.js +66 -0
- package/dist/sessionSyncFileHistoryCapability.d.ts +0 -2
- package/dist/sessionSyncFileHistoryCapability.js +2 -9
- package/dist/skillToolListsCapability.d.ts +0 -2
- package/dist/skillToolListsCapability.js +2 -9
- 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 -2
- package/dist/steerPriorityCapability.js +3 -12
- package/dist/storePostureCapability.d.ts +1 -5
- package/dist/storePostureCapability.js +16 -22
- 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/engineSubagentSteer.js +7 -5
- package/dist/subagent/engineSubagentTail.d.ts +0 -1
- package/dist/subagent/engineSubagentTail.js +7 -32
- package/dist/subagentContentStore.js +7 -18
- package/dist/supportFloor.d.ts +1 -0
- package/dist/supportFloor.js +15 -14
- package/dist/systemReminderTag.d.ts +1 -0
- package/dist/systemReminderTag.js +8 -0
- package/dist/terminalStatuses.d.ts +30 -0
- package/dist/terminalStatuses.js +67 -0
- package/dist/toolHistoryMismatch.d.ts +0 -3
- package/dist/toolHistoryMismatch.js +3 -7
- package/dist/toolResult.d.ts +6 -1
- package/dist/toolResult.js +90 -37
- package/dist/toolResultContent.d.ts +2 -0
- package/dist/toolResultContent.js +63 -0
- package/dist/types/engineState.d.ts +2 -1
- package/dist/usageAnalytics.d.ts +146 -0
- package/dist/usageAnalytics.js +335 -0
- package/dist/userInvokedSkillsCapability.d.ts +0 -2
- package/dist/userInvokedSkillsCapability.js +2 -9
- package/dist/webSearchBackendCapability.d.ts +0 -1
- package/dist/webSearchBackendCapability.js +3 -7
- package/dist/webSearchWireCaps.js +3 -11
- package/dist/wireErrorTriage.d.ts +2 -0
- package/dist/wireErrorTriage.js +34 -5
- package/dist/wireFailureShape.d.ts +23 -2
- package/dist/wireFailureShape.js +88 -43
- 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 +2279 -27
- 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
|
@@ -11,10 +11,11 @@ export * from './adapt/textSegmentAuthority.js';
|
|
|
11
11
|
export * from './engineHttpTools.js';
|
|
12
12
|
export * from './sdkWireTransit.js';
|
|
13
13
|
export { SEMA_SEGMENT_ID_KEY } from './adapt/textStream.js';
|
|
14
|
-
export { __resetSubagentContentStoreConfigForTests, __resetSubagentOwnerLedgerForTests, clearSubagentContent, coerceOutput, configureSubagentContentStore, getBgParentRun, getBgParentRunOwner, getBgTerminalFacts, getSubagentContentSnapshot, isOwnEngineRun, parentToolCallIdOf, planSubagentViewSlots, publishSubagentContentEvent, pushSubagentLocalEcho, recordBgParentRun,
|
|
14
|
+
export { __resetSubagentContentStoreConfigForTests, __resetSubagentOwnerLedgerForTests, clearSubagentContent, coerceOutput, configureSubagentContentStore, getBgParentRun, getBgParentRunOwner, getBgTerminalFacts, getSubagentContentSnapshot, isOwnEngineRun, parentToolCallIdOf, planSubagentViewSlots, publishSubagentContentEvent, pushSubagentLocalEcho, recordBgParentRun, recordOwnEngineRun, recordSubagentOwner, recordSubagentOwnerFromProgress, registerSubagentAlias, settleSubagentContent, SUBAGENT_CONTENT_STORE_DEFAULTS, subagentContentStoreConfig, subagentOwnerSessionConflicts, subscribeSubagentContent, } from './subagentContentStore.js';
|
|
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,12 @@ 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';
|
|
43
|
+
export { PROVIDER_REJECTION_KINDS } from './providerRejection.js';
|
|
40
44
|
export * from './runCancelContext.js';
|
|
41
45
|
export * from './argvFlagValue.js';
|
|
42
46
|
export * from './readFacePosture.js';
|
|
@@ -45,6 +49,7 @@ export * from './mcpLiveness.js';
|
|
|
45
49
|
export * from './mcpEngineLeg.js';
|
|
46
50
|
export * from './mcpProbeCapability.js';
|
|
47
51
|
export * from './sessionSyncFileHistoryCapability.js';
|
|
52
|
+
export * from './sessionSyncFileHistory.js';
|
|
48
53
|
export * from './workflowsJournalCapability.js';
|
|
49
54
|
export * from './userInvokedSkillsCapability.js';
|
|
50
55
|
export * from './skillToolListsCapability.js';
|
|
@@ -69,7 +74,7 @@ export * from './modelCapabilityProbe.js';
|
|
|
69
74
|
export * from './classifierStatus.js';
|
|
70
75
|
export * from './engineToolLabelStore.js';
|
|
71
76
|
export * from './fleetTaskDesc.js';
|
|
72
|
-
export { displayUntrusted, displayUntrustedMarks } from './displayUntrusted.js';
|
|
77
|
+
export { displayUntrusted, displayUntrustedMarks, displayConfiguredUrl, queryCarriesCredential } from './displayUntrusted.js';
|
|
73
78
|
export * from './hostEnv.js';
|
|
74
79
|
export * from './unrefTimer.js';
|
|
75
80
|
export { ControlRouter, ControlSafetyError, errCodes, steerBodyOf, steerRefusalAdviceOf, steeringRefusedBeforeEngine, } from './controlRouter.js';
|
|
@@ -79,7 +84,7 @@ export * from './engineWireSdk.js';
|
|
|
79
84
|
export * from './classifierVerdictWire.js';
|
|
80
85
|
export { stripSystemReminderBlocks, unwrapSystemReminder } from './systemReminderTag.js';
|
|
81
86
|
export { findSystemReminderOpenTag } from './systemReminderTag.js';
|
|
82
|
-
export { ACTIVE_RUN_BUSY_ERROR_CODE, APPROVAL_EXPIRED, ASK_GONE, asModelFallbackReason, CAPABILITY_OPERATOR_PRINCIPALS_REQUIRED, CAPABILITY_SELF_ORCHESTRATION_REQUIRED, CONFIG_AGENT_UNKNOWN_TOOL, CONFIG_DELEGATION_ENTRY_CAPS, CONFIG_IMAGE_INVALID, CONFIG_LEGACY_TOOL_NAME, CONFIG_LIMIT_INVALID, CONFIG_LIMIT_UNKNOWN_KEY, CONFIG_MEMORY_PROJECT_KEY_SPELLING, CONFIG_MEMORY_WRITE_SCOPE_MISMATCH, CONFIG_OUTPUT_STYLE_INVALID,
|
|
87
|
+
export { ACTIVE_RUN_BUSY_ERROR_CODE, APPROVAL_EXPIRED, ASK_GONE, asModelFallbackReason, CAPABILITY_IMAGE_INDEX_REQUIRED, CAPABILITY_OPERATOR_PRINCIPALS_REQUIRED, CAPABILITY_SELF_ORCHESTRATION_REQUIRED, CONFIG_AGENT_UNKNOWN_TOOL, CONFIG_DELEGATION_ENTRY_CAPS, CONFIG_IMAGE_INVALID, CONFIG_LEGACY_TOOL_NAME, CONFIG_LIMIT_INVALID, CONFIG_LIMIT_UNKNOWN_KEY, CONFIG_MEMORY_PROJECT_KEY_SPELLING, CONFIG_MEMORY_WRITE_SCOPE_MISMATCH, CONFIG_OUTPUT_STYLE_INVALID, CONFIG_STRATEGY_FIND_LIMIT_INVALID, CONFIG_STRATEGY_MAX_SIZE_INVALID, CORRUPT_SESSION_ERROR_CODE, DECIDE_CLAIM_LOST, DECIDE_GATE_MOVED, DECIDE_NOT_PARKED, DECIDE_PARK_MOVED_CODES, DECIDE_WORKFLOW_HOST_UNKNOWN, DECIDE_WORKFLOW_LANE_CODES, DECIDE_WORKFLOW_PARK_FORKED, DECIDE_WORKFLOW_PARKS_UNREADABLE, DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED, DELEGATION_CAP_CODES, DELEGATION_CONCURRENCY_CAP, DELEGATION_SESSION_CAP, delegationCapDispositionOf, DRAINING_ERROR_CODE, ENGINE_STOP_REASONS, engineStopReasonToCc, ENV_LIFETIME_EXPIRED, FLEET_LEASE_UNAVAILABLE, GATE_PARKED_ERROR_CODE, imageInvalidFailureNoteOf, isConfigRefusalCode, isCorruptSessionCode, isDecideParkMovedCode, isDelegationCapCode, isInterruptedToolEndCode, isLimitsExceededCode, isRewindFamilyCode, isRulesRefusalCode, isStatusDerivedCoarseCode, isWorkflowParkRefusalCode, LIMITS_MAX_COST_EXCEEDED, LIMITS_MAX_TOKENS_EXCEEDED, LIMITS_MAX_TURNS_EXCEEDED, LIMITS_MAX_WALLTIME_EXCEEDED, MCP_SERVER_REVOKED, MODEL_FALLBACK_INHERIT_NO_TIER_BINDING, operatorGateRefusalContent, OUTPUT_INVALID, PARKED_RESUME_STARTUP_FAILED, REQUEST_AUTONOMY_LANE_REFUSED, RESUME_AT_ERROR_CODE_PREFIX, RESUME_CONTEXT_UNAVAILABLE, RESUME_ENV_FAILED, RESUME_PLACEMENT_MISMATCH, RESUME_POLICY_FOLD_CODE, RESUME_PREFLIGHT_REJECTED, RESUME_REOPEN_CODES, RESUME_RETRY_LATER_CODES, RESUME_TOOL_CONTRACT_MISMATCH, RESUME_TOOL_UNAVAILABLE, RESUME_USAGE_WINDOW_EXHAUSTED, REWIND_ERROR_CODE_PREFIXES, RULES_LEGACY_TOOL_NAME, RUN_DEATH_VERDICT_CODES, RUN_ORPHANED, RUN_STALLED, runDeathVerdictNoteOf, SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE, SCENARIO_NOT_ALLOWED_ERROR_CODE, STATUS_DERIVED_COARSE_CODES, STOP_CONFLICT_CODES, STREAM_MAX_DURATION, TOOL_END_INTERRUPTED_NEVER_STARTED, TOOL_END_INTERRUPTED_OUTCOME_UNKNOWN, USAGE_WINDOW_EXHAUSTED, WORKFLOW_PARK_REFUSAL_CODES, } from './engineErrorCodes.js';
|
|
83
88
|
export * from './agentsWireCaps.js';
|
|
84
89
|
export * from './attachmentsWireCaps.js';
|
|
85
90
|
export * from './clientContextWireCaps.js';
|
|
@@ -94,6 +99,7 @@ export * from './retainBackgroundWireCaps.js';
|
|
|
94
99
|
export * from './oneShotWireCaps.js';
|
|
95
100
|
export * from './rewindWireCaps.js';
|
|
96
101
|
export * from './rewindArchiveCapability.js';
|
|
102
|
+
export * from './rewindEngineAction.js';
|
|
97
103
|
export * from './fileHistoryCaptureCapability.js';
|
|
98
104
|
export { FILE_HISTORY_LEG_VERDICTS, fileHistoryLegNoticeVerdict, fileHistoryLegNoticeSentence, fileHistoryDeclarationOfBody, createFileHistoryDeclarationLedger, } from './fileHistoryLegNotice.js';
|
|
99
105
|
export * from './callerCwdCapability.js';
|
|
@@ -102,6 +108,7 @@ export * from './sealedKeyCapability.js';
|
|
|
102
108
|
export * from './storePostureCapability.js';
|
|
103
109
|
export * from './centerWiringCapability.js';
|
|
104
110
|
export * from './registryQuotaUsage.js';
|
|
111
|
+
export * from './engineDirectory.js';
|
|
105
112
|
export * from './selfOrchestrationWireCaps.js';
|
|
106
113
|
export * from './skillsWireCaps.js';
|
|
107
114
|
export * from './ultracodeWireCaps.js';
|
|
@@ -111,6 +118,7 @@ export * from './liveModelCatalog.js';
|
|
|
111
118
|
export * from './modelBudgetRule.js';
|
|
112
119
|
export * from './modelIdentityResolvability.js';
|
|
113
120
|
export * from './sessionModelLatch.js';
|
|
121
|
+
export * from './modelSwitchFallback.js';
|
|
114
122
|
export * from './effortWire.js';
|
|
115
123
|
export * from './adapter/types.js';
|
|
116
124
|
export * from './adapter/downstream/turnUsageToModelUsage.js';
|
|
@@ -122,7 +130,7 @@ export * from './adapter/activeRunSelfHeal.js';
|
|
|
122
130
|
export * from './request/taskRequest.js';
|
|
123
131
|
export { disableSkillsDeclaration, disableSkillsDeclarationSettled } from './disableSkillsWire.js';
|
|
124
132
|
export { approvalReachDeclaration, approvalReachDeclarationSettled } from './approvalReachWire.js';
|
|
125
|
-
export { PERMISSIONS_KEPT_REASONS, WIRE_RULE_TRUST_ORDER, permissionsDeclaration, permissionsDeclarationReport } from './permissionsDeclaration.js';
|
|
133
|
+
export { PERMISSIONS_KEPT_REASONS, WIRE_RULE_TRUST_ORDER, permissionsAllowKeptNotice, permissionsDeclaration, permissionsDeclarationReport } from './permissionsDeclaration.js';
|
|
126
134
|
export * from './clientSlice.js';
|
|
127
135
|
export * from './host.js';
|
|
128
136
|
export { abortableSleep } from './abortableSleep.js';
|
|
@@ -137,8 +145,9 @@ export * from './limitsWire.js';
|
|
|
137
145
|
export * from './interactiveToolsWire.js';
|
|
138
146
|
export * from './headlessPermissionModeWire.js';
|
|
139
147
|
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,
|
|
148
|
+
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
149
|
export * from './fleet/fleetLedger.js';
|
|
150
|
+
export * from './fleet/bgSubagentRow.js';
|
|
142
151
|
export * from './fleet/workflowSizeWarning.js';
|
|
143
152
|
export * from './subagent/engineDelegatedPrompt.js';
|
|
144
153
|
export * from './subagent/engineRowStopGate.js';
|
|
@@ -158,16 +167,15 @@ export * from './corruptSession.js';
|
|
|
158
167
|
export * from './corruptSessionCopy.js';
|
|
159
168
|
export { classifyToolHistoryMismatch, readToolHistoryMismatchKey, resolveToolHistoryRewindTarget } from './toolHistoryMismatch.js';
|
|
160
169
|
export { toolHistoryBadTurnSentence } from './toolHistoryBadTurn.js';
|
|
161
|
-
export { classifyRegistryConflict, isScopeGoneError } from './registryConflict.js';
|
|
162
170
|
export { deviceFlowPollingPlan } from './deviceFlowPolling.js';
|
|
163
171
|
export { createPromptDeliveryLedger, promptKnownUndelivered, withoutUndeliveredPrompts } from './promptDelivery.js';
|
|
164
172
|
export { mintUserAttachmentEnvelope } from './userAttachmentEnvelope.js';
|
|
165
173
|
export { encodeHumanTurn, deliveredUuidsOf } from './humanTurn.js';
|
|
166
|
-
export { noteEngineCapsForAttachmentSeat, observedAttachmentSeat,
|
|
174
|
+
export { noteEngineCapsForAttachmentSeat, observedAttachmentSeat, __resetAttachmentSeatReadingsForTests, } from './attachmentSeatCapability.js';
|
|
167
175
|
export * from './resumeRefusalCopy.js';
|
|
168
176
|
export * from './wireRefusalCopy.js';
|
|
169
177
|
export * from './inheritEnvWire.js';
|
|
170
|
-
export { SUPPORT_FLOOR, supportFloorOf, engineVersionTier, coreVersionTier } from './supportFloor.js';
|
|
178
|
+
export { SUPPORT_FLOOR, supportFloorOf, engineVersionTier, engineSupportFloorEffective, coreVersionTier } from './supportFloor.js';
|
|
171
179
|
export * from './decideReceipt.js';
|
|
172
180
|
export * from './sessionMap.js';
|
|
173
181
|
export * from './detachWire.js';
|
|
@@ -186,8 +194,9 @@ export { __setDecideTimeoutRetryBudgetForTests, backendDeny, DecideTransportRetr
|
|
|
186
194
|
export * from './hitl/suspendedReopen.js';
|
|
187
195
|
export * from './hitl/approvalOutcomeNote.js';
|
|
188
196
|
export * from './hitl/approvalResolution.js';
|
|
189
|
-
export {
|
|
190
|
-
export {
|
|
197
|
+
export { ENGINE_ABORT_TOOL_RESULT } from './hitl/frameRouter.js';
|
|
198
|
+
export { toolEndOutputText } from './toolResultContent.js';
|
|
199
|
+
export { _resetHitlHostSurfaceForTest, APPROVAL_PARKING_WARN_TEXT, CANCEL_DENY_BUDGET_MS, CANCEL_DENY_WARN_TEXT, EDIT_NOT_FORWARDED_WARN_TEXT, EDIT_REFUSED_ON_BLIND_ASK_WARN_TEXT, hitlHostSurfaceFor, hitlHostSurfaceMisses, hitlHostSurfaceMissesFor, installHitlHostSurface, installHitlHostSurfaceFor, observeCancelByDeny, REMEMBER_NOT_APPLIED_WARN_TEXT, REPLAYED_APPROVAL_LIST_UNREADABLE_WARN_TEXT, RULE_NOT_SENT_REJECTED_WARN_TEXT, RULE_NOT_SENT_WARN_TEXT, surfaceEditRefusedOnBlindAsk, surfaceForCurrentSession, surfaceRememberNotApplied, } from './hitl/hitlHostSurface.js';
|
|
191
200
|
export * from './hitl/toolApprovalWire.js';
|
|
192
201
|
export * from './hitl/editedRuleTextPrecheck.js';
|
|
193
202
|
export * from './coreValuePorts.js';
|
|
@@ -206,15 +215,22 @@ export * from './hitl/sessionPolicyWire.js';
|
|
|
206
215
|
export * from './hitl/sessionPolicyDeliverable.js';
|
|
207
216
|
export * from './hitl/approvalsFeed.js';
|
|
208
217
|
export * from './hitl/livePendingAsk.js';
|
|
209
|
-
export { replayedApprovalDisposition } from './hitl/replayedApproval.js';
|
|
218
|
+
export { replayedApprovalClosesCardFrame, replayedApprovalDisposition, replayedApprovalSentence } from './hitl/replayedApproval.js';
|
|
219
|
+
export { hasLedgerPositionKey } from './hitl/gateLedger.js';
|
|
210
220
|
export { MODE_ARBITRATION, automaticAnswerVerdict, mandatedApprovalDetailOf, permissionRequestHookScope, } from './hitl/automaticAnswerVerdict.js';
|
|
211
|
-
export {
|
|
221
|
+
export { standingRowsOf, } from './hitl/standingRows.js';
|
|
222
|
+
export { classifyDecisionRefusal, liveAskPendingReading, decisionRefusalClosesOut, undeliverableDecisionContent, decisionRefusalAskReading, } from './hitl/decisionRefusal.js';
|
|
212
223
|
export { noAllowCauseOf } from './hitl/noAllowCause.js';
|
|
213
224
|
export { policyDenyReason } from './hitl/frameRouter.js';
|
|
214
|
-
export { readApprovalAllowRuleShadow, approvalAllowRuleShadowed, } from './hitl/allowRuleShadow.js';
|
|
225
|
+
export { readApprovalAllowRuleShadow, approvalAllowRuleShadowed, allowRuleShadowSentence, } from './hitl/allowRuleShadow.js';
|
|
215
226
|
export { projectCrashConverged } from './hitl/crashConverged.js';
|
|
216
227
|
export * from './hitl/crashConvergedNotice.js';
|
|
228
|
+
export { approvalCompleteParked } from './hitl/approvalCompleteParked.js';
|
|
229
|
+
export { approvalCompleteCauseOf } from './hitl/approvalEndingCause.js';
|
|
217
230
|
export * from './interactiveHalt.js';
|
|
231
|
+
export { fireInteractiveInterrupt } from './interactiveInterrupt.js';
|
|
232
|
+
export { listDevices, readSessionBinding, rebindSession, reconcileRebindOutcome, rebindProvesRequestNotApplied } from './deviceRebind.js';
|
|
233
|
+
export { resolveEngineEnvSourcing, engineEnvView } from './engineEnvSourcing.js';
|
|
218
234
|
export * from './compensations.js';
|
|
219
235
|
export * from './request/printNotification.js';
|
|
220
236
|
export * from './seatContract.js';
|
|
@@ -235,3 +251,8 @@ export * from './env/localeGeo.js';
|
|
|
235
251
|
export * from './env/localeTag.js';
|
|
236
252
|
export * from './env/uiLanguage.js';
|
|
237
253
|
export * from './ruleRemovalConsequence.js';
|
|
254
|
+
export { engineCredentialRequirementOf } from './engineCredentialRequirement.js';
|
|
255
|
+
export { credentialProvenance, CREDENTIAL_ATTACH_WORDS } from './credentialProvenance.js';
|
|
256
|
+
export { isSessionIdPathSegment } from './sessionIdSegment.js';
|
|
257
|
+
export { cutForDisplay, noticePresentationFacts, NOTICE_SEAT_CLASS, noticeSeatClassOf, OUTLET_KINDS, outletReachable, planOutletRendering, NOTICE_FULL_TEXT_CAP, noticePrintLine, } from './noticePresentation.js';
|
|
258
|
+
export { printPermissionOutcomeOf, PRINT_PERMISSION_OUTCOME_FORMS } from './printPermissionOutcome.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 {};
|