@orbit-build/cli 3.0.0 → 3.1.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
|
})
|
|
@@ -291362,17 +291363,25 @@ async function reviewEditTransaction(options) {
|
|
|
291362
291363
|
}
|
|
291363
291364
|
if (options.autoAccept) return { ok: true };
|
|
291364
291365
|
try {
|
|
291366
|
+
const local = (en, zh, tw) => options.language === "zh-TW" ? tw : options.language === "zh" ? zh : en;
|
|
291365
291367
|
const choice = interaction.reviewFileChange ? await interaction.reviewFileChange({
|
|
291366
291368
|
filePath,
|
|
291367
291369
|
before,
|
|
291368
291370
|
after,
|
|
291369
291371
|
agentId: options.agent?.id,
|
|
291370
291372
|
agentRole: options.agent?.role
|
|
291371
|
-
}) ? "yes" : "no" : await interaction.prompt?.askSelect(
|
|
291372
|
-
|
|
291373
|
-
|
|
291374
|
-
|
|
291375
|
-
|
|
291373
|
+
}) ? "yes" : "no" : await interaction.prompt?.askSelect(
|
|
291374
|
+
local(
|
|
291375
|
+
`Keep the edit to ${filePath}?`,
|
|
291376
|
+
`\u4FDD\u7559\u5BF9 ${filePath} \u7684\u6539\u52A8\uFF1F`,
|
|
291377
|
+
`\u4FDD\u7559\u5C0D ${filePath} \u7684\u8B8A\u66F4\uFF1F`
|
|
291378
|
+
),
|
|
291379
|
+
[
|
|
291380
|
+
{ value: "yes", label: local("Keep change", "\u4FDD\u7559\u6539\u52A8", "\u4FDD\u7559\u8B8A\u66F4") },
|
|
291381
|
+
{ value: "hunks", label: local("Review individual hunks", "\u9010\u6BB5\u5BA1\u67E5", "\u9010\u6BB5\u5BE9\u67E5") },
|
|
291382
|
+
{ value: "no", label: local("Revert this change", "\u56DE\u9000\u672C\u6B21\u6539\u52A8", "\u9084\u539F\u672C\u6B21\u8B8A\u66F4") }
|
|
291383
|
+
]
|
|
291384
|
+
);
|
|
291376
291385
|
if (!unchanged())
|
|
291377
291386
|
return {
|
|
291378
291387
|
ok: false,
|
|
@@ -293677,6 +293686,7 @@ ${buildCommitContextForModel(stdout2)}`
|
|
|
293677
293686
|
}
|
|
293678
293687
|
if (finalResult.ok && targetPath && absoluteTargetPath && isFileMutationTool(tc.name)) {
|
|
293679
293688
|
const review = await reviewEditTransaction({
|
|
293689
|
+
language: this.config.language,
|
|
293680
293690
|
cwd: this.cwd,
|
|
293681
293691
|
filePath: targetPath,
|
|
293682
293692
|
absolutePath: absoluteTargetPath,
|
|
@@ -293880,9 +293890,9 @@ ${guardNudge.message}` : ""),
|
|
|
293880
293890
|
this.interaction.showText(
|
|
293881
293891
|
` Modified files: ${modifiedFiles.length > 0 ? modifiedFiles.join(", ") : "None"}`
|
|
293882
293892
|
);
|
|
293883
|
-
const
|
|
293893
|
+
const verificationSummary2 = this.verificationSummary();
|
|
293884
293894
|
this.interaction.showText(
|
|
293885
|
-
` Verification contract: ${
|
|
293895
|
+
` Verification contract: ${verificationSummary2}.`
|
|
293886
293896
|
);
|
|
293887
293897
|
this.interaction.showText(` Session Cost: ${this.formatSessionCost()}`);
|
|
293888
293898
|
if (!this.terminalFailure && !iterationLimitReached && this.config.autoCommit && modifiedFiles.length > 0) {
|
|
@@ -305641,27 +305651,30 @@ var FullscreenTui = class {
|
|
|
305641
305651
|
if (this.keymapMode === "vim") {
|
|
305642
305652
|
statusText = morandi2.accent(getVimModeLabel(this.vimMode, languageIsZh)) + morandi2.gray(" \xB7 ") + statusText;
|
|
305643
305653
|
}
|
|
305654
|
+
const language = this.config?.language ?? "zh";
|
|
305655
|
+
const queueHint = localizeOrbit(language, " Queue", " \u52A0\u5165\u961F\u5217", " \u52A0\u5165\u4F47\u5217");
|
|
305656
|
+
const interruptHint = this.isThinking ? localizeOrbit(language, " Stop run", " \u505C\u6B62\u6267\u884C", " \u505C\u6B62\u57F7\u884C") : localizeOrbit(language, " Cancel", " \u53D6\u6D88", " \u53D6\u6D88");
|
|
305644
305657
|
let keybindings = this.historyScrollOffset > 0 ? morandi2.gray("[End]") + morandi2.dim(languageIsZh ? " \u8FD4\u56DE\u5E95\u90E8" : " Bottom") : columns >= 88 ? [
|
|
305645
305658
|
...this.isThinking ? [
|
|
305646
|
-
morandi2.gray("[Enter]") + morandi2.dim(
|
|
305659
|
+
morandi2.gray("[Enter]") + morandi2.dim(queueHint)
|
|
305647
305660
|
] : [],
|
|
305648
|
-
morandi2.gray("[^C]") + morandi2.dim(
|
|
305661
|
+
morandi2.gray("[^C]") + morandi2.dim(interruptHint),
|
|
305649
305662
|
morandi2.gray("[^J]") + morandi2.dim(languageIsZh ? " \u6362\u884C" : " Newline"),
|
|
305650
305663
|
morandi2.gray("[^R]") + morandi2.dim(languageIsZh ? " \u5386\u53F2" : " History"),
|
|
305651
305664
|
morandi2.gray("[^L]") + morandi2.dim(languageIsZh ? " \u6E05\u5C4F" : " Clear"),
|
|
305652
305665
|
morandi2.gray("[^P]") + morandi2.dim(languageIsZh ? " \u547D\u4EE4" : " Cmds")
|
|
305653
305666
|
].join(" ") : columns >= 62 ? [
|
|
305654
305667
|
...this.isThinking ? [
|
|
305655
|
-
morandi2.gray("[\u21B5]") + morandi2.dim(
|
|
305668
|
+
morandi2.gray("[\u21B5]") + morandi2.dim(queueHint)
|
|
305656
305669
|
] : [],
|
|
305657
|
-
morandi2.gray("[^C]") + morandi2.dim(
|
|
305670
|
+
morandi2.gray("[^C]") + morandi2.dim(interruptHint),
|
|
305658
305671
|
morandi2.gray("[^P]") + morandi2.dim(languageIsZh ? " \u547D\u4EE4" : " Cmds")
|
|
305659
305672
|
].join(" ") : morandi2.gray("[^C]") + morandi2.dim(languageIsZh ? " \u9000\u51FA" : " Exit");
|
|
305660
305673
|
let statusTextLength = this.getStringWidth(statusText);
|
|
305661
305674
|
let keybindingsLength = this.getStringWidth(keybindings);
|
|
305662
305675
|
if (statusTextLength + keybindingsLength > columns - 8) {
|
|
305663
305676
|
keybindings = [
|
|
305664
|
-
morandi2.gray("[^C]") + morandi2.dim(
|
|
305677
|
+
morandi2.gray("[^C]") + morandi2.dim(interruptHint),
|
|
305665
305678
|
morandi2.gray("[^P]") + morandi2.dim(languageIsZh ? " \u547D\u4EE4" : " Cmds")
|
|
305666
305679
|
].join(" ");
|
|
305667
305680
|
keybindingsLength = this.getStringWidth(keybindings);
|
|
@@ -306548,6 +306561,24 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
|
|
|
306548
306561
|
if (state.busy) stopTurn();
|
|
306549
306562
|
else submitTurn(elements.prompt.value);
|
|
306550
306563
|
});
|
|
306564
|
+
function focusPendingApproval() {
|
|
306565
|
+
if (!state.pendingApproval) return;
|
|
306566
|
+
showConversation();
|
|
306567
|
+
elements.approvalPanel.focus({ preventScroll: true });
|
|
306568
|
+
elements.approvalPanel.scrollIntoView({ block: 'nearest' });
|
|
306569
|
+
}
|
|
306570
|
+
elements.jumpApproval.addEventListener('click', focusPendingApproval);
|
|
306571
|
+
elements.approvalDiffButton.addEventListener('click', () => {
|
|
306572
|
+
setWorkbench('changes', false);
|
|
306573
|
+
byId('approvalDiffTitle').focus();
|
|
306574
|
+
byId('approvalDiffDetail').scrollIntoView({ block: 'nearest' });
|
|
306575
|
+
});
|
|
306576
|
+
byId('returnToApproval').addEventListener('click', () => {
|
|
306577
|
+
setWorkbench(null, false);
|
|
306578
|
+
focusPendingApproval();
|
|
306579
|
+
});
|
|
306580
|
+
byId('browserPreviewButton').addEventListener('click', () => closeContextPicker({ skipRestore: true }));
|
|
306581
|
+
elements.steerButton.addEventListener('click', () => void queuePrompt(elements.prompt.value, 'steer'));
|
|
306551
306582
|
elements.denyApprovalButton.addEventListener('click', () => void respondToApproval(false));
|
|
306552
306583
|
elements.approveApprovalButton.addEventListener('click', () => void respondToApproval(true));
|
|
306553
306584
|
elements.buildPlanButton.addEventListener('click', () => void startTaskAction(elements.buildPlanButton));
|
|
@@ -306732,13 +306763,17 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
|
|
|
306732
306763
|
elements.inspectorButton.addEventListener('click', () => {
|
|
306733
306764
|
setInspector(!elements.inspector.classList.contains('is-open'), 'settings');
|
|
306734
306765
|
});
|
|
306735
|
-
elements.tasksButton.addEventListener('click',
|
|
306736
|
-
setInspector(elements.tasksButton.getAttribute('aria-expanded') !== 'true', 'tasks');
|
|
306737
|
-
closeSidebar();
|
|
306738
|
-
});
|
|
306766
|
+
elements.tasksButton.addEventListener('click', toggleTaskDetails);
|
|
306739
306767
|
elements.changesButton.addEventListener('click', () => {
|
|
306740
|
-
|
|
306741
|
-
|
|
306768
|
+
setWorkbench('changes', false);
|
|
306769
|
+
const first = elements.changesList.querySelector('summary');
|
|
306770
|
+
if (first) { first.parentElement.open = true; first.focus(); }
|
|
306771
|
+
else elements.changeFilter.focus();
|
|
306772
|
+
});
|
|
306773
|
+
byId('verificationResultButton').addEventListener('click', () => {
|
|
306774
|
+
setWorkbench('changes', false);
|
|
306775
|
+
const result = elements.verificationList.querySelector('.is-error') || elements.verificationList.firstElementChild;
|
|
306776
|
+
if (result) { result.tabIndex = -1; result.focus(); }
|
|
306742
306777
|
});
|
|
306743
306778
|
elements.contextMeter.addEventListener('click', () => setInspector(true, 'activity'));
|
|
306744
306779
|
elements.inspectorClose.addEventListener('click', () => setInspector(false));
|
|
@@ -307718,12 +307753,12 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
|
|
|
307718
307753
|
setInspector(false);
|
|
307719
307754
|
closeSidebar();
|
|
307720
307755
|
}
|
|
307721
|
-
if ((event.ctrlKey || event.metaKey) && ['k', 'p'].includes(event.key.toLowerCase())) {
|
|
307756
|
+
if ((event.ctrlKey || event.metaKey && event.key.toLowerCase() === 'k') && ['k', 'p'].includes(event.key.toLowerCase())) {
|
|
307722
307757
|
event.preventDefault();
|
|
307723
307758
|
if (elements.commandPalette.hidden) openCommandPalette();
|
|
307724
307759
|
else closeCommandPalette();
|
|
307725
307760
|
}
|
|
307726
|
-
if (
|
|
307761
|
+
if (event.ctrlKey && event.key.toLowerCase() === 'n') {
|
|
307727
307762
|
event.preventDefault();
|
|
307728
307763
|
if (!state.busy) void updateSession({ action: 'new' });
|
|
307729
307764
|
}
|
|
@@ -308465,13 +308500,16 @@ function createApprovalController(runtime) {
|
|
|
308465
308500
|
api,
|
|
308466
308501
|
showToast,
|
|
308467
308502
|
reconcileStatus,
|
|
308468
|
-
revealApproval
|
|
308503
|
+
revealApproval,
|
|
308504
|
+
placePreview
|
|
308469
308505
|
} = runtime;
|
|
308470
308506
|
function renderPendingApproval(approval) {
|
|
308471
308507
|
const newRequest = Boolean(
|
|
308472
308508
|
approval?.id && approval.id !== state.pendingApproval?.id
|
|
308473
308509
|
);
|
|
308510
|
+
const changedPreview = newRequest || state.pendingApproval?.preview !== approval?.preview;
|
|
308474
308511
|
state.pendingApproval = approval?.id ? approval : null;
|
|
308512
|
+
placePreview(state.pendingApproval);
|
|
308475
308513
|
const visible = Boolean(state.pendingApproval);
|
|
308476
308514
|
elements.approvalPanel.hidden = !visible;
|
|
308477
308515
|
if (!state.pendingApproval) {
|
|
@@ -308479,9 +308517,13 @@ function createApprovalController(runtime) {
|
|
|
308479
308517
|
elements.approvalReason.textContent = "";
|
|
308480
308518
|
elements.approvalPreview.textContent = "";
|
|
308481
308519
|
elements.approvalPreview.hidden = true;
|
|
308482
|
-
state.approvalSubmitting =
|
|
308520
|
+
state.approvalSubmitting = null;
|
|
308483
308521
|
return;
|
|
308484
308522
|
}
|
|
308523
|
+
if (newRequest) state.approvalSubmitting = null;
|
|
308524
|
+
const change = state.pendingApproval.kind === "change";
|
|
308525
|
+
elements.approveApprovalButton.textContent = change ? copy.keepChange : copy.allowOnce;
|
|
308526
|
+
elements.denyApprovalButton.textContent = change ? copy.revertChange : copy.denyOnce;
|
|
308485
308527
|
elements.approvalTitle.textContent = state.pendingApproval.title || copy.approvalRequired;
|
|
308486
308528
|
const approvalOwner = state.pendingApproval.agentRole || state.pendingApproval.agentId || "";
|
|
308487
308529
|
elements.approvalReason.textContent = [
|
|
@@ -308489,8 +308531,8 @@ function createApprovalController(runtime) {
|
|
|
308489
308531
|
state.pendingApproval.reason || ""
|
|
308490
308532
|
].filter(Boolean).join(" \xB7 ");
|
|
308491
308533
|
const preview = String(state.pendingApproval.preview || "");
|
|
308492
|
-
elements.approvalPreview.replaceChildren();
|
|
308493
|
-
if (preview) {
|
|
308534
|
+
if (changedPreview) elements.approvalPreview.replaceChildren();
|
|
308535
|
+
if (changedPreview && preview) {
|
|
308494
308536
|
for (const line of preview.split("\n")) {
|
|
308495
308537
|
const row = document.createElement("span");
|
|
308496
308538
|
row.className = "approval-preview-line";
|
|
@@ -308506,14 +308548,14 @@ function createApprovalController(runtime) {
|
|
|
308506
308548
|
}
|
|
308507
308549
|
}
|
|
308508
308550
|
elements.approvalPreview.hidden = !preview;
|
|
308509
|
-
elements.denyApprovalButton.disabled = state.approvalSubmitting;
|
|
308510
|
-
elements.approveApprovalButton.disabled = state.approvalSubmitting;
|
|
308551
|
+
elements.denyApprovalButton.disabled = !state.ready || Boolean(state.approvalSubmitting);
|
|
308552
|
+
elements.approveApprovalButton.disabled = !state.ready || Boolean(state.approvalSubmitting);
|
|
308511
308553
|
if (newRequest) revealApproval();
|
|
308512
308554
|
}
|
|
308513
308555
|
async function respondToApproval(approved) {
|
|
308514
308556
|
const approval = state.pendingApproval;
|
|
308515
|
-
if (!approval || state.approvalSubmitting) return;
|
|
308516
|
-
state.approvalSubmitting =
|
|
308557
|
+
if (!approval || !state.ready || state.approvalSubmitting) return;
|
|
308558
|
+
state.approvalSubmitting = approval.id;
|
|
308517
308559
|
renderPendingApproval(approval);
|
|
308518
308560
|
try {
|
|
308519
308561
|
await api("/api/approval", {
|
|
@@ -308522,14 +308564,16 @@ function createApprovalController(runtime) {
|
|
|
308522
308564
|
body: JSON.stringify({ id: approval.id, approved: Boolean(approved) })
|
|
308523
308565
|
});
|
|
308524
308566
|
showToast(
|
|
308525
|
-
approved ? copy.approvalApproved : copy.approvalDenied,
|
|
308567
|
+
approval.kind === "change" ? copy.reviewSent : approved ? copy.approvalApproved : copy.approvalDenied,
|
|
308526
308568
|
approved ? "success" : "warning"
|
|
308527
308569
|
);
|
|
308528
|
-
renderPendingApproval(null);
|
|
308570
|
+
if (state.pendingApproval?.id === approval.id) renderPendingApproval(null);
|
|
308529
308571
|
void reconcileStatus();
|
|
308530
308572
|
} catch (error) {
|
|
308531
|
-
state.
|
|
308532
|
-
|
|
308573
|
+
if (state.pendingApproval?.id === approval.id) {
|
|
308574
|
+
state.approvalSubmitting = null;
|
|
308575
|
+
renderPendingApproval(approval);
|
|
308576
|
+
}
|
|
308533
308577
|
showToast(
|
|
308534
308578
|
error instanceof Error ? error.message : String(error),
|
|
308535
308579
|
"error"
|
|
@@ -308539,10 +308583,17 @@ function createApprovalController(runtime) {
|
|
|
308539
308583
|
return { renderPendingApproval, respondToApproval };
|
|
308540
308584
|
}
|
|
308541
308585
|
var WEB_UI_CLIENT_APPROVAL_SCRIPT = ` const { renderPendingApproval, respondToApproval } = (${createApprovalController.toString()})({ copy, elements, state, api, showToast, reconcileStatus, revealApproval: () => {
|
|
308542
|
-
|
|
308543
|
-
|
|
308544
|
-
|
|
308545
|
-
|
|
308586
|
+
if (state.stickToBottom && !elements.conversation.inert) scrollToBottom(false);
|
|
308587
|
+
}, placePreview: (approval) => {
|
|
308588
|
+
const isChange = approval?.kind === 'change';
|
|
308589
|
+
const hasDiff = Boolean(isChange && approval.preview);
|
|
308590
|
+
const slot = hasDiff ? byId('approvalDiffSlot') : byId('approvalInlinePreview');
|
|
308591
|
+
if (elements.approvalPreview.parentNode !== slot) slot.append(elements.approvalPreview);
|
|
308592
|
+
elements.approvalDiffButton.hidden = !hasDiff;
|
|
308593
|
+
byId('approvalDiffDetail').hidden = !hasDiff;
|
|
308594
|
+
byId('approvalDiffTitle').textContent = hasDiff ? approval.title : '';
|
|
308595
|
+
elements.approvalEyebrow.textContent = isChange ? copy.fileReview : copy.approvalRequired;
|
|
308596
|
+
elements.jumpApproval.hidden = !approval;
|
|
308546
308597
|
} });
|
|
308547
308598
|
|
|
308548
308599
|
`;
|
|
@@ -309085,7 +309136,7 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309085
309136
|
cancelling: '正在取消',
|
|
309086
309137
|
thinking: 'Orbit 正在思考…',
|
|
309087
309138
|
sendAction: '发送消息',
|
|
309088
|
-
stopAction: '
|
|
309139
|
+
stopAction: chinese('停止执行', '停止執行'),
|
|
309089
309140
|
stopping: '正在停止…',
|
|
309090
309141
|
stopped: '已停止生成',
|
|
309091
309142
|
working: '正在处理任务…',
|
|
@@ -309110,6 +309161,13 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309110
309161
|
settingsSaved: '设置已更新',
|
|
309111
309162
|
settingsSaving: '正在应用设置…',
|
|
309112
309163
|
nothingRunning: '当前没有正在运行的任务。',
|
|
309164
|
+
keepChange: chinese('保留改动', '保留變更'),
|
|
309165
|
+
revertChange: chinese('回退本次改动', '還原本次變更'),
|
|
309166
|
+
fileReview: chinese('文件已修改,等待审查', '檔案已修改,等待審查'),
|
|
309167
|
+
reviewClosed: chinese('本次文件审查已结束', '本次檔案審查已結束'),
|
|
309168
|
+
reviewSent: chinese('已提交审查决定', '已提交審查決定'),
|
|
309169
|
+
allowOnce: chinese('允许这次操作', '允許這次操作'),
|
|
309170
|
+
denyOnce: chinese('拒绝', '拒絕'),
|
|
309113
309171
|
approvalRequired: '等待你的确认',
|
|
309114
309172
|
approvalApproved: '已允许操作',
|
|
309115
309173
|
approvalDenied: '已拒绝操作',
|
|
@@ -309241,7 +309299,7 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309241
309299
|
cancelling: 'Cancelling',
|
|
309242
309300
|
thinking: 'Orbit is thinking…',
|
|
309243
309301
|
sendAction: 'Send message',
|
|
309244
|
-
stopAction: 'Stop
|
|
309302
|
+
stopAction: 'Stop run',
|
|
309245
309303
|
stopping: 'Stopping…',
|
|
309246
309304
|
stopped: 'Generation stopped',
|
|
309247
309305
|
working: 'Working on your task…',
|
|
@@ -309266,6 +309324,13 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309266
309324
|
settingsSaved: 'Settings updated',
|
|
309267
309325
|
settingsSaving: 'Applying settings…',
|
|
309268
309326
|
nothingRunning: 'Nothing is currently running.',
|
|
309327
|
+
keepChange: 'Keep change',
|
|
309328
|
+
revertChange: 'Revert this change',
|
|
309329
|
+
fileReview: 'File edited · review required',
|
|
309330
|
+
reviewClosed: 'File review closed',
|
|
309331
|
+
reviewSent: 'Review decision submitted',
|
|
309332
|
+
allowOnce: 'Allow this action',
|
|
309333
|
+
denyOnce: 'Deny',
|
|
309269
309334
|
approvalRequired: 'Waiting for your approval',
|
|
309270
309335
|
approvalApproved: 'Action approved',
|
|
309271
309336
|
approvalDenied: 'Action denied',
|
|
@@ -309607,6 +309672,7 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309607
309672
|
promptQueue: byId('promptQueue'),
|
|
309608
309673
|
promptQueueList: byId('promptQueueList'),
|
|
309609
309674
|
clearQueueButton: byId('clearQueueButton'),
|
|
309675
|
+
steerButton: byId('steerButton'),
|
|
309610
309676
|
queueButton: byId('queueButton'),
|
|
309611
309677
|
contextPicker: byId('contextPicker'),
|
|
309612
309678
|
contextPickerClose: byId('contextPickerClose'),
|
|
@@ -309616,6 +309682,9 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309616
309682
|
sendButton: byId('sendButton'),
|
|
309617
309683
|
sendGlyph: byId('sendGlyph'),
|
|
309618
309684
|
turnStatus: byId('turnStatus'),
|
|
309685
|
+
jumpApproval: byId('jumpApproval'),
|
|
309686
|
+
approvalDiffButton: byId('approvalDiffButton'),
|
|
309687
|
+
approvalEyebrow: byId('approvalEyebrow'),
|
|
309619
309688
|
approvalPanel: byId('approvalPanel'),
|
|
309620
309689
|
approvalTitle: byId('approvalTitle'),
|
|
309621
309690
|
approvalReason: byId('approvalReason'),
|
|
@@ -309747,7 +309816,9 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309747
309816
|
externalTurn: false,
|
|
309748
309817
|
useBearerTransport: false,
|
|
309749
309818
|
pendingApproval: null,
|
|
309750
|
-
approvalSubmitting:
|
|
309819
|
+
approvalSubmitting: null,
|
|
309820
|
+
statusEpoch: 0,
|
|
309821
|
+
statusRequest: 0,
|
|
309751
309822
|
pendingSessionDeleteId: null,
|
|
309752
309823
|
sessionData: null,
|
|
309753
309824
|
sessionQuery: '',
|
|
@@ -309760,6 +309831,7 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
309760
309831
|
projectLaunchPending: false,
|
|
309761
309832
|
promptQueue: [],
|
|
309762
309833
|
queueEditingId: null,
|
|
309834
|
+
queueSubmitting: false,
|
|
309763
309835
|
queueEditDraft: '',
|
|
309764
309836
|
agentSteeringId: null,
|
|
309765
309837
|
agentSteeringDraft: '',
|
|
@@ -310070,17 +310142,21 @@ ${WEB_UI_CLIENT_TRANSPORT_SCRIPT}
|
|
|
310070
310142
|
|
|
310071
310143
|
function updateSendButtonState() {
|
|
310072
310144
|
const hasPrompt = Boolean(elements.prompt.value.trim());
|
|
310145
|
+
elements.contextPickerButton.disabled = state.busy || !state.ready;
|
|
310073
310146
|
elements.buildPlanButton.disabled = state.busy || !state.ready;
|
|
310074
310147
|
elements.parallelImproveButton.disabled = state.busy || !state.ready;
|
|
310075
310148
|
elements.queueButton.hidden = !state.busy;
|
|
310076
|
-
elements.queueButton.disabled = !hasPrompt || state.stopping;
|
|
310149
|
+
elements.queueButton.disabled = !state.ready || !hasPrompt || state.stopping || state.queueSubmitting || state.promptQueue.length >= 12;
|
|
310150
|
+
elements.steerButton.hidden = !state.busy || !hasPrompt;
|
|
310151
|
+
elements.steerButton.disabled = elements.queueButton.disabled;
|
|
310152
|
+
elements.denyApprovalButton.disabled = elements.approveApprovalButton.disabled = !state.ready || Boolean(state.approvalSubmitting);
|
|
310077
310153
|
elements.sendButton.disabled = state.busy
|
|
310078
|
-
? state.stopping
|
|
310154
|
+
? !state.ready || state.stopping
|
|
310079
310155
|
: !state.ready || !hasPrompt;
|
|
310080
310156
|
}
|
|
310081
310157
|
|
|
310082
310158
|
function setEmptyState() {
|
|
310083
|
-
const hasMessages = elements.messages.childElementCount > 0;
|
|
310159
|
+
const hasMessages = elements.messages.childElementCount > 0 || Boolean(state.pendingApproval);
|
|
310084
310160
|
elements.emptyState.hidden = hasMessages;
|
|
310085
310161
|
elements.conversation.classList.toggle('has-messages', hasMessages);
|
|
310086
310162
|
const target = hasMessages ? elements.composerAnchor : elements.emptyComposerSlot;
|
|
@@ -310477,7 +310553,7 @@ function createWorkbenchController(runtime) {
|
|
|
310477
310553
|
get("changesButton"),
|
|
310478
310554
|
get("tasksButton")
|
|
310479
310555
|
];
|
|
310480
|
-
let active = "
|
|
310556
|
+
let active = "run";
|
|
310481
310557
|
let preferred = runtime.readWidth();
|
|
310482
310558
|
let focused = false;
|
|
310483
310559
|
let returnFocus = null;
|
|
@@ -310533,6 +310609,7 @@ function createWorkbenchController(runtime) {
|
|
|
310533
310609
|
String(Boolean(tab) && selected)
|
|
310534
310610
|
);
|
|
310535
310611
|
}
|
|
310612
|
+
get("tasksButton").setAttribute("aria-expanded", String(Boolean(tab)));
|
|
310536
310613
|
if (tab) runtime.closeSidebar();
|
|
310537
310614
|
resize();
|
|
310538
310615
|
workbench.dispatchEvent(
|
|
@@ -310541,7 +310618,7 @@ function createWorkbenchController(runtime) {
|
|
|
310541
310618
|
if (moveFocus && tab)
|
|
310542
310619
|
buttons[tabs.indexOf(tab)].focus();
|
|
310543
310620
|
if (!tab && !wasHidden && moveFocus) {
|
|
310544
|
-
const target = returnFocus?.isConnected && !returnFocus.closest("[inert], [hidden]") ? returnFocus :
|
|
310621
|
+
const target = returnFocus?.isConnected && !returnFocus.closest("[inert], [hidden]") ? returnFocus : get("tasksButton");
|
|
310545
310622
|
target.focus();
|
|
310546
310623
|
returnFocus = null;
|
|
310547
310624
|
}
|
|
@@ -310571,7 +310648,7 @@ function createWorkbenchController(runtime) {
|
|
|
310571
310648
|
() => setWorkbench(!workbench.hidden && active === "browser" ? null : "browser")
|
|
310572
310649
|
);
|
|
310573
310650
|
hide.addEventListener("click", () => {
|
|
310574
|
-
const returnToDraft = conversation.inert;
|
|
310651
|
+
const returnToDraft = conversation.inert && !returnFocus?.closest("#approvalPanel, #reviewResults");
|
|
310575
310652
|
setWorkbench(null, !returnToDraft);
|
|
310576
310653
|
if (returnToDraft) get("prompt").focus();
|
|
310577
310654
|
});
|
|
@@ -310615,6 +310692,9 @@ function createWorkbenchController(runtime) {
|
|
|
310615
310692
|
window.addEventListener("beforeunload", () => observer.disconnect());
|
|
310616
310693
|
return {
|
|
310617
310694
|
setWorkbench,
|
|
310695
|
+
toggleTaskDetails() {
|
|
310696
|
+
setWorkbench(workbench.hidden ? active : null);
|
|
310697
|
+
},
|
|
310618
310698
|
showConversation() {
|
|
310619
310699
|
focused = false;
|
|
310620
310700
|
if (layout.narrow) setWorkbench(null, false);
|
|
@@ -310622,7 +310702,7 @@ function createWorkbenchController(runtime) {
|
|
|
310622
310702
|
}
|
|
310623
310703
|
};
|
|
310624
310704
|
}
|
|
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 });
|
|
310705
|
+
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
310706
|
`;
|
|
310627
310707
|
|
|
310628
310708
|
// src/runtime/webui/WebUiClientMessages.ts
|
|
@@ -311773,7 +311853,13 @@ var WEB_UI_CLIENT_MISSION_CONTROL_SCRIPT = ` const { renderTaskOverview, render
|
|
|
311773
311853
|
`;
|
|
311774
311854
|
|
|
311775
311855
|
// src/runtime/webui/WebUiClientPalette.ts
|
|
311776
|
-
|
|
311856
|
+
function paletteMatches(action, query) {
|
|
311857
|
+
if (!query) return true;
|
|
311858
|
+
const haystack = (action.label + " " + action.detail + " " + action.keywords).toLocaleLowerCase();
|
|
311859
|
+
return query.split(/\s+/).every((part) => haystack.includes(part));
|
|
311860
|
+
}
|
|
311861
|
+
var WEB_UI_CLIENT_PALETTE_SCRIPT = String.raw` const paletteMatches = ${paletteMatches.toString()};
|
|
311862
|
+
let paletteActions = [];
|
|
311777
311863
|
let paletteSelection = 0;
|
|
311778
311864
|
let paletteReturnFocus = null;
|
|
311779
311865
|
|
|
@@ -311802,6 +311888,11 @@ var WEB_UI_CLIENT_PALETTE_SCRIPT = String.raw` let paletteActions = [];
|
|
|
311802
311888
|
{ icon: '◧', label: language !== 'en' ? chinese('切换导航栏', '切換導覽列') : 'Toggle navigation', detail: 'Ctrl B', keywords: 'toggle sidebar navigation focus', run: toggleNavigation },
|
|
311803
311889
|
{ icon: '+', label: language !== 'en' ? chinese('添加文件上下文', '加入檔案上下文') : 'Add file context', detail: language !== 'en' ? chinese('搜索工作区文件', '搜尋工作區檔案') : 'Search workspace files', keywords: 'add context file', idle: true, run: openContextPicker },
|
|
311804
311890
|
];
|
|
311891
|
+
for (const preset of elements.reviewPresets.querySelectorAll('[data-review-preset]')) {
|
|
311892
|
+
actions.push({ icon: '◇', label: (language === 'en' ? 'Review' : chinese('审查', '審查')) + ' · ' + preset.textContent,
|
|
311893
|
+
detail: '/review ' + preset.dataset.reviewPreset, keywords: 'review project', idle: true,
|
|
311894
|
+
run: () => setComposerValue('/review ' + preset.dataset.reviewPreset) });
|
|
311895
|
+
}
|
|
311805
311896
|
for (const definition of slashCommands) {
|
|
311806
311897
|
actions.push({
|
|
311807
311898
|
icon: '/',
|
|
@@ -311850,12 +311941,6 @@ var WEB_UI_CLIENT_PALETTE_SCRIPT = String.raw` let paletteActions = [];
|
|
|
311850
311941
|
return actions;
|
|
311851
311942
|
}
|
|
311852
311943
|
|
|
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
311944
|
function renderCommandPalette() {
|
|
311860
311945
|
const query = elements.commandSearch.value.trim().toLocaleLowerCase();
|
|
311861
311946
|
paletteActions = buildPaletteActions().filter((action) => paletteMatches(action, query));
|
|
@@ -312240,6 +312325,50 @@ var WEB_UI_CLIENT_SELECT_SCRIPT = String.raw` const selectControls = new Map();
|
|
|
312240
312325
|
|
|
312241
312326
|
`;
|
|
312242
312327
|
|
|
312328
|
+
// src/runtime/webui/WebUiClientReview.ts
|
|
312329
|
+
function verificationSummary(checks, t2) {
|
|
312330
|
+
const failures = checks.filter((check) => check.success === false).length;
|
|
312331
|
+
if (failures) return String(failures) + t2(" failed", " \u9879\u5931\u8D25", " \u9805\u5931\u6557");
|
|
312332
|
+
if (!checks.length || checks.some((check) => check.success !== true))
|
|
312333
|
+
return t2("See records", "\u67E5\u770B\u8BB0\u5F55", "\u67E5\u770B\u8A18\u9304");
|
|
312334
|
+
return String(checks.length) + t2(" passed", " \u9879\u901A\u8FC7", " \u9805\u901A\u904E");
|
|
312335
|
+
}
|
|
312336
|
+
function renderReviewResults(fileCount, verification, t2, relativeSessionTime, summarize) {
|
|
312337
|
+
const get = (id) => document.getElementById(id);
|
|
312338
|
+
get("reviewResults").hidden = !fileCount && !verification.length;
|
|
312339
|
+
get("changesButton").hidden = !fileCount;
|
|
312340
|
+
get("resultFileCount").textContent = String(fileCount);
|
|
312341
|
+
get("verificationResultButton").hidden = !verification.length;
|
|
312342
|
+
get("resultVerification").textContent = summarize(verification, t2);
|
|
312343
|
+
get("verificationCount").textContent = String(verification.length);
|
|
312344
|
+
get("verificationList").replaceChildren();
|
|
312345
|
+
if (!verification.length) {
|
|
312346
|
+
const empty = document.createElement("p");
|
|
312347
|
+
empty.className = "review-empty";
|
|
312348
|
+
empty.textContent = t2(
|
|
312349
|
+
"No verification recorded for this chat.",
|
|
312350
|
+
"\u672C\u6B21\u5BF9\u8BDD\u5C1A\u65E0\u9A8C\u8BC1\u8BB0\u5F55\u3002",
|
|
312351
|
+
"\u672C\u6B21\u5C0D\u8A71\u5C1A\u7121\u9A57\u8B49\u8A18\u9304\u3002"
|
|
312352
|
+
);
|
|
312353
|
+
get("verificationList").append(empty);
|
|
312354
|
+
} else {
|
|
312355
|
+
for (const result of verification) {
|
|
312356
|
+
const row = document.createElement("div");
|
|
312357
|
+
row.className = "verification-row " + (result.success === true ? "is-success" : result.success === false ? "is-error" : "");
|
|
312358
|
+
const marker = document.createElement("span");
|
|
312359
|
+
marker.textContent = result.success === true ? "\u2713" : result.success === false ? "\xD7" : "\xB7";
|
|
312360
|
+
const content = document.createElement("span");
|
|
312361
|
+
const title = document.createElement("strong");
|
|
312362
|
+
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");
|
|
312363
|
+
const detail = document.createElement("small");
|
|
312364
|
+
detail.textContent = result.detail || relativeSessionTime(result.timestamp);
|
|
312365
|
+
content.append(title, detail);
|
|
312366
|
+
row.append(marker, content);
|
|
312367
|
+
get("verificationList").append(row);
|
|
312368
|
+
}
|
|
312369
|
+
}
|
|
312370
|
+
}
|
|
312371
|
+
|
|
312243
312372
|
// src/runtime/webui/WebUiModelSelectOptions.ts
|
|
312244
312373
|
function renderModelSelectOptions(selects, data, language) {
|
|
312245
312374
|
const current = data.modelSelection || data.activeModel || "";
|
|
@@ -312281,6 +312410,8 @@ function renderProviderSelectOptions(select2, provider = {}) {
|
|
|
312281
312410
|
// src/runtime/webui/WebUiClientSession.ts
|
|
312282
312411
|
var WEB_UI_CONTROL_COMMANDS = JSON.stringify(BUILTIN_SLASH_COMMANDS);
|
|
312283
312412
|
var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI_CONTROL_COMMANDS};
|
|
312413
|
+
const renderReviewResults = ${renderReviewResults.toString()};
|
|
312414
|
+
const verificationSummary = ${verificationSummary.toString()};
|
|
312284
312415
|
const fillModelSelectOptions = ${renderModelSelectOptions.toString()};
|
|
312285
312416
|
const fillProviderSelectOptions = ${renderProviderSelectOptions.toString()};
|
|
312286
312417
|
|
|
@@ -312435,6 +312566,9 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312435
312566
|
|
|
312436
312567
|
function renderChangeReview(review) {
|
|
312437
312568
|
state.changeReview = review;
|
|
312569
|
+
const signature = JSON.stringify([state.status?.session?.activeId, state.changeQuery, review.fileChanges, review.checkpoints, review.verification]);
|
|
312570
|
+
if (state.reviewSignature === signature) return;
|
|
312571
|
+
state.reviewSignature = signature;
|
|
312438
312572
|
const rawChanges = Array.isArray(review.fileChanges) ? review.fileChanges : [];
|
|
312439
312573
|
const latestByPath = new Map();
|
|
312440
312574
|
for (const change of rawChanges) {
|
|
@@ -312448,6 +312582,7 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312448
312582
|
elements.changeCount.textContent = query
|
|
312449
312583
|
? String(changes.length) + '/' + String(allChanges.length)
|
|
312450
312584
|
: String(allChanges.length);
|
|
312585
|
+
const openPaths = new Set(Array.from(elements.changesList.querySelectorAll('details[open]'), card => card.dataset.path));
|
|
312451
312586
|
elements.changesList.replaceChildren();
|
|
312452
312587
|
if (!changes.length) {
|
|
312453
312588
|
const empty = document.createElement('p');
|
|
@@ -312458,6 +312593,8 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312458
312593
|
for (const change of changes) {
|
|
312459
312594
|
const card = document.createElement('details');
|
|
312460
312595
|
card.className = 'change-card';
|
|
312596
|
+
card.dataset.path = change.path;
|
|
312597
|
+
card.open = openPaths.has(change.path);
|
|
312461
312598
|
const summary = document.createElement('summary');
|
|
312462
312599
|
const path = document.createElement('strong');
|
|
312463
312600
|
path.textContent = change.path;
|
|
@@ -312528,32 +312665,7 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312528
312665
|
}
|
|
312529
312666
|
}
|
|
312530
312667
|
|
|
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
|
-
}
|
|
312668
|
+
renderReviewResults(allChanges.length, review.verification || [], (en, zh, tw) => language === 'en' ? en : chinese(zh, tw), relativeSessionTime, verificationSummary);
|
|
312557
312669
|
}
|
|
312558
312670
|
|
|
312559
312671
|
async function applyReviewAction(action, button) {
|
|
@@ -312830,7 +312942,9 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312830
312942
|
}
|
|
312831
312943
|
|
|
312832
312944
|
async function loadStatus() {
|
|
312945
|
+
const epoch = state.statusEpoch, request = ++state.statusRequest;
|
|
312833
312946
|
const requestedTurn = state.activeTurnId, data = await api('/api/status');
|
|
312947
|
+
if (epoch !== state.statusEpoch || request !== state.statusRequest) return;
|
|
312834
312948
|
state.status = data;
|
|
312835
312949
|
state.promptQueue = Array.isArray(data.inputQueue) ? data.inputQueue : [];
|
|
312836
312950
|
renderPromptQueue();
|
|
@@ -312877,7 +312991,9 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
312877
312991
|
copy.context + (contextCount ? ' · ' + contextCount : ''),
|
|
312878
312992
|
);
|
|
312879
312993
|
renderContextShelf(data.context || {});
|
|
312994
|
+
if (epoch !== state.statusEpoch || request !== state.statusRequest) return;
|
|
312880
312995
|
renderPendingApproval(data.approval);
|
|
312996
|
+
setEmptyState();
|
|
312881
312997
|
|
|
312882
312998
|
const activeLanguage = data.language || language;
|
|
312883
312999
|
elements.languageOptions.querySelectorAll('[data-language-value]').forEach((button) => {
|
|
@@ -313131,6 +313247,8 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313131
313247
|
const selectionEnd = restoreEditorFocus ? activeEditor.selectionEnd : null;
|
|
313132
313248
|
elements.promptQueueList.replaceChildren();
|
|
313133
313249
|
elements.promptQueue.hidden = state.promptQueue.length === 0;
|
|
313250
|
+
byId('queueCount').textContent = String(state.promptQueue.length);
|
|
313251
|
+
if (!state.promptQueue.length) elements.promptQueue.open = false;
|
|
313134
313252
|
if (!state.promptQueue.some((item) => item.id === state.queueEditingId)) {
|
|
313135
313253
|
state.queueEditingId = null;
|
|
313136
313254
|
state.queueEditDraft = '';
|
|
@@ -313210,8 +313328,12 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313210
313328
|
|
|
313211
313329
|
async function queuePrompt(prompt, mode) {
|
|
313212
313330
|
const value = String(prompt || '').trim();
|
|
313213
|
-
if (!value || state.promptQueue.length >= 12) return;
|
|
313331
|
+
if (!state.ready || state.stopping || state.queueSubmitting || !value || state.promptQueue.length >= 12) return;
|
|
313214
313332
|
const attachmentIds = state.attachments.map((attachment) => attachment.id);
|
|
313333
|
+
state.queueSubmitting = true;
|
|
313334
|
+
if (document.activeElement === elements.queueButton || document.activeElement === elements.steerButton)
|
|
313335
|
+
elements.prompt.focus();
|
|
313336
|
+
updateSendButtonState();
|
|
313215
313337
|
try {
|
|
313216
313338
|
await api('/api/input-queue', {
|
|
313217
313339
|
method: 'POST',
|
|
@@ -313219,15 +313341,18 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313219
313341
|
body: JSON.stringify({ action: 'enqueue', prompt: value, mode: mode === 'steer' ? 'steer' : 'follow_up', attachmentIds }),
|
|
313220
313342
|
});
|
|
313221
313343
|
consumeAttachments(attachmentIds);
|
|
313222
|
-
elements.prompt.value
|
|
313223
|
-
|
|
313224
|
-
|
|
313225
|
-
|
|
313344
|
+
if (elements.prompt.value === prompt) {
|
|
313345
|
+
elements.prompt.value = '';
|
|
313346
|
+
writeLocalStorage('orbit.webui.draft', '');
|
|
313347
|
+
autoSizePrompt();
|
|
313348
|
+
}
|
|
313226
313349
|
await loadStatus();
|
|
313227
313350
|
showToast(mode === 'steer' ? (language === 'en' ? 'Steering accepted' : chinese('引导已接收', '引導已接收')) : copy.queued, 'success');
|
|
313228
|
-
elements.prompt.focus();
|
|
313229
313351
|
} catch (error) {
|
|
313230
313352
|
showToast(error.message || String(error), 'error');
|
|
313353
|
+
} finally {
|
|
313354
|
+
state.queueSubmitting = false;
|
|
313355
|
+
updateSendButtonState();
|
|
313231
313356
|
}
|
|
313232
313357
|
}
|
|
313233
313358
|
|
|
@@ -313510,7 +313635,7 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313510
313635
|
setBusy(true, copy.approvalRequired);
|
|
313511
313636
|
void reconcileStatus();
|
|
313512
313637
|
} else if (event.type === 'web_approval_resolved') {
|
|
313513
|
-
addActivity(payload.approved ? copy.approvalApproved : copy.approvalDenied, payload.approved ? 'success' : 'warning', 'approval');
|
|
313638
|
+
addActivity(payload.kind === 'change' ? copy.reviewClosed : payload.approved ? copy.approvalApproved : copy.approvalDenied, payload.approved ? 'success' : 'warning', 'approval');
|
|
313514
313639
|
void reconcileStatus();
|
|
313515
313640
|
} else if (event.type === 'tool_result') {
|
|
313516
313641
|
const key = 'tool-' + (payload.toolCallId || payload.toolName || '');
|
|
@@ -313625,18 +313750,34 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313625
313750
|
const eventUrl = state.useBearerTransport && webSessionToken
|
|
313626
313751
|
? '/api/events?access_token=' + encodeURIComponent(webSessionToken)
|
|
313627
313752
|
: '/api/events';
|
|
313753
|
+
state.ready = false;
|
|
313754
|
+
state.statusEpoch++;
|
|
313755
|
+
updateSendButtonState();
|
|
313628
313756
|
const source = new EventSource(eventUrl, { withCredentials: true });
|
|
313629
313757
|
state.eventSource = source;
|
|
313630
|
-
|
|
313631
|
-
|
|
313632
|
-
state.
|
|
313633
|
-
|
|
313634
|
-
|
|
313635
|
-
|
|
313758
|
+
let synchronizing;
|
|
313759
|
+
const syncConnection = () => {
|
|
313760
|
+
if (synchronizing || state.eventSource !== source) return;
|
|
313761
|
+
const epoch = state.statusEpoch;
|
|
313762
|
+
synchronizing = loadStatus().then((data) => {
|
|
313763
|
+
if (state.eventSource !== source || state.statusEpoch !== epoch) return;
|
|
313764
|
+
if (!data) return;
|
|
313765
|
+
state.eventRetryAttempt = 0;
|
|
313766
|
+
state.ready = true;
|
|
313767
|
+
updateSendButtonState();
|
|
313768
|
+
setConnection('connected', copy.connected);
|
|
313769
|
+
}).catch(() => {
|
|
313770
|
+
if (state.eventSource === source) source.onerror();
|
|
313771
|
+
}).finally(() => {
|
|
313772
|
+
synchronizing = null;
|
|
313773
|
+
if (!state.ready && state.eventSource === source) syncConnection();
|
|
313774
|
+
});
|
|
313636
313775
|
};
|
|
313776
|
+
source.onopen = syncConnection;
|
|
313637
313777
|
source.onerror = () => {
|
|
313638
313778
|
if (state.eventSource !== source) return;
|
|
313639
313779
|
state.ready = false;
|
|
313780
|
+
state.statusEpoch++;
|
|
313640
313781
|
updateSendButtonState();
|
|
313641
313782
|
source.close();
|
|
313642
313783
|
state.eventSource = null;
|
|
@@ -313658,20 +313799,15 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313658
313799
|
source.onmessage = (message) => {
|
|
313659
313800
|
const event = parseWebUiStreamEvent(message.data);
|
|
313660
313801
|
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);
|
|
313802
|
+
if (state.eventSource !== source) return;
|
|
313803
|
+
if (event.kind === 'system' || event.kind === 'heartbeat') {
|
|
313804
|
+
if (!state.ready) syncConnection();
|
|
313670
313805
|
} else if (event.kind === 'replay_gap') {
|
|
313671
313806
|
// The server retained only a bounded replay window. Reconcile the
|
|
313672
313807
|
// authoritative snapshot immediately so a reconnect never leaves the
|
|
313673
313808
|
// UI presenting a silently incomplete turn or session history.
|
|
313674
313809
|
state.ready = false;
|
|
313810
|
+
state.statusEpoch++;
|
|
313675
313811
|
updateSendButtonState();
|
|
313676
313812
|
setConnection(
|
|
313677
313813
|
'connecting',
|
|
@@ -313679,13 +313815,7 @@ var WEB_UI_CLIENT_SESSION_SCRIPT = String.raw` const controlCommands = ${WEB_UI
|
|
|
313679
313815
|
? 'Some events expired; syncing the latest state…'
|
|
313680
313816
|
: chinese('部分事件已过期,正在同步最新状态…', '部分事件已過期,正在同步最新狀態…'),
|
|
313681
313817
|
);
|
|
313682
|
-
|
|
313683
|
-
if (state.eventSource === source && state.ready === false) {
|
|
313684
|
-
state.ready = true;
|
|
313685
|
-
updateSendButtonState();
|
|
313686
|
-
setConnection('connected', copy.connected);
|
|
313687
|
-
}
|
|
313688
|
-
});
|
|
313818
|
+
syncConnection();
|
|
313689
313819
|
} else if (event.kind === 'turn_started') {
|
|
313690
313820
|
state.activeTurnId = event.turnId;
|
|
313691
313821
|
setBusy(true, copy.working);
|
|
@@ -314071,6 +314201,7 @@ function sanitizeWebEventPayload(type, payload) {
|
|
|
314071
314201
|
};
|
|
314072
314202
|
case "web_approval_resolved":
|
|
314073
314203
|
return {
|
|
314204
|
+
...["tool", "change", "action"].includes(String(payload.kind)) ? { kind: payload.kind } : {},
|
|
314074
314205
|
approvalId: safeWebText(payload.approvalId, 200),
|
|
314075
314206
|
approved: payload.approved === true
|
|
314076
314207
|
};
|
|
@@ -316132,21 +316263,7 @@ var COPY = {
|
|
|
316132
316263
|
function renderComposer(copy, t2) {
|
|
316133
316264
|
return `<div class="composer-dock" id="composerDock">
|
|
316134
316265
|
<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>
|
|
316266
|
+
|
|
316150
316267
|
<form class="composer" id="composer">
|
|
316151
316268
|
<label class="sr-only" for="prompt">${copy.inputLabel}</label>
|
|
316152
316269
|
<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,10 +316276,11 @@ function renderComposer(copy, t2) {
|
|
|
316159
316276
|
<section class="attachment-shelf" id="attachmentShelf" aria-label="${copy.attachments}" hidden>
|
|
316160
316277
|
<div class="attachment-list" id="attachmentList"></div>
|
|
316161
316278
|
</section>
|
|
316162
|
-
<
|
|
316163
|
-
<
|
|
316279
|
+
<details class="prompt-queue" id="promptQueue" aria-label="${copy.queuedMessages}" hidden>
|
|
316280
|
+
<summary>${copy.queuedMessages} \xB7 <span id="queueCount">0</span></summary>
|
|
316281
|
+
<div class="prompt-queue-header"><button id="clearQueueButton" type="button">${copy.clearQueue}</button></div>
|
|
316164
316282
|
<div class="prompt-queue-list" id="promptQueueList"></div>
|
|
316165
|
-
</
|
|
316283
|
+
</details>
|
|
316166
316284
|
<div class="composer-models" role="group" aria-label="${copy.model}">
|
|
316167
316285
|
<div class="select-control provider-control" data-select-control data-select-placement="top" title="${copy.provider}">
|
|
316168
316286
|
<select class="native-select-proxy" id="providerSelect" aria-label="${copy.provider}" tabindex="-1" aria-hidden="true" hidden></select>
|
|
@@ -316199,7 +316317,8 @@ function renderComposer(copy, t2) {
|
|
|
316199
316317
|
</div>
|
|
316200
316318
|
</div>
|
|
316201
316319
|
<div class="composer-actions">
|
|
316202
|
-
<button class="queue-button" id="queueButton" type="button"
|
|
316320
|
+
<button class="queue-button" id="queueButton" type="button" hidden>${copy.queueMessage}</button>
|
|
316321
|
+
<button class="queue-button" id="steerButton" type="button" hidden>${t2("Steer now", "\u7ACB\u5373\u5F15\u5BFC", "\u7ACB\u5373\u5F15\u5C0E")}</button>
|
|
316203
316322
|
<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
316323
|
</div>
|
|
316205
316324
|
</div>
|
|
@@ -316224,6 +316343,7 @@ function renderComposer(copy, t2) {
|
|
|
316224
316343
|
</div>
|
|
316225
316344
|
<div class="context-results" id="contextResults" role="listbox"></div>
|
|
316226
316345
|
<p class="context-empty" id="contextEmpty" role="status">${copy.contextPickerEmpty}</p>
|
|
316346
|
+
<button class="secondary-button" id="browserPreviewButton" type="button" aria-expanded="false" aria-controls="workbench">${renderUiIcon("panel")}<span>Safari</span></button>
|
|
316227
316347
|
<p class="context-picker-hint">${copy.contextPickerHint}</p>
|
|
316228
316348
|
</section>
|
|
316229
316349
|
</form>
|
|
@@ -316338,10 +316458,9 @@ function renderWebUiPage(language) {
|
|
|
316338
316458
|
<span class="connection-dot"></span>
|
|
316339
316459
|
<span id="connectionLabel" role="status" aria-live="polite">${copy.connected}</span>
|
|
316340
316460
|
</button>
|
|
316461
|
+
<button class="approval-jump" id="jumpApproval" aria-controls="approvalPanel" type="button" hidden>${t2("Review pending request", "\u67E5\u770B\u5F85\u786E\u8BA4\u4E8B\u9879", "\u67E5\u770B\u5F85\u78BA\u8A8D\u4E8B\u9805")}</button>
|
|
316341
316462
|
<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>
|
|
316463
|
+
<button class="workspace-tool" id="tasksButton" data-testid="tasks" type="button" aria-expanded="false" aria-controls="workbench">${renderUiIcon("tasks")}<span>${copy.inspectorTitle}</span></button>
|
|
316345
316464
|
</nav>
|
|
316346
316465
|
</div>
|
|
316347
316466
|
</header>
|
|
@@ -316355,6 +316474,26 @@ function renderWebUiPage(language) {
|
|
|
316355
316474
|
<main class="conversation" id="conversation">
|
|
316356
316475
|
<div class="message-scroll" id="messageScroll">
|
|
316357
316476
|
<div class="message-column" id="messages" role="log" aria-live="off" aria-relevant="additions" aria-label="${copy.messages}"></div>
|
|
316477
|
+
<section class="approval-panel" id="approvalPanel" tabindex="-1" role="region" aria-labelledby="approvalTitle" hidden>
|
|
316478
|
+
<div class="approval-panel-head">
|
|
316479
|
+
<span class="approval-mark" aria-hidden="true">!</span>
|
|
316480
|
+
<div>
|
|
316481
|
+
<span class="approval-eyebrow" id="approvalEyebrow" role="status">${copy.approvalEyebrow}</span>
|
|
316482
|
+
<strong id="approvalTitle"></strong>
|
|
316483
|
+
</div>
|
|
316484
|
+
</div>
|
|
316485
|
+
<p class="approval-reason" id="approvalReason"></p>
|
|
316486
|
+
<div id="approvalInlinePreview"><pre class="approval-preview" id="approvalPreview" tabindex="0" hidden></pre></div>
|
|
316487
|
+
<div class="approval-actions">
|
|
316488
|
+
<button class="approval-button" id="approvalDiffButton" type="button" aria-controls="changesPanel" hidden>${t2("View diff", "\u67E5\u770B\u5DEE\u5F02", "\u67E5\u770B\u5DEE\u7570")}</button>
|
|
316489
|
+
<button class="approval-button is-deny" id="denyApprovalButton" type="button">${copy.approvalDeny}</button>
|
|
316490
|
+
<button class="approval-button is-approve" id="approveApprovalButton" type="button">${copy.approvalApprove}</button>
|
|
316491
|
+
</div>
|
|
316492
|
+
</section>
|
|
316493
|
+
<div class="review-results" id="reviewResults" hidden>
|
|
316494
|
+
<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>
|
|
316495
|
+
<button class="text-button" id="verificationResultButton" aria-controls="verificationList" type="button">${copy.verification} \xB7 <span id="resultVerification"></span></button>
|
|
316496
|
+
</div>
|
|
316358
316497
|
<section class="empty-state" id="emptyState">
|
|
316359
316498
|
<p class="eyebrow">${renderOrbitMark("eyebrow-mark")}<span>${copy.emptyEyebrow}</span></p>
|
|
316360
316499
|
<h1>${copy.emptyTitle}</h1>
|
|
@@ -316420,6 +316559,17 @@ function renderWebUiPage(language) {
|
|
|
316420
316559
|
</button>
|
|
316421
316560
|
</div>
|
|
316422
316561
|
</section>
|
|
316562
|
+
<section class="detail-section review-launcher">
|
|
316563
|
+
<div class="section-heading"><h3>${copy.reviewProject}</h3><span>READ ONLY</span></div>
|
|
316564
|
+
<p>${copy.reviewProjectBody}</p>
|
|
316565
|
+
<div class="review-preset-grid" id="reviewPresets">
|
|
316566
|
+
<button type="button" data-review-preset="comprehensive">${copy.reviewComprehensive}</button>
|
|
316567
|
+
<button type="button" data-review-preset="security">${copy.reviewSecurity}</button>
|
|
316568
|
+
<button type="button" data-review-preset="tests">${copy.reviewTests}</button>
|
|
316569
|
+
<button type="button" data-review-preset="performance">${copy.reviewPerformance}</button>
|
|
316570
|
+
<button type="button" data-review-preset="accessibility">${copy.reviewAccessibility}</button>
|
|
316571
|
+
</div>
|
|
316572
|
+
</section>
|
|
316423
316573
|
<section class="detail-section">
|
|
316424
316574
|
<div class="section-heading"><h3>${copy.taskPlan}</h3><span id="planCount">0</span></div>
|
|
316425
316575
|
<div class="review-list" id="planReview"><p class="review-empty">${copy.noPlan}</p></div>
|
|
@@ -316463,30 +316613,24 @@ function renderWebUiPage(language) {
|
|
|
316463
316613
|
</div>
|
|
316464
316614
|
</section>
|
|
316465
316615
|
<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>
|
|
316616
|
+
<section class="detail-section" id="approvalDiffDetail" hidden>
|
|
316617
|
+
<h3 id="approvalDiffTitle" tabindex="-1"></h3>
|
|
316618
|
+
<div id="approvalDiffSlot"></div>
|
|
316619
|
+
<button class="secondary-button" id="returnToApproval" type="button">${t2("Return to decision", "\u8FD4\u56DE\u5BA1\u67E5", "\u8FD4\u56DE\u5BE9\u67E5")}</button>
|
|
316476
316620
|
</section>
|
|
316477
316621
|
<section class="detail-section changes-summary-section">
|
|
316478
316622
|
<div class="section-heading"><h3>${copy.changedFiles}</h3><span id="changeCount">0</span></div>
|
|
316479
316623
|
<input class="field-control compact-filter-input" id="changeFilter" type="search" maxlength="200" autocomplete="off" placeholder="${copy.filterChanges}" aria-label="${copy.filterChanges}" />
|
|
316480
316624
|
<div class="changes-list" id="changesList" data-testid="changes-list"><p class="review-empty">${copy.noChanges}</p></div>
|
|
316481
316625
|
</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
316626
|
<section class="detail-section">
|
|
316487
316627
|
<div class="section-heading"><h3>${copy.verification}</h3><span id="verificationCount">0</span></div>
|
|
316488
316628
|
<div class="verification-list" id="verificationList"><p class="review-empty">\u2014</p></div>
|
|
316489
316629
|
</section>
|
|
316630
|
+
<section class="detail-section">
|
|
316631
|
+
<div class="section-heading"><h3>${copy.checkpoints}</h3><span id="checkpointCount">0</span></div>
|
|
316632
|
+
<div class="checkpoint-list" id="checkpointList"><p class="review-empty">\u2014</p></div>
|
|
316633
|
+
</section>
|
|
316490
316634
|
<button class="secondary-button export-trace-button" id="exportTraceButton" type="button">${copy.exportTrace}</button>
|
|
316491
316635
|
</section>
|
|
316492
316636
|
|
|
@@ -317087,6 +317231,14 @@ var WEB_UI_COMPOSER_STYLES = String.raw`
|
|
|
317087
317231
|
background: var(--surface-subtle);
|
|
317088
317232
|
}
|
|
317089
317233
|
|
|
317234
|
+
.prompt-queue > summary {
|
|
317235
|
+
cursor: pointer;
|
|
317236
|
+
color: var(--ink);
|
|
317237
|
+
font-size: 12px;
|
|
317238
|
+
font-weight: 600;
|
|
317239
|
+
}
|
|
317240
|
+
.prompt-queue:not([open]) { display: block; }
|
|
317241
|
+
.composer-actions .queue-button { width: auto; padding-inline: 6px; font-size: 11px; }
|
|
317090
317242
|
.prompt-queue[hidden] { display: none; }
|
|
317091
317243
|
|
|
317092
317244
|
.prompt-queue-header {
|
|
@@ -317312,6 +317464,16 @@ var WEB_UI_COMPOSER_STYLES = String.raw`
|
|
|
317312
317464
|
transform: translateX(-50%);
|
|
317313
317465
|
}
|
|
317314
317466
|
|
|
317467
|
+
/* Keep scroll controls clear of a decision in short windows. */
|
|
317468
|
+
.conversation:has(.approval-panel:not([hidden])) {
|
|
317469
|
+
grid-template-rows: minmax(min(96px, 20dvh), 1fr) auto auto;
|
|
317470
|
+
}
|
|
317471
|
+
.conversation:has(.approval-panel:not([hidden])) .message-navigation {
|
|
317472
|
+
position: static;
|
|
317473
|
+
grid-row: 2;
|
|
317474
|
+
justify-self: center;
|
|
317475
|
+
transform: none;
|
|
317476
|
+
}
|
|
317315
317477
|
.jump-bottom {
|
|
317316
317478
|
width: 32px;
|
|
317317
317479
|
height: 32px;
|
|
@@ -317394,16 +317556,36 @@ var WEB_UI_COMPOSER_STYLES = String.raw`
|
|
|
317394
317556
|
var WEB_UI_APPROVAL_STYLES = String.raw`
|
|
317395
317557
|
.approval-panel {
|
|
317396
317558
|
position: relative;
|
|
317397
|
-
|
|
317559
|
+
width: min(calc(100% - 32px), var(--content-width));
|
|
317560
|
+
margin: 0 auto 14px;
|
|
317398
317561
|
padding: 16px;
|
|
317399
317562
|
overflow: hidden;
|
|
317400
317563
|
color: var(--ink);
|
|
317401
317564
|
background: color-mix(in srgb, var(--surface-raised) 94%, var(--warning-soft));
|
|
317402
317565
|
border: 1px solid color-mix(in srgb, var(--warning) 32%, var(--border));
|
|
317403
317566
|
border-radius: 16px;
|
|
317404
|
-
box-shadow:
|
|
317567
|
+
box-shadow: none;
|
|
317405
317568
|
}
|
|
317406
317569
|
|
|
317570
|
+
.approval-jump {
|
|
317571
|
+
display: block;
|
|
317572
|
+
margin: 0 0 4px;
|
|
317573
|
+
padding: 4px 8px;
|
|
317574
|
+
border: 0;
|
|
317575
|
+
background: var(--warning-soft);
|
|
317576
|
+
color: var(--ink);
|
|
317577
|
+
border-radius: var(--radius-sm);
|
|
317578
|
+
font: inherit;
|
|
317579
|
+
font-size: 12px;
|
|
317580
|
+
}
|
|
317581
|
+
.review-results:not([hidden]) {
|
|
317582
|
+
display: flex;
|
|
317583
|
+
flex-wrap: wrap;
|
|
317584
|
+
gap: 6px 14px;
|
|
317585
|
+
width: min(calc(100% - 32px), var(--content-width));
|
|
317586
|
+
margin: 0 auto 14px;
|
|
317587
|
+
}
|
|
317588
|
+
.approval-jump[hidden], #approvalDiffButton[hidden] { display: none; }
|
|
317407
317589
|
.approval-panel::before {
|
|
317408
317590
|
content: "";
|
|
317409
317591
|
position: absolute;
|
|
@@ -325148,6 +325330,7 @@ var WebUiApprovalBroker = class {
|
|
|
325148
325330
|
clearTimeout(pending.timeout);
|
|
325149
325331
|
eventBus.emitEvent("web_approval_resolved", {
|
|
325150
325332
|
approvalId: pending.snapshot.id,
|
|
325333
|
+
kind: pending.snapshot.kind,
|
|
325151
325334
|
approved
|
|
325152
325335
|
});
|
|
325153
325336
|
pending.resolve(approved);
|
|
@@ -327766,6 +327949,14 @@ function findQueuedInput(items, reference) {
|
|
|
327766
327949
|
function usage(isZh) {
|
|
327767
327950
|
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
327951
|
}
|
|
327952
|
+
function unavailableSteeringMessage(language) {
|
|
327953
|
+
return localizeOrbit(
|
|
327954
|
+
language,
|
|
327955
|
+
"Mid-turn steering requires an active single-agent task. During a multi-agent run, use the follow-up queue.",
|
|
327956
|
+
"\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",
|
|
327957
|
+
"\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"
|
|
327958
|
+
);
|
|
327959
|
+
}
|
|
327769
327960
|
function handleInputQueueCommand(command, rawArguments, context) {
|
|
327770
327961
|
if (command !== "/queue") return void 0;
|
|
327771
327962
|
const isZh = context.language !== "en";
|
|
@@ -327841,9 +328032,7 @@ ${usage(false)}`
|
|
|
327841
328032
|
}
|
|
327842
328033
|
if (action === "steer") {
|
|
327843
328034
|
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
|
-
);
|
|
328035
|
+
context.printOutput("\u26A0\uFE0F " + unavailableSteeringMessage(context.language));
|
|
327847
328036
|
return HANDLED;
|
|
327848
328037
|
}
|
|
327849
328038
|
context.loop.updateQueuedInput(input.id, { mode: "steer" });
|
|
@@ -330377,19 +330566,10 @@ ${picocolors21.green("\u2714")} Switched security mode to: ${picocolors21.green(
|
|
|
330377
330566
|
};
|
|
330378
330567
|
}
|
|
330379
330568
|
const orchestrated = this.webUiRunnable instanceof Orchestrator || this.multi && this.runCoordinator.isActive("terminal");
|
|
330569
|
+
if (action.mode === "steer" && (orchestrated || !this.tui.hasActiveRunnable())) {
|
|
330570
|
+
return { ok: false, message: unavailableSteeringMessage(this.config.language) };
|
|
330571
|
+
}
|
|
330380
330572
|
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
330573
|
return this.loop.updateQueuedInput(action.inputId, {
|
|
330394
330574
|
...action.prompt !== void 0 ? { text: action.prompt } : {},
|
|
330395
330575
|
...action.mode !== void 0 ? { mode: action.mode } : {}
|
|
@@ -330422,9 +330602,8 @@ ${picocolors21.green("\u2714")} Switched security mode to: ${picocolors21.green(
|
|
|
330422
330602
|
};
|
|
330423
330603
|
}
|
|
330424
330604
|
}
|
|
330425
|
-
const mode = orchestrated ? "follow_up" : action.mode;
|
|
330426
330605
|
this.loop.enqueueUserInput(action.prompt, {
|
|
330427
|
-
mode,
|
|
330606
|
+
mode: action.mode,
|
|
330428
330607
|
source: "web",
|
|
330429
330608
|
attachments: action.attachments.map((attachment) => ({
|
|
330430
330609
|
type: "image",
|
|
@@ -330435,7 +330614,7 @@ ${picocolors21.green("\u2714")} Switched security mode to: ${picocolors21.green(
|
|
|
330435
330614
|
});
|
|
330436
330615
|
return {
|
|
330437
330616
|
ok: true,
|
|
330438
|
-
message: mode === "steer" ? "Steering instruction accepted." : "Follow-up added to the shared queue."
|
|
330617
|
+
message: action.mode === "steer" ? "Steering instruction accepted." : "Follow-up added to the shared queue."
|
|
330439
330618
|
};
|
|
330440
330619
|
}
|
|
330441
330620
|
startWebUiTask(action) {
|
|
@@ -330487,8 +330666,8 @@ ${picocolors21.green("\u2714")} Switched security mode to: ${picocolors21.green(
|
|
|
330487
330666
|
}),
|
|
330488
330667
|
reviewFileChange: ({ filePath, before, after, agentId, agentRole }) => this.webApprovalBroker.request({
|
|
330489
330668
|
kind: "change",
|
|
330490
|
-
title: isZh ? `\
|
|
330491
|
-
reason: isZh ? "\
|
|
330669
|
+
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}?`,
|
|
330670
|
+
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
330671
|
preview: DiffView.renderPlain(filePath, before, after),
|
|
330493
330672
|
agentId,
|
|
330494
330673
|
agentRole
|
|
@@ -331355,11 +331534,17 @@ ${thought.trim()}
|
|
|
331355
331534
|
` : "" : Renderer.formatThought,
|
|
331356
331535
|
formatMarkdown: screenReaderMode ? (text2) => text2 : Renderer.formatMarkdown,
|
|
331357
331536
|
askApproval: async (reason, preview) => {
|
|
331537
|
+
const question = localizeOrbit(
|
|
331538
|
+
this.config.language,
|
|
331539
|
+
"Allow this action?",
|
|
331540
|
+
"\u5141\u8BB8\u8FD9\u6B21\u64CD\u4F5C\uFF1F",
|
|
331541
|
+
"\u5141\u8A31\u9019\u6B21\u64CD\u4F5C\uFF1F"
|
|
331542
|
+
);
|
|
331358
331543
|
if (useFullscreenTui && tui.isActive) {
|
|
331359
331544
|
const message2 = preview ? `Risk Warning: ${reason}
|
|
331360
331545
|
Parameters: ${preview}
|
|
331361
|
-
|
|
331362
|
-
|
|
331546
|
+
${question}` : `Risk Warning: ${reason}
|
|
331547
|
+
${question}`;
|
|
331363
331548
|
return await Prompt.askApproval(message2);
|
|
331364
331549
|
}
|
|
331365
331550
|
const wasActive = useFullscreenTui && tui.isActive;
|
|
@@ -331369,7 +331554,7 @@ Risk Warning: ${reason}`);
|
|
|
331369
331554
|
if (preview) {
|
|
331370
331555
|
console.log(terminalColors.gray(`Parameters: ${preview}`));
|
|
331371
331556
|
}
|
|
331372
|
-
const approved = await Prompt.askApproval(
|
|
331557
|
+
const approved = await Prompt.askApproval(question);
|
|
331373
331558
|
if (wasActive) tui.start(this.config.budgetLimit);
|
|
331374
331559
|
return approved;
|
|
331375
331560
|
},
|
|
@@ -331449,15 +331634,24 @@ Risk Warning: ${reason}`);
|
|
|
331449
331634
|
);
|
|
331450
331635
|
return true;
|
|
331451
331636
|
}
|
|
331452
|
-
const mode = this.multi ? "follow_up" : "steer";
|
|
331453
331637
|
loop.enqueueUserInput(submitted, {
|
|
331454
|
-
mode,
|
|
331638
|
+
mode: "follow_up",
|
|
331455
331639
|
source: "terminal",
|
|
331456
331640
|
attachments: this.takeTerminalAttachments()
|
|
331457
331641
|
});
|
|
331458
|
-
|
|
331459
|
-
this.config.language
|
|
331642
|
+
const queued = localizeOrbit(
|
|
331643
|
+
this.config.language,
|
|
331644
|
+
"\u25CF Follow-up queued.",
|
|
331645
|
+
"\u25CF \u5DF2\u52A0\u5165\u961F\u5217\u3002",
|
|
331646
|
+
"\u25CF \u5DF2\u52A0\u5165\u4F47\u5217\u3002"
|
|
331647
|
+
);
|
|
331648
|
+
const steerHint = this.multi ? "" : localizeOrbit(
|
|
331649
|
+
this.config.language,
|
|
331650
|
+
" Use /queue steer <n> to steer the current task.",
|
|
331651
|
+
" \u4F7F\u7528 /queue steer <\u5E8F\u53F7> \u5F15\u5BFC\u5F53\u524D\u4EFB\u52A1\u3002",
|
|
331652
|
+
" \u4F7F\u7528 /queue steer <\u5E8F\u865F> \u5F15\u5C0E\u76EE\u524D\u4EFB\u52D9\u3002"
|
|
331460
331653
|
);
|
|
331654
|
+
tui.addLog(queued + steerHint);
|
|
331461
331655
|
return true;
|
|
331462
331656
|
} catch (error) {
|
|
331463
331657
|
tui.addLog(
|