@sema-agent/client-core 0.94.0 → 0.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +341 -0
- package/README.md +70 -47
- package/dist/adapt/arms.js +5 -6
- package/dist/adapt/panelTasks.js +4 -10
- package/dist/adapt/toolCards.js +2 -2
- package/dist/adapt/wireShapes.js +3 -8
- package/dist/adapter/activeRunSelfHeal.d.ts +8 -3
- package/dist/adapter/activeRunSelfHeal.js +20 -12
- package/dist/adapter/downstream/eventToSdkMessage.js +24 -17
- package/dist/adapter/downstream/terminalToSdkResult.js +11 -3
- package/dist/adapter/runStream.js +2 -1
- package/dist/adapter/types.d.ts +7 -0
- package/dist/adapter/types.js +15 -0
- package/dist/agentSession/backgroundView.js +5 -1
- package/dist/agentSession/engineAgentRegistryRead.js +2 -1
- package/dist/agentSession/engineSessionBackgroundStop.js +3 -2
- package/dist/agentsWireCaps.d.ts +2 -0
- package/dist/approvalDecidedByCapability.d.ts +0 -1
- package/dist/approvalDecidedByCapability.js +2 -7
- package/dist/approvalsStreamLiveCapability.d.ts +0 -1
- package/dist/approvalsStreamLiveCapability.js +2 -6
- package/dist/atMostOnce.d.ts +8 -0
- package/dist/atMostOnce.js +36 -0
- package/dist/attachmentSeatCapability.d.ts +0 -1
- package/dist/attachmentSeatCapability.js +0 -3
- package/dist/attachmentsWireCaps.js +11 -6
- package/dist/bashExitReading.d.ts +10 -0
- package/dist/bashExitReading.js +12 -0
- package/dist/callerCwdCapability.d.ts +0 -1
- package/dist/callerCwdCapability.js +2 -7
- package/dist/centerWiringCapability.d.ts +1 -3
- package/dist/centerWiringCapability.js +18 -21
- package/dist/classifierStatus.js +4 -4
- package/dist/cloudConfigWireCaps.js +43 -21
- package/dist/compensations.js +1 -1
- package/dist/cycleOrder.d.ts +15 -0
- package/dist/cycleOrder.js +45 -0
- package/dist/decideFailureNote.js +4 -1
- package/dist/decideReceipt.d.ts +2 -1
- package/dist/decideReceipt.js +41 -13
- package/dist/declared/supportFloorDeclared.d.ts +1 -0
- package/dist/declared/supportFloorDeclared.js +5 -0
- package/dist/deviceExecutorManagementCapability.d.ts +0 -1
- package/dist/deviceExecutorManagementCapability.js +7 -16
- package/dist/deviceRebind.d.ts +88 -0
- package/dist/deviceRebind.js +242 -0
- package/dist/displayUntrusted.d.ts +1 -0
- package/dist/displayUntrusted.js +313 -11
- package/dist/engineAgentAbsence.d.ts +2 -2
- package/dist/engineAgentPanelStore.d.ts +8 -18
- package/dist/engineAgentPanelStore.js +19 -537
- package/dist/engineCapReader.d.ts +6 -6
- package/dist/engineCapReader.js +30 -43
- package/dist/engineCapsCache.d.ts +7 -2
- package/dist/engineCapsCache.js +64 -26
- package/dist/engineCredentialRequirement.d.ts +9 -0
- package/dist/engineCredentialRequirement.js +23 -0
- package/dist/engineEnvSourcing.d.ts +53 -0
- package/dist/engineEnvSourcing.js +81 -0
- package/dist/engineErrorCodes.d.ts +14 -3
- package/dist/engineErrorCodes.js +31 -10
- package/dist/engineIdentity.js +2 -0
- package/dist/engineWireSdk.js +2 -2
- package/dist/executionLaneCapability.d.ts +2 -3
- package/dist/executionLaneCapability.js +18 -23
- package/dist/fileHistoryCaptureCapability.d.ts +0 -1
- package/dist/fileHistoryCaptureCapability.js +2 -6
- package/dist/fileHistoryLegNotice.d.ts +3 -2
- package/dist/fileHistoryLegNotice.js +51 -2
- package/dist/fleet/fleetLedger.d.ts +2 -0
- package/dist/fleet/fleetLedger.js +69 -52
- package/dist/fleet/fleetProjection.d.ts +0 -3
- package/dist/fleet/fleetProjection.js +9 -16
- package/dist/fleetAgentPanelProjection.d.ts +4 -17
- package/dist/fleetAgentPanelProjection.js +7 -197
- package/dist/fleetAgentRowLike.d.ts +16 -0
- package/dist/fleetAgentRowLike.js +1 -0
- package/dist/gateOutcome.js +30 -18
- package/dist/generated/sdkFactTables.d.ts +2 -0
- package/dist/generated/sdkFactTables.js +17 -0
- package/dist/generated/settingsSchemaFns.d.ts +10 -0
- package/dist/generated/settingsSchemaFns.js +22 -0
- package/dist/headlessPermissionModeWire.d.ts +1 -1
- package/dist/headlessPermissionModeWire.js +1 -1
- package/dist/headlessReconnectWire.js +49 -20
- package/dist/hitl/allowRuleShadow.d.ts +1 -1
- package/dist/hitl/allowRuleShadow.js +49 -8
- package/dist/hitl/approvalCompleteParked.d.ts +1 -0
- package/dist/hitl/approvalCompleteParked.js +14 -0
- package/dist/hitl/approvalEndingCause.d.ts +5 -0
- package/dist/hitl/approvalEndingCause.js +61 -0
- package/dist/hitl/approvalHolds.d.ts +12 -2
- package/dist/hitl/approvalHolds.js +53 -2
- package/dist/hitl/approvalsFeed.js +23 -11
- package/dist/hitl/askGateWire.d.ts +2 -1
- package/dist/hitl/askGateWire.js +26 -1
- package/dist/hitl/automaticAnswerVerdict.js +2 -2
- package/dist/hitl/crashConverged.js +2 -0
- package/dist/hitl/decisionConflict.d.ts +3 -0
- package/dist/hitl/decisionConflict.js +43 -0
- package/dist/hitl/decisionRefusal.d.ts +4 -0
- package/dist/hitl/decisionRefusal.js +26 -1
- package/dist/hitl/frameRouter.js +26 -43
- package/dist/hitl/gateLedger.d.ts +5 -0
- package/dist/hitl/gateLedger.js +21 -0
- package/dist/hitl/hitlBridge.d.ts +12 -1
- package/dist/hitl/hitlBridge.js +68 -53
- package/dist/hitl/hitlHostSurface.js +3 -11
- package/dist/hitl/livePendingAsk.d.ts +16 -6
- package/dist/hitl/livePendingAsk.js +36 -4
- package/dist/hitl/parkExpiryJudgements.d.ts +19 -0
- package/dist/hitl/parkExpiryJudgements.js +46 -0
- package/dist/hitl/parkResolver.d.ts +3 -7
- package/dist/hitl/parkResolver.js +50 -26
- package/dist/hitl/persistedRulesWire.js +5 -1
- package/dist/hitl/planReviewWire.d.ts +2 -2
- package/dist/hitl/planReviewWire.js +56 -30
- package/dist/hitl/replayedApproval.d.ts +8 -0
- package/dist/hitl/replayedApproval.js +125 -10
- package/dist/hitl/resumeRunningCard.d.ts +2 -0
- package/dist/hitl/resumeRunningCard.js +15 -4
- package/dist/hitl/toolApprovalWire.d.ts +24 -4
- package/dist/hitl/toolApprovalWire.js +115 -38
- package/dist/hooksWireCaps.js +38 -6
- package/dist/host.d.ts +5 -0
- package/dist/host.js +3 -1
- package/dist/hostCallbackGuard.d.ts +1 -0
- package/dist/hostCallbackGuard.js +25 -0
- package/dist/index.d.ts +30 -11
- package/dist/index.js +20 -8
- package/dist/interactiveInterrupt.d.ts +8 -0
- package/dist/interactiveInterrupt.js +54 -0
- package/dist/limitsWire.d.ts +5 -0
- package/dist/limitsWire.js +49 -3
- package/dist/liveModelCatalog.d.ts +95 -0
- package/dist/liveModelCatalog.js +297 -32
- package/dist/mcpEngineLeg.d.ts +25 -0
- package/dist/mcpEngineLeg.js +71 -15
- package/dist/mcpPanel.js +2 -1
- package/dist/mcpProbeCapability.d.ts +0 -1
- package/dist/mcpProbeCapability.js +2 -6
- package/dist/mcpReconnect.d.ts +1 -3
- package/dist/mcpReconnect.js +10 -5
- package/dist/memoryComplianceCapability.d.ts +0 -1
- package/dist/memoryComplianceCapability.js +2 -6
- package/dist/memoryOriginCapability.d.ts +0 -1
- package/dist/memoryOriginCapability.js +2 -6
- package/dist/memoryVerbsWire.d.ts +1 -1
- package/dist/memoryVerbsWire.js +4 -0
- package/dist/model/liveCatalogShape.d.ts +14 -0
- package/dist/model/liveCatalogShape.js +71 -0
- package/dist/model/modelSupplyRules.d.ts +1 -0
- package/dist/model/modelSupplyRules.js +30 -9
- package/dist/model/modelsPolicy.d.ts +21 -0
- package/dist/model/modelsPolicy.js +90 -0
- package/dist/modelIdentityResolvability.d.ts +1 -1
- package/dist/modelIdentityResolvability.js +5 -12
- package/dist/modelSwitchFallback.d.ts +69 -0
- package/dist/modelSwitchFallback.js +206 -0
- package/dist/notifications.js +12 -11
- package/dist/outputStyleSeatCapability.d.ts +0 -1
- package/dist/outputStyleSeatCapability.js +2 -7
- package/dist/ownKey.d.ts +6 -0
- package/dist/ownKey.js +48 -0
- package/dist/panelReduce.d.ts +114 -0
- package/dist/panelReduce.js +1135 -0
- package/dist/panelStateHolder.d.ts +17 -0
- package/dist/panelStateHolder.js +201 -0
- package/dist/peerLaneCapability.d.ts +0 -1
- package/dist/peerLaneCapability.js +2 -6
- package/dist/permissionModesCapability.d.ts +0 -1
- package/dist/permissionModesCapability.js +5 -10
- package/dist/permissionRulesWriteCapability.d.ts +0 -1
- package/dist/permissionRulesWriteCapability.js +2 -6
- package/dist/permissionsAllowGrantCapability.d.ts +0 -1
- package/dist/permissionsAllowGrantCapability.js +3 -9
- package/dist/permissionsDeclaration.d.ts +6 -0
- package/dist/permissionsDeclaration.js +45 -0
- package/dist/printToolResultFrame.js +2 -10
- package/dist/promptDelivery.js +0 -8
- package/dist/resumeRefusalCopy.d.ts +18 -1
- package/dist/resumeRefusalCopy.js +126 -15
- package/dist/rewindArchiveCapability.d.ts +2 -1
- package/dist/rewindArchiveCapability.js +15 -7
- package/dist/rewindEngineAction.d.ts +21 -0
- package/dist/rewindEngineAction.js +36 -0
- package/dist/rewindWireCaps.d.ts +2 -1
- package/dist/rewindWireCaps.js +1 -0
- package/dist/runTerminal.d.ts +0 -11
- package/dist/runTerminal.js +4 -27
- package/dist/sdkRegistryTransit.d.ts +2 -1
- package/dist/sdkRegistryTransit.js +1 -0
- package/dist/sealedKeyCapability.d.ts +0 -1
- package/dist/sealedKeyCapability.js +3 -9
- package/dist/seatContract.d.ts +54 -25
- package/dist/seatContract.js +394 -171
- package/dist/sessionIdSegment.d.ts +1 -0
- package/dist/sessionIdSegment.js +11 -0
- package/dist/sessionMemoryErase.d.ts +1 -1
- package/dist/sessionMemoryErase.js +6 -1
- package/dist/sessionMemoryStatus.js +3 -2
- package/dist/sessionPolicyCapability.d.ts +0 -1
- package/dist/sessionPolicyCapability.js +2 -6
- package/dist/sessionReadRedactionCapability.d.ts +0 -1
- package/dist/sessionReadRedactionCapability.js +2 -7
- package/dist/sessionSyncFileHistoryCapability.d.ts +0 -1
- package/dist/sessionSyncFileHistoryCapability.js +2 -6
- package/dist/skillToolListsCapability.d.ts +0 -1
- package/dist/skillToolListsCapability.js +2 -6
- package/dist/skillsWireCaps.d.ts +4 -0
- package/dist/skillsWireCaps.js +66 -1
- package/dist/sqlEngineCapability.d.ts +0 -1
- package/dist/sqlEngineCapability.js +9 -14
- package/dist/steerPriorityCapability.d.ts +0 -1
- package/dist/steerPriorityCapability.js +3 -9
- package/dist/storePostureCapability.d.ts +1 -1
- package/dist/storePostureCapability.js +16 -16
- package/dist/streamDrainingLegs.d.ts +6 -0
- package/dist/streamDrainingLegs.js +23 -0
- package/dist/subagent/engineCompactWire.js +13 -38
- package/dist/subagent/engineDelegatedPrompt.js +10 -6
- package/dist/subagent/engineSubagentOutput.d.ts +0 -1
- package/dist/subagent/engineSubagentOutput.js +5 -20
- package/dist/subagent/engineSubagentTail.d.ts +0 -1
- package/dist/subagent/engineSubagentTail.js +7 -32
- package/dist/subagentContentStore.js +3 -3
- package/dist/supportFloor.js +2 -5
- package/dist/terminalStatuses.d.ts +30 -0
- package/dist/terminalStatuses.js +67 -0
- package/dist/toolResult.d.ts +5 -0
- package/dist/toolResult.js +88 -36
- package/dist/types/engineState.d.ts +2 -1
- package/dist/usageAnalytics.d.ts +146 -0
- package/dist/usageAnalytics.js +311 -0
- package/dist/userInvokedSkillsCapability.d.ts +0 -1
- package/dist/userInvokedSkillsCapability.js +2 -6
- package/dist/webSearchBackendCapability.d.ts +0 -1
- package/dist/webSearchBackendCapability.js +3 -7
- package/dist/webSearchWireCaps.js +3 -11
- package/dist/wireFailureShape.d.ts +4 -0
- package/dist/wireFailureShape.js +42 -2
- package/dist/wireRefusalCopy.js +2 -18
- package/dist/workflowClient.js +7 -11
- package/dist/workflowsJournalCapability.d.ts +0 -1
- package/dist/workflowsJournalCapability.js +2 -6
- package/dist/writeProtectionCapability.d.ts +0 -1
- package/dist/writeProtectionCapability.js +5 -10
- package/docs/INTEGRATION-CLIENTS.md +1033 -26
- package/package.json +5 -5
- package/dist/engineCapsGenerationGuard.d.ts +0 -4
- package/dist/engineCapsGenerationGuard.js +0 -19
- package/dist/panelRunningHistory.d.ts +0 -22
- package/dist/panelRunningHistory.js +0 -82
- package/dist/registryConflict.d.ts +0 -3
- package/dist/registryConflict.js +0 -44
package/dist/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
|
+
}
|
|
@@ -56,7 +56,10 @@ export declare const RESUME_SESSION_NOT_FOUND = "resume.session_not_found";
|
|
|
56
56
|
export declare const REQUEST_FIELD_CONFLICT = "request.field_conflict";
|
|
57
57
|
export declare const REQUEST_AUTONOMY_LANE_REFUSED = "request.autonomy_lane_refused";
|
|
58
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";
|
|
59
61
|
export declare function refusalSaysStillPending(err: object): boolean;
|
|
62
|
+
export declare function refusalRetriableReading(err: object): boolean | undefined;
|
|
60
63
|
export type StatusDerivedCoarseCode = (typeof STATUS_DERIVED_COARSE_CODES)[number];
|
|
61
64
|
export declare const RESUME_PLACEMENT_MISMATCH = "resume.placement_mismatch";
|
|
62
65
|
export declare const RESUME_CONTEXT_UNAVAILABLE = "conflict.resume_context_unavailable";
|
|
@@ -76,13 +79,21 @@ export declare const DECIDE_GATE_MOVED = "decide.gate_moved";
|
|
|
76
79
|
export declare const DECIDE_CLAIM_LOST = "decide.claim_lost";
|
|
77
80
|
export declare const DECIDE_PARK_MOVED_CODES: readonly string[];
|
|
78
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;
|
|
79
90
|
export declare const ASK_GONE = "gone.ask";
|
|
80
91
|
export declare const ASK_GONE_DENIED_WORD: "routing_failure_fail_closed";
|
|
81
|
-
export declare const RUN_STALLED = "run.stalled";
|
|
82
|
-
export declare const RUN_ORPHANED = "run.orphaned";
|
|
83
|
-
export declare const APPROVAL_EXPIRED = "approval.expired";
|
|
84
92
|
export declare const RUN_DEATH_VERDICT_CODES: readonly ["run.stalled", "run.orphaned", "approval.expired"];
|
|
85
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";
|
|
86
97
|
export declare function runDeathVerdictNoteOf(code: string | undefined): string | undefined;
|
|
87
98
|
export declare const CAPABILITY_OPERATOR_PRINCIPALS_REQUIRED = "capability.operator_principals_required";
|
|
88
99
|
export declare const COMPACT_NOT_RUNNING = "compact.not_running";
|
package/dist/engineErrorCodes.js
CHANGED
|
@@ -1,6 +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_STATUS_DERIVED_COARSE_CODES } from './generated/sdkFactTables.js';
|
|
3
|
+
import { SDK_DENY_REASON_ROUTING_FAILURE, SDK_RUN_DEATH_VERDICT_CODES, SDK_STATUS_DERIVED_COARSE_CODES } from './generated/sdkFactTables.js';
|
|
4
4
|
export const LIMITS_MAX_TOKENS_EXCEEDED = 'limits.max_tokens_exceeded';
|
|
5
5
|
export const LIMITS_MAX_COST_EXCEEDED = 'limits.max_cost_exceeded';
|
|
6
6
|
export const LIMITS_MAX_TURNS_EXCEEDED = 'limits.max_turns_exceeded';
|
|
@@ -112,12 +112,17 @@ export const RESUME_SESSION_NOT_FOUND = 'resume.session_not_found';
|
|
|
112
112
|
export const REQUEST_FIELD_CONFLICT = 'request.field_conflict';
|
|
113
113
|
export const REQUEST_AUTONOMY_LANE_REFUSED = 'request.autonomy_lane_refused';
|
|
114
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';
|
|
115
117
|
export function refusalSaysStillPending(err) {
|
|
118
|
+
return refusalRetriableReading(err) === true;
|
|
119
|
+
}
|
|
120
|
+
export function refusalRetriableReading(err) {
|
|
116
121
|
try {
|
|
117
122
|
return Object.hasOwn(err, 'retriable') && err.retriable === true;
|
|
118
123
|
}
|
|
119
124
|
catch {
|
|
120
|
-
return
|
|
125
|
+
return undefined;
|
|
121
126
|
}
|
|
122
127
|
}
|
|
123
128
|
export const RESUME_PLACEMENT_MISMATCH = 'resume.placement_mismatch';
|
|
@@ -156,25 +161,41 @@ export const DECIDE_PARK_MOVED_CODES = Object.freeze([
|
|
|
156
161
|
export function isDecideParkMovedCode(code) {
|
|
157
162
|
return typeof code === 'string' && DECIDE_PARK_MOVED_CODES.includes(code);
|
|
158
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
|
+
}
|
|
159
179
|
export const ASK_GONE = 'gone.ask';
|
|
160
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;
|
|
161
184
|
export const RUN_STALLED = 'run.stalled';
|
|
162
185
|
export const RUN_ORPHANED = 'run.orphaned';
|
|
163
186
|
export const APPROVAL_EXPIRED = 'approval.expired';
|
|
164
|
-
export const RUN_DEATH_VERDICT_CODES = Object.freeze([RUN_STALLED, RUN_ORPHANED, APPROVAL_EXPIRED]);
|
|
165
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.';
|
|
166
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;
|
|
167
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;
|
|
168
190
|
const RUN_APPROVAL_EXPIRED_NOTE = 'This run ended because it was waiting on an approval for too long and the engine retired it. ' +
|
|
169
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
|
+
});
|
|
170
197
|
export function runDeathVerdictNoteOf(code) {
|
|
171
|
-
|
|
172
|
-
return RUN_ORPHANED_NOTE;
|
|
173
|
-
if (code === RUN_STALLED)
|
|
174
|
-
return RUN_STALLED_NOTE;
|
|
175
|
-
if (code === APPROVAL_EXPIRED)
|
|
176
|
-
return RUN_APPROVAL_EXPIRED_NOTE;
|
|
177
|
-
return undefined;
|
|
198
|
+
return typeof code === 'string' && Object.hasOwn(RUN_DEATH_VERDICT_NOTES, code) ? RUN_DEATH_VERDICT_NOTES[code] : undefined;
|
|
178
199
|
}
|
|
179
200
|
export const CAPABILITY_OPERATOR_PRINCIPALS_REQUIRED = 'capability.operator_principals_required';
|
|
180
201
|
export const COMPACT_NOT_RUNNING = 'compact.not_running';
|
package/dist/engineIdentity.js
CHANGED
package/dist/engineWireSdk.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AgentClient } from '@sema-agent/sdk';
|
|
2
|
+
import { SETTINGS_IS_LOOPBACK_AUTH_HOST } from './generated/settingsSchemaFns.js';
|
|
2
3
|
import { normalizeWirePrincipal } from './principalWire.js';
|
|
3
4
|
export function isLoopbackWireUrl(url) {
|
|
4
5
|
try {
|
|
5
|
-
|
|
6
|
-
return h === '127.0.0.1' || h === 'localhost' || h === '::1' || h === '[::1]';
|
|
6
|
+
return SETTINGS_IS_LOOPBACK_AUTH_HOST(new URL(url).hostname);
|
|
7
7
|
}
|
|
8
8
|
catch {
|
|
9
9
|
return false;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ExecutionLaneIsolatedAbsence = 'no_hands' | '
|
|
1
|
+
export type ExecutionLaneIsolatedAbsence = 'no_hands' | 'unreadable';
|
|
2
2
|
export interface ExecutionLaneCapabilityView {
|
|
3
3
|
provider: string;
|
|
4
4
|
toolsOnThisHost: boolean;
|
|
@@ -19,9 +19,8 @@ export declare function noteEngineCapsForExecutionLane(baseUrl: string, caps: un
|
|
|
19
19
|
generation?: number;
|
|
20
20
|
}): void;
|
|
21
21
|
export declare function observedExecutionLane(baseUrl?: string | undefined): ExecutionLaneReading;
|
|
22
|
-
export declare function toolsRunHereFromExecutionLane(reading: ExecutionLaneReading
|
|
22
|
+
export declare function toolsRunHereFromExecutionLane(reading: ExecutionLaneReading): boolean;
|
|
23
23
|
export declare function noOsSandboxOnThisHost(reading: ExecutionLaneReading): 'yes' | 'no' | 'unknown';
|
|
24
24
|
export declare function noOsSandboxContent(): string;
|
|
25
25
|
export declare function executionLaneDoctorDetail(reading: ExecutionLaneReading): string;
|
|
26
|
-
export declare function forgetExecutionLaneReading(baseUrl: string | undefined): void;
|
|
27
26
|
export declare function __resetExecutionLaneReadingsForTests(): void;
|