@sema-agent/client-core 0.93.1 → 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 +554 -0
- package/README.md +89 -55
- package/dist/adapt/arms.js +13 -11
- 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 +13 -6
- 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 +5 -3
- package/dist/agentsWireCaps.d.ts +17 -0
- package/dist/agentsWireCaps.js +111 -1
- package/dist/approvalDecidedByCapability.d.ts +0 -1
- package/dist/approvalDecidedByCapability.js +2 -7
- package/dist/approvalReachWire.d.ts +18 -0
- package/dist/approvalReachWire.js +58 -0
- package/dist/approvalsStreamLiveCapability.d.ts +0 -1
- package/dist/approvalsStreamLiveCapability.js +15 -14
- 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 +15 -0
- package/dist/callerCwdCapability.js +42 -0
- 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/controlRouter.js +3 -10
- package/dist/coreValuePorts.d.ts +64 -1
- package/dist/coreValuePorts.js +30 -0
- 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/detachWire.d.ts +1 -4
- package/dist/detachWire.js +1 -1
- package/dist/deviceExecutorManagementCapability.d.ts +0 -1
- package/dist/deviceExecutorManagementCapability.js +36 -40
- package/dist/deviceFlowPolling.d.ts +5 -0
- package/dist/deviceFlowPolling.js +28 -0
- package/dist/deviceRebind.d.ts +88 -0
- package/dist/deviceRebind.js +242 -0
- package/dist/displayUntrusted.d.ts +1 -0
- package/dist/displayUntrusted.js +963 -30
- 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 +19 -4
- package/dist/engineErrorCodes.js +39 -21
- package/dist/engineIdentity.js +2 -0
- package/dist/engineNoticeCodes.d.ts +22 -2
- package/dist/engineNoticeCodes.js +73 -6
- package/dist/engineRefusedToolName.d.ts +1 -0
- package/dist/engineRefusedToolName.js +8 -0
- package/dist/engineWireSdk.js +2 -2
- package/dist/executionLaneCapability.d.ts +2 -3
- package/dist/executionLaneCapability.js +28 -28
- package/dist/fileHistoryCaptureCapability.d.ts +0 -1
- package/dist/fileHistoryCaptureCapability.js +13 -12
- package/dist/fileHistoryLegNotice.d.ts +14 -2
- package/dist/fileHistoryLegNotice.js +101 -15
- package/dist/fleet/fleetLedger.d.ts +2 -0
- package/dist/fleet/fleetLedger.js +74 -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.d.ts +2 -1
- package/dist/gateOutcome.js +33 -18
- package/dist/gateVocabulary.js +1 -1
- package/dist/generated/engineAskFaceTables.d.ts +3 -0
- package/dist/generated/engineAskFaceTables.js +12 -0
- package/dist/generated/engineFactTables.d.ts +4 -2
- package/dist/generated/engineFactTables.js +13 -0
- package/dist/generated/engineNoticeTables.d.ts +5 -0
- package/dist/generated/engineNoticeTables.js +7 -0
- package/dist/generated/sdkFactTables.d.ts +5 -0
- package/dist/generated/sdkFactTables.js +34 -0
- package/dist/generated/settingsSchemaFns.d.ts +10 -0
- package/dist/generated/settingsSchemaFns.js +22 -0
- package/dist/generated/settingsSchemaTables.d.ts +3 -0
- package/dist/generated/settingsSchemaTables.js +3 -0
- package/dist/headlessPermissionModeWire.d.ts +2 -2
- package/dist/headlessPermissionModeWire.js +11 -21
- 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 +46 -0
- package/dist/hitl/approvalHolds.js +140 -0
- package/dist/hitl/approvalOutcomeNote.js +2 -1
- package/dist/hitl/approvalResolution.js +9 -1
- package/dist/hitl/approvalsFeed.js +23 -6
- package/dist/hitl/askGateWire.d.ts +2 -1
- package/dist/hitl/askGateWire.js +29 -1
- package/dist/hitl/automaticAnswerVerdict.d.ts +8 -2
- package/dist/hitl/automaticAnswerVerdict.js +71 -23
- 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 +23 -0
- package/dist/hitl/decisionRefusal.js +88 -0
- package/dist/hitl/frameRouter.d.ts +10 -0
- package/dist/hitl/frameRouter.js +71 -32
- package/dist/hitl/gateLedger.d.ts +8 -0
- package/dist/hitl/gateLedger.js +38 -0
- package/dist/hitl/hitlBridge.d.ts +14 -3
- package/dist/hitl/hitlBridge.js +75 -62
- package/dist/hitl/hitlHostSurface.d.ts +3 -0
- package/dist/hitl/hitlHostSurface.js +17 -15
- package/dist/hitl/livePendingAsk.d.ts +16 -6
- package/dist/hitl/livePendingAsk.js +36 -4
- package/dist/hitl/localAllowRule.js +2 -1
- package/dist/hitl/noAllowCause.d.ts +9 -0
- package/dist/hitl/noAllowCause.js +26 -0
- 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 +55 -28
- package/dist/hitl/parkRowBirthWait.js +2 -1
- package/dist/hitl/persistedRulesWire.d.ts +6 -1
- package/dist/hitl/persistedRulesWire.js +16 -4
- package/dist/hitl/planReviewWire.d.ts +2 -3
- package/dist/hitl/planReviewWire.js +86 -39
- 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/sessionPolicyDeliverable.d.ts +1 -1
- package/dist/hitl/sessionPolicyDeliverable.js +3 -8
- package/dist/hitl/sessionPolicyWire.js +1 -1
- package/dist/hitl/toolApprovalWire.d.ts +50 -5
- package/dist/hitl/toolApprovalWire.js +368 -56
- 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/humanTurnRead.d.ts +15 -1
- package/dist/humanTurnRead.js +28 -2
- package/dist/index.d.ts +45 -14
- package/dist/index.js +33 -12
- package/dist/interactiveInterrupt.d.ts +8 -0
- package/dist/interactiveInterrupt.js +54 -0
- package/dist/limitsWire.d.ts +5 -1
- package/dist/limitsWire.js +51 -13
- package/dist/liveModelCatalog.d.ts +109 -0
- package/dist/liveModelCatalog.js +344 -18
- 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 +13 -12
- package/dist/mcpReconnect.d.ts +1 -3
- package/dist/mcpReconnect.js +20 -10
- package/dist/memoryComplianceCapability.d.ts +0 -1
- package/dist/memoryComplianceCapability.js +14 -13
- package/dist/memoryOriginCapability.d.ts +0 -1
- package/dist/memoryOriginCapability.js +14 -13
- 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 +4 -2
- package/dist/modelIdentityResolvability.js +25 -5
- package/dist/modelSwitchFallback.d.ts +69 -0
- package/dist/modelSwitchFallback.js +206 -0
- package/dist/notifications.js +12 -11
- package/dist/outputStyleSeatCapability.d.ts +15 -0
- package/dist/outputStyleSeatCapability.js +42 -0
- package/dist/ownKey.d.ts +7 -0
- package/dist/ownKey.js +58 -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 +15 -14
- package/dist/permissionModesCapability.d.ts +0 -1
- package/dist/permissionModesCapability.js +5 -10
- package/dist/permissionRuleIssue.js +1 -1
- package/dist/permissionRulesWriteCapability.d.ts +0 -1
- package/dist/permissionRulesWriteCapability.js +15 -14
- package/dist/permissionsAllowGrantCapability.d.ts +2 -1
- package/dist/permissionsAllowGrantCapability.js +35 -19
- package/dist/permissionsDeclaration.d.ts +16 -1
- package/dist/permissionsDeclaration.js +142 -15
- package/dist/printToolResultFrame.js +2 -10
- package/dist/promptDelivery.js +0 -8
- package/dist/protocolSegment.d.ts +1 -0
- package/dist/protocolSegment.js +13 -1
- package/dist/request/taskRequest.d.ts +11 -3
- package/dist/request/taskRequest.js +13 -1
- package/dist/resultFrameKeys.d.ts +4 -0
- package/dist/resultFrameKeys.js +13 -0
- package/dist/resumeRefusalCopy.d.ts +18 -1
- package/dist/resumeRefusalCopy.js +132 -31
- package/dist/retryStatus.js +6 -4
- package/dist/rewindArchiveCapability.d.ts +2 -1
- package/dist/rewindArchiveCapability.js +28 -15
- 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/{hitl/rosterMountedNames.d.ts → rosterMountedNames.d.ts} +1 -1
- package/dist/runCancelContext.js +2 -1
- 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 +19 -20
- package/dist/seatContract.d.ts +85 -28
- package/dist/seatContract.js +512 -148
- 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 +14 -13
- package/dist/sessionReadRedactionCapability.d.ts +15 -0
- package/dist/sessionReadRedactionCapability.js +42 -0
- package/dist/sessionSyncFileHistoryCapability.d.ts +0 -1
- package/dist/sessionSyncFileHistoryCapability.js +13 -12
- package/dist/skillToolListsCapability.d.ts +0 -1
- package/dist/skillToolListsCapability.js +13 -12
- package/dist/skillsWireCaps.d.ts +4 -0
- package/dist/skillsWireCaps.js +66 -1
- package/dist/sqlEngineCapability.d.ts +0 -1
- package/dist/sqlEngineCapability.js +21 -21
- package/dist/steerPriorityCapability.d.ts +0 -1
- package/dist/steerPriorityCapability.js +18 -19
- 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/agentStateDetail.d.ts +1 -0
- package/dist/subagent/agentStateDetail.js +41 -0
- package/dist/subagent/engineCompactWire.d.ts +15 -0
- package/dist/subagent/engineCompactWire.js +82 -45
- 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/taskRequestWords.d.ts +2 -4
- package/dist/taskRequestWords.js +3 -2
- 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/userAttachmentEnvelope.d.ts +22 -1
- package/dist/userAttachmentEnvelope.js +90 -2
- package/dist/userInvokedSkillsCapability.d.ts +0 -1
- package/dist/userInvokedSkillsCapability.js +13 -12
- package/dist/webSearchBackendCapability.d.ts +0 -1
- package/dist/webSearchBackendCapability.js +20 -19
- package/dist/webSearchWireCaps.js +3 -11
- package/dist/wireErrorTriage.d.ts +11 -0
- package/dist/wireErrorTriage.js +35 -0
- package/dist/wireFailureShape.d.ts +10 -0
- package/dist/wireFailureShape.js +72 -5
- package/dist/wireRefusalCopy.d.ts +6 -1
- package/dist/wireRefusalCopy.js +23 -25
- package/dist/wiringInstructionsAttribution.d.ts +10 -0
- package/dist/wiringInstructionsAttribution.js +67 -0
- package/dist/workflowClient.js +19 -2
- package/dist/workflowsJournalCapability.d.ts +0 -1
- package/dist/workflowsJournalCapability.js +13 -12
- package/dist/writeProtectionCapability.d.ts +0 -1
- package/dist/writeProtectionCapability.js +26 -26
- package/docs/INTEGRATION-CLIENTS.md +1733 -52
- package/package.json +5 -5
- package/dist/askSurvivesStandingAnswer.d.ts +0 -13
- package/dist/askSurvivesStandingAnswer.js +0 -53
- package/dist/engineCapsGenerationGuard.d.ts +0 -4
- package/dist/engineCapsGenerationGuard.js +0 -19
- package/dist/hitl/askSurvivesPosture.d.ts +0 -20
- package/dist/hitl/askSurvivesPosture.js +0 -48
- 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/{hitl/rosterMountedNames.js → rosterMountedNames.js} +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { MCP_CAPS } from './mcpWireCaps.js';
|
|
2
2
|
import { toCappedSpec } from './skillsWireCaps.js';
|
|
3
3
|
import { TIER_ORDER } from './model/tierVocabulary.js';
|
|
4
|
+
import { SETTINGS_NARROW_AT_MENTION } from './generated/settingsSchemaFns.js';
|
|
5
|
+
import { modelsPolicyOf } from './model/modelsPolicy.js';
|
|
4
6
|
import { SETTINGS_BUDGET_NUMBER_KEYS, SETTINGS_BUDGET_PER_MODEL_NUMBER_KEYS, SETTINGS_BUDGET_STRING_KEYS, SETTINGS_TIER_GROUP_NAME_RE, } from './generated/settingsSchemaTables.js';
|
|
5
7
|
const asRec = (v) => (typeof v === 'object' && v !== null && !Array.isArray(v) ? v : undefined);
|
|
6
8
|
const asArr = (v) => (Array.isArray(v) ? v : []);
|
|
@@ -174,17 +176,26 @@ function modelsDocOf(models, opts) {
|
|
|
174
176
|
written = stripped.filter((_, i) => acceptedFlags[i]);
|
|
175
177
|
}
|
|
176
178
|
const doc = { models: written };
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
const policy = modelsPolicyOf(m);
|
|
180
|
+
if (policy.unreadable) {
|
|
181
|
+
drop({ key: 'default', reason: 'unreadable' });
|
|
182
|
+
drop({ key: 'atModelAllowlist', at: 'models', reason: 'unreadable' });
|
|
183
|
+
}
|
|
184
|
+
if (policy.defaultUnreadable)
|
|
185
|
+
drop({ key: 'default', reason: 'unreadable' });
|
|
186
|
+
const dm = policy.defaultModel;
|
|
187
|
+
if (accept && dm !== undefined) {
|
|
188
|
+
if (names.has(dm.name))
|
|
189
|
+
doc.default = dm.name;
|
|
181
190
|
else
|
|
182
|
-
drop({ key: 'default',
|
|
191
|
+
drop({ key: 'default', target: dm.name, reason: reasonOf(dm.name) });
|
|
183
192
|
}
|
|
184
193
|
const roles = asRec(m.roles);
|
|
185
194
|
if (roles) {
|
|
186
195
|
const kept = {};
|
|
187
196
|
for (const [role, t] of Object.entries(roles)) {
|
|
197
|
+
if (role === 'default' && accept && dm?.from === 'roles.default')
|
|
198
|
+
continue;
|
|
188
199
|
const tr = asRec(t);
|
|
189
200
|
const model = tr && Object.hasOwn(tr, 'model') ? tr.model : undefined;
|
|
190
201
|
if (typeof model === 'string' && !names.has(model)) {
|
|
@@ -195,19 +206,30 @@ function modelsDocOf(models, opts) {
|
|
|
195
206
|
}
|
|
196
207
|
doc.roles = kept;
|
|
197
208
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
209
|
+
const am = policy.atMention;
|
|
210
|
+
if (am?.kind === 'unreadable') {
|
|
211
|
+
drop({ key: 'atModelAllowlist', at: am.from, reason: 'unreadable' });
|
|
212
|
+
}
|
|
213
|
+
else if (am !== undefined) {
|
|
214
|
+
for (let i = 0; i < am.unreadableEntries; i += 1)
|
|
215
|
+
drop({ key: 'atModelAllowlist', reason: 'unreadable' });
|
|
216
|
+
const v = am.value;
|
|
217
|
+
if (v.mode === 'none') {
|
|
218
|
+
drop({ key: 'atModelAllowlist', at: 'atMention', reason: 'unsupported' });
|
|
205
219
|
}
|
|
206
|
-
else {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
220
|
+
else if (v.mode === 'only') {
|
|
221
|
+
const narrowed = SETTINGS_NARROW_AT_MENTION(v, names);
|
|
222
|
+
if (narrowed.mode === 'only') {
|
|
223
|
+
for (const n of v.models)
|
|
224
|
+
if (!names.has(n))
|
|
225
|
+
drop({ key: 'atModelAllowlist', target: n, reason: reasonOf(n) });
|
|
226
|
+
doc.atModelAllowlist = [...narrowed.models];
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
doc.atModelAllowlist = [...v.models];
|
|
230
|
+
for (const n of v.models)
|
|
231
|
+
issues.push({ key: 'atModelAllowlist', target: n, reason: reasonOf(n), outcome: 'kept' });
|
|
232
|
+
}
|
|
211
233
|
}
|
|
212
234
|
}
|
|
213
235
|
let groupNames;
|
|
@@ -494,8 +516,6 @@ const ENTRY_REJECTED = `is in the catalog, but its entry is one the local engine
|
|
|
494
516
|
function warningNotice(w) {
|
|
495
517
|
const where = quoted(w.domain, 'the configuration');
|
|
496
518
|
switch (w.kind) {
|
|
497
|
-
case 'hosts-grandfathered':
|
|
498
|
-
return { level: 'warn', text: `cloud config warning: host entries exceeding the current limits were skipped by the registry${listOf(w.droppedNames, w.truncatedFrom)}` };
|
|
499
519
|
case 'domain-defaulted':
|
|
500
520
|
return { level: 'warn', text: `cloud config warning: ${where} could not be read by the registry and were served as defaults — what is configured there is not in effect` };
|
|
501
521
|
case 'entry-dropped':
|
|
@@ -504,8 +524,6 @@ function warningNotice(w) {
|
|
|
504
524
|
return { level: 'warn', text: `cloud config warning: the registry dropped unrecognised keys from ${where}${listOf(w.keys, w.truncatedFrom)}` };
|
|
505
525
|
case 'unknown-keys-carried':
|
|
506
526
|
return { level: 'warn', text: `cloud config warning: ${where} carry keys the registry does not recognise, passed on as written (check the spelling)${listOf(w.keys, w.truncatedFrom)}` };
|
|
507
|
-
case 'legacy-governance-lifted':
|
|
508
|
-
return { level: 'info', text: `cloud config note: ${where} were taken from their older location${listOf(w.keys, undefined)}` };
|
|
509
527
|
case 'unread-config-file':
|
|
510
528
|
return { level: 'warn', text: `cloud config warning: a configuration file was not read by the registry${w.file === undefined ? '' : ` (${w.file}${w.why === undefined ? '' : `: ${w.why}`})`}` };
|
|
511
529
|
default:
|
|
@@ -523,6 +541,10 @@ function droppedRefNotice(d) {
|
|
|
523
541
|
case 'roles':
|
|
524
542
|
return { level: 'warn', text: `cloud config: role "${d.at ?? ''}" ${t === undefined ? 'names no readable model' : `points at model "${t}", which ${notServed}`} — the role was left out and falls back along the engine's role chain` };
|
|
525
543
|
case 'atModelAllowlist':
|
|
544
|
+
if (d.reason === 'unsupported')
|
|
545
|
+
return { level: 'warn', text: 'cloud config: the @-mention setting served to you allows no model to be @-mentioned, which the local engine\'s settings format cannot express — it was left out, so @-mentions are not restricted on the local engine' };
|
|
546
|
+
if (d.at !== undefined)
|
|
547
|
+
return { level: 'warn', text: 'cloud config: the @-mention setting served to you could not be read by this client — it was left out, so @-mentions are not restricted on the local engine' };
|
|
526
548
|
return { level: 'warn', text: `cloud config: ${t === undefined ? 'an unreadable @-mention allowlist entry' : `@-mention allowlist entry "${t}" ${notServed} and`} was left out` };
|
|
527
549
|
case 'tierGroups':
|
|
528
550
|
if (d.reason === 'duplicate')
|
package/dist/compensations.js
CHANGED
package/dist/controlRouter.js
CHANGED
|
@@ -90,12 +90,9 @@ export class ControlRouter {
|
|
|
90
90
|
return await this.client.runs.cancel(this.taskId, opts?.signal !== undefined ? { signal: opts.signal } : undefined);
|
|
91
91
|
}
|
|
92
92
|
catch (e) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
if (isCancelSuspendedConflict(e)) {
|
|
97
|
-
throw controlSafetyRefusal('cancel_lost_race', 'runs.cancel 409', 'the pending gate was decided or expired concurrently (lost CAS race); ' +
|
|
98
|
-
'check what that decision did to the run before retrying the cancel', e);
|
|
93
|
+
const conflict = cancelConflictFromError(e);
|
|
94
|
+
if (conflict !== null) {
|
|
95
|
+
throw controlSafetyRefusal(conflict.kind === 'run_not_running' ? 'cancel_run_not_running' : 'cancel_lost_race', conflict.code === undefined ? 'runs.cancel 409' : `runs.cancel 409 ${conflict.code}`, cancelConflictContent(conflict), e);
|
|
99
96
|
}
|
|
100
97
|
if (isNotFound(e)) {
|
|
101
98
|
throw controlSafetyRefusal('not_found', 'runs.cancel 404', `${CANCEL_NOT_FOUND_COPY.happened} — ${CANCEL_NOT_FOUND_COPY.nextStep}`, e);
|
|
@@ -310,10 +307,6 @@ export function steerBodyOf(input, reading) {
|
|
|
310
307
|
throw steerLocalRefusal('priority_not_applied', tierMode);
|
|
311
308
|
return Object.freeze({ ...base, priority });
|
|
312
309
|
}
|
|
313
|
-
function isCancelSuspendedConflict(e) {
|
|
314
|
-
const { name, status } = errCodes(e);
|
|
315
|
-
return name === 'ConflictError' || status === 409;
|
|
316
|
-
}
|
|
317
310
|
function isNotFound(e) {
|
|
318
311
|
const { name, status } = errCodes(e);
|
|
319
312
|
return name === 'NotFoundError' || status === 404;
|
package/dist/coreValuePorts.d.ts
CHANGED
|
@@ -48,6 +48,49 @@ export interface ValidatePermissionRulesOptionsView {
|
|
|
48
48
|
readonly [base: string]: string | undefined;
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
+
export interface AllowListReadingView {
|
|
52
|
+
readonly inert: readonly {
|
|
53
|
+
readonly entry: string;
|
|
54
|
+
readonly reason: string;
|
|
55
|
+
}[];
|
|
56
|
+
}
|
|
57
|
+
export interface RouteModelView {
|
|
58
|
+
readonly id: string;
|
|
59
|
+
readonly baseUrl: string;
|
|
60
|
+
}
|
|
61
|
+
export interface RouteCredentialInputView {
|
|
62
|
+
optionsApiKey?: string;
|
|
63
|
+
optionsHeaders?: Record<string, string>;
|
|
64
|
+
modelHeaders?: Record<string, string>;
|
|
65
|
+
configApiKey?: string;
|
|
66
|
+
configHeaders?: Record<string, string>;
|
|
67
|
+
}
|
|
68
|
+
export interface RouteCredentialView {
|
|
69
|
+
source: 'per-model' | 'deployment-config' | 'absent' | (string & {});
|
|
70
|
+
apiKey?: string;
|
|
71
|
+
headersBorne?: boolean;
|
|
72
|
+
carrierBag?: 'options' | 'model' | 'config' | (string & {});
|
|
73
|
+
}
|
|
74
|
+
export type RouteAdjudicationView = {
|
|
75
|
+
ok: true;
|
|
76
|
+
posture: 'per-model' | 'paired' | 'unpinned' | 'keyless' | (string & {});
|
|
77
|
+
} | {
|
|
78
|
+
ok: false;
|
|
79
|
+
code: 'route.credential_mismatch' | 'route.credential_missing' | (string & {});
|
|
80
|
+
detail: RouteRefusalDetailView;
|
|
81
|
+
};
|
|
82
|
+
export interface RouteRefusalDetailView {
|
|
83
|
+
modelId: string;
|
|
84
|
+
entryBaseUrl: string;
|
|
85
|
+
requestBaseUrl: string;
|
|
86
|
+
configBaseUrl?: string;
|
|
87
|
+
fixHint: string;
|
|
88
|
+
}
|
|
89
|
+
export type RoutePairingStatusView = `ok:${string}` | `broken:${string}` | 'unknown';
|
|
90
|
+
export interface PerModelAuthView {
|
|
91
|
+
apiKey?: string;
|
|
92
|
+
headers?: Record<string, string>;
|
|
93
|
+
}
|
|
51
94
|
export interface CoreValuePorts {
|
|
52
95
|
resolveAutonomousLoopPrompt: (prompt: string, opts?: AutonomousLoopPromptOptionsView) => string | null;
|
|
53
96
|
loosenReasons: (prior: SessionPermissionRules, next: SessionPermissionRules) => string[];
|
|
@@ -60,8 +103,18 @@ export interface CoreValuePorts {
|
|
|
60
103
|
validatePermissionRules: (rules: PermissionRuleView[], opts?: ValidatePermissionRulesOptionsView) => PermissionRuleIssueView[];
|
|
61
104
|
DISCUSSION_WORKFLOW_NAME: string;
|
|
62
105
|
mintNamespacePrefix(ns: CoreProtocolNamespaceView, peer: string): string;
|
|
106
|
+
compileAllowList(entries: readonly string[], behavior: 'allow' | 'deny', roster?: ReadonlySet<string>): AllowListReadingView;
|
|
107
|
+
routeKeyOf(url: string | undefined): string;
|
|
108
|
+
joinRequestUrl(root: string | undefined, suffix: string): string;
|
|
109
|
+
resolveRouteCredential(input: RouteCredentialInputView): RouteCredentialView;
|
|
110
|
+
adjudicateModelRoute(model: RouteModelView, credential: RouteCredentialView, config: {
|
|
111
|
+
baseUrl?: string;
|
|
112
|
+
}): RouteAdjudicationView;
|
|
113
|
+
routePairingStatus(brain: {
|
|
114
|
+
adjudicateRoute?(model: RouteModelView, perModelAuth?: PerModelAuthView): RouteAdjudicationView | undefined;
|
|
115
|
+
}, model: RouteModelView, perModelAuth?: PerModelAuthView): RoutePairingStatusView;
|
|
63
116
|
}
|
|
64
|
-
export declare const CORE_VALUE_PORT_NAMES: readonly ["resolveAutonomousLoopPrompt", "loosenReasons", "combinePolicies", "createAllowDenyPolicy", "MCP_NAMESPACE", "RETIRED_TOOL_NAMES", "protocolOf", "ruleToolGrammarOf", "validatePermissionRules", "DISCUSSION_WORKFLOW_NAME", "mintNamespacePrefix"];
|
|
117
|
+
export declare const CORE_VALUE_PORT_NAMES: readonly ["resolveAutonomousLoopPrompt", "loosenReasons", "combinePolicies", "createAllowDenyPolicy", "MCP_NAMESPACE", "RETIRED_TOOL_NAMES", "protocolOf", "ruleToolGrammarOf", "validatePermissionRules", "DISCUSSION_WORKFLOW_NAME", "mintNamespacePrefix", "compileAllowList", "routeKeyOf", "joinRequestUrl", "resolveRouteCredential", "adjudicateModelRoute", "routePairingStatus"];
|
|
65
118
|
export type CoreValuePortName = (typeof CORE_VALUE_PORT_NAMES)[number];
|
|
66
119
|
export declare function installCoreValuePorts(ports: Partial<CoreValuePorts> | null): () => void;
|
|
67
120
|
export declare function hasCoreValuePorts(): boolean;
|
|
@@ -78,3 +131,13 @@ export declare function ruleToolGrammarOf(toolName: string): 'command' | 'path'
|
|
|
78
131
|
export declare function validatePermissionRules(rules: PermissionRuleView[], opts?: ValidatePermissionRulesOptionsView): PermissionRuleIssueView[] | undefined;
|
|
79
132
|
export declare function discussionWorkflowName(): string | undefined;
|
|
80
133
|
export declare function mintNamespacePrefix(ns: CoreProtocolNamespaceView, peer: string): string | undefined;
|
|
134
|
+
export declare function compileAllowList(entries: readonly string[], behavior: 'allow' | 'deny', roster?: ReadonlySet<string>): AllowListReadingView | undefined;
|
|
135
|
+
export declare function routeKeyOf(url: string | undefined): string | undefined;
|
|
136
|
+
export declare function joinRequestUrl(root: string | undefined, suffix: string): string | undefined;
|
|
137
|
+
export declare function resolveRouteCredential(input: RouteCredentialInputView): RouteCredentialView | undefined;
|
|
138
|
+
export declare function adjudicateModelRoute(model: RouteModelView, credential: RouteCredentialView, config: {
|
|
139
|
+
baseUrl?: string;
|
|
140
|
+
}): RouteAdjudicationView | undefined;
|
|
141
|
+
export declare function routePairingStatus(brain: {
|
|
142
|
+
adjudicateRoute?(model: RouteModelView, perModelAuth?: PerModelAuthView): RouteAdjudicationView | undefined;
|
|
143
|
+
}, model: RouteModelView, perModelAuth?: PerModelAuthView): RoutePairingStatusView | undefined;
|
package/dist/coreValuePorts.js
CHANGED
|
@@ -10,6 +10,12 @@ export const CORE_VALUE_PORT_NAMES = Object.freeze([
|
|
|
10
10
|
'validatePermissionRules',
|
|
11
11
|
'DISCUSSION_WORKFLOW_NAME',
|
|
12
12
|
'mintNamespacePrefix',
|
|
13
|
+
'compileAllowList',
|
|
14
|
+
'routeKeyOf',
|
|
15
|
+
'joinRequestUrl',
|
|
16
|
+
'resolveRouteCredential',
|
|
17
|
+
'adjudicateModelRoute',
|
|
18
|
+
'routePairingStatus',
|
|
13
19
|
]);
|
|
14
20
|
let installed = null;
|
|
15
21
|
export function installCoreValuePorts(ports) {
|
|
@@ -72,3 +78,27 @@ export function mintNamespacePrefix(ns, peer) {
|
|
|
72
78
|
const fn = port('mintNamespacePrefix');
|
|
73
79
|
return fn === undefined ? undefined : fn(ns, peer);
|
|
74
80
|
}
|
|
81
|
+
export function compileAllowList(entries, behavior, roster) {
|
|
82
|
+
const fn = port('compileAllowList');
|
|
83
|
+
return fn === undefined ? undefined : fn(entries, behavior, roster);
|
|
84
|
+
}
|
|
85
|
+
export function routeKeyOf(url) {
|
|
86
|
+
const fn = port('routeKeyOf');
|
|
87
|
+
return fn === undefined ? undefined : fn(url);
|
|
88
|
+
}
|
|
89
|
+
export function joinRequestUrl(root, suffix) {
|
|
90
|
+
const fn = port('joinRequestUrl');
|
|
91
|
+
return fn === undefined ? undefined : fn(root, suffix);
|
|
92
|
+
}
|
|
93
|
+
export function resolveRouteCredential(input) {
|
|
94
|
+
const fn = port('resolveRouteCredential');
|
|
95
|
+
return fn === undefined ? undefined : fn(input);
|
|
96
|
+
}
|
|
97
|
+
export function adjudicateModelRoute(model, credential, config) {
|
|
98
|
+
const fn = port('adjudicateModelRoute');
|
|
99
|
+
return fn === undefined ? undefined : fn(model, credential, config);
|
|
100
|
+
}
|
|
101
|
+
export function routePairingStatus(brain, model, perModelAuth) {
|
|
102
|
+
const fn = port('routePairingStatus');
|
|
103
|
+
return fn === undefined ? undefined : fn(brain, model, perModelAuth);
|
|
104
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface EngineAgentPanelCycleIdentity {
|
|
2
|
+
readonly cycleSeq?: number;
|
|
3
|
+
readonly startedAt?: number;
|
|
4
|
+
}
|
|
5
|
+
export type CycleOrder = 'before' | 'after' | 'same' | 'unknown';
|
|
6
|
+
export declare function cycleSeqValue(v: unknown): number | undefined;
|
|
7
|
+
export declare function cycleSeqOf(v: EngineAgentPanelCycleIdentity | null | undefined): number | undefined;
|
|
8
|
+
export declare function startedAtOf(v: EngineAgentPanelCycleIdentity | null | undefined): number | undefined;
|
|
9
|
+
export declare function cycleOrder(a: EngineAgentPanelCycleIdentity | null | undefined, b: EngineAgentPanelCycleIdentity | null | undefined): CycleOrder;
|
|
10
|
+
export declare function cycleSeqOrder(a: number | undefined, b: number | undefined): CycleOrder;
|
|
11
|
+
export declare function cycleOf(v: EngineAgentPanelCycleIdentity | null | undefined): EngineAgentPanelCycleIdentity;
|
|
12
|
+
export declare function cycleEmpty(v: EngineAgentPanelCycleIdentity | null | undefined): boolean;
|
|
13
|
+
export declare function cycleKeysChanged(prev: EngineAgentPanelCycleIdentity | null | undefined, next: EngineAgentPanelCycleIdentity | null | undefined): boolean;
|
|
14
|
+
export declare function carryCycle(frame: EngineAgentPanelCycleIdentity, prev: EngineAgentPanelCycleIdentity | undefined, carry: boolean): EngineAgentPanelCycleIdentity;
|
|
15
|
+
export declare function mergeCycle(prefer: EngineAgentPanelCycleIdentity, fallback: EngineAgentPanelCycleIdentity | undefined): EngineAgentPanelCycleIdentity;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export function cycleSeqValue(v) {
|
|
2
|
+
return typeof v === 'number' && Number.isInteger(v) && v >= 1 ? v : undefined;
|
|
3
|
+
}
|
|
4
|
+
export function cycleSeqOf(v) {
|
|
5
|
+
return cycleSeqValue(v?.cycleSeq);
|
|
6
|
+
}
|
|
7
|
+
export function startedAtOf(v) {
|
|
8
|
+
const n = v?.startedAt;
|
|
9
|
+
return typeof n === 'number' && Number.isFinite(n) && n > 0 ? n : undefined;
|
|
10
|
+
}
|
|
11
|
+
export function cycleOrder(a, b) {
|
|
12
|
+
const ac = cycleSeqOf(a);
|
|
13
|
+
const bc = cycleSeqOf(b);
|
|
14
|
+
if (ac !== undefined && bc !== undefined)
|
|
15
|
+
return ac < bc ? 'before' : ac > bc ? 'after' : 'same';
|
|
16
|
+
const as = startedAtOf(a);
|
|
17
|
+
const bs = startedAtOf(b);
|
|
18
|
+
if (as !== undefined && bs !== undefined)
|
|
19
|
+
return as < bs ? 'before' : as > bs ? 'after' : 'same';
|
|
20
|
+
return 'unknown';
|
|
21
|
+
}
|
|
22
|
+
export function cycleSeqOrder(a, b) {
|
|
23
|
+
return cycleOrder(a === undefined ? undefined : { cycleSeq: a }, b === undefined ? undefined : { cycleSeq: b });
|
|
24
|
+
}
|
|
25
|
+
export function cycleOf(v) {
|
|
26
|
+
const c = cycleSeqOf(v);
|
|
27
|
+
const s = startedAtOf(v);
|
|
28
|
+
return { ...(c !== undefined ? { cycleSeq: c } : {}), ...(s !== undefined ? { startedAt: s } : {}) };
|
|
29
|
+
}
|
|
30
|
+
export function cycleEmpty(v) {
|
|
31
|
+
return cycleSeqOf(v) === undefined && startedAtOf(v) === undefined;
|
|
32
|
+
}
|
|
33
|
+
export function cycleKeysChanged(prev, next) {
|
|
34
|
+
const nc = cycleSeqOf(next);
|
|
35
|
+
const ns = startedAtOf(next);
|
|
36
|
+
return (nc !== undefined && nc !== cycleSeqOf(prev)) || (ns !== undefined && ns !== startedAtOf(prev));
|
|
37
|
+
}
|
|
38
|
+
export function carryCycle(frame, prev, carry) {
|
|
39
|
+
const c = cycleSeqOf(frame) ?? (carry ? cycleSeqOf(prev) : undefined);
|
|
40
|
+
const s = startedAtOf(frame) ?? (carry ? startedAtOf(prev) : undefined);
|
|
41
|
+
return { ...(c !== undefined ? { cycleSeq: c } : {}), ...(s !== undefined ? { startedAt: s } : {}) };
|
|
42
|
+
}
|
|
43
|
+
export function mergeCycle(prefer, fallback) {
|
|
44
|
+
return carryCycle(prefer, fallback, true);
|
|
45
|
+
}
|
|
@@ -2,6 +2,7 @@ import { corruptStoredRowContent, corruptStoredRowWhere } from './wireErrorTriag
|
|
|
2
2
|
import { checkpointUnsupportedVersionContent, checkpointUnsupportedVersionFromError, parkedResumeStartupContent, parkedResumeStartupFromError, resumePolicyBlockContent, resumePolicyBlockFromError, } from './resumeRefusalCopy.js';
|
|
3
3
|
import { askGoneContent, askGoneFromError, decideParkMovedContent, decideParkMovedFromError } from './decideReceipt.js';
|
|
4
4
|
import { settingsPermissionBucketRefusalContent, settingsPermissionBucketRefusalFromError } from './wireRefusalCopy.js';
|
|
5
|
+
import { DECISION_ANSWER_INVALID_CONTENT, decisionConflictOf } from './hitl/decisionConflict.js';
|
|
5
6
|
export function decideFailureNote(err, decision) {
|
|
6
7
|
const where = corruptStoredRowWhere(err);
|
|
7
8
|
const fold = resumePolicyBlockFromError(err);
|
|
@@ -10,11 +11,13 @@ export function decideFailureNote(err, decision) {
|
|
|
10
11
|
const bucket = settingsPermissionBucketRefusalFromError(err);
|
|
11
12
|
const unsupported = checkpointUnsupportedVersionFromError(err);
|
|
12
13
|
const gone = askGoneFromError(err);
|
|
14
|
+
const answerInvalid = decisionConflictOf(err) === 'answer_invalid';
|
|
13
15
|
return ((where === undefined ? '' : ` — ${corruptStoredRowContent(where)}`) +
|
|
14
16
|
(fold === null ? '' : ` — ${resumePolicyBlockContent(fold)}`) +
|
|
15
17
|
(bucket === null ? '' : ` — ${settingsPermissionBucketRefusalContent(bucket)}`) +
|
|
16
18
|
(startup === null ? '' : ` — ${parkedResumeStartupContent(startup)}`) +
|
|
17
19
|
(moved === null ? '' : ` — ${decideParkMovedContent(moved)}`) +
|
|
18
20
|
(unsupported === null ? '' : ` — ${checkpointUnsupportedVersionContent(unsupported)}`) +
|
|
19
|
-
(gone === null ? '' : ` — ${askGoneContent(gone)}`)
|
|
21
|
+
(gone === null ? '' : ` — ${askGoneContent(gone)}`) +
|
|
22
|
+
(answerInvalid ? ` — ${DECISION_ANSWER_INVALID_CONTENT}` : ''));
|
|
20
23
|
}
|
package/dist/decideReceipt.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type GateOutcomeView } from './gateOutcome.js';
|
|
2
2
|
import { type ResumeReopenDetail } from './hitl/suspendedReopen.js';
|
|
3
3
|
import { type CrashConvergedRow } from './hitl/crashConverged.js';
|
|
4
|
+
import type { AskRowEndingCause } from '@sema-agent/sdk';
|
|
4
5
|
export interface DecideReceiptView {
|
|
5
6
|
status?: string;
|
|
6
7
|
taskId?: string;
|
|
@@ -33,7 +34,7 @@ export declare function decideParkMovedContent(detail: Pick<DecideParkMovedDetai
|
|
|
33
34
|
export interface AskGoneDetail {
|
|
34
35
|
code: 'gone.ask';
|
|
35
36
|
state?: 'VOID' | 'DENIED';
|
|
36
|
-
|
|
37
|
+
endingCause?: AskRowEndingCause;
|
|
37
38
|
holderGone?: CrashConvergedRow['cause'];
|
|
38
39
|
}
|
|
39
40
|
export declare function askGoneFromError(e: unknown): AskGoneDetail | null;
|
package/dist/decideReceipt.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { gateOutcomeOf } from './gateOutcome.js';
|
|
2
2
|
import { resumeReopenFromError } from './hitl/suspendedReopen.js';
|
|
3
|
-
import { ASK_GONE,
|
|
3
|
+
import { ASK_GONE, DECIDE_CLAIM_LOST, DECIDE_GATE_MOVED, DECIDE_NOT_PARKED, DECIDE_WORKFLOW_HOST_UNKNOWN, DECIDE_WORKFLOW_LANE_CODES, DECIDE_WORKFLOW_PARK_FORKED, DECIDE_WORKFLOW_PARKS_UNREADABLE, DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED, isDecideParkMovedCode, } from './engineErrorCodes.js';
|
|
4
4
|
import { effectiveWireErrorCode } from './wireErrorTriage.js';
|
|
5
5
|
import { readErrorString, readErrorStrictStringList } from './wireFailureShape.js';
|
|
6
6
|
import { isCrashConvergedCause } from './hitl/crashConverged.js';
|
|
7
|
+
import { askRowEndingCauseFor } from './hitl/approvalEndingCause.js';
|
|
7
8
|
const STATUS_RESUMING = 'resuming';
|
|
8
9
|
function str(v) {
|
|
9
10
|
return typeof v === 'string' && v.length > 0 ? v : undefined;
|
|
@@ -132,6 +133,38 @@ export function decideParkMovedContent(detail) {
|
|
|
132
133
|
const extra = code === DECIDE_CLAIM_LOST ? '; if this approval is still listed, wait a little before deciding it again' : '';
|
|
133
134
|
return `${what} · This decision was not applied — fetch the pending approvals again and decide from what is pending now${extra}`;
|
|
134
135
|
}
|
|
136
|
+
function askGoneRawCause(e) {
|
|
137
|
+
let top;
|
|
138
|
+
try {
|
|
139
|
+
top = e.endingCause;
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
top = undefined;
|
|
143
|
+
}
|
|
144
|
+
if (typeof top === 'string')
|
|
145
|
+
return top;
|
|
146
|
+
let extra;
|
|
147
|
+
try {
|
|
148
|
+
extra = e.extra;
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
extra = undefined;
|
|
152
|
+
}
|
|
153
|
+
if (typeof extra === 'object' && extra !== null && !Array.isArray(extra)) {
|
|
154
|
+
let hasCause = false;
|
|
155
|
+
let word;
|
|
156
|
+
try {
|
|
157
|
+
hasCause = Object.hasOwn(extra, 'cause');
|
|
158
|
+
word = hasCause ? extra.cause : undefined;
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
return undefined;
|
|
162
|
+
}
|
|
163
|
+
if (hasCause)
|
|
164
|
+
return word;
|
|
165
|
+
}
|
|
166
|
+
return readErrorString(e, 'deniedReason');
|
|
167
|
+
}
|
|
135
168
|
export function askGoneFromError(e) {
|
|
136
169
|
if (typeof e !== 'object' || e === null)
|
|
137
170
|
return null;
|
|
@@ -139,37 +172,32 @@ export function askGoneFromError(e) {
|
|
|
139
172
|
return null;
|
|
140
173
|
const rawState = readErrorString(e, 'state');
|
|
141
174
|
const state = rawState === 'VOID' || rawState === 'DENIED' ? rawState : undefined;
|
|
142
|
-
const
|
|
143
|
-
const
|
|
144
|
-
? undefined
|
|
145
|
-
: state === 'DENIED'
|
|
146
|
-
? rawReason === ASK_GONE_DENIED_WORD ? rawReason : undefined
|
|
147
|
-
: state === 'VOID' ? rawReason : undefined;
|
|
148
|
-
const holderGone = state === 'VOID' && isCrashConvergedCause(deniedReason) ? deniedReason : undefined;
|
|
175
|
+
const endingCause = askRowEndingCauseFor(state, askGoneRawCause(e));
|
|
176
|
+
const holderGone = state === 'VOID' && isCrashConvergedCause(endingCause) ? endingCause : undefined;
|
|
149
177
|
return {
|
|
150
178
|
code: ASK_GONE,
|
|
151
179
|
...(state !== undefined ? { state } : {}),
|
|
152
|
-
...(
|
|
180
|
+
...(endingCause !== undefined ? { endingCause } : {}),
|
|
153
181
|
...(holderGone !== undefined ? { holderGone } : {}),
|
|
154
182
|
};
|
|
155
183
|
}
|
|
156
184
|
export function askGoneContent(detail) {
|
|
157
185
|
let state;
|
|
158
|
-
let
|
|
186
|
+
let endingCause;
|
|
159
187
|
let holderGone;
|
|
160
188
|
try {
|
|
161
189
|
state = detail.state;
|
|
162
|
-
|
|
190
|
+
endingCause = detail.endingCause;
|
|
163
191
|
holderGone = detail.holderGone;
|
|
164
192
|
}
|
|
165
193
|
catch {
|
|
166
194
|
state = undefined;
|
|
167
|
-
|
|
195
|
+
endingCause = undefined;
|
|
168
196
|
holderGone = undefined;
|
|
169
197
|
}
|
|
170
198
|
const st = state === 'VOID' || state === 'DENIED' ? state : undefined;
|
|
171
199
|
const safety = 'Your answer was not applied and nothing was run on it';
|
|
172
|
-
if (st === 'VOID' && (isCrashConvergedCause(holderGone) || isCrashConvergedCause(
|
|
200
|
+
if (st === 'VOID' && (isCrashConvergedCause(holderGone) || isCrashConvergedCause(endingCause))) {
|
|
173
201
|
return [
|
|
174
202
|
'The engine run that was waiting for this answer ended before the answer arrived',
|
|
175
203
|
safety,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DECLARED_SUPPORT_FLOOR: Readonly<Record<"server" | "core" | "sdk", string>>;
|
package/dist/detachWire.d.ts
CHANGED
|
@@ -10,10 +10,7 @@ export type DetachResolution = {
|
|
|
10
10
|
on: false;
|
|
11
11
|
reason: 'env-off';
|
|
12
12
|
};
|
|
13
|
-
export declare function resolveHeadlessDetach(
|
|
14
|
-
fetchImpl?: typeof fetch;
|
|
15
|
-
timeoutMs?: number;
|
|
16
|
-
}): Promise<DetachResolution>;
|
|
13
|
+
export declare function resolveHeadlessDetach(env?: EnvLike): Promise<DetachResolution>;
|
|
17
14
|
export declare const DETACH_DURABLE_OFF_400_ANCHOR = "x-detach-on-disconnect requires a durable run";
|
|
18
15
|
export declare function isDetachDurableOff400(err: unknown): boolean;
|
|
19
16
|
export declare function detachDurableOffHint(err: unknown): string | null;
|
package/dist/detachWire.js
CHANGED
|
@@ -6,7 +6,7 @@ export const HEADLESS_DETACH_ENV = 'SEMA_HEADLESS_DETACH';
|
|
|
6
6
|
export function headlessDetachDisabledByEnv(env = hostEnv()) {
|
|
7
7
|
return envFlagOff(env[HEADLESS_DETACH_ENV]);
|
|
8
8
|
}
|
|
9
|
-
export async function resolveHeadlessDetach(
|
|
9
|
+
export async function resolveHeadlessDetach(env = hostEnv()) {
|
|
10
10
|
if (headlessDetachDisabledByEnv(env))
|
|
11
11
|
return { on: false, reason: 'env-off' };
|
|
12
12
|
return { on: true, reason: 'default-on' };
|
|
@@ -20,5 +20,4 @@ export declare function observedDeviceExecutorManagement(baseUrl?: string | unde
|
|
|
20
20
|
export declare function deviceManagementVerbsAvailable(reading: DeviceExecutorManagementReading): 'yes' | 'no' | 'unknown';
|
|
21
21
|
export declare function deviceLaneOpen(reading: DeviceExecutorManagementReading): 'yes' | 'no' | 'unknown';
|
|
22
22
|
export declare function deviceExecutorManagementDoctorDetail(reading: DeviceExecutorManagementReading): string;
|
|
23
|
-
export declare function forgetDeviceExecutorManagementReading(baseUrl: string | undefined): void;
|
|
24
23
|
export declare function __resetDeviceExecutorManagementReadingsForTests(): void;
|
|
@@ -1,45 +1,44 @@
|
|
|
1
1
|
import { engineWireTarget } from './engineWireTarget.js';
|
|
2
2
|
import { createEngineCapReader } from './engineCapReader.js';
|
|
3
|
+
import { ownDataField } from './ownKey.js';
|
|
3
4
|
import { capForDisplay } from './fleetTaskDesc.js';
|
|
4
|
-
function ownRead(o, key) {
|
|
5
|
-
return Object.hasOwn(o, key) ? o[key] : undefined;
|
|
6
|
-
}
|
|
7
5
|
export function projectDeviceExecutorManagementCapability(caps) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
6
|
+
try {
|
|
7
|
+
if (caps === null || typeof caps !== 'object' || Array.isArray(caps))
|
|
8
|
+
return undefined;
|
|
9
|
+
const d = ownDataField(caps, 'deviceExecutor');
|
|
10
|
+
if (d === undefined)
|
|
11
|
+
return { kind: 'not_reported', why: 'capability_absent' };
|
|
12
|
+
if (d === false)
|
|
13
|
+
return { kind: 'lane_absent' };
|
|
14
|
+
if (d === null || typeof d !== 'object' || Array.isArray(d))
|
|
15
|
+
return undefined;
|
|
16
|
+
if (ownDataField(d, 'enabled') !== true)
|
|
17
|
+
return undefined;
|
|
18
|
+
const mgmt = ownDataField(d, 'management');
|
|
19
|
+
let management;
|
|
20
|
+
if (mgmt === undefined)
|
|
21
|
+
management = 'absent';
|
|
22
|
+
else if (mgmt === true)
|
|
23
|
+
management = 'present-true';
|
|
24
|
+
else if (mgmt === false)
|
|
25
|
+
management = 'present-false';
|
|
26
|
+
else
|
|
27
|
+
return undefined;
|
|
28
|
+
const pv = ownDataField(d, 'protocolVersion');
|
|
29
|
+
const mi = ownDataField(d, 'maxInflightPerDevice');
|
|
30
|
+
const ws = ownDataField(d, 'wsPath');
|
|
31
|
+
return {
|
|
32
|
+
kind: 'present',
|
|
33
|
+
management,
|
|
34
|
+
...(typeof pv === 'number' && Number.isFinite(pv) ? { protocolVersion: pv } : {}),
|
|
35
|
+
...(typeof mi === 'number' && Number.isFinite(mi) && mi >= 0 ? { maxInflightPerDevice: mi } : {}),
|
|
36
|
+
...(typeof ws === 'string' && ws.length > 0 ? { wsPath: ws } : {}),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
32
40
|
return undefined;
|
|
33
|
-
|
|
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
|
-
};
|
|
41
|
+
}
|
|
43
42
|
}
|
|
44
43
|
const reader = createEngineCapReader({
|
|
45
44
|
name: 'deviceExecutor.management',
|
|
@@ -103,9 +102,6 @@ export function deviceExecutorManagementDoctorDetail(reading) {
|
|
|
103
102
|
}
|
|
104
103
|
}
|
|
105
104
|
}
|
|
106
|
-
export function forgetDeviceExecutorManagementReading(baseUrl) {
|
|
107
|
-
reader.forget(baseUrl);
|
|
108
|
-
}
|
|
109
105
|
export function __resetDeviceExecutorManagementReadingsForTests() {
|
|
110
106
|
reader.__resetForTests();
|
|
111
107
|
}
|