copilot-operator 0.1.4 → 0.1.6

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.
Files changed (47) hide show
  1. package/dist/src/api/operator.controller.js +5 -2
  2. package/dist/src/api/operator.service.js +48 -12
  3. package/dist/src/orchestrator/taskRunner.js +12 -2
  4. package/dist/src/plan/brief.js +1290 -1221
  5. package/dist/src/plan/schema.js +12 -0
  6. package/dist/src/plan/script.js +13 -0
  7. package/dist/src/plan/systemGuide.js +1396 -172
  8. package/dist/src/session/compose.js +5 -1
  9. package/dist/src/session/exports.js +4 -0
  10. package/dist/src/session/store.js +4 -1
  11. package/dist/src/session/story.js +10 -1
  12. package/dist/src/vcs/taskVcs.js +122 -12
  13. package/dist/web/404.html +2 -2
  14. package/dist/web/_next/static/chunks/549-afafecd6bfbb138e.js +1 -0
  15. package/dist/web/_next/static/chunks/56-91cd1709158ebf99.js +1 -0
  16. package/dist/web/_next/static/chunks/867-fc983d08916b4e28.js +1 -0
  17. package/dist/web/_next/static/chunks/app/history/page-b3b4af994c868b5d.js +1 -0
  18. package/dist/web/_next/static/chunks/app/layout-e0174d863960f109.js +1 -0
  19. package/dist/web/_next/static/chunks/app/sessions/view/page-d4213354730a945c.js +1 -0
  20. package/dist/web/_next/static/css/{5a10c60adf9c5336.css → 63fea96806e6b2cb.css} +1 -1
  21. package/dist/web/appearance.html +2 -2
  22. package/dist/web/appearance.txt +25 -24
  23. package/dist/web/defaults.html +2 -2
  24. package/dist/web/defaults.txt +25 -24
  25. package/dist/web/history.html +2 -2
  26. package/dist/web/history.txt +25 -24
  27. package/dist/web/import.html +2 -2
  28. package/dist/web/import.txt +25 -24
  29. package/dist/web/index.html +2 -2
  30. package/dist/web/index.txt +25 -24
  31. package/dist/web/level1.html +2 -2
  32. package/dist/web/level1.txt +25 -24
  33. package/dist/web/presets.html +2 -2
  34. package/dist/web/presets.txt +25 -24
  35. package/dist/web/sessions/view.html +2 -2
  36. package/dist/web/sessions/view.txt +25 -24
  37. package/dist/web/system.html +2 -2
  38. package/dist/web/system.txt +25 -24
  39. package/package.json +4 -3
  40. package/dist/web/_next/static/chunks/549-2086c05135bc9753.js +0 -1
  41. package/dist/web/_next/static/chunks/867-f0e3e152f6f67e45.js +0 -1
  42. package/dist/web/_next/static/chunks/89-382e9b29486d2747.js +0 -1
  43. package/dist/web/_next/static/chunks/app/history/page-8d4f817e36986e3f.js +0 -1
  44. package/dist/web/_next/static/chunks/app/layout-92fa876afe619cf3.js +0 -1
  45. package/dist/web/_next/static/chunks/app/sessions/view/page-185f5fcc383e6619.js +0 -1
  46. /package/dist/web/_next/static/{p9lexLS0u8W5N6VzLavHO → WJ_8hRZsp4VWiDZx8NMUw}/_buildManifest.js +0 -0
  47. /package/dist/web/_next/static/{p9lexLS0u8W5N6VzLavHO → WJ_8hRZsp4VWiDZx8NMUw}/_ssgManifest.js +0 -0
@@ -70,7 +70,11 @@ export function composeOpening(input) {
70
70
  const continuationLine = input.continuing
71
71
  ? `\n\nThis continues an earlier attempt at this task that stopped at the runner's limit. The files are as ` +
72
72
  `that attempt left them: look at what is already done before changing anything, and carry on from there.`
73
- : '';
73
+ : input.buildsOn
74
+ ? `\n\nThis task was done once already (attempt ${input.buildsOn.fromAttempt}), and that work is in your ` +
75
+ `working tree. The text above is a new instruction for it: look at what is there first, build on it, and ` +
76
+ `change or undo it only where the new instruction asks. Verify the result as for any task.`
77
+ : '';
74
78
  if (!input.contractAlreadySent) {
75
79
  const taskMessage = `${runnerBlock(input)}${level2Block(input.level2)}\n\n${taskBlock}${continuationLine}`;
76
80
  return {
@@ -141,6 +141,9 @@ export function buildPlanExport(scope) {
141
141
  commitOnFinish: s.vcs?.commitOnFinish ?? true,
142
142
  branchPrefix: s.vcs?.branchPrefix ?? 'cop/',
143
143
  branchName: s.vcs?.branchName ?? '',
144
+ // Only when chosen: absent is the old behaviour, and writing it out would suggest a choice.
145
+ ...(s.vcs?.startFrom ? { startFrom: s.vcs.startFrom } : {}),
146
+ ...(s.vcs?.baseBranch ? { baseBranch: s.vcs.baseBranch } : {}),
144
147
  },
145
148
  review: { enabled: s.review?.enabled !== false, model: s.review?.model ?? '' },
146
149
  mirror: {
@@ -251,6 +254,7 @@ export function taskAtAttempt(task, attempt) {
251
254
  vcs: a.vcs,
252
255
  attempts: task.attempts?.slice(0, attempt - 1),
253
256
  continuing: undefined,
257
+ buildsOn: undefined,
254
258
  finalReply: undefined,
255
259
  firstMessage: undefined,
256
260
  logFile: a.runId ? 'task-log.txt' : undefined,
@@ -307,7 +307,9 @@ export class SessionStore {
307
307
  }
308
308
  async rerunTask(sessionId, taskId, patch = {},
309
309
  /** Present when the new attempt carries on from the last one (see `continueTask`). */
310
- continuing) {
310
+ continuing,
311
+ /** Present when a finished task's new prompt builds on its work (see `Task.buildsOn`). */
312
+ buildsOn) {
311
313
  let result;
312
314
  await this.updateSession(sessionId, (s) => {
313
315
  const t = s.tasks.find((x) => x.id === taskId);
@@ -356,6 +358,7 @@ export class SessionStore {
356
358
  t.status = 'queued';
357
359
  t.iterations = 0;
358
360
  t.continuing = continuing;
361
+ t.buildsOn = buildsOn;
359
362
  // Cleared so the next run starts from nothing and gets its own run folder.
360
363
  t.runId = undefined;
361
364
  t.runGroup = undefined;
@@ -18,6 +18,15 @@ const MAX_TEXT = 60_000;
18
18
  function clip(text) {
19
19
  return text.length > MAX_TEXT ? `${text.slice(0, MAX_TEXT)}\n… (${text.length - MAX_TEXT} more characters in the run folder)` : text;
20
20
  }
21
+ /**
22
+ * A command's output keeps its end instead, the way a terminal does. What is at the end of a long
23
+ * output — the test summary, the error that stopped it — is what anyone reads it for, and while a
24
+ * step is still running the end is where the new lines arrive: a head-kept clip froze a live view
25
+ * of a long test run at its first 60 000 characters, and nothing after that ever appeared.
26
+ */
27
+ function clipTail(text) {
28
+ return text.length > MAX_TEXT ? `… (${text.length - MAX_TEXT} earlier characters in the run folder)\n${text.slice(-MAX_TEXT)}` : text;
29
+ }
21
30
  /** The task log's sections: a name between two rules, then the text until the next rule. */
22
31
  function sectionsOf(log) {
23
32
  const rule = /^=+\s*$/;
@@ -68,7 +77,7 @@ async function stepsIn(dir) {
68
77
  iteration,
69
78
  id: Number(m[2]),
70
79
  command: parsed.command,
71
- output: clip(parsed.output),
80
+ output: clipTail(parsed.output),
72
81
  outcome: parsed.outcome,
73
82
  exitCode: parsed.exitCode,
74
83
  durationMs: parsed.durationMs,
@@ -1,5 +1,5 @@
1
1
  import { findSuspicious } from './commitHygiene.js';
2
- import { branchNameFrom, commitAll, commitFiles, commitsBetween, commitSubject, createBranch, checkoutExisting, freeBranchName, isValidBranchName, plannedBranchName, repoState } from './git.js';
2
+ import { branchNameFrom, commitAll, commitFiles, commitsBetween, commitSubject, createBranch, 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
5
  return (session.vcs?.repoDir?.trim() || session.mirror.rootDir?.trim() || '').trim();
@@ -11,7 +11,9 @@ export function repoDirOf(session) {
11
11
  * on without it, not a reason to throw away a queue of work: the task itself may not even
12
12
  * touch the repository.
13
13
  */
14
- export async function prepareForTask(session, task, bus, saveSession) {
14
+ export async function prepareForTask(session, task, bus, saveSession,
15
+ /** Every session on record, for `startFrom: previous-session` to find the one before this. */
16
+ allSessions = async () => []) {
15
17
  const settings = session.vcs;
16
18
  if (!settings?.enabled)
17
19
  return { vcs: {}, note: '' };
@@ -34,13 +36,28 @@ export async function prepareForTask(session, task, bus, saveSession) {
34
36
  return { vcs: { problem }, note: '' };
35
37
  }
36
38
  // The session's base is fixed the first time it runs: every per-task branch is cut from it,
37
- // which is what makes the tasks independent of each other rather than of the calendar.
39
+ // which is what makes the tasks independent of each other rather than of the calendar. Where
40
+ // it is taken from is the session's `startFrom`; see `sessionStart`.
38
41
  let base = session.vcsBaseCommit;
39
- if (!base && state.head) {
40
- base = state.head;
41
- await saveSession((s) => {
42
- s.vcsBaseCommit = base;
43
- });
42
+ let start = session.vcsStart;
43
+ if (!base) {
44
+ const resolved = await sessionStart(session, dir, state.head, allSessions);
45
+ if ('problem' in resolved) {
46
+ bus.publish({ sessionId: session.id, taskId: task.id, type: 'vcs-problem', level: 'warn',
47
+ message: `version control is on but inactive: ${resolved.problem}` });
48
+ return { vcs: { problem: resolved.problem }, note: '' };
49
+ }
50
+ start = resolved.start;
51
+ base = start?.commit;
52
+ if (start) {
53
+ const chosen = start;
54
+ await saveSession((s) => {
55
+ s.vcsBaseCommit = chosen.commit;
56
+ s.vcsStart = chosen;
57
+ });
58
+ bus.publish({ sessionId: session.id, taskId: task.id, type: 'vcs-start', level: chosen.note ? 'warn' : 'info',
59
+ message: describeStart(chosen), data: { ...chosen } });
60
+ }
44
61
  }
45
62
  const attempt = task.attempt ?? 1;
46
63
  const prefix = settings.branchPrefix || 'cop/';
@@ -49,7 +66,7 @@ export async function prepareForTask(session, task, bus, saveSession) {
49
66
  const wanted = planned
50
67
  ? plannedBranchName(planned, prefix)
51
68
  : branchNameFrom([session.name, session.id.slice(0, 13)], prefix);
52
- return await switchTo(session, task, dir, wanted, base, bus, { reuseExisting: true });
69
+ return await switchTo(session, task, dir, wanted, base, bus, { reuseExisting: true, start });
53
70
  }
54
71
  // A name the task carries wins over one derived from its title: whoever wrote the plan knew
55
72
  // what the task was for, and a title is only ever a label for the list.
@@ -59,13 +76,94 @@ export async function prepareForTask(session, task, bus, saveSession) {
59
76
  : branchNameFrom([session.name, task.title, attempt > 1 ? `a${attempt}` : undefined], prefix);
60
77
  // A continuation carries on where the previous attempt stopped, on that attempt's own branch:
61
78
  // its work is what is being continued. See `continueTask` in the store.
62
- const previousBranch = task.continuing ? task.attempts?.at(-1)?.vcs?.branch : undefined;
79
+ // The same for a new prompt given to a finished task: it builds on that attempt's work.
80
+ const previousBranch = task.continuing || task.buildsOn ? task.attempts?.at(-1)?.vcs?.branch : undefined;
63
81
  if (previousBranch)
64
- return await switchTo(session, task, dir, previousBranch, base, bus, { reuseExisting: true });
82
+ return await switchTo(session, task, dir, previousBranch, base, bus, { reuseExisting: true, start });
65
83
  // A re-run starts from where that task started the first time, not from where the previous
66
84
  // attempt ended. That is the whole point of recording the base commit.
67
85
  const from = firstAttemptBase(task) ?? base;
68
- return await switchTo(session, task, dir, wanted, from, bus, { reuseExisting: false });
86
+ return await switchTo(session, task, dir, wanted, from, bus, { reuseExisting: false, start });
87
+ }
88
+ /**
89
+ * The commit a session's first branch is cut from, by its `startFrom`, or why there is none.
90
+ *
91
+ * `previous-session` looks for the session whose work was committed last in this same repository —
92
+ * not the one listed before it, because a plan may put sessions in several repositories, and
93
+ * continuing a front end from a back end's branch would be nonsense. In a run of several sessions
94
+ * that is the one that ran just before; started on its own, it is the last one that worked here.
95
+ * When there is none, it starts from `baseBranch` and says so, rather than from wherever the
96
+ * repository happens to be.
97
+ */
98
+ export async function sessionStart(session, dir, head, allSessions) {
99
+ const how = session.vcs?.startFrom ?? 'head';
100
+ const baseBranch = session.vcs?.baseBranch?.trim() || 'main';
101
+ if (how === 'head')
102
+ return head ? { start: { kind: 'head', commit: head } } : {};
103
+ const fromBranch = async (note) => {
104
+ const tip = await branchTip(dir, baseBranch);
105
+ if (!tip) {
106
+ return {
107
+ problem: `this session is set to start from the local branch "${baseBranch}", and ${dir} has no such branch. ` +
108
+ 'Name the branch the work should start from (Version control → "Start from"), or create it.',
109
+ };
110
+ }
111
+ return { start: { kind: 'branch', commit: tip, branch: baseBranch, ...(note ? { note } : {}) } };
112
+ };
113
+ if (how === 'branch')
114
+ return await fromBranch();
115
+ const here = normalise(dir);
116
+ let best = null;
117
+ for (const other of await allSessions()) {
118
+ if (other.id === session.id || !other.vcs?.enabled || normalise(repoDirOf(other)) !== here)
119
+ continue;
120
+ const last = lastWorkOf(other);
121
+ if (last && (!best || last.at > best.at))
122
+ best = { session: other, ...last };
123
+ }
124
+ if (!best)
125
+ return await fromBranch(`no earlier session has committed work in this repository, so it starts from "${baseBranch}"`);
126
+ const tip = await branchTip(dir, best.branch);
127
+ if (!tip) {
128
+ return await fromBranch(`the branch of the previous session "${best.session.name}" (${best.branch}) is no longer in the repository, so it starts from "${baseBranch}"`);
129
+ }
130
+ return { start: { kind: 'previous-session', commit: tip, branch: best.branch, fromSession: { id: best.session.id, name: best.session.name } } };
131
+ }
132
+ /**
133
+ * The branch holding a session's latest work, and when that work ended: in `per-session` mode its
134
+ * one branch, in `per-task` mode the branch of the task that finished last — only tasks that
135
+ * committed something, since a branch with nothing on it is the session's start, not its work.
136
+ */
137
+ function lastWorkOf(session) {
138
+ let best = null;
139
+ for (const t of session.tasks) {
140
+ for (const v of [...(t.attempts ?? []).map((a) => ({ vcs: a.vcs, at: a.finishedAt })), { vcs: t.vcs, at: t.finishedAt }]) {
141
+ if (!v.vcs?.branch || !v.vcs.commit || !v.at)
142
+ continue;
143
+ if (!best || v.at > best.at)
144
+ best = { branch: v.vcs.branch, at: v.at };
145
+ }
146
+ }
147
+ return best;
148
+ }
149
+ async function branchTip(dir, branch) {
150
+ if (!(await isValidBranchName(dir, branch)))
151
+ return null;
152
+ const r = await git(dir, ['rev-parse', '--verify', '--quiet', `refs/heads/${branch}^{commit}`]);
153
+ return r.ok && r.stdout.trim() ? r.stdout.trim() : null;
154
+ }
155
+ function normalise(dir) {
156
+ return dir.trim().replace(/[\\/]+$/, '').replace(/\//g, '\\').toLowerCase();
157
+ }
158
+ /** One line for the log and the event stream: where this session starts, and why. */
159
+ export function describeStart(start) {
160
+ const at = start.commit.slice(0, 8);
161
+ const said = start.kind === 'previous-session'
162
+ ? `this session continues "${start.fromSession?.name ?? '?'}": it starts from the end of its branch ${start.branch} (${at})`
163
+ : start.kind === 'branch'
164
+ ? `this session starts from the local branch ${start.branch} (${at})`
165
+ : `this session starts from where the repository was (${at})`;
166
+ return start.note ? `${said} — ${start.note}` : said;
69
167
  }
70
168
  /**
71
169
  * Which branch has the complete work of a session, when one does.
@@ -135,6 +233,7 @@ async function switchTo(session, task, dir, wantedName, from, bus, opts) {
135
233
  mode,
136
234
  base: vcs.baseCommit ? { commit: vcs.baseCommit, subject } : undefined,
137
235
  earlier,
236
+ start: opts.start,
138
237
  });
139
238
  return { vcs, note };
140
239
  }
@@ -167,12 +266,23 @@ export function noteFor(repoDir, vcs, ctx = { mode: 'per-task', earlier: [] }) {
167
266
  ? `Every task of this session gets its own branch from that same commit, so the work of the earlier tasks is NOT in your working tree: ` +
168
267
  `${ctx.earlier.map((e) => `"${e.title}" is on \`${e.branch}\``).join(', ')}. If this task depends on what one of them produced, say so in the summary rather than looking for files that are not here.`
169
268
  : 'Every task of this session gets its own branch from that same commit.';
269
+ /*
270
+ * Where the session began, said when it was chosen. A session that continues another has that
271
+ * session's files in its tree, and a model not told so reads them as something to redo or
272
+ * doubt; one that starts from `main` has none of them, and a model not told so goes looking.
273
+ */
274
+ const began = ctx.start?.kind === 'previous-session'
275
+ ? `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 started from the local branch \`${ctx.start.branch}\`, not from any earlier session's work${ctx.start.note ? ` (${ctx.start.note})` : ''}.`
278
+ : '';
170
279
  return [
171
280
  '## Version control',
172
281
  '',
173
282
  `The runner has already put ${repoDir} on the branch \`${vcs.branch}\`, created for this task from ${base},`,
174
283
  'and it will commit whatever you change when the task finishes.',
175
284
  '',
285
+ ...(began ? [began, ''] : []),
176
286
  standing,
177
287
  '',
178
288
  '- Do not create branches, switch branches, commit, stash, reset or revert. That is the',
package/dist/web/404.html CHANGED
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html><!--p9lexLS0u8W5N6VzLavHO--><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/5a10c60adf9c5336.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-f0e3e152f6f67e45.js" async=""></script><script src="/_next/static/chunks/549-2086c05135bc9753.js" async=""></script><script src="/_next/static/chunks/app/layout-92fa876afe619cf3.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>
1
+ <!DOCTYPE html><!--WJ_8hRZsp4VWiDZx8NMUw--><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/63fea96806e6b2cb.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-fc983d08916b4e28.js" async=""></script><script src="/_next/static/chunks/549-afafecd6bfbb138e.js" async=""></script><script src="/_next/static/chunks/app/layout-e0174d863960f109.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;
@@ -12,4 +12,4 @@
12
12
  d.dataset.focus = a.strongFocus ? 'strong' : 'normal';
13
13
  } catch (e) {}
14
14
  })();
15
- </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,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;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-f0e3e152f6f67e45.js\",\"549\",\"static/chunks/549-2086c05135bc9753.js\",\"177\",\"static/chunks/app/layout-92fa876afe619cf3.js\"],\"themeScript\"]\n3:I[1205,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-f0e3e152f6f67e45.js\",\"549\",\"static/chunks/549-2086c05135bc9753.js\",\"177\",\"static/chunks/app/layout-92fa876afe619cf3.js\"],\"AppearanceProvider\"]\n4:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-f0e3e152f6f67e45.js\",\"549\",\"static/chunks/549-2086c05135bc9753.js\",\"177\",\"static/chunks/app/layout-92fa876afe619cf3.js\"],\"LanguageProvider\"]\n5:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-f0e3e152f6f67e45.js\",\"549\",\"static/chunks/549-2086c05135bc9753.js\",\"177\",\"static/chunks/app/layout-92fa876afe619cf3.js\"],\"DialogHost\"]\n6:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-f0e3e152f6f67e45.js\",\"549\",\"static/chunks/549-2086c05135bc9753.js\",\"177\",\"static/chunks/app/layout-92fa876afe619cf3.js\"],\"SkipLink\"]\n7:I[8197,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-f0e3e152f6f67e45.js\",\"549\",\"static/chunks/549-2086c05135bc9753.js\",\"177\",\"static/chunks/app/layout-92fa876afe619cf3.js\"],\"\"]\n8:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-f0e3e152f6f67e45.js\",\"549\",\"static/chunks/549-2086c05135bc9753.js\",\"177\",\"static/chunks/app/layout-92fa876afe619cf3.js\"],\"Nav\"]\n9:I[6657,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-f0e3e152f6f67e45.js\",\"549\",\"static/chunks/549-2086c05135bc9753.js\",\"177\",\"static/chunks/app/layout-92fa876afe619cf3.js\"],\"GlobalApprovals\"]\na:I[5204,[],\"\"]\nb:I[2642,[],\"\"]\nc:I[433,[],\"OutletBoundary\"]\ne:I[9884,[],\"AsyncMetadataOutlet\"]\n10:I[433,[],\"ViewportBoundary\"]\n12:I[433,[],\"MetadataBoundary\"]\n13:\"$Sreact.suspense\"\n15:I[3536,[],\"\"]\n:HL[\"/_next/static/css/5a10c60adf9c5336.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"p9lexLS0u8W5N6VzLavHO\",\"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/5a10c60adf9c5336.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\"}]}]]}]]}]}]}]}]]}]]}],{\"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,[\"$\",\"$Lc\",null,{\"children\":[\"$Ld\",[\"$\",\"$Le\",null,{\"promise\":\"$@f\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$L10\",null,{\"children\":\"$L11\"}],null],[\"$\",\"$L12\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$13\",null,{\"fallback\":null,\"children\":\"$L14\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$15\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"11:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\nd:null\n"])</script><script>self.__next_f.push([1,"f:{\"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,"14:\"$f:metadata\"\n"])</script></body></html>
15
+ </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,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;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-fc983d08916b4e28.js\",\"549\",\"static/chunks/549-afafecd6bfbb138e.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"themeScript\"]\n3:I[1205,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-fc983d08916b4e28.js\",\"549\",\"static/chunks/549-afafecd6bfbb138e.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"AppearanceProvider\"]\n4:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-fc983d08916b4e28.js\",\"549\",\"static/chunks/549-afafecd6bfbb138e.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"LanguageProvider\"]\n5:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-fc983d08916b4e28.js\",\"549\",\"static/chunks/549-afafecd6bfbb138e.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"DialogHost\"]\n6:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-fc983d08916b4e28.js\",\"549\",\"static/chunks/549-afafecd6bfbb138e.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"SkipLink\"]\n7:I[8197,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-fc983d08916b4e28.js\",\"549\",\"static/chunks/549-afafecd6bfbb138e.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"\"]\n8:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-fc983d08916b4e28.js\",\"549\",\"static/chunks/549-afafecd6bfbb138e.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"Nav\"]\n9:I[6657,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-fc983d08916b4e28.js\",\"549\",\"static/chunks/549-afafecd6bfbb138e.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"GlobalApprovals\"]\na:I[5204,[],\"\"]\nb:I[2642,[],\"\"]\nc:I[7712,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-fc983d08916b4e28.js\",\"549\",\"static/chunks/549-afafecd6bfbb138e.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.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/63fea96806e6b2cb.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"WJ_8hRZsp4VWiDZx8NMUw\",\"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/63fea96806e6b2cb.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([[549],{5549:(t,e,o)=>{o.d(e,{AV:()=>i,FH:()=>h,FZ:()=>d,aT:()=>c,c5:()=>y,dK:()=>u,nC:()=>s,rt:()=>l,ub:()=>r,zi:()=>p});var n=o(986);let s="/api";function c(t,e){return"/sessions/view?id=".concat(encodeURIComponent(t)).concat(e?"#".concat(e):"")}let a="cop-api-token";function i(){try{var t;let e=/(?:^#|&)token=([0-9a-f]{16,})/i.exec(window.location.hash);if(e)return window.localStorage.setItem(a,e[1]),window.history.replaceState(null,"",window.location.pathname+window.location.search),e[1];return window.localStorage.getItem(a)||(null!=(t=n.env.NEXT_PUBLIC_COP_TOKEN)?t:"")}catch(t){return""}}function r(t){let e=i();return e?"".concat(t).concat(t.includes("?")?"&":"?","token=").concat(encodeURIComponent(e)):t}let d=["exit-zero","exit-nonzero","output-contains","output-omits","output-matches","file-exists","file-missing","file-contains"];function l(t){return t.startsWith("exit-")||t.startsWith("output-")}function u(t){return"output-contains"===t||"output-omits"===t||"output-matches"===t||"file-contains"===t}async function m(t,e){var o;let n=await fetch("".concat(s).concat(t),{...e,headers:{"content-type":"application/json",...i()?{"x-cop-token":i()}:{},...null!=(o=null==e?void 0:e.headers)?o:{}}});if(!n.ok){let t="".concat(n.status," ").concat(n.statusText);try{let e=await n.json();(null==e?void 0:e.message)&&(t=Array.isArray(e.message)?e.message.join("; "):e.message)}catch(t){}throw Error(t)}let c=await n.text();return c?JSON.parse(c):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"),session:t=>m("/sessions/".concat(t)),createSession:(t,e)=>m("/sessions",{method:"POST",body:JSON.stringify({name:t,mirror: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}:{}})})},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(s,"/sessions/").concat(t,"/tasks/").concat(e,"/log").concat(o?"?run=".concat(encodeURIComponent(o)):""),taskFileUrl:(t,e,o,n,c)=>"".concat(s,"/sessions/").concat(t,"/tasks/").concat(e,"/files/").concat(o,"/").concat(encodeURIComponent(n)).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=>r("".concat(s,"/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})}),dirs:function(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return m("/dirs?root=".concat(encodeURIComponent(t),"&gitignore=").concat(e?"1":"0"))},browseFolder:t=>m("/browse-folder",{method:"POST",body:JSON.stringify({start:t})}),previewMirror:t=>m("/mirror/preview",{method:"POST",body:JSON.stringify(t)}),tasks:()=>m("/tasks"),activity:()=>m("/activity"),downloadBundle:async t=>{var e,o,n;let c=await fetch("".concat(s,"/export/bundle"),{method:"POST",headers:{"content-type":"application/json",...i()?{"x-cop-token":i()}:{}},body:JSON.stringify({tasks:t})});if(!c.ok)throw Error(await c.text()||"".concat(c.status," ").concat(c.statusText));let a=null!=(n=c.headers.get("content-disposition"))?n:"",r=null==(e=/filename\*=UTF-8''([^;]+)/i.exec(a))?void 0:e[1],d=null==(o=/filename="([^"]+)"/i.exec(a))?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),r("".concat(s,"/export/").concat(t,"?").concat(o.toString()))},debugExportUrl:t=>r("".concat(s,"/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:"{}"})};function p(t){return t<1024?"".concat(t," B"):t<1048576?"".concat((t/1024).toFixed(1)," KB"):"".concat((t/1048576).toFixed(1)," MB")}function y(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")}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[56],{1035:(e,t,s)=>{s.d(t,{DialogHost:()=>c,Z:()=>o});var n=s(3365),l=s(1521),r=s(867);let a=null,i=[];function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(s=>{var n;return n={kind:"confirm",message:e,...t,resolve:s},void(a?a(n):i.push(n))})}function c(e){var t,s;let{children:o}=e,{t:c}=(0,r.kj)(),[d,u]=(0,l.useState)([]),h=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(a=e=>u(t=>[...t,e]),i.length>0){let e=i.splice(0,i.length);u(t=>[...t,...e])}return()=>{a=null}},[]);let m=d[0],p=(0,l.useCallback)(e=>{m&&(m.resolve(e),u(e=>e.slice(1)))},[m]);return(0,l.useEffect)(()=>{var e;if(!m)return;null==(e=h.current)||e.focus();let t=e=>{"Escape"===e.key&&(e.preventDefault(),p(!1))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[m,p]),(0,n.jsxs)(n.Fragment,{children:[o,m&&(0,n.jsx)("div",{className:"modal-backdrop",onClick:()=>p(!1),role:"presentation",children:(0,n.jsxs)("div",{className:"modal".concat(m.danger?" danger":""),role:"confirm"===m.kind?"alertdialog":"dialog","aria-modal":"true","aria-labelledby":"modal-title",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("h2",{id:"modal-title",children:null!=(t=m.title)?t:c("confirm"===m.kind?"dialog.confirmTitle":"dialog.noticeTitle")}),(0,n.jsx)("div",{className:"modal-body",children:m.message}),(0,n.jsxs)("div",{className:"row modal-actions",children:["confirm"===m.kind&&(0,n.jsx)("button",{type:"button",className:"quiet",onClick:()=>p(!1),children:c("dialog.cancel")}),(0,n.jsx)("button",{ref:h,type:"button",className:m.danger?"danger":"primary",onClick:()=>p(!0),children:null!=(s=m.okLabel)?s:c("dialog.ok")})]})]})})]})}},1910:(e,t,s)=>{s.d(t,{H:()=>o,u:()=>i});var n=s(3365),l=s(1521),r=s(867),a=s(5549);function i(e){let{label:t,save:s}=e,{t:a}=(0,r.kj)(),[i,o]=(0,l.useState)(!1),[c,d]=(0,l.useState)(""),[u,h]=(0,l.useState)(!1),m=async()=>{o(!0),d("");try{var e;let t=await s();h(!1),d(t.revealed?a("save.done",{path:t.path}):a("save.savedOnly",{path:t.path,note:null!=(e=t.note)?e:""}))}catch(e){h(!0),d(a("save.failed",{problem:e.message}))}finally{o(!1)}};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:"linkish",disabled:i,title:a("save.why"),onClick:()=>void m(),children:i?a("save.saving"):t}),c&&(0,n.jsx)("span",{className:u?"err small":"muted small",children:c})]})}function o(e){let{sessionId:t,taskId:s,attempt:i}=e,{t:o}=(0,r.kj)(),[c,d]=(0,l.useState)(!1),[u,h]=(0,l.useState)(""),[m,p]=(0,l.useState)(!1),f=async()=>{d(!0),h("");try{let e=await a.FH.downloadBundle([{sessionId:t,taskId:s,attempt:i}]);p(!1),h(o("reg.bundleSaved",{name:e}))}catch(e){p(!0),h(o("save.failed",{problem:e.message}))}finally{d(!1)}};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:"linkish",disabled:c,title:o("save.attemptRecordWhy"),onClick:()=>void f(),children:c?o("save.saving"):o("save.attemptRecord")}),u&&(0,n.jsx)("span",{className:m?"err small":"muted small",children:u})]})}},2876:(e,t,s)=>{s.d(t,{P:()=>d});var n=s(3365),l=s(1521),r=s(5549),a=s(867);function i(e,t){let[s,n]=(0,l.useState)(null),r=(0,l.useRef)(!0),[a,i]=(0,l.useState)(!0),o=(0,l.useCallback)(e=>n(e),[]);return(0,l.useLayoutEffect)(()=>{if(!s)return;let e=()=>{let e=s.scrollHeight-s.scrollTop-s.clientHeight<=24;r.current=e,i(e)};return s.addEventListener("scroll",e,{passive:!0}),()=>s.removeEventListener("scroll",e)},[s]),(0,l.useLayoutEffect)(()=>{s&&e&&r.current&&(s.scrollTop=s.scrollHeight)},[s,e,t]),{ref:o,following:a,follow:(0,l.useCallback)(()=>{r.current=!0,i(!0),s&&(s.scrollTop=s.scrollHeight)},[s])}}var o=s(5132);function c(e){let{text:t,follow:s}=e,{ref:l}=i(s,t);return(0,n.jsx)("pre",{ref:l,className:"story-out".concat(s?" terminal":""),children:t})}function d(e){let{sessionId:t,taskId:s,runId:d,live:u}=e,{t:h}=(0,a.kj)(),[m,p]=(0,l.useState)(null),[f,x]=(0,l.useState)(""),[v,y]=(0,l.useState)(!0),[g,j]=(0,l.useState)(!0),[k,b]=(0,l.useState)(new Set),[N,w]=(0,l.useState)(new Set),[S,C]=(0,l.useState)(new Set),D=!!(null==m?void 0:m.live),E=(0,l.useRef)(0);E.current+=1;let H=i(D,E.current),F=(0,l.useRef)(null),I=(0,l.useRef)(!1);if((0,l.useEffect)(()=>{if(!m)return;let e=[],t=(s,n)=>s.forEach((s,l)=>{let r="".concat(n).concat(l);"review"===s.kind?t(s.entries,"".concat(r,"-")):"step"!==s.kind||s.outcome||e.push(r)});t(m.entries,"e"),e.some(e=>!N.has(e))&&w(t=>new Set([...t,...e])),m.live&&!I.current&&F.current&&(I.current=!0,F.current.scrollIntoView({block:"nearest",behavior:"smooth"}))},[m,N]),(0,l.useEffect)(()=>{let e,n=!0,l=async()=>{try{let a=await r.FH.taskStory(t,s,d);if(!n)return;p(a),x(""),a.live&&(e=setTimeout(l,2e3))}catch(t){if(!n)return;x(t.message),u&&(e=setTimeout(l,2e3))}};return l(),()=>{n=!1,e&&clearTimeout(e)}},[t,s,d,u]),f&&!m)return(0,n.jsx)("div",{className:"err small",children:f});if(!m)return(0,n.jsx)("div",{className:"muted small",children:h("story.loading")});let L=e=>k.has(e)||N.has(e)&&!S.has(e),T=e=>{let t=L(e);b(s=>{let n=new Set(s);return t?n.delete(e):n.add(e),n}),C(s=>{let n=new Set(s);return t?n.add(e):n.delete(e),n})},B=(e,t)=>{if(!("review"===e.kind?v||g:"step"===e.kind?g:v))return null;if("review"===e.kind)return(0,n.jsxs)("li",{className:"story-review",children:[(0,n.jsx)("div",{className:"story-head",children:(0,n.jsx)("span",{className:"chip",children:h("story.review",{n:e.round})})}),(0,n.jsx)("ol",{className:"story",children:e.entries.map((e,s)=>B(e,"".concat(t,"-").concat(s)))})]},t);if("step"===e.kind){let s=L(t),l=!e.outcome&&m.live;return(0,n.jsxs)("li",{className:"story-step".concat(e.failed?" failed":""),children:[(0,n.jsxs)("div",{className:"story-head",children:[(0,n.jsx)("span",{className:"chip",children:h("story.step",{it:e.iteration,id:e.id})}),e.outcome&&(0,n.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,r.c5)(e.durationMs)):""]}),!e.outcome&&(0,n.jsx)("span",{className:"badge running",children:h("story.running")}),e.failed&&(0,n.jsx)("span",{className:"badge failed",children:h("story.failedHere")})]}),(0,n.jsx)("pre",{className:"story-cmd",children:e.command}),e.output&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:"linkish small",onClick:()=>T(t),children:s?h("story.hideOutput"):h("story.showOutput",{n:e.output.length})}),s&&(0,n.jsx)(c,{text:e.output,follow:l})]})]},t)}let s=k.has(t),l="sent"===e.kind?h("story.bot"):h("story.chat"),a="reply"===e.kind&&("blocked"===e.status||"failed"===e.status);return(0,n.jsxs)("li",{className:"story-msg ".concat(e.kind).concat(a?" failed":""),children:[(0,n.jsxs)("div",{className:"story-head",children:[(0,n.jsx)("strong",{children:l}),(0,n.jsx)("span",{className:"muted small",children:e.label}),"reply"===e.kind&&e.status&&(0,n.jsx)("span",{className:"badge ".concat(a?"failed":"done"===e.status?"done":""),children:e.status})]}),"reply"===e.kind&&e.notes&&(0,n.jsx)("p",{className:"story-notes",children:e.notes}),(0,n.jsx)("button",{type:"button",className:"linkish small",onClick:()=>T(t),children:s?h("story.hideText"):h("story.showText",{n:e.text.length})}),s&&(0,n.jsx)("pre",{className:"story-out",children:e.text})]},t)},R=m.close,A=R&&"done"!==R.status;return(0,n.jsxs)("div",{className:"story-box",ref:F,children:[(0,n.jsxs)("div",{className:"row small",style:{marginBottom:6},children:[(0,n.jsxs)("label",{className:"option-inline",children:[(0,n.jsx)("input",{type:"checkbox",checked:v,onChange:e=>y(e.target.checked)})," ",h("story.showChat")]}),(0,n.jsxs)("label",{className:"option-inline",children:[(0,n.jsx)("input",{type:"checkbox",checked:g,onChange:e=>j(e.target.checked)})," ",h("story.showCommands")]}),m.live&&(0,n.jsxs)("span",{className:"live",children:[(0,n.jsx)("span",{className:"dot","aria-hidden":"true"})," ",h("story.live")]}),m.live&&!H.following&&(0,n.jsx)("button",{type:"button",className:"quiet small",onClick:H.follow,title:h("story.followWhy"),children:h("story.follow")}),f&&(0,n.jsx)("span",{className:"err",children:f})]}),(0,n.jsxs)("div",{className:"story-fixed",children:[(0,n.jsx)("strong",{children:h("story.prompt")}),(0,n.jsx)("pre",{className:"story-out always",children:m.prompt})]}),(0,n.jsx)("div",{ref:H.ref,className:"story-scroll".concat(m.live?" live":""),children:(0,n.jsx)("ol",{className:"story",children:m.entries.map((e,t)=>B(e,"e".concat(t)))})}),R?(0,n.jsxs)("div",{className:"story-fixed close".concat(A?" failed":""),children:[(0,n.jsx)("strong",{children:A?h("story.endedBadly",{status:R.status}):h("story.ended")}),R.reason&&(0,n.jsx)("p",{className:"err small",children:R.reason}),R.summary&&(0,n.jsx)(o.s,{text:R.summary,className:"what"}),R.checks&&R.checks.length>0&&(0,n.jsx)("ul",{className:"small",style:{margin:"6px 0 0",paddingLeft:18},children:R.checks.map((e,t)=>(0,n.jsxs)("li",{className:e.passed?"":"err",children:[e.passed?"✓":"✗"," ",e.name,!e.passed&&e.detail?" — ".concat(e.detail):""]},t))})]}):(0,n.jsx)("div",{className:"story-fixed muted small",children:h("story.notEnded")})]})}},3041:(e,t,s)=>{s.d(t,{e:()=>i});var n=s(1521),l=s(5549),r=s(1035),a=s(867);function i(e){let{t}=(0,a.kj)(),[s,i]=(0,n.useState)(""),[o,c]=(0,n.useState)("");return{busy:s,message:o,clearMessage:()=>c(""),restore:(0,n.useCallback)(async s=>{i("restore"),c("");try{var n,a,o,d,u,h,m,p,f,x,v,y,g,j;let i=await l.FH.restorePreview(s.sessionId,s.taskId);if(!i.ok)return void c(t("restore.cannot",{problem:null!=(o=i.problem)?o:""}));let k={repo:i.repoDir,title:s.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,r.Z)(b))return;let N=await l.FH.restore(s.sessionId,s.taskId);if(!N.ok)return void c(t("restore.failed",{problem:null!=(m=N.problem)?m:""}));c((null!=(p=null==(n=N.leftBehind)?void 0:n.length)?p:0)>0?t("restore.done",{branch:null!=(f=N.branch)?f:"",commit:(null!=(x=N.commit)?x:"").slice(0,8),n:null!=(v=null==(a=N.leftBehind)?void 0:a.length)?v:0,kept:null!=(y=N.keptOn)?y:""}):t("restore.doneNothing",{branch:null!=(g=N.branch)?g:"",commit:(null!=(j=N.commit)?j:"").slice(0,8)})),e()}catch(e){c(e.message)}finally{i("")}},[t,e]),restartFrom:(0,n.useCallback)(async s=>{i("restart"),c("");try{var n,a;let i=await l.FH.restartPlan(s.sessionId,s.taskId);if(!i.ok)return void c(t("restart.cannot",{problem:null!=(n=i.problem)?n:""}));let o=i.restores.filter(e=>!e.ok);if(o.length>0)return void c(t("restart.cannot",{problem:o.map(e=>{var t;return"".concat(e.repoDir,": ").concat(null!=(t=e.problem)?t:"")}).join(" | ")}));let d=i.restores.map(e=>{var s,n,l;return t("restart.repoLine",{repo:e.repoDir,commit:(null!=(s=e.baseCommit)?s:"").slice(0,8),branch:null!=(n=e.branchName)?n:"",n:e.leftBehind.length,kept:null!=(l=e.keptOn)?l:""})}).join("\n"),u=i.tasks.map(e=>" ".concat(e.sessionName," / ").concat(e.title).concat(e.alreadyQueued?t("restart.alreadyQueued"):"")).join("\n"),h=t("restart.confirm",{title:i.from.title,tasks:i.tasks.length,sessions:i.sessions.length,list:u,repos:d||t("restart.noRepo"),mode:t("unattended"===i.mode?"run.unattended":"run.confirm")});if(!await (0,r.Z)(h))return;let m=await l.FH.restartFrom(s.sessionId,s.taskId);if(!m.started){c(t("restart.failed",{problem:null!=(a=m.reason)?a:""})),e();return}c(t("restart.started",{requeued:m.requeued,repos:m.restored.length})),e()}catch(e){c(e.message)}finally{i("")}},[t,e])}}},3374:(e,t,s)=>{s.d(t,{c:()=>l});var n=s(1521);function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,[s,l]=(0,n.useState)(()=>Date.now());return(0,n.useEffect)(()=>{if(!e)return;l(Date.now());let s=window.setInterval(()=>l(Date.now()),t);return()=>window.clearInterval(s)},[e,t]),s}},3523:(e,t,s)=>{function n(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now();if(!e)return;let n=Date.parse(e);if(Number.isNaN(n))return;let l=t?Date.parse(t):s;return Number.isNaN(l)?void 0:Math.max(0,l-n)}function l(e){return!!e.startedAt&&!e.finishedAt&&"queued"!==e.status}function r(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),n=t.some(e=>l(e)),r=t.map(e=>e.finishedAt?Date.parse(e.finishedAt):NaN).filter(e=>!Number.isNaN(e)),a=Date.parse(e.startedAt),i=n||0===r.length?s:Math.max(...r);return{ms:Number.isNaN(a)?0:Math.max(0,i-a),live:n,tasks:t.length}}function a(e){var t,s;let n=new Map;for(let s of e){if(!s.runGroup)continue;let e=null!=(t=n.get(s.runGroup.id))?t:{run:s.runGroup,tasks:[]};e.tasks.push(s),n.set(s.runGroup.id,e)}return null!=(s=[...n.values()].sort((e,t)=>Date.parse(t.run.startedAt)-Date.parse(e.run.startedAt))[0])?s:null}s.d(t,{DG:()=>l,d5:()=>n,eZ:()=>r,hH:()=>a})},4811:(e,t,s)=>{s.d(t,{p:()=>r});var n=s(1521),l=s(5549);function r(){let[e,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let e=!0;return l.FH.settings().then(s=>{var n;let l=null!=(n=s.raw.execution)?n:{};e&&t("unattended"===l.mode)}).catch(()=>void 0),()=>{e=!1}},[]),e}},5132:(e,t,s)=>{s.d(t,{s:()=>i});var n=s(3365),l=s(1521);function r(e,t){let s,l=[],r=/(`[^`\n]+`)|(\*\*[^*\n]+\*\*)|(\*[^*\n]+\*)/g,a=0,i=0;for(;null!==(s=r.exec(e));){s.index>a&&l.push(e.slice(a,s.index));let r=s[0],o="".concat(t,"-i").concat(i+=1);r.startsWith("`")?l.push((0,n.jsx)("code",{children:r.slice(1,-1)},o)):r.startsWith("**")?l.push((0,n.jsx)("strong",{children:r.slice(2,-2)},o)):l.push((0,n.jsx)("em",{children:r.slice(1,-1)},o)),a=s.index+r.length}return a<e.length&&l.push(e.slice(a)),l}function a(e){let t=/^\s*[-*•]\s+(.*)$/.exec(e);if(t)return t[1];let s=/^\s*\d+[.)]\s+(.*)$/.exec(e);return s?s[1]:null}function i(e){let{text:t,className:s}=e,i=[],o=t.replace(/\r\n/g,"\n").split("\n"),c=0,d=0;for(;c<o.length;){let e=o[c];if(e.trim().startsWith("```")){let e=[];for(c+=1;c<o.length&&!o[c].trim().startsWith("```");)e.push(o[c++]);c+=1,e.length>0&&i.push((0,n.jsx)("pre",{children:e.join("\n")},"b".concat(d+=1)));continue}if(null!==a(e)){let e=[];for(;c<o.length&&null!==a(o[c]);)e.push(a(o[c++]));i.push((0,n.jsx)("ul",{children:e.map((e,t)=>(0,n.jsx)("li",{children:r(e,"b".concat(d,"-").concat(t))},t))},"b".concat(d+=1)));continue}if(""===e.trim()){c+=1;continue}let t=[];for(;c<o.length&&""!==o[c].trim()&&null===a(o[c])&&!o[c].trim().startsWith("```");)t.push(o[c++]);let s=d+=1;i.push((0,n.jsx)("p",{children:t.map((e,t)=>(0,n.jsxs)(l.Fragment,{children:[t>0&&(0,n.jsx)("br",{}),r(e,"b".concat(s,"-").concat(t))]},t))},"b".concat(s)))}return(0,n.jsx)("div",{className:"rich ".concat(null!=s?s:""),children:i})}}}]);