@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
package/dist/engineCapReader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { engineCapsLandingOf } from './engineCapsCache.js';
|
|
2
|
+
import { ownDataField } from './ownKey.js';
|
|
3
3
|
function freezeReading(reading, seen = new Set()) {
|
|
4
4
|
if (reading === null || typeof reading !== 'object' || seen.has(reading))
|
|
5
5
|
return reading;
|
|
@@ -11,67 +11,54 @@ function freezeReading(reading, seen = new Set()) {
|
|
|
11
11
|
}
|
|
12
12
|
return reading;
|
|
13
13
|
}
|
|
14
|
+
const PROJECTING = Symbol('projecting');
|
|
14
15
|
export function createEngineCapReader(spec) {
|
|
15
|
-
|
|
16
|
+
let memo = new WeakMap();
|
|
16
17
|
return {
|
|
17
|
-
note(
|
|
18
|
+
note(_baseUrl, _caps, _opts) { },
|
|
19
|
+
observed(baseUrl) {
|
|
18
20
|
if (typeof baseUrl !== 'string' || baseUrl === '')
|
|
19
|
-
return;
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
return;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
return spec.makeUnobserved();
|
|
22
|
+
const landing = engineCapsLandingOf(baseUrl);
|
|
23
|
+
if (landing === undefined)
|
|
24
|
+
return spec.makeUnobserved();
|
|
25
|
+
const hit = memo.get(landing);
|
|
26
|
+
if (hit === PROJECTING)
|
|
27
|
+
return spec.makeUnobserved();
|
|
28
|
+
if (hit !== undefined)
|
|
29
|
+
return hit.reading === undefined ? spec.makeUnobserved() : hit.reading;
|
|
30
|
+
const mine = memo;
|
|
31
|
+
mine.set(landing, PROJECTING);
|
|
26
32
|
let reading;
|
|
27
33
|
try {
|
|
28
|
-
reading = spec.project(caps);
|
|
34
|
+
reading = spec.project(landing.caps);
|
|
29
35
|
}
|
|
30
36
|
catch {
|
|
31
37
|
reading = undefined;
|
|
32
38
|
}
|
|
33
|
-
if (
|
|
34
|
-
|
|
35
|
-
if (reading === undefined) {
|
|
36
|
-
cellByBase.delete(baseUrl);
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
cellByBase.set(baseUrl, { reading: freezeReading(reading), mark });
|
|
40
|
-
},
|
|
41
|
-
observed(baseUrl) {
|
|
42
|
-
if (typeof baseUrl !== 'string' || baseUrl === '')
|
|
43
|
-
return spec.makeUnobserved();
|
|
44
|
-
const cell = cellByBase.get(baseUrl);
|
|
45
|
-
if (cell === undefined)
|
|
46
|
-
return spec.makeUnobserved();
|
|
47
|
-
if (cell.mark !== capsGenerationMarkOf(baseUrl)) {
|
|
48
|
-
cellByBase.delete(baseUrl);
|
|
39
|
+
if (engineCapsLandingOf(baseUrl) !== landing) {
|
|
40
|
+
mine.delete(landing);
|
|
49
41
|
return spec.makeUnobserved();
|
|
50
42
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (typeof baseUrl !== 'string' || baseUrl === '')
|
|
55
|
-
return;
|
|
56
|
-
cellByBase.delete(baseUrl);
|
|
43
|
+
const done = { reading: reading === undefined ? undefined : freezeReading(reading) };
|
|
44
|
+
mine.set(landing, done);
|
|
45
|
+
return done.reading === undefined ? spec.makeUnobserved() : done.reading;
|
|
57
46
|
},
|
|
58
47
|
__resetForTests() {
|
|
59
|
-
|
|
48
|
+
memo = new WeakMap();
|
|
60
49
|
},
|
|
61
50
|
};
|
|
62
51
|
}
|
|
63
|
-
export function
|
|
52
|
+
export function storeSeatOf(caps) {
|
|
64
53
|
try {
|
|
65
|
-
|
|
66
|
-
return { generation: 'old', store: 'absent' };
|
|
67
|
-
const store = caps.store;
|
|
54
|
+
const store = ownDataField(caps, 'store');
|
|
68
55
|
if (store === undefined)
|
|
69
|
-
return {
|
|
56
|
+
return { kind: 'absent' };
|
|
70
57
|
if (typeof store !== 'object' || store === null || Array.isArray(store))
|
|
71
|
-
return {
|
|
72
|
-
return {
|
|
58
|
+
return { kind: 'malformed' };
|
|
59
|
+
return { kind: 'object', store };
|
|
73
60
|
}
|
|
74
61
|
catch {
|
|
75
|
-
return {
|
|
62
|
+
return { kind: 'malformed' };
|
|
76
63
|
}
|
|
77
64
|
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
export declare function engineCapsGeneration(baseUrl: string): number;
|
|
2
|
-
export declare function
|
|
3
|
-
|
|
2
|
+
export declare function engineCapsLandingOf(baseUrl: string): {
|
|
3
|
+
readonly caps: object;
|
|
4
|
+
} | undefined;
|
|
4
5
|
export declare function kickEngineCapsProbe(baseUrl: string, probe: () => Promise<unknown>): void;
|
|
5
6
|
export declare function engineCapsSettled(baseUrl: string | undefined, opts?: {
|
|
6
7
|
withinMs?: number;
|
|
7
8
|
}): Promise<'settled' | 'timed_out'>;
|
|
8
9
|
export type EngineCapState = 'true' | 'false' | 'unprobed' | 'absent' | 'non_boolean';
|
|
9
10
|
export declare function engineCapState(baseUrl: string | undefined, key: string): EngineCapState;
|
|
11
|
+
export declare function engineCapStateVia(baseUrl: string | undefined, key: string, probe: (signal?: AbortSignal) => Promise<unknown>, opts?: {
|
|
12
|
+
withinMs?: number;
|
|
13
|
+
signal?: AbortSignal;
|
|
14
|
+
}): Promise<EngineCapState>;
|
|
10
15
|
export declare function engineCapTrue(baseUrl: string | undefined, key: string): boolean;
|
|
11
16
|
export declare function engineCapNestedTrue(baseUrl: string | undefined, parentKey: string, key: string): boolean;
|
|
12
17
|
export type EngineCapValueState = {
|
package/dist/engineCapsCache.js
CHANGED
|
@@ -3,21 +3,13 @@ const inFlight = new Set();
|
|
|
3
3
|
const settleByBase = new Map();
|
|
4
4
|
const genByBase = new Map();
|
|
5
5
|
function capsGeneration(baseUrl) {
|
|
6
|
-
return genByBase.get(baseUrl)
|
|
6
|
+
return genByBase.get(baseUrl) ?? 0;
|
|
7
7
|
}
|
|
8
8
|
export function engineCapsGeneration(baseUrl) {
|
|
9
9
|
return capsGeneration(baseUrl);
|
|
10
10
|
}
|
|
11
|
-
export function
|
|
12
|
-
return
|
|
13
|
-
}
|
|
14
|
-
export function retainCapsGenerationMark(baseUrl) {
|
|
15
|
-
let mark = genByBase.get(baseUrl);
|
|
16
|
-
if (mark === undefined) {
|
|
17
|
-
mark = Object.freeze({ n: 0 });
|
|
18
|
-
genByBase.set(baseUrl, mark);
|
|
19
|
-
}
|
|
20
|
-
return mark;
|
|
11
|
+
export function engineCapsLandingOf(baseUrl) {
|
|
12
|
+
return capsByBase.get(baseUrl);
|
|
21
13
|
}
|
|
22
14
|
export function kickEngineCapsProbe(baseUrl, probe) {
|
|
23
15
|
if (!baseUrl || capsByBase.has(baseUrl) || inFlight.has(baseUrl))
|
|
@@ -39,7 +31,7 @@ export function kickEngineCapsProbe(baseUrl, probe) {
|
|
|
39
31
|
if (gen !== capsGeneration(baseUrl))
|
|
40
32
|
return;
|
|
41
33
|
if (caps && typeof caps === 'object') {
|
|
42
|
-
capsByBase.set(baseUrl, caps);
|
|
34
|
+
capsByBase.set(baseUrl, Object.freeze({ caps: caps }));
|
|
43
35
|
}
|
|
44
36
|
}
|
|
45
37
|
catch {
|
|
@@ -124,17 +116,63 @@ export async function engineCapsSettled(baseUrl, opts) {
|
|
|
124
116
|
export function engineCapState(baseUrl, key) {
|
|
125
117
|
if (!baseUrl)
|
|
126
118
|
return 'unprobed';
|
|
127
|
-
|
|
128
|
-
|
|
119
|
+
return capStateIn(capsByBase.get(baseUrl)?.caps, key);
|
|
120
|
+
}
|
|
121
|
+
function capStateIn(caps, key) {
|
|
122
|
+
if (caps === undefined || caps === null || typeof caps !== 'object')
|
|
129
123
|
return 'unprobed';
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
124
|
+
try {
|
|
125
|
+
if (!(key in caps))
|
|
126
|
+
return 'absent';
|
|
127
|
+
const v = caps[key];
|
|
128
|
+
if (v === true)
|
|
129
|
+
return 'true';
|
|
130
|
+
if (v === false)
|
|
131
|
+
return 'false';
|
|
132
|
+
return 'non_boolean';
|
|
133
|
+
}
|
|
134
|
+
catch {
|
|
135
|
+
return 'unprobed';
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
async function untilSettledOrAborted(p, signal) {
|
|
139
|
+
if (signal === undefined) {
|
|
140
|
+
await p.catch(() => undefined);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (signal.aborted)
|
|
144
|
+
return;
|
|
145
|
+
let onAbort;
|
|
146
|
+
const aborted = new Promise((resolve) => {
|
|
147
|
+
onAbort = () => resolve();
|
|
148
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
149
|
+
});
|
|
150
|
+
try {
|
|
151
|
+
await Promise.race([p.then(() => undefined, () => undefined), aborted]);
|
|
152
|
+
}
|
|
153
|
+
finally {
|
|
154
|
+
if (onAbort !== undefined)
|
|
155
|
+
signal.removeEventListener('abort', onAbort);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
export async function engineCapStateVia(baseUrl, key, probe, opts) {
|
|
159
|
+
const signal = opts?.signal;
|
|
160
|
+
if (!baseUrl) {
|
|
161
|
+
try {
|
|
162
|
+
if (signal?.aborted)
|
|
163
|
+
return 'unprobed';
|
|
164
|
+
return capStateIn(await probe(signal), key);
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
return 'unprobed';
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
const now = engineCapState(baseUrl, key);
|
|
171
|
+
if (now !== 'unprobed')
|
|
172
|
+
return now;
|
|
173
|
+
kickEngineCapsProbe(baseUrl, () => probe());
|
|
174
|
+
await untilSettledOrAborted(engineCapsSettled(baseUrl, opts?.withinMs !== undefined ? { withinMs: opts.withinMs } : undefined), signal);
|
|
175
|
+
return engineCapState(baseUrl, key);
|
|
138
176
|
}
|
|
139
177
|
export function engineCapTrue(baseUrl, key) {
|
|
140
178
|
return engineCapState(baseUrl, key) === 'true';
|
|
@@ -142,7 +180,7 @@ export function engineCapTrue(baseUrl, key) {
|
|
|
142
180
|
export function engineCapNestedTrue(baseUrl, parentKey, key) {
|
|
143
181
|
if (!baseUrl)
|
|
144
182
|
return false;
|
|
145
|
-
const parent = capsByBase.get(baseUrl)?.[parentKey];
|
|
183
|
+
const parent = capsByBase.get(baseUrl)?.caps[parentKey];
|
|
146
184
|
if (parent === null || typeof parent !== 'object')
|
|
147
185
|
return false;
|
|
148
186
|
return parent[key] === true;
|
|
@@ -150,7 +188,7 @@ export function engineCapNestedTrue(baseUrl, parentKey, key) {
|
|
|
150
188
|
export function engineCapValue(baseUrl, key) {
|
|
151
189
|
if (!baseUrl)
|
|
152
190
|
return { kind: 'unobserved' };
|
|
153
|
-
const caps = capsByBase.get(baseUrl);
|
|
191
|
+
const caps = capsByBase.get(baseUrl)?.caps;
|
|
154
192
|
if (caps === undefined)
|
|
155
193
|
return { kind: 'unobserved' };
|
|
156
194
|
if (!(key in caps))
|
|
@@ -165,7 +203,7 @@ export function engineCapValue(baseUrl, key) {
|
|
|
165
203
|
export function engineCapString(baseUrl, key) {
|
|
166
204
|
if (!baseUrl)
|
|
167
205
|
return undefined;
|
|
168
|
-
const v = capsByBase.get(baseUrl)?.[key];
|
|
206
|
+
const v = capsByBase.get(baseUrl)?.caps[key];
|
|
169
207
|
return typeof v === 'string' && v.length > 0 ? v : undefined;
|
|
170
208
|
}
|
|
171
209
|
export function invalidateEngineCaps(baseUrl, probe) {
|
|
@@ -176,7 +214,7 @@ export function invalidateEngineCaps(baseUrl, probe) {
|
|
|
176
214
|
settleByBase.has(baseUrl) ||
|
|
177
215
|
genByBase.has(baseUrl);
|
|
178
216
|
if (hadState) {
|
|
179
|
-
genByBase.set(baseUrl,
|
|
217
|
+
genByBase.set(baseUrl, capsGeneration(baseUrl) + 1);
|
|
180
218
|
capsByBase.delete(baseUrl);
|
|
181
219
|
inFlight.delete(baseUrl);
|
|
182
220
|
settleByBase.get(baseUrl)?.wake();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type EngineProbeAnswer = {
|
|
2
|
+
readonly ok: true;
|
|
3
|
+
} | {
|
|
4
|
+
readonly status: number;
|
|
5
|
+
} | {
|
|
6
|
+
readonly transport: true;
|
|
7
|
+
};
|
|
8
|
+
export type EngineCredentialNeed = 'open' | 'requires' | 'undetermined';
|
|
9
|
+
export declare function engineCredentialRequirementOf(answer: EngineProbeAnswer): EngineCredentialNeed;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function engineCredentialRequirementOf(answer) {
|
|
2
|
+
try {
|
|
3
|
+
const a = answer;
|
|
4
|
+
if (typeof a !== 'object' || a === null || Array.isArray(a))
|
|
5
|
+
return 'undetermined';
|
|
6
|
+
const ok = Object.getOwnPropertyDescriptor(a, 'ok');
|
|
7
|
+
const status = Object.getOwnPropertyDescriptor(a, 'status');
|
|
8
|
+
const transport = Object.getOwnPropertyDescriptor(a, 'transport');
|
|
9
|
+
const arms = (ok !== undefined ? 1 : 0) + (status !== undefined ? 1 : 0) + (transport !== undefined ? 1 : 0);
|
|
10
|
+
if (arms !== 1)
|
|
11
|
+
return 'undetermined';
|
|
12
|
+
if (ok !== undefined)
|
|
13
|
+
return Object.hasOwn(ok, 'value') && ok.value === true ? 'open' : 'undetermined';
|
|
14
|
+
if (status !== undefined) {
|
|
15
|
+
const value = Object.hasOwn(status, 'value') ? status.value : undefined;
|
|
16
|
+
return value === 401 || value === 403 ? 'requires' : 'undetermined';
|
|
17
|
+
}
|
|
18
|
+
return 'undetermined';
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return 'undetermined';
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export interface EngineEnvView {
|
|
2
|
+
raw(key: string): string | undefined;
|
|
3
|
+
get(key: string): string | undefined;
|
|
4
|
+
}
|
|
5
|
+
export interface EngineEnvGroupDecl {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly safety: boolean;
|
|
8
|
+
readonly keys: readonly string[];
|
|
9
|
+
readonly dropKeys: readonly string[];
|
|
10
|
+
refuses(view: EngineEnvView): boolean;
|
|
11
|
+
readonly skippable?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface EngineEnvSourcingInput {
|
|
14
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
15
|
+
readonly caseInsensitive: boolean;
|
|
16
|
+
readonly sources: ReadonlyArray<{
|
|
17
|
+
readonly source: string;
|
|
18
|
+
readonly keys: readonly string[];
|
|
19
|
+
}>;
|
|
20
|
+
ignored(key: string, source: string): boolean;
|
|
21
|
+
readonly aliases?: ReadonlyArray<readonly [from: string, to: string]>;
|
|
22
|
+
readonly groups: readonly EngineEnvGroupDecl[];
|
|
23
|
+
}
|
|
24
|
+
export interface EngineEnvTouchedKey {
|
|
25
|
+
readonly key: string;
|
|
26
|
+
readonly written: string;
|
|
27
|
+
readonly source: string;
|
|
28
|
+
}
|
|
29
|
+
export interface EngineEnvGroupReading {
|
|
30
|
+
readonly id: string;
|
|
31
|
+
readonly touched: readonly EngineEnvTouchedKey[];
|
|
32
|
+
readonly refuses: boolean;
|
|
33
|
+
readonly action: 'none' | 'skip' | 'refuse-explained';
|
|
34
|
+
readonly own: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
export type EngineEnvKeyReason = {
|
|
37
|
+
readonly key: string;
|
|
38
|
+
readonly reason: 'repo-half-ignored';
|
|
39
|
+
readonly written: string;
|
|
40
|
+
readonly source: string;
|
|
41
|
+
readonly groups: readonly string[];
|
|
42
|
+
} | {
|
|
43
|
+
readonly key: string;
|
|
44
|
+
readonly reason: 'dropped-with-group';
|
|
45
|
+
readonly groups: readonly string[];
|
|
46
|
+
};
|
|
47
|
+
export interface EngineEnvSourcingVerdict {
|
|
48
|
+
readonly drop: readonly string[];
|
|
49
|
+
readonly groups: readonly EngineEnvGroupReading[];
|
|
50
|
+
readonly keys: readonly EngineEnvKeyReason[];
|
|
51
|
+
}
|
|
52
|
+
export declare function engineEnvView(env: Readonly<Record<string, string | undefined>>, caseInsensitive: boolean): EngineEnvView;
|
|
53
|
+
export declare function resolveEngineEnvSourcing(input: EngineEnvSourcingInput): EngineEnvSourcingVerdict;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export function engineEnvView(env, caseInsensitive) {
|
|
2
|
+
const raw = (key) => {
|
|
3
|
+
const direct = env[key];
|
|
4
|
+
if (direct !== undefined || !caseInsensitive)
|
|
5
|
+
return direct;
|
|
6
|
+
const upper = key.toUpperCase();
|
|
7
|
+
for (const [k, v] of Object.entries(env))
|
|
8
|
+
if (k.toUpperCase() === upper)
|
|
9
|
+
return v;
|
|
10
|
+
return undefined;
|
|
11
|
+
};
|
|
12
|
+
return { raw, get: (key) => { const v = raw(key); return v === undefined || v === '' ? undefined : v; } };
|
|
13
|
+
}
|
|
14
|
+
function safely(f) {
|
|
15
|
+
try {
|
|
16
|
+
return f() === true;
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function resolveEngineEnvSourcing(input) {
|
|
23
|
+
const view = engineEnvView(input.env, input.caseInsensitive === true);
|
|
24
|
+
const alias = new Map((input.aliases ?? []).map(([from, to]) => [from.toUpperCase(), to.toUpperCase()]));
|
|
25
|
+
const repo = new Map();
|
|
26
|
+
for (const { source, keys } of input.sources) {
|
|
27
|
+
for (const k of keys) {
|
|
28
|
+
if (!safely(() => input.ignored(k, source)))
|
|
29
|
+
continue;
|
|
30
|
+
const upper = k.toUpperCase();
|
|
31
|
+
repo.set(upper, { source, written: k });
|
|
32
|
+
const target = alias.get(upper);
|
|
33
|
+
if (target !== undefined && !repo.has(target))
|
|
34
|
+
repo.set(target, { source, written: k });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const drop = [];
|
|
38
|
+
const groups = [];
|
|
39
|
+
const halfRows = new Map();
|
|
40
|
+
const dropRows = new Map();
|
|
41
|
+
for (const g of input.groups) {
|
|
42
|
+
const touched = [];
|
|
43
|
+
for (const k of g.keys) {
|
|
44
|
+
const hit = repo.get(k);
|
|
45
|
+
if (hit !== undefined && view.get(k) === undefined)
|
|
46
|
+
touched.push({ key: k, written: hit.written, source: hit.source });
|
|
47
|
+
}
|
|
48
|
+
const refuses = touched.length > 0 && safely(() => g.refuses(view));
|
|
49
|
+
let action = 'none';
|
|
50
|
+
let own = [];
|
|
51
|
+
if (refuses) {
|
|
52
|
+
own = g.dropKeys.filter((k) => view.raw(k) !== undefined);
|
|
53
|
+
if (g.safety || g.skippable === false)
|
|
54
|
+
action = 'refuse-explained';
|
|
55
|
+
else {
|
|
56
|
+
action = 'skip';
|
|
57
|
+
drop.push(...g.dropKeys);
|
|
58
|
+
for (const k of g.dropKeys) {
|
|
59
|
+
const row = dropRows.get(k);
|
|
60
|
+
if (row === undefined)
|
|
61
|
+
dropRows.set(k, { key: k, groups: [g.id] });
|
|
62
|
+
else if (!row.groups.includes(g.id))
|
|
63
|
+
row.groups.push(g.id);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
for (const t of touched) {
|
|
67
|
+
const row = halfRows.get(t.key);
|
|
68
|
+
if (row === undefined)
|
|
69
|
+
halfRows.set(t.key, { ...t, groups: [g.id] });
|
|
70
|
+
else if (!row.groups.includes(g.id))
|
|
71
|
+
row.groups.push(g.id);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
groups.push({ id: g.id, touched, refuses, action, own });
|
|
75
|
+
}
|
|
76
|
+
const keys = [
|
|
77
|
+
...[...halfRows.values()].map((r) => ({ key: r.key, reason: 'repo-half-ignored', written: r.written, source: r.source, groups: r.groups })),
|
|
78
|
+
...[...dropRows.values()].map((r) => ({ key: r.key, reason: 'dropped-with-group', groups: r.groups })),
|
|
79
|
+
];
|
|
80
|
+
return { drop, groups, keys };
|
|
81
|
+
}
|
|
@@ -16,6 +16,8 @@ export declare const CONFIG_MEMORY_WRITE_SCOPE_MISMATCH = "config.memory_write_s
|
|
|
16
16
|
export declare const CONFIG_LEGACY_TOOL_NAME = "config.legacy_tool_name";
|
|
17
17
|
export declare const CONFIG_IMAGE_INVALID = "config.image_invalid";
|
|
18
18
|
export declare function imageInvalidFailureNoteOf(code: string | undefined): string | undefined;
|
|
19
|
+
export declare const CONFIG_AGENT_UNKNOWN_TOOL = "config.agent.unknown_tool";
|
|
20
|
+
export declare const CONFIG_OUTPUT_STYLE_INVALID = "config.output_style_invalid";
|
|
19
21
|
export declare const CONFIG_REFUSAL_CODES: ReadonlySet<string>;
|
|
20
22
|
export declare const RULES_LEGACY_TOOL_NAME = "rules.legacy_tool_name";
|
|
21
23
|
export declare function isRulesRefusalCode(code: string | undefined): boolean;
|
|
@@ -52,8 +54,12 @@ export declare const RESUME_USAGE_WINDOW_EXHAUSTED = "resume.usage_window_exhaus
|
|
|
52
54
|
export declare const RESUME_PREFLIGHT_REJECTED = "resume.preflight_rejected";
|
|
53
55
|
export declare const RESUME_SESSION_NOT_FOUND = "resume.session_not_found";
|
|
54
56
|
export declare const REQUEST_FIELD_CONFLICT = "request.field_conflict";
|
|
57
|
+
export declare const REQUEST_AUTONOMY_LANE_REFUSED = "request.autonomy_lane_refused";
|
|
55
58
|
export declare const CHECKPOINT_UNSUPPORTED_VERSION = "checkpoint.unsupported_version";
|
|
59
|
+
export declare const CHECKPOINT_WALLTIME_AXIS_RETIRED = "checkpoint.walltime_axis_retired";
|
|
60
|
+
export declare const CHECKPOINT_CONFIG_REFUSED = "checkpoint.config_refused";
|
|
56
61
|
export declare function refusalSaysStillPending(err: object): boolean;
|
|
62
|
+
export declare function refusalRetriableReading(err: object): boolean | undefined;
|
|
57
63
|
export type StatusDerivedCoarseCode = (typeof STATUS_DERIVED_COARSE_CODES)[number];
|
|
58
64
|
export declare const RESUME_PLACEMENT_MISMATCH = "resume.placement_mismatch";
|
|
59
65
|
export declare const RESUME_CONTEXT_UNAVAILABLE = "conflict.resume_context_unavailable";
|
|
@@ -73,15 +79,24 @@ export declare const DECIDE_GATE_MOVED = "decide.gate_moved";
|
|
|
73
79
|
export declare const DECIDE_CLAIM_LOST = "decide.claim_lost";
|
|
74
80
|
export declare const DECIDE_PARK_MOVED_CODES: readonly string[];
|
|
75
81
|
export declare function isDecideParkMovedCode(code: string | null | undefined): boolean;
|
|
82
|
+
export declare const APPROVAL_STALE = "approval_stale";
|
|
83
|
+
export declare const APPROVAL_BINDING_MISMATCH = "approval_binding_mismatch";
|
|
84
|
+
export declare const RESUME_OUTCOME_INVALID = "resume_outcome_invalid";
|
|
85
|
+
export declare const CHECKPOINT_ALREADY_RESOLVED = "checkpoint.already_resolved";
|
|
86
|
+
export declare const NOT_FOUND_APPROVAL = "not_found.approval";
|
|
87
|
+
export declare const NOT_FOUND_CHECKPOINT = "not_found.checkpoint";
|
|
88
|
+
export declare const DECIDE_ALREADY_RESOLVED_CODES: readonly string[];
|
|
89
|
+
export declare function isDecideAlreadyResolvedCode(code: string | null | undefined): boolean;
|
|
76
90
|
export declare const ASK_GONE = "gone.ask";
|
|
77
|
-
export declare const ASK_GONE_DENIED_WORD
|
|
78
|
-
export declare const RUN_STALLED = "run.stalled";
|
|
79
|
-
export declare const RUN_ORPHANED = "run.orphaned";
|
|
80
|
-
export declare const APPROVAL_EXPIRED = "approval.expired";
|
|
91
|
+
export declare const ASK_GONE_DENIED_WORD: "routing_failure_fail_closed";
|
|
81
92
|
export declare const RUN_DEATH_VERDICT_CODES: readonly ["run.stalled", "run.orphaned", "approval.expired"];
|
|
82
93
|
export type RunDeathVerdictCode = (typeof RUN_DEATH_VERDICT_CODES)[number];
|
|
94
|
+
export declare const RUN_STALLED: "run.stalled";
|
|
95
|
+
export declare const RUN_ORPHANED: "run.orphaned";
|
|
96
|
+
export declare const APPROVAL_EXPIRED: "approval.expired";
|
|
83
97
|
export declare function runDeathVerdictNoteOf(code: string | undefined): string | undefined;
|
|
84
98
|
export declare const CAPABILITY_OPERATOR_PRINCIPALS_REQUIRED = "capability.operator_principals_required";
|
|
99
|
+
export declare const COMPACT_NOT_RUNNING = "compact.not_running";
|
|
85
100
|
export declare function isUnavailableFaceCode(code: string | undefined): boolean;
|
|
86
101
|
export type OperatorGateRefusal = 'operator_only' | 'operators_unconfigured';
|
|
87
102
|
export declare function operatorGateRefusalContent(cause: OperatorGateRefusal): string | undefined;
|
package/dist/engineErrorCodes.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { frozenSet } from './frozenSet.js';
|
|
2
2
|
import { CORE_TOOL_DECLARATION_CODES } from './generated/engineFactTables.js';
|
|
3
|
+
import { SDK_DENY_REASON_ROUTING_FAILURE, SDK_RUN_DEATH_VERDICT_CODES, SDK_STATUS_DERIVED_COARSE_CODES } from './generated/sdkFactTables.js';
|
|
3
4
|
export const LIMITS_MAX_TOKENS_EXCEEDED = 'limits.max_tokens_exceeded';
|
|
4
5
|
export const LIMITS_MAX_COST_EXCEEDED = 'limits.max_cost_exceeded';
|
|
5
6
|
export const LIMITS_MAX_TURNS_EXCEEDED = 'limits.max_turns_exceeded';
|
|
@@ -25,6 +26,8 @@ const IMAGE_INVALID_FAILURE_NOTE = 'This run did not start: an image sent with t
|
|
|
25
26
|
export function imageInvalidFailureNoteOf(code) {
|
|
26
27
|
return code === CONFIG_IMAGE_INVALID ? IMAGE_INVALID_FAILURE_NOTE : undefined;
|
|
27
28
|
}
|
|
29
|
+
export const CONFIG_AGENT_UNKNOWN_TOOL = 'config.agent.unknown_tool';
|
|
30
|
+
export const CONFIG_OUTPUT_STYLE_INVALID = 'config.output_style_invalid';
|
|
28
31
|
export const CONFIG_REFUSAL_CODES = frozenSet([
|
|
29
32
|
CONFIG_LIMIT_INVALID,
|
|
30
33
|
CONFIG_STRATEGY_FIND_LIMIT_INVALID,
|
|
@@ -35,6 +38,8 @@ export const CONFIG_REFUSAL_CODES = frozenSet([
|
|
|
35
38
|
CONFIG_MEMORY_WRITE_SCOPE_MISMATCH,
|
|
36
39
|
CONFIG_LEGACY_TOOL_NAME,
|
|
37
40
|
CONFIG_IMAGE_INVALID,
|
|
41
|
+
CONFIG_AGENT_UNKNOWN_TOOL,
|
|
42
|
+
CONFIG_OUTPUT_STYLE_INVALID,
|
|
38
43
|
...CORE_TOOL_DECLARATION_CODES,
|
|
39
44
|
]);
|
|
40
45
|
export const RULES_LEGACY_TOOL_NAME = 'rules.legacy_tool_name';
|
|
@@ -92,17 +97,7 @@ export const STOP_CONFLICT_CODES = Object.freeze([
|
|
|
92
97
|
]);
|
|
93
98
|
export const OUTPUT_INVALID = 'output.invalid';
|
|
94
99
|
export const RESUME_POLICY_FOLD_CODE = 'resume_blocked_by_policy';
|
|
95
|
-
export const STATUS_DERIVED_COARSE_CODES =
|
|
96
|
-
'request.rejected',
|
|
97
|
-
'auth.unauthorized',
|
|
98
|
-
'auth.forbidden',
|
|
99
|
-
'not_found.resource',
|
|
100
|
-
'request.payload_too_large',
|
|
101
|
-
'request.unprocessable',
|
|
102
|
-
'limit.rate_exceeded',
|
|
103
|
-
'capability.unavailable',
|
|
104
|
-
'internal.error',
|
|
105
|
-
]);
|
|
100
|
+
export const STATUS_DERIVED_COARSE_CODES = SDK_STATUS_DERIVED_COARSE_CODES;
|
|
106
101
|
export function isStatusDerivedCoarseCode(code) {
|
|
107
102
|
return typeof code === 'string' && STATUS_DERIVED_COARSE_CODES.includes(code);
|
|
108
103
|
}
|
|
@@ -115,13 +110,19 @@ export const RESUME_USAGE_WINDOW_EXHAUSTED = 'resume.usage_window_exhausted';
|
|
|
115
110
|
export const RESUME_PREFLIGHT_REJECTED = 'resume.preflight_rejected';
|
|
116
111
|
export const RESUME_SESSION_NOT_FOUND = 'resume.session_not_found';
|
|
117
112
|
export const REQUEST_FIELD_CONFLICT = 'request.field_conflict';
|
|
113
|
+
export const REQUEST_AUTONOMY_LANE_REFUSED = 'request.autonomy_lane_refused';
|
|
118
114
|
export const CHECKPOINT_UNSUPPORTED_VERSION = 'checkpoint.unsupported_version';
|
|
115
|
+
export const CHECKPOINT_WALLTIME_AXIS_RETIRED = 'checkpoint.walltime_axis_retired';
|
|
116
|
+
export const CHECKPOINT_CONFIG_REFUSED = 'checkpoint.config_refused';
|
|
119
117
|
export function refusalSaysStillPending(err) {
|
|
118
|
+
return refusalRetriableReading(err) === true;
|
|
119
|
+
}
|
|
120
|
+
export function refusalRetriableReading(err) {
|
|
120
121
|
try {
|
|
121
122
|
return Object.hasOwn(err, 'retriable') && err.retriable === true;
|
|
122
123
|
}
|
|
123
124
|
catch {
|
|
124
|
-
return
|
|
125
|
+
return undefined;
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
128
|
export const RESUME_PLACEMENT_MISMATCH = 'resume.placement_mismatch';
|
|
@@ -160,27 +161,44 @@ export const DECIDE_PARK_MOVED_CODES = Object.freeze([
|
|
|
160
161
|
export function isDecideParkMovedCode(code) {
|
|
161
162
|
return typeof code === 'string' && DECIDE_PARK_MOVED_CODES.includes(code);
|
|
162
163
|
}
|
|
164
|
+
export const APPROVAL_STALE = 'approval_stale';
|
|
165
|
+
export const APPROVAL_BINDING_MISMATCH = 'approval_binding_mismatch';
|
|
166
|
+
export const RESUME_OUTCOME_INVALID = 'resume_outcome_invalid';
|
|
167
|
+
export const CHECKPOINT_ALREADY_RESOLVED = 'checkpoint.already_resolved';
|
|
168
|
+
export const NOT_FOUND_APPROVAL = 'not_found.approval';
|
|
169
|
+
export const NOT_FOUND_CHECKPOINT = 'not_found.checkpoint';
|
|
170
|
+
export const DECIDE_ALREADY_RESOLVED_CODES = Object.freeze([
|
|
171
|
+
APPROVAL_STALE,
|
|
172
|
+
CHECKPOINT_ALREADY_RESOLVED,
|
|
173
|
+
NOT_FOUND_APPROVAL,
|
|
174
|
+
NOT_FOUND_CHECKPOINT,
|
|
175
|
+
]);
|
|
176
|
+
export function isDecideAlreadyResolvedCode(code) {
|
|
177
|
+
return typeof code === 'string' && DECIDE_ALREADY_RESOLVED_CODES.includes(code);
|
|
178
|
+
}
|
|
163
179
|
export const ASK_GONE = 'gone.ask';
|
|
164
|
-
export const ASK_GONE_DENIED_WORD =
|
|
180
|
+
export const ASK_GONE_DENIED_WORD = SDK_DENY_REASON_ROUTING_FAILURE;
|
|
181
|
+
export const RUN_DEATH_VERDICT_CODES = SDK_RUN_DEATH_VERDICT_CODES;
|
|
182
|
+
const _runDeathVerdictCodePin = true;
|
|
183
|
+
void _runDeathVerdictCodePin;
|
|
165
184
|
export const RUN_STALLED = 'run.stalled';
|
|
166
185
|
export const RUN_ORPHANED = 'run.orphaned';
|
|
167
186
|
export const APPROVAL_EXPIRED = 'approval.expired';
|
|
168
|
-
export const RUN_DEATH_VERDICT_CODES = Object.freeze([RUN_STALLED, RUN_ORPHANED, APPROVAL_EXPIRED]);
|
|
169
187
|
const RUN_HOLDER_LOST_OUTLET = 'The request itself was not at fault, but this run cannot be picked up again; submit the work again as a new task.';
|
|
170
188
|
const RUN_ORPHANED_NOTE = 'This run ended because the engine process that was running it went away (it was restarted) before the run finished. ' + RUN_HOLDER_LOST_OUTLET;
|
|
171
189
|
const RUN_STALLED_NOTE = 'This run ended because the engine process that was running it stopped reporting in before the run finished. ' + RUN_HOLDER_LOST_OUTLET;
|
|
172
190
|
const RUN_APPROVAL_EXPIRED_NOTE = 'This run ended because it was waiting on an approval for too long and the engine retired it. ' +
|
|
173
191
|
'The request itself was not at fault, but this run cannot be picked up again; submit the work again as a new task, and it will ask for the approval again.';
|
|
192
|
+
const RUN_DEATH_VERDICT_NOTES = Object.freeze({
|
|
193
|
+
[RUN_STALLED]: RUN_STALLED_NOTE,
|
|
194
|
+
[RUN_ORPHANED]: RUN_ORPHANED_NOTE,
|
|
195
|
+
[APPROVAL_EXPIRED]: RUN_APPROVAL_EXPIRED_NOTE,
|
|
196
|
+
});
|
|
174
197
|
export function runDeathVerdictNoteOf(code) {
|
|
175
|
-
|
|
176
|
-
return RUN_ORPHANED_NOTE;
|
|
177
|
-
if (code === RUN_STALLED)
|
|
178
|
-
return RUN_STALLED_NOTE;
|
|
179
|
-
if (code === APPROVAL_EXPIRED)
|
|
180
|
-
return RUN_APPROVAL_EXPIRED_NOTE;
|
|
181
|
-
return undefined;
|
|
198
|
+
return typeof code === 'string' && Object.hasOwn(RUN_DEATH_VERDICT_NOTES, code) ? RUN_DEATH_VERDICT_NOTES[code] : undefined;
|
|
182
199
|
}
|
|
183
200
|
export const CAPABILITY_OPERATOR_PRINCIPALS_REQUIRED = 'capability.operator_principals_required';
|
|
201
|
+
export const COMPACT_NOT_RUNNING = 'compact.not_running';
|
|
184
202
|
export function isUnavailableFaceCode(code) {
|
|
185
203
|
return typeof code === 'string' && (code.startsWith('capability.') || code.startsWith('feature.'));
|
|
186
204
|
}
|
package/dist/engineIdentity.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CORE_TOOL_TURN_INCOMPLETE_CAUSES, CORE_USER_INPUT_UNDRAINED_CAUSES } from './generated/engineNoticeTables.js';
|
|
1
|
+
import { CORE_TOOL_TURN_INCOMPLETE_CAUSES, CORE_USER_INPUT_UNDRAINED_CAUSES, CORE_USER_INPUT_UNDRAINED_FAMILIES } from './generated/engineNoticeTables.js';
|
|
2
2
|
export type NoticeAudience = 'user' | 'operator';
|
|
3
3
|
export declare const ENGINE_NOTICE_CODES: readonly string[];
|
|
4
4
|
export declare function engineNoticeInCatalog(code: unknown): boolean;
|
|
@@ -146,8 +146,27 @@ export interface ModelUnreachableFactsView {
|
|
|
146
146
|
proxyInUse?: string;
|
|
147
147
|
remedy: string;
|
|
148
148
|
sessionId: string;
|
|
149
|
+
taskId?: string;
|
|
149
150
|
}
|
|
150
151
|
export declare function readModelUnreachable(notice: unknown): ModelUnreachableFactsView | undefined;
|
|
152
|
+
export interface AllowedToolNotGrantedEntryView {
|
|
153
|
+
source: string;
|
|
154
|
+
entry: string;
|
|
155
|
+
entryShown: string;
|
|
156
|
+
reason: string;
|
|
157
|
+
skill?: string;
|
|
158
|
+
skillShown?: string;
|
|
159
|
+
list?: string;
|
|
160
|
+
verdict?: string;
|
|
161
|
+
currentName?: string;
|
|
162
|
+
currentNameShown?: string;
|
|
163
|
+
valueType?: string;
|
|
164
|
+
}
|
|
165
|
+
export interface AllowedToolNotGrantedFactsView {
|
|
166
|
+
entries: readonly AllowedToolNotGrantedEntryView[];
|
|
167
|
+
sessionId?: string;
|
|
168
|
+
}
|
|
169
|
+
export declare function readAllowedToolNotGranted(notice: unknown): AllowedToolNotGrantedFactsView | undefined;
|
|
151
170
|
export type ToolTurnIncompleteCause = (typeof CORE_TOOL_TURN_INCOMPLETE_CAUSES)[number];
|
|
152
171
|
export interface ToolTurnIncompleteFactsView {
|
|
153
172
|
cause: string;
|
|
@@ -159,7 +178,7 @@ export interface ToolTurnIncompleteFactsView {
|
|
|
159
178
|
export declare function readToolTurnIncomplete(notice: unknown): ToolTurnIncompleteFactsView | undefined;
|
|
160
179
|
export type UserSteerUndrainedCause = (typeof CORE_USER_INPUT_UNDRAINED_CAUSES)[number];
|
|
161
180
|
export interface UserInputUndrainedFactsView {
|
|
162
|
-
kind:
|
|
181
|
+
kind: keyof typeof CORE_USER_INPUT_UNDRAINED_FAMILIES;
|
|
163
182
|
count: number;
|
|
164
183
|
cause?: string;
|
|
165
184
|
taskId?: string;
|
|
@@ -199,6 +218,7 @@ export declare const ENGINE_NOTICE_FACT_READERS: Readonly<{
|
|
|
199
218
|
readonly 'permission.read_deny_unapplied': typeof readReadDenyUnapplied;
|
|
200
219
|
readonly 'context.tool_turn_repaired': typeof readToolTurnRepaired;
|
|
201
220
|
readonly 'server.model_unreachable': typeof readModelUnreachable;
|
|
221
|
+
readonly 'permission.allowed_tool_not_granted': typeof readAllowedToolNotGranted;
|
|
202
222
|
readonly 'task.tool_turn_incomplete': typeof readToolTurnIncomplete;
|
|
203
223
|
readonly 'task.user_steer_undrained': typeof readUserInputUndrained;
|
|
204
224
|
readonly 'task.user_followup_undrained': typeof readUserInputUndrained;
|