copilot-operator 0.1.12 → 0.1.15
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/README.md +9 -14
- package/dist/src/api/operator.controller.js +31 -42
- package/dist/src/api/operator.service.js +692 -364
- package/dist/src/api/saveToDesktop.js +1 -1
- package/dist/src/api/security.js +40 -10
- package/dist/src/api/server.js +75 -12
- package/dist/src/api/settings.js +156 -15
- package/dist/src/cli.js +108 -97
- package/dist/src/config/handWritten.js +36 -0
- package/dist/src/config/layout.js +13 -4
- package/dist/src/config/lockedPolicy.js +56 -22
- package/dist/src/config/schema.js +13 -84
- package/dist/src/context/desktopDir.js +44 -0
- package/dist/src/exec/authorizer.js +9 -1
- package/dist/src/exec/checks.js +240 -23
- package/dist/src/exec/dangerous.js +29 -5
- package/dist/src/exec/network.js +105 -28
- package/dist/src/exec/redaction.js +52 -9
- package/dist/src/exec/reportFile.js +4 -5
- package/dist/src/exec/runner.js +146 -13
- package/dist/src/exec/shells.js +41 -6
- package/dist/src/exec/workDir.js +4 -4
- package/dist/src/orchestrator/derivedChecks.js +1 -0
- package/dist/src/orchestrator/review.js +25 -3
- package/dist/src/orchestrator/taskRunner.js +482 -150
- package/dist/src/plan/brief.js +56 -44
- package/dist/src/plan/importPlan.js +18 -7
- package/dist/src/plan/schema.js +90 -31
- package/dist/src/plan/script.js +79 -90
- package/dist/src/plan/systemGuide.js +39 -182
- package/dist/src/protocol/parser.js +5 -1
- package/dist/src/session/debugExport.js +1 -1
- package/dist/src/session/exportRecord.js +1 -1
- package/dist/src/session/exports.js +52 -9
- package/dist/src/session/store.js +215 -80
- package/dist/src/vcs/git.js +77 -2
- package/dist/src/vcs/scope.js +29 -6
- package/dist/src/vcs/taskVcs.js +149 -23
- package/dist/web/404.html +2 -2
- package/dist/web/_next/static/chunks/36-94660f1cde2da529.js +1 -0
- package/dist/web/_next/static/chunks/549-9548d9a132c8c7d4.js +1 -0
- package/dist/web/_next/static/chunks/867-8b95ae984befc0e2.js +1 -0
- package/dist/web/_next/static/chunks/app/defaults/page-71a43ed69134b48d.js +1 -0
- package/dist/web/_next/static/chunks/app/history/page-d7314ac22d47a3ab.js +1 -0
- package/dist/web/_next/static/chunks/app/sessions/view/page-886f5fc99e146408.js +1 -0
- package/dist/web/_next/static/css/{a0642fdb8adf9edb.css → e2a2c9eb3c226313.css} +1 -1
- package/dist/web/appearance.html +2 -2
- package/dist/web/appearance.txt +12 -12
- package/dist/web/defaults.html +2 -2
- package/dist/web/defaults.txt +12 -12
- package/dist/web/history.html +2 -2
- package/dist/web/history.txt +12 -12
- package/dist/web/import.html +2 -2
- package/dist/web/import.txt +12 -12
- package/dist/web/index.html +2 -2
- package/dist/web/index.txt +12 -12
- package/dist/web/level1.html +2 -2
- package/dist/web/level1.txt +12 -12
- package/dist/web/presets.html +2 -2
- package/dist/web/presets.txt +12 -12
- package/dist/web/sessions/view.html +2 -2
- package/dist/web/sessions/view.txt +12 -12
- package/dist/web/system.html +2 -2
- package/dist/web/system.txt +12 -12
- package/package.json +18 -10
- package/prompts/level1.md +2 -1
- package/prompts/organisation.bg.md +0 -1
- package/prompts/organisation.en.md +0 -1
- package/dist/src/context/contextFiles.js +0 -295
- package/dist/src/context/desktopMirror.js +0 -135
- package/dist/src/context/projectMirror.js +0 -432
- package/dist/web/_next/static/chunks/295-04151ded0741d18d.js +0 -1
- package/dist/web/_next/static/chunks/36-c3dd06c6a459c114.js +0 -1
- package/dist/web/_next/static/chunks/549-a5a59a94f92bb3eb.js +0 -1
- package/dist/web/_next/static/chunks/867-b64c436f5b25f39e.js +0 -1
- package/dist/web/_next/static/chunks/app/defaults/page-5f180a88398be4c9.js +0 -1
- package/dist/web/_next/static/chunks/app/history/page-854e3dde672e38a2.js +0 -1
- package/dist/web/_next/static/chunks/app/sessions/view/page-cc99401da5173b36.js +0 -1
- /package/dist/web/_next/static/{bcBE4tY_aNh6kzLzN1luP → IwNZiBrEMAcXEUFj2miiU}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{bcBE4tY_aNh6kzLzN1luP → IwNZiBrEMAcXEUFj2miiU}/_ssgManifest.js +0 -0
package/dist/src/vcs/taskVcs.js
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { findSuspicious } from './commitHygiene.js';
|
|
2
|
-
import { branchNameFrom, commitAll, commitFiles, commitsBetween, commitSubject, createBranch, foreignCommits, isAncestor, checkoutExisting, freeBranchName, git, isValidBranchName, plannedBranchName, repoState } from './git.js';
|
|
2
|
+
import { branchExists, branchNameFrom, describeUpdate, updateFromRemote, localBranches, commitAll, commitFiles, commitsBetween, commitSubject, createBranch, foreignCommits, isAncestor, checkoutExisting, freeBranchName, git, isValidBranchName, plannedBranchName, repoState } from './git.js';
|
|
3
3
|
/** Which repository a session works in: its own setting, else the project it mirrors. */
|
|
4
4
|
export function repoDirOf(session) {
|
|
5
|
-
return (session.vcs?.repoDir?.trim() || session.
|
|
5
|
+
return (session.vcs?.repoDir?.trim() || session.projectDir?.trim() || '').trim();
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The repository version control keeps this session's work in, or '' when version control is off.
|
|
9
|
+
*
|
|
10
|
+
* What a reader asks when it wants "the session's repository": `repoDirOf` says which folder that
|
|
11
|
+
* is, and this says whether there is one. Readers that took `vcs.repoDir` itself missed a session
|
|
12
|
+
* whose repository is its project folder — version control on, `repoDir` empty, `projectDir` set,
|
|
13
|
+
* as the session page can save it — where the branch is cut and the work committed all the same:
|
|
14
|
+
* the reviewer was told there was no repository and no changed files.
|
|
15
|
+
*/
|
|
16
|
+
export function trackedRepoOf(session) {
|
|
17
|
+
return session.vcs?.enabled ? repoDirOf(session) : '';
|
|
6
18
|
}
|
|
7
19
|
/**
|
|
8
20
|
* Puts the repository on the right branch for a task and reports where it starts from.
|
|
@@ -25,6 +37,8 @@ allSessions = async () => []) {
|
|
|
25
37
|
message: `version control is on but inactive: ${problem}` });
|
|
26
38
|
return { vcs: { problem }, note: '' };
|
|
27
39
|
}
|
|
40
|
+
if (settings.startFrom === 'existing-branch')
|
|
41
|
+
return await onExistingBranch(session, task, dir, state, bus, saveSession);
|
|
28
42
|
// A dirty tree is the operator's own work in progress. Committing it under the bot's name
|
|
29
43
|
// or moving it to another branch would both be decisions that are not ours to make.
|
|
30
44
|
if (state.dirty) {
|
|
@@ -55,18 +69,14 @@ allSessions = async () => []) {
|
|
|
55
69
|
s.vcsBaseCommit = chosen.commit;
|
|
56
70
|
s.vcsStart = chosen;
|
|
57
71
|
});
|
|
58
|
-
bus.publish({ sessionId: session.id, taskId: task.id, type: 'vcs-start', level: chosen.note ? 'warn' : 'info',
|
|
72
|
+
bus.publish({ sessionId: session.id, taskId: task.id, type: 'vcs-start', level: chosen.note || updateWarns(chosen) ? 'warn' : 'info',
|
|
59
73
|
message: describeStart(chosen), data: { ...chosen } });
|
|
60
74
|
}
|
|
61
75
|
}
|
|
62
76
|
const attempt = task.attempt ?? 1;
|
|
63
77
|
const prefix = settings.branchPrefix || 'cop/';
|
|
64
78
|
if (settings.branchMode === 'per-session') {
|
|
65
|
-
|
|
66
|
-
const wanted = planned
|
|
67
|
-
? plannedBranchName(planned, prefix)
|
|
68
|
-
: branchNameFrom([session.name, session.id.slice(0, 13)], prefix);
|
|
69
|
-
return await switchTo(session, task, dir, wanted, base, bus, { reuseExisting: true, start });
|
|
79
|
+
return await switchTo(session, task, dir, sessionBranchName(session), base, bus, { reuseExisting: true, start });
|
|
70
80
|
}
|
|
71
81
|
// A name the task carries wins over one derived from its title: whoever wrote the plan knew
|
|
72
82
|
// what the task was for, and a title is only ever a label for the list.
|
|
@@ -85,6 +95,69 @@ allSessions = async () => []) {
|
|
|
85
95
|
const from = firstAttemptBase(task) ?? base;
|
|
86
96
|
return await switchTo(session, task, dir, wanted, from, bus, { reuseExisting: false, start });
|
|
87
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* The one branch a `per-session` session works on: the name it was given, else one made from its
|
|
100
|
+
* name and id. Every task of the session is put on it, and an existing branch of that name is
|
|
101
|
+
* carried on, not copied — which is why "Run again from here" names the restore branch here when it
|
|
102
|
+
* takes a chain back (see `OperatorService.rerunFromRestore`).
|
|
103
|
+
*/
|
|
104
|
+
export function sessionBranchName(session) {
|
|
105
|
+
const prefix = session.vcs?.branchPrefix || 'cop/';
|
|
106
|
+
return namedSessionBranch(session.vcs) ?? branchNameFrom([session.name, session.id.slice(0, 13)], prefix);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The branch a session's `branchName` names, or undefined when it names none: a name a plan or the
|
|
110
|
+
* operator chose, made safe (`plannedBranchName`), or a branch this program made, as it is written
|
|
111
|
+
* (`branchNameExact`). The one reading of the field, for the run and for what the pages show.
|
|
112
|
+
*/
|
|
113
|
+
export function namedSessionBranch(vcs) {
|
|
114
|
+
const named = vcs?.branchName?.trim();
|
|
115
|
+
if (!named)
|
|
116
|
+
return undefined;
|
|
117
|
+
return vcs?.branchNameExact ? named : plannedBranchName(named, vcs?.branchPrefix || 'cop/');
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* A session that carries on an existing branch: every task on that branch, exactly as named.
|
|
121
|
+
*
|
|
122
|
+
* Nothing is created. The branch must exist and the tree must be clean — the uncommitted changes
|
|
123
|
+
* would otherwise be carried onto the branch, or stop the switch half-way — and anything else
|
|
124
|
+
* refuses the task before a message is sent. The first run records the branch's tip as where the
|
|
125
|
+
* session started, so the record and a restore know what was there before the work.
|
|
126
|
+
*/
|
|
127
|
+
async function onExistingBranch(session, task, dir, state, bus, saveSession) {
|
|
128
|
+
const wanted = (session.vcs?.existingBranch ?? '').trim();
|
|
129
|
+
const refuse = (why) => {
|
|
130
|
+
bus.publish({ sessionId: session.id, taskId: task.id, type: 'vcs-refused', level: 'error', message: why });
|
|
131
|
+
return { vcs: { problem: why }, note: '', refuse: why };
|
|
132
|
+
};
|
|
133
|
+
if (!wanted)
|
|
134
|
+
return refuse('this session is set to carry on an existing branch, and no branch is named. Name it (Version control → "Start from").');
|
|
135
|
+
if (!(await branchExists(dir, wanted))) {
|
|
136
|
+
const have = await localBranches(dir);
|
|
137
|
+
return refuse(`this session is set to carry on the branch "${wanted}", and ${dir} has no such local branch` +
|
|
138
|
+
`${have.length > 0 ? ` (it has: ${have.slice(0, 12).join(', ')})` : ''}. Nothing was run.`);
|
|
139
|
+
}
|
|
140
|
+
if (state.dirty) {
|
|
141
|
+
return refuse(`the repository has uncommitted changes (${state.changed.slice(0, 5).join(', ')}${state.changed.length > 5 ? `, and ${state.changed.length - 5} more` : ''}), ` +
|
|
142
|
+
`so the work cannot be put on "${wanted}" without taking them along. Commit or stash them first. Nothing was run.`);
|
|
143
|
+
}
|
|
144
|
+
let start = session.vcsStart;
|
|
145
|
+
if (!session.vcsBaseCommit || start?.kind !== 'existing-branch' || start.branch !== wanted) {
|
|
146
|
+
const update = session.vcs?.updateFromRemote !== false ? await updateFromRemote(dir, wanted) : undefined;
|
|
147
|
+
const tip = await branchTip(dir, wanted);
|
|
148
|
+
if (tip) {
|
|
149
|
+
const chosen = { kind: 'existing-branch', commit: tip, branch: wanted, ...(update ? { update } : {}) };
|
|
150
|
+
start = chosen;
|
|
151
|
+
await saveSession((s) => {
|
|
152
|
+
s.vcsBaseCommit = chosen.commit;
|
|
153
|
+
s.vcsStart = chosen;
|
|
154
|
+
});
|
|
155
|
+
bus.publish({ sessionId: session.id, taskId: task.id, type: 'vcs-start', level: updateWarns(chosen) ? 'warn' : 'info', message: describeStart(chosen), data: { ...chosen } });
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
const prepared = await switchTo(session, task, dir, wanted, undefined, bus, { reuseExisting: true, mustExist: true, start });
|
|
159
|
+
return prepared.vcs.branch === wanted ? prepared : refuse(`the repository could not be put on "${wanted}": ${prepared.vcs.problem ?? 'unknown reason'}. Nothing was run.`);
|
|
160
|
+
}
|
|
88
161
|
/**
|
|
89
162
|
* The commit a session's first branch is cut from, by its `startFrom`, or why there is none.
|
|
90
163
|
*
|
|
@@ -101,6 +174,8 @@ export async function sessionStart(session, dir, head, allSessions) {
|
|
|
101
174
|
if (how === 'head')
|
|
102
175
|
return head ? { start: { kind: 'head', commit: head } } : {};
|
|
103
176
|
const fromBranch = async (note) => {
|
|
177
|
+
// The code as it is on the server, not as this checkout last pulled it: see `updateFromRemote`.
|
|
178
|
+
const update = session.vcs?.updateFromRemote !== false && (await branchTip(dir, baseBranch)) ? await updateFromRemote(dir, baseBranch) : undefined;
|
|
104
179
|
const tip = await branchTip(dir, baseBranch);
|
|
105
180
|
if (!tip) {
|
|
106
181
|
return {
|
|
@@ -108,7 +183,7 @@ export async function sessionStart(session, dir, head, allSessions) {
|
|
|
108
183
|
'Name the branch the work should start from (Version control → "Start from"), or create it.',
|
|
109
184
|
};
|
|
110
185
|
}
|
|
111
|
-
return { start: { kind: 'branch', commit: tip, branch: baseBranch, ...(note ? { note } : {}) } };
|
|
186
|
+
return { start: { kind: 'branch', commit: tip, branch: baseBranch, ...(note ? { note } : {}), ...(update ? { update } : {}) } };
|
|
112
187
|
};
|
|
113
188
|
if (how === 'branch')
|
|
114
189
|
return await fromBranch();
|
|
@@ -160,10 +235,17 @@ export function describeStart(start) {
|
|
|
160
235
|
const at = start.commit.slice(0, 8);
|
|
161
236
|
const said = start.kind === 'previous-session'
|
|
162
237
|
? `this session continues "${start.fromSession?.name ?? '?'}": it starts from the end of its branch ${start.branch} (${at})`
|
|
163
|
-
: start.kind === 'branch'
|
|
164
|
-
? `this session
|
|
165
|
-
:
|
|
166
|
-
|
|
238
|
+
: start.kind === 'existing-branch'
|
|
239
|
+
? `this session carries on the existing branch ${start.branch}, from its tip ${at}`
|
|
240
|
+
: start.kind === 'branch'
|
|
241
|
+
? `this session starts from the local branch ${start.branch} (${at})`
|
|
242
|
+
: `this session starts from where the repository was (${at})`;
|
|
243
|
+
const updated = start.update ? ` (${describeUpdate(start.update)})` : '';
|
|
244
|
+
return start.note ? `${said}${updated} — ${start.note}` : `${said}${updated}`;
|
|
245
|
+
}
|
|
246
|
+
/** Whether the update before a session's start is worth a warning: it did not bring the branch up to date. */
|
|
247
|
+
export function updateWarns(start) {
|
|
248
|
+
return !!start.update && !['updated', 'up-to-date', 'no-remote'].includes(start.update.outcome);
|
|
167
249
|
}
|
|
168
250
|
/**
|
|
169
251
|
* Which branch has the complete work of a session, when one does.
|
|
@@ -179,8 +261,7 @@ export function sessionBranches(session) {
|
|
|
179
261
|
.filter((t) => !!t.vcs?.branch)
|
|
180
262
|
.map((t) => ({ title: t.title, branch: t.vcs?.branch, commit: t.vcs?.commit, status: t.status }));
|
|
181
263
|
if (mode === 'per-session') {
|
|
182
|
-
const
|
|
183
|
-
const complete = branches[branches.length - 1]?.branch ?? (planned ? plannedBranchName(planned, session.vcs?.branchPrefix || 'cop/') : undefined);
|
|
264
|
+
const complete = branches[branches.length - 1]?.branch ?? namedSessionBranch(session.vcs);
|
|
184
265
|
return { mode, complete, branches };
|
|
185
266
|
}
|
|
186
267
|
return { mode, branches };
|
|
@@ -189,7 +270,9 @@ export function sessionBranches(session) {
|
|
|
189
270
|
function firstAttemptBase(task) {
|
|
190
271
|
return earliestBase(task);
|
|
191
272
|
}
|
|
192
|
-
async function switchTo(session, task, dir, wantedName, from, bus,
|
|
273
|
+
async function switchTo(session, task, dir, wantedName, from, bus,
|
|
274
|
+
/** `mustExist`: carry on this branch or nothing; never create it. */
|
|
275
|
+
opts) {
|
|
193
276
|
if (!(await isValidBranchName(dir, wantedName))) {
|
|
194
277
|
const problem = `"${wantedName}" is not a name git accepts.`;
|
|
195
278
|
bus.publish({ sessionId: session.id, taskId: task.id, type: 'vcs-problem', level: 'warn', message: problem });
|
|
@@ -203,7 +286,7 @@ async function switchTo(session, task, dir, wantedName, from, bus, opts) {
|
|
|
203
286
|
}
|
|
204
287
|
else if (opts.reuseExisting) {
|
|
205
288
|
const existing = await checkoutExisting(dir, wantedName);
|
|
206
|
-
result = existing.ok ? existing : await createBranch(dir, wantedName, from);
|
|
289
|
+
result = existing.ok || opts.mustExist ? existing : await createBranch(dir, wantedName, from);
|
|
207
290
|
}
|
|
208
291
|
else {
|
|
209
292
|
name = await freeBranchName(dir, wantedName);
|
|
@@ -222,7 +305,8 @@ async function switchTo(session, task, dir, wantedName, from, bus, opts) {
|
|
|
222
305
|
// What the task stands on, and what it does not: the base commit by name, and the other
|
|
223
306
|
// tasks of this session that already ran, with the branch each of them worked on.
|
|
224
307
|
const subject = vcs.baseCommit ? await commitSubject(dir, vcs.baseCommit) : '';
|
|
225
|
-
|
|
308
|
+
// A session carrying on an existing branch has all its tasks on it, one after another.
|
|
309
|
+
const mode = session.vcs?.startFrom === 'existing-branch' ? 'per-session' : (session.vcs?.branchMode ?? 'per-task');
|
|
226
310
|
// On this branch (per-session: their work is here) or on others (per-task: it is not). A
|
|
227
311
|
// session whose mode was switched mid-way has both, and each kind is reported by where it is.
|
|
228
312
|
const earlier = session.tasks
|
|
@@ -273,9 +357,11 @@ export function noteFor(repoDir, vcs, ctx = { mode: 'per-task', earlier: [] }) {
|
|
|
273
357
|
*/
|
|
274
358
|
const began = ctx.start?.kind === 'previous-session'
|
|
275
359
|
? `This session continues the work of the earlier session "${ctx.start.fromSession?.name ?? ''}": it was started from the end of its branch \`${ctx.start.branch}\`, so that session's work is already in your working tree. Build on it; do not redo it.`
|
|
276
|
-
: ctx.start?.kind === 'branch'
|
|
277
|
-
? `This session
|
|
278
|
-
: ''
|
|
360
|
+
: ctx.start?.kind === 'existing-branch'
|
|
361
|
+
? `This session carries on the existing branch \`${ctx.start.branch}\`: the work already on it is in your working tree. Build on it; do not redo it.`
|
|
362
|
+
: ctx.start?.kind === 'branch'
|
|
363
|
+
? `This session started from the local branch \`${ctx.start.branch}\`, not from any earlier session's work${ctx.start.note ? ` (${ctx.start.note})` : ''}.`
|
|
364
|
+
: '';
|
|
279
365
|
return [
|
|
280
366
|
'## Version control',
|
|
281
367
|
'',
|
|
@@ -468,13 +554,47 @@ function earliestBase(task) {
|
|
|
468
554
|
const fromAttempts = (task.attempts ?? []).map((a) => a.vcs?.baseCommit).find(Boolean);
|
|
469
555
|
return fromAttempts ?? task.vcs?.baseCommit;
|
|
470
556
|
}
|
|
557
|
+
/**
|
|
558
|
+
* Where going back to before this task lands: where it first started, on the line of work the
|
|
559
|
+
* session carries on now.
|
|
560
|
+
*
|
|
561
|
+
* In per-session mode that line is the session's one branch, and "Run again from here" moves the
|
|
562
|
+
* session onto a new one, the restore branch (see `OperatorService.rerunFromRestore`). The task's
|
|
563
|
+
* attempts from before that move are on the branch it left, the work it abandoned. Taken from the
|
|
564
|
+
* first attempt of all, a second restart, or a Restore after one, went back onto that abandoned line
|
|
565
|
+
* and dropped what was done again since. So the earliest attempt on the session's branch decides,
|
|
566
|
+
* live or archived; without a restart every attempt is on it and the answer is the first one's, as
|
|
567
|
+
* before. A task with no attempt on that branch (it ran only before a move, or the branch was
|
|
568
|
+
* renamed) falls back to its first attempt. Per-task mode cuts every attempt from where the task
|
|
569
|
+
* first started, so the first attempt is the answer there.
|
|
570
|
+
*/
|
|
571
|
+
export function restorePoint(session, task) {
|
|
572
|
+
if (session.vcs?.branchMode === 'per-session' && session.vcs.startFrom !== 'existing-branch') {
|
|
573
|
+
const branch = sessionBranchName(session);
|
|
574
|
+
const onIt = [...(task.attempts ?? []).map((a) => a.vcs), task.vcs].find((v) => v?.branch === branch && !!v.baseCommit);
|
|
575
|
+
if (onIt?.baseCommit)
|
|
576
|
+
return onIt.baseCommit;
|
|
577
|
+
}
|
|
578
|
+
return earliestBase(task);
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Makes a branch at a commit without checking it out: the repository stays where it is, on the
|
|
582
|
+
* branch the operator was shown. Additive like every other change here; an existing name is refused
|
|
583
|
+
* by git, never moved.
|
|
584
|
+
*/
|
|
585
|
+
export async function branchAt(dir, name, commit) {
|
|
586
|
+
if (!(await isValidBranchName(dir, name)))
|
|
587
|
+
return { ok: false, problem: `"${name}" is not a name git accepts.` };
|
|
588
|
+
const r = await git(dir, ['branch', name, commit]);
|
|
589
|
+
return r.ok ? { ok: true } : { ok: false, problem: r.stderr || r.stdout || 'the branch could not be made' };
|
|
590
|
+
}
|
|
471
591
|
/** What restoring this task would do, asked before anything is done. */
|
|
472
592
|
export async function restorePreview(session, task) {
|
|
473
593
|
const repoDir = repoDirOf(session);
|
|
474
594
|
const empty = { ok: false, repoDir, leftBehind: [] };
|
|
475
595
|
if (!session.vcs?.enabled)
|
|
476
596
|
return { ...empty, problem: 'Version control is off for this session.' };
|
|
477
|
-
const base =
|
|
597
|
+
const base = restorePoint(session, task);
|
|
478
598
|
if (!base) {
|
|
479
599
|
return {
|
|
480
600
|
...empty,
|
|
@@ -503,7 +623,13 @@ export async function restorePreview(session, task) {
|
|
|
503
623
|
currentBranch: state.branch ?? undefined,
|
|
504
624
|
leftBehind: await commitsBetween(repoDir, base, 'HEAD'),
|
|
505
625
|
keptOn: state.branch ?? undefined,
|
|
506
|
-
|
|
626
|
+
/*
|
|
627
|
+
* Derived from the title, so built the way every derived name is. A title is a label for the
|
|
628
|
+
* list, not a branch name anybody chose: put through `plannedBranchName`, a "/" in it ("Add
|
|
629
|
+
* CI/CD pipeline") read as a namespace the plan wanted and gave "restore-Add-CI/CD-pipeline",
|
|
630
|
+
* outside the session's prefix and in the title's case.
|
|
631
|
+
*/
|
|
632
|
+
branchName: await freeBranchName(repoDir, branchNameFrom(['restore', task.title], prefix)),
|
|
507
633
|
};
|
|
508
634
|
}
|
|
509
635
|
/** Does it: a new branch at that commit, checked out. Nothing else changes. */
|
package/dist/web/404.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--IwNZiBrEMAcXEUFj2miiU--><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/e2a2c9eb3c226313.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-8b95ae984befc0e2.js" async=""></script><script src="/_next/static/chunks/549-9548d9a132c8c7d4.js" async=""></script><script src="/_next/static/chunks/app/layout-560bd6d173302e5a.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="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[1205,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-b64c436f5b25f39e.js\",\"549\",\"static/chunks/549-a5a59a94f92bb3eb.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"themeScript\"]\n3:I[1205,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-b64c436f5b25f39e.js\",\"549\",\"static/chunks/549-a5a59a94f92bb3eb.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"AppearanceProvider\"]\n4:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-b64c436f5b25f39e.js\",\"549\",\"static/chunks/549-a5a59a94f92bb3eb.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"LanguageProvider\"]\n5:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-b64c436f5b25f39e.js\",\"549\",\"static/chunks/549-a5a59a94f92bb3eb.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"DialogHost\"]\n6:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-b64c436f5b25f39e.js\",\"549\",\"static/chunks/549-a5a59a94f92bb3eb.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"SkipLink\"]\n7:I[8197,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-b64c436f5b25f39e.js\",\"549\",\"static/chunks/549-a5a59a94f92bb3eb.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"\"]\n8:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-b64c436f5b25f39e.js\",\"549\",\"static/chunks/549-a5a59a94f92bb3eb.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"Nav\"]\n9:I[6657,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-b64c436f5b25f39e.js\",\"549\",\"static/chunks/549-a5a59a94f92bb3eb.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"GlobalApprovals\"]\na:I[5204,[],\"\"]\nb:I[2642,[],\"\"]\nc:I[7712,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-b64c436f5b25f39e.js\",\"549\",\"static/chunks/549-a5a59a94f92bb3eb.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"ScrollJump\"]\nd:I[433,[],\"OutletBoundary\"]\nf:I[9884,[],\"AsyncMeta"])</script><script>self.__next_f.push([1,"dataOutlet\"]\n11:I[433,[],\"ViewportBoundary\"]\n13:I[433,[],\"MetadataBoundary\"]\n14:\"$Sreact.suspense\"\n16:I[3536,[],\"\"]\n:HL[\"/_next/static/css/a0642fdb8adf9edb.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"bcBE4tY_aNh6kzLzN1luP\",\"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/a0642fdb8adf9edb.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\":\"$2\"}}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$L5\",null,{\"children\":[[\"$\",\"$L6\",null,{}],[\"$\",\"div\",null,{\"className\":\"wrap\",\"children\":[[\"$\",\"header\",null,{\"className\":\"top\",\"children\":[[\"$\",\"h1\",null,{\"children\":[\"$\",\"$L7\",null,{\"href\":\"/\",\"children\":\"copilot-operator\"}]}],[\"$\",\"$L8\",null,{}]]}],[\"$\",\"$L9\",null,{}],[\"$\",\"main\",null,{\"id\":\"main\",\"children\":[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lb\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}],[\"$\",\"$Lc\",null,{}]]}]}]}]}]]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lb\",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,[\"$\",\"$Ld\",null,{\"children\":[\"$Le\",[\"$\",\"$Lf\",null,{\"promise\":\"$@10\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$L11\",null,{\"children\":\"$L12\"}],null],[\"$\",\"$L13\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$14\",null,{\"fallback\":null,\"children\":\"$L15\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$16\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"12:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\ne:null\n"])</script><script>self.__next_f.push([1,"10:{\"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,"15:\"$10: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="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[1205,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-8b95ae984befc0e2.js\",\"549\",\"static/chunks/549-9548d9a132c8c7d4.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"themeScript\"]\n3:I[1205,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-8b95ae984befc0e2.js\",\"549\",\"static/chunks/549-9548d9a132c8c7d4.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"AppearanceProvider\"]\n4:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-8b95ae984befc0e2.js\",\"549\",\"static/chunks/549-9548d9a132c8c7d4.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"LanguageProvider\"]\n5:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-8b95ae984befc0e2.js\",\"549\",\"static/chunks/549-9548d9a132c8c7d4.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"DialogHost\"]\n6:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-8b95ae984befc0e2.js\",\"549\",\"static/chunks/549-9548d9a132c8c7d4.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"SkipLink\"]\n7:I[8197,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-8b95ae984befc0e2.js\",\"549\",\"static/chunks/549-9548d9a132c8c7d4.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"\"]\n8:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-8b95ae984befc0e2.js\",\"549\",\"static/chunks/549-9548d9a132c8c7d4.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"Nav\"]\n9:I[6657,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-8b95ae984befc0e2.js\",\"549\",\"static/chunks/549-9548d9a132c8c7d4.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"GlobalApprovals\"]\na:I[5204,[],\"\"]\nb:I[2642,[],\"\"]\nc:I[7712,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-8b95ae984befc0e2.js\",\"549\",\"static/chunks/549-9548d9a132c8c7d4.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"ScrollJump\"]\nd:I[433,[],\"OutletBoundary\"]\nf:I[9884,[],\"AsyncMeta"])</script><script>self.__next_f.push([1,"dataOutlet\"]\n11:I[433,[],\"ViewportBoundary\"]\n13:I[433,[],\"MetadataBoundary\"]\n14:\"$Sreact.suspense\"\n16:I[3536,[],\"\"]\n:HL[\"/_next/static/css/e2a2c9eb3c226313.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"IwNZiBrEMAcXEUFj2miiU\",\"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/e2a2c9eb3c226313.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\":\"$2\"}}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$L5\",null,{\"children\":[[\"$\",\"$L6\",null,{}],[\"$\",\"div\",null,{\"className\":\"wrap\",\"children\":[[\"$\",\"header\",null,{\"className\":\"top\",\"children\":[[\"$\",\"h1\",null,{\"children\":[\"$\",\"$L7\",null,{\"href\":\"/\",\"children\":\"copilot-operator\"}]}],[\"$\",\"$L8\",null,{}]]}],[\"$\",\"$L9\",null,{}],[\"$\",\"main\",null,{\"id\":\"main\",\"children\":[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lb\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}],[\"$\",\"$Lc\",null,{}]]}]}]}]}]]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lb\",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,[\"$\",\"$Ld\",null,{\"children\":[\"$Le\",[\"$\",\"$Lf\",null,{\"promise\":\"$@10\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$L11\",null,{\"children\":\"$L12\"}],null],[\"$\",\"$L13\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$14\",null,{\"fallback\":null,\"children\":\"$L15\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$16\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"12:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\ne:null\n"])</script><script>self.__next_f.push([1,"10:{\"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,"15:\"$10:metadata\"\n"])</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[36],{1035:(e,t,n)=>{n.d(t,{DialogHost:()=>c,Z:()=>d});var s=n(3365),l=n(1521),a=n(867),r=n(4969);let i=null,o=[];function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(n=>{var s;return s={kind:"confirm",message:e,...t,resolve:n},void(i?i(s):o.push(s))})}function c(e){var t,n;let{children:d}=e,{t:c}=(0,a.kj)(),[u,h]=(0,l.useState)([]),m=(0,l.useRef)(null),f=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(i=e=>h(t=>[...t,e]),o.length>0){let e=o.splice(0,o.length);h(t=>[...t,...e])}return()=>{i=null}},[]);let p=u[0],x=(0,l.useCallback)(e=>{p&&(p.resolve(e),h(e=>e.slice(1)))},[p]);return(0,r.V)(f,!!p,m),(0,l.useEffect)(()=>{if(!p)return;let e=e=>{"Escape"===e.key&&(e.preventDefault(),x(!1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[p,x]),(0,s.jsxs)(s.Fragment,{children:[d,p&&(0,s.jsx)("div",{className:"modal-backdrop",onClick:()=>x(!1),role:"presentation",children:(0,s.jsxs)("div",{ref:f,className:"modal".concat(p.danger?" danger":""),role:"confirm"===p.kind?"alertdialog":"dialog","aria-modal":"true","aria-labelledby":"modal-title","aria-describedby":"modal-body",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)("h2",{id:"modal-title",children:null!=(t=p.title)?t:c("confirm"===p.kind?"dialog.confirmTitle":"dialog.noticeTitle")}),(0,s.jsx)("div",{id:"modal-body",className:"modal-body",children:p.message}),(0,s.jsxs)("div",{className:"row modal-actions",children:["confirm"===p.kind&&(0,s.jsx)("button",{type:"button",className:"quiet",onClick:()=>x(!1),children:c("dialog.cancel")}),(0,s.jsx)("button",{ref:m,type:"button",className:p.danger?"danger":"primary",onClick:()=>x(!0),children:null!=(n=p.okLabel)?n:c("dialog.ok")})]})]})})]})}},1366:(e,t,n)=>{n.d(t,{w:()=>i,y:()=>r});var s=n(3365),l=n(1521),a=n(867);function r(e){let{readOnly:t,scope:n,onReadOnly:r,onScope:i}=e,{t:o}=(0,a.kj)(),d=(0,l.useId)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"option",style:{marginTop:10},children:[(0,s.jsxs)("label",{children:[(0,s.jsx)("input",{type:"checkbox",checked:t,onChange:e=>r(e.target.checked)}),(0,s.jsx)("span",{children:o("task.readOnlyEdit")})]}),(0,s.jsx)("p",{className:"why",children:o("task.readOnlyEditWhy")})]}),(0,s.jsx)("label",{htmlFor:"".concat(d,"-scope"),children:o("task.scopeEdit")}),(0,s.jsx)("textarea",{id:"".concat(d,"-scope"),value:n,onChange:e=>i(e.target.value),placeholder:"tests/e2e/\nsrc/**/*.ts",style:{minHeight:60},disabled:t}),(0,s.jsx)("p",{className:"why",children:o("task.scopeEditWhy")})]})}function i(e){return e.split(/\r?\n/).map(e=>e.trim()).filter(Boolean)}},1910:(e,t,n)=>{n.d(t,{H:()=>o,u:()=>i});var s=n(3365),l=n(1521),a=n(867),r=n(5549);function i(e){let{label:t,save:n}=e,{t:r}=(0,a.kj)(),[i,o]=(0,l.useState)(!1),[d,c]=(0,l.useState)(""),[u,h]=(0,l.useState)(!1),m=async()=>{o(!0),c("");try{var e;let t=await n();h(!1),c(t.revealed?r("save.done",{path:t.path}):r("save.savedOnly",{path:t.path,note:null!=(e=t.note)?e:""}))}catch(e){h(!0),c(r("save.failed",{problem:e.message}))}finally{o(!1)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{type:"button",className:"linkish",disabled:i,title:r("save.why"),onClick:()=>void m(),children:i?r("save.saving"):t}),d&&(0,s.jsx)("span",{className:u?"err small":"muted small",children:d})]})}function o(e){let{sessionId:t,taskId:n,attempt:i}=e,{t:o}=(0,a.kj)(),[d,c]=(0,l.useState)(!1),[u,h]=(0,l.useState)(""),[m,f]=(0,l.useState)(!1),p=async()=>{c(!0),h("");try{let e=await r.FH.downloadBundle([{sessionId:t,taskId:n,attempt:i}]);f(!1),h(o("reg.bundleSaved",{name:e}))}catch(e){f(!0),h(o("save.failed",{problem:e.message}))}finally{c(!1)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{type:"button",className:"linkish",disabled:d,title:o("save.attemptRecordWhy"),onClick:()=>void p(),children:d?o("save.saving"):o("save.attemptRecord")}),u&&(0,s.jsx)("span",{className:m?"err small":"muted small",children:u})]})}},2876:(e,t,n)=>{n.d(t,{P:()=>c});var s=n(3365),l=n(1521),a=n(5549),r=n(867);function i(e,t){let[n,s]=(0,l.useState)(null),a=(0,l.useRef)(!0),[r,i]=(0,l.useState)(!0),o=(0,l.useCallback)(e=>s(e),[]);return(0,l.useLayoutEffect)(()=>{if(!n)return;let e=()=>{let e=n.scrollHeight-n.scrollTop-n.clientHeight<=24;a.current=e,i(e)};return n.addEventListener("scroll",e,{passive:!0}),()=>n.removeEventListener("scroll",e)},[n]),(0,l.useLayoutEffect)(()=>{n&&e&&a.current&&(n.scrollTop=n.scrollHeight)},[n,e,t]),{ref:o,following:r,follow:(0,l.useCallback)(()=>{a.current=!0,i(!0),n&&(n.scrollTop=n.scrollHeight)},[n])}}var o=n(5132);function d(e){let{text:t,follow:n}=e,{ref:l}=i(n,t);return(0,s.jsx)("pre",{ref:l,className:"story-out".concat(n?" terminal":""),children:t})}function c(e){let{sessionId:t,taskId:n,runId:c,live:h}=e,{t:m}=(0,r.kj)(),[f,p]=(0,l.useState)(null),[x,g]=(0,l.useState)(""),[v,y]=(0,l.useState)(!0),[j,k]=(0,l.useState)(!0),[b,N]=(0,l.useState)(new Set),[w,S]=(0,l.useState)(new Set),[C,E]=(0,l.useState)(new Set),I=!!(null==f?void 0:f.live),F=(0,l.useRef)(0);F.current+=1;let D=i(I,F.current),M=(0,l.useRef)(null),L=(0,l.useRef)(!1);if((0,l.useEffect)(()=>{if(!f)return;let e=[],t=(n,s)=>n.forEach((n,l)=>{let a="".concat(s).concat(l);"review"===n.kind?t(n.entries,"".concat(a,"-")):"step"!==n.kind||n.outcome||e.push(a)});t(f.entries,"e"),e.some(e=>!w.has(e))&&S(t=>new Set([...t,...e])),f.live&&!L.current&&M.current&&(L.current=!0,M.current.scrollIntoView({block:"nearest",behavior:"smooth"}))},[f,w]),(0,l.useEffect)(()=>{let e,s=!0,l=async()=>{try{let r=await a.FH.taskStory(t,n,c);if(!s)return;p(r),g(""),(r.live||h)&&(e=setTimeout(l,2e3))}catch(t){if(!s)return;g(t.message),h&&(e=setTimeout(l,2e3))}};return l(),()=>{s=!1,e&&clearTimeout(e)}},[t,n,c,h]),x&&!f)return(0,s.jsx)("div",{className:"err small",children:x});if(!f)return(0,s.jsx)("div",{className:"muted small",children:m("story.loading")});let T=e=>b.has(e)||w.has(e)&&!C.has(e),H=e=>{let t=T(e);N(n=>{let s=new Set(n);return t?s.delete(e):s.add(e),s}),E(n=>{let s=new Set(n);return t?s.add(e):s.delete(e),s})},R=(e,t)=>{if(!("review"===e.kind?v||j:"step"===e.kind?j:v))return null;if("review"===e.kind)return(0,s.jsxs)("li",{className:"story-review",children:[(0,s.jsxs)("div",{className:"story-head",children:[(0,s.jsx)(u,{at:e.at}),(0,s.jsx)("span",{className:"chip",children:m("story.review",{n:e.round})})]}),(0,s.jsx)("ol",{className:"story",children:e.entries.map((e,n)=>R(e,"".concat(t,"-").concat(n)))})]},t);if("step"===e.kind){let n=T(t),l=!e.outcome&&f.live;return(0,s.jsxs)("li",{className:"story-step".concat(e.failed?" failed":""),children:[(0,s.jsxs)("div",{className:"story-head",children:[(0,s.jsx)(u,{at:e.at}),(0,s.jsx)("span",{className:"chip",children:m("story.step",{it:e.iteration,id:e.id})}),e.outcome&&(0,s.jsxs)("span",{className:"badge ".concat(e.failed?"failed":"done"),children:[e.outcome,void 0!==e.exitCode?" \xb7 exit ".concat(e.exitCode):"",void 0!==e.durationMs?" \xb7 ".concat((0,a.c5)(e.durationMs)):""]}),!e.outcome&&(0,s.jsx)("span",{className:"badge running",children:m("story.running")}),e.failed&&(0,s.jsx)("span",{className:"badge failed",children:m("story.failedHere")})]}),(0,s.jsx)("pre",{className:"story-cmd",children:e.command}),e.output&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{type:"button",className:"linkish small",onClick:()=>H(t),children:n?m("story.hideOutput"):m("story.showOutput",{n:e.output.length})}),n&&(0,s.jsx)(d,{text:e.output,follow:l})]})]},t)}let n=b.has(t),l="sent"===e.kind?m("story.bot"):m("story.chat"),r="reply"===e.kind&&("blocked"===e.status||"failed"===e.status);return(0,s.jsxs)("li",{className:"story-msg ".concat(e.kind).concat(r?" failed":""),children:[(0,s.jsxs)("div",{className:"story-head",children:[(0,s.jsx)(u,{at:e.at}),(0,s.jsx)("strong",{children:l}),(0,s.jsx)("span",{className:"muted small",children:e.label}),"reply"===e.kind&&e.status&&(0,s.jsx)("span",{className:"badge ".concat(r?"failed":"done"===e.status?"done":""),children:e.status})]}),"reply"===e.kind&&e.notes&&(0,s.jsx)("p",{className:"story-notes",children:e.notes}),(0,s.jsx)("button",{type:"button",className:"linkish small",onClick:()=>H(t),children:n?m("story.hideText"):m("story.showText",{n:e.text.length})}),n&&(0,s.jsx)("pre",{className:"story-out",children:e.text})]},t)},q=f.close,B=q&&"done"!==q.status;return(0,s.jsxs)("div",{className:"story-box",ref:M,children:[(0,s.jsxs)("div",{className:"row small",style:{marginBottom:6},children:[(0,s.jsxs)("label",{className:"option-inline",children:[(0,s.jsx)("input",{type:"checkbox",checked:v,onChange:e=>y(e.target.checked)})," ",m("story.showChat")]}),(0,s.jsxs)("label",{className:"option-inline",children:[(0,s.jsx)("input",{type:"checkbox",checked:j,onChange:e=>k(e.target.checked)})," ",m("story.showCommands")]}),f.live&&(0,s.jsxs)("span",{className:"live",children:[(0,s.jsx)("span",{className:"dot","aria-hidden":"true"})," ",m("story.live")]}),f.live&&!D.following&&(0,s.jsx)("button",{type:"button",className:"quiet small",onClick:D.follow,title:m("story.followWhy"),children:m("story.follow")}),x&&(0,s.jsx)("span",{className:"err",children:x})]}),(0,s.jsxs)("div",{className:"story-fixed",children:[(0,s.jsx)("strong",{children:m("story.prompt")}),(0,s.jsx)("pre",{className:"story-out always",children:f.prompt})]}),(0,s.jsx)("div",{ref:D.ref,className:"story-scroll".concat(f.live?" live":""),children:(0,s.jsx)("ol",{className:"story",children:f.entries.map((e,t)=>R(e,"e".concat(t)))})}),q?(0,s.jsxs)("div",{className:"story-fixed close".concat(B?" failed":""),children:[(0,s.jsx)("strong",{children:B?m("story.endedBadly",{status:q.status}):m("story.ended")}),q.reason&&(0,s.jsx)("p",{className:"err small",children:q.reason}),q.summary&&(0,s.jsx)(o.s,{text:q.summary,className:"what"}),q.checks&&q.checks.length>0&&(0,s.jsx)("ul",{className:"small",style:{margin:"6px 0 0",paddingLeft:18},children:q.checks.map((e,t)=>(0,s.jsxs)("li",{className:e.passed?"":"err",children:[e.passed?"✓":"✗"," ",e.name,!e.passed&&e.detail?" — ".concat(e.detail):""]},t))})]}):(0,s.jsx)("div",{className:"story-fixed muted small",children:m("story.notEnded")})]})}function u(e){let{at:t}=e,n=(0,r.W3)(),{locale:l}=(0,r.kj)();if(!t)return null;let a=new Date(t),i="bg"===l?"bg-BG":void 0,o=a.toLocaleTimeString(i,{hour12:!1}),d=new Date().toDateString()===a.toDateString();return(0,s.jsx)("time",{className:"story-when",dateTime:t,title:n(t),children:d?o:"".concat(a.toLocaleDateString(i)," ").concat(o)})}},3041:(e,t,n)=>{n.d(t,{e:()=>i});var s=n(1521),l=n(5549),a=n(1035),r=n(867);function i(e){let{t}=(0,r.kj)(),[n,i]=(0,s.useState)(""),[o,d]=(0,s.useState)({taskId:"",text:""}),c=(e,t)=>d({taskId:e,text:t}),u=(0,s.useCallback)(async n=>{i("restore"),c(n.taskId,"");try{var s,r,o,d,u,h,m,f,p,x,g,v,y,j;let i=await l.FH.restorePreview(n.sessionId,n.taskId);if(!i.ok)return void c(n.taskId,t("restore.cannot",{problem:null!=(o=i.problem)?o:""}));let k={repo:i.repoDir,title:n.title,branch:null!=(d=i.branchName)?d:"",commit:(null!=(u=i.baseCommit)?u:"").slice(0,8)},b=i.leftBehind.length>0?t("restore.confirmLosing",{...k,n:i.leftBehind.length,kept:null!=(h=i.keptOn)?h:"",list:i.leftBehind.slice(0,10).join("\n")}):t("restore.confirm",k);if(!await (0,a.Z)(b))return;let N=await l.FH.restore(n.sessionId,n.taskId);if(!N.ok)return void c(n.taskId,t("restore.failed",{problem:null!=(m=N.problem)?m:""}));c(n.taskId,(null!=(f=null==(s=N.leftBehind)?void 0:s.length)?f:0)>0?t("restore.done",{branch:null!=(p=N.branch)?p:"",commit:(null!=(x=N.commit)?x:"").slice(0,8),n:null!=(g=null==(r=N.leftBehind)?void 0:r.length)?g:0,kept:null!=(v=N.keptOn)?v:""}):t("restore.doneNothing",{branch:null!=(y=N.branch)?y:"",commit:(null!=(j=N.commit)?j:"").slice(0,8)})),e()}catch(e){c(n.taskId,e.message)}finally{i("")}},[t,e]),h=(0,s.useCallback)(async n=>{i("restart"),c(n.taskId,"");try{var s,r,o;let i=await l.FH.restartPlan(n.sessionId,n.taskId);if(!i.ok)return void c(n.taskId,t("restart.cannot",{problem:null!=(s=i.problem)?s:""}));let d=i.restores.filter(e=>!e.ok);if(d.length>0)return void c(n.taskId,t("restart.cannot",{problem:d.map(e=>{var t;return"".concat(e.repoDir,": ").concat(null!=(t=e.problem)?t:"")}).join(" | ")}));let u=i.restores.map(e=>{var n,s,l;return t("restart.repoLine",{repo:e.repoDir,commit:(null!=(n=e.baseCommit)?n:"").slice(0,8),branch:null!=(s=e.branchName)?s:"",n:e.leftBehind.length,kept:null!=(l=e.keptOn)?l:""})}).join("\n"),h=i.tasks.map(e=>" ".concat(e.sessionName," / ").concat(e.title).concat(e.alreadyQueued?t("restart.alreadyQueued"):"")).join("\n"),m="unattended"===i.mode&&!!i.unattendedRefused,f=t("restart.confirm",{title:i.from.title,tasks:i.tasks.length,sessions:i.sessions.length,list:h,repos:u||t("restart.noRepo"),mode:t("unattended"!==i.mode||m?"run.confirm":"run.unattended")})+(m?t("restart.stepByStep",{reason:null!=(r=i.unattendedRefused)?r:""}):"");if(!await (0,a.Z)(f))return;let p=await l.FH.restartFrom(n.sessionId,n.taskId,m?{mode:"confirm"}:{});if(!p.started){c(n.taskId,t("restart.failed",{problem:null!=(o=p.reason)?o:""})),e();return}c(n.taskId,t("restart.started",{requeued:p.requeued,repos:p.restored.length})),e()}catch(e){c(n.taskId,e.message)}finally{i("")}},[t,e]);return{busy:n,message:o.text,messageTask:o.taskId,clearMessage:()=>c("",""),restore:u,restartFrom:h}}},3374:(e,t,n)=>{n.d(t,{c:()=>l});var s=n(1521);function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,[n,l]=(0,s.useState)(()=>Date.now());return(0,s.useEffect)(()=>{if(!e)return;l(Date.now());let n=window.setInterval(()=>l(Date.now()),t);return()=>window.clearInterval(n)},[e,t]),n}},3523:(e,t,n)=>{function s(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now();if(!e)return;let s=Date.parse(e);if(Number.isNaN(s))return;let l=t?Date.parse(t):n;return Number.isNaN(l)?void 0:Math.max(0,l-s)}function l(e){return!!e.startedAt&&!e.finishedAt&&"queued"!==e.status}function a(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),s=t.some(e=>l(e)),a=t.map(e=>e.finishedAt?Date.parse(e.finishedAt):NaN).filter(e=>!Number.isNaN(e)),r=Date.parse(e.startedAt),i=s||0===a.length?n:Math.max(...a);return{ms:Number.isNaN(r)?0:Math.max(0,i-r),live:s,tasks:t.length}}function r(e){var t,n;let s=new Map;for(let n of e){if(!n.runGroup)continue;let e=null!=(t=s.get(n.runGroup.id))?t:{run:n.runGroup,tasks:[]};e.tasks.push(n),s.set(n.runGroup.id,e)}return null!=(n=[...s.values()].sort((e,t)=>Date.parse(t.run.startedAt)-Date.parse(e.run.startedAt))[0])?n:null}n.d(t,{DG:()=>l,d5:()=>s,eZ:()=>a,hH:()=>r})},4811:(e,t,n)=>{n.d(t,{p:()=>a});var s=n(1521),l=n(5549);function a(){let[e,t]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let e=!0;return l.FH.settings().then(n=>{var s;let l=null!=(s=n.raw.execution)?s:{};e&&t("unattended"===l.mode)}).catch(()=>void 0),()=>{e=!1}},[]),e}},4969:(e,t,n)=>{n.d(t,{V:()=>a});var s=n(1521);let l='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function a(e,t,n){(0,s.useEffect)(()=>{var s,a;if(!t)return;let r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=e.current,o=null!=(a=null!=(s=null==n?void 0:n.current)?s:null==i?void 0:i.querySelector(l))?a:null;null==o||o.focus();let d=e=>{if("Tab"!==e.key||!i)return;let t=Array.from(i.querySelectorAll(l)).filter(e=>null!==e.offsetParent);if(0===t.length)return;let n=t[0],s=t[t.length-1],a=i.contains(document.activeElement);e.shiftKey&&(document.activeElement===n||!a)?(e.preventDefault(),s.focus()):e.shiftKey||document.activeElement!==s&&a||(e.preventDefault(),n.focus())};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d),r&&document.contains(r)&&r.focus()}},[e,t,n])}},5132:(e,t,n)=>{n.d(t,{s:()=>i});var s=n(3365),l=n(1521);function a(e,t){let n,l=[],a=/(`[^`\n]+`)|(\*\*[^*\n]+\*\*)|(\*[^*\n]+\*)/g,r=0,i=0;for(;null!==(n=a.exec(e));){n.index>r&&l.push(e.slice(r,n.index));let a=n[0],o="".concat(t,"-i").concat(i+=1);a.startsWith("`")?l.push((0,s.jsx)("code",{children:a.slice(1,-1)},o)):a.startsWith("**")?l.push((0,s.jsx)("strong",{children:a.slice(2,-2)},o)):l.push((0,s.jsx)("em",{children:a.slice(1,-1)},o)),r=n.index+a.length}return r<e.length&&l.push(e.slice(r)),l}function r(e){let t=/^\s*[-*•]\s+(.*)$/.exec(e);if(t)return t[1];let n=/^\s*\d+[.)]\s+(.*)$/.exec(e);return n?n[1]:null}function i(e){let{text:t,className:n}=e,i=[],o=t.replace(/\r\n/g,"\n").split("\n"),d=0,c=0;for(;d<o.length;){let e=o[d];if(e.trim().startsWith("```")){let e=[];for(d+=1;d<o.length&&!o[d].trim().startsWith("```");)e.push(o[d++]);d+=1,e.length>0&&i.push((0,s.jsx)("pre",{children:e.join("\n")},"b".concat(c+=1)));continue}if(null!==r(e)){let e=[];for(;d<o.length&&null!==r(o[d]);)e.push(r(o[d++]));i.push((0,s.jsx)("ul",{children:e.map((e,t)=>(0,s.jsx)("li",{children:a(e,"b".concat(c,"-").concat(t))},t))},"b".concat(c+=1)));continue}if(""===e.trim()){d+=1;continue}let t=[];for(;d<o.length&&""!==o[d].trim()&&null===r(o[d])&&!o[d].trim().startsWith("```");)t.push(o[d++]);let n=c+=1;i.push((0,s.jsx)("p",{children:t.map((e,t)=>(0,s.jsxs)(l.Fragment,{children:[t>0&&(0,s.jsx)("br",{}),a(e,"b".concat(n,"-").concat(t))]},t))},"b".concat(n)))}return(0,s.jsx)("div",{className:"rich ".concat(null!=n?n:""),children:i})}},7527:(e,t,n)=>{n.d(t,{z:()=>l});var s=n(1521);function l(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],l=(0,s.useRef)(e);l.current=e,(0,s.useEffect)(()=>{let e;if(!n)return;let s=!1,a=async()=>{try{await l.current()}catch(e){}finally{s||(e=setTimeout(()=>void a(),t))}};return a(),()=>{s=!0,e&&clearTimeout(e)}},[t,n])}},8934:(e,t,n)=>{n.d(t,{C:()=>d});var s=n(3365),l=n(1521),a=n(5549),r=n(4969),i=n(867);function o(e){if(null===e||""===e)return[];let t=e.split(/\r?\n/);return""===t[t.length-1]&&t.pop(),t}function d(e){let{sessionId:t,taskId:n,runId:a,title:r,files:o}=e,{t:d}=(0,i.kj)(),[u,h]=(0,l.useState)(!1);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{type:"button",className:"linkish",onClick:()=>h(!0),title:d("diff.openWhy"),children:d("diff.open",{n:o})}),u&&(0,s.jsx)(c,{sessionId:t,taskId:n,runId:a,title:r,onClose:()=>h(!1)})]})}function c(e){var t,n,d,c,h,m,f;let{sessionId:p,taskId:x,runId:g,title:v,onClose:y}=e,{t:j}=(0,i.kj)(),[k,b]=(0,l.useState)(null),[N,w]=(0,l.useState)(""),[S,C]=(0,l.useState)(0),[E,I]=(0,l.useState)(new Map),[F,D]=(0,l.useState)(!1),[M,L]=(0,l.useState)(!0),[T,H]=(0,l.useState)(new Map),[R,q]=(0,l.useState)(-1),B=(0,l.useRef)(null),A=(0,l.useRef)(null),W=(0,l.useRef)(null);(0,r.V)(A,!0,W),(0,l.useEffect)(()=>{a.FH.taskChanges(p,x,g).then(b).catch(e=>w(e.message))},[p,x,g]);let P=null!=(d=null==k?void 0:k.files)?d:[],O=P[S];(0,l.useEffect)(()=>{!O||E.has(O.path)||a.FH.taskChangeFile(p,x,O.path,g).then(e=>I(t=>new Map(t).set(O.path,e))).catch(e=>I(t=>new Map(t).set(O.path,e.message)))},[O,E,p,x,g]);let G=O?E.get(O.path):void 0,K=(0,l.useMemo)(()=>!G||"string"==typeof G||G.binary||G.tooLarge?[]:function(e,t){let n=function(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n+=1;let s=e.length,l=t.length;for(;s>n&&l>n&&e[s-1]===t[l-1];)s-=1,l-=1;let a=[];for(let e=0;e<n;e+=1)a.push({kind:"same",a:e,b:e});for(let r of function(e,t){let n=e.length,s=t.length;if(0===n)return t.map((e,t)=>({kind:"add",b:t}));if(0===s)return e.map((e,t)=>({kind:"del",a:t}));let l=n+s,a=l+1,r=new Int32Array(2*l+3),i=[];for(let o=0;o<=Math.min(l,2e3);o+=1){i.push(r.slice(a-o-1,a+o+2));for(let l=-o;l<=o;l+=2){let d=l===-o||l!==o&&r[a+l-1]<r[a+l+1]?r[a+l+1]:r[a+l-1]+1,c=d-l;for(;d<n&&c<s&&e[d]===t[c];)d+=1,c+=1;if(r[a+l]=d,d>=n&&c>=s)return function(e,t,n,s){let l=[],a=t.length,r=n.length;for(let t=s;t>0;t-=1){let n=e[t],s=e=>n[e+t+1],i=a-r,o=i===-t||i!==t&&s(i-1)<s(i+1)?i+1:i-1,d=s(o),c=d-o;for(;a>d&&r>c;)a-=1,r-=1,l.push({kind:"same",a:a,b:r});a===d?l.push({kind:"add",b:c}):l.push({kind:"del",a:d}),a=d,r=c}for(;a>0&&r>0;)a-=1,r-=1,l.push({kind:"same",a:a,b:r});return l.reverse()}(i,e,t,o)}}return[...e.map((e,t)=>({kind:"del",a:t})),...t.map((e,t)=>({kind:"add",b:t}))]}(e.slice(n,s),t.slice(n,l)))a.push({kind:r.kind,...void 0!==r.a?{a:r.a+n}:{},...void 0!==r.b?{b:r.b+n}:{}});for(let t=0;s+t<e.length;t+=1)a.push({kind:"same",a:s+t,b:l+t});return a}(e,t),s=[];for(let l=0;l<n.length;){let a=n[l];if("same"===a.kind){s.push({kind:"same",left:{no:a.a+1,text:e[a.a]},right:{no:a.b+1,text:t[a.b]}}),l+=1;continue}let r=[],i=[];for(;l<n.length&&"same"!==n[l].kind;){let e=n[l];"del"===e.kind?r.push(e.a):i.push(e.b),l+=1}let o=Math.max(r.length,i.length);for(let n=0;n<o;n+=1){let l=r[n],a=i[n];s.push({kind:void 0!==l&&void 0!==a?"change":void 0!==l?"del":"add",...void 0!==l?{left:{no:l+1,text:e[l]}}:{},...void 0!==a?{right:{no:a+1,text:t[a]}}:{}})}}return s}(o(G.before),o(G.after)),[G]),V=O&&T.get(O.path)||new Set,Z=(0,l.useMemo)(()=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(s)return e.map((e,t)=>({type:"row",row:e,index:t}));let l=[];for(let s=0;s<e.length;){if("same"!==e[s].kind){l.push({type:"row",row:e[s],index:s}),s+=1;continue}let a=s;for(;a<e.length&&"same"===e[a].kind;)a+=1;let r=0===s?0:t,i=a===e.length?0:t,o=a-s-r-i;if(o>1&&!n.has(s+r)){for(let t=s;t<s+r;t+=1)l.push({type:"row",row:e[t],index:t});l.push({type:"gap",from:s+r,count:o});for(let t=a-i;t<a;t+=1)l.push({type:"row",row:e[t],index:t})}else for(let t=s;t<a;t+=1)l.push({type:"row",row:e[t],index:t});s=a}return l})(K,3,V,F),[K,V,F]),_=(0,l.useMemo)(()=>K.flatMap((e,t)=>"same"!==e.kind&&(0===t||"same"===K[t-1].kind)?[t]:[]),[K]);(0,l.useEffect)(()=>{q(-1),B.current&&(B.current.scrollTop=0)},[S]);let Q=(0,l.useCallback)(e=>{var t;if(0===_.length)return;let n=R<0?1===e?0:_.length-1:Math.min(_.length-1,Math.max(0,R+e));q(n);let s=null==(t=B.current)?void 0:t.querySelector('[data-row="'.concat(_[n],'"]'));null==s||s.scrollIntoView({block:"center"})},[R,_]),$=(0,l.useCallback)(e=>C(t=>Math.min(Math.max(0,t+e),Math.max(0,P.length-1))),[P.length]);(0,l.useEffect)(()=>{let e=e=>{if(!e.ctrlKey&&!e.metaKey&&!e.altKey){if("Escape"===e.key)y();else if("n"===e.key)Q(1);else if("p"===e.key)Q(-1);else if("]"===e.key)$(1);else{if("["!==e.key)return;$(-1)}e.preventDefault()}};window.addEventListener("keydown",e);let t=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",e),document.body.style.overflow=t}},[Q,$,y]);let z=P.reduce((e,t)=>({added:e.added+Math.max(0,t.added),removed:e.removed+Math.max(0,t.removed)}),{added:0,removed:0});return(0,s.jsxs)("div",{ref:A,className:"diff-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"diff-title",children:[(0,s.jsxs)("div",{className:"diff-head",children:[(0,s.jsx)("h2",{id:"diff-title",children:j("diff.title",{title:v})}),(null==k?void 0:k.ok)&&(0,s.jsxs)("span",{className:"muted small",children:[k.branch?"".concat(k.branch," \xb7 "):"",null==(t=k.base)?void 0:t.slice(0,8)," → ",null==(n=k.commit)?void 0:n.slice(0,8)," \xb7 ",j("diff.summary",{n:P.length,a:z.added,r:z.removed})]}),(0,s.jsx)("span",{className:"grow"}),(0,s.jsx)("span",{className:"muted small",children:j("diff.keys")}),(0,s.jsx)("button",{ref:W,type:"button",onClick:y,children:j("diff.close")})]}),N&&(0,s.jsx)("div",{className:"err",style:{padding:12},children:N}),!k&&!N&&(0,s.jsx)("div",{className:"muted",style:{padding:12},children:j("diff.loading")}),k&&!k.ok&&(0,s.jsx)("div",{className:"notice caution",style:{margin:12},children:k.problem}),(null==k?void 0:k.ok)&&0===P.length&&(0,s.jsx)("div",{className:"notice",style:{margin:12},children:j("diff.nothing")}),(null==k?void 0:k.ok)&&P.length>0&&(0,s.jsxs)("div",{className:"diff-body",children:[(0,s.jsx)("nav",{className:"diff-files","aria-label":j("diff.files"),children:P.map((e,t)=>{let n=e.path.lastIndexOf("/");return(0,s.jsxs)("button",{type:"button",className:"diff-file".concat(t===S?" on":""),onClick:()=>C(t),title:e.oldPath?"".concat(e.oldPath," → ").concat(e.path):e.path,children:[(0,s.jsx)("span",{className:"diff-status s-".concat(e.status),children:e.status}),(0,s.jsxs)("span",{className:"diff-path",children:[n>=0&&(0,s.jsx)("span",{className:"muted",children:e.path.slice(0,n+1)}),(0,s.jsx)("strong",{children:e.path.slice(n+1)})]}),(0,s.jsx)("span",{className:"diff-counts",children:e.added<0?j("diff.binaryShort"):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{className:"plus",children:["+",e.added]})," ",(0,s.jsxs)("span",{className:"minus",children:["−",e.removed]})]})})]},e.path)})}),(0,s.jsxs)("div",{className:"diff-main",children:[O&&(0,s.jsxs)("div",{className:"diff-toolbar",children:[(0,s.jsx)("strong",{className:"diff-name",children:O.oldPath?"".concat(O.oldPath," → ").concat(O.path):O.path}),(0,s.jsx)("span",{className:"muted small",children:"A"===O.status?j("diff.added"):"D"===O.status?j("diff.deleted"):"R"===O.status?j("diff.renamed"):""}),(0,s.jsx)("span",{className:"grow"}),(0,s.jsx)("button",{type:"button",className:"quiet",onClick:()=>Q(-1),disabled:0===_.length,children:j("diff.prevChange")}),(0,s.jsx)("button",{type:"button",className:"quiet",onClick:()=>Q(1),disabled:0===_.length,children:j("diff.nextChange")}),(0,s.jsx)("span",{className:"muted small",children:_.length>0?j("diff.changeN",{i:R<0?"–":R+1,n:_.length}):""}),(0,s.jsx)("button",{type:"button",className:"quiet",onClick:()=>$(-1),disabled:0===S,children:j("diff.prevFile")}),(0,s.jsx)("button",{type:"button",className:"quiet",onClick:()=>$(1),disabled:S>=P.length-1,children:j("diff.nextFile")}),(0,s.jsxs)("label",{className:"option-inline",children:[(0,s.jsx)("input",{type:"checkbox",checked:F,onChange:e=>D(e.target.checked)})," ",j("diff.whole")]}),(0,s.jsxs)("label",{className:"option-inline",children:[(0,s.jsx)("input",{type:"checkbox",checked:M,onChange:e=>L(e.target.checked)})," ",j("diff.wrap")]})]}),(0,s.jsxs)("div",{className:"diff-scroll",ref:B,children:[void 0===G&&(0,s.jsx)("div",{className:"muted",style:{padding:12},children:j("diff.loading")}),"string"==typeof G&&(0,s.jsx)("div",{className:"err",style:{padding:12},children:G}),G&&"string"!=typeof G&&G.binary&&(0,s.jsx)("div",{className:"notice",style:{margin:12},children:j("diff.binary")}),G&&"string"!=typeof G&&G.tooLarge&&(0,s.jsx)("div",{className:"notice",style:{margin:12},children:j("diff.tooLarge")}),G&&"string"!=typeof G&&!G.binary&&!G.tooLarge&&(0,s.jsxs)(s.Fragment,{children:[(null!=(c=G.before)?c:"").includes("\r\n")!==(null!=(h=G.after)?h:"").includes("\r\n")&&null!==G.before&&null!==G.after&&(0,s.jsx)("div",{className:"notice small",style:{margin:8},children:j("diff.eol",{from:(null!=(m=G.before)?m:"").includes("\r\n")?"CRLF":"LF",to:(null!=(f=G.after)?f:"").includes("\r\n")?"CRLF":"LF"})}),K.length>0&&0===_.length&&(0,s.jsx)("div",{className:"notice small",style:{margin:8},children:j("diff.sameText")}),(0,s.jsxs)("table",{className:"diff-table".concat(M?"":" nowrap"),children:[(0,s.jsxs)("colgroup",{children:[(0,s.jsx)("col",{className:"num"}),(0,s.jsx)("col",{}),(0,s.jsx)("col",{className:"num"}),(0,s.jsx)("col",{})]}),(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{colSpan:2,children:j("diff.before")}),(0,s.jsx)("th",{colSpan:2,children:j("diff.after")})]})}),(0,s.jsx)("tbody",{children:Z.map(e=>"gap"===e.type?(0,s.jsx)("tr",{className:"diff-gap",children:(0,s.jsx)("td",{colSpan:4,children:(0,s.jsx)("button",{type:"button",className:"linkish small",onClick:()=>{var t;return t=e.from,void(O&&H(e=>{var n;return new Map(e).set(O.path,new Set([...null!=(n=e.get(O.path))?n:[],t]))}))},children:j("diff.gap",{n:e.count})})})},"g".concat(e.from)):(0,s.jsx)(u,{row:e.row,index:e.index,current:R>=0&&_[R]===e.index},e.index))})]})]})]})]})]})]})}function u(e){var t,n,a,r;let{row:i,index:o,current:d}=e,c="change"===i.kind?function(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n+=1;let s=e.length,l=t.length;for(;s>n&&l>n&&e[s-1]===t[l-1];)s-=1,l-=1;return{start:n,leftEnd:s,rightEnd:l}}(i.left.text,i.right.text):null,u=e=>{let t=i[e];if(!t)return null;if(!c)return t.text;let n="left"===e?c.leftEnd:c.rightEnd;return(0,s.jsxs)(l.Fragment,{children:[t.text.slice(0,c.start),(0,s.jsx)("mark",{children:t.text.slice(c.start,n)}),t.text.slice(n)]})};return(0,s.jsxs)("tr",{className:"diff-row ".concat(i.kind).concat(d?" current":""),"data-row":o,children:[(0,s.jsx)("td",{className:"num",children:null!=(a=null==(t=i.left)?void 0:t.no)?a:""}),(0,s.jsx)("td",{className:"code l".concat(i.left?"":" empty"),children:u("left")}),(0,s.jsx)("td",{className:"num",children:null!=(r=null==(n=i.right)?void 0:n.no)?r:""}),(0,s.jsx)("td",{className:"code r".concat(i.right?"":" empty"),children:u("right")})]})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[549],{5549:(t,e,o)=>{o.d(e,{AV:()=>a,FH:()=>h,FZ:()=>r,Zm:()=>u,aT:()=>s,c5:()=>p,dK:()=>l,nC:()=>n,rt:()=>d,ub:()=>i});let n="/api";function s(t,e){return"/sessions/view?id=".concat(encodeURIComponent(t)).concat(e?"#".concat(e):"")}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 e=a();return e?"".concat(t).concat(t.includes("?")?"&":"?","token=").concat(encodeURIComponent(e)):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)}async function m(t,e){let o,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=void 0===s.timeoutMs?3e4:s.timeoutMs;try{var i;o=await fetch("".concat(n).concat(t),{...e,...null!==c&&!(null==e?void 0:e.signal)?{signal:AbortSignal.timeout(c)}:{},headers:{"content-type":"application/json",...a()?{"x-cop-token":a()}:{},...null!=(i=null==e?void 0:e.headers)?i:{}}})}catch(e){if("TimeoutError"===e.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 e}if(!o.ok){let t="".concat(o.status," ").concat(o.statusText);try{let e=await o.json();(null==e?void 0:e.message)&&(t=Array.isArray(e.message)?e.message.join("; "):e.message)}catch(t){}throw Error(t)}let r=await o.text();return r?JSON.parse(r):void 0}let h={health:()=>m("/health"),doctor:()=>m("/doctor"),settings:()=>m("/settings"),saveSettings:t=>m("/settings",{method:"PUT",body:JSON.stringify(t)}),level1:()=>m("/level1"),setLevel1:t=>m("/level1",{method:"PUT",body:JSON.stringify({content:t})}),resetLevel1:()=>m("/level1",{method:"DELETE"}),presets:()=>m("/presets"),savePreset:(t,e)=>m("/presets/".concat(encodeURIComponent(t)),{method:"PUT",body:JSON.stringify({content:e})}),deletePreset:t=>m("/presets/".concat(encodeURIComponent(t)),{method:"DELETE"}),personas:()=>m("/personas"),savePersona:(t,e)=>m("/personas/".concat(encodeURIComponent(t)),{method:"PUT",body:JSON.stringify({content:e})}),deletePersona:t=>m("/personas/".concat(encodeURIComponent(t)),{method:"DELETE"}),sessions:()=>m("/sessions"),metrics:()=>m("/metrics"),syncPlan:t=>m("/repo/sync?dir=".concat(encodeURIComponent(t))),session:t=>m("/sessions/".concat(t)),createSession:(t,e)=>m("/sessions",{method:"POST",body:JSON.stringify({name:t,projectDir:e})}),updateSession:(t,e)=>m("/sessions/".concat(t),{method:"PUT",body:JSON.stringify(e)}),deleteSession:t=>m("/sessions/".concat(t),{method:"DELETE"}),addTask:(t,e)=>m("/sessions/".concat(t,"/tasks"),{method:"POST",body:JSON.stringify(e)}),updateTask:(t,e,o)=>m("/sessions/".concat(t,"/tasks/").concat(e),{method:"PUT",body:JSON.stringify(o)}),deleteTask:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e),{method:"DELETE"}),continueTask:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/continue"),{method:"POST",body:"{}"}),rerunTask:function(t,e){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return m("/sessions/".concat(t,"/tasks/").concat(e,"/rerun"),{method:"POST",body:JSON.stringify({...o,...n.buildOnFinished?{buildOnFinished:!0}:{}})})},taskChanges:(t,e,o)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/changes").concat(o?"?run=".concat(encodeURIComponent(o)):"")),taskChangeFile:(t,e,o,n)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/changes/file?path=").concat(encodeURIComponent(o)).concat(n?"&run=".concat(encodeURIComponent(n)):"")),taskStory:(t,e,o)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/story").concat(o?"?run=".concat(encodeURIComponent(o)):"")),taskFiles:(t,e,o)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/files").concat(o?"?run=".concat(encodeURIComponent(o)):"")),taskLogUrl:(t,e,o)=>"".concat(n,"/sessions/").concat(t,"/tasks/").concat(e,"/log").concat(o?"?run=".concat(encodeURIComponent(o)):""),taskFileUrl:(t,e,o,s,c)=>"".concat(n,"/sessions/").concat(t,"/tasks/").concat(e,"/files/").concat(o,"/").concat(encodeURIComponent(s)).concat(c?"?run=".concat(encodeURIComponent(c)):""),saveTaskLog:(t,e,o)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/log").concat(o?"?run=".concat(encodeURIComponent(o)):""),{method:"POST",body:"{}"}),saveTaskFile:(t,e,o,n,s)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/files/").concat(o,"/").concat(encodeURIComponent(n)).concat(s?"?run=".concat(encodeURIComponent(s)):""),{method:"POST",body:"{}"}),start:(t,e,o)=>m("/sessions/".concat(t,"/start"),{method:"POST",body:JSON.stringify({mode:e,name:o})}),stop:t=>m("/sessions/".concat(t,"/stop"),{method:"POST",body:"{}"}),approvals:t=>m("/approvals".concat(t?"?session=".concat(encodeURIComponent(t)):"")),decide:(t,e)=>m("/approvals/".concat(t),{method:"POST",body:JSON.stringify({action:e})}),setRunMode:(t,e)=>m("/sessions/".concat(t,"/mode"),{method:"POST",body:JSON.stringify({mode:e})}),streamUrl:t=>i("".concat(n,"/sessions/").concat(t,"/stream")),batch:()=>m("/batch").then(t=>null!=t?t:null),startBatch:(t,e,o,n,s,c,a)=>m("/batch/start",{method:"POST",body:JSON.stringify({sessionIds:t,mode:e,onFailure:o,model:n,reviewModel:s,name:c,taskIds:a})}),suggestedRunName:t=>m("/batch/name?sessions=".concat(encodeURIComponent(t.join(",")))),stopBatch:()=>m("/batch/stop",{method:"POST",body:"{}"}),pauseBatch:()=>m("/batch/pause",{method:"POST",body:"{}"}),resumeBatch:()=>m("/batch/resume",{method:"POST",body:"{}"}),planBrief:t=>m("/plan/brief?lang=".concat(encodeURIComponent(t))),context:(t,e)=>m("/context/".concat(t,"?lang=").concat(encodeURIComponent(e))),setContext:(t,e)=>m("/context/".concat(t),{method:"PUT",body:JSON.stringify({content:e})}),resetContext:(t,e)=>m("/context/".concat(t,"?lang=").concat(encodeURIComponent(e)),{method:"DELETE"}),checkPlan:t=>m("/plan/check",{method:"POST",body:JSON.stringify({text:t})}),importPlan:t=>m("/plan/import",{method:"POST",body:JSON.stringify({text:t})}),browseFolder:t=>m("/browse-folder",{method:"POST",body:JSON.stringify({start:t})},{timeoutMs:null}),tasks:()=>m("/tasks"),activity:()=>m("/activity"),downloadBundle:async t=>{var e,o,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==(e=/filename\*=UTF-8''([^;]+)/i.exec(i))?void 0:e[1],d=null==(o=/filename="([^"]+)"/i.exec(i))?void 0:o[1],l=null!=d?d:"copilot-operator-bundle.json";if(r)try{l=decodeURIComponent(r)}catch(t){}let u=URL.createObjectURL(await c.blob()),m=document.createElement("a");return m.href=u,m.download=l,document.body.appendChild(m),m.click(),m.remove(),setTimeout(()=>URL.revokeObjectURL(u),1e4),l},exportUrl:(t,e)=>{let o=new URLSearchParams;return e.run&&o.set("run",e.run),e.session&&o.set("session",e.session),e.task&&o.set("task",e.task),i("".concat(n,"/export/").concat(t,"?").concat(o.toString()))},debugExportUrl:t=>i("".concat(n,"/debug/export").concat(t.length>0?"?sessions=".concat(encodeURIComponent(t.join(","))):"")),vcsStatus:t=>m("/sessions/".concat(t,"/vcs")),restorePreview:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/restore")),restore:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/restore"),{method:"POST",body:"{}"}),restartPlan:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/restart")),restartFrom:function(t,e){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return m("/sessions/".concat(t,"/tasks/").concat(e,"/restart"),{method:"POST",body:JSON.stringify(o)})},repoCheck:t=>m("/repo?dir=".concat(encodeURIComponent(t))),project:()=>m("/project"),setProject:t=>m("/project",{method:"PUT",body:JSON.stringify(t)}),models:()=>m("/models"),setDefaultModel:t=>m("/models/default",{method:"PUT",body:JSON.stringify({model:t})}),setDefaultReviewModel:t=>m("/models/review-default",{method:"PUT",body:JSON.stringify({model:t})}),refreshModels:()=>m("/models/refresh",{method:"POST",body:"{}"},{timeoutMs:null})};function p(t){if(void 0===t)return"";let e=Math.round(t/1e3);if(e<60)return"".concat(e,"s");let o=Math.floor(e/60);return o<60?"".concat(o,"m ").concat(e%60,"s"):"".concat(Math.floor(o/60),"h ").concat(o%60,"m")}}}]);
|