@sema-agent/client-core 0.105.0 → 0.107.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 +301 -0
- package/README.md +40 -21
- package/dist/adapt/arms.js +10 -1
- package/dist/adapter/activeRunSelfHeal.d.ts +21 -2
- package/dist/adapter/activeRunSelfHeal.js +129 -28
- package/dist/adapter/downstream/eventToSdkMessage.d.ts +0 -5
- package/dist/adapter/downstream/eventToSdkMessage.js +20 -19
- package/dist/adapter/downstream/terminalToSdkResult.js +2 -3
- package/dist/adapter/downstream/wiringManifestView.d.ts +1 -3
- package/dist/adapter/downstream/wiringManifestView.js +0 -1
- package/dist/adapter/runStream.js +3 -4
- package/dist/approvalReachWire.d.ts +1 -0
- package/dist/approvalReachWire.js +4 -1
- package/dist/approvalSeat.d.ts +21 -0
- package/dist/approvalSeat.js +73 -0
- package/dist/assistantInbox.d.ts +2 -0
- package/dist/assistantInbox.js +3 -0
- package/dist/checkpointRowVerdict.d.ts +29 -0
- package/dist/checkpointRowVerdict.js +98 -0
- package/dist/coreValuePorts.d.ts +12 -1
- package/dist/coreValuePorts.js +10 -0
- package/dist/decideFailureNote.js +3 -1
- package/dist/decideReceipt.d.ts +9 -0
- package/dist/decideReceipt.js +29 -1
- package/dist/declared/supportFloorDeclared.js +2 -2
- package/dist/deviceRebind.d.ts +7 -0
- package/dist/deviceRebind.js +39 -5
- package/dist/displayUntrusted.d.ts +5 -3
- package/dist/displayUntrusted.js +50 -41
- package/dist/engineAddress.d.ts +3 -0
- package/dist/engineAddress.js +25 -0
- package/dist/engineDirectory.js +9 -17
- package/dist/engineErrorCodes.d.ts +8 -0
- package/dist/engineErrorCodes.js +8 -0
- package/dist/engineNoticeCodes.d.ts +38 -3
- package/dist/engineNoticeCodes.js +167 -11
- package/dist/engineRowRef.js +1 -1
- package/dist/errorSupplementRoles.js +4 -1
- package/dist/eventLeg.d.ts +2 -2
- package/dist/eventLeg.js +2 -1
- package/dist/executionLaneCapability.js +3 -2
- package/dist/executionLaneWords.d.ts +1 -0
- package/dist/executionLaneWords.js +3 -0
- package/dist/fleet/fleetProjection.js +26 -5
- package/dist/generated/engineFactTables.d.ts +2 -1
- package/dist/generated/engineFactTables.js +3 -1
- package/dist/generated/engineNoticeTables.js +28 -7
- package/dist/generated/sdkFactTables.d.ts +3 -0
- package/dist/generated/sdkFactTables.js +15 -0
- package/dist/generated/settingsSchemaFns.d.ts +11 -0
- package/dist/generated/settingsSchemaFns.js +2 -1
- package/dist/generated/settingsSchemaSafetyMergeSpec.js +1 -1
- package/dist/generated/settingsSchemaSettingsSources.d.ts +1 -1
- package/dist/generated/settingsSchemaSettingsSources.js +22 -2
- package/dist/hitl/approvalLiveFace.d.ts +17 -0
- package/dist/hitl/approvalLiveFace.js +35 -0
- package/dist/hitl/approvalQueueRow.d.ts +21 -0
- package/dist/hitl/approvalQueueRow.js +69 -0
- package/dist/hitl/approvalResolution.d.ts +5 -1
- package/dist/hitl/approvalResolution.js +18 -1
- package/dist/hitl/approvalsFeed.d.ts +5 -4
- package/dist/hitl/approvalsFeed.js +39 -6
- package/dist/hitl/askParkRowRouting.d.ts +4 -3
- package/dist/hitl/askParkRowRouting.js +27 -3
- package/dist/hitl/automaticAnswerVerdict.js +13 -10
- package/dist/hitl/crashConverged.d.ts +5 -1
- package/dist/hitl/decisionConflict.js +2 -1
- package/dist/hitl/decisionRefusal.js +1 -1
- package/dist/hitl/decisionSend.d.ts +3 -0
- package/dist/hitl/decisionSend.js +32 -6
- package/dist/hitl/frameRouter.js +4 -5
- package/dist/hitl/hitlBridge.d.ts +6 -2
- package/dist/hitl/hitlBridge.js +53 -7
- package/dist/hitl/livePendingAsk.d.ts +5 -0
- package/dist/hitl/livePendingAsk.js +10 -3
- package/dist/hitl/parkOwnership.js +4 -5
- package/dist/hitl/parkResolver.js +9 -5
- package/dist/hitl/parkRowBirthWait.d.ts +7 -0
- package/dist/hitl/parkRowBirthWait.js +1 -1
- package/dist/hitl/parkRowDelegation.d.ts +6 -0
- package/dist/hitl/parkRowDelegation.js +33 -0
- package/dist/hitl/persistedRulesWire.d.ts +15 -3
- package/dist/hitl/persistedRulesWire.js +102 -20
- package/dist/hitl/planReviewCard.d.ts +2 -0
- package/dist/hitl/planReviewCard.js +21 -0
- package/dist/hitl/planReviewWire.d.ts +2 -2
- package/dist/hitl/planReviewWire.js +105 -38
- package/dist/hitl/sessionAllowRoute.d.ts +7 -0
- package/dist/hitl/sessionAllowRoute.js +49 -0
- package/dist/hitl/sessionPolicyWire.d.ts +1 -7
- package/dist/hitl/sessionPolicyWire.js +3 -43
- package/dist/hitl/standingRows.js +10 -10
- package/dist/hitl/subagentSource.d.ts +1 -0
- package/dist/hitl/subagentSource.js +13 -0
- package/dist/hitl/toolApprovalWire.d.ts +3 -2
- package/dist/hitl/toolApprovalWire.js +100 -44
- package/dist/hostSettingsSource.d.ts +4 -1
- package/dist/hostSettingsSource.js +11 -6
- package/dist/hostTurnSettings.d.ts +4 -5
- package/dist/hostTurnSettings.js +80 -19
- package/dist/i18n/messages.en.d.ts +41 -12
- package/dist/i18n/messages.en.js +42 -13
- package/dist/i18n/messages.zh.js +45 -13
- package/dist/index.d.ts +22 -2
- package/dist/index.js +12 -2
- package/dist/injectionLaneNotice.js +2 -1
- package/dist/liveInitToolFace.js +0 -1
- package/dist/liveModelCatalog.d.ts +15 -0
- package/dist/liveModelCatalog.js +40 -0
- package/dist/mcpWireCaps.js +1 -1
- package/dist/modelCapabilityProbe.js +66 -33
- package/dist/noticePresentation.js +2 -0
- package/dist/ownKey.d.ts +0 -1
- package/dist/ownKey.js +0 -2
- package/dist/permissionsDeclaration.d.ts +2 -2
- package/dist/permissionsDeclaration.js +12 -14
- package/dist/projectSeed.d.ts +39 -0
- package/dist/projectSeed.js +80 -0
- package/dist/promptDelivery.js +1 -1
- package/dist/replayBody.d.ts +7 -6
- package/dist/replayBody.js +62 -7
- package/dist/request/taskRequest.js +3 -4
- package/dist/ruleCompileVerdict.d.ts +0 -2
- package/dist/ruleCompileVerdict.js +0 -31
- package/dist/ruleRefusalSentence.js +0 -3
- package/dist/runReattachPolicy.d.ts +3 -0
- package/dist/runReattachPolicy.js +15 -2
- package/dist/runTerminal.js +30 -8
- package/dist/sandboxWire.d.ts +0 -3
- package/dist/sandboxWire.js +0 -9
- package/dist/sdkWireTransit.d.ts +1 -1
- package/dist/seam.d.ts +14 -7
- package/dist/seam.js +12 -0
- package/dist/seatContract.d.ts +58 -7
- package/dist/seatContract.js +135 -4
- package/dist/serverSupportRange.d.ts +18 -0
- package/dist/serverSupportRange.js +25 -0
- package/dist/sessionEngine.d.ts +156 -0
- package/dist/sessionEngine.js +464 -0
- package/dist/sessionMap.d.ts +11 -1
- package/dist/sessionMap.js +35 -9
- package/dist/sessionMemorySync.d.ts +31 -0
- package/dist/sessionMemorySync.js +95 -0
- package/dist/sessionRowTag.d.ts +4 -0
- package/dist/sessionRowTag.js +18 -0
- package/dist/settingsLayerAdmission.d.ts +1 -0
- package/dist/settingsLayerAdmission.js +4 -1
- package/dist/toolResult.js +1 -1
- package/dist/wireRefusalCopy.d.ts +6 -1
- package/dist/wireRefusalCopy.js +9 -7
- package/docs/INTEGRATION-CLIENTS.md +1393 -18
- package/package.json +5 -5
|
@@ -2,12 +2,14 @@ import { STREAM_DRAINING_RECONNECT_MAX, drainingRetryDelayMs, isPreStreamDrainin
|
|
|
2
2
|
import { drainingLegStep } from './streamDrainingLegs.js';
|
|
3
3
|
import { mintRunNotFollowed } from './runFollow.js';
|
|
4
4
|
export const REATTACH_MAX_TRIES = 5;
|
|
5
|
+
export const STREAM_CAP_CREDIBLE_AFTER_MS = 300_000;
|
|
6
|
+
const connectionLostBackoffMs = (n) => 1000 * n;
|
|
5
7
|
const DRAINING_TOTAL_MAX = REATTACH_MAX_TRIES * STREAM_DRAINING_RECONNECT_MAX;
|
|
6
8
|
export const REATTACH_BUDGET_FRESH = Object.freeze({ tries: 0, drainingStreak: 0, drainingTotal: 0 });
|
|
7
9
|
export const REATTACH_BUDGET_NONE = Object.freeze({ tries: REATTACH_MAX_TRIES, drainingStreak: 0, drainingTotal: DRAINING_TOTAL_MAX });
|
|
8
10
|
const isCount = (v) => typeof v === 'number' && Number.isSafeInteger(v) && v >= 0;
|
|
9
11
|
const giveUp = (notFollowed, budget) => Object.freeze({ action: 'give_up', budget, notFollowed });
|
|
10
|
-
const reattach = (afterMs, tries, drainingStreak, drainingTotal) => Object.freeze({ action: 'reattach', afterMs, budget: Object.freeze({ tries, drainingStreak, drainingTotal }) });
|
|
12
|
+
const reattach = (afterMs, tries, drainingStreak, drainingTotal, premature) => Object.freeze({ action: 'reattach', afterMs, ...(premature === true ? { premature } : {}), budget: Object.freeze({ tries, drainingStreak, drainingTotal }) });
|
|
11
13
|
export function runReattachPolicy(budget, event) {
|
|
12
14
|
let handle;
|
|
13
15
|
try {
|
|
@@ -44,6 +46,15 @@ export function runReattachPolicy(budget, event) {
|
|
|
44
46
|
draining = { step: st };
|
|
45
47
|
}
|
|
46
48
|
}
|
|
49
|
+
let premature = false;
|
|
50
|
+
if (cause === 'stream_cap') {
|
|
51
|
+
const legElapsedMs = event.legElapsedMs;
|
|
52
|
+
if (legElapsedMs !== undefined) {
|
|
53
|
+
if (typeof legElapsedMs !== 'number' || !Number.isFinite(legElapsedMs) || legElapsedMs < 0)
|
|
54
|
+
return bad();
|
|
55
|
+
premature = legElapsedMs < STREAM_CAP_CREDIBLE_AFTER_MS;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
47
58
|
if (runId === undefined)
|
|
48
59
|
return giveUp(mintRunNotFollowed('no_run_id'), keep);
|
|
49
60
|
if (handle === undefined)
|
|
@@ -55,12 +66,14 @@ export function runReattachPolicy(budget, event) {
|
|
|
55
66
|
return exhausted(cause);
|
|
56
67
|
const error = event.error;
|
|
57
68
|
const next = tries + 1;
|
|
58
|
-
const afterMs = isPreStreamDrainingReject(error) ? drainingRetryDelayMs(error, next - 1) :
|
|
69
|
+
const afterMs = isPreStreamDrainingReject(error) ? drainingRetryDelayMs(error, next - 1) : connectionLostBackoffMs(next);
|
|
59
70
|
return reattach(afterMs, next, 0, drainingTotal);
|
|
60
71
|
}
|
|
61
72
|
if (cause === 'stream_cap') {
|
|
62
73
|
if (tries >= REATTACH_MAX_TRIES)
|
|
63
74
|
return exhausted(cause);
|
|
75
|
+
if (premature)
|
|
76
|
+
return reattach(connectionLostBackoffMs(tries + 1), tries + 1, 0, drainingTotal, true);
|
|
64
77
|
return reattach(0, tries + 1, 0, drainingTotal);
|
|
65
78
|
}
|
|
66
79
|
if (draining === undefined || 'ladder' in draining) {
|
package/dist/runTerminal.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CORE_PROMPT_BLOCK_CAUSES } from './generated/engineFactTables.js';
|
|
2
2
|
import { isSdkRunParked } from './terminalStatuses.js';
|
|
3
|
+
import { runRowSentenceOf, terminalLayerOf } from './replayBody.js';
|
|
3
4
|
import { readOwnDataNonEmptyString, readOwnDataValue } from './ownKey.js';
|
|
4
|
-
import { doneResultView } from './replayBody.js';
|
|
5
5
|
import { washCredentials } from './displayUntrusted.js';
|
|
6
6
|
export const PROMPT_BLOCK_CAUSES = CORE_PROMPT_BLOCK_CAUSES;
|
|
7
7
|
const _promptBlockTablePin = true;
|
|
@@ -300,18 +300,40 @@ function blockedDetailOf(cause) {
|
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
export function readRunTerminal(result) {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
303
|
+
const layer = terminalLayerOf(result);
|
|
304
|
+
const read = readRunTerminalArm(layer);
|
|
305
|
+
if (read === null || read.kind !== 'failed' || read.plane !== 'flat' || read.message !== undefined || layer !== result)
|
|
306
|
+
return read;
|
|
307
|
+
const sentence = runRowSentenceOf(result);
|
|
308
|
+
return sentence === undefined ? read : { ...read, message: sentence };
|
|
309
|
+
}
|
|
310
|
+
function topLevelSnapshotOf(o) {
|
|
311
|
+
const snap = Object.create(null);
|
|
312
|
+
for (const k of ['terminal', 'status', 'errorCode', 'errorMessage', 'blockedReason', 'checkpointGate', 'checkpointId', 'workspaceRestoreMode']) {
|
|
313
|
+
let present;
|
|
314
|
+
try {
|
|
315
|
+
present = k in o;
|
|
316
|
+
}
|
|
317
|
+
catch {
|
|
318
|
+
return undefined;
|
|
319
|
+
}
|
|
320
|
+
if (!present)
|
|
321
|
+
continue;
|
|
322
|
+
try {
|
|
323
|
+
snap[k] = o[k];
|
|
324
|
+
}
|
|
325
|
+
catch {
|
|
326
|
+
snap[k] = undefined;
|
|
327
|
+
}
|
|
308
328
|
}
|
|
309
|
-
return
|
|
329
|
+
return snap;
|
|
310
330
|
}
|
|
311
331
|
function readRunTerminalArm(result) {
|
|
312
332
|
if (typeof result !== 'object' || result === null || Array.isArray(result))
|
|
313
333
|
return null;
|
|
314
|
-
const r = result;
|
|
334
|
+
const r = topLevelSnapshotOf(result);
|
|
335
|
+
if (r === undefined)
|
|
336
|
+
return null;
|
|
315
337
|
if ('terminal' in r) {
|
|
316
338
|
const t = r.terminal;
|
|
317
339
|
const c = typeof t === 'object' && t !== null && !Array.isArray(t) ? t : undefined;
|
package/dist/sandboxWire.d.ts
CHANGED
|
@@ -20,9 +20,6 @@ export declare function sandboxRequestFields(sel: SandboxSelection | undefined):
|
|
|
20
20
|
};
|
|
21
21
|
export declare const AUTO_SANDBOX_ADVISORY: string;
|
|
22
22
|
export declare function wrapObjectiveWithAutoSandboxAdvisory(objective: string): string;
|
|
23
|
-
export declare const SANDBOX_K8S_ONLY_400_ANCHOR = "only supported on the k8s sandbox backend";
|
|
24
|
-
export declare const SANDBOX_NO_IMAGE_INDEX_400_ANCHOR = "requires the image index";
|
|
25
|
-
export declare const SANDBOX_NO_PUBLISHED_IMAGE_404_ANCHOR = "no published sandbox image for profile";
|
|
26
23
|
export declare const SANDBOX_CASCADE_CONFLICT_400_ANCHOR = "not supported together with cascade/verify";
|
|
27
24
|
export type SandboxHintHost = 'terminal' | 'web' | 'desktop';
|
|
28
25
|
export declare const SANDBOX_HINT_HOSTS: readonly SandboxHintHost[];
|
package/dist/sandboxWire.js
CHANGED
|
@@ -41,9 +41,6 @@ export const AUTO_SANDBOX_ADVISORY = '<sandbox-auto-select>\n' +
|
|
|
41
41
|
export function wrapObjectiveWithAutoSandboxAdvisory(objective) {
|
|
42
42
|
return `${AUTO_SANDBOX_ADVISORY}\n\n${objective}`;
|
|
43
43
|
}
|
|
44
|
-
export const SANDBOX_K8S_ONLY_400_ANCHOR = 'only supported on the k8s sandbox backend';
|
|
45
|
-
export const SANDBOX_NO_IMAGE_INDEX_400_ANCHOR = 'requires the image index';
|
|
46
|
-
export const SANDBOX_NO_PUBLISHED_IMAGE_404_ANCHOR = 'no published sandbox image for profile';
|
|
47
44
|
export const SANDBOX_CASCADE_CONFLICT_400_ANCHOR = 'not supported together with cascade/verify';
|
|
48
45
|
export const SANDBOX_HINT_HOSTS = Object.freeze(['terminal', 'web', 'desktop']);
|
|
49
46
|
const SANDBOX_HINT_ARMS = Object.freeze({
|
|
@@ -146,12 +143,6 @@ export function sandboxDegradeHint(err, host, sentRequest) {
|
|
|
146
143
|
const msg = err.message;
|
|
147
144
|
if (typeof msg !== 'string')
|
|
148
145
|
return undefined;
|
|
149
|
-
if (noCode && status === 400 && msg.includes(SANDBOX_K8S_ONLY_400_ANCHOR))
|
|
150
|
-
return sandboxHintOf(SANDBOX_HINT_ARMS.k8sLaneOnly, host);
|
|
151
|
-
if (noCode && status === 400 && msg.includes(SANDBOX_NO_IMAGE_INDEX_400_ANCHOR))
|
|
152
|
-
return sandboxHintOf(SANDBOX_HINT_ARMS.imageIndexRequired, host);
|
|
153
|
-
if (noCode && status === 404 && msg.includes(SANDBOX_NO_PUBLISHED_IMAGE_404_ANCHOR))
|
|
154
|
-
return sandboxHintOf(SANDBOX_HINT_ARMS.noPublishedImage404, host);
|
|
155
146
|
if (status === 400 && msg.includes(SANDBOX_CASCADE_CONFLICT_400_ANCHOR))
|
|
156
147
|
return sandboxHintOf(SANDBOX_HINT_ARMS.cascadeConflict400, host);
|
|
157
148
|
return undefined;
|
package/dist/sdkWireTransit.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export { AgentClient } from '@sema-agent/sdk';
|
|
|
2
2
|
export { isApprovalRequestFrameV1, isApprovalRevokeFrameV1 } from '@sema-agent/sdk';
|
|
3
3
|
export { pushSessionBundle, pullSessionBundle, importSessionBundle, APIError } from '@sema-agent/sdk';
|
|
4
4
|
export { APPROVAL_DECIDE_GATE_KINDS, PLAN_REVIEW_GATE_KINDS } from '@sema-agent/sdk';
|
|
5
|
-
export type { TaskRequest, SessionPermissionRules, SemaSettings, SkillSpec, AgentEvent, RunReceipt, CancelAck, RunRecord, ToolApprovalRespondAck, FleetTaskRow, FleetWorkflowRow, ApprovalCard, ApprovalRequestFrame, ApprovalRiskAxes, AskDecisionAck, AskDecisionBody, PolicyInfo, CcImportLayer, CcImportPrepareResult,
|
|
5
|
+
export type { TaskRequest, SessionPermissionRules, SemaSettings, SkillSpec, AgentEvent, RunReceipt, CancelAck, RunRecord, ToolApprovalRespondAck, FleetTaskRow, FleetWorkflowRow, ApprovalCard, ApprovalRequestFrame, ApprovalRiskAxes, AskDecisionAck, AskDecisionBody, PolicyInfo, CcImportLayer, CcImportPrepareResult, CcImportSettingsLayer, CcImportSkippedRule, PersistedRule, RuleRevokeRequest, RuleRevokeResult, ApprovalDecideGateKind, PlanReviewGateKind, } from '@sema-agent/sdk';
|
package/dist/seam.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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,
|
|
4
|
+
import type { WiringManifestAutoMode, WiringManifestModelGate, WiringManifestMcpEntryView, 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';
|
|
@@ -165,7 +165,7 @@ export type ChromeEvent = {
|
|
|
165
165
|
} | ({
|
|
166
166
|
kind: 'run_cost_reconciled';
|
|
167
167
|
laneProof: LaneProof;
|
|
168
|
-
} & RunCostReconcile) | HumanInputChromeEvent | MessageCommittedChromeEvent | EngineNoticeChromeEvent | TextSegmentEndChromeEvent | ThinkingSegmentEndChromeEvent | ToolDisclosureChromeEvent | ToolProgressChromeEvent | ToolRosterDeltaChromeEvent | ContextUsageChromeEvent | CompactionOutcomeChromeEvent | CompactionStartedChromeEvent | SubagentStartedChromeEvent | PromptAssembledChromeEvent | MemorySavedChromeEvent | WiringManifestChromeEvent | ResultTextDivergedChromeEvent | ResultReplayedChromeEvent | ToolParkedChromeEvent | ApprovalRequestChromeEvent | ApprovalRevokeChromeEvent | {
|
|
168
|
+
} & RunCostReconcile) | HumanInputChromeEvent | MessageCommittedChromeEvent | EngineNoticeChromeEvent | TextSegmentEndChromeEvent | ThinkingSegmentEndChromeEvent | ToolDisclosureChromeEvent | ToolProgressChromeEvent | ToolRosterDeltaChromeEvent | ContextUsageChromeEvent | CompactionOutcomeChromeEvent | CompactionStartedChromeEvent | SubagentStartedChromeEvent | PromptAssembledChromeEvent | MemorySavedChromeEvent | WiringManifestChromeEvent | ResultTextDivergedChromeEvent | ResultReplayedChromeEvent | ToolParkedChromeEvent | ApprovalRequestChromeEvent | ApprovalRevokeChromeEvent | ApprovalCompleteChromeEvent | SessionTitledChromeEvent | {
|
|
169
169
|
kind: 'suspended_reopened';
|
|
170
170
|
laneProof: LaneProof;
|
|
171
171
|
reopen: Extract<SuspendedReopenReading, {
|
|
@@ -182,7 +182,6 @@ export interface WiringManifestChromeEvent {
|
|
|
182
182
|
autoMode?: WiringManifestAutoMode;
|
|
183
183
|
mcp?: readonly WiringManifestMcpEntryView[];
|
|
184
184
|
tools?: ToolRosterView;
|
|
185
|
-
hooks?: readonly WiringManifestHookEntryView[];
|
|
186
185
|
lsp?: WiringManifestLspSeamView;
|
|
187
186
|
writeProtection?: WiringManifestWriteProtectionView;
|
|
188
187
|
autoConsolidation?: WiringManifestAutoConsolidationView;
|
|
@@ -311,17 +310,25 @@ export interface ThinkingSegmentEndChromeEvent {
|
|
|
311
310
|
committedUuids?: readonly string[];
|
|
312
311
|
eventId?: string;
|
|
313
312
|
}
|
|
314
|
-
export interface ApprovalRequestChromeEvent {
|
|
313
|
+
export interface ApprovalRequestChromeEvent extends ApprovalFrameChromeEnvelope {
|
|
315
314
|
kind: 'approval_request';
|
|
315
|
+
}
|
|
316
|
+
export interface ApprovalFrameChromeEnvelope {
|
|
316
317
|
laneProof: LaneProof;
|
|
317
318
|
frame: unknown;
|
|
318
319
|
schemaVersion: number;
|
|
319
320
|
}
|
|
320
|
-
export interface
|
|
321
|
+
export interface ApprovalCompleteChromeEvent extends ApprovalFrameChromeEnvelope {
|
|
322
|
+
kind: 'approval_complete';
|
|
323
|
+
}
|
|
324
|
+
export interface ApprovalRevokeChromeEvent extends ApprovalFrameChromeEnvelope {
|
|
321
325
|
kind: 'approval_revoke';
|
|
326
|
+
}
|
|
327
|
+
export interface SessionTitledChromeEvent {
|
|
328
|
+
kind: 'session_titled';
|
|
322
329
|
laneProof: LaneProof;
|
|
323
|
-
|
|
324
|
-
|
|
330
|
+
sessionId: string;
|
|
331
|
+
title: string;
|
|
325
332
|
}
|
|
326
333
|
export interface ResultTextDivergedChromeEvent {
|
|
327
334
|
kind: 'result_text_diverged';
|
package/dist/seam.js
CHANGED
|
@@ -168,6 +168,18 @@ const CHROME_ARM_TABLE = {
|
|
|
168
168
|
'🔴 三纪律:①按 taskId 归属过滤(孤儿撤帧行非我即忽略)②账本重放的撤帧只用于时间线渲染,卡集基准恒为开流 preamble' +
|
|
169
169
|
'(撤帧可能整帧丢失)③已 DECIDED 的兄弟不在 askIds 里;真撤到本地卡时给一行归因(reason 消毒后呈现),零命中不要多说那一行',
|
|
170
170
|
},
|
|
171
|
+
approval_complete: {
|
|
172
|
+
required: true,
|
|
173
|
+
duty: '用 sdk isApprovalCompleteFrameV1 窄化 frame 取 askId/outcome/cause/parked;窄不下来按 askId(若有)清卡、别猜结局;按开卡帧的 askId 清本地卡' +
|
|
174
|
+
'(与撤卡帧不冲突,两帧都可能到;清卡是这张卡的一条出口,呈卡臂登记的持有句柄照放);🔴 永不据本帧推断 run 的归宿(读 run 行 / 停驻面),' +
|
|
175
|
+
'expired 不是拒绝,带 parked 的是转进耐久队列、还在等人;账本重放的消卡帧只用于时间线渲染,卡集对账基准恒为开流 preamble(帧可能整帧丢失)',
|
|
176
|
+
},
|
|
177
|
+
session_titled: {
|
|
178
|
+
required: false,
|
|
179
|
+
duty: '可选:按 sessionId(服务端会话 id)把那一条会话行的标题刷新成 title(与行上同值,写进宿主自己那一份会话行);' +
|
|
180
|
+
'🔴 会话行 title 是唯一真源:本臂只活不存、可能不到(冷启动 / 多窗口 / 断线重连读行),没收到 ≠ 还没有标题;' +
|
|
181
|
+
'title 是模型产文,只渲染、永不回喂模型;座位上由宿主刷新会话行后经 session_updated 推给渲染端',
|
|
182
|
+
},
|
|
171
183
|
text_segment_end: {
|
|
172
184
|
required: true,
|
|
173
185
|
duty: '🔴 引擎明报的 assistant 散文段边界 + **该段权威全文**(server ≥7.75.3 起 content 经脱敏器、' +
|
package/dist/seatContract.d.ts
CHANGED
|
@@ -14,12 +14,14 @@ import type { DeviceEnrollTokenOutcome, DeviceListOutcome, DeviceRebindOutcome,
|
|
|
14
14
|
import type { McpPanelView } from "./mcpPanel.js";
|
|
15
15
|
import type { McpToolToggleKey } from "./mcpToolToggles.js";
|
|
16
16
|
import { type ThinkingLatchEvent, type ThinkingLatchRowWord } from "./thinkingLatchWords.js";
|
|
17
|
-
import type { SessionRowPatchFields } from "./sessionRowTag.js";
|
|
17
|
+
import type { SessionRowPatchFields, SessionRowUnreadable } from "./sessionRowTag.js";
|
|
18
|
+
import { type SessionEngineView } from "./sessionEngine.js";
|
|
18
19
|
export interface SeatValidationFailure {
|
|
19
20
|
reason: string;
|
|
20
21
|
field?: string;
|
|
21
22
|
}
|
|
22
23
|
export type SeatValidation = true | SeatValidationFailure;
|
|
24
|
+
export declare const isSecretKeyName: (k: string) => boolean;
|
|
23
25
|
export type EipcMethodKind = "invoke" | "event";
|
|
24
26
|
export interface EipcMethodSpec {
|
|
25
27
|
kind: EipcMethodKind;
|
|
@@ -50,7 +52,10 @@ export interface LocalSessionRecord {
|
|
|
50
52
|
parked?: boolean;
|
|
51
53
|
pinned?: boolean;
|
|
52
54
|
rowTag?: string;
|
|
55
|
+
unreadable?: SessionRowUnreadable;
|
|
53
56
|
thinkingLatch?: ThinkingLatchRowWord;
|
|
57
|
+
engine?: SessionEngineView;
|
|
58
|
+
executionLane?: string;
|
|
54
59
|
}
|
|
55
60
|
export declare const TOOL_PERMISSION_REQUEST_ID_DOMAINS: readonly ["live:", "durable:", "question:", "elicit:", "plan:"];
|
|
56
61
|
export type ToolPermissionRequestIdDomain = (typeof TOOL_PERMISSION_REQUEST_ID_DOMAINS)[number];
|
|
@@ -105,6 +110,7 @@ declare const CHROME_ARM_SEAT_ROUTE: {
|
|
|
105
110
|
readonly plan_review_park: "host";
|
|
106
111
|
readonly approval_request: "host";
|
|
107
112
|
readonly approval_revoke: "host";
|
|
113
|
+
readonly approval_complete: "host";
|
|
108
114
|
readonly task_ledger_sync: "host";
|
|
109
115
|
readonly inline_task_stats: "host";
|
|
110
116
|
readonly stream_delta: "host";
|
|
@@ -124,6 +130,7 @@ declare const CHROME_ARM_SEAT_ROUTE: {
|
|
|
124
130
|
readonly wiring_manifest: "host";
|
|
125
131
|
readonly suspended_reopened: "host";
|
|
126
132
|
readonly result_text_diverged: "host";
|
|
133
|
+
readonly session_titled: "host";
|
|
127
134
|
};
|
|
128
135
|
type SeatRoutedKind = {
|
|
129
136
|
[K in keyof typeof CHROME_ARM_SEAT_ROUTE]: (typeof CHROME_ARM_SEAT_ROUTE)[K] extends "seat" ? K : never;
|
|
@@ -194,7 +201,7 @@ export type SeatStreamReading = {
|
|
|
194
201
|
};
|
|
195
202
|
export declare function seatStreamDeltaMessage(event: SeatStreamDeltaSource, ids: SeatStreamDeltaIds): SeatStreamEventMessage | undefined;
|
|
196
203
|
export declare function readSeatStreamDelta(message: object): SeatStreamReading;
|
|
197
|
-
export declare const SEAT_CAPABILITY_NAMES: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles", "thinkingLatch"];
|
|
204
|
+
export declare const SEAT_CAPABILITY_NAMES: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles", "thinkingLatch", "computerUseSwitch", "engineModeDefaultOnly"];
|
|
198
205
|
export type SeatCapabilityName = (typeof SEAT_CAPABILITY_NAMES)[number];
|
|
199
206
|
export interface SeatCapabilitiesState {
|
|
200
207
|
pickFolder?: boolean;
|
|
@@ -206,6 +213,8 @@ export interface SeatCapabilitiesState {
|
|
|
206
213
|
onboard?: boolean;
|
|
207
214
|
mcpToolToggles?: boolean;
|
|
208
215
|
thinkingLatch?: boolean;
|
|
216
|
+
computerUseSwitch?: boolean;
|
|
217
|
+
engineModeDefaultOnly?: boolean;
|
|
209
218
|
}
|
|
210
219
|
export type SeatCapabilityReading = {
|
|
211
220
|
readonly kind: "reported";
|
|
@@ -589,6 +598,7 @@ export interface OnboardImportableProfile {
|
|
|
589
598
|
api: ModelApiWord;
|
|
590
599
|
hasKey: boolean;
|
|
591
600
|
models: string[];
|
|
601
|
+
isCurrent?: boolean;
|
|
592
602
|
}
|
|
593
603
|
export interface OnboardProvidersResult {
|
|
594
604
|
providers: OnboardProviderRow[];
|
|
@@ -600,6 +610,42 @@ export declare const checkMcpToolToggleKey: (v: unknown) => SeatValidation;
|
|
|
600
610
|
export interface McpToolTogglesResult {
|
|
601
611
|
off: McpToolToggleKey[];
|
|
602
612
|
}
|
|
613
|
+
export declare const COMPUTER_USE_SOURCES: readonly ["env", "settings", "default"];
|
|
614
|
+
export type ComputerUseSource = (typeof COMPUTER_USE_SOURCES)[number];
|
|
615
|
+
export declare const COMPUTER_USE_REFUSAL_REASONS: readonly ["locked-by-env", "confirmation-required", "invalid-request", "write-failed"];
|
|
616
|
+
export type ComputerUseRefusalReason = (typeof COMPUTER_USE_REFUSAL_REASONS)[number];
|
|
617
|
+
export declare const COMPUTER_USE_APPLIES_ON: readonly ["next-engine-start"];
|
|
618
|
+
export type ComputerUseAppliesOn = (typeof COMPUTER_USE_APPLIES_ON)[number];
|
|
619
|
+
export interface ComputerUseState {
|
|
620
|
+
enabled: boolean;
|
|
621
|
+
source: ComputerUseSource;
|
|
622
|
+
lockedByEnv: boolean;
|
|
623
|
+
appliesOn: ComputerUseAppliesOn;
|
|
624
|
+
}
|
|
625
|
+
export type SetComputerUseRequest = {
|
|
626
|
+
readonly enabled: false;
|
|
627
|
+
} | {
|
|
628
|
+
readonly enabled: true;
|
|
629
|
+
readonly confirmed: true;
|
|
630
|
+
};
|
|
631
|
+
export type SetComputerUseResult = {
|
|
632
|
+
ok: true;
|
|
633
|
+
changed: boolean;
|
|
634
|
+
state: ComputerUseState;
|
|
635
|
+
} | {
|
|
636
|
+
ok: false;
|
|
637
|
+
reason: ComputerUseRefusalReason;
|
|
638
|
+
state: ComputerUseState;
|
|
639
|
+
};
|
|
640
|
+
export declare const checkSetComputerUseRequest: (v: unknown) => SeatValidation;
|
|
641
|
+
export type SetComputerUsePlan = {
|
|
642
|
+
readonly kind: "apply";
|
|
643
|
+
readonly enabled: boolean;
|
|
644
|
+
} | {
|
|
645
|
+
readonly kind: "refused";
|
|
646
|
+
readonly reason: Exclude<ComputerUseRefusalReason, "write-failed">;
|
|
647
|
+
};
|
|
648
|
+
export declare function planSetComputerUse(request: {} | null | undefined, lockedByEnv: boolean): SetComputerUsePlan;
|
|
603
649
|
export interface LocalSessionsApi {
|
|
604
650
|
start(opts?: StartSessionOptions): Promise<LocalSessionRecord>;
|
|
605
651
|
sendMessage(req: SendMessageRequest): Promise<SendMessageAck>;
|
|
@@ -638,6 +684,8 @@ export interface LocalSessionsApi {
|
|
|
638
684
|
listMcpToolToggles(): Promise<McpToolTogglesResult>;
|
|
639
685
|
setMcpToolToggle(key: McpToolToggleKey, enabled: boolean): Promise<OkAck>;
|
|
640
686
|
setThinkingLatch(req: SetThinkingLatchRequest): Promise<OkAck>;
|
|
687
|
+
getComputerUse(): Promise<ComputerUseState>;
|
|
688
|
+
setComputerUse(req: SetComputerUseRequest): Promise<SetComputerUseResult>;
|
|
641
689
|
onEvent(cb: (ev: LocalSessionEvent) => void): () => void;
|
|
642
690
|
onToolPermissionRequest(cb: (req: ToolPermissionRequest) => void): () => void;
|
|
643
691
|
sessionsStateStore: EipcStoreClient<SessionsState>;
|
|
@@ -683,12 +731,12 @@ export declare const checkSetThinkingLatchRequest: (v: unknown) => SeatValidatio
|
|
|
683
731
|
export declare function isSetThinkingLatchRequest(v: unknown): v is SetThinkingLatchRequest;
|
|
684
732
|
export declare function isSendMessageAck(v: unknown): v is SendMessageAck;
|
|
685
733
|
export declare const LOCAL_SESSIONS_SPEC: EipcServiceSpec;
|
|
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"];
|
|
734
|
+
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", "getComputerUse", "setComputerUse", "onEvent", "onToolPermissionRequest"];
|
|
687
735
|
export declare const SEAT_STORE_PROPS: readonly ["sessionsStateStore", "focusedSessionStateStore", "settingsStateStore", "seatCapabilitiesStateStore", "engineTargetStateStore"];
|
|
688
736
|
export declare const SEAT_EVENT_METHOD_NAMES: readonly ["onEvent", "onToolPermissionRequest"];
|
|
689
737
|
export declare const LOCAL_SESSION_EVENT_KEYS: readonly ["type", "sessionId", "message", "error", "errorCategory", "code", "session", "userMessageUuid", "requestId", "outcome", "parked", "chrome", "_sema_turnFailure", "subagentContent"];
|
|
690
738
|
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"];
|
|
691
|
-
export declare const LOCAL_SESSION_RECORD_KEYS: readonly ["sessionId", "engineSessionId", "model", "title", "cwd", "isRunning", "createdAt", "lastActivityAt", "queuedMessages", "parked", "pinned", "rowTag", "thinkingLatch"];
|
|
739
|
+
export declare const LOCAL_SESSION_RECORD_KEYS: readonly ["sessionId", "engineSessionId", "model", "title", "cwd", "isRunning", "createdAt", "lastActivityAt", "queuedMessages", "parked", "pinned", "rowTag", "unreadable", "thinkingLatch", "engine", "executionLane"];
|
|
692
740
|
export declare const SEND_MESSAGE_REQUEST_KEYS: readonly ["sessionId", "text", "model", "userMessageUuid", "permissionMode", "attachmentIds", "reasoningEffort", "retainBackgroundProcesses", "forwardSubagentEvents", "retainSubagentSessions", "settings", "scenario", "rewind"];
|
|
693
741
|
export declare const SEAT_SEND_MESSAGE_KEY_ORIGINS: {
|
|
694
742
|
readonly sessionId: {
|
|
@@ -738,7 +786,7 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
738
786
|
readonly LocalSessionRecord: {
|
|
739
787
|
readonly guard: "isLocalSessionRecord";
|
|
740
788
|
readonly check: (v: unknown) => SeatValidation;
|
|
741
|
-
readonly validated: readonly ["sessionId", "engineSessionId", "model", "title", "cwd", "isRunning", "createdAt", "lastActivityAt", "queuedMessages", "parked", "pinned", "rowTag", "thinkingLatch"];
|
|
789
|
+
readonly validated: readonly ["sessionId", "engineSessionId", "model", "title", "cwd", "isRunning", "createdAt", "lastActivityAt", "queuedMessages", "parked", "pinned", "rowTag", "unreadable", "thinkingLatch", "engine", "executionLane"];
|
|
742
790
|
readonly unchecked: readonly [];
|
|
743
791
|
};
|
|
744
792
|
readonly ToolPermissionRequest: {
|
|
@@ -804,6 +852,9 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
804
852
|
}, {
|
|
805
853
|
readonly key: "candidateRejected";
|
|
806
854
|
readonly why: "诊断面(0.97.0 CC-715;当前配置是候选被整拒后回落的那一份),三态读法归 modelCandidateRejectedOf(含坏形 unreadable);出站门为它拒掉整份目录 = 选单为一行诊断整个消失。";
|
|
855
|
+
}, {
|
|
856
|
+
readonly key: "modelPlane";
|
|
857
|
+
readonly why: "诊断面(0.106.0 CC-1156;这台引擎服务的是哪张模型表 / 最近一份目录候选的结局),三态读法归 modelPlaneOf(含坏形 unreadable、表外词整位不给);出站门为它拒掉整份目录 = 选单为一行诊断整个消失。";
|
|
807
858
|
}];
|
|
808
859
|
};
|
|
809
860
|
readonly SendMessageRequest: {
|
|
@@ -877,7 +928,7 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
877
928
|
};
|
|
878
929
|
readonly SeatCapabilitiesState: {
|
|
879
930
|
readonly check: (v: unknown) => SeatValidation;
|
|
880
|
-
readonly validated: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles", "thinkingLatch"];
|
|
931
|
+
readonly validated: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles", "thinkingLatch", "computerUseSwitch", "engineModeDefaultOnly"];
|
|
881
932
|
readonly unchecked: readonly [];
|
|
882
933
|
};
|
|
883
934
|
readonly RecentFoldersResult: {
|
|
@@ -917,7 +968,7 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
917
968
|
};
|
|
918
969
|
};
|
|
919
970
|
export declare const SEAT_VALIDATOR_COVERAGE_EXEMPT: readonly [...{
|
|
920
|
-
label: "DeviceListOutcome" | "DeviceSessionBindingOutcome" | "DeviceRebindOutcome" | "DeviceEnrollTokenOutcome" | "DeviceRevokeOutcome" | "SeatDeviceRebindRequest" | "SeatDeviceRevokeRequest" | "EngineTargetState" | "EngineTargetResult" | "CloudLoginStart" | "CloudLoginCancelAck" | "CloudConnectResult" | "CloudLoginRequest" | "CloudEngineConnectRequest" | "CloudEngineConfigureRequest" | "OnboardProvidersResult" | "OnboardProbeResult" | "OnboardApplyResult" | "OnboardEntryRequest" | "OnboardApplyRequest" | "McpToolTogglesResult" | "McpToolToggleKey";
|
|
971
|
+
label: "DeviceListOutcome" | "DeviceSessionBindingOutcome" | "DeviceRebindOutcome" | "DeviceEnrollTokenOutcome" | "DeviceRevokeOutcome" | "SeatDeviceRebindRequest" | "SeatDeviceRevokeRequest" | "EngineTargetState" | "EngineTargetResult" | "CloudLoginStart" | "CloudLoginCancelAck" | "CloudConnectResult" | "CloudLoginRequest" | "CloudEngineConnectRequest" | "CloudEngineConfigureRequest" | "OnboardProvidersResult" | "OnboardProbeResult" | "OnboardApplyResult" | "OnboardEntryRequest" | "OnboardApplyRequest" | "McpToolTogglesResult" | "McpToolToggleKey" | "ComputerUseState" | "SetComputerUseResult" | "SetComputerUseRequest";
|
|
921
972
|
check: (v: unknown) => SeatValidation;
|
|
922
973
|
why: string;
|
|
923
974
|
}[], {
|