@sema-agent/client-core 0.98.0 → 0.99.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 +199 -0
- package/README.md +35 -22
- package/dist/adapt/arms.js +61 -20
- package/dist/adapt/panelTasks.d.ts +1 -1
- package/dist/adapt/panelTasks.js +2 -2
- package/dist/adapter/activeRunSelfHeal.d.ts +4 -3
- package/dist/adapter/activeRunSelfHeal.js +162 -293
- package/dist/adapter/downstream/eventToSdkMessage.js +52 -4
- package/dist/adapter/runStream.js +52 -37
- package/dist/adapter/types.js +2 -1
- package/dist/agentSession/engineSessionBackgroundStop.js +16 -8
- package/dist/agentsWireCaps.d.ts +0 -3
- package/dist/agentsWireCaps.js +33 -24
- package/dist/cloudConfigWireCaps.d.ts +1 -1
- package/dist/cloudConfigWireCaps.js +26 -4
- package/dist/controlRouter.d.ts +4 -2
- package/dist/controlRouter.js +39 -51
- package/dist/coreValuePorts.d.ts +26 -1
- package/dist/coreValuePorts.js +10 -0
- package/dist/corruptSessionCopy.d.ts +2 -1
- package/dist/corruptSessionCopy.js +3 -3
- package/dist/declared/supportFloorDeclared.js +1 -1
- package/dist/detachWire.js +3 -2
- package/dist/devicesFace.d.ts +34 -0
- package/dist/devicesFace.js +90 -0
- package/dist/displayUntrusted.d.ts +1 -0
- package/dist/displayUntrusted.js +3 -0
- package/dist/engineAgentPanelStore.d.ts +7 -0
- package/dist/engineAgentPanelStore.js +14 -0
- package/dist/engineCapReader.d.ts +2 -1
- package/dist/engineCapReader.js +7 -5
- package/dist/engineCapsCache.d.ts +8 -0
- package/dist/engineCapsCache.js +59 -6
- package/dist/engineCapsChange.d.ts +2 -0
- package/dist/engineCapsChange.js +9 -0
- package/dist/engineErrorCodes.d.ts +2 -1
- package/dist/engineErrorCodes.js +2 -7
- package/dist/engineRowRef.js +3 -0
- package/dist/engineSessionMessages.d.ts +1 -0
- package/dist/engineSessionMessages.js +7 -1
- package/dist/engineTargetSeat.d.ts +27 -0
- package/dist/engineTargetSeat.js +199 -0
- package/dist/engineWireFor.js +3 -8
- package/dist/env/uiLanguage.d.ts +2 -1
- package/dist/env/uiLanguage.js +3 -2
- package/dist/eventLeg.d.ts +8 -0
- package/dist/eventLeg.js +61 -41
- package/dist/fileHistoryCaptureCapability.d.ts +2 -1
- package/dist/fileHistoryCaptureCapability.js +12 -18
- package/dist/fileHistoryLegNotice.d.ts +2 -1
- package/dist/fileHistoryLegNotice.js +3 -3
- package/dist/frameBinding.d.ts +3 -0
- package/dist/frameBinding.js +12 -0
- package/dist/gateOutcome.js +16 -2
- package/dist/gateVocabulary.d.ts +8 -7
- package/dist/gateVocabulary.js +71 -73
- package/dist/generated/engineFactTables.d.ts +17 -1
- package/dist/generated/engineFactTables.js +29 -0
- package/dist/generated/engineNoticeTables.js +9 -3
- package/dist/generated/settingsSchemaFns.d.ts +6 -0
- package/dist/generated/settingsSchemaFns.js +57 -0
- package/dist/generated/settingsSchemaHooksClassifier.d.ts +2 -0
- package/dist/generated/settingsSchemaHooksClassifier.js +254 -0
- package/dist/generated/settingsSchemaTables.d.ts +1 -0
- package/dist/generated/settingsSchemaTables.js +4 -0
- package/dist/generated/settingsSchemaTypes.d.ts +105 -0
- package/dist/generated/settingsSchemaTypes.js +1 -0
- package/dist/hitl/allowRuleShadow.d.ts +2 -1
- package/dist/hitl/allowRuleShadow.js +17 -14
- package/dist/hitl/approvalCardReasons.d.ts +3 -2
- package/dist/hitl/approvalCardReasons.js +27 -28
- package/dist/hitl/approvalHolds.d.ts +3 -0
- package/dist/hitl/approvalHolds.js +73 -29
- package/dist/hitl/askClassPair.d.ts +1 -1
- package/dist/hitl/askClassPair.js +16 -0
- package/dist/hitl/askGateWire.js +2 -1
- package/dist/hitl/askSettlementLine.d.ts +14 -4
- package/dist/hitl/askSettlementLine.js +67 -47
- package/dist/hitl/automaticAnswerVerdict.d.ts +2 -1
- package/dist/hitl/automaticAnswerVerdict.js +8 -8
- package/dist/hitl/crashConvergedNotice.d.ts +5 -4
- package/dist/hitl/crashConvergedNotice.js +28 -41
- package/dist/hitl/frameRouter.js +7 -8
- package/dist/hitl/hitlBridge.d.ts +1 -0
- package/dist/hitl/hitlBridge.js +3 -3
- package/dist/hitl/persistedRulesWire.d.ts +6 -5
- package/dist/hitl/persistedRulesWire.js +55 -73
- package/dist/hitl/planReviewWire.d.ts +5 -0
- package/dist/hitl/planReviewWire.js +8 -0
- package/dist/hitl/sessionPolicyDeliverable.d.ts +2 -0
- package/dist/hitl/sessionPolicyDeliverable.js +46 -3
- package/dist/hitl/sessionPolicyWire.d.ts +2 -1
- package/dist/hitl/sessionPolicyWire.js +23 -24
- package/dist/hitl/suspendedReopen.d.ts +2 -1
- package/dist/hitl/suspendedReopen.js +7 -10
- package/dist/hitl/toolApprovalWire.d.ts +17 -5
- package/dist/hitl/toolApprovalWire.js +79 -40
- package/dist/hooksWireCaps.js +145 -56
- package/dist/host.d.ts +21 -0
- package/dist/hostTurnSettings.d.ts +71 -0
- package/dist/hostTurnSettings.js +291 -0
- package/dist/humanTurn.d.ts +14 -1
- package/dist/humanTurn.js +100 -12
- package/dist/humanTurnRead.d.ts +2 -0
- package/dist/humanTurnRead.js +22 -1
- package/dist/i18n/messages.en.d.ts +582 -0
- package/dist/i18n/messages.en.js +582 -0
- package/dist/i18n/messages.zh.js +718 -1
- package/dist/index.d.ts +29 -13
- package/dist/index.js +18 -9
- package/dist/inheritEnvCapability.d.ts +3 -2
- package/dist/inheritEnvCapability.js +3 -3
- package/dist/inheritEnvWire.d.ts +3 -2
- package/dist/inheritEnvWire.js +12 -14
- package/dist/interactiveHalt.js +17 -6
- package/dist/liveModelCatalog.d.ts +2 -1
- package/dist/liveModelCatalog.js +14 -8
- package/dist/mcpPanel.d.ts +10 -1
- package/dist/mcpPanel.js +40 -13
- package/dist/mcpProbeCapability.d.ts +2 -1
- package/dist/mcpProbeCapability.js +7 -11
- package/dist/mcpProbeWire.d.ts +3 -1
- package/dist/mcpProbeWire.js +5 -0
- package/dist/mcpWireCaps.d.ts +34 -0
- package/dist/mcpWireCaps.js +117 -17
- package/dist/memoryEntriesWire.js +5 -10
- package/dist/model/onboardJudgement.d.ts +93 -0
- package/dist/model/onboardJudgement.js +415 -0
- package/dist/model/tierVocabulary.d.ts +2 -0
- package/dist/model/tierVocabulary.js +17 -5
- package/dist/modelCapabilityProbe.d.ts +64 -0
- package/dist/modelCapabilityProbe.js +600 -0
- package/dist/modelIdentityResolvability.d.ts +3 -0
- package/dist/modelIdentityResolvability.js +26 -17
- package/dist/ownKey.d.ts +7 -0
- package/dist/ownKey.js +34 -0
- package/dist/panelReduce.d.ts +6 -1
- package/dist/panelReduce.js +50 -3
- package/dist/permissionRuleIssue.js +2 -0
- package/dist/permissionRulesWriteCapability.d.ts +2 -1
- package/dist/permissionRulesWriteCapability.js +8 -6
- package/dist/pluginHooksWire.d.ts +46 -3
- package/dist/pluginHooksWire.js +217 -11
- package/dist/printModelStatus.d.ts +63 -0
- package/dist/printModelStatus.js +155 -0
- package/dist/request/taskRequest.d.ts +11 -5
- package/dist/request/taskRequest.js +112 -16
- package/dist/resumeRefusalCopy.d.ts +12 -9
- package/dist/resumeRefusalCopy.js +70 -143
- package/dist/retryStatus.d.ts +37 -0
- package/dist/retryStatus.js +79 -0
- package/dist/scenarioRefusal.d.ts +9 -0
- package/dist/scenarioRefusal.js +111 -0
- package/dist/seam.d.ts +25 -1
- package/dist/seam.js +10 -1
- package/dist/seatContract.d.ts +260 -10
- package/dist/seatContract.js +692 -19
- package/dist/selfOrchestrationDenial.js +7 -19
- package/dist/sessionIdSegment.d.ts +6 -0
- package/dist/sessionIdSegment.js +24 -0
- package/dist/sessionMemoryStatus.js +6 -11
- package/dist/sessionPolicyCapability.d.ts +2 -1
- package/dist/sessionPolicyCapability.js +8 -6
- package/dist/settingsHooksSalvage.d.ts +44 -0
- package/dist/settingsHooksSalvage.js +211 -0
- package/dist/skillToolListsCapability.d.ts +2 -1
- package/dist/skillToolListsCapability.js +8 -6
- package/dist/sseIdleTriage.js +3 -2
- package/dist/subagent/engineSubagentResume.js +15 -9
- package/dist/subagentContentStore.d.ts +3 -0
- package/dist/subagentContentStore.js +22 -0
- package/dist/toolHistoryMismatch.js +3 -2
- package/dist/toolRoster.d.ts +3 -2
- package/dist/toolRoster.js +21 -20
- package/dist/turnFailurePresentation.d.ts +12 -1
- package/dist/turnFailurePresentation.js +212 -15
- package/dist/usageAnalytics.js +6 -11
- package/dist/userAttachmentEnvelope.d.ts +1 -0
- package/dist/userAttachmentEnvelope.js +37 -7
- package/dist/userAttachmentSeat.d.ts +21 -0
- package/dist/userAttachmentSeat.js +75 -0
- package/dist/userInvokedSkillsCapability.d.ts +11 -1
- package/dist/userInvokedSkillsCapability.js +31 -7
- package/dist/wireErrorTriage.d.ts +7 -0
- package/dist/wireErrorTriage.js +23 -1
- package/dist/wireFailureShape.js +2 -1
- package/dist/wireRefusalCopy.d.ts +13 -1
- package/dist/wireRefusalCopy.js +24 -28
- package/dist/workflowsJournalCapability.d.ts +2 -1
- package/dist/workflowsJournalCapability.js +8 -6
- package/docs/INTEGRATION-CLIENTS.md +542 -30
- package/package.json +5 -5
package/dist/seam.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { ToolRosterView, ToolRosterDeltaView, WiringManifestHandsView } fro
|
|
|
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
|
+
import type { HumanInputAttachmentView } from './ownKey.js';
|
|
9
10
|
export interface AbortSignalLike {
|
|
10
11
|
readonly aborted: boolean;
|
|
11
12
|
}
|
|
@@ -143,6 +144,7 @@ export type ChromeEvent = {
|
|
|
143
144
|
laneProof: LaneProof;
|
|
144
145
|
usage: ModelUsage;
|
|
145
146
|
engineUsage?: EngineTurnUsage;
|
|
147
|
+
engineUsageUnknownKeys?: number;
|
|
146
148
|
usageMissing?: true;
|
|
147
149
|
stopReason?: string;
|
|
148
150
|
responseModel?: string;
|
|
@@ -154,6 +156,7 @@ export type ChromeEvent = {
|
|
|
154
156
|
parentToolCallId: string;
|
|
155
157
|
usage?: ModelUsage;
|
|
156
158
|
engineUsage?: EngineTurnUsage;
|
|
159
|
+
engineUsageUnknownKeys?: number;
|
|
157
160
|
usageMissing?: true;
|
|
158
161
|
stopReason?: string;
|
|
159
162
|
responseModel?: string;
|
|
@@ -164,7 +167,7 @@ export type ChromeEvent = {
|
|
|
164
167
|
} | ({
|
|
165
168
|
kind: 'run_cost_reconciled';
|
|
166
169
|
laneProof: LaneProof;
|
|
167
|
-
} & RunCostReconcile) | HumanInputChromeEvent | MessageCommittedChromeEvent | EngineNoticeChromeEvent | TextSegmentEndChromeEvent | ThinkingSegmentEndChromeEvent | ToolDisclosureChromeEvent | ToolProgressChromeEvent | ToolRosterDeltaChromeEvent | ContextUsageChromeEvent | CompactionOutcomeChromeEvent | PromptAssembledChromeEvent | MemorySavedChromeEvent | WiringManifestChromeEvent | ResultTextDivergedChromeEvent | ResultReplayedChromeEvent | ToolParkedChromeEvent | ApprovalRequestChromeEvent | ApprovalRevokeChromeEvent | {
|
|
170
|
+
} & RunCostReconcile) | HumanInputChromeEvent | MessageCommittedChromeEvent | EngineNoticeChromeEvent | TextSegmentEndChromeEvent | ThinkingSegmentEndChromeEvent | ToolDisclosureChromeEvent | ToolProgressChromeEvent | ToolRosterDeltaChromeEvent | ContextUsageChromeEvent | CompactionOutcomeChromeEvent | SubagentStartedChromeEvent | PromptAssembledChromeEvent | MemorySavedChromeEvent | WiringManifestChromeEvent | ResultTextDivergedChromeEvent | ResultReplayedChromeEvent | ToolParkedChromeEvent | ApprovalRequestChromeEvent | ApprovalRevokeChromeEvent | {
|
|
168
171
|
kind: 'suspended_reopened';
|
|
169
172
|
laneProof: LaneProof;
|
|
170
173
|
reopen: Extract<SuspendedReopenReading, {
|
|
@@ -234,6 +237,25 @@ export interface CompactionOutcomeChromeEvent {
|
|
|
234
237
|
reason?: string;
|
|
235
238
|
eventId?: string;
|
|
236
239
|
}
|
|
240
|
+
export interface SubagentStartedChromeEvent {
|
|
241
|
+
kind: 'subagent_started';
|
|
242
|
+
laneProof: LaneProof;
|
|
243
|
+
taskId: string;
|
|
244
|
+
sessionId?: string;
|
|
245
|
+
model?: string;
|
|
246
|
+
taskType?: string;
|
|
247
|
+
seq?: number;
|
|
248
|
+
workflowRunId?: string;
|
|
249
|
+
workflowAgentLabel?: string;
|
|
250
|
+
parentTaskId?: string;
|
|
251
|
+
parentSessionId?: string;
|
|
252
|
+
rootSessionId?: string;
|
|
253
|
+
name?: string;
|
|
254
|
+
spawnName?: string;
|
|
255
|
+
agentType?: string;
|
|
256
|
+
startedAt?: number;
|
|
257
|
+
eventId?: string;
|
|
258
|
+
}
|
|
237
259
|
export interface MemorySavedChromeEvent {
|
|
238
260
|
kind: 'memory_saved';
|
|
239
261
|
laneProof: LaneProof;
|
|
@@ -337,7 +359,9 @@ export interface HumanInputChromeEvent {
|
|
|
337
359
|
actor?: HumanInputActor;
|
|
338
360
|
entryId?: string;
|
|
339
361
|
eventId?: string;
|
|
362
|
+
attachments?: HumanInputAttachmentView[];
|
|
340
363
|
}
|
|
364
|
+
export type { HumanInputAttachmentView } from './ownKey.js';
|
|
341
365
|
export interface MessageCommittedChromeEvent {
|
|
342
366
|
kind: 'message_committed';
|
|
343
367
|
laneProof: LaneProof;
|
package/dist/seam.js
CHANGED
|
@@ -76,6 +76,14 @@ 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
|
+
subagent_started: {
|
|
80
|
+
required: false,
|
|
81
|
+
duty: '可选:委派子代每周期一帧的起跑事实(sdk `task_started`,服务端 ≥ 7.127.0)—— 要「起跑时就开子代行」的宿主接它(不接 = 首个 task_progress 才开行,与 0.98.0 同)。' +
|
|
82
|
+
'🔴 面板的起跑时刻证据:把本事件原样交 `publishEngineAgentPanelStart(event)`(只补行上缺的 `startedAt`、从不建行 / 不改身份归并;workflow 车道自报 `workflowRunId` 的帧它自己忽略)。' +
|
|
83
|
+
'🔴 `taskType` 开集读(缺席 = 前台同步子代,没有 fleet 行);`seq` 缺席 = 没有 a* 行,禁读作第 1 周期;`name` / `workflowAgentLabel` 是 UNTRUSTED 展示文本(渲前过展示出口);' +
|
|
84
|
+
'`laneProof.lane` 为 subagent = 挂在那张委派卡上(`parentToolCallId`),主车道 = 后台代理(卡已收口);workflow 车道的子代别开前台子代行(带 `workflowRunId` 即是);' +
|
|
85
|
+
'本事件不是 spinner / run 终态证据;缺席键 = 服务端没说,不是 0 / 空串。',
|
|
86
|
+
},
|
|
79
87
|
prompt_assembled: {
|
|
80
88
|
required: false,
|
|
81
89
|
duty: 'CC-91(0.76.0):这一次 prepare 的提示词装配清单(每段 / 块多大、挂了哪些工具),/context 类面板的引擎侧真值来源。🔴 一次任务可能多条(cascade / verify / resume 各自 re-prepare)' +
|
|
@@ -136,7 +144,8 @@ const CHROME_ARM_TABLE = {
|
|
|
136
144
|
approval_request: {
|
|
137
145
|
required: true,
|
|
138
146
|
duty: '用 sdk isApprovalRequestFrameV1 窄化 frame 才取 card/askId/窗三键;窄不下来 ⇒ 呈通用卡(安全元数据 + 人工 approve/deny),' +
|
|
139
|
-
'🔴 永不 auto-deny
|
|
147
|
+
'🔴 永不 auto-deny;开卡前调 claimApprovalCard(身份, { signal }):joined / aborted ⇒ 不开卡,held ⇒ 开卡且每条出口恰调一次 hold.release(settled?)' +
|
|
148
|
+
'(去重判定归包 —— legacy 帧那一路的持有与结局在进程级持有表 / 已结表里,宿主不自持 legacy 已收口集);流上下文经 approvalFrameContextOf(这只 chrome 事件) 查,查不到不开卡;' +
|
|
140
149
|
'🔴 账本重放的历史帧只用于时间线渲染,卡集的全量对账基准是开流 preamble(它带的 expiresInMs 是铸帧时刻的旧值);' +
|
|
141
150
|
'card 的 message/args 是模型/工具产文,只渲染永不回喂模型',
|
|
142
151
|
},
|
package/dist/seatContract.d.ts
CHANGED
|
@@ -8,6 +8,10 @@ import type { ApprovalMandateWord } from "./gateVocabulary.js";
|
|
|
8
8
|
import type { ModelApiWord } from "./model/providerPresets.js";
|
|
9
9
|
import type { LiveModelCatalog } from "./liveModelCatalog.js";
|
|
10
10
|
import { type RewindMode } from "./rewindWireCaps.js";
|
|
11
|
+
import { type ProbeVerdictWord } from "./modelCapabilityProbe.js";
|
|
12
|
+
import type { SubagentContentEvent } from "./subagentContentStore.js";
|
|
13
|
+
import type { DeviceEnrollTokenOutcome, DeviceListOutcome, DeviceRebindOutcome, DeviceRevokeOutcome, DeviceSessionBindingOutcome, DeviceTransport, DeviceUnarmed, DeviceUnreadable } from "./deviceRebind.js";
|
|
14
|
+
import type { McpPanelView } from "./mcpPanel.js";
|
|
11
15
|
export interface SeatValidationFailure {
|
|
12
16
|
reason: string;
|
|
13
17
|
field?: string;
|
|
@@ -71,7 +75,7 @@ export interface ToolPermissionRequest {
|
|
|
71
75
|
classes?: readonly string[];
|
|
72
76
|
sessionRow?: true;
|
|
73
77
|
}
|
|
74
|
-
declare const SEAT_EVENT_TYPE_TUPLE: readonly ["start", "close", "session_updated", "message", "stream_event", "chrome_event", "error", "tool_permission_resolved"];
|
|
78
|
+
declare const SEAT_EVENT_TYPE_TUPLE: readonly ["start", "close", "session_updated", "message", "stream_event", "chrome_event", "error", "tool_permission_resolved", "subagent_content"];
|
|
75
79
|
export type SeatEventType = (typeof SEAT_EVENT_TYPE_TUPLE)[number];
|
|
76
80
|
export declare const SEAT_EVENT_TYPES: readonly SeatEventType[];
|
|
77
81
|
declare const CHROME_EVENT_KIND_TUPLE: readonly ["panel_task", "notification_terminal", "prompt_suggestions", "subagent_lifecycle", "text_segment_end", "thinking_segment_end", "retry_status", "context_usage", "last_turn_usage", "bgshell_register", "bgshell_settle", "memory_saved", "result_replayed", "tool_parked"];
|
|
@@ -93,14 +97,13 @@ export interface LocalSessionEvent {
|
|
|
93
97
|
errorCategory?: string;
|
|
94
98
|
_sema_turnFailure?: SeatTurnFailure;
|
|
95
99
|
code?: number;
|
|
96
|
-
request?: ToolPermissionRequest;
|
|
97
|
-
sources?: string[];
|
|
98
100
|
session?: LocalSessionRecord;
|
|
99
101
|
userMessageUuid?: string;
|
|
100
102
|
requestId?: string;
|
|
101
103
|
outcome?: string;
|
|
102
104
|
parked?: true;
|
|
103
105
|
chrome?: SeatChromeEnvelope;
|
|
106
|
+
subagentContent?: SubagentContentEvent;
|
|
104
107
|
}
|
|
105
108
|
export declare const HITL_RESOLUTION_OUTCOMES: readonly string[];
|
|
106
109
|
export declare const SEAT_STREAM_DELTA_TYPE_OF_CHANNEL: Readonly<{
|
|
@@ -141,13 +144,16 @@ export type SeatStreamReading = {
|
|
|
141
144
|
};
|
|
142
145
|
export declare function seatStreamDeltaMessage(event: SeatStreamDeltaSource, ids: SeatStreamDeltaIds): SeatStreamEventMessage | undefined;
|
|
143
146
|
export declare function readSeatStreamDelta(message: object): SeatStreamReading;
|
|
144
|
-
export declare const SEAT_CAPABILITY_NAMES: readonly ["pickFolder", "rewind", "recents", "patchSession"];
|
|
147
|
+
export declare const SEAT_CAPABILITY_NAMES: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard"];
|
|
145
148
|
export type SeatCapabilityName = (typeof SEAT_CAPABILITY_NAMES)[number];
|
|
146
149
|
export interface SeatCapabilitiesState {
|
|
147
150
|
pickFolder?: boolean;
|
|
148
151
|
rewind?: boolean;
|
|
149
152
|
recents?: boolean;
|
|
150
153
|
patchSession?: boolean;
|
|
154
|
+
devices?: boolean;
|
|
155
|
+
engineTarget?: boolean;
|
|
156
|
+
onboard?: boolean;
|
|
151
157
|
}
|
|
152
158
|
export type SeatCapabilityReading = {
|
|
153
159
|
readonly kind: "reported";
|
|
@@ -318,6 +324,224 @@ export interface RecentFolderRow {
|
|
|
318
324
|
export interface RecentFoldersResult {
|
|
319
325
|
folders: RecentFolderRow[];
|
|
320
326
|
}
|
|
327
|
+
export interface SeatDeviceRebindRequest {
|
|
328
|
+
sessionId: string;
|
|
329
|
+
toDeviceId: string;
|
|
330
|
+
expectedRev: number;
|
|
331
|
+
fromDeviceId: string;
|
|
332
|
+
}
|
|
333
|
+
export interface SeatDeviceRevokeRequest {
|
|
334
|
+
deviceId: string;
|
|
335
|
+
reason?: string;
|
|
336
|
+
}
|
|
337
|
+
export declare const checkSeatDeviceRebindRequest: (v: unknown) => SeatValidation;
|
|
338
|
+
export declare const checkSeatDeviceRevokeRequest: (v: unknown) => SeatValidation;
|
|
339
|
+
export declare const ENGINE_TARGET_REFUSALS: readonly ["busy", "switching", "not_configured", "not_signed_in", "probe_failed", "org_policy", "url_refused", "login_failed", "storage_unavailable", "no_local_runtime", "input"];
|
|
340
|
+
export type EngineTargetRefusal = (typeof ENGINE_TARGET_REFUSALS)[number];
|
|
341
|
+
export declare const CLOUD_LOGIN_FAILURES: readonly ["access_denied", "expired_token", "invalid_grant", "cancelled", "transport", "refused", "no_tokens", "other"];
|
|
342
|
+
export type CloudLoginFailure = (typeof CLOUD_LOGIN_FAILURES)[number];
|
|
343
|
+
export interface CloudLoginFailureReading {
|
|
344
|
+
failure: CloudLoginFailure;
|
|
345
|
+
status?: number;
|
|
346
|
+
}
|
|
347
|
+
export interface EngineProbeReading {
|
|
348
|
+
ok: boolean;
|
|
349
|
+
version?: string;
|
|
350
|
+
detail?: string;
|
|
351
|
+
at: string;
|
|
352
|
+
}
|
|
353
|
+
export type EngineTargetCloudAuth = {
|
|
354
|
+
kind: "registry";
|
|
355
|
+
registryUrl: string;
|
|
356
|
+
principal?: string;
|
|
357
|
+
role?: string;
|
|
358
|
+
scope?: string;
|
|
359
|
+
} | {
|
|
360
|
+
kind: "token";
|
|
361
|
+
};
|
|
362
|
+
export type CloudLoginState = {
|
|
363
|
+
state: "pending";
|
|
364
|
+
registryUrl: string;
|
|
365
|
+
userCode: string;
|
|
366
|
+
verificationUri: string;
|
|
367
|
+
verificationUriComplete?: string;
|
|
368
|
+
expiresAt: string;
|
|
369
|
+
} | {
|
|
370
|
+
state: "failed";
|
|
371
|
+
failure: CloudLoginFailure;
|
|
372
|
+
status?: number;
|
|
373
|
+
at: string;
|
|
374
|
+
};
|
|
375
|
+
export interface CloudAuthErrorState {
|
|
376
|
+
failure: CloudLoginFailure;
|
|
377
|
+
status?: number;
|
|
378
|
+
at: string;
|
|
379
|
+
}
|
|
380
|
+
export interface EngineTargetCloud {
|
|
381
|
+
configured: boolean;
|
|
382
|
+
url?: string;
|
|
383
|
+
label?: string;
|
|
384
|
+
auth?: EngineTargetCloudAuth;
|
|
385
|
+
login?: CloudLoginState;
|
|
386
|
+
lastProbe?: EngineProbeReading;
|
|
387
|
+
authError?: CloudAuthErrorState;
|
|
388
|
+
orgEngine?: {
|
|
389
|
+
url: string;
|
|
390
|
+
required: boolean;
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
export interface SeatLocalMcpRow {
|
|
394
|
+
name: string;
|
|
395
|
+
status: string;
|
|
396
|
+
toolCount?: number;
|
|
397
|
+
liveness?: string;
|
|
398
|
+
errorCode?: string;
|
|
399
|
+
forcedAsk?: string[];
|
|
400
|
+
}
|
|
401
|
+
export type SeatLocalMcpReading = {
|
|
402
|
+
status: "listed";
|
|
403
|
+
servers: SeatLocalMcpRow[];
|
|
404
|
+
readAt: string;
|
|
405
|
+
restartRequired?: true;
|
|
406
|
+
} | {
|
|
407
|
+
status: "unreadable";
|
|
408
|
+
cause: string;
|
|
409
|
+
detail?: string;
|
|
410
|
+
readAt: string;
|
|
411
|
+
restartRequired?: true;
|
|
412
|
+
};
|
|
413
|
+
export interface EngineTargetLocal {
|
|
414
|
+
lastBootError?: string;
|
|
415
|
+
mcp?: SeatLocalMcpReading;
|
|
416
|
+
}
|
|
417
|
+
export interface EngineTargetState {
|
|
418
|
+
mode: "local" | "cloud";
|
|
419
|
+
generation: number;
|
|
420
|
+
cloud: EngineTargetCloud;
|
|
421
|
+
local: EngineTargetLocal;
|
|
422
|
+
}
|
|
423
|
+
export interface EngineTargetRefused {
|
|
424
|
+
ok: false;
|
|
425
|
+
refusal: EngineTargetRefusal;
|
|
426
|
+
failure?: CloudLoginFailure;
|
|
427
|
+
status?: number;
|
|
428
|
+
detail?: string;
|
|
429
|
+
}
|
|
430
|
+
export type EngineTargetResult = {
|
|
431
|
+
ok: true;
|
|
432
|
+
} | EngineTargetRefused;
|
|
433
|
+
export type CloudLoginStart = {
|
|
434
|
+
ok: true;
|
|
435
|
+
verificationUri: string;
|
|
436
|
+
verificationUriComplete?: string;
|
|
437
|
+
userCode: string;
|
|
438
|
+
expiresAt: string;
|
|
439
|
+
} | EngineTargetRefused;
|
|
440
|
+
export type CloudConnectResult = {
|
|
441
|
+
ok: true;
|
|
442
|
+
probe: {
|
|
443
|
+
version?: string;
|
|
444
|
+
};
|
|
445
|
+
} | EngineTargetRefused;
|
|
446
|
+
export interface CloudLoginRequest {
|
|
447
|
+
registryUrl: string;
|
|
448
|
+
}
|
|
449
|
+
export interface CloudEngineConnectRequest {
|
|
450
|
+
url: string;
|
|
451
|
+
}
|
|
452
|
+
export interface CloudEngineConfigureRequest {
|
|
453
|
+
url: string;
|
|
454
|
+
token: string;
|
|
455
|
+
}
|
|
456
|
+
export declare const checkCloudLoginRequest: (v: unknown) => SeatValidation;
|
|
457
|
+
export declare const checkCloudEngineConnectRequest: (v: unknown) => SeatValidation;
|
|
458
|
+
export declare const checkCloudEngineConfigureRequest: (v: unknown) => SeatValidation;
|
|
459
|
+
export type OnboardProbeVerdict = ProbeVerdictWord;
|
|
460
|
+
export declare const ONBOARD_REFUSALS: readonly ["input", "probe_failed", "probe_unverified", "credential_unpaired", "catalog_unreadable", "write_conflict", "write_failed", "engine_is_remote", "env_catalog_present"];
|
|
461
|
+
export type OnboardRefusal = (typeof ONBOARD_REFUSALS)[number];
|
|
462
|
+
export type EngineRestartOutcome = {
|
|
463
|
+
state: "started" | "restarted";
|
|
464
|
+
model: string | null;
|
|
465
|
+
} | {
|
|
466
|
+
state: "pending" | "failed" | "skipped";
|
|
467
|
+
reason: string;
|
|
468
|
+
};
|
|
469
|
+
export type OnboardSource = {
|
|
470
|
+
kind: "preset";
|
|
471
|
+
providerId: string;
|
|
472
|
+
} | {
|
|
473
|
+
kind: "custom";
|
|
474
|
+
} | {
|
|
475
|
+
kind: "imported";
|
|
476
|
+
profileId: string;
|
|
477
|
+
};
|
|
478
|
+
export interface OnboardEntryRequest {
|
|
479
|
+
source: OnboardSource;
|
|
480
|
+
modelId: string;
|
|
481
|
+
baseUrl?: string;
|
|
482
|
+
api?: ModelApiWord;
|
|
483
|
+
apiKey?: string;
|
|
484
|
+
contextWindow?: number;
|
|
485
|
+
maxTokens?: number;
|
|
486
|
+
}
|
|
487
|
+
export interface OnboardApplyRequest extends OnboardEntryRequest {
|
|
488
|
+
makeDefault?: boolean;
|
|
489
|
+
acceptUnverified?: boolean;
|
|
490
|
+
}
|
|
491
|
+
export interface OnboardProbeResult {
|
|
492
|
+
verdict: OnboardProbeVerdict;
|
|
493
|
+
detail: string;
|
|
494
|
+
thinking?: string;
|
|
495
|
+
}
|
|
496
|
+
export interface OnboardCatalogIssue {
|
|
497
|
+
name: string;
|
|
498
|
+
modelId: string;
|
|
499
|
+
issue: string;
|
|
500
|
+
}
|
|
501
|
+
export type OnboardApplyResult = {
|
|
502
|
+
ok: true;
|
|
503
|
+
entryName: string;
|
|
504
|
+
modelId: string;
|
|
505
|
+
keyEnv: string;
|
|
506
|
+
updatedExisting: boolean;
|
|
507
|
+
probe: OnboardProbeResult;
|
|
508
|
+
otherIssues: OnboardCatalogIssue[];
|
|
509
|
+
engine: EngineRestartOutcome;
|
|
510
|
+
} | {
|
|
511
|
+
ok: false;
|
|
512
|
+
refusal: OnboardRefusal;
|
|
513
|
+
detail?: string;
|
|
514
|
+
probe?: OnboardProbeResult;
|
|
515
|
+
};
|
|
516
|
+
export interface OnboardProviderModel {
|
|
517
|
+
id: string;
|
|
518
|
+
contextWindow: number;
|
|
519
|
+
maxTokens: number;
|
|
520
|
+
}
|
|
521
|
+
export interface OnboardProviderRow {
|
|
522
|
+
id: string;
|
|
523
|
+
name: string;
|
|
524
|
+
baseUrl: string;
|
|
525
|
+
api: ModelApiWord;
|
|
526
|
+
keyAuth: boolean;
|
|
527
|
+
authEnv: string;
|
|
528
|
+
models: OnboardProviderModel[];
|
|
529
|
+
consoleUrl?: string;
|
|
530
|
+
}
|
|
531
|
+
export interface OnboardImportableProfile {
|
|
532
|
+
id: string;
|
|
533
|
+
name: string;
|
|
534
|
+
baseUrl: string;
|
|
535
|
+
api: ModelApiWord;
|
|
536
|
+
hasKey: boolean;
|
|
537
|
+
models: string[];
|
|
538
|
+
}
|
|
539
|
+
export interface OnboardProvidersResult {
|
|
540
|
+
providers: OnboardProviderRow[];
|
|
541
|
+
importable?: OnboardImportableProfile[];
|
|
542
|
+
}
|
|
543
|
+
export declare const checkOnboardEntryRequest: (v: unknown) => SeatValidation;
|
|
544
|
+
export declare const checkOnboardApplyRequest: (v: unknown) => SeatValidation;
|
|
321
545
|
export interface LocalSessionsApi {
|
|
322
546
|
start(opts?: StartSessionOptions): Promise<LocalSessionRecord>;
|
|
323
547
|
sendMessage(req: SendMessageRequest): Promise<SendMessageAck>;
|
|
@@ -338,15 +562,32 @@ export interface LocalSessionsApi {
|
|
|
338
562
|
listRecentFolders(): Promise<RecentFoldersResult>;
|
|
339
563
|
noteRecentFolder(path: string): Promise<OkAck>;
|
|
340
564
|
patchSession(req: SessionRowPatchRequest): Promise<LocalSessionRecord>;
|
|
565
|
+
listDevices(): Promise<DeviceListOutcome>;
|
|
566
|
+
readSessionBinding(sessionId: string): Promise<DeviceSessionBindingOutcome>;
|
|
567
|
+
rebindSession(req: SeatDeviceRebindRequest): Promise<DeviceRebindOutcome>;
|
|
568
|
+
issueEnrollToken(): Promise<DeviceEnrollTokenOutcome>;
|
|
569
|
+
revokeDevice(req: SeatDeviceRevokeRequest): Promise<DeviceRevokeOutcome>;
|
|
570
|
+
setEngineMode(mode: "local" | "cloud"): Promise<EngineTargetResult>;
|
|
571
|
+
startCloudLogin(req: CloudLoginRequest): Promise<CloudLoginStart>;
|
|
572
|
+
cancelCloudLogin(): Promise<OkAck>;
|
|
573
|
+
connectCloudEngine(req: CloudEngineConnectRequest): Promise<CloudConnectResult>;
|
|
574
|
+
configureCloudEngine(req: CloudEngineConfigureRequest): Promise<CloudConnectResult>;
|
|
575
|
+
clearCloudEngine(): Promise<EngineTargetResult>;
|
|
576
|
+
listOnboardProviders(): Promise<OnboardProvidersResult>;
|
|
577
|
+
probeOnboardEntry(req: OnboardEntryRequest): Promise<OnboardProbeResult>;
|
|
578
|
+
applyOnboardEntry(req: OnboardApplyRequest): Promise<OnboardApplyResult>;
|
|
579
|
+
readSessionMcpPanel(sessionId: string): Promise<McpPanelView | DeviceUnreadable | DeviceTransport | DeviceUnarmed>;
|
|
341
580
|
onEvent(cb: (ev: LocalSessionEvent) => void): () => void;
|
|
342
581
|
onToolPermissionRequest(cb: (req: ToolPermissionRequest) => void): () => void;
|
|
343
582
|
sessionsStateStore: EipcStoreClient<SessionsState>;
|
|
344
583
|
focusedSessionStateStore: EipcStoreClient<FocusedSessionState>;
|
|
345
584
|
settingsStateStore: EipcStoreClient<SettingsState>;
|
|
346
585
|
seatCapabilitiesStateStore: EipcStoreClient<SeatCapabilitiesState>;
|
|
586
|
+
engineTargetStateStore: EipcStoreClient<EngineTargetState>;
|
|
347
587
|
}
|
|
348
588
|
export declare function isLocalSessionRecord(s: unknown): s is LocalSessionRecord;
|
|
349
589
|
export declare function isToolPermissionRequest(r: unknown): r is ToolPermissionRequest;
|
|
590
|
+
export declare function readSeatSubagentContent(event: object): SubagentContentEvent | undefined;
|
|
350
591
|
export declare function isLocalSessionEvent(v: unknown): v is LocalSessionEvent;
|
|
351
592
|
export declare function isAttachmentUploadReceipt(v: unknown): v is AttachmentUploadReceipt;
|
|
352
593
|
export interface SeatCatalogEntry {
|
|
@@ -379,10 +620,10 @@ export declare const checkSessionRowPatchRequest: (v: unknown) => SeatValidation
|
|
|
379
620
|
export declare function isSessionRowPatchRequest(v: unknown): v is SessionRowPatchRequest;
|
|
380
621
|
export declare function isSendMessageAck(v: unknown): v is SendMessageAck;
|
|
381
622
|
export declare const LOCAL_SESSIONS_SPEC: EipcServiceSpec;
|
|
382
|
-
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", "onEvent", "onToolPermissionRequest"];
|
|
383
|
-
export declare const SEAT_STORE_PROPS: readonly ["sessionsStateStore", "focusedSessionStateStore", "settingsStateStore", "seatCapabilitiesStateStore"];
|
|
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"];
|
|
624
|
+
export declare const SEAT_STORE_PROPS: readonly ["sessionsStateStore", "focusedSessionStateStore", "settingsStateStore", "seatCapabilitiesStateStore", "engineTargetStateStore"];
|
|
384
625
|
export declare const SEAT_EVENT_METHOD_NAMES: readonly ["onEvent", "onToolPermissionRequest"];
|
|
385
|
-
export declare const LOCAL_SESSION_EVENT_KEYS: readonly ["type", "sessionId", "message", "error", "errorCategory", "code", "
|
|
626
|
+
export declare const LOCAL_SESSION_EVENT_KEYS: readonly ["type", "sessionId", "message", "error", "errorCategory", "code", "session", "userMessageUuid", "requestId", "outcome", "parked", "chrome", "_sema_turnFailure", "subagentContent"];
|
|
386
627
|
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"];
|
|
387
628
|
export declare const LOCAL_SESSION_RECORD_KEYS: readonly ["sessionId", "engineSessionId", "model", "title", "cwd", "isRunning", "createdAt", "lastActivityAt", "queuedMessages", "parked", "pinned"];
|
|
388
629
|
export declare const SEND_MESSAGE_REQUEST_KEYS: readonly ["sessionId", "text", "model", "userMessageUuid", "permissionMode", "attachmentIds", "reasoningEffort", "retainBackgroundProcesses", "forwardSubagentEvents", "retainSubagentSessions", "settings", "scenario", "rewind"];
|
|
@@ -476,7 +717,7 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
476
717
|
readonly LocalSessionEvent: {
|
|
477
718
|
readonly guard: "isLocalSessionEvent";
|
|
478
719
|
readonly check: (v: unknown) => SeatValidation;
|
|
479
|
-
readonly validated: readonly ["type", "sessionId", "error", "errorCategory", "code", "
|
|
720
|
+
readonly validated: readonly ["type", "sessionId", "error", "errorCategory", "code", "session", "userMessageUuid", "requestId", "outcome", "parked", "chrome", "subagentContent"];
|
|
480
721
|
readonly unchecked: readonly [{
|
|
481
722
|
readonly key: "message";
|
|
482
723
|
readonly why: "transcript 面直通位(CC fQe 逐字姿态:SDKMessage 体不做 schema 校验)—— 校它 = 引擎加一种消息体的那天整条转录被门吃掉。";
|
|
@@ -567,7 +808,7 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
567
808
|
};
|
|
568
809
|
readonly SeatCapabilitiesState: {
|
|
569
810
|
readonly check: (v: unknown) => SeatValidation;
|
|
570
|
-
readonly validated: readonly ["pickFolder", "rewind", "recents", "patchSession"];
|
|
811
|
+
readonly validated: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard"];
|
|
571
812
|
readonly unchecked: readonly [];
|
|
572
813
|
};
|
|
573
814
|
readonly RecentFoldersResult: {
|
|
@@ -600,8 +841,17 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
600
841
|
readonly validated: readonly ["kind", "laneProof"];
|
|
601
842
|
readonly unchecked: readonly [];
|
|
602
843
|
};
|
|
844
|
+
readonly SessionMcpPanelResult: {
|
|
845
|
+
readonly check: (v: unknown) => SeatValidation;
|
|
846
|
+
readonly validated: readonly ["kind", "why", "detail", "asOf", "servers", "lastLegMcp", "lastLegMcpUnreadable", "degraded", "scenarioRefusal"];
|
|
847
|
+
readonly unchecked: readonly [];
|
|
848
|
+
};
|
|
603
849
|
};
|
|
604
|
-
export declare const SEAT_VALIDATOR_COVERAGE_EXEMPT: readonly [{
|
|
850
|
+
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";
|
|
852
|
+
check: (v: unknown) => SeatValidation;
|
|
853
|
+
why: string;
|
|
854
|
+
}[], {
|
|
605
855
|
readonly label: "PickFolderResult";
|
|
606
856
|
readonly check: (v: unknown) => SeatValidation;
|
|
607
857
|
readonly why: "载荷是**串或 null**(选中的路径 / 用户取消,CC-469),没有键面 ⇒ `keyof` 覆盖表在它身上无从谈起。判别力由 run-seat-wave2-test.mjs ST1-1 承担:认 null 与非空串、拒空串 / 数 / undefined / 对象 / 布尔五形。";
|