copilot-operator 0.1.44 → 0.1.46
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/src/api/operator.controller.js +25 -1
- package/dist/src/api/operator.service.js +89 -16
- package/dist/src/api/server.js +6 -4
- package/dist/src/config/schema.js +21 -1
- package/dist/src/orchestrator/taskRunner.js +131 -23
- package/dist/src/plan/systemGuide.js +26 -2
- package/dist/src/session/checkpoint.js +91 -0
- package/dist/src/session/store.js +2 -0
- package/dist/src/transport/copilotTransport.js +92 -18
- package/dist/web/404.html +2 -2
- package/dist/web/_next/static/chunks/{549-1fe42544e4b72942.js → 549-8732dd2c1339bc5d.js} +1 -1
- package/dist/web/_next/static/chunks/867-7fb52be342fa64e5.js +1 -0
- package/dist/web/_next/static/chunks/app/defaults/page-614be29d185a2947.js +1 -0
- package/dist/web/_next/static/chunks/app/layout-485ce9395cb17998.js +1 -0
- package/dist/web/_next/static/chunks/app/page-ed6a5a2ff1b6285e.js +1 -0
- package/dist/web/_next/static/chunks/app/sessions/view/page-835d3533fdc63082.js +1 -0
- package/dist/web/_next/static/css/{eaec9cc6fe8aceb7.css → 70ceb261074b139c.css} +1 -1
- package/dist/web/appearance.html +2 -2
- package/dist/web/appearance.txt +10 -10
- package/dist/web/defaults.html +2 -2
- package/dist/web/defaults.txt +10 -10
- package/dist/web/history.html +2 -2
- package/dist/web/history.txt +10 -10
- package/dist/web/import.html +2 -2
- package/dist/web/import.txt +10 -10
- package/dist/web/index.html +2 -2
- package/dist/web/index.txt +10 -10
- package/dist/web/level1.html +2 -2
- package/dist/web/level1.txt +10 -10
- package/dist/web/presets.html +2 -2
- package/dist/web/presets.txt +10 -10
- package/dist/web/sessions/view.html +2 -2
- package/dist/web/sessions/view.txt +10 -10
- package/dist/web/sessions.html +2 -2
- package/dist/web/sessions.txt +10 -10
- package/dist/web/system.html +2 -2
- package/dist/web/system.txt +10 -10
- package/package.json +1 -1
- package/dist/web/_next/static/chunks/867-0f0f8c3bd37be31e.js +0 -1
- package/dist/web/_next/static/chunks/app/defaults/page-56134fbb8cc7554f.js +0 -1
- package/dist/web/_next/static/chunks/app/layout-12f138ee04d33c1e.js +0 -1
- package/dist/web/_next/static/chunks/app/page-09c6e2d42098f8d4.js +0 -1
- package/dist/web/_next/static/chunks/app/sessions/view/page-afc235a9171535d8.js +0 -1
- /package/dist/web/_next/static/{BX8Nw248DTY9xAfUu2pOH → uAYbk9CSKPZe3-jWXmPOP}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{BX8Nw248DTY9xAfUu2pOH → uAYbk9CSKPZe3-jWXmPOP}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checkpoints of the workbench's chat (operator's request, 2026-10-17): "before any message, I can put the code
|
|
3
|
+
* back as it was then — and the messages after it go, because they did not happen. The branch is mine: the bot
|
|
4
|
+
* works on the one I left checked out."
|
|
5
|
+
*
|
|
6
|
+
* So a chat conversation neither branches nor commits. Before each message the folder is photographed — the branch
|
|
7
|
+
* and commit it is on, and the working tree as it stands, untracked files included and ignored ones not — into a
|
|
8
|
+
* commit that no branch points at, kept under `refs/copilot-operator/checkpoints/`; after the message, once more,
|
|
9
|
+
* so what the message changed can be shown file by file. Going back puts the folder exactly as the photograph
|
|
10
|
+
* shows it: the branch checked out, at its commit, with the same uncommitted changes. That rewrites the working
|
|
11
|
+
* tree and can move the branch back, so before it the folder as it is is photographed too, under
|
|
12
|
+
* `refs/copilot-operator/safety/`: nothing that going back removes is lost, it is one `git checkout` away. These
|
|
13
|
+
* are the only places the runner's git overwrites anything (see the rules in `vcs/git.ts`).
|
|
14
|
+
*/
|
|
15
|
+
import { mkdtemp, rm } from 'node:fs/promises';
|
|
16
|
+
import { tmpdir } from 'node:os';
|
|
17
|
+
import { join } from 'node:path';
|
|
18
|
+
import { git, looksLikeRepo } from '../vcs/git.js';
|
|
19
|
+
const AUTHOR = ['-c', 'user.name=copilot-operator', '-c', 'user.email=copilot-operator@localhost'];
|
|
20
|
+
/**
|
|
21
|
+
* The working tree as a commit, without touching the index, HEAD or any branch: a scratch index is filled from
|
|
22
|
+
* HEAD and then from the folder (`add -A`, which honours .gitignore), written as a tree, and committed on top of
|
|
23
|
+
* HEAD under `ref`.
|
|
24
|
+
*/
|
|
25
|
+
async function photograph(dir, ref, message, parent) {
|
|
26
|
+
if (!looksLikeRepo(dir))
|
|
27
|
+
return { problem: 'The open folder is not a git repository, so there is no way back to a message: run "git init" there first.' };
|
|
28
|
+
const head = await git(dir, ['rev-parse', '--verify', '--quiet', 'HEAD^{commit}']);
|
|
29
|
+
if (!head.ok || !head.stdout)
|
|
30
|
+
return { problem: 'The repository has no commit yet, so there is nothing to go back to: make a first commit.' };
|
|
31
|
+
const branch = await git(dir, ['symbolic-ref', '--quiet', '--short', 'HEAD']);
|
|
32
|
+
const scratch = await mkdtemp(join(tmpdir(), 'cop-checkpoint-'));
|
|
33
|
+
const env = { ...process.env, GIT_INDEX_FILE: join(scratch, 'index') };
|
|
34
|
+
try {
|
|
35
|
+
const read = await git(dir, ['read-tree', 'HEAD'], 60_000, env);
|
|
36
|
+
if (!read.ok)
|
|
37
|
+
return { problem: `git could not read the commit: ${read.stderr}` };
|
|
38
|
+
const add = await git(dir, ['add', '-A'], 120_000, env);
|
|
39
|
+
if (!add.ok)
|
|
40
|
+
return { problem: `git could not read the folder: ${add.stderr}` };
|
|
41
|
+
const tree = await git(dir, ['write-tree'], 60_000, env);
|
|
42
|
+
if (!tree.ok)
|
|
43
|
+
return { problem: `git could not record the folder: ${tree.stderr}` };
|
|
44
|
+
const commit = await git(dir, [...AUTHOR, 'commit-tree', tree.stdout, '-p', parent ?? head.stdout, '-m', message]);
|
|
45
|
+
if (!commit.ok)
|
|
46
|
+
return { problem: `git could not record the folder: ${commit.stderr}` };
|
|
47
|
+
const kept = await git(dir, ['update-ref', ref, commit.stdout]);
|
|
48
|
+
if (!kept.ok)
|
|
49
|
+
return { problem: `git could not keep the record: ${kept.stderr}` };
|
|
50
|
+
return { commit: commit.stdout, head: head.stdout, branch: branch.ok ? branch.stdout : '' };
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
await rm(scratch, { recursive: true, force: true }).catch(() => undefined);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** Before a message: the folder as it is, kept under the message's id. */
|
|
57
|
+
export async function takeCheckpoint(dir, id) {
|
|
58
|
+
const r = await photograph(dir, `refs/copilot-operator/checkpoints/${id}`, `checkpoint before message ${id}`);
|
|
59
|
+
return 'problem' in r ? r : { ...r, at: new Date().toISOString() };
|
|
60
|
+
}
|
|
61
|
+
/** After a message: the folder again, on top of its checkpoint, so the commit holds exactly what the message changed. */
|
|
62
|
+
export async function takeAfter(dir, id, before) {
|
|
63
|
+
const r = await photograph(dir, `refs/copilot-operator/after/${id}`, `after message ${id}`, before.commit);
|
|
64
|
+
return 'problem' in r ? r : { commit: r.commit };
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Puts the folder back as `cp` photographed it: its branch checked out at its commit, its working tree with the
|
|
68
|
+
* same uncommitted changes. The folder as it is now is photographed first, under `refs/copilot-operator/safety/`.
|
|
69
|
+
*/
|
|
70
|
+
export async function restoreCheckpoint(dir, cp) {
|
|
71
|
+
const stamp = new Date().toISOString().replace(/[-:.TZ]/g, '').slice(0, 17);
|
|
72
|
+
const safety = await photograph(dir, `refs/copilot-operator/safety/${stamp}`, `the folder before going back to ${cp.commit.slice(0, 8)}`);
|
|
73
|
+
if ('problem' in safety)
|
|
74
|
+
return { ok: false, problem: safety.problem };
|
|
75
|
+
const step = async (args, what) => {
|
|
76
|
+
const r = await git(dir, args, 120_000);
|
|
77
|
+
return r.ok ? null : `${what}: ${(r.stderr || r.stdout).split('\n')[0]}. Nothing is lost: the folder as it was is kept as ${safety.commit.slice(0, 8)}.`;
|
|
78
|
+
};
|
|
79
|
+
const problem =
|
|
80
|
+
// On the branch it was on (or at its commit, when it was on none), whatever was checked out since.
|
|
81
|
+
(cp.branch
|
|
82
|
+
? await step(['checkout', '--force', cp.branch], `${cp.branch} could not be checked out`)
|
|
83
|
+
: await step(['checkout', '--force', '--detach', cp.head], `${cp.head.slice(0, 8)} could not be checked out`)) ??
|
|
84
|
+
// At the commit it was on: a commit made after it, by the chat or by hand, is undone here (kept in the safety record).
|
|
85
|
+
(cp.branch ? await step(['reset', '--hard', cp.head], `${cp.branch} could not be put back at ${cp.head.slice(0, 8)}`) : null) ??
|
|
86
|
+
// Files made since that git does not track go; ignored ones (builds, installs) stay.
|
|
87
|
+
(await step(['clean', '-f', '-d'], 'the files made since could not be removed')) ??
|
|
88
|
+
// And the uncommitted changes as they were, untracked files included.
|
|
89
|
+
(await step(['restore', '--source', cp.commit, '--worktree', '--', '.'], 'the files could not be put back'));
|
|
90
|
+
return problem ? { ok: false, problem } : { ok: true, safety: safety.commit };
|
|
91
|
+
}
|
|
@@ -111,6 +111,8 @@ export const TASK_FIELD_ON_RERUN = {
|
|
|
111
111
|
accepted: 'archived',
|
|
112
112
|
// Every note stays with the task; the ones not sent yet go out with the next attempt's opening.
|
|
113
113
|
notes: 'kept',
|
|
114
|
+
// The folder before the message first ran: the point "go back" returns to, whatever attempt came after.
|
|
115
|
+
checkpoint: 'kept',
|
|
114
116
|
interruption: 'cleared',
|
|
115
117
|
finalReply: 'cleared',
|
|
116
118
|
firstMessage: 'cleared',
|
|
@@ -118,6 +118,16 @@ export class SendRejectedError extends Error {
|
|
|
118
118
|
this.name = 'SendRejectedError';
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* The run was stopped while the transport was in one of its long waits: the model picker's looks and pauses, or
|
|
123
|
+
* the sign-in. Thrown by `hold` and the sign-in wait, so a Stop is not left waiting minutes for them to end.
|
|
124
|
+
*/
|
|
125
|
+
export class StoppedByOperator extends Error {
|
|
126
|
+
constructor(message = 'stopped by the operator') {
|
|
127
|
+
super(message);
|
|
128
|
+
this.name = 'StoppedByOperator';
|
|
129
|
+
}
|
|
130
|
+
}
|
|
121
131
|
/**
|
|
122
132
|
* Takes the copy button off the operator's clipboard.
|
|
123
133
|
*
|
|
@@ -205,9 +215,27 @@ export class CopilotTransport {
|
|
|
205
215
|
context = null;
|
|
206
216
|
page = null;
|
|
207
217
|
lock = null;
|
|
218
|
+
/**
|
|
219
|
+
* The run's Stop, while a choice of model is being made (see `selectModel`). The picker's waits add up to minutes
|
|
220
|
+
* — six attempts, each looking up to twenty seconds for each of its rows, in four ways — and a Stop pressed in them
|
|
221
|
+
* did nothing until they ended (2026-10-17: "the Stop button seems not to work").
|
|
222
|
+
*/
|
|
223
|
+
stop = null;
|
|
208
224
|
constructor(opts) {
|
|
209
225
|
this.opts = opts;
|
|
210
226
|
}
|
|
227
|
+
/** A pause of the model picker that ends early, with `StoppedByOperator`, once the run is stopped. */
|
|
228
|
+
async hold(ms) {
|
|
229
|
+
const until = Date.now() + ms;
|
|
230
|
+
for (;;) {
|
|
231
|
+
if (this.stop?.aborted)
|
|
232
|
+
throw new StoppedByOperator();
|
|
233
|
+
const left = until - Date.now();
|
|
234
|
+
if (left <= 0)
|
|
235
|
+
return;
|
|
236
|
+
await this.p.waitForTimeout(Math.min(250, left));
|
|
237
|
+
}
|
|
238
|
+
}
|
|
211
239
|
emit(event, detail) {
|
|
212
240
|
this.opts.onEvent?.(event, detail);
|
|
213
241
|
}
|
|
@@ -269,6 +297,25 @@ export class CopilotTransport {
|
|
|
269
297
|
composer() {
|
|
270
298
|
return this.p.locator(Css.composer).first();
|
|
271
299
|
}
|
|
300
|
+
/** Whether the composer shows within `ms`, looked for a second at a time; a Stop ends the wait with `StoppedByOperator`. */
|
|
301
|
+
async composerWithin(ms, signal, stopped) {
|
|
302
|
+
const until = Date.now() + ms;
|
|
303
|
+
for (;;) {
|
|
304
|
+
if (signal?.aborted)
|
|
305
|
+
throw new StoppedByOperator(stopped);
|
|
306
|
+
try {
|
|
307
|
+
await this.composer().waitFor({ state: 'visible', timeout: Math.max(1, Math.min(1_000, until - Date.now())) });
|
|
308
|
+
return true;
|
|
309
|
+
}
|
|
310
|
+
catch (e) {
|
|
311
|
+
// Only "not yet": a closed window or page ends the wait as it always did, at once.
|
|
312
|
+
if (e.name !== 'TimeoutError')
|
|
313
|
+
throw e;
|
|
314
|
+
if (Date.now() >= until)
|
|
315
|
+
return false;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
272
319
|
/**
|
|
273
320
|
* Which Copilot we actually landed on.
|
|
274
321
|
*
|
|
@@ -442,11 +489,19 @@ Current URL: ${url}`);
|
|
|
442
489
|
* Opens the chat and, if the tenant has signed us out, waits for the human. The bot never
|
|
443
490
|
* types credentials; it only waits for the composer to appear.
|
|
444
491
|
*/
|
|
445
|
-
async ensureSignedIn(url = this.opts.chatUrl) {
|
|
492
|
+
async ensureSignedIn(url = this.opts.chatUrl, opts = {}) {
|
|
446
493
|
await this.p.goto(url, { waitUntil: 'domcontentloaded' });
|
|
447
|
-
|
|
494
|
+
/*
|
|
495
|
+
* Looked for a second at a time, so a Stop pressed while the page loads or the operator has not signed in yet
|
|
496
|
+
* ends the wait at once, rather than after the whole sign-in timeout, fifteen minutes by default (2026-10-17).
|
|
497
|
+
*/
|
|
498
|
+
const stoppedHere = 'stopped by the operator while waiting for the sign-in';
|
|
499
|
+
if (!(await this.composerWithin(15_000, opts.signal, stoppedHere))) {
|
|
448
500
|
this.emit('sign-in-required', { url: this.p.url() });
|
|
449
|
-
await this.
|
|
501
|
+
if (!(await this.composerWithin(this.opts.signInTimeoutMs, opts.signal, stoppedHere))) {
|
|
502
|
+
throw new Error(`The sign-in was not completed within ${Math.round(this.opts.signInTimeoutMs / 1000)} s (Settings → copilot.signInTimeoutSec). ` +
|
|
503
|
+
'Sign in in the open Edge window, then start again.');
|
|
504
|
+
}
|
|
450
505
|
this.emit('signed-in');
|
|
451
506
|
}
|
|
452
507
|
await this.clearBlockers();
|
|
@@ -600,11 +655,11 @@ Current URL: ${url}`);
|
|
|
600
655
|
async dismissOpenMenu() {
|
|
601
656
|
try {
|
|
602
657
|
await this.p.keyboard.press('Escape');
|
|
603
|
-
await this.
|
|
658
|
+
await this.hold(150);
|
|
604
659
|
const open = this.p.locator('[role="menu"]');
|
|
605
660
|
if ((await open.count()) > 0) {
|
|
606
661
|
await this.p.mouse.click(4, 4);
|
|
607
|
-
await this.
|
|
662
|
+
await this.hold(150);
|
|
608
663
|
}
|
|
609
664
|
}
|
|
610
665
|
catch {
|
|
@@ -650,7 +705,7 @@ Current URL: ${url}`);
|
|
|
650
705
|
const byLabel = this.p.getByRole('button', { name: Model.buttonLabel, exact: false });
|
|
651
706
|
if ((await byLabel.count().catch(() => 0)) > 0)
|
|
652
707
|
return byLabel.first();
|
|
653
|
-
await this.
|
|
708
|
+
await this.hold(500);
|
|
654
709
|
} while (Date.now() < deadline);
|
|
655
710
|
return null;
|
|
656
711
|
}
|
|
@@ -834,7 +889,7 @@ Current URL: ${url}`);
|
|
|
834
889
|
const fresh = rows.find((r) => !before.has(r.menuOf) && r.menuOf !== row.elId);
|
|
835
890
|
if (fresh && (!row.elId || Date.now() - started > 1_500))
|
|
836
891
|
return fresh.menuOf;
|
|
837
|
-
await this.
|
|
892
|
+
await this.hold(200);
|
|
838
893
|
} while (Date.now() - started < ms);
|
|
839
894
|
return null;
|
|
840
895
|
};
|
|
@@ -879,7 +934,7 @@ Current URL: ${url}`);
|
|
|
879
934
|
}
|
|
880
935
|
if (first)
|
|
881
936
|
return first;
|
|
882
|
-
await this.
|
|
937
|
+
await this.hold(200);
|
|
883
938
|
} while (Date.now() < deadline);
|
|
884
939
|
return null;
|
|
885
940
|
}
|
|
@@ -938,7 +993,7 @@ Current URL: ${url}`);
|
|
|
938
993
|
return { ok: true, current: name, by: 'locator' };
|
|
939
994
|
}
|
|
940
995
|
await this.press(found.row).catch(() => undefined);
|
|
941
|
-
await this.
|
|
996
|
+
await this.hold(800);
|
|
942
997
|
// Whatever the click did, the menu is not left open over the chat.
|
|
943
998
|
await this.closeMenu();
|
|
944
999
|
const again = await this.openToModel(name, group);
|
|
@@ -964,7 +1019,7 @@ Current URL: ${url}`);
|
|
|
964
1019
|
const before = await this.currentModel();
|
|
965
1020
|
const textOf = async (el) => (((await el.innerText().catch(() => '')) ?? '').split('\n')[0] ?? '').trim();
|
|
966
1021
|
// A fixed pause after every opening and every press (see `ModelPicking`); the checks give it less.
|
|
967
|
-
const settle = () => this.
|
|
1022
|
+
const settle = () => this.hold(this.opts.modelSettleMs ?? ModelPicking.settleMs);
|
|
968
1023
|
const pause = this.opts.modelBeforePressMs ?? ModelPicking.beforePressMs;
|
|
969
1024
|
const poll = this.opts.modelPollMs ?? ModelPicking.pollMs;
|
|
970
1025
|
const appear = this.opts.modelAppearMs ?? ModelPicking.appearMs;
|
|
@@ -987,7 +1042,7 @@ Current URL: ${url}`);
|
|
|
987
1042
|
let el = await find();
|
|
988
1043
|
while (!el && Date.now() < deadline) {
|
|
989
1044
|
this.emit('model-step', { step: 'not there yet, waiting', what: label, look: looks, waitMs: poll });
|
|
990
|
-
await this.
|
|
1045
|
+
await this.hold(poll);
|
|
991
1046
|
looks += 1;
|
|
992
1047
|
el = await find();
|
|
993
1048
|
}
|
|
@@ -996,7 +1051,7 @@ Current URL: ${url}`);
|
|
|
996
1051
|
return null;
|
|
997
1052
|
}
|
|
998
1053
|
this.emit('model-step', { step: 'there, pausing before the press', what: label, look: looks, text: await textOf(el), pauseMs: pause });
|
|
999
|
-
await this.
|
|
1054
|
+
await this.hold(pause);
|
|
1000
1055
|
await picture(`before-${label}`);
|
|
1001
1056
|
return el;
|
|
1002
1057
|
};
|
|
@@ -1035,7 +1090,7 @@ Current URL: ${url}`);
|
|
|
1035
1090
|
return { row };
|
|
1036
1091
|
}
|
|
1037
1092
|
this.emit('model-step', { step: 'group not opened', how });
|
|
1038
|
-
await this.
|
|
1093
|
+
await this.hold(pause);
|
|
1039
1094
|
}
|
|
1040
1095
|
await this.captureMenu('select-failed', await this.readMenuRows().catch(() => [])).catch(() => undefined);
|
|
1041
1096
|
return { problem: `"${target.model}" did not appear after opening "${target.group.name}" every way (${target.xpath}); the menu is kept as models-select-failed.html/.png` };
|
|
@@ -1083,14 +1138,14 @@ Current URL: ${url}`);
|
|
|
1083
1138
|
// The chosen model's own name: "Sonnet" alone would stop at "Sonnet 5.5" when "Sonnet 5" is asked for.
|
|
1084
1139
|
if (now.radio && (sameModel(line, name) || containsModel(now.text, name))) {
|
|
1085
1140
|
this.emit('model-step', { step: 'model reached by the keyboard, pausing before Enter', attempt, text: line, presses, pauseMs: pause });
|
|
1086
|
-
await this.
|
|
1141
|
+
await this.hold(pause);
|
|
1087
1142
|
await picture('before-enter');
|
|
1088
1143
|
await this.p.keyboard.press('Enter');
|
|
1089
1144
|
await settle();
|
|
1090
1145
|
return true;
|
|
1091
1146
|
}
|
|
1092
1147
|
await this.p.keyboard.press('ArrowDown');
|
|
1093
|
-
await this.
|
|
1148
|
+
await this.hold(400);
|
|
1094
1149
|
}
|
|
1095
1150
|
this.emit('model-step', { step: 'model not reached by the keyboard', attempt });
|
|
1096
1151
|
await this.closeMenu();
|
|
@@ -1142,7 +1197,7 @@ Current URL: ${url}`);
|
|
|
1142
1197
|
await found.row.evaluate((el) => el.click(), undefined, { timeout: 3_000 }).catch(() => undefined);
|
|
1143
1198
|
await settle();
|
|
1144
1199
|
if ((await this.modelMenuOpen()) && !(await checked(found.row))) {
|
|
1145
|
-
await this.
|
|
1200
|
+
await this.hold(pause);
|
|
1146
1201
|
await found.row.click({ timeout: 3_000 }).catch(() => undefined);
|
|
1147
1202
|
await settle();
|
|
1148
1203
|
}
|
|
@@ -1239,7 +1294,7 @@ Current URL: ${url}`);
|
|
|
1239
1294
|
if (!(await this.modelMenuOpen()))
|
|
1240
1295
|
return;
|
|
1241
1296
|
await act().catch(() => undefined);
|
|
1242
|
-
await this.
|
|
1297
|
+
await this.hold(250);
|
|
1243
1298
|
if (!(await this.modelMenuOpen())) {
|
|
1244
1299
|
if (how !== 'escape')
|
|
1245
1300
|
this.emit('model-menu-closed', { how });
|
|
@@ -1262,7 +1317,7 @@ Current URL: ${url}`);
|
|
|
1262
1317
|
return one;
|
|
1263
1318
|
}
|
|
1264
1319
|
}
|
|
1265
|
-
await this.
|
|
1320
|
+
await this.hold(250);
|
|
1266
1321
|
}
|
|
1267
1322
|
return null;
|
|
1268
1323
|
}
|
|
@@ -1277,6 +1332,25 @@ Current URL: ${url}`);
|
|
|
1277
1332
|
* caller is told what the chat is actually on.
|
|
1278
1333
|
*/
|
|
1279
1334
|
async selectModel(name, opts = {}) {
|
|
1335
|
+
if (opts.signal?.aborted)
|
|
1336
|
+
return { ok: false, current: null, reason: 'stopped by the operator' };
|
|
1337
|
+
this.stop = opts.signal ?? null;
|
|
1338
|
+
try {
|
|
1339
|
+
return await this.chooseModel(name, opts);
|
|
1340
|
+
}
|
|
1341
|
+
catch (e) {
|
|
1342
|
+
if (!(e instanceof StoppedByOperator))
|
|
1343
|
+
throw e;
|
|
1344
|
+
this.stop = null;
|
|
1345
|
+
this.emit('model-step', { step: 'stopped by the operator', model: name });
|
|
1346
|
+
await this.closeMenu().catch(() => undefined);
|
|
1347
|
+
return { ok: false, current: await this.currentModel().catch(() => null), reason: 'stopped by the operator' };
|
|
1348
|
+
}
|
|
1349
|
+
finally {
|
|
1350
|
+
this.stop = null;
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
async chooseModel(name, opts) {
|
|
1280
1354
|
const button = await this.resolveModelButton();
|
|
1281
1355
|
if (!button)
|
|
1282
1356
|
return { ok: false, current: null, reason: 'This chat does not show a model picker.' };
|
package/dist/web/404.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--uAYbk9CSKPZe3_jWXmPOP--><html lang="en" data-theme="light" data-textsize="normal" data-contrast="normal" data-motion="normal" data-links="plain" data-focus="normal"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/70ceb261074b139c.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js"/><script src="/_next/static/chunks/c7879cf7-b5ab1053c1d9a2e7.js" async=""></script><script src="/_next/static/chunks/131-bae98f790a541679.js" async=""></script><script src="/_next/static/chunks/main-app-e3a5f713ba31557e.js" async=""></script><script src="/_next/static/chunks/197-f7c33a0114fc3db3.js" async=""></script><script src="/_next/static/chunks/867-7fb52be342fa64e5.js" async=""></script><script src="/_next/static/chunks/549-8732dd2c1339bc5d.js" async=""></script><script src="/_next/static/chunks/499-751e0be9d4f86e2d.js" async=""></script><script src="/_next/static/chunks/app/layout-485ce9395cb17998.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>copilot-operator</title><meta name="description" content="Runs task loops with Microsoft 365 Copilot on this machine."/><script>
|
|
2
2
|
(function () {
|
|
3
3
|
try {
|
|
4
4
|
var d = document.documentElement;
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
d.dataset.focus = a.strongFocus ? 'strong' : 'normal';
|
|
14
14
|
} catch (e) {}
|
|
15
15
|
})();
|
|
16
|
-
</script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><a class="skip-link" href="#main">Skip to the content</a><div class="wrap"><header class="top"><h1><a href="/">copilot-operator</a></h1><nav aria-label="Main"><a href="/"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M3 4h18v16H3zM9 4v16M3 15h6" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Workbench</span></a><a href="/sessions"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v4H4zM4 11h16v4H4zM4 17h10v2H4z"></path></svg><span>Sessions</span></a><a href="/defaults"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm8.5 4 1.5 1-1.6 2.8-1.8-.4a7 7 0 0 1-1.5 1.5l.4 1.8L14.7 21l-1-1.5a7 7 0 0 1-3.4 0l-1 1.5-2.8-1.6.4-1.8A7 7 0 0 1 5.4 16l-1.8.4L2 13.6 3.5 12.6V11.4L2 10.4l1.6-2.8 1.8.4A7 7 0 0 1 6.9 6.5l-.4-1.8L9.3 3l1 1.5a7 7 0 0 1 3.4 0l1-1.5 2.8 1.6-.4 1.8a7 7 0 0 1 1.5 1.5l1.8-.4L22 10.4l-1.5 1z"></path></svg><span>Settings</span></a><a href="/import"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3v10m0 0 4-4m-4 4-4-4M4 15v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Plan from JSON</span></a><a href="/history"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 1 0 8.5 6M12 7v5l3 2M3 4v5h5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Task register</span></a><a href="/level1"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M6 3h9l5 5v13H6zM14 3v6h6M9 13h7M9 17h7" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 1 prompt</span></a><a href="/presets"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M5 4h14v4H5zM5 10h14v4H5zM5 16h9v4H5z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 2 presets</span></a><a href="/appearance"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 0 0 0 18c1.5 0 2-1 2-2s-1-1.5-1-2.5S14 15 15.5 15H17a4 4 0 0 0 4-4 8 8 0 0 0-9-8zM8 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"></path></svg><span>Appearance</span></a><a href="/system"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v10H4zM2 19h20M9 15v4M15 15v4" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>System</span></a><select aria-label="Language" style="width:auto"><option value="en" selected="">English</option><option value="bg">Български</option></select></nav></header><main id="main"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--></main></div><script src="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[8078,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0f0f8c3bd37be31e.js\",\"549\",\"static/chunks/549-1fe42544e4b72942.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"AppearanceProvider\"]\n3:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0f0f8c3bd37be31e.js\",\"549\",\"static/chunks/549-1fe42544e4b72942.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"LanguageProvider\"]\n4:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0f0f8c3bd37be31e.js\",\"549\",\"static/chunks/549-1fe42544e4b72942.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"DialogHost\"]\n5:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0f0f8c3bd37be31e.js\",\"549\",\"static/chunks/549-1fe42544e4b72942.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"SkipLink\"]\n6:I[966,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0f0f8c3bd37be31e.js\",\"549\",\"static/chunks/549-1fe42544e4b72942.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"Shell\"]\n7:I[5204,[],\"\"]\n8:I[2642,[],\"\"]\n9:I[7712,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0f0f8c3bd37be31e.js\",\"549\",\"static/chunks/549-1fe42544e4b72942.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"ScrollJump\"]\na:I[1701,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0f0f8c3bd37be31e.js\",\"549\",\"static/chunks/549-1fe42544e4b72942.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"StartDialogHost\"]\nb:I[433,[],\"OutletBoundary\"]\nd:I[9884,[],\"AsyncMetadataOutlet\"]\nf:I[433,[],\"ViewportBoundary\"]\n11:I[433,[],\"MetadataBoundary\"]\n12:\"$Sreact.suspense\"\n14"])</script><script>self.__next_f.push([1,":I[3536,[],\"\"]\n:HL[\"/_next/static/css/eaec9cc6fe8aceb7.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"BX8Nw248DTY9xAfUu2pOH\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/eaec9cc6fe8aceb7.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"data-theme\":\"light\",\"data-textsize\":\"normal\",\"data-contrast\":\"normal\",\"data-motion\":\"normal\",\"data-links\":\"plain\",\"data-focus\":\"normal\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n(function () {\\n try {\\n var d = document.documentElement;\\n var raw = localStorage.getItem('cop.appearance');\\n var a = raw ? JSON.parse(raw) : {};\\n if (!a || typeof a !== 'object') a = {};\\n d.dataset.theme = a.theme === 'dark' ? 'dark' : 'light';\\n d.dataset.textsize = [\\\"small\\\",\\\"normal\\\",\\\"large\\\",\\\"huge\\\",\\\"giant\\\"].indexOf(a.textSize) \u003e= 0 ? a.textSize : 'normal';\\n d.dataset.contrast = a.highContrast ? 'high' : 'normal';\\n d.dataset.motion = a.reduceMotion ? 'reduced' : 'normal';\\n d.dataset.links = a.underlineLinks ? 'underline' : 'plain';\\n d.dataset.focus = a.strongFocus ? 'strong' : 'normal';\\n } catch (e) {}\\n})();\\n\"}}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"children\":[[\"$\",\"$L5\",null,{}],[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L7\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L8\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}],[\"$\",\"$L9\",null,{}],[\"$\",\"$La\",null,{}]]}]}]}]}]]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L7\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L8\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$Lb\",null,{\"children\":[\"$Lc\",[\"$\",\"$Ld\",null,{\"promise\":\"$@e\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$Lf\",null,{\"children\":\"$L10\"}],null],[\"$\",\"$L11\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$12\",null,{\"fallback\":null,\"children\":\"$L13\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$14\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"10:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\nc:null\n"])</script><script>self.__next_f.push([1,"e:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"copilot-operator\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Runs task loops with Microsoft 365 Copilot on this machine.\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"13:\"$e:metadata\"\n"])</script></body></html>
|
|
16
|
+
</script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><a class="skip-link" href="#main">Skip to the content</a><div class="wrap"><header class="top"><h1><a href="/">copilot-operator</a></h1><nav aria-label="Main"><a href="/"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M3 4h18v16H3zM9 4v16M3 15h6" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Workbench</span></a><a href="/sessions"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v4H4zM4 11h16v4H4zM4 17h10v2H4z"></path></svg><span>Sessions</span></a><a href="/defaults"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm8.5 4 1.5 1-1.6 2.8-1.8-.4a7 7 0 0 1-1.5 1.5l.4 1.8L14.7 21l-1-1.5a7 7 0 0 1-3.4 0l-1 1.5-2.8-1.6.4-1.8A7 7 0 0 1 5.4 16l-1.8.4L2 13.6 3.5 12.6V11.4L2 10.4l1.6-2.8 1.8.4A7 7 0 0 1 6.9 6.5l-.4-1.8L9.3 3l1 1.5a7 7 0 0 1 3.4 0l1-1.5 2.8 1.6-.4 1.8a7 7 0 0 1 1.5 1.5l1.8-.4L22 10.4l-1.5 1z"></path></svg><span>Settings</span></a><a href="/import"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3v10m0 0 4-4m-4 4-4-4M4 15v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Plan from JSON</span></a><a href="/history"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 1 0 8.5 6M12 7v5l3 2M3 4v5h5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Task register</span></a><a href="/level1"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M6 3h9l5 5v13H6zM14 3v6h6M9 13h7M9 17h7" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 1 prompt</span></a><a href="/presets"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M5 4h14v4H5zM5 10h14v4H5zM5 16h9v4H5z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 2 presets</span></a><a href="/appearance"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 0 0 0 18c1.5 0 2-1 2-2s-1-1.5-1-2.5S14 15 15.5 15H17a4 4 0 0 0 4-4 8 8 0 0 0-9-8zM8 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"></path></svg><span>Appearance</span></a><a href="/system"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v10H4zM2 19h20M9 15v4M15 15v4" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>System</span></a><select aria-label="Language" style="width:auto"><option value="en" selected="">English</option><option value="bg">Български</option></select></nav></header><main id="main"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--></main></div><script src="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[8078,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7fb52be342fa64e5.js\",\"549\",\"static/chunks/549-8732dd2c1339bc5d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-485ce9395cb17998.js\"],\"AppearanceProvider\"]\n3:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7fb52be342fa64e5.js\",\"549\",\"static/chunks/549-8732dd2c1339bc5d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-485ce9395cb17998.js\"],\"LanguageProvider\"]\n4:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7fb52be342fa64e5.js\",\"549\",\"static/chunks/549-8732dd2c1339bc5d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-485ce9395cb17998.js\"],\"DialogHost\"]\n5:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7fb52be342fa64e5.js\",\"549\",\"static/chunks/549-8732dd2c1339bc5d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-485ce9395cb17998.js\"],\"SkipLink\"]\n6:I[966,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7fb52be342fa64e5.js\",\"549\",\"static/chunks/549-8732dd2c1339bc5d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-485ce9395cb17998.js\"],\"Shell\"]\n7:I[5204,[],\"\"]\n8:I[2642,[],\"\"]\n9:I[7712,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7fb52be342fa64e5.js\",\"549\",\"static/chunks/549-8732dd2c1339bc5d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-485ce9395cb17998.js\"],\"ScrollJump\"]\na:I[1701,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7fb52be342fa64e5.js\",\"549\",\"static/chunks/549-8732dd2c1339bc5d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-485ce9395cb17998.js\"],\"StartDialogHost\"]\nb:I[433,[],\"OutletBoundary\"]\nd:I[9884,[],\"AsyncMetadataOutlet\"]\nf:I[433,[],\"ViewportBoundary\"]\n11:I[433,[],\"MetadataBoundary\"]\n12:\"$Sreact.suspense\"\n14"])</script><script>self.__next_f.push([1,":I[3536,[],\"\"]\n:HL[\"/_next/static/css/70ceb261074b139c.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"uAYbk9CSKPZe3-jWXmPOP\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/70ceb261074b139c.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"data-theme\":\"light\",\"data-textsize\":\"normal\",\"data-contrast\":\"normal\",\"data-motion\":\"normal\",\"data-links\":\"plain\",\"data-focus\":\"normal\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n(function () {\\n try {\\n var d = document.documentElement;\\n var raw = localStorage.getItem('cop.appearance');\\n var a = raw ? JSON.parse(raw) : {};\\n if (!a || typeof a !== 'object') a = {};\\n d.dataset.theme = a.theme === 'dark' ? 'dark' : 'light';\\n d.dataset.textsize = [\\\"small\\\",\\\"normal\\\",\\\"large\\\",\\\"huge\\\",\\\"giant\\\"].indexOf(a.textSize) \u003e= 0 ? a.textSize : 'normal';\\n d.dataset.contrast = a.highContrast ? 'high' : 'normal';\\n d.dataset.motion = a.reduceMotion ? 'reduced' : 'normal';\\n d.dataset.links = a.underlineLinks ? 'underline' : 'plain';\\n d.dataset.focus = a.strongFocus ? 'strong' : 'normal';\\n } catch (e) {}\\n})();\\n\"}}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"children\":[[\"$\",\"$L5\",null,{}],[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L7\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L8\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}],[\"$\",\"$L9\",null,{}],[\"$\",\"$La\",null,{}]]}]}]}]}]]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L7\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L8\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$Lb\",null,{\"children\":[\"$Lc\",[\"$\",\"$Ld\",null,{\"promise\":\"$@e\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$Lf\",null,{\"children\":\"$L10\"}],null],[\"$\",\"$L11\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$12\",null,{\"fallback\":null,\"children\":\"$L13\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$14\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"10:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\nc:null\n"])</script><script>self.__next_f.push([1,"e:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"copilot-operator\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Runs task loops with Microsoft 365 Copilot on this machine.\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"13:\"$e:metadata\"\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[549],{5549:(t,o,e)=>{e.d(o,{AV:()=>a,Dh:()=>h,FH:()=>m,FZ:()=>r,Zm:()=>u,aT:()=>s,c5:()=>f,dK:()=>l,nC:()=>n,rt:()=>d,ub:()=>i,zi:()=>y});let n="/api";function s(t,o){return"/sessions/view?id=".concat(encodeURIComponent(t)).concat(o?"#".concat(o):"")}let c="cop-api-token";function a(){try{let t=/(?:^#|&)token=([0-9a-f]{16,})/i.exec(window.location.hash);if(t)return window.localStorage.setItem(c,t[1]),window.history.replaceState(null,"",window.location.pathname+window.location.search),t[1];return window.localStorage.getItem(c)||""}catch(t){return""}}function i(t){let o=a();return o?"".concat(t).concat(t.includes("?")?"&":"?","token=").concat(encodeURIComponent(o)):t}let r=["exit-zero","exit-nonzero","output-contains","output-omits","output-matches","file-exists","file-missing","file-contains"];function d(t){return t.startsWith("exit-")||t.startsWith("output-")}function l(t){return"output-contains"===t||"output-omits"===t||"output-matches"===t||"file-contains"===t}function u(t){return"limit-reached"===t.status||"aborted"===t.status||!!t.limit&&("failed"===t.status||"blocked"===t.status)}function h(t){return("failed"===t.status||"blocked"===t.status)&&"contract-conflict"!==t.stopCode}async function p(t,o){let e,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=void 0===s.timeoutMs?3e4:s.timeoutMs;try{var i;e=await fetch("".concat(n).concat(t),{...o,...null!==c&&!(null==o?void 0:o.signal)?{signal:AbortSignal.timeout(c)}:{},headers:{"content-type":"application/json",...a()?{"x-cop-token":a()}:{},...null!=(i=null==o?void 0:o.headers)?i:{}}})}catch(o){if("TimeoutError"===o.name)throw Error("The API did not answer within ".concat(Math.round((null!=c?c:0)/1e3)," s (").concat(t.split("?")[0],"). It may be busy; try again."));throw o}if(!e.ok){let t="".concat(e.status," ").concat(e.statusText);try{let o=await e.json();(null==o?void 0:o.message)&&(t=Array.isArray(o.message)?o.message.join("; "):o.message)}catch(t){}throw Error(t)}let r=await e.text();return r?JSON.parse(r):void 0}let m={health:()=>p("/health"),doctor:()=>p("/doctor"),settings:()=>p("/settings"),saveSettings:t=>p("/settings",{method:"PUT",body:JSON.stringify(t)}),level1:()=>p("/level1"),setLevel1:t=>p("/level1",{method:"PUT",body:JSON.stringify({content:t})}),resetLevel1:()=>p("/level1",{method:"DELETE"}),presets:()=>p("/presets"),savePreset:(t,o)=>p("/presets/".concat(encodeURIComponent(t)),{method:"PUT",body:JSON.stringify({content:o})}),deletePreset:t=>p("/presets/".concat(encodeURIComponent(t)),{method:"DELETE"}),personas:()=>p("/personas"),savePersona:(t,o)=>p("/personas/".concat(encodeURIComponent(t)),{method:"PUT",body:JSON.stringify({content:o})}),deletePersona:t=>p("/personas/".concat(encodeURIComponent(t)),{method:"DELETE"}),sessions:()=>p("/sessions"),reorderSessions:t=>p("/sessions-order",{method:"PUT",body:JSON.stringify({ids:t})}),metrics:()=>p("/metrics"),preparePreview:function(t){let o=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return p("/repo/prepare/preview",{method:"POST",body:JSON.stringify({dir:t,fetch:o})},{timeoutMs:33e4})},prepareProject:function(t,o){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return p("/repo/prepare",{method:"POST",body:JSON.stringify({dir:t,fingerprint:o,...e})})},session:t=>p("/sessions/".concat(t)),createSession:(t,o)=>p("/sessions",{method:"POST",body:JSON.stringify({name:t,projectDir:o})}),updateSession:(t,o)=>p("/sessions/".concat(t),{method:"PUT",body:JSON.stringify(o)}),deleteSession:t=>p("/sessions/".concat(t),{method:"DELETE"}),addTask:(t,o)=>p("/sessions/".concat(t,"/tasks"),{method:"POST",body:JSON.stringify(o)}),updateTask:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o),{method:"PUT",body:JSON.stringify(e)}),deleteTask:(t,o)=>p("/sessions/".concat(t,"/tasks/").concat(o),{method:"DELETE"}),continueTask:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/continue"),{method:"POST",body:JSON.stringify((null==e?void 0:e.trim())?{instruction:e}:{})}),rerunTask:function(t,o){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return p("/sessions/".concat(t,"/tasks/").concat(o,"/rerun"),{method:"POST",body:JSON.stringify({...e,...n.buildOnFinished?{buildOnFinished:!0}:{}})})},taskChanges:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/changes").concat(e?"?run=".concat(encodeURIComponent(e)):"")),taskChangeFile:(t,o,e,n)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/changes/file?path=").concat(encodeURIComponent(e)).concat(n?"&run=".concat(encodeURIComponent(n)):"")),taskStory:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/story").concat(e?"?run=".concat(encodeURIComponent(e)):"")),taskFiles:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/files").concat(e?"?run=".concat(encodeURIComponent(e)):"")),taskLogUrl:(t,o,e)=>"".concat(n,"/sessions/").concat(t,"/tasks/").concat(o,"/log").concat(e?"?run=".concat(encodeURIComponent(e)):""),taskFileUrl:(t,o,e,s,c)=>"".concat(n,"/sessions/").concat(t,"/tasks/").concat(o,"/files/").concat(e,"/").concat(encodeURIComponent(s)).concat(c?"?run=".concat(encodeURIComponent(c)):""),saveTaskLog:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/log").concat(e?"?run=".concat(encodeURIComponent(e)):""),{method:"POST",body:"{}"}),saveTaskFile:(t,o,e,n,s)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/files/").concat(e,"/").concat(encodeURIComponent(n)).concat(s?"?run=".concat(encodeURIComponent(s)):""),{method:"POST",body:"{}"}),start:(t,o,e,n)=>p("/sessions/".concat(t,"/start"),{method:"POST",body:JSON.stringify({mode:o,name:e,starts:n})},{timeoutMs:12e4}),startOptions:t=>p("/start/options?sessions=".concat(encodeURIComponent(t.join(",")))),startFetch:(t,o,e)=>p("/start/fetch",{method:"POST",body:JSON.stringify({dir:t,remote:o,...e?{branches:e}:{}})},{timeoutMs:33e4}),startFailures:function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return p("/start/failures".concat(t?"?unanswered=1":""))},startFailureUrl:t=>i("".concat(n,"/start/failures/").concat(encodeURIComponent(t),"/report")),terminalUrl:()=>i("".concat(n,"/terminal")),stop:t=>p("/sessions/".concat(t,"/stop"),{method:"POST",body:"{}"}),approvals:t=>p("/approvals".concat(t?"?session=".concat(encodeURIComponent(t)):"")),undoPreview:(t,o)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/undo")),undoTask:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/undo"),{method:"POST",body:JSON.stringify({how:e})}),acceptTask:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/accept"),{method:"POST",body:JSON.stringify((null==e?void 0:e.trim())?{note:e}:{})}),addTaskNote:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/notes"),{method:"POST",body:JSON.stringify({text:e})}),kerriganReport:t=>p("/kerrigan/report",{method:"POST",body:JSON.stringify(t)}),checkChanges:t=>p("/changes/check",{method:"POST",body:JSON.stringify({text:t})}),applyChanges:t=>p("/changes/apply",{method:"POST",body:JSON.stringify({text:t})}),workspace:()=>p("/workspace"),workspaceFiles:()=>p("/workspace/files"),workspaceFile:t=>p("/workspace/file?path=".concat(encodeURIComponent(t))),chatThreads:()=>p("/chat/threads"),chatSend:(t,o)=>p("/chat",{method:"POST",body:JSON.stringify({text:t,...o?{threadId:o}:{}})}),repoTree:function(t){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=arguments.length>2?arguments[2]:void 0;return p("/sessions/".concat(t,"/repo/tree?path=").concat(encodeURIComponent(o)).concat(e?"&task=".concat(encodeURIComponent(e)):""))},repoFile:(t,o,e)=>p("/sessions/".concat(t,"/repo/file?path=").concat(encodeURIComponent(o)).concat(e?"&task=".concat(encodeURIComponent(e)):"")),repoLog:t=>p("/sessions/".concat(t,"/repo/log")),sessionEvents:t=>p("/sessions/".concat(t,"/events")),decidePlan:(t,o,e)=>p("/approvals/".concat(t,"/plan"),{method:"POST",body:JSON.stringify({action:o,...(null==e?void 0:e.trim())?{note:e}:{}})}),decide:(t,o)=>p("/approvals/".concat(t),{method:"POST",body:JSON.stringify({action:o})}),setRunMode:(t,o)=>p("/sessions/".concat(t,"/mode"),{method:"POST",body:JSON.stringify({mode:o})}),streamUrl:t=>i("".concat(n,"/sessions/").concat(t,"/stream")),batch:()=>p("/batch").then(t=>null!=t?t:null),startBatch:(t,o,e,n,s,c,a,i)=>p("/batch/start",{method:"POST",body:JSON.stringify({sessionIds:t,mode:o,onFailure:e,model:n,reviewModel:s,name:c,taskIds:a,starts:i})},{timeoutMs:12e4}),suggestedRunName:t=>p("/batch/name?sessions=".concat(encodeURIComponent(t.join(",")))),stopBatch:()=>p("/batch/stop",{method:"POST",body:"{}"}),pauseBatch:()=>p("/batch/pause",{method:"POST",body:"{}"}),resumeBatch:()=>p("/batch/resume",{method:"POST",body:"{}"}),planBrief:t=>p("/plan/brief?lang=".concat(encodeURIComponent(t))),context:(t,o)=>p("/context/".concat(t,"?lang=").concat(encodeURIComponent(o))),setContext:(t,o)=>p("/context/".concat(t),{method:"PUT",body:JSON.stringify({content:o})}),resetContext:(t,o)=>p("/context/".concat(t,"?lang=").concat(encodeURIComponent(o)),{method:"DELETE"}),checkPlan:t=>p("/plan/check",{method:"POST",body:JSON.stringify({text:t})}),importPlan:t=>p("/plan/import",{method:"POST",body:JSON.stringify({text:t})}),browseFolder:t=>p("/browse-folder",{method:"POST",body:JSON.stringify({start:t})},{timeoutMs:null}),tasks:()=>p("/tasks"),activity:()=>p("/activity"),downloadBundle:async t=>{var o,e,s;let c=await fetch("".concat(n,"/export/bundle"),{method:"POST",headers:{"content-type":"application/json",...a()?{"x-cop-token":a()}:{}},body:JSON.stringify({tasks:t})});if(!c.ok)throw Error(await c.text()||"".concat(c.status," ").concat(c.statusText));let i=null!=(s=c.headers.get("content-disposition"))?s:"",r=null==(o=/filename\*=UTF-8''([^;]+)/i.exec(i))?void 0:o[1],d=null==(e=/filename="([^"]+)"/i.exec(i))?void 0:e[1],l=null!=d?d:"copilot-operator-bundle.json";if(r)try{l=decodeURIComponent(r)}catch(t){}let u=URL.createObjectURL(await c.blob()),h=document.createElement("a");return h.href=u,h.download=l,document.body.appendChild(h),h.click(),h.remove(),setTimeout(()=>URL.revokeObjectURL(u),1e4),l},exportUrl:(t,o)=>{let e=new URLSearchParams;return o.run&&e.set("run",o.run),o.session&&e.set("session",o.session),o.task&&e.set("task",o.task),i("".concat(n,"/export/").concat(t,"?").concat(e.toString()))},debugExportUrl:t=>i("".concat(n,"/debug/export").concat(t.length>0?"?sessions=".concat(encodeURIComponent(t.join(","))):"")),vcsStatus:t=>p("/sessions/".concat(t,"/vcs")),runVcs:t=>p("/batch/vcs?ids=".concat(encodeURIComponent(t.join(",")))),runVcsPrepare:function(t,o,e){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return p("/batch/vcs/prepare",{method:"POST",body:JSON.stringify({sessionIds:t,repoDir:o,action:e,choices:n})})},vcsSnapshot:(t,o)=>p("/sessions/".concat(t,"/vcs/snapshot"),{method:"POST",body:JSON.stringify({choices:o})}),restorePreview:(t,o)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/restore")),restore:(t,o)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/restore"),{method:"POST",body:"{}"}),contractCheck:(t,o)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/contract")),applyContractFix:(t,o,e,n)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/contract-fix"),{method:"POST",body:JSON.stringify({choices:e,expect:n})}),restartPlan:(t,o)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/restart")),restartFrom:function(t,o){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return p("/sessions/".concat(t,"/tasks/").concat(o,"/restart"),{method:"POST",body:JSON.stringify(e)})},repoCheck:t=>p("/repo?dir=".concat(encodeURIComponent(t))),project:()=>p("/project"),setProject:t=>p("/project",{method:"PUT",body:JSON.stringify(t)}),models:()=>p("/models"),setDefaultModel:t=>p("/models/default",{method:"PUT",body:JSON.stringify({model:t})}),setDefaultReviewModel:t=>p("/models/review-default",{method:"PUT",body:JSON.stringify({model:t})}),refreshModels:()=>p("/models/refresh",{method:"POST",body:"{}"},{timeoutMs:null}),login:t=>p("/login",{method:"POST",body:JSON.stringify({account:(null==t?void 0:t.trim())||void 0})},{timeoutMs:null})};function y(t){return t<1024?"".concat(t," B"):t<1048576?"".concat((t/1024).toFixed(1)," KB"):"".concat((t/1048576).toFixed(1)," MB")}function f(t){if(void 0===t)return"";let o=Math.round(t/1e3);if(o<60)return"".concat(o,"s");let e=Math.floor(o/60);return e<60?"".concat(e,"m ").concat(o%60,"s"):"".concat(Math.floor(e/60),"h ").concat(e%60,"m")}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[549],{5549:(t,o,e)=>{e.d(o,{AV:()=>a,Dh:()=>u,FH:()=>m,FZ:()=>r,Zm:()=>h,aT:()=>s,c5:()=>f,dK:()=>l,nC:()=>n,rt:()=>d,ub:()=>i,zi:()=>y});let n="/api";function s(t,o){return"/sessions/view?id=".concat(encodeURIComponent(t)).concat(o?"#".concat(o):"")}let c="cop-api-token";function a(){try{let t=/(?:^#|&)token=([0-9a-f]{16,})/i.exec(window.location.hash);if(t)return window.localStorage.setItem(c,t[1]),window.history.replaceState(null,"",window.location.pathname+window.location.search),t[1];return window.localStorage.getItem(c)||""}catch(t){return""}}function i(t){let o=a();return o?"".concat(t).concat(t.includes("?")?"&":"?","token=").concat(encodeURIComponent(o)):t}let r=["exit-zero","exit-nonzero","output-contains","output-omits","output-matches","file-exists","file-missing","file-contains"];function d(t){return t.startsWith("exit-")||t.startsWith("output-")}function l(t){return"output-contains"===t||"output-omits"===t||"output-matches"===t||"file-contains"===t}function h(t){return"limit-reached"===t.status||"aborted"===t.status||!!t.limit&&("failed"===t.status||"blocked"===t.status)}function u(t){return("failed"===t.status||"blocked"===t.status)&&"contract-conflict"!==t.stopCode}async function p(t,o){let e,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=void 0===s.timeoutMs?3e4:s.timeoutMs;try{var i;e=await fetch("".concat(n).concat(t),{...o,...null!==c&&!(null==o?void 0:o.signal)?{signal:AbortSignal.timeout(c)}:{},headers:{"content-type":"application/json",...a()?{"x-cop-token":a()}:{},...null!=(i=null==o?void 0:o.headers)?i:{}}})}catch(o){if("TimeoutError"===o.name)throw Error("The API did not answer within ".concat(Math.round((null!=c?c:0)/1e3)," s (").concat(t.split("?")[0],"). It may be busy; try again."));throw o}if(!e.ok){let t="".concat(e.status," ").concat(e.statusText);try{let o=await e.json();(null==o?void 0:o.message)&&(t=Array.isArray(o.message)?o.message.join("; "):o.message)}catch(t){}throw Error(t)}let r=await e.text();return r?JSON.parse(r):void 0}let m={health:()=>p("/health"),doctor:()=>p("/doctor"),settings:()=>p("/settings"),saveSettings:t=>p("/settings",{method:"PUT",body:JSON.stringify(t)}),level1:()=>p("/level1"),setLevel1:t=>p("/level1",{method:"PUT",body:JSON.stringify({content:t})}),resetLevel1:()=>p("/level1",{method:"DELETE"}),presets:()=>p("/presets"),savePreset:(t,o)=>p("/presets/".concat(encodeURIComponent(t)),{method:"PUT",body:JSON.stringify({content:o})}),deletePreset:t=>p("/presets/".concat(encodeURIComponent(t)),{method:"DELETE"}),personas:()=>p("/personas"),savePersona:(t,o)=>p("/personas/".concat(encodeURIComponent(t)),{method:"PUT",body:JSON.stringify({content:o})}),deletePersona:t=>p("/personas/".concat(encodeURIComponent(t)),{method:"DELETE"}),sessions:()=>p("/sessions"),reorderSessions:t=>p("/sessions-order",{method:"PUT",body:JSON.stringify({ids:t})}),metrics:()=>p("/metrics"),preparePreview:function(t){let o=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return p("/repo/prepare/preview",{method:"POST",body:JSON.stringify({dir:t,fetch:o})},{timeoutMs:33e4})},prepareProject:function(t,o){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return p("/repo/prepare",{method:"POST",body:JSON.stringify({dir:t,fingerprint:o,...e})})},session:t=>p("/sessions/".concat(t)),createSession:(t,o)=>p("/sessions",{method:"POST",body:JSON.stringify({name:t,projectDir:o})}),updateSession:(t,o)=>p("/sessions/".concat(t),{method:"PUT",body:JSON.stringify(o)}),deleteSession:t=>p("/sessions/".concat(t),{method:"DELETE"}),addTask:(t,o)=>p("/sessions/".concat(t,"/tasks"),{method:"POST",body:JSON.stringify(o)}),updateTask:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o),{method:"PUT",body:JSON.stringify(e)}),deleteTask:(t,o)=>p("/sessions/".concat(t,"/tasks/").concat(o),{method:"DELETE"}),continueTask:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/continue"),{method:"POST",body:JSON.stringify((null==e?void 0:e.trim())?{instruction:e}:{})}),rerunTask:function(t,o){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return p("/sessions/".concat(t,"/tasks/").concat(o,"/rerun"),{method:"POST",body:JSON.stringify({...e,...n.buildOnFinished?{buildOnFinished:!0}:{}})})},taskChanges:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/changes").concat(e?"?run=".concat(encodeURIComponent(e)):"")),taskChangeFile:(t,o,e,n)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/changes/file?path=").concat(encodeURIComponent(e)).concat(n?"&run=".concat(encodeURIComponent(n)):"")),taskStory:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/story").concat(e?"?run=".concat(encodeURIComponent(e)):"")),taskFiles:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/files").concat(e?"?run=".concat(encodeURIComponent(e)):"")),taskLogUrl:(t,o,e)=>"".concat(n,"/sessions/").concat(t,"/tasks/").concat(o,"/log").concat(e?"?run=".concat(encodeURIComponent(e)):""),taskFileUrl:(t,o,e,s,c)=>"".concat(n,"/sessions/").concat(t,"/tasks/").concat(o,"/files/").concat(e,"/").concat(encodeURIComponent(s)).concat(c?"?run=".concat(encodeURIComponent(c)):""),saveTaskLog:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/log").concat(e?"?run=".concat(encodeURIComponent(e)):""),{method:"POST",body:"{}"}),saveTaskFile:(t,o,e,n,s)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/files/").concat(e,"/").concat(encodeURIComponent(n)).concat(s?"?run=".concat(encodeURIComponent(s)):""),{method:"POST",body:"{}"}),start:(t,o,e,n)=>p("/sessions/".concat(t,"/start"),{method:"POST",body:JSON.stringify({mode:o,name:e,starts:n})},{timeoutMs:12e4}),startOptions:t=>p("/start/options?sessions=".concat(encodeURIComponent(t.join(",")))),startFetch:(t,o,e)=>p("/start/fetch",{method:"POST",body:JSON.stringify({dir:t,remote:o,...e?{branches:e}:{}})},{timeoutMs:33e4}),startFailures:function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return p("/start/failures".concat(t?"?unanswered=1":""))},startFailureUrl:t=>i("".concat(n,"/start/failures/").concat(encodeURIComponent(t),"/report")),terminalUrl:()=>i("".concat(n,"/terminal")),stop:t=>p("/sessions/".concat(t,"/stop"),{method:"POST",body:"{}"}),approvals:t=>p("/approvals".concat(t?"?session=".concat(encodeURIComponent(t)):"")),undoPreview:(t,o)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/undo")),undoTask:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/undo"),{method:"POST",body:JSON.stringify({how:e})}),acceptTask:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/accept"),{method:"POST",body:JSON.stringify((null==e?void 0:e.trim())?{note:e}:{})}),addTaskNote:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/notes"),{method:"POST",body:JSON.stringify({text:e})}),kerriganReport:t=>p("/kerrigan/report",{method:"POST",body:JSON.stringify(t)}),checkChanges:t=>p("/changes/check",{method:"POST",body:JSON.stringify({text:t})}),applyChanges:t=>p("/changes/apply",{method:"POST",body:JSON.stringify({text:t})}),workspace:()=>p("/workspace"),workspaceFiles:()=>p("/workspace/files"),workspaceFile:t=>p("/workspace/file?path=".concat(encodeURIComponent(t))),chatThreads:()=>p("/chat/threads"),chatSend:(t,o,e,n)=>p("/chat",{method:"POST",body:JSON.stringify({text:t,...o?{threadId:o}:{},...e?{model:e}:{},...n?{manualModel:!0}:{}})}),chatRewind:(t,o)=>p("/chat/".concat(t,"/rewind"),{method:"POST",body:JSON.stringify({taskId:o})}),repoTree:function(t){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=arguments.length>2?arguments[2]:void 0;return p("/sessions/".concat(t,"/repo/tree?path=").concat(encodeURIComponent(o)).concat(e?"&task=".concat(encodeURIComponent(e)):""))},repoFile:(t,o,e)=>p("/sessions/".concat(t,"/repo/file?path=").concat(encodeURIComponent(o)).concat(e?"&task=".concat(encodeURIComponent(e)):"")),repoLog:t=>p("/sessions/".concat(t,"/repo/log")),sessionEvents:t=>p("/sessions/".concat(t,"/events")),decidePlan:(t,o,e)=>p("/approvals/".concat(t,"/plan"),{method:"POST",body:JSON.stringify({action:o,...(null==e?void 0:e.trim())?{note:e}:{}})}),decide:(t,o)=>p("/approvals/".concat(t),{method:"POST",body:JSON.stringify({action:o})}),setRunMode:(t,o)=>p("/sessions/".concat(t,"/mode"),{method:"POST",body:JSON.stringify({mode:o})}),streamUrl:t=>i("".concat(n,"/sessions/").concat(t,"/stream")),batch:()=>p("/batch").then(t=>null!=t?t:null),startBatch:(t,o,e,n,s,c,a,i)=>p("/batch/start",{method:"POST",body:JSON.stringify({sessionIds:t,mode:o,onFailure:e,model:n,reviewModel:s,name:c,taskIds:a,starts:i})},{timeoutMs:12e4}),suggestedRunName:t=>p("/batch/name?sessions=".concat(encodeURIComponent(t.join(",")))),stopBatch:()=>p("/batch/stop",{method:"POST",body:"{}"}),pauseBatch:()=>p("/batch/pause",{method:"POST",body:"{}"}),resumeBatch:()=>p("/batch/resume",{method:"POST",body:"{}"}),planBrief:t=>p("/plan/brief?lang=".concat(encodeURIComponent(t))),context:(t,o)=>p("/context/".concat(t,"?lang=").concat(encodeURIComponent(o))),setContext:(t,o)=>p("/context/".concat(t),{method:"PUT",body:JSON.stringify({content:o})}),resetContext:(t,o)=>p("/context/".concat(t,"?lang=").concat(encodeURIComponent(o)),{method:"DELETE"}),checkPlan:t=>p("/plan/check",{method:"POST",body:JSON.stringify({text:t})}),importPlan:t=>p("/plan/import",{method:"POST",body:JSON.stringify({text:t})}),browseFolder:t=>p("/browse-folder",{method:"POST",body:JSON.stringify({start:t})},{timeoutMs:null}),tasks:()=>p("/tasks"),activity:()=>p("/activity"),downloadBundle:async t=>{var o,e,s;let c=await fetch("".concat(n,"/export/bundle"),{method:"POST",headers:{"content-type":"application/json",...a()?{"x-cop-token":a()}:{}},body:JSON.stringify({tasks:t})});if(!c.ok)throw Error(await c.text()||"".concat(c.status," ").concat(c.statusText));let i=null!=(s=c.headers.get("content-disposition"))?s:"",r=null==(o=/filename\*=UTF-8''([^;]+)/i.exec(i))?void 0:o[1],d=null==(e=/filename="([^"]+)"/i.exec(i))?void 0:e[1],l=null!=d?d:"copilot-operator-bundle.json";if(r)try{l=decodeURIComponent(r)}catch(t){}let h=URL.createObjectURL(await c.blob()),u=document.createElement("a");return u.href=h,u.download=l,document.body.appendChild(u),u.click(),u.remove(),setTimeout(()=>URL.revokeObjectURL(h),1e4),l},exportUrl:(t,o)=>{let e=new URLSearchParams;return o.run&&e.set("run",o.run),o.session&&e.set("session",o.session),o.task&&e.set("task",o.task),i("".concat(n,"/export/").concat(t,"?").concat(e.toString()))},debugExportUrl:t=>i("".concat(n,"/debug/export").concat(t.length>0?"?sessions=".concat(encodeURIComponent(t.join(","))):"")),vcsStatus:t=>p("/sessions/".concat(t,"/vcs")),runVcs:t=>p("/batch/vcs?ids=".concat(encodeURIComponent(t.join(",")))),runVcsPrepare:function(t,o,e){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return p("/batch/vcs/prepare",{method:"POST",body:JSON.stringify({sessionIds:t,repoDir:o,action:e,choices:n})})},vcsSnapshot:(t,o)=>p("/sessions/".concat(t,"/vcs/snapshot"),{method:"POST",body:JSON.stringify({choices:o})}),restorePreview:(t,o)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/restore")),restore:(t,o)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/restore"),{method:"POST",body:"{}"}),contractCheck:(t,o)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/contract")),applyContractFix:(t,o,e,n)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/contract-fix"),{method:"POST",body:JSON.stringify({choices:e,expect:n})}),restartPlan:(t,o)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/restart")),restartFrom:function(t,o){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return p("/sessions/".concat(t,"/tasks/").concat(o,"/restart"),{method:"POST",body:JSON.stringify(e)})},repoCheck:t=>p("/repo?dir=".concat(encodeURIComponent(t))),project:()=>p("/project"),setProject:t=>p("/project",{method:"PUT",body:JSON.stringify(t)}),models:()=>p("/models"),setDefaultModel:t=>p("/models/default",{method:"PUT",body:JSON.stringify({model:t})}),setDefaultReviewModel:t=>p("/models/review-default",{method:"PUT",body:JSON.stringify({model:t})}),refreshModels:()=>p("/models/refresh",{method:"POST",body:"{}"},{timeoutMs:null}),login:t=>p("/login",{method:"POST",body:JSON.stringify({account:(null==t?void 0:t.trim())||void 0})},{timeoutMs:null})};function y(t){return t<1024?"".concat(t," B"):t<1048576?"".concat((t/1024).toFixed(1)," KB"):"".concat((t/1048576).toFixed(1)," MB")}function f(t){if(void 0===t)return"";let o=Math.round(t/1e3);if(o<60)return"".concat(o,"s");let e=Math.floor(o/60);return e<60?"".concat(e,"m ").concat(o%60,"s"):"".concat(Math.floor(e/60),"h ").concat(e%60,"m")}}}]);
|