@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,5 +1,6 @@
|
|
|
1
1
|
import { AUTO_MODE_UNAVAILABLE_CAUSES } from './autoModeUnavailable.js';
|
|
2
|
-
import {
|
|
2
|
+
import { displayUntrusted } from './displayUntrusted.js';
|
|
3
|
+
import { CORE_ENGINE_NOTICE_CODES, CORE_MCP_INJECTION_DROP_REASONS, CORE_NOTICE_AUDIENCE, CORE_USER_INPUT_UNDRAINED_FAMILIES, } from './generated/engineNoticeTables.js';
|
|
3
4
|
import { CORE_ASK_UNRESOLVABLE_CAUSES, CORE_DURABLE_MANDATE_SOURCES, CORE_PERMISSION_MODE_FOLD_REASONS, } from './generated/engineFactTables.js';
|
|
4
5
|
export const ENGINE_NOTICE_CODES = CORE_ENGINE_NOTICE_CODES;
|
|
5
6
|
const CATALOG = new Set(ENGINE_NOTICE_CODES);
|
|
@@ -520,7 +521,61 @@ function readModelUnreachableOf(notice) {
|
|
|
520
521
|
if (code === undefined || targetHost === undefined || remedy === undefined || sessionId === undefined)
|
|
521
522
|
return undefined;
|
|
522
523
|
const proxyInUse = nonEmpty(optionalOwnSeat(o, 'proxyInUse'));
|
|
523
|
-
|
|
524
|
+
const taskId = nonEmpty(optionalOwnSeat(o, 'taskId'));
|
|
525
|
+
return { code, targetHost, ...(proxyInUse !== undefined ? { proxyInUse } : {}), remedy, sessionId, ...(taskId !== undefined ? { taskId } : {}) };
|
|
526
|
+
}
|
|
527
|
+
const ALLOWED_TOOL_NOT_GRANTED_MAX_ENTRIES = 10_000;
|
|
528
|
+
export function readAllowedToolNotGranted(notice) {
|
|
529
|
+
return guardedRead(notice, readAllowedToolNotGrantedOf);
|
|
530
|
+
}
|
|
531
|
+
function readAllowedToolNotGrantedOf(notice) {
|
|
532
|
+
if (typeof notice !== 'object' || notice === null || Array.isArray(notice))
|
|
533
|
+
return undefined;
|
|
534
|
+
const n = notice;
|
|
535
|
+
if (ownSeat(n, 'code') !== 'permission.allowed_tool_not_granted')
|
|
536
|
+
return undefined;
|
|
537
|
+
const d = ownSeat(n, 'detail');
|
|
538
|
+
if (typeof d !== 'object' || d === null || Array.isArray(d))
|
|
539
|
+
return undefined;
|
|
540
|
+
const o = d;
|
|
541
|
+
const list = ownSeat(o, 'entries');
|
|
542
|
+
if (!Array.isArray(list))
|
|
543
|
+
return undefined;
|
|
544
|
+
const length = list.length;
|
|
545
|
+
if (length === 0 || length > ALLOWED_TOOL_NOT_GRANTED_MAX_ENTRIES)
|
|
546
|
+
return undefined;
|
|
547
|
+
const entries = [];
|
|
548
|
+
for (let i = 0; i < length; i++) {
|
|
549
|
+
if (!Object.hasOwn(list, i))
|
|
550
|
+
return undefined;
|
|
551
|
+
const item = list[i];
|
|
552
|
+
if (typeof item !== 'object' || item === null || Array.isArray(item))
|
|
553
|
+
return undefined;
|
|
554
|
+
const e = item;
|
|
555
|
+
const source = nonEmpty(ownSeat(e, 'source'));
|
|
556
|
+
const reason = nonEmpty(ownSeat(e, 'reason'));
|
|
557
|
+
const entry = ownSeat(e, 'entry');
|
|
558
|
+
if (source === undefined || reason === undefined || typeof entry !== 'string')
|
|
559
|
+
return undefined;
|
|
560
|
+
const skill = nonEmpty(optionalOwnSeat(e, 'skill'));
|
|
561
|
+
const which = nonEmpty(optionalOwnSeat(e, 'list'));
|
|
562
|
+
const verdict = nonEmpty(optionalOwnSeat(e, 'verdict'));
|
|
563
|
+
const currentName = nonEmpty(optionalOwnSeat(e, 'currentName'));
|
|
564
|
+
const valueType = nonEmpty(optionalOwnSeat(e, 'valueType'));
|
|
565
|
+
entries.push(Object.freeze({
|
|
566
|
+
source,
|
|
567
|
+
entry,
|
|
568
|
+
entryShown: displayUntrusted(entry),
|
|
569
|
+
reason,
|
|
570
|
+
...(skill !== undefined ? { skill, skillShown: displayUntrusted(skill) } : {}),
|
|
571
|
+
...(which !== undefined ? { list: which } : {}),
|
|
572
|
+
...(verdict !== undefined ? { verdict } : {}),
|
|
573
|
+
...(currentName !== undefined ? { currentName, currentNameShown: displayUntrusted(currentName) } : {}),
|
|
574
|
+
...(valueType !== undefined ? { valueType } : {}),
|
|
575
|
+
}));
|
|
576
|
+
}
|
|
577
|
+
const sessionId = nonEmpty(optionalOwnSeat(o, 'sessionId'));
|
|
578
|
+
return { entries: Object.freeze(entries), ...(sessionId !== undefined ? { sessionId } : {}) };
|
|
524
579
|
}
|
|
525
580
|
const positiveInt = (v) => (typeof v === 'number' && Number.isInteger(v) && v > 0 ? v : undefined);
|
|
526
581
|
export function readToolTurnIncomplete(notice) {
|
|
@@ -557,19 +612,28 @@ function readToolTurnIncompleteOf(notice) {
|
|
|
557
612
|
export function readUserInputUndrained(notice) {
|
|
558
613
|
return guardedRead(notice, readUserInputUndrainedOf);
|
|
559
614
|
}
|
|
615
|
+
function isUndrainedLane(v) {
|
|
616
|
+
return typeof v === 'string' && Object.hasOwn(CORE_USER_INPUT_UNDRAINED_FAMILIES, v);
|
|
617
|
+
}
|
|
618
|
+
function undrainedLaneOfCode(code) {
|
|
619
|
+
for (const lane of Object.keys(CORE_USER_INPUT_UNDRAINED_FAMILIES)) {
|
|
620
|
+
if (CORE_USER_INPUT_UNDRAINED_FAMILIES[lane].code === code)
|
|
621
|
+
return lane;
|
|
622
|
+
}
|
|
623
|
+
return undefined;
|
|
624
|
+
}
|
|
560
625
|
function readUserInputUndrainedOf(notice) {
|
|
561
626
|
if (typeof notice !== 'object' || notice === null || Array.isArray(notice))
|
|
562
627
|
return undefined;
|
|
563
628
|
const n = notice;
|
|
564
|
-
const
|
|
565
|
-
const kind = code === 'task.user_steer_undrained' ? 'steer' : code === 'task.user_followup_undrained' ? 'followUp' : undefined;
|
|
629
|
+
const kind = undrainedLaneOfCode(ownSeat(n, 'code'));
|
|
566
630
|
if (kind === undefined)
|
|
567
631
|
return undefined;
|
|
568
632
|
const d = ownSeat(n, 'detail');
|
|
569
633
|
if (typeof d !== 'object' || d === null || Array.isArray(d))
|
|
570
634
|
return undefined;
|
|
571
635
|
const o = d;
|
|
572
|
-
const count = positiveInt(ownSeat(o, kind));
|
|
636
|
+
const count = positiveInt(ownSeat(o, CORE_USER_INPUT_UNDRAINED_FAMILIES[kind].countKey));
|
|
573
637
|
if (count === undefined)
|
|
574
638
|
return undefined;
|
|
575
639
|
const cause = nonEmpty(optionalOwnSeat(o, 'cause'));
|
|
@@ -598,6 +662,8 @@ const STEER_UNDRAINED_SENTENCE = Object.freeze({
|
|
|
598
662
|
});
|
|
599
663
|
const _steerSentencePin = true;
|
|
600
664
|
void _steerSentencePin;
|
|
665
|
+
const _undrainedLanePin = true;
|
|
666
|
+
void _undrainedLanePin;
|
|
601
667
|
const followUpUndrainedSentence = (n) => `${messagesPhrase(n, 'follow-up message')} you queued ${verbBe(n)} not used before the run ended and will not be delivered. ` +
|
|
602
668
|
`Send ${itThem(n)} again if you still need ${itThem(n)}.`;
|
|
603
669
|
const subagentSteerUndrainedSentence = (n) => `${messagesPhrase(n, 'message')} you sent while the run was in progress ${verbBe(n)} not used before a sub-agent's run ended and will not be delivered. ` +
|
|
@@ -629,7 +695,7 @@ export function userInputUndrainedNotice(facts) {
|
|
|
629
695
|
}
|
|
630
696
|
const fromSubagent = typeof child === 'string' && child.length > 0;
|
|
631
697
|
const n = positiveInt(count);
|
|
632
|
-
if (n === undefined || (kind
|
|
698
|
+
if (n === undefined || !isUndrainedLane(kind))
|
|
633
699
|
return undefined;
|
|
634
700
|
if (kind === 'followUp') {
|
|
635
701
|
if (cause === undefined || cause === 'leg_end')
|
|
@@ -730,6 +796,7 @@ export const ENGINE_NOTICE_FACT_READERS = Object.freeze({
|
|
|
730
796
|
'permission.read_deny_unapplied': readReadDenyUnapplied,
|
|
731
797
|
'context.tool_turn_repaired': readToolTurnRepaired,
|
|
732
798
|
'server.model_unreachable': readModelUnreachable,
|
|
799
|
+
'permission.allowed_tool_not_granted': readAllowedToolNotGranted,
|
|
733
800
|
'task.tool_turn_incomplete': readToolTurnIncomplete,
|
|
734
801
|
'task.user_steer_undrained': readUserInputUndrained,
|
|
735
802
|
'task.user_followup_undrained': readUserInputUndrained,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isEngineRefusedToolName(name: string): boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CORE_PROTOCOL_PREFIXES, CORE_RETIRED_TOOL_CURRENT_NAMES } from './generated/toolNameTables.js';
|
|
2
|
+
export function isEngineRefusedToolName(name) {
|
|
3
|
+
if (typeof name !== 'string')
|
|
4
|
+
return false;
|
|
5
|
+
if (CORE_RETIRED_TOOL_CURRENT_NAMES.has(name))
|
|
6
|
+
return true;
|
|
7
|
+
return name.includes('__') && !CORE_PROTOCOL_PREFIXES.some((prefix) => name.startsWith(prefix));
|
|
8
|
+
}
|
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;
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
import { capForDisplay } from './fleetTaskDesc.js';
|
|
2
2
|
import { engineWireTarget } from './engineWireTarget.js';
|
|
3
|
-
import {
|
|
3
|
+
import { createEngineCapReader } from './engineCapReader.js';
|
|
4
|
+
import { ownDataField } from './ownKey.js';
|
|
4
5
|
export function projectExecutionLaneCapability(caps) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
try {
|
|
7
|
+
if (caps === null || typeof caps !== 'object')
|
|
8
|
+
return undefined;
|
|
9
|
+
if (caps === null || typeof caps !== 'object' || Array.isArray(caps))
|
|
10
|
+
return undefined;
|
|
11
|
+
const lane = ownDataField(caps, 'executionLane');
|
|
12
|
+
if (lane === undefined)
|
|
13
|
+
return { kind: 'not_reported' };
|
|
14
|
+
return projectExecutionLaneObject(lane);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
8
17
|
return undefined;
|
|
9
|
-
|
|
10
|
-
return { kind: 'not_reported' };
|
|
11
|
-
const lane = caps.executionLane;
|
|
12
|
-
if (lane === undefined)
|
|
13
|
-
return { kind: 'not_reported' };
|
|
14
|
-
return projectExecutionLaneObject(lane, () => capsGenerationOf(caps).generation === 'new');
|
|
18
|
+
}
|
|
15
19
|
}
|
|
16
|
-
function projectExecutionLaneObject(lane
|
|
20
|
+
function projectExecutionLaneObject(lane) {
|
|
17
21
|
if (lane === null || typeof lane !== 'object' || Array.isArray(lane))
|
|
18
22
|
return undefined;
|
|
19
|
-
const provider = lane
|
|
20
|
-
const toolsOnThisHost = lane
|
|
23
|
+
const provider = ownDataField(lane, 'provider');
|
|
24
|
+
const toolsOnThisHost = ownDataField(lane, 'toolsOnThisHost');
|
|
21
25
|
if (typeof provider !== 'string' || provider === '')
|
|
22
26
|
return undefined;
|
|
23
27
|
if (typeof toolsOnThisHost !== 'boolean')
|
|
@@ -25,26 +29,24 @@ function projectExecutionLaneObject(lane, newGeneration) {
|
|
|
25
29
|
let isolated;
|
|
26
30
|
let isolatedThrew = false;
|
|
27
31
|
try {
|
|
28
|
-
isolated =
|
|
32
|
+
isolated = ownDataField(lane, 'isolated');
|
|
29
33
|
}
|
|
30
34
|
catch {
|
|
31
35
|
isolatedThrew = true;
|
|
32
36
|
}
|
|
33
37
|
if (!isolatedThrew && typeof isolated === 'boolean')
|
|
34
38
|
return { kind: 'present', view: { provider, toolsOnThisHost, isolated } };
|
|
35
|
-
const isolatedAbsent = isolatedThrew || isolated !== undefined ? 'unreadable' :
|
|
39
|
+
const isolatedAbsent = isolatedThrew || isolated !== undefined ? 'unreadable' : toolsOnThisHost ? 'unreadable' : 'no_hands';
|
|
36
40
|
return { kind: 'present', view: { provider, toolsOnThisHost, isolatedAbsent } };
|
|
37
41
|
}
|
|
38
42
|
export function projectExecutionLaneWiring(wiring) {
|
|
39
43
|
try {
|
|
40
44
|
if (wiring === null || typeof wiring !== 'object' || Array.isArray(wiring))
|
|
41
45
|
return undefined;
|
|
42
|
-
|
|
43
|
-
return { kind: 'not_reported' };
|
|
44
|
-
const lane = wiring.executionLane;
|
|
46
|
+
const lane = ownDataField(wiring, 'executionLane');
|
|
45
47
|
if (lane === undefined)
|
|
46
48
|
return { kind: 'not_reported' };
|
|
47
|
-
return projectExecutionLaneObject(lane
|
|
49
|
+
return projectExecutionLaneObject(lane);
|
|
48
50
|
}
|
|
49
51
|
catch {
|
|
50
52
|
return undefined;
|
|
@@ -61,12 +63,13 @@ export function noteEngineCapsForExecutionLane(baseUrl, caps, opts) {
|
|
|
61
63
|
export function observedExecutionLane(baseUrl = engineWireTarget()?.baseUrl) {
|
|
62
64
|
return reader.observed(baseUrl);
|
|
63
65
|
}
|
|
64
|
-
export function toolsRunHereFromExecutionLane(reading
|
|
65
|
-
|
|
66
|
-
return reading.view.toolsOnThisHost;
|
|
67
|
-
|
|
66
|
+
export function toolsRunHereFromExecutionLane(reading) {
|
|
67
|
+
try {
|
|
68
|
+
return reading.kind === 'present' && reading.view.toolsOnThisHost === true;
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
68
71
|
return false;
|
|
69
|
-
|
|
72
|
+
}
|
|
70
73
|
}
|
|
71
74
|
export function noOsSandboxOnThisHost(reading) {
|
|
72
75
|
if (typeof reading !== 'object' || reading === null)
|
|
@@ -100,7 +103,7 @@ export function executionLaneDoctorDetail(reading) {
|
|
|
100
103
|
'this process has no usable capabilities reading cached for it (none received, the last one was unreadable, or the last one was discarded when the engine connection was reset; this process cannot tell which)');
|
|
101
104
|
case 'not_reported':
|
|
102
105
|
return ('execution lane not reported by this engine; ' +
|
|
103
|
-
'this does not say where tools run, so
|
|
106
|
+
'this does not say where tools run, so skill baseDir is not sent until the engine reports it');
|
|
104
107
|
case 'present': {
|
|
105
108
|
const lane = capForDisplay(reading.view.provider, LANE_DETAIL_MAX);
|
|
106
109
|
if (reading.view.toolsOnThisHost) {
|
|
@@ -113,9 +116,6 @@ export function executionLaneDoctorDetail(reading) {
|
|
|
113
116
|
}
|
|
114
117
|
}
|
|
115
118
|
}
|
|
116
|
-
export function forgetExecutionLaneReading(baseUrl) {
|
|
117
|
-
reader.forget(baseUrl);
|
|
118
|
-
}
|
|
119
119
|
export function __resetExecutionLaneReadingsForTests() {
|
|
120
120
|
reader.__resetForTests();
|
|
121
121
|
}
|
|
@@ -17,5 +17,4 @@ export declare function fileHistoryDeclarationField(reading: FileHistoryCaptureR
|
|
|
17
17
|
fileHistory: 'disabled';
|
|
18
18
|
} | Record<string, never>;
|
|
19
19
|
export declare function fileHistoryCaptureDoctorDetail(reading: FileHistoryCaptureReading): string;
|
|
20
|
-
export declare function forgetFileHistoryCaptureReading(baseUrl: string | undefined): void;
|
|
21
20
|
export declare function __resetFileHistoryCaptureReadingsForTests(): void;
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { capForDisplay } from './fleetTaskDesc.js';
|
|
2
2
|
import { engineWireTarget } from './engineWireTarget.js';
|
|
3
3
|
import { createEngineCapReader } from './engineCapReader.js';
|
|
4
|
+
import { ownDataField } from './ownKey.js';
|
|
4
5
|
import { FILE_HISTORY_DISABLED } from './request/taskRequest.js';
|
|
5
6
|
export function projectFileHistoryCaptureCapability(caps) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
try {
|
|
8
|
+
if (caps === null || typeof caps !== 'object' || Array.isArray(caps))
|
|
9
|
+
return undefined;
|
|
10
|
+
const v = ownDataField(caps, 'fileHistoryCapture');
|
|
11
|
+
if (v === undefined)
|
|
12
|
+
return { kind: 'not_reported' };
|
|
13
|
+
if (typeof v !== 'string' || v.length === 0)
|
|
14
|
+
return undefined;
|
|
15
|
+
return { kind: 'present', word: v };
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
14
18
|
return undefined;
|
|
15
|
-
|
|
19
|
+
}
|
|
16
20
|
}
|
|
17
21
|
const reader = createEngineCapReader({
|
|
18
22
|
name: 'fileHistoryCapture',
|
|
@@ -79,9 +83,6 @@ export function fileHistoryCaptureDoctorDetail(reading) {
|
|
|
79
83
|
return unobserved;
|
|
80
84
|
}
|
|
81
85
|
}
|
|
82
|
-
export function forgetFileHistoryCaptureReading(baseUrl) {
|
|
83
|
-
reader.forget(baseUrl);
|
|
84
|
-
}
|
|
85
86
|
export function __resetFileHistoryCaptureReadingsForTests() {
|
|
86
87
|
reader.__resetForTests();
|
|
87
88
|
}
|
|
@@ -4,7 +4,7 @@ export type FileHistoryDeclarationFact = 'sent' | 'not_sent' | 'unknown';
|
|
|
4
4
|
export declare const FILE_HISTORY_LEG_VERDICTS: readonly ["not_honored", "honored", "not_declared", "unknown"];
|
|
5
5
|
export type FileHistoryLegNoticeVerdict = (typeof FILE_HISTORY_LEG_VERDICTS)[number];
|
|
6
6
|
export interface FileHistoryLegNoticeInput {
|
|
7
|
-
readonly
|
|
7
|
+
readonly assemblyCapability: FileHistoryCaptureReading;
|
|
8
8
|
readonly declaration: FileHistoryDeclarationFact;
|
|
9
9
|
readonly captureOffByUser: boolean;
|
|
10
10
|
readonly legWord: string | undefined;
|
|
@@ -12,9 +12,21 @@ export interface FileHistoryLegNoticeInput {
|
|
|
12
12
|
export declare function fileHistoryLegNoticeVerdict(input: FileHistoryLegNoticeInput): FileHistoryLegNoticeVerdict;
|
|
13
13
|
export declare function fileHistoryLegNoticeSentence(verdict: FileHistoryLegNoticeVerdict): string | null;
|
|
14
14
|
export declare function fileHistoryDeclarationOfBody(body: object | null | undefined): FileHistoryDeclarationFact;
|
|
15
|
+
export type OutboundBodyField = {
|
|
16
|
+
kind: 'absent';
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'value';
|
|
19
|
+
value: unknown;
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'unprovable';
|
|
22
|
+
};
|
|
23
|
+
export declare function readOutboundBodyField(body: object | null | undefined, key: string): OutboundBodyField;
|
|
15
24
|
export interface FileHistoryDeclarationLedger {
|
|
16
|
-
declared(requestKey: string, fact: FileHistoryDeclarationFact): boolean;
|
|
25
|
+
declared(requestKey: string, fact: FileHistoryDeclarationFact, capabilityAtAssembly?: FileHistoryCaptureReading): boolean;
|
|
17
26
|
boundToRun(requestKey: string, runId: string, event: AgentEvent): boolean;
|
|
18
27
|
declarationOf(runId: string): FileHistoryDeclarationFact;
|
|
28
|
+
declaredLegCwd(requestKey: string, cwd: string | undefined): boolean;
|
|
29
|
+
legCwdOf(runId: string): string | undefined;
|
|
30
|
+
capabilityAtAssemblyOf(runId: string): FileHistoryCaptureReading;
|
|
19
31
|
}
|
|
20
32
|
export declare function createFileHistoryDeclarationLedger(): FileHistoryDeclarationLedger;
|
|
@@ -16,7 +16,7 @@ export function fileHistoryLegNoticeVerdict(input) {
|
|
|
16
16
|
let offByUser;
|
|
17
17
|
let legWord;
|
|
18
18
|
try {
|
|
19
|
-
capability = ownRead(input, '
|
|
19
|
+
capability = ownRead(input, 'assemblyCapability');
|
|
20
20
|
declaration = declarationOfInput(ownRead(input, 'declaration'));
|
|
21
21
|
offByUser = ownRead(input, 'captureOffByUser') === true;
|
|
22
22
|
legWord = ownRead(input, 'legWord');
|
|
@@ -42,50 +42,136 @@ export function fileHistoryLegNoticeSentence(verdict) {
|
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
44
44
|
export function fileHistoryDeclarationOfBody(body) {
|
|
45
|
-
|
|
45
|
+
const r = readOutboundBodyField(body, 'fileHistory');
|
|
46
|
+
if (r.kind === 'unprovable')
|
|
46
47
|
return 'unknown';
|
|
48
|
+
if (r.kind === 'absent')
|
|
49
|
+
return 'not_sent';
|
|
50
|
+
return r.value === FILE_HISTORY_DISABLED ? 'sent' : 'not_sent';
|
|
51
|
+
}
|
|
52
|
+
export function readOutboundBodyField(body, key) {
|
|
53
|
+
const UNPROVABLE = { kind: 'unprovable' };
|
|
54
|
+
if (typeof body !== 'object' || body === null)
|
|
55
|
+
return UNPROVABLE;
|
|
47
56
|
try {
|
|
48
57
|
if (Array.isArray(body))
|
|
49
|
-
return
|
|
58
|
+
return UNPROVABLE;
|
|
50
59
|
if (typeof body.toJSON === 'function')
|
|
51
|
-
return
|
|
52
|
-
const d = Object.getOwnPropertyDescriptor(body,
|
|
60
|
+
return UNPROVABLE;
|
|
61
|
+
const d = Object.getOwnPropertyDescriptor(body, key);
|
|
53
62
|
const all = Object.getOwnPropertyDescriptors(body);
|
|
54
63
|
for (const k of Reflect.ownKeys(all)) {
|
|
55
64
|
const x = all[k];
|
|
56
65
|
if (x !== undefined && x.enumerable === true && !Object.hasOwn(x, 'value'))
|
|
57
|
-
return
|
|
66
|
+
return UNPROVABLE;
|
|
58
67
|
}
|
|
59
|
-
const listed = Object.hasOwn(all,
|
|
68
|
+
const listed = Object.hasOwn(all, key) ? all[key] : undefined;
|
|
60
69
|
const listedOn = listed !== undefined && listed.enumerable === true;
|
|
61
70
|
if (d === undefined || d.enumerable !== true)
|
|
62
|
-
return listedOn ?
|
|
71
|
+
return listedOn ? UNPROVABLE : { kind: 'absent' };
|
|
63
72
|
if (!Object.hasOwn(d, 'value') || !listedOn || !Object.hasOwn(listed, 'value') || !Object.is(listed.value, d.value))
|
|
64
|
-
return
|
|
65
|
-
if (!Object.is(body
|
|
66
|
-
return
|
|
73
|
+
return UNPROVABLE;
|
|
74
|
+
if (!Object.is(body[key], d.value))
|
|
75
|
+
return UNPROVABLE;
|
|
67
76
|
if (typeof d.value === 'object' && d.value !== null)
|
|
68
|
-
return
|
|
69
|
-
return
|
|
77
|
+
return UNPROVABLE;
|
|
78
|
+
return { kind: 'value', value: d.value };
|
|
70
79
|
}
|
|
71
80
|
catch {
|
|
72
|
-
return
|
|
81
|
+
return UNPROVABLE;
|
|
73
82
|
}
|
|
74
83
|
}
|
|
75
84
|
const idOk = (v) => typeof v === 'string' && v.length > 0;
|
|
85
|
+
function canonReading(r) {
|
|
86
|
+
try {
|
|
87
|
+
if (typeof r !== 'object' || r === null)
|
|
88
|
+
return 'unobserved';
|
|
89
|
+
const kind = r.kind;
|
|
90
|
+
if (kind === 'not_reported')
|
|
91
|
+
return 'not_reported';
|
|
92
|
+
if (kind === 'present') {
|
|
93
|
+
const word = r.word;
|
|
94
|
+
return typeof word === 'string' && word.length > 0 ? `present:${word}` : 'unobserved';
|
|
95
|
+
}
|
|
96
|
+
return 'unobserved';
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
return 'unobserved';
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function readingOfCanon(c) {
|
|
103
|
+
if (c === 'not_reported')
|
|
104
|
+
return { kind: 'not_reported' };
|
|
105
|
+
if (c.startsWith('present:'))
|
|
106
|
+
return { kind: 'present', word: c.slice('present:'.length) };
|
|
107
|
+
return { kind: 'unobserved' };
|
|
108
|
+
}
|
|
76
109
|
export function createFileHistoryDeclarationLedger() {
|
|
77
110
|
const factsByKey = new Map();
|
|
111
|
+
const cwdsByKey = new Map();
|
|
78
112
|
const keysByRun = new Map();
|
|
113
|
+
const readingsByKey = new Map();
|
|
79
114
|
return Object.freeze({
|
|
80
|
-
|
|
115
|
+
declaredLegCwd(requestKey, cwd) {
|
|
116
|
+
if (!idOk(requestKey) || !idOk(cwd))
|
|
117
|
+
return false;
|
|
118
|
+
let set = cwdsByKey.get(requestKey);
|
|
119
|
+
if (set === undefined)
|
|
120
|
+
cwdsByKey.set(requestKey, (set = new Set()));
|
|
121
|
+
set.add(cwd);
|
|
122
|
+
return true;
|
|
123
|
+
},
|
|
124
|
+
legCwdOf(runId) {
|
|
125
|
+
if (!idOk(runId))
|
|
126
|
+
return undefined;
|
|
127
|
+
const keys = keysByRun.get(runId);
|
|
128
|
+
if (keys === undefined)
|
|
129
|
+
return undefined;
|
|
130
|
+
let agreed;
|
|
131
|
+
for (const k of keys) {
|
|
132
|
+
const cwds = cwdsByKey.get(k);
|
|
133
|
+
if (cwds === undefined || cwds.size !== 1)
|
|
134
|
+
return undefined;
|
|
135
|
+
const [only] = cwds;
|
|
136
|
+
if (only === undefined || (agreed !== undefined && agreed !== only))
|
|
137
|
+
return undefined;
|
|
138
|
+
agreed = only;
|
|
139
|
+
}
|
|
140
|
+
return agreed;
|
|
141
|
+
},
|
|
142
|
+
declared(requestKey, fact, capabilityAtAssembly) {
|
|
81
143
|
if (!idOk(requestKey) || (fact !== 'sent' && fact !== 'not_sent'))
|
|
82
144
|
return false;
|
|
83
145
|
let set = factsByKey.get(requestKey);
|
|
84
146
|
if (set === undefined)
|
|
85
147
|
factsByKey.set(requestKey, (set = new Set()));
|
|
86
148
|
set.add(fact);
|
|
149
|
+
if (capabilityAtAssembly !== undefined) {
|
|
150
|
+
let rs = readingsByKey.get(requestKey);
|
|
151
|
+
if (rs === undefined)
|
|
152
|
+
readingsByKey.set(requestKey, (rs = new Set()));
|
|
153
|
+
rs.add(canonReading(capabilityAtAssembly));
|
|
154
|
+
}
|
|
87
155
|
return true;
|
|
88
156
|
},
|
|
157
|
+
capabilityAtAssemblyOf(runId) {
|
|
158
|
+
if (!idOk(runId))
|
|
159
|
+
return { kind: 'unobserved' };
|
|
160
|
+
const keys = keysByRun.get(runId);
|
|
161
|
+
if (keys === undefined)
|
|
162
|
+
return { kind: 'unobserved' };
|
|
163
|
+
let agreed;
|
|
164
|
+
for (const k of keys) {
|
|
165
|
+
const rs = readingsByKey.get(k);
|
|
166
|
+
if (rs === undefined || rs.size !== 1)
|
|
167
|
+
return { kind: 'unobserved' };
|
|
168
|
+
const [only] = rs;
|
|
169
|
+
if (only === undefined || (agreed !== undefined && agreed !== only))
|
|
170
|
+
return { kind: 'unobserved' };
|
|
171
|
+
agreed = only;
|
|
172
|
+
}
|
|
173
|
+
return agreed === undefined ? { kind: 'unobserved' } : readingOfCanon(agreed);
|
|
174
|
+
},
|
|
89
175
|
boundToRun(requestKey, runId, event) {
|
|
90
176
|
if (!idOk(requestKey) || !idOk(runId) || !frameProvesDelivery(event))
|
|
91
177
|
return false;
|
|
@@ -18,6 +18,8 @@ export declare function readEngineActiveBgTasks(): EngineActiveBgReading;
|
|
|
18
18
|
export declare function readEngineActiveBgTasksFor(sessionKey: string): EngineActiveBgReading;
|
|
19
19
|
export declare function clearAllRetainedFleetRows(): void;
|
|
20
20
|
export declare function clearAllRetainedFleetRowsFor(sessionKey: string): void;
|
|
21
|
+
export declare function forgetSettledTerminalRow(id: string): boolean;
|
|
22
|
+
export declare function forgetSettledTerminalRowFor(sessionKey: string, id: string): boolean;
|
|
21
23
|
export declare function __resetFleetLedgerRegistryForTests(): void;
|
|
22
24
|
export declare function fleetStreamOptions(): {
|
|
23
25
|
session?: string;
|