@orbit-build/cli 3.1.0 → 3.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.
package/dist/index.js CHANGED
@@ -291308,6 +291308,7 @@ var EDIT_FILE_MAX_BYTES = 16 * 1024 * 1024;
291308
291308
  var HUNK_REVIEW_MAX_CHARS = 256 * 1024;
291309
291309
  async function reviewEditTransaction(options) {
291310
291310
  const { filePath, before, checkpoint, interaction } = options;
291311
+ const local = (en, zh, tw) => options.language === "zh-TW" ? tw : options.language === "zh" ? zh : en;
291311
291312
  let after;
291312
291313
  try {
291313
291314
  const content = readBoundedRegularFile(
@@ -291349,7 +291350,13 @@ async function reviewEditTransaction(options) {
291349
291350
  error: `${reason} Rollback failed: ${restored.error ?? "unknown error"}`
291350
291351
  };
291351
291352
  options.checkpoints.removeCheckpoint(checkpoint.id);
291352
- interaction.showText(`\u25CF Rejected changes. Reverted ${filePath}.`);
291353
+ interaction.showText(
291354
+ local(
291355
+ `\u2714 Reverted ${filePath}.`,
291356
+ `\u2714 \u5DF2\u56DE\u9000 ${filePath} \u7684\u6539\u52A8\u3002`,
291357
+ `\u2714 \u5DF2\u9084\u539F ${filePath} \u7684\u8B8A\u66F4\u3002`
291358
+ )
291359
+ );
291353
291360
  return {
291354
291361
  ok: false,
291355
291362
  error: `${reason} Edits to ${filePath} rejected and rolled back.`
@@ -291363,7 +291370,6 @@ async function reviewEditTransaction(options) {
291363
291370
  }
291364
291371
  if (options.autoAccept) return { ok: true };
291365
291372
  try {
291366
- const local = (en, zh, tw) => options.language === "zh-TW" ? tw : options.language === "zh" ? zh : en;
291367
291373
  const choice = interaction.reviewFileChange ? await interaction.reviewFileChange({
291368
291374
  filePath,
291369
291375
  before,
@@ -291396,21 +291402,31 @@ async function reviewEditTransaction(options) {
291396
291402
  const lines = before === null ? [] : before.split("\n");
291397
291403
  const hunks = buildHunks(lines, after.split("\n"));
291398
291404
  if (hunks.length === 0) return { ok: true };
291399
- interaction.showText(`\u25CF Reviewing ${hunks.length} hunks in ${filePath}:`);
291405
+ interaction.showText(
291406
+ local(
291407
+ `\u25CF Reviewing ${hunks.length} hunks in ${filePath}`,
291408
+ `\u25CF \u6B63\u5728\u5BA1\u67E5 ${filePath} \u7684 ${hunks.length} \u6BB5\u6539\u52A8`,
291409
+ `\u25CF \u6B63\u5728\u5BE9\u67E5 ${filePath} \u7684 ${hunks.length} \u6BB5\u8B8A\u66F4`
291410
+ )
291411
+ );
291400
291412
  for (let index = 0; index < hunks.length; index++) {
291401
291413
  const hunk = hunks[index];
291402
291414
  await interaction.showDiff(
291403
- `${filePath} \xB7 Hunk #${index + 1}/${hunks.length}`,
291415
+ `${filePath} \xB7 ${local("Hunk #", "\u6539\u52A8 ", "\u8B8A\u66F4 ")}${index + 1}/${hunks.length}`,
291404
291416
  hunk.before.join("\n"),
291405
291417
  hunk.after.join("\n")
291406
291418
  );
291407
291419
  }
291408
291420
  const selected = await interaction.prompt?.askMultiSelect(
291409
- `Select the hunks to apply to ${filePath}:`,
291421
+ local(
291422
+ `Which hunks should be kept in ${filePath}?`,
291423
+ `\u8981\u4FDD\u7559 ${filePath} \u7684\u54EA\u4E9B\u6539\u52A8\uFF1F`,
291424
+ `\u8981\u4FDD\u7559 ${filePath} \u7684\u54EA\u4E9B\u8B8A\u66F4\uFF1F`
291425
+ ),
291410
291426
  hunks.map((hunk, index) => ({
291411
291427
  value: String(index),
291412
- label: `Apply Hunk #${index + 1}`,
291413
- hint: `-${hunk.before.length} lines, +${hunk.after.length} lines`
291428
+ label: local(`Keep hunk #${index + 1}`, `\u4FDD\u7559\u7B2C ${index + 1} \u6BB5`, `\u4FDD\u7559\u7B2C ${index + 1} \u6BB5`),
291429
+ hint: `\u2212${hunk.before.length} +${hunk.after.length}`
291414
291430
  }))
291415
291431
  );
291416
291432
  if (!selected?.length) return reject("No changes were selected.");
@@ -291438,7 +291454,14 @@ async function reviewEditTransaction(options) {
291438
291454
  });
291439
291455
  if (!result.success)
291440
291456
  return reject(`Hunk merge failed: ${result.error ?? "unknown error"}.`);
291441
- interaction.showText(`\u2714 Selected hunks merged and saved to ${filePath}.`);
291457
+ const count = `${selection.size}/${hunks.length}`;
291458
+ interaction.showText(
291459
+ local(
291460
+ `\u2714 Kept ${count} hunks in ${filePath}.`,
291461
+ `\u2714 \u5DF2\u4FDD\u7559 ${filePath} \u7684 ${count} \u6BB5\u6539\u52A8\u3002`,
291462
+ `\u2714 \u5DF2\u4FDD\u7559 ${filePath} \u7684 ${count} \u6BB5\u8B8A\u66F4\u3002`
291463
+ )
291464
+ );
291442
291465
  return { ok: true };
291443
291466
  } catch (error) {
291444
291467
  return reject(`Edit review failed: ${safeAgentLoopErrorMessage(error)}.`);
@@ -306555,6 +306578,135 @@ async function getAutocompleteCandidates(cwd, config, mcpPromptCommands = []) {
306555
306578
  };
306556
306579
  }
306557
306580
 
306581
+ // src/runtime/webui/WebUiNavigationRows.ts
306582
+ function projectPathKey(path10) {
306583
+ return /^(?:[A-Za-z]:|\\\\)/.test(path10) ? path10.replace(/\\/g, "/").toLowerCase() : path10;
306584
+ }
306585
+ function createNavigationRows() {
306586
+ const signatures = /* @__PURE__ */ new WeakMap();
306587
+ return function reconcile(container, items, id, content, render) {
306588
+ const old = Array.from(container.children);
306589
+ const byId = new Map(old.map((row) => [row.dataset.navigationId, row]));
306590
+ const focused = container.contains(document.activeElement) ? document.activeElement : null;
306591
+ const focusedRow = focused?.closest("[data-navigation-id]");
306592
+ const action = focused?.dataset.sessionAction || focused?.dataset.projectAction;
306593
+ for (const [index, item] of items.entries()) {
306594
+ const key = id(item);
306595
+ const signature = JSON.stringify(content(item));
306596
+ let row = byId.get(key);
306597
+ if (!row || signatures.get(row) !== signature) {
306598
+ const updated = render(item);
306599
+ updated.dataset.navigationId = key;
306600
+ signatures.set(updated, signature);
306601
+ row?.replaceWith(updated);
306602
+ row = updated;
306603
+ }
306604
+ if (container.children[index] !== row)
306605
+ container.insertBefore(row, container.children[index] ?? null);
306606
+ byId.delete(key);
306607
+ }
306608
+ for (const row of byId.values()) row.remove();
306609
+ if (!focusedRow || !focused || document.activeElement === focused) return;
306610
+ const rows = Array.from(container.children);
306611
+ const target = rows.find((row) => row.dataset.navigationId === focusedRow.dataset.navigationId) ?? rows[Math.min(old.indexOf(focusedRow), rows.length - 1)];
306612
+ const buttons = target?.querySelectorAll("button:not(:disabled)");
306613
+ const equivalent = Array.from(buttons ?? []).find(
306614
+ (button) => (button.dataset.sessionAction || button.dataset.projectAction) === action
306615
+ );
306616
+ (equivalent ?? buttons?.[0])?.focus({ preventScroll: true });
306617
+ };
306618
+ }
306619
+ function bindWorkspaceLocation(location) {
306620
+ const closeOutside = (event) => {
306621
+ if (location.open && event.target instanceof Node && !location.contains(event.target)) {
306622
+ location.open = false;
306623
+ }
306624
+ };
306625
+ document.addEventListener("pointerdown", closeOutside);
306626
+ document.addEventListener("focusin", closeOutside);
306627
+ location.addEventListener("keydown", (event) => {
306628
+ if (event.key !== "Escape" || event.isComposing || event.keyCode === 229 || !location.open)
306629
+ return;
306630
+ event.preventDefault();
306631
+ location.open = false;
306632
+ location.querySelector("summary")?.focus();
306633
+ });
306634
+ }
306635
+
306636
+ // src/runtime/webui/WebUiClientDrafts.ts
306637
+ function createConversationDrafts(storage) {
306638
+ const legacy = "orbit.webui.draft";
306639
+ const fallback = /* @__PURE__ */ new Map();
306640
+ let active = null;
306641
+ function key(workspace, session) {
306642
+ return legacy + "." + JSON.stringify([workspace, session]);
306643
+ }
306644
+ function read(scope) {
306645
+ if (fallback.has(scope)) return fallback.get(scope);
306646
+ try {
306647
+ return storage().getItem(scope) || "";
306648
+ } catch {
306649
+ return "";
306650
+ }
306651
+ }
306652
+ function write(scope, value) {
306653
+ try {
306654
+ if (value) storage().setItem(scope, value);
306655
+ else storage().removeItem(scope);
306656
+ fallback.delete(scope);
306657
+ } catch {
306658
+ fallback.set(scope, value);
306659
+ }
306660
+ }
306661
+ return {
306662
+ get active() {
306663
+ return active;
306664
+ },
306665
+ key,
306666
+ read,
306667
+ write,
306668
+ save(value) {
306669
+ if (active !== null) write(active, value);
306670
+ },
306671
+ recover(scope, original, currentInput) {
306672
+ const current = active === scope ? currentInput : read(scope);
306673
+ const recovered = current && current !== original ? original + "\n\n" + current : original;
306674
+ write(scope, recovered);
306675
+ return active === scope ? recovered : void 0;
306676
+ },
306677
+ activate(workspace, session, input) {
306678
+ const next = key(workspace, session);
306679
+ if (active === next) return;
306680
+ const first = active === null;
306681
+ active = next;
306682
+ const saved = read(next);
306683
+ const old = first ? read(legacy) : "";
306684
+ const value = first ? [...new Set([saved, old, input].filter(Boolean))].join("\n\n") : saved;
306685
+ if (first && (input || old)) {
306686
+ write(next, value);
306687
+ if (!fallback.has(next)) write(legacy, "");
306688
+ }
306689
+ return value;
306690
+ }
306691
+ };
306692
+ }
306693
+ var WEB_UI_CLIENT_DRAFTS_SCRIPT = String.raw` const drafts = (${createConversationDrafts.toString()})(() => localStorage);
306694
+ let draftRevision = 0;
306695
+ function activateComposerDraft(workspace, session) {
306696
+ const previousScope = drafts.active;
306697
+ const value = drafts.activate(workspace, session, elements.prompt.value);
306698
+ if (value !== undefined) {
306699
+ elements.prompt.dataset.orbitDraftTarget = String(++draftRevision);
306700
+ switchAttachmentDraft(previousScope, drafts.active);
306701
+ elements.prompt.value = value;
306702
+ autoSizePrompt();
306703
+ updateSendButtonState();
306704
+ closeSlashCommands();
306705
+ if (value && previousScope === null) showToast(copy.draftRestored);
306706
+ }
306707
+ }
306708
+ `;
306709
+
306558
306710
  // src/runtime/webui/WebUiClientBindings.ts
306559
306711
  var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListener('submit', (event) => {
306560
306712
  event.preventDefault();
@@ -306586,7 +306738,7 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
306586
306738
 
306587
306739
  elements.prompt.addEventListener('input', () => {
306588
306740
  autoSizePrompt();
306589
- writeLocalStorage('orbit.webui.draft', elements.prompt.value);
306741
+ drafts.save(elements.prompt.value);
306590
306742
  updateSendButtonState();
306591
306743
  slashCommandSelection = 0;
306592
306744
  renderSlashCommands();
@@ -307750,8 +307902,12 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
307750
307902
  closeCommandPalette();
307751
307903
  return;
307752
307904
  }
307753
- setInspector(false);
307754
- closeSidebar();
307905
+ if (elements.inspector.classList.contains('is-open')) setInspector(false);
307906
+ else if (elements.appShell.classList.contains('sidebar-open')) closeSidebar();
307907
+ else if (!byId('workbench').hidden) {
307908
+ event.preventDefault();
307909
+ setWorkbench(null, byId('workbench').contains(document.activeElement));
307910
+ }
307755
307911
  }
307756
307912
  if ((event.ctrlKey || event.metaKey && event.key.toLowerCase() === 'k') && ['k', 'p'].includes(event.key.toLowerCase())) {
307757
307913
  event.preventDefault();
@@ -307796,17 +307952,10 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
307796
307952
  );
307797
307953
  setProjectExpanded(readLocalStorage('orbit.webui.project', 'expanded') !== 'collapsed');
307798
307954
  syncSidebarInteractivity();
307799
- const draft = readLocalStorage('orbit.webui.draft', '');
307800
- if (draft) {
307801
- elements.prompt.value = draft;
307802
- autoSizePrompt();
307803
- updateSendButtonState();
307804
- }
307805
307955
  try {
307806
307956
  await bootstrapSession();
307807
307957
  await Promise.all([renderMessages({ forceBottom: true }), loadStatus(), loadSlashCommands()]);
307808
307958
  connectEvents();
307809
- if (draft) showToast(copy.draftRestored);
307810
307959
  // Do not steal focus from an interaction that started while the initial
307811
307960
  // bootstrap was still settling (for example, editing a queued prompt).
307812
307961
  // The composer is the default target only while the document remains
@@ -308548,13 +308697,13 @@ function createApprovalController(runtime) {
308548
308697
  }
308549
308698
  }
308550
308699
  elements.approvalPreview.hidden = !preview;
308551
- elements.denyApprovalButton.disabled = !state.ready || Boolean(state.approvalSubmitting);
308552
- elements.approveApprovalButton.disabled = !state.ready || Boolean(state.approvalSubmitting);
308700
+ elements.denyApprovalButton.disabled = !state.ready || Boolean(state.sessionChanging || state.approvalSubmitting);
308701
+ elements.approveApprovalButton.disabled = !state.ready || Boolean(state.sessionChanging || state.approvalSubmitting);
308553
308702
  if (newRequest) revealApproval();
308554
308703
  }
308555
308704
  async function respondToApproval(approved) {
308556
308705
  const approval = state.pendingApproval;
308557
- if (!approval || !state.ready || state.approvalSubmitting) return;
308706
+ if (!approval || !state.ready || state.sessionChanging || state.approvalSubmitting) return;
308558
308707
  state.approvalSubmitting = approval.id;
308559
308708
  renderPendingApproval(approval);
308560
308709
  try {
@@ -308592,7 +308741,8 @@ var WEB_UI_CLIENT_APPROVAL_SCRIPT = ` const { renderPendingApproval, respondToA
308592
308741
  elements.approvalDiffButton.hidden = !hasDiff;
308593
308742
  byId('approvalDiffDetail').hidden = !hasDiff;
308594
308743
  byId('approvalDiffTitle').textContent = hasDiff ? approval.title : '';
308595
- elements.approvalEyebrow.textContent = isChange ? copy.fileReview : copy.approvalRequired;
308744
+ const label = isChange ? copy.fileReview : copy.approvalRequired;
308745
+ if (elements.approvalEyebrow.textContent !== label) elements.approvalEyebrow.textContent = label;
308596
308746
  elements.jumpApproval.hidden = !approval;
308597
308747
  } });
308598
308748
 
@@ -308601,6 +308751,33 @@ var WEB_UI_CLIENT_APPROVAL_SCRIPT = ` const { renderPendingApproval, respondToA
308601
308751
  // src/runtime/webui/WebUiClientAttachments.ts
308602
308752
  function createAttachmentController(runtime) {
308603
308753
  const { copy, elements, state, api, showToast, updateSendButtonState } = runtime;
308754
+ const inactive = /* @__PURE__ */ new Map();
308755
+ const uploads = /* @__PURE__ */ new WeakMap();
308756
+ const discarded = /* @__PURE__ */ new WeakSet();
308757
+ function switchAttachmentDraft(previous, next) {
308758
+ if (previous === null) return;
308759
+ if (state.attachments.length || uploads.get(state.attachments)) {
308760
+ inactive.set(previous, state.attachments);
308761
+ }
308762
+ state.attachments = inactive.get(next) ?? [];
308763
+ inactive.delete(next);
308764
+ renderAttachments();
308765
+ }
308766
+ function releaseUpload(id) {
308767
+ void api(`/api/attachment?id=${encodeURIComponent(id)}`, { method: "DELETE" }).catch(() => {
308768
+ });
308769
+ }
308770
+ function discardAttachmentDraft(key) {
308771
+ const group = inactive.get(key);
308772
+ if (!group) return;
308773
+ inactive.delete(key);
308774
+ discarded.add(group);
308775
+ for (const attachment of group) {
308776
+ URL.revokeObjectURL(attachment.previewUrl);
308777
+ releaseUpload(attachment.id);
308778
+ }
308779
+ group.length = 0;
308780
+ }
308604
308781
  function renderAttachments() {
308605
308782
  elements.attachmentList.replaceChildren();
308606
308783
  elements.attachmentShelf.hidden = state.attachments.length === 0;
@@ -308634,18 +308811,20 @@ function createAttachmentController(runtime) {
308634
308811
  }
308635
308812
  updateSendButtonState();
308636
308813
  }
308637
- async function uploadAttachment(file) {
308814
+ async function uploadAttachment(file, group = state.attachments) {
308815
+ if (discarded.has(group)) return;
308638
308816
  if (!file || !["image/png", "image/jpeg", "image/gif", "image/webp"].includes(
308639
308817
  file.type
308640
308818
  )) {
308641
308819
  showToast(copy.attachmentLimit, "warning");
308642
308820
  return;
308643
308821
  }
308644
- if (file.size <= 0 || file.size > 5 * 1024 * 1024 || state.attachments.length >= 4) {
308822
+ if (file.size <= 0 || file.size > 5 * 1024 * 1024 || group.length + (uploads.get(group) ?? 0) >= 4) {
308645
308823
  showToast(copy.attachmentLimit, "warning");
308646
308824
  return;
308647
308825
  }
308648
- elements.attachmentButton.disabled = true;
308826
+ uploads.set(group, (uploads.get(group) ?? 0) + 1);
308827
+ if (group === state.attachments) elements.attachmentButton.disabled = true;
308649
308828
  try {
308650
308829
  const result = await api(
308651
308830
  `/api/attachment?name=${encodeURIComponent(file.name || "image")}`,
@@ -308656,39 +308835,48 @@ function createAttachmentController(runtime) {
308656
308835
  }
308657
308836
  );
308658
308837
  const attachment = result.attachment || {};
308659
- state.attachments.push({
308838
+ if (discarded.has(group)) {
308839
+ if (attachment.id) releaseUpload(attachment.id);
308840
+ return;
308841
+ }
308842
+ group.push({
308660
308843
  id: String(attachment.id || ""),
308661
308844
  name: attachment.name || file.name || "image",
308662
308845
  mediaType: attachment.mediaType || file.type,
308663
308846
  size: Number(attachment.size || file.size),
308664
308847
  previewUrl: URL.createObjectURL(file)
308665
308848
  });
308666
- renderAttachments();
308667
- showToast(copy.attachmentAdded, "success");
308849
+ if (group === state.attachments) {
308850
+ renderAttachments();
308851
+ showToast(copy.attachmentAdded, "success");
308852
+ }
308668
308853
  } catch (error) {
308669
308854
  showToast(
308670
308855
  error instanceof Error ? error.message : String(error),
308671
308856
  "error"
308672
308857
  );
308673
308858
  } finally {
308674
- elements.attachmentButton.disabled = state.attachments.length >= 4;
308859
+ uploads.set(group, (uploads.get(group) ?? 1) - 1);
308860
+ elements.attachmentButton.disabled = state.attachments.length + (uploads.get(state.attachments) ?? 0) >= 4;
308675
308861
  elements.attachmentInput.value = "";
308676
308862
  }
308677
308863
  }
308678
308864
  async function addAttachmentFiles(files) {
308865
+ const group = state.attachments;
308679
308866
  for (const file of Array.from(files || []).slice(
308680
308867
  0,
308681
- 4 - state.attachments.length
308868
+ 4 - group.length
308682
308869
  )) {
308683
- await uploadAttachment(file);
308870
+ await uploadAttachment(file, group);
308684
308871
  }
308685
308872
  }
308686
308873
  async function removeAttachment(id, notify) {
308687
- const index = state.attachments.findIndex(
308874
+ const group = state.attachments;
308875
+ const index = group.findIndex(
308688
308876
  (attachment2) => attachment2.id === id
308689
308877
  );
308690
308878
  if (index === -1) return;
308691
- const attachment = state.attachments[index];
308879
+ const attachment = group[index];
308692
308880
  const removeButton = elements.attachmentList.querySelector(
308693
308881
  `[data-attachment-remove="${CSS.escape(id)}"]`
308694
308882
  );
@@ -308697,13 +308885,13 @@ function createAttachmentController(runtime) {
308697
308885
  await api(`/api/attachment?id=${encodeURIComponent(id)}`, {
308698
308886
  method: "DELETE"
308699
308887
  });
308700
- const currentIndex = state.attachments.findIndex(
308888
+ const currentIndex = group.findIndex(
308701
308889
  (item) => item.id === id
308702
308890
  );
308703
- if (currentIndex !== -1) state.attachments.splice(currentIndex, 1);
308891
+ if (currentIndex !== -1) group.splice(currentIndex, 1);
308704
308892
  if (attachment.previewUrl) URL.revokeObjectURL(attachment.previewUrl);
308705
308893
  renderAttachments();
308706
- if (notify) showToast(copy.attachmentRemoved);
308894
+ if (notify && group === state.attachments) showToast(copy.attachmentRemoved);
308707
308895
  } catch (error) {
308708
308896
  if (removeButton) removeButton.disabled = false;
308709
308897
  showToast(
@@ -308712,19 +308900,18 @@ function createAttachmentController(runtime) {
308712
308900
  );
308713
308901
  }
308714
308902
  }
308715
- function consumeAttachments(ids2) {
308903
+ function consumeAttachments(ids2, group = state.attachments) {
308716
308904
  const consumed = new Set(ids2 || []);
308717
- for (const attachment of state.attachments) {
308718
- if (consumed.has(attachment.id) && attachment.previewUrl) {
308719
- URL.revokeObjectURL(attachment.previewUrl);
308720
- }
308905
+ for (const attachment of group.slice()) {
308906
+ if (!consumed.has(attachment.id)) continue;
308907
+ URL.revokeObjectURL(attachment.previewUrl);
308908
+ group.splice(group.indexOf(attachment), 1);
308721
308909
  }
308722
- state.attachments = state.attachments.filter(
308723
- (attachment) => !consumed.has(attachment.id)
308724
- );
308725
308910
  renderAttachments();
308726
308911
  }
308727
308912
  return {
308913
+ switchAttachmentDraft,
308914
+ discardAttachmentDraft,
308728
308915
  renderAttachments,
308729
308916
  uploadAttachment,
308730
308917
  addAttachmentFiles,
@@ -308732,7 +308919,7 @@ function createAttachmentController(runtime) {
308732
308919
  consumeAttachments
308733
308920
  };
308734
308921
  }
308735
- var WEB_UI_CLIENT_ATTACHMENTS_SCRIPT = ` const { renderAttachments, uploadAttachment, addAttachmentFiles, removeAttachment, consumeAttachments } = (${createAttachmentController.toString()})({ copy, elements, state, api, showToast, updateSendButtonState });
308922
+ var WEB_UI_CLIENT_ATTACHMENTS_SCRIPT = ` const { switchAttachmentDraft, discardAttachmentDraft, renderAttachments, uploadAttachment, addAttachmentFiles, removeAttachment, consumeAttachments } = (${createAttachmentController.toString()})({ copy, elements, state, api, showToast, updateSendButtonState });
308736
308923
 
308737
308924
  `;
308738
308925
 
@@ -309278,7 +309465,7 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
309278
309465
  collapseNavigation: '收起导航',
309279
309466
  modeStrict: '严格',
309280
309467
  modeNormal: '标准',
309281
- modeAuto: '全自动',
309468
+ modeAuto: '完整访问',
309282
309469
  modePlan: '规划',
309283
309470
  permissionFullAccess: chinese('完整权限已开启:所有已启用工具操作均自动批准。', '完整權限已開啟:所有已啟用工具操作均自動批准。'),
309284
309471
  permissionAutoLimited: chinese('全自动尚未完全生效,部分操作仍需确认。', '全自動尚未完全生效,部分操作仍需確認。'),
@@ -309517,7 +309704,7 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
309517
309704
  collapseNavigation: '收合導覽',
309518
309705
  modeStrict: '嚴格',
309519
309706
  modeNormal: '標準',
309520
- modeAuto: '自動',
309707
+ modeAuto: '完整取用',
309521
309708
  modePlan: '規劃',
309522
309709
  recentSession: '最近工作階段',
309523
309710
  useWorkflow: '使用工作流程',
@@ -309832,6 +310019,7 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
309832
310019
  promptQueue: [],
309833
310020
  queueEditingId: null,
309834
310021
  queueSubmitting: false,
310022
+ sessionChanging: false,
309835
310023
  queueEditDraft: '',
309836
310024
  agentSteeringId: null,
309837
310025
  agentSteeringDraft: '',
@@ -310101,6 +310289,10 @@ ${WEB_UI_CLIENT_TRANSPORT_SCRIPT}
310101
310289
  updateMessageNavigation();
310102
310290
  }
310103
310291
 
310292
+ const appleKeyboard = /Mac|iPhone|iPad/i.test(navigator.platform);
310293
+ function controlShortcut(key) { return (appleKeyboard ? '⌃ ' : 'Ctrl ') + key; }
310294
+ document.querySelectorAll('[data-control-key]').forEach(key => { key.textContent = controlShortcut(key.dataset.controlKey); });
310295
+
310104
310296
  function setBusy(busy, label) {
310105
310297
  state.busy = busy;
310106
310298
  elements.appShell.classList.toggle('is-busy', busy);
@@ -310126,7 +310318,11 @@ ${WEB_UI_CLIENT_TRANSPORT_SCRIPT}
310126
310318
  ));
310127
310319
  syncCustomModelAction();
310128
310320
  elements.turnStatus.classList.toggle('is-working', busy);
310129
- elements.turnStatus.textContent = label || (busy ? copy.thinking : '');
310321
+ const hint = byId('composerHint');
310322
+ const keys = busy ? hint.dataset.running.replace('{steer}', appleKeyboard ? '⌘↩' : 'Ctrl+Enter') : hint.dataset.idle;
310323
+ if (hint.textContent !== keys) hint.textContent = keys;
310324
+ const statusLabel = label || (busy ? copy.thinking : '');
310325
+ if (elements.turnStatus.textContent !== statusLabel) elements.turnStatus.textContent = statusLabel;
310130
310326
  updateSendButtonState();
310131
310327
  renderPromptQueue();
310132
310328
  }
@@ -310141,18 +310337,20 @@ ${WEB_UI_CLIENT_TRANSPORT_SCRIPT}
310141
310337
  }
310142
310338
 
310143
310339
  function updateSendButtonState() {
310340
+ const ready = state.ready && !state.sessionChanging;
310341
+ elements.prompt.setAttribute('aria-busy', String(!ready));
310144
310342
  const hasPrompt = Boolean(elements.prompt.value.trim());
310145
- elements.contextPickerButton.disabled = state.busy || !state.ready;
310146
- elements.buildPlanButton.disabled = state.busy || !state.ready;
310147
- elements.parallelImproveButton.disabled = state.busy || !state.ready;
310343
+ elements.contextPickerButton.disabled = state.busy || !ready;
310344
+ elements.buildPlanButton.disabled = state.busy || !ready;
310345
+ elements.parallelImproveButton.disabled = state.busy || !ready;
310148
310346
  elements.queueButton.hidden = !state.busy;
310149
- elements.queueButton.disabled = !state.ready || !hasPrompt || state.stopping || state.queueSubmitting || state.promptQueue.length >= 12;
310347
+ elements.queueButton.disabled = !ready || !hasPrompt || state.stopping || state.queueSubmitting || state.promptQueue.length >= 12;
310150
310348
  elements.steerButton.hidden = !state.busy || !hasPrompt;
310151
310349
  elements.steerButton.disabled = elements.queueButton.disabled;
310152
- elements.denyApprovalButton.disabled = elements.approveApprovalButton.disabled = !state.ready || Boolean(state.approvalSubmitting);
310350
+ elements.denyApprovalButton.disabled = elements.approveApprovalButton.disabled = !ready || Boolean(state.approvalSubmitting);
310153
310351
  elements.sendButton.disabled = state.busy
310154
- ? !state.ready || state.stopping
310155
- : !state.ready || !hasPrompt;
310352
+ ? !ready || state.stopping
310353
+ : !ready || !hasPrompt;
310156
310354
  }
310157
310355
 
310158
310356
  function setEmptyState() {
@@ -311871,7 +312069,7 @@ var WEB_UI_CLIENT_PALETTE_SCRIPT = String.raw` const paletteMatches = ${palette
311871
312069
 
311872
312070
  function setComposerValue(value) {
311873
312071
  elements.prompt.value = value;
311874
- writeLocalStorage('orbit.webui.draft', value);
312072
+ drafts.save(value);
311875
312073
  autoSizePrompt();
311876
312074
  updateSendButtonState();
311877
312075
  focusMessageComposer();
@@ -311880,12 +312078,12 @@ var WEB_UI_CLIENT_PALETTE_SCRIPT = String.raw` const paletteMatches = ${palette
311880
312078
 
311881
312079
  function buildPaletteActions() {
311882
312080
  const actions = [
311883
- { icon: '+', label: language !== 'en' ? chinese('新建任务', '新增任務') : 'New task', detail: 'Ctrl N', keywords: 'new session task', idle: true, run: () => updateSession({ action: 'new' }) },
312081
+ { icon: '+', label: language !== 'en' ? chinese('新建任务', '新增任務') : 'New task', detail: controlShortcut('N'), keywords: 'new session task', idle: true, run: () => updateSession({ action: 'new' }) },
311884
312082
  { icon: '▣', label: language !== 'en' ? chinese('添加或创建项目', '加入或建立專案') : 'Add or create project', detail: language !== 'en' ? chinese('选择项目文件夹', '選擇專案資料夾') : 'Choose a project folder', keywords: 'add new open create project workspace folder', idle: true, run: openProjectDialog },
311885
312083
  { icon: '›', label: copy.focusComposer, detail: language !== 'en' ? chinese('发送消息', '傳送訊息') : 'Message Orbit', keywords: 'focus prompt message composer', run: focusMessageComposer },
311886
312084
  { icon: '◫', label: copy.openActivity, detail: language !== 'en' ? chinese('运行状态与工具', '執行狀態與工具') : 'Runtime and tools', keywords: 'activity details runtime tools', run: () => setInspector(true, 'activity') },
311887
- { icon: '⚙', label: copy.openSettings, detail: 'Ctrl ,', keywords: 'settings preferences configuration', run: () => setInspector(true, 'settings') },
311888
- { icon: '◧', label: language !== 'en' ? chinese('切换导航栏', '切換導覽列') : 'Toggle navigation', detail: 'Ctrl B', keywords: 'toggle sidebar navigation focus', run: toggleNavigation },
312085
+ { icon: '⚙', label: copy.openSettings, detail: controlShortcut(','), keywords: 'settings preferences configuration', run: () => setInspector(true, 'settings') },
312086
+ { icon: '◧', label: language !== 'en' ? chinese('切换导航栏', '切換導覽列') : 'Toggle navigation', detail: controlShortcut('B'), keywords: 'toggle sidebar navigation focus', run: toggleNavigation },
311889
312087
  { icon: '+', label: language !== 'en' ? chinese('添加文件上下文', '加入檔案上下文') : 'Add file context', detail: language !== 'en' ? chinese('搜索工作区文件', '搜尋工作區檔案') : 'Search workspace files', keywords: 'add context file', idle: true, run: openContextPicker },
311890
312088
  ];
311891
312089
  for (const preset of elements.reviewPresets.querySelectorAll('[data-review-preset]')) {
@@ -312070,13 +312268,19 @@ function selectMenuLayout(input) {
312070
312268
  }
312071
312269
 
312072
312270
  // src/runtime/webui/WebUiClientSelect.ts
312271
+ function syncSelectedValue(select2, trigger, value) {
312272
+ const option = select2.selectedOptions[0] ?? select2.options[0];
312273
+ const label = option?.dataset.displayLabel || option?.textContent || "\u2014";
312274
+ if (value.textContent !== label) value.textContent = label;
312275
+ value.title = select2.id === "permissionSelect" ? label : option?.textContent || "";
312276
+ value.id = select2.id + "SelectedValue";
312277
+ trigger.setAttribute("aria-describedby", value.id);
312278
+ }
312073
312279
  var WEB_UI_CLIENT_SELECT_SCRIPT = String.raw` const selectControls = new Map();
312074
312280
  const fitSelectMenu = ${selectMenuLayout.toString()};
312075
312281
  let selectScrollSettleTimer = 0;
312076
312282
 
312077
- function selectedOption(select) {
312078
- return [...select.options].find((option) => option.value === select.value) || select.options[0];
312079
- }
312283
+ const syncSelectedValue = ${syncSelectedValue.toString()};
312080
312284
 
312081
312285
  function positionSelectMenu(entry) {
312082
312286
  const rect = entry.trigger.getBoundingClientRect();
@@ -312155,9 +312359,7 @@ var WEB_UI_CLIENT_SELECT_SCRIPT = String.raw` const selectControls = new Map();
312155
312359
  function syncSelectControl(select) {
312156
312360
  const entry = selectControls.get(select);
312157
312361
  if (!entry) return;
312158
- const active = selectedOption(select);
312159
- entry.value.textContent = active ? active.dataset.displayLabel || active.textContent : '—';
312160
- entry.value.title = active ? active.textContent : '';
312362
+ syncSelectedValue(select, entry.trigger, entry.value);
312161
312363
  entry.trigger.disabled = select.disabled;
312162
312364
  if (select.disabled) closeSelectControl(entry, false);
312163
312365
  const optionsKey = JSON.stringify([...select.options].map((option) => [option.value, option.textContent, option.disabled]));
@@ -312472,14 +312674,14 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
312472
312674
  }
312473
312675
  const compactAt = Number(context.compactAtTokens || 0);
312474
312676
  const estimated = Number(context.estimatedHistoryTokens || 0);
312475
- const usagePercent = compactAt > 0 ? Math.max(0, (estimated / compactAt) * 100) : 0;
312677
+ const meterLimit = compactAt || Number(context.maxContextTokens || 0);
312678
+ const usagePercent = meterLimit > 0 ? Math.max(0, (estimated / meterLimit) * 100) : 0;
312476
312679
  const ringPercent = Math.min(100, usagePercent);
312477
312680
  elements.contextMeter.style.setProperty('--context-pct', ringPercent + '%');
312478
- elements.contextPercent.textContent = Math.round(usagePercent) + '%';
312681
+ elements.contextPercent.textContent = meterLimit ? Math.round(usagePercent) + '%' : '—';
312479
312682
  elements.contextMeter.classList.toggle('is-warm', usagePercent >= 72 && usagePercent < 90);
312480
312683
  elements.contextMeter.classList.toggle('is-hot', usagePercent >= 90);
312481
- const meterLimit = compactAt || Number(context.maxContextTokens || 0);
312482
- const meterDetail = estimated.toLocaleString() + ' / ' + meterLimit.toLocaleString() + ' tokens';
312684
+ const meterDetail = meterLimit ? estimated.toLocaleString() + ' / ' + meterLimit.toLocaleString() + ' tokens' : stageCopy('Limit unavailable', '暂无上限数据', '暫無上限資料');
312483
312685
  elements.contextMeter.title = meterDetail;
312484
312686
  elements.contextMeter.setAttribute('aria-label', copy.contextWindow + ': ' + meterDetail);
312485
312687
  renderWorkspaceState(data);
@@ -312792,9 +312994,10 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
312792
312994
  .some((value) => String(value).toLocaleLowerCase().includes(query)))
312793
312995
  : sessions;
312794
312996
  const visibleSessions = matchingSessions.slice(0, state.sessionLimit);
312795
- const renderList = (container, items, archived) => {
312796
- container.replaceChildren();
312797
- for (const session of items) {
312997
+ const renderList = (container, items, archived) => reconcileNavigation(
312998
+ container, items, session => session.id,
312999
+ session => [session.title, session.model, Boolean(session.active), relativeSessionTime(session.updatedAt)],
313000
+ session => {
312798
313001
  const isActive = Boolean(session.active);
312799
313002
  const row = document.createElement('div');
312800
313003
  row.className = 'session-row'
@@ -312837,9 +313040,9 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
312837
313040
  actions.append(secondaryAction, deleteAction);
312838
313041
  row.append(actions);
312839
313042
  }
312840
- container.append(row);
313043
+ return row;
312841
313044
  }
312842
- };
313045
+ );
312843
313046
  renderList(elements.recentSessions, visibleSessions, false);
312844
313047
  renderList(elements.archivedSessions, archivedSessions, true);
312845
313048
  elements.sessionSearchField.hidden = sessions.length < 12;
@@ -312856,13 +313059,12 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
312856
313059
  }
312857
313060
 
312858
313061
  function renderProjectNavigation(projects, currentWorkspace) {
312859
- elements.projectList.replaceChildren();
312860
- const normalizePath = (value) => String(value || '').replace(/\\/g, '/').toLowerCase();
312861
- const current = normalizePath(currentWorkspace);
313062
+ const current = projectPathKey(currentWorkspace || '');
312862
313063
  const recentProjects = (Array.isArray(projects) ? projects : [])
312863
- .filter((item) => item.available === true && normalizePath(item.path) !== current)
313064
+ .filter((item) => item.available === true && projectPathKey(item.path || '') !== current)
312864
313065
  .slice(0, 6);
312865
- for (const project of recentProjects) {
313066
+ reconcileNavigation(elements.projectList, recentProjects, project => project.id || project.path,
313067
+ project => [project.name, project.path], project => {
312866
313068
  const row = document.createElement('div');
312867
313069
  row.className = 'registered-project';
312868
313070
  const button = document.createElement('button');
@@ -312890,15 +313092,16 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
312890
313092
  remove.setAttribute('aria-label', copy.removeProject + ': ' + (project.name || 'Orbit'));
312891
313093
  remove.textContent = '×';
312892
313094
  row.append(button, remove);
312893
- elements.projectList.append(row);
312894
- }
313095
+ return row;
313096
+ });
312895
313097
  elements.recentProjectsShell.hidden = elements.projectList.childElementCount === 0;
312896
313098
  syncScrollAffordance(elements.projectList);
312897
313099
  }
312898
313100
 
312899
313101
  async function updateSession(action) {
312900
- if (state.busy) return;
312901
- state.busy = true;
313102
+ if (!state.ready || state.busy || state.sessionChanging) return;
313103
+ state.sessionChanging = true;
313104
+ updateSendButtonState();
312902
313105
  elements.newTaskButton.disabled = true;
312903
313106
  elements.recentSessions.querySelectorAll('button').forEach((button) => { button.disabled = true; });
312904
313107
  elements.archivedSessions.querySelectorAll('button').forEach((button) => { button.disabled = true; });
@@ -312908,14 +313111,20 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
312908
313111
  headers: { 'Content-Type': 'application/json' },
312909
313112
  body: JSON.stringify(action),
312910
313113
  });
313114
+ if (action.action === 'delete' && state.status) {
313115
+ const deleted = drafts.key(state.status.workspace || '', action.sessionId);
313116
+ drafts.write(deleted, '');
313117
+ discardAttachmentDraft(deleted);
313118
+ }
312911
313119
  const navigates = action.action === 'new' || action.action === 'resume';
312912
313120
  if (navigates) {
312913
313121
  clearActivity();
312914
313122
  state.controlTurns.clear();
312915
- await Promise.all([
313123
+ const [, snapshot] = await Promise.all([
312916
313124
  renderMessages({ forceBottom: true, resetHistory: true }),
312917
313125
  loadStatus(),
312918
313126
  ]);
313127
+ if (!snapshot) connectEvents();
312919
313128
  } else {
312920
313129
  await loadStatus();
312921
313130
  }
@@ -312933,8 +313142,10 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
312933
313142
  }
312934
313143
  } catch (error) {
312935
313144
  showToast(error.message || String(error), 'error');
313145
+ connectEvents();
312936
313146
  } finally {
312937
- state.busy = false;
313147
+ state.sessionChanging = false;
313148
+ updateSendButtonState();
312938
313149
  elements.newTaskButton.disabled = false;
312939
313150
  elements.recentSessions.querySelectorAll('button').forEach((button) => { button.disabled = false; });
312940
313151
  elements.archivedSessions.querySelectorAll('button').forEach((button) => { button.disabled = false; });
@@ -312945,6 +313156,7 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
312945
313156
  const epoch = state.statusEpoch, request = ++state.statusRequest;
312946
313157
  const requestedTurn = state.activeTurnId, data = await api('/api/status');
312947
313158
  if (epoch !== state.statusEpoch || request !== state.statusRequest) return;
313159
+ activateComposerDraft(data.workspace || '', data.session?.activeId || '');
312948
313160
  state.status = data;
312949
313161
  state.promptQueue = Array.isArray(data.inputQueue) ? data.inputQueue : [];
312950
313162
  renderPromptQueue();
@@ -312966,8 +313178,8 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
312966
313178
  }
312967
313179
  }
312968
313180
  const name = workspaceName(data.workspace);
312969
- byId('workspaceName').textContent = name;
312970
- byId('workspacePath').textContent = data.workspace || '';
313181
+ byId('workspacePath').textContent = name;
313182
+ byId('workspaceFolder').textContent = data.workspace || '';
312971
313183
  byId('sidebarWorkspace').textContent = name;
312972
313184
  byId('sidebarWorkspace').title = data.workspace || '';
312973
313185
  byId('sidebarSession').textContent = data.workspace || 'local';
@@ -313001,7 +313213,11 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
313001
313213
  button.classList.toggle('is-active', active);
313002
313214
  button.setAttribute('aria-pressed', active ? 'true' : 'false');
313003
313215
  });
313004
- const mode = data.permissions && data.permissions.mode || 'normal';
313216
+ const permissions = data.permissions || {};
313217
+ const mode = permissions.mode || 'normal';
313218
+ const auto = elements.permissionSelect.querySelector('option[value="auto"]');
313219
+ auto.dataset.displayLabel = mode === 'auto' && !permissions.fullAccess
313220
+ ? stageCopy('Auto (limited)', '自动(受限)', '自動(受限)') : auto.textContent;
313005
313221
  elements.permissionSelect.value = mode;
313006
313222
  syncSelectControl(elements.permissionSelect);
313007
313223
  elements.permissionSegments.querySelectorAll('[data-mode]').forEach((button) => {
@@ -313009,7 +313225,6 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
313009
313225
  button.classList.toggle('is-active', active);
313010
313226
  button.setAttribute('aria-pressed', active ? 'true' : 'false');
313011
313227
  });
313012
- const permissions = data.permissions || {};
313013
313228
  const modeSummary = mode === 'auto'
313014
313229
  ? (permissions.fullAccess ? copy.permissionFullAccess : copy.permissionAutoLimited)
313015
313230
  : mode === 'strict'
@@ -313328,8 +313543,10 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
313328
313543
 
313329
313544
  async function queuePrompt(prompt, mode) {
313330
313545
  const value = String(prompt || '').trim();
313331
- if (!state.ready || state.stopping || state.queueSubmitting || !value || state.promptQueue.length >= 12) return;
313546
+ if (!state.ready || state.sessionChanging || state.stopping || state.queueSubmitting || !value || state.promptQueue.length >= 12) return;
313332
313547
  const attachmentIds = state.attachments.map((attachment) => attachment.id);
313548
+ const scope = drafts.active;
313549
+ const attachments = state.attachments;
313333
313550
  state.queueSubmitting = true;
313334
313551
  if (document.activeElement === elements.queueButton || document.activeElement === elements.steerButton)
313335
313552
  elements.prompt.focus();
@@ -313340,10 +313557,11 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
313340
313557
  headers: { 'Content-Type': 'application/json' },
313341
313558
  body: JSON.stringify({ action: 'enqueue', prompt: value, mode: mode === 'steer' ? 'steer' : 'follow_up', attachmentIds }),
313342
313559
  });
313343
- consumeAttachments(attachmentIds);
313344
- if (elements.prompt.value === prompt) {
313560
+ consumeAttachments(attachmentIds, attachments);
313561
+ if (drafts.active !== scope && scope && drafts.read(scope) === prompt) drafts.write(scope, '');
313562
+ if (drafts.active === scope && elements.prompt.value === prompt) {
313345
313563
  elements.prompt.value = '';
313346
- writeLocalStorage('orbit.webui.draft', '');
313564
+ drafts.save('');
313347
313565
  autoSizePrompt();
313348
313566
  }
313349
313567
  await loadStatus();
@@ -313422,7 +313640,7 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
313422
313640
 
313423
313641
  async function submitTurn(prompt, options) {
313424
313642
  const value = String(prompt || '').trim();
313425
- if (!value || state.busy) return;
313643
+ if (!value || state.busy || state.sessionChanging) return;
313426
313644
  if (!state.ready) {
313427
313645
  showToast(copy.waitForConnection, 'warning');
313428
313646
  elements.prompt.focus();
@@ -313443,10 +313661,12 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
313443
313661
  closeSlashCommands();
313444
313662
  const turnId = crypto.randomUUID ? crypto.randomUUID() : String(Date.now()) + '-' + Math.random().toString(16).slice(2);
313445
313663
  const previousDraft = elements.prompt.value;
313446
- const restoreDraft = String(options && options.restoreDraft || '');
313664
+ const preserveDraft = options && typeof options.restoreDraft === 'string';
313665
+ const scope = drafts.active;
313666
+ const attachments = state.attachments;
313447
313667
  const attachmentIds = Array.isArray(options && options.attachmentIds)
313448
313668
  ? options.attachmentIds.slice(0, 4)
313449
- : state.attachments.map((attachment) => attachment.id);
313669
+ : preserveDraft ? [] : attachments.map((attachment) => attachment.id);
313450
313670
  const controlCommand = isControlCommand(value);
313451
313671
  state.submitting = true;
313452
313672
  state.activeTurnId = turnId;
@@ -313460,10 +313680,12 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
313460
313680
  } else {
313461
313681
  createStreamingTurn(value, turnId);
313462
313682
  }
313463
- elements.prompt.value = '';
313464
- writeLocalStorage('orbit.webui.draft', '');
313465
- autoSizePrompt();
313466
- updateSendButtonState();
313683
+ if (!preserveDraft) {
313684
+ elements.prompt.value = '';
313685
+ drafts.save('');
313686
+ autoSizePrompt();
313687
+ updateSendButtonState();
313688
+ }
313467
313689
  closeSidebar();
313468
313690
  try {
313469
313691
  const result = await api('/api/chat', {
@@ -313472,13 +313694,7 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
313472
313694
  body: JSON.stringify({ prompt: value, turnId, attachmentIds }),
313473
313695
  });
313474
313696
  if (result.turnId) state.activeTurnId = result.turnId;
313475
- consumeAttachments(attachmentIds);
313476
- if (restoreDraft) {
313477
- elements.prompt.value = restoreDraft;
313478
- writeLocalStorage('orbit.webui.draft', restoreDraft);
313479
- autoSizePrompt();
313480
- updateSendButtonState();
313481
- }
313697
+ consumeAttachments(attachmentIds, attachments);
313482
313698
  state.submitting = false;
313483
313699
  void reconcileStatus();
313484
313700
  } catch (error) {
@@ -313488,10 +313704,14 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
313488
313704
  state.controlTurnId = null;
313489
313705
  state.controlPrompt = '';
313490
313706
  if (controlCommand) upsertControlTurn(turnId, value, 'failed', false);
313491
- elements.prompt.value = previousDraft || value;
313492
- writeLocalStorage('orbit.webui.draft', elements.prompt.value);
313493
- autoSizePrompt();
313494
- updateSendButtonState();
313707
+ if (!preserveDraft && scope) {
313708
+ const recovered = drafts.recover(scope, previousDraft || value, elements.prompt.value);
313709
+ if (recovered !== undefined) {
313710
+ elements.prompt.value = recovered;
313711
+ autoSizePrompt();
313712
+ updateSendButtonState();
313713
+ }
313714
+ }
313495
313715
  await renderMessages().catch(() => {});
313496
313716
  showToast(error.message || String(error), 'error');
313497
313717
  }
@@ -313894,7 +314114,7 @@ var WEB_UI_CLIENT_SLASH_COMMANDS_SCRIPT = String.raw` const builtInSlashCommand
313894
314114
  const definition = slashCommandMatches[index];
313895
314115
  if (!definition) return;
313896
314116
  elements.prompt.value = definition.insertValue || (definition.command + (definition.usage ? ' ' : ''));
313897
- writeLocalStorage('orbit.webui.draft', elements.prompt.value);
314117
+ drafts.save(elements.prompt.value);
313898
314118
  autoSizePrompt();
313899
314119
  updateSendButtonState();
313900
314120
  closeSlashCommands();
@@ -314055,6 +314275,7 @@ var WEB_UI_CLIENT_SCRIPT = [
314055
314275
  `const onShortcutKeydown = ${onShortcutKeydown.toString()};`,
314056
314276
  `document.addEventListener("mousedown", ${focusActivatedButton.toString()});`,
314057
314277
  WEB_UI_CLIENT_FOUNDATION_SCRIPT,
314278
+ WEB_UI_CLIENT_DRAFTS_SCRIPT,
314058
314279
  WEB_UI_CLIENT_WORKBENCH_SCRIPT,
314059
314280
  WEB_UI_CLIENT_INSPECTOR_SCRIPT,
314060
314281
  WEB_UI_CLIENT_SELECT_SCRIPT,
@@ -314068,10 +314289,13 @@ var WEB_UI_CLIENT_SCRIPT = [
314068
314289
  WEB_UI_CLIENT_MISSION_CONTROL_SCRIPT,
314069
314290
  WEB_UI_CLIENT_EVENT_ROUTING_SCRIPT,
314070
314291
  WEB_UI_CLIENT_STREAM_PARSER_SCRIPT,
314292
+ `const projectPathKey = ${projectPathKey.toString()};`,
314293
+ `const reconcileNavigation = (${createNavigationRows.toString()})();`,
314071
314294
  WEB_UI_CLIENT_SESSION_SCRIPT,
314072
314295
  WEB_UI_CLIENT_SLASH_COMMANDS_SCRIPT,
314073
314296
  WEB_UI_CLIENT_PALETTE_SCRIPT,
314074
314297
  WEB_UI_CLIENT_AUTHENTICATION_SCRIPT,
314298
+ `(${bindWorkspaceLocation.toString()})(byId('workspaceLocation'));`,
314075
314299
  WEB_UI_CLIENT_BINDINGS_SCRIPT,
314076
314300
  WEB_UI_CLIENT_EPILOGUE
314077
314301
  ].join("");
@@ -315758,9 +315982,7 @@ var BASE_COPY = {
315758
315982
  connectionBody: "Keep the Orbit terminal open. Reconnection is automatic and your draft stays on this device.",
315759
315983
  retry: "Retry now",
315760
315984
  details: "Details",
315761
- emptyEyebrow: "ORBIT \xB7 LOCAL SESSION",
315762
315985
  emptyTitle: "What should we work on?",
315763
- emptyBody: "Ask, plan, build, or verify anything in this workspace.",
315764
315986
  suggestionReview: "Review this project",
315765
315987
  suggestionReviewBody: "Find the highest-impact issues and fix them.",
315766
315988
  suggestionFix: "Fix a problem",
@@ -315784,7 +316006,7 @@ var BASE_COPY = {
315784
316006
  attachImage: "Attach image",
315785
316007
  clearContext: "Clear all",
315786
316008
  webSearch: "Agent search",
315787
- sendHint: "Enter to send or queue \xB7 Ctrl+Enter steers \xB7 Shift+Enter for a new line \xB7 Type / for commands",
316009
+ sendHint: "Enter to send \xB7 Shift+Enter for a new line \xB7 Type / for commands",
315788
316010
  queuedMessages: "Queued follow-ups",
315789
316011
  clearQueue: "Clear queue",
315790
316012
  queueMessage: "Queue message",
@@ -315949,9 +316171,7 @@ var BASE_COPY = {
315949
316171
  connectionBody: "\u8BF7\u4FDD\u6301 Orbit \u7EC8\u7AEF\u8FD0\u884C\uFF1B\u9875\u9762\u4F1A\u81EA\u52A8\u91CD\u8FDE\uFF0C\u8349\u7A3F\u4F1A\u7EE7\u7EED\u4FDD\u5B58\u5728\u672C\u673A\u3002",
315950
316172
  retry: "\u7ACB\u5373\u91CD\u8BD5",
315951
316173
  details: "\u4EFB\u52A1\u8BE6\u60C5",
315952
- emptyEyebrow: "ORBIT \xB7 \u672C\u5730\u4F1A\u8BDD",
315953
316174
  emptyTitle: "\u63A5\u4E0B\u6765\u60F3\u505A\u4EC0\u4E48\uFF1F",
315954
- emptyBody: "\u8BA9 Orbit \u5728\u5F53\u524D\u5DE5\u4F5C\u533A\u4E2D\u5206\u6790\u3001\u89C4\u5212\u3001\u5B9E\u73B0\u6216\u9A8C\u8BC1\u4EFB\u52A1\u3002",
315955
316175
  suggestionReview: "\u5168\u9762\u5BA1\u67E5\u9879\u76EE",
315956
316176
  suggestionReviewBody: "\u627E\u51FA\u5F71\u54CD\u6700\u5927\u7684\u95EE\u9898\u5E76\u76F4\u63A5\u4FEE\u590D\u3002",
315957
316177
  suggestionFix: "\u4FEE\u590D\u4E00\u4E2A\u95EE\u9898",
@@ -315975,7 +316195,7 @@ var BASE_COPY = {
315975
316195
  attachImage: "\u6DFB\u52A0\u56FE\u7247",
315976
316196
  clearContext: "\u5168\u90E8\u6E05\u7A7A",
315977
316197
  webSearch: "Agent \u641C\u7D22",
315978
- sendHint: "Enter \u53D1\u9001\u6216\u6392\u961F \xB7 Ctrl+Enter \u5F15\u5BFC \xB7 Shift+Enter \u6362\u884C \xB7 \u8F93\u5165 / \u67E5\u770B\u547D\u4EE4",
316198
+ sendHint: "Enter \u53D1\u9001 \xB7 Shift+Enter \u6362\u884C \xB7 / \u67E5\u770B\u547D\u4EE4",
315979
316199
  queuedMessages: "\u5F85\u53D1\u9001\u6D88\u606F",
315980
316200
  clearQueue: "\u6E05\u7A7A\u961F\u5217",
315981
316201
  queueMessage: "\u52A0\u5165\u961F\u5217",
@@ -316051,7 +316271,7 @@ var BASE_COPY = {
316051
316271
  fullAccessConfirmAction: "\u6388\u4E88\u5B8C\u6574\u6743\u9650",
316052
316272
  modeStrict: "\u4E25\u683C",
316053
316273
  modeNormal: "\u6807\u51C6",
316054
- modeAuto: "\u5168\u81EA\u52A8",
316274
+ modeAuto: "\u5B8C\u6574\u8BBF\u95EE",
316055
316275
  modePlan: "\u89C4\u5212",
316056
316276
  searchProvider: "\u641C\u7D22\u670D\u52A1",
316057
316277
  searchResults: "\u6700\u5927\u7ED3\u679C\u6570",
@@ -316138,9 +316358,7 @@ var COPY = {
316138
316358
  collapseNavigation: "\u6536\u5408\u5C0E\u89BD",
316139
316359
  connected: "\u6B63\u5728\u9023\u7DDA",
316140
316360
  details: "\u4EFB\u52D9\u8A73\u60C5",
316141
- emptyEyebrow: "ORBIT \xB7 \u672C\u6A5F\u5DE5\u4F5C\u968E\u6BB5",
316142
316361
  emptyTitle: "\u63A5\u4E0B\u4F86\u60F3\u505A\u4EC0\u9EBC\uFF1F",
316143
- emptyBody: "\u8B93 Orbit \u5728\u76EE\u524D\u5DE5\u4F5C\u5340\u4E2D\u5206\u6790\u3001\u898F\u5283\u3001\u5BE6\u4F5C\u6216\u9A57\u8B49\u4EFB\u52D9\u3002",
316144
316362
  suggestionReview: "\u5168\u9762\u6AA2\u8996\u5C08\u6848",
316145
316363
  suggestionReviewBody: "\u627E\u51FA\u5F71\u97FF\u6700\u5927\u7684\u554F\u984C\u4E26\u76F4\u63A5\u4FEE\u6B63\u3002",
316146
316364
  suggestionFix: "\u4FEE\u6B63\u4E00\u500B\u554F\u984C",
@@ -316160,7 +316378,7 @@ var COPY = {
316160
316378
  attachImage: "\u52A0\u5165\u5716\u7247",
316161
316379
  clearContext: "\u5168\u90E8\u6E05\u9664",
316162
316380
  webSearch: "Agent \u641C\u5C0B",
316163
- sendHint: "Enter \u50B3\u9001\u6216\u6392\u968A \xB7 Ctrl+Enter \u5F15\u5C0E \xB7 Shift+Enter \u63DB\u884C \xB7 \u8F38\u5165 / \u67E5\u770B\u547D\u4EE4",
316381
+ sendHint: "Enter \u50B3\u9001 \xB7 Shift+Enter \u63DB\u884C \xB7 / \u67E5\u770B\u547D\u4EE4",
316164
316382
  queuedMessages: "\u5F85\u50B3\u9001\u8A0A\u606F",
316165
316383
  clearQueue: "\u6E05\u9664\u4F47\u5217",
316166
316384
  queueMessage: "\u52A0\u5165\u4F47\u5217",
@@ -316211,7 +316429,7 @@ var COPY = {
316211
316429
  fullAccessConfirmAction: "\u6388\u4E88\u5B8C\u6574\u6B0A\u9650",
316212
316430
  modeStrict: "\u56B4\u683C",
316213
316431
  modeNormal: "\u6A19\u6E96",
316214
- modeAuto: "\u5168\u81EA\u52D5",
316432
+ modeAuto: "\u5B8C\u6574\u53D6\u7528",
316215
316433
  modePlan: "\u898F\u5283",
316216
316434
  searchProvider: "\u641C\u5C0B\u670D\u52D9",
316217
316435
  searchResults: "\u6700\u5927\u7D50\u679C\u6578",
@@ -316281,7 +316499,8 @@ function renderComposer(copy, t2) {
316281
316499
  <div class="prompt-queue-header"><button id="clearQueueButton" type="button">${copy.clearQueue}</button></div>
316282
316500
  <div class="prompt-queue-list" id="promptQueueList"></div>
316283
316501
  </details>
316284
- <div class="composer-models" role="group" aria-label="${copy.model}">
316502
+ <div class="composer-toolbar">
316503
+ <div class="composer-models" role="group" aria-label="${copy.model}">
316285
316504
  <div class="select-control provider-control" data-select-control data-select-placement="top" title="${copy.provider}">
316286
316505
  <select class="native-select-proxy" id="providerSelect" aria-label="${copy.provider}" tabindex="-1" aria-hidden="true" hidden></select>
316287
316506
  <button class="select-trigger provider-select-trigger" id="providerSelectTrigger" type="button" aria-label="${copy.provider}" aria-haspopup="listbox" aria-controls="providerSelectMenu" aria-expanded="false">
@@ -316296,13 +316515,6 @@ function renderComposer(copy, t2) {
316296
316515
  </button>
316297
316516
  <div class="select-menu model-select-menu" id="modelSelectMenu" role="listbox" aria-label="${copy.model}" hidden></div>
316298
316517
  </div>
316299
- </div>
316300
- <div class="composer-toolbar">
316301
- <div class="composer-tools">
316302
- <button class="composer-chip" id="contextPickerButton" type="button" data-open-context aria-label="${copy.context}" aria-haspopup="dialog" aria-controls="contextPicker" aria-expanded="false">${renderUiIcon("context")}<span>${copy.context}</span><span class="context-chip-count" id="contextChipCount" aria-label="0" hidden>0</span></button>
316303
- <button class="composer-chip" id="attachmentButton" type="button" aria-label="${copy.attachImage}">${renderUiIcon("image")}<span>${copy.attachments}</span><span class="context-chip-count" id="attachmentCount" aria-label="0" hidden>0</span></button>
316304
- <input id="attachmentInput" data-testid="attachment-input" type="file" accept="image/png,image/jpeg,image/gif,image/webp" multiple hidden />
316305
- <button class="composer-chip" id="searchToggle" type="button" aria-label="${copy.webSearch}" aria-pressed="false"><span class="web-status-dot" aria-hidden="true"></span><span>${copy.webSearch}</span></button>
316306
316518
  <div class="select-control composer-select-control" data-select-control>
316307
316519
  <select class="native-select-proxy" id="permissionSelect" aria-label="${copy.permission}" tabindex="-1" aria-hidden="true" hidden>
316308
316520
  <option value="strict">${copy.modeStrict}</option>
@@ -316316,6 +316528,12 @@ function renderComposer(copy, t2) {
316316
316528
  <div class="select-menu" id="permissionSelectMenu" role="listbox" aria-label="${copy.permission}" hidden></div>
316317
316529
  </div>
316318
316530
  </div>
316531
+ <div class="composer-tools">
316532
+ <button class="composer-chip" id="contextPickerButton" type="button" data-open-context aria-label="${copy.context}" aria-haspopup="dialog" aria-controls="contextPicker" aria-expanded="false">${renderUiIcon("context")}<span>${copy.context}</span><span class="context-chip-count" id="contextChipCount" aria-label="0" hidden>0</span></button>
316533
+ <button class="composer-chip" id="attachmentButton" type="button" aria-label="${copy.attachImage}">${renderUiIcon("image")}<span>${copy.attachments}</span><span class="context-chip-count" id="attachmentCount" aria-label="0" hidden>0</span></button>
316534
+ <input id="attachmentInput" data-testid="attachment-input" type="file" accept="image/png,image/jpeg,image/gif,image/webp" multiple hidden />
316535
+ <button class="composer-chip" id="searchToggle" type="button" aria-label="${copy.webSearch}" aria-pressed="false"><span class="web-status-dot" aria-hidden="true"></span><span>${copy.webSearch}</span></button>
316536
+ </div>
316319
316537
  <div class="composer-actions">
316320
316538
  <button class="queue-button" id="queueButton" type="button" hidden>${copy.queueMessage}</button>
316321
316539
  <button class="queue-button" id="steerButton" type="button" hidden>${t2("Steer now", "\u7ACB\u5373\u5F15\u5BFC", "\u7ACB\u5373\u5F15\u5C0E")}</button>
@@ -316347,7 +316565,11 @@ function renderComposer(copy, t2) {
316347
316565
  <p class="context-picker-hint">${copy.contextPickerHint}</p>
316348
316566
  </section>
316349
316567
  </form>
316350
- <p class="composer-hint">${copy.sendHint}</p>
316568
+ <p class="composer-hint" id="composerHint" data-idle="${copy.sendHint}" data-running="${t2(
316569
+ "Enter to queue \xB7 {steer} to steer \xB7 Shift+Enter for a new line",
316570
+ "Enter \u52A0\u5165\u961F\u5217 \xB7 {steer} \u5F15\u5BFC\u5F53\u524D\u4EFB\u52A1 \xB7 Shift+Enter \u6362\u884C",
316571
+ "Enter \u52A0\u5165\u4F47\u5217 \xB7 {steer} \u5F15\u5C0E\u76EE\u524D\u4EFB\u52D9 \xB7 Shift+Enter \u63DB\u884C"
316572
+ )}">${copy.sendHint}</p>
316351
316573
  </div>`;
316352
316574
  }
316353
316575
  function renderWebUiPage(language) {
@@ -316383,10 +316605,10 @@ function renderWebUiPage(language) {
316383
316605
  <button class="sidebar-collapse-button" id="sidebarCollapseButton" type="button" aria-label="${copy.collapseNavigation}" aria-controls="sidebar" aria-expanded="true">${renderUiIcon("panel")}</button>
316384
316606
  </div>
316385
316607
 
316386
- <button class="new-task-button" id="newTaskButton" data-testid="new-chat" type="button">
316608
+ <button class="new-task-button" aria-keyshortcuts="Control+n" id="newTaskButton" data-testid="new-chat" type="button">
316387
316609
  <span class="new-task-icon">${renderUiIcon("add")}</span>
316388
316610
  <span>${copy.newTask}</span>
316389
- <kbd>Ctrl N</kbd>
316611
+ <kbd data-control-key="N">Ctrl N</kbd>
316390
316612
  </button>
316391
316613
 
316392
316614
  <div class="nav-section-heading project-heading">
@@ -316435,7 +316657,7 @@ function renderWebUiPage(language) {
316435
316657
 
316436
316658
  <div class="sidebar-spacer"></div>
316437
316659
  <footer class="sidebar-footer">
316438
- <button class="nav-button" id="commandsButton" type="button" aria-label="${copy.commands}" aria-haspopup="dialog" aria-controls="commandPalette">${renderUiIcon("commands")}<span>${copy.commands}</span><kbd>Ctrl K</kbd></button>
316660
+ <button class="nav-button" aria-keyshortcuts="Control+k" id="commandsButton" type="button" aria-label="${copy.commands}" aria-haspopup="dialog" aria-controls="commandPalette">${renderUiIcon("commands")}<span>${copy.commands}</span><kbd data-control-key="K">Ctrl K</kbd></button>
316439
316661
  <button class="nav-button" id="inspectorButton" type="button" aria-label="${copy.settings}" aria-controls="inspector" aria-expanded="false">${renderUiIcon("diagnostics")}<span>${copy.settings}</span></button>
316440
316662
  </footer>
316441
316663
  </aside>
@@ -316445,8 +316667,11 @@ function renderWebUiPage(language) {
316445
316667
  <div class="topbar-start">
316446
316668
  <button class="icon-button mobile-menu" id="menuButton" type="button" aria-label="${copy.openNavigation}" aria-controls="sidebar" aria-expanded="false">${renderUiIcon("menu")}</button>
316447
316669
  <div class="workspace-heading">
316670
+ <details class="workspace-location" id="workspaceLocation">
316671
+ <summary title="${copy.projectPath}"><span id="workspacePath">Orbit</span>${renderUiIcon("down")}</summary>
316672
+ <div class="workspace-location-detail"><strong>${copy.projectPath}</strong><code id="workspaceFolder" dir="auto"></code></div>
316673
+ </details>
316448
316674
  <strong id="workspaceName">Orbit</strong>
316449
- <span id="workspacePath">${copy.localOnly}</span>
316450
316675
  </div>
316451
316676
  </div>
316452
316677
  <div class="topbar-actions">
@@ -316458,9 +316683,9 @@ function renderWebUiPage(language) {
316458
316683
  <span class="connection-dot"></span>
316459
316684
  <span id="connectionLabel" role="status" aria-live="polite">${copy.connected}</span>
316460
316685
  </button>
316461
- <button class="approval-jump" id="jumpApproval" aria-controls="approvalPanel" type="button" hidden>${t2("Review pending request", "\u67E5\u770B\u5F85\u786E\u8BA4\u4E8B\u9879", "\u67E5\u770B\u5F85\u78BA\u8A8D\u4E8B\u9805")}</button>
316686
+ <button class="approval-jump" id="jumpApproval" aria-controls="approvalPanel" type="button" aria-label="${t2("Review pending request", "\u67E5\u770B\u5F85\u786E\u8BA4\u4E8B\u9879", "\u67E5\u770B\u5F85\u78BA\u8A8D\u4E8B\u9805")}" hidden>${t2("Pending review", "\u5F85\u786E\u8BA4", "\u5F85\u78BA\u8A8D")}</button>
316462
316687
  <nav class="workspace-tools" aria-label="${copy.details}">
316463
- <button class="workspace-tool" id="tasksButton" data-testid="tasks" type="button" aria-expanded="false" aria-controls="workbench">${renderUiIcon("tasks")}<span>${copy.inspectorTitle}</span></button>
316688
+ <button class="workspace-tool" id="tasksButton" title="${copy.inspectorTitle}" data-testid="tasks" type="button" aria-expanded="false" aria-controls="workbench">${renderUiIcon("tasks")}<span>${copy.inspectorTitle}</span></button>
316464
316689
  </nav>
316465
316690
  </div>
316466
316691
  </header>
@@ -316481,11 +316706,11 @@ function renderWebUiPage(language) {
316481
316706
  <span class="approval-eyebrow" id="approvalEyebrow" role="status">${copy.approvalEyebrow}</span>
316482
316707
  <strong id="approvalTitle"></strong>
316483
316708
  </div>
316709
+ <button class="diff-link" id="approvalDiffButton" type="button" aria-controls="changesPanel" hidden>${t2("View diff", "\u67E5\u770B\u5DEE\u5F02", "\u67E5\u770B\u5DEE\u7570")}</button>
316484
316710
  </div>
316485
316711
  <p class="approval-reason" id="approvalReason"></p>
316486
316712
  <div id="approvalInlinePreview"><pre class="approval-preview" id="approvalPreview" tabindex="0" hidden></pre></div>
316487
316713
  <div class="approval-actions">
316488
- <button class="approval-button" id="approvalDiffButton" type="button" aria-controls="changesPanel" hidden>${t2("View diff", "\u67E5\u770B\u5DEE\u5F02", "\u67E5\u770B\u5DEE\u7570")}</button>
316489
316714
  <button class="approval-button is-deny" id="denyApprovalButton" type="button">${copy.approvalDeny}</button>
316490
316715
  <button class="approval-button is-approve" id="approveApprovalButton" type="button">${copy.approvalApprove}</button>
316491
316716
  </div>
@@ -316495,9 +316720,7 @@ function renderWebUiPage(language) {
316495
316720
  <button class="text-button" id="verificationResultButton" aria-controls="verificationList" type="button">${copy.verification} \xB7 <span id="resultVerification"></span></button>
316496
316721
  </div>
316497
316722
  <section class="empty-state" id="emptyState">
316498
- <p class="eyebrow">${renderOrbitMark("eyebrow-mark")}<span>${copy.emptyEyebrow}</span></p>
316499
- <h1>${copy.emptyTitle}</h1>
316500
- <p class="empty-description">${copy.emptyBody}</p>
316723
+ <div class="empty-heading">${renderOrbitMark("welcome-mark")}<h1>${copy.emptyTitle}</h1></div>
316501
316724
  <div class="empty-composer-slot" id="emptyComposerSlot">
316502
316725
  ${renderComposer(copy, t2)}
316503
316726
  </div>
@@ -316545,7 +316768,7 @@ function renderWebUiPage(language) {
316545
316768
  <h3>${copy.taskCenter}</h3>
316546
316769
  <p>${copy.taskCenterDescription}</p>
316547
316770
  </header>
316548
- <section class="task-overview" id="taskOverview" aria-live="polite"></section>
316771
+ <section class="task-overview" id="taskOverview"></section>
316549
316772
  <section class="task-actions" aria-labelledby="taskActionsTitle">
316550
316773
  <div class="section-heading"><h3 id="taskActionsTitle">${copy.taskActions}</h3></div>
316551
316774
  <div class="task-action-grid">
@@ -316855,7 +317078,7 @@ function renderWebUiPage(language) {
316855
317078
  <div class="project-path-field">
316856
317079
  <label for="projectPathInput">${copy.projectPath}</label>
316857
317080
  <div class="project-path-control">
316858
- <input id="projectPathInput" type="text" maxlength="4096" autocomplete="off" spellcheck="false" placeholder="${copy.projectPathPlaceholder}" />
317081
+ <input id="projectPathInput" type="text" maxlength="4096" autocomplete="off" spellcheck="false" placeholder="${process.platform === "win32" ? copy.projectPathPlaceholder : process.platform === "darwin" ? "/Users/me/Projects/orbit" : "/home/me/projects/orbit"}" />
316859
317082
  <button class="project-dialog-browse" id="projectDialogBrowse" type="button">${copy.browseProject}</button>
316860
317083
  </div>
316861
317084
  </div>
@@ -316872,11 +317095,11 @@ function renderWebUiPage(language) {
316872
317095
 
316873
317096
  // src/runtime/webui/styles/WebUiComposerStyles.ts
316874
317097
  var WEB_UI_COMPOSER_STYLES = String.raw`
316875
- .composer-models { display: flex; align-items: center; gap: 2px; padding: 3px 0 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
317098
+ .composer-models { display: flex; align-items: center; gap: 2px; flex: 1 1 230px; min-width: 0; }
316876
317099
  .composer-models .select-trigger { height: 32px; width: auto; max-width: 100%; border-color: transparent; background: transparent; box-shadow: none; font-size: 12px; }
316877
317100
  .composer-models .provider-select-trigger { max-width: 145px; color: var(--muted); }
316878
317101
  .composer-models .provider-control { flex: 0 1 auto; max-width: 145px; }
316879
- .composer-models .model-control { min-width: 0; flex: 1 1 0; }
317102
+ .composer-models .model-control { min-width: 0; flex: 0 1 auto; }
316880
317103
  .composer-models .model-select-trigger { max-width: min(320px, 100%); width: fit-content; }
316881
317104
  .composer-models .select-trigger:hover { background: var(--surface-hover); }
316882
317105
  .composer-dock {
@@ -317115,10 +317338,11 @@ var WEB_UI_COMPOSER_STYLES = String.raw`
317115
317338
 
317116
317339
  .composer-toolbar {
317117
317340
  display: flex;
317118
- align-items: flex-end;
317119
- justify-content: space-between;
317120
- gap: 12px;
317121
- padding-top: 2px;
317341
+ flex-wrap: wrap;
317342
+ align-items: center;
317343
+ gap: 4px 8px;
317344
+ padding-top: 5px;
317345
+ border-top: 1px solid var(--border);
317122
317346
  }
317123
317347
 
317124
317348
  .composer-tools {
@@ -317197,6 +317421,7 @@ var WEB_UI_COMPOSER_STYLES = String.raw`
317197
317421
  }
317198
317422
 
317199
317423
  .composer-actions {
317424
+ margin-left: auto;
317200
317425
  display: flex;
317201
317426
  align-items: center;
317202
317427
  gap: 6px;
@@ -317569,8 +317794,8 @@ var WEB_UI_APPROVAL_STYLES = String.raw`
317569
317794
 
317570
317795
  .approval-jump {
317571
317796
  display: block;
317572
- margin: 0 0 4px;
317573
- padding: 4px 8px;
317797
+ margin: 0;
317798
+ padding: 6px 9px;
317574
317799
  border: 0;
317575
317800
  background: var(--warning-soft);
317576
317801
  color: var(--ink);
@@ -317606,6 +317831,20 @@ var WEB_UI_APPROVAL_STYLES = String.raw`
317606
317831
  gap: 2px;
317607
317832
  }
317608
317833
 
317834
+ .diff-link {
317835
+ flex: 0 0 auto;
317836
+ align-self: center;
317837
+ margin-left: auto;
317838
+ padding: 7px 5px;
317839
+ color: var(--accent-strong);
317840
+ background: transparent;
317841
+ border: 0;
317842
+ border-radius: 5px;
317843
+ font: 600 12px/1.4 var(--font-sans);
317844
+ text-decoration: underline;
317845
+ text-underline-offset: 3px;
317846
+ }
317847
+
317609
317848
  .approval-mark {
317610
317849
  width: 28px;
317611
317850
  height: 28px;
@@ -319080,28 +319319,15 @@ var WEB_UI_CONVERSATION_STYLES = String.raw`
319080
319319
  display: none;
319081
319320
  }
319082
319321
 
319083
- .eyebrow {
319084
- display: inline-flex;
319322
+ .empty-heading {
319323
+ display: flex;
319085
319324
  align-items: center;
319086
- gap: 8px;
319087
- width: fit-content;
319088
- margin: 0 0 14px;
319089
- color: var(--accent-strong);
319090
- font: 720 10px/1.4 var(--font-mono);
319091
- letter-spacing: 0.11em;
319092
- }
319093
-
319094
- .eyebrow::after {
319095
- content: "";
319096
- width: 28px;
319097
- height: 1px;
319098
- margin-left: 3px;
319099
- background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent), transparent);
319325
+ gap: 14px;
319100
319326
  }
319101
319327
 
319102
- .eyebrow-mark {
319103
- width: 22px;
319104
- height: 22px;
319328
+ .welcome-mark {
319329
+ width: 40px;
319330
+ height: 40px;
319105
319331
  color: var(--accent-strong);
319106
319332
  }
319107
319333
 
@@ -319115,14 +319341,6 @@ var WEB_UI_CONVERSATION_STYLES = String.raw`
319115
319341
  line-height: 1.08;
319116
319342
  }
319117
319343
 
319118
- .empty-description {
319119
- max-width: 600px;
319120
- margin: 10px 0 0;
319121
- color: var(--muted);
319122
- font-size: 14.5px;
319123
- line-height: 1.65;
319124
- }
319125
-
319126
319344
  .connection-help {
319127
319345
  display: none;
319128
319346
  grid-template-columns: auto minmax(0, 1fr) auto;
@@ -319213,19 +319431,19 @@ var WEB_UI_CONVERSATION_STYLES = String.raw`
319213
319431
  gap: 11px;
319214
319432
  padding: 11px 14px;
319215
319433
  color: var(--ink);
319216
- background: color-mix(in srgb, var(--surface-raised) 92%, transparent);
319217
- border: 1px solid var(--border-strong);
319218
- border-radius: 13px;
319434
+ background: transparent;
319435
+ border: 0;
319436
+ border-bottom: 1px solid var(--border);
319437
+ border-radius: 0;
319219
319438
  text-align: left;
319220
- box-shadow: 0 1px 2px rgba(26, 43, 40, 0.035);
319439
+ box-shadow: none;
319221
319440
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
319222
319441
  }
319223
319442
 
319224
319443
  .suggestion-card:hover {
319225
319444
  background: var(--surface-raised);
319226
319445
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
319227
- box-shadow: 0 12px 30px rgba(23, 53, 45, 0.09);
319228
- transform: translateY(-2px);
319446
+ box-shadow: none;
319229
319447
  }
319230
319448
 
319231
319449
  .suggestion-icon {
@@ -319255,14 +319473,14 @@ var WEB_UI_CONVERSATION_STYLES = String.raw`
319255
319473
 
319256
319474
  .suggestion-copy strong {
319257
319475
  color: var(--ink-strong);
319258
- font-size: 12px;
319476
+ font-size: 13px;
319259
319477
  font-weight: 650;
319260
319478
  }
319261
319479
 
319262
319480
  .suggestion-copy small {
319263
319481
  overflow: hidden;
319264
319482
  color: var(--muted);
319265
- font-size: 10px;
319483
+ font-size: 12px;
319266
319484
  line-height: 1.4;
319267
319485
  text-overflow: ellipsis;
319268
319486
  white-space: nowrap;
@@ -319843,8 +320061,8 @@ var WEB_UI_FOUNDATION_STYLES = String.raw`
319843
320061
  --radius-md: 12px;
319844
320062
  --radius-lg: 18px;
319845
320063
  --radius-xl: 24px;
319846
- --font-sans: "Segoe UI Variable Text", Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI", sans-serif;
319847
- --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
320064
+ --font-sans: -apple-system, system-ui, "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
320065
+ --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
319848
320066
  }
319849
320067
 
319850
320068
  :root[data-theme="dark"] {
@@ -321970,8 +322188,7 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
321970
322188
  display: none;
321971
322189
  }
321972
322190
 
321973
- .context-meter,
321974
- .workspace-heading span {
322191
+ .context-meter {
321975
322192
  display: none;
321976
322193
  }
321977
322194
 
@@ -322082,10 +322299,6 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
322082
322299
  font-size: 44px;
322083
322300
  }
322084
322301
 
322085
- .empty-description {
322086
- font-size: 15px;
322087
- }
322088
-
322089
322302
  .suggestion-card {
322090
322303
  min-height: 68px;
322091
322304
  }
@@ -322200,7 +322413,6 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
322200
322413
  padding-top: env(safe-area-inset-top);
322201
322414
  }
322202
322415
 
322203
- .workspace-heading span,
322204
322416
  .command-trigger,
322205
322417
  .context-meter,
322206
322418
  .brand-version {
@@ -322225,8 +322437,13 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
322225
322437
  max-width: none;
322226
322438
  }
322227
322439
 
322228
- .workspace-tool { padding-inline: 6px; }
322229
- .workspace-tool .ui-icon { display: none; }
322440
+ .workspace-tool { width: 40px; height: 40px; justify-content: center; padding: 0; }
322441
+ .workspace-tool span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
322442
+ .workspace-tool .ui-icon { width: 18px; height: 18px; }
322443
+ .workspace-heading span, .workspace-heading strong { max-width: 100%; }
322444
+ .topbar-start { gap: 5px; }
322445
+ .welcome-mark { width: 32px; height: 32px; }
322446
+ .empty-heading { gap: 9px; }
322230
322447
  .composer-models .provider-control, .composer-models .model-control { display: block; }
322231
322448
 
322232
322449
  .message-column {
@@ -322284,10 +322501,6 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
322284
322501
  padding: 38px 0 28px;
322285
322502
  }
322286
322503
 
322287
- .empty-description {
322288
- font-size: 12px;
322289
- }
322290
-
322291
322504
  .suggestion-grid {
322292
322505
  grid-template-columns: repeat(2, minmax(0, 1fr));
322293
322506
  gap: 7px;
@@ -322361,7 +322574,7 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
322361
322574
  }
322362
322575
 
322363
322576
  .composer-models .select-trigger {
322364
- height: 36px;
322577
+ height: 40px;
322365
322578
  }
322366
322579
 
322367
322580
  .context-shelf {
@@ -322450,10 +322663,20 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
322450
322663
  }
322451
322664
  }
322452
322665
 
322666
+ @media (max-width: 760px) {
322667
+ .composer-models { flex-basis: 100%; }
322668
+ .composer-models .composer-select-control { margin-left: auto; }
322669
+ .composer-tools { flex: 1 1 0; }
322670
+ }
322671
+
322672
+ @container preview-chat (max-width: 680px) {
322673
+ .composer-models { flex-basis: 100%; }
322674
+ .composer-models .composer-select-control { margin-left: auto; }
322675
+ .composer-tools { flex: 1 1 0; }
322676
+ }
322677
+
322453
322678
  @media (max-width: 420px) {
322454
- .composer-toolbar {
322455
- gap: 8px;
322456
- }
322679
+ .composer-toolbar { gap: 3px 5px; }
322457
322680
 
322458
322681
  .task-overview-stats {
322459
322682
  grid-template-columns: minmax(0, 1fr);
@@ -322471,10 +322694,6 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
322471
322694
  font-size: 29px;
322472
322695
  }
322473
322696
 
322474
- .empty-description {
322475
- max-width: 34ch;
322476
- }
322477
-
322478
322697
  }
322479
322698
 
322480
322699
  @media (prefers-reduced-motion: reduce) {
@@ -323805,6 +324024,20 @@ var WEB_UI_SHELL_STYLES = String.raw`
323805
324024
  line-height: 1.22;
323806
324025
  }
323807
324026
 
324027
+ .workspace-location { position: relative; width: fit-content; max-width: 100%; }
324028
+ .workspace-location summary { display: flex; align-items: center; gap: 4px; min-height: 18px; cursor: pointer; list-style: none; }
324029
+ .workspace-location summary::-webkit-details-marker { display: none; }
324030
+ .workspace-location .ui-icon { width: 10px; height: 10px; color: var(--faint); }
324031
+ .workspace-location[open] .ui-icon { transform: rotate(180deg); }
324032
+ .workspace-location-detail {
324033
+ position: absolute; z-index: 2; inset: calc(100% + 5px) auto auto 0;
324034
+ width: max-content; max-width: min(380px, 74vw); padding: 10px 12px;
324035
+ display: grid; gap: 5px; color: var(--ink);
324036
+ background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: 9px; box-shadow: var(--shadow-md);
324037
+ }
324038
+ .workspace-heading .workspace-location-detail strong { font-size: 11px; color: var(--muted); }
324039
+ .workspace-location-detail code { font: 12px/1.5 var(--font-mono); overflow-wrap: anywhere; user-select: all; }
324040
+
323808
324041
  .workspace-heading strong,
323809
324042
  .workspace-heading span {
323810
324043
  max-width: min(32vw, 430px);
@@ -323822,7 +324055,7 @@ var WEB_UI_SHELL_STYLES = String.raw`
323822
324055
 
323823
324056
  .workspace-heading span {
323824
324057
  color: var(--faint);
323825
- font: 10px/1.3 var(--font-mono);
324058
+ font: 500 11px/1.3 var(--font-sans);
323826
324059
  }
323827
324060
 
323828
324061
  .icon-button,
@@ -323991,9 +324224,7 @@ var WEB_UI_WORKBENCH_STYLES = String.raw`
323991
324224
  .workbench .inspector-content { padding-inline: 20px; padding-top: 12px; }
323992
324225
  .workbench .task-overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
323993
324226
  .workspace-view.is-preview-open:not(.is-preview-focus) .empty-state { width: calc(100% - 40px); max-width: none; padding-top: 20px; }
323994
- .workspace-view.is-preview-open:not(.is-preview-focus) .empty-state .eyebrow { display: none; }
323995
324227
  .workspace-view.is-preview-open:not(.is-preview-focus) .empty-state h1 { font-size: 20px; letter-spacing: -0.025em; line-height: 1.25; }
323996
- .workspace-view.is-preview-open:not(.is-preview-focus) .empty-description { margin-top: 4px; font-size: 12px; line-height: 1.45; }
323997
324228
  .workspace-view.is-preview-open:not(.is-preview-focus) .empty-composer-slot { margin-top: 14px; }
323998
324229
  .workspace-view.is-preview-open:not(.is-preview-focus) .suggestion-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; margin-top: 10px; }
323999
324230
  .workspace-view.is-preview-open:not(.is-preview-focus) .suggestion-card { min-height: 34px; gap: 6px; padding: 5px 7px; border-color: transparent; border-radius: 8px; box-shadow: none; background: transparent; }