@orbit-build/cli 3.0.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -288008,6 +288008,7 @@ var WebApprovalRequestedEventSchema = z47.object({
|
|
|
288008
288008
|
var WebApprovalResolvedEventSchema = z47.object({
|
|
288009
288009
|
type: z47.literal("web_approval_resolved"),
|
|
288010
288010
|
payload: z47.object({
|
|
288011
|
+
kind: z47.enum(["tool", "change", "action"]).optional(),
|
|
288011
288012
|
approvalId: z47.string(),
|
|
288012
288013
|
approved: z47.boolean()
|
|
288013
288014
|
})
|
|
@@ -291307,6 +291308,7 @@ var EDIT_FILE_MAX_BYTES = 16 * 1024 * 1024;
|
|
|
291307
291308
|
var HUNK_REVIEW_MAX_CHARS = 256 * 1024;
|
|
291308
291309
|
async function reviewEditTransaction(options) {
|
|
291309
291310
|
const { filePath, before, checkpoint, interaction } = options;
|
|
291311
|
+
const local = (en, zh, tw) => options.language === "zh-TW" ? tw : options.language === "zh" ? zh : en;
|
|
291310
291312
|
let after;
|
|
291311
291313
|
try {
|
|
291312
291314
|
const content = readBoundedRegularFile(
|
|
@@ -291348,7 +291350,13 @@ async function reviewEditTransaction(options) {
|
|
|
291348
291350
|
error: `${reason} Rollback failed: ${restored.error ?? "unknown error"}`
|
|
291349
291351
|
};
|
|
291350
291352
|
options.checkpoints.removeCheckpoint(checkpoint.id);
|
|
291351
|
-
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
|
+
);
|
|
291352
291360
|
return {
|
|
291353
291361
|
ok: false,
|
|
291354
291362
|
error: `${reason} Edits to ${filePath} rejected and rolled back.`
|
|
@@ -291368,11 +291376,18 @@ async function reviewEditTransaction(options) {
|
|
|
291368
291376
|
after,
|
|
291369
291377
|
agentId: options.agent?.id,
|
|
291370
291378
|
agentRole: options.agent?.role
|
|
291371
|
-
}) ? "yes" : "no" : await interaction.prompt?.askSelect(
|
|
291372
|
-
|
|
291373
|
-
|
|
291374
|
-
|
|
291375
|
-
|
|
291379
|
+
}) ? "yes" : "no" : await interaction.prompt?.askSelect(
|
|
291380
|
+
local(
|
|
291381
|
+
`Keep the edit to ${filePath}?`,
|
|
291382
|
+
`\u4FDD\u7559\u5BF9 ${filePath} \u7684\u6539\u52A8\uFF1F`,
|
|
291383
|
+
`\u4FDD\u7559\u5C0D ${filePath} \u7684\u8B8A\u66F4\uFF1F`
|
|
291384
|
+
),
|
|
291385
|
+
[
|
|
291386
|
+
{ value: "yes", label: local("Keep change", "\u4FDD\u7559\u6539\u52A8", "\u4FDD\u7559\u8B8A\u66F4") },
|
|
291387
|
+
{ value: "hunks", label: local("Review individual hunks", "\u9010\u6BB5\u5BA1\u67E5", "\u9010\u6BB5\u5BE9\u67E5") },
|
|
291388
|
+
{ value: "no", label: local("Revert this change", "\u56DE\u9000\u672C\u6B21\u6539\u52A8", "\u9084\u539F\u672C\u6B21\u8B8A\u66F4") }
|
|
291389
|
+
]
|
|
291390
|
+
);
|
|
291376
291391
|
if (!unchanged())
|
|
291377
291392
|
return {
|
|
291378
291393
|
ok: false,
|
|
@@ -291387,21 +291402,31 @@ async function reviewEditTransaction(options) {
|
|
|
291387
291402
|
const lines = before === null ? [] : before.split("\n");
|
|
291388
291403
|
const hunks = buildHunks(lines, after.split("\n"));
|
|
291389
291404
|
if (hunks.length === 0) return { ok: true };
|
|
291390
|
-
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
|
+
);
|
|
291391
291412
|
for (let index = 0; index < hunks.length; index++) {
|
|
291392
291413
|
const hunk = hunks[index];
|
|
291393
291414
|
await interaction.showDiff(
|
|
291394
|
-
`${filePath} \xB7 Hunk
|
|
291415
|
+
`${filePath} \xB7 ${local("Hunk #", "\u6539\u52A8 ", "\u8B8A\u66F4 ")}${index + 1}/${hunks.length}`,
|
|
291395
291416
|
hunk.before.join("\n"),
|
|
291396
291417
|
hunk.after.join("\n")
|
|
291397
291418
|
);
|
|
291398
291419
|
}
|
|
291399
291420
|
const selected = await interaction.prompt?.askMultiSelect(
|
|
291400
|
-
|
|
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
|
+
),
|
|
291401
291426
|
hunks.map((hunk, index) => ({
|
|
291402
291427
|
value: String(index),
|
|
291403
|
-
label: `
|
|
291404
|
-
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}`
|
|
291405
291430
|
}))
|
|
291406
291431
|
);
|
|
291407
291432
|
if (!selected?.length) return reject("No changes were selected.");
|
|
@@ -291429,7 +291454,14 @@ async function reviewEditTransaction(options) {
|
|
|
291429
291454
|
});
|
|
291430
291455
|
if (!result.success)
|
|
291431
291456
|
return reject(`Hunk merge failed: ${result.error ?? "unknown error"}.`);
|
|
291432
|
-
|
|
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
|
+
);
|
|
291433
291465
|
return { ok: true };
|
|
291434
291466
|
} catch (error) {
|
|
291435
291467
|
return reject(`Edit review failed: ${safeAgentLoopErrorMessage(error)}.`);
|
|
@@ -293677,6 +293709,7 @@ ${buildCommitContextForModel(stdout2)}`
|
|
|
293677
293709
|
}
|
|
293678
293710
|
if (finalResult.ok && targetPath && absoluteTargetPath && isFileMutationTool(tc.name)) {
|
|
293679
293711
|
const review = await reviewEditTransaction({
|
|
293712
|
+
language: this.config.language,
|
|
293680
293713
|
cwd: this.cwd,
|
|
293681
293714
|
filePath: targetPath,
|
|
293682
293715
|
absolutePath: absoluteTargetPath,
|
|
@@ -293880,9 +293913,9 @@ ${guardNudge.message}` : ""),
|
|
|
293880
293913
|
this.interaction.showText(
|
|
293881
293914
|
` Modified files: ${modifiedFiles.length > 0 ? modifiedFiles.join(", ") : "None"}`
|
|
293882
293915
|
);
|
|
293883
|
-
const
|
|
293916
|
+
const verificationSummary2 = this.verificationSummary();
|
|
293884
293917
|
this.interaction.showText(
|
|
293885
|
-
` Verification contract: ${
|
|
293918
|
+
` Verification contract: ${verificationSummary2}.`
|
|
293886
293919
|
);
|
|
293887
293920
|
this.interaction.showText(` Session Cost: ${this.formatSessionCost()}`);
|
|
293888
293921
|
if (!this.terminalFailure && !iterationLimitReached && this.config.autoCommit && modifiedFiles.length > 0) {
|
|
@@ -305641,27 +305674,30 @@ var FullscreenTui = class {
|
|
|
305641
305674
|
if (this.keymapMode === "vim") {
|
|
305642
305675
|
statusText = morandi2.accent(getVimModeLabel(this.vimMode, languageIsZh)) + morandi2.gray(" \xB7 ") + statusText;
|
|
305643
305676
|
}
|
|
305677
|
+
const language = this.config?.language ?? "zh";
|
|
305678
|
+
const queueHint = localizeOrbit(language, " Queue", " \u52A0\u5165\u961F\u5217", " \u52A0\u5165\u4F47\u5217");
|
|
305679
|
+
const interruptHint = this.isThinking ? localizeOrbit(language, " Stop run", " \u505C\u6B62\u6267\u884C", " \u505C\u6B62\u57F7\u884C") : localizeOrbit(language, " Cancel", " \u53D6\u6D88", " \u53D6\u6D88");
|
|
305644
305680
|
let keybindings = this.historyScrollOffset > 0 ? morandi2.gray("[End]") + morandi2.dim(languageIsZh ? " \u8FD4\u56DE\u5E95\u90E8" : " Bottom") : columns >= 88 ? [
|
|
305645
305681
|
...this.isThinking ? [
|
|
305646
|
-
morandi2.gray("[Enter]") + morandi2.dim(
|
|
305682
|
+
morandi2.gray("[Enter]") + morandi2.dim(queueHint)
|
|
305647
305683
|
] : [],
|
|
305648
|
-
morandi2.gray("[^C]") + morandi2.dim(
|
|
305684
|
+
morandi2.gray("[^C]") + morandi2.dim(interruptHint),
|
|
305649
305685
|
morandi2.gray("[^J]") + morandi2.dim(languageIsZh ? " \u6362\u884C" : " Newline"),
|
|
305650
305686
|
morandi2.gray("[^R]") + morandi2.dim(languageIsZh ? " \u5386\u53F2" : " History"),
|
|
305651
305687
|
morandi2.gray("[^L]") + morandi2.dim(languageIsZh ? " \u6E05\u5C4F" : " Clear"),
|
|
305652
305688
|
morandi2.gray("[^P]") + morandi2.dim(languageIsZh ? " \u547D\u4EE4" : " Cmds")
|
|
305653
305689
|
].join(" ") : columns >= 62 ? [
|
|
305654
305690
|
...this.isThinking ? [
|
|
305655
|
-
morandi2.gray("[\u21B5]") + morandi2.dim(
|
|
305691
|
+
morandi2.gray("[\u21B5]") + morandi2.dim(queueHint)
|
|
305656
305692
|
] : [],
|
|
305657
|
-
morandi2.gray("[^C]") + morandi2.dim(
|
|
305693
|
+
morandi2.gray("[^C]") + morandi2.dim(interruptHint),
|
|
305658
305694
|
morandi2.gray("[^P]") + morandi2.dim(languageIsZh ? " \u547D\u4EE4" : " Cmds")
|
|
305659
305695
|
].join(" ") : morandi2.gray("[^C]") + morandi2.dim(languageIsZh ? " \u9000\u51FA" : " Exit");
|
|
305660
305696
|
let statusTextLength = this.getStringWidth(statusText);
|
|
305661
305697
|
let keybindingsLength = this.getStringWidth(keybindings);
|
|
305662
305698
|
if (statusTextLength + keybindingsLength > columns - 8) {
|
|
305663
305699
|
keybindings = [
|
|
305664
|
-
morandi2.gray("[^C]") + morandi2.dim(
|
|
305700
|
+
morandi2.gray("[^C]") + morandi2.dim(interruptHint),
|
|
305665
305701
|
morandi2.gray("[^P]") + morandi2.dim(languageIsZh ? " \u547D\u4EE4" : " Cmds")
|
|
305666
305702
|
].join(" ");
|
|
305667
305703
|
keybindingsLength = this.getStringWidth(keybindings);
|
|
@@ -306542,12 +306578,159 @@ async function getAutocompleteCandidates(cwd, config, mcpPromptCommands = []) {
|
|
|
306542
306578
|
};
|
|
306543
306579
|
}
|
|
306544
306580
|
|
|
306581
|
+
// src/runtime/webui/WebUiNavigationRows.ts
|
|
306582
|
+
function projectPathKey(path10) {
|
|
306583
|
+
return /^(?:[A-Za-z]:|\\\\)/.test(path10) ? path10.replace(/\\/g, "/").toLowerCase() : path10;
|
|
306584
|
+
}
|
|
306585
|
+
function createNavigationRows() {
|
|
306586
|
+
const signatures = /* @__PURE__ */ new WeakMap();
|
|
306587
|
+
return function reconcile(container, items, id, content, render) {
|
|
306588
|
+
const old = Array.from(container.children);
|
|
306589
|
+
const byId = new Map(old.map((row) => [row.dataset.navigationId, row]));
|
|
306590
|
+
const focused = container.contains(document.activeElement) ? document.activeElement : null;
|
|
306591
|
+
const focusedRow = focused?.closest("[data-navigation-id]");
|
|
306592
|
+
const action = focused?.dataset.sessionAction || focused?.dataset.projectAction;
|
|
306593
|
+
for (const [index, item] of items.entries()) {
|
|
306594
|
+
const key = id(item);
|
|
306595
|
+
const signature = JSON.stringify(content(item));
|
|
306596
|
+
let row = byId.get(key);
|
|
306597
|
+
if (!row || signatures.get(row) !== signature) {
|
|
306598
|
+
const updated = render(item);
|
|
306599
|
+
updated.dataset.navigationId = key;
|
|
306600
|
+
signatures.set(updated, signature);
|
|
306601
|
+
row?.replaceWith(updated);
|
|
306602
|
+
row = updated;
|
|
306603
|
+
}
|
|
306604
|
+
if (container.children[index] !== row)
|
|
306605
|
+
container.insertBefore(row, container.children[index] ?? null);
|
|
306606
|
+
byId.delete(key);
|
|
306607
|
+
}
|
|
306608
|
+
for (const row of byId.values()) row.remove();
|
|
306609
|
+
if (!focusedRow || !focused || document.activeElement === focused) return;
|
|
306610
|
+
const rows = Array.from(container.children);
|
|
306611
|
+
const target = rows.find((row) => row.dataset.navigationId === focusedRow.dataset.navigationId) ?? rows[Math.min(old.indexOf(focusedRow), rows.length - 1)];
|
|
306612
|
+
const buttons = target?.querySelectorAll("button:not(:disabled)");
|
|
306613
|
+
const equivalent = Array.from(buttons ?? []).find(
|
|
306614
|
+
(button) => (button.dataset.sessionAction || button.dataset.projectAction) === action
|
|
306615
|
+
);
|
|
306616
|
+
(equivalent ?? buttons?.[0])?.focus({ preventScroll: true });
|
|
306617
|
+
};
|
|
306618
|
+
}
|
|
306619
|
+
function bindWorkspaceLocation(location) {
|
|
306620
|
+
const closeOutside = (event) => {
|
|
306621
|
+
if (location.open && event.target instanceof Node && !location.contains(event.target)) {
|
|
306622
|
+
location.open = false;
|
|
306623
|
+
}
|
|
306624
|
+
};
|
|
306625
|
+
document.addEventListener("pointerdown", closeOutside);
|
|
306626
|
+
document.addEventListener("focusin", closeOutside);
|
|
306627
|
+
location.addEventListener("keydown", (event) => {
|
|
306628
|
+
if (event.key !== "Escape" || event.isComposing || event.keyCode === 229 || !location.open)
|
|
306629
|
+
return;
|
|
306630
|
+
event.preventDefault();
|
|
306631
|
+
location.open = false;
|
|
306632
|
+
location.querySelector("summary")?.focus();
|
|
306633
|
+
});
|
|
306634
|
+
}
|
|
306635
|
+
|
|
306636
|
+
// src/runtime/webui/WebUiClientDrafts.ts
|
|
306637
|
+
function createConversationDrafts(storage) {
|
|
306638
|
+
const legacy = "orbit.webui.draft";
|
|
306639
|
+
const fallback = /* @__PURE__ */ new Map();
|
|
306640
|
+
let active = null;
|
|
306641
|
+
function key(workspace, session) {
|
|
306642
|
+
return legacy + "." + JSON.stringify([workspace, session]);
|
|
306643
|
+
}
|
|
306644
|
+
function read(scope) {
|
|
306645
|
+
if (fallback.has(scope)) return fallback.get(scope);
|
|
306646
|
+
try {
|
|
306647
|
+
return storage().getItem(scope) || "";
|
|
306648
|
+
} catch {
|
|
306649
|
+
return "";
|
|
306650
|
+
}
|
|
306651
|
+
}
|
|
306652
|
+
function write(scope, value) {
|
|
306653
|
+
try {
|
|
306654
|
+
if (value) storage().setItem(scope, value);
|
|
306655
|
+
else storage().removeItem(scope);
|
|
306656
|
+
fallback.delete(scope);
|
|
306657
|
+
} catch {
|
|
306658
|
+
fallback.set(scope, value);
|
|
306659
|
+
}
|
|
306660
|
+
}
|
|
306661
|
+
return {
|
|
306662
|
+
get active() {
|
|
306663
|
+
return active;
|
|
306664
|
+
},
|
|
306665
|
+
key,
|
|
306666
|
+
read,
|
|
306667
|
+
write,
|
|
306668
|
+
save(value) {
|
|
306669
|
+
if (active !== null) write(active, value);
|
|
306670
|
+
},
|
|
306671
|
+
recover(scope, original, currentInput) {
|
|
306672
|
+
const current = active === scope ? currentInput : read(scope);
|
|
306673
|
+
const recovered = current && current !== original ? original + "\n\n" + current : original;
|
|
306674
|
+
write(scope, recovered);
|
|
306675
|
+
return active === scope ? recovered : void 0;
|
|
306676
|
+
},
|
|
306677
|
+
activate(workspace, session, input) {
|
|
306678
|
+
const next = key(workspace, session);
|
|
306679
|
+
if (active === next) return;
|
|
306680
|
+
const first = active === null;
|
|
306681
|
+
active = next;
|
|
306682
|
+
const saved = read(next);
|
|
306683
|
+
const old = first ? read(legacy) : "";
|
|
306684
|
+
const value = first ? [...new Set([saved, old, input].filter(Boolean))].join("\n\n") : saved;
|
|
306685
|
+
if (first && (input || old)) {
|
|
306686
|
+
write(next, value);
|
|
306687
|
+
if (!fallback.has(next)) write(legacy, "");
|
|
306688
|
+
}
|
|
306689
|
+
return value;
|
|
306690
|
+
}
|
|
306691
|
+
};
|
|
306692
|
+
}
|
|
306693
|
+
var WEB_UI_CLIENT_DRAFTS_SCRIPT = String.raw` const drafts = (${createConversationDrafts.toString()})(() => localStorage);
|
|
306694
|
+
let draftRevision = 0;
|
|
306695
|
+
function activateComposerDraft(workspace, session) {
|
|
306696
|
+
const previousScope = drafts.active;
|
|
306697
|
+
const value = drafts.activate(workspace, session, elements.prompt.value);
|
|
306698
|
+
if (value !== undefined) {
|
|
306699
|
+
elements.prompt.dataset.orbitDraftTarget = String(++draftRevision);
|
|
306700
|
+
switchAttachmentDraft(previousScope, drafts.active);
|
|
306701
|
+
elements.prompt.value = value;
|
|
306702
|
+
autoSizePrompt();
|
|
306703
|
+
updateSendButtonState();
|
|
306704
|
+
closeSlashCommands();
|
|
306705
|
+
if (value && previousScope === null) showToast(copy.draftRestored);
|
|
306706
|
+
}
|
|
306707
|
+
}
|
|
306708
|
+
`;
|
|
306709
|
+
|
|
306545
306710
|
// src/runtime/webui/WebUiClientBindings.ts
|
|
306546
306711
|
var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListener('submit', (event) => {
|
|
306547
306712
|
event.preventDefault();
|
|
306548
306713
|
if (state.busy) stopTurn();
|
|
306549
306714
|
else submitTurn(elements.prompt.value);
|
|
306550
306715
|
});
|
|
306716
|
+
function focusPendingApproval() {
|
|
306717
|
+
if (!state.pendingApproval) return;
|
|
306718
|
+
showConversation();
|
|
306719
|
+
elements.approvalPanel.focus({ preventScroll: true });
|
|
306720
|
+
elements.approvalPanel.scrollIntoView({ block: 'nearest' });
|
|
306721
|
+
}
|
|
306722
|
+
elements.jumpApproval.addEventListener('click', focusPendingApproval);
|
|
306723
|
+
elements.approvalDiffButton.addEventListener('click', () => {
|
|
306724
|
+
setWorkbench('changes', false);
|
|
306725
|
+
byId('approvalDiffTitle').focus();
|
|
306726
|
+
byId('approvalDiffDetail').scrollIntoView({ block: 'nearest' });
|
|
306727
|
+
});
|
|
306728
|
+
byId('returnToApproval').addEventListener('click', () => {
|
|
306729
|
+
setWorkbench(null, false);
|
|
306730
|
+
focusPendingApproval();
|
|
306731
|
+
});
|
|
306732
|
+
byId('browserPreviewButton').addEventListener('click', () => closeContextPicker({ skipRestore: true }));
|
|
306733
|
+
elements.steerButton.addEventListener('click', () => void queuePrompt(elements.prompt.value, 'steer'));
|
|
306551
306734
|
elements.denyApprovalButton.addEventListener('click', () => void respondToApproval(false));
|
|
306552
306735
|
elements.approveApprovalButton.addEventListener('click', () => void respondToApproval(true));
|
|
306553
306736
|
elements.buildPlanButton.addEventListener('click', () => void startTaskAction(elements.buildPlanButton));
|
|
@@ -306555,7 +306738,7 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
|
|
|
306555
306738
|
|
|
306556
306739
|
elements.prompt.addEventListener('input', () => {
|
|
306557
306740
|
autoSizePrompt();
|
|
306558
|
-
|
|
306741
|
+
drafts.save(elements.prompt.value);
|
|
306559
306742
|
updateSendButtonState();
|
|
306560
306743
|
slashCommandSelection = 0;
|
|
306561
306744
|
renderSlashCommands();
|
|
@@ -306732,13 +306915,17 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
|
|
|
306732
306915
|
elements.inspectorButton.addEventListener('click', () => {
|
|
306733
306916
|
setInspector(!elements.inspector.classList.contains('is-open'), 'settings');
|
|
306734
306917
|
});
|
|
306735
|
-
elements.tasksButton.addEventListener('click',
|
|
306736
|
-
setInspector(elements.tasksButton.getAttribute('aria-expanded') !== 'true', 'tasks');
|
|
306737
|
-
closeSidebar();
|
|
306738
|
-
});
|
|
306918
|
+
elements.tasksButton.addEventListener('click', toggleTaskDetails);
|
|
306739
306919
|
elements.changesButton.addEventListener('click', () => {
|
|
306740
|
-
|
|
306741
|
-
|
|
306920
|
+
setWorkbench('changes', false);
|
|
306921
|
+
const first = elements.changesList.querySelector('summary');
|
|
306922
|
+
if (first) { first.parentElement.open = true; first.focus(); }
|
|
306923
|
+
else elements.changeFilter.focus();
|
|
306924
|
+
});
|
|
306925
|
+
byId('verificationResultButton').addEventListener('click', () => {
|
|
306926
|
+
setWorkbench('changes', false);
|
|
306927
|
+
const result = elements.verificationList.querySelector('.is-error') || elements.verificationList.firstElementChild;
|
|
306928
|
+
if (result) { result.tabIndex = -1; result.focus(); }
|
|
306742
306929
|
});
|
|
306743
306930
|
elements.contextMeter.addEventListener('click', () => setInspector(true, 'activity'));
|
|
306744
306931
|
elements.inspectorClose.addEventListener('click', () => setInspector(false));
|
|
@@ -307715,15 +307902,19 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
|
|
|
307715
307902
|
closeCommandPalette();
|
|
307716
307903
|
return;
|
|
307717
307904
|
}
|
|
307718
|
-
setInspector(false);
|
|
307719
|
-
closeSidebar();
|
|
307905
|
+
if (elements.inspector.classList.contains('is-open')) setInspector(false);
|
|
307906
|
+
else if (elements.appShell.classList.contains('sidebar-open')) closeSidebar();
|
|
307907
|
+
else if (!byId('workbench').hidden) {
|
|
307908
|
+
event.preventDefault();
|
|
307909
|
+
setWorkbench(null, byId('workbench').contains(document.activeElement));
|
|
307910
|
+
}
|
|
307720
307911
|
}
|
|
307721
|
-
if ((event.ctrlKey || event.metaKey) && ['k', 'p'].includes(event.key.toLowerCase())) {
|
|
307912
|
+
if ((event.ctrlKey || event.metaKey && event.key.toLowerCase() === 'k') && ['k', 'p'].includes(event.key.toLowerCase())) {
|
|
307722
307913
|
event.preventDefault();
|
|
307723
307914
|
if (elements.commandPalette.hidden) openCommandPalette();
|
|
307724
307915
|
else closeCommandPalette();
|
|
307725
307916
|
}
|
|
307726
|
-
if (
|
|
307917
|
+
if (event.ctrlKey && event.key.toLowerCase() === 'n') {
|
|
307727
307918
|
event.preventDefault();
|
|
307728
307919
|
if (!state.busy) void updateSession({ action: 'new' });
|
|
307729
307920
|
}
|
|
@@ -307761,17 +307952,10 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
|
|
|
307761
307952
|
);
|
|
307762
307953
|
setProjectExpanded(readLocalStorage('orbit.webui.project', 'expanded') !== 'collapsed');
|
|
307763
307954
|
syncSidebarInteractivity();
|
|
307764
|
-
const draft = readLocalStorage('orbit.webui.draft', '');
|
|
307765
|
-
if (draft) {
|
|
307766
|
-
elements.prompt.value = draft;
|
|
307767
|
-
autoSizePrompt();
|
|
307768
|
-
updateSendButtonState();
|
|
307769
|
-
}
|
|
307770
307955
|
try {
|
|
307771
307956
|
await bootstrapSession();
|
|
307772
307957
|
await Promise.all([renderMessages({ forceBottom: true }), loadStatus(), loadSlashCommands()]);
|
|
307773
307958
|
connectEvents();
|
|
307774
|
-
if (draft) showToast(copy.draftRestored);
|
|
307775
307959
|
// Do not steal focus from an interaction that started while the initial
|
|
307776
307960
|
// bootstrap was still settling (for example, editing a queued prompt).
|
|
307777
307961
|
// The composer is the default target only while the document remains
|
|
@@ -308465,13 +308649,16 @@ function createApprovalController(runtime) {
|
|
|
308465
308649
|
api,
|
|
308466
308650
|
showToast,
|
|
308467
308651
|
reconcileStatus,
|
|
308468
|
-
revealApproval
|
|
308652
|
+
revealApproval,
|
|
308653
|
+
placePreview
|
|
308469
308654
|
} = runtime;
|
|
308470
308655
|
function renderPendingApproval(approval) {
|
|
308471
308656
|
const newRequest = Boolean(
|
|
308472
308657
|
approval?.id && approval.id !== state.pendingApproval?.id
|
|
308473
308658
|
);
|
|
308659
|
+
const changedPreview = newRequest || state.pendingApproval?.preview !== approval?.preview;
|
|
308474
308660
|
state.pendingApproval = approval?.id ? approval : null;
|
|
308661
|
+
placePreview(state.pendingApproval);
|
|
308475
308662
|
const visible = Boolean(state.pendingApproval);
|
|
308476
308663
|
elements.approvalPanel.hidden = !visible;
|
|
308477
308664
|
if (!state.pendingApproval) {
|
|
@@ -308479,9 +308666,13 @@ function createApprovalController(runtime) {
|
|
|
308479
308666
|
elements.approvalReason.textContent = "";
|
|
308480
308667
|
elements.approvalPreview.textContent = "";
|
|
308481
308668
|
elements.approvalPreview.hidden = true;
|
|
308482
|
-
state.approvalSubmitting =
|
|
308669
|
+
state.approvalSubmitting = null;
|
|
308483
308670
|
return;
|
|
308484
308671
|
}
|
|
308672
|
+
if (newRequest) state.approvalSubmitting = null;
|
|
308673
|
+
const change = state.pendingApproval.kind === "change";
|
|
308674
|
+
elements.approveApprovalButton.textContent = change ? copy.keepChange : copy.allowOnce;
|
|
308675
|
+
elements.denyApprovalButton.textContent = change ? copy.revertChange : copy.denyOnce;
|
|
308485
308676
|
elements.approvalTitle.textContent = state.pendingApproval.title || copy.approvalRequired;
|
|
308486
308677
|
const approvalOwner = state.pendingApproval.agentRole || state.pendingApproval.agentId || "";
|
|
308487
308678
|
elements.approvalReason.textContent = [
|
|
@@ -308489,8 +308680,8 @@ function createApprovalController(runtime) {
|
|
|
308489
308680
|
state.pendingApproval.reason || ""
|
|
308490
308681
|
].filter(Boolean).join(" \xB7 ");
|
|
308491
308682
|
const preview = String(state.pendingApproval.preview || "");
|
|
308492
|
-
elements.approvalPreview.replaceChildren();
|
|
308493
|
-
if (preview) {
|
|
308683
|
+
if (changedPreview) elements.approvalPreview.replaceChildren();
|
|
308684
|
+
if (changedPreview && preview) {
|
|
308494
308685
|
for (const line of preview.split("\n")) {
|
|
308495
308686
|
const row = document.createElement("span");
|
|
308496
308687
|
row.className = "approval-preview-line";
|
|
@@ -308506,14 +308697,14 @@ function createApprovalController(runtime) {
|
|
|
308506
308697
|
}
|
|
308507
308698
|
}
|
|
308508
308699
|
elements.approvalPreview.hidden = !preview;
|
|
308509
|
-
elements.denyApprovalButton.disabled = state.approvalSubmitting;
|
|
308510
|
-
elements.approveApprovalButton.disabled = state.approvalSubmitting;
|
|
308700
|
+
elements.denyApprovalButton.disabled = !state.ready || Boolean(state.sessionChanging || state.approvalSubmitting);
|
|
308701
|
+
elements.approveApprovalButton.disabled = !state.ready || Boolean(state.sessionChanging || state.approvalSubmitting);
|
|
308511
308702
|
if (newRequest) revealApproval();
|
|
308512
308703
|
}
|
|
308513
308704
|
async function respondToApproval(approved) {
|
|
308514
308705
|
const approval = state.pendingApproval;
|
|
308515
|
-
if (!approval || state.approvalSubmitting) return;
|
|
308516
|
-
state.approvalSubmitting =
|
|
308706
|
+
if (!approval || !state.ready || state.sessionChanging || state.approvalSubmitting) return;
|
|
308707
|
+
state.approvalSubmitting = approval.id;
|
|
308517
308708
|
renderPendingApproval(approval);
|
|
308518
308709
|
try {
|
|
308519
308710
|
await api("/api/approval", {
|
|
@@ -308522,14 +308713,16 @@ function createApprovalController(runtime) {
|
|
|
308522
308713
|
body: JSON.stringify({ id: approval.id, approved: Boolean(approved) })
|
|
308523
308714
|
});
|
|
308524
308715
|
showToast(
|
|
308525
|
-
approved ? copy.approvalApproved : copy.approvalDenied,
|
|
308716
|
+
approval.kind === "change" ? copy.reviewSent : approved ? copy.approvalApproved : copy.approvalDenied,
|
|
308526
308717
|
approved ? "success" : "warning"
|
|
308527
308718
|
);
|
|
308528
|
-
renderPendingApproval(null);
|
|
308719
|
+
if (state.pendingApproval?.id === approval.id) renderPendingApproval(null);
|
|
308529
308720
|
void reconcileStatus();
|
|
308530
308721
|
} catch (error) {
|
|
308531
|
-
state.
|
|
308532
|
-
|
|
308722
|
+
if (state.pendingApproval?.id === approval.id) {
|
|
308723
|
+
state.approvalSubmitting = null;
|
|
308724
|
+
renderPendingApproval(approval);
|
|
308725
|
+
}
|
|
308533
308726
|
showToast(
|
|
308534
308727
|
error instanceof Error ? error.message : String(error),
|
|
308535
308728
|
"error"
|
|
@@ -308539,10 +308732,18 @@ function createApprovalController(runtime) {
|
|
|
308539
308732
|
return { renderPendingApproval, respondToApproval };
|
|
308540
308733
|
}
|
|
308541
308734
|
var WEB_UI_CLIENT_APPROVAL_SCRIPT = ` const { renderPendingApproval, respondToApproval } = (${createApprovalController.toString()})({ copy, elements, state, api, showToast, reconcileStatus, revealApproval: () => {
|
|
308542
|
-
|
|
308543
|
-
|
|
308544
|
-
|
|
308545
|
-
|
|
308735
|
+
if (state.stickToBottom && !elements.conversation.inert) scrollToBottom(false);
|
|
308736
|
+
}, placePreview: (approval) => {
|
|
308737
|
+
const isChange = approval?.kind === 'change';
|
|
308738
|
+
const hasDiff = Boolean(isChange && approval.preview);
|
|
308739
|
+
const slot = hasDiff ? byId('approvalDiffSlot') : byId('approvalInlinePreview');
|
|
308740
|
+
if (elements.approvalPreview.parentNode !== slot) slot.append(elements.approvalPreview);
|
|
308741
|
+
elements.approvalDiffButton.hidden = !hasDiff;
|
|
308742
|
+
byId('approvalDiffDetail').hidden = !hasDiff;
|
|
308743
|
+
byId('approvalDiffTitle').textContent = hasDiff ? approval.title : '';
|
|
308744
|
+
const label = isChange ? copy.fileReview : copy.approvalRequired;
|
|
308745
|
+
if (elements.approvalEyebrow.textContent !== label) elements.approvalEyebrow.textContent = label;
|
|
308746
|
+
elements.jumpApproval.hidden = !approval;
|
|
308546
308747
|
} });
|
|
308547
308748
|
|
|
308548
308749
|
`;
|
|
@@ -308550,6 +308751,33 @@ var WEB_UI_CLIENT_APPROVAL_SCRIPT = ` const { renderPendingApproval, respondToA
|
|
|
308550
308751
|
// src/runtime/webui/WebUiClientAttachments.ts
|
|
308551
308752
|
function createAttachmentController(runtime) {
|
|
308552
308753
|
const { copy, elements, state, api, showToast, updateSendButtonState } = runtime;
|
|
308754
|
+
const inactive = /* @__PURE__ */ new Map();
|
|
308755
|
+
const uploads = /* @__PURE__ */ new WeakMap();
|
|
308756
|
+
const discarded = /* @__PURE__ */ new WeakSet();
|
|
308757
|
+
function switchAttachmentDraft(previous, next) {
|
|
308758
|
+
if (previous === null) return;
|
|
308759
|
+
if (state.attachments.length || uploads.get(state.attachments)) {
|
|
308760
|
+
inactive.set(previous, state.attachments);
|
|
308761
|
+
}
|
|
308762
|
+
state.attachments = inactive.get(next) ?? [];
|
|
308763
|
+
inactive.delete(next);
|
|
308764
|
+
renderAttachments();
|
|
308765
|
+
}
|
|
308766
|
+
function releaseUpload(id) {
|
|
308767
|
+
void api(`/api/attachment?id=${encodeURIComponent(id)}`, { method: "DELETE" }).catch(() => {
|
|
308768
|
+
});
|
|
308769
|
+
}
|
|
308770
|
+
function discardAttachmentDraft(key) {
|
|
308771
|
+
const group = inactive.get(key);
|
|
308772
|
+
if (!group) return;
|
|
308773
|
+
inactive.delete(key);
|
|
308774
|
+
discarded.add(group);
|
|
308775
|
+
for (const attachment of group) {
|
|
308776
|
+
URL.revokeObjectURL(attachment.previewUrl);
|
|
308777
|
+
releaseUpload(attachment.id);
|
|
308778
|
+
}
|
|
308779
|
+
group.length = 0;
|
|
308780
|
+
}
|
|
308553
308781
|
function renderAttachments() {
|
|
308554
308782
|
elements.attachmentList.replaceChildren();
|
|
308555
308783
|
elements.attachmentShelf.hidden = state.attachments.length === 0;
|
|
@@ -308583,18 +308811,20 @@ function createAttachmentController(runtime) {
|
|
|
308583
308811
|
}
|
|
308584
308812
|
updateSendButtonState();
|
|
308585
308813
|
}
|
|
308586
|
-
async function uploadAttachment(file) {
|
|
308814
|
+
async function uploadAttachment(file, group = state.attachments) {
|
|
308815
|
+
if (discarded.has(group)) return;
|
|
308587
308816
|
if (!file || !["image/png", "image/jpeg", "image/gif", "image/webp"].includes(
|
|
308588
308817
|
file.type
|
|
308589
308818
|
)) {
|
|
308590
308819
|
showToast(copy.attachmentLimit, "warning");
|
|
308591
308820
|
return;
|
|
308592
308821
|
}
|
|
308593
|
-
if (file.size <= 0 || file.size > 5 * 1024 * 1024 ||
|
|
308822
|
+
if (file.size <= 0 || file.size > 5 * 1024 * 1024 || group.length + (uploads.get(group) ?? 0) >= 4) {
|
|
308594
308823
|
showToast(copy.attachmentLimit, "warning");
|
|
308595
308824
|
return;
|
|
308596
308825
|
}
|
|
308597
|
-
|
|
308826
|
+
uploads.set(group, (uploads.get(group) ?? 0) + 1);
|
|
308827
|
+
if (group === state.attachments) elements.attachmentButton.disabled = true;
|
|
308598
308828
|
try {
|
|
308599
308829
|
const result = await api(
|
|
308600
308830
|
`/api/attachment?name=${encodeURIComponent(file.name || "image")}`,
|
|
@@ -308605,39 +308835,48 @@ function createAttachmentController(runtime) {
|
|
|
308605
308835
|
}
|
|
308606
308836
|
);
|
|
308607
308837
|
const attachment = result.attachment || {};
|
|
308608
|
-
|
|
308838
|
+
if (discarded.has(group)) {
|
|
308839
|
+
if (attachment.id) releaseUpload(attachment.id);
|
|
308840
|
+
return;
|
|
308841
|
+
}
|
|
308842
|
+
group.push({
|
|
308609
308843
|
id: String(attachment.id || ""),
|
|
308610
308844
|
name: attachment.name || file.name || "image",
|
|
308611
308845
|
mediaType: attachment.mediaType || file.type,
|
|
308612
308846
|
size: Number(attachment.size || file.size),
|
|
308613
308847
|
previewUrl: URL.createObjectURL(file)
|
|
308614
308848
|
});
|
|
308615
|
-
|
|
308616
|
-
|
|
308849
|
+
if (group === state.attachments) {
|
|
308850
|
+
renderAttachments();
|
|
308851
|
+
showToast(copy.attachmentAdded, "success");
|
|
308852
|
+
}
|
|
308617
308853
|
} catch (error) {
|
|
308618
308854
|
showToast(
|
|
308619
308855
|
error instanceof Error ? error.message : String(error),
|
|
308620
308856
|
"error"
|
|
308621
308857
|
);
|
|
308622
308858
|
} finally {
|
|
308623
|
-
|
|
308859
|
+
uploads.set(group, (uploads.get(group) ?? 1) - 1);
|
|
308860
|
+
elements.attachmentButton.disabled = state.attachments.length + (uploads.get(state.attachments) ?? 0) >= 4;
|
|
308624
308861
|
elements.attachmentInput.value = "";
|
|
308625
308862
|
}
|
|
308626
308863
|
}
|
|
308627
308864
|
async function addAttachmentFiles(files) {
|
|
308865
|
+
const group = state.attachments;
|
|
308628
308866
|
for (const file of Array.from(files || []).slice(
|
|
308629
308867
|
0,
|
|
308630
|
-
4 -
|
|
308868
|
+
4 - group.length
|
|
308631
308869
|
)) {
|
|
308632
|
-
await uploadAttachment(file);
|
|
308870
|
+
await uploadAttachment(file, group);
|
|
308633
308871
|
}
|
|
308634
308872
|
}
|
|
308635
308873
|
async function removeAttachment(id, notify) {
|
|
308636
|
-
const
|
|
308874
|
+
const group = state.attachments;
|
|
308875
|
+
const index = group.findIndex(
|
|
308637
308876
|
(attachment2) => attachment2.id === id
|
|
308638
308877
|
);
|
|
308639
308878
|
if (index === -1) return;
|
|
308640
|
-
const attachment =
|
|
308879
|
+
const attachment = group[index];
|
|
308641
308880
|
const removeButton = elements.attachmentList.querySelector(
|
|
308642
308881
|
`[data-attachment-remove="${CSS.escape(id)}"]`
|
|
308643
308882
|
);
|
|
@@ -308646,13 +308885,13 @@ function createAttachmentController(runtime) {
|
|
|
308646
308885
|
await api(`/api/attachment?id=${encodeURIComponent(id)}`, {
|
|
308647
308886
|
method: "DELETE"
|
|
308648
308887
|
});
|
|
308649
|
-
const currentIndex =
|
|
308888
|
+
const currentIndex = group.findIndex(
|
|
308650
308889
|
(item) => item.id === id
|
|
308651
308890
|
);
|
|
308652
|
-
if (currentIndex !== -1)
|
|
308891
|
+
if (currentIndex !== -1) group.splice(currentIndex, 1);
|
|
308653
308892
|
if (attachment.previewUrl) URL.revokeObjectURL(attachment.previewUrl);
|
|
308654
308893
|
renderAttachments();
|
|
308655
|
-
if (notify) showToast(copy.attachmentRemoved);
|
|
308894
|
+
if (notify && group === state.attachments) showToast(copy.attachmentRemoved);
|
|
308656
308895
|
} catch (error) {
|
|
308657
308896
|
if (removeButton) removeButton.disabled = false;
|
|
308658
308897
|
showToast(
|
|
@@ -308661,19 +308900,18 @@ function createAttachmentController(runtime) {
|
|
|
308661
308900
|
);
|
|
308662
308901
|
}
|
|
308663
308902
|
}
|
|
308664
|
-
function consumeAttachments(ids2) {
|
|
308903
|
+
function consumeAttachments(ids2, group = state.attachments) {
|
|
308665
308904
|
const consumed = new Set(ids2 || []);
|
|
308666
|
-
for (const attachment of
|
|
308667
|
-
if (consumed.has(attachment.id)
|
|
308668
|
-
|
|
308669
|
-
|
|
308905
|
+
for (const attachment of group.slice()) {
|
|
308906
|
+
if (!consumed.has(attachment.id)) continue;
|
|
308907
|
+
URL.revokeObjectURL(attachment.previewUrl);
|
|
308908
|
+
group.splice(group.indexOf(attachment), 1);
|
|
308670
308909
|
}
|
|
308671
|
-
state.attachments = state.attachments.filter(
|
|
308672
|
-
(attachment) => !consumed.has(attachment.id)
|
|
308673
|
-
);
|
|
308674
308910
|
renderAttachments();
|
|
308675
308911
|
}
|
|
308676
308912
|
return {
|
|
308913
|
+
switchAttachmentDraft,
|
|
308914
|
+
discardAttachmentDraft,
|
|
308677
308915
|
renderAttachments,
|
|
308678
308916
|
uploadAttachment,
|
|
308679
308917
|
addAttachmentFiles,
|
|
@@ -308681,7 +308919,7 @@ function createAttachmentController(runtime) {
|
|
|
308681
308919
|
consumeAttachments
|
|
308682
308920
|
};
|
|
308683
308921
|
}
|
|
308684
|
-
var WEB_UI_CLIENT_ATTACHMENTS_SCRIPT = ` const { renderAttachments, uploadAttachment, addAttachmentFiles, removeAttachment, consumeAttachments } = (${createAttachmentController.toString()})({ copy, elements, state, api, showToast, updateSendButtonState });
|
|
308922
|
+
var WEB_UI_CLIENT_ATTACHMENTS_SCRIPT = ` const { switchAttachmentDraft, discardAttachmentDraft, renderAttachments, uploadAttachment, addAttachmentFiles, removeAttachment, consumeAttachments } = (${createAttachmentController.toString()})({ copy, elements, state, api, showToast, updateSendButtonState });
|
|
308685
308923
|
|
|
308686
308924
|
`;
|
|
308687
308925
|
|
|
@@ -309085,7 +309323,7 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309085
309323
|
cancelling: '正在取消',
|
|
309086
309324
|
thinking: 'Orbit 正在思考…',
|
|
309087
309325
|
sendAction: '发送消息',
|
|
309088
|
-
stopAction: '
|
|
309326
|
+
stopAction: chinese('停止执行', '停止執行'),
|
|
309089
309327
|
stopping: '正在停止…',
|
|
309090
309328
|
stopped: '已停止生成',
|
|
309091
309329
|
working: '正在处理任务…',
|
|
@@ -309110,6 +309348,13 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309110
309348
|
settingsSaved: '设置已更新',
|
|
309111
309349
|
settingsSaving: '正在应用设置…',
|
|
309112
309350
|
nothingRunning: '当前没有正在运行的任务。',
|
|
309351
|
+
keepChange: chinese('保留改动', '保留變更'),
|
|
309352
|
+
revertChange: chinese('回退本次改动', '還原本次變更'),
|
|
309353
|
+
fileReview: chinese('文件已修改,等待审查', '檔案已修改,等待審查'),
|
|
309354
|
+
reviewClosed: chinese('本次文件审查已结束', '本次檔案審查已結束'),
|
|
309355
|
+
reviewSent: chinese('已提交审查决定', '已提交審查決定'),
|
|
309356
|
+
allowOnce: chinese('允许这次操作', '允許這次操作'),
|
|
309357
|
+
denyOnce: chinese('拒绝', '拒絕'),
|
|
309113
309358
|
approvalRequired: '等待你的确认',
|
|
309114
309359
|
approvalApproved: '已允许操作',
|
|
309115
309360
|
approvalDenied: '已拒绝操作',
|
|
@@ -309220,7 +309465,7 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309220
309465
|
collapseNavigation: '收起导航',
|
|
309221
309466
|
modeStrict: '严格',
|
|
309222
309467
|
modeNormal: '标准',
|
|
309223
|
-
modeAuto: '
|
|
309468
|
+
modeAuto: '完整访问',
|
|
309224
309469
|
modePlan: '规划',
|
|
309225
309470
|
permissionFullAccess: chinese('完整权限已开启:所有已启用工具操作均自动批准。', '完整權限已開啟:所有已啟用工具操作均自動批准。'),
|
|
309226
309471
|
permissionAutoLimited: chinese('全自动尚未完全生效,部分操作仍需确认。', '全自動尚未完全生效,部分操作仍需確認。'),
|
|
@@ -309241,7 +309486,7 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309241
309486
|
cancelling: 'Cancelling',
|
|
309242
309487
|
thinking: 'Orbit is thinking…',
|
|
309243
309488
|
sendAction: 'Send message',
|
|
309244
|
-
stopAction: 'Stop
|
|
309489
|
+
stopAction: 'Stop run',
|
|
309245
309490
|
stopping: 'Stopping…',
|
|
309246
309491
|
stopped: 'Generation stopped',
|
|
309247
309492
|
working: 'Working on your task…',
|
|
@@ -309266,6 +309511,13 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309266
309511
|
settingsSaved: 'Settings updated',
|
|
309267
309512
|
settingsSaving: 'Applying settings…',
|
|
309268
309513
|
nothingRunning: 'Nothing is currently running.',
|
|
309514
|
+
keepChange: 'Keep change',
|
|
309515
|
+
revertChange: 'Revert this change',
|
|
309516
|
+
fileReview: 'File edited · review required',
|
|
309517
|
+
reviewClosed: 'File review closed',
|
|
309518
|
+
reviewSent: 'Review decision submitted',
|
|
309519
|
+
allowOnce: 'Allow this action',
|
|
309520
|
+
denyOnce: 'Deny',
|
|
309269
309521
|
approvalRequired: 'Waiting for your approval',
|
|
309270
309522
|
approvalApproved: 'Action approved',
|
|
309271
309523
|
approvalDenied: 'Action denied',
|
|
@@ -309452,7 +309704,7 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309452
309704
|
collapseNavigation: '收合導覽',
|
|
309453
309705
|
modeStrict: '嚴格',
|
|
309454
309706
|
modeNormal: '標準',
|
|
309455
|
-
modeAuto: '
|
|
309707
|
+
modeAuto: '完整取用',
|
|
309456
309708
|
modePlan: '規劃',
|
|
309457
309709
|
recentSession: '最近工作階段',
|
|
309458
309710
|
useWorkflow: '使用工作流程',
|
|
@@ -309607,6 +309859,7 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309607
309859
|
promptQueue: byId('promptQueue'),
|
|
309608
309860
|
promptQueueList: byId('promptQueueList'),
|
|
309609
309861
|
clearQueueButton: byId('clearQueueButton'),
|
|
309862
|
+
steerButton: byId('steerButton'),
|
|
309610
309863
|
queueButton: byId('queueButton'),
|
|
309611
309864
|
contextPicker: byId('contextPicker'),
|
|
309612
309865
|
contextPickerClose: byId('contextPickerClose'),
|
|
@@ -309616,6 +309869,9 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309616
309869
|
sendButton: byId('sendButton'),
|
|
309617
309870
|
sendGlyph: byId('sendGlyph'),
|
|
309618
309871
|
turnStatus: byId('turnStatus'),
|
|
309872
|
+
jumpApproval: byId('jumpApproval'),
|
|
309873
|
+
approvalDiffButton: byId('approvalDiffButton'),
|
|
309874
|
+
approvalEyebrow: byId('approvalEyebrow'),
|
|
309619
309875
|
approvalPanel: byId('approvalPanel'),
|
|
309620
309876
|
approvalTitle: byId('approvalTitle'),
|
|
309621
309877
|
approvalReason: byId('approvalReason'),
|
|
@@ -309747,7 +310003,9 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309747
310003
|
externalTurn: false,
|
|
309748
310004
|
useBearerTransport: false,
|
|
309749
310005
|
pendingApproval: null,
|
|
309750
|
-
approvalSubmitting:
|
|
310006
|
+
approvalSubmitting: null,
|
|
310007
|
+
statusEpoch: 0,
|
|
310008
|
+
statusRequest: 0,
|
|
309751
310009
|
pendingSessionDeleteId: null,
|
|
309752
310010
|
sessionData: null,
|
|
309753
310011
|
sessionQuery: '',
|
|
@@ -309760,6 +310018,8 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309760
310018
|
projectLaunchPending: false,
|
|
309761
310019
|
promptQueue: [],
|
|
309762
310020
|
queueEditingId: null,
|
|
310021
|
+
queueSubmitting: false,
|
|
310022
|
+
sessionChanging: false,
|
|
309763
310023
|
queueEditDraft: '',
|
|
309764
310024
|
agentSteeringId: null,
|
|
309765
310025
|
agentSteeringDraft: '',
|
|
@@ -310029,6 +310289,10 @@ ${WEB_UI_CLIENT_TRANSPORT_SCRIPT}
|
|
|
310029
310289
|
updateMessageNavigation();
|
|
310030
310290
|
}
|
|
310031
310291
|
|
|
310292
|
+
const appleKeyboard = /Mac|iPhone|iPad/i.test(navigator.platform);
|
|
310293
|
+
function controlShortcut(key) { return (appleKeyboard ? '⌃ ' : 'Ctrl ') + key; }
|
|
310294
|
+
document.querySelectorAll('[data-control-key]').forEach(key => { key.textContent = controlShortcut(key.dataset.controlKey); });
|
|
310295
|
+
|
|
310032
310296
|
function setBusy(busy, label) {
|
|
310033
310297
|
state.busy = busy;
|
|
310034
310298
|
elements.appShell.classList.toggle('is-busy', busy);
|
|
@@ -310054,7 +310318,11 @@ ${WEB_UI_CLIENT_TRANSPORT_SCRIPT}
|
|
|
310054
310318
|
));
|
|
310055
310319
|
syncCustomModelAction();
|
|
310056
310320
|
elements.turnStatus.classList.toggle('is-working', busy);
|
|
310057
|
-
|
|
310321
|
+
const hint = byId('composerHint');
|
|
310322
|
+
const keys = busy ? hint.dataset.running.replace('{steer}', appleKeyboard ? '⌘↩' : 'Ctrl+Enter') : hint.dataset.idle;
|
|
310323
|
+
if (hint.textContent !== keys) hint.textContent = keys;
|
|
310324
|
+
const statusLabel = label || (busy ? copy.thinking : '');
|
|
310325
|
+
if (elements.turnStatus.textContent !== statusLabel) elements.turnStatus.textContent = statusLabel;
|
|
310058
310326
|
updateSendButtonState();
|
|
310059
310327
|
renderPromptQueue();
|
|
310060
310328
|
}
|
|
@@ -310069,18 +310337,24 @@ ${WEB_UI_CLIENT_TRANSPORT_SCRIPT}
|
|
|
310069
310337
|
}
|
|
310070
310338
|
|
|
310071
310339
|
function updateSendButtonState() {
|
|
310340
|
+
const ready = state.ready && !state.sessionChanging;
|
|
310341
|
+
elements.prompt.setAttribute('aria-busy', String(!ready));
|
|
310072
310342
|
const hasPrompt = Boolean(elements.prompt.value.trim());
|
|
310073
|
-
elements.
|
|
310074
|
-
elements.
|
|
310343
|
+
elements.contextPickerButton.disabled = state.busy || !ready;
|
|
310344
|
+
elements.buildPlanButton.disabled = state.busy || !ready;
|
|
310345
|
+
elements.parallelImproveButton.disabled = state.busy || !ready;
|
|
310075
310346
|
elements.queueButton.hidden = !state.busy;
|
|
310076
|
-
elements.queueButton.disabled = !hasPrompt || state.stopping;
|
|
310347
|
+
elements.queueButton.disabled = !ready || !hasPrompt || state.stopping || state.queueSubmitting || state.promptQueue.length >= 12;
|
|
310348
|
+
elements.steerButton.hidden = !state.busy || !hasPrompt;
|
|
310349
|
+
elements.steerButton.disabled = elements.queueButton.disabled;
|
|
310350
|
+
elements.denyApprovalButton.disabled = elements.approveApprovalButton.disabled = !ready || Boolean(state.approvalSubmitting);
|
|
310077
310351
|
elements.sendButton.disabled = state.busy
|
|
310078
|
-
? state.stopping
|
|
310079
|
-
: !
|
|
310352
|
+
? !ready || state.stopping
|
|
310353
|
+
: !ready || !hasPrompt;
|
|
310080
310354
|
}
|
|
310081
310355
|
|
|
310082
310356
|
function setEmptyState() {
|
|
310083
|
-
const hasMessages = elements.messages.childElementCount > 0;
|
|
310357
|
+
const hasMessages = elements.messages.childElementCount > 0 || Boolean(state.pendingApproval);
|
|
310084
310358
|
elements.emptyState.hidden = hasMessages;
|
|
310085
310359
|
elements.conversation.classList.toggle('has-messages', hasMessages);
|
|
310086
310360
|
const target = hasMessages ? elements.composerAnchor : elements.emptyComposerSlot;
|
|
@@ -310477,7 +310751,7 @@ function createWorkbenchController(runtime) {
|
|
|
310477
310751
|
get("changesButton"),
|
|
310478
310752
|
get("tasksButton")
|
|
310479
310753
|
];
|
|
310480
|
-
let active = "
|
|
310754
|
+
let active = "run";
|
|
310481
310755
|
let preferred = runtime.readWidth();
|
|
310482
310756
|
let focused = false;
|
|
310483
310757
|
let returnFocus = null;
|
|
@@ -310533,6 +310807,7 @@ function createWorkbenchController(runtime) {
|
|
|
310533
310807
|
String(Boolean(tab) && selected)
|
|
310534
310808
|
);
|
|
310535
310809
|
}
|
|
310810
|
+
get("tasksButton").setAttribute("aria-expanded", String(Boolean(tab)));
|
|
310536
310811
|
if (tab) runtime.closeSidebar();
|
|
310537
310812
|
resize();
|
|
310538
310813
|
workbench.dispatchEvent(
|
|
@@ -310541,7 +310816,7 @@ function createWorkbenchController(runtime) {
|
|
|
310541
310816
|
if (moveFocus && tab)
|
|
310542
310817
|
buttons[tabs.indexOf(tab)].focus();
|
|
310543
310818
|
if (!tab && !wasHidden && moveFocus) {
|
|
310544
|
-
const target = returnFocus?.isConnected && !returnFocus.closest("[inert], [hidden]") ? returnFocus :
|
|
310819
|
+
const target = returnFocus?.isConnected && !returnFocus.closest("[inert], [hidden]") ? returnFocus : get("tasksButton");
|
|
310545
310820
|
target.focus();
|
|
310546
310821
|
returnFocus = null;
|
|
310547
310822
|
}
|
|
@@ -310571,7 +310846,7 @@ function createWorkbenchController(runtime) {
|
|
|
310571
310846
|
() => setWorkbench(!workbench.hidden && active === "browser" ? null : "browser")
|
|
310572
310847
|
);
|
|
310573
310848
|
hide.addEventListener("click", () => {
|
|
310574
|
-
const returnToDraft = conversation.inert;
|
|
310849
|
+
const returnToDraft = conversation.inert && !returnFocus?.closest("#approvalPanel, #reviewResults");
|
|
310575
310850
|
setWorkbench(null, !returnToDraft);
|
|
310576
310851
|
if (returnToDraft) get("prompt").focus();
|
|
310577
310852
|
});
|
|
@@ -310615,6 +310890,9 @@ function createWorkbenchController(runtime) {
|
|
|
310615
310890
|
window.addEventListener("beforeunload", () => observer.disconnect());
|
|
310616
310891
|
return {
|
|
310617
310892
|
setWorkbench,
|
|
310893
|
+
toggleTaskDetails() {
|
|
310894
|
+
setWorkbench(workbench.hidden ? active : null);
|
|
310895
|
+
},
|
|
310618
310896
|
showConversation() {
|
|
310619
310897
|
focused = false;
|
|
310620
310898
|
if (layout.narrow) setWorkbench(null, false);
|
|
@@ -310622,7 +310900,7 @@ function createWorkbenchController(runtime) {
|
|
|
310622
310900
|
}
|
|
310623
310901
|
};
|
|
310624
310902
|
}
|
|
310625
|
-
var WEB_UI_CLIENT_WORKBENCH_SCRIPT = `const { setWorkbench, showConversation } = (${createWorkbenchController.toString()})({ geometry: (${createPreviewGeometry.toString()})(), readWidth: () => Number(readLocalStorage('orbit.webui.previewWidth', '54')), saveWidth: (width) => writeLocalStorage('orbit.webui.previewWidth', String(width)), syncSidebarInteractivity, closeSidebar });
|
|
310903
|
+
var WEB_UI_CLIENT_WORKBENCH_SCRIPT = `const { setWorkbench, toggleTaskDetails, showConversation } = (${createWorkbenchController.toString()})({ geometry: (${createPreviewGeometry.toString()})(), readWidth: () => Number(readLocalStorage('orbit.webui.previewWidth', '54')), saveWidth: (width) => writeLocalStorage('orbit.webui.previewWidth', String(width)), syncSidebarInteractivity, closeSidebar });
|
|
310626
310904
|
`;
|
|
310627
310905
|
|
|
310628
310906
|
// src/runtime/webui/WebUiClientMessages.ts
|
|
@@ -311773,7 +312051,13 @@ var WEB_UI_CLIENT_MISSION_CONTROL_SCRIPT = ` const { renderTaskOverview, render
|
|
|
311773
312051
|
`;
|
|
311774
312052
|
|
|
311775
312053
|
// src/runtime/webui/WebUiClientPalette.ts
|
|
311776
|
-
|
|
312054
|
+
function paletteMatches(action, query) {
|
|
312055
|
+
if (!query) return true;
|
|
312056
|
+
const haystack = (action.label + " " + action.detail + " " + action.keywords).toLocaleLowerCase();
|
|
312057
|
+
return query.split(/\s+/).every((part) => haystack.includes(part));
|
|
312058
|
+
}
|
|
312059
|
+
var WEB_UI_CLIENT_PALETTE_SCRIPT = String.raw` const paletteMatches = ${paletteMatches.toString()};
|
|
312060
|
+
let paletteActions = [];
|
|
311777
312061
|
let paletteSelection = 0;
|
|
311778
312062
|
let paletteReturnFocus = null;
|
|
311779
312063
|
|
|
@@ -311785,7 +312069,7 @@ var WEB_UI_CLIENT_PALETTE_SCRIPT = String.raw` let paletteActions = [];
|
|
|
311785
312069
|
|
|
311786
312070
|
function setComposerValue(value) {
|
|
311787
312071
|
elements.prompt.value = value;
|
|
311788
|
-
|
|
312072
|
+
drafts.save(value);
|
|
311789
312073
|
autoSizePrompt();
|
|
311790
312074
|
updateSendButtonState();
|
|
311791
312075
|
focusMessageComposer();
|
|
@@ -311794,14 +312078,19 @@ var WEB_UI_CLIENT_PALETTE_SCRIPT = String.raw` let paletteActions = [];
|
|
|
311794
312078
|
|
|
311795
312079
|
function buildPaletteActions() {
|
|
311796
312080
|
const actions = [
|
|
311797
|
-
{ icon: '+', label: language !== 'en' ? chinese('新建任务', '新增任務') : 'New task', detail: '
|
|
312081
|
+
{ icon: '+', label: language !== 'en' ? chinese('新建任务', '新增任務') : 'New task', detail: controlShortcut('N'), keywords: 'new session task', idle: true, run: () => updateSession({ action: 'new' }) },
|
|
311798
312082
|
{ icon: '▣', label: language !== 'en' ? chinese('添加或创建项目', '加入或建立專案') : 'Add or create project', detail: language !== 'en' ? chinese('选择项目文件夹', '選擇專案資料夾') : 'Choose a project folder', keywords: 'add new open create project workspace folder', idle: true, run: openProjectDialog },
|
|
311799
312083
|
{ icon: '›', label: copy.focusComposer, detail: language !== 'en' ? chinese('发送消息', '傳送訊息') : 'Message Orbit', keywords: 'focus prompt message composer', run: focusMessageComposer },
|
|
311800
312084
|
{ icon: '◫', label: copy.openActivity, detail: language !== 'en' ? chinese('运行状态与工具', '執行狀態與工具') : 'Runtime and tools', keywords: 'activity details runtime tools', run: () => setInspector(true, 'activity') },
|
|
311801
|
-
{ icon: '⚙', label: copy.openSettings, detail: '
|
|
311802
|
-
{ icon: '◧', label: language !== 'en' ? chinese('切换导航栏', '切換導覽列') : 'Toggle navigation', detail: '
|
|
312085
|
+
{ icon: '⚙', label: copy.openSettings, detail: controlShortcut(','), keywords: 'settings preferences configuration', run: () => setInspector(true, 'settings') },
|
|
312086
|
+
{ icon: '◧', label: language !== 'en' ? chinese('切换导航栏', '切換導覽列') : 'Toggle navigation', detail: controlShortcut('B'), keywords: 'toggle sidebar navigation focus', run: toggleNavigation },
|
|
311803
312087
|
{ icon: '+', label: language !== 'en' ? chinese('添加文件上下文', '加入檔案上下文') : 'Add file context', detail: language !== 'en' ? chinese('搜索工作区文件', '搜尋工作區檔案') : 'Search workspace files', keywords: 'add context file', idle: true, run: openContextPicker },
|
|
311804
312088
|
];
|
|
312089
|
+
for (const preset of elements.reviewPresets.querySelectorAll('[data-review-preset]')) {
|
|
312090
|
+
actions.push({ icon: '◇', label: (language === 'en' ? 'Review' : chinese('审查', '審查')) + ' · ' + preset.textContent,
|
|
312091
|
+
detail: '/review ' + preset.dataset.reviewPreset, keywords: 'review project', idle: true,
|
|
312092
|
+
run: () => setComposerValue('/review ' + preset.dataset.reviewPreset) });
|
|
312093
|
+
}
|
|
311805
312094
|
for (const definition of slashCommands) {
|
|
311806
312095
|
actions.push({
|
|
311807
312096
|
icon: '/',
|
|
@@ -311850,12 +312139,6 @@ var WEB_UI_CLIENT_PALETTE_SCRIPT = String.raw` let paletteActions = [];
|
|
|
311850
312139
|
return actions;
|
|
311851
312140
|
}
|
|
311852
312141
|
|
|
311853
|
-
function paletteMatches(action, query) {
|
|
311854
|
-
if (!query) return true;
|
|
311855
|
-
const haystack = (action.label + ' ' + action.detail + ' ' + action.keywords).toLocaleLowerCase();
|
|
311856
|
-
return query.split(/\s+/).every((part) => haystack.includes(part));
|
|
311857
|
-
}
|
|
311858
|
-
|
|
311859
312142
|
function renderCommandPalette() {
|
|
311860
312143
|
const query = elements.commandSearch.value.trim().toLocaleLowerCase();
|
|
311861
312144
|
paletteActions = buildPaletteActions().filter((action) => paletteMatches(action, query));
|
|
@@ -311985,13 +312268,19 @@ function selectMenuLayout(input) {
|
|
|
311985
312268
|
}
|
|
311986
312269
|
|
|
311987
312270
|
// src/runtime/webui/WebUiClientSelect.ts
|
|
312271
|
+
function syncSelectedValue(select2, trigger, value) {
|
|
312272
|
+
const option = select2.selectedOptions[0] ?? select2.options[0];
|
|
312273
|
+
const label = option?.dataset.displayLabel || option?.textContent || "\u2014";
|
|
312274
|
+
if (value.textContent !== label) value.textContent = label;
|
|
312275
|
+
value.title = select2.id === "permissionSelect" ? label : option?.textContent || "";
|
|
312276
|
+
value.id = select2.id + "SelectedValue";
|
|
312277
|
+
trigger.setAttribute("aria-describedby", value.id);
|
|
312278
|
+
}
|
|
311988
312279
|
var WEB_UI_CLIENT_SELECT_SCRIPT = String.raw` const selectControls = new Map();
|
|
311989
312280
|
const fitSelectMenu = ${selectMenuLayout.toString()};
|
|
311990
312281
|
let selectScrollSettleTimer = 0;
|
|
311991
312282
|
|
|
311992
|
-
|
|
311993
|
-
return [...select.options].find((option) => option.value === select.value) || select.options[0];
|
|
311994
|
-
}
|
|
312283
|
+
const syncSelectedValue = ${syncSelectedValue.toString()};
|
|
311995
312284
|
|
|
311996
312285
|
function positionSelectMenu(entry) {
|
|
311997
312286
|
const rect = entry.trigger.getBoundingClientRect();
|
|
@@ -312070,9 +312359,7 @@ var WEB_UI_CLIENT_SELECT_SCRIPT = String.raw` const selectControls = new Map();
|
|
|
312070
312359
|
function syncSelectControl(select) {
|
|
312071
312360
|
const entry = selectControls.get(select);
|
|
312072
312361
|
if (!entry) return;
|
|
312073
|
-
|
|
312074
|
-
entry.value.textContent = active ? active.dataset.displayLabel || active.textContent : '—';
|
|
312075
|
-
entry.value.title = active ? active.textContent : '';
|
|
312362
|
+
syncSelectedValue(select, entry.trigger, entry.value);
|
|
312076
312363
|
entry.trigger.disabled = select.disabled;
|
|
312077
312364
|
if (select.disabled) closeSelectControl(entry, false);
|
|
312078
312365
|
const optionsKey = JSON.stringify([...select.options].map((option) => [option.value, option.textContent, option.disabled]));
|
|
@@ -312240,6 +312527,50 @@ var WEB_UI_CLIENT_SELECT_SCRIPT = String.raw` const selectControls = new Map();
|
|
|
312240
312527
|
|
|
312241
312528
|
`;
|
|
312242
312529
|
|
|
312530
|
+
// src/runtime/webui/WebUiClientReview.ts
|
|
312531
|
+
function verificationSummary(checks, t2) {
|
|
312532
|
+
const failures = checks.filter((check) => check.success === false).length;
|
|
312533
|
+
if (failures) return String(failures) + t2(" failed", " \u9879\u5931\u8D25", " \u9805\u5931\u6557");
|
|
312534
|
+
if (!checks.length || checks.some((check) => check.success !== true))
|
|
312535
|
+
return t2("See records", "\u67E5\u770B\u8BB0\u5F55", "\u67E5\u770B\u8A18\u9304");
|
|
312536
|
+
return String(checks.length) + t2(" passed", " \u9879\u901A\u8FC7", " \u9805\u901A\u904E");
|
|
312537
|
+
}
|
|
312538
|
+
function renderReviewResults(fileCount, verification, t2, relativeSessionTime, summarize) {
|
|
312539
|
+
const get = (id) => document.getElementById(id);
|
|
312540
|
+
get("reviewResults").hidden = !fileCount && !verification.length;
|
|
312541
|
+
get("changesButton").hidden = !fileCount;
|
|
312542
|
+
get("resultFileCount").textContent = String(fileCount);
|
|
312543
|
+
get("verificationResultButton").hidden = !verification.length;
|
|
312544
|
+
get("resultVerification").textContent = summarize(verification, t2);
|
|
312545
|
+
get("verificationCount").textContent = String(verification.length);
|
|
312546
|
+
get("verificationList").replaceChildren();
|
|
312547
|
+
if (!verification.length) {
|
|
312548
|
+
const empty = document.createElement("p");
|
|
312549
|
+
empty.className = "review-empty";
|
|
312550
|
+
empty.textContent = t2(
|
|
312551
|
+
"No verification recorded for this chat.",
|
|
312552
|
+
"\u672C\u6B21\u5BF9\u8BDD\u5C1A\u65E0\u9A8C\u8BC1\u8BB0\u5F55\u3002",
|
|
312553
|
+
"\u672C\u6B21\u5C0D\u8A71\u5C1A\u7121\u9A57\u8B49\u8A18\u9304\u3002"
|
|
312554
|
+
);
|
|
312555
|
+
get("verificationList").append(empty);
|
|
312556
|
+
} else {
|
|
312557
|
+
for (const result of verification) {
|
|
312558
|
+
const row = document.createElement("div");
|
|
312559
|
+
row.className = "verification-row " + (result.success === true ? "is-success" : result.success === false ? "is-error" : "");
|
|
312560
|
+
const marker = document.createElement("span");
|
|
312561
|
+
marker.textContent = result.success === true ? "\u2713" : result.success === false ? "\xD7" : "\xB7";
|
|
312562
|
+
const content = document.createElement("span");
|
|
312563
|
+
const title = document.createElement("strong");
|
|
312564
|
+
title.textContent = typeof result.success !== "boolean" ? t2("Outcome unrecorded", "\u7ED3\u679C\u672A\u8BB0\u5F55", "\u7D50\u679C\u672A\u8A18\u9304") : result.success ? t2("Verification passed", "\u9A8C\u8BC1\u901A\u8FC7", "\u9A57\u8B49\u901A\u904E") : t2("Verification failed", "\u9A8C\u8BC1\u5931\u8D25", "\u9A57\u8B49\u5931\u6557");
|
|
312565
|
+
const detail = document.createElement("small");
|
|
312566
|
+
detail.textContent = result.detail || relativeSessionTime(result.timestamp);
|
|
312567
|
+
content.append(title, detail);
|
|
312568
|
+
row.append(marker, content);
|
|
312569
|
+
get("verificationList").append(row);
|
|
312570
|
+
}
|
|
312571
|
+
}
|
|
312572
|
+
}
|
|
312573
|
+
|
|
312243
312574
|
// src/runtime/webui/WebUiModelSelectOptions.ts
|
|
312244
312575
|
function renderModelSelectOptions(selects, data, language) {
|
|
312245
312576
|
const current = data.modelSelection || data.activeModel || "";
|
|
@@ -312281,6 +312612,8 @@ function renderProviderSelectOptions(select2, provider = {}) {
|
|
|
312281
312612
|
// src/runtime/webui/WebUiClientSession.ts
|
|
312282
312613
|
var WEB_UI_CONTROL_COMMANDS = JSON.stringify(BUILTIN_SLASH_COMMANDS);
|
|
312283
312614
|
var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI_CONTROL_COMMANDS};
|
|
312615
|
+
const renderReviewResults = ${renderReviewResults.toString()};
|
|
312616
|
+
const verificationSummary = ${verificationSummary.toString()};
|
|
312284
312617
|
const fillModelSelectOptions = ${renderModelSelectOptions.toString()};
|
|
312285
312618
|
const fillProviderSelectOptions = ${renderProviderSelectOptions.toString()};
|
|
312286
312619
|
|
|
@@ -312341,14 +312674,14 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312341
312674
|
}
|
|
312342
312675
|
const compactAt = Number(context.compactAtTokens || 0);
|
|
312343
312676
|
const estimated = Number(context.estimatedHistoryTokens || 0);
|
|
312344
|
-
const
|
|
312677
|
+
const meterLimit = compactAt || Number(context.maxContextTokens || 0);
|
|
312678
|
+
const usagePercent = meterLimit > 0 ? Math.max(0, (estimated / meterLimit) * 100) : 0;
|
|
312345
312679
|
const ringPercent = Math.min(100, usagePercent);
|
|
312346
312680
|
elements.contextMeter.style.setProperty('--context-pct', ringPercent + '%');
|
|
312347
|
-
elements.contextPercent.textContent = Math.round(usagePercent) + '%';
|
|
312681
|
+
elements.contextPercent.textContent = meterLimit ? Math.round(usagePercent) + '%' : '—';
|
|
312348
312682
|
elements.contextMeter.classList.toggle('is-warm', usagePercent >= 72 && usagePercent < 90);
|
|
312349
312683
|
elements.contextMeter.classList.toggle('is-hot', usagePercent >= 90);
|
|
312350
|
-
const
|
|
312351
|
-
const meterDetail = estimated.toLocaleString() + ' / ' + meterLimit.toLocaleString() + ' tokens';
|
|
312684
|
+
const meterDetail = meterLimit ? estimated.toLocaleString() + ' / ' + meterLimit.toLocaleString() + ' tokens' : stageCopy('Limit unavailable', '暂无上限数据', '暫無上限資料');
|
|
312352
312685
|
elements.contextMeter.title = meterDetail;
|
|
312353
312686
|
elements.contextMeter.setAttribute('aria-label', copy.contextWindow + ': ' + meterDetail);
|
|
312354
312687
|
renderWorkspaceState(data);
|
|
@@ -312435,6 +312768,9 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312435
312768
|
|
|
312436
312769
|
function renderChangeReview(review) {
|
|
312437
312770
|
state.changeReview = review;
|
|
312771
|
+
const signature = JSON.stringify([state.status?.session?.activeId, state.changeQuery, review.fileChanges, review.checkpoints, review.verification]);
|
|
312772
|
+
if (state.reviewSignature === signature) return;
|
|
312773
|
+
state.reviewSignature = signature;
|
|
312438
312774
|
const rawChanges = Array.isArray(review.fileChanges) ? review.fileChanges : [];
|
|
312439
312775
|
const latestByPath = new Map();
|
|
312440
312776
|
for (const change of rawChanges) {
|
|
@@ -312448,6 +312784,7 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312448
312784
|
elements.changeCount.textContent = query
|
|
312449
312785
|
? String(changes.length) + '/' + String(allChanges.length)
|
|
312450
312786
|
: String(allChanges.length);
|
|
312787
|
+
const openPaths = new Set(Array.from(elements.changesList.querySelectorAll('details[open]'), card => card.dataset.path));
|
|
312451
312788
|
elements.changesList.replaceChildren();
|
|
312452
312789
|
if (!changes.length) {
|
|
312453
312790
|
const empty = document.createElement('p');
|
|
@@ -312458,6 +312795,8 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312458
312795
|
for (const change of changes) {
|
|
312459
312796
|
const card = document.createElement('details');
|
|
312460
312797
|
card.className = 'change-card';
|
|
312798
|
+
card.dataset.path = change.path;
|
|
312799
|
+
card.open = openPaths.has(change.path);
|
|
312461
312800
|
const summary = document.createElement('summary');
|
|
312462
312801
|
const path = document.createElement('strong');
|
|
312463
312802
|
path.textContent = change.path;
|
|
@@ -312528,32 +312867,7 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312528
312867
|
}
|
|
312529
312868
|
}
|
|
312530
312869
|
|
|
312531
|
-
|
|
312532
|
-
elements.verificationCount.textContent = String(verification.length);
|
|
312533
|
-
elements.verificationList.replaceChildren();
|
|
312534
|
-
if (!verification.length) {
|
|
312535
|
-
const empty = document.createElement('p');
|
|
312536
|
-
empty.className = 'review-empty';
|
|
312537
|
-
empty.textContent = copy.noVerification;
|
|
312538
|
-
elements.verificationList.append(empty);
|
|
312539
|
-
} else {
|
|
312540
|
-
for (const result of verification) {
|
|
312541
|
-
const row = document.createElement('div');
|
|
312542
|
-
row.className = 'verification-row ' + (result.success ? 'is-success' : 'is-error');
|
|
312543
|
-
const marker = document.createElement('span');
|
|
312544
|
-
marker.textContent = result.success ? '✓' : '×';
|
|
312545
|
-
const content = document.createElement('span');
|
|
312546
|
-
const title = document.createElement('strong');
|
|
312547
|
-
title.textContent = result.success
|
|
312548
|
-
? (language !== 'en' ? chinese('验证通过', '驗證通過') : 'Verification passed')
|
|
312549
|
-
: (language !== 'en' ? chinese('验证失败', '驗證失敗') : 'Verification failed');
|
|
312550
|
-
const detail = document.createElement('small');
|
|
312551
|
-
detail.textContent = result.detail || relativeSessionTime(result.timestamp);
|
|
312552
|
-
content.append(title, detail);
|
|
312553
|
-
row.append(marker, content);
|
|
312554
|
-
elements.verificationList.append(row);
|
|
312555
|
-
}
|
|
312556
|
-
}
|
|
312870
|
+
renderReviewResults(allChanges.length, review.verification || [], (en, zh, tw) => language === 'en' ? en : chinese(zh, tw), relativeSessionTime, verificationSummary);
|
|
312557
312871
|
}
|
|
312558
312872
|
|
|
312559
312873
|
async function applyReviewAction(action, button) {
|
|
@@ -312680,9 +312994,10 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312680
312994
|
.some((value) => String(value).toLocaleLowerCase().includes(query)))
|
|
312681
312995
|
: sessions;
|
|
312682
312996
|
const visibleSessions = matchingSessions.slice(0, state.sessionLimit);
|
|
312683
|
-
const renderList = (container, items, archived) =>
|
|
312684
|
-
container.
|
|
312685
|
-
|
|
312997
|
+
const renderList = (container, items, archived) => reconcileNavigation(
|
|
312998
|
+
container, items, session => session.id,
|
|
312999
|
+
session => [session.title, session.model, Boolean(session.active), relativeSessionTime(session.updatedAt)],
|
|
313000
|
+
session => {
|
|
312686
313001
|
const isActive = Boolean(session.active);
|
|
312687
313002
|
const row = document.createElement('div');
|
|
312688
313003
|
row.className = 'session-row'
|
|
@@ -312725,9 +313040,9 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312725
313040
|
actions.append(secondaryAction, deleteAction);
|
|
312726
313041
|
row.append(actions);
|
|
312727
313042
|
}
|
|
312728
|
-
|
|
313043
|
+
return row;
|
|
312729
313044
|
}
|
|
312730
|
-
|
|
313045
|
+
);
|
|
312731
313046
|
renderList(elements.recentSessions, visibleSessions, false);
|
|
312732
313047
|
renderList(elements.archivedSessions, archivedSessions, true);
|
|
312733
313048
|
elements.sessionSearchField.hidden = sessions.length < 12;
|
|
@@ -312744,13 +313059,12 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312744
313059
|
}
|
|
312745
313060
|
|
|
312746
313061
|
function renderProjectNavigation(projects, currentWorkspace) {
|
|
312747
|
-
|
|
312748
|
-
const normalizePath = (value) => String(value || '').replace(/\\/g, '/').toLowerCase();
|
|
312749
|
-
const current = normalizePath(currentWorkspace);
|
|
313062
|
+
const current = projectPathKey(currentWorkspace || '');
|
|
312750
313063
|
const recentProjects = (Array.isArray(projects) ? projects : [])
|
|
312751
|
-
.filter((item) => item.available === true &&
|
|
313064
|
+
.filter((item) => item.available === true && projectPathKey(item.path || '') !== current)
|
|
312752
313065
|
.slice(0, 6);
|
|
312753
|
-
|
|
313066
|
+
reconcileNavigation(elements.projectList, recentProjects, project => project.id || project.path,
|
|
313067
|
+
project => [project.name, project.path], project => {
|
|
312754
313068
|
const row = document.createElement('div');
|
|
312755
313069
|
row.className = 'registered-project';
|
|
312756
313070
|
const button = document.createElement('button');
|
|
@@ -312778,15 +313092,16 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312778
313092
|
remove.setAttribute('aria-label', copy.removeProject + ': ' + (project.name || 'Orbit'));
|
|
312779
313093
|
remove.textContent = '×';
|
|
312780
313094
|
row.append(button, remove);
|
|
312781
|
-
|
|
312782
|
-
}
|
|
313095
|
+
return row;
|
|
313096
|
+
});
|
|
312783
313097
|
elements.recentProjectsShell.hidden = elements.projectList.childElementCount === 0;
|
|
312784
313098
|
syncScrollAffordance(elements.projectList);
|
|
312785
313099
|
}
|
|
312786
313100
|
|
|
312787
313101
|
async function updateSession(action) {
|
|
312788
|
-
if (state.busy) return;
|
|
312789
|
-
state.
|
|
313102
|
+
if (!state.ready || state.busy || state.sessionChanging) return;
|
|
313103
|
+
state.sessionChanging = true;
|
|
313104
|
+
updateSendButtonState();
|
|
312790
313105
|
elements.newTaskButton.disabled = true;
|
|
312791
313106
|
elements.recentSessions.querySelectorAll('button').forEach((button) => { button.disabled = true; });
|
|
312792
313107
|
elements.archivedSessions.querySelectorAll('button').forEach((button) => { button.disabled = true; });
|
|
@@ -312796,14 +313111,20 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312796
313111
|
headers: { 'Content-Type': 'application/json' },
|
|
312797
313112
|
body: JSON.stringify(action),
|
|
312798
313113
|
});
|
|
313114
|
+
if (action.action === 'delete' && state.status) {
|
|
313115
|
+
const deleted = drafts.key(state.status.workspace || '', action.sessionId);
|
|
313116
|
+
drafts.write(deleted, '');
|
|
313117
|
+
discardAttachmentDraft(deleted);
|
|
313118
|
+
}
|
|
312799
313119
|
const navigates = action.action === 'new' || action.action === 'resume';
|
|
312800
313120
|
if (navigates) {
|
|
312801
313121
|
clearActivity();
|
|
312802
313122
|
state.controlTurns.clear();
|
|
312803
|
-
await Promise.all([
|
|
313123
|
+
const [, snapshot] = await Promise.all([
|
|
312804
313124
|
renderMessages({ forceBottom: true, resetHistory: true }),
|
|
312805
313125
|
loadStatus(),
|
|
312806
313126
|
]);
|
|
313127
|
+
if (!snapshot) connectEvents();
|
|
312807
313128
|
} else {
|
|
312808
313129
|
await loadStatus();
|
|
312809
313130
|
}
|
|
@@ -312821,8 +313142,10 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312821
313142
|
}
|
|
312822
313143
|
} catch (error) {
|
|
312823
313144
|
showToast(error.message || String(error), 'error');
|
|
313145
|
+
connectEvents();
|
|
312824
313146
|
} finally {
|
|
312825
|
-
state.
|
|
313147
|
+
state.sessionChanging = false;
|
|
313148
|
+
updateSendButtonState();
|
|
312826
313149
|
elements.newTaskButton.disabled = false;
|
|
312827
313150
|
elements.recentSessions.querySelectorAll('button').forEach((button) => { button.disabled = false; });
|
|
312828
313151
|
elements.archivedSessions.querySelectorAll('button').forEach((button) => { button.disabled = false; });
|
|
@@ -312830,7 +313153,10 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312830
313153
|
}
|
|
312831
313154
|
|
|
312832
313155
|
async function loadStatus() {
|
|
313156
|
+
const epoch = state.statusEpoch, request = ++state.statusRequest;
|
|
312833
313157
|
const requestedTurn = state.activeTurnId, data = await api('/api/status');
|
|
313158
|
+
if (epoch !== state.statusEpoch || request !== state.statusRequest) return;
|
|
313159
|
+
activateComposerDraft(data.workspace || '', data.session?.activeId || '');
|
|
312834
313160
|
state.status = data;
|
|
312835
313161
|
state.promptQueue = Array.isArray(data.inputQueue) ? data.inputQueue : [];
|
|
312836
313162
|
renderPromptQueue();
|
|
@@ -312852,8 +313178,8 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312852
313178
|
}
|
|
312853
313179
|
}
|
|
312854
313180
|
const name = workspaceName(data.workspace);
|
|
312855
|
-
byId('
|
|
312856
|
-
byId('
|
|
313181
|
+
byId('workspacePath').textContent = name;
|
|
313182
|
+
byId('workspaceFolder').textContent = data.workspace || '';
|
|
312857
313183
|
byId('sidebarWorkspace').textContent = name;
|
|
312858
313184
|
byId('sidebarWorkspace').title = data.workspace || '';
|
|
312859
313185
|
byId('sidebarSession').textContent = data.workspace || 'local';
|
|
@@ -312877,7 +313203,9 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312877
313203
|
copy.context + (contextCount ? ' · ' + contextCount : ''),
|
|
312878
313204
|
);
|
|
312879
313205
|
renderContextShelf(data.context || {});
|
|
313206
|
+
if (epoch !== state.statusEpoch || request !== state.statusRequest) return;
|
|
312880
313207
|
renderPendingApproval(data.approval);
|
|
313208
|
+
setEmptyState();
|
|
312881
313209
|
|
|
312882
313210
|
const activeLanguage = data.language || language;
|
|
312883
313211
|
elements.languageOptions.querySelectorAll('[data-language-value]').forEach((button) => {
|
|
@@ -312885,7 +313213,11 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312885
313213
|
button.classList.toggle('is-active', active);
|
|
312886
313214
|
button.setAttribute('aria-pressed', active ? 'true' : 'false');
|
|
312887
313215
|
});
|
|
312888
|
-
const
|
|
313216
|
+
const permissions = data.permissions || {};
|
|
313217
|
+
const mode = permissions.mode || 'normal';
|
|
313218
|
+
const auto = elements.permissionSelect.querySelector('option[value="auto"]');
|
|
313219
|
+
auto.dataset.displayLabel = mode === 'auto' && !permissions.fullAccess
|
|
313220
|
+
? stageCopy('Auto (limited)', '自动(受限)', '自動(受限)') : auto.textContent;
|
|
312889
313221
|
elements.permissionSelect.value = mode;
|
|
312890
313222
|
syncSelectControl(elements.permissionSelect);
|
|
312891
313223
|
elements.permissionSegments.querySelectorAll('[data-mode]').forEach((button) => {
|
|
@@ -312893,7 +313225,6 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312893
313225
|
button.classList.toggle('is-active', active);
|
|
312894
313226
|
button.setAttribute('aria-pressed', active ? 'true' : 'false');
|
|
312895
313227
|
});
|
|
312896
|
-
const permissions = data.permissions || {};
|
|
312897
313228
|
const modeSummary = mode === 'auto'
|
|
312898
313229
|
? (permissions.fullAccess ? copy.permissionFullAccess : copy.permissionAutoLimited)
|
|
312899
313230
|
: mode === 'strict'
|
|
@@ -313131,6 +313462,8 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313131
313462
|
const selectionEnd = restoreEditorFocus ? activeEditor.selectionEnd : null;
|
|
313132
313463
|
elements.promptQueueList.replaceChildren();
|
|
313133
313464
|
elements.promptQueue.hidden = state.promptQueue.length === 0;
|
|
313465
|
+
byId('queueCount').textContent = String(state.promptQueue.length);
|
|
313466
|
+
if (!state.promptQueue.length) elements.promptQueue.open = false;
|
|
313134
313467
|
if (!state.promptQueue.some((item) => item.id === state.queueEditingId)) {
|
|
313135
313468
|
state.queueEditingId = null;
|
|
313136
313469
|
state.queueEditDraft = '';
|
|
@@ -313210,24 +313543,34 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313210
313543
|
|
|
313211
313544
|
async function queuePrompt(prompt, mode) {
|
|
313212
313545
|
const value = String(prompt || '').trim();
|
|
313213
|
-
if (!value || state.promptQueue.length >= 12) return;
|
|
313546
|
+
if (!state.ready || state.sessionChanging || state.stopping || state.queueSubmitting || !value || state.promptQueue.length >= 12) return;
|
|
313214
313547
|
const attachmentIds = state.attachments.map((attachment) => attachment.id);
|
|
313548
|
+
const scope = drafts.active;
|
|
313549
|
+
const attachments = state.attachments;
|
|
313550
|
+
state.queueSubmitting = true;
|
|
313551
|
+
if (document.activeElement === elements.queueButton || document.activeElement === elements.steerButton)
|
|
313552
|
+
elements.prompt.focus();
|
|
313553
|
+
updateSendButtonState();
|
|
313215
313554
|
try {
|
|
313216
313555
|
await api('/api/input-queue', {
|
|
313217
313556
|
method: 'POST',
|
|
313218
313557
|
headers: { 'Content-Type': 'application/json' },
|
|
313219
313558
|
body: JSON.stringify({ action: 'enqueue', prompt: value, mode: mode === 'steer' ? 'steer' : 'follow_up', attachmentIds }),
|
|
313220
313559
|
});
|
|
313221
|
-
consumeAttachments(attachmentIds);
|
|
313222
|
-
|
|
313223
|
-
|
|
313224
|
-
|
|
313225
|
-
|
|
313560
|
+
consumeAttachments(attachmentIds, attachments);
|
|
313561
|
+
if (drafts.active !== scope && scope && drafts.read(scope) === prompt) drafts.write(scope, '');
|
|
313562
|
+
if (drafts.active === scope && elements.prompt.value === prompt) {
|
|
313563
|
+
elements.prompt.value = '';
|
|
313564
|
+
drafts.save('');
|
|
313565
|
+
autoSizePrompt();
|
|
313566
|
+
}
|
|
313226
313567
|
await loadStatus();
|
|
313227
313568
|
showToast(mode === 'steer' ? (language === 'en' ? 'Steering accepted' : chinese('引导已接收', '引導已接收')) : copy.queued, 'success');
|
|
313228
|
-
elements.prompt.focus();
|
|
313229
313569
|
} catch (error) {
|
|
313230
313570
|
showToast(error.message || String(error), 'error');
|
|
313571
|
+
} finally {
|
|
313572
|
+
state.queueSubmitting = false;
|
|
313573
|
+
updateSendButtonState();
|
|
313231
313574
|
}
|
|
313232
313575
|
}
|
|
313233
313576
|
|
|
@@ -313297,7 +313640,7 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313297
313640
|
|
|
313298
313641
|
async function submitTurn(prompt, options) {
|
|
313299
313642
|
const value = String(prompt || '').trim();
|
|
313300
|
-
if (!value || state.busy) return;
|
|
313643
|
+
if (!value || state.busy || state.sessionChanging) return;
|
|
313301
313644
|
if (!state.ready) {
|
|
313302
313645
|
showToast(copy.waitForConnection, 'warning');
|
|
313303
313646
|
elements.prompt.focus();
|
|
@@ -313318,10 +313661,12 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313318
313661
|
closeSlashCommands();
|
|
313319
313662
|
const turnId = crypto.randomUUID ? crypto.randomUUID() : String(Date.now()) + '-' + Math.random().toString(16).slice(2);
|
|
313320
313663
|
const previousDraft = elements.prompt.value;
|
|
313321
|
-
const
|
|
313664
|
+
const preserveDraft = options && typeof options.restoreDraft === 'string';
|
|
313665
|
+
const scope = drafts.active;
|
|
313666
|
+
const attachments = state.attachments;
|
|
313322
313667
|
const attachmentIds = Array.isArray(options && options.attachmentIds)
|
|
313323
313668
|
? options.attachmentIds.slice(0, 4)
|
|
313324
|
-
:
|
|
313669
|
+
: preserveDraft ? [] : attachments.map((attachment) => attachment.id);
|
|
313325
313670
|
const controlCommand = isControlCommand(value);
|
|
313326
313671
|
state.submitting = true;
|
|
313327
313672
|
state.activeTurnId = turnId;
|
|
@@ -313335,10 +313680,12 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313335
313680
|
} else {
|
|
313336
313681
|
createStreamingTurn(value, turnId);
|
|
313337
313682
|
}
|
|
313338
|
-
|
|
313339
|
-
|
|
313340
|
-
|
|
313341
|
-
|
|
313683
|
+
if (!preserveDraft) {
|
|
313684
|
+
elements.prompt.value = '';
|
|
313685
|
+
drafts.save('');
|
|
313686
|
+
autoSizePrompt();
|
|
313687
|
+
updateSendButtonState();
|
|
313688
|
+
}
|
|
313342
313689
|
closeSidebar();
|
|
313343
313690
|
try {
|
|
313344
313691
|
const result = await api('/api/chat', {
|
|
@@ -313347,13 +313694,7 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313347
313694
|
body: JSON.stringify({ prompt: value, turnId, attachmentIds }),
|
|
313348
313695
|
});
|
|
313349
313696
|
if (result.turnId) state.activeTurnId = result.turnId;
|
|
313350
|
-
consumeAttachments(attachmentIds);
|
|
313351
|
-
if (restoreDraft) {
|
|
313352
|
-
elements.prompt.value = restoreDraft;
|
|
313353
|
-
writeLocalStorage('orbit.webui.draft', restoreDraft);
|
|
313354
|
-
autoSizePrompt();
|
|
313355
|
-
updateSendButtonState();
|
|
313356
|
-
}
|
|
313697
|
+
consumeAttachments(attachmentIds, attachments);
|
|
313357
313698
|
state.submitting = false;
|
|
313358
313699
|
void reconcileStatus();
|
|
313359
313700
|
} catch (error) {
|
|
@@ -313363,10 +313704,14 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313363
313704
|
state.controlTurnId = null;
|
|
313364
313705
|
state.controlPrompt = '';
|
|
313365
313706
|
if (controlCommand) upsertControlTurn(turnId, value, 'failed', false);
|
|
313366
|
-
|
|
313367
|
-
|
|
313368
|
-
|
|
313369
|
-
|
|
313707
|
+
if (!preserveDraft && scope) {
|
|
313708
|
+
const recovered = drafts.recover(scope, previousDraft || value, elements.prompt.value);
|
|
313709
|
+
if (recovered !== undefined) {
|
|
313710
|
+
elements.prompt.value = recovered;
|
|
313711
|
+
autoSizePrompt();
|
|
313712
|
+
updateSendButtonState();
|
|
313713
|
+
}
|
|
313714
|
+
}
|
|
313370
313715
|
await renderMessages().catch(() => {});
|
|
313371
313716
|
showToast(error.message || String(error), 'error');
|
|
313372
313717
|
}
|
|
@@ -313510,7 +313855,7 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313510
313855
|
setBusy(true, copy.approvalRequired);
|
|
313511
313856
|
void reconcileStatus();
|
|
313512
313857
|
} else if (event.type === 'web_approval_resolved') {
|
|
313513
|
-
addActivity(payload.approved ? copy.approvalApproved : copy.approvalDenied, payload.approved ? 'success' : 'warning', 'approval');
|
|
313858
|
+
addActivity(payload.kind === 'change' ? copy.reviewClosed : payload.approved ? copy.approvalApproved : copy.approvalDenied, payload.approved ? 'success' : 'warning', 'approval');
|
|
313514
313859
|
void reconcileStatus();
|
|
313515
313860
|
} else if (event.type === 'tool_result') {
|
|
313516
313861
|
const key = 'tool-' + (payload.toolCallId || payload.toolName || '');
|
|
@@ -313625,18 +313970,34 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313625
313970
|
const eventUrl = state.useBearerTransport && webSessionToken
|
|
313626
313971
|
? '/api/events?access_token=' + encodeURIComponent(webSessionToken)
|
|
313627
313972
|
: '/api/events';
|
|
313973
|
+
state.ready = false;
|
|
313974
|
+
state.statusEpoch++;
|
|
313975
|
+
updateSendButtonState();
|
|
313628
313976
|
const source = new EventSource(eventUrl, { withCredentials: true });
|
|
313629
313977
|
state.eventSource = source;
|
|
313630
|
-
|
|
313631
|
-
|
|
313632
|
-
state.
|
|
313633
|
-
|
|
313634
|
-
|
|
313635
|
-
|
|
313978
|
+
let synchronizing;
|
|
313979
|
+
const syncConnection = () => {
|
|
313980
|
+
if (synchronizing || state.eventSource !== source) return;
|
|
313981
|
+
const epoch = state.statusEpoch;
|
|
313982
|
+
synchronizing = loadStatus().then((data) => {
|
|
313983
|
+
if (state.eventSource !== source || state.statusEpoch !== epoch) return;
|
|
313984
|
+
if (!data) return;
|
|
313985
|
+
state.eventRetryAttempt = 0;
|
|
313986
|
+
state.ready = true;
|
|
313987
|
+
updateSendButtonState();
|
|
313988
|
+
setConnection('connected', copy.connected);
|
|
313989
|
+
}).catch(() => {
|
|
313990
|
+
if (state.eventSource === source) source.onerror();
|
|
313991
|
+
}).finally(() => {
|
|
313992
|
+
synchronizing = null;
|
|
313993
|
+
if (!state.ready && state.eventSource === source) syncConnection();
|
|
313994
|
+
});
|
|
313636
313995
|
};
|
|
313996
|
+
source.onopen = syncConnection;
|
|
313637
313997
|
source.onerror = () => {
|
|
313638
313998
|
if (state.eventSource !== source) return;
|
|
313639
313999
|
state.ready = false;
|
|
314000
|
+
state.statusEpoch++;
|
|
313640
314001
|
updateSendButtonState();
|
|
313641
314002
|
source.close();
|
|
313642
314003
|
state.eventSource = null;
|
|
@@ -313658,20 +314019,15 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313658
314019
|
source.onmessage = (message) => {
|
|
313659
314020
|
const event = parseWebUiStreamEvent(message.data);
|
|
313660
314021
|
if (!event) return;
|
|
313661
|
-
if (
|
|
313662
|
-
|
|
313663
|
-
|
|
313664
|
-
setConnection('connected', copy.connected);
|
|
313665
|
-
void reconcileStatus();
|
|
313666
|
-
} else if (event.kind === 'heartbeat') {
|
|
313667
|
-
state.ready = true;
|
|
313668
|
-
updateSendButtonState();
|
|
313669
|
-
setConnection('connected', copy.connected);
|
|
314022
|
+
if (state.eventSource !== source) return;
|
|
314023
|
+
if (event.kind === 'system' || event.kind === 'heartbeat') {
|
|
314024
|
+
if (!state.ready) syncConnection();
|
|
313670
314025
|
} else if (event.kind === 'replay_gap') {
|
|
313671
314026
|
// The server retained only a bounded replay window. Reconcile the
|
|
313672
314027
|
// authoritative snapshot immediately so a reconnect never leaves the
|
|
313673
314028
|
// UI presenting a silently incomplete turn or session history.
|
|
313674
314029
|
state.ready = false;
|
|
314030
|
+
state.statusEpoch++;
|
|
313675
314031
|
updateSendButtonState();
|
|
313676
314032
|
setConnection(
|
|
313677
314033
|
'connecting',
|
|
@@ -313679,13 +314035,7 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313679
314035
|
? 'Some events expired; syncing the latest state…'
|
|
313680
314036
|
: chinese('部分事件已过期,正在同步最新状态…', '部分事件已過期,正在同步最新狀態…'),
|
|
313681
314037
|
);
|
|
313682
|
-
|
|
313683
|
-
if (state.eventSource === source && state.ready === false) {
|
|
313684
|
-
state.ready = true;
|
|
313685
|
-
updateSendButtonState();
|
|
313686
|
-
setConnection('connected', copy.connected);
|
|
313687
|
-
}
|
|
313688
|
-
});
|
|
314038
|
+
syncConnection();
|
|
313689
314039
|
} else if (event.kind === 'turn_started') {
|
|
313690
314040
|
state.activeTurnId = event.turnId;
|
|
313691
314041
|
setBusy(true, copy.working);
|
|
@@ -313764,7 +314114,7 @@ var WEB_UI_CLIENT_SLASH_COMMANDS_SCRIPT = String.raw` const builtInSlashCommand
|
|
|
313764
314114
|
const definition = slashCommandMatches[index];
|
|
313765
314115
|
if (!definition) return;
|
|
313766
314116
|
elements.prompt.value = definition.insertValue || (definition.command + (definition.usage ? ' ' : ''));
|
|
313767
|
-
|
|
314117
|
+
drafts.save(elements.prompt.value);
|
|
313768
314118
|
autoSizePrompt();
|
|
313769
314119
|
updateSendButtonState();
|
|
313770
314120
|
closeSlashCommands();
|
|
@@ -313925,6 +314275,7 @@ var WEB_UI_CLIENT_SCRIPT = [
|
|
|
313925
314275
|
`const onShortcutKeydown = ${onShortcutKeydown.toString()};`,
|
|
313926
314276
|
`document.addEventListener("mousedown", ${focusActivatedButton.toString()});`,
|
|
313927
314277
|
WEB_UI_CLIENT_FOUNDATION_SCRIPT,
|
|
314278
|
+
WEB_UI_CLIENT_DRAFTS_SCRIPT,
|
|
313928
314279
|
WEB_UI_CLIENT_WORKBENCH_SCRIPT,
|
|
313929
314280
|
WEB_UI_CLIENT_INSPECTOR_SCRIPT,
|
|
313930
314281
|
WEB_UI_CLIENT_SELECT_SCRIPT,
|
|
@@ -313938,10 +314289,13 @@ var WEB_UI_CLIENT_SCRIPT = [
|
|
|
313938
314289
|
WEB_UI_CLIENT_MISSION_CONTROL_SCRIPT,
|
|
313939
314290
|
WEB_UI_CLIENT_EVENT_ROUTING_SCRIPT,
|
|
313940
314291
|
WEB_UI_CLIENT_STREAM_PARSER_SCRIPT,
|
|
314292
|
+
`const projectPathKey = ${projectPathKey.toString()};`,
|
|
314293
|
+
`const reconcileNavigation = (${createNavigationRows.toString()})();`,
|
|
313941
314294
|
WEB_UI_CLIENT_SESSION_SCRIPT,
|
|
313942
314295
|
WEB_UI_CLIENT_SLASH_COMMANDS_SCRIPT,
|
|
313943
314296
|
WEB_UI_CLIENT_PALETTE_SCRIPT,
|
|
313944
314297
|
WEB_UI_CLIENT_AUTHENTICATION_SCRIPT,
|
|
314298
|
+
`(${bindWorkspaceLocation.toString()})(byId('workspaceLocation'));`,
|
|
313945
314299
|
WEB_UI_CLIENT_BINDINGS_SCRIPT,
|
|
313946
314300
|
WEB_UI_CLIENT_EPILOGUE
|
|
313947
314301
|
].join("");
|
|
@@ -314071,6 +314425,7 @@ function sanitizeWebEventPayload(type, payload) {
|
|
|
314071
314425
|
};
|
|
314072
314426
|
case "web_approval_resolved":
|
|
314073
314427
|
return {
|
|
314428
|
+
...["tool", "change", "action"].includes(String(payload.kind)) ? { kind: payload.kind } : {},
|
|
314074
314429
|
approvalId: safeWebText(payload.approvalId, 200),
|
|
314075
314430
|
approved: payload.approved === true
|
|
314076
314431
|
};
|
|
@@ -315627,9 +315982,7 @@ var BASE_COPY = {
|
|
|
315627
315982
|
connectionBody: "Keep the Orbit terminal open. Reconnection is automatic and your draft stays on this device.",
|
|
315628
315983
|
retry: "Retry now",
|
|
315629
315984
|
details: "Details",
|
|
315630
|
-
emptyEyebrow: "ORBIT \xB7 LOCAL SESSION",
|
|
315631
315985
|
emptyTitle: "What should we work on?",
|
|
315632
|
-
emptyBody: "Ask, plan, build, or verify anything in this workspace.",
|
|
315633
315986
|
suggestionReview: "Review this project",
|
|
315634
315987
|
suggestionReviewBody: "Find the highest-impact issues and fix them.",
|
|
315635
315988
|
suggestionFix: "Fix a problem",
|
|
@@ -315653,7 +316006,7 @@ var BASE_COPY = {
|
|
|
315653
316006
|
attachImage: "Attach image",
|
|
315654
316007
|
clearContext: "Clear all",
|
|
315655
316008
|
webSearch: "Agent search",
|
|
315656
|
-
sendHint: "Enter to send
|
|
316009
|
+
sendHint: "Enter to send \xB7 Shift+Enter for a new line \xB7 Type / for commands",
|
|
315657
316010
|
queuedMessages: "Queued follow-ups",
|
|
315658
316011
|
clearQueue: "Clear queue",
|
|
315659
316012
|
queueMessage: "Queue message",
|
|
@@ -315818,9 +316171,7 @@ var BASE_COPY = {
|
|
|
315818
316171
|
connectionBody: "\u8BF7\u4FDD\u6301 Orbit \u7EC8\u7AEF\u8FD0\u884C\uFF1B\u9875\u9762\u4F1A\u81EA\u52A8\u91CD\u8FDE\uFF0C\u8349\u7A3F\u4F1A\u7EE7\u7EED\u4FDD\u5B58\u5728\u672C\u673A\u3002",
|
|
315819
316172
|
retry: "\u7ACB\u5373\u91CD\u8BD5",
|
|
315820
316173
|
details: "\u4EFB\u52A1\u8BE6\u60C5",
|
|
315821
|
-
emptyEyebrow: "ORBIT \xB7 \u672C\u5730\u4F1A\u8BDD",
|
|
315822
316174
|
emptyTitle: "\u63A5\u4E0B\u6765\u60F3\u505A\u4EC0\u4E48\uFF1F",
|
|
315823
|
-
emptyBody: "\u8BA9 Orbit \u5728\u5F53\u524D\u5DE5\u4F5C\u533A\u4E2D\u5206\u6790\u3001\u89C4\u5212\u3001\u5B9E\u73B0\u6216\u9A8C\u8BC1\u4EFB\u52A1\u3002",
|
|
315824
316175
|
suggestionReview: "\u5168\u9762\u5BA1\u67E5\u9879\u76EE",
|
|
315825
316176
|
suggestionReviewBody: "\u627E\u51FA\u5F71\u54CD\u6700\u5927\u7684\u95EE\u9898\u5E76\u76F4\u63A5\u4FEE\u590D\u3002",
|
|
315826
316177
|
suggestionFix: "\u4FEE\u590D\u4E00\u4E2A\u95EE\u9898",
|
|
@@ -315844,7 +316195,7 @@ var BASE_COPY = {
|
|
|
315844
316195
|
attachImage: "\u6DFB\u52A0\u56FE\u7247",
|
|
315845
316196
|
clearContext: "\u5168\u90E8\u6E05\u7A7A",
|
|
315846
316197
|
webSearch: "Agent \u641C\u7D22",
|
|
315847
|
-
sendHint: "Enter \u53D1\u9001
|
|
316198
|
+
sendHint: "Enter \u53D1\u9001 \xB7 Shift+Enter \u6362\u884C \xB7 / \u67E5\u770B\u547D\u4EE4",
|
|
315848
316199
|
queuedMessages: "\u5F85\u53D1\u9001\u6D88\u606F",
|
|
315849
316200
|
clearQueue: "\u6E05\u7A7A\u961F\u5217",
|
|
315850
316201
|
queueMessage: "\u52A0\u5165\u961F\u5217",
|
|
@@ -315920,7 +316271,7 @@ var BASE_COPY = {
|
|
|
315920
316271
|
fullAccessConfirmAction: "\u6388\u4E88\u5B8C\u6574\u6743\u9650",
|
|
315921
316272
|
modeStrict: "\u4E25\u683C",
|
|
315922
316273
|
modeNormal: "\u6807\u51C6",
|
|
315923
|
-
modeAuto: "\
|
|
316274
|
+
modeAuto: "\u5B8C\u6574\u8BBF\u95EE",
|
|
315924
316275
|
modePlan: "\u89C4\u5212",
|
|
315925
316276
|
searchProvider: "\u641C\u7D22\u670D\u52A1",
|
|
315926
316277
|
searchResults: "\u6700\u5927\u7ED3\u679C\u6570",
|
|
@@ -316007,9 +316358,7 @@ var COPY = {
|
|
|
316007
316358
|
collapseNavigation: "\u6536\u5408\u5C0E\u89BD",
|
|
316008
316359
|
connected: "\u6B63\u5728\u9023\u7DDA",
|
|
316009
316360
|
details: "\u4EFB\u52D9\u8A73\u60C5",
|
|
316010
|
-
emptyEyebrow: "ORBIT \xB7 \u672C\u6A5F\u5DE5\u4F5C\u968E\u6BB5",
|
|
316011
316361
|
emptyTitle: "\u63A5\u4E0B\u4F86\u60F3\u505A\u4EC0\u9EBC\uFF1F",
|
|
316012
|
-
emptyBody: "\u8B93 Orbit \u5728\u76EE\u524D\u5DE5\u4F5C\u5340\u4E2D\u5206\u6790\u3001\u898F\u5283\u3001\u5BE6\u4F5C\u6216\u9A57\u8B49\u4EFB\u52D9\u3002",
|
|
316013
316362
|
suggestionReview: "\u5168\u9762\u6AA2\u8996\u5C08\u6848",
|
|
316014
316363
|
suggestionReviewBody: "\u627E\u51FA\u5F71\u97FF\u6700\u5927\u7684\u554F\u984C\u4E26\u76F4\u63A5\u4FEE\u6B63\u3002",
|
|
316015
316364
|
suggestionFix: "\u4FEE\u6B63\u4E00\u500B\u554F\u984C",
|
|
@@ -316029,7 +316378,7 @@ var COPY = {
|
|
|
316029
316378
|
attachImage: "\u52A0\u5165\u5716\u7247",
|
|
316030
316379
|
clearContext: "\u5168\u90E8\u6E05\u9664",
|
|
316031
316380
|
webSearch: "Agent \u641C\u5C0B",
|
|
316032
|
-
sendHint: "Enter \u50B3\u9001
|
|
316381
|
+
sendHint: "Enter \u50B3\u9001 \xB7 Shift+Enter \u63DB\u884C \xB7 / \u67E5\u770B\u547D\u4EE4",
|
|
316033
316382
|
queuedMessages: "\u5F85\u50B3\u9001\u8A0A\u606F",
|
|
316034
316383
|
clearQueue: "\u6E05\u9664\u4F47\u5217",
|
|
316035
316384
|
queueMessage: "\u52A0\u5165\u4F47\u5217",
|
|
@@ -316080,7 +316429,7 @@ var COPY = {
|
|
|
316080
316429
|
fullAccessConfirmAction: "\u6388\u4E88\u5B8C\u6574\u6B0A\u9650",
|
|
316081
316430
|
modeStrict: "\u56B4\u683C",
|
|
316082
316431
|
modeNormal: "\u6A19\u6E96",
|
|
316083
|
-
modeAuto: "\
|
|
316432
|
+
modeAuto: "\u5B8C\u6574\u53D6\u7528",
|
|
316084
316433
|
modePlan: "\u898F\u5283",
|
|
316085
316434
|
searchProvider: "\u641C\u5C0B\u670D\u52D9",
|
|
316086
316435
|
searchResults: "\u6700\u5927\u7D50\u679C\u6578",
|
|
@@ -316132,21 +316481,7 @@ var COPY = {
|
|
|
316132
316481
|
function renderComposer(copy, t2) {
|
|
316133
316482
|
return `<div class="composer-dock" id="composerDock">
|
|
316134
316483
|
<div class="turn-status" id="turnStatus" role="status" aria-live="polite"></div>
|
|
316135
|
-
|
|
316136
|
-
<div class="approval-panel-head">
|
|
316137
|
-
<span class="approval-mark" aria-hidden="true">!</span>
|
|
316138
|
-
<div>
|
|
316139
|
-
<span class="approval-eyebrow">${copy.approvalEyebrow}</span>
|
|
316140
|
-
<strong id="approvalTitle"></strong>
|
|
316141
|
-
</div>
|
|
316142
|
-
</div>
|
|
316143
|
-
<p class="approval-reason" id="approvalReason"></p>
|
|
316144
|
-
<pre class="approval-preview" id="approvalPreview" tabindex="0" hidden></pre>
|
|
316145
|
-
<div class="approval-actions">
|
|
316146
|
-
<button class="approval-button is-deny" id="denyApprovalButton" type="button">${copy.approvalDeny}</button>
|
|
316147
|
-
<button class="approval-button is-approve" id="approveApprovalButton" type="button">${copy.approvalApprove}</button>
|
|
316148
|
-
</div>
|
|
316149
|
-
</section>
|
|
316484
|
+
|
|
316150
316485
|
<form class="composer" id="composer">
|
|
316151
316486
|
<label class="sr-only" for="prompt">${copy.inputLabel}</label>
|
|
316152
316487
|
<textarea id="prompt" data-testid="composer-input" rows="1" maxlength="100000" autocomplete="off" autofocus placeholder="${copy.inputPlaceholder}" aria-autocomplete="list" aria-controls="slashCommandResults" aria-expanded="false"></textarea>
|
|
@@ -316159,11 +316494,13 @@ function renderComposer(copy, t2) {
|
|
|
316159
316494
|
<section class="attachment-shelf" id="attachmentShelf" aria-label="${copy.attachments}" hidden>
|
|
316160
316495
|
<div class="attachment-list" id="attachmentList"></div>
|
|
316161
316496
|
</section>
|
|
316162
|
-
<
|
|
316163
|
-
<
|
|
316497
|
+
<details class="prompt-queue" id="promptQueue" aria-label="${copy.queuedMessages}" hidden>
|
|
316498
|
+
<summary>${copy.queuedMessages} \xB7 <span id="queueCount">0</span></summary>
|
|
316499
|
+
<div class="prompt-queue-header"><button id="clearQueueButton" type="button">${copy.clearQueue}</button></div>
|
|
316164
316500
|
<div class="prompt-queue-list" id="promptQueueList"></div>
|
|
316165
|
-
</
|
|
316166
|
-
<div class="composer-
|
|
316501
|
+
</details>
|
|
316502
|
+
<div class="composer-toolbar">
|
|
316503
|
+
<div class="composer-models" role="group" aria-label="${copy.model}">
|
|
316167
316504
|
<div class="select-control provider-control" data-select-control data-select-placement="top" title="${copy.provider}">
|
|
316168
316505
|
<select class="native-select-proxy" id="providerSelect" aria-label="${copy.provider}" tabindex="-1" aria-hidden="true" hidden></select>
|
|
316169
316506
|
<button class="select-trigger provider-select-trigger" id="providerSelectTrigger" type="button" aria-label="${copy.provider}" aria-haspopup="listbox" aria-controls="providerSelectMenu" aria-expanded="false">
|
|
@@ -316178,13 +316515,6 @@ function renderComposer(copy, t2) {
|
|
|
316178
316515
|
</button>
|
|
316179
316516
|
<div class="select-menu model-select-menu" id="modelSelectMenu" role="listbox" aria-label="${copy.model}" hidden></div>
|
|
316180
316517
|
</div>
|
|
316181
|
-
</div>
|
|
316182
|
-
<div class="composer-toolbar">
|
|
316183
|
-
<div class="composer-tools">
|
|
316184
|
-
<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>
|
|
316185
|
-
<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>
|
|
316186
|
-
<input id="attachmentInput" data-testid="attachment-input" type="file" accept="image/png,image/jpeg,image/gif,image/webp" multiple hidden />
|
|
316187
|
-
<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>
|
|
316188
316518
|
<div class="select-control composer-select-control" data-select-control>
|
|
316189
316519
|
<select class="native-select-proxy" id="permissionSelect" aria-label="${copy.permission}" tabindex="-1" aria-hidden="true" hidden>
|
|
316190
316520
|
<option value="strict">${copy.modeStrict}</option>
|
|
@@ -316198,8 +316528,15 @@ function renderComposer(copy, t2) {
|
|
|
316198
316528
|
<div class="select-menu" id="permissionSelectMenu" role="listbox" aria-label="${copy.permission}" hidden></div>
|
|
316199
316529
|
</div>
|
|
316200
316530
|
</div>
|
|
316531
|
+
<div class="composer-tools">
|
|
316532
|
+
<button class="composer-chip" id="contextPickerButton" type="button" data-open-context aria-label="${copy.context}" aria-haspopup="dialog" aria-controls="contextPicker" aria-expanded="false">${renderUiIcon("context")}<span>${copy.context}</span><span class="context-chip-count" id="contextChipCount" aria-label="0" hidden>0</span></button>
|
|
316533
|
+
<button class="composer-chip" id="attachmentButton" type="button" aria-label="${copy.attachImage}">${renderUiIcon("image")}<span>${copy.attachments}</span><span class="context-chip-count" id="attachmentCount" aria-label="0" hidden>0</span></button>
|
|
316534
|
+
<input id="attachmentInput" data-testid="attachment-input" type="file" accept="image/png,image/jpeg,image/gif,image/webp" multiple hidden />
|
|
316535
|
+
<button class="composer-chip" id="searchToggle" type="button" aria-label="${copy.webSearch}" aria-pressed="false"><span class="web-status-dot" aria-hidden="true"></span><span>${copy.webSearch}</span></button>
|
|
316536
|
+
</div>
|
|
316201
316537
|
<div class="composer-actions">
|
|
316202
|
-
<button class="queue-button" id="queueButton" type="button"
|
|
316538
|
+
<button class="queue-button" id="queueButton" type="button" hidden>${copy.queueMessage}</button>
|
|
316539
|
+
<button class="queue-button" id="steerButton" type="button" hidden>${t2("Steer now", "\u7ACB\u5373\u5F15\u5BFC", "\u7ACB\u5373\u5F15\u5C0E")}</button>
|
|
316203
316540
|
<button class="send-button" id="sendButton" data-testid="composer-send" type="submit" aria-label="${copy.inputLabel}"><span id="sendGlyph" aria-hidden="true">\u2191</span></button>
|
|
316204
316541
|
</div>
|
|
316205
316542
|
</div>
|
|
@@ -316224,10 +316561,15 @@ function renderComposer(copy, t2) {
|
|
|
316224
316561
|
</div>
|
|
316225
316562
|
<div class="context-results" id="contextResults" role="listbox"></div>
|
|
316226
316563
|
<p class="context-empty" id="contextEmpty" role="status">${copy.contextPickerEmpty}</p>
|
|
316564
|
+
<button class="secondary-button" id="browserPreviewButton" type="button" aria-expanded="false" aria-controls="workbench">${renderUiIcon("panel")}<span>Safari</span></button>
|
|
316227
316565
|
<p class="context-picker-hint">${copy.contextPickerHint}</p>
|
|
316228
316566
|
</section>
|
|
316229
316567
|
</form>
|
|
316230
|
-
<p class="composer-hint"
|
|
316568
|
+
<p class="composer-hint" id="composerHint" data-idle="${copy.sendHint}" data-running="${t2(
|
|
316569
|
+
"Enter to queue \xB7 {steer} to steer \xB7 Shift+Enter for a new line",
|
|
316570
|
+
"Enter \u52A0\u5165\u961F\u5217 \xB7 {steer} \u5F15\u5BFC\u5F53\u524D\u4EFB\u52A1 \xB7 Shift+Enter \u6362\u884C",
|
|
316571
|
+
"Enter \u52A0\u5165\u4F47\u5217 \xB7 {steer} \u5F15\u5C0E\u76EE\u524D\u4EFB\u52D9 \xB7 Shift+Enter \u63DB\u884C"
|
|
316572
|
+
)}">${copy.sendHint}</p>
|
|
316231
316573
|
</div>`;
|
|
316232
316574
|
}
|
|
316233
316575
|
function renderWebUiPage(language) {
|
|
@@ -316263,10 +316605,10 @@ function renderWebUiPage(language) {
|
|
|
316263
316605
|
<button class="sidebar-collapse-button" id="sidebarCollapseButton" type="button" aria-label="${copy.collapseNavigation}" aria-controls="sidebar" aria-expanded="true">${renderUiIcon("panel")}</button>
|
|
316264
316606
|
</div>
|
|
316265
316607
|
|
|
316266
|
-
<button class="new-task-button" id="newTaskButton" data-testid="new-chat" type="button">
|
|
316608
|
+
<button class="new-task-button" aria-keyshortcuts="Control+n" id="newTaskButton" data-testid="new-chat" type="button">
|
|
316267
316609
|
<span class="new-task-icon">${renderUiIcon("add")}</span>
|
|
316268
316610
|
<span>${copy.newTask}</span>
|
|
316269
|
-
<kbd>Ctrl N</kbd>
|
|
316611
|
+
<kbd data-control-key="N">Ctrl N</kbd>
|
|
316270
316612
|
</button>
|
|
316271
316613
|
|
|
316272
316614
|
<div class="nav-section-heading project-heading">
|
|
@@ -316315,7 +316657,7 @@ function renderWebUiPage(language) {
|
|
|
316315
316657
|
|
|
316316
316658
|
<div class="sidebar-spacer"></div>
|
|
316317
316659
|
<footer class="sidebar-footer">
|
|
316318
|
-
<button class="nav-button" id="commandsButton" type="button" aria-label="${copy.commands}" aria-haspopup="dialog" aria-controls="commandPalette">${renderUiIcon("commands")}<span>${copy.commands}</span><kbd>Ctrl K</kbd></button>
|
|
316660
|
+
<button class="nav-button" aria-keyshortcuts="Control+k" id="commandsButton" type="button" aria-label="${copy.commands}" aria-haspopup="dialog" aria-controls="commandPalette">${renderUiIcon("commands")}<span>${copy.commands}</span><kbd data-control-key="K">Ctrl K</kbd></button>
|
|
316319
316661
|
<button class="nav-button" id="inspectorButton" type="button" aria-label="${copy.settings}" aria-controls="inspector" aria-expanded="false">${renderUiIcon("diagnostics")}<span>${copy.settings}</span></button>
|
|
316320
316662
|
</footer>
|
|
316321
316663
|
</aside>
|
|
@@ -316325,8 +316667,11 @@ function renderWebUiPage(language) {
|
|
|
316325
316667
|
<div class="topbar-start">
|
|
316326
316668
|
<button class="icon-button mobile-menu" id="menuButton" type="button" aria-label="${copy.openNavigation}" aria-controls="sidebar" aria-expanded="false">${renderUiIcon("menu")}</button>
|
|
316327
316669
|
<div class="workspace-heading">
|
|
316670
|
+
<details class="workspace-location" id="workspaceLocation">
|
|
316671
|
+
<summary title="${copy.projectPath}"><span id="workspacePath">Orbit</span>${renderUiIcon("down")}</summary>
|
|
316672
|
+
<div class="workspace-location-detail"><strong>${copy.projectPath}</strong><code id="workspaceFolder" dir="auto"></code></div>
|
|
316673
|
+
</details>
|
|
316328
316674
|
<strong id="workspaceName">Orbit</strong>
|
|
316329
|
-
<span id="workspacePath">${copy.localOnly}</span>
|
|
316330
316675
|
</div>
|
|
316331
316676
|
</div>
|
|
316332
316677
|
<div class="topbar-actions">
|
|
@@ -316338,10 +316683,9 @@ function renderWebUiPage(language) {
|
|
|
316338
316683
|
<span class="connection-dot"></span>
|
|
316339
316684
|
<span id="connectionLabel" role="status" aria-live="polite">${copy.connected}</span>
|
|
316340
316685
|
</button>
|
|
316686
|
+
<button class="approval-jump" id="jumpApproval" aria-controls="approvalPanel" type="button" aria-label="${t2("Review pending request", "\u67E5\u770B\u5F85\u786E\u8BA4\u4E8B\u9879", "\u67E5\u770B\u5F85\u78BA\u8A8D\u4E8B\u9805")}" hidden>${t2("Pending review", "\u5F85\u786E\u8BA4", "\u5F85\u78BA\u8A8D")}</button>
|
|
316341
316687
|
<nav class="workspace-tools" aria-label="${copy.details}">
|
|
316342
|
-
<button class="workspace-tool" id="
|
|
316343
|
-
<button class="workspace-tool" id="changesButton" data-testid="changes" type="button" aria-expanded="false" aria-controls="workbench">${renderUiIcon("changes")}<span>${copy.changes}</span></button>
|
|
316344
|
-
<button class="workspace-tool" id="tasksButton" data-testid="tasks" type="button" aria-expanded="false" aria-controls="workbench">${renderUiIcon("tasks")}<span>${t2("Run", "\u8FD0\u884C", "\u57F7\u884C")}</span></button>
|
|
316688
|
+
<button class="workspace-tool" id="tasksButton" title="${copy.inspectorTitle}" data-testid="tasks" type="button" aria-expanded="false" aria-controls="workbench">${renderUiIcon("tasks")}<span>${copy.inspectorTitle}</span></button>
|
|
316345
316689
|
</nav>
|
|
316346
316690
|
</div>
|
|
316347
316691
|
</header>
|
|
@@ -316355,10 +316699,28 @@ function renderWebUiPage(language) {
|
|
|
316355
316699
|
<main class="conversation" id="conversation">
|
|
316356
316700
|
<div class="message-scroll" id="messageScroll">
|
|
316357
316701
|
<div class="message-column" id="messages" role="log" aria-live="off" aria-relevant="additions" aria-label="${copy.messages}"></div>
|
|
316702
|
+
<section class="approval-panel" id="approvalPanel" tabindex="-1" role="region" aria-labelledby="approvalTitle" hidden>
|
|
316703
|
+
<div class="approval-panel-head">
|
|
316704
|
+
<span class="approval-mark" aria-hidden="true">!</span>
|
|
316705
|
+
<div>
|
|
316706
|
+
<span class="approval-eyebrow" id="approvalEyebrow" role="status">${copy.approvalEyebrow}</span>
|
|
316707
|
+
<strong id="approvalTitle"></strong>
|
|
316708
|
+
</div>
|
|
316709
|
+
<button class="diff-link" id="approvalDiffButton" type="button" aria-controls="changesPanel" hidden>${t2("View diff", "\u67E5\u770B\u5DEE\u5F02", "\u67E5\u770B\u5DEE\u7570")}</button>
|
|
316710
|
+
</div>
|
|
316711
|
+
<p class="approval-reason" id="approvalReason"></p>
|
|
316712
|
+
<div id="approvalInlinePreview"><pre class="approval-preview" id="approvalPreview" tabindex="0" hidden></pre></div>
|
|
316713
|
+
<div class="approval-actions">
|
|
316714
|
+
<button class="approval-button is-deny" id="denyApprovalButton" type="button">${copy.approvalDeny}</button>
|
|
316715
|
+
<button class="approval-button is-approve" id="approveApprovalButton" type="button">${copy.approvalApprove}</button>
|
|
316716
|
+
</div>
|
|
316717
|
+
</section>
|
|
316718
|
+
<div class="review-results" id="reviewResults" hidden>
|
|
316719
|
+
<button class="text-button" id="changesButton" data-testid="changes" aria-controls="changesPanel" aria-expanded="false" type="button">${copy.changedFiles} \xB7 <span id="resultFileCount"></span></button>
|
|
316720
|
+
<button class="text-button" id="verificationResultButton" aria-controls="verificationList" type="button">${copy.verification} \xB7 <span id="resultVerification"></span></button>
|
|
316721
|
+
</div>
|
|
316358
316722
|
<section class="empty-state" id="emptyState">
|
|
316359
|
-
<
|
|
316360
|
-
<h1>${copy.emptyTitle}</h1>
|
|
316361
|
-
<p class="empty-description">${copy.emptyBody}</p>
|
|
316723
|
+
<div class="empty-heading">${renderOrbitMark("welcome-mark")}<h1>${copy.emptyTitle}</h1></div>
|
|
316362
316724
|
<div class="empty-composer-slot" id="emptyComposerSlot">
|
|
316363
316725
|
${renderComposer(copy, t2)}
|
|
316364
316726
|
</div>
|
|
@@ -316406,7 +316768,7 @@ function renderWebUiPage(language) {
|
|
|
316406
316768
|
<h3>${copy.taskCenter}</h3>
|
|
316407
316769
|
<p>${copy.taskCenterDescription}</p>
|
|
316408
316770
|
</header>
|
|
316409
|
-
<section class="task-overview" id="taskOverview"
|
|
316771
|
+
<section class="task-overview" id="taskOverview"></section>
|
|
316410
316772
|
<section class="task-actions" aria-labelledby="taskActionsTitle">
|
|
316411
316773
|
<div class="section-heading"><h3 id="taskActionsTitle">${copy.taskActions}</h3></div>
|
|
316412
316774
|
<div class="task-action-grid">
|
|
@@ -316420,6 +316782,17 @@ function renderWebUiPage(language) {
|
|
|
316420
316782
|
</button>
|
|
316421
316783
|
</div>
|
|
316422
316784
|
</section>
|
|
316785
|
+
<section class="detail-section review-launcher">
|
|
316786
|
+
<div class="section-heading"><h3>${copy.reviewProject}</h3><span>READ ONLY</span></div>
|
|
316787
|
+
<p>${copy.reviewProjectBody}</p>
|
|
316788
|
+
<div class="review-preset-grid" id="reviewPresets">
|
|
316789
|
+
<button type="button" data-review-preset="comprehensive">${copy.reviewComprehensive}</button>
|
|
316790
|
+
<button type="button" data-review-preset="security">${copy.reviewSecurity}</button>
|
|
316791
|
+
<button type="button" data-review-preset="tests">${copy.reviewTests}</button>
|
|
316792
|
+
<button type="button" data-review-preset="performance">${copy.reviewPerformance}</button>
|
|
316793
|
+
<button type="button" data-review-preset="accessibility">${copy.reviewAccessibility}</button>
|
|
316794
|
+
</div>
|
|
316795
|
+
</section>
|
|
316423
316796
|
<section class="detail-section">
|
|
316424
316797
|
<div class="section-heading"><h3>${copy.taskPlan}</h3><span id="planCount">0</span></div>
|
|
316425
316798
|
<div class="review-list" id="planReview"><p class="review-empty">${copy.noPlan}</p></div>
|
|
@@ -316463,30 +316836,24 @@ function renderWebUiPage(language) {
|
|
|
316463
316836
|
</div>
|
|
316464
316837
|
</section>
|
|
316465
316838
|
<section class="tab-panel inspector-content" id="changesPanel" role="tabpanel" aria-labelledby="changesTab" hidden>
|
|
316466
|
-
<section class="detail-section
|
|
316467
|
-
<
|
|
316468
|
-
<
|
|
316469
|
-
<
|
|
316470
|
-
<button type="button" data-review-preset="comprehensive">${copy.reviewComprehensive}</button>
|
|
316471
|
-
<button type="button" data-review-preset="security">${copy.reviewSecurity}</button>
|
|
316472
|
-
<button type="button" data-review-preset="tests">${copy.reviewTests}</button>
|
|
316473
|
-
<button type="button" data-review-preset="performance">${copy.reviewPerformance}</button>
|
|
316474
|
-
<button type="button" data-review-preset="accessibility">${copy.reviewAccessibility}</button>
|
|
316475
|
-
</div>
|
|
316839
|
+
<section class="detail-section" id="approvalDiffDetail" hidden>
|
|
316840
|
+
<h3 id="approvalDiffTitle" tabindex="-1"></h3>
|
|
316841
|
+
<div id="approvalDiffSlot"></div>
|
|
316842
|
+
<button class="secondary-button" id="returnToApproval" type="button">${t2("Return to decision", "\u8FD4\u56DE\u5BA1\u67E5", "\u8FD4\u56DE\u5BE9\u67E5")}</button>
|
|
316476
316843
|
</section>
|
|
316477
316844
|
<section class="detail-section changes-summary-section">
|
|
316478
316845
|
<div class="section-heading"><h3>${copy.changedFiles}</h3><span id="changeCount">0</span></div>
|
|
316479
316846
|
<input class="field-control compact-filter-input" id="changeFilter" type="search" maxlength="200" autocomplete="off" placeholder="${copy.filterChanges}" aria-label="${copy.filterChanges}" />
|
|
316480
316847
|
<div class="changes-list" id="changesList" data-testid="changes-list"><p class="review-empty">${copy.noChanges}</p></div>
|
|
316481
316848
|
</section>
|
|
316482
|
-
<section class="detail-section">
|
|
316483
|
-
<div class="section-heading"><h3>${copy.checkpoints}</h3><span id="checkpointCount">0</span></div>
|
|
316484
|
-
<div class="checkpoint-list" id="checkpointList"><p class="review-empty">\u2014</p></div>
|
|
316485
|
-
</section>
|
|
316486
316849
|
<section class="detail-section">
|
|
316487
316850
|
<div class="section-heading"><h3>${copy.verification}</h3><span id="verificationCount">0</span></div>
|
|
316488
316851
|
<div class="verification-list" id="verificationList"><p class="review-empty">\u2014</p></div>
|
|
316489
316852
|
</section>
|
|
316853
|
+
<section class="detail-section">
|
|
316854
|
+
<div class="section-heading"><h3>${copy.checkpoints}</h3><span id="checkpointCount">0</span></div>
|
|
316855
|
+
<div class="checkpoint-list" id="checkpointList"><p class="review-empty">\u2014</p></div>
|
|
316856
|
+
</section>
|
|
316490
316857
|
<button class="secondary-button export-trace-button" id="exportTraceButton" type="button">${copy.exportTrace}</button>
|
|
316491
316858
|
</section>
|
|
316492
316859
|
|
|
@@ -316711,7 +317078,7 @@ function renderWebUiPage(language) {
|
|
|
316711
317078
|
<div class="project-path-field">
|
|
316712
317079
|
<label for="projectPathInput">${copy.projectPath}</label>
|
|
316713
317080
|
<div class="project-path-control">
|
|
316714
|
-
<input id="projectPathInput" type="text" maxlength="4096" autocomplete="off" spellcheck="false" placeholder="${copy.projectPathPlaceholder}" />
|
|
317081
|
+
<input id="projectPathInput" type="text" maxlength="4096" autocomplete="off" spellcheck="false" placeholder="${process.platform === "win32" ? copy.projectPathPlaceholder : process.platform === "darwin" ? "/Users/me/Projects/orbit" : "/home/me/projects/orbit"}" />
|
|
316715
317082
|
<button class="project-dialog-browse" id="projectDialogBrowse" type="button">${copy.browseProject}</button>
|
|
316716
317083
|
</div>
|
|
316717
317084
|
</div>
|
|
@@ -316728,11 +317095,11 @@ function renderWebUiPage(language) {
|
|
|
316728
317095
|
|
|
316729
317096
|
// src/runtime/webui/styles/WebUiComposerStyles.ts
|
|
316730
317097
|
var WEB_UI_COMPOSER_STYLES = String.raw`
|
|
316731
|
-
.composer-models { display: flex; align-items: center; gap: 2px;
|
|
317098
|
+
.composer-models { display: flex; align-items: center; gap: 2px; flex: 1 1 230px; min-width: 0; }
|
|
316732
317099
|
.composer-models .select-trigger { height: 32px; width: auto; max-width: 100%; border-color: transparent; background: transparent; box-shadow: none; font-size: 12px; }
|
|
316733
317100
|
.composer-models .provider-select-trigger { max-width: 145px; color: var(--muted); }
|
|
316734
317101
|
.composer-models .provider-control { flex: 0 1 auto; max-width: 145px; }
|
|
316735
|
-
.composer-models .model-control { min-width: 0; flex:
|
|
317102
|
+
.composer-models .model-control { min-width: 0; flex: 0 1 auto; }
|
|
316736
317103
|
.composer-models .model-select-trigger { max-width: min(320px, 100%); width: fit-content; }
|
|
316737
317104
|
.composer-models .select-trigger:hover { background: var(--surface-hover); }
|
|
316738
317105
|
.composer-dock {
|
|
@@ -316971,10 +317338,11 @@ var WEB_UI_COMPOSER_STYLES = String.raw`
|
|
|
316971
317338
|
|
|
316972
317339
|
.composer-toolbar {
|
|
316973
317340
|
display: flex;
|
|
316974
|
-
|
|
316975
|
-
|
|
316976
|
-
gap:
|
|
316977
|
-
padding-top:
|
|
317341
|
+
flex-wrap: wrap;
|
|
317342
|
+
align-items: center;
|
|
317343
|
+
gap: 4px 8px;
|
|
317344
|
+
padding-top: 5px;
|
|
317345
|
+
border-top: 1px solid var(--border);
|
|
316978
317346
|
}
|
|
316979
317347
|
|
|
316980
317348
|
.composer-tools {
|
|
@@ -317053,6 +317421,7 @@ var WEB_UI_COMPOSER_STYLES = String.raw`
|
|
|
317053
317421
|
}
|
|
317054
317422
|
|
|
317055
317423
|
.composer-actions {
|
|
317424
|
+
margin-left: auto;
|
|
317056
317425
|
display: flex;
|
|
317057
317426
|
align-items: center;
|
|
317058
317427
|
gap: 6px;
|
|
@@ -317087,6 +317456,14 @@ var WEB_UI_COMPOSER_STYLES = String.raw`
|
|
|
317087
317456
|
background: var(--surface-subtle);
|
|
317088
317457
|
}
|
|
317089
317458
|
|
|
317459
|
+
.prompt-queue > summary {
|
|
317460
|
+
cursor: pointer;
|
|
317461
|
+
color: var(--ink);
|
|
317462
|
+
font-size: 12px;
|
|
317463
|
+
font-weight: 600;
|
|
317464
|
+
}
|
|
317465
|
+
.prompt-queue:not([open]) { display: block; }
|
|
317466
|
+
.composer-actions .queue-button { width: auto; padding-inline: 6px; font-size: 11px; }
|
|
317090
317467
|
.prompt-queue[hidden] { display: none; }
|
|
317091
317468
|
|
|
317092
317469
|
.prompt-queue-header {
|
|
@@ -317312,6 +317689,16 @@ var WEB_UI_COMPOSER_STYLES = String.raw`
|
|
|
317312
317689
|
transform: translateX(-50%);
|
|
317313
317690
|
}
|
|
317314
317691
|
|
|
317692
|
+
/* Keep scroll controls clear of a decision in short windows. */
|
|
317693
|
+
.conversation:has(.approval-panel:not([hidden])) {
|
|
317694
|
+
grid-template-rows: minmax(min(96px, 20dvh), 1fr) auto auto;
|
|
317695
|
+
}
|
|
317696
|
+
.conversation:has(.approval-panel:not([hidden])) .message-navigation {
|
|
317697
|
+
position: static;
|
|
317698
|
+
grid-row: 2;
|
|
317699
|
+
justify-self: center;
|
|
317700
|
+
transform: none;
|
|
317701
|
+
}
|
|
317315
317702
|
.jump-bottom {
|
|
317316
317703
|
width: 32px;
|
|
317317
317704
|
height: 32px;
|
|
@@ -317394,16 +317781,36 @@ var WEB_UI_COMPOSER_STYLES = String.raw`
|
|
|
317394
317781
|
var WEB_UI_APPROVAL_STYLES = String.raw`
|
|
317395
317782
|
.approval-panel {
|
|
317396
317783
|
position: relative;
|
|
317397
|
-
|
|
317784
|
+
width: min(calc(100% - 32px), var(--content-width));
|
|
317785
|
+
margin: 0 auto 14px;
|
|
317398
317786
|
padding: 16px;
|
|
317399
317787
|
overflow: hidden;
|
|
317400
317788
|
color: var(--ink);
|
|
317401
317789
|
background: color-mix(in srgb, var(--surface-raised) 94%, var(--warning-soft));
|
|
317402
317790
|
border: 1px solid color-mix(in srgb, var(--warning) 32%, var(--border));
|
|
317403
317791
|
border-radius: 16px;
|
|
317404
|
-
box-shadow:
|
|
317792
|
+
box-shadow: none;
|
|
317405
317793
|
}
|
|
317406
317794
|
|
|
317795
|
+
.approval-jump {
|
|
317796
|
+
display: block;
|
|
317797
|
+
margin: 0;
|
|
317798
|
+
padding: 6px 9px;
|
|
317799
|
+
border: 0;
|
|
317800
|
+
background: var(--warning-soft);
|
|
317801
|
+
color: var(--ink);
|
|
317802
|
+
border-radius: var(--radius-sm);
|
|
317803
|
+
font: inherit;
|
|
317804
|
+
font-size: 12px;
|
|
317805
|
+
}
|
|
317806
|
+
.review-results:not([hidden]) {
|
|
317807
|
+
display: flex;
|
|
317808
|
+
flex-wrap: wrap;
|
|
317809
|
+
gap: 6px 14px;
|
|
317810
|
+
width: min(calc(100% - 32px), var(--content-width));
|
|
317811
|
+
margin: 0 auto 14px;
|
|
317812
|
+
}
|
|
317813
|
+
.approval-jump[hidden], #approvalDiffButton[hidden] { display: none; }
|
|
317407
317814
|
.approval-panel::before {
|
|
317408
317815
|
content: "";
|
|
317409
317816
|
position: absolute;
|
|
@@ -317424,6 +317831,20 @@ var WEB_UI_APPROVAL_STYLES = String.raw`
|
|
|
317424
317831
|
gap: 2px;
|
|
317425
317832
|
}
|
|
317426
317833
|
|
|
317834
|
+
.diff-link {
|
|
317835
|
+
flex: 0 0 auto;
|
|
317836
|
+
align-self: center;
|
|
317837
|
+
margin-left: auto;
|
|
317838
|
+
padding: 7px 5px;
|
|
317839
|
+
color: var(--accent-strong);
|
|
317840
|
+
background: transparent;
|
|
317841
|
+
border: 0;
|
|
317842
|
+
border-radius: 5px;
|
|
317843
|
+
font: 600 12px/1.4 var(--font-sans);
|
|
317844
|
+
text-decoration: underline;
|
|
317845
|
+
text-underline-offset: 3px;
|
|
317846
|
+
}
|
|
317847
|
+
|
|
317427
317848
|
.approval-mark {
|
|
317428
317849
|
width: 28px;
|
|
317429
317850
|
height: 28px;
|
|
@@ -318898,28 +319319,15 @@ var WEB_UI_CONVERSATION_STYLES = String.raw`
|
|
|
318898
319319
|
display: none;
|
|
318899
319320
|
}
|
|
318900
319321
|
|
|
318901
|
-
.
|
|
318902
|
-
display:
|
|
319322
|
+
.empty-heading {
|
|
319323
|
+
display: flex;
|
|
318903
319324
|
align-items: center;
|
|
318904
|
-
gap:
|
|
318905
|
-
width: fit-content;
|
|
318906
|
-
margin: 0 0 14px;
|
|
318907
|
-
color: var(--accent-strong);
|
|
318908
|
-
font: 720 10px/1.4 var(--font-mono);
|
|
318909
|
-
letter-spacing: 0.11em;
|
|
318910
|
-
}
|
|
318911
|
-
|
|
318912
|
-
.eyebrow::after {
|
|
318913
|
-
content: "";
|
|
318914
|
-
width: 28px;
|
|
318915
|
-
height: 1px;
|
|
318916
|
-
margin-left: 3px;
|
|
318917
|
-
background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent), transparent);
|
|
319325
|
+
gap: 14px;
|
|
318918
319326
|
}
|
|
318919
319327
|
|
|
318920
|
-
.
|
|
318921
|
-
width:
|
|
318922
|
-
height:
|
|
319328
|
+
.welcome-mark {
|
|
319329
|
+
width: 40px;
|
|
319330
|
+
height: 40px;
|
|
318923
319331
|
color: var(--accent-strong);
|
|
318924
319332
|
}
|
|
318925
319333
|
|
|
@@ -318933,14 +319341,6 @@ var WEB_UI_CONVERSATION_STYLES = String.raw`
|
|
|
318933
319341
|
line-height: 1.08;
|
|
318934
319342
|
}
|
|
318935
319343
|
|
|
318936
|
-
.empty-description {
|
|
318937
|
-
max-width: 600px;
|
|
318938
|
-
margin: 10px 0 0;
|
|
318939
|
-
color: var(--muted);
|
|
318940
|
-
font-size: 14.5px;
|
|
318941
|
-
line-height: 1.65;
|
|
318942
|
-
}
|
|
318943
|
-
|
|
318944
319344
|
.connection-help {
|
|
318945
319345
|
display: none;
|
|
318946
319346
|
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
@@ -319031,19 +319431,19 @@ var WEB_UI_CONVERSATION_STYLES = String.raw`
|
|
|
319031
319431
|
gap: 11px;
|
|
319032
319432
|
padding: 11px 14px;
|
|
319033
319433
|
color: var(--ink);
|
|
319034
|
-
background:
|
|
319035
|
-
border:
|
|
319036
|
-
border-
|
|
319434
|
+
background: transparent;
|
|
319435
|
+
border: 0;
|
|
319436
|
+
border-bottom: 1px solid var(--border);
|
|
319437
|
+
border-radius: 0;
|
|
319037
319438
|
text-align: left;
|
|
319038
|
-
box-shadow:
|
|
319439
|
+
box-shadow: none;
|
|
319039
319440
|
transition: background 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
|
|
319040
319441
|
}
|
|
319041
319442
|
|
|
319042
319443
|
.suggestion-card:hover {
|
|
319043
319444
|
background: var(--surface-raised);
|
|
319044
319445
|
border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
|
|
319045
|
-
box-shadow:
|
|
319046
|
-
transform: translateY(-2px);
|
|
319446
|
+
box-shadow: none;
|
|
319047
319447
|
}
|
|
319048
319448
|
|
|
319049
319449
|
.suggestion-icon {
|
|
@@ -319073,14 +319473,14 @@ var WEB_UI_CONVERSATION_STYLES = String.raw`
|
|
|
319073
319473
|
|
|
319074
319474
|
.suggestion-copy strong {
|
|
319075
319475
|
color: var(--ink-strong);
|
|
319076
|
-
font-size:
|
|
319476
|
+
font-size: 13px;
|
|
319077
319477
|
font-weight: 650;
|
|
319078
319478
|
}
|
|
319079
319479
|
|
|
319080
319480
|
.suggestion-copy small {
|
|
319081
319481
|
overflow: hidden;
|
|
319082
319482
|
color: var(--muted);
|
|
319083
|
-
font-size:
|
|
319483
|
+
font-size: 12px;
|
|
319084
319484
|
line-height: 1.4;
|
|
319085
319485
|
text-overflow: ellipsis;
|
|
319086
319486
|
white-space: nowrap;
|
|
@@ -319661,8 +320061,8 @@ var WEB_UI_FOUNDATION_STYLES = String.raw`
|
|
|
319661
320061
|
--radius-md: 12px;
|
|
319662
320062
|
--radius-lg: 18px;
|
|
319663
320063
|
--radius-xl: 24px;
|
|
319664
|
-
--font-sans: "Segoe UI Variable Text",
|
|
319665
|
-
--font-mono: "SFMono-Regular", Consolas, "Liberation Mono",
|
|
320064
|
+
--font-sans: -apple-system, system-ui, "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
|
|
320065
|
+
--font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
|
|
319666
320066
|
}
|
|
319667
320067
|
|
|
319668
320068
|
:root[data-theme="dark"] {
|
|
@@ -321788,8 +322188,7 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
321788
322188
|
display: none;
|
|
321789
322189
|
}
|
|
321790
322190
|
|
|
321791
|
-
.context-meter
|
|
321792
|
-
.workspace-heading span {
|
|
322191
|
+
.context-meter {
|
|
321793
322192
|
display: none;
|
|
321794
322193
|
}
|
|
321795
322194
|
|
|
@@ -321900,10 +322299,6 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
321900
322299
|
font-size: 44px;
|
|
321901
322300
|
}
|
|
321902
322301
|
|
|
321903
|
-
.empty-description {
|
|
321904
|
-
font-size: 15px;
|
|
321905
|
-
}
|
|
321906
|
-
|
|
321907
322302
|
.suggestion-card {
|
|
321908
322303
|
min-height: 68px;
|
|
321909
322304
|
}
|
|
@@ -322018,7 +322413,6 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
322018
322413
|
padding-top: env(safe-area-inset-top);
|
|
322019
322414
|
}
|
|
322020
322415
|
|
|
322021
|
-
.workspace-heading span,
|
|
322022
322416
|
.command-trigger,
|
|
322023
322417
|
.context-meter,
|
|
322024
322418
|
.brand-version {
|
|
@@ -322043,8 +322437,13 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
322043
322437
|
max-width: none;
|
|
322044
322438
|
}
|
|
322045
322439
|
|
|
322046
|
-
.workspace-tool {
|
|
322047
|
-
.workspace-tool
|
|
322440
|
+
.workspace-tool { width: 40px; height: 40px; justify-content: center; padding: 0; }
|
|
322441
|
+
.workspace-tool span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
|
|
322442
|
+
.workspace-tool .ui-icon { width: 18px; height: 18px; }
|
|
322443
|
+
.workspace-heading span, .workspace-heading strong { max-width: 100%; }
|
|
322444
|
+
.topbar-start { gap: 5px; }
|
|
322445
|
+
.welcome-mark { width: 32px; height: 32px; }
|
|
322446
|
+
.empty-heading { gap: 9px; }
|
|
322048
322447
|
.composer-models .provider-control, .composer-models .model-control { display: block; }
|
|
322049
322448
|
|
|
322050
322449
|
.message-column {
|
|
@@ -322102,10 +322501,6 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
322102
322501
|
padding: 38px 0 28px;
|
|
322103
322502
|
}
|
|
322104
322503
|
|
|
322105
|
-
.empty-description {
|
|
322106
|
-
font-size: 12px;
|
|
322107
|
-
}
|
|
322108
|
-
|
|
322109
322504
|
.suggestion-grid {
|
|
322110
322505
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
322111
322506
|
gap: 7px;
|
|
@@ -322179,7 +322574,7 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
322179
322574
|
}
|
|
322180
322575
|
|
|
322181
322576
|
.composer-models .select-trigger {
|
|
322182
|
-
height:
|
|
322577
|
+
height: 40px;
|
|
322183
322578
|
}
|
|
322184
322579
|
|
|
322185
322580
|
.context-shelf {
|
|
@@ -322268,10 +322663,20 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
322268
322663
|
}
|
|
322269
322664
|
}
|
|
322270
322665
|
|
|
322666
|
+
@media (max-width: 760px) {
|
|
322667
|
+
.composer-models { flex-basis: 100%; }
|
|
322668
|
+
.composer-models .composer-select-control { margin-left: auto; }
|
|
322669
|
+
.composer-tools { flex: 1 1 0; }
|
|
322670
|
+
}
|
|
322671
|
+
|
|
322672
|
+
@container preview-chat (max-width: 680px) {
|
|
322673
|
+
.composer-models { flex-basis: 100%; }
|
|
322674
|
+
.composer-models .composer-select-control { margin-left: auto; }
|
|
322675
|
+
.composer-tools { flex: 1 1 0; }
|
|
322676
|
+
}
|
|
322677
|
+
|
|
322271
322678
|
@media (max-width: 420px) {
|
|
322272
|
-
.composer-toolbar {
|
|
322273
|
-
gap: 8px;
|
|
322274
|
-
}
|
|
322679
|
+
.composer-toolbar { gap: 3px 5px; }
|
|
322275
322680
|
|
|
322276
322681
|
.task-overview-stats {
|
|
322277
322682
|
grid-template-columns: minmax(0, 1fr);
|
|
@@ -322289,10 +322694,6 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
322289
322694
|
font-size: 29px;
|
|
322290
322695
|
}
|
|
322291
322696
|
|
|
322292
|
-
.empty-description {
|
|
322293
|
-
max-width: 34ch;
|
|
322294
|
-
}
|
|
322295
|
-
|
|
322296
322697
|
}
|
|
322297
322698
|
|
|
322298
322699
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -323623,6 +324024,20 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
323623
324024
|
line-height: 1.22;
|
|
323624
324025
|
}
|
|
323625
324026
|
|
|
324027
|
+
.workspace-location { position: relative; width: fit-content; max-width: 100%; }
|
|
324028
|
+
.workspace-location summary { display: flex; align-items: center; gap: 4px; min-height: 18px; cursor: pointer; list-style: none; }
|
|
324029
|
+
.workspace-location summary::-webkit-details-marker { display: none; }
|
|
324030
|
+
.workspace-location .ui-icon { width: 10px; height: 10px; color: var(--faint); }
|
|
324031
|
+
.workspace-location[open] .ui-icon { transform: rotate(180deg); }
|
|
324032
|
+
.workspace-location-detail {
|
|
324033
|
+
position: absolute; z-index: 2; inset: calc(100% + 5px) auto auto 0;
|
|
324034
|
+
width: max-content; max-width: min(380px, 74vw); padding: 10px 12px;
|
|
324035
|
+
display: grid; gap: 5px; color: var(--ink);
|
|
324036
|
+
background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: 9px; box-shadow: var(--shadow-md);
|
|
324037
|
+
}
|
|
324038
|
+
.workspace-heading .workspace-location-detail strong { font-size: 11px; color: var(--muted); }
|
|
324039
|
+
.workspace-location-detail code { font: 12px/1.5 var(--font-mono); overflow-wrap: anywhere; user-select: all; }
|
|
324040
|
+
|
|
323626
324041
|
.workspace-heading strong,
|
|
323627
324042
|
.workspace-heading span {
|
|
323628
324043
|
max-width: min(32vw, 430px);
|
|
@@ -323640,7 +324055,7 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
323640
324055
|
|
|
323641
324056
|
.workspace-heading span {
|
|
323642
324057
|
color: var(--faint);
|
|
323643
|
-
font:
|
|
324058
|
+
font: 500 11px/1.3 var(--font-sans);
|
|
323644
324059
|
}
|
|
323645
324060
|
|
|
323646
324061
|
.icon-button,
|
|
@@ -323809,9 +324224,7 @@ var WEB_UI_WORKBENCH_STYLES = String.raw`
|
|
|
323809
324224
|
.workbench .inspector-content { padding-inline: 20px; padding-top: 12px; }
|
|
323810
324225
|
.workbench .task-overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
323811
324226
|
.workspace-view.is-preview-open:not(.is-preview-focus) .empty-state { width: calc(100% - 40px); max-width: none; padding-top: 20px; }
|
|
323812
|
-
.workspace-view.is-preview-open:not(.is-preview-focus) .empty-state .eyebrow { display: none; }
|
|
323813
324227
|
.workspace-view.is-preview-open:not(.is-preview-focus) .empty-state h1 { font-size: 20px; letter-spacing: -0.025em; line-height: 1.25; }
|
|
323814
|
-
.workspace-view.is-preview-open:not(.is-preview-focus) .empty-description { margin-top: 4px; font-size: 12px; line-height: 1.45; }
|
|
323815
324228
|
.workspace-view.is-preview-open:not(.is-preview-focus) .empty-composer-slot { margin-top: 14px; }
|
|
323816
324229
|
.workspace-view.is-preview-open:not(.is-preview-focus) .suggestion-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; margin-top: 10px; }
|
|
323817
324230
|
.workspace-view.is-preview-open:not(.is-preview-focus) .suggestion-card { min-height: 34px; gap: 6px; padding: 5px 7px; border-color: transparent; border-radius: 8px; box-shadow: none; background: transparent; }
|
|
@@ -325148,6 +325561,7 @@ var WebUiApprovalBroker = class {
|
|
|
325148
325561
|
clearTimeout(pending.timeout);
|
|
325149
325562
|
eventBus.emitEvent("web_approval_resolved", {
|
|
325150
325563
|
approvalId: pending.snapshot.id,
|
|
325564
|
+
kind: pending.snapshot.kind,
|
|
325151
325565
|
approved
|
|
325152
325566
|
});
|
|
325153
325567
|
pending.resolve(approved);
|
|
@@ -327766,6 +328180,14 @@ function findQueuedInput(items, reference) {
|
|
|
327766
328180
|
function usage(isZh) {
|
|
327767
328181
|
return isZh ? "\u7528\u6CD5: /queue [list|clear|remove <\u5E8F\u53F7>|edit <\u5E8F\u53F7> <\u5185\u5BB9>|up <\u5E8F\u53F7>|down <\u5E8F\u53F7>|next <\u5E8F\u53F7>|steer <\u5E8F\u53F7>]" : "Usage: /queue [list|clear|remove <n>|edit <n> <text>|up <n>|down <n>|next <n>|steer <n>]";
|
|
327768
328182
|
}
|
|
328183
|
+
function unavailableSteeringMessage(language) {
|
|
328184
|
+
return localizeOrbit(
|
|
328185
|
+
language,
|
|
328186
|
+
"Mid-turn steering requires an active single-agent task. During a multi-agent run, use the follow-up queue.",
|
|
328187
|
+
"\u53EA\u6709\u6B63\u5728\u8FD0\u884C\u7684\u5355\u667A\u80FD\u4F53\u4EFB\u52A1\u53EF\u4EE5\u63A5\u6536\u4E2D\u9014\u5F15\u5BFC\u3002\u591A\u667A\u80FD\u4F53\u4EFB\u52A1\u8BF7\u4F7F\u7528\u300C\u52A0\u5165\u961F\u5217\u300D\u3002",
|
|
328188
|
+
"\u53EA\u6709\u57F7\u884C\u4E2D\u7684\u55AE\u4EE3\u7406\u4EFB\u52D9\u53EF\u63A5\u53D7\u4E2D\u9014\u5F15\u5C0E\u3002\u591A\u4EE3\u7406\u4EFB\u52D9\u8ACB\u4F7F\u7528\u300C\u52A0\u5165\u4F47\u5217\u300D\u3002"
|
|
328189
|
+
);
|
|
328190
|
+
}
|
|
327769
328191
|
function handleInputQueueCommand(command, rawArguments, context) {
|
|
327770
328192
|
if (command !== "/queue") return void 0;
|
|
327771
328193
|
const isZh = context.language !== "en";
|
|
@@ -327841,9 +328263,7 @@ ${usage(false)}`
|
|
|
327841
328263
|
}
|
|
327842
328264
|
if (action === "steer") {
|
|
327843
328265
|
if (!context.canSteer) {
|
|
327844
|
-
context.printOutput(
|
|
327845
|
-
isZh ? "\u26A0\uFE0F \u53EA\u6709\u6B63\u5728\u8FD0\u884C\u7684\u5355\u667A\u80FD\u4F53\u4EFB\u52A1\u53EF\u4EE5\u63A5\u6536\u4E2D\u9014\u5F15\u5BFC\u3002" : "\u26A0\uFE0F Mid-turn steering requires an active single-agent task."
|
|
327846
|
-
);
|
|
328266
|
+
context.printOutput("\u26A0\uFE0F " + unavailableSteeringMessage(context.language));
|
|
327847
328267
|
return HANDLED;
|
|
327848
328268
|
}
|
|
327849
328269
|
context.loop.updateQueuedInput(input.id, { mode: "steer" });
|
|
@@ -330377,19 +330797,10 @@ ${picocolors21.green("\u2714")} Switched security mode to: ${picocolors21.green(
|
|
|
330377
330797
|
};
|
|
330378
330798
|
}
|
|
330379
330799
|
const orchestrated = this.webUiRunnable instanceof Orchestrator || this.multi && this.runCoordinator.isActive("terminal");
|
|
330800
|
+
if (action.mode === "steer" && (orchestrated || !this.tui.hasActiveRunnable())) {
|
|
330801
|
+
return { ok: false, message: unavailableSteeringMessage(this.config.language) };
|
|
330802
|
+
}
|
|
330380
330803
|
if (action.action === "update") {
|
|
330381
|
-
if (action.mode === "steer" && !this.tui.hasActiveRunnable()) {
|
|
330382
|
-
return {
|
|
330383
|
-
ok: false,
|
|
330384
|
-
message: "Steering requires a currently active task."
|
|
330385
|
-
};
|
|
330386
|
-
}
|
|
330387
|
-
if (action.mode === "steer" && orchestrated) {
|
|
330388
|
-
return {
|
|
330389
|
-
ok: false,
|
|
330390
|
-
message: "Multi-agent runs accept ordered follow-ups instead of mid-turn steering."
|
|
330391
|
-
};
|
|
330392
|
-
}
|
|
330393
330804
|
return this.loop.updateQueuedInput(action.inputId, {
|
|
330394
330805
|
...action.prompt !== void 0 ? { text: action.prompt } : {},
|
|
330395
330806
|
...action.mode !== void 0 ? { mode: action.mode } : {}
|
|
@@ -330422,9 +330833,8 @@ ${picocolors21.green("\u2714")} Switched security mode to: ${picocolors21.green(
|
|
|
330422
330833
|
};
|
|
330423
330834
|
}
|
|
330424
330835
|
}
|
|
330425
|
-
const mode = orchestrated ? "follow_up" : action.mode;
|
|
330426
330836
|
this.loop.enqueueUserInput(action.prompt, {
|
|
330427
|
-
mode,
|
|
330837
|
+
mode: action.mode,
|
|
330428
330838
|
source: "web",
|
|
330429
330839
|
attachments: action.attachments.map((attachment) => ({
|
|
330430
330840
|
type: "image",
|
|
@@ -330435,7 +330845,7 @@ ${picocolors21.green("\u2714")} Switched security mode to: ${picocolors21.green(
|
|
|
330435
330845
|
});
|
|
330436
330846
|
return {
|
|
330437
330847
|
ok: true,
|
|
330438
|
-
message: mode === "steer" ? "Steering instruction accepted." : "Follow-up added to the shared queue."
|
|
330848
|
+
message: action.mode === "steer" ? "Steering instruction accepted." : "Follow-up added to the shared queue."
|
|
330439
330849
|
};
|
|
330440
330850
|
}
|
|
330441
330851
|
startWebUiTask(action) {
|
|
@@ -330487,8 +330897,8 @@ ${picocolors21.green("\u2714")} Switched security mode to: ${picocolors21.green(
|
|
|
330487
330897
|
}),
|
|
330488
330898
|
reviewFileChange: ({ filePath, before, after, agentId, agentRole }) => this.webApprovalBroker.request({
|
|
330489
330899
|
kind: "change",
|
|
330490
|
-
title: isZh ? `\
|
|
330491
|
-
reason: isZh ? "\
|
|
330900
|
+
title: isZh ? this.config.language === "zh-TW" ? `\u4FDD\u7559\u5C0D ${filePath} \u7684\u8B8A\u66F4\uFF1F` : `\u4FDD\u7559\u5BF9 ${filePath} \u7684\u6539\u52A8\uFF1F` : `Keep the edit to ${filePath}?`,
|
|
330901
|
+
reason: isZh ? this.config.language === "zh-TW" ? "\u6A94\u6848\u5DF2\u4FEE\u6539\u3002\u8ACB\u6AA2\u67E5\u5DEE\u7570\uFF0C\u518D\u6C7A\u5B9A\u4FDD\u7559\u6216\u9084\u539F\u672C\u6B21\u8B8A\u66F4\u3002" : "\u6587\u4EF6\u5DF2\u4FEE\u6539\u3002\u8BF7\u68C0\u67E5\u5DEE\u5F02\uFF0C\u518D\u51B3\u5B9A\u4FDD\u7559\u6216\u56DE\u9000\u672C\u6B21\u6539\u52A8\u3002" : "Review the diff before keeping or rolling back this change.",
|
|
330492
330902
|
preview: DiffView.renderPlain(filePath, before, after),
|
|
330493
330903
|
agentId,
|
|
330494
330904
|
agentRole
|
|
@@ -331355,11 +331765,17 @@ ${thought.trim()}
|
|
|
331355
331765
|
` : "" : Renderer.formatThought,
|
|
331356
331766
|
formatMarkdown: screenReaderMode ? (text2) => text2 : Renderer.formatMarkdown,
|
|
331357
331767
|
askApproval: async (reason, preview) => {
|
|
331768
|
+
const question = localizeOrbit(
|
|
331769
|
+
this.config.language,
|
|
331770
|
+
"Allow this action?",
|
|
331771
|
+
"\u5141\u8BB8\u8FD9\u6B21\u64CD\u4F5C\uFF1F",
|
|
331772
|
+
"\u5141\u8A31\u9019\u6B21\u64CD\u4F5C\uFF1F"
|
|
331773
|
+
);
|
|
331358
331774
|
if (useFullscreenTui && tui.isActive) {
|
|
331359
331775
|
const message2 = preview ? `Risk Warning: ${reason}
|
|
331360
331776
|
Parameters: ${preview}
|
|
331361
|
-
|
|
331362
|
-
|
|
331777
|
+
${question}` : `Risk Warning: ${reason}
|
|
331778
|
+
${question}`;
|
|
331363
331779
|
return await Prompt.askApproval(message2);
|
|
331364
331780
|
}
|
|
331365
331781
|
const wasActive = useFullscreenTui && tui.isActive;
|
|
@@ -331369,7 +331785,7 @@ Risk Warning: ${reason}`);
|
|
|
331369
331785
|
if (preview) {
|
|
331370
331786
|
console.log(terminalColors.gray(`Parameters: ${preview}`));
|
|
331371
331787
|
}
|
|
331372
|
-
const approved = await Prompt.askApproval(
|
|
331788
|
+
const approved = await Prompt.askApproval(question);
|
|
331373
331789
|
if (wasActive) tui.start(this.config.budgetLimit);
|
|
331374
331790
|
return approved;
|
|
331375
331791
|
},
|
|
@@ -331449,15 +331865,24 @@ Risk Warning: ${reason}`);
|
|
|
331449
331865
|
);
|
|
331450
331866
|
return true;
|
|
331451
331867
|
}
|
|
331452
|
-
const mode = this.multi ? "follow_up" : "steer";
|
|
331453
331868
|
loop.enqueueUserInput(submitted, {
|
|
331454
|
-
mode,
|
|
331869
|
+
mode: "follow_up",
|
|
331455
331870
|
source: "terminal",
|
|
331456
331871
|
attachments: this.takeTerminalAttachments()
|
|
331457
331872
|
});
|
|
331458
|
-
|
|
331459
|
-
this.config.language
|
|
331873
|
+
const queued = localizeOrbit(
|
|
331874
|
+
this.config.language,
|
|
331875
|
+
"\u25CF Follow-up queued.",
|
|
331876
|
+
"\u25CF \u5DF2\u52A0\u5165\u961F\u5217\u3002",
|
|
331877
|
+
"\u25CF \u5DF2\u52A0\u5165\u4F47\u5217\u3002"
|
|
331878
|
+
);
|
|
331879
|
+
const steerHint = this.multi ? "" : localizeOrbit(
|
|
331880
|
+
this.config.language,
|
|
331881
|
+
" Use /queue steer <n> to steer the current task.",
|
|
331882
|
+
" \u4F7F\u7528 /queue steer <\u5E8F\u53F7> \u5F15\u5BFC\u5F53\u524D\u4EFB\u52A1\u3002",
|
|
331883
|
+
" \u4F7F\u7528 /queue steer <\u5E8F\u865F> \u5F15\u5C0E\u76EE\u524D\u4EFB\u52D9\u3002"
|
|
331460
331884
|
);
|
|
331885
|
+
tui.addLog(queued + steerHint);
|
|
331461
331886
|
return true;
|
|
331462
331887
|
} catch (error) {
|
|
331463
331888
|
tui.addLog(
|