agl 43.0.5 → 43.2.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 (216) hide show
  1. package/changelog.md +30 -0
  2. package/dist_serve/bundle.js +5996 -5280
  3. package/dist_serve/bundle.js.map +2 -2
  4. package/dist_serve/bundle.js.third-party-notices.json +30 -30
  5. package/dist_serve/bundle.js.third-party-notices.txt +30 -30
  6. package/dist_serve/third-party-notices.md +1 -1
  7. package/dist_ts/00_commitinfo_data.js +1 -1
  8. package/dist_ts/aglapi/aglapisurface.document.js +805 -10
  9. package/dist_ts/aglapi/interfaces.d.ts +13 -0
  10. package/dist_ts/aglapi/interfaces.js +4 -1
  11. package/dist_ts/classes.authmodels.js +17 -4
  12. package/dist_ts/classes.authstore.js +16 -2
  13. package/dist_ts/classes.claudeharness.d.ts +14 -5
  14. package/dist_ts/classes.claudeharness.js +62 -2
  15. package/dist_ts/classes.cli.d.ts +4 -2
  16. package/dist_ts/classes.cli.js +6 -3
  17. package/dist_ts/classes.codexclientadapter.d.ts +7 -5
  18. package/dist_ts/classes.codexclientadapter.js +38 -3
  19. package/dist_ts/classes.controller.d.ts +19 -2
  20. package/dist_ts/classes.controller.js +234 -27
  21. package/dist_ts/classes.controllermanagement.d.ts +14 -4
  22. package/dist_ts/classes.controllermanagement.js +20 -2
  23. package/dist_ts/classes.gatewayclient.d.ts +115 -0
  24. package/dist_ts/classes.gatewayclient.js +336 -0
  25. package/dist_ts/classes.gatewayclientstore.d.ts +97 -0
  26. package/dist_ts/classes.gatewayclientstore.js +261 -0
  27. package/dist_ts/classes.inferencegateway.d.ts +8 -5
  28. package/dist_ts/classes.inferencegateway.js +62 -19
  29. package/dist_ts/classes.inferencerouter.d.ts +9 -0
  30. package/dist_ts/classes.inferencerouter.js +11 -1
  31. package/dist_ts/classes.inferenceservice.d.ts +9 -0
  32. package/dist_ts/classes.inferenceservice.js +27 -1
  33. package/dist_ts/classes.inferencespend.d.ts +9 -3
  34. package/dist_ts/classes.inferencespend.js +44 -16
  35. package/dist_ts/classes.mcpclient.d.ts +9 -4
  36. package/dist_ts/classes.mcpclient.js +24 -2
  37. package/dist_ts/classes.mcpcontrollerhost.d.ts +3 -1
  38. package/dist_ts/classes.mcpcontrollerhost.js +13 -1
  39. package/dist_ts/classes.mcptools.d.ts +3 -3
  40. package/dist_ts/classes.mcptools.js +42 -4
  41. package/dist_ts/classes.mcpvalidation.js +7 -1
  42. package/dist_ts/classes.opencodeclient.js +3 -1
  43. package/dist_ts/classes.proxycontrol.d.ts +33 -11
  44. package/dist_ts/classes.proxycontrol.js +12 -3
  45. package/dist_ts/classes.proxycontrolclient.d.ts +23 -5
  46. package/dist_ts/classes.proxycontrolclient.js +42 -6
  47. package/dist_ts/classes.proxydaemon.d.ts +8 -6
  48. package/dist_ts/classes.proxydaemon.js +42 -21
  49. package/dist_ts/classes.proxyleaseholder.d.ts +12 -4
  50. package/dist_ts/classes.proxyleaseholder.js +39 -9
  51. package/dist_ts/classes.proxymonitor.d.ts +7 -0
  52. package/dist_ts/classes.proxymonitor.js +13 -1
  53. package/dist_ts/classes.proxystore.d.ts +4 -3
  54. package/dist_ts/classes.proxystore.js +17 -7
  55. package/dist_ts/classes.sessionfeed.d.ts +1 -1
  56. package/dist_ts/classes.trustedproxysecrets.d.ts +2 -0
  57. package/dist_ts/classes.trustedproxysecrets.js +5 -1
  58. package/dist_ts/classes.validation.d.ts +7 -0
  59. package/dist_ts/classes.validation.js +49 -2
  60. package/dist_ts/driver/functions.drivertools.js +2 -2
  61. package/dist_ts/fleet/classes.codexworkers.d.ts +4 -11
  62. package/dist_ts/fleet/classes.codexworkers.js +6 -3
  63. package/dist_ts/fleet/classes.workers.d.ts +25 -13
  64. package/dist_ts/fleet/classes.workers.js +105 -9
  65. package/dist_ts/fleet/functions.workervalidation.d.ts +26 -1
  66. package/dist_ts/fleet/functions.workervalidation.js +40 -11
  67. package/dist_ts/fleet/interfaces.workers.d.ts +17 -11
  68. package/dist_ts/fleet/interfaces.workers.js +10 -1
  69. package/dist_ts/functions.confinedrelay.d.ts +21 -0
  70. package/dist_ts/functions.confinedrelay.js +65 -0
  71. package/dist_ts/functions.controllermanagementsurface.d.ts +4 -0
  72. package/dist_ts/functions.controllermanagementsurface.js +15 -1
  73. package/dist_ts/functions.deviceapi.d.ts +4 -2
  74. package/dist_ts/functions.deviceapi.js +20 -2
  75. package/dist_ts/functions.elicitation.d.ts +49 -0
  76. package/dist_ts/functions.elicitation.js +418 -0
  77. package/dist_ts/functions.gatewaycli.d.ts +24 -0
  78. package/dist_ts/functions.gatewaycli.js +395 -0
  79. package/dist_ts/functions.gatewayroute.d.ts +135 -0
  80. package/dist_ts/functions.gatewayroute.js +366 -0
  81. package/dist_ts/functions.inferencecli.d.ts +3 -3
  82. package/dist_ts/functions.inferencecli.js +62 -10
  83. package/dist_ts/functions.inferencecliarguments.d.ts +9 -2
  84. package/dist_ts/functions.inferencecliarguments.js +59 -10
  85. package/dist_ts/functions.inferencelaunch.d.ts +35 -7
  86. package/dist_ts/functions.inferencelaunch.js +143 -16
  87. package/dist_ts/functions.mcpfleetworkertools.d.ts +63 -70
  88. package/dist_ts/functions.mcpfleetworkertools.js +32 -4
  89. package/dist_ts/functions.proxycapacity.d.ts +50 -0
  90. package/dist_ts/functions.proxycapacity.js +142 -0
  91. package/dist_ts/functions.proxycapacitycli.d.ts +30 -0
  92. package/dist_ts/functions.proxycapacitycli.js +65 -0
  93. package/dist_ts/functions.proxycontract.d.ts +21 -4
  94. package/dist_ts/functions.proxycontract.js +12 -5
  95. package/dist_ts/functions.proxyharnessconfig.d.ts +7 -0
  96. package/dist_ts/functions.proxyharnessconfig.js +11 -1
  97. package/dist_ts/functions.remotecli.d.ts +30 -3
  98. package/dist_ts/functions.remotecli.js +44 -18
  99. package/dist_ts/interfaces.auth.d.ts +25 -4
  100. package/dist_ts/interfaces.auth.js +8 -1
  101. package/dist_ts/plugins.d.ts +2 -0
  102. package/dist_ts/plugins.js +4 -1
  103. package/dist_ts_authswitch/authority-placement.js +3 -17
  104. package/dist_ts_authswitch/authority-usagelimit.d.ts +29 -0
  105. package/dist_ts_authswitch/authority-usagelimit.js +66 -2
  106. package/dist_ts_authswitch/authority-usagewindows.d.ts +6 -0
  107. package/dist_ts_authswitch/authority-usagewindows.js +15 -1
  108. package/dist_ts_interfaces/devices.d.ts +133 -3
  109. package/dist_ts_interfaces/devices.js +3 -2
  110. package/dist_ts_interfaces/elicitations.d.ts +125 -0
  111. package/dist_ts_interfaces/elicitations.js +7 -0
  112. package/dist_ts_interfaces/fleetworkers.d.ts +119 -5
  113. package/dist_ts_interfaces/fleetworkers.js +14 -2
  114. package/dist_ts_interfaces/gateway.d.ts +151 -0
  115. package/dist_ts_interfaces/gateway.js +66 -0
  116. package/dist_ts_interfaces/index.d.ts +3 -0
  117. package/dist_ts_interfaces/index.js +4 -1
  118. package/dist_ts_interfaces/interfaces.d.ts +3 -1
  119. package/dist_ts_interfaces/interfaces.js +2 -2
  120. package/dist_ts_interfaces/management.d.ts +4 -4
  121. package/dist_ts_interfaces/management.js +3 -2
  122. package/dist_ts_interfaces/mcprequests.d.ts +18 -2
  123. package/dist_ts_interfaces/mcprequests.js +3 -1
  124. package/dist_ts_interfaces/nativesessions.d.ts +14 -0
  125. package/dist_ts_interfaces/proxycapacity.d.ts +99 -0
  126. package/dist_ts_interfaces/proxycapacity.js +74 -0
  127. package/dist_ts_interfaces/requests.d.ts +3 -3
  128. package/dist_ts_interfaces/requests.fleetworkers.js +2 -2
  129. package/dist_ts_interfaces/requests.js +1 -1
  130. package/dist_ts_interfaces/requests.promptreply.d.ts +18 -0
  131. package/dist_ts_interfaces/sessionfeed.d.ts +3 -2
  132. package/dist_ts_interfaces/sessionfeed.js +1 -1
  133. package/package.json +5 -4
  134. package/readme.md +267 -26
  135. package/third-party-notices.md +1 -1
  136. package/ts/00_commitinfo_data.ts +1 -1
  137. package/ts/aglapi/aglapisurface.document.ts +804 -9
  138. package/ts/aglapi/interfaces.ts +3 -0
  139. package/ts/classes.authmodels.ts +22 -3
  140. package/ts/classes.authstore.ts +15 -1
  141. package/ts/classes.claudeharness.ts +80 -9
  142. package/ts/classes.cli.ts +7 -3
  143. package/ts/classes.codexclientadapter.ts +41 -5
  144. package/ts/classes.controller.ts +276 -32
  145. package/ts/classes.controllermanagement.ts +40 -7
  146. package/ts/classes.gatewayclient.ts +401 -0
  147. package/ts/classes.gatewayclientstore.ts +272 -0
  148. package/ts/classes.inferencegateway.ts +69 -23
  149. package/ts/classes.inferencerouter.ts +12 -0
  150. package/ts/classes.inferenceservice.ts +27 -0
  151. package/ts/classes.inferencespend.ts +46 -13
  152. package/ts/classes.mcpclient.ts +26 -4
  153. package/ts/classes.mcpcontrollerhost.ts +17 -0
  154. package/ts/classes.mcptools.ts +47 -5
  155. package/ts/classes.mcpvalidation.ts +5 -0
  156. package/ts/classes.opencodeclient.ts +2 -0
  157. package/ts/classes.proxycontrol.ts +43 -13
  158. package/ts/classes.proxycontrolclient.ts +39 -6
  159. package/ts/classes.proxydaemon.ts +57 -27
  160. package/ts/classes.proxyleaseholder.ts +43 -11
  161. package/ts/classes.proxymonitor.ts +12 -0
  162. package/ts/classes.proxystore.ts +21 -8
  163. package/ts/classes.sessionfeed.ts +1 -1
  164. package/ts/classes.trustedproxysecrets.ts +5 -0
  165. package/ts/classes.validation.ts +52 -0
  166. package/ts/driver/functions.drivertools.ts +1 -1
  167. package/ts/fleet/classes.codexworkers.ts +8 -6
  168. package/ts/fleet/classes.workers.ts +101 -17
  169. package/ts/fleet/functions.workervalidation.ts +35 -9
  170. package/ts/fleet/interfaces.workers.ts +11 -4
  171. package/ts/functions.confinedrelay.ts +65 -0
  172. package/ts/functions.controllermanagementsurface.ts +15 -0
  173. package/ts/functions.deviceapi.ts +24 -1
  174. package/ts/functions.elicitation.ts +443 -0
  175. package/ts/functions.gatewaycli.ts +436 -0
  176. package/ts/functions.gatewayroute.ts +429 -0
  177. package/ts/functions.inferencecli.ts +62 -13
  178. package/ts/functions.inferencecliarguments.ts +56 -9
  179. package/ts/functions.inferencelaunch.ts +143 -16
  180. package/ts/functions.mcpfleetworkertools.ts +34 -4
  181. package/ts/functions.proxycapacity.ts +191 -0
  182. package/ts/functions.proxycapacitycli.ts +104 -0
  183. package/ts/functions.proxycontract.ts +17 -4
  184. package/ts/functions.proxyharnessconfig.ts +11 -0
  185. package/ts/functions.remotecli.ts +56 -20
  186. package/ts/interfaces.auth.ts +29 -4
  187. package/ts/plugins.ts +5 -0
  188. package/ts_authswitch/authority-placement.ts +2 -15
  189. package/ts_authswitch/authority-usagelimit.ts +84 -1
  190. package/ts_authswitch/authority-usagewindows.ts +13 -0
  191. package/ts_interfaces/devices.schema.json +476 -2
  192. package/ts_interfaces/devices.ts +146 -2
  193. package/ts_interfaces/elicitations.ts +148 -0
  194. package/ts_interfaces/fleetworkers.ts +96 -4
  195. package/ts_interfaces/gateway.ts +242 -0
  196. package/ts_interfaces/index.ts +3 -0
  197. package/ts_interfaces/interfaces.ts +3 -1
  198. package/ts_interfaces/management.ts +6 -4
  199. package/ts_interfaces/mcprequests.ts +19 -0
  200. package/ts_interfaces/nativesessions.ts +16 -0
  201. package/ts_interfaces/proxycapacity.ts +162 -0
  202. package/ts_interfaces/requests.fleetworkers.ts +1 -1
  203. package/ts_interfaces/requests.promptreply.ts +22 -0
  204. package/ts_interfaces/requests.ts +4 -0
  205. package/ts_interfaces/sessionfeed.ts +3 -2
  206. package/ts_web/00_commitinfo_data.ts +1 -1
  207. package/ts_web/classes.browserpresentation.ts +13 -5
  208. package/ts_web/classes.elicitationcards.ts +106 -0
  209. package/ts_web/classes.nativesessionstate.ts +38 -1
  210. package/ts_web/elements.accounts.ts +40 -113
  211. package/ts_web/elements.configurationpane.ts +24 -37
  212. package/ts_web/elements.devices.ts +4 -17
  213. package/ts_web/elements.fleetworker.ts +27 -2
  214. package/ts_web/elements.flexlimitstrip.ts +21 -70
  215. package/ts_web/elements.harnesscontrollerapp.ts +159 -186
  216. package/ts_web/functions.sessionchat.ts +5 -0
@@ -35,6 +35,7 @@ import { deploymentsAttentionCount, deploymentsHref } from './functions.deployme
35
35
  import { AglFleetWorker } from './elements.fleetworker.js';
36
36
  import { AglNativeSession } from './elements.nativesession.js';
37
37
  import type { ISessionIntelligenceRemedyDetail } from './classes.nativesessionstate.js';
38
+ import { ElicitationCards, elicitationReply } from './classes.elicitationcards.js';
38
39
  import {
39
40
  renderSessionChat,
40
41
  sessionIntelligenceAvailabilityAction,
@@ -229,6 +230,7 @@ interface IConversationChatView extends Pick<
229
230
  | 'loadEarlierHistory'
230
231
  | 'permissions'
231
232
  | 'questions'
233
+ | 'elicitations'
232
234
  | 'transcriptKey'
233
235
  | 'hasEarlierMessages'
234
236
  | 'loadingEarlier'
@@ -673,6 +675,7 @@ const globalAutoAcceptModeOptions: plugins.deesCatalog.IHarnessComposerOption[]
673
675
  { label: 'Yolo', value: 'Yolo', description: 'Settings accept every permission request automatically.' },
674
676
  ];
675
677
  const emptyHarnessQuestions: plugins.deesCatalog.IHarnessQuestionRequest[] = [];
678
+ const emptyHarnessElicitations: plugins.deesCatalog.IHarnessElicitationRequest[] = [];
676
679
  const emptyHarnessAttachments: plugins.deesCatalog.IHarnessAttachment[] = [];
677
680
  const emptyHarnessPermissions: plugins.deesCatalog.IHarnessPermissionRequest[] = [];
678
681
  const emptyHarnessTodos: plugins.deesCatalog.IHarnessTodoItem[] = [];
@@ -1141,6 +1144,22 @@ const codexRejoinIsRunning = (rejoinArg: interfaces.IControllerCodexRejoinStatus
1141
1144
  */
1142
1145
  const codexUsageLimitNotice = 'To run Codex on another account, choose Use for Codex on it in Settings → Accounts.';
1143
1146
 
1147
+ /**
1148
+ * The harnesses a new conversation can run on, in the order the New conversation box offers them. Its toggle is
1149
+ * `allowEmpty`: nothing is chosen until the owner picks, so AGL never starts a harness nobody chose.
1150
+ */
1151
+ const newConversationHarnesses = ['opencode', 'flex', 'codex', 'claude'] as const satisfies readonly TBrowserSessionHarnessId[];
1152
+ const newConversationHarnessOptions: plugins.deesCatalog.TMultitoggleOption[] = newConversationHarnesses.map(
1153
+ (harnessIdArg) => ({ key: harnessIdArg, label: sessionHarnessLabel(harnessIdArg) }),
1154
+ );
1155
+
1156
+ /** Codex's collaboration modes as the activity strip offers them; Plan keeps its tone while it is the mode. */
1157
+ const codexCollaborationModes = ['default', 'plan'] as const satisfies readonly interfaces.TControllerCodexCollaborationMode[];
1158
+ const codexCollaborationModeOptions: plugins.deesCatalog.TMultitoggleOption[] = [
1159
+ { key: 'default', label: 'Default' },
1160
+ { key: 'plan', label: 'Plan', tone: 'info' },
1161
+ ];
1162
+
1144
1163
  const codexModeOutcomeUnknownNotice = 'The Codex mode change outcome is unknown. Send, Steer, Queue, slash commands, and model changes are unavailable for this conversation.';
1145
1164
 
1146
1165
  export const controllerClampSidebarWidth = (widthArg: number): number => Math.min(
@@ -1179,7 +1198,11 @@ export const boundedNewestMessageBundles = (
1179
1198
  return { bundles, limited: bundles.length !== bundlesArg.length };
1180
1199
  };
1181
1200
 
1182
- /** The list's row of a feed row: the same fields without where it opens, which only the app acts on. */
1201
+ /**
1202
+ * The list's row of a feed row: the same fields without where it opens, which only the app acts on. A row's native
1203
+ * wait and its interrupted label are the list's own fields too: it says where a needs-input row waits and that a
1204
+ * completed row's turn was interrupted (dees-catalog ≥ 24.2.0).
1205
+ */
1183
1206
  const sessionFeedListRow = (
1184
1207
  { open: _open, ...rowArg }: interfaces.IControllerSessionFeedRow,
1185
1208
  ): plugins.deesCatalog.IHarnessSessionRow => rowArg;
@@ -1277,6 +1300,10 @@ const concatBytes = (chunksArg: readonly Uint8Array[]): Uint8Array => {
1277
1300
  return bytes;
1278
1301
  };
1279
1302
 
1303
+ /** The controller refused an elicitation answer: it does not fit the request, or the request is gone. */
1304
+ const isElicitationRefusal = (errorArg: unknown): boolean => errorArg instanceof plugins.typedrequest.TypedResponseError
1305
+ && (errorArg.errorData?.code === 'invalid_request' || errorArg.errorData?.code === 'not_found');
1306
+
1280
1307
  const errorMessage = (errorArg: unknown): string => {
1281
1308
  if (errorArg instanceof Error && errorArg.message) {
1282
1309
  return errorArg.message;
@@ -1562,13 +1589,7 @@ class AglSystemStatsPanel extends plugins.deesElement.DeesElement {
1562
1589
  h2 { margin: 0; font-size: 14px; font-weight: 700; }
1563
1590
  .freshness { margin-top: 3px; color: var(--dees-color-text-muted); font-size: 11px; }
1564
1591
  .freshness.stale { color: var(--dees-color-text-warning); }
1565
- .close {
1566
- flex: 0 0 auto; border: 1px solid var(--dees-color-border-subtle);
1567
- border-radius: var(--dees-radius-sm); padding: 3px 8px;
1568
- background: transparent; color: inherit; font: inherit; cursor: pointer;
1569
- }
1570
- .close:hover, .close:focus-visible { background: var(--dees-color-bg-secondary); }
1571
- .close:focus-visible { outline: 2px solid var(--dees-color-accent-primary); outline-offset: 2px; }
1592
+ .close { flex: 0 0 auto; }
1572
1593
  .summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 13px; }
1573
1594
  .summary.stale .stat { border-style: dashed; }
1574
1595
  .summary.stale .statLabel,
@@ -1613,7 +1634,7 @@ class AglSystemStatsPanel extends plugins.deesElement.DeesElement {
1613
1634
  }
1614
1635
 
1615
1636
  public focusClose(): void {
1616
- this.shadowRoot?.querySelector<HTMLButtonElement>('.close')?.focus({ preventScroll: true });
1637
+ void this.shadowRoot?.querySelector<plugins.deesCatalog.DeesButton>('.close')?.focus({ preventScroll: true });
1617
1638
  }
1618
1639
 
1619
1640
  private readonly requestClose = (): void => {
@@ -1731,7 +1752,7 @@ class AglSystemStatsPanel extends plugins.deesElement.DeesElement {
1731
1752
  : `Live sample ${formatMetricTime(metrics!.sampledAt)} · ${ageSeconds}s old${stale ? ' · stale' : ''}`}
1732
1753
  </div>
1733
1754
  </div>
1734
- <button class="close" type="button" @click=${this.requestClose}>Close</button>
1755
+ <dees-button class="close" size="sm" @clicked=${this.requestClose}>Close</dees-button>
1735
1756
  </div>
1736
1757
  <div class=${`summary ${stale ? 'stale' : ''}`}>
1737
1758
  <div class="stat"><span class="statLabel">CPU · whole system</span><span class=${`statValue ${this.highCpuWarning ? 'critical' : ''}`}>${formatPercentage(metrics?.cpuUsagePercent)}</span>
@@ -2348,6 +2369,8 @@ export class HarnessControllerApp extends plugins.deesElement.DeesElement {
2348
2369
  // OpenCode drops them from its pending lists; cleared on session switch.
2349
2370
  private readonly answeredQuestionCards = new Map<string, plugins.deesCatalog.IHarnessQuestionRequest>();
2350
2371
  private readonly answeredPermissionCards = new Map<string, plugins.deesCatalog.IHarnessPermissionRequest>();
2372
+ // MCP elicitation cards of the viewed session: a card and its refusal keep their objects across renders.
2373
+ private readonly elicitationCards = new ElicitationCards(controllerRuntimeIdToUiKey);
2351
2374
  // Multi-question requests answer card-by-card; the reply fires once all
2352
2375
  // cards of the request are in.
2353
2376
  private readonly pendingQuestionBatchAnswers = new Map<string, Map<number, string[]>>();
@@ -2888,20 +2911,9 @@ export class HarnessControllerApp extends plugins.deesElement.DeesElement {
2888
2911
  transform: none;
2889
2912
  }
2890
2913
 
2914
+ /* The link sits centred under the sign-in; stretched, its host would be wider than the face a click reaches. */
2891
2915
  .tempPasswordToggle {
2892
- appearance: none;
2893
- border: none;
2894
- background: transparent;
2895
- padding: var(--dees-spacing-sm);
2896
- color: var(--dees-color-text-secondary);
2897
- font: inherit;
2898
- font-size: var(--dees-font-control-size-sm);
2899
- text-decoration: underline;
2900
- cursor: pointer;
2901
- }
2902
-
2903
- .tempPasswordToggle:hover {
2904
- color: var(--dees-color-text-primary);
2916
+ align-self: center;
2905
2917
  }
2906
2918
 
2907
2919
  .tempPasswordForm {
@@ -3152,49 +3164,6 @@ export class HarnessControllerApp extends plugins.deesElement.DeesElement {
3152
3164
  margin: 0;
3153
3165
  }
3154
3166
 
3155
- .pathSuggestionHint {
3156
- padding: 4px var(--dees-spacing-sm);
3157
- color: var(--dees-color-text-muted);
3158
- font-size: var(--dees-font-caption2-size);
3159
- line-height: 1.4;
3160
- }
3161
-
3162
- .pathSuggestionList {
3163
- display: grid;
3164
- max-height: 190px;
3165
- overflow-y: auto;
3166
- padding: var(--dees-spacing-xs);
3167
- gap: 2px;
3168
- border-bottom: 1px solid var(--dees-color-border-subtle);
3169
- background: var(--dees-color-bg-primary);
3170
- }
3171
-
3172
- .pathSuggestion {
3173
- display: flex;
3174
- align-items: center;
3175
- gap: var(--dees-spacing-sm);
3176
- width: 100%;
3177
- padding: 6px var(--dees-spacing-sm);
3178
- border: none;
3179
- border-radius: var(--dees-radius-md);
3180
- background: transparent;
3181
- color: var(--dees-color-text-primary);
3182
- font-family: var(--dees-font-family-mono);
3183
- font-size: var(--dees-font-caption1-size);
3184
- text-align: left;
3185
- cursor: pointer;
3186
- }
3187
-
3188
- .pathSuggestion:hover {
3189
- background: var(--dees-color-bg-secondary);
3190
- }
3191
-
3192
- .pathSuggestion span {
3193
- overflow: hidden;
3194
- text-overflow: ellipsis;
3195
- white-space: nowrap;
3196
- }
3197
-
3198
3167
  .projectsRootHint {
3199
3168
  padding: var(--dees-spacing-xs) var(--dees-spacing-sm) 0;
3200
3169
  color: var(--dees-color-text-secondary);
@@ -3370,54 +3339,8 @@ export class HarnessControllerApp extends plugins.deesElement.DeesElement {
3370
3339
  color: var(--dees-color-text-primary);
3371
3340
  }
3372
3341
 
3373
- .codexCollaborationModeButtons {
3374
- display: inline-flex;
3342
+ .codexCollaborationModeToggle {
3375
3343
  min-width: 150px;
3376
- padding: 2px;
3377
- border-radius: var(--dees-radius-lg);
3378
- background: var(--dees-color-fill-tertiary);
3379
- }
3380
-
3381
- .codexCollaborationModeButton {
3382
- flex: 1 1 0;
3383
- min-height: 24px;
3384
- padding: 1px 10px;
3385
- border: 0;
3386
- border-radius: calc(var(--dees-radius-lg) - 2px);
3387
- background: transparent;
3388
- color: var(--dees-color-text-secondary);
3389
- font: 600 12px/1.35 var(--dees-font-family);
3390
- cursor: pointer;
3391
- }
3392
-
3393
- .codexCollaborationModeButton[aria-pressed='true'] {
3394
- background: var(--dees-color-control-thumb);
3395
- color: var(--dees-color-text-primary);
3396
- box-shadow: var(--dees-shadow-xs);
3397
- }
3398
-
3399
- .codexCollaborationModeButton.plan[aria-pressed='true'] {
3400
- background: color-mix(in srgb, var(--dees-color-accent-primary) 14%, var(--dees-color-control-thumb));
3401
- color: var(--dees-color-accent-primary);
3402
- box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dees-color-accent-primary) 45%, transparent);
3403
- }
3404
-
3405
- .codexCollaborationModeButton:focus-visible {
3406
- outline: 2px solid var(--dees-color-focus-ring);
3407
- outline-offset: 1px;
3408
- }
3409
-
3410
- .codexCollaborationModeButton:disabled {
3411
- opacity: .5;
3412
- cursor: default;
3413
- }
3414
-
3415
- .codexCollaborationModeButton[aria-pressed='true']:disabled {
3416
- opacity: 1;
3417
- }
3418
-
3419
- @media (pointer: coarse) {
3420
- .codexCollaborationModeButton { min-height: 44px; }
3421
3344
  }
3422
3345
 
3423
3346
  .codexDiffSummary {
@@ -3863,7 +3786,6 @@ export class HarnessControllerApp extends plugins.deesElement.DeesElement {
3863
3786
  text-transform: uppercase;
3864
3787
  }
3865
3788
 
3866
- .newConversationHarnesses,
3867
3789
  .newConversationSecondary {
3868
3790
  display: flex;
3869
3791
  flex-wrap: wrap;
@@ -3881,20 +3803,6 @@ export class HarnessControllerApp extends plugins.deesElement.DeesElement {
3881
3803
  gap: var(--dees-spacing-xs);
3882
3804
  }
3883
3805
 
3884
- .newConversationStandardDir {
3885
- display: flex;
3886
- align-items: center;
3887
- gap: var(--dees-spacing-xs);
3888
- padding: 3px 8px;
3889
- border: 1px solid var(--dees-color-border-subtle);
3890
- border-radius: var(--dees-radius-lg);
3891
- background: transparent;
3892
- color: var(--dees-color-text-muted);
3893
- font: inherit;
3894
- font-size: 12px;
3895
- cursor: pointer;
3896
- }
3897
-
3898
3806
  .statusBar {
3899
3807
  position: relative;
3900
3808
  display: flex;
@@ -12538,6 +12446,18 @@ export class HarnessControllerApp extends plugins.deesElement.DeesElement {
12538
12446
  || modeChanging;
12539
12447
  const modeDispatchFenced = isSessionRuntimeId(detailArg.session.id)
12540
12448
  && this.codexModeDispatchIsFenced(detailArg.session.id);
12449
+ // The mode the toggle shows: only one Codex confirmed. Without one it shows none, and then it is always disabled,
12450
+ // so no choice is offered or drawn while the mode is unknown. A mode change in flight or of unknown outcome and a
12451
+ // Codex that is not ready disable it as well.
12452
+ const modeShown = !modeUnconfirmed && activity.collaborationMode ? activity.collaborationMode.mode : '';
12453
+ const modeDisabled = modeShown === ''
12454
+ || modeDispatchFenced
12455
+ || !this.codexHarnessIsReady();
12456
+ // A running turn, another writer or another composer request in flight: the confirmed mode stays legible at full
12457
+ // contrast, but no pointer or key changes it.
12458
+ const modeReadOnly = this.composerMutationPending()
12459
+ || turnRunning
12460
+ || activity.writer !== 'idle';
12541
12461
  const steeringHint = activity.writer === 'agl'
12542
12462
  && turnRunning
12543
12463
  && !modeDispatchFenced
@@ -12577,22 +12497,23 @@ export class HarnessControllerApp extends plugins.deesElement.DeesElement {
12577
12497
  ${modeControlVisible ? plugins.deesElement.html`
12578
12498
  <div class="codexCollaborationMode">
12579
12499
  <span class="codexCollaborationModeLabel">Mode</span>
12580
- <div class="codexCollaborationModeButtons" role="group" aria-label="Codex collaboration mode">
12581
- ${(['default', 'plan'] as const).map((modeArg) => plugins.deesElement.html`
12582
- <button
12583
- class=${`codexCollaborationModeButton ${modeArg}`}
12584
- type="button"
12585
- aria-pressed=${!modeUnconfirmed
12586
- && activity.collaborationMode?.mode === modeArg}
12587
- ?disabled=${this.composerMutationPending()
12588
- || modeDispatchFenced
12589
- || !this.codexHarnessIsReady()
12590
- || turnRunning
12591
- || activity.writer !== 'idle'}
12592
- @click=${() => this.updateCodexCollaborationMode(modeArg)}
12593
- >${modeArg === 'plan' ? 'Plan' : 'Default'}</button>
12594
- `)}
12595
- </div>
12500
+ <dees-input-multitoggle
12501
+ class="codexCollaborationModeToggle"
12502
+ size="sm"
12503
+ label="Codex collaboration mode"
12504
+ .labelPosition=${'none'}
12505
+ .options=${codexCollaborationModeOptions}
12506
+ .selectedOption=${modeShown}
12507
+ .disabled=${modeDisabled}
12508
+ .readOnly=${modeReadOnly}
12509
+ @change=${(eventArg: Event) => {
12510
+ // The toggle shows the mode Codex confirmed: the pick goes back at once and is only a request.
12511
+ const toggle = eventArg.currentTarget as plugins.deesCatalog.DeesInputMultitoggle;
12512
+ const picked = codexCollaborationModes.find((modeArg) => modeArg === toggle.selectedOption);
12513
+ toggle.selectedOption = modeShown;
12514
+ if (picked) this.updateCodexCollaborationMode(picked);
12515
+ }}
12516
+ ></dees-input-multitoggle>
12596
12517
  </div>
12597
12518
  ` : ''}
12598
12519
  ${turnDiff ? plugins.deesElement.html`
@@ -13950,6 +13871,55 @@ ${entry.detail.stack}`}</pre>`}
13950
13871
  if (request) void this.replyToPermission(request.id, reply, childAttention);
13951
13872
  };
13952
13873
 
13874
+ /** The owner's answer to an MCP elicitation card: sent as it is, and kept nowhere but the card. */
13875
+ private readonly handleElicitationResponse = (
13876
+ eventArg: CustomEvent<plugins.deesCatalog.IHarnessElicitationResponseDetail>,
13877
+ ): void => {
13878
+ const cardId = eventArg.detail?.requestId;
13879
+ if (!isNonEmptyString(cardId)) return;
13880
+ const request = this.elicitationCards.request(cardId), reply = elicitationReply(eventArg.detail);
13881
+ if (request && reply) void this.replyToElicitation(cardId, request.id, reply);
13882
+ };
13883
+
13884
+ /**
13885
+ * Answers an MCP elicitation of the conversation on screen. The controller checks the answer against the request; its
13886
+ * refusal, or an answer that could not be sent, shows on the card, which then takes an answer again. A refusal is
13887
+ * the card's to show; any other failure is recorded as well.
13888
+ */
13889
+ private async replyToElicitation(
13890
+ cardIdArg: string,
13891
+ requestIdArg: interfaces.IControllerRuntimeId,
13892
+ replyArg: interfaces.TControllerElicitationReply,
13893
+ ): Promise<void> {
13894
+ const scope = this.composerMutationScope();
13895
+ const sessionId = this.selectedSessionId;
13896
+ const mutationId = isSessionRuntimeId(sessionId) ? this.beginMutation(scope) : undefined;
13897
+ if (!mutationId || !isSessionRuntimeId(sessionId)) {
13898
+ this.finishMutation(mutationId);
13899
+ this.elicitationCards.refuse(cardIdArg, this.sendRefusalReason(scope));
13900
+ this.requestUpdate();
13901
+ return;
13902
+ }
13903
+ const generation = this.connectionGeneration;
13904
+ try {
13905
+ await this.socketClient.fire<interfaces.IReq_ControllerElicitationReply>(
13906
+ 'controller.elicitation.reply',
13907
+ { projectId: this.selectedProjectId, sessionId, requestId: requestIdArg, reply: replyArg },
13908
+ );
13909
+ if (this.isCurrentMutation(mutationId, generation, sessionId)) {
13910
+ await this.loadSessionDetail(sessionId);
13911
+ }
13912
+ } catch (error) {
13913
+ if (this.isCurrentMutation(mutationId, generation, sessionId)) {
13914
+ this.elicitationCards.refuse(cardIdArg, errorMessage(error));
13915
+ if (!isElicitationRefusal(error)) this.reportWorkspaceError('Answer the MCP request', error);
13916
+ this.requestUpdate();
13917
+ }
13918
+ } finally {
13919
+ this.finishMutation(mutationId);
13920
+ }
13921
+ }
13922
+
13953
13923
  // The open subagent drill-in modal; refreshed on that child's session events.
13954
13924
  private subagentModalSessionId: TBrowserSessionId | undefined;
13955
13925
  private subagentModalParentSessionId: TBrowserSessionId | undefined;
@@ -14688,6 +14658,7 @@ ${entry.detail.stack}`}</pre>`}
14688
14658
  this.answeredQuestionCards.clear();
14689
14659
  this.answeredPermissionCards.clear();
14690
14660
  this.pendingQuestionBatchAnswers.clear();
14661
+ this.elicitationCards.clear();
14691
14662
  }
14692
14663
 
14693
14664
  private async submitQuestionReply(
@@ -17484,10 +17455,20 @@ ${entry.detail.stack}`}</pre>`}
17484
17455
  }
17485
17456
  }
17486
17457
 
17487
- private readonly handlePathSuggestionClick = (suggestionArg: interfaces.IControllerPathSuggestion): void => {
17488
- this.newConversationDirectory = suggestionArg.path;
17458
+ /**
17459
+ * A picked directory: the field already reported it as typed (`input`), so the debounced read for the path itself
17460
+ * is dropped and the directories inside it are read at once.
17461
+ */
17462
+ private readonly handlePathSuggestionSelect = (
17463
+ eventArg: CustomEvent<plugins.deesCatalog.IInputTextSuggestionSelectDetail>,
17464
+ ): void => {
17465
+ if (this.suggestDebounce) {
17466
+ clearTimeout(this.suggestDebounce);
17467
+ this.suggestDebounce = undefined;
17468
+ }
17469
+ this.newConversationDirectory = eventArg.detail.value;
17489
17470
  this.newConversationError = '';
17490
- void this.fireSuggest(`${suggestionArg.path}/`);
17471
+ void this.fireSuggest(`${eventArg.detail.value}/`);
17491
17472
  };
17492
17473
 
17493
17474
  private readonly handleModelChange = (
@@ -19795,15 +19776,15 @@ ${entry.detail.stack}`}</pre>`}
19795
19776
  : ''}
19796
19777
  `
19797
19778
  : plugins.deesElement.html`
19798
- <button
19779
+ <dees-button
19799
19780
  class="tempPasswordToggle"
19800
- @click=${() => {
19781
+ type="link"
19782
+ size="sm"
19783
+ @clicked=${() => {
19801
19784
  this.showTempPasswordForm = true;
19802
19785
  this.tempPasswordError = '';
19803
19786
  }}
19804
- >
19805
- Use a CLI temporary password
19806
- </button>
19787
+ >Use a CLI temporary password</dees-button>
19807
19788
  `}
19808
19789
  </section>
19809
19790
  `;
@@ -20297,57 +20278,45 @@ ${entry.detail.stack}`}</pre>`}
20297
20278
  placeholder=${this.standardProjectDirectories[0]
20298
20279
  ? `${this.standardProjectDirectories[0]}/my-project`
20299
20280
  : '/an/absolute/path'}
20281
+ .suggestions=${directory === '' ? [] : this.pathSuggestions.map((suggestionArg) => suggestionArg.path)}
20300
20282
  @input=${this.handleNewConversationDirectoryInput}
20283
+ @suggestion-select=${this.handlePathSuggestionSelect}
20301
20284
  ></dees-input-text>
20302
20285
  </label>
20303
- ${directory !== '' && this.pathSuggestions.length > 0
20304
- ? plugins.deesElement.html`
20305
- <div class="pathSuggestionList" role="listbox">
20306
- ${this.pathSuggestions.map((suggestionArg) => plugins.deesElement.html`
20307
- <button
20308
- class="pathSuggestion"
20309
- role="option"
20310
- @click=${() => this.handlePathSuggestionClick(suggestionArg)}
20311
- >
20312
- <dees-icon icon="lucide:Folder" iconSize="13"></dees-icon>
20313
- <span>${suggestionArg.path}</span>
20314
- </button>
20315
- `)}
20316
- </div>
20317
- `
20318
- : ''}
20319
20286
  ${this.standardProjectDirectories.length > 0
20320
20287
  ? plugins.deesElement.html`
20321
20288
  <div class="newConversationStandardDirs">
20322
20289
  ${this.standardProjectDirectories.map((directoryArg) => plugins.deesElement.html`
20323
- <button
20290
+ <dees-button
20324
20291
  class="newConversationStandardDir"
20325
- type="button"
20326
- @click=${() => {
20292
+ type="outline"
20293
+ size="sm"
20294
+ shape="pill"
20295
+ icon="lucide:Folder"
20296
+ @clicked=${() => {
20327
20297
  this.newConversationDirectory = `${directoryArg}/`;
20328
20298
  this.newConversationError = '';
20329
20299
  }}
20330
- >
20331
- <dees-icon icon="lucide:Folder" iconSize="13"></dees-icon>
20332
- <span>${directoryArg}</span>
20333
- </button>
20300
+ >${directoryArg}</dees-button>
20334
20301
  `)}
20335
20302
  </div>
20336
20303
  `
20337
20304
  : ''}
20338
20305
  <div class="newConversationField">
20339
20306
  <span class="newConversationLabel">Harness</span>
20340
- <div class="newConversationHarnesses">
20341
- ${(['opencode', 'flex', 'codex', 'claude'] as const).map((candidateArg) => plugins.deesElement.html`
20342
- <dees-button
20343
- class="newConversationHarness"
20344
- data-harness-choice=${candidateArg}
20345
- size="sm"
20346
- .type=${harnessId === candidateArg ? 'accent' : 'ghost'}
20347
- @clicked=${() => this.selectNewConversationHarness(candidateArg)}
20348
- >${sessionHarnessLabel(candidateArg)}</dees-button>
20349
- `)}
20350
- </div>
20307
+ <dees-input-multitoggle
20308
+ class="newConversationHarness"
20309
+ size="sm"
20310
+ label="Harness"
20311
+ .labelPosition=${'none'}
20312
+ .allowEmpty=${true}
20313
+ .options=${newConversationHarnessOptions}
20314
+ .selectedOption=${harnessId ?? ''}
20315
+ @change=${(eventArg: CustomEvent<{ selectedOption?: unknown }>) => {
20316
+ const picked = newConversationHarnesses.find((candidateArg) => candidateArg === eventArg.detail?.selectedOption);
20317
+ if (picked) this.selectNewConversationHarness(picked);
20318
+ }}
20319
+ ></dees-input-multitoggle>
20351
20320
  </div>
20352
20321
  ${harnessId === undefined
20353
20322
  ? plugins.deesElement.html`
@@ -21773,6 +21742,7 @@ ${entry.detail.stack}`}</pre>`}
21773
21742
  loadEarlierHistory: undefined,
21774
21743
  permissions: emptyHarnessPermissions,
21775
21744
  questions: emptyHarnessQuestions,
21745
+ elicitations: emptyHarnessElicitations,
21776
21746
  transcriptKey: draftKey,
21777
21747
  hasEarlierMessages: false,
21778
21748
  loadingEarlier: false,
@@ -22141,6 +22111,8 @@ ${entry.detail.stack}`}</pre>`}
22141
22111
  'chat.questions',
22142
22112
  sessionId.harnessId !== 'flex' ? harnessQuestions : emptyHarnessQuestions,
22143
22113
  ),
22114
+ // Not through stableRenderValue: a refusal that reads as the last one is a new array the card must see.
22115
+ elicitations: this.elicitationCards.cards(detailArg.elicitations),
22144
22116
  transcriptKey: `${this.selectedProjectId}\u0000${controllerRuntimeIdToUiKey(sessionId)}`,
22145
22117
  hasEarlierMessages: this.detailHistoryCursor !== undefined,
22146
22118
  loadingEarlier: this.detailHistoryStatus === 'backfilling',
@@ -22269,6 +22241,7 @@ ${entry.detail.stack}`}</pre>`}
22269
22241
  modeChange: started ? this.handleModeChange : undefined,
22270
22242
  permissionResponse: started ? this.handlePermissionResponse : undefined,
22271
22243
  questionResponse: started ? this.handleQuestionResponse : undefined,
22244
+ elicitationResponse: started ? this.handleElicitationResponse : undefined,
22272
22245
  subtaskOpen: started ? this.handleSubtaskOpen : undefined,
22273
22246
  heldResend: started ? this.handleHeldResend : undefined,
22274
22247
  heldDiscard: started ? this.handleHeldDiscard : undefined,
@@ -13,6 +13,7 @@ type TSessionChatProperty =
13
13
  | 'loadEarlierHistory'
14
14
  | 'permissions'
15
15
  | 'questions'
16
+ | 'elicitations'
16
17
  | 'transcriptKey'
17
18
  | 'hasEarlierMessages'
18
19
  | 'loadingEarlier'
@@ -84,6 +85,8 @@ export interface ISessionChatHandlers {
84
85
  modeChange?: TSessionChatListener;
85
86
  permissionResponse?: TSessionChatListener;
86
87
  questionResponse?: TSessionChatListener;
88
+ /** The one event that carries what the owner entered in an MCP elicitation card: send it, keep nothing of it. */
89
+ elicitationResponse?: TSessionChatListener;
87
90
  subtaskOpen?: TSessionChatListener;
88
91
  heldResend?: TSessionChatListener;
89
92
  heldDiscard?: TSessionChatListener;
@@ -120,6 +123,7 @@ export const renderSessionChat = (viewArg: ISessionChatView): plugins.deesElemen
120
123
  .loadEarlierHistory=${viewArg.loadEarlierHistory}
121
124
  .permissions=${viewArg.permissions ?? emptyList}
122
125
  .questions=${viewArg.questions ?? emptyList}
126
+ .elicitations=${viewArg.elicitations ?? emptyList}
123
127
  .transcriptKey=${viewArg.transcriptKey ?? ''}
124
128
  .hasEarlierMessages=${viewArg.hasEarlierMessages ?? false}
125
129
  .loadingEarlier=${viewArg.loadingEarlier ?? false}
@@ -192,6 +196,7 @@ export const renderSessionChat = (viewArg: ISessionChatView): plugins.deesElemen
192
196
  @harness-mode-change=${on.modeChange}
193
197
  @harness-permission-response=${on.permissionResponse}
194
198
  @harness-question-response=${on.questionResponse}
199
+ @harness-elicitation-response=${on.elicitationResponse}
195
200
  @harness-subtask-open=${on.subtaskOpen}
196
201
  @harness-held-resend=${on.heldResend}
197
202
  @harness-held-discard=${on.heldDiscard}