@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
|
@@ -10,6 +10,7 @@ const CLASS_OF_REASON = Object.freeze({
|
|
|
10
10
|
home_relative_path: 'homePath',
|
|
11
11
|
compile_refused: 'compile',
|
|
12
12
|
paren_in_tool_name: 'compile',
|
|
13
|
+
content_form_never_matches: 'neverMatches',
|
|
13
14
|
});
|
|
14
15
|
function reasonOf(row, lang) {
|
|
15
16
|
const cls = typeof row.reason === 'string' && Object.hasOwn(CLASS_OF_REASON, row.reason) ? CLASS_OF_REASON[row.reason] : undefined;
|
|
@@ -17,6 +18,8 @@ function reasonOf(row, lang) {
|
|
|
17
18
|
return renderMessage(msg('rules.refusal.reason.toolName'), lang);
|
|
18
19
|
if (cls === 'homePath')
|
|
19
20
|
return renderMessage(msg('rules.refusal.reason.homePath'), lang);
|
|
21
|
+
if (cls === 'neverMatches')
|
|
22
|
+
return renderMessage(msg('rules.refusal.reason.neverMatches'), lang);
|
|
20
23
|
if (cls === 'compile')
|
|
21
24
|
return permissionRuleIssueDetail(row.code, row.message, row.rule, lang);
|
|
22
25
|
return undefined;
|
|
@@ -48,11 +51,14 @@ export function ruleRefusalSentence(rows, lang) {
|
|
|
48
51
|
}
|
|
49
52
|
if (items.length === 0)
|
|
50
53
|
return undefined;
|
|
54
|
+
const listText = ruleRefusalListText(items, lang);
|
|
55
|
+
return renderMessage(items.length === 1 ? msg('rules.refusal.sentence.one', { list: listText }) : msg('rules.refusal.sentence.other', { count: items.length, list: listText }), lang);
|
|
56
|
+
}
|
|
57
|
+
export function ruleRefusalListText(items, lang) {
|
|
51
58
|
const shown = items.slice(0, RULE_REFUSAL_NAMED_MAX);
|
|
52
59
|
const separator = renderMessage(msg('rules.refusal.itemSeparator'), lang);
|
|
53
|
-
const named = shown.map((it) => renderMessage(msg('rules.refusal.item', { rule: nameOf(it.rule), reason: it.reason }), lang)).join(separator);
|
|
60
|
+
const named = shown.map((it) => (it.rule === undefined ? it.reason : renderMessage(msg('rules.refusal.item', { rule: nameOf(it.rule), reason: it.reason }), lang))).join(separator);
|
|
54
61
|
const rest = items.length - shown.length;
|
|
55
62
|
const list = rest > 0 ? msg('rules.refusal.list.more', { shown: named, count: rest }) : named;
|
|
56
|
-
|
|
57
|
-
return renderMessage(items.length === 1 ? msg('rules.refusal.sentence.one', { list: listText }) : msg('rules.refusal.sentence.other', { count: items.length, list: listText }), lang);
|
|
63
|
+
return typeof list === 'string' ? list : renderMessage(list, lang);
|
|
58
64
|
}
|
|
@@ -30,7 +30,6 @@ export type RunAbortCause = {
|
|
|
30
30
|
};
|
|
31
31
|
export declare const RUN_CANCELLED_CODE: "cancelled";
|
|
32
32
|
export declare function classifyRunAbortCause(record: unknown): RunAbortCause;
|
|
33
|
-
export declare const ABORT_CAUSES: readonly ["client_disconnected", "ask_park_grace_exhausted", "cancel_verb"];
|
|
34
33
|
export type { AbortCause };
|
|
35
34
|
export type AbortCauseReading = {
|
|
36
35
|
readonly kind: 'known';
|
package/dist/runCancelContext.js
CHANGED
|
@@ -57,7 +57,6 @@ export function classifyRunAbortCause(record) {
|
|
|
57
57
|
return { kind: 'run_still_live', status };
|
|
58
58
|
return { kind: 'unknown', ...(read !== null ? { terminal: read.kind } : {}) };
|
|
59
59
|
}
|
|
60
|
-
export const ABORT_CAUSES = SDK_ABORT_CAUSES;
|
|
61
60
|
const _abortCauseTablePin = true;
|
|
62
61
|
void _abortCauseTablePin;
|
|
63
62
|
function ownDataOf(o, key) {
|
|
@@ -85,7 +84,7 @@ function abortCauseIn(holder) {
|
|
|
85
84
|
const raw = ownDataOf(holder, 'abortCause');
|
|
86
85
|
if (typeof raw !== 'string' || raw.length === 0)
|
|
87
86
|
return undefined;
|
|
88
|
-
return
|
|
87
|
+
return SDK_ABORT_CAUSES.includes(raw) ? { kind: 'known', cause: raw } : { kind: 'unrecognized', word: raw };
|
|
89
88
|
}
|
|
90
89
|
export function readAbortCause(frame) {
|
|
91
90
|
try {
|
package/dist/runTerminal.d.ts
CHANGED
|
@@ -27,6 +27,9 @@ export type RunTerminalFailureDetail = RunTerminalProviderRejectedDetail | {
|
|
|
27
27
|
export type RunTerminalJsonValue = string | number | boolean | null | readonly RunTerminalJsonValue[] | {
|
|
28
28
|
readonly [key: string]: RunTerminalJsonValue;
|
|
29
29
|
};
|
|
30
|
+
export type RunTerminalCodedDetail = {
|
|
31
|
+
readonly [key: string]: RunTerminalJsonValue;
|
|
32
|
+
};
|
|
30
33
|
export interface RunTerminalOutputLimit {
|
|
31
34
|
capStop: boolean;
|
|
32
35
|
outputTokens?: number;
|
|
@@ -94,6 +97,8 @@ type RunTerminalReadArm = {
|
|
|
94
97
|
code?: string;
|
|
95
98
|
message?: string;
|
|
96
99
|
};
|
|
100
|
+
export declare function runTerminalCodedDetail(read: RunTerminalRead | null | undefined): RunTerminalCodedDetail | undefined;
|
|
101
|
+
export declare function terminalCodedDetailOf(carrier: {} | null | undefined): RunTerminalCodedDetail | undefined;
|
|
97
102
|
export declare function readRunTerminal(result: unknown): RunTerminalRead | null;
|
|
98
103
|
export declare const REVIEW_PARK_GATE_KINDS: readonly string[];
|
|
99
104
|
export declare function runTerminalGateKind(read: RunTerminalRead | null): string | undefined;
|
package/dist/runTerminal.js
CHANGED
|
@@ -2,6 +2,7 @@ import { CORE_PROMPT_BLOCK_CAUSES } from './generated/engineFactTables.js';
|
|
|
2
2
|
import { isSdkRunParked } from './terminalStatuses.js';
|
|
3
3
|
import { readOwnDataNonEmptyString, readOwnDataValue } from './ownKey.js';
|
|
4
4
|
import { doneResultView } from './replayBody.js';
|
|
5
|
+
import { washCredentials } from './displayUntrusted.js';
|
|
5
6
|
export const PROMPT_BLOCK_CAUSES = CORE_PROMPT_BLOCK_CAUSES;
|
|
6
7
|
const _promptBlockTablePin = true;
|
|
7
8
|
void _promptBlockTablePin;
|
|
@@ -39,7 +40,7 @@ void _modelOutputInvalidCausePin;
|
|
|
39
40
|
const CODED_DETAIL_MAX_DEPTH = 40;
|
|
40
41
|
function ownData(o, k) {
|
|
41
42
|
const d = Object.getOwnPropertyDescriptor(o, k);
|
|
42
|
-
return d !== undefined && 'value'
|
|
43
|
+
return d !== undefined && Object.hasOwn(d, 'value') ? d.value : undefined;
|
|
43
44
|
}
|
|
44
45
|
function isPlainRecord(v) {
|
|
45
46
|
if (typeof v !== 'object' || v === null || Array.isArray(v))
|
|
@@ -53,8 +54,10 @@ function jsonSnapshot(v, depth, ctx) {
|
|
|
53
54
|
ctx.budget -= 1;
|
|
54
55
|
if (ctx.budget < 0)
|
|
55
56
|
throw CODED_DETAIL_OVER_BUDGET;
|
|
56
|
-
if (v === null || typeof v === '
|
|
57
|
+
if (v === null || typeof v === 'boolean')
|
|
57
58
|
return v;
|
|
59
|
+
if (typeof v === 'string')
|
|
60
|
+
return ctx.leaf === undefined ? v : ctx.leaf(v);
|
|
58
61
|
if (typeof v === 'number')
|
|
59
62
|
return Number.isFinite(v) ? v : undefined;
|
|
60
63
|
if (depth >= CODED_DETAIL_MAX_DEPTH)
|
|
@@ -148,6 +151,51 @@ function requestRouteOf(d) {
|
|
|
148
151
|
return undefined;
|
|
149
152
|
}
|
|
150
153
|
}
|
|
154
|
+
function codedBodySnapshot(inner, washLeaves = false) {
|
|
155
|
+
if (!isPlainRecord(inner))
|
|
156
|
+
return undefined;
|
|
157
|
+
let snap;
|
|
158
|
+
try {
|
|
159
|
+
snap = jsonSnapshot(inner, 0, { budget: CODED_DETAIL_BUDGET, path: new Set(), ...(washLeaves ? { leaf: washCredentials } : {}) });
|
|
160
|
+
}
|
|
161
|
+
catch (e) {
|
|
162
|
+
if (e === CODED_DETAIL_OVER_BUDGET)
|
|
163
|
+
return undefined;
|
|
164
|
+
throw e;
|
|
165
|
+
}
|
|
166
|
+
if (snap === undefined || snap === null || typeof snap !== 'object' || Array.isArray(snap))
|
|
167
|
+
return undefined;
|
|
168
|
+
return snap;
|
|
169
|
+
}
|
|
170
|
+
export function runTerminalCodedDetail(read) {
|
|
171
|
+
try {
|
|
172
|
+
if (typeof read !== 'object' || read === null)
|
|
173
|
+
return undefined;
|
|
174
|
+
if (ownData(read, 'kind') !== 'failed')
|
|
175
|
+
return undefined;
|
|
176
|
+
const detail = ownData(read, 'detail');
|
|
177
|
+
if (typeof detail !== 'object' || detail === null)
|
|
178
|
+
return undefined;
|
|
179
|
+
if (ownData(detail, 'kind') !== CODED_DETAIL_KIND)
|
|
180
|
+
return undefined;
|
|
181
|
+
const body = codedBodySnapshot(ownData(detail, 'detail'), true);
|
|
182
|
+
return body !== undefined && Object.keys(body).length > 0 ? body : undefined;
|
|
183
|
+
}
|
|
184
|
+
catch {
|
|
185
|
+
return undefined;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
export function terminalCodedDetailOf(carrier) {
|
|
189
|
+
try {
|
|
190
|
+
if (typeof carrier !== 'object' || carrier === null || Array.isArray(carrier))
|
|
191
|
+
return undefined;
|
|
192
|
+
const body = codedBodySnapshot(ownData(carrier, '_sema_coded_detail'), true);
|
|
193
|
+
return body !== undefined && Object.keys(body).length > 0 ? body : undefined;
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
return undefined;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
151
199
|
function failureDetailOf(cause) {
|
|
152
200
|
try {
|
|
153
201
|
const own = ownValueOf;
|
|
@@ -185,21 +233,8 @@ function failureDetailOf(cause) {
|
|
|
185
233
|
};
|
|
186
234
|
}
|
|
187
235
|
if (kind === CODED_DETAIL_KIND) {
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
return undefined;
|
|
191
|
-
let snap;
|
|
192
|
-
try {
|
|
193
|
-
snap = jsonSnapshot(inner, 0, { budget: CODED_DETAIL_BUDGET, path: new Set() });
|
|
194
|
-
}
|
|
195
|
-
catch (e) {
|
|
196
|
-
if (e === CODED_DETAIL_OVER_BUDGET)
|
|
197
|
-
return undefined;
|
|
198
|
-
throw e;
|
|
199
|
-
}
|
|
200
|
-
if (snap === undefined || snap === null || typeof snap !== 'object' || Array.isArray(snap))
|
|
201
|
-
return undefined;
|
|
202
|
-
return { kind: CODED_DETAIL_KIND, detail: snap };
|
|
236
|
+
const snap = codedBodySnapshot(ownData(v, 'detail'));
|
|
237
|
+
return snap === undefined ? undefined : { kind: CODED_DETAIL_KIND, detail: snap };
|
|
203
238
|
}
|
|
204
239
|
if (kind === MODEL_OUTPUT_INVALID_DETAIL_KIND) {
|
|
205
240
|
const c = ownData(v, 'cause');
|
package/dist/sandboxWire.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export type SandboxParseResult = {
|
|
|
14
14
|
ok: false;
|
|
15
15
|
error: string;
|
|
16
16
|
};
|
|
17
|
-
export declare function
|
|
17
|
+
export declare function sandboxFromFlag(value?: string): SandboxParseResult;
|
|
18
18
|
export declare function sandboxRequestFields(sel: SandboxSelection | undefined): {
|
|
19
19
|
sandboxImageProfile?: string;
|
|
20
20
|
};
|
package/dist/sandboxWire.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { lastFlagValue } from './argvFlagValue.js';
|
|
2
1
|
import { CAPABILITY_IMAGE_INDEX_REQUIRED, CAPABILITY_K8S_LANE_REQUIRED, isStatusDerivedCoarseCode, NOT_FOUND_IMAGE, REQUEST_FIELD_CONFLICT, REQUEST_PRECONDITION_UNMET } from './engineErrorCodes.js';
|
|
3
2
|
import { THROWN_SLOT_UNREADABLE, readThrownSlot } from './wireFailureShape.js';
|
|
4
3
|
const MAX_PROFILE_LEN = 128;
|
|
@@ -6,13 +5,12 @@ const USAGE_HINT = "sema: --sandbox expects a profile name or 'auto'.\n" +
|
|
|
6
5
|
' --sandbox <profile> run on that sandbox image profile (k8s-lane workers; list: sema cloud images list)\n' +
|
|
7
6
|
' --sandbox auto let the model pick via its SelectEnvironment tool (advisory — choice + reason shown in the reply)\n' +
|
|
8
7
|
' (no flag) the worker default image';
|
|
9
|
-
export function
|
|
10
|
-
|
|
11
|
-
if (!flag.present)
|
|
8
|
+
export function sandboxFromFlag(value) {
|
|
9
|
+
if (value === undefined)
|
|
12
10
|
return { ok: true, sel: { mode: 'default' } };
|
|
13
|
-
if (
|
|
11
|
+
if (typeof value !== 'string')
|
|
14
12
|
return { ok: false, error: USAGE_HINT };
|
|
15
|
-
const v =
|
|
13
|
+
const v = value.trim();
|
|
16
14
|
if (v.length === 0)
|
|
17
15
|
return { ok: false, error: USAGE_HINT };
|
|
18
16
|
if (/\s/.test(v)) {
|
package/dist/scenarioRefusal.js
CHANGED
|
@@ -34,7 +34,7 @@ export function scenarioRefusalOf(body) {
|
|
|
34
34
|
const d = Object.getOwnPropertyDescriptor(body, 'scenarioRefusal');
|
|
35
35
|
if (d === undefined)
|
|
36
36
|
return undefined;
|
|
37
|
-
raw = 'value'
|
|
37
|
+
raw = Object.hasOwn(d, 'value') ? d.value : undefined;
|
|
38
38
|
}
|
|
39
39
|
catch {
|
|
40
40
|
return null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type ScenarioCardSkillSource = 'factory' | 'center' | 'unknown-source';
|
|
2
|
+
export interface ScenarioCardSkill {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly description: string;
|
|
5
|
+
readonly source: ScenarioCardSkillSource;
|
|
6
|
+
}
|
|
7
|
+
export declare function scenarioSkillsOf(card: object | null | undefined): readonly ScenarioCardSkill[] | undefined;
|
|
8
|
+
export type ScenarioSkillsCapabilityReading = {
|
|
9
|
+
readonly kind: 'confirmed';
|
|
10
|
+
} | {
|
|
11
|
+
readonly kind: 'absent';
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: 'declined';
|
|
14
|
+
} | {
|
|
15
|
+
readonly kind: 'unreadable';
|
|
16
|
+
} | {
|
|
17
|
+
readonly kind: 'unobserved';
|
|
18
|
+
};
|
|
19
|
+
export declare function observedScenarioSkillsCapability(baseUrl?: string | undefined): ScenarioSkillsCapabilityReading;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { engineCapValue } from './engineCapsCache.js';
|
|
2
|
+
import { engineWireTargetBaseUrl } from './engineWireTarget.js';
|
|
3
|
+
import { appendOwnElement, guardedRead, readOwnDataValue } from './ownKey.js';
|
|
4
|
+
const SKILLS_READ_BUDGET = 100_000;
|
|
5
|
+
function skillOfEntry(raw) {
|
|
6
|
+
try {
|
|
7
|
+
if (typeof raw !== 'object' || raw === null || Array.isArray(raw))
|
|
8
|
+
return undefined;
|
|
9
|
+
const name = readOwnDataValue(raw, 'name');
|
|
10
|
+
if (typeof name !== 'string' || name.length === 0)
|
|
11
|
+
return undefined;
|
|
12
|
+
const description = readOwnDataValue(raw, 'description');
|
|
13
|
+
if (typeof description !== 'string')
|
|
14
|
+
return undefined;
|
|
15
|
+
const source = guardedRead(() => readOwnDataValue(raw, 'source'));
|
|
16
|
+
return Object.freeze({
|
|
17
|
+
name,
|
|
18
|
+
description,
|
|
19
|
+
source: source === 'factory' || source === 'center' ? source : 'unknown-source',
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export function scenarioSkillsOf(card) {
|
|
27
|
+
try {
|
|
28
|
+
if (typeof card !== 'object' || card === null)
|
|
29
|
+
return undefined;
|
|
30
|
+
const list = readOwnDataValue(card, 'skills');
|
|
31
|
+
if (!Array.isArray(list))
|
|
32
|
+
return undefined;
|
|
33
|
+
const lengthDesc = Object.getOwnPropertyDescriptor(list, 'length');
|
|
34
|
+
const length = lengthDesc !== undefined && Object.hasOwn(lengthDesc, 'value') ? lengthDesc.value : undefined;
|
|
35
|
+
if (typeof length !== 'number' || !Number.isSafeInteger(length) || length < 0 || length > SKILLS_READ_BUDGET)
|
|
36
|
+
return undefined;
|
|
37
|
+
const out = [];
|
|
38
|
+
for (let i = 0; i < length; i++) {
|
|
39
|
+
const entry = guardedRead(() => skillOfEntry(readOwnDataValue(list, String(i))));
|
|
40
|
+
if (entry !== undefined)
|
|
41
|
+
appendOwnElement(out, entry);
|
|
42
|
+
}
|
|
43
|
+
if (length > 0 && out.length === 0)
|
|
44
|
+
return undefined;
|
|
45
|
+
return Object.freeze(out);
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const SCENARIO_SKILLS_CAPABILITY_KEY = 'scenarioSkills';
|
|
52
|
+
export function observedScenarioSkillsCapability(baseUrl) {
|
|
53
|
+
try {
|
|
54
|
+
const base = baseUrl === undefined ? engineWireTargetBaseUrl() : baseUrl;
|
|
55
|
+
const slot = engineCapValue(typeof base === 'string' ? base : undefined, SCENARIO_SKILLS_CAPABILITY_KEY);
|
|
56
|
+
switch (slot.kind) {
|
|
57
|
+
case 'unobserved':
|
|
58
|
+
return Object.freeze({ kind: 'unobserved' });
|
|
59
|
+
case 'not_reported':
|
|
60
|
+
return Object.freeze({ kind: 'absent' });
|
|
61
|
+
case 'unreadable':
|
|
62
|
+
return Object.freeze({ kind: 'unreadable' });
|
|
63
|
+
case 'null':
|
|
64
|
+
return Object.freeze({ kind: 'declined' });
|
|
65
|
+
case 'value':
|
|
66
|
+
return slot.value === true ? Object.freeze({ kind: 'confirmed' }) : Object.freeze({ kind: 'declined' });
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return Object.freeze({ kind: 'unobserved' });
|
|
71
|
+
}
|
|
72
|
+
}
|
package/dist/scenarioWire.d.ts
CHANGED
|
@@ -8,6 +8,9 @@ export type ScenarioParseResult = {
|
|
|
8
8
|
ok: false;
|
|
9
9
|
error: string;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export interface ScenarioFlag {
|
|
12
|
+
readonly flag?: string;
|
|
13
|
+
readonly missing?: true;
|
|
14
|
+
}
|
|
12
15
|
export declare function headlessScenarioFromEnv(env?: EnvLike): string | undefined;
|
|
13
|
-
export declare function scenarioForPrint(
|
|
16
|
+
export declare function scenarioForPrint(flag: ScenarioFlag | undefined, env?: EnvLike): ScenarioParseResult;
|
package/dist/scenarioWire.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { hostEnv } from './hostEnv.js';
|
|
2
|
-
import {
|
|
2
|
+
import { flagIsWronglyTyped, flagString, flagTrue } from './flagInput.js';
|
|
3
3
|
export const SCENARIO_NAME_RE = /^[a-z][a-z0-9-]{1,31}$/;
|
|
4
4
|
export const HEADLESS_SCENARIO_ENV = 'SEMA_HEADLESS_SCENARIO';
|
|
5
5
|
const USAGE_HINT = "sema: --scenario expects a scenario name (lowercase letters/digits/hyphens, starting with a letter, ≤32 chars).\n" +
|
|
6
6
|
' --scenario <name> route this run through the named engine scenario (deployment-defined tool\n' +
|
|
7
7
|
' roster + system prompt; unknown names are refused by the engine (scenario_unknown))\n' +
|
|
8
8
|
' (no flag) the default scenario — today\'s behaviour';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (!flag.present)
|
|
12
|
-
return { ok: true };
|
|
13
|
-
if (flag.raw === undefined)
|
|
9
|
+
function parseScenarioFlag(input) {
|
|
10
|
+
if (flagIsWronglyTyped(input, 'flag'))
|
|
14
11
|
return { ok: false, error: USAGE_HINT };
|
|
15
|
-
const
|
|
12
|
+
const value = flagString(input, 'flag');
|
|
13
|
+
if (value === undefined)
|
|
14
|
+
return flagTrue(input, 'missing') ? { ok: false, error: USAGE_HINT } : { ok: true };
|
|
15
|
+
const v = value.trim();
|
|
16
16
|
if (/\s/.test(v)) {
|
|
17
17
|
return {
|
|
18
18
|
ok: false,
|
|
@@ -36,8 +36,8 @@ export function headlessScenarioFromEnv(env = hostEnv()) {
|
|
|
36
36
|
}
|
|
37
37
|
return v;
|
|
38
38
|
}
|
|
39
|
-
export function scenarioForPrint(
|
|
40
|
-
const parsed =
|
|
39
|
+
export function scenarioForPrint(flag, env = hostEnv()) {
|
|
40
|
+
const parsed = parseScenarioFlag(flag);
|
|
41
41
|
if (!parsed.ok)
|
|
42
42
|
return parsed;
|
|
43
43
|
if (parsed.scenario)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { engineWireTargetBaseUrl } from './engineWireTarget.js';
|
|
2
2
|
import { createEngineCapReader } from './engineCapReader.js';
|
|
3
3
|
import { ownDataField } from './ownKey.js';
|
|
4
4
|
function ownNonEmpty(seg, key) {
|
|
@@ -29,6 +29,6 @@ const reader = createEngineCapReader({
|
|
|
29
29
|
name: 'sealedKey',
|
|
30
30
|
project: projectSealedKeyCapability,
|
|
31
31
|
});
|
|
32
|
-
export function observedSealedKey(baseUrl =
|
|
32
|
+
export function observedSealedKey(baseUrl = engineWireTargetBaseUrl()) {
|
|
33
33
|
return reader.observed(baseUrl);
|
|
34
34
|
}
|
package/dist/seam.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { WiringManifestFleetView } from './adapter/downstream/wiringManifes
|
|
|
7
7
|
import type { SuspendedReopenReading } from './hitl/suspendedReopen.js';
|
|
8
8
|
import type { ToolKillCause } from './toolResult.js';
|
|
9
9
|
import type { HumanInputAttachmentView } from './ownKey.js';
|
|
10
|
+
import type { TaskNotificationFields } from './notifications.js';
|
|
10
11
|
export interface AbortSignalLike {
|
|
11
12
|
readonly aborted: boolean;
|
|
12
13
|
}
|
|
@@ -115,6 +116,7 @@ export type ChromeEvent = {
|
|
|
115
116
|
status: 'completed' | 'failed';
|
|
116
117
|
summary: string;
|
|
117
118
|
message: string;
|
|
119
|
+
notification: Readonly<TaskNotificationFields>;
|
|
118
120
|
} | {
|
|
119
121
|
kind: 'task_ledger_sync';
|
|
120
122
|
laneProof: LaneProof;
|
package/dist/seam.js
CHANGED
|
@@ -170,7 +170,7 @@ const CHROME_ARM_TABLE = {
|
|
|
170
170
|
},
|
|
171
171
|
text_segment_end: {
|
|
172
172
|
required: true,
|
|
173
|
-
duty: '🔴 引擎明报的 assistant 散文段边界 + **该段权威全文**(
|
|
173
|
+
duty: '🔴 引擎明报的 assistant 散文段边界 + **该段权威全文**(server ≥7.75.3 起 content 经脱敏器、' +
|
|
174
174
|
'text_delta 仍逐字 ⇒ 两者**可以不相等**)。①`diverged` 在场(never false)⇒ 你按增量拼出来的那一段是过期的,' +
|
|
175
175
|
'必须用 content **重渲该段**并以它为该段 committed 文本,不许保留增量拼文;②`committedPrefixDiverged` 在场' +
|
|
176
176
|
'(never false)⇒ 这一段此前已 committed 上屏的正文**也**过期了,🔴 本包在这一形上**一个字节都不再交**(唯一不同:本段已提交行的归属说不出 —— 上游两行同 uuid,`committedUuids` 整键缺席 —— 时本包一个字节不动,还押着的原始那截在本事件之后照旧作为本段末行交出)' +
|
|
@@ -201,14 +201,14 @@ export function terminalOwnerOf(row) {
|
|
|
201
201
|
if (typeof row !== 'object' || row === null)
|
|
202
202
|
return undefined;
|
|
203
203
|
const d = Object.getOwnPropertyDescriptor(row, SEMA_TERMINAL_OWNER_KEY);
|
|
204
|
-
if (d === undefined || !('value'
|
|
204
|
+
if (d === undefined || !Object.hasOwn(d, 'value'))
|
|
205
205
|
return undefined;
|
|
206
206
|
const v = d.value;
|
|
207
207
|
if (typeof v !== 'object' || v === null)
|
|
208
208
|
return undefined;
|
|
209
209
|
const own = (k) => {
|
|
210
210
|
const pd = Object.getOwnPropertyDescriptor(v, k);
|
|
211
|
-
return pd !== undefined && 'value'
|
|
211
|
+
return pd !== undefined && Object.hasOwn(pd, 'value') && typeof pd.value === 'string' && pd.value.length > 0 ? pd.value : undefined;
|
|
212
212
|
};
|
|
213
213
|
const kind = own('kind');
|
|
214
214
|
if (kind === 'request-not-sent') {
|
package/dist/seatContract.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import type { SubagentContentEvent } from "./subagentContentStore.js";
|
|
|
13
13
|
import type { DeviceEnrollTokenOutcome, DeviceListOutcome, DeviceRebindOutcome, DeviceRevokeOutcome, DeviceSessionBindingOutcome, DeviceTransport, DeviceUnarmed, DeviceUnreadable } from "./deviceRebind.js";
|
|
14
14
|
import type { McpPanelView } from "./mcpPanel.js";
|
|
15
15
|
import type { McpToolToggleKey } from "./mcpToolToggles.js";
|
|
16
|
+
import { type ThinkingLatchEvent, type ThinkingLatchRowWord } from "./thinkingLatchWords.js";
|
|
16
17
|
export interface SeatValidationFailure {
|
|
17
18
|
reason: string;
|
|
18
19
|
field?: string;
|
|
@@ -47,6 +48,7 @@ export interface LocalSessionRecord {
|
|
|
47
48
|
}>;
|
|
48
49
|
parked?: boolean;
|
|
49
50
|
pinned?: boolean;
|
|
51
|
+
thinkingLatch?: ThinkingLatchRowWord;
|
|
50
52
|
}
|
|
51
53
|
export declare const TOOL_PERMISSION_REQUEST_ID_DOMAINS: readonly ["live:", "durable:", "question:", "elicit:", "plan:"];
|
|
52
54
|
export type ToolPermissionRequestIdDomain = (typeof TOOL_PERMISSION_REQUEST_ID_DOMAINS)[number];
|
|
@@ -79,7 +81,52 @@ export interface ToolPermissionRequest {
|
|
|
79
81
|
declare const SEAT_EVENT_TYPE_TUPLE: readonly ["start", "close", "session_updated", "message", "stream_event", "chrome_event", "error", "tool_permission_resolved", "subagent_content"];
|
|
80
82
|
export type SeatEventType = (typeof SEAT_EVENT_TYPE_TUPLE)[number];
|
|
81
83
|
export declare const SEAT_EVENT_TYPES: readonly SeatEventType[];
|
|
82
|
-
declare const
|
|
84
|
+
declare const CHROME_ARM_SEAT_ROUTE: {
|
|
85
|
+
readonly panel_task: "seat";
|
|
86
|
+
readonly notification_terminal: "seat";
|
|
87
|
+
readonly prompt_suggestions: "seat";
|
|
88
|
+
readonly subagent_lifecycle: "seat";
|
|
89
|
+
readonly text_segment_end: "seat";
|
|
90
|
+
readonly thinking_segment_end: "seat";
|
|
91
|
+
readonly retry_status: "seat";
|
|
92
|
+
readonly context_usage: "seat";
|
|
93
|
+
readonly last_turn_usage: "seat";
|
|
94
|
+
readonly bgshell_register: "seat";
|
|
95
|
+
readonly bgshell_settle: "seat";
|
|
96
|
+
readonly memory_saved: "seat";
|
|
97
|
+
readonly result_replayed: "seat";
|
|
98
|
+
readonly tool_parked: "seat";
|
|
99
|
+
readonly compaction_started: "seat";
|
|
100
|
+
readonly compaction_outcome: "seat";
|
|
101
|
+
readonly engine_notice: "seat";
|
|
102
|
+
readonly workflow_notification_enqueue: "host";
|
|
103
|
+
readonly plan_review_park: "host";
|
|
104
|
+
readonly approval_request: "host";
|
|
105
|
+
readonly approval_revoke: "host";
|
|
106
|
+
readonly task_ledger_sync: "host";
|
|
107
|
+
readonly inline_task_stats: "host";
|
|
108
|
+
readonly stream_delta: "host";
|
|
109
|
+
readonly thinking_activity: "host";
|
|
110
|
+
readonly request_start: "host";
|
|
111
|
+
readonly response_metrics: "host";
|
|
112
|
+
readonly attachment: "host";
|
|
113
|
+
readonly subagent_turn_usage: "host";
|
|
114
|
+
readonly run_cost_reconciled: "host";
|
|
115
|
+
readonly message_committed: "host";
|
|
116
|
+
readonly human_input: "host";
|
|
117
|
+
readonly tool_roster_delta: "host";
|
|
118
|
+
readonly subagent_started: "host";
|
|
119
|
+
readonly prompt_assembled: "host";
|
|
120
|
+
readonly tool_disclosure: "host";
|
|
121
|
+
readonly tool_progress: "host";
|
|
122
|
+
readonly wiring_manifest: "host";
|
|
123
|
+
readonly suspended_reopened: "host";
|
|
124
|
+
readonly result_text_diverged: "host";
|
|
125
|
+
};
|
|
126
|
+
type SeatRoutedKind = {
|
|
127
|
+
[K in keyof typeof CHROME_ARM_SEAT_ROUTE]: (typeof CHROME_ARM_SEAT_ROUTE)[K] extends "seat" ? K : never;
|
|
128
|
+
}[keyof typeof CHROME_ARM_SEAT_ROUTE];
|
|
129
|
+
declare const CHROME_EVENT_KIND_TUPLE: readonly SeatRoutedKind[];
|
|
83
130
|
export type ChromeEventKind = Extract<ChromeArmKind, (typeof CHROME_EVENT_KIND_TUPLE)[number]>;
|
|
84
131
|
export declare const CHROME_EVENT_KINDS: readonly ChromeEventKind[];
|
|
85
132
|
export interface SeatChromeEnvelopeBase {
|
|
@@ -145,7 +192,7 @@ export type SeatStreamReading = {
|
|
|
145
192
|
};
|
|
146
193
|
export declare function seatStreamDeltaMessage(event: SeatStreamDeltaSource, ids: SeatStreamDeltaIds): SeatStreamEventMessage | undefined;
|
|
147
194
|
export declare function readSeatStreamDelta(message: object): SeatStreamReading;
|
|
148
|
-
export declare const SEAT_CAPABILITY_NAMES: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles"];
|
|
195
|
+
export declare const SEAT_CAPABILITY_NAMES: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles", "thinkingLatch"];
|
|
149
196
|
export type SeatCapabilityName = (typeof SEAT_CAPABILITY_NAMES)[number];
|
|
150
197
|
export interface SeatCapabilitiesState {
|
|
151
198
|
pickFolder?: boolean;
|
|
@@ -156,6 +203,7 @@ export interface SeatCapabilitiesState {
|
|
|
156
203
|
engineTarget?: boolean;
|
|
157
204
|
onboard?: boolean;
|
|
158
205
|
mcpToolToggles?: boolean;
|
|
206
|
+
thinkingLatch?: boolean;
|
|
159
207
|
}
|
|
160
208
|
export type SeatCapabilityReading = {
|
|
161
209
|
readonly kind: "reported";
|
|
@@ -259,6 +307,10 @@ export interface SessionRowPatchRequest {
|
|
|
259
307
|
pinned?: boolean;
|
|
260
308
|
}
|
|
261
309
|
export declare const SESSION_ROW_PATCH_REQUEST_KEYS: readonly ["sessionId", "title", "pinned"];
|
|
310
|
+
export interface SetThinkingLatchRequest {
|
|
311
|
+
readonly sessionId: string;
|
|
312
|
+
readonly event: ThinkingLatchEvent;
|
|
313
|
+
}
|
|
262
314
|
export interface AttachmentUploadReceipt {
|
|
263
315
|
id: string;
|
|
264
316
|
name: string;
|
|
@@ -585,6 +637,7 @@ export interface LocalSessionsApi {
|
|
|
585
637
|
readSessionMcpPanel(sessionId: string): Promise<McpPanelView | DeviceUnreadable | DeviceTransport | DeviceUnarmed>;
|
|
586
638
|
listMcpToolToggles(): Promise<McpToolTogglesResult>;
|
|
587
639
|
setMcpToolToggle(key: McpToolToggleKey, enabled: boolean): Promise<OkAck>;
|
|
640
|
+
setThinkingLatch(req: SetThinkingLatchRequest): Promise<OkAck>;
|
|
588
641
|
onEvent(cb: (ev: LocalSessionEvent) => void): () => void;
|
|
589
642
|
onToolPermissionRequest(cb: (req: ToolPermissionRequest) => void): () => void;
|
|
590
643
|
sessionsStateStore: EipcStoreClient<SessionsState>;
|
|
@@ -626,14 +679,16 @@ export declare function checkSendMessageRequest(v: unknown): SeatValidation;
|
|
|
626
679
|
export declare function isSendMessageRequest(v: unknown): v is SendMessageRequest;
|
|
627
680
|
export declare const checkSessionRowPatchRequest: (v: unknown) => SeatValidation;
|
|
628
681
|
export declare function isSessionRowPatchRequest(v: unknown): v is SessionRowPatchRequest;
|
|
682
|
+
export declare const checkSetThinkingLatchRequest: (v: unknown) => SeatValidation;
|
|
683
|
+
export declare function isSetThinkingLatchRequest(v: unknown): v is SetThinkingLatchRequest;
|
|
629
684
|
export declare function isSendMessageAck(v: unknown): v is SendMessageAck;
|
|
630
685
|
export declare const LOCAL_SESSIONS_SPEC: EipcServiceSpec;
|
|
631
|
-
export declare const SEAT_METHOD_NAMES: readonly ["start", "sendMessage", "interrupt", "stop", "respondToToolPermission", "cancelQueuedMessage", "reorderQueuedMessage", "promoteQueuedMessage", "setFocusedSession", "setModel", "getTranscript", "searchSessions", "uploadAttachment", "listModels", "applyModelConfig", "pickFolder", "listRecentFolders", "noteRecentFolder", "patchSession", "listDevices", "readSessionBinding", "rebindSession", "issueEnrollToken", "revokeDevice", "setEngineMode", "startCloudLogin", "cancelCloudLogin", "connectCloudEngine", "configureCloudEngine", "clearCloudEngine", "listOnboardProviders", "probeOnboardEntry", "applyOnboardEntry", "readSessionMcpPanel", "listMcpToolToggles", "setMcpToolToggle", "onEvent", "onToolPermissionRequest"];
|
|
686
|
+
export declare const SEAT_METHOD_NAMES: readonly ["start", "sendMessage", "interrupt", "stop", "respondToToolPermission", "cancelQueuedMessage", "reorderQueuedMessage", "promoteQueuedMessage", "setFocusedSession", "setModel", "getTranscript", "searchSessions", "uploadAttachment", "listModels", "applyModelConfig", "pickFolder", "listRecentFolders", "noteRecentFolder", "patchSession", "listDevices", "readSessionBinding", "rebindSession", "issueEnrollToken", "revokeDevice", "setEngineMode", "startCloudLogin", "cancelCloudLogin", "connectCloudEngine", "configureCloudEngine", "clearCloudEngine", "listOnboardProviders", "probeOnboardEntry", "applyOnboardEntry", "readSessionMcpPanel", "listMcpToolToggles", "setMcpToolToggle", "setThinkingLatch", "onEvent", "onToolPermissionRequest"];
|
|
632
687
|
export declare const SEAT_STORE_PROPS: readonly ["sessionsStateStore", "focusedSessionStateStore", "settingsStateStore", "seatCapabilitiesStateStore", "engineTargetStateStore"];
|
|
633
688
|
export declare const SEAT_EVENT_METHOD_NAMES: readonly ["onEvent", "onToolPermissionRequest"];
|
|
634
689
|
export declare const LOCAL_SESSION_EVENT_KEYS: readonly ["type", "sessionId", "message", "error", "errorCategory", "code", "session", "userMessageUuid", "requestId", "outcome", "parked", "chrome", "_sema_turnFailure", "subagentContent"];
|
|
635
690
|
export declare const TOOL_PERMISSION_REQUEST_KEYS: readonly ["requestId", "sessionId", "toolName", "toolCallId", "input", "message", "toctouBinding", "createdAtMs", "governanceForced", "delegation", "mandated", "mandate", "origin", "ruleOffersAbsence", "askClass", "classes", "sessionRow"];
|
|
636
|
-
export declare const LOCAL_SESSION_RECORD_KEYS: readonly ["sessionId", "engineSessionId", "model", "title", "cwd", "isRunning", "createdAt", "lastActivityAt", "queuedMessages", "parked", "pinned"];
|
|
691
|
+
export declare const LOCAL_SESSION_RECORD_KEYS: readonly ["sessionId", "engineSessionId", "model", "title", "cwd", "isRunning", "createdAt", "lastActivityAt", "queuedMessages", "parked", "pinned", "thinkingLatch"];
|
|
637
692
|
export declare const SEND_MESSAGE_REQUEST_KEYS: readonly ["sessionId", "text", "model", "userMessageUuid", "permissionMode", "attachmentIds", "reasoningEffort", "retainBackgroundProcesses", "forwardSubagentEvents", "retainSubagentSessions", "settings", "scenario", "rewind"];
|
|
638
693
|
export declare const SEAT_SEND_MESSAGE_KEY_ORIGINS: {
|
|
639
694
|
readonly sessionId: {
|
|
@@ -683,7 +738,7 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
683
738
|
readonly LocalSessionRecord: {
|
|
684
739
|
readonly guard: "isLocalSessionRecord";
|
|
685
740
|
readonly check: (v: unknown) => SeatValidation;
|
|
686
|
-
readonly validated: readonly ["sessionId", "engineSessionId", "model", "title", "cwd", "isRunning", "createdAt", "lastActivityAt", "queuedMessages", "parked", "pinned"];
|
|
741
|
+
readonly validated: readonly ["sessionId", "engineSessionId", "model", "title", "cwd", "isRunning", "createdAt", "lastActivityAt", "queuedMessages", "parked", "pinned", "thinkingLatch"];
|
|
687
742
|
readonly unchecked: readonly [];
|
|
688
743
|
};
|
|
689
744
|
readonly ToolPermissionRequest: {
|
|
@@ -763,6 +818,12 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
763
818
|
readonly validated: readonly ["sessionId", "title", "pinned"];
|
|
764
819
|
readonly unchecked: readonly [];
|
|
765
820
|
};
|
|
821
|
+
readonly SetThinkingLatchRequest: {
|
|
822
|
+
readonly guard: "isSetThinkingLatchRequest";
|
|
823
|
+
readonly check: (v: unknown) => SeatValidation;
|
|
824
|
+
readonly validated: readonly ["sessionId", "event"];
|
|
825
|
+
readonly unchecked: readonly [];
|
|
826
|
+
};
|
|
766
827
|
readonly ApplyModelConfigResult: {
|
|
767
828
|
readonly check: (v: unknown) => SeatValidation;
|
|
768
829
|
readonly validated: readonly ["ok", "requiresRestart", "reason", "detail"];
|
|
@@ -816,7 +877,7 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
816
877
|
};
|
|
817
878
|
readonly SeatCapabilitiesState: {
|
|
818
879
|
readonly check: (v: unknown) => SeatValidation;
|
|
819
|
-
readonly validated: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles"];
|
|
880
|
+
readonly validated: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles", "thinkingLatch"];
|
|
820
881
|
readonly unchecked: readonly [];
|
|
821
882
|
};
|
|
822
883
|
readonly RecentFoldersResult: {
|
|
@@ -862,7 +923,7 @@ export declare const SEAT_VALIDATOR_COVERAGE_EXEMPT: readonly [...{
|
|
|
862
923
|
}[], {
|
|
863
924
|
readonly label: "PickFolderResult";
|
|
864
925
|
readonly check: (v: unknown) => SeatValidation;
|
|
865
|
-
readonly why: "载荷是**串或 null**(选中的路径 / 用户取消,CC-469),没有键面 ⇒ `keyof`
|
|
926
|
+
readonly why: "载荷是**串或 null**(选中的路径 / 用户取消,CC-469),没有键面 ⇒ `keyof` 覆盖表在它身上无从谈起。判别力由对应的座位契约测试套承担:认 null 与非空串、拒空串 / 数 / undefined / 对象 / 布尔五形。";
|
|
866
927
|
}, {
|
|
867
928
|
readonly label: "BooleanAck";
|
|
868
929
|
readonly check: (v: unknown) => SeatValidation;
|