@sema-agent/client-core 0.107.0 → 0.108.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 +118 -0
- package/README.md +19 -14
- package/dist/adapter/activeRunSelfHeal.d.ts +2 -0
- package/dist/adapter/activeRunSelfHeal.js +20 -3
- package/dist/checkpointRowVerdict.d.ts +5 -0
- package/dist/checkpointRowVerdict.js +26 -0
- package/dist/cloudConfigWireCaps.d.ts +10 -0
- package/dist/cloudConfigWireCaps.js +33 -0
- package/dist/coreValuePorts.d.ts +17 -1
- package/dist/coreValuePorts.js +5 -0
- package/dist/decideReceipt.js +2 -1
- package/dist/engineErrorCodes.d.ts +5 -0
- package/dist/engineErrorCodes.js +5 -0
- package/dist/engineNoticeCodes.d.ts +19 -1
- package/dist/engineNoticeCodes.js +65 -3
- package/dist/engineTargetSeat.js +1 -0
- package/dist/errorSupplementRoles.js +2 -0
- package/dist/eventLeg.js +1 -1
- package/dist/executionLaneWords.js +2 -1
- package/dist/gateOutcome.d.ts +10 -1
- package/dist/gateOutcome.js +48 -1
- package/dist/generated/engineFactTables.d.ts +1 -0
- package/dist/generated/engineFactTables.js +5 -0
- package/dist/generated/engineNoticeTables.js +3 -0
- package/dist/generated/settingsSchemaFns.d.ts +4 -2
- package/dist/generated/settingsSchemaFns.js +9 -3
- package/dist/generated/settingsSchemaMcpRequestEntry.d.ts +1 -1
- package/dist/generated/settingsSchemaMcpRequestEntry.js +9 -18
- package/dist/generated/settingsSchemaReservedMemberName.d.ts +1 -0
- package/dist/generated/settingsSchemaReservedMemberName.js +7 -0
- package/dist/generated/settingsSchemaTables.d.ts +2 -0
- package/dist/generated/settingsSchemaTables.js +10 -0
- package/dist/generated/settingsSchemaWireName.d.ts +1 -0
- package/dist/generated/settingsSchemaWireName.js +8 -0
- package/dist/headlessReconnectWire.js +12 -7
- package/dist/hitl/approvalAskers.d.ts +13 -0
- package/dist/hitl/approvalAskers.js +79 -0
- package/dist/hitl/approvalResolution.d.ts +3 -0
- package/dist/hitl/approvalResolution.js +22 -4
- package/dist/hitl/approvalsFeed.js +3 -12
- package/dist/hitl/askParkRowRouting.js +5 -1
- package/dist/hitl/decisionRefusal.d.ts +1 -0
- package/dist/hitl/decisionRefusal.js +5 -2
- package/dist/hitl/decisionSend.js +2 -6
- package/dist/hitl/frameRouter.d.ts +3 -2
- package/dist/hitl/frameRouter.js +28 -6
- package/dist/hitl/gateLedger.d.ts +2 -0
- package/dist/hitl/gateLedger.js +3 -1
- package/dist/hitl/hitlBridge.js +2 -3
- package/dist/hitl/parkResolver.js +32 -23
- package/dist/hitl/parkRowBirthWait.d.ts +2 -0
- package/dist/hitl/parkRowBirthWait.js +8 -1
- package/dist/hitl/persistedRulesWire.d.ts +5 -1
- package/dist/hitl/persistedRulesWire.js +20 -4
- package/dist/hitl/planReviewWire.js +12 -16
- package/dist/hitl/policyDenyCause.d.ts +3 -0
- package/dist/hitl/policyDenyCause.js +16 -0
- package/dist/hitl/sessionPolicyDeliverable.js +1 -1
- package/dist/hitl/toolApprovalWire.d.ts +8 -2
- package/dist/hitl/toolApprovalWire.js +22 -3
- package/dist/hooksReaderGenerations.d.ts +1 -0
- package/dist/hooksReaderGenerations.js +12 -0
- package/dist/hooksWireCaps.js +8 -4
- package/dist/i18n/messages.en.d.ts +38 -1
- package/dist/i18n/messages.en.js +40 -3
- package/dist/i18n/messages.zh.js +45 -3
- package/dist/index.d.ts +6 -1
- package/dist/index.js +4 -1
- package/dist/liveModelCatalog.d.ts +4 -2
- package/dist/liveModelCatalog.js +164 -26
- package/dist/model/catalogDefault.d.ts +25 -0
- package/dist/model/catalogDefault.js +44 -0
- package/dist/permissionWireCaps.d.ts +1 -0
- package/dist/permissionWireCaps.js +11 -0
- package/dist/pluginHooksWire.d.ts +5 -3
- package/dist/pluginHooksWire.js +116 -7
- package/dist/queuedDelivery.d.ts +1 -0
- package/dist/queuedDelivery.js +12 -0
- package/dist/resultFrameKeys.js +4 -2
- package/dist/resumeRefusalCopy.js +15 -8
- package/dist/runPermissionModeSwitch.d.ts +2 -1
- package/dist/runPermissionModeSwitch.js +16 -6
- package/dist/seatContract.d.ts +63 -10
- package/dist/seatContract.js +164 -11
- package/dist/sessionEngine.d.ts +2 -1
- package/dist/sessionEngine.js +5 -0
- package/dist/settingsHooksSalvage.d.ts +5 -0
- package/dist/settingsHooksSalvage.js +54 -0
- package/dist/subagentContentStore.js +1 -1
- package/dist/supportFloor.js +2 -0
- package/dist/taskNotificationAdmission.d.ts +19 -0
- package/dist/taskNotificationAdmission.js +84 -0
- package/dist/toolResult.js +2 -1
- package/dist/webSearchWireCaps.js +9 -4
- package/dist/wireRefusalCopy.d.ts +2 -1
- package/dist/wireRefusalCopy.js +2 -2
- package/docs/INTEGRATION-CLIENTS.md +816 -14
- package/package.json +4 -4
package/dist/queuedDelivery.js
CHANGED
|
@@ -3,6 +3,7 @@ import { imageVisionOf } from './liveModelCatalog.js';
|
|
|
3
3
|
import { userPromptSubmitExecutorOf } from './pluginHooksWire.js';
|
|
4
4
|
import { observedUserAttachmentSeat } from './userAttachmentSeat.js';
|
|
5
5
|
import { guardedRead, readOwnDataValue } from './ownKey.js';
|
|
6
|
+
import { taskNotificationOf } from './notifications.js';
|
|
6
7
|
const own = (o, key) => guardedRead(() => readOwnDataValue(o, key));
|
|
7
8
|
const str = (o, key) => {
|
|
8
9
|
const v = own(o, key);
|
|
@@ -43,6 +44,8 @@ export function batchCompatible(head, follower, plan) {
|
|
|
43
44
|
return false;
|
|
44
45
|
if (typeof head !== 'object' || head === null || typeof follower !== 'object' || follower === null)
|
|
45
46
|
return false;
|
|
47
|
+
if (carriesCompletionIdentity(head) || carriesCompletionIdentity(follower))
|
|
48
|
+
return false;
|
|
46
49
|
const executor = userPromptSubmitExecutorOf(plan);
|
|
47
50
|
if (executor === 'engine' || executor === 'unknown')
|
|
48
51
|
return false;
|
|
@@ -84,6 +87,15 @@ export function batchCompatible(head, follower, plan) {
|
|
|
84
87
|
return false;
|
|
85
88
|
}
|
|
86
89
|
}
|
|
90
|
+
function carriesCompletionIdentity(e) {
|
|
91
|
+
const slot = peek(e, '_sema_task_notification');
|
|
92
|
+
if (slot === undefined || slot === null)
|
|
93
|
+
return false;
|
|
94
|
+
if (slot === UNREADABLE)
|
|
95
|
+
return true;
|
|
96
|
+
const fact = taskNotificationOf({ _sema_task_notification: slot });
|
|
97
|
+
return fact === undefined || fact.completionId !== undefined;
|
|
98
|
+
}
|
|
87
99
|
function upsExecutorWordOk(v) {
|
|
88
100
|
return v === undefined || v === 'shell' || v === 'engine' || v === 'unknown' || v === 'none';
|
|
89
101
|
}
|
package/dist/resultFrameKeys.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readFrameStringKey, readFrameTrueMark } from './ownKey.js';
|
|
1
|
+
import { guardedRead, readFrameStringKey, readFrameTrueMark, readOwnDataValue } from './ownKey.js';
|
|
2
2
|
export function resultErrorCodeOf(frame) {
|
|
3
3
|
return readFrameStringKey(frame, '_sema_error_code');
|
|
4
4
|
}
|
|
@@ -12,5 +12,7 @@ export function resultParkFailedReasonOf(frame) {
|
|
|
12
12
|
return readFrameStringKey(frame, '_sema_park_failed_reason');
|
|
13
13
|
}
|
|
14
14
|
export function resultErrorCodeInTextOf(frame) {
|
|
15
|
-
|
|
15
|
+
if (!readFrameTrueMark(frame, '_sema_error_code_in_text'))
|
|
16
|
+
return undefined;
|
|
17
|
+
return guardedRead(() => (Array.isArray(readOwnDataValue(frame, 'errors')) ? true : undefined));
|
|
16
18
|
}
|
|
@@ -2,21 +2,27 @@ import { msg, renderMessage } from './i18n/translate.js';
|
|
|
2
2
|
import { readBlockedBy, readErrorNumber, readErrorString, readThrownSlot } from './wireFailureShape.js';
|
|
3
3
|
import { guardedRead, ownDataField, readOwnDataNonEmptyString, readOwnDataValue } from './ownKey.js';
|
|
4
4
|
import { CORE_RESUME_STARTUP_CAUSES } from './generated/engineFactTables.js';
|
|
5
|
-
import { RESUME_CONTEXT_UNAVAILABLE, RESUME_PLACEMENT_MISMATCH, RESUME_PREFLIGHT_REJECTED, RESUME_POLICY_FOLD_CODE, PARKED_RESUME_STARTUP_FAILED, isStatusDerivedCoarseCode, RESUME_SESSION_NOT_FOUND, REQUEST_FIELD_CONFLICT, CHECKPOINT_UNSUPPORTED_VERSION, CHECKPOINT_WALLTIME_AXIS_RETIRED, CHECKPOINT_CONFIG_REFUSED, isRefusedParkCode, refusalSaysStillPending, refusalRetriableReading, } from './engineErrorCodes.js';
|
|
5
|
+
import { RESUME_CONTEXT_UNAVAILABLE, RESUME_PLACEMENT_MISMATCH, RESUME_PREFLIGHT_REJECTED, RESUME_PRINCIPAL_MISMATCH, RESUME_COMPOSITION_MISMATCH, RESUME_PARENT_CONSTRAINT_MISSING, RESUME_PARENT_CONSTRAINT_MISMATCH, RESUME_CONSTRAINT_UNPROJECTABLE, RESUME_POLICY_FOLD_CODE, PARKED_RESUME_STARTUP_FAILED, isStatusDerivedCoarseCode, RESUME_SESSION_NOT_FOUND, REQUEST_FIELD_CONFLICT, CHECKPOINT_UNSUPPORTED_VERSION, CHECKPOINT_WALLTIME_AXIS_RETIRED, CHECKPOINT_CONFIG_REFUSED, isRefusedParkCode, refusalSaysStillPending, refusalRetriableReading, } from './engineErrorCodes.js';
|
|
6
6
|
import { capForDisplay } from './fleetTaskDesc.js';
|
|
7
7
|
import { engineVersionTier } from './supportFloor.js';
|
|
8
8
|
import { resumeRetryLaterFromError } from './wireErrorTriage.js';
|
|
9
|
-
|
|
10
|
-
RESUME_PLACEMENT_MISMATCH,
|
|
11
|
-
RESUME_PREFLIGHT_REJECTED,
|
|
12
|
-
]
|
|
9
|
+
const REFUSAL_COPY_KEYS = Object.freeze({
|
|
10
|
+
[RESUME_PLACEMENT_MISMATCH]: 'resume.refusal.placementMismatch',
|
|
11
|
+
[RESUME_PREFLIGHT_REJECTED]: null,
|
|
12
|
+
[RESUME_PRINCIPAL_MISMATCH]: 'resume.refusal.principalMismatch',
|
|
13
|
+
[RESUME_COMPOSITION_MISMATCH]: 'resume.refusal.compositionMismatch',
|
|
14
|
+
[RESUME_PARENT_CONSTRAINT_MISSING]: 'resume.refusal.parentConstraintMissing',
|
|
15
|
+
[RESUME_PARENT_CONSTRAINT_MISMATCH]: 'resume.refusal.parentConstraintMismatch',
|
|
16
|
+
[RESUME_CONSTRAINT_UNPROJECTABLE]: 'resume.refusal.constraintUnprojectable',
|
|
17
|
+
});
|
|
18
|
+
export const RESUME_REFUSAL_CODES = Object.freeze(Object.keys(REFUSAL_COPY_KEYS));
|
|
13
19
|
export function resumeRefusalFromError(err) {
|
|
14
20
|
if (typeof err !== 'object' || err === null)
|
|
15
21
|
return null;
|
|
16
22
|
const code = guardedRead(() => ownDataField(err, 'errorCode'));
|
|
17
23
|
if (typeof code !== 'string' || !RESUME_REFUSAL_CODES.includes(code))
|
|
18
24
|
return null;
|
|
19
|
-
if (code
|
|
25
|
+
if (code !== RESUME_PREFLIGHT_REJECTED) {
|
|
20
26
|
return { code, waitable: false };
|
|
21
27
|
}
|
|
22
28
|
const timed = resumeRetryLaterFromError(err);
|
|
@@ -29,8 +35,9 @@ export function resumeRefusalFromError(err) {
|
|
|
29
35
|
};
|
|
30
36
|
}
|
|
31
37
|
export function resumeRefusalContent(detail, lang) {
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
const copyKey = typeof detail.code === 'string' && Object.hasOwn(REFUSAL_COPY_KEYS, detail.code) ? REFUSAL_COPY_KEYS[detail.code] : null;
|
|
39
|
+
if (copyKey !== null && copyKey !== undefined)
|
|
40
|
+
return renderMessage(msg(copyKey, { safe: msg('resume.refusal.untouched') }), lang);
|
|
34
41
|
return renderMessage(msg(detail.waitable ? 'resume.refusal.preflightWaitable' : 'resume.refusal.preflightNoWait'), lang);
|
|
35
42
|
}
|
|
36
43
|
export function resumePolicyBlockFromError(err) {
|
|
@@ -2,7 +2,7 @@ import type { UiLanguage } from './env/uiLanguage.js';
|
|
|
2
2
|
import { type PermissionModeReceiptView } from './adapter/downstream/wiringManifestView.js';
|
|
3
3
|
import { SDK_PERMISSION_MODE_ADMISSION_FOLDS, SDK_PERMISSION_MODE_PERSIST_MISSES } from './generated/sdkFactTables.js';
|
|
4
4
|
import { type PermissionModeWriteReading } from './permissionModeWriteCapability.js';
|
|
5
|
-
import type
|
|
5
|
+
import { type PermissionMode } from './permissionWireCaps.js';
|
|
6
6
|
export type { PermissionModeReceiptView };
|
|
7
7
|
type AdmissionFold = (typeof SDK_PERMISSION_MODE_ADMISSION_FOLDS)[number];
|
|
8
8
|
type PersistMiss = (typeof SDK_PERMISSION_MODE_PERSIST_MISSES)[number];
|
|
@@ -40,6 +40,7 @@ export type RunPermissionModeSwitchOutcome = {
|
|
|
40
40
|
readonly status?: number;
|
|
41
41
|
} | {
|
|
42
42
|
readonly kind: 'unavailable';
|
|
43
|
+
readonly code?: string;
|
|
43
44
|
};
|
|
44
45
|
export interface RunPermissionModeSwitchRuns {
|
|
45
46
|
setPermissionMode(taskId: string, mode: PermissionMode, opts?: {
|
|
@@ -3,8 +3,9 @@ import { readPermissionModeReceiptSegment } from './adapter/downstream/wiringMan
|
|
|
3
3
|
import { displayUntrusted } from './displayUntrusted.js';
|
|
4
4
|
import { SDK_PERMISSION_MODE_ADMISSION_FOLDS, SDK_PERMISSION_MODE_PERSIST_MISSES } from './generated/sdkFactTables.js';
|
|
5
5
|
import { msg, renderMessage } from './i18n/translate.js';
|
|
6
|
-
import { ownDataField } from './ownKey.js';
|
|
6
|
+
import { ownDataField, readOwnDataValue } from './ownKey.js';
|
|
7
7
|
import { permissionModeWriteAvailable } from './permissionModeWriteCapability.js';
|
|
8
|
+
import { permissionModeTitle } from './permissionWireCaps.js';
|
|
8
9
|
import { isDisplayableWireCode } from './wireFailureShape.js';
|
|
9
10
|
export const PERMISSION_MODE_SWITCH_RESULT_KEYS = Object.freeze(['taskId', 'sessionId', 'status', 'permissionMode', 'admission', 'persisted', 'persistMiss']);
|
|
10
11
|
const NOT_RUNNING_CODE = 'steering.not_running';
|
|
@@ -19,7 +20,9 @@ function guardedSlot(o, key) {
|
|
|
19
20
|
return undefined;
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
|
-
const unavailable = () => Object.freeze({ kind: 'unavailable' });
|
|
23
|
+
const unavailable = (code) => Object.freeze(code !== undefined ? { kind: 'unavailable', code } : { kind: 'unavailable' });
|
|
24
|
+
const RUN_STORE_REQUIRED_CODE = 'capability.run_store_required';
|
|
25
|
+
const CHECKPOINT_STORE_REQUIRED_CODE = 'capability.checkpoint_store_required';
|
|
23
26
|
const unreadableAnswer = () => Object.freeze({ kind: 'unconfirmed', why: 'unreadable-answer' });
|
|
24
27
|
function admissionOf(raw) {
|
|
25
28
|
if (raw === null || typeof raw !== 'object' || Array.isArray(raw))
|
|
@@ -72,7 +75,7 @@ function switchOutcomeOf(taskId, sent, body) {
|
|
|
72
75
|
function failureOutcomeOf(e) {
|
|
73
76
|
const v = atMostOnceVerdictOf(e);
|
|
74
77
|
if (v.status === 501)
|
|
75
|
-
return unavailable();
|
|
78
|
+
return unavailable(v.code);
|
|
76
79
|
if (v.delivery === 'rejected' && v.status !== undefined) {
|
|
77
80
|
if (v.status === 404)
|
|
78
81
|
return Object.freeze({ kind: 'not-found' });
|
|
@@ -110,7 +113,8 @@ export async function setRunPermissionMode(runs, taskId, mode, opts = {}) {
|
|
|
110
113
|
export function runPermissionModeSwitchLine(outcome, lang) {
|
|
111
114
|
switch (outcome.kind) {
|
|
112
115
|
case 'switched': {
|
|
113
|
-
const
|
|
116
|
+
const effective = outcome.permissionMode.effective;
|
|
117
|
+
const mode = permissionModeTitle(effective) ?? displayUntrusted(effective, { max: 64 });
|
|
114
118
|
const reason = outcome.admission !== undefined
|
|
115
119
|
? msg(outcome.admission.foldedBy === 'entry_floor' ? 'session.permissionModeSwitch.reason.entryFloor' : 'session.permissionModeSwitch.reason.disableAutoMode')
|
|
116
120
|
: outcome.permissionMode.foldedBy !== undefined
|
|
@@ -129,7 +133,13 @@ export function runPermissionModeSwitchLine(outcome, lang) {
|
|
|
129
133
|
: renderMessage(msg('session.permissionModeSwitch.refused', { status: String(outcome.status) }), lang);
|
|
130
134
|
case 'unconfirmed':
|
|
131
135
|
return renderMessage(msg('session.permissionModeSwitch.unconfirmed'), lang);
|
|
132
|
-
case 'unavailable':
|
|
133
|
-
|
|
136
|
+
case 'unavailable': {
|
|
137
|
+
const code = readOwnDataValue(outcome, 'code');
|
|
138
|
+
return renderMessage(msg(code === RUN_STORE_REQUIRED_CODE
|
|
139
|
+
? 'session.permissionModeSwitch.unavailableRunStore'
|
|
140
|
+
: code === CHECKPOINT_STORE_REQUIRED_CODE
|
|
141
|
+
? 'session.permissionModeSwitch.unavailableCheckpointStore'
|
|
142
|
+
: 'session.permissionModeSwitch.unavailable'), lang);
|
|
143
|
+
}
|
|
134
144
|
}
|
|
135
145
|
}
|
package/dist/seatContract.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ 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
17
|
import type { SessionRowPatchFields, SessionRowUnreadable } from "./sessionRowTag.js";
|
|
18
|
-
import { type SessionEngineView } from "./sessionEngine.js";
|
|
18
|
+
import { type SessionEngineKind, type SessionEngineView } from "./sessionEngine.js";
|
|
19
19
|
export interface SeatValidationFailure {
|
|
20
20
|
reason: string;
|
|
21
21
|
field?: string;
|
|
@@ -201,7 +201,7 @@ export type SeatStreamReading = {
|
|
|
201
201
|
};
|
|
202
202
|
export declare function seatStreamDeltaMessage(event: SeatStreamDeltaSource, ids: SeatStreamDeltaIds): SeatStreamEventMessage | undefined;
|
|
203
203
|
export declare function readSeatStreamDelta(message: object): SeatStreamReading;
|
|
204
|
-
export declare const SEAT_CAPABILITY_NAMES: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles", "thinkingLatch", "computerUseSwitch", "engineModeDefaultOnly"];
|
|
204
|
+
export declare const SEAT_CAPABILITY_NAMES: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles", "thinkingLatch", "computerUseSwitch", "engineModeDefaultOnly", "seatActions"];
|
|
205
205
|
export type SeatCapabilityName = (typeof SEAT_CAPABILITY_NAMES)[number];
|
|
206
206
|
export interface SeatCapabilitiesState {
|
|
207
207
|
pickFolder?: boolean;
|
|
@@ -215,6 +215,7 @@ export interface SeatCapabilitiesState {
|
|
|
215
215
|
thinkingLatch?: boolean;
|
|
216
216
|
computerUseSwitch?: boolean;
|
|
217
217
|
engineModeDefaultOnly?: boolean;
|
|
218
|
+
seatActions?: boolean;
|
|
218
219
|
}
|
|
219
220
|
export type SeatCapabilityReading = {
|
|
220
221
|
readonly kind: "reported";
|
|
@@ -254,6 +255,7 @@ export interface StartSessionOptions {
|
|
|
254
255
|
title?: string;
|
|
255
256
|
cwd?: string;
|
|
256
257
|
excludeTools?: string[];
|
|
258
|
+
engine?: SessionEngineKind;
|
|
257
259
|
}
|
|
258
260
|
export type PermissionModeIntent = PermissionMode;
|
|
259
261
|
export declare const PERMISSION_MODE_INTENTS: readonly PermissionModeIntent[];
|
|
@@ -312,6 +314,9 @@ export declare const ATTACHMENT_UPLOAD_REQUEST_KEYS: readonly ["name", "mimeType
|
|
|
312
314
|
export interface SessionScopedRequest {
|
|
313
315
|
sessionId: string;
|
|
314
316
|
}
|
|
317
|
+
export interface SeatResourceScope {
|
|
318
|
+
sessionId: string;
|
|
319
|
+
}
|
|
315
320
|
export interface SessionRowPatchRequest extends SessionRowPatchFields {
|
|
316
321
|
sessionId: string;
|
|
317
322
|
}
|
|
@@ -399,7 +404,7 @@ export interface SeatDeviceRevokeRequest {
|
|
|
399
404
|
}
|
|
400
405
|
export declare const checkSeatDeviceRebindRequest: (v: unknown) => SeatValidation;
|
|
401
406
|
export declare const checkSeatDeviceRevokeRequest: (v: unknown) => SeatValidation;
|
|
402
|
-
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"];
|
|
407
|
+
export declare const ENGINE_TARGET_REFUSALS: readonly ["busy", "switching", "not_configured", "not_signed_in", "probe_failed", "cloud_unreachable", "org_policy", "url_refused", "login_failed", "storage_unavailable", "no_local_runtime", "input"];
|
|
403
408
|
export type EngineTargetRefusal = (typeof ENGINE_TARGET_REFUSALS)[number];
|
|
404
409
|
export declare const CLOUD_LOGIN_FAILURES: readonly ["access_denied", "expired_token", "invalid_grant", "cancelled", "transport", "refused", "no_tokens", "other"];
|
|
405
410
|
export type CloudLoginFailure = (typeof CLOUD_LOGIN_FAILURES)[number];
|
|
@@ -646,6 +651,32 @@ export type SetComputerUsePlan = {
|
|
|
646
651
|
readonly reason: Exclude<ComputerUseRefusalReason, "write-failed">;
|
|
647
652
|
};
|
|
648
653
|
export declare function planSetComputerUse(request: {} | null | undefined, lockedByEnv: boolean): SetComputerUsePlan;
|
|
654
|
+
export declare const SEAT_ACTION_NAMES: readonly ["new-project", "prefill-composer"];
|
|
655
|
+
export type SeatActionName = (typeof SEAT_ACTION_NAMES)[number];
|
|
656
|
+
export type SeatAction = {
|
|
657
|
+
readonly action: "new-project";
|
|
658
|
+
} | {
|
|
659
|
+
readonly action: "prefill-composer";
|
|
660
|
+
readonly text: string;
|
|
661
|
+
readonly cwd?: string;
|
|
662
|
+
};
|
|
663
|
+
export interface SeatActionsClaim {
|
|
664
|
+
readonly actions: readonly string[];
|
|
665
|
+
}
|
|
666
|
+
export declare const checkSeatAction: (v: unknown) => SeatValidation;
|
|
667
|
+
export type SeatActionReading = {
|
|
668
|
+
readonly kind: "action";
|
|
669
|
+
readonly action: SeatAction;
|
|
670
|
+
} | {
|
|
671
|
+
readonly kind: "unknown";
|
|
672
|
+
readonly name: string;
|
|
673
|
+
} | {
|
|
674
|
+
readonly kind: "malformed";
|
|
675
|
+
readonly reason: string;
|
|
676
|
+
};
|
|
677
|
+
export declare function readSeatAction(ev: unknown): SeatActionReading;
|
|
678
|
+
export declare const checkSeatActionsClaim: (v: unknown) => SeatValidation;
|
|
679
|
+
export declare function claimedSeatActionsOf(claim: unknown): readonly SeatActionName[];
|
|
649
680
|
export interface LocalSessionsApi {
|
|
650
681
|
start(opts?: StartSessionOptions): Promise<LocalSessionRecord>;
|
|
651
682
|
sendMessage(req: SendMessageRequest): Promise<SendMessageAck>;
|
|
@@ -659,8 +690,8 @@ export interface LocalSessionsApi {
|
|
|
659
690
|
setModel(sessionId: string, model: string): Promise<boolean>;
|
|
660
691
|
getTranscript(sessionId: string): Promise<GetTranscriptResult>;
|
|
661
692
|
searchSessions(query: string): Promise<SessionSearchEnvelope>;
|
|
662
|
-
uploadAttachment(req: AttachmentUploadRequest): Promise<AttachmentUploadReceipt>;
|
|
663
|
-
listModels(): Promise<LiveModelCatalog>;
|
|
693
|
+
uploadAttachment(req: AttachmentUploadRequest, scope?: SeatResourceScope): Promise<AttachmentUploadReceipt>;
|
|
694
|
+
listModels(scope?: SeatResourceScope): Promise<LiveModelCatalog>;
|
|
664
695
|
applyModelConfig(req: ApplyModelConfigRequest): Promise<ApplyModelConfigResult>;
|
|
665
696
|
pickFolder(): Promise<string | null>;
|
|
666
697
|
listRecentFolders(): Promise<RecentFoldersResult>;
|
|
@@ -686,8 +717,10 @@ export interface LocalSessionsApi {
|
|
|
686
717
|
setThinkingLatch(req: SetThinkingLatchRequest): Promise<OkAck>;
|
|
687
718
|
getComputerUse(): Promise<ComputerUseState>;
|
|
688
719
|
setComputerUse(req: SetComputerUseRequest): Promise<SetComputerUseResult>;
|
|
720
|
+
claimSeatActions(req: SeatActionsClaim): Promise<OkAck>;
|
|
689
721
|
onEvent(cb: (ev: LocalSessionEvent) => void): () => void;
|
|
690
722
|
onToolPermissionRequest(cb: (req: ToolPermissionRequest) => void): () => void;
|
|
723
|
+
onSeatAction(cb: (action: SeatAction) => void): () => void;
|
|
691
724
|
sessionsStateStore: EipcStoreClient<SessionsState>;
|
|
692
725
|
focusedSessionStateStore: EipcStoreClient<FocusedSessionState>;
|
|
693
726
|
settingsStateStore: EipcStoreClient<SettingsState>;
|
|
@@ -729,11 +762,13 @@ export declare const checkSessionRowPatchRequest: (v: unknown) => SeatValidation
|
|
|
729
762
|
export declare function isSessionRowPatchRequest(v: unknown): v is SessionRowPatchRequest;
|
|
730
763
|
export declare const checkSetThinkingLatchRequest: (v: unknown) => SeatValidation;
|
|
731
764
|
export declare function isSetThinkingLatchRequest(v: unknown): v is SetThinkingLatchRequest;
|
|
765
|
+
export declare const checkStartSessionOptions: (v: unknown) => SeatValidation;
|
|
766
|
+
export declare const checkSeatResourceScope: (v: unknown) => SeatValidation;
|
|
732
767
|
export declare function isSendMessageAck(v: unknown): v is SendMessageAck;
|
|
733
768
|
export declare const LOCAL_SESSIONS_SPEC: EipcServiceSpec;
|
|
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"];
|
|
769
|
+
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", "claimSeatActions", "onEvent", "onToolPermissionRequest", "onSeatAction"];
|
|
735
770
|
export declare const SEAT_STORE_PROPS: readonly ["sessionsStateStore", "focusedSessionStateStore", "settingsStateStore", "seatCapabilitiesStateStore", "engineTargetStateStore"];
|
|
736
|
-
export declare const SEAT_EVENT_METHOD_NAMES: readonly ["onEvent", "onToolPermissionRequest"];
|
|
771
|
+
export declare const SEAT_EVENT_METHOD_NAMES: readonly ["onEvent", "onToolPermissionRequest", "onSeatAction"];
|
|
737
772
|
export declare const LOCAL_SESSION_EVENT_KEYS: readonly ["type", "sessionId", "message", "error", "errorCategory", "code", "session", "userMessageUuid", "requestId", "outcome", "parked", "chrome", "_sema_turnFailure", "subagentContent"];
|
|
738
773
|
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"];
|
|
739
774
|
export declare const LOCAL_SESSION_RECORD_KEYS: readonly ["sessionId", "engineSessionId", "model", "title", "cwd", "isRunning", "createdAt", "lastActivityAt", "queuedMessages", "parked", "pinned", "rowTag", "unreadable", "thinkingLatch", "engine", "executionLane"];
|
|
@@ -781,7 +816,7 @@ export declare const SEAT_SEND_MESSAGE_KEY_ORIGINS: {
|
|
|
781
816
|
};
|
|
782
817
|
};
|
|
783
818
|
export declare const TOOL_PERMISSION_DECISION_KEYS: readonly ["sessionId", "requestId", "decision", "answer", "updatedInput", "remember"];
|
|
784
|
-
export declare const START_SESSION_OPTION_KEYS: readonly ["model", "title", "cwd", "excludeTools"];
|
|
819
|
+
export declare const START_SESSION_OPTION_KEYS: readonly ["model", "title", "cwd", "excludeTools", "engine"];
|
|
785
820
|
export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
786
821
|
readonly LocalSessionRecord: {
|
|
787
822
|
readonly guard: "isLocalSessionRecord";
|
|
@@ -855,6 +890,9 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
855
890
|
}, {
|
|
856
891
|
readonly key: "modelPlane";
|
|
857
892
|
readonly why: "诊断面(0.106.0 CC-1156;这台引擎服务的是哪张模型表 / 最近一份目录候选的结局),三态读法归 modelPlaneOf(含坏形 unreadable、表外词整位不给);出站门为它拒掉整份目录 = 选单为一行诊断整个消失。";
|
|
893
|
+
}, {
|
|
894
|
+
readonly key: "aliases";
|
|
895
|
+
readonly why: "受理面(0.108.0 CC-944;除行名之外引擎还认的模型词),读法归 modelAcceptanceOf(缺席 = 更早的服务端,照旧判;在场而坏形 ⇒ 没找到行的词读 catalog_unreadable);出站门为它拒掉整份目录 = 选单为一份受理数据整个消失。";
|
|
858
896
|
}];
|
|
859
897
|
};
|
|
860
898
|
readonly SendMessageRequest: {
|
|
@@ -875,6 +913,21 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
875
913
|
readonly validated: readonly ["sessionId", "event"];
|
|
876
914
|
readonly unchecked: readonly [];
|
|
877
915
|
};
|
|
916
|
+
readonly StartSessionOptions: {
|
|
917
|
+
readonly check: (v: unknown) => SeatValidation;
|
|
918
|
+
readonly validated: readonly ["model", "title", "cwd", "excludeTools", "engine"];
|
|
919
|
+
readonly unchecked: readonly [];
|
|
920
|
+
};
|
|
921
|
+
readonly SeatResourceScope: {
|
|
922
|
+
readonly check: (v: unknown) => SeatValidation;
|
|
923
|
+
readonly validated: readonly ["sessionId"];
|
|
924
|
+
readonly unchecked: readonly [];
|
|
925
|
+
};
|
|
926
|
+
readonly SeatActionsClaim: {
|
|
927
|
+
readonly check: (v: unknown) => SeatValidation;
|
|
928
|
+
readonly validated: readonly ["actions"];
|
|
929
|
+
readonly unchecked: readonly [];
|
|
930
|
+
};
|
|
878
931
|
readonly ApplyModelConfigResult: {
|
|
879
932
|
readonly check: (v: unknown) => SeatValidation;
|
|
880
933
|
readonly validated: readonly ["ok", "requiresRestart", "reason", "detail"];
|
|
@@ -928,7 +981,7 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
928
981
|
};
|
|
929
982
|
readonly SeatCapabilitiesState: {
|
|
930
983
|
readonly check: (v: unknown) => SeatValidation;
|
|
931
|
-
readonly validated: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles", "thinkingLatch", "computerUseSwitch", "engineModeDefaultOnly"];
|
|
984
|
+
readonly validated: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles", "thinkingLatch", "computerUseSwitch", "engineModeDefaultOnly", "seatActions"];
|
|
932
985
|
readonly unchecked: readonly [];
|
|
933
986
|
};
|
|
934
987
|
readonly RecentFoldersResult: {
|
|
@@ -968,7 +1021,7 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
968
1021
|
};
|
|
969
1022
|
};
|
|
970
1023
|
export declare const SEAT_VALIDATOR_COVERAGE_EXEMPT: readonly [...{
|
|
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";
|
|
1024
|
+
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" | "SeatAction";
|
|
972
1025
|
check: (v: unknown) => SeatValidation;
|
|
973
1026
|
why: string;
|
|
974
1027
|
}[], {
|