@orbit-build/cli 3.1.0 → 3.2.1
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 +685 -653
- package/dist/safari-extension/manifest.json +1 -1
- package/dist/safari-extension/page.js +16 -1
- package/dist/safari-extension/popup.js +19 -10
- package/package.json +1 -1
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(
|
|
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(
|
|
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
|
|
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
|
-
|
|
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: `
|
|
291413
|
-
hint:
|
|
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
|
-
|
|
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)}.`);
|
|
@@ -303911,13 +303934,15 @@ var DISABLE_ALT_SCREEN = "\x1B[?1049l";
|
|
|
303911
303934
|
var ENABLE_MOUSE = "\x1B[?1000h\x1B[?1006h";
|
|
303912
303935
|
var DISABLE_MOUSE = "\x1B[?1006l\x1B[?1000l";
|
|
303913
303936
|
var HIDE_CURSOR = "\x1B[?25l";
|
|
303937
|
+
var STEADY_BAR_CURSOR = "\x1B[6 q";
|
|
303938
|
+
var DEFAULT_CURSOR = "\x1B[0 q";
|
|
303914
303939
|
var RESET_AND_SHOW_CURSOR = "\x1B[0m\x1B[?25h";
|
|
303915
303940
|
function enterFullscreenTerminal(mouseEnabled, stdout2 = process.stdout) {
|
|
303916
303941
|
const mouseMode = mouseEnabled ? ENABLE_MOUSE : "";
|
|
303917
|
-
stdout2.write(`${ENABLE_ALT_SCREEN}${mouseMode}${HIDE_CURSOR}`);
|
|
303942
|
+
stdout2.write(`${ENABLE_ALT_SCREEN}${STEADY_BAR_CURSOR}${mouseMode}${HIDE_CURSOR}`);
|
|
303918
303943
|
}
|
|
303919
303944
|
function leaveFullscreenTerminal(stdin2 = process.stdin, stdout2 = process.stdout) {
|
|
303920
|
-
stdout2.write(`${DISABLE_MOUSE}${DISABLE_ALT_SCREEN}${RESET_AND_SHOW_CURSOR}`);
|
|
303945
|
+
stdout2.write(`${DISABLE_MOUSE}${DEFAULT_CURSOR}${DISABLE_ALT_SCREEN}${RESET_AND_SHOW_CURSOR}`);
|
|
303921
303946
|
if (stdin2.setRawMode) stdin2.setRawMode(false);
|
|
303922
303947
|
}
|
|
303923
303948
|
|
|
@@ -306555,6 +306580,155 @@ async function getAutocompleteCandidates(cwd, config, mcpPromptCommands = []) {
|
|
|
306555
306580
|
};
|
|
306556
306581
|
}
|
|
306557
306582
|
|
|
306583
|
+
// src/runtime/webui/WebUiNavigationRows.ts
|
|
306584
|
+
function projectPathKey(path10) {
|
|
306585
|
+
return /^(?:[A-Za-z]:|\\\\)/.test(path10) ? path10.replace(/\\/g, "/").toLowerCase() : path10;
|
|
306586
|
+
}
|
|
306587
|
+
function projectFolderHints(projects) {
|
|
306588
|
+
const hints = /* @__PURE__ */ new Map();
|
|
306589
|
+
const parents = projects.map(({ path: path10 }) => {
|
|
306590
|
+
const windows = /^(?:[A-Za-z]:|\\\\)/.test(path10);
|
|
306591
|
+
const separator = windows && path10.includes("\\") ? "\\" : "/";
|
|
306592
|
+
const parts = (windows ? path10.replace(/\\/g, "/") : path10).split("/").filter(Boolean);
|
|
306593
|
+
return { parts: parts.slice(0, -1), separator };
|
|
306594
|
+
});
|
|
306595
|
+
for (const [index, project] of projects.entries()) {
|
|
306596
|
+
const others = parents.filter((_, i2) => i2 !== index && projects[i2].name === project.name);
|
|
306597
|
+
if (!others.length) continue;
|
|
306598
|
+
const { parts, separator } = parents[index];
|
|
306599
|
+
let count = 1;
|
|
306600
|
+
while (count < parts.length && others.some(
|
|
306601
|
+
(parent) => parent.parts.slice(-count).join("/") === parts.slice(-count).join("/")
|
|
306602
|
+
)) count++;
|
|
306603
|
+
hints.set(project.path, parts.slice(-count).join(separator) || separator);
|
|
306604
|
+
}
|
|
306605
|
+
return hints;
|
|
306606
|
+
}
|
|
306607
|
+
function createNavigationRows() {
|
|
306608
|
+
const signatures = /* @__PURE__ */ new WeakMap();
|
|
306609
|
+
return function reconcile(container, items, id, content, render) {
|
|
306610
|
+
const old = Array.from(container.children);
|
|
306611
|
+
const byId = new Map(old.map((row) => [row.dataset.navigationId, row]));
|
|
306612
|
+
const focused = container.contains(document.activeElement) ? document.activeElement : null;
|
|
306613
|
+
const focusedRow = focused?.closest("[data-navigation-id]");
|
|
306614
|
+
const action = focused?.dataset.sessionAction || focused?.dataset.projectAction;
|
|
306615
|
+
for (const [index, item] of items.entries()) {
|
|
306616
|
+
const key = id(item);
|
|
306617
|
+
const signature = JSON.stringify(content(item));
|
|
306618
|
+
let row = byId.get(key);
|
|
306619
|
+
if (!row || signatures.get(row) !== signature) {
|
|
306620
|
+
const updated = render(item);
|
|
306621
|
+
updated.dataset.navigationId = key;
|
|
306622
|
+
signatures.set(updated, signature);
|
|
306623
|
+
row?.replaceWith(updated);
|
|
306624
|
+
row = updated;
|
|
306625
|
+
}
|
|
306626
|
+
if (container.children[index] !== row)
|
|
306627
|
+
container.insertBefore(row, container.children[index] ?? null);
|
|
306628
|
+
byId.delete(key);
|
|
306629
|
+
}
|
|
306630
|
+
for (const row of byId.values()) row.remove();
|
|
306631
|
+
if (!focusedRow || !focused || document.activeElement === focused) return;
|
|
306632
|
+
const rows = Array.from(container.children);
|
|
306633
|
+
const target = rows.find((row) => row.dataset.navigationId === focusedRow.dataset.navigationId) ?? rows[Math.min(old.indexOf(focusedRow), rows.length - 1)];
|
|
306634
|
+
const buttons = target?.querySelectorAll("button:not(:disabled)");
|
|
306635
|
+
const equivalent = Array.from(buttons ?? []).find(
|
|
306636
|
+
(button) => (button.dataset.sessionAction || button.dataset.projectAction) === action
|
|
306637
|
+
);
|
|
306638
|
+
(equivalent ?? buttons?.[0])?.focus({ preventScroll: true });
|
|
306639
|
+
};
|
|
306640
|
+
}
|
|
306641
|
+
function bindWorkspaceLocation(location) {
|
|
306642
|
+
const closeOutside = (event) => {
|
|
306643
|
+
if (location.open && event.target instanceof Node && !location.contains(event.target)) {
|
|
306644
|
+
location.open = false;
|
|
306645
|
+
}
|
|
306646
|
+
};
|
|
306647
|
+
document.addEventListener("pointerdown", closeOutside);
|
|
306648
|
+
document.addEventListener("focusin", closeOutside);
|
|
306649
|
+
location.addEventListener("keydown", (event) => {
|
|
306650
|
+
if (event.key !== "Escape" || event.isComposing || event.keyCode === 229 || !location.open)
|
|
306651
|
+
return;
|
|
306652
|
+
event.preventDefault();
|
|
306653
|
+
location.open = false;
|
|
306654
|
+
location.querySelector("summary")?.focus();
|
|
306655
|
+
});
|
|
306656
|
+
}
|
|
306657
|
+
|
|
306658
|
+
// src/runtime/webui/WebUiClientDrafts.ts
|
|
306659
|
+
function createConversationDrafts(storage) {
|
|
306660
|
+
const legacy = "orbit.webui.draft";
|
|
306661
|
+
const fallback = /* @__PURE__ */ new Map();
|
|
306662
|
+
let active = null;
|
|
306663
|
+
function key(workspace, session) {
|
|
306664
|
+
return legacy + "." + JSON.stringify([workspace, session]);
|
|
306665
|
+
}
|
|
306666
|
+
function read(scope) {
|
|
306667
|
+
if (fallback.has(scope)) return fallback.get(scope);
|
|
306668
|
+
try {
|
|
306669
|
+
return storage().getItem(scope) || "";
|
|
306670
|
+
} catch {
|
|
306671
|
+
return "";
|
|
306672
|
+
}
|
|
306673
|
+
}
|
|
306674
|
+
function write(scope, value) {
|
|
306675
|
+
try {
|
|
306676
|
+
if (value) storage().setItem(scope, value);
|
|
306677
|
+
else storage().removeItem(scope);
|
|
306678
|
+
fallback.delete(scope);
|
|
306679
|
+
} catch {
|
|
306680
|
+
fallback.set(scope, value);
|
|
306681
|
+
}
|
|
306682
|
+
}
|
|
306683
|
+
return {
|
|
306684
|
+
get active() {
|
|
306685
|
+
return active;
|
|
306686
|
+
},
|
|
306687
|
+
key,
|
|
306688
|
+
read,
|
|
306689
|
+
write,
|
|
306690
|
+
save(value) {
|
|
306691
|
+
if (active !== null) write(active, value);
|
|
306692
|
+
},
|
|
306693
|
+
recover(scope, original, currentInput) {
|
|
306694
|
+
const current = active === scope ? currentInput : read(scope);
|
|
306695
|
+
const recovered = current && current !== original ? original + "\n\n" + current : original;
|
|
306696
|
+
write(scope, recovered);
|
|
306697
|
+
return active === scope ? recovered : void 0;
|
|
306698
|
+
},
|
|
306699
|
+
activate(workspace, session, input) {
|
|
306700
|
+
const next = key(workspace, session);
|
|
306701
|
+
if (active === next) return;
|
|
306702
|
+
const first = active === null;
|
|
306703
|
+
active = next;
|
|
306704
|
+
const saved = read(next);
|
|
306705
|
+
const old = first ? read(legacy) : "";
|
|
306706
|
+
const value = first ? [...new Set([saved, old, input].filter(Boolean))].join("\n\n") : saved;
|
|
306707
|
+
if (first && (input || old)) {
|
|
306708
|
+
write(next, value);
|
|
306709
|
+
if (!fallback.has(next)) write(legacy, "");
|
|
306710
|
+
}
|
|
306711
|
+
return value;
|
|
306712
|
+
}
|
|
306713
|
+
};
|
|
306714
|
+
}
|
|
306715
|
+
var WEB_UI_CLIENT_DRAFTS_SCRIPT = String.raw` const drafts = (${createConversationDrafts.toString()})(() => localStorage);
|
|
306716
|
+
let draftRevision = 0;
|
|
306717
|
+
function activateComposerDraft(workspace, session) {
|
|
306718
|
+
const previousScope = drafts.active;
|
|
306719
|
+
const value = drafts.activate(workspace, session, elements.prompt.value);
|
|
306720
|
+
if (value !== undefined) {
|
|
306721
|
+
elements.prompt.dataset.orbitDraftTarget = String(++draftRevision);
|
|
306722
|
+
switchAttachmentDraft(previousScope, drafts.active);
|
|
306723
|
+
elements.prompt.value = value;
|
|
306724
|
+
autoSizePrompt();
|
|
306725
|
+
updateSendButtonState();
|
|
306726
|
+
closeSlashCommands();
|
|
306727
|
+
if (value && previousScope === null) showToast(copy.draftRestored);
|
|
306728
|
+
}
|
|
306729
|
+
}
|
|
306730
|
+
`;
|
|
306731
|
+
|
|
306558
306732
|
// src/runtime/webui/WebUiClientBindings.ts
|
|
306559
306733
|
var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListener('submit', (event) => {
|
|
306560
306734
|
event.preventDefault();
|
|
@@ -306586,7 +306760,7 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
|
|
|
306586
306760
|
|
|
306587
306761
|
elements.prompt.addEventListener('input', () => {
|
|
306588
306762
|
autoSizePrompt();
|
|
306589
|
-
|
|
306763
|
+
drafts.save(elements.prompt.value);
|
|
306590
306764
|
updateSendButtonState();
|
|
306591
306765
|
slashCommandSelection = 0;
|
|
306592
306766
|
renderSlashCommands();
|
|
@@ -307286,6 +307460,9 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
|
|
|
307286
307460
|
const expanded = elements.archiveToggle.getAttribute('aria-expanded') === 'true';
|
|
307287
307461
|
elements.archiveToggle.setAttribute('aria-expanded', expanded ? 'false' : 'true');
|
|
307288
307462
|
elements.archivedPanel.hidden = expanded;
|
|
307463
|
+
if (expanded && !elements.archivedSessions.childElementCount) {
|
|
307464
|
+
elements.archiveToggle.hidden = true; elements.projectToggle.focus();
|
|
307465
|
+
}
|
|
307289
307466
|
});
|
|
307290
307467
|
elements.sessionDeleteBackdrop.addEventListener('click', () => closeSessionDeleteDialog());
|
|
307291
307468
|
elements.sessionDeleteCancel.addEventListener('click', () => closeSessionDeleteDialog());
|
|
@@ -307750,8 +307927,12 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
|
|
|
307750
307927
|
closeCommandPalette();
|
|
307751
307928
|
return;
|
|
307752
307929
|
}
|
|
307753
|
-
setInspector(false);
|
|
307754
|
-
closeSidebar();
|
|
307930
|
+
if (elements.inspector.classList.contains('is-open')) setInspector(false);
|
|
307931
|
+
else if (elements.appShell.classList.contains('sidebar-open')) closeSidebar();
|
|
307932
|
+
else if (!byId('workbench').hidden) {
|
|
307933
|
+
event.preventDefault();
|
|
307934
|
+
setWorkbench(null, byId('workbench').contains(document.activeElement));
|
|
307935
|
+
}
|
|
307755
307936
|
}
|
|
307756
307937
|
if ((event.ctrlKey || event.metaKey && event.key.toLowerCase() === 'k') && ['k', 'p'].includes(event.key.toLowerCase())) {
|
|
307757
307938
|
event.preventDefault();
|
|
@@ -307796,17 +307977,10 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
|
|
|
307796
307977
|
);
|
|
307797
307978
|
setProjectExpanded(readLocalStorage('orbit.webui.project', 'expanded') !== 'collapsed');
|
|
307798
307979
|
syncSidebarInteractivity();
|
|
307799
|
-
const draft = readLocalStorage('orbit.webui.draft', '');
|
|
307800
|
-
if (draft) {
|
|
307801
|
-
elements.prompt.value = draft;
|
|
307802
|
-
autoSizePrompt();
|
|
307803
|
-
updateSendButtonState();
|
|
307804
|
-
}
|
|
307805
307980
|
try {
|
|
307806
307981
|
await bootstrapSession();
|
|
307807
307982
|
await Promise.all([renderMessages({ forceBottom: true }), loadStatus(), loadSlashCommands()]);
|
|
307808
307983
|
connectEvents();
|
|
307809
|
-
if (draft) showToast(copy.draftRestored);
|
|
307810
307984
|
// Do not steal focus from an interaction that started while the initial
|
|
307811
307985
|
// bootstrap was still settling (for example, editing a queued prompt).
|
|
307812
307986
|
// The composer is the default target only while the document remains
|
|
@@ -308548,13 +308722,13 @@ function createApprovalController(runtime) {
|
|
|
308548
308722
|
}
|
|
308549
308723
|
}
|
|
308550
308724
|
elements.approvalPreview.hidden = !preview;
|
|
308551
|
-
elements.denyApprovalButton.disabled = !state.ready || Boolean(state.approvalSubmitting);
|
|
308552
|
-
elements.approveApprovalButton.disabled = !state.ready || Boolean(state.approvalSubmitting);
|
|
308725
|
+
elements.denyApprovalButton.disabled = !state.ready || Boolean(state.sessionChanging || state.approvalSubmitting);
|
|
308726
|
+
elements.approveApprovalButton.disabled = !state.ready || Boolean(state.sessionChanging || state.approvalSubmitting);
|
|
308553
308727
|
if (newRequest) revealApproval();
|
|
308554
308728
|
}
|
|
308555
308729
|
async function respondToApproval(approved) {
|
|
308556
308730
|
const approval = state.pendingApproval;
|
|
308557
|
-
if (!approval || !state.ready || state.approvalSubmitting) return;
|
|
308731
|
+
if (!approval || !state.ready || state.sessionChanging || state.approvalSubmitting) return;
|
|
308558
308732
|
state.approvalSubmitting = approval.id;
|
|
308559
308733
|
renderPendingApproval(approval);
|
|
308560
308734
|
try {
|
|
@@ -308592,7 +308766,8 @@ var WEB_UI_CLIENT_APPROVAL_SCRIPT = ` const { renderPendingApproval, respondToA
|
|
|
308592
308766
|
elements.approvalDiffButton.hidden = !hasDiff;
|
|
308593
308767
|
byId('approvalDiffDetail').hidden = !hasDiff;
|
|
308594
308768
|
byId('approvalDiffTitle').textContent = hasDiff ? approval.title : '';
|
|
308595
|
-
|
|
308769
|
+
const label = isChange ? copy.fileReview : copy.approvalRequired;
|
|
308770
|
+
if (elements.approvalEyebrow.textContent !== label) elements.approvalEyebrow.textContent = label;
|
|
308596
308771
|
elements.jumpApproval.hidden = !approval;
|
|
308597
308772
|
} });
|
|
308598
308773
|
|
|
@@ -308601,6 +308776,33 @@ var WEB_UI_CLIENT_APPROVAL_SCRIPT = ` const { renderPendingApproval, respondToA
|
|
|
308601
308776
|
// src/runtime/webui/WebUiClientAttachments.ts
|
|
308602
308777
|
function createAttachmentController(runtime) {
|
|
308603
308778
|
const { copy, elements, state, api, showToast, updateSendButtonState } = runtime;
|
|
308779
|
+
const inactive = /* @__PURE__ */ new Map();
|
|
308780
|
+
const uploads = /* @__PURE__ */ new WeakMap();
|
|
308781
|
+
const discarded = /* @__PURE__ */ new WeakSet();
|
|
308782
|
+
function switchAttachmentDraft(previous, next) {
|
|
308783
|
+
if (previous === null) return;
|
|
308784
|
+
if (state.attachments.length || uploads.get(state.attachments)) {
|
|
308785
|
+
inactive.set(previous, state.attachments);
|
|
308786
|
+
}
|
|
308787
|
+
state.attachments = inactive.get(next) ?? [];
|
|
308788
|
+
inactive.delete(next);
|
|
308789
|
+
renderAttachments();
|
|
308790
|
+
}
|
|
308791
|
+
function releaseUpload(id) {
|
|
308792
|
+
void api(`/api/attachment?id=${encodeURIComponent(id)}`, { method: "DELETE" }).catch(() => {
|
|
308793
|
+
});
|
|
308794
|
+
}
|
|
308795
|
+
function discardAttachmentDraft(key) {
|
|
308796
|
+
const group = inactive.get(key);
|
|
308797
|
+
if (!group) return;
|
|
308798
|
+
inactive.delete(key);
|
|
308799
|
+
discarded.add(group);
|
|
308800
|
+
for (const attachment of group) {
|
|
308801
|
+
URL.revokeObjectURL(attachment.previewUrl);
|
|
308802
|
+
releaseUpload(attachment.id);
|
|
308803
|
+
}
|
|
308804
|
+
group.length = 0;
|
|
308805
|
+
}
|
|
308604
308806
|
function renderAttachments() {
|
|
308605
308807
|
elements.attachmentList.replaceChildren();
|
|
308606
308808
|
elements.attachmentShelf.hidden = state.attachments.length === 0;
|
|
@@ -308634,18 +308836,20 @@ function createAttachmentController(runtime) {
|
|
|
308634
308836
|
}
|
|
308635
308837
|
updateSendButtonState();
|
|
308636
308838
|
}
|
|
308637
|
-
async function uploadAttachment(file) {
|
|
308839
|
+
async function uploadAttachment(file, group = state.attachments) {
|
|
308840
|
+
if (discarded.has(group)) return;
|
|
308638
308841
|
if (!file || !["image/png", "image/jpeg", "image/gif", "image/webp"].includes(
|
|
308639
308842
|
file.type
|
|
308640
308843
|
)) {
|
|
308641
308844
|
showToast(copy.attachmentLimit, "warning");
|
|
308642
308845
|
return;
|
|
308643
308846
|
}
|
|
308644
|
-
if (file.size <= 0 || file.size > 5 * 1024 * 1024 ||
|
|
308847
|
+
if (file.size <= 0 || file.size > 5 * 1024 * 1024 || group.length + (uploads.get(group) ?? 0) >= 4) {
|
|
308645
308848
|
showToast(copy.attachmentLimit, "warning");
|
|
308646
308849
|
return;
|
|
308647
308850
|
}
|
|
308648
|
-
|
|
308851
|
+
uploads.set(group, (uploads.get(group) ?? 0) + 1);
|
|
308852
|
+
if (group === state.attachments) elements.attachmentButton.disabled = true;
|
|
308649
308853
|
try {
|
|
308650
308854
|
const result = await api(
|
|
308651
308855
|
`/api/attachment?name=${encodeURIComponent(file.name || "image")}`,
|
|
@@ -308656,39 +308860,48 @@ function createAttachmentController(runtime) {
|
|
|
308656
308860
|
}
|
|
308657
308861
|
);
|
|
308658
308862
|
const attachment = result.attachment || {};
|
|
308659
|
-
|
|
308863
|
+
if (discarded.has(group)) {
|
|
308864
|
+
if (attachment.id) releaseUpload(attachment.id);
|
|
308865
|
+
return;
|
|
308866
|
+
}
|
|
308867
|
+
group.push({
|
|
308660
308868
|
id: String(attachment.id || ""),
|
|
308661
308869
|
name: attachment.name || file.name || "image",
|
|
308662
308870
|
mediaType: attachment.mediaType || file.type,
|
|
308663
308871
|
size: Number(attachment.size || file.size),
|
|
308664
308872
|
previewUrl: URL.createObjectURL(file)
|
|
308665
308873
|
});
|
|
308666
|
-
|
|
308667
|
-
|
|
308874
|
+
if (group === state.attachments) {
|
|
308875
|
+
renderAttachments();
|
|
308876
|
+
showToast(copy.attachmentAdded, "success");
|
|
308877
|
+
}
|
|
308668
308878
|
} catch (error) {
|
|
308669
308879
|
showToast(
|
|
308670
308880
|
error instanceof Error ? error.message : String(error),
|
|
308671
308881
|
"error"
|
|
308672
308882
|
);
|
|
308673
308883
|
} finally {
|
|
308674
|
-
|
|
308884
|
+
uploads.set(group, (uploads.get(group) ?? 1) - 1);
|
|
308885
|
+
elements.attachmentButton.disabled = state.attachments.length + (uploads.get(state.attachments) ?? 0) >= 4;
|
|
308675
308886
|
elements.attachmentInput.value = "";
|
|
308676
308887
|
}
|
|
308677
308888
|
}
|
|
308678
308889
|
async function addAttachmentFiles(files) {
|
|
308890
|
+
const group = state.attachments;
|
|
308679
308891
|
for (const file of Array.from(files || []).slice(
|
|
308680
308892
|
0,
|
|
308681
|
-
4 -
|
|
308893
|
+
4 - group.length
|
|
308682
308894
|
)) {
|
|
308683
|
-
await uploadAttachment(file);
|
|
308895
|
+
await uploadAttachment(file, group);
|
|
308684
308896
|
}
|
|
308685
308897
|
}
|
|
308686
308898
|
async function removeAttachment(id, notify) {
|
|
308687
|
-
const
|
|
308899
|
+
const group = state.attachments;
|
|
308900
|
+
const index = group.findIndex(
|
|
308688
308901
|
(attachment2) => attachment2.id === id
|
|
308689
308902
|
);
|
|
308690
308903
|
if (index === -1) return;
|
|
308691
|
-
const attachment =
|
|
308904
|
+
const attachment = group[index];
|
|
308692
308905
|
const removeButton = elements.attachmentList.querySelector(
|
|
308693
308906
|
`[data-attachment-remove="${CSS.escape(id)}"]`
|
|
308694
308907
|
);
|
|
@@ -308697,13 +308910,13 @@ function createAttachmentController(runtime) {
|
|
|
308697
308910
|
await api(`/api/attachment?id=${encodeURIComponent(id)}`, {
|
|
308698
308911
|
method: "DELETE"
|
|
308699
308912
|
});
|
|
308700
|
-
const currentIndex =
|
|
308913
|
+
const currentIndex = group.findIndex(
|
|
308701
308914
|
(item) => item.id === id
|
|
308702
308915
|
);
|
|
308703
|
-
if (currentIndex !== -1)
|
|
308916
|
+
if (currentIndex !== -1) group.splice(currentIndex, 1);
|
|
308704
308917
|
if (attachment.previewUrl) URL.revokeObjectURL(attachment.previewUrl);
|
|
308705
308918
|
renderAttachments();
|
|
308706
|
-
if (notify) showToast(copy.attachmentRemoved);
|
|
308919
|
+
if (notify && group === state.attachments) showToast(copy.attachmentRemoved);
|
|
308707
308920
|
} catch (error) {
|
|
308708
308921
|
if (removeButton) removeButton.disabled = false;
|
|
308709
308922
|
showToast(
|
|
@@ -308712,19 +308925,18 @@ function createAttachmentController(runtime) {
|
|
|
308712
308925
|
);
|
|
308713
308926
|
}
|
|
308714
308927
|
}
|
|
308715
|
-
function consumeAttachments(ids2) {
|
|
308928
|
+
function consumeAttachments(ids2, group = state.attachments) {
|
|
308716
308929
|
const consumed = new Set(ids2 || []);
|
|
308717
|
-
for (const attachment of
|
|
308718
|
-
if (consumed.has(attachment.id)
|
|
308719
|
-
|
|
308720
|
-
|
|
308930
|
+
for (const attachment of group.slice()) {
|
|
308931
|
+
if (!consumed.has(attachment.id)) continue;
|
|
308932
|
+
URL.revokeObjectURL(attachment.previewUrl);
|
|
308933
|
+
group.splice(group.indexOf(attachment), 1);
|
|
308721
308934
|
}
|
|
308722
|
-
state.attachments = state.attachments.filter(
|
|
308723
|
-
(attachment) => !consumed.has(attachment.id)
|
|
308724
|
-
);
|
|
308725
308935
|
renderAttachments();
|
|
308726
308936
|
}
|
|
308727
308937
|
return {
|
|
308938
|
+
switchAttachmentDraft,
|
|
308939
|
+
discardAttachmentDraft,
|
|
308728
308940
|
renderAttachments,
|
|
308729
308941
|
uploadAttachment,
|
|
308730
308942
|
addAttachmentFiles,
|
|
@@ -308732,7 +308944,7 @@ function createAttachmentController(runtime) {
|
|
|
308732
308944
|
consumeAttachments
|
|
308733
308945
|
};
|
|
308734
308946
|
}
|
|
308735
|
-
var WEB_UI_CLIENT_ATTACHMENTS_SCRIPT = ` const { renderAttachments, uploadAttachment, addAttachmentFiles, removeAttachment, consumeAttachments } = (${createAttachmentController.toString()})({ copy, elements, state, api, showToast, updateSendButtonState });
|
|
308947
|
+
var WEB_UI_CLIENT_ATTACHMENTS_SCRIPT = ` const { switchAttachmentDraft, discardAttachmentDraft, renderAttachments, uploadAttachment, addAttachmentFiles, removeAttachment, consumeAttachments } = (${createAttachmentController.toString()})({ copy, elements, state, api, showToast, updateSendButtonState });
|
|
308736
308948
|
|
|
308737
308949
|
`;
|
|
308738
308950
|
|
|
@@ -309278,7 +309490,7 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309278
309490
|
collapseNavigation: '收起导航',
|
|
309279
309491
|
modeStrict: '严格',
|
|
309280
309492
|
modeNormal: '标准',
|
|
309281
|
-
modeAuto: '
|
|
309493
|
+
modeAuto: '完整访问',
|
|
309282
309494
|
modePlan: '规划',
|
|
309283
309495
|
permissionFullAccess: chinese('完整权限已开启:所有已启用工具操作均自动批准。', '完整權限已開啟:所有已啟用工具操作均自動批准。'),
|
|
309284
309496
|
permissionAutoLimited: chinese('全自动尚未完全生效,部分操作仍需确认。', '全自動尚未完全生效,部分操作仍需確認。'),
|
|
@@ -309517,7 +309729,7 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309517
309729
|
collapseNavigation: '收合導覽',
|
|
309518
309730
|
modeStrict: '嚴格',
|
|
309519
309731
|
modeNormal: '標準',
|
|
309520
|
-
modeAuto: '
|
|
309732
|
+
modeAuto: '完整取用',
|
|
309521
309733
|
modePlan: '規劃',
|
|
309522
309734
|
recentSession: '最近工作階段',
|
|
309523
309735
|
useWorkflow: '使用工作流程',
|
|
@@ -309832,6 +310044,7 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309832
310044
|
promptQueue: [],
|
|
309833
310045
|
queueEditingId: null,
|
|
309834
310046
|
queueSubmitting: false,
|
|
310047
|
+
sessionChanging: false,
|
|
309835
310048
|
queueEditDraft: '',
|
|
309836
310049
|
agentSteeringId: null,
|
|
309837
310050
|
agentSteeringDraft: '',
|
|
@@ -310101,6 +310314,10 @@ ${WEB_UI_CLIENT_TRANSPORT_SCRIPT}
|
|
|
310101
310314
|
updateMessageNavigation();
|
|
310102
310315
|
}
|
|
310103
310316
|
|
|
310317
|
+
const appleKeyboard = /Mac|iPhone|iPad/i.test(navigator.platform);
|
|
310318
|
+
function controlShortcut(key) { return (appleKeyboard ? '⌃ ' : 'Ctrl ') + key; }
|
|
310319
|
+
document.querySelectorAll('[data-control-key]').forEach(key => { key.textContent = controlShortcut(key.dataset.controlKey); });
|
|
310320
|
+
|
|
310104
310321
|
function setBusy(busy, label) {
|
|
310105
310322
|
state.busy = busy;
|
|
310106
310323
|
elements.appShell.classList.toggle('is-busy', busy);
|
|
@@ -310126,7 +310343,11 @@ ${WEB_UI_CLIENT_TRANSPORT_SCRIPT}
|
|
|
310126
310343
|
));
|
|
310127
310344
|
syncCustomModelAction();
|
|
310128
310345
|
elements.turnStatus.classList.toggle('is-working', busy);
|
|
310129
|
-
|
|
310346
|
+
const hint = byId('composerHint');
|
|
310347
|
+
const keys = busy ? hint.dataset.running.replace('{steer}', appleKeyboard ? '⌘↩' : 'Ctrl+Enter') : hint.dataset.idle;
|
|
310348
|
+
if (hint.textContent !== keys) hint.textContent = keys;
|
|
310349
|
+
const statusLabel = label || (busy ? copy.thinking : '');
|
|
310350
|
+
if (elements.turnStatus.textContent !== statusLabel) elements.turnStatus.textContent = statusLabel;
|
|
310130
310351
|
updateSendButtonState();
|
|
310131
310352
|
renderPromptQueue();
|
|
310132
310353
|
}
|
|
@@ -310141,18 +310362,20 @@ ${WEB_UI_CLIENT_TRANSPORT_SCRIPT}
|
|
|
310141
310362
|
}
|
|
310142
310363
|
|
|
310143
310364
|
function updateSendButtonState() {
|
|
310365
|
+
const ready = state.ready && !state.sessionChanging;
|
|
310366
|
+
elements.prompt.setAttribute('aria-busy', String(!ready));
|
|
310144
310367
|
const hasPrompt = Boolean(elements.prompt.value.trim());
|
|
310145
|
-
elements.contextPickerButton.disabled = state.busy || !
|
|
310146
|
-
elements.buildPlanButton.disabled = state.busy || !
|
|
310147
|
-
elements.parallelImproveButton.disabled = state.busy || !
|
|
310368
|
+
elements.contextPickerButton.disabled = state.busy || !ready;
|
|
310369
|
+
elements.buildPlanButton.disabled = state.busy || !ready;
|
|
310370
|
+
elements.parallelImproveButton.disabled = state.busy || !ready;
|
|
310148
310371
|
elements.queueButton.hidden = !state.busy;
|
|
310149
|
-
elements.queueButton.disabled = !
|
|
310372
|
+
elements.queueButton.disabled = !ready || !hasPrompt || state.stopping || state.queueSubmitting || state.promptQueue.length >= 12;
|
|
310150
310373
|
elements.steerButton.hidden = !state.busy || !hasPrompt;
|
|
310151
310374
|
elements.steerButton.disabled = elements.queueButton.disabled;
|
|
310152
|
-
elements.denyApprovalButton.disabled = elements.approveApprovalButton.disabled = !
|
|
310375
|
+
elements.denyApprovalButton.disabled = elements.approveApprovalButton.disabled = !ready || Boolean(state.approvalSubmitting);
|
|
310153
310376
|
elements.sendButton.disabled = state.busy
|
|
310154
|
-
? !
|
|
310155
|
-
: !
|
|
310377
|
+
? !ready || state.stopping
|
|
310378
|
+
: !ready || !hasPrompt;
|
|
310156
310379
|
}
|
|
310157
310380
|
|
|
310158
310381
|
function setEmptyState() {
|
|
@@ -311871,7 +312094,7 @@ var WEB_UI_CLIENT_PALETTE_SCRIPT = String.raw` const paletteMatches = ${palette
|
|
|
311871
312094
|
|
|
311872
312095
|
function setComposerValue(value) {
|
|
311873
312096
|
elements.prompt.value = value;
|
|
311874
|
-
|
|
312097
|
+
drafts.save(value);
|
|
311875
312098
|
autoSizePrompt();
|
|
311876
312099
|
updateSendButtonState();
|
|
311877
312100
|
focusMessageComposer();
|
|
@@ -311880,12 +312103,12 @@ var WEB_UI_CLIENT_PALETTE_SCRIPT = String.raw` const paletteMatches = ${palette
|
|
|
311880
312103
|
|
|
311881
312104
|
function buildPaletteActions() {
|
|
311882
312105
|
const actions = [
|
|
311883
|
-
{ icon: '+', label: language !== 'en' ? chinese('新建任务', '新增任務') : 'New task', detail: '
|
|
312106
|
+
{ icon: '+', label: language !== 'en' ? chinese('新建任务', '新增任務') : 'New task', detail: controlShortcut('N'), keywords: 'new session task', idle: true, run: () => updateSession({ action: 'new' }) },
|
|
311884
312107
|
{ 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
312108
|
{ icon: '›', label: copy.focusComposer, detail: language !== 'en' ? chinese('发送消息', '傳送訊息') : 'Message Orbit', keywords: 'focus prompt message composer', run: focusMessageComposer },
|
|
311886
312109
|
{ 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: '
|
|
311888
|
-
{ icon: '◧', label: language !== 'en' ? chinese('切换导航栏', '切換導覽列') : 'Toggle navigation', detail: '
|
|
312110
|
+
{ icon: '⚙', label: copy.openSettings, detail: controlShortcut(','), keywords: 'settings preferences configuration', run: () => setInspector(true, 'settings') },
|
|
312111
|
+
{ icon: '◧', label: language !== 'en' ? chinese('切换导航栏', '切換導覽列') : 'Toggle navigation', detail: controlShortcut('B'), keywords: 'toggle sidebar navigation focus', run: toggleNavigation },
|
|
311889
312112
|
{ icon: '+', label: language !== 'en' ? chinese('添加文件上下文', '加入檔案上下文') : 'Add file context', detail: language !== 'en' ? chinese('搜索工作区文件', '搜尋工作區檔案') : 'Search workspace files', keywords: 'add context file', idle: true, run: openContextPicker },
|
|
311890
312113
|
];
|
|
311891
312114
|
for (const preset of elements.reviewPresets.querySelectorAll('[data-review-preset]')) {
|
|
@@ -312070,13 +312293,19 @@ function selectMenuLayout(input) {
|
|
|
312070
312293
|
}
|
|
312071
312294
|
|
|
312072
312295
|
// src/runtime/webui/WebUiClientSelect.ts
|
|
312296
|
+
function syncSelectedValue(select2, trigger, value) {
|
|
312297
|
+
const option = select2.selectedOptions[0] ?? select2.options[0];
|
|
312298
|
+
const label = option?.dataset.displayLabel || option?.textContent || "\u2014";
|
|
312299
|
+
if (value.textContent !== label) value.textContent = label;
|
|
312300
|
+
value.title = select2.id === "permissionSelect" ? label : option?.textContent || "";
|
|
312301
|
+
value.id = select2.id + "SelectedValue";
|
|
312302
|
+
trigger.setAttribute("aria-describedby", value.id);
|
|
312303
|
+
}
|
|
312073
312304
|
var WEB_UI_CLIENT_SELECT_SCRIPT = String.raw` const selectControls = new Map();
|
|
312074
312305
|
const fitSelectMenu = ${selectMenuLayout.toString()};
|
|
312075
312306
|
let selectScrollSettleTimer = 0;
|
|
312076
312307
|
|
|
312077
|
-
|
|
312078
|
-
return [...select.options].find((option) => option.value === select.value) || select.options[0];
|
|
312079
|
-
}
|
|
312308
|
+
const syncSelectedValue = ${syncSelectedValue.toString()};
|
|
312080
312309
|
|
|
312081
312310
|
function positionSelectMenu(entry) {
|
|
312082
312311
|
const rect = entry.trigger.getBoundingClientRect();
|
|
@@ -312155,9 +312384,7 @@ var WEB_UI_CLIENT_SELECT_SCRIPT = String.raw` const selectControls = new Map();
|
|
|
312155
312384
|
function syncSelectControl(select) {
|
|
312156
312385
|
const entry = selectControls.get(select);
|
|
312157
312386
|
if (!entry) return;
|
|
312158
|
-
|
|
312159
|
-
entry.value.textContent = active ? active.dataset.displayLabel || active.textContent : '—';
|
|
312160
|
-
entry.value.title = active ? active.textContent : '';
|
|
312387
|
+
syncSelectedValue(select, entry.trigger, entry.value);
|
|
312161
312388
|
entry.trigger.disabled = select.disabled;
|
|
312162
312389
|
if (select.disabled) closeSelectControl(entry, false);
|
|
312163
312390
|
const optionsKey = JSON.stringify([...select.options].map((option) => [option.value, option.textContent, option.disabled]));
|
|
@@ -312325,6 +312552,35 @@ var WEB_UI_CLIENT_SELECT_SCRIPT = String.raw` const selectControls = new Map();
|
|
|
312325
312552
|
|
|
312326
312553
|
`;
|
|
312327
312554
|
|
|
312555
|
+
// src/runtime/webui/WebUiIcon.ts
|
|
312556
|
+
function renderUiIcon(name) {
|
|
312557
|
+
const paths = {
|
|
312558
|
+
add: '<path d="M12 5v14M5 12h14" />',
|
|
312559
|
+
tasks: '<rect x="5" y="4.5" width="14" height="15" rx="2" /><path d="m8 9 1.5 1.5L12 8M13.5 10h2.5M8 14h8M8 17h5" />',
|
|
312560
|
+
diagnostics: '<path d="M4.5 12h3l1.7-4 3.1 8 1.7-4h5.5" /><path d="M6 5.5h12v13H6z" />',
|
|
312561
|
+
changes: '<path d="M5 7h14M5 12h14M5 17h14" /><path d="M8 5v4M15 10v4M11 15v4" />',
|
|
312562
|
+
context: '<path d="M7 4.5h7l3 3v12H7z" /><path d="M14 4.5v3h3M9.5 12h5M12 9.5v5" />',
|
|
312563
|
+
image: '<rect x="4.5" y="5" width="15" height="14" rx="2" /><circle cx="9" cy="9.5" r="1.5" /><path d="m6.5 17 4-4 2.5 2 2.5-3 2.5 5" />',
|
|
312564
|
+
commands: '<rect x="4.5" y="5.5" width="15" height="13" rx="2" /><path d="m8 10 2 2-2 2M12.5 14h3.5" />',
|
|
312565
|
+
menu: '<path d="M5 7h14M5 12h14M5 17h14" />',
|
|
312566
|
+
panel: '<rect x="4.5" y="5" width="15" height="14" rx="2" /><path d="M14 5v14" />',
|
|
312567
|
+
close: '<path d="m7 7 10 10M17 7 7 17" />',
|
|
312568
|
+
back: '<path d="m10 6-6 6 6 6M4 12h16" />',
|
|
312569
|
+
up: '<path d="m7 14 5-5 5 5" />',
|
|
312570
|
+
down: '<path d="m7 10 5 5 5-5" />',
|
|
312571
|
+
archive: '<path d="M5.5 8.5h13v10h-13zM4.5 5h15v3.5h-15zM9.5 12h5" />',
|
|
312572
|
+
restore: '<path d="M8 8H4V4M4.5 8a8 8 0 1 1-.2 7" />',
|
|
312573
|
+
delete: '<path d="M8 7v11M12 7v11M16 7v11M5 5h14M9 5V3h6v2M6.5 5l1 16h9l1-16" />',
|
|
312574
|
+
search: '<circle cx="10.5" cy="10.5" r="5.5" /><path d="m14.7 14.7 4.3 4.3" />',
|
|
312575
|
+
folder: '<path d="M3.5 7V6a1 1 0 0 1 1-1H10l2 2h7.5a1 1 0 0 1 1 1v9a1.5 1.5 0 0 1-1.5 1.5H5A1.5 1.5 0 0 1 3.5 17V7z" />',
|
|
312576
|
+
review: '<circle cx="10.5" cy="10.5" r="5.5" /><path d="m14.7 14.7 4.3 4.3M10.5 8v5M8 10.5h5" />',
|
|
312577
|
+
fix: '<path d="M14.5 5.5a4 4 0 0 0-4.8 5.2L5 15.4 8.6 19l4.7-4.7a4 4 0 0 0 5.2-4.8l-2.7 2.7-3-3z" />',
|
|
312578
|
+
explain: '<path d="m9 7-5 5 5 5M15 7l5 5-5 5M13 5l-2 14" />',
|
|
312579
|
+
improve: '<path d="M12 4l1.2 4.1L17 10l-3.8 1.9L12 16l-1.2-4.1L7 10l3.8-1.9zM18 16v4M16 18h4M5 4v3M3.5 5.5h3" />'
|
|
312580
|
+
};
|
|
312581
|
+
return `<svg class="ui-icon" viewBox="0 0 24 24" fill="none" aria-hidden="true" focusable="false">${paths[name]}</svg>`;
|
|
312582
|
+
}
|
|
312583
|
+
|
|
312328
312584
|
// src/runtime/webui/WebUiClientReview.ts
|
|
312329
312585
|
function verificationSummary(checks, t2) {
|
|
312330
312586
|
const failures = checks.filter((check) => check.success === false).length;
|
|
@@ -312472,14 +312728,14 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312472
312728
|
}
|
|
312473
312729
|
const compactAt = Number(context.compactAtTokens || 0);
|
|
312474
312730
|
const estimated = Number(context.estimatedHistoryTokens || 0);
|
|
312475
|
-
const
|
|
312731
|
+
const meterLimit = compactAt || Number(context.maxContextTokens || 0);
|
|
312732
|
+
const usagePercent = meterLimit > 0 ? Math.max(0, (estimated / meterLimit) * 100) : 0;
|
|
312476
312733
|
const ringPercent = Math.min(100, usagePercent);
|
|
312477
312734
|
elements.contextMeter.style.setProperty('--context-pct', ringPercent + '%');
|
|
312478
|
-
elements.contextPercent.textContent = Math.round(usagePercent) + '%';
|
|
312735
|
+
elements.contextPercent.textContent = meterLimit ? Math.round(usagePercent) + '%' : '—';
|
|
312479
312736
|
elements.contextMeter.classList.toggle('is-warm', usagePercent >= 72 && usagePercent < 90);
|
|
312480
312737
|
elements.contextMeter.classList.toggle('is-hot', usagePercent >= 90);
|
|
312481
|
-
const
|
|
312482
|
-
const meterDetail = estimated.toLocaleString() + ' / ' + meterLimit.toLocaleString() + ' tokens';
|
|
312738
|
+
const meterDetail = meterLimit ? estimated.toLocaleString() + ' / ' + meterLimit.toLocaleString() + ' tokens' : stageCopy('Limit unavailable', '暂无上限数据', '暫無上限資料');
|
|
312483
312739
|
elements.contextMeter.title = meterDetail;
|
|
312484
312740
|
elements.contextMeter.setAttribute('aria-label', copy.contextWindow + ': ' + meterDetail);
|
|
312485
312741
|
renderWorkspaceState(data);
|
|
@@ -312756,23 +313012,6 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312756
313012
|
return language !== 'en' ? days + ' 天' : days + 'd';
|
|
312757
313013
|
}
|
|
312758
313014
|
|
|
312759
|
-
function appendSessionActionIcon(button, action) {
|
|
312760
|
-
const namespace = 'http://www.w3.org/2000/svg';
|
|
312761
|
-
const svg = document.createElementNS(namespace, 'svg');
|
|
312762
|
-
svg.setAttribute('class', 'ui-icon');
|
|
312763
|
-
svg.setAttribute('viewBox', '0 0 24 24');
|
|
312764
|
-
svg.setAttribute('fill', 'none');
|
|
312765
|
-
svg.setAttribute('aria-hidden', 'true');
|
|
312766
|
-
const path = document.createElementNS(namespace, 'path');
|
|
312767
|
-
path.setAttribute('d', {
|
|
312768
|
-
archive: 'M5.5 8.5h13v10h-13zM4.5 5h15v3.5h-15zM9.5 12h5',
|
|
312769
|
-
restore: 'M8 8H4V4M4.5 8a8 8 0 1 1-.2 7',
|
|
312770
|
-
delete: 'M8 7v11M12 7v11M16 7v11M5 5h14M9 5V3h6v2M6.5 5l1 16h9l1-16',
|
|
312771
|
-
}[action] || 'M6 12h12');
|
|
312772
|
-
svg.append(path);
|
|
312773
|
-
button.append(svg);
|
|
312774
|
-
}
|
|
312775
|
-
|
|
312776
313015
|
function renderSessionNavigation(sessionData) {
|
|
312777
313016
|
state.sessionData = sessionData || {};
|
|
312778
313017
|
const sessions = Array.isArray(sessionData && sessionData.recent)
|
|
@@ -312792,9 +313031,10 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312792
313031
|
.some((value) => String(value).toLocaleLowerCase().includes(query)))
|
|
312793
313032
|
: sessions;
|
|
312794
313033
|
const visibleSessions = matchingSessions.slice(0, state.sessionLimit);
|
|
312795
|
-
const renderList = (container, items, archived) =>
|
|
312796
|
-
container.
|
|
312797
|
-
|
|
313034
|
+
const renderList = (container, items, archived) => reconcileNavigation(
|
|
313035
|
+
container, items, session => session.id,
|
|
313036
|
+
session => [session.title, session.model, Boolean(session.active), relativeSessionTime(session.updatedAt)],
|
|
313037
|
+
session => {
|
|
312798
313038
|
const isActive = Boolean(session.active);
|
|
312799
313039
|
const row = document.createElement('div');
|
|
312800
313040
|
row.className = 'session-row'
|
|
@@ -312812,7 +313052,9 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312812
313052
|
button.title = title.textContent;
|
|
312813
313053
|
const meta = document.createElement('span');
|
|
312814
313054
|
meta.className = 'recent-session-meta';
|
|
312815
|
-
meta.textContent =
|
|
313055
|
+
meta.textContent = relativeSessionTime(session.updatedAt);
|
|
313056
|
+
meta.title = [meta.textContent, session.model].filter(Boolean).join(' · ');
|
|
313057
|
+
button.setAttribute('aria-description', [meta.textContent, session.model].filter(Boolean).join(' · '));
|
|
312816
313058
|
button.append(title, meta);
|
|
312817
313059
|
row.append(button);
|
|
312818
313060
|
if (!isActive) {
|
|
@@ -312823,7 +313065,7 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312823
313065
|
secondaryAction.className = 'session-action';
|
|
312824
313066
|
secondaryAction.dataset.sessionAction = archived ? 'restore' : 'archive';
|
|
312825
313067
|
secondaryAction.dataset.sessionId = session.id;
|
|
312826
|
-
|
|
313068
|
+
secondaryAction.innerHTML = archived ? '${renderUiIcon("restore")}' : '${renderUiIcon("archive")}';
|
|
312827
313069
|
secondaryAction.title = archived ? copy.restoreSession : copy.archiveSession;
|
|
312828
313070
|
secondaryAction.setAttribute('aria-label', secondaryAction.title);
|
|
312829
313071
|
const deleteAction = document.createElement('button');
|
|
@@ -312831,15 +313073,15 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312831
313073
|
deleteAction.className = 'session-action is-danger';
|
|
312832
313074
|
deleteAction.dataset.sessionAction = 'delete';
|
|
312833
313075
|
deleteAction.dataset.sessionId = session.id;
|
|
312834
|
-
|
|
313076
|
+
deleteAction.innerHTML = '${renderUiIcon("delete")}';
|
|
312835
313077
|
deleteAction.title = copy.deleteSession;
|
|
312836
313078
|
deleteAction.setAttribute('aria-label', copy.deleteSession);
|
|
312837
313079
|
actions.append(secondaryAction, deleteAction);
|
|
312838
313080
|
row.append(actions);
|
|
312839
313081
|
}
|
|
312840
|
-
|
|
313082
|
+
return row;
|
|
312841
313083
|
}
|
|
312842
|
-
|
|
313084
|
+
);
|
|
312843
313085
|
renderList(elements.recentSessions, visibleSessions, false);
|
|
312844
313086
|
renderList(elements.archivedSessions, archivedSessions, true);
|
|
312845
313087
|
elements.sessionSearchField.hidden = sessions.length < 12;
|
|
@@ -312848,7 +313090,7 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312848
313090
|
elements.recentEmpty.hidden = matchingSessions.length > 0;
|
|
312849
313091
|
elements.archivedEmpty.hidden = elements.archivedSessions.childElementCount > 0;
|
|
312850
313092
|
elements.archiveCount.textContent = String(archivedSessions.length);
|
|
312851
|
-
elements.archiveToggle.
|
|
313093
|
+
elements.archiveToggle.hidden = archivedSessions.length === 0 && elements.archivedPanel.hidden;
|
|
312852
313094
|
const sessionCount = Number(sessionData && sessionData.count || sessions.length + archivedSessions.length);
|
|
312853
313095
|
elements.projectChatCount.textContent = String(sessionCount);
|
|
312854
313096
|
elements.projectChatCount.setAttribute('aria-label', String(sessionCount));
|
|
@@ -312856,13 +313098,16 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312856
313098
|
}
|
|
312857
313099
|
|
|
312858
313100
|
function renderProjectNavigation(projects, currentWorkspace) {
|
|
312859
|
-
|
|
312860
|
-
const normalizePath = (value) => String(value || '').replace(/\\/g, '/').toLowerCase();
|
|
312861
|
-
const current = normalizePath(currentWorkspace);
|
|
313101
|
+
const current = projectPathKey(currentWorkspace || '');
|
|
312862
313102
|
const recentProjects = (Array.isArray(projects) ? projects : [])
|
|
312863
|
-
.filter((item) => item.available === true &&
|
|
313103
|
+
.filter((item) => item.available === true && projectPathKey(item.path || '') !== current)
|
|
312864
313104
|
.slice(0, 6);
|
|
312865
|
-
|
|
313105
|
+
const hints = projectFolderHints([
|
|
313106
|
+
{ name: workspaceName(currentWorkspace), path: currentWorkspace || '' },
|
|
313107
|
+
...recentProjects.map(p => ({name: p.name || workspaceName(p.path), path: p.path})),
|
|
313108
|
+
]);
|
|
313109
|
+
reconcileNavigation(elements.projectList, recentProjects, project => project.id || project.path,
|
|
313110
|
+
project => [project.name, project.path, hints.get(project.path)], project => {
|
|
312866
313111
|
const row = document.createElement('div');
|
|
312867
313112
|
row.className = 'registered-project';
|
|
312868
313113
|
const button = document.createElement('button');
|
|
@@ -312872,14 +313117,18 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312872
313117
|
button.setAttribute('aria-label', (language !== 'en' ? chinese('打开项目:', '開啟專案:') : 'Open project: ') + (project.name || 'Orbit'));
|
|
312873
313118
|
const icon = document.createElement('span');
|
|
312874
313119
|
icon.className = 'registered-project-icon project-folder-icon';
|
|
312875
|
-
icon.innerHTML = '
|
|
313120
|
+
icon.innerHTML = '${renderUiIcon("folder")}';
|
|
312876
313121
|
const copyNode = document.createElement('span');
|
|
312877
313122
|
copyNode.className = 'project-copy';
|
|
312878
313123
|
const name = document.createElement('strong');
|
|
312879
|
-
name.textContent = project.name || workspaceName(project.path);
|
|
312880
|
-
|
|
312881
|
-
|
|
312882
|
-
|
|
313124
|
+
name.textContent = project.name || workspaceName(project.path);
|
|
313125
|
+
button.title = project.path || ''; button.setAttribute('aria-description', button.title);
|
|
313126
|
+
copyNode.append(name);
|
|
313127
|
+
if (hints.has(project.path)) {
|
|
313128
|
+
const path = document.createElement('small');
|
|
313129
|
+
path.textContent = hints.get(project.path);
|
|
313130
|
+
copyNode.append(path);
|
|
313131
|
+
}
|
|
312883
313132
|
button.append(icon, copyNode);
|
|
312884
313133
|
const remove = document.createElement('button');
|
|
312885
313134
|
remove.type = 'button';
|
|
@@ -312890,15 +313139,16 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312890
313139
|
remove.setAttribute('aria-label', copy.removeProject + ': ' + (project.name || 'Orbit'));
|
|
312891
313140
|
remove.textContent = '×';
|
|
312892
313141
|
row.append(button, remove);
|
|
312893
|
-
|
|
312894
|
-
}
|
|
313142
|
+
return row;
|
|
313143
|
+
});
|
|
312895
313144
|
elements.recentProjectsShell.hidden = elements.projectList.childElementCount === 0;
|
|
312896
313145
|
syncScrollAffordance(elements.projectList);
|
|
312897
313146
|
}
|
|
312898
313147
|
|
|
312899
313148
|
async function updateSession(action) {
|
|
312900
|
-
if (state.busy) return;
|
|
312901
|
-
state.
|
|
313149
|
+
if (!state.ready || state.busy || state.sessionChanging) return;
|
|
313150
|
+
state.sessionChanging = true;
|
|
313151
|
+
updateSendButtonState();
|
|
312902
313152
|
elements.newTaskButton.disabled = true;
|
|
312903
313153
|
elements.recentSessions.querySelectorAll('button').forEach((button) => { button.disabled = true; });
|
|
312904
313154
|
elements.archivedSessions.querySelectorAll('button').forEach((button) => { button.disabled = true; });
|
|
@@ -312908,14 +313158,20 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312908
313158
|
headers: { 'Content-Type': 'application/json' },
|
|
312909
313159
|
body: JSON.stringify(action),
|
|
312910
313160
|
});
|
|
313161
|
+
if (action.action === 'delete' && state.status) {
|
|
313162
|
+
const deleted = drafts.key(state.status.workspace || '', action.sessionId);
|
|
313163
|
+
drafts.write(deleted, '');
|
|
313164
|
+
discardAttachmentDraft(deleted);
|
|
313165
|
+
}
|
|
312911
313166
|
const navigates = action.action === 'new' || action.action === 'resume';
|
|
312912
313167
|
if (navigates) {
|
|
312913
313168
|
clearActivity();
|
|
312914
313169
|
state.controlTurns.clear();
|
|
312915
|
-
await Promise.all([
|
|
313170
|
+
const [, snapshot] = await Promise.all([
|
|
312916
313171
|
renderMessages({ forceBottom: true, resetHistory: true }),
|
|
312917
313172
|
loadStatus(),
|
|
312918
313173
|
]);
|
|
313174
|
+
if (!snapshot) connectEvents();
|
|
312919
313175
|
} else {
|
|
312920
313176
|
await loadStatus();
|
|
312921
313177
|
}
|
|
@@ -312933,8 +313189,10 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312933
313189
|
}
|
|
312934
313190
|
} catch (error) {
|
|
312935
313191
|
showToast(error.message || String(error), 'error');
|
|
313192
|
+
connectEvents();
|
|
312936
313193
|
} finally {
|
|
312937
|
-
state.
|
|
313194
|
+
state.sessionChanging = false;
|
|
313195
|
+
updateSendButtonState();
|
|
312938
313196
|
elements.newTaskButton.disabled = false;
|
|
312939
313197
|
elements.recentSessions.querySelectorAll('button').forEach((button) => { button.disabled = false; });
|
|
312940
313198
|
elements.archivedSessions.querySelectorAll('button').forEach((button) => { button.disabled = false; });
|
|
@@ -312945,6 +313203,7 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312945
313203
|
const epoch = state.statusEpoch, request = ++state.statusRequest;
|
|
312946
313204
|
const requestedTurn = state.activeTurnId, data = await api('/api/status');
|
|
312947
313205
|
if (epoch !== state.statusEpoch || request !== state.statusRequest) return;
|
|
313206
|
+
activateComposerDraft(data.workspace || '', data.session?.activeId || '');
|
|
312948
313207
|
state.status = data;
|
|
312949
313208
|
state.promptQueue = Array.isArray(data.inputQueue) ? data.inputQueue : [];
|
|
312950
313209
|
renderPromptQueue();
|
|
@@ -312966,12 +313225,11 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312966
313225
|
}
|
|
312967
313226
|
}
|
|
312968
313227
|
const name = workspaceName(data.workspace);
|
|
312969
|
-
byId('
|
|
312970
|
-
byId('
|
|
313228
|
+
byId('workspacePath').textContent = name;
|
|
313229
|
+
byId('workspaceFolder').textContent = data.workspace || '';
|
|
312971
313230
|
byId('sidebarWorkspace').textContent = name;
|
|
312972
313231
|
byId('sidebarWorkspace').title = data.workspace || '';
|
|
312973
|
-
|
|
312974
|
-
byId('sidebarSession').title = data.workspace || '';
|
|
313232
|
+
elements.projectToggle.title = data.workspace || '';
|
|
312975
313233
|
renderProjectNavigation(data.projects || [], data.workspace);
|
|
312976
313234
|
renderSessionNavigation(data.session || {});
|
|
312977
313235
|
elements.runtimeUpdated.textContent = formatTime(data.updatedAt);
|
|
@@ -313001,7 +313259,11 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313001
313259
|
button.classList.toggle('is-active', active);
|
|
313002
313260
|
button.setAttribute('aria-pressed', active ? 'true' : 'false');
|
|
313003
313261
|
});
|
|
313004
|
-
const
|
|
313262
|
+
const permissions = data.permissions || {};
|
|
313263
|
+
const mode = permissions.mode || 'normal';
|
|
313264
|
+
const auto = elements.permissionSelect.querySelector('option[value="auto"]');
|
|
313265
|
+
auto.dataset.displayLabel = mode === 'auto' && !permissions.fullAccess
|
|
313266
|
+
? stageCopy('Auto (limited)', '自动(受限)', '自動(受限)') : auto.textContent;
|
|
313005
313267
|
elements.permissionSelect.value = mode;
|
|
313006
313268
|
syncSelectControl(elements.permissionSelect);
|
|
313007
313269
|
elements.permissionSegments.querySelectorAll('[data-mode]').forEach((button) => {
|
|
@@ -313009,7 +313271,6 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313009
313271
|
button.classList.toggle('is-active', active);
|
|
313010
313272
|
button.setAttribute('aria-pressed', active ? 'true' : 'false');
|
|
313011
313273
|
});
|
|
313012
|
-
const permissions = data.permissions || {};
|
|
313013
313274
|
const modeSummary = mode === 'auto'
|
|
313014
313275
|
? (permissions.fullAccess ? copy.permissionFullAccess : copy.permissionAutoLimited)
|
|
313015
313276
|
: mode === 'strict'
|
|
@@ -313328,8 +313589,10 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313328
313589
|
|
|
313329
313590
|
async function queuePrompt(prompt, mode) {
|
|
313330
313591
|
const value = String(prompt || '').trim();
|
|
313331
|
-
if (!state.ready || state.stopping || state.queueSubmitting || !value || state.promptQueue.length >= 12) return;
|
|
313592
|
+
if (!state.ready || state.sessionChanging || state.stopping || state.queueSubmitting || !value || state.promptQueue.length >= 12) return;
|
|
313332
313593
|
const attachmentIds = state.attachments.map((attachment) => attachment.id);
|
|
313594
|
+
const scope = drafts.active;
|
|
313595
|
+
const attachments = state.attachments;
|
|
313333
313596
|
state.queueSubmitting = true;
|
|
313334
313597
|
if (document.activeElement === elements.queueButton || document.activeElement === elements.steerButton)
|
|
313335
313598
|
elements.prompt.focus();
|
|
@@ -313340,10 +313603,11 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313340
313603
|
headers: { 'Content-Type': 'application/json' },
|
|
313341
313604
|
body: JSON.stringify({ action: 'enqueue', prompt: value, mode: mode === 'steer' ? 'steer' : 'follow_up', attachmentIds }),
|
|
313342
313605
|
});
|
|
313343
|
-
consumeAttachments(attachmentIds);
|
|
313344
|
-
if (
|
|
313606
|
+
consumeAttachments(attachmentIds, attachments);
|
|
313607
|
+
if (drafts.active !== scope && scope && drafts.read(scope) === prompt) drafts.write(scope, '');
|
|
313608
|
+
if (drafts.active === scope && elements.prompt.value === prompt) {
|
|
313345
313609
|
elements.prompt.value = '';
|
|
313346
|
-
|
|
313610
|
+
drafts.save('');
|
|
313347
313611
|
autoSizePrompt();
|
|
313348
313612
|
}
|
|
313349
313613
|
await loadStatus();
|
|
@@ -313422,7 +313686,7 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313422
313686
|
|
|
313423
313687
|
async function submitTurn(prompt, options) {
|
|
313424
313688
|
const value = String(prompt || '').trim();
|
|
313425
|
-
if (!value || state.busy) return;
|
|
313689
|
+
if (!value || state.busy || state.sessionChanging) return;
|
|
313426
313690
|
if (!state.ready) {
|
|
313427
313691
|
showToast(copy.waitForConnection, 'warning');
|
|
313428
313692
|
elements.prompt.focus();
|
|
@@ -313443,10 +313707,12 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313443
313707
|
closeSlashCommands();
|
|
313444
313708
|
const turnId = crypto.randomUUID ? crypto.randomUUID() : String(Date.now()) + '-' + Math.random().toString(16).slice(2);
|
|
313445
313709
|
const previousDraft = elements.prompt.value;
|
|
313446
|
-
const
|
|
313710
|
+
const preserveDraft = options && typeof options.restoreDraft === 'string';
|
|
313711
|
+
const scope = drafts.active;
|
|
313712
|
+
const attachments = state.attachments;
|
|
313447
313713
|
const attachmentIds = Array.isArray(options && options.attachmentIds)
|
|
313448
313714
|
? options.attachmentIds.slice(0, 4)
|
|
313449
|
-
:
|
|
313715
|
+
: preserveDraft ? [] : attachments.map((attachment) => attachment.id);
|
|
313450
313716
|
const controlCommand = isControlCommand(value);
|
|
313451
313717
|
state.submitting = true;
|
|
313452
313718
|
state.activeTurnId = turnId;
|
|
@@ -313460,10 +313726,12 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313460
313726
|
} else {
|
|
313461
313727
|
createStreamingTurn(value, turnId);
|
|
313462
313728
|
}
|
|
313463
|
-
|
|
313464
|
-
|
|
313465
|
-
|
|
313466
|
-
|
|
313729
|
+
if (!preserveDraft) {
|
|
313730
|
+
elements.prompt.value = '';
|
|
313731
|
+
drafts.save('');
|
|
313732
|
+
autoSizePrompt();
|
|
313733
|
+
updateSendButtonState();
|
|
313734
|
+
}
|
|
313467
313735
|
closeSidebar();
|
|
313468
313736
|
try {
|
|
313469
313737
|
const result = await api('/api/chat', {
|
|
@@ -313472,13 +313740,7 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313472
313740
|
body: JSON.stringify({ prompt: value, turnId, attachmentIds }),
|
|
313473
313741
|
});
|
|
313474
313742
|
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
|
-
}
|
|
313743
|
+
consumeAttachments(attachmentIds, attachments);
|
|
313482
313744
|
state.submitting = false;
|
|
313483
313745
|
void reconcileStatus();
|
|
313484
313746
|
} catch (error) {
|
|
@@ -313488,10 +313750,14 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313488
313750
|
state.controlTurnId = null;
|
|
313489
313751
|
state.controlPrompt = '';
|
|
313490
313752
|
if (controlCommand) upsertControlTurn(turnId, value, 'failed', false);
|
|
313491
|
-
|
|
313492
|
-
|
|
313493
|
-
|
|
313494
|
-
|
|
313753
|
+
if (!preserveDraft && scope) {
|
|
313754
|
+
const recovered = drafts.recover(scope, previousDraft || value, elements.prompt.value);
|
|
313755
|
+
if (recovered !== undefined) {
|
|
313756
|
+
elements.prompt.value = recovered;
|
|
313757
|
+
autoSizePrompt();
|
|
313758
|
+
updateSendButtonState();
|
|
313759
|
+
}
|
|
313760
|
+
}
|
|
313495
313761
|
await renderMessages().catch(() => {});
|
|
313496
313762
|
showToast(error.message || String(error), 'error');
|
|
313497
313763
|
}
|
|
@@ -313894,7 +314160,7 @@ var WEB_UI_CLIENT_SLASH_COMMANDS_SCRIPT = String.raw` const builtInSlashCommand
|
|
|
313894
314160
|
const definition = slashCommandMatches[index];
|
|
313895
314161
|
if (!definition) return;
|
|
313896
314162
|
elements.prompt.value = definition.insertValue || (definition.command + (definition.usage ? ' ' : ''));
|
|
313897
|
-
|
|
314163
|
+
drafts.save(elements.prompt.value);
|
|
313898
314164
|
autoSizePrompt();
|
|
313899
314165
|
updateSendButtonState();
|
|
313900
314166
|
closeSlashCommands();
|
|
@@ -314055,6 +314321,7 @@ var WEB_UI_CLIENT_SCRIPT = [
|
|
|
314055
314321
|
`const onShortcutKeydown = ${onShortcutKeydown.toString()};`,
|
|
314056
314322
|
`document.addEventListener("mousedown", ${focusActivatedButton.toString()});`,
|
|
314057
314323
|
WEB_UI_CLIENT_FOUNDATION_SCRIPT,
|
|
314324
|
+
WEB_UI_CLIENT_DRAFTS_SCRIPT,
|
|
314058
314325
|
WEB_UI_CLIENT_WORKBENCH_SCRIPT,
|
|
314059
314326
|
WEB_UI_CLIENT_INSPECTOR_SCRIPT,
|
|
314060
314327
|
WEB_UI_CLIENT_SELECT_SCRIPT,
|
|
@@ -314068,10 +314335,14 @@ var WEB_UI_CLIENT_SCRIPT = [
|
|
|
314068
314335
|
WEB_UI_CLIENT_MISSION_CONTROL_SCRIPT,
|
|
314069
314336
|
WEB_UI_CLIENT_EVENT_ROUTING_SCRIPT,
|
|
314070
314337
|
WEB_UI_CLIENT_STREAM_PARSER_SCRIPT,
|
|
314338
|
+
`const projectFolderHints = ${projectFolderHints.toString()};`,
|
|
314339
|
+
`const projectPathKey = ${projectPathKey.toString()};`,
|
|
314340
|
+
`const reconcileNavigation = (${createNavigationRows.toString()})();`,
|
|
314071
314341
|
WEB_UI_CLIENT_SESSION_SCRIPT,
|
|
314072
314342
|
WEB_UI_CLIENT_SLASH_COMMANDS_SCRIPT,
|
|
314073
314343
|
WEB_UI_CLIENT_PALETTE_SCRIPT,
|
|
314074
314344
|
WEB_UI_CLIENT_AUTHENTICATION_SCRIPT,
|
|
314345
|
+
`(${bindWorkspaceLocation.toString()})(byId('workspaceLocation'));`,
|
|
314075
314346
|
WEB_UI_CLIENT_BINDINGS_SCRIPT,
|
|
314076
314347
|
WEB_UI_CLIENT_EPILOGUE
|
|
314077
314348
|
].join("");
|
|
@@ -314100,6 +314371,41 @@ var WEB_UI_FAVICON_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4
|
|
|
314100
314371
|
// src/runtime/webui/WebUiData.ts
|
|
314101
314372
|
import { relative as relative9 } from "path";
|
|
314102
314373
|
|
|
314374
|
+
// src/runtime/SessionTitles.ts
|
|
314375
|
+
var MAX_TITLE_CHARACTERS = 64;
|
|
314376
|
+
var MAX_LATIN_WORDS = 8;
|
|
314377
|
+
function isDefaultSessionTitle(title) {
|
|
314378
|
+
const name = title.trim();
|
|
314379
|
+
return !name || name === "New Orbit Session";
|
|
314380
|
+
}
|
|
314381
|
+
function deriveSessionTitle(prompt) {
|
|
314382
|
+
const firstMeaningfulLine = prompt.split(/\r?\n/).map((line) => line.trim()).find(Boolean);
|
|
314383
|
+
if (!firstMeaningfulLine) return "Untitled task";
|
|
314384
|
+
const safe = redactSecrets(firstMeaningfulLine).replace(/^#{1,6}\s*/, "").replace(/^[-*+>]\s*/, "").replace(/[\u0000-\u001f\u007f]/g, " ").replace(/\s+/g, " ").trim();
|
|
314385
|
+
if (!safe) return "Untitled task";
|
|
314386
|
+
const clause = safe.split(/[。!?!?;;]|\s+[—–-]\s+/u, 1)[0]?.trim() || safe;
|
|
314387
|
+
const hasCjk = /[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u.test(
|
|
314388
|
+
clause
|
|
314389
|
+
);
|
|
314390
|
+
const compact2 = hasCjk ? Array.from(clause).slice(0, 30).join("") : clause.split(/\s+/).slice(0, MAX_LATIN_WORDS).join(" ");
|
|
314391
|
+
const bounded = Array.from(compact2).slice(0, MAX_TITLE_CHARACTERS).join("").replace(/[\s,.:;!?,。!?;:]+$/u, "").trim();
|
|
314392
|
+
return bounded || "Untitled task";
|
|
314393
|
+
}
|
|
314394
|
+
function ensureSessionTitle(loop, prompt) {
|
|
314395
|
+
try {
|
|
314396
|
+
const activeSession = loop.sessionManager?.getActiveSession();
|
|
314397
|
+
if (!activeSession || !isDefaultSessionTitle(activeSession.title)) {
|
|
314398
|
+
return void 0;
|
|
314399
|
+
}
|
|
314400
|
+
const title = deriveSessionTitle(prompt);
|
|
314401
|
+
activeSession.title = title;
|
|
314402
|
+
loop.sessionManager.getSessionStore().updateSession(activeSession);
|
|
314403
|
+
return title;
|
|
314404
|
+
} catch {
|
|
314405
|
+
return void 0;
|
|
314406
|
+
}
|
|
314407
|
+
}
|
|
314408
|
+
|
|
314103
314409
|
// src/runtime/webui/WebUiSecurity.ts
|
|
314104
314410
|
import { timingSafeEqual } from "crypto";
|
|
314105
314411
|
import { z as z68 } from "zod";
|
|
@@ -314710,7 +315016,7 @@ function collectWebUiStatus(options, activeTurn) {
|
|
|
314710
315016
|
safeCall(() => options.getPendingApproval?.())
|
|
314711
315017
|
);
|
|
314712
315018
|
const contextFiles = summarizeWebUiContextFiles(relevantFiles);
|
|
314713
|
-
const normalizedSessions = normalizeSessions(sessions, sessionId);
|
|
315019
|
+
const normalizedSessions = normalizeSessions(sessions, sessionId, config.language);
|
|
314714
315020
|
const recentSessions = normalizedSessions.filter(
|
|
314715
315021
|
(session) => session.active || !session.archived
|
|
314716
315022
|
);
|
|
@@ -315015,17 +315321,41 @@ function safeApprovalText(value, maxLength, preserveLines) {
|
|
|
315015
315321
|
);
|
|
315016
315322
|
return (preserveLines ? safe : safe.replace(/\s+/g, " ")).trim().slice(0, maxLength);
|
|
315017
315323
|
}
|
|
315018
|
-
function normalizeSessions(sessions, activeId) {
|
|
315324
|
+
function normalizeSessions(sessions, activeId, language) {
|
|
315019
315325
|
if (!Array.isArray(sessions)) return [];
|
|
315020
|
-
|
|
315021
|
-
|
|
315022
|
-
|
|
315326
|
+
const records = sessions.filter(isRecord9).filter((s) => typeof s.id === "string" && s.id);
|
|
315327
|
+
const labels = /* @__PURE__ */ new Map();
|
|
315328
|
+
const unnamed = records.filter((session) => {
|
|
315329
|
+
const title = typeof session.title === "string" ? session.title.trim() : "";
|
|
315330
|
+
if (isDefaultSessionTitle(title)) return true;
|
|
315331
|
+
labels.set(session.id, redactSecrets(title).slice(0, 160));
|
|
315332
|
+
return false;
|
|
315333
|
+
});
|
|
315334
|
+
const creationTime = (session) => typeof session.createdAt === "string" ? Date.parse(session.createdAt) || 0 : 0;
|
|
315335
|
+
unnamed.sort(
|
|
315336
|
+
(a2, b) => creationTime(a2) - creationTime(b) || String(a2.id).localeCompare(String(b.id))
|
|
315337
|
+
);
|
|
315338
|
+
const base = { en: "Untitled chat", zh: "\u672A\u547D\u540D\u5BF9\u8BDD", "zh-TW": "\u672A\u547D\u540D\u5C0D\u8A71" }[language];
|
|
315339
|
+
const taken = new Set(labels.values());
|
|
315340
|
+
let ordinal = 0;
|
|
315341
|
+
for (const session of unnamed) {
|
|
315342
|
+
let label = base;
|
|
315343
|
+
if (unnamed.length > 1 || taken.has(base)) {
|
|
315344
|
+
do {
|
|
315345
|
+
label = base + " " + ++ordinal;
|
|
315346
|
+
} while (taken.has(label));
|
|
315347
|
+
}
|
|
315348
|
+
labels.set(session.id, label);
|
|
315349
|
+
}
|
|
315350
|
+
return records.map((session) => ({
|
|
315351
|
+
id: String(session.id),
|
|
315352
|
+
title: labels.get(session.id),
|
|
315023
315353
|
model: typeof session.model === "string" ? session.model : "",
|
|
315024
315354
|
updatedAt: typeof session.updatedAt === "string" ? session.updatedAt : typeof session.createdAt === "string" ? session.createdAt : "",
|
|
315025
315355
|
active: session.id === activeId,
|
|
315026
315356
|
archived: typeof session.archivedAt === "string",
|
|
315027
315357
|
archivedAt: typeof session.archivedAt === "string" ? session.archivedAt : ""
|
|
315028
|
-
})).
|
|
315358
|
+
})).sort((left, right) => {
|
|
315029
315359
|
if (left.active !== right.active) return left.active ? -1 : 1;
|
|
315030
315360
|
return Date.parse(right.updatedAt) - Date.parse(left.updatedAt);
|
|
315031
315361
|
});
|
|
@@ -315619,33 +315949,6 @@ data: ${JSON.stringify(entry.event)}
|
|
|
315619
315949
|
`;
|
|
315620
315950
|
}
|
|
315621
315951
|
|
|
315622
|
-
// src/runtime/webui/WebUiIcon.ts
|
|
315623
|
-
function renderUiIcon(name) {
|
|
315624
|
-
const paths = {
|
|
315625
|
-
add: '<path d="M12 5v14M5 12h14" />',
|
|
315626
|
-
tasks: '<rect x="5" y="4.5" width="14" height="15" rx="2" /><path d="m8 9 1.5 1.5L12 8M13.5 10h2.5M8 14h8M8 17h5" />',
|
|
315627
|
-
diagnostics: '<path d="M4.5 12h3l1.7-4 3.1 8 1.7-4h5.5" /><path d="M6 5.5h12v13H6z" />',
|
|
315628
|
-
changes: '<path d="M5 7h14M5 12h14M5 17h14" /><path d="M8 5v4M15 10v4M11 15v4" />',
|
|
315629
|
-
context: '<path d="M7 4.5h7l3 3v12H7z" /><path d="M14 4.5v3h3M9.5 12h5M12 9.5v5" />',
|
|
315630
|
-
image: '<rect x="4.5" y="5" width="15" height="14" rx="2" /><circle cx="9" cy="9.5" r="1.5" /><path d="m6.5 17 4-4 2.5 2 2.5-3 2.5 5" />',
|
|
315631
|
-
commands: '<rect x="4.5" y="5.5" width="15" height="13" rx="2" /><path d="m8 10 2 2-2 2M12.5 14h3.5" />',
|
|
315632
|
-
menu: '<path d="M5 7h14M5 12h14M5 17h14" />',
|
|
315633
|
-
panel: '<rect x="4.5" y="5" width="15" height="14" rx="2" /><path d="M14 5v14" />',
|
|
315634
|
-
close: '<path d="m7 7 10 10M17 7 7 17" />',
|
|
315635
|
-
back: '<path d="m10 6-6 6 6 6M4 12h16" />',
|
|
315636
|
-
up: '<path d="m7 14 5-5 5 5" />',
|
|
315637
|
-
down: '<path d="m7 10 5 5 5-5" />',
|
|
315638
|
-
archive: '<path d="M5.5 8.5h13v10h-13zM4.5 5h15v3.5h-15zM9.5 12h5" />',
|
|
315639
|
-
search: '<circle cx="10.5" cy="10.5" r="5.5" /><path d="m14.7 14.7 4.3 4.3" />',
|
|
315640
|
-
folder: '<path d="M4.5 7h5.3l2-2h7.7v14h-15z" /><path d="M4.5 9h15" />',
|
|
315641
|
-
review: '<circle cx="10.5" cy="10.5" r="5.5" /><path d="m14.7 14.7 4.3 4.3M10.5 8v5M8 10.5h5" />',
|
|
315642
|
-
fix: '<path d="M14.5 5.5a4 4 0 0 0-4.8 5.2L5 15.4 8.6 19l4.7-4.7a4 4 0 0 0 5.2-4.8l-2.7 2.7-3-3z" />',
|
|
315643
|
-
explain: '<path d="m9 7-5 5 5 5M15 7l5 5-5 5M13 5l-2 14" />',
|
|
315644
|
-
improve: '<path d="M12 4l1.2 4.1L17 10l-3.8 1.9L12 16l-1.2-4.1L7 10l3.8-1.9zM18 16v4M16 18h4M5 4v3M3.5 5.5h3" />'
|
|
315645
|
-
};
|
|
315646
|
-
return `<svg class="ui-icon" viewBox="0 0 24 24" fill="none" aria-hidden="true" focusable="false">${paths[name]}</svg>`;
|
|
315647
|
-
}
|
|
315648
|
-
|
|
315649
315952
|
// src/runtime/webui/WebUiWorkflowForm.ts
|
|
315650
315953
|
var STAGE_COPY = {
|
|
315651
315954
|
en: {
|
|
@@ -315758,9 +316061,7 @@ var BASE_COPY = {
|
|
|
315758
316061
|
connectionBody: "Keep the Orbit terminal open. Reconnection is automatic and your draft stays on this device.",
|
|
315759
316062
|
retry: "Retry now",
|
|
315760
316063
|
details: "Details",
|
|
315761
|
-
emptyEyebrow: "ORBIT \xB7 LOCAL SESSION",
|
|
315762
316064
|
emptyTitle: "What should we work on?",
|
|
315763
|
-
emptyBody: "Ask, plan, build, or verify anything in this workspace.",
|
|
315764
316065
|
suggestionReview: "Review this project",
|
|
315765
316066
|
suggestionReviewBody: "Find the highest-impact issues and fix them.",
|
|
315766
316067
|
suggestionFix: "Fix a problem",
|
|
@@ -315784,7 +316085,7 @@ var BASE_COPY = {
|
|
|
315784
316085
|
attachImage: "Attach image",
|
|
315785
316086
|
clearContext: "Clear all",
|
|
315786
316087
|
webSearch: "Agent search",
|
|
315787
|
-
sendHint: "Enter to send
|
|
316088
|
+
sendHint: "Enter to send \xB7 Shift+Enter for a new line \xB7 Type / for commands",
|
|
315788
316089
|
queuedMessages: "Queued follow-ups",
|
|
315789
316090
|
clearQueue: "Clear queue",
|
|
315790
316091
|
queueMessage: "Queue message",
|
|
@@ -315949,9 +316250,7 @@ var BASE_COPY = {
|
|
|
315949
316250
|
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
316251
|
retry: "\u7ACB\u5373\u91CD\u8BD5",
|
|
315951
316252
|
details: "\u4EFB\u52A1\u8BE6\u60C5",
|
|
315952
|
-
emptyEyebrow: "ORBIT \xB7 \u672C\u5730\u4F1A\u8BDD",
|
|
315953
316253
|
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
316254
|
suggestionReview: "\u5168\u9762\u5BA1\u67E5\u9879\u76EE",
|
|
315956
316255
|
suggestionReviewBody: "\u627E\u51FA\u5F71\u54CD\u6700\u5927\u7684\u95EE\u9898\u5E76\u76F4\u63A5\u4FEE\u590D\u3002",
|
|
315957
316256
|
suggestionFix: "\u4FEE\u590D\u4E00\u4E2A\u95EE\u9898",
|
|
@@ -315975,7 +316274,7 @@ var BASE_COPY = {
|
|
|
315975
316274
|
attachImage: "\u6DFB\u52A0\u56FE\u7247",
|
|
315976
316275
|
clearContext: "\u5168\u90E8\u6E05\u7A7A",
|
|
315977
316276
|
webSearch: "Agent \u641C\u7D22",
|
|
315978
|
-
sendHint: "Enter \u53D1\u9001
|
|
316277
|
+
sendHint: "Enter \u53D1\u9001 \xB7 Shift+Enter \u6362\u884C \xB7 / \u67E5\u770B\u547D\u4EE4",
|
|
315979
316278
|
queuedMessages: "\u5F85\u53D1\u9001\u6D88\u606F",
|
|
315980
316279
|
clearQueue: "\u6E05\u7A7A\u961F\u5217",
|
|
315981
316280
|
queueMessage: "\u52A0\u5165\u961F\u5217",
|
|
@@ -316051,7 +316350,7 @@ var BASE_COPY = {
|
|
|
316051
316350
|
fullAccessConfirmAction: "\u6388\u4E88\u5B8C\u6574\u6743\u9650",
|
|
316052
316351
|
modeStrict: "\u4E25\u683C",
|
|
316053
316352
|
modeNormal: "\u6807\u51C6",
|
|
316054
|
-
modeAuto: "\
|
|
316353
|
+
modeAuto: "\u5B8C\u6574\u8BBF\u95EE",
|
|
316055
316354
|
modePlan: "\u89C4\u5212",
|
|
316056
316355
|
searchProvider: "\u641C\u7D22\u670D\u52A1",
|
|
316057
316356
|
searchResults: "\u6700\u5927\u7ED3\u679C\u6570",
|
|
@@ -316138,9 +316437,7 @@ var COPY = {
|
|
|
316138
316437
|
collapseNavigation: "\u6536\u5408\u5C0E\u89BD",
|
|
316139
316438
|
connected: "\u6B63\u5728\u9023\u7DDA",
|
|
316140
316439
|
details: "\u4EFB\u52D9\u8A73\u60C5",
|
|
316141
|
-
emptyEyebrow: "ORBIT \xB7 \u672C\u6A5F\u5DE5\u4F5C\u968E\u6BB5",
|
|
316142
316440
|
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
316441
|
suggestionReview: "\u5168\u9762\u6AA2\u8996\u5C08\u6848",
|
|
316145
316442
|
suggestionReviewBody: "\u627E\u51FA\u5F71\u97FF\u6700\u5927\u7684\u554F\u984C\u4E26\u76F4\u63A5\u4FEE\u6B63\u3002",
|
|
316146
316443
|
suggestionFix: "\u4FEE\u6B63\u4E00\u500B\u554F\u984C",
|
|
@@ -316160,7 +316457,7 @@ var COPY = {
|
|
|
316160
316457
|
attachImage: "\u52A0\u5165\u5716\u7247",
|
|
316161
316458
|
clearContext: "\u5168\u90E8\u6E05\u9664",
|
|
316162
316459
|
webSearch: "Agent \u641C\u5C0B",
|
|
316163
|
-
sendHint: "Enter \u50B3\u9001
|
|
316460
|
+
sendHint: "Enter \u50B3\u9001 \xB7 Shift+Enter \u63DB\u884C \xB7 / \u67E5\u770B\u547D\u4EE4",
|
|
316164
316461
|
queuedMessages: "\u5F85\u50B3\u9001\u8A0A\u606F",
|
|
316165
316462
|
clearQueue: "\u6E05\u9664\u4F47\u5217",
|
|
316166
316463
|
queueMessage: "\u52A0\u5165\u4F47\u5217",
|
|
@@ -316211,7 +316508,7 @@ var COPY = {
|
|
|
316211
316508
|
fullAccessConfirmAction: "\u6388\u4E88\u5B8C\u6574\u6B0A\u9650",
|
|
316212
316509
|
modeStrict: "\u56B4\u683C",
|
|
316213
316510
|
modeNormal: "\u6A19\u6E96",
|
|
316214
|
-
modeAuto: "\
|
|
316511
|
+
modeAuto: "\u5B8C\u6574\u53D6\u7528",
|
|
316215
316512
|
modePlan: "\u898F\u5283",
|
|
316216
316513
|
searchProvider: "\u641C\u5C0B\u670D\u52D9",
|
|
316217
316514
|
searchResults: "\u6700\u5927\u7D50\u679C\u6578",
|
|
@@ -316281,7 +316578,8 @@ function renderComposer(copy, t2) {
|
|
|
316281
316578
|
<div class="prompt-queue-header"><button id="clearQueueButton" type="button">${copy.clearQueue}</button></div>
|
|
316282
316579
|
<div class="prompt-queue-list" id="promptQueueList"></div>
|
|
316283
316580
|
</details>
|
|
316284
|
-
<div class="composer-
|
|
316581
|
+
<div class="composer-toolbar">
|
|
316582
|
+
<div class="composer-models" role="group" aria-label="${copy.model}">
|
|
316285
316583
|
<div class="select-control provider-control" data-select-control data-select-placement="top" title="${copy.provider}">
|
|
316286
316584
|
<select class="native-select-proxy" id="providerSelect" aria-label="${copy.provider}" tabindex="-1" aria-hidden="true" hidden></select>
|
|
316287
316585
|
<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 +316594,6 @@ function renderComposer(copy, t2) {
|
|
|
316296
316594
|
</button>
|
|
316297
316595
|
<div class="select-menu model-select-menu" id="modelSelectMenu" role="listbox" aria-label="${copy.model}" hidden></div>
|
|
316298
316596
|
</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
316597
|
<div class="select-control composer-select-control" data-select-control>
|
|
316307
316598
|
<select class="native-select-proxy" id="permissionSelect" aria-label="${copy.permission}" tabindex="-1" aria-hidden="true" hidden>
|
|
316308
316599
|
<option value="strict">${copy.modeStrict}</option>
|
|
@@ -316316,6 +316607,12 @@ function renderComposer(copy, t2) {
|
|
|
316316
316607
|
<div class="select-menu" id="permissionSelectMenu" role="listbox" aria-label="${copy.permission}" hidden></div>
|
|
316317
316608
|
</div>
|
|
316318
316609
|
</div>
|
|
316610
|
+
<div class="composer-tools">
|
|
316611
|
+
<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>
|
|
316612
|
+
<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>
|
|
316613
|
+
<input id="attachmentInput" data-testid="attachment-input" type="file" accept="image/png,image/jpeg,image/gif,image/webp" multiple hidden />
|
|
316614
|
+
<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>
|
|
316615
|
+
</div>
|
|
316319
316616
|
<div class="composer-actions">
|
|
316320
316617
|
<button class="queue-button" id="queueButton" type="button" hidden>${copy.queueMessage}</button>
|
|
316321
316618
|
<button class="queue-button" id="steerButton" type="button" hidden>${t2("Steer now", "\u7ACB\u5373\u5F15\u5BFC", "\u7ACB\u5373\u5F15\u5C0E")}</button>
|
|
@@ -316347,7 +316644,11 @@ function renderComposer(copy, t2) {
|
|
|
316347
316644
|
<p class="context-picker-hint">${copy.contextPickerHint}</p>
|
|
316348
316645
|
</section>
|
|
316349
316646
|
</form>
|
|
316350
|
-
<p class="composer-hint"
|
|
316647
|
+
<p class="composer-hint" id="composerHint" data-idle="${copy.sendHint}" data-running="${t2(
|
|
316648
|
+
"Enter to queue \xB7 {steer} to steer \xB7 Shift+Enter for a new line",
|
|
316649
|
+
"Enter \u52A0\u5165\u961F\u5217 \xB7 {steer} \u5F15\u5BFC\u5F53\u524D\u4EFB\u52A1 \xB7 Shift+Enter \u6362\u884C",
|
|
316650
|
+
"Enter \u52A0\u5165\u4F47\u5217 \xB7 {steer} \u5F15\u5C0E\u76EE\u524D\u4EFB\u52D9 \xB7 Shift+Enter \u63DB\u884C"
|
|
316651
|
+
)}">${copy.sendHint}</p>
|
|
316351
316652
|
</div>`;
|
|
316352
316653
|
}
|
|
316353
316654
|
function renderWebUiPage(language) {
|
|
@@ -316383,14 +316684,14 @@ function renderWebUiPage(language) {
|
|
|
316383
316684
|
<button class="sidebar-collapse-button" id="sidebarCollapseButton" type="button" aria-label="${copy.collapseNavigation}" aria-controls="sidebar" aria-expanded="true">${renderUiIcon("panel")}</button>
|
|
316384
316685
|
</div>
|
|
316385
316686
|
|
|
316386
|
-
<button class="new-task-button" id="newTaskButton" data-testid="new-chat" type="button">
|
|
316687
|
+
<button class="new-task-button" aria-keyshortcuts="Control+n" id="newTaskButton" data-testid="new-chat" type="button">
|
|
316387
316688
|
<span class="new-task-icon">${renderUiIcon("add")}</span>
|
|
316388
316689
|
<span>${copy.newTask}</span>
|
|
316389
|
-
<kbd>Ctrl N</kbd>
|
|
316690
|
+
<kbd data-control-key="N">Ctrl N</kbd>
|
|
316390
316691
|
</button>
|
|
316391
316692
|
|
|
316392
|
-
<div class="
|
|
316393
|
-
<span>${copy.projects}</span
|
|
316693
|
+
<div class="project-heading">
|
|
316694
|
+
<span>${copy.projects}</span>
|
|
316394
316695
|
<button class="new-project-button" id="newProjectButton" type="button" aria-label="${copy.newProject}" aria-haspopup="dialog" aria-controls="projectDialog">${renderUiIcon("add")}</button>
|
|
316395
316696
|
</div>
|
|
316396
316697
|
<section class="project-section" id="projectSection" data-testid="active-project" aria-label="${copy.projects}">
|
|
@@ -316398,19 +316699,12 @@ function renderWebUiPage(language) {
|
|
|
316398
316699
|
<span class="project-folder-icon">${renderUiIcon("folder")}</span>
|
|
316399
316700
|
<span class="project-copy">
|
|
316400
316701
|
<strong id="sidebarWorkspace">\u2014</strong>
|
|
316401
|
-
<small id="sidebarSession">${copy.localOnly}</small>
|
|
316402
316702
|
</span>
|
|
316403
316703
|
<span class="project-chat-count" id="projectChatCount" aria-label="0">0</span>
|
|
316404
316704
|
<span class="project-toggle-chevron">${renderUiIcon("down")}</span>
|
|
316405
316705
|
</button>
|
|
316406
316706
|
<div class="project-chat-body" id="projectChatBody" role="region" aria-label="${copy.recentTasks}" tabindex="0">
|
|
316407
|
-
<section class="recent-section" id="recentSection" aria-
|
|
316408
|
-
<div class="nav-section-heading session-section-heading" id="recentHeading">
|
|
316409
|
-
<span>${copy.recentTasks}</span><i></i>
|
|
316410
|
-
<button class="archive-toggle" id="archiveToggle" type="button" aria-label="${copy.archivedTasks}" aria-controls="archivedPanel" aria-expanded="false">
|
|
316411
|
-
${renderUiIcon("archive")}<b id="archiveCount">0</b>
|
|
316412
|
-
</button>
|
|
316413
|
-
</div>
|
|
316707
|
+
<section class="recent-section" id="recentSection" aria-label="${copy.recentTasks}">
|
|
316414
316708
|
<label class="session-search" id="sessionSearchField" hidden>
|
|
316415
316709
|
<span class="sr-only">${copy.searchChats}</span>
|
|
316416
316710
|
${renderUiIcon("search")}
|
|
@@ -316419,8 +316713,10 @@ function renderWebUiPage(language) {
|
|
|
316419
316713
|
<div class="recent-sessions" id="recentSessions" data-testid="chat-list" aria-label="${copy.recentTasks}"></div>
|
|
316420
316714
|
<p class="session-list-empty" id="recentEmpty">${copy.noRecentTasks}</p>
|
|
316421
316715
|
<button class="session-show-more" id="sessionShowMore" type="button" hidden>${copy.showMoreChats}</button>
|
|
316716
|
+
<button class="archive-toggle" id="archiveToggle" type="button" aria-controls="archivedPanel" aria-expanded="false" hidden>
|
|
316717
|
+
${renderUiIcon("archive")}<span>${copy.archivedTasks}</span><b id="archiveCount">0</b>
|
|
316718
|
+
</button>
|
|
316422
316719
|
<section class="archived-panel" id="archivedPanel" aria-label="${copy.archivedTasks}" hidden>
|
|
316423
|
-
<div class="archived-panel-title">${copy.archivedTasks}</div>
|
|
316424
316720
|
<div class="archived-sessions" id="archivedSessions"></div>
|
|
316425
316721
|
<p class="session-list-empty" id="archivedEmpty">${copy.noArchivedTasks}</p>
|
|
316426
316722
|
</section>
|
|
@@ -316429,13 +316725,12 @@ function renderWebUiPage(language) {
|
|
|
316429
316725
|
</section>
|
|
316430
316726
|
|
|
316431
316727
|
<section class="recent-projects-shell" id="recentProjectsShell" aria-label="${copy.recentProjects}" hidden>
|
|
316432
|
-
<div class="project-list-label">${copy.recentProjects}</div>
|
|
316433
316728
|
<div class="project-list" id="projectList" role="region" aria-label="${copy.recentProjects}" tabindex="0"></div>
|
|
316434
316729
|
</section>
|
|
316435
316730
|
|
|
316436
316731
|
<div class="sidebar-spacer"></div>
|
|
316437
316732
|
<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>
|
|
316733
|
+
<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
316734
|
<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
316735
|
</footer>
|
|
316441
316736
|
</aside>
|
|
@@ -316445,8 +316740,11 @@ function renderWebUiPage(language) {
|
|
|
316445
316740
|
<div class="topbar-start">
|
|
316446
316741
|
<button class="icon-button mobile-menu" id="menuButton" type="button" aria-label="${copy.openNavigation}" aria-controls="sidebar" aria-expanded="false">${renderUiIcon("menu")}</button>
|
|
316447
316742
|
<div class="workspace-heading">
|
|
316743
|
+
<details class="workspace-location" id="workspaceLocation">
|
|
316744
|
+
<summary title="${copy.projectPath}"><span id="workspacePath">Orbit</span>${renderUiIcon("down")}</summary>
|
|
316745
|
+
<div class="workspace-location-detail"><strong>${copy.projectPath}</strong><code id="workspaceFolder" dir="auto"></code></div>
|
|
316746
|
+
</details>
|
|
316448
316747
|
<strong id="workspaceName">Orbit</strong>
|
|
316449
|
-
<span id="workspacePath">${copy.localOnly}</span>
|
|
316450
316748
|
</div>
|
|
316451
316749
|
</div>
|
|
316452
316750
|
<div class="topbar-actions">
|
|
@@ -316458,9 +316756,9 @@ function renderWebUiPage(language) {
|
|
|
316458
316756
|
<span class="connection-dot"></span>
|
|
316459
316757
|
<span id="connectionLabel" role="status" aria-live="polite">${copy.connected}</span>
|
|
316460
316758
|
</button>
|
|
316461
|
-
<button class="approval-jump" id="jumpApproval" aria-controls="approvalPanel" type="button"
|
|
316759
|
+
<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
316760
|
<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>
|
|
316761
|
+
<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
316762
|
</nav>
|
|
316465
316763
|
</div>
|
|
316466
316764
|
</header>
|
|
@@ -316481,11 +316779,11 @@ function renderWebUiPage(language) {
|
|
|
316481
316779
|
<span class="approval-eyebrow" id="approvalEyebrow" role="status">${copy.approvalEyebrow}</span>
|
|
316482
316780
|
<strong id="approvalTitle"></strong>
|
|
316483
316781
|
</div>
|
|
316782
|
+
<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
316783
|
</div>
|
|
316485
316784
|
<p class="approval-reason" id="approvalReason"></p>
|
|
316486
316785
|
<div id="approvalInlinePreview"><pre class="approval-preview" id="approvalPreview" tabindex="0" hidden></pre></div>
|
|
316487
316786
|
<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
316787
|
<button class="approval-button is-deny" id="denyApprovalButton" type="button">${copy.approvalDeny}</button>
|
|
316490
316788
|
<button class="approval-button is-approve" id="approveApprovalButton" type="button">${copy.approvalApprove}</button>
|
|
316491
316789
|
</div>
|
|
@@ -316495,9 +316793,7 @@ function renderWebUiPage(language) {
|
|
|
316495
316793
|
<button class="text-button" id="verificationResultButton" aria-controls="verificationList" type="button">${copy.verification} \xB7 <span id="resultVerification"></span></button>
|
|
316496
316794
|
</div>
|
|
316497
316795
|
<section class="empty-state" id="emptyState">
|
|
316498
|
-
<
|
|
316499
|
-
<h1>${copy.emptyTitle}</h1>
|
|
316500
|
-
<p class="empty-description">${copy.emptyBody}</p>
|
|
316796
|
+
<div class="empty-heading">${renderOrbitMark("welcome-mark")}<h1>${copy.emptyTitle}</h1></div>
|
|
316501
316797
|
<div class="empty-composer-slot" id="emptyComposerSlot">
|
|
316502
316798
|
${renderComposer(copy, t2)}
|
|
316503
316799
|
</div>
|
|
@@ -316545,7 +316841,7 @@ function renderWebUiPage(language) {
|
|
|
316545
316841
|
<h3>${copy.taskCenter}</h3>
|
|
316546
316842
|
<p>${copy.taskCenterDescription}</p>
|
|
316547
316843
|
</header>
|
|
316548
|
-
<section class="task-overview" id="taskOverview"
|
|
316844
|
+
<section class="task-overview" id="taskOverview"></section>
|
|
316549
316845
|
<section class="task-actions" aria-labelledby="taskActionsTitle">
|
|
316550
316846
|
<div class="section-heading"><h3 id="taskActionsTitle">${copy.taskActions}</h3></div>
|
|
316551
316847
|
<div class="task-action-grid">
|
|
@@ -316855,7 +317151,7 @@ function renderWebUiPage(language) {
|
|
|
316855
317151
|
<div class="project-path-field">
|
|
316856
317152
|
<label for="projectPathInput">${copy.projectPath}</label>
|
|
316857
317153
|
<div class="project-path-control">
|
|
316858
|
-
<input id="projectPathInput" type="text" maxlength="4096" autocomplete="off" spellcheck="false" placeholder="${copy.projectPathPlaceholder}" />
|
|
317154
|
+
<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
317155
|
<button class="project-dialog-browse" id="projectDialogBrowse" type="button">${copy.browseProject}</button>
|
|
316860
317156
|
</div>
|
|
316861
317157
|
</div>
|
|
@@ -316872,11 +317168,11 @@ function renderWebUiPage(language) {
|
|
|
316872
317168
|
|
|
316873
317169
|
// src/runtime/webui/styles/WebUiComposerStyles.ts
|
|
316874
317170
|
var WEB_UI_COMPOSER_STYLES = String.raw`
|
|
316875
|
-
.composer-models { display: flex; align-items: center; gap: 2px;
|
|
317171
|
+
.composer-models { display: flex; align-items: center; gap: 2px; flex: 1 1 230px; min-width: 0; }
|
|
316876
317172
|
.composer-models .select-trigger { height: 32px; width: auto; max-width: 100%; border-color: transparent; background: transparent; box-shadow: none; font-size: 12px; }
|
|
316877
317173
|
.composer-models .provider-select-trigger { max-width: 145px; color: var(--muted); }
|
|
316878
317174
|
.composer-models .provider-control { flex: 0 1 auto; max-width: 145px; }
|
|
316879
|
-
.composer-models .model-control { min-width: 0; flex:
|
|
317175
|
+
.composer-models .model-control { min-width: 0; flex: 0 1 auto; }
|
|
316880
317176
|
.composer-models .model-select-trigger { max-width: min(320px, 100%); width: fit-content; }
|
|
316881
317177
|
.composer-models .select-trigger:hover { background: var(--surface-hover); }
|
|
316882
317178
|
.composer-dock {
|
|
@@ -317115,10 +317411,11 @@ var WEB_UI_COMPOSER_STYLES = String.raw`
|
|
|
317115
317411
|
|
|
317116
317412
|
.composer-toolbar {
|
|
317117
317413
|
display: flex;
|
|
317118
|
-
|
|
317119
|
-
|
|
317120
|
-
gap:
|
|
317121
|
-
padding-top:
|
|
317414
|
+
flex-wrap: wrap;
|
|
317415
|
+
align-items: center;
|
|
317416
|
+
gap: 4px 8px;
|
|
317417
|
+
padding-top: 5px;
|
|
317418
|
+
border-top: 1px solid var(--border);
|
|
317122
317419
|
}
|
|
317123
317420
|
|
|
317124
317421
|
.composer-tools {
|
|
@@ -317197,6 +317494,7 @@ var WEB_UI_COMPOSER_STYLES = String.raw`
|
|
|
317197
317494
|
}
|
|
317198
317495
|
|
|
317199
317496
|
.composer-actions {
|
|
317497
|
+
margin-left: auto;
|
|
317200
317498
|
display: flex;
|
|
317201
317499
|
align-items: center;
|
|
317202
317500
|
gap: 6px;
|
|
@@ -317569,8 +317867,8 @@ var WEB_UI_APPROVAL_STYLES = String.raw`
|
|
|
317569
317867
|
|
|
317570
317868
|
.approval-jump {
|
|
317571
317869
|
display: block;
|
|
317572
|
-
margin: 0
|
|
317573
|
-
padding:
|
|
317870
|
+
margin: 0;
|
|
317871
|
+
padding: 6px 9px;
|
|
317574
317872
|
border: 0;
|
|
317575
317873
|
background: var(--warning-soft);
|
|
317576
317874
|
color: var(--ink);
|
|
@@ -317606,6 +317904,20 @@ var WEB_UI_APPROVAL_STYLES = String.raw`
|
|
|
317606
317904
|
gap: 2px;
|
|
317607
317905
|
}
|
|
317608
317906
|
|
|
317907
|
+
.diff-link {
|
|
317908
|
+
flex: 0 0 auto;
|
|
317909
|
+
align-self: center;
|
|
317910
|
+
margin-left: auto;
|
|
317911
|
+
padding: 7px 5px;
|
|
317912
|
+
color: var(--accent-strong);
|
|
317913
|
+
background: transparent;
|
|
317914
|
+
border: 0;
|
|
317915
|
+
border-radius: 5px;
|
|
317916
|
+
font: 600 12px/1.4 var(--font-sans);
|
|
317917
|
+
text-decoration: underline;
|
|
317918
|
+
text-underline-offset: 3px;
|
|
317919
|
+
}
|
|
317920
|
+
|
|
317609
317921
|
.approval-mark {
|
|
317610
317922
|
width: 28px;
|
|
317611
317923
|
height: 28px;
|
|
@@ -319080,28 +319392,15 @@ var WEB_UI_CONVERSATION_STYLES = String.raw`
|
|
|
319080
319392
|
display: none;
|
|
319081
319393
|
}
|
|
319082
319394
|
|
|
319083
|
-
.
|
|
319084
|
-
display:
|
|
319395
|
+
.empty-heading {
|
|
319396
|
+
display: flex;
|
|
319085
319397
|
align-items: center;
|
|
319086
|
-
gap:
|
|
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);
|
|
319398
|
+
gap: 14px;
|
|
319100
319399
|
}
|
|
319101
319400
|
|
|
319102
|
-
.
|
|
319103
|
-
width:
|
|
319104
|
-
height:
|
|
319401
|
+
.welcome-mark {
|
|
319402
|
+
width: 40px;
|
|
319403
|
+
height: 40px;
|
|
319105
319404
|
color: var(--accent-strong);
|
|
319106
319405
|
}
|
|
319107
319406
|
|
|
@@ -319115,14 +319414,6 @@ var WEB_UI_CONVERSATION_STYLES = String.raw`
|
|
|
319115
319414
|
line-height: 1.08;
|
|
319116
319415
|
}
|
|
319117
319416
|
|
|
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
319417
|
.connection-help {
|
|
319127
319418
|
display: none;
|
|
319128
319419
|
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
@@ -319213,19 +319504,19 @@ var WEB_UI_CONVERSATION_STYLES = String.raw`
|
|
|
319213
319504
|
gap: 11px;
|
|
319214
319505
|
padding: 11px 14px;
|
|
319215
319506
|
color: var(--ink);
|
|
319216
|
-
background:
|
|
319217
|
-
border:
|
|
319218
|
-
border-
|
|
319507
|
+
background: transparent;
|
|
319508
|
+
border: 0;
|
|
319509
|
+
border-bottom: 1px solid var(--border);
|
|
319510
|
+
border-radius: 0;
|
|
319219
319511
|
text-align: left;
|
|
319220
|
-
box-shadow:
|
|
319512
|
+
box-shadow: none;
|
|
319221
319513
|
transition: background 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
|
|
319222
319514
|
}
|
|
319223
319515
|
|
|
319224
319516
|
.suggestion-card:hover {
|
|
319225
319517
|
background: var(--surface-raised);
|
|
319226
319518
|
border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
|
|
319227
|
-
box-shadow:
|
|
319228
|
-
transform: translateY(-2px);
|
|
319519
|
+
box-shadow: none;
|
|
319229
319520
|
}
|
|
319230
319521
|
|
|
319231
319522
|
.suggestion-icon {
|
|
@@ -319255,14 +319546,14 @@ var WEB_UI_CONVERSATION_STYLES = String.raw`
|
|
|
319255
319546
|
|
|
319256
319547
|
.suggestion-copy strong {
|
|
319257
319548
|
color: var(--ink-strong);
|
|
319258
|
-
font-size:
|
|
319549
|
+
font-size: 13px;
|
|
319259
319550
|
font-weight: 650;
|
|
319260
319551
|
}
|
|
319261
319552
|
|
|
319262
319553
|
.suggestion-copy small {
|
|
319263
319554
|
overflow: hidden;
|
|
319264
319555
|
color: var(--muted);
|
|
319265
|
-
font-size:
|
|
319556
|
+
font-size: 12px;
|
|
319266
319557
|
line-height: 1.4;
|
|
319267
319558
|
text-overflow: ellipsis;
|
|
319268
319559
|
white-space: nowrap;
|
|
@@ -319843,8 +320134,8 @@ var WEB_UI_FOUNDATION_STYLES = String.raw`
|
|
|
319843
320134
|
--radius-md: 12px;
|
|
319844
320135
|
--radius-lg: 18px;
|
|
319845
320136
|
--radius-xl: 24px;
|
|
319846
|
-
--font-sans: "Segoe UI Variable Text",
|
|
319847
|
-
--font-mono: "SFMono-Regular", Consolas, "Liberation Mono",
|
|
320137
|
+
--font-sans: -apple-system, system-ui, "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
|
|
320138
|
+
--font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
|
|
319848
320139
|
}
|
|
319849
320140
|
|
|
319850
320141
|
:root[data-theme="dark"] {
|
|
@@ -321880,9 +322171,10 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
321880
322171
|
pointer-events: auto;
|
|
321881
322172
|
}
|
|
321882
322173
|
|
|
321883
|
-
.
|
|
321884
|
-
|
|
321885
|
-
}
|
|
322174
|
+
.session-actions { flex-basis: auto; width: auto; }
|
|
322175
|
+
.recent-session, .registered-project-open, .project-toggle { min-height: 44px; }
|
|
322176
|
+
.registered-project-remove { width: 32px; height: 32px; right: 2px; }
|
|
322177
|
+
|
|
321886
322178
|
|
|
321887
322179
|
.session-action {
|
|
321888
322180
|
width: 32px;
|
|
@@ -321890,7 +322182,7 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
321890
322182
|
}
|
|
321891
322183
|
|
|
321892
322184
|
.session-row:has(.session-actions) .recent-session-meta {
|
|
321893
|
-
|
|
322185
|
+
display: none;
|
|
321894
322186
|
}
|
|
321895
322187
|
|
|
321896
322188
|
.icon-button,
|
|
@@ -321970,8 +322262,7 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
321970
322262
|
display: none;
|
|
321971
322263
|
}
|
|
321972
322264
|
|
|
321973
|
-
.context-meter
|
|
321974
|
-
.workspace-heading span {
|
|
322265
|
+
.context-meter {
|
|
321975
322266
|
display: none;
|
|
321976
322267
|
}
|
|
321977
322268
|
|
|
@@ -322082,10 +322373,6 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
322082
322373
|
font-size: 44px;
|
|
322083
322374
|
}
|
|
322084
322375
|
|
|
322085
|
-
.empty-description {
|
|
322086
|
-
font-size: 15px;
|
|
322087
|
-
}
|
|
322088
|
-
|
|
322089
322376
|
.suggestion-card {
|
|
322090
322377
|
min-height: 68px;
|
|
322091
322378
|
}
|
|
@@ -322165,6 +322452,8 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
322165
322452
|
scrollbar-gutter: auto;
|
|
322166
322453
|
}
|
|
322167
322454
|
|
|
322455
|
+
.project-chat-body { padding-inline-end: 10px; }
|
|
322456
|
+
|
|
322168
322457
|
.message-scroll {
|
|
322169
322458
|
scrollbar-width: none;
|
|
322170
322459
|
}
|
|
@@ -322200,7 +322489,6 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
322200
322489
|
padding-top: env(safe-area-inset-top);
|
|
322201
322490
|
}
|
|
322202
322491
|
|
|
322203
|
-
.workspace-heading span,
|
|
322204
322492
|
.command-trigger,
|
|
322205
322493
|
.context-meter,
|
|
322206
322494
|
.brand-version {
|
|
@@ -322225,8 +322513,13 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
322225
322513
|
max-width: none;
|
|
322226
322514
|
}
|
|
322227
322515
|
|
|
322228
|
-
.workspace-tool {
|
|
322229
|
-
.workspace-tool
|
|
322516
|
+
.workspace-tool { width: 40px; height: 40px; justify-content: center; padding: 0; }
|
|
322517
|
+
.workspace-tool span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
|
|
322518
|
+
.workspace-tool .ui-icon { width: 18px; height: 18px; }
|
|
322519
|
+
.workspace-heading span, .workspace-heading strong { max-width: 100%; }
|
|
322520
|
+
.topbar-start { gap: 5px; }
|
|
322521
|
+
.welcome-mark { width: 32px; height: 32px; }
|
|
322522
|
+
.empty-heading { gap: 9px; }
|
|
322230
322523
|
.composer-models .provider-control, .composer-models .model-control { display: block; }
|
|
322231
322524
|
|
|
322232
322525
|
.message-column {
|
|
@@ -322284,10 +322577,6 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
322284
322577
|
padding: 38px 0 28px;
|
|
322285
322578
|
}
|
|
322286
322579
|
|
|
322287
|
-
.empty-description {
|
|
322288
|
-
font-size: 12px;
|
|
322289
|
-
}
|
|
322290
|
-
|
|
322291
322580
|
.suggestion-grid {
|
|
322292
322581
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
322293
322582
|
gap: 7px;
|
|
@@ -322361,7 +322650,7 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
322361
322650
|
}
|
|
322362
322651
|
|
|
322363
322652
|
.composer-models .select-trigger {
|
|
322364
|
-
height:
|
|
322653
|
+
height: 40px;
|
|
322365
322654
|
}
|
|
322366
322655
|
|
|
322367
322656
|
.context-shelf {
|
|
@@ -322450,10 +322739,20 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
322450
322739
|
}
|
|
322451
322740
|
}
|
|
322452
322741
|
|
|
322742
|
+
@media (max-width: 760px) {
|
|
322743
|
+
.composer-models { flex-basis: 100%; }
|
|
322744
|
+
.composer-models .composer-select-control { margin-left: auto; }
|
|
322745
|
+
.composer-tools { flex: 1 1 0; }
|
|
322746
|
+
}
|
|
322747
|
+
|
|
322748
|
+
@container preview-chat (max-width: 680px) {
|
|
322749
|
+
.composer-models { flex-basis: 100%; }
|
|
322750
|
+
.composer-models .composer-select-control { margin-left: auto; }
|
|
322751
|
+
.composer-tools { flex: 1 1 0; }
|
|
322752
|
+
}
|
|
322753
|
+
|
|
322453
322754
|
@media (max-width: 420px) {
|
|
322454
|
-
.composer-toolbar {
|
|
322455
|
-
gap: 8px;
|
|
322456
|
-
}
|
|
322755
|
+
.composer-toolbar { gap: 3px 5px; }
|
|
322457
322756
|
|
|
322458
322757
|
.task-overview-stats {
|
|
322459
322758
|
grid-template-columns: minmax(0, 1fr);
|
|
@@ -322471,10 +322770,6 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
322471
322770
|
font-size: 29px;
|
|
322472
322771
|
}
|
|
322473
322772
|
|
|
322474
|
-
.empty-description {
|
|
322475
|
-
max-width: 34ch;
|
|
322476
|
-
}
|
|
322477
|
-
|
|
322478
322773
|
}
|
|
322479
322774
|
|
|
322480
322775
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -322778,7 +323073,7 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
322778
323073
|
gap: 8px;
|
|
322779
323074
|
padding: 8px 8px 8px 0;
|
|
322780
323075
|
background:
|
|
322781
|
-
radial-gradient(circle at 5% 0%, color-mix(in srgb, var(--accent)
|
|
323076
|
+
radial-gradient(circle at 5% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 32%),
|
|
322782
323077
|
linear-gradient(145deg, color-mix(in srgb, var(--canvas-deep) 94%, white), var(--canvas-deep)),
|
|
322783
323078
|
var(--canvas-deep);
|
|
322784
323079
|
transition: grid-template-columns 210ms cubic-bezier(0.2, 0.75, 0.3, 1), gap 210ms ease, padding 210ms ease;
|
|
@@ -322872,14 +323167,9 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
322872
323167
|
|
|
322873
323168
|
.brand-version {
|
|
322874
323169
|
margin-left: auto;
|
|
322875
|
-
padding: 3px 6px;
|
|
322876
323170
|
color: var(--sidebar-muted);
|
|
322877
|
-
|
|
322878
|
-
|
|
322879
|
-
border-radius: 5px;
|
|
322880
|
-
font-family: var(--font-mono);
|
|
322881
|
-
font-size: 9px;
|
|
322882
|
-
letter-spacing: 0.04em;
|
|
323171
|
+
font: 11px var(--font-sans);
|
|
323172
|
+
font-variant-numeric: tabular-nums;
|
|
322883
323173
|
}
|
|
322884
323174
|
|
|
322885
323175
|
.sidebar-collapse-button {
|
|
@@ -322906,74 +323196,35 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
322906
323196
|
}
|
|
322907
323197
|
|
|
322908
323198
|
.new-task-button {
|
|
322909
|
-
height:
|
|
323199
|
+
min-height: 37px;
|
|
322910
323200
|
display: flex;
|
|
322911
323201
|
align-items: center;
|
|
322912
|
-
gap:
|
|
322913
|
-
|
|
322914
|
-
padding: 0 12px;
|
|
323202
|
+
gap: 8px;
|
|
323203
|
+
padding: 0 10px;
|
|
322915
323204
|
color: var(--sidebar-ink);
|
|
322916
|
-
background:
|
|
322917
|
-
border: 1px solid
|
|
322918
|
-
border-radius:
|
|
322919
|
-
|
|
322920
|
-
font-weight: 620;
|
|
323205
|
+
background: var(--sidebar-surface);
|
|
323206
|
+
border: 1px solid var(--sidebar-border);
|
|
323207
|
+
border-radius: 8px;
|
|
323208
|
+
font: 600 13px var(--font-sans);
|
|
322921
323209
|
text-align: left;
|
|
322922
|
-
transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
|
|
322923
|
-
}
|
|
322924
|
-
|
|
322925
|
-
.new-task-button:hover {
|
|
322926
|
-
background: color-mix(in srgb, var(--sidebar-active) 88%, var(--accent) 12%);
|
|
322927
|
-
border-color: color-mix(in srgb, var(--accent) 46%, var(--sidebar-border));
|
|
322928
|
-
box-shadow: 0 10px 26px rgba(3, 13, 10, 0.22);
|
|
322929
|
-
transform: translateY(-1px);
|
|
322930
323210
|
}
|
|
322931
|
-
|
|
323211
|
+
.new-task-button:hover { background: var(--sidebar-active); }
|
|
322932
323212
|
.new-task-button kbd {
|
|
322933
323213
|
margin-left: auto;
|
|
322934
|
-
|
|
322935
|
-
|
|
322936
|
-
background: var(--sidebar-surface);
|
|
322937
|
-
border: 1px solid var(--sidebar-border);
|
|
322938
|
-
border-radius: 5px;
|
|
322939
|
-
font: 9px/1.3 var(--font-mono);
|
|
322940
|
-
}
|
|
322941
|
-
|
|
322942
|
-
.new-task-icon {
|
|
322943
|
-
width: 20px;
|
|
322944
|
-
height: 20px;
|
|
322945
|
-
display: grid;
|
|
322946
|
-
place-items: center;
|
|
322947
|
-
color: #f6fbf9;
|
|
322948
|
-
background: color-mix(in srgb, var(--accent) 86%, white);
|
|
322949
|
-
border-radius: 6px;
|
|
322950
|
-
}
|
|
322951
|
-
|
|
322952
|
-
.new-task-icon .ui-icon {
|
|
322953
|
-
width: 14px;
|
|
322954
|
-
height: 14px;
|
|
323214
|
+
color: var(--sidebar-muted);
|
|
323215
|
+
font: 11px var(--font-sans);
|
|
322955
323216
|
}
|
|
323217
|
+
.new-task-icon { display: grid; place-items: center; color: var(--accent-strong); }
|
|
323218
|
+
.new-task-icon .ui-icon { width: 17px; height: 17px; }
|
|
322956
323219
|
|
|
322957
|
-
.
|
|
322958
|
-
height: 25px;
|
|
323220
|
+
.project-heading {
|
|
322959
323221
|
display: flex;
|
|
322960
323222
|
align-items: center;
|
|
322961
|
-
|
|
322962
|
-
|
|
322963
|
-
|
|
322964
|
-
|
|
322965
|
-
|
|
322966
|
-
text-transform: uppercase;
|
|
322967
|
-
}
|
|
322968
|
-
|
|
322969
|
-
.nav-section-heading i {
|
|
322970
|
-
height: 1px;
|
|
322971
|
-
flex: 1;
|
|
322972
|
-
background: var(--sidebar-border);
|
|
322973
|
-
}
|
|
322974
|
-
|
|
322975
|
-
.project-heading {
|
|
322976
|
-
padding-right: 3px;
|
|
323223
|
+
justify-content: space-between;
|
|
323224
|
+
margin-top: 10px;
|
|
323225
|
+
padding: 0 6px 0 9px;
|
|
323226
|
+
color: var(--sidebar-muted);
|
|
323227
|
+
font: 600 12px/1.4 var(--font-sans);
|
|
322977
323228
|
}
|
|
322978
323229
|
|
|
322979
323230
|
.new-project-button {
|
|
@@ -323058,53 +323309,25 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
323058
323309
|
|
|
323059
323310
|
.project-section {
|
|
323060
323311
|
min-width: 0;
|
|
323061
|
-
min-height:
|
|
323312
|
+
min-height: 0;
|
|
323062
323313
|
display: grid;
|
|
323063
323314
|
grid-template-rows: auto minmax(0, 1fr);
|
|
323064
|
-
flex:
|
|
323315
|
+
flex: 0 1 auto;
|
|
323065
323316
|
overflow: hidden;
|
|
323066
|
-
background: transparent;
|
|
323067
|
-
border: 1px solid transparent;
|
|
323068
|
-
border-radius: 8px;
|
|
323069
323317
|
}
|
|
323070
|
-
|
|
323071
323318
|
.project-section:has(.project-toggle[aria-expanded="false"]) {
|
|
323072
|
-
min-height: 0;
|
|
323073
323319
|
flex: 0 0 auto;
|
|
323074
323320
|
grid-template-rows: auto;
|
|
323075
323321
|
}
|
|
323076
|
-
|
|
323077
|
-
.recent-projects-shell {
|
|
323078
|
-
min-width: 0;
|
|
323079
|
-
min-height: 0;
|
|
323080
|
-
max-height: min(196px, 26dvh);
|
|
323081
|
-
display: grid;
|
|
323082
|
-
grid-template-rows: auto minmax(0, 1fr);
|
|
323083
|
-
flex: 0 1 auto;
|
|
323084
|
-
gap: 3px;
|
|
323085
|
-
margin: 12px 4px 0;
|
|
323086
|
-
padding-top: 10px;
|
|
323087
|
-
border-top: 1px solid var(--sidebar-border);
|
|
323088
|
-
}
|
|
323089
|
-
|
|
323090
|
-
.recent-projects-shell[hidden] {
|
|
323091
|
-
display: none;
|
|
323092
|
-
}
|
|
323093
|
-
|
|
323094
|
-
.project-list-label {
|
|
323095
|
-
padding: 0 6px 3px;
|
|
323096
|
-
color: var(--sidebar-faint);
|
|
323097
|
-
font: 700 9.5px/1.4 var(--font-mono);
|
|
323098
|
-
letter-spacing: 0.11em;
|
|
323099
|
-
text-transform: uppercase;
|
|
323100
|
-
}
|
|
323322
|
+
.recent-projects-shell { min-width: 0; min-height: 0; max-height: min(170px, 24dvh); display: grid; flex: 0 1 auto; }
|
|
323323
|
+
.recent-projects-shell[hidden] { display: none; }
|
|
323101
323324
|
|
|
323102
323325
|
.project-list {
|
|
323103
323326
|
min-width: 0;
|
|
323104
323327
|
min-height: 0;
|
|
323105
323328
|
display: grid;
|
|
323106
323329
|
align-content: start;
|
|
323107
|
-
gap:
|
|
323330
|
+
gap: 1px;
|
|
323108
323331
|
overflow-x: hidden;
|
|
323109
323332
|
overflow-y: auto;
|
|
323110
323333
|
overscroll-behavior: contain;
|
|
@@ -323114,57 +323337,25 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
323114
323337
|
.registered-project {
|
|
323115
323338
|
position: relative;
|
|
323116
323339
|
min-width: 0;
|
|
323117
|
-
width: 100%;
|
|
323118
|
-
min-height: 52px;
|
|
323119
|
-
display: block;
|
|
323120
|
-
padding: 0;
|
|
323121
323340
|
color: var(--sidebar-muted);
|
|
323122
|
-
|
|
323123
|
-
border: 1px solid var(--sidebar-border);
|
|
323124
|
-
border-radius: 12px;
|
|
323125
|
-
text-align: left;
|
|
323126
|
-
transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
|
|
323127
|
-
}
|
|
323128
|
-
|
|
323129
|
-
.registered-project:focus-within,
|
|
323130
|
-
.registered-project:hover {
|
|
323131
|
-
color: var(--sidebar-ink);
|
|
323132
|
-
background: color-mix(in srgb, var(--sidebar-active) 72%, var(--sidebar-surface));
|
|
323133
|
-
border-color: color-mix(in srgb, var(--accent) 24%, var(--sidebar-border));
|
|
323341
|
+
border-radius: 7px;
|
|
323134
323342
|
}
|
|
323135
323343
|
|
|
323136
|
-
.registered-project:focus-within {
|
|
323137
|
-
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 34%, transparent);
|
|
323138
|
-
}
|
|
323344
|
+
.registered-project:hover, .registered-project:focus-within { background: var(--sidebar-surface); color: var(--sidebar-ink); }
|
|
323139
323345
|
|
|
323140
323346
|
.registered-project-open {
|
|
323141
|
-
min-
|
|
323142
|
-
|
|
323143
|
-
|
|
323144
|
-
|
|
323145
|
-
grid-template-columns: 30px minmax(0, 1fr);
|
|
323146
|
-
align-items: center;
|
|
323147
|
-
gap: 9px;
|
|
323148
|
-
padding: 7px 38px 7px 9px;
|
|
323149
|
-
color: inherit;
|
|
323150
|
-
background: transparent;
|
|
323151
|
-
border: 0;
|
|
323152
|
-
border-radius: inherit;
|
|
323153
|
-
text-align: left;
|
|
323154
|
-
}
|
|
323155
|
-
|
|
323156
|
-
.registered-project-open:focus-visible {
|
|
323157
|
-
outline: none;
|
|
323347
|
+
width: 100%; min-height: 34px;
|
|
323348
|
+
display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 8px;
|
|
323349
|
+
padding: 4px 34px 4px 9px;
|
|
323350
|
+
color: inherit; background: transparent; border: 0; border-radius: inherit; text-align: left;
|
|
323158
323351
|
}
|
|
323352
|
+
.registered-project-open:focus-visible { outline-offset: -2px; }
|
|
323159
323353
|
|
|
323160
323354
|
.registered-project-open.is-switching {
|
|
323161
323355
|
cursor: progress;
|
|
323162
323356
|
opacity: 0.58;
|
|
323163
323357
|
}
|
|
323164
323358
|
|
|
323165
|
-
.registered-project-icon.project-folder-icon { width: 30px; height: 30px; }
|
|
323166
|
-
.registered-project-icon .ui-icon { width: 16px; height: 16px; }
|
|
323167
|
-
|
|
323168
323359
|
.registered-project-remove {
|
|
323169
323360
|
position: absolute;
|
|
323170
323361
|
top: 50%;
|
|
@@ -323199,40 +323390,16 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
323199
323390
|
}
|
|
323200
323391
|
|
|
323201
323392
|
.project-toggle {
|
|
323202
|
-
min-width: 0;
|
|
323203
|
-
|
|
323204
|
-
|
|
323205
|
-
|
|
323206
|
-
grid-template-columns: auto minmax(0, 1fr) auto auto;
|
|
323207
|
-
align-items: center;
|
|
323208
|
-
gap: 9px;
|
|
323209
|
-
padding: 7px 9px;
|
|
323210
|
-
color: var(--sidebar-ink);
|
|
323211
|
-
background: transparent;
|
|
323212
|
-
border: 0;
|
|
323213
|
-
text-align: left;
|
|
323214
|
-
transition: background 140ms ease;
|
|
323215
|
-
}
|
|
323216
|
-
|
|
323217
|
-
.project-toggle:hover {
|
|
323218
|
-
background: color-mix(in srgb, var(--sidebar-active) 76%, transparent);
|
|
323219
|
-
}
|
|
323220
|
-
|
|
323221
|
-
.project-folder-icon {
|
|
323222
|
-
width: 30px;
|
|
323223
|
-
height: 30px;
|
|
323224
|
-
display: grid;
|
|
323225
|
-
place-items: center;
|
|
323226
|
-
color: var(--accent-strong);
|
|
323227
|
-
background: color-mix(in srgb, var(--accent-soft) 62%, var(--sidebar-surface));
|
|
323228
|
-
border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--sidebar-border));
|
|
323229
|
-
border-radius: 8px;
|
|
323230
|
-
}
|
|
323231
|
-
|
|
323232
|
-
.project-folder-icon .ui-icon {
|
|
323233
|
-
width: 16px;
|
|
323234
|
-
height: 16px;
|
|
323393
|
+
width: 100%; min-width: 0; min-height: 34px;
|
|
323394
|
+
display: grid; grid-template-columns: 18px minmax(0, 1fr) auto 14px; gap: 8px; align-items: center;
|
|
323395
|
+
padding: 4px 8px 4px 9px; color: var(--sidebar-ink);
|
|
323396
|
+
background: transparent; border: 0; border-radius: 7px; text-align: left;
|
|
323235
323397
|
}
|
|
323398
|
+
.project-toggle:hover { background: var(--sidebar-surface); }
|
|
323399
|
+
.project-toggle:focus-visible { outline-offset: -2px; }
|
|
323400
|
+
.project-folder-icon { display: grid; place-items: center; color: var(--sidebar-muted); }
|
|
323401
|
+
.project-toggle .project-folder-icon { color: var(--accent-strong); }
|
|
323402
|
+
.project-folder-icon .ui-icon { width: 17px; height: 17px; }
|
|
323236
323403
|
|
|
323237
323404
|
.project-copy {
|
|
323238
323405
|
min-width: 0;
|
|
@@ -323259,16 +323426,9 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
323259
323426
|
}
|
|
323260
323427
|
|
|
323261
323428
|
.project-chat-count {
|
|
323262
|
-
|
|
323263
|
-
|
|
323264
|
-
|
|
323265
|
-
place-items: center;
|
|
323266
|
-
padding: 0 5px;
|
|
323267
|
-
color: var(--sidebar-faint);
|
|
323268
|
-
background: var(--sidebar-surface);
|
|
323269
|
-
border: 1px solid var(--sidebar-border);
|
|
323270
|
-
border-radius: 7px;
|
|
323271
|
-
font: 600 10px/1 var(--font-mono);
|
|
323429
|
+
color: var(--sidebar-muted);
|
|
323430
|
+
font: 11px var(--font-sans);
|
|
323431
|
+
font-variant-numeric: tabular-nums;
|
|
323272
323432
|
}
|
|
323273
323433
|
|
|
323274
323434
|
.project-toggle-chevron {
|
|
@@ -323292,12 +323452,13 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
323292
323452
|
.project-chat-body {
|
|
323293
323453
|
min-width: 0;
|
|
323294
323454
|
min-height: 0;
|
|
323295
|
-
|
|
323455
|
+
margin-inline-start: 17px;
|
|
323456
|
+
padding: 0 1px 0 8px;
|
|
323296
323457
|
overflow-x: hidden;
|
|
323297
323458
|
overflow-y: auto;
|
|
323298
323459
|
overscroll-behavior: contain;
|
|
323299
323460
|
scrollbar-gutter: stable;
|
|
323300
|
-
border-
|
|
323461
|
+
border-inline-start: 1px solid var(--sidebar-border);
|
|
323301
323462
|
}
|
|
323302
323463
|
|
|
323303
323464
|
.project-chat-body,
|
|
@@ -323345,7 +323506,7 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
323345
323506
|
display: none;
|
|
323346
323507
|
}
|
|
323347
323508
|
|
|
323348
|
-
/*
|
|
323509
|
+
/* Indicate when more navigation items are outside the viewport. */
|
|
323349
323510
|
.project-list.has-scroll-before,
|
|
323350
323511
|
.project-chat-body.has-scroll-before {
|
|
323351
323512
|
box-shadow: inset 0 9px 13px -13px color-mix(in srgb, var(--accent) 76%, var(--sidebar-ink));
|
|
@@ -323366,7 +323527,7 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
323366
323527
|
.recent-section {
|
|
323367
323528
|
min-height: 0;
|
|
323368
323529
|
display: grid;
|
|
323369
|
-
grid-
|
|
323530
|
+
grid-auto-rows: max-content;
|
|
323370
323531
|
align-content: start;
|
|
323371
323532
|
margin-top: 2px;
|
|
323372
323533
|
}
|
|
@@ -323438,144 +323599,47 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
323438
323599
|
display: none;
|
|
323439
323600
|
}
|
|
323440
323601
|
|
|
323441
|
-
.session-section-heading {
|
|
323442
|
-
padding-right: 2px;
|
|
323443
|
-
}
|
|
323444
|
-
|
|
323445
323602
|
.archive-toggle {
|
|
323446
|
-
|
|
323447
|
-
height:
|
|
323448
|
-
|
|
323449
|
-
|
|
323450
|
-
|
|
323451
|
-
|
|
323452
|
-
|
|
323453
|
-
|
|
323454
|
-
|
|
323455
|
-
|
|
323456
|
-
border-radius: 7px;
|
|
323457
|
-
font: 600 10px/1 var(--font-mono);
|
|
323458
|
-
}
|
|
323459
|
-
|
|
323460
|
-
.archive-toggle:hover,
|
|
323461
|
-
.archive-toggle[aria-expanded="true"] {
|
|
323462
|
-
color: var(--sidebar-ink);
|
|
323463
|
-
background: var(--sidebar-surface);
|
|
323464
|
-
border-color: var(--sidebar-border);
|
|
323465
|
-
}
|
|
323466
|
-
|
|
323467
|
-
.archive-toggle b {
|
|
323468
|
-
min-width: 8px;
|
|
323469
|
-
font: inherit;
|
|
323470
|
-
}
|
|
323471
|
-
|
|
323472
|
-
.archive-toggle .ui-icon {
|
|
323473
|
-
width: 13px;
|
|
323474
|
-
height: 13px;
|
|
323475
|
-
}
|
|
323476
|
-
|
|
323477
|
-
.archive-toggle:not(.has-items) b {
|
|
323478
|
-
color: var(--sidebar-faint);
|
|
323479
|
-
}
|
|
323480
|
-
|
|
323481
|
-
.recent-sessions,
|
|
323482
|
-
.archived-sessions {
|
|
323483
|
-
min-height: 0;
|
|
323484
|
-
display: grid;
|
|
323485
|
-
gap: 2px;
|
|
323486
|
-
overflow: visible;
|
|
323487
|
-
padding: 2px;
|
|
323488
|
-
}
|
|
323489
|
-
|
|
323603
|
+
justify-self: start;
|
|
323604
|
+
display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 2px 7px;
|
|
323605
|
+
color: var(--sidebar-muted); background: transparent; border: 0; border-radius: 5px;
|
|
323606
|
+
font: 11px var(--font-sans);
|
|
323607
|
+
}
|
|
323608
|
+
.archive-toggle b { font-weight: 500; font-variant-numeric: tabular-nums; }
|
|
323609
|
+
.archive-toggle .ui-icon { width: 13px; height: 13px; }
|
|
323610
|
+
.archive-toggle:hover, .archive-toggle[aria-expanded="true"] { color: var(--sidebar-ink); background: var(--sidebar-surface); }
|
|
323611
|
+
.archive-toggle[hidden] { display: none; }
|
|
323612
|
+
.recent-sessions, .archived-sessions { min-width: 0; display: grid; gap: 2px; padding: 2px 0; }
|
|
323490
323613
|
.session-row {
|
|
323491
|
-
position: relative;
|
|
323492
323614
|
min-width: 0;
|
|
323493
|
-
display:
|
|
323494
|
-
|
|
323495
|
-
align-items: center;
|
|
323496
|
-
border: 1px solid transparent;
|
|
323497
|
-
border-radius: 9px;
|
|
323498
|
-
transition: background 140ms ease, border-color 140ms ease;
|
|
323499
|
-
}
|
|
323500
|
-
|
|
323501
|
-
.session-row:hover,
|
|
323502
|
-
.session-row:focus-within {
|
|
323503
|
-
background: color-mix(in srgb, var(--sidebar-surface) 78%, transparent);
|
|
323504
|
-
border-color: var(--sidebar-border);
|
|
323505
|
-
}
|
|
323506
|
-
|
|
323507
|
-
.session-row.is-active {
|
|
323508
|
-
background: color-mix(in srgb, var(--accent) 24%, transparent);
|
|
323509
|
-
border-color: color-mix(in srgb, var(--accent) 44%, var(--sidebar-border));
|
|
323510
|
-
}
|
|
323511
|
-
|
|
323512
|
-
.session-row.is-active .recent-session {
|
|
323513
|
-
color: var(--sidebar-ink);
|
|
323514
|
-
cursor: default;
|
|
323615
|
+
position: relative; display: flex; align-items: center;
|
|
323616
|
+
border-radius: 6px;
|
|
323515
323617
|
}
|
|
323516
|
-
|
|
323517
|
-
.session-row.is-active
|
|
323518
|
-
|
|
323519
|
-
height:
|
|
323520
|
-
|
|
323521
|
-
box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
|
|
323618
|
+
.session-row:hover, .session-row:focus-within { background: var(--sidebar-surface); }
|
|
323619
|
+
.session-row.is-active { color: var(--accent-strong); background: var(--accent-soft); }
|
|
323620
|
+
.session-row.is-active::before {
|
|
323621
|
+
content: ""; position: absolute; inset-inline-start: 0; width: 2px; height: 13px;
|
|
323622
|
+
border-radius: 2px; background: var(--accent); pointer-events: none;
|
|
323522
323623
|
}
|
|
323523
|
-
|
|
323624
|
+
.session-row.is-active .recent-session { color: inherit; font-weight: 620; cursor: default; }
|
|
323524
323625
|
.recent-session {
|
|
323525
|
-
|
|
323526
|
-
|
|
323527
|
-
|
|
323528
|
-
|
|
323529
|
-
gap: 6px;
|
|
323530
|
-
padding: 9px 12px 9px 18px;
|
|
323531
|
-
color: var(--sidebar-muted);
|
|
323532
|
-
background: transparent;
|
|
323533
|
-
border: 0;
|
|
323534
|
-
border-radius: 9px;
|
|
323535
|
-
text-align: left;
|
|
323536
|
-
transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
|
|
323626
|
+
min-width: 0; flex: 1; min-height: 33px;
|
|
323627
|
+
display: flex; align-items: center; gap: 6px; padding: 4px 7px 4px 10px;
|
|
323628
|
+
color: var(--sidebar-ink); background: transparent; border: 0; border-radius: inherit;
|
|
323629
|
+
text-align: left; font: 400 13px/1.35 var(--font-sans);
|
|
323537
323630
|
}
|
|
323538
|
-
|
|
323539
|
-
.recent-session::before {
|
|
323540
|
-
content: "";
|
|
323541
|
-
position: absolute;
|
|
323542
|
-
width: 5px;
|
|
323543
|
-
height: 5px;
|
|
323544
|
-
top: 16px;
|
|
323545
|
-
left: 7px;
|
|
323546
|
-
background: var(--sidebar-faint);
|
|
323547
|
-
border-radius: 50%;
|
|
323548
|
-
}
|
|
323549
|
-
|
|
323550
|
-
.recent-session:hover {
|
|
323551
|
-
color: var(--sidebar-ink);
|
|
323552
|
-
}
|
|
323553
|
-
|
|
323631
|
+
.recent-session:focus-visible { outline-offset: -2px; }
|
|
323554
323632
|
.session-actions {
|
|
323555
|
-
|
|
323556
|
-
|
|
323557
|
-
bottom: 4px;
|
|
323558
|
-
display: flex;
|
|
323559
|
-
align-items: center;
|
|
323560
|
-
gap: 1px;
|
|
323561
|
-
opacity: 0;
|
|
323562
|
-
pointer-events: none;
|
|
323563
|
-
transition: opacity 120ms ease;
|
|
323564
|
-
}
|
|
323565
|
-
|
|
323566
|
-
.session-row:hover .session-actions,
|
|
323567
|
-
.session-row:focus-within .session-actions {
|
|
323568
|
-
opacity: 1;
|
|
323569
|
-
pointer-events: auto;
|
|
323570
|
-
}
|
|
323571
|
-
|
|
323572
|
-
.session-row:has(.session-actions) .recent-session-meta {
|
|
323573
|
-
padding-right: 58px;
|
|
323633
|
+
flex: 0 0 0; width: 0; overflow: hidden;
|
|
323634
|
+
display: flex; align-items: center; gap: 1px; opacity: 0; pointer-events: none;
|
|
323574
323635
|
}
|
|
323636
|
+
.session-row:is(:hover, :focus-within) .session-actions { width: auto; flex-basis: auto; opacity: 1; pointer-events: auto; }
|
|
323637
|
+
.session-row:has(.session-actions):is(:hover, :focus-within) .recent-session-meta { display: none; }
|
|
323575
323638
|
|
|
323576
323639
|
.session-action {
|
|
323577
|
-
width:
|
|
323578
|
-
height:
|
|
323640
|
+
width: 26px;
|
|
323641
|
+
height: 28px;
|
|
323642
|
+
flex-shrink: 0;
|
|
323579
323643
|
display: grid;
|
|
323580
323644
|
place-items: center;
|
|
323581
323645
|
padding: 0;
|
|
@@ -323619,17 +323683,8 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
323619
323683
|
display: none;
|
|
323620
323684
|
}
|
|
323621
323685
|
|
|
323622
|
-
.archived-panel-title {
|
|
323623
|
-
padding: 0 8px 2px;
|
|
323624
|
-
color: var(--sidebar-faint);
|
|
323625
|
-
font: 700 10px/1.2 var(--font-mono);
|
|
323626
|
-
letter-spacing: 0.11em;
|
|
323627
|
-
text-transform: uppercase;
|
|
323628
|
-
}
|
|
323629
323686
|
|
|
323630
|
-
|
|
323631
|
-
overflow: visible;
|
|
323632
|
-
}
|
|
323687
|
+
|
|
323633
323688
|
|
|
323634
323689
|
.session-list-empty {
|
|
323635
323690
|
margin: 0;
|
|
@@ -323649,15 +323704,12 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
323649
323704
|
white-space: nowrap;
|
|
323650
323705
|
}
|
|
323651
323706
|
|
|
323652
|
-
.recent-session-title {
|
|
323653
|
-
color: inherit;
|
|
323654
|
-
font-size: 12px;
|
|
323655
|
-
font-weight: 590;
|
|
323656
|
-
}
|
|
323657
|
-
|
|
323707
|
+
.recent-session-title { flex: 1; min-width: 0; }
|
|
323658
323708
|
.recent-session-meta {
|
|
323709
|
+
flex: none;
|
|
323659
323710
|
color: var(--sidebar-muted);
|
|
323660
|
-
font:
|
|
323711
|
+
font: 11px/1.35 var(--font-sans);
|
|
323712
|
+
font-variant-numeric: tabular-nums;
|
|
323661
323713
|
}
|
|
323662
323714
|
|
|
323663
323715
|
.recent-session:disabled,
|
|
@@ -323678,7 +323730,7 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
323678
323730
|
|
|
323679
323731
|
.sidebar-spacer {
|
|
323680
323732
|
min-height: 4px;
|
|
323681
|
-
flex:
|
|
323733
|
+
flex: 1 0 4px;
|
|
323682
323734
|
}
|
|
323683
323735
|
|
|
323684
323736
|
.sidebar-footer { flex-shrink: 0; display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid var(--sidebar-border); }
|
|
@@ -323805,6 +323857,20 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
323805
323857
|
line-height: 1.22;
|
|
323806
323858
|
}
|
|
323807
323859
|
|
|
323860
|
+
.workspace-location { position: relative; width: fit-content; max-width: 100%; }
|
|
323861
|
+
.workspace-location summary { display: flex; align-items: center; gap: 4px; min-height: 18px; cursor: pointer; list-style: none; }
|
|
323862
|
+
.workspace-location summary::-webkit-details-marker { display: none; }
|
|
323863
|
+
.workspace-location .ui-icon { width: 10px; height: 10px; color: var(--faint); }
|
|
323864
|
+
.workspace-location[open] .ui-icon { transform: rotate(180deg); }
|
|
323865
|
+
.workspace-location-detail {
|
|
323866
|
+
position: absolute; z-index: 2; inset: calc(100% + 5px) auto auto 0;
|
|
323867
|
+
width: max-content; max-width: min(380px, 74vw); padding: 10px 12px;
|
|
323868
|
+
display: grid; gap: 5px; color: var(--ink);
|
|
323869
|
+
background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: 9px; box-shadow: var(--shadow-md);
|
|
323870
|
+
}
|
|
323871
|
+
.workspace-heading .workspace-location-detail strong { font-size: 11px; color: var(--muted); }
|
|
323872
|
+
.workspace-location-detail code { font: 12px/1.5 var(--font-mono); overflow-wrap: anywhere; user-select: all; }
|
|
323873
|
+
|
|
323808
323874
|
.workspace-heading strong,
|
|
323809
323875
|
.workspace-heading span {
|
|
323810
323876
|
max-width: min(32vw, 430px);
|
|
@@ -323822,7 +323888,7 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
323822
323888
|
|
|
323823
323889
|
.workspace-heading span {
|
|
323824
323890
|
color: var(--faint);
|
|
323825
|
-
font:
|
|
323891
|
+
font: 500 11px/1.3 var(--font-sans);
|
|
323826
323892
|
}
|
|
323827
323893
|
|
|
323828
323894
|
.icon-button,
|
|
@@ -323991,9 +324057,7 @@ var WEB_UI_WORKBENCH_STYLES = String.raw`
|
|
|
323991
324057
|
.workbench .inspector-content { padding-inline: 20px; padding-top: 12px; }
|
|
323992
324058
|
.workbench .task-overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
323993
324059
|
.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
324060
|
.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
324061
|
.workspace-view.is-preview-open:not(.is-preview-focus) .empty-composer-slot { margin-top: 14px; }
|
|
323998
324062
|
.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
324063
|
.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; }
|
|
@@ -326933,38 +326997,6 @@ async function handleSessionCommand(subcommand, argument, dependencies) {
|
|
|
326933
326997
|
}
|
|
326934
326998
|
}
|
|
326935
326999
|
|
|
326936
|
-
// src/runtime/SessionTitles.ts
|
|
326937
|
-
var DEFAULT_SESSION_TITLES = /* @__PURE__ */ new Set(["", "New Orbit Session"]);
|
|
326938
|
-
var MAX_TITLE_CHARACTERS = 64;
|
|
326939
|
-
var MAX_LATIN_WORDS = 8;
|
|
326940
|
-
function deriveSessionTitle(prompt) {
|
|
326941
|
-
const firstMeaningfulLine = prompt.split(/\r?\n/).map((line) => line.trim()).find(Boolean);
|
|
326942
|
-
if (!firstMeaningfulLine) return "Untitled task";
|
|
326943
|
-
const safe = redactSecrets(firstMeaningfulLine).replace(/^#{1,6}\s*/, "").replace(/^[-*+>]\s*/, "").replace(/[\u0000-\u001f\u007f]/g, " ").replace(/\s+/g, " ").trim();
|
|
326944
|
-
if (!safe) return "Untitled task";
|
|
326945
|
-
const clause = safe.split(/[。!?!?;;]|\s+[—–-]\s+/u, 1)[0]?.trim() || safe;
|
|
326946
|
-
const hasCjk = /[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u.test(
|
|
326947
|
-
clause
|
|
326948
|
-
);
|
|
326949
|
-
const compact2 = hasCjk ? Array.from(clause).slice(0, 30).join("") : clause.split(/\s+/).slice(0, MAX_LATIN_WORDS).join(" ");
|
|
326950
|
-
const bounded = Array.from(compact2).slice(0, MAX_TITLE_CHARACTERS).join("").replace(/[\s,.:;!?,。!?;:]+$/u, "").trim();
|
|
326951
|
-
return bounded || "Untitled task";
|
|
326952
|
-
}
|
|
326953
|
-
function ensureSessionTitle(loop, prompt) {
|
|
326954
|
-
try {
|
|
326955
|
-
const activeSession = loop.sessionManager?.getActiveSession();
|
|
326956
|
-
if (!activeSession || !DEFAULT_SESSION_TITLES.has(activeSession.title.trim())) {
|
|
326957
|
-
return void 0;
|
|
326958
|
-
}
|
|
326959
|
-
const title = deriveSessionTitle(prompt);
|
|
326960
|
-
activeSession.title = title;
|
|
326961
|
-
loop.sessionManager.getSessionStore().updateSession(activeSession);
|
|
326962
|
-
return title;
|
|
326963
|
-
} catch {
|
|
326964
|
-
return void 0;
|
|
326965
|
-
}
|
|
326966
|
-
}
|
|
326967
|
-
|
|
326968
327000
|
// src/runtime/ModelDiscovery.ts
|
|
326969
327001
|
import { z as z75 } from "zod";
|
|
326970
327002
|
var ModelEntrySchema = z75.object({
|