@sema-agent/client-core 0.110.0 → 0.111.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 +169 -0
- package/README.md +50 -18
- package/dist/abortableSleep.d.ts +7 -0
- package/dist/abortableSleep.js +37 -0
- package/dist/adapt/arms.js +25 -4
- package/dist/adapt/toolCards.d.ts +3 -1
- package/dist/adapt/toolCards.js +4 -2
- package/dist/adapter/activeRunSelfHeal.d.ts +39 -0
- package/dist/adapter/activeRunSelfHeal.js +171 -3
- package/dist/adapter/downstream/eventToSdkMessage.js +10 -10
- package/dist/adapter/downstream/terminalToSdkResult.d.ts +2 -0
- package/dist/adapter/downstream/terminalToSdkResult.js +11 -0
- package/dist/adapter/runStream.d.ts +5 -0
- package/dist/adapter/runStream.js +15 -3
- package/dist/attachmentRoute.d.ts +20 -0
- package/dist/attachmentRoute.js +39 -0
- package/dist/attachmentsWireCaps.js +1 -1
- package/dist/builtinOutputStyles.d.ts +12 -0
- package/dist/builtinOutputStyles.js +147 -0
- package/dist/compactionStatus.d.ts +9 -0
- package/dist/compactionStatus.js +29 -5
- package/dist/controlRouter.js +2 -1
- package/dist/coreValuePorts.d.ts +39 -1
- package/dist/coreValuePorts.js +10 -0
- package/dist/displayUntrusted.d.ts +1 -0
- package/dist/displayUntrusted.js +6 -0
- package/dist/engineHealthFacts.d.ts +11 -0
- package/dist/engineHealthFacts.js +21 -0
- package/dist/engineHealthProbeVerdict.d.ts +23 -0
- package/dist/engineHealthProbeVerdict.js +115 -0
- package/dist/engineNoticeCodes.js +5 -7
- package/dist/engineRepoint.d.ts +12 -5
- package/dist/engineRepoint.js +44 -19
- package/dist/engineRowRef.d.ts +3 -0
- package/dist/engineRowRef.js +11 -1
- package/dist/engineSwapCrossing.d.ts +57 -0
- package/dist/engineSwapCrossing.js +297 -0
- package/dist/engineUnavailable.d.ts +44 -0
- package/dist/engineUnavailable.js +492 -0
- package/dist/eventLeg.js +3 -3
- package/dist/generated/sdkFactTables.d.ts +1 -1
- package/dist/generated/sdkFactTables.js +1 -0
- package/dist/generated/settingsSchemaTables.d.ts +4 -0
- package/dist/generated/settingsSchemaTables.js +1 -0
- package/dist/hitl/approvalDelivery.d.ts +1 -0
- package/dist/hitl/approvalDelivery.js +1 -1
- package/dist/hitl/approvalResolution.d.ts +1 -1
- package/dist/hitl/approvalResolution.js +2 -1
- package/dist/hitl/askGateWire.js +5 -6
- package/dist/hitl/decisionRefusal.d.ts +2 -0
- package/dist/hitl/decisionRefusal.js +7 -8
- package/dist/hitl/decisionRefusalCarrier.d.ts +3 -0
- package/dist/hitl/decisionRefusalCarrier.js +348 -0
- package/dist/hitl/decisionSend.d.ts +7 -0
- package/dist/hitl/decisionSend.js +34 -12
- package/dist/hitl/editedApprovalAcceptance.js +1 -1
- package/dist/hitl/elicitationRefusal.d.ts +4 -0
- package/dist/hitl/elicitationRefusal.js +23 -0
- package/dist/hitl/frameRouter.d.ts +2 -2
- package/dist/hitl/frameRouter.js +8 -15
- package/dist/hitl/gateIdentity.d.ts +5 -0
- package/dist/hitl/gateIdentity.js +23 -0
- package/dist/hitl/hitlBridge.d.ts +6 -0
- package/dist/hitl/hitlBridge.js +10 -4
- package/dist/hitl/hitlHostSurface.d.ts +2 -1
- package/dist/hitl/hitlHostSurface.js +7 -2
- package/dist/hitl/localAllowRedemption.d.ts +67 -0
- package/dist/hitl/localAllowRedemption.js +256 -0
- package/dist/hitl/parkResolver.js +7 -4
- package/dist/hitl/persistedRulesWire.d.ts +16 -0
- package/dist/hitl/persistedRulesWire.js +70 -0
- package/dist/hitl/planReviewWire.d.ts +3 -0
- package/dist/hitl/planReviewWire.js +23 -6
- package/dist/hitl/policyDenyCause.d.ts +1 -1
- package/dist/hitl/policyDenyCause.js +1 -1
- package/dist/hitl/resumeRunningCard.d.ts +1 -0
- package/dist/hitl/resumeRunningCard.js +1 -0
- package/dist/hitl/screenCardCarriers.d.ts +15 -0
- package/dist/hitl/screenCardCarriers.js +41 -0
- package/dist/hitl/screenDecisionCards.d.ts +98 -0
- package/dist/hitl/screenDecisionCards.js +362 -0
- package/dist/hitl/standingRows.d.ts +3 -1
- package/dist/hitl/standingRows.js +18 -0
- package/dist/hitl/toolApprovalWire.d.ts +30 -8
- package/dist/hitl/toolApprovalWire.js +264 -121
- package/dist/hooksWireCaps.js +3 -3
- package/dist/hostSettingNoticeArm.d.ts +3 -0
- package/dist/hostSettingNoticeArm.js +12 -0
- package/dist/hostTurnSettings.d.ts +3 -0
- package/dist/hostTurnSettings.js +38 -5
- package/dist/humanTurnRead.js +11 -1
- package/dist/i18n/messages.en.d.ts +129 -0
- package/dist/i18n/messages.en.js +135 -7
- package/dist/i18n/messages.zh.js +142 -6
- package/dist/i18n/translate.d.ts +3 -0
- package/dist/i18n/translate.js +78 -10
- package/dist/i18n/zh.d.ts +1 -0
- package/dist/i18n/zh.js +1 -0
- package/dist/index.d.ts +43 -17
- package/dist/index.js +30 -12
- package/dist/interactiveHalt.js +2 -1
- package/dist/interactiveInterrupt.js +20 -2
- package/dist/liveModelCatalog.js +2 -2
- package/dist/localEngineSeatReading.d.ts +2 -2
- package/dist/localEngineSeatReading.js +5 -3
- package/dist/localEngineSpawn.d.ts +0 -7
- package/dist/localEngineSpawn.js +0 -92
- package/dist/localEngineStep.d.ts +2 -2
- package/dist/localEngineStep.js +2 -0
- package/dist/mcpReconnect.js +3 -3
- package/dist/mcpWireCaps.js +1 -1
- package/dist/model/engineModelWords.d.ts +3 -0
- package/dist/model/engineModelWords.js +13 -0
- package/dist/model/subagentModelWord.d.ts +21 -2
- package/dist/model/subagentModelWord.js +100 -29
- package/dist/modelCapabilityProbe.js +3 -40
- package/dist/notifications.d.ts +19 -0
- package/dist/notifications.js +114 -12
- package/dist/ownKey.d.ts +6 -0
- package/dist/ownKey.js +31 -0
- package/dist/pendingUserRow.d.ts +4 -0
- package/dist/pendingUserRow.js +16 -0
- package/dist/permissionsDeclaration.d.ts +1 -0
- package/dist/permissionsDeclaration.js +11 -1
- package/dist/planReviewCardFacts.d.ts +3 -0
- package/dist/planReviewCardFacts.js +52 -2
- package/dist/pluginHooksWire.d.ts +9 -1
- package/dist/pluginHooksWire.js +40 -6
- package/dist/printToolResultFrame.js +4 -2
- package/dist/promptBlockedCopy.js +11 -6
- package/dist/promptSuggestionBatch.d.ts +7 -0
- package/dist/promptSuggestionBatch.js +9 -0
- package/dist/promptSuggestionsTail.d.ts +39 -0
- package/dist/promptSuggestionsTail.js +116 -0
- package/dist/request/taskRequest.js +10 -6
- package/dist/requestCoordinate.d.ts +1 -0
- package/dist/requestCoordinate.js +13 -0
- package/dist/rewindArchiveReading.js +4 -4
- package/dist/runCancelContext.d.ts +2 -1
- package/dist/runCancelContext.js +1 -0
- package/dist/runPermissionModeSwitch.js +2 -2
- package/dist/scenarioRefusal.js +11 -13
- package/dist/scenarioSkills.js +11 -6
- package/dist/seam.d.ts +16 -2
- package/dist/seam.js +10 -0
- package/dist/seatContract.d.ts +109 -9
- package/dist/seatContract.js +218 -15
- package/dist/sessionCostReading.d.ts +70 -0
- package/dist/sessionCostReading.js +150 -0
- package/dist/sessionHooksRoster.d.ts +4 -0
- package/dist/sessionHooksRoster.js +158 -0
- package/dist/sessionMemoryStatus.js +2 -2
- package/dist/sessionReadRedaction.d.ts +7 -0
- package/dist/sessionReadRedaction.js +26 -0
- package/dist/sessionSyncFileHistory.js +8 -9
- package/dist/settingsHooksSalvage.js +2 -1
- package/dist/sseIdleTriage.js +2 -1
- package/dist/storeDurabilityWord.d.ts +15 -0
- package/dist/storeDurabilityWord.js +18 -0
- package/dist/storePostureCapability.d.ts +7 -3
- package/dist/storePostureCapability.js +69 -39
- package/dist/subagent/engineSubagentResume.js +2 -2
- package/dist/subagent/engineSubagentTail.js +2 -1
- package/dist/subagentContentStore.d.ts +11 -0
- package/dist/subagentContentStore.js +28 -2
- package/dist/toolResult.d.ts +1 -0
- package/dist/toolResult.js +2 -0
- package/dist/userAttachmentEnvelope.d.ts +2 -1
- package/dist/userAttachmentEnvelope.js +10 -0
- package/dist/wireErrorTriage.js +2 -1
- package/dist/wireFailureShape.d.ts +4 -0
- package/dist/wireFailureShape.js +141 -19
- package/dist/wireRefusalCopy.d.ts +6 -5
- package/dist/wireRefusalCopy.js +49 -92
- package/docs/INTEGRATION-CLIENTS.md +2118 -17
- package/package.json +6 -2
package/dist/seatContract.d.ts
CHANGED
|
@@ -22,6 +22,11 @@ import { type SessionEngineKind, type SessionEngineView } from "./sessionEngine.
|
|
|
22
22
|
import type { ParkedUnresumableRow } from "./hitl/parkedUnresumable.js";
|
|
23
23
|
import { type EngineSwapCard } from "./localEngineSwapCard.js";
|
|
24
24
|
import type { ToolPermissionSettledElsewhere } from "./hitl/approvalResolution.js";
|
|
25
|
+
import { type HookEntryTypeWord, type HookSettingsSource, type HooksWirePlan, type PluginHookExclusionReason, type PluginHookReason, type SettingsHookDropReason } from "./pluginHooksWire.js";
|
|
26
|
+
import { type HttpPolicyDropReason } from "./httpHookPolicy.js";
|
|
27
|
+
import { type HooksSalvageDropCode, type HooksSalvageRejectionCode } from "./settingsHooksSalvage.js";
|
|
28
|
+
import { SETTINGS_HOOK_EVENTS } from "./generated/settingsSchemaFns.js";
|
|
29
|
+
import type { ToolPermissionUnconfirmed, ToolPermissionUnconfirmedCause } from "./hitl/decisionSend.js";
|
|
25
30
|
export interface SeatValidationFailure {
|
|
26
31
|
reason: string;
|
|
27
32
|
field?: string;
|
|
@@ -121,6 +126,8 @@ declare const CHROME_ARM_SEAT_ROUTE: {
|
|
|
121
126
|
readonly engine_notice: "seat";
|
|
122
127
|
readonly subagent_alias: "seat";
|
|
123
128
|
readonly session_box_notice: "seat";
|
|
129
|
+
readonly resupply_truncated: "seat";
|
|
130
|
+
readonly host_setting_notice: "seat";
|
|
124
131
|
readonly workflow_notification_enqueue: "host";
|
|
125
132
|
readonly plan_review_park: "host";
|
|
126
133
|
readonly approval_request: "host";
|
|
@@ -216,7 +223,7 @@ export type SeatStreamReading = {
|
|
|
216
223
|
};
|
|
217
224
|
export declare function seatStreamDeltaMessage(event: SeatStreamDeltaSource, ids: SeatStreamDeltaIds): SeatStreamEventMessage | undefined;
|
|
218
225
|
export declare function readSeatStreamDelta(message: object): SeatStreamReading;
|
|
219
|
-
export declare const SEAT_CAPABILITY_NAMES: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles", "thinkingLatch", "computerUseSwitch", "engineModeDefaultOnly", "seatActions", "notificationLevels", "modsView"];
|
|
226
|
+
export declare const SEAT_CAPABILITY_NAMES: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles", "thinkingLatch", "computerUseSwitch", "engineModeDefaultOnly", "seatActions", "notificationLevels", "modsView", "quickEntryShortcut", "hooksRoster"];
|
|
220
227
|
export type SeatCapabilityName = (typeof SEAT_CAPABILITY_NAMES)[number];
|
|
221
228
|
export interface SeatCapabilitiesState {
|
|
222
229
|
pickFolder?: boolean;
|
|
@@ -233,6 +240,8 @@ export interface SeatCapabilitiesState {
|
|
|
233
240
|
seatActions?: boolean;
|
|
234
241
|
notificationLevels?: boolean;
|
|
235
242
|
modsView?: boolean;
|
|
243
|
+
quickEntryShortcut?: boolean;
|
|
244
|
+
hooksRoster?: boolean;
|
|
236
245
|
}
|
|
237
246
|
export type SeatCapabilityReading = {
|
|
238
247
|
readonly kind: "reported";
|
|
@@ -400,9 +409,29 @@ export interface StopAck {
|
|
|
400
409
|
export interface OkAck {
|
|
401
410
|
ok: boolean;
|
|
402
411
|
}
|
|
403
|
-
export
|
|
412
|
+
export type ToolPermissionAck = ToolPermissionAckSettled | ToolPermissionAckUnconfirmed;
|
|
413
|
+
export interface ToolPermissionAckSettled extends OkAck {
|
|
404
414
|
settledElsewhere?: ToolPermissionSettledElsewhere;
|
|
415
|
+
unconfirmed?: never;
|
|
405
416
|
}
|
|
417
|
+
export interface ToolPermissionAckUnconfirmed extends OkAck {
|
|
418
|
+
ok: false;
|
|
419
|
+
unconfirmed: ToolPermissionUnconfirmed;
|
|
420
|
+
settledElsewhere?: never;
|
|
421
|
+
}
|
|
422
|
+
export type ToolPermissionAckState = {
|
|
423
|
+
readonly kind: "applied";
|
|
424
|
+
} | {
|
|
425
|
+
readonly kind: "not_applied";
|
|
426
|
+
} | {
|
|
427
|
+
readonly kind: "unconfirmed";
|
|
428
|
+
readonly cause: ToolPermissionUnconfirmedCause;
|
|
429
|
+
};
|
|
430
|
+
export interface DecisionRefusalCarrier {
|
|
431
|
+
readonly [key: string]: DecisionRefusalCarrierValue;
|
|
432
|
+
}
|
|
433
|
+
export type DecisionRefusalCarrierValue = string | number | boolean | null | undefined | readonly DecisionRefusalCarrierValue[] | DecisionRefusalCarrier;
|
|
434
|
+
export type ToolPermissionRefusal = DecisionRefusalCarrier;
|
|
406
435
|
export interface SessionsState {
|
|
407
436
|
sessions: LocalSessionRecord[];
|
|
408
437
|
}
|
|
@@ -502,7 +531,7 @@ export type SeatLocalMcpReading = {
|
|
|
502
531
|
readAt: string;
|
|
503
532
|
restartRequired?: true;
|
|
504
533
|
};
|
|
505
|
-
export declare const LOCAL_ENGINE_DOWN_REASONS: readonly ["lock-unavailable", "spawn-failed", "spawn-refused", "stop-failed", "crash-loop", "high-water-unreadable", "principal-unknown"];
|
|
534
|
+
export declare const LOCAL_ENGINE_DOWN_REASONS: readonly ["lock-unavailable", "spawn-failed", "spawn-refused", "stop-failed", "crash-loop", "high-water-unreadable", "exited-once", "principal-unknown"];
|
|
506
535
|
export type LocalEngineDownReason = (typeof LOCAL_ENGINE_DOWN_REASONS)[number];
|
|
507
536
|
export declare const LOCAL_ENGINE_WAITING_REASONS: readonly ["starting", "dormant", "draining", "unanswered", "peer"];
|
|
508
537
|
export type LocalEngineWaitingReason = (typeof LOCAL_ENGINE_WAITING_REASONS)[number];
|
|
@@ -541,7 +570,7 @@ export interface EngineTargetState {
|
|
|
541
570
|
mode: "local" | "cloud";
|
|
542
571
|
generation: number;
|
|
543
572
|
cloud: EngineTargetCloud;
|
|
544
|
-
local
|
|
573
|
+
local?: EngineTargetLocal;
|
|
545
574
|
}
|
|
546
575
|
export interface EngineTargetRefused {
|
|
547
576
|
ok: false;
|
|
@@ -669,6 +698,43 @@ export declare const checkOnboardApplyRequest: (v: unknown) => SeatValidation;
|
|
|
669
698
|
export interface SessionModsView {
|
|
670
699
|
readonly rows: readonly WiringManifestModView[];
|
|
671
700
|
}
|
|
701
|
+
export declare const SESSION_HOOKS_ROSTER_STATUSES: readonly ["engine", "shell", "not_run"];
|
|
702
|
+
export type SessionHooksRosterStatus = (typeof SESSION_HOOKS_ROSTER_STATUSES)[number];
|
|
703
|
+
export type SessionHooksRosterEvent = (typeof SETTINGS_HOOK_EVENTS)[number];
|
|
704
|
+
export interface SessionHooksRosterRow {
|
|
705
|
+
readonly source: HookSettingsSource;
|
|
706
|
+
readonly event: SessionHooksRosterEvent;
|
|
707
|
+
readonly groupIndex: number;
|
|
708
|
+
readonly hookIndex: number;
|
|
709
|
+
readonly type?: HookEntryTypeWord;
|
|
710
|
+
readonly status: SessionHooksRosterStatus;
|
|
711
|
+
readonly reason: PluginHookReason | PluginHookExclusionReason | SettingsHookDropReason;
|
|
712
|
+
}
|
|
713
|
+
export type SessionHooksRosterLayer = {
|
|
714
|
+
readonly source: HookSettingsSource;
|
|
715
|
+
readonly state: "loaded-partial";
|
|
716
|
+
readonly codes: readonly HooksSalvageDropCode[];
|
|
717
|
+
} | {
|
|
718
|
+
readonly source: HookSettingsSource;
|
|
719
|
+
readonly state: "rejected";
|
|
720
|
+
readonly codes: readonly HooksSalvageRejectionCode[];
|
|
721
|
+
} | {
|
|
722
|
+
readonly source: HookSettingsSource;
|
|
723
|
+
readonly state: "trust_withheld";
|
|
724
|
+
};
|
|
725
|
+
export interface SessionHooksRosterHttpRow {
|
|
726
|
+
readonly source: HookSettingsSource;
|
|
727
|
+
readonly event: SessionHooksRosterEvent;
|
|
728
|
+
readonly reason: HttpPolicyDropReason;
|
|
729
|
+
}
|
|
730
|
+
export interface SessionHooksRoster {
|
|
731
|
+
readonly closedBy: HooksWirePlan["closedBy"];
|
|
732
|
+
readonly sources?: readonly HookSettingsSource[];
|
|
733
|
+
readonly rows: readonly SessionHooksRosterRow[];
|
|
734
|
+
readonly layers: readonly SessionHooksRosterLayer[];
|
|
735
|
+
readonly http: readonly SessionHooksRosterHttpRow[];
|
|
736
|
+
readonly unlisted: number;
|
|
737
|
+
}
|
|
672
738
|
export declare const checkMcpToolToggleKey: (v: unknown) => SeatValidation;
|
|
673
739
|
export interface McpToolTogglesResult {
|
|
674
740
|
off: McpToolToggleKey[];
|
|
@@ -736,7 +802,35 @@ export type SetNotificationLevelPlan = {
|
|
|
736
802
|
readonly reason: Exclude<NotificationLevelRefusalReason, "write-failed">;
|
|
737
803
|
};
|
|
738
804
|
export declare function planSetNotificationLevel(type: {} | null | undefined, level: {} | null | undefined, supported: readonly NotificationLevel[]): SetNotificationLevelPlan;
|
|
739
|
-
export declare const
|
|
805
|
+
export declare const QUICK_ENTRY_SHORTCUT_FAILURES: readonly ["invalid-accelerator", "registration-failed"];
|
|
806
|
+
export type QuickEntryShortcutFailure = (typeof QUICK_ENTRY_SHORTCUT_FAILURES)[number];
|
|
807
|
+
export declare const QUICK_ENTRY_SHORTCUT_REFUSAL_REASONS: readonly ["invalid-request", "invalid-accelerator", "registration-failed", "write-failed"];
|
|
808
|
+
export type QuickEntryShortcutRefusalReason = (typeof QUICK_ENTRY_SHORTCUT_REFUSAL_REASONS)[number];
|
|
809
|
+
export type QuickEntryShortcut = "off" | {
|
|
810
|
+
readonly accelerator: string;
|
|
811
|
+
};
|
|
812
|
+
export interface QuickEntryShortcutState {
|
|
813
|
+
saved: QuickEntryShortcut;
|
|
814
|
+
active: string | null;
|
|
815
|
+
savedFailure: QuickEntryShortcutFailure | null;
|
|
816
|
+
}
|
|
817
|
+
export type SetQuickEntryShortcutResult = {
|
|
818
|
+
ok: true;
|
|
819
|
+
state: QuickEntryShortcutState;
|
|
820
|
+
} | {
|
|
821
|
+
ok: false;
|
|
822
|
+
reason: QuickEntryShortcutRefusalReason;
|
|
823
|
+
state: QuickEntryShortcutState;
|
|
824
|
+
};
|
|
825
|
+
export type SetQuickEntryShortcutPlan = {
|
|
826
|
+
readonly kind: "apply";
|
|
827
|
+
readonly next: QuickEntryShortcut;
|
|
828
|
+
} | {
|
|
829
|
+
readonly kind: "refused";
|
|
830
|
+
readonly reason: "invalid-request";
|
|
831
|
+
};
|
|
832
|
+
export declare function planSetQuickEntryShortcut(request: {} | null | undefined): SetQuickEntryShortcutPlan;
|
|
833
|
+
export declare const SEAT_ACTION_NAMES: readonly ["new-project", "prefill-composer", "open-local-setup"];
|
|
740
834
|
export type SeatActionName = (typeof SEAT_ACTION_NAMES)[number];
|
|
741
835
|
export type SeatAction = {
|
|
742
836
|
readonly action: "new-project";
|
|
@@ -744,6 +838,8 @@ export type SeatAction = {
|
|
|
744
838
|
readonly action: "prefill-composer";
|
|
745
839
|
readonly text: string;
|
|
746
840
|
readonly cwd?: string;
|
|
841
|
+
} | {
|
|
842
|
+
readonly action: "open-local-setup";
|
|
747
843
|
};
|
|
748
844
|
export interface SeatActionsClaim {
|
|
749
845
|
readonly actions: readonly string[];
|
|
@@ -806,8 +902,11 @@ export interface LocalSessionsApi {
|
|
|
806
902
|
setComputerUse(req: SetComputerUseRequest): Promise<SetComputerUseResult>;
|
|
807
903
|
getNotificationLevels(): Promise<NotificationLevelsState>;
|
|
808
904
|
setNotificationLevel(type: NotificationLevelType, level: NotificationLevel): Promise<SetNotificationLevelResult>;
|
|
905
|
+
getQuickEntryShortcut(): Promise<QuickEntryShortcutState>;
|
|
906
|
+
setQuickEntryShortcut(next: QuickEntryShortcut): Promise<SetQuickEntryShortcutResult>;
|
|
809
907
|
claimSeatActions(req: SeatActionsClaim): Promise<OkAck>;
|
|
810
908
|
readSessionMods(sessionId: string): Promise<SessionModsView | DeviceUnreadable | DeviceUnarmed>;
|
|
909
|
+
readSessionHooksRoster(sessionId: string): Promise<SessionHooksRoster | DeviceUnreadable | DeviceUnarmed>;
|
|
811
910
|
onEvent(cb: (ev: LocalSessionEvent) => void): () => void;
|
|
812
911
|
onToolPermissionRequest(cb: (req: ToolPermissionRequest) => void): () => void;
|
|
813
912
|
onSeatAction(cb: (action: SeatAction) => void): () => void;
|
|
@@ -857,8 +956,9 @@ export declare const checkStartSessionOptions: (v: unknown) => SeatValidation;
|
|
|
857
956
|
export declare const checkSeatResourceScope: (v: unknown) => SeatValidation;
|
|
858
957
|
export declare function isSendMessageAck(v: unknown): v is SendMessageAck;
|
|
859
958
|
export declare function readToolPermissionSettledElsewhere(ack: object | null | undefined): ToolPermissionSettledElsewhere | undefined;
|
|
959
|
+
export declare function readToolPermissionAckState(ack: ToolPermissionAck | null | undefined): ToolPermissionAckState | undefined;
|
|
860
960
|
export declare const LOCAL_SESSIONS_SPEC: EipcServiceSpec;
|
|
861
|
-
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", "answerEngineSwap", "beginSelfUpgrade", "listOnboardProviders", "probeOnboardEntry", "applyOnboardEntry", "readSessionMcpPanel", "listMcpToolToggles", "setMcpToolToggle", "setThinkingLatch", "getComputerUse", "setComputerUse", "getNotificationLevels", "setNotificationLevel", "claimSeatActions", "readSessionMods", "onEvent", "onToolPermissionRequest", "onSeatAction"];
|
|
961
|
+
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", "answerEngineSwap", "beginSelfUpgrade", "listOnboardProviders", "probeOnboardEntry", "applyOnboardEntry", "readSessionMcpPanel", "listMcpToolToggles", "setMcpToolToggle", "setThinkingLatch", "getComputerUse", "setComputerUse", "getNotificationLevels", "setNotificationLevel", "getQuickEntryShortcut", "setQuickEntryShortcut", "claimSeatActions", "readSessionMods", "readSessionHooksRoster", "onEvent", "onToolPermissionRequest", "onSeatAction"];
|
|
862
962
|
export declare const SEAT_STORE_PROPS: readonly ["sessionsStateStore", "focusedSessionStateStore", "settingsStateStore", "seatCapabilitiesStateStore", "engineTargetStateStore"];
|
|
863
963
|
export declare const SEAT_EVENT_METHOD_NAMES: readonly ["onEvent", "onToolPermissionRequest", "onSeatAction"];
|
|
864
964
|
export declare const LOCAL_SESSION_EVENT_KEYS: readonly ["type", "sessionId", "message", "error", "errorCategory", "code", "session", "userMessageUuid", "requestId", "outcome", "parked", "chrome", "_sema_turnFailure", "subagentContent"];
|
|
@@ -1066,7 +1166,7 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
1066
1166
|
};
|
|
1067
1167
|
readonly ToolPermissionAck: {
|
|
1068
1168
|
readonly check: (v: unknown) => SeatValidation;
|
|
1069
|
-
readonly validated: readonly ["ok", "settledElsewhere"];
|
|
1169
|
+
readonly validated: readonly ["ok", "settledElsewhere", "unconfirmed"];
|
|
1070
1170
|
readonly unchecked: readonly [];
|
|
1071
1171
|
};
|
|
1072
1172
|
readonly GetTranscriptResult: {
|
|
@@ -1096,7 +1196,7 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
1096
1196
|
};
|
|
1097
1197
|
readonly SeatCapabilitiesState: {
|
|
1098
1198
|
readonly check: (v: unknown) => SeatValidation;
|
|
1099
|
-
readonly validated: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles", "thinkingLatch", "computerUseSwitch", "engineModeDefaultOnly", "seatActions", "notificationLevels", "modsView"];
|
|
1199
|
+
readonly validated: readonly ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles", "thinkingLatch", "computerUseSwitch", "engineModeDefaultOnly", "seatActions", "notificationLevels", "modsView", "quickEntryShortcut", "hooksRoster"];
|
|
1100
1200
|
readonly unchecked: readonly [];
|
|
1101
1201
|
};
|
|
1102
1202
|
readonly RecentFoldersResult: {
|
|
@@ -1136,7 +1236,7 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
1136
1236
|
};
|
|
1137
1237
|
};
|
|
1138
1238
|
export declare const SEAT_VALIDATOR_COVERAGE_EXEMPT: readonly [...{
|
|
1139
|
-
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" | "NotificationLevelsState" | "SetNotificationLevelResult" | "SeatAction" | "EngineSwapAnswerOutcome" | "SelfUpgradeOutcome" | "SessionModsResult";
|
|
1239
|
+
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" | "NotificationLevelsState" | "SetNotificationLevelResult" | "SeatAction" | "EngineSwapAnswerOutcome" | "SelfUpgradeOutcome" | "SessionModsResult" | "QuickEntryShortcutState" | "SetQuickEntryShortcutResult" | "SessionHooksRosterResult";
|
|
1140
1240
|
check: (v: unknown) => SeatValidation;
|
|
1141
1241
|
why: string;
|
|
1142
1242
|
}[], {
|
package/dist/seatContract.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PERMISSION_MODE_WORDS, REASONING_EFFORT_WORDS } from "./taskRequestWords.js";
|
|
2
|
+
import { CC_TOOL_DENIAL_KINDS } from "./gateVocabulary.js";
|
|
2
3
|
import { liveDefaultModelCopy, liveModelRowCopy } from "./model/liveCatalogShape.js";
|
|
3
4
|
import { REWIND_MODES } from "./rewindWireCaps.js";
|
|
4
5
|
import { SETTINGS_MODEL_API_WORDS } from "./generated/settingsSchemaTables.js";
|
|
@@ -11,6 +12,10 @@ import { THINKING_LATCH_EVENTS, THINKING_LATCH_ROW_WORDS } from "./thinkingLatch
|
|
|
11
12
|
import { EXECUTION_PLACEMENT_ROLES } from "./executionPlacementWords.js";
|
|
12
13
|
import { isSessionEngineView } from "./sessionEngine.js";
|
|
13
14
|
import { LOCAL_ENGINE_SWAP_CAUSES } from "./localEngineSwapCard.js";
|
|
15
|
+
import { HOOK_ENTRY_TYPE_WORDS, PLUGIN_HOOK_EXCLUSION_REASONS, PLUGIN_HOOK_REASONS, SETTINGS_HOOK_DROP_REASONS, } from "./pluginHooksWire.js";
|
|
16
|
+
import { HTTP_POLICY_DROP_REASONS } from "./httpHookPolicy.js";
|
|
17
|
+
import { HOOK_SETTINGS_SOURCE_TEXT } from "./settingsHooksSalvage.js";
|
|
18
|
+
import { SETTINGS_HOOK_EVENTS, SETTINGS_HOOKS_DROPPED_PIECE_CODES, SETTINGS_HOOKS_REJECTION_CODES } from "./generated/settingsSchemaFns.js";
|
|
14
19
|
const bad = (reason, field) => field === undefined ? { reason } : { reason, field };
|
|
15
20
|
const nested = (prefix, verdict) => {
|
|
16
21
|
const path = verdict.field === undefined
|
|
@@ -311,6 +316,8 @@ const CHROME_ARM_SEAT_ROUTE = {
|
|
|
311
316
|
engine_notice: "seat",
|
|
312
317
|
subagent_alias: "seat",
|
|
313
318
|
session_box_notice: "seat",
|
|
319
|
+
resupply_truncated: "seat",
|
|
320
|
+
host_setting_notice: "seat",
|
|
314
321
|
workflow_notification_enqueue: "host",
|
|
315
322
|
plan_review_park: "host",
|
|
316
323
|
approval_request: "host",
|
|
@@ -399,7 +406,7 @@ export function readSeatStreamDelta(message) {
|
|
|
399
406
|
return Object.freeze({ kind: "malformed" });
|
|
400
407
|
}
|
|
401
408
|
}
|
|
402
|
-
export const SEAT_CAPABILITY_NAMES = Object.freeze(["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles", "thinkingLatch", "computerUseSwitch", "engineModeDefaultOnly", "seatActions", "notificationLevels", "modsView"]);
|
|
409
|
+
export const SEAT_CAPABILITY_NAMES = Object.freeze(["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles", "thinkingLatch", "computerUseSwitch", "engineModeDefaultOnly", "seatActions", "notificationLevels", "modsView", "quickEntryShortcut", "hooksRoster"]);
|
|
403
410
|
const notReported = () => Object.freeze({ kind: "not_reported" });
|
|
404
411
|
const malformedReading = () => Object.freeze({ kind: "malformed" });
|
|
405
412
|
const reported = (available) => Object.freeze({ kind: "reported", available });
|
|
@@ -481,6 +488,8 @@ const SEAT_CAPABILITY_PHRASES = Object.freeze({
|
|
|
481
488
|
seatActions: Object.freeze({ action: "App menu actions", ability: "send actions to this window", support: "app action support" }),
|
|
482
489
|
notificationLevels: Object.freeze({ action: "Choosing notification levels", ability: "keep notification levels", support: "notification-level support" }),
|
|
483
490
|
modsView: Object.freeze({ action: "Showing mods", ability: "show mods", support: "mods support" }),
|
|
491
|
+
quickEntryShortcut: Object.freeze({ action: "Changing the Quick Entry shortcut", ability: "change the Quick Entry shortcut", support: "Quick Entry shortcut support" }),
|
|
492
|
+
hooksRoster: Object.freeze({ action: "Showing hooks", ability: "show hooks", support: "hooks support" }),
|
|
484
493
|
});
|
|
485
494
|
export function seatCapabilityUnavailableDetail(name, reading) {
|
|
486
495
|
const phrase = Object.hasOwn(SEAT_CAPABILITY_PHRASES, name)
|
|
@@ -715,6 +724,7 @@ export const LOCAL_ENGINE_DOWN_REASONS = Object.freeze([
|
|
|
715
724
|
"stop-failed",
|
|
716
725
|
"crash-loop",
|
|
717
726
|
"high-water-unreadable",
|
|
727
|
+
"exited-once",
|
|
718
728
|
"principal-unknown",
|
|
719
729
|
]);
|
|
720
730
|
export const LOCAL_ENGINE_WAITING_REASONS = Object.freeze(["starting", "dormant", "draining", "unanswered", "peer"]);
|
|
@@ -874,7 +884,7 @@ const ENGINE_TARGET_STATE = shapeRule("engine target", {
|
|
|
874
884
|
mode: reqF(R_ENGINE_LANE),
|
|
875
885
|
generation: reqF(R_INT0),
|
|
876
886
|
cloud: reqF(ENGINE_TARGET_CLOUD),
|
|
877
|
-
local:
|
|
887
|
+
local: optF(ENGINE_TARGET_LOCAL),
|
|
878
888
|
});
|
|
879
889
|
const checkEngineTargetState = seatShapeCheck(ENGINE_TARGET_STATE);
|
|
880
890
|
const okArmsRule = (label, okSpec, refusedSpec) => ({
|
|
@@ -1116,6 +1126,78 @@ const checkSessionModsResult = seatCheck((v) => {
|
|
|
1116
1126
|
return bad("not object");
|
|
1117
1127
|
return Object.hasOwn(v, "kind") ? checkSessionModsFailure(v) : checkSessionModsView(v);
|
|
1118
1128
|
});
|
|
1129
|
+
export const SESSION_HOOKS_ROSTER_STATUSES = Object.freeze(["engine", "shell", "not_run"]);
|
|
1130
|
+
const HOOKS_ROSTER_CLOSED_BY = Object.freeze(["workspace_untrusted", "governance_unreadable", "policy_disable_all"]);
|
|
1131
|
+
const HOOKS_ROSTER_REASONS = Object.freeze([...new Set([...PLUGIN_HOOK_REASONS, ...PLUGIN_HOOK_EXCLUSION_REASONS, ...SETTINGS_HOOK_DROP_REASONS])]);
|
|
1132
|
+
const R_HOOK_SOURCE = ruleOf("hook source", (v) => typeof v === "string" && Object.hasOwn(HOOK_SETTINGS_SOURCE_TEXT, v));
|
|
1133
|
+
const R_HOOK_EVENT = oneOfRule("hook event", SETTINGS_HOOK_EVENTS);
|
|
1134
|
+
const HOOKS_ROSTER_ROW_SHAPE = shapeRule("hooks roster row", {
|
|
1135
|
+
source: reqF(R_HOOK_SOURCE),
|
|
1136
|
+
event: reqF(R_HOOK_EVENT),
|
|
1137
|
+
groupIndex: reqF(R_INT0),
|
|
1138
|
+
hookIndex: reqF(R_INT0),
|
|
1139
|
+
type: optF(oneOfRule("hook type", HOOK_ENTRY_TYPE_WORDS)),
|
|
1140
|
+
status: reqF(oneOfRule("hooks roster status", SESSION_HOOKS_ROSTER_STATUSES)),
|
|
1141
|
+
reason: reqF(oneOfRule("hooks roster reason", HOOKS_ROSTER_REASONS)),
|
|
1142
|
+
});
|
|
1143
|
+
const HOOKS_ROSTER_ROW = {
|
|
1144
|
+
label: HOOKS_ROSTER_ROW_SHAPE.label,
|
|
1145
|
+
test: (v, path) => {
|
|
1146
|
+
const verdict = HOOKS_ROSTER_ROW_SHAPE.test(v, path);
|
|
1147
|
+
if (verdict !== true)
|
|
1148
|
+
return verdict;
|
|
1149
|
+
const rec = v;
|
|
1150
|
+
const status = own(rec, "status");
|
|
1151
|
+
const reason = own(rec, "reason");
|
|
1152
|
+
if (status === "engine" && !PLUGIN_HOOK_REASONS.includes(reason))
|
|
1153
|
+
return bad("status conflict", pathAt(path, "reason"));
|
|
1154
|
+
return true;
|
|
1155
|
+
},
|
|
1156
|
+
};
|
|
1157
|
+
const HOOKS_ROSTER_LAYER = armsRule("hooks roster layer", "state", {
|
|
1158
|
+
"loaded-partial": { source: reqF(R_HOOK_SOURCE), codes: reqF(arrayRule(oneOfRule("hooks drop code", SETTINGS_HOOKS_DROPPED_PIECE_CODES), true)) },
|
|
1159
|
+
rejected: { source: reqF(R_HOOK_SOURCE), codes: reqF(arrayRule(oneOfRule("hooks rejection code", SETTINGS_HOOKS_REJECTION_CODES), true)) },
|
|
1160
|
+
trust_withheld: { source: reqF(R_HOOK_SOURCE) },
|
|
1161
|
+
});
|
|
1162
|
+
const HOOKS_ROSTER_HTTP_ROW = shapeRule("hooks roster http row", {
|
|
1163
|
+
source: reqF(R_HOOK_SOURCE),
|
|
1164
|
+
event: reqF(R_HOOK_EVENT),
|
|
1165
|
+
reason: reqF(oneOfRule("http policy reason", HTTP_POLICY_DROP_REASONS)),
|
|
1166
|
+
});
|
|
1167
|
+
const HOOKS_ROSTER_SHAPE = shapeRule("hooks roster", {
|
|
1168
|
+
closedBy: reqF(ruleOf("closedBy", (v) => v === null || (typeof v === "string" && inTuple(HOOKS_ROSTER_CLOSED_BY, v)))),
|
|
1169
|
+
sources: optF(arrayRule(R_HOOK_SOURCE)),
|
|
1170
|
+
rows: reqF(arrayRule(HOOKS_ROSTER_ROW)),
|
|
1171
|
+
layers: reqF(arrayRule(HOOKS_ROSTER_LAYER)),
|
|
1172
|
+
http: reqF(arrayRule(HOOKS_ROSTER_HTTP_ROW)),
|
|
1173
|
+
unlisted: reqF(R_INT0),
|
|
1174
|
+
});
|
|
1175
|
+
const checkSessionHooksRosterView = seatShapeCheck({
|
|
1176
|
+
label: HOOKS_ROSTER_SHAPE.label,
|
|
1177
|
+
test: (v, path) => {
|
|
1178
|
+
const verdict = HOOKS_ROSTER_SHAPE.test(v, path);
|
|
1179
|
+
if (verdict !== true)
|
|
1180
|
+
return verdict;
|
|
1181
|
+
const rec = v;
|
|
1182
|
+
if (own(rec, "closedBy") === null)
|
|
1183
|
+
return true;
|
|
1184
|
+
const rows = ownItems(own(rec, "rows"));
|
|
1185
|
+
for (let i = 0; i < rows.length; i += 1) {
|
|
1186
|
+
if (own(rows[i], "status") !== "not_run")
|
|
1187
|
+
return bad("status conflict", pathAt(path, `rows[${i}].status`));
|
|
1188
|
+
}
|
|
1189
|
+
return true;
|
|
1190
|
+
},
|
|
1191
|
+
});
|
|
1192
|
+
const checkSessionHooksRosterFailure = seatShapeCheck(armsRule("readSessionHooksRoster failure", "kind", {
|
|
1193
|
+
unreadable: DEVICE_UNREADABLE_SPEC,
|
|
1194
|
+
unarmed: {},
|
|
1195
|
+
}));
|
|
1196
|
+
const checkSessionHooksRosterResult = seatCheck((v) => {
|
|
1197
|
+
if (!isPlainRecord(v))
|
|
1198
|
+
return bad("not object");
|
|
1199
|
+
return Object.hasOwn(v, "kind") ? checkSessionHooksRosterFailure(v) : checkSessionHooksRosterView(v);
|
|
1200
|
+
});
|
|
1119
1201
|
const MCP_TOOL_TOGGLE_KEY = shapeRule("toggle key", {
|
|
1120
1202
|
server: reqF(R_NONEMPTY),
|
|
1121
1203
|
tool: reqF(R_NONEMPTY),
|
|
@@ -1280,7 +1362,75 @@ export function planSetNotificationLevel(type, level, supported) {
|
|
|
1280
1362
|
return Object.freeze({ kind: "refused", reason: "unsupported-level" });
|
|
1281
1363
|
return Object.freeze({ kind: "apply", type, level });
|
|
1282
1364
|
}
|
|
1283
|
-
export const
|
|
1365
|
+
export const QUICK_ENTRY_SHORTCUT_FAILURES = Object.freeze(["invalid-accelerator", "registration-failed"]);
|
|
1366
|
+
export const QUICK_ENTRY_SHORTCUT_REFUSAL_REASONS = Object.freeze(["invalid-request", "invalid-accelerator", "registration-failed", "write-failed"]);
|
|
1367
|
+
const QUICK_ENTRY_ACCELERATOR_SPEC = { accelerator: reqF(R_NONEMPTY) };
|
|
1368
|
+
const R_QUICK_ENTRY_SHORTCUT = {
|
|
1369
|
+
label: "quick entry shortcut",
|
|
1370
|
+
test: (v, path) => (v === "off" ? true : shapeVerdict(QUICK_ENTRY_ACCELERATOR_SPEC, v, path)),
|
|
1371
|
+
};
|
|
1372
|
+
const QUICK_ENTRY_STATE_SHAPE = shapeRule("quick entry shortcut state", {
|
|
1373
|
+
saved: reqF(R_QUICK_ENTRY_SHORTCUT),
|
|
1374
|
+
active: reqF(ruleOf("active accelerator", (v) => v === null || (typeof v === "string" && v.length > 0))),
|
|
1375
|
+
savedFailure: reqF(ruleOf("saved failure", (v) => v === null || (typeof v === "string" && inTuple(QUICK_ENTRY_SHORTCUT_FAILURES, v)))),
|
|
1376
|
+
});
|
|
1377
|
+
const QUICK_ENTRY_STATE = {
|
|
1378
|
+
label: QUICK_ENTRY_STATE_SHAPE.label,
|
|
1379
|
+
test: (v, path) => {
|
|
1380
|
+
const verdict = QUICK_ENTRY_STATE_SHAPE.test(v, path);
|
|
1381
|
+
if (verdict !== true)
|
|
1382
|
+
return verdict;
|
|
1383
|
+
const rec = v;
|
|
1384
|
+
if (own(rec, "savedFailure") === null)
|
|
1385
|
+
return true;
|
|
1386
|
+
const saved = own(rec, "saved");
|
|
1387
|
+
if (saved === "off")
|
|
1388
|
+
return bad("failure conflict", pathAt(path, "savedFailure"));
|
|
1389
|
+
if (own(rec, "active") === own(saved, "accelerator"))
|
|
1390
|
+
return bad("failure conflict", pathAt(path, "active"));
|
|
1391
|
+
return true;
|
|
1392
|
+
},
|
|
1393
|
+
};
|
|
1394
|
+
const checkQuickEntryShortcutState = seatShapeCheck(QUICK_ENTRY_STATE);
|
|
1395
|
+
const SET_QUICK_ENTRY_SHORTCUT_RESULT = okArmsRule("setQuickEntryShortcut result", { state: reqF(QUICK_ENTRY_STATE) }, {
|
|
1396
|
+
reason: reqF(oneOfRule("quick entry refusal", QUICK_ENTRY_SHORTCUT_REFUSAL_REASONS)),
|
|
1397
|
+
state: reqF(QUICK_ENTRY_STATE),
|
|
1398
|
+
});
|
|
1399
|
+
const checkSetQuickEntryShortcutResult = seatShapeCheck({
|
|
1400
|
+
label: SET_QUICK_ENTRY_SHORTCUT_RESULT.label,
|
|
1401
|
+
test: (v, path) => {
|
|
1402
|
+
const verdict = SET_QUICK_ENTRY_SHORTCUT_RESULT.test(v, path);
|
|
1403
|
+
if (verdict !== true)
|
|
1404
|
+
return verdict;
|
|
1405
|
+
const rec = v;
|
|
1406
|
+
if (own(rec, "ok") === true && own(own(rec, "state"), "savedFailure") !== null)
|
|
1407
|
+
return bad("failure conflict", pathAt(path, "state.savedFailure"));
|
|
1408
|
+
return true;
|
|
1409
|
+
},
|
|
1410
|
+
});
|
|
1411
|
+
export function planSetQuickEntryShortcut(request) {
|
|
1412
|
+
const refused = Object.freeze({ kind: "refused", reason: "invalid-request" });
|
|
1413
|
+
if (request === "off")
|
|
1414
|
+
return Object.freeze({ kind: "apply", next: "off" });
|
|
1415
|
+
try {
|
|
1416
|
+
if (!isPlainRecord(request) || firstAccessorPath(request) !== undefined)
|
|
1417
|
+
return refused;
|
|
1418
|
+
const snap = new Map();
|
|
1419
|
+
for (const k of Reflect.ownKeys(request))
|
|
1420
|
+
if (typeof k === "string")
|
|
1421
|
+
snap.set(k, own(request, k));
|
|
1422
|
+
if (snap.size !== 1 || !snap.has("accelerator"))
|
|
1423
|
+
return refused;
|
|
1424
|
+
const accelerator = snap.get("accelerator");
|
|
1425
|
+
if (typeof accelerator !== "string" || accelerator.length === 0)
|
|
1426
|
+
return refused;
|
|
1427
|
+
return Object.freeze({ kind: "apply", next: Object.freeze({ accelerator }) });
|
|
1428
|
+
}
|
|
1429
|
+
catch {
|
|
1430
|
+
return refused;
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
export const SEAT_ACTION_NAMES = Object.freeze(["new-project", "prefill-composer", "open-local-setup"]);
|
|
1284
1434
|
const SEAT_PREFILL_TEXT_MAX = 14336;
|
|
1285
1435
|
const SEAT_PREFILL_CWD_MAX = 4096;
|
|
1286
1436
|
const SEAT_ACTIONS_CLAIM_MAX = 16;
|
|
@@ -1293,6 +1443,7 @@ const R_PREFILL_CWD = ruleOf(`folder path (1–${SEAT_PREFILL_CWD_MAX} chars, no
|
|
|
1293
1443
|
const SEAT_ACTION_ARMS = {
|
|
1294
1444
|
"new-project": {},
|
|
1295
1445
|
"prefill-composer": { text: reqF(R_PREFILL_TEXT), cwd: optF(R_PREFILL_CWD) },
|
|
1446
|
+
"open-local-setup": {},
|
|
1296
1447
|
};
|
|
1297
1448
|
export const checkSeatAction = seatShapeCheck(armsRule("seat action", "action", SEAT_ACTION_ARMS));
|
|
1298
1449
|
const seatActionMalformed = (reason) => Object.freeze({ kind: "malformed", reason });
|
|
@@ -1311,6 +1462,8 @@ export function readSeatAction(ev) {
|
|
|
1311
1462
|
}
|
|
1312
1463
|
if (name === "new-project")
|
|
1313
1464
|
return Object.freeze({ kind: "action", action: Object.freeze({ action: "new-project" }) });
|
|
1465
|
+
if (name === "open-local-setup")
|
|
1466
|
+
return Object.freeze({ kind: "action", action: Object.freeze({ action: "open-local-setup" }) });
|
|
1314
1467
|
const text = own(ev, "text");
|
|
1315
1468
|
const cwd = own(ev, "cwd");
|
|
1316
1469
|
if (R_PREFILL_TEXT.test(text, "text") !== true || typeof text !== "string")
|
|
@@ -1763,6 +1916,8 @@ const SUBAGENT_CONTENT_SHAPE = shapeRule("subagent content", {
|
|
|
1763
1916
|
output: optF(R_STR),
|
|
1764
1917
|
isError: optF(R_BOOL),
|
|
1765
1918
|
notExecuted: optF(R_TRUE),
|
|
1919
|
+
denialKind: optF(oneOfRule("denial kind", CC_TOOL_DENIAL_KINDS)),
|
|
1920
|
+
refusalNoted: optF(R_TRUE),
|
|
1766
1921
|
});
|
|
1767
1922
|
export function readSeatSubagentContent(event) {
|
|
1768
1923
|
try {
|
|
@@ -2037,23 +2192,43 @@ const R_SETTLED_ELSEWHERE = shapeRule("settled elsewhere", {
|
|
|
2037
2192
|
firstDecision: reqF(oneOfRule("decision word", TOOL_PERMISSION_SETTLED_WORDS)),
|
|
2038
2193
|
contrary: reqF(R_BOOL),
|
|
2039
2194
|
});
|
|
2040
|
-
const
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2195
|
+
const TOOL_PERMISSION_UNCONFIRMED_CAUSES = Object.freeze(["transport", "server_error", "local_error", "aborted", "gone_after_retry", "registry_unreadable"]);
|
|
2196
|
+
const R_UNCONFIRMED = shapeRule("unconfirmed", {
|
|
2197
|
+
cause: reqF(oneOfRule("cause word", TOOL_PERMISSION_UNCONFIRMED_CAUSES)),
|
|
2198
|
+
});
|
|
2199
|
+
const R_TOOL_PERMISSION_ACK = shapeRule("permission ack", {
|
|
2200
|
+
ok: reqF(R_BOOL),
|
|
2201
|
+
settledElsewhere: optF(R_SETTLED_ELSEWHERE),
|
|
2202
|
+
unconfirmed: optF(R_UNCONFIRMED),
|
|
2046
2203
|
});
|
|
2047
|
-
const
|
|
2204
|
+
const TOOL_PERMISSION_ACK_SLOTS = [["settledElsewhere"], ["unconfirmed"]];
|
|
2205
|
+
const R_FALSE = ruleOf("false", (v) => v === false);
|
|
2206
|
+
function toolPermissionAckVerdict(v) {
|
|
2207
|
+
if (!isPlainRecord(v))
|
|
2208
|
+
return okAckVerdict(v);
|
|
2209
|
+
const shape = R_TOOL_PERMISSION_ACK.test(v, "");
|
|
2210
|
+
if (shape !== true)
|
|
2211
|
+
return shape;
|
|
2212
|
+
const ack = v;
|
|
2213
|
+
const groups = keyGroupsVerdict(TOOL_PERMISSION_ACK_SLOTS, ack, "");
|
|
2214
|
+
if (groups !== true)
|
|
2215
|
+
return groups;
|
|
2216
|
+
const ok = own(ack, "ok");
|
|
2217
|
+
if (!isAbsent(own(ack, "unconfirmed")))
|
|
2218
|
+
return R_FALSE.test(ok, "ok");
|
|
2219
|
+
const settled = own(ack, "settledElsewhere");
|
|
2220
|
+
if (isAbsent(settled))
|
|
2221
|
+
return true;
|
|
2222
|
+
return own(settled, "contrary") === true ? R_FALSE.test(ok, "ok") : R_TRUE.test(ok, "ok");
|
|
2223
|
+
}
|
|
2224
|
+
const checkToolPermissionAck = seatShapeCheck({ label: "permission ack", test: (v) => toolPermissionAckVerdict(v) });
|
|
2048
2225
|
export function readToolPermissionSettledElsewhere(ack) {
|
|
2049
2226
|
try {
|
|
2050
|
-
if (
|
|
2227
|
+
if (checkToolPermissionAck(ack) !== true)
|
|
2051
2228
|
return undefined;
|
|
2052
2229
|
const slot = own(ack, "settledElsewhere");
|
|
2053
2230
|
if (isAbsent(slot))
|
|
2054
2231
|
return undefined;
|
|
2055
|
-
if (checkSettledElsewhereSlot(slot) !== true)
|
|
2056
|
-
return undefined;
|
|
2057
2232
|
const first = own(slot, "firstDecision");
|
|
2058
2233
|
return Object.freeze({ firstDecision: first === "allow" ? "allow" : "deny", contrary: own(slot, "contrary") === true });
|
|
2059
2234
|
}
|
|
@@ -2061,6 +2236,22 @@ export function readToolPermissionSettledElsewhere(ack) {
|
|
|
2061
2236
|
return undefined;
|
|
2062
2237
|
}
|
|
2063
2238
|
}
|
|
2239
|
+
export function readToolPermissionAckState(ack) {
|
|
2240
|
+
try {
|
|
2241
|
+
if (checkToolPermissionAck(ack) !== true)
|
|
2242
|
+
return undefined;
|
|
2243
|
+
const un = own(ack, "unconfirmed");
|
|
2244
|
+
if (!isAbsent(un)) {
|
|
2245
|
+
const word = own(un, "cause");
|
|
2246
|
+
const cause = TOOL_PERMISSION_UNCONFIRMED_CAUSES.find((w) => w === word);
|
|
2247
|
+
return cause === undefined ? undefined : Object.freeze({ kind: "unconfirmed", cause });
|
|
2248
|
+
}
|
|
2249
|
+
return own(ack, "ok") === true ? Object.freeze({ kind: "applied" }) : Object.freeze({ kind: "not_applied" });
|
|
2250
|
+
}
|
|
2251
|
+
catch {
|
|
2252
|
+
return undefined;
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2064
2255
|
const checkBooleanAck = (v) => typeof v === "boolean" ? true : bad("expected a bare boolean result");
|
|
2065
2256
|
const checkGetTranscriptResult = seatCheck((v) => {
|
|
2066
2257
|
if (!isPlainRecord(v))
|
|
@@ -2221,8 +2412,11 @@ export const LOCAL_SESSIONS_SPEC = {
|
|
|
2221
2412
|
setComputerUse: { kind: "invoke", check: checkSetComputerUseResult },
|
|
2222
2413
|
getNotificationLevels: { kind: "invoke", check: checkNotificationLevelsState },
|
|
2223
2414
|
setNotificationLevel: { kind: "invoke", check: checkSetNotificationLevelResult },
|
|
2415
|
+
getQuickEntryShortcut: { kind: "invoke", check: checkQuickEntryShortcutState },
|
|
2416
|
+
setQuickEntryShortcut: { kind: "invoke", check: checkSetQuickEntryShortcutResult },
|
|
2224
2417
|
claimSeatActions: { kind: "invoke", check: checkOkAck },
|
|
2225
2418
|
readSessionMods: { kind: "invoke", check: checkSessionModsResult },
|
|
2419
|
+
readSessionHooksRoster: { kind: "invoke", check: checkSessionHooksRosterResult },
|
|
2226
2420
|
onEvent: { kind: "event", check: checkLocalSessionEvent },
|
|
2227
2421
|
onToolPermissionRequest: { kind: "event", check: checkToolPermissionRequest },
|
|
2228
2422
|
onSeatAction: { kind: "event", check: checkSeatAction },
|
|
@@ -2278,8 +2472,11 @@ export const SEAT_METHOD_NAMES = [
|
|
|
2278
2472
|
"setComputerUse",
|
|
2279
2473
|
"getNotificationLevels",
|
|
2280
2474
|
"setNotificationLevel",
|
|
2475
|
+
"getQuickEntryShortcut",
|
|
2476
|
+
"setQuickEntryShortcut",
|
|
2281
2477
|
"claimSeatActions",
|
|
2282
2478
|
"readSessionMods",
|
|
2479
|
+
"readSessionHooksRoster",
|
|
2283
2480
|
"onEvent",
|
|
2284
2481
|
"onToolPermissionRequest",
|
|
2285
2482
|
"onSeatAction",
|
|
@@ -2601,7 +2798,7 @@ export const SEAT_VALIDATOR_KEY_COVERAGE = {
|
|
|
2601
2798
|
},
|
|
2602
2799
|
ToolPermissionAck: {
|
|
2603
2800
|
check: checkToolPermissionAck,
|
|
2604
|
-
validated: ["ok", "settledElsewhere"],
|
|
2801
|
+
validated: ["ok", "settledElsewhere", "unconfirmed"],
|
|
2605
2802
|
unchecked: [],
|
|
2606
2803
|
},
|
|
2607
2804
|
GetTranscriptResult: {
|
|
@@ -2631,7 +2828,7 @@ export const SEAT_VALIDATOR_KEY_COVERAGE = {
|
|
|
2631
2828
|
},
|
|
2632
2829
|
SeatCapabilitiesState: {
|
|
2633
2830
|
check: checkSeatCapabilitiesState,
|
|
2634
|
-
validated: ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles", "thinkingLatch", "computerUseSwitch", "engineModeDefaultOnly", "seatActions", "notificationLevels", "modsView"],
|
|
2831
|
+
validated: ["pickFolder", "rewind", "recents", "patchSession", "devices", "engineTarget", "onboard", "mcpToolToggles", "thinkingLatch", "computerUseSwitch", "engineModeDefaultOnly", "seatActions", "notificationLevels", "modsView", "quickEntryShortcut", "hooksRoster"],
|
|
2635
2832
|
unchecked: [],
|
|
2636
2833
|
},
|
|
2637
2834
|
RecentFoldersResult: {
|
|
@@ -2703,6 +2900,9 @@ export const SEAT_VALIDATOR_COVERAGE_EXEMPT = [
|
|
|
2703
2900
|
["EngineSwapAnswerOutcome", checkEngineSwapAnswerOutcome],
|
|
2704
2901
|
["SelfUpgradeOutcome", checkSelfUpgradeOutcome],
|
|
2705
2902
|
["SessionModsResult", checkSessionModsResult],
|
|
2903
|
+
["QuickEntryShortcutState", checkQuickEntryShortcutState],
|
|
2904
|
+
["SetQuickEntryShortcutResult", checkSetQuickEntryShortcutResult],
|
|
2905
|
+
["SessionHooksRosterResult", checkSessionHooksRosterResult],
|
|
2706
2906
|
].map(([label, check]) => ({
|
|
2707
2907
|
label,
|
|
2708
2908
|
check,
|
|
@@ -2770,5 +2970,8 @@ const _seatContractPins = [
|
|
|
2770
2970
|
true, true, true, true, true,
|
|
2771
2971
|
true, true, true,
|
|
2772
2972
|
true, true, true, true,
|
|
2973
|
+
true, true, true, true,
|
|
2974
|
+
true, true, true, true, true, true,
|
|
2975
|
+
true, true, true, true, true,
|
|
2773
2976
|
];
|
|
2774
2977
|
void _seatContractPins;
|