@sema-agent/client-core 0.99.0 → 0.101.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 +572 -0
- package/README.md +174 -114
- package/dist/adapt/arms.js +109 -50
- package/dist/adapt/panelTasks.d.ts +2 -1
- package/dist/adapt/panelTasks.js +32 -9
- package/dist/adapt/textStream.d.ts +1 -1
- package/dist/adapt/textStream.js +58 -32
- package/dist/adapt/toolCards.js +9 -8
- package/dist/adapt.js +7 -1
- package/dist/adapter/activeRunSelfHeal.d.ts +31 -2
- package/dist/adapter/activeRunSelfHeal.js +162 -13
- package/dist/adapter/downstream/eventToSdkMessage.d.ts +25 -6
- package/dist/adapter/downstream/eventToSdkMessage.js +157 -20
- package/dist/adapter/downstream/terminalToSdkResult.d.ts +60 -1
- package/dist/adapter/downstream/terminalToSdkResult.js +219 -39
- package/dist/adapter/downstream/wiringManifestView.d.ts +3 -1
- package/dist/adapter/downstream/wiringManifestView.js +1 -0
- package/dist/adapter/runStream.d.ts +4 -4
- package/dist/adapter/runStream.js +184 -42
- package/dist/adapter/types.d.ts +2 -0
- package/dist/agentsWireCaps.d.ts +9 -7
- package/dist/agentsWireCaps.js +101 -17
- 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 +28 -5
- package/dist/cloudConfigWireCaps.js +334 -103
- package/dist/compactionStatus.d.ts +34 -0
- package/dist/compactionStatus.js +196 -0
- package/dist/coreValuePorts.d.ts +12 -2
- package/dist/coreValuePorts.js +9 -0
- package/dist/decideFailureNote.js +8 -6
- 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 +1 -0
- package/dist/displayUntrusted.js +215 -13
- package/dist/engineAgentPanelStore.d.ts +7 -4
- package/dist/engineCapReader.js +1 -1
- package/dist/engineConfigDrift.js +1 -1
- package/dist/engineErrorCodes.d.ts +23 -6
- package/dist/engineErrorCodes.js +36 -11
- 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.d.ts +3 -0
- package/dist/engineToolDirectory.js +6 -4
- 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/eventLeg.d.ts +1 -7
- package/dist/eventLeg.js +7 -8
- package/dist/executionLaneCapability.js +2 -2
- package/dist/fileHistoryCaptureCapability.d.ts +0 -3
- package/dist/fileHistoryCaptureCapability.js +3 -7
- 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 +15 -2
- package/dist/gateVocabulary.js +3 -0
- package/dist/generated/engineFactTables.d.ts +7 -2
- package/dist/generated/engineFactTables.js +79 -0
- package/dist/generated/engineNoticeTables.js +15 -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 +66 -0
- package/dist/generated/settingsSchemaFns.js +38 -0
- package/dist/generated/settingsSchemaMcpRequestEntry.d.ts +1 -0
- package/dist/generated/settingsSchemaMcpRequestEntry.js +156 -0
- 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 +3 -0
- package/dist/generated/settingsSchemaTables.js +18 -0
- package/dist/generated/settingsSchemaTypes.d.ts +28 -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 +9 -7
- package/dist/hitl/approvalCardReading.d.ts +3 -0
- package/dist/hitl/approvalCardReading.js +17 -0
- package/dist/hitl/approvalCardReasons.js +2 -2
- 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/approvalHolds.d.ts +14 -0
- package/dist/hitl/approvalHolds.js +41 -0
- package/dist/hitl/approvalResolution.d.ts +11 -0
- package/dist/hitl/approvalResolution.js +50 -11
- package/dist/hitl/askClassPair.d.ts +8 -2
- package/dist/hitl/askClassPair.js +31 -4
- 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 +62 -0
- package/dist/hitl/attributionLadder.js +138 -0
- 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/decisionLedger.d.ts +55 -0
- package/dist/hitl/decisionLedger.js +156 -0
- package/dist/hitl/decisionRefusal.d.ts +21 -10
- package/dist/hitl/decisionRefusal.js +100 -55
- package/dist/hitl/decisionSend.d.ts +116 -0
- package/dist/hitl/decisionSend.js +563 -0
- 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 +59 -43
- 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 +104 -106
- 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 +65 -35
- 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 +103 -151
- 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 +114 -19
- package/dist/hostTurnSettings.js +966 -68
- package/dist/httpHookPolicy.d.ts +37 -0
- package/dist/httpHookPolicy.js +176 -0
- package/dist/humanTurn.d.ts +4 -2
- package/dist/humanTurn.js +40 -10
- 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 +313 -0
- package/dist/i18n/messages.en.js +326 -13
- package/dist/i18n/messages.zh.js +341 -13
- package/dist/i18n/translate.js +3 -3
- package/dist/index.d.ts +85 -15
- package/dist/index.js +53 -12
- package/dist/inheritEnvCapability.d.ts +4 -1
- package/dist/inheritEnvCapability.js +38 -17
- package/dist/inheritEnvWire.d.ts +2 -1
- package/dist/inheritEnvWire.js +11 -5
- package/dist/injectionLaneNotice.d.ts +5 -0
- package/dist/injectionLaneNotice.js +46 -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 +3 -1
- package/dist/mcpProbeCapability.js +2 -2
- package/dist/mcpReconnect.js +2 -2
- package/dist/mcpStatusSupersetKeys.d.ts +24 -0
- package/dist/mcpStatusSupersetKeys.js +45 -0
- package/dist/mcpToolToggles.d.ts +6 -0
- package/dist/mcpToolToggles.js +47 -0
- package/dist/mcpWireCaps.d.ts +48 -4
- package/dist/mcpWireCaps.js +338 -99
- package/dist/mcpWireTransport.d.ts +4 -0
- package/dist/mcpWireTransport.js +18 -0
- 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.d.ts +2 -1
- package/dist/modelCapabilityProbe.js +16 -15
- package/dist/modelIdentityResolvability.d.ts +12 -1
- package/dist/modelIdentityResolvability.js +69 -28
- 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 +37 -0
- package/dist/ownKey.js +238 -2
- package/dist/panelReduce.d.ts +5 -0
- package/dist/panelReduce.js +45 -13
- package/dist/panelStateHolder.d.ts +1 -0
- package/dist/panelStateHolder.js +10 -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.d.ts +2 -1
- package/dist/permissionRuleIssue.js +24 -21
- 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 +101 -60
- package/dist/prepareRefusal.d.ts +9 -0
- package/dist/prepareRefusal.js +90 -0
- package/dist/printInitToolFace.js +2 -2
- package/dist/printModelStatus.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 +5 -1
- package/dist/request/submissionIdentity.d.ts +37 -0
- package/dist/request/submissionIdentity.js +65 -0
- package/dist/request/taskRequest.d.ts +22 -14
- package/dist/request/taskRequest.js +312 -202
- package/dist/resultFrameKeys.d.ts +1 -0
- package/dist/resultFrameKeys.js +4 -1
- package/dist/resumeRefusalCopy.d.ts +3 -1
- package/dist/resumeRefusalCopy.js +22 -4
- package/dist/retryStatus.d.ts +26 -0
- package/dist/retryStatus.js +133 -28
- 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 +8 -0
- package/dist/ruleRefusalSentence.js +64 -0
- 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 +3 -2
- package/dist/sandboxWire.js +59 -27
- package/dist/scenarioRefusal.d.ts +2 -1
- package/dist/scenarioRefusal.js +6 -6
- 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 +26 -9
- package/dist/seam.js +44 -4
- package/dist/seatContract.d.ts +62 -9
- package/dist/seatContract.js +70 -25
- package/dist/selfOrchestrationDenial.js +1 -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.d.ts +8 -0
- package/dist/settingsCredentialKeyPaths.js +274 -0
- 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 -3
- package/dist/skillsWireCaps.js +48 -18
- 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/subagentContentStore.d.ts +1 -0
- package/dist/subagentContentStore.js +135 -27
- 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/toolHistoryMismatch.d.ts +8 -0
- package/dist/toolHistoryMismatch.js +37 -6
- package/dist/toolResult.d.ts +13 -3
- package/dist/toolResult.js +158 -9
- 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/toolsFlagNames.d.ts +8 -0
- package/dist/toolsFlagNames.js +110 -0
- package/dist/turnFailurePresentation.js +41 -96
- 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 +75 -18
- package/dist/wireRefusalCopy.js +532 -148
- 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 +1013 -190
- package/package.json +15 -4
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { UiLanguage } from './env/uiLanguage.js';
|
|
1
2
|
export interface ScenarioRefusalReading {
|
|
2
3
|
readonly errorCode?: string;
|
|
3
4
|
readonly error?: string;
|
|
@@ -6,4 +7,4 @@ export interface ScenarioRefusalReading {
|
|
|
6
7
|
}
|
|
7
8
|
export declare function scenarioRefusalOf(body: object): ScenarioRefusalReading | undefined | null;
|
|
8
9
|
export declare function scenarioRefusalFromError(err: {} | null | undefined): ScenarioRefusalReading | null;
|
|
9
|
-
export declare function scenarioRefusalContent(reading: ScenarioRefusalReading): string;
|
|
10
|
+
export declare function scenarioRefusalContent(reading: ScenarioRefusalReading, lang?: UiLanguage): string;
|
package/dist/scenarioRefusal.js
CHANGED
|
@@ -3,6 +3,7 @@ import { readOwnDataValue } from './ownKey.js';
|
|
|
3
3
|
import { SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE } from './engineErrorCodes.js';
|
|
4
4
|
import { readErrorRecord, readErrorString } from './wireFailureShape.js';
|
|
5
5
|
import { effectiveWireErrorCode } from './wireErrorTriage.js';
|
|
6
|
+
import { msg, renderMessage } from './i18n/translate.js';
|
|
6
7
|
const SCENARIO_REFUSAL_ERROR_MAX = 200;
|
|
7
8
|
function detailBits(detail) {
|
|
8
9
|
if (detail === undefined)
|
|
@@ -33,7 +34,7 @@ export function scenarioRefusalOf(body) {
|
|
|
33
34
|
const d = Object.getOwnPropertyDescriptor(body, 'scenarioRefusal');
|
|
34
35
|
if (d === undefined)
|
|
35
36
|
return undefined;
|
|
36
|
-
raw = 'value'
|
|
37
|
+
raw = Object.hasOwn(d, 'value') ? d.value : undefined;
|
|
37
38
|
}
|
|
38
39
|
catch {
|
|
39
40
|
return null;
|
|
@@ -86,7 +87,7 @@ export function scenarioRefusalFromError(err) {
|
|
|
86
87
|
return null;
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
|
-
export function scenarioRefusalContent(reading) {
|
|
90
|
+
export function scenarioRefusalContent(reading, lang) {
|
|
90
91
|
let code;
|
|
91
92
|
let scenario;
|
|
92
93
|
let source;
|
|
@@ -102,10 +103,9 @@ export function scenarioRefusalContent(reading) {
|
|
|
102
103
|
}
|
|
103
104
|
if (code === SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE) {
|
|
104
105
|
const name = typeof scenario === 'string' && scenario.length > 0 ? ` ("${capForDisplay(scenario, 80)}")` : '';
|
|
105
|
-
const from = source === 'ruling' ? '
|
|
106
|
-
return (
|
|
107
|
-
"new runs that do not name a scenario, and this session's list of MCP servers · Ask whoever operates the engine to fix the scenario assignment");
|
|
106
|
+
const from = source === 'ruling' ? msg('config.scenarioRefusal.source.ruling') : source === 'deployment' ? msg('config.scenarioRefusal.source.deployment') : '';
|
|
107
|
+
return renderMessage(msg('config.scenarioRefusal.dangling', { name, from }), lang);
|
|
108
108
|
}
|
|
109
109
|
const tail = typeof code === 'string' && code.length > 0 ? ` (${capForDisplay(code, 80)})` : '';
|
|
110
|
-
return
|
|
110
|
+
return renderMessage(msg('config.scenarioRefusal.generic', { tail }), lang);
|
|
111
111
|
}
|
|
@@ -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
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { ModelUsage, SDKMessage } from '@sema-agent/agent-types';
|
|
2
2
|
import type { EngineTurnUsage } from './adapter/downstream/turnUsageToModelUsage.js';
|
|
3
3
|
import type { RunCostReconcile } from './adapter/downstream/terminalToSdkResult.js';
|
|
4
|
-
import type { WiringManifestAutoMode, WiringManifestModelGate, WiringManifestMcpEntryView, WiringManifestHookEntryView, WiringManifestLspSeamView, WiringManifestWriteProtectionView, WiringManifestAutoConsolidationView, WiringManifestReadDenyView, ContextUsageSectionView, PromptManifestSectionView, PromptManifestBlockView, PromptManifestToolView } from './adapter/downstream/eventToSdkMessage.js';
|
|
4
|
+
import type { WiringManifestAutoMode, WiringManifestModelGate, WiringManifestMcpEntryView, WiringManifestHookEntryView, WiringManifestLspSeamView, WiringManifestWriteProtectionView, WiringManifestAutoConsolidationView, WiringManifestReadDenyView, WiringManifestModView, ContextUsageSectionView, PromptManifestSectionView, PromptManifestBlockView, PromptManifestToolView, PromptManifestIdentityView } from './adapter/downstream/eventToSdkMessage.js';
|
|
5
5
|
import type { ToolRosterView, ToolRosterDeltaView, WiringManifestHandsView } from './toolRoster.js';
|
|
6
6
|
import type { WiringManifestFleetView } from './adapter/downstream/wiringManifestView.js';
|
|
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
|
}
|
|
@@ -34,13 +35,6 @@ export interface AdapterContext {
|
|
|
34
35
|
readonly toolName: string;
|
|
35
36
|
}): ToolKillCause | undefined;
|
|
36
37
|
coalesceIntervalMs?: number;
|
|
37
|
-
continuesPark?: ContinuesParkDeclaration;
|
|
38
|
-
}
|
|
39
|
-
export interface ContinuesParkDeclaration {
|
|
40
|
-
readonly toolCallId: string;
|
|
41
|
-
readonly checkpointId?: string;
|
|
42
|
-
readonly parkedTaskId?: string;
|
|
43
|
-
readonly continuationTaskId?: string;
|
|
44
38
|
}
|
|
45
39
|
export type ChromeEvent = {
|
|
46
40
|
kind: 'retry_status';
|
|
@@ -122,6 +116,7 @@ export type ChromeEvent = {
|
|
|
122
116
|
status: 'completed' | 'failed';
|
|
123
117
|
summary: string;
|
|
124
118
|
message: string;
|
|
119
|
+
notification: Readonly<TaskNotificationFields>;
|
|
125
120
|
} | {
|
|
126
121
|
kind: 'task_ledger_sync';
|
|
127
122
|
laneProof: LaneProof;
|
|
@@ -167,7 +162,7 @@ export type ChromeEvent = {
|
|
|
167
162
|
} | ({
|
|
168
163
|
kind: 'run_cost_reconciled';
|
|
169
164
|
laneProof: LaneProof;
|
|
170
|
-
} & RunCostReconcile) | HumanInputChromeEvent | MessageCommittedChromeEvent | EngineNoticeChromeEvent | TextSegmentEndChromeEvent | ThinkingSegmentEndChromeEvent | ToolDisclosureChromeEvent | ToolProgressChromeEvent | ToolRosterDeltaChromeEvent | ContextUsageChromeEvent | CompactionOutcomeChromeEvent | SubagentStartedChromeEvent | PromptAssembledChromeEvent | MemorySavedChromeEvent | WiringManifestChromeEvent | ResultTextDivergedChromeEvent | ResultReplayedChromeEvent | ToolParkedChromeEvent | ApprovalRequestChromeEvent | ApprovalRevokeChromeEvent | {
|
|
165
|
+
} & RunCostReconcile) | HumanInputChromeEvent | MessageCommittedChromeEvent | EngineNoticeChromeEvent | TextSegmentEndChromeEvent | ThinkingSegmentEndChromeEvent | ToolDisclosureChromeEvent | ToolProgressChromeEvent | ToolRosterDeltaChromeEvent | ContextUsageChromeEvent | CompactionOutcomeChromeEvent | CompactionStartedChromeEvent | SubagentStartedChromeEvent | PromptAssembledChromeEvent | MemorySavedChromeEvent | WiringManifestChromeEvent | ResultTextDivergedChromeEvent | ResultReplayedChromeEvent | ToolParkedChromeEvent | ApprovalRequestChromeEvent | ApprovalRevokeChromeEvent | {
|
|
171
166
|
kind: 'suspended_reopened';
|
|
172
167
|
laneProof: LaneProof;
|
|
173
168
|
reopen: Extract<SuspendedReopenReading, {
|
|
@@ -195,6 +190,7 @@ export interface WiringManifestChromeEvent {
|
|
|
195
190
|
readonly selected: readonly string[];
|
|
196
191
|
};
|
|
197
192
|
fleet?: WiringManifestFleetView;
|
|
193
|
+
mods?: readonly WiringManifestModView[];
|
|
198
194
|
eventId?: string;
|
|
199
195
|
}
|
|
200
196
|
export interface TextSegmentCommittedRow {
|
|
@@ -235,6 +231,15 @@ export interface CompactionOutcomeChromeEvent {
|
|
|
235
231
|
outcome: string;
|
|
236
232
|
trigger?: string;
|
|
237
233
|
reason?: string;
|
|
234
|
+
pass?: string;
|
|
235
|
+
eventId?: string;
|
|
236
|
+
}
|
|
237
|
+
export interface CompactionStartedChromeEvent {
|
|
238
|
+
kind: 'compaction_started';
|
|
239
|
+
laneProof: LaneProof;
|
|
240
|
+
pass: string;
|
|
241
|
+
trigger: string;
|
|
242
|
+
startedAt?: number;
|
|
238
243
|
eventId?: string;
|
|
239
244
|
}
|
|
240
245
|
export interface SubagentStartedChromeEvent {
|
|
@@ -269,6 +274,7 @@ export interface PromptAssembledChromeEvent {
|
|
|
269
274
|
blocks?: readonly PromptManifestBlockView[];
|
|
270
275
|
sections?: readonly PromptManifestSectionView[];
|
|
271
276
|
tools?: readonly PromptManifestToolView[];
|
|
277
|
+
identity?: PromptManifestIdentityView;
|
|
272
278
|
eventId?: string;
|
|
273
279
|
}
|
|
274
280
|
export interface ToolDisclosureChromeEvent {
|
|
@@ -401,3 +407,14 @@ export declare function deriveTranscriptId(frame: {
|
|
|
401
407
|
id?: unknown;
|
|
402
408
|
toolCallId?: unknown;
|
|
403
409
|
}, ctx: Pick<AdapterContext, 'uuid'>, suffix?: string): string;
|
|
410
|
+
export declare const SEMA_TERMINAL_OWNER_KEY = "_sema_terminal_owner";
|
|
411
|
+
export type TerminalOwner = {
|
|
412
|
+
readonly kind: 'request-not-sent';
|
|
413
|
+
readonly requestId?: string;
|
|
414
|
+
readonly heldBy?: string;
|
|
415
|
+
} | {
|
|
416
|
+
readonly kind: 'followed-run';
|
|
417
|
+
readonly taskId: string;
|
|
418
|
+
readonly runId?: string;
|
|
419
|
+
};
|
|
420
|
+
export declare function terminalOwnerOf(row: {} | null | undefined): TerminalOwner | undefined;
|
package/dist/seam.js
CHANGED
|
@@ -76,6 +76,12 @@ const CHROME_ARM_TABLE = {
|
|
|
76
76
|
duty: 'CC-89(0.75.0):一次压缩的非 compacted 结局(作废 / 失败等),给用户一条可见提示。`outcome` / `trigger` 是引擎开集原词,按成员渲染必带 default 臂、认不得照原词显示;' +
|
|
77
77
|
'🔴 不是终态 —— 任务还在跑,别据它收 spinner;`laneProof.lane` 为 subagent = 子代的压缩结局,别渲成主会话的;成功压缩不走本臂(权威是转录的 compact_boundary)。不接 = 压缩失败对用户不可见。',
|
|
78
78
|
},
|
|
79
|
+
compaction_started: {
|
|
80
|
+
required: false,
|
|
81
|
+
duty: '可选:一次压缩 pass 宣告开始(服务端 ≥ 7.132.0)—— 要显示「正在压缩」的宿主接它。🔴 别自己配对开 / 收:把本臂、`compaction_outcome` 臂与转录 `compact_boundary` 行喂给' +
|
|
82
|
+
' `createCompactionStatusTracker()`(按 `pass` 开收、子代车道不点亮主车道、流结束收口),交互车道读它的 `reading()`,print 车道把它的变化转成 CC 同形 `system/status` 帧;' +
|
|
83
|
+
'`trigger` 开集原词(按成员渲染带 default 臂);`startedAt` 缺席 = 没报;本臂不是终态,`laneProof.lane` 为 subagent = 子代的压缩,别渲成主会话的。',
|
|
84
|
+
},
|
|
79
85
|
subagent_started: {
|
|
80
86
|
required: false,
|
|
81
87
|
duty: '可选:委派子代每周期一帧的起跑事实(sdk `task_started`,服务端 ≥ 7.127.0)—— 要「起跑时就开子代行」的宿主接它(不接 = 首个 task_progress 才开行,与 0.98.0 同)。' +
|
|
@@ -167,13 +173,13 @@ const CHROME_ARM_TABLE = {
|
|
|
167
173
|
duty: '🔴 引擎明报的 assistant 散文段边界 + **该段权威全文**(#323/core #447;server ≥7.75.3 起 content 经脱敏器、' +
|
|
168
174
|
'text_delta 仍逐字 ⇒ 两者**可以不相等**)。①`diverged` 在场(never false)⇒ 你按增量拼出来的那一段是过期的,' +
|
|
169
175
|
'必须用 content **重渲该段**并以它为该段 committed 文本,不许保留增量拼文;②`committedPrefixDiverged` 在场' +
|
|
170
|
-
'(never false)⇒ 这一段此前已 committed 上屏的正文**也**过期了,🔴 本包在这一形上**一个字节都不再交**' +
|
|
176
|
+
'(never false)⇒ 这一段此前已 committed 上屏的正文**也**过期了,🔴 本包在这一形上**一个字节都不再交**(唯一不同:本段已提交行的归属说不出 —— 上游两行同 uuid,`committedUuids` 整键缺席 —— 时本包一个字节不动,还押着的原始那截在本事件之后照旧作为本段末行交出)' +
|
|
171
177
|
'(撤不回的那截拼不出 content)⇒ 把 committedPrefixLen 指的那一截换成 content,这一条**所有宿主都要做**;' +
|
|
172
178
|
'缺席 ⇒ 本包交的是尾段,前缀+尾段=content,什么都不用丢;③`committedPrefixLen`(never 0)= 定位量,' +
|
|
173
179
|
'🔴 **单位 = JS 字符串长度(UTF-16 代码单元),不是 UTF-8 字节、也不是几条消息**' +
|
|
174
|
-
'(按 UTF-8 字节截会在非 ASCII
|
|
175
|
-
'照抄 `已committed正文.slice(0, 长度 - committedPrefixLen) + content`;按**增量拼文**计长、不是 content 上的偏移;④三键全缺席 ⇒ 照旧只当对账/定界,拿 content 再渲一行 = 同一段上屏两遍;⑤`segmentId`(恒在场)=
|
|
176
|
-
'🔴 缺席只表示「没报」,绝不等于「段没结束」——要退回自家启发式必须按整条流判、不按单帧判;⑥`committedUuids[]`(0.71.0 起,在场 = 本窗口已提交行按序、`[]` = 零行、整键缺席 = 本包说不出):`committedPrefixDiverged` ⇒ **按 `committedRows[]` 逐行写回正文**(包已算好:首行 =
|
|
180
|
+
'(按 UTF-8 字节截会在非 ASCII 正文上截错位置把凭据留在屏上;按消息丢会连同一条消息里别的段的正文一起删掉),' +
|
|
181
|
+
'照抄 `已committed正文.slice(0, 长度 - committedPrefixLen) + content`;按**增量拼文**计长、不是 content 上的偏移;④三键全缺席 ⇒ 照旧只当对账/定界,拿 content 再渲一行 = 同一段上屏两遍;⑤`segmentId`(恒在场)= 段身份,与本段**全部** committed 文本行顶层 `_sema_segment_id` 同值(一行恰属一个段;本事件之后紧跟本段末行;段只按这一位认,不按消息界 / 相邻猜)—— 换掉已提交那截时认行的钥匙是**两把**:行 uuid ∧ 段身份(按字节相等找行会被同后缀的独立行冒充)。' +
|
|
182
|
+
'🔴 缺席只表示「没报」,绝不等于「段没结束」——要退回自家启发式必须按整条流判、不按单帧判;⑥`committedUuids[]`(0.71.0 起,在场 = 本窗口已提交行按序、`[]` = 零行、整键缺席 = 本包说不出):`committedPrefixDiverged` ⇒ **按 `committedRows[]` 逐行写回正文**(包已算好:首行 = content、其余行空),端不再自己数窗口里过境的行,也不再对多行段整发放弃;`committedUuid` = 末条兼容位;' +
|
|
177
183
|
'⑦序:该段尾部的活体增量(`stream_delta`)一律先于本事件到达,本事件之后不再有同段增量(下一条增量属于下一段)。',
|
|
178
184
|
},
|
|
179
185
|
};
|
|
@@ -189,3 +195,37 @@ export function deriveTranscriptId(frame, ctx, suffix) {
|
|
|
189
195
|
}
|
|
190
196
|
return ctx.uuid();
|
|
191
197
|
}
|
|
198
|
+
export const SEMA_TERMINAL_OWNER_KEY = '_sema_terminal_owner';
|
|
199
|
+
export function terminalOwnerOf(row) {
|
|
200
|
+
try {
|
|
201
|
+
if (typeof row !== 'object' || row === null)
|
|
202
|
+
return undefined;
|
|
203
|
+
const d = Object.getOwnPropertyDescriptor(row, SEMA_TERMINAL_OWNER_KEY);
|
|
204
|
+
if (d === undefined || !Object.hasOwn(d, 'value'))
|
|
205
|
+
return undefined;
|
|
206
|
+
const v = d.value;
|
|
207
|
+
if (typeof v !== 'object' || v === null)
|
|
208
|
+
return undefined;
|
|
209
|
+
const own = (k) => {
|
|
210
|
+
const pd = Object.getOwnPropertyDescriptor(v, k);
|
|
211
|
+
return pd !== undefined && Object.hasOwn(pd, 'value') && typeof pd.value === 'string' && pd.value.length > 0 ? pd.value : undefined;
|
|
212
|
+
};
|
|
213
|
+
const kind = own('kind');
|
|
214
|
+
if (kind === 'request-not-sent') {
|
|
215
|
+
const requestId = own('requestId');
|
|
216
|
+
const heldBy = own('heldBy');
|
|
217
|
+
return { kind, ...(requestId !== undefined ? { requestId } : {}), ...(heldBy !== undefined ? { heldBy } : {}) };
|
|
218
|
+
}
|
|
219
|
+
if (kind === 'followed-run') {
|
|
220
|
+
const taskId = own('taskId');
|
|
221
|
+
if (taskId === undefined)
|
|
222
|
+
return undefined;
|
|
223
|
+
const runId = own('runId');
|
|
224
|
+
return { kind, taskId, ...(runId !== undefined ? { runId } : {}) };
|
|
225
|
+
}
|
|
226
|
+
return undefined;
|
|
227
|
+
}
|
|
228
|
+
catch {
|
|
229
|
+
return undefined;
|
|
230
|
+
}
|
|
231
|
+
}
|
package/dist/seatContract.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { type ProbeVerdictWord } from "./modelCapabilityProbe.js";
|
|
|
12
12
|
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
|
+
import type { McpToolToggleKey } from "./mcpToolToggles.js";
|
|
15
16
|
export interface SeatValidationFailure {
|
|
16
17
|
reason: string;
|
|
17
18
|
field?: string;
|
|
@@ -78,7 +79,52 @@ export interface ToolPermissionRequest {
|
|
|
78
79
|
declare const SEAT_EVENT_TYPE_TUPLE: readonly ["start", "close", "session_updated", "message", "stream_event", "chrome_event", "error", "tool_permission_resolved", "subagent_content"];
|
|
79
80
|
export type SeatEventType = (typeof SEAT_EVENT_TYPE_TUPLE)[number];
|
|
80
81
|
export declare const SEAT_EVENT_TYPES: readonly SeatEventType[];
|
|
81
|
-
declare const
|
|
82
|
+
declare const CHROME_ARM_SEAT_ROUTE: {
|
|
83
|
+
readonly panel_task: "seat";
|
|
84
|
+
readonly notification_terminal: "seat";
|
|
85
|
+
readonly prompt_suggestions: "seat";
|
|
86
|
+
readonly subagent_lifecycle: "seat";
|
|
87
|
+
readonly text_segment_end: "seat";
|
|
88
|
+
readonly thinking_segment_end: "seat";
|
|
89
|
+
readonly retry_status: "seat";
|
|
90
|
+
readonly context_usage: "seat";
|
|
91
|
+
readonly last_turn_usage: "seat";
|
|
92
|
+
readonly bgshell_register: "seat";
|
|
93
|
+
readonly bgshell_settle: "seat";
|
|
94
|
+
readonly memory_saved: "seat";
|
|
95
|
+
readonly result_replayed: "seat";
|
|
96
|
+
readonly tool_parked: "seat";
|
|
97
|
+
readonly compaction_started: "seat";
|
|
98
|
+
readonly compaction_outcome: "seat";
|
|
99
|
+
readonly engine_notice: "seat";
|
|
100
|
+
readonly workflow_notification_enqueue: "host";
|
|
101
|
+
readonly plan_review_park: "host";
|
|
102
|
+
readonly approval_request: "host";
|
|
103
|
+
readonly approval_revoke: "host";
|
|
104
|
+
readonly task_ledger_sync: "host";
|
|
105
|
+
readonly inline_task_stats: "host";
|
|
106
|
+
readonly stream_delta: "host";
|
|
107
|
+
readonly thinking_activity: "host";
|
|
108
|
+
readonly request_start: "host";
|
|
109
|
+
readonly response_metrics: "host";
|
|
110
|
+
readonly attachment: "host";
|
|
111
|
+
readonly subagent_turn_usage: "host";
|
|
112
|
+
readonly run_cost_reconciled: "host";
|
|
113
|
+
readonly message_committed: "host";
|
|
114
|
+
readonly human_input: "host";
|
|
115
|
+
readonly tool_roster_delta: "host";
|
|
116
|
+
readonly subagent_started: "host";
|
|
117
|
+
readonly prompt_assembled: "host";
|
|
118
|
+
readonly tool_disclosure: "host";
|
|
119
|
+
readonly tool_progress: "host";
|
|
120
|
+
readonly wiring_manifest: "host";
|
|
121
|
+
readonly suspended_reopened: "host";
|
|
122
|
+
readonly result_text_diverged: "host";
|
|
123
|
+
};
|
|
124
|
+
type SeatRoutedKind = {
|
|
125
|
+
[K in keyof typeof CHROME_ARM_SEAT_ROUTE]: (typeof CHROME_ARM_SEAT_ROUTE)[K] extends "seat" ? K : never;
|
|
126
|
+
}[keyof typeof CHROME_ARM_SEAT_ROUTE];
|
|
127
|
+
declare const CHROME_EVENT_KIND_TUPLE: readonly SeatRoutedKind[];
|
|
82
128
|
export type ChromeEventKind = Extract<ChromeArmKind, (typeof CHROME_EVENT_KIND_TUPLE)[number]>;
|
|
83
129
|
export declare const CHROME_EVENT_KINDS: readonly ChromeEventKind[];
|
|
84
130
|
export interface SeatChromeEnvelopeBase {
|
|
@@ -144,7 +190,7 @@ export type SeatStreamReading = {
|
|
|
144
190
|
};
|
|
145
191
|
export declare function seatStreamDeltaMessage(event: SeatStreamDeltaSource, ids: SeatStreamDeltaIds): SeatStreamEventMessage | undefined;
|
|
146
192
|
export declare function readSeatStreamDelta(message: object): SeatStreamReading;
|
|
147
|
-
export declare const SEAT_CAPABILITY_NAMES: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard"];
|
|
193
|
+
export declare const SEAT_CAPABILITY_NAMES: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles"];
|
|
148
194
|
export type SeatCapabilityName = (typeof SEAT_CAPABILITY_NAMES)[number];
|
|
149
195
|
export interface SeatCapabilitiesState {
|
|
150
196
|
pickFolder?: boolean;
|
|
@@ -154,6 +200,7 @@ export interface SeatCapabilitiesState {
|
|
|
154
200
|
devices?: boolean;
|
|
155
201
|
engineTarget?: boolean;
|
|
156
202
|
onboard?: boolean;
|
|
203
|
+
mcpToolToggles?: boolean;
|
|
157
204
|
}
|
|
158
205
|
export type SeatCapabilityReading = {
|
|
159
206
|
readonly kind: "reported";
|
|
@@ -207,16 +254,16 @@ export declare const SEAT_TURN_SETTINGS_ORIGINS: Readonly<{
|
|
|
207
254
|
carriedBy: "renderer";
|
|
208
255
|
}>;
|
|
209
256
|
webSearch: Readonly<{
|
|
210
|
-
hostSupplied: "
|
|
257
|
+
hostSupplied: "settings.webSearch";
|
|
211
258
|
}>;
|
|
212
259
|
hooks: Readonly<{
|
|
213
|
-
hostSupplied: "hooks
|
|
260
|
+
hostSupplied: "settings.hooks";
|
|
214
261
|
}>;
|
|
215
262
|
resolved: Readonly<{
|
|
216
|
-
hostSupplied: "
|
|
263
|
+
hostSupplied: "settings.resolved";
|
|
217
264
|
}>;
|
|
218
265
|
outputStyle: Readonly<{
|
|
219
|
-
hostSupplied: "
|
|
266
|
+
hostSupplied: "settings.outputStyle";
|
|
220
267
|
}>;
|
|
221
268
|
}>;
|
|
222
269
|
export interface SeatRewindIntent {
|
|
@@ -542,6 +589,10 @@ export interface OnboardProvidersResult {
|
|
|
542
589
|
}
|
|
543
590
|
export declare const checkOnboardEntryRequest: (v: unknown) => SeatValidation;
|
|
544
591
|
export declare const checkOnboardApplyRequest: (v: unknown) => SeatValidation;
|
|
592
|
+
export declare const checkMcpToolToggleKey: (v: unknown) => SeatValidation;
|
|
593
|
+
export interface McpToolTogglesResult {
|
|
594
|
+
off: McpToolToggleKey[];
|
|
595
|
+
}
|
|
545
596
|
export interface LocalSessionsApi {
|
|
546
597
|
start(opts?: StartSessionOptions): Promise<LocalSessionRecord>;
|
|
547
598
|
sendMessage(req: SendMessageRequest): Promise<SendMessageAck>;
|
|
@@ -577,6 +628,8 @@ export interface LocalSessionsApi {
|
|
|
577
628
|
probeOnboardEntry(req: OnboardEntryRequest): Promise<OnboardProbeResult>;
|
|
578
629
|
applyOnboardEntry(req: OnboardApplyRequest): Promise<OnboardApplyResult>;
|
|
579
630
|
readSessionMcpPanel(sessionId: string): Promise<McpPanelView | DeviceUnreadable | DeviceTransport | DeviceUnarmed>;
|
|
631
|
+
listMcpToolToggles(): Promise<McpToolTogglesResult>;
|
|
632
|
+
setMcpToolToggle(key: McpToolToggleKey, enabled: boolean): Promise<OkAck>;
|
|
580
633
|
onEvent(cb: (ev: LocalSessionEvent) => void): () => void;
|
|
581
634
|
onToolPermissionRequest(cb: (req: ToolPermissionRequest) => void): () => void;
|
|
582
635
|
sessionsStateStore: EipcStoreClient<SessionsState>;
|
|
@@ -620,7 +673,7 @@ export declare const checkSessionRowPatchRequest: (v: unknown) => SeatValidation
|
|
|
620
673
|
export declare function isSessionRowPatchRequest(v: unknown): v is SessionRowPatchRequest;
|
|
621
674
|
export declare function isSendMessageAck(v: unknown): v is SendMessageAck;
|
|
622
675
|
export declare const LOCAL_SESSIONS_SPEC: EipcServiceSpec;
|
|
623
|
-
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", "onEvent", "onToolPermissionRequest"];
|
|
676
|
+
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"];
|
|
624
677
|
export declare const SEAT_STORE_PROPS: readonly ["sessionsStateStore", "focusedSessionStateStore", "settingsStateStore", "seatCapabilitiesStateStore", "engineTargetStateStore"];
|
|
625
678
|
export declare const SEAT_EVENT_METHOD_NAMES: readonly ["onEvent", "onToolPermissionRequest"];
|
|
626
679
|
export declare const LOCAL_SESSION_EVENT_KEYS: readonly ["type", "sessionId", "message", "error", "errorCategory", "code", "session", "userMessageUuid", "requestId", "outcome", "parked", "chrome", "_sema_turnFailure", "subagentContent"];
|
|
@@ -808,7 +861,7 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
808
861
|
};
|
|
809
862
|
readonly SeatCapabilitiesState: {
|
|
810
863
|
readonly check: (v: unknown) => SeatValidation;
|
|
811
|
-
readonly validated: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard"];
|
|
864
|
+
readonly validated: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles"];
|
|
812
865
|
readonly unchecked: readonly [];
|
|
813
866
|
};
|
|
814
867
|
readonly RecentFoldersResult: {
|
|
@@ -848,7 +901,7 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
848
901
|
};
|
|
849
902
|
};
|
|
850
903
|
export declare const SEAT_VALIDATOR_COVERAGE_EXEMPT: readonly [...{
|
|
851
|
-
label: "DeviceListOutcome" | "DeviceSessionBindingOutcome" | "DeviceRebindOutcome" | "DeviceEnrollTokenOutcome" | "DeviceRevokeOutcome" | "SeatDeviceRebindRequest" | "SeatDeviceRevokeRequest" | "EngineTargetState" | "EngineTargetResult" | "CloudLoginStart" | "CloudLoginCancelAck" | "CloudConnectResult" | "CloudLoginRequest" | "CloudEngineConnectRequest" | "CloudEngineConfigureRequest" | "OnboardProvidersResult" | "OnboardProbeResult" | "OnboardApplyResult" | "OnboardEntryRequest" | "OnboardApplyRequest";
|
|
904
|
+
label: "DeviceListOutcome" | "DeviceSessionBindingOutcome" | "DeviceRebindOutcome" | "DeviceEnrollTokenOutcome" | "DeviceRevokeOutcome" | "SeatDeviceRebindRequest" | "SeatDeviceRevokeRequest" | "EngineTargetState" | "EngineTargetResult" | "CloudLoginStart" | "CloudLoginCancelAck" | "CloudConnectResult" | "CloudLoginRequest" | "CloudEngineConnectRequest" | "CloudEngineConfigureRequest" | "OnboardProvidersResult" | "OnboardProbeResult" | "OnboardApplyResult" | "OnboardEntryRequest" | "OnboardApplyRequest" | "McpToolTogglesResult" | "McpToolToggleKey";
|
|
852
905
|
check: (v: unknown) => SeatValidation;
|
|
853
906
|
why: string;
|
|
854
907
|
}[], {
|