@sema-agent/client-core 0.106.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.
Files changed (114) hide show
  1. package/CHANGELOG.md +199 -0
  2. package/README.md +35 -26
  3. package/dist/adapter/activeRunSelfHeal.d.ts +10 -0
  4. package/dist/adapter/activeRunSelfHeal.js +68 -23
  5. package/dist/checkpointRowVerdict.d.ts +11 -0
  6. package/dist/checkpointRowVerdict.js +35 -0
  7. package/dist/cloudConfigWireCaps.d.ts +10 -0
  8. package/dist/cloudConfigWireCaps.js +33 -0
  9. package/dist/coreValuePorts.d.ts +17 -1
  10. package/dist/coreValuePorts.js +5 -0
  11. package/dist/decideReceipt.js +2 -1
  12. package/dist/displayUntrusted.d.ts +5 -3
  13. package/dist/displayUntrusted.js +50 -41
  14. package/dist/engineErrorCodes.d.ts +5 -0
  15. package/dist/engineErrorCodes.js +5 -0
  16. package/dist/engineNoticeCodes.d.ts +31 -1
  17. package/dist/engineNoticeCodes.js +182 -9
  18. package/dist/engineTargetSeat.js +1 -0
  19. package/dist/errorSupplementRoles.js +4 -1
  20. package/dist/eventLeg.js +1 -1
  21. package/dist/executionLaneCapability.js +3 -2
  22. package/dist/executionLaneWords.d.ts +1 -0
  23. package/dist/executionLaneWords.js +4 -0
  24. package/dist/gateOutcome.d.ts +10 -1
  25. package/dist/gateOutcome.js +48 -1
  26. package/dist/generated/engineFactTables.d.ts +1 -0
  27. package/dist/generated/engineFactTables.js +5 -0
  28. package/dist/generated/engineNoticeTables.js +12 -3
  29. package/dist/generated/settingsSchemaFns.d.ts +4 -2
  30. package/dist/generated/settingsSchemaFns.js +9 -3
  31. package/dist/generated/settingsSchemaMcpRequestEntry.d.ts +1 -1
  32. package/dist/generated/settingsSchemaMcpRequestEntry.js +9 -18
  33. package/dist/generated/settingsSchemaReservedMemberName.d.ts +1 -0
  34. package/dist/generated/settingsSchemaReservedMemberName.js +7 -0
  35. package/dist/generated/settingsSchemaTables.d.ts +2 -0
  36. package/dist/generated/settingsSchemaTables.js +10 -0
  37. package/dist/generated/settingsSchemaWireName.d.ts +1 -0
  38. package/dist/generated/settingsSchemaWireName.js +8 -0
  39. package/dist/headlessReconnectWire.js +12 -7
  40. package/dist/hitl/approvalAskers.d.ts +13 -0
  41. package/dist/hitl/approvalAskers.js +79 -0
  42. package/dist/hitl/approvalResolution.d.ts +8 -1
  43. package/dist/hitl/approvalResolution.js +37 -2
  44. package/dist/hitl/approvalsFeed.js +5 -13
  45. package/dist/hitl/askParkRowRouting.js +17 -1
  46. package/dist/hitl/decisionRefusal.d.ts +1 -0
  47. package/dist/hitl/decisionRefusal.js +5 -2
  48. package/dist/hitl/decisionSend.d.ts +2 -0
  49. package/dist/hitl/decisionSend.js +22 -12
  50. package/dist/hitl/frameRouter.d.ts +3 -2
  51. package/dist/hitl/frameRouter.js +28 -6
  52. package/dist/hitl/gateLedger.d.ts +2 -0
  53. package/dist/hitl/gateLedger.js +3 -1
  54. package/dist/hitl/hitlBridge.d.ts +5 -1
  55. package/dist/hitl/hitlBridge.js +26 -2
  56. package/dist/hitl/livePendingAsk.js +4 -2
  57. package/dist/hitl/parkOwnership.js +4 -5
  58. package/dist/hitl/parkResolver.js +34 -21
  59. package/dist/hitl/parkRowBirthWait.d.ts +9 -0
  60. package/dist/hitl/parkRowBirthWait.js +8 -1
  61. package/dist/hitl/parkRowDelegation.d.ts +6 -0
  62. package/dist/hitl/parkRowDelegation.js +33 -0
  63. package/dist/hitl/persistedRulesWire.d.ts +19 -3
  64. package/dist/hitl/persistedRulesWire.js +118 -20
  65. package/dist/hitl/planReviewWire.js +16 -18
  66. package/dist/hitl/policyDenyCause.d.ts +3 -0
  67. package/dist/hitl/policyDenyCause.js +16 -0
  68. package/dist/hitl/sessionAllowRoute.d.ts +5 -0
  69. package/dist/hitl/sessionAllowRoute.js +42 -0
  70. package/dist/hitl/sessionPolicyDeliverable.js +1 -1
  71. package/dist/hitl/standingRows.js +10 -10
  72. package/dist/hitl/toolApprovalWire.d.ts +8 -2
  73. package/dist/hitl/toolApprovalWire.js +44 -11
  74. package/dist/hooksReaderGenerations.d.ts +1 -0
  75. package/dist/hooksReaderGenerations.js +12 -0
  76. package/dist/hooksWireCaps.js +8 -4
  77. package/dist/i18n/messages.en.d.ts +43 -0
  78. package/dist/i18n/messages.en.js +47 -4
  79. package/dist/i18n/messages.zh.js +53 -4
  80. package/dist/index.d.ts +7 -1
  81. package/dist/index.js +5 -1
  82. package/dist/injectionLaneNotice.js +2 -1
  83. package/dist/liveModelCatalog.d.ts +4 -2
  84. package/dist/liveModelCatalog.js +164 -26
  85. package/dist/model/catalogDefault.d.ts +25 -0
  86. package/dist/model/catalogDefault.js +44 -0
  87. package/dist/noticePresentation.js +2 -0
  88. package/dist/permissionWireCaps.d.ts +1 -0
  89. package/dist/permissionWireCaps.js +11 -0
  90. package/dist/pluginHooksWire.d.ts +5 -3
  91. package/dist/pluginHooksWire.js +116 -7
  92. package/dist/queuedDelivery.d.ts +1 -0
  93. package/dist/queuedDelivery.js +12 -0
  94. package/dist/resultFrameKeys.js +4 -2
  95. package/dist/resumeRefusalCopy.js +15 -8
  96. package/dist/runPermissionModeSwitch.d.ts +2 -1
  97. package/dist/runPermissionModeSwitch.js +16 -6
  98. package/dist/sdkWireTransit.d.ts +1 -1
  99. package/dist/seatContract.d.ts +64 -10
  100. package/dist/seatContract.js +167 -12
  101. package/dist/sessionEngine.d.ts +2 -1
  102. package/dist/sessionEngine.js +5 -0
  103. package/dist/settingsHooksSalvage.d.ts +5 -0
  104. package/dist/settingsHooksSalvage.js +54 -0
  105. package/dist/subagentContentStore.js +1 -1
  106. package/dist/supportFloor.js +2 -0
  107. package/dist/taskNotificationAdmission.d.ts +19 -0
  108. package/dist/taskNotificationAdmission.js +84 -0
  109. package/dist/toolResult.js +2 -1
  110. package/dist/webSearchWireCaps.js +9 -4
  111. package/dist/wireRefusalCopy.d.ts +7 -1
  112. package/dist/wireRefusalCopy.js +7 -1
  113. package/docs/INTEGRATION-CLIENTS.md +1189 -18
  114. package/package.json +5 -5
@@ -1,8 +1,8 @@
1
1
  import { displayUntrusted } from './displayUntrusted.js';
2
- import { appendOwnElement } from './ownKey.js';
2
+ import { appendOwnElement, readOwnDataValue } from './ownKey.js';
3
3
  import { msg, renderMessage } from './i18n/translate.js';
4
4
  import { SETTINGS_ENGINE_OWNED_HOOK_EVENTS } from './generated/settingsSchemaTables.js';
5
- import { HOOK_SETTINGS_SOURCE_TEXT, hooksSalvageMaskOf, salvageSettingsHooksEntries, } from './settingsHooksSalvage.js';
5
+ import { HOOK_SETTINGS_SOURCE_TEXT, hooksEntryUnreadKeys, hooksGroupAuthoredSource, hooksGroupUnreadKeys, hooksKeyCoordinateText, hooksSalvageMaskOf, salvageSettingsHooksEntries, } from './settingsHooksSalvage.js';
6
6
  export const ENGINE_FIRED_HOOK_EVENTS = SETTINGS_ENGINE_OWNED_HOOK_EVENTS;
7
7
  export const PLUGIN_HOOK_DISPOSITIONS = ['engine', 'shell', 'not_run'];
8
8
  export const PLUGIN_HOOK_REASONS = [
@@ -29,6 +29,8 @@ export const PLUGIN_HOOK_REASONS = [
29
29
  'scope_unsupported',
30
30
  'source_incomplete',
31
31
  'compaction_local_fallback',
32
+ 'key_not_read',
33
+ 'source_not_authored',
32
34
  ];
33
35
  export const PLUGIN_HOOK_EXCLUSION_REASONS = [
34
36
  'workspace_untrusted',
@@ -38,7 +40,7 @@ export const PLUGIN_HOOK_EXCLUSION_REASONS = [
38
40
  'managed_plugins_only',
39
41
  'prompt_not_user_authored',
40
42
  ];
41
- export const SETTINGS_HOOK_DROP_REASONS = ['exec_form_unsupported', 'mcp_tool_unsupported'];
43
+ export const SETTINGS_HOOK_DROP_REASONS = ['exec_form_unsupported', 'mcp_tool_unsupported', 'key_not_read', 'source_not_authored'];
42
44
  export function hooksWirePlanShapeOf(v) {
43
45
  try {
44
46
  if (typeof v !== 'object' || v === null || Array.isArray(v))
@@ -257,7 +259,9 @@ export function decidePluginHooks(input) {
257
259
  unreadable++;
258
260
  return;
259
261
  }
260
- ;
262
+ const authored = hooksGroupAuthoredSource(group);
263
+ const groupUnread = authored === 'unreadable' ? undefined : hooksGroupUnreadKeys(event, group);
264
+ const groupSourceAuthored = authored === 'unreadable' || (authored === 'present' && groupUnread !== undefined);
261
265
  group.hooks.forEach((entry, hookIndex) => {
262
266
  const key = { pluginId, pluginName, event, groupIndex, hookIndex };
263
267
  if (input.exclusion !== undefined) {
@@ -317,6 +321,15 @@ export function decidePluginHooks(input) {
317
321
  appendOwnElement(verdicts, { ...key, disposition: ex.disposition, reason: ex.reason });
318
322
  return;
319
323
  }
324
+ const entryUnread = isRecord(entry) ? hooksEntryUnreadKeys(event, entry, input.readerNotRead) : undefined;
325
+ if (groupSourceAuthored && (authored === 'unreadable' || entryUnread !== undefined)) {
326
+ appendOwnElement(verdicts, { ...key, ...fallback(event, entryType, 'source_not_authored') });
327
+ return;
328
+ }
329
+ if (entryUnread !== undefined && ((groupUnread?.length ?? 0) > 0 || entryUnread.length > 0)) {
330
+ appendOwnElement(verdicts, { ...key, ...fallback(event, entryType, 'key_not_read') });
331
+ return;
332
+ }
320
333
  const plugin = { name: src.name, root: src.root, dataDir: src.dataDir };
321
334
  const options = projectedOptions(src.options);
322
335
  if (options !== undefined)
@@ -454,7 +467,18 @@ function carriesArgs(entry) {
454
467
  }
455
468
  return true;
456
469
  }
457
- export function filterSettingsHookGroups(source, event, groups, execFormCapable, shellRunsType, judge, mask) {
470
+ function unreadKeyPathsOf(event, groupIndex, hookIndex, groupUnread, entryUnread) {
471
+ if (entryUnread === undefined)
472
+ return Object.freeze([]);
473
+ const out = [];
474
+ for (const k of groupUnread)
475
+ appendOwnElement(out, Object.freeze(['hooks', event, groupIndex, k]));
476
+ for (const k of entryUnread)
477
+ if (k !== 'plugin')
478
+ appendOwnElement(out, Object.freeze(['hooks', event, groupIndex, 'hooks', hookIndex, k]));
479
+ return Object.freeze(out);
480
+ }
481
+ export function filterSettingsHookGroups(source, event, groups, execFormCapable, shellRunsType, judge, readerNotRead, mask) {
458
482
  const drops = [];
459
483
  const verdicts = [];
460
484
  const excluded = [];
@@ -470,20 +494,35 @@ export function filterSettingsHookGroups(source, event, groups, execFormCapable,
470
494
  }
471
495
  const kept = [];
472
496
  let changed = false;
497
+ const authored = hooksGroupAuthoredSource(group);
498
+ const groupUnread = authored === 'unreadable' ? undefined : hooksGroupUnreadKeys(event, group);
499
+ const groupSourceAuthored = authored === 'unreadable' || (authored === 'present' && groupUnread !== undefined);
473
500
  group.hooks.forEach((entry, hookIndex) => {
474
501
  if (mask !== undefined && mask.entryDropped(event, groupIndex, hookIndex)) {
475
502
  changed = true;
476
503
  return;
477
504
  }
478
- const reason = !isRecord(entry)
505
+ const earlier = !isRecord(entry)
479
506
  ? undefined
480
507
  : entry.type === 'mcp_tool'
481
508
  ? 'mcp_tool_unsupported'
482
509
  : entry.type === 'command' && carriesArgs(entry) && !execFormCapable
483
510
  ? 'exec_form_unsupported'
484
511
  : undefined;
512
+ const entryUnread = earlier === undefined && isRecord(entry) ? hooksEntryUnreadKeys(event, entry, readerNotRead) : undefined;
513
+ const sourceNotAuthored = earlier === undefined && groupSourceAuthored && (authored === 'unreadable' || entryUnread !== undefined);
514
+ const unreadKeys = earlier === undefined && !sourceNotAuthored ? unreadKeyPathsOf(event, groupIndex, hookIndex, groupUnread ?? [], entryUnread) : [];
515
+ const reason = earlier ?? (sourceNotAuthored ? 'source_not_authored' : unreadKeys.length > 0 ? 'key_not_read' : undefined);
485
516
  if (reason !== undefined) {
486
- appendOwnElement(drops, { source, event, groupIndex, hookIndex, reason, notRun: engineEvent && !shellRunsType(isRecord(entry) && typeof entry.type === 'string' ? entry.type : undefined) });
517
+ appendOwnElement(drops, {
518
+ source,
519
+ event,
520
+ groupIndex,
521
+ hookIndex,
522
+ reason,
523
+ notRun: engineEvent && !shellRunsType(isRecord(entry) && typeof entry.type === 'string' ? entry.type : undefined),
524
+ ...(reason === 'key_not_read' ? { unreadKeys } : {}),
525
+ });
487
526
  changed = true;
488
527
  return;
489
528
  }
@@ -510,6 +549,8 @@ export function filterSettingsHookGroups(source, event, groups, execFormCapable,
510
549
  }
511
550
  appendOwnElement(kept, entry);
512
551
  });
552
+ if (((groupUnread?.length ?? 0) > 0 || groupSourceAuthored) && kept.length === 0)
553
+ changed = true;
513
554
  if (!changed)
514
555
  appendOwnElement(out, group);
515
556
  else if (kept.length > 0)
@@ -832,10 +873,14 @@ const REASON_TEXT = {
832
873
  scope_unsupported: 'hooks registered for a skill, an agent or by the host application are not sent to the engine, and this client does not run this event',
833
874
  source_incomplete: 'the plugin was reported without its id, name, root folder or data folder',
834
875
  compaction_local_fallback: renderMessage(msg('config.hooks.plan.reason.compactionLocalFallback')),
876
+ key_not_read: renderMessage(msg('config.hooks.plan.reason.keyNotRead')),
877
+ source_not_authored: renderMessage(msg('config.hooks.plan.reason.sourceNotAuthored')),
835
878
  };
836
879
  const DROP_TEXT = {
837
880
  exec_form_unsupported: 'exec-form hooks (with "args") are sent to the engine only once it reports support for them',
838
881
  mcp_tool_unsupported: 'MCP tool hooks are not supported by the engine',
882
+ key_not_read: REASON_TEXT.key_not_read,
883
+ source_not_authored: REASON_TEXT.source_not_authored,
839
884
  };
840
885
  const SOURCE_TEXT = HOOK_SETTINGS_SOURCE_TEXT;
841
886
  export function pluginHookReasonText(reason) {
@@ -898,8 +943,52 @@ function capNoticeLabel(s) {
898
943
  }
899
944
  return `${s.slice(0, end)}…`;
900
945
  }
946
+ const KEY_NOT_READ_SHOWN = 3;
947
+ function unreadPathsOfRow(d) {
948
+ const raw = d.unreadKeys;
949
+ if (!Array.isArray(raw))
950
+ return [];
951
+ return raw.filter((p) => Array.isArray(p) && p.length > 0 && p.every((x) => typeof x === 'string' || typeof x === 'number'));
952
+ }
953
+ function namedPathsOfRow(d) {
954
+ switch (d.reason) {
955
+ case 'key_not_read':
956
+ return unreadPathsOfRow(d);
957
+ case 'source_not_authored':
958
+ return typeof d.event === 'string' && Number.isInteger(d.groupIndex) && d.groupIndex >= 0 ? [['hooks', d.event, d.groupIndex, 'source']] : [];
959
+ case 'exec_form_unsupported':
960
+ case 'mcp_tool_unsupported':
961
+ return [];
962
+ }
963
+ }
964
+ function namedCoordinatesText(coordinates) {
965
+ const shown = coordinates.slice(0, KEY_NOT_READ_SHOWN).join(', ');
966
+ return coordinates.length > KEY_NOT_READ_SHOWN ? renderMessage(msg('config.hooks.plan.keyNotRead.more', { shown, rest: coordinates.length - KEY_NOT_READ_SHOWN })) : shown;
967
+ }
968
+ function keyNotReadLine(source, row) {
969
+ const events = row.events.map((e) => noticeLabel(e)).join(', ');
970
+ const hooks = `${row.count} ${events} ${row.count === 1 ? 'hook' : 'hooks'}`;
971
+ const coordinates = namedCoordinatesText(row.coordinates);
972
+ const line = renderMessage(msg(row.coordinates.length === 1 ? 'config.hooks.plan.keyNotRead.oneKey' : 'config.hooks.plan.keyNotRead.manyKeys', { layer: SOURCE_TEXT[source], hooks, coordinates }));
973
+ return row.onFailure ? renderMessage(msg('config.hooks.plan.keyNotRead.withOnFailure', { line })) : line;
974
+ }
975
+ function sourceNotAuthoredLine(source, row) {
976
+ const events = row.events.map((e) => noticeLabel(e)).join(', ');
977
+ const hooks = `${row.count} ${events} ${row.count === 1 ? 'hook' : 'hooks'}`;
978
+ const coordinates = namedCoordinatesText(row.coordinates);
979
+ return renderMessage(msg(row.coordinates.length === 1 ? 'config.hooks.plan.sourceNotAuthored.oneKey' : 'config.hooks.plan.sourceNotAuthored.manyKeys', { layer: SOURCE_TEXT[source], hooks, coordinates }));
980
+ }
901
981
  export function hooksNotRunNotice(plan) {
902
982
  const lines = [];
983
+ let closedBy;
984
+ try {
985
+ closedBy = isRecord(plan) ? readOwnDataValue(plan, 'closedBy') : undefined;
986
+ }
987
+ catch {
988
+ closedBy = undefined;
989
+ }
990
+ if (closedBy === 'policy_disable_all')
991
+ appendOwnElement(lines, renderMessage(msg('config.hooks.plan.disableAllHooks')));
903
992
  const byPlugin = new Map();
904
993
  for (const v of plan.verdicts) {
905
994
  if (v.disposition !== 'not_run')
@@ -916,9 +1005,27 @@ export function hooksNotRunNotice(plan) {
916
1005
  appendOwnElement(lines, `Plugin "${noticeLabel(row.name) || '(unnamed)'}": ${events} ${row.count === 1 ? 'hook' : 'hooks'} will not run — ${pluginHookReasonText(row.reason)}.`);
917
1006
  }
918
1007
  const bySource = new Map();
1008
+ const namedBySource = new Map();
919
1009
  for (const d of plan.settingsDropped) {
920
1010
  if (!d.notRun)
921
1011
  continue;
1012
+ const named = d.reason === 'key_not_read' || d.reason === 'source_not_authored' ? namedPathsOfRow(d) : [];
1013
+ if (named.length > 0 && (d.reason === 'key_not_read' || d.reason === 'source_not_authored')) {
1014
+ const nk = `${d.source}\u0000${d.reason}`;
1015
+ const row = namedBySource.get(nk) ?? { source: d.source, reason: d.reason, events: [], count: 0, coordinates: [], onFailure: false };
1016
+ if (!row.events.includes(d.event))
1017
+ appendOwnElement(row.events, d.event);
1018
+ row.count++;
1019
+ for (const path of named) {
1020
+ const c = hooksKeyCoordinateText(path);
1021
+ if (!row.coordinates.includes(c))
1022
+ appendOwnElement(row.coordinates, c);
1023
+ if (d.reason === 'key_not_read' && path[path.length - 1] === 'onFailure')
1024
+ row.onFailure = true;
1025
+ }
1026
+ namedBySource.set(nk, row);
1027
+ continue;
1028
+ }
922
1029
  const k = `${d.source}\u0000${d.reason}`;
923
1030
  const row = bySource.get(k) ?? { source: d.source, reason: d.reason, events: [], count: 0 };
924
1031
  if (!row.events.includes(d.event))
@@ -930,6 +1037,8 @@ export function hooksNotRunNotice(plan) {
930
1037
  const events = row.events.map((e) => noticeLabel(e)).join(', ');
931
1038
  appendOwnElement(lines, `${SOURCE_TEXT[row.source]}: ${events} ${row.count === 1 ? 'hook' : 'hooks'} will not run — ${settingsHookDropText(row.reason)}.`);
932
1039
  }
1040
+ for (const row of namedBySource.values())
1041
+ appendOwnElement(lines, row.reason === 'key_not_read' ? keyNotReadLine(row.source, row) : sourceNotAuthoredLine(row.source, row));
933
1042
  const settingsVerdicts = plan.settingsVerdicts;
934
1043
  const byVerdict = new Map();
935
1044
  for (const raw of Array.isArray(settingsVerdicts) ? settingsVerdicts : []) {
@@ -15,6 +15,7 @@ export interface QueueEntry {
15
15
  readonly intentKey?: string;
16
16
  readonly screening?: 'pending' | 'result';
17
17
  readonly upsExecutor?: 'shell' | 'engine' | 'unknown' | 'none';
18
+ readonly _sema_task_notification?: {} | null | undefined;
18
19
  }
19
20
  export type QueuedHoldReason = 'barrier' | 'share_incomplete' | 'not_steerable' | 'in_flight' | 'attempted' | 'no_run';
20
21
  export interface QueuedDeliveryPlan {
@@ -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
  }
@@ -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
- return readFrameTrueMark(frame, '_sema_error_code_in_text') ? true : undefined;
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
- export const RESUME_REFUSAL_CODES = Object.freeze([
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 === RESUME_PLACEMENT_MISMATCH) {
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
- if (detail.code === RESUME_PLACEMENT_MISMATCH)
33
- return renderMessage(msg('resume.refusal.placementMismatch'), lang);
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 { PermissionMode } from './permissionWireCaps.js';
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 mode = displayUntrusted(outcome.permissionMode.effective, { max: 64 });
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
- return renderMessage(msg('session.permissionModeSwitch.unavailable'), lang);
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
  }
@@ -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, CcImportRedeemResult, CcImportSettingsLayer, CcImportSkippedRule, PersistedRule, RuleRevokeRequest, RuleRevokeResult, ApprovalDecideGateKind, PlanReviewGateKind, } 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, CcImportSettingsLayer, CcImportSkippedRule, PersistedRule, RuleRevokeRequest, RuleRevokeResult, ApprovalDecideGateKind, PlanReviewGateKind, } from '@sema-agent/sdk';
@@ -15,12 +15,13 @@ 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;
22
22
  }
23
23
  export type SeatValidation = true | SeatValidationFailure;
24
+ export declare const isSecretKeyName: (k: string) => boolean;
24
25
  export type EipcMethodKind = "invoke" | "event";
25
26
  export interface EipcMethodSpec {
26
27
  kind: EipcMethodKind;
@@ -200,7 +201,7 @@ export type SeatStreamReading = {
200
201
  };
201
202
  export declare function seatStreamDeltaMessage(event: SeatStreamDeltaSource, ids: SeatStreamDeltaIds): SeatStreamEventMessage | undefined;
202
203
  export declare function readSeatStreamDelta(message: object): SeatStreamReading;
203
- 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"];
204
205
  export type SeatCapabilityName = (typeof SEAT_CAPABILITY_NAMES)[number];
205
206
  export interface SeatCapabilitiesState {
206
207
  pickFolder?: boolean;
@@ -214,6 +215,7 @@ export interface SeatCapabilitiesState {
214
215
  thinkingLatch?: boolean;
215
216
  computerUseSwitch?: boolean;
216
217
  engineModeDefaultOnly?: boolean;
218
+ seatActions?: boolean;
217
219
  }
218
220
  export type SeatCapabilityReading = {
219
221
  readonly kind: "reported";
@@ -253,6 +255,7 @@ export interface StartSessionOptions {
253
255
  title?: string;
254
256
  cwd?: string;
255
257
  excludeTools?: string[];
258
+ engine?: SessionEngineKind;
256
259
  }
257
260
  export type PermissionModeIntent = PermissionMode;
258
261
  export declare const PERMISSION_MODE_INTENTS: readonly PermissionModeIntent[];
@@ -311,6 +314,9 @@ export declare const ATTACHMENT_UPLOAD_REQUEST_KEYS: readonly ["name", "mimeType
311
314
  export interface SessionScopedRequest {
312
315
  sessionId: string;
313
316
  }
317
+ export interface SeatResourceScope {
318
+ sessionId: string;
319
+ }
314
320
  export interface SessionRowPatchRequest extends SessionRowPatchFields {
315
321
  sessionId: string;
316
322
  }
@@ -398,7 +404,7 @@ export interface SeatDeviceRevokeRequest {
398
404
  }
399
405
  export declare const checkSeatDeviceRebindRequest: (v: unknown) => SeatValidation;
400
406
  export declare const checkSeatDeviceRevokeRequest: (v: unknown) => SeatValidation;
401
- 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"];
402
408
  export type EngineTargetRefusal = (typeof ENGINE_TARGET_REFUSALS)[number];
403
409
  export declare const CLOUD_LOGIN_FAILURES: readonly ["access_denied", "expired_token", "invalid_grant", "cancelled", "transport", "refused", "no_tokens", "other"];
404
410
  export type CloudLoginFailure = (typeof CLOUD_LOGIN_FAILURES)[number];
@@ -645,6 +651,32 @@ export type SetComputerUsePlan = {
645
651
  readonly reason: Exclude<ComputerUseRefusalReason, "write-failed">;
646
652
  };
647
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[];
648
680
  export interface LocalSessionsApi {
649
681
  start(opts?: StartSessionOptions): Promise<LocalSessionRecord>;
650
682
  sendMessage(req: SendMessageRequest): Promise<SendMessageAck>;
@@ -658,8 +690,8 @@ export interface LocalSessionsApi {
658
690
  setModel(sessionId: string, model: string): Promise<boolean>;
659
691
  getTranscript(sessionId: string): Promise<GetTranscriptResult>;
660
692
  searchSessions(query: string): Promise<SessionSearchEnvelope>;
661
- uploadAttachment(req: AttachmentUploadRequest): Promise<AttachmentUploadReceipt>;
662
- listModels(): Promise<LiveModelCatalog>;
693
+ uploadAttachment(req: AttachmentUploadRequest, scope?: SeatResourceScope): Promise<AttachmentUploadReceipt>;
694
+ listModels(scope?: SeatResourceScope): Promise<LiveModelCatalog>;
663
695
  applyModelConfig(req: ApplyModelConfigRequest): Promise<ApplyModelConfigResult>;
664
696
  pickFolder(): Promise<string | null>;
665
697
  listRecentFolders(): Promise<RecentFoldersResult>;
@@ -685,8 +717,10 @@ export interface LocalSessionsApi {
685
717
  setThinkingLatch(req: SetThinkingLatchRequest): Promise<OkAck>;
686
718
  getComputerUse(): Promise<ComputerUseState>;
687
719
  setComputerUse(req: SetComputerUseRequest): Promise<SetComputerUseResult>;
720
+ claimSeatActions(req: SeatActionsClaim): Promise<OkAck>;
688
721
  onEvent(cb: (ev: LocalSessionEvent) => void): () => void;
689
722
  onToolPermissionRequest(cb: (req: ToolPermissionRequest) => void): () => void;
723
+ onSeatAction(cb: (action: SeatAction) => void): () => void;
690
724
  sessionsStateStore: EipcStoreClient<SessionsState>;
691
725
  focusedSessionStateStore: EipcStoreClient<FocusedSessionState>;
692
726
  settingsStateStore: EipcStoreClient<SettingsState>;
@@ -728,11 +762,13 @@ export declare const checkSessionRowPatchRequest: (v: unknown) => SeatValidation
728
762
  export declare function isSessionRowPatchRequest(v: unknown): v is SessionRowPatchRequest;
729
763
  export declare const checkSetThinkingLatchRequest: (v: unknown) => SeatValidation;
730
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;
731
767
  export declare function isSendMessageAck(v: unknown): v is SendMessageAck;
732
768
  export declare const LOCAL_SESSIONS_SPEC: EipcServiceSpec;
733
- 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"];
734
770
  export declare const SEAT_STORE_PROPS: readonly ["sessionsStateStore", "focusedSessionStateStore", "settingsStateStore", "seatCapabilitiesStateStore", "engineTargetStateStore"];
735
- export declare const SEAT_EVENT_METHOD_NAMES: readonly ["onEvent", "onToolPermissionRequest"];
771
+ export declare const SEAT_EVENT_METHOD_NAMES: readonly ["onEvent", "onToolPermissionRequest", "onSeatAction"];
736
772
  export declare const LOCAL_SESSION_EVENT_KEYS: readonly ["type", "sessionId", "message", "error", "errorCategory", "code", "session", "userMessageUuid", "requestId", "outcome", "parked", "chrome", "_sema_turnFailure", "subagentContent"];
737
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"];
738
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"];
@@ -780,7 +816,7 @@ export declare const SEAT_SEND_MESSAGE_KEY_ORIGINS: {
780
816
  };
781
817
  };
782
818
  export declare const TOOL_PERMISSION_DECISION_KEYS: readonly ["sessionId", "requestId", "decision", "answer", "updatedInput", "remember"];
783
- 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"];
784
820
  export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
785
821
  readonly LocalSessionRecord: {
786
822
  readonly guard: "isLocalSessionRecord";
@@ -854,6 +890,9 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
854
890
  }, {
855
891
  readonly key: "modelPlane";
856
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);出站门为它拒掉整份目录 = 选单为一份受理数据整个消失。";
857
896
  }];
858
897
  };
859
898
  readonly SendMessageRequest: {
@@ -874,6 +913,21 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
874
913
  readonly validated: readonly ["sessionId", "event"];
875
914
  readonly unchecked: readonly [];
876
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
+ };
877
931
  readonly ApplyModelConfigResult: {
878
932
  readonly check: (v: unknown) => SeatValidation;
879
933
  readonly validated: readonly ["ok", "requiresRestart", "reason", "detail"];
@@ -927,7 +981,7 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
927
981
  };
928
982
  readonly SeatCapabilitiesState: {
929
983
  readonly check: (v: unknown) => SeatValidation;
930
- 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"];
931
985
  readonly unchecked: readonly [];
932
986
  };
933
987
  readonly RecentFoldersResult: {
@@ -967,7 +1021,7 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
967
1021
  };
968
1022
  };
969
1023
  export declare const SEAT_VALIDATOR_COVERAGE_EXEMPT: readonly [...{
970
- 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";
971
1025
  check: (v: unknown) => SeatValidation;
972
1026
  why: string;
973
1027
  }[], {