@sema-agent/client-core 0.100.0 → 0.102.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 +452 -0
- package/README.md +172 -120
- package/dist/adapt/arms.js +51 -16
- package/dist/adapt/textStream.js +7 -4
- package/dist/adapt/toolCards.d.ts +2 -1
- package/dist/adapt/toolCards.js +28 -13
- package/dist/adapt.d.ts +1 -1
- package/dist/adapt.js +8 -2
- package/dist/adapter/activeRunSelfHeal.d.ts +24 -2
- package/dist/adapter/activeRunSelfHeal.js +108 -6
- package/dist/adapter/downstream/eventToSdkMessage.js +38 -79
- package/dist/adapter/downstream/terminalToSdkResult.d.ts +60 -1
- package/dist/adapter/downstream/terminalToSdkResult.js +209 -39
- package/dist/adapter/downstream/wiringManifestView.d.ts +1 -0
- package/dist/adapter/downstream/wiringManifestView.js +138 -0
- package/dist/adapter/runStream.d.ts +4 -4
- package/dist/adapter/runStream.js +158 -43
- package/dist/agentsWireCaps.d.ts +2 -7
- package/dist/agentsWireCaps.js +1 -2
- package/dist/approvalDecidedByCapability.js +2 -2
- package/dist/approvalFrameFamilies.d.ts +33 -0
- package/dist/approvalFrameFamilies.js +120 -0
- package/dist/approvalsStreamLiveCapability.js +2 -2
- package/dist/attachmentsWireCaps.js +41 -13
- package/dist/callerCwdCapability.js +2 -2
- package/dist/centerWiringCapability.js +2 -2
- package/dist/clockReading.d.ts +2 -0
- package/dist/clockReading.js +4 -0
- package/dist/cloudConfigWireCaps.d.ts +19 -5
- package/dist/cloudConfigWireCaps.js +193 -56
- package/dist/compensations.js +1 -1
- package/dist/coreValuePorts.d.ts +12 -2
- package/dist/coreValuePorts.js +9 -0
- package/dist/decideFailureNote.js +5 -3
- package/dist/decideReceipt.js +2 -2
- package/dist/deviceExecutorManagementCapability.js +2 -2
- package/dist/deviceFlowPolling.js +1 -1
- package/dist/disableSkillsWire.d.ts +1 -1
- package/dist/disableSkillsWire.js +4 -3
- package/dist/displayUntrusted.d.ts +9 -4
- package/dist/displayUntrusted.js +834 -104
- package/dist/engineCapReader.js +1 -1
- package/dist/engineConfigDrift.js +1 -1
- package/dist/engineErrorCodes.d.ts +14 -5
- package/dist/engineErrorCodes.js +27 -6
- package/dist/engineGenerationConvergence.d.ts +39 -0
- package/dist/engineGenerationConvergence.js +95 -0
- package/dist/engineGenerationPort.d.ts +61 -0
- package/dist/engineGenerationPort.js +144 -0
- package/dist/engineHealthFacts.d.ts +23 -0
- package/dist/engineHealthFacts.js +92 -0
- package/dist/engineIdentity.d.ts +4 -0
- package/dist/engineIdentity.js +11 -0
- package/dist/engineNoticeCodes.d.ts +2 -5
- package/dist/engineRowRef.js +4 -0
- package/dist/engineSessionMessages.js +2 -2
- package/dist/engineToolDirectory.js +2 -2
- package/dist/engineWireFor.d.ts +99 -0
- package/dist/engineWireFor.js +248 -6
- package/dist/engineWireTarget.d.ts +1 -0
- package/dist/engineWireTarget.js +8 -0
- package/dist/env/uiLanguage.js +1 -1
- package/dist/errorSupplementRoles.d.ts +3 -0
- package/dist/errorSupplementRoles.js +37 -0
- package/dist/executionLaneCapability.js +2 -2
- package/dist/fileHistoryCaptureCapability.js +3 -3
- package/dist/finalVerifyWire.d.ts +6 -3
- package/dist/finalVerifyWire.js +6 -23
- package/dist/flagInput.d.ts +4 -0
- package/dist/flagInput.js +24 -0
- package/dist/fleet/fleetLedger.js +5 -2
- package/dist/fleet/fleetProjection.d.ts +1 -0
- package/dist/fleet/fleetProjection.js +16 -3
- package/dist/gateVocabulary.js +3 -0
- package/dist/generated/engineFactTables.d.ts +7 -3
- package/dist/generated/engineFactTables.js +52 -0
- package/dist/generated/engineNoticeTables.js +12 -0
- package/dist/generated/settingsSchemaActiveTiers.d.ts +1 -0
- package/dist/generated/settingsSchemaActiveTiers.js +14 -0
- package/dist/generated/settingsSchemaCallerTextEcho.d.ts +1 -0
- package/dist/generated/settingsSchemaCallerTextEcho.js +8 -0
- package/dist/generated/settingsSchemaControlAndBidi.d.ts +1 -0
- package/dist/generated/settingsSchemaControlAndBidi.js +8 -0
- package/dist/generated/settingsSchemaDefaultModel.d.ts +11 -0
- package/dist/generated/settingsSchemaDefaultModel.js +25 -0
- package/dist/generated/settingsSchemaFns.d.ts +54 -0
- package/dist/generated/settingsSchemaFns.js +26 -1
- package/dist/generated/settingsSchemaMcpRequestEntry.d.ts +1 -1
- package/dist/generated/settingsSchemaMcpRequestEntry.js +1 -7
- package/dist/generated/settingsSchemaSafetyMergeSpec.d.ts +1 -0
- package/dist/generated/settingsSchemaSafetyMergeSpec.js +95 -0
- package/dist/generated/settingsSchemaSettingsSources.d.ts +1 -0
- package/dist/generated/settingsSchemaSettingsSources.js +58 -0
- package/dist/generated/settingsSchemaTables.d.ts +2 -0
- package/dist/generated/settingsSchemaTables.js +13 -0
- package/dist/generated/settingsSchemaUrlPattern.d.ts +1 -0
- package/dist/generated/settingsSchemaUrlPattern.js +183 -0
- package/dist/headlessPermissionModeWire.d.ts +18 -2
- package/dist/headlessPermissionModeWire.js +30 -19
- package/dist/hitl/allowRuleShadow.js +7 -5
- package/dist/hitl/approvalCardReading.d.ts +3 -0
- package/dist/hitl/approvalCardReading.js +17 -0
- package/dist/hitl/approvalCompleteParked.js +1 -1
- package/dist/hitl/approvalDelivery.d.ts +87 -0
- package/dist/hitl/approvalDelivery.js +193 -0
- package/dist/hitl/approvalResolution.d.ts +11 -0
- package/dist/hitl/approvalResolution.js +50 -11
- package/dist/hitl/askClassPair.d.ts +6 -0
- package/dist/hitl/askClassPair.js +30 -3
- package/dist/hitl/askParkAutoReopenBlock.d.ts +30 -0
- package/dist/hitl/askParkAutoReopenBlock.js +117 -0
- package/dist/hitl/askParkRowRouting.js +4 -1
- package/dist/hitl/attributionLadder.d.ts +42 -3
- package/dist/hitl/attributionLadder.js +79 -8
- package/dist/hitl/automaticAnswerVerdict.d.ts +6 -1
- package/dist/hitl/automaticAnswerVerdict.js +46 -11
- package/dist/hitl/crashConverged.js +2 -2
- package/dist/hitl/decisionConflict.d.ts +6 -2
- package/dist/hitl/decisionConflict.js +24 -9
- package/dist/hitl/decisionRefusal.d.ts +20 -10
- package/dist/hitl/decisionRefusal.js +99 -54
- package/dist/hitl/decisionSend.d.ts +3 -0
- package/dist/hitl/decisionSend.js +87 -103
- package/dist/hitl/frameRouter.d.ts +1 -0
- package/dist/hitl/frameRouter.js +9 -2
- package/dist/hitl/hitlBridge.d.ts +18 -6
- package/dist/hitl/hitlBridge.js +41 -37
- package/dist/hitl/livePendingAsk.js +4 -3
- package/dist/hitl/noAllowCause.js +1 -1
- package/dist/hitl/parkResolver.js +3 -2
- package/dist/hitl/persistedRulesWire.js +1 -0
- package/dist/hitl/planReviewWire.d.ts +4 -0
- package/dist/hitl/planReviewWire.js +59 -30
- package/dist/hitl/resumeRunningCard.d.ts +3 -2
- package/dist/hitl/resumeRunningCard.js +17 -11
- package/dist/hitl/sessionPolicyDeliverable.d.ts +5 -2
- package/dist/hitl/sessionPolicyDeliverable.js +62 -29
- package/dist/hitl/sessionPolicyWire.d.ts +13 -3
- package/dist/hitl/sessionPolicyWire.js +81 -16
- package/dist/hitl/standingRows.js +1 -1
- package/dist/hitl/toolApprovalWire.d.ts +9 -10
- package/dist/hitl/toolApprovalWire.js +72 -54
- package/dist/hookMatcherVerdict.d.ts +2 -0
- package/dist/hookMatcherVerdict.js +12 -0
- package/dist/hooksCompactTransition.d.ts +19 -0
- package/dist/hooksCompactTransition.js +41 -0
- package/dist/hooksWireCaps.d.ts +1 -1
- package/dist/hooksWireCaps.js +202 -203
- package/dist/host.d.ts +1 -14
- package/dist/host.js +0 -8
- package/dist/hostCallbackGuard.d.ts +1 -0
- package/dist/hostCallbackGuard.js +1 -1
- package/dist/hostSettingsSource.d.ts +172 -0
- package/dist/hostSettingsSource.js +675 -0
- package/dist/hostTurnSettings.d.ts +73 -17
- package/dist/hostTurnSettings.js +594 -97
- package/dist/httpHookPolicy.d.ts +37 -0
- package/dist/httpHookPolicy.js +176 -0
- package/dist/humanTurn.d.ts +2 -1
- package/dist/humanTurn.js +37 -7
- package/dist/humanTurnRead.js +4 -3
- package/dist/humanTurnSentences.d.ts +10 -0
- package/dist/humanTurnSentences.js +74 -0
- package/dist/i18n/messages.en.d.ts +222 -2
- package/dist/i18n/messages.en.js +225 -5
- package/dist/i18n/messages.zh.js +237 -5
- package/dist/i18n/translate.js +3 -3
- package/dist/index.d.ts +77 -15
- package/dist/index.js +50 -13
- package/dist/inheritEnvCapability.d.ts +3 -1
- package/dist/inheritEnvCapability.js +31 -17
- package/dist/inheritEnvWire.d.ts +2 -1
- package/dist/inheritEnvWire.js +11 -5
- package/dist/interactiveHalt.d.ts +3 -1
- package/dist/interactiveHalt.js +2 -0
- package/dist/interactiveInterrupt.d.ts +2 -0
- package/dist/interactiveInterrupt.js +15 -0
- package/dist/interactiveToolsWire.d.ts +4 -2
- package/dist/interactiveToolsWire.js +5 -5
- package/dist/jsonFaithful.d.ts +20 -0
- package/dist/jsonFaithful.js +152 -0
- package/dist/limitsWire.d.ts +7 -2
- package/dist/limitsWire.js +19 -13
- package/dist/liveInitToolFace.d.ts +6 -1
- package/dist/liveInitToolFace.js +5 -3
- package/dist/liveModelCatalog.d.ts +22 -0
- package/dist/liveModelCatalog.js +132 -18
- package/dist/mcpPanel.js +1 -1
- package/dist/mcpProbeCapability.js +2 -2
- package/dist/mcpStatusSupersetKeys.d.ts +24 -0
- package/dist/mcpStatusSupersetKeys.js +45 -0
- package/dist/mcpToolToggles.js +2 -1
- package/dist/mcpWireCaps.d.ts +39 -1
- package/dist/mcpWireCaps.js +254 -50
- package/dist/memoryComplianceCapability.js +2 -2
- package/dist/memoryOriginCapability.js +2 -2
- package/dist/model/catalogDefault.d.ts +24 -0
- package/dist/model/catalogDefault.js +4 -0
- package/dist/model/liveCatalogShape.js +5 -4
- package/dist/model/modelsPolicy.js +4 -3
- package/dist/model/onboardJudgement.d.ts +1 -0
- package/dist/model/onboardJudgement.js +1 -1
- package/dist/model/subagentModelWord.js +2 -2
- package/dist/modelCapabilityProbe.js +6 -6
- package/dist/modelIdentityResolvability.d.ts +10 -1
- package/dist/modelIdentityResolvability.js +62 -39
- package/dist/modsFace.d.ts +8 -0
- package/dist/modsFace.js +59 -0
- package/dist/modsKernelIdentity.d.ts +10 -0
- package/dist/modsKernelIdentity.js +103 -0
- package/dist/modsKernelTransit.d.ts +8 -0
- package/dist/modsKernelTransit.js +6 -0
- package/dist/notifications.d.ts +30 -12
- package/dist/notifications.js +241 -53
- package/dist/outputStyleSeatCapability.js +2 -2
- package/dist/ownKey.d.ts +12 -0
- package/dist/ownKey.js +179 -3
- package/dist/panelReduce.js +1 -1
- package/dist/peerFrames.d.ts +1 -1
- package/dist/peerFrames.js +6 -2
- package/dist/peerLaneCapability.js +2 -2
- package/dist/permissionModesCapability.js +4 -4
- package/dist/permissionRuleIssue.js +2 -0
- package/dist/permissionRulesWriteCapability.js +2 -2
- package/dist/permissionsAllowGrantCapability.js +2 -2
- package/dist/permissionsDeclaration.d.ts +43 -4
- package/dist/permissionsDeclaration.js +102 -35
- package/dist/pluginHooksWire.d.ts +20 -4
- package/dist/pluginHooksWire.js +92 -53
- package/dist/prepareRefusal.d.ts +3 -2
- package/dist/prepareRefusal.js +27 -9
- package/dist/printInitToolFace.js +2 -2
- package/dist/printModelStatus.js +1 -1
- package/dist/printToolResultFrame.js +1 -1
- package/dist/projectMemory.d.ts +32 -0
- package/dist/projectMemory.js +70 -0
- package/dist/promptBlockedCopy.d.ts +2 -1
- package/dist/promptBlockedCopy.js +2 -1
- package/dist/promptDelivery.d.ts +23 -3
- package/dist/promptDelivery.js +169 -30
- package/dist/providerRejection.d.ts +19 -1
- package/dist/providerRejection.js +75 -4
- package/dist/queuedDelivery.d.ts +48 -0
- package/dist/queuedDelivery.js +233 -0
- package/dist/reattachWindow.d.ts +94 -0
- package/dist/reattachWindow.js +127 -0
- package/dist/request/printNotification.d.ts +1 -1
- package/dist/request/printNotification.js +6 -2
- package/dist/request/submissionIdentity.d.ts +37 -0
- package/dist/request/submissionIdentity.js +65 -0
- package/dist/request/taskRequest.d.ts +33 -4
- package/dist/request/taskRequest.js +341 -156
- package/dist/resultFrameKeys.d.ts +1 -0
- package/dist/resultFrameKeys.js +4 -1
- package/dist/retryStatus.d.ts +8 -0
- package/dist/retryStatus.js +57 -9
- package/dist/rewindArchiveCapability.js +2 -2
- package/dist/rewindEngineAction.d.ts +2 -0
- package/dist/rewindEngineAction.js +23 -1
- package/dist/rowKind.d.ts +36 -0
- package/dist/rowKind.js +97 -0
- package/dist/ruleCompileVerdict.d.ts +18 -0
- package/dist/ruleCompileVerdict.js +67 -2
- package/dist/ruleReadings.d.ts +58 -0
- package/dist/ruleReadings.js +132 -0
- package/dist/ruleRefusalSentence.d.ts +4 -0
- package/dist/ruleRefusalSentence.js +9 -3
- package/dist/runCancelContext.d.ts +0 -1
- package/dist/runCancelContext.js +1 -2
- package/dist/runTerminal.d.ts +5 -0
- package/dist/runTerminal.js +52 -17
- package/dist/sandboxWire.d.ts +1 -1
- package/dist/sandboxWire.js +4 -6
- package/dist/scenarioRefusal.js +1 -1
- package/dist/scenarioSkills.d.ts +20 -0
- package/dist/scenarioSkills.js +72 -0
- package/dist/scenarioWire.d.ts +5 -2
- package/dist/scenarioWire.js +9 -9
- package/dist/sealedKeyCapability.js +2 -2
- package/dist/seam.d.ts +2 -0
- package/dist/seam.js +3 -3
- package/dist/seatContract.d.ts +68 -7
- package/dist/seatContract.js +84 -25
- package/dist/selfOrchestrationDenial.js +1 -1
- package/dist/sessionBackground.d.ts +165 -0
- package/dist/sessionBackground.js +781 -0
- package/dist/sessionBackgroundHandoff.d.ts +54 -0
- package/dist/sessionBackgroundHandoff.js +321 -0
- package/dist/sessionMap.js +4 -1
- package/dist/sessionPolicyCapability.js +2 -2
- package/dist/sessionRulesChildrenReadLive.d.ts +6 -0
- package/dist/sessionRulesChildrenReadLive.js +5 -0
- package/dist/sessionRulesNamespaceFormsCapability.d.ts +12 -0
- package/dist/sessionRulesNamespaceFormsCapability.js +29 -0
- package/dist/sessionSyncFileHistoryCapability.js +2 -2
- package/dist/settingsCredentialKeyPaths.js +55 -15
- package/dist/settingsHooksSalvage.d.ts +1 -0
- package/dist/settingsHooksSalvage.js +7 -1
- package/dist/settingsLayerAdmission.d.ts +4 -0
- package/dist/settingsLayerAdmission.js +16 -0
- package/dist/skillToolListsCapability.js +6 -5
- package/dist/skillsWireCaps.d.ts +14 -0
- package/dist/skillsWireCaps.js +47 -16
- package/dist/slashCommandGate.d.ts +24 -0
- package/dist/slashCommandGate.js +74 -0
- package/dist/slashCommandTable.d.ts +14 -0
- package/dist/slashCommandTable.js +99 -0
- package/dist/sqlEngineCapability.js +2 -2
- package/dist/steerPriorityCapability.js +2 -2
- package/dist/storePostureCapability.js +2 -2
- package/dist/subagent/agentStateDetail.js +1 -1
- package/dist/subagent/engineDelegatedPrompt.d.ts +9 -0
- package/dist/subagent/engineDelegatedPrompt.js +38 -7
- package/dist/subagent/engineRowStopGate.js +2 -2
- package/dist/subagent/engineSubagentResume.js +3 -3
- package/dist/subagent/engineTaskHandleWire.d.ts +1 -0
- package/dist/subagent/engineTaskHandleWire.js +10 -0
- package/dist/submitFailure.d.ts +8 -0
- package/dist/submitFailure.js +17 -0
- package/dist/supportFloor.d.ts +1 -0
- package/dist/supportFloor.js +7 -0
- package/dist/terminationIntent.d.ts +55 -0
- package/dist/terminationIntent.js +352 -0
- package/dist/thinkingLatch.d.ts +69 -0
- package/dist/thinkingLatch.js +255 -0
- package/dist/thinkingLatchWords.d.ts +7 -0
- package/dist/thinkingLatchWords.js +4 -0
- package/dist/toolHistoryMismatch.d.ts +8 -0
- package/dist/toolHistoryMismatch.js +37 -6
- package/dist/toolResult.d.ts +13 -3
- package/dist/toolResult.js +159 -32
- package/dist/toolResultContent.d.ts +13 -0
- package/dist/toolResultContent.js +82 -7
- package/dist/toolRoster.d.ts +18 -0
- package/dist/toolRoster.js +64 -0
- package/dist/turnFailurePresentation.js +27 -90
- package/dist/usageLimitAutoResume.d.ts +74 -0
- package/dist/usageLimitAutoResume.js +227 -0
- package/dist/userAttachmentEnvelope.js +1 -1
- package/dist/userAttachmentSeat.js +5 -5
- package/dist/userInvokedSkillsCapability.js +2 -2
- package/dist/webSearchBackendCapability.js +2 -2
- package/dist/wireErrorTriage.js +99 -50
- package/dist/wireFailureShape.d.ts +25 -1
- package/dist/wireFailureShape.js +92 -5
- package/dist/wireRefusalCopy.d.ts +24 -1
- package/dist/wireRefusalCopy.js +253 -32
- package/dist/wiringFleetDoctor.d.ts +3 -0
- package/dist/wiringFleetDoctor.js +21 -0
- package/dist/workflow.d.ts +2 -1
- package/dist/workflow.js +38 -1
- package/dist/workflowClient.d.ts +2 -7
- package/dist/workflowsJournalCapability.js +2 -2
- package/dist/writeProtectionCapability.js +2 -2
- package/docs/INTEGRATION-CLIENTS.md +907 -182
- package/package.json +14 -3
- package/dist/argvFlagValue.d.ts +0 -8
- package/dist/argvFlagValue.js +0 -37
package/dist/seatContract.js
CHANGED
|
@@ -5,6 +5,7 @@ import { SETTINGS_MODEL_API_WORDS } from "./generated/settingsSchemaTables.js";
|
|
|
5
5
|
import { PROBE_VERDICTS } from "./modelCapabilityProbe.js";
|
|
6
6
|
import { guardedRead, ownDataField, ownDataRefusalKeyOf, ownSendableField, readOwnDataValue } from "./ownKey.js";
|
|
7
7
|
import { MCP_LIVENESS_STATES } from "./mcpLiveness.js";
|
|
8
|
+
import { THINKING_LATCH_EVENTS, THINKING_LATCH_ROW_WORDS } from "./thinkingLatchWords.js";
|
|
8
9
|
const bad = (reason, field) => field === undefined ? { reason } : { reason, field };
|
|
9
10
|
const nested = (prefix, verdict) => {
|
|
10
11
|
const path = verdict.field === undefined
|
|
@@ -62,7 +63,7 @@ const firstAccessorPath = (root) => {
|
|
|
62
63
|
const at = path === "" ? k : `${path}.${k}`;
|
|
63
64
|
if (!Object.hasOwn(d, "value"))
|
|
64
65
|
return at;
|
|
65
|
-
stack.
|
|
66
|
+
Object.defineProperty(stack, stack.length, { value: [d.value, at], writable: true, enumerable: true, configurable: true });
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
return undefined;
|
|
@@ -158,6 +159,7 @@ const oneOfRule = (label, words) => ruleOf(label, (v) => typeof v === "string" &
|
|
|
158
159
|
const R_STR = ruleOf("string", (v) => typeof v === "string");
|
|
159
160
|
const R_NONEMPTY = ruleOf("non-empty string", (v) => typeof v === "string" && v.length > 0);
|
|
160
161
|
const R_BOOL = ruleOf("boolean", (v) => typeof v === "boolean");
|
|
162
|
+
const R_THINKING_LATCH_ROW = oneOfRule("latch word", THINKING_LATCH_ROW_WORDS);
|
|
161
163
|
const R_TRUE = ruleOf("true", (v) => v === true);
|
|
162
164
|
const R_NUM = ruleOf("finite number", (v) => typeof v === "number" && Number.isFinite(v));
|
|
163
165
|
const R_INT0 = ruleOf("non-negative integer", (v) => typeof v === "number" && Number.isSafeInteger(v) && v >= 0);
|
|
@@ -197,7 +199,7 @@ const firstSecretKeyPath = (root, allow) => {
|
|
|
197
199
|
const at = isArr && /^[0-9]+$/.test(k) ? `${path}[${k}]` : pathAt(path, k);
|
|
198
200
|
if (isSecretKeyName(k) && !allow.has(at))
|
|
199
201
|
return at;
|
|
200
|
-
stack.
|
|
202
|
+
Object.defineProperty(stack, stack.length, { value: [d.value, at], writable: true, enumerable: true, configurable: true });
|
|
201
203
|
}
|
|
202
204
|
}
|
|
203
205
|
return undefined;
|
|
@@ -251,22 +253,49 @@ const SEAT_EVENT_TYPE_TUPLE = [
|
|
|
251
253
|
"subagent_content",
|
|
252
254
|
];
|
|
253
255
|
export const SEAT_EVENT_TYPES = Object.freeze(SEAT_EVENT_TYPE_TUPLE);
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
256
|
+
const CHROME_ARM_SEAT_ROUTE = {
|
|
257
|
+
panel_task: "seat",
|
|
258
|
+
notification_terminal: "seat",
|
|
259
|
+
prompt_suggestions: "seat",
|
|
260
|
+
subagent_lifecycle: "seat",
|
|
261
|
+
text_segment_end: "seat",
|
|
262
|
+
thinking_segment_end: "seat",
|
|
263
|
+
retry_status: "seat",
|
|
264
|
+
context_usage: "seat",
|
|
265
|
+
last_turn_usage: "seat",
|
|
266
|
+
bgshell_register: "seat",
|
|
267
|
+
bgshell_settle: "seat",
|
|
268
|
+
memory_saved: "seat",
|
|
269
|
+
result_replayed: "seat",
|
|
270
|
+
tool_parked: "seat",
|
|
271
|
+
compaction_started: "seat",
|
|
272
|
+
compaction_outcome: "seat",
|
|
273
|
+
engine_notice: "seat",
|
|
274
|
+
workflow_notification_enqueue: "host",
|
|
275
|
+
plan_review_park: "host",
|
|
276
|
+
approval_request: "host",
|
|
277
|
+
approval_revoke: "host",
|
|
278
|
+
task_ledger_sync: "host",
|
|
279
|
+
inline_task_stats: "host",
|
|
280
|
+
stream_delta: "host",
|
|
281
|
+
thinking_activity: "host",
|
|
282
|
+
request_start: "host",
|
|
283
|
+
response_metrics: "host",
|
|
284
|
+
attachment: "host",
|
|
285
|
+
subagent_turn_usage: "host",
|
|
286
|
+
run_cost_reconciled: "host",
|
|
287
|
+
message_committed: "host",
|
|
288
|
+
human_input: "host",
|
|
289
|
+
tool_roster_delta: "host",
|
|
290
|
+
subagent_started: "host",
|
|
291
|
+
prompt_assembled: "host",
|
|
292
|
+
tool_disclosure: "host",
|
|
293
|
+
tool_progress: "host",
|
|
294
|
+
wiring_manifest: "host",
|
|
295
|
+
suspended_reopened: "host",
|
|
296
|
+
result_text_diverged: "host",
|
|
297
|
+
};
|
|
298
|
+
const CHROME_EVENT_KIND_TUPLE = Object.keys(CHROME_ARM_SEAT_ROUTE).filter((k) => CHROME_ARM_SEAT_ROUTE[k] === "seat");
|
|
270
299
|
export const CHROME_EVENT_KINDS = Object.freeze(CHROME_EVENT_KIND_TUPLE);
|
|
271
300
|
const LANE_PROOF_LANE_TUPLE = ["main", "subagent", "workflow"];
|
|
272
301
|
export const SEAT_CHROME_ENVELOPE_KEYS = ["kind", "laneProof"];
|
|
@@ -327,7 +356,7 @@ export function readSeatStreamDelta(message) {
|
|
|
327
356
|
return Object.freeze({ kind: "malformed" });
|
|
328
357
|
}
|
|
329
358
|
}
|
|
330
|
-
export const SEAT_CAPABILITY_NAMES = Object.freeze(["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles"]);
|
|
359
|
+
export const SEAT_CAPABILITY_NAMES = Object.freeze(["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles", "thinkingLatch"]);
|
|
331
360
|
const notReported = () => Object.freeze({ kind: "not_reported" });
|
|
332
361
|
const malformedReading = () => Object.freeze({ kind: "malformed" });
|
|
333
362
|
const reported = (available) => Object.freeze({ kind: "reported", available });
|
|
@@ -340,7 +369,7 @@ export function seatCapability(state, name) {
|
|
|
340
369
|
const desc = Object.getOwnPropertyDescriptor(state, name);
|
|
341
370
|
if (desc === undefined)
|
|
342
371
|
return notReported();
|
|
343
|
-
if (!("value"
|
|
372
|
+
if (!Object.hasOwn(desc, "value"))
|
|
344
373
|
return malformedReading();
|
|
345
374
|
const v = desc.value;
|
|
346
375
|
if (v === undefined)
|
|
@@ -403,6 +432,7 @@ const SEAT_CAPABILITY_PHRASES = Object.freeze({
|
|
|
403
432
|
engineTarget: Object.freeze({ action: "Switching engines", ability: "switch engines", support: "engine-switching support" }),
|
|
404
433
|
onboard: Object.freeze({ action: "Model setup", ability: "add models", support: "model-setup support" }),
|
|
405
434
|
mcpToolToggles: Object.freeze({ action: "Per-tool switching", ability: "toggle tools", support: "per-tool switches" }),
|
|
435
|
+
thinkingLatch: Object.freeze({ action: "Switching thinking", ability: "switch thinking", support: "thinking-switch support" }),
|
|
406
436
|
});
|
|
407
437
|
export function seatCapabilityUnavailableDetail(name, reading) {
|
|
408
438
|
const phrase = Object.hasOwn(SEAT_CAPABILITY_PHRASES, name)
|
|
@@ -529,6 +559,7 @@ export const SEAT_TURN_SETTINGS_ORIGINS = Object.freeze({
|
|
|
529
559
|
export const SEAT_REWIND_INTENT_KEYS = ["mode", "targetMessageUuid"];
|
|
530
560
|
export const ATTACHMENT_UPLOAD_REQUEST_KEYS = ["name", "mimeType", "bytes"];
|
|
531
561
|
export const SESSION_ROW_PATCH_REQUEST_KEYS = Object.freeze(["sessionId", "title", "pinned"]);
|
|
562
|
+
const SET_THINKING_LATCH_REQUEST_KEYS = Object.freeze(["sessionId", "event"]);
|
|
532
563
|
export const SESSION_SEARCH_RESULT_KEYS = ["sessionId", "title", "matches"];
|
|
533
564
|
export const GET_TRANSCRIPT_RESULT_KEYS = ["sessionId", "messages"];
|
|
534
565
|
const DEVICE_REFUSED_SPEC = { status: reqF(R_INT0), errorCode: optF(R_STR), message: optF(R_STR) };
|
|
@@ -944,6 +975,12 @@ const checkLocalSessionRecord = seatCheck((s) => {
|
|
|
944
975
|
if (!isAbsent(pinned) && typeof pinned !== "boolean") {
|
|
945
976
|
return bad("pinned must be a boolean when present (absent = not pinned or unknown)", "pinned");
|
|
946
977
|
}
|
|
978
|
+
const latch = own(s, "thinkingLatch");
|
|
979
|
+
if (!isAbsent(latch)) {
|
|
980
|
+
const verdict = R_THINKING_LATCH_ROW.test(latch, "thinkingLatch");
|
|
981
|
+
if (verdict !== true)
|
|
982
|
+
return verdict;
|
|
983
|
+
}
|
|
947
984
|
return true;
|
|
948
985
|
});
|
|
949
986
|
export function isLocalSessionRecord(s) {
|
|
@@ -1084,9 +1121,11 @@ const SEAT_CHROME_PAYLOAD_SPECS = {
|
|
|
1084
1121
|
registration: reqF(shapeRule("registration", {
|
|
1085
1122
|
kind: reqF(oneOfRule("registration kind", ["register"])),
|
|
1086
1123
|
taskId: reqF(R_NONEMPTY),
|
|
1124
|
+
toolUseId: optF(R_NONEMPTY),
|
|
1087
1125
|
command: reqF(R_STR),
|
|
1088
1126
|
description: optF(R_STR),
|
|
1089
1127
|
receipt: reqF(R_STR),
|
|
1128
|
+
outputFile: optF(R_NONEMPTY),
|
|
1090
1129
|
source: reqF(oneOfRule("registration source", ["bash", "monitor"])),
|
|
1091
1130
|
})),
|
|
1092
1131
|
},
|
|
@@ -1409,6 +1448,14 @@ export const checkSessionRowPatchRequest = seatCheck((v) => {
|
|
|
1409
1448
|
export function isSessionRowPatchRequest(v) {
|
|
1410
1449
|
return checkSessionRowPatchRequest(v) === true;
|
|
1411
1450
|
}
|
|
1451
|
+
const checkSetThinkingLatchShape = seatShapeCheck(shapeRule("latch request", {
|
|
1452
|
+
sessionId: reqF(R_NONEMPTY),
|
|
1453
|
+
event: reqF(oneOfRule("latch event", THINKING_LATCH_EVENTS)),
|
|
1454
|
+
}));
|
|
1455
|
+
export const checkSetThinkingLatchRequest = seatCheck((v) => isPlainRecord(v) ? checkSetThinkingLatchShape(v) : bad("setThinkingLatch request is not a plain object"));
|
|
1456
|
+
export function isSetThinkingLatchRequest(v) {
|
|
1457
|
+
return checkSetThinkingLatchRequest(v) === true;
|
|
1458
|
+
}
|
|
1412
1459
|
const checkSendMessageAck = seatCheck((v) => {
|
|
1413
1460
|
if (!isPlainRecord(v))
|
|
1414
1461
|
return bad("sendMessage ack is not a plain object");
|
|
@@ -1580,6 +1627,7 @@ export const LOCAL_SESSIONS_SPEC = {
|
|
|
1580
1627
|
readSessionMcpPanel: { kind: "invoke", check: checkSessionMcpPanelResult },
|
|
1581
1628
|
listMcpToolToggles: { kind: "invoke", check: checkMcpToolTogglesResult },
|
|
1582
1629
|
setMcpToolToggle: { kind: "invoke", check: checkOkAck },
|
|
1630
|
+
setThinkingLatch: { kind: "invoke", check: checkOkAck },
|
|
1583
1631
|
onEvent: { kind: "event", check: checkLocalSessionEvent },
|
|
1584
1632
|
onToolPermissionRequest: { kind: "event", check: checkToolPermissionRequest },
|
|
1585
1633
|
},
|
|
@@ -1627,6 +1675,7 @@ export const SEAT_METHOD_NAMES = [
|
|
|
1627
1675
|
"readSessionMcpPanel",
|
|
1628
1676
|
"listMcpToolToggles",
|
|
1629
1677
|
"setMcpToolToggle",
|
|
1678
|
+
"setThinkingLatch",
|
|
1630
1679
|
"onEvent",
|
|
1631
1680
|
"onToolPermissionRequest",
|
|
1632
1681
|
];
|
|
@@ -1685,6 +1734,7 @@ export const LOCAL_SESSION_RECORD_KEYS = [
|
|
|
1685
1734
|
"queuedMessages",
|
|
1686
1735
|
"parked",
|
|
1687
1736
|
"pinned",
|
|
1737
|
+
"thinkingLatch",
|
|
1688
1738
|
];
|
|
1689
1739
|
export const SEND_MESSAGE_REQUEST_KEYS = [
|
|
1690
1740
|
"sessionId",
|
|
@@ -1729,7 +1779,7 @@ export const SEAT_VALIDATOR_KEY_COVERAGE = {
|
|
|
1729
1779
|
LocalSessionRecord: {
|
|
1730
1780
|
guard: "isLocalSessionRecord",
|
|
1731
1781
|
check: checkLocalSessionRecord,
|
|
1732
|
-
validated: ["sessionId", "engineSessionId", "model", "title", "cwd", "isRunning", "createdAt", "lastActivityAt", "queuedMessages", "parked", "pinned"],
|
|
1782
|
+
validated: ["sessionId", "engineSessionId", "model", "title", "cwd", "isRunning", "createdAt", "lastActivityAt", "queuedMessages", "parked", "pinned", "thinkingLatch"],
|
|
1733
1783
|
unchecked: [],
|
|
1734
1784
|
},
|
|
1735
1785
|
ToolPermissionRequest: {
|
|
@@ -1853,6 +1903,12 @@ export const SEAT_VALIDATOR_KEY_COVERAGE = {
|
|
|
1853
1903
|
validated: ["sessionId", "title", "pinned"],
|
|
1854
1904
|
unchecked: [],
|
|
1855
1905
|
},
|
|
1906
|
+
SetThinkingLatchRequest: {
|
|
1907
|
+
guard: "isSetThinkingLatchRequest",
|
|
1908
|
+
check: checkSetThinkingLatchRequest,
|
|
1909
|
+
validated: ["sessionId", "event"],
|
|
1910
|
+
unchecked: [],
|
|
1911
|
+
},
|
|
1856
1912
|
ApplyModelConfigResult: {
|
|
1857
1913
|
check: checkApplyModelConfigResult,
|
|
1858
1914
|
validated: ["ok", "requiresRestart", "reason", "detail"],
|
|
@@ -1906,7 +1962,7 @@ export const SEAT_VALIDATOR_KEY_COVERAGE = {
|
|
|
1906
1962
|
},
|
|
1907
1963
|
SeatCapabilitiesState: {
|
|
1908
1964
|
check: checkSeatCapabilitiesState,
|
|
1909
|
-
validated: ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles"],
|
|
1965
|
+
validated: ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles", "thinkingLatch"],
|
|
1910
1966
|
unchecked: [],
|
|
1911
1967
|
},
|
|
1912
1968
|
RecentFoldersResult: {
|
|
@@ -1977,7 +2033,7 @@ export const SEAT_VALIDATOR_COVERAGE_EXEMPT = [
|
|
|
1977
2033
|
{
|
|
1978
2034
|
label: "PickFolderResult",
|
|
1979
2035
|
check: checkPickFolderResult,
|
|
1980
|
-
why: "载荷是**串或 null**(选中的路径 / 用户取消,CC-469),没有键面 ⇒ `keyof`
|
|
2036
|
+
why: "载荷是**串或 null**(选中的路径 / 用户取消,CC-469),没有键面 ⇒ `keyof` 覆盖表在它身上无从谈起。判别力由对应的座位契约测试套承担:认 null 与非空串、拒空串 / 数 / undefined / 对象 / 布尔五形。",
|
|
1981
2037
|
},
|
|
1982
2038
|
{
|
|
1983
2039
|
label: "BooleanAck",
|
|
@@ -1988,10 +2044,10 @@ export const SEAT_VALIDATOR_COVERAGE_EXEMPT = [
|
|
|
1988
2044
|
label: "LaneProof",
|
|
1989
2045
|
check: (v) => checkLaneProof(v, "laneProof"),
|
|
1990
2046
|
why: "判别式联合:必填键面随 `lane` 臂而变(subagent 要 parentToolCallId、workflow 要 via+key),而覆盖表的方法是「一个最小合法体 + 逐键投毒」—— 那套方法在它身上没有判别力(main 臂对另外两臂的伴随位本来就不该拒,投毒过了不代表漏校)。" +
|
|
1991
|
-
"🔴
|
|
2047
|
+
"🔴 (2026-08-07 订正)本条此前自称判别力由「**逐臂**投毒(空对象 / 非对象 / **未登记车道词**)」承担 —— 全树实扫,那三样里只有**空对象**与**非对象**真的存在(座位契约键测试套的逐臂投毒段)," +
|
|
1992
2048
|
"「未登记车道词」实际只钉了 `lane: 7`(非串,证明不了闭集成员判定在场),「逐臂」(subagent 缺 parentToolCallId / workflow 缺 via+key)则是**零覆盖**。也就是说这条豁免曾经拿三件不存在的判据给自己背书。" +
|
|
1993
2049
|
"现势(判据锚在真存在的东西上):① `LANE_PROOF_LANE_TUPLE` ⇄ seam.ts 车道联合的双向 `Covers`(本文件 `_seatContractPins`,加车道不跟 ⇒ 编译红);" +
|
|
1994
|
-
"②
|
|
2050
|
+
"② 本包纯测试套的投毒段 —— 未登记车道词 / subagent 缺伴随位 / workflow 缺 via 或 key 三条投毒 + 两条逐臂正控 + 一条「main 臂不被过紧误拒」负控,全部直接喂本条的 `check`。",
|
|
1995
2051
|
},
|
|
1996
2052
|
];
|
|
1997
2053
|
const _seatContractPins = [
|
|
@@ -2021,5 +2077,8 @@ const _seatContractPins = [
|
|
|
2021
2077
|
true, true, true,
|
|
2022
2078
|
true,
|
|
2023
2079
|
true, true, true,
|
|
2080
|
+
true, true, true, true, true, true,
|
|
2081
|
+
true, true, true,
|
|
2082
|
+
true, true,
|
|
2024
2083
|
];
|
|
2025
2084
|
void _seatContractPins;
|
|
@@ -43,7 +43,7 @@ function ownRead(o, key) {
|
|
|
43
43
|
const d = Object.getOwnPropertyDescriptor(o, key);
|
|
44
44
|
if (d === undefined)
|
|
45
45
|
return ABSENT;
|
|
46
|
-
if ('get'
|
|
46
|
+
if (Object.hasOwn(d, 'get') || Object.hasOwn(d, 'set'))
|
|
47
47
|
return ACCESSOR;
|
|
48
48
|
return { kind: 'data', value: d.value };
|
|
49
49
|
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import type { AgentClient, AgentEvent, TaskRequest } from '@sema-agent/sdk';
|
|
2
|
+
import { type EnvLike } from './hostEnv.js';
|
|
3
|
+
import type { UiLanguage } from './env/uiLanguage.js';
|
|
4
|
+
export type SessionBackgroundableReading = {
|
|
5
|
+
readonly kind: 'advertised';
|
|
6
|
+
} | {
|
|
7
|
+
readonly kind: 'declined';
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: 'not_reported';
|
|
10
|
+
} | {
|
|
11
|
+
readonly kind: 'unreadable';
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: 'unobserved';
|
|
14
|
+
};
|
|
15
|
+
export declare function projectSessionBackgroundable(caps: {} | null | undefined): SessionBackgroundableReading | undefined;
|
|
16
|
+
export declare function readSessionBackgroundable(baseUrl?: string | undefined): SessionBackgroundableReading;
|
|
17
|
+
export type InteractiveEngineLane = 'self-spawned' | 'external';
|
|
18
|
+
export interface InteractiveEngineWireInit {
|
|
19
|
+
readonly baseUrl: string;
|
|
20
|
+
readonly lane: InteractiveEngineLane;
|
|
21
|
+
readonly tasks: Pick<AgentClient['tasks'], 'stream'>;
|
|
22
|
+
readonly runs: Pick<AgentClient['runs'], 'events' | 'get'>;
|
|
23
|
+
}
|
|
24
|
+
export interface InteractiveEngineWire {
|
|
25
|
+
readonly baseUrl: string;
|
|
26
|
+
readonly lane: InteractiveEngineLane;
|
|
27
|
+
}
|
|
28
|
+
type SdkStreamOptions = Parameters<AgentClient['tasks']['stream']>[1];
|
|
29
|
+
type SdkEventsOptions = NonNullable<Parameters<AgentClient['runs']['events']>[1]>;
|
|
30
|
+
type SdkGetOptions = NonNullable<Parameters<AgentClient['runs']['get']>[1]>;
|
|
31
|
+
type SdkRunRecord = Awaited<ReturnType<AgentClient['runs']['get']>>;
|
|
32
|
+
export type OpeningPhase = 'opening' | 'bound' | 'running' | 'ended-unstarted' | 'finished' | 'stream-ended' | 'handing-off' | 'handed-off' | 'engine-ended';
|
|
33
|
+
export interface OpeningRecordView {
|
|
34
|
+
readonly phase: OpeningPhase;
|
|
35
|
+
readonly inconsistent: boolean;
|
|
36
|
+
readonly capsGenAtBind: number | undefined;
|
|
37
|
+
readonly stopRequested: boolean;
|
|
38
|
+
readonly stamped: boolean;
|
|
39
|
+
readonly postureReason: InteractiveDetachPostureReason;
|
|
40
|
+
readonly proof: 'loopback-self-spawned' | 'none';
|
|
41
|
+
readonly taskId: string | undefined;
|
|
42
|
+
readonly sessionId: string | undefined;
|
|
43
|
+
readonly openAsks: ReadonlyMap<string, number | undefined>;
|
|
44
|
+
readonly askUnacked: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface OpeningRecord extends OpeningRecordView {
|
|
47
|
+
readonly openingId: number;
|
|
48
|
+
readonly sessionKey: string | undefined;
|
|
49
|
+
phase: OpeningPhase;
|
|
50
|
+
inconsistent: boolean;
|
|
51
|
+
capsGenAtBind: number | undefined;
|
|
52
|
+
stopRequested: boolean;
|
|
53
|
+
stamped: boolean;
|
|
54
|
+
postureReason: InteractiveDetachPostureReason;
|
|
55
|
+
proof: 'loopback-self-spawned' | 'none';
|
|
56
|
+
taskId: string | undefined;
|
|
57
|
+
sessionId: string | undefined;
|
|
58
|
+
readonly openAsks: Map<string, number | undefined>;
|
|
59
|
+
askUnacked: boolean;
|
|
60
|
+
replay: boolean;
|
|
61
|
+
readonly tear: (reason: string) => void;
|
|
62
|
+
}
|
|
63
|
+
export interface HandedOffEntry {
|
|
64
|
+
readonly taskId: string;
|
|
65
|
+
readonly sessionKey: string;
|
|
66
|
+
state: 'running' | 'ended' | 'unconfirmed';
|
|
67
|
+
readonly stop: (cause: 'disposed' | 'engine-ended') => void;
|
|
68
|
+
readonly reconcile: () => void;
|
|
69
|
+
}
|
|
70
|
+
export interface WireState {
|
|
71
|
+
retired: boolean;
|
|
72
|
+
readonly baseUrl: string;
|
|
73
|
+
readonly lane: InteractiveEngineLane;
|
|
74
|
+
readonly stream: (req: TaskRequest, opts: SdkStreamOptions) => AsyncGenerator<AgentEvent>;
|
|
75
|
+
readonly events: (taskId: string, opts: SdkEventsOptions) => AsyncGenerator<AgentEvent>;
|
|
76
|
+
readonly get: (taskId: string, opts: SdkGetOptions) => Promise<SdkRunRecord>;
|
|
77
|
+
readonly bySession: Map<string, OpeningRecord>;
|
|
78
|
+
readonly byTask: Map<string, OpeningRecord>;
|
|
79
|
+
readonly order: OpeningRecord[];
|
|
80
|
+
readonly handedOff: Map<string, HandedOffEntry>;
|
|
81
|
+
nextOpeningId: number;
|
|
82
|
+
}
|
|
83
|
+
export declare const OPENING_RECORD_CAP = 256;
|
|
84
|
+
export type OwnSlot = {
|
|
85
|
+
readonly state: 'absent';
|
|
86
|
+
} | {
|
|
87
|
+
readonly state: 'unreadable';
|
|
88
|
+
} | {
|
|
89
|
+
readonly state: 'data';
|
|
90
|
+
readonly value: {} | null;
|
|
91
|
+
};
|
|
92
|
+
export declare function ownSlotOf(o: object, key: string): OwnSlot;
|
|
93
|
+
export declare function wireStateOf(wire: InteractiveEngineWire | null | undefined): WireState | undefined;
|
|
94
|
+
export declare function interactiveEngineWire(init: InteractiveEngineWireInit): InteractiveEngineWire | undefined;
|
|
95
|
+
export declare function retireInteractiveEngineWire(wire: InteractiveEngineWire): void;
|
|
96
|
+
export interface InteractiveOpeningInput {
|
|
97
|
+
readonly sessionKey: string;
|
|
98
|
+
readonly reattachable: boolean;
|
|
99
|
+
readonly env?: EnvLike;
|
|
100
|
+
}
|
|
101
|
+
export type InteractiveDetachPostureReason = 'self-spawned' | 'unreadable-input' | 'retired-wire' | 'env-off' | 'not-reattachable' | 'declined' | 'unacknowledged' | 'not_reported' | 'unobserved' | 'unreadable' | 'durable-off-400';
|
|
102
|
+
export interface InteractiveDetachPosture {
|
|
103
|
+
readonly stamp: boolean;
|
|
104
|
+
readonly reason: InteractiveDetachPostureReason;
|
|
105
|
+
}
|
|
106
|
+
export declare function interactiveDetachPosture(wire: InteractiveEngineWire, input: InteractiveOpeningInput): InteractiveDetachPosture;
|
|
107
|
+
export type InteractiveStreamOptions = {
|
|
108
|
+
transientOk: true;
|
|
109
|
+
signal?: AbortSignal;
|
|
110
|
+
headers?: Record<string, string>;
|
|
111
|
+
onResponse?: (res: Response) => void;
|
|
112
|
+
idempotencyKey?: string | null;
|
|
113
|
+
heartbeatGraceMs?: number;
|
|
114
|
+
};
|
|
115
|
+
export declare function streamInteractiveRun(wire: InteractiveEngineWire, req: TaskRequest, opts: InteractiveStreamOptions, input: InteractiveOpeningInput): AsyncGenerator<AgentEvent>;
|
|
116
|
+
export type BackgroundHandoffVerdict = {
|
|
117
|
+
readonly verdict: 'eligible';
|
|
118
|
+
readonly taskId: string;
|
|
119
|
+
} | {
|
|
120
|
+
readonly verdict: 'ineligible';
|
|
121
|
+
readonly reason: BackgroundHandoffRefusal;
|
|
122
|
+
readonly cause?: InteractiveDetachPostureReason;
|
|
123
|
+
} | {
|
|
124
|
+
readonly verdict: 'unknown';
|
|
125
|
+
readonly reason: BackgroundHandoffUnknown;
|
|
126
|
+
};
|
|
127
|
+
export type BackgroundHandoffRefusal = 'no-run' | 'stream-ended' | 'already-handed-off' | 'finished' | 'engine-replaced' | 'stopping' | 'not-stamped' | 'declined' | 'not-started' | 'awaiting-user';
|
|
128
|
+
export type BackgroundHandoffUnknown = 'unreadable-input' | 'capability-unconfirmed' | 'detach-unconfirmed' | 'awaiting-user-unattributable';
|
|
129
|
+
export interface HoldOwnerView {
|
|
130
|
+
readonly taskId: string | undefined;
|
|
131
|
+
readonly sessionId: string | undefined;
|
|
132
|
+
}
|
|
133
|
+
export interface HandoffJudgeFacts {
|
|
134
|
+
readonly inputReadable: boolean;
|
|
135
|
+
readonly wirePresent: boolean;
|
|
136
|
+
readonly wireRecognized: boolean;
|
|
137
|
+
readonly rec: OpeningRecordView | undefined;
|
|
138
|
+
readonly capability: SessionBackgroundableReading['kind'];
|
|
139
|
+
readonly capsGenerationNow: number | undefined;
|
|
140
|
+
readonly holds: readonly HoldOwnerView[];
|
|
141
|
+
readonly nowMs: number;
|
|
142
|
+
}
|
|
143
|
+
export declare function handoffVerdictOf(f: HandoffJudgeFacts): BackgroundHandoffVerdict;
|
|
144
|
+
export interface HandoffJudgeInput {
|
|
145
|
+
readonly wire: InteractiveEngineWire | undefined;
|
|
146
|
+
readonly sessionKey: string;
|
|
147
|
+
}
|
|
148
|
+
export interface JudgedHandoff {
|
|
149
|
+
readonly verdict: BackgroundHandoffVerdict;
|
|
150
|
+
readonly rec: OpeningRecord | undefined;
|
|
151
|
+
readonly state: WireState | undefined;
|
|
152
|
+
}
|
|
153
|
+
export declare function judgeHandoff(input: HandoffJudgeInput | null | undefined): JudgedHandoff;
|
|
154
|
+
export declare function backgroundHandoffEligibility(input: {
|
|
155
|
+
readonly wire: InteractiveEngineWire | undefined;
|
|
156
|
+
readonly sessionKey: string;
|
|
157
|
+
}): BackgroundHandoffVerdict;
|
|
158
|
+
export declare function backgroundHandoffSentence(v: BackgroundHandoffVerdict, lang?: UiLanguage): string | undefined;
|
|
159
|
+
export interface InteractiveStopFacts {
|
|
160
|
+
readonly detachArmed: boolean;
|
|
161
|
+
readonly handedOff: boolean;
|
|
162
|
+
}
|
|
163
|
+
export declare function interactiveStopFacts(wire: InteractiveEngineWire | undefined, taskId: string): InteractiveStopFacts;
|
|
164
|
+
export declare function noteInteractiveStopRequested(wire: InteractiveEngineWire, taskId: string): 'withheld' | 'proceed';
|
|
165
|
+
export {};
|