copilot-operator 0.1.44 → 0.1.45

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 (37) hide show
  1. package/dist/src/api/operator.controller.js +24 -1
  2. package/dist/src/api/operator.service.js +73 -14
  3. package/dist/src/config/schema.js +18 -0
  4. package/dist/src/orchestrator/taskRunner.js +50 -2
  5. package/dist/src/plan/systemGuide.js +26 -2
  6. package/dist/src/session/checkpoint.js +91 -0
  7. package/dist/src/session/store.js +2 -0
  8. package/dist/web/404.html +2 -2
  9. package/dist/web/_next/static/chunks/{549-1fe42544e4b72942.js → 549-13aab16a40600608.js} +1 -1
  10. package/dist/web/_next/static/chunks/867-88233b4570638286.js +1 -0
  11. package/dist/web/_next/static/chunks/app/page-b51630404f5eba03.js +1 -0
  12. package/dist/web/_next/static/css/{eaec9cc6fe8aceb7.css → 70ceb261074b139c.css} +1 -1
  13. package/dist/web/appearance.html +2 -2
  14. package/dist/web/appearance.txt +10 -10
  15. package/dist/web/defaults.html +2 -2
  16. package/dist/web/defaults.txt +10 -10
  17. package/dist/web/history.html +2 -2
  18. package/dist/web/history.txt +10 -10
  19. package/dist/web/import.html +2 -2
  20. package/dist/web/import.txt +10 -10
  21. package/dist/web/index.html +2 -2
  22. package/dist/web/index.txt +10 -10
  23. package/dist/web/level1.html +2 -2
  24. package/dist/web/level1.txt +10 -10
  25. package/dist/web/presets.html +2 -2
  26. package/dist/web/presets.txt +10 -10
  27. package/dist/web/sessions/view.html +2 -2
  28. package/dist/web/sessions/view.txt +10 -10
  29. package/dist/web/sessions.html +2 -2
  30. package/dist/web/sessions.txt +10 -10
  31. package/dist/web/system.html +2 -2
  32. package/dist/web/system.txt +10 -10
  33. package/package.json +1 -1
  34. package/dist/web/_next/static/chunks/867-0f0f8c3bd37be31e.js +0 -1
  35. package/dist/web/_next/static/chunks/app/page-09c6e2d42098f8d4.js +0 -1
  36. /package/dist/web/_next/static/{BX8Nw248DTY9xAfUu2pOH → L6g_c8hW3p_AUNzreQ3Sj}/_buildManifest.js +0 -0
  37. /package/dist/web/_next/static/{BX8Nw248DTY9xAfUu2pOH → L6g_c8hW3p_AUNzreQ3Sj}/_ssgManifest.js +0 -0
@@ -544,7 +544,22 @@ let OperatorController = class OperatorController {
544
544
  chatSend(body = {}) {
545
545
  if (typeof body?.text !== 'string' || !body.text.trim())
546
546
  throw new BadRequestException('text is required');
547
- return this.ops.chatSend({ text: body.text, ...(typeof body.threadId === 'string' && body.threadId ? { threadId: body.threadId } : {}) }).catch(fail);
547
+ return this.ops
548
+ .chatSend({
549
+ text: body.text,
550
+ ...(typeof body.threadId === 'string' && body.threadId ? { threadId: body.threadId } : {}),
551
+ ...(typeof body.model === 'string' && body.model.trim() ? { model: body.model } : {}),
552
+ })
553
+ .catch(fail);
554
+ }
555
+ /** Back to before a message: the folder as it was then, that message and the ones after it taken out. */
556
+ async chatRewind(id, body = {}) {
557
+ if (typeof body?.taskId !== 'string' || !body.taskId)
558
+ throw new BadRequestException('taskId is required');
559
+ const r = await this.ops.chatRewind(id, body.taskId).catch(fail);
560
+ if (!r.ok)
561
+ throw new BadRequestException(r.problem);
562
+ return r;
548
563
  }
549
564
  /** One folder of the session's repository at its branch (or the task's commit): read-only, for the workbench. */
550
565
  repoTree(id, path, task) {
@@ -1250,6 +1265,14 @@ __decorate([
1250
1265
  __metadata("design:paramtypes", [Object]),
1251
1266
  __metadata("design:returntype", Promise)
1252
1267
  ], OperatorController.prototype, "chatSend", null);
1268
+ __decorate([
1269
+ Post('chat/:id/rewind'),
1270
+ __param(0, Param('id')),
1271
+ __param(1, Body()),
1272
+ __metadata("design:type", Function),
1273
+ __metadata("design:paramtypes", [String, Object]),
1274
+ __metadata("design:returntype", Promise)
1275
+ ], OperatorController.prototype, "chatRewind", null);
1253
1276
  __decorate([
1254
1277
  Get('sessions/:id/repo/tree'),
1255
1278
  __param(0, Param('id')),
@@ -48,6 +48,7 @@ function sameFolder(a, b) {
48
48
  import { composeLevel2, composePrompt, importPlan, personaBlock, plannedSessionSignature, taskSignature } from '../plan/importPlan.js';
49
49
  import { checkChanges, kerriganReport } from '../plan/changes.js';
50
50
  import { workspaceFile, workspaceFiles, workspaceInfo } from '../session/workspace.js';
51
+ import { restoreCheckpoint } from '../session/checkpoint.js';
51
52
  import { readInterruption } from '../session/interruption.js';
52
53
  import { baseRefOf, branchAt, commitInterrupted, nextAttemptBranch, repoDirOf, trackedRepoOf, vcsPreflight, restorePoint, restorePreview, restoreToBase, revertTaskWork, undoThisPreview, sessionBranches, sessionBranchName } from '../vcs/taskVcs.js';
53
54
  import { branchExists, changedFilesBetween, commitsBetween, fileAt, freeBranchName, git, gitAvailable, localBranches, looksLikeRepo, plannedBranchName, repoUnusableReason } from '../vcs/git.js';
@@ -81,6 +82,7 @@ import { resolveDesktopDir, desktopIsSynced } from '../context/desktopDir.js';
81
82
  import { saveAndReveal } from './saveToDesktop.js';
82
83
  import { settingsOf, SettingsUnusableError } from './settings.js';
83
84
  import { PolicyLockUnusableError } from '../config/lockedPolicy.js';
85
+ import { chatDenyPatterns } from '../config/schema.js';
84
86
  /** Why a session set aside on the Sessions page does not run: one sentence for every start that refuses it. */
85
87
  /** The id of the task a change names by id, number or title; see `plan/changes.ts`. */
86
88
  function checkTaskRef(session, ref) {
@@ -1301,7 +1303,9 @@ let OperatorService = class OperatorService {
1301
1303
  const queuedIds = queuedToRun(session, onlyTasks).map((t) => t.id);
1302
1304
  if (queuedIds.length === 0)
1303
1305
  return { started: false, reason: 'no queued tasks', done: Promise.resolve(idle) };
1304
- const cfg = await this.settings.load();
1306
+ const loaded = await this.settings.load();
1307
+ // A chat conversation's git is the operator's: switching branches and committing are allowed there (2026-10-17).
1308
+ const cfg = session.kind === 'chat' ? { ...loaded, execution: { ...loaded.execution, denyPatterns: chatDenyPatterns(loaded.execution.denyPatterns) } } : loaded;
1305
1309
  const policy = {
1306
1310
  mode,
1307
1311
  denyPatterns: cfg.execution.denyPatterns,
@@ -2302,18 +2306,18 @@ let OperatorService = class OperatorService {
2302
2306
  s.onFailure = 'continue';
2303
2307
  s.review = { enabled: false, model: '' };
2304
2308
  s.planMode = 'off';
2305
- s.vcs = ws.isRepo
2306
- ? {
2307
- ...(s.vcs ?? DEFAULT_VCS),
2308
- enabled: true,
2309
- repoDir: ws.dir,
2310
- branchMode: 'per-session',
2311
- // The operator's own uncommitted work is normal in an open folder: taken along as the conversation's
2312
- // starting snapshot, once they approve it, rather than refusing the first message.
2313
- dirtyWorktree: { policy: 'snapshot' },
2314
- }
2315
- : { ...(s.vcs ?? DEFAULT_VCS), enabled: false, repoDir: '' };
2309
+ /*
2310
+ * No version control of the bot's own (2026-10-17): no branch, no commit, no question about where the work
2311
+ * starts. The chat works on the branch the folder is on, with what is in it, as an IDE's chat does; each
2312
+ * message is photographed before it runs instead, so the operator can go back to before it.
2313
+ */
2314
+ s.vcs = { ...(s.vcs ?? DEFAULT_VCS), enabled: false, repoDir: '' };
2316
2315
  s.projectDir = ws.dir;
2316
+ // The model chosen in the chat for this conversation: the operator's word, which outranks Settings.
2317
+ if (input.model?.trim()) {
2318
+ s.model = input.model.trim();
2319
+ s.modelSource = 'operator';
2320
+ }
2317
2321
  });
2318
2322
  this.bus.publish({ sessionId: session.id, type: 'chat-started', level: 'info', message: `a conversation in ${ws.dir}` });
2319
2323
  }
@@ -2322,8 +2326,63 @@ let OperatorService = class OperatorService {
2322
2326
  level2: '',
2323
2327
  prompt: text,
2324
2328
  });
2325
- const fresh = (await this.store.getSession(session.id));
2326
- return { threadId: fresh.id, taskId: task.id, needsStart: !fresh.vcsStart && !fresh.tasks.some((t) => t.startedAt) };
2329
+ // After going back, the conversation is told with this message: it still holds what was undone.
2330
+ const pending = (await this.store.getSession(session.id))?.rewindNote;
2331
+ if (pending) {
2332
+ await this.store.addTaskNote(session.id, task.id, pending);
2333
+ await this.store.updateSession(session.id, (s) => {
2334
+ s.rewindNote = undefined;
2335
+ });
2336
+ }
2337
+ return { threadId: session.id, taskId: task.id, needsStart: false };
2338
+ }
2339
+ /**
2340
+ * Back to before a message of the chat (2026-10-17): the folder put back exactly as it was just before that
2341
+ * message ran — branch, commit, uncommitted changes — and that message and every one after it taken out of the
2342
+ * conversation, because they did not happen. They stay on the record (`Session.rewound`), and the folder as it
2343
+ * was before going back is kept as a safety photograph. The Copilot conversation still holds them, so its next
2344
+ * message says what was undone. See `session/checkpoint.ts`.
2345
+ */
2346
+ async chatRewind(threadId, taskId) {
2347
+ await this.init();
2348
+ const session = await this.store.getSession(threadId);
2349
+ if (!session || session.kind !== 'chat')
2350
+ return { ok: false, problem: 'That conversation is not there any more.' };
2351
+ if (this.running.has(threadId) || session.status !== 'idle')
2352
+ return { ok: false, problem: 'The conversation is working. Stop it first, then go back.' };
2353
+ const at = session.tasks.findIndex((t) => t.id === taskId);
2354
+ if (at < 0)
2355
+ return { ok: false, problem: 'That message is not in the conversation.' };
2356
+ const task = session.tasks[at];
2357
+ // A message that never ran changed nothing: it is only taken out, with the ones after it.
2358
+ const firstRan = session.tasks.slice(at).find((t) => t.checkpoint);
2359
+ const dir = session.projectDir?.trim() || '';
2360
+ let safety;
2361
+ if (firstRan?.checkpoint) {
2362
+ const other = await this.runningIn(dir);
2363
+ if (other)
2364
+ return { ok: false, problem: `Session "${other.name}" is running in this folder. Stop it first.` };
2365
+ const done = await restoreCheckpoint(dir, firstRan.checkpoint);
2366
+ if (!done.ok)
2367
+ return { ok: false, problem: done.problem };
2368
+ safety = done.safety;
2369
+ }
2370
+ const removed = session.tasks.slice(at);
2371
+ const titles = removed.map((t) => `"${t.title}"`).join(', ');
2372
+ await this.store.updateSession(threadId, (s) => {
2373
+ s.tasks = s.tasks.slice(0, at);
2374
+ s.rewound = [...(s.rewound ?? []), { at: new Date().toISOString(), toBefore: taskId, safety: safety ?? '', tasks: removed }];
2375
+ s.rewindNote =
2376
+ `The operator went back to before the message "${task.title}": the folder is again exactly as it was then` +
2377
+ `${firstRan?.checkpoint ? ` (on ${firstRan.checkpoint.branch || 'commit ' + firstRan.checkpoint.head.slice(0, 8)})` : ''}, and that message and the ` +
2378
+ `${removed.length > 1 ? `${removed.length - 1} after it were` : 'ones after it were'} undone (${titles}). Forget what was done for them; ` +
2379
+ 'work from the folder as it is now.';
2380
+ });
2381
+ const message = `went back to before "${task.title}": ${removed.length} message(s) taken out${safety ? `, the folder as it was is kept as ${safety.slice(0, 8)}` : ''}`;
2382
+ const cfg = await this.settings.load();
2383
+ await appendSessionLog(cfg.resolved.runsDir, threadId, { type: 'chat-rewind', message, data: { taskId, removed: removed.map((t) => t.id), safety } }).catch(() => undefined);
2384
+ this.bus.publish({ sessionId: threadId, type: 'chat-rewind', level: 'info', message, data: { taskId, removed: removed.length, safety } });
2385
+ return { ok: true, message, text: task.prompt, ...(safety ? { safety } : {}) };
2327
2386
  }
2328
2387
  // --- the repository, read-only, for the workbench (2026-10-14) ------------------------------
2329
2388
  /**
@@ -70,6 +70,24 @@ const GIT_SOMETIMES_WRITES = 'remote\\s+(?:add|remove|rm|rename|set-url|set-head
70
70
  'config\\s+(?:set|unset|rename-section|remove-section|edit)\\b|' +
71
71
  'reflog\\s+(?:delete|expire)|' +
72
72
  'notes\\s+(?:add|append|edit|remove|copy|prune)';
73
+ /** The two default patterns that refuse git writes, as they stand in `execution.denyPatterns`. */
74
+ export const GIT_WRITE_DENY = [
75
+ `\\bgit\\s+(?:${GIT_GLOBAL_OPTION}\\s+)*(?:${GIT_ALWAYS_WRITES})(?![\\w-])`,
76
+ `\\bgit\\s+(?:${GIT_GLOBAL_OPTION}\\s+)*(?:${GIT_SOMETIMES_WRITES})`,
77
+ ];
78
+ /**
79
+ * In the workbench's chat the git is the operator's (2026-10-17: "the program works on the branch I left; I may
80
+ * ask the bot to change it"): switching or making a branch, committing, staging, stashing, pulling and merging
81
+ * are theirs to ask for. Still refused there: what reaches the remote, rewrites history or throws work away —
82
+ * push, reset, rebase, clean, history filters, low-level ref and object surgery — and the settings ones.
83
+ */
84
+ const GIT_CHAT_WRITES = 'push|reset|rebase|clean|filter-branch|filter-repo|update-ref|update-index|gc|prune|repack|worktree|' +
85
+ 'submodule|init|clone|checkout-index|commit-tree|read-tree|prune-packed|update-server-info';
86
+ export function chatDenyPatterns(patterns) {
87
+ const [always] = GIT_WRITE_DENY;
88
+ // Only the default pattern is narrowed: a list the operator wrote themselves is kept as they wrote it.
89
+ return patterns.map((p) => (p === always ? `\\bgit\\s+(?:${GIT_GLOBAL_OPTION}\\s+)*(?:${GIT_CHAT_WRITES})(?![\\w-])` : p));
90
+ }
73
91
  export const RunConfigSchema = z.object({
74
92
  copilot: z
75
93
  .object({
@@ -40,13 +40,14 @@ import { writeReport } from '../exec/reportFile.js';
40
40
  import { Pacer } from '../util/pacing.js';
41
41
  import { RunLog } from '../log/runLog.js';
42
42
  import { composeOpening, operatorNotesSection, readOnlyNote } from '../session/compose.js';
43
+ import { takeAfter, takeCheckpoint } from '../session/checkpoint.js';
43
44
  import { MIN_TRIED_APPROACHES } from '../protocol/replySchema.js';
44
45
  import { enforceScope, scopeMessage, scopeNote } from '../vcs/scope.js';
45
46
  import { PLAN_FIRST, PLAN_NOT_NOW, PLAN_NUDGE_AFTER, describePlan, planApprovedMessage, planFrom, planModeNote, planNudge, planReviseMessage } from './planMode.js';
46
47
  import { composeHandoff } from '../session/handoff.js';
47
48
  import { ProgressWatch } from './progress.js';
48
49
  import { contractConflicts, readsTreeClean } from './contract.js';
49
- import { treeFingerprint } from '../vcs/git.js';
50
+ import { commitFiles, treeFingerprint } from '../vcs/git.js';
50
51
  import { isContinuable } from '../session/model.js';
51
52
  import { prepareForTask, commitTaskResult, commitShortfall, repoDirOf, trackedRepoOf, whereLeft } from '../vcs/taskVcs.js';
52
53
  import { protectInputs, inputsMessage, inputsAtCommit, untrackedInputs, blobOfFile } from '../vcs/inputs.js';
@@ -651,6 +652,19 @@ async function withOperatorHand(transport, wanted, first, hooks, sessionId, bus,
651
652
  }
652
653
  return { result, goOnAsItIs: false };
653
654
  }
655
+ /**
656
+ * What a chat message is told about the folder (2026-10-17): it works on the operator's own branch, nothing is
657
+ * committed for it, and git is the operator's to ask for — unlike a task of the bot's sessions, where the runner
658
+ * owns the repository.
659
+ */
660
+ const CHAT_NOTE = [
661
+ '## Working in the operator\'s folder',
662
+ '',
663
+ 'This is the operator\'s chat in their own folder, on the branch it is on. Nothing is branched or committed for',
664
+ 'you, and the rule against git commands that change something does not hold here: when the operator asks, you',
665
+ 'may switch or create a branch, stage, commit, stash, pull or merge. Never push, reset, rebase or clean, and',
666
+ 'never rewrite history; the runner refuses those. The operator can put the folder back to before any message.',
667
+ ].join('\n');
654
668
  /** Runs one task to completion inside an already-open transport. */
655
669
  /** The approved plan a task works to: its own attempt's, else, for a continuation, the latest one before it. */
656
670
  function approvedPlanOf(task) {
@@ -889,11 +903,28 @@ export async function runTask(transport, session, task, deps) {
889
903
  }
890
904
  return check;
891
905
  };
906
+ /** A chat message's checkpoint and folder (2026-10-17), set where the task starts; read by `finish`. */
907
+ let chatCheckpoint = session.kind === 'chat' ? task.checkpoint : undefined;
908
+ const chatDir = session.kind === 'chat' ? session.projectDir?.trim() ?? '' : '';
892
909
  const finish = async (status, reason, summary, finalReply) => {
893
910
  // How it ended as reported; the runner's own checks below can still change it, and the final word is written at the end.
894
911
  await record(`ENDING: ${status.toUpperCase()}`, [summary ?? '', reason ? `Reason: ${reason}` : ''].filter(Boolean).join('\n\n') || '(no details)');
895
912
  // The net under the plan's own checks: whatever the task left running is stopped and named.
896
913
  await reap(processesBefore, 'the task');
914
+ /*
915
+ * A chat message: the folder photographed again after it, on top of its checkpoint, so what it changed is
916
+ * one commit's worth of files, shown under the message and in the changes view. Nothing is committed on the
917
+ * operator's branch.
918
+ */
919
+ if (chatCheckpoint && chatDir) {
920
+ const after = await takeAfter(chatDir, task.id, chatCheckpoint).catch((e) => ({ problem: e.message }));
921
+ if (!('problem' in after)) {
922
+ const files = await commitFiles(chatDir, after.commit).catch(() => []);
923
+ await setTask((t) => {
924
+ t.vcs = { baseCommit: chatCheckpoint.commit, commit: after.commit, files };
925
+ });
926
+ }
927
+ }
897
928
  /*
898
929
  * The operator's input files, once more before the commit: put back what the last round changed,
899
930
  * so it is not committed as the task's work. One that cannot be put back fails a done task. See
@@ -1139,6 +1170,23 @@ export async function runTask(transport, session, task, deps) {
1139
1170
  t.reviewChecks = reviewChecks;
1140
1171
  });
1141
1172
  sink.event('task-started', { runId, title: task.title }, `task "${task.title}" starting (run ${runId})`);
1173
+ /*
1174
+ * A chat message: the folder photographed before it first runs, so the operator can go back to before it
1175
+ * (2026-10-17). Kept from the first attempt: a message carried on goes back to where it began.
1176
+ */
1177
+ if (session.kind === 'chat' && !chatCheckpoint && chatDir) {
1178
+ const cp = await takeCheckpoint(chatDir, task.id).catch((e) => ({ problem: e.message }));
1179
+ if ('problem' in cp) {
1180
+ sink.event('chat-checkpoint-missing', { problem: cp.problem }, `no way back to before this message: ${cp.problem}`, 'warn');
1181
+ }
1182
+ else {
1183
+ chatCheckpoint = cp;
1184
+ await setTask((t) => {
1185
+ t.checkpoint = cp;
1186
+ });
1187
+ sink.event('chat-checkpoint', { commit: cp.commit, branch: cp.branch, head: cp.head }, `the folder before this message is kept as ${cp.commit.slice(0, 8)} (on ${cp.branch || cp.head.slice(0, 8)})`);
1188
+ }
1189
+ }
1142
1190
  {
1143
1191
  const sel = (await store.getSession(session.id))?.modelSelection;
1144
1192
  if (sel) {
@@ -1416,7 +1464,7 @@ export async function runTask(transport, session, task, deps) {
1416
1464
  // The operator's new prompt goes out whether or not the attempt it follows reached a conversation.
1417
1465
  ...(task.continuing?.instruction ? { instruction: { text: task.continuing.instruction, fromAttempt: task.continuing.fromAttempt, ended: task.continuing.ended } } : {}),
1418
1466
  workDirNote: workingDirNote(work),
1419
- vcsNote: prepared.note,
1467
+ vcsNote: session.kind === 'chat' ? CHAT_NOTE : prepared.note,
1420
1468
  // What is said about a commit is true only where one happens (live run 2026-10-03: promised with commits off).
1421
1469
  readOnlyNote: task.readOnly ? readOnlyNote(!!(session.vcs?.enabled && session.vcs.commitOnFinish !== false && trackedRepoOf(session)), artifactPatterns(session.vcs)) : undefined,
1422
1470
  scopeNote: [
@@ -1273,6 +1273,30 @@ export const SYSTEM_GUIDE = [
1273
1273
  doesEn: 'The message: what to change or ask. Enter sends it, Shift+Enter starts a new line; while it works, what is written is added to what it is doing.',
1274
1274
  doesBg: 'Съобщението: какво да се промени или попита. Enter го изпраща, Shift+Enter започва нов ред; докато работи, написаното се добавя към това, което прави.',
1275
1275
  },
1276
+ {
1277
+ key: 'chat.model',
1278
+ kind: 'select',
1279
+ en: 'Model',
1280
+ bg: 'Модел',
1281
+ doesEn: 'The model of this conversation (or of the next one): "As in Settings" or one the chat\'s picker offered when last read; it is chosen in Copilot when the next message runs.',
1282
+ doesBg: 'Моделът на този разговор (или на следващия): „Както е в Настройки“ или някой, предложен от избора в чата при последното четене; избира се в Copilot, когато тръгне следващото съобщение.',
1283
+ },
1284
+ {
1285
+ key: 'chat.readModels',
1286
+ kind: 'button',
1287
+ en: 'Read the latest models from Copilot',
1288
+ bg: 'Прочети последните модели от Copilot',
1289
+ doesEn: 'The ↻ beside the model: reads the models Copilot\'s own picker offers now (the browser opens for a moment; not while a conversation works).',
1290
+ doesBg: '↻ до модела: прочита моделите, които изборът в Copilot предлага сега (браузърът се отваря за момент; не и докато разговор работи).',
1291
+ },
1292
+ {
1293
+ key: 'chat.rewind',
1294
+ kind: 'button',
1295
+ en: 'Go back to before this message',
1296
+ bg: 'Върни отпреди това съобщение',
1297
+ doesEn: 'The ↶ beside a message of yours: puts the folder back exactly as it was before that message — branch, files, uncommitted changes — and takes it and the messages after it out of the conversation; the folder as it was is kept in a safety copy, and the message goes back in the box.',
1298
+ doesBg: '↶ до твое съобщение: връща папката точно както беше преди него — клон, файлове, некомитнати промени — и маха него и следващите от разговора; папката, както е била, се пази като резервно копие, а съобщението се връща в полето.',
1299
+ },
1276
1300
  {
1277
1301
  key: 'chat.mode',
1278
1302
  kind: 'select',
@@ -1302,8 +1326,8 @@ export const SYSTEM_GUIDE = [
1302
1326
  kind: 'button',
1303
1327
  en: 'Send',
1304
1328
  bg: 'Изпрати',
1305
- doesEn: 'Sends the message: the first one of a conversation asks where the work starts (the start window), later ones go on where it is.',
1306
- doesBg: 'Изпраща съобщението: първото в разговора пита откъде да започне работата (прозорецът за начало), следващите продължават, където е.',
1329
+ doesEn: 'Sends the message and starts it on the branch the folder is on; nothing is asked about branches.',
1330
+ doesBg: 'Изпраща съобщението и го пуска на клона, на който е папката; нищо не се пита за клонове.',
1307
1331
  },
1308
1332
  {
1309
1333
  key: 'chat.sendNote',
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Checkpoints of the workbench's chat (operator's request, 2026-10-17): "before any message, I can put the code
3
+ * back as it was then — and the messages after it go, because they did not happen. The branch is mine: the bot
4
+ * works on the one I left checked out."
5
+ *
6
+ * So a chat conversation neither branches nor commits. Before each message the folder is photographed — the branch
7
+ * and commit it is on, and the working tree as it stands, untracked files included and ignored ones not — into a
8
+ * commit that no branch points at, kept under `refs/copilot-operator/checkpoints/`; after the message, once more,
9
+ * so what the message changed can be shown file by file. Going back puts the folder exactly as the photograph
10
+ * shows it: the branch checked out, at its commit, with the same uncommitted changes. That rewrites the working
11
+ * tree and can move the branch back, so before it the folder as it is is photographed too, under
12
+ * `refs/copilot-operator/safety/`: nothing that going back removes is lost, it is one `git checkout` away. These
13
+ * are the only places the runner's git overwrites anything (see the rules in `vcs/git.ts`).
14
+ */
15
+ import { mkdtemp, rm } from 'node:fs/promises';
16
+ import { tmpdir } from 'node:os';
17
+ import { join } from 'node:path';
18
+ import { git, looksLikeRepo } from '../vcs/git.js';
19
+ const AUTHOR = ['-c', 'user.name=copilot-operator', '-c', 'user.email=copilot-operator@localhost'];
20
+ /**
21
+ * The working tree as a commit, without touching the index, HEAD or any branch: a scratch index is filled from
22
+ * HEAD and then from the folder (`add -A`, which honours .gitignore), written as a tree, and committed on top of
23
+ * HEAD under `ref`.
24
+ */
25
+ async function photograph(dir, ref, message, parent) {
26
+ if (!looksLikeRepo(dir))
27
+ return { problem: 'The open folder is not a git repository, so there is no way back to a message: run "git init" there first.' };
28
+ const head = await git(dir, ['rev-parse', '--verify', '--quiet', 'HEAD^{commit}']);
29
+ if (!head.ok || !head.stdout)
30
+ return { problem: 'The repository has no commit yet, so there is nothing to go back to: make a first commit.' };
31
+ const branch = await git(dir, ['symbolic-ref', '--quiet', '--short', 'HEAD']);
32
+ const scratch = await mkdtemp(join(tmpdir(), 'cop-checkpoint-'));
33
+ const env = { ...process.env, GIT_INDEX_FILE: join(scratch, 'index') };
34
+ try {
35
+ const read = await git(dir, ['read-tree', 'HEAD'], 60_000, env);
36
+ if (!read.ok)
37
+ return { problem: `git could not read the commit: ${read.stderr}` };
38
+ const add = await git(dir, ['add', '-A'], 120_000, env);
39
+ if (!add.ok)
40
+ return { problem: `git could not read the folder: ${add.stderr}` };
41
+ const tree = await git(dir, ['write-tree'], 60_000, env);
42
+ if (!tree.ok)
43
+ return { problem: `git could not record the folder: ${tree.stderr}` };
44
+ const commit = await git(dir, [...AUTHOR, 'commit-tree', tree.stdout, '-p', parent ?? head.stdout, '-m', message]);
45
+ if (!commit.ok)
46
+ return { problem: `git could not record the folder: ${commit.stderr}` };
47
+ const kept = await git(dir, ['update-ref', ref, commit.stdout]);
48
+ if (!kept.ok)
49
+ return { problem: `git could not keep the record: ${kept.stderr}` };
50
+ return { commit: commit.stdout, head: head.stdout, branch: branch.ok ? branch.stdout : '' };
51
+ }
52
+ finally {
53
+ await rm(scratch, { recursive: true, force: true }).catch(() => undefined);
54
+ }
55
+ }
56
+ /** Before a message: the folder as it is, kept under the message's id. */
57
+ export async function takeCheckpoint(dir, id) {
58
+ const r = await photograph(dir, `refs/copilot-operator/checkpoints/${id}`, `checkpoint before message ${id}`);
59
+ return 'problem' in r ? r : { ...r, at: new Date().toISOString() };
60
+ }
61
+ /** After a message: the folder again, on top of its checkpoint, so the commit holds exactly what the message changed. */
62
+ export async function takeAfter(dir, id, before) {
63
+ const r = await photograph(dir, `refs/copilot-operator/after/${id}`, `after message ${id}`, before.commit);
64
+ return 'problem' in r ? r : { commit: r.commit };
65
+ }
66
+ /**
67
+ * Puts the folder back as `cp` photographed it: its branch checked out at its commit, its working tree with the
68
+ * same uncommitted changes. The folder as it is now is photographed first, under `refs/copilot-operator/safety/`.
69
+ */
70
+ export async function restoreCheckpoint(dir, cp) {
71
+ const stamp = new Date().toISOString().replace(/[-:.TZ]/g, '').slice(0, 17);
72
+ const safety = await photograph(dir, `refs/copilot-operator/safety/${stamp}`, `the folder before going back to ${cp.commit.slice(0, 8)}`);
73
+ if ('problem' in safety)
74
+ return { ok: false, problem: safety.problem };
75
+ const step = async (args, what) => {
76
+ const r = await git(dir, args, 120_000);
77
+ return r.ok ? null : `${what}: ${(r.stderr || r.stdout).split('\n')[0]}. Nothing is lost: the folder as it was is kept as ${safety.commit.slice(0, 8)}.`;
78
+ };
79
+ const problem =
80
+ // On the branch it was on (or at its commit, when it was on none), whatever was checked out since.
81
+ (cp.branch
82
+ ? await step(['checkout', '--force', cp.branch], `${cp.branch} could not be checked out`)
83
+ : await step(['checkout', '--force', '--detach', cp.head], `${cp.head.slice(0, 8)} could not be checked out`)) ??
84
+ // At the commit it was on: a commit made after it, by the chat or by hand, is undone here (kept in the safety record).
85
+ (cp.branch ? await step(['reset', '--hard', cp.head], `${cp.branch} could not be put back at ${cp.head.slice(0, 8)}`) : null) ??
86
+ // Files made since that git does not track go; ignored ones (builds, installs) stay.
87
+ (await step(['clean', '-f', '-d'], 'the files made since could not be removed')) ??
88
+ // And the uncommitted changes as they were, untracked files included.
89
+ (await step(['restore', '--source', cp.commit, '--worktree', '--', '.'], 'the files could not be put back'));
90
+ return problem ? { ok: false, problem } : { ok: true, safety: safety.commit };
91
+ }
@@ -111,6 +111,8 @@ export const TASK_FIELD_ON_RERUN = {
111
111
  accepted: 'archived',
112
112
  // Every note stays with the task; the ones not sent yet go out with the next attempt's opening.
113
113
  notes: 'kept',
114
+ // The folder before the message first ran: the point "go back" returns to, whatever attempt came after.
115
+ checkpoint: 'kept',
114
116
  interruption: 'cleared',
115
117
  finalReply: 'cleared',
116
118
  firstMessage: 'cleared',
package/dist/web/404.html CHANGED
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html><!--BX8Nw248DTY9xAfUu2pOH--><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/eaec9cc6fe8aceb7.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-0f0f8c3bd37be31e.js" async=""></script><script src="/_next/static/chunks/549-1fe42544e4b72942.js" async=""></script><script src="/_next/static/chunks/499-751e0be9d4f86e2d.js" async=""></script><script src="/_next/static/chunks/app/layout-12f138ee04d33c1e.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><!--L6g_c8hW3p_AUNzreQ3Sj--><html lang="en" data-theme="light" data-textsize="normal" data-contrast="normal" data-motion="normal" data-links="plain" data-focus="normal"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/70ceb261074b139c.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js"/><script src="/_next/static/chunks/c7879cf7-b5ab1053c1d9a2e7.js" async=""></script><script src="/_next/static/chunks/131-bae98f790a541679.js" async=""></script><script src="/_next/static/chunks/main-app-e3a5f713ba31557e.js" async=""></script><script src="/_next/static/chunks/197-f7c33a0114fc3db3.js" async=""></script><script src="/_next/static/chunks/867-88233b4570638286.js" async=""></script><script src="/_next/static/chunks/549-13aab16a40600608.js" async=""></script><script src="/_next/static/chunks/499-751e0be9d4f86e2d.js" async=""></script><script src="/_next/static/chunks/app/layout-12f138ee04d33c1e.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>copilot-operator</title><meta name="description" content="Runs task loops with Microsoft 365 Copilot on this machine."/><script>
2
2
  (function () {
3
3
  try {
4
4
  var d = document.documentElement;
@@ -13,4 +13,4 @@
13
13
  d.dataset.focus = a.strongFocus ? 'strong' : 'normal';
14
14
  } catch (e) {}
15
15
  })();
16
- </script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><a class="skip-link" href="#main">Skip to the content</a><div class="wrap"><header class="top"><h1><a href="/">copilot-operator</a></h1><nav aria-label="Main"><a href="/"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M3 4h18v16H3zM9 4v16M3 15h6" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Workbench</span></a><a href="/sessions"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v4H4zM4 11h16v4H4zM4 17h10v2H4z"></path></svg><span>Sessions</span></a><a href="/defaults"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm8.5 4 1.5 1-1.6 2.8-1.8-.4a7 7 0 0 1-1.5 1.5l.4 1.8L14.7 21l-1-1.5a7 7 0 0 1-3.4 0l-1 1.5-2.8-1.6.4-1.8A7 7 0 0 1 5.4 16l-1.8.4L2 13.6 3.5 12.6V11.4L2 10.4l1.6-2.8 1.8.4A7 7 0 0 1 6.9 6.5l-.4-1.8L9.3 3l1 1.5a7 7 0 0 1 3.4 0l1-1.5 2.8 1.6-.4 1.8a7 7 0 0 1 1.5 1.5l1.8-.4L22 10.4l-1.5 1z"></path></svg><span>Settings</span></a><a href="/import"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3v10m0 0 4-4m-4 4-4-4M4 15v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Plan from JSON</span></a><a href="/history"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 1 0 8.5 6M12 7v5l3 2M3 4v5h5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Task register</span></a><a href="/level1"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M6 3h9l5 5v13H6zM14 3v6h6M9 13h7M9 17h7" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 1 prompt</span></a><a href="/presets"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M5 4h14v4H5zM5 10h14v4H5zM5 16h9v4H5z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 2 presets</span></a><a href="/appearance"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 0 0 0 18c1.5 0 2-1 2-2s-1-1.5-1-2.5S14 15 15.5 15H17a4 4 0 0 0 4-4 8 8 0 0 0-9-8zM8 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"></path></svg><span>Appearance</span></a><a href="/system"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v10H4zM2 19h20M9 15v4M15 15v4" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>System</span></a><select aria-label="Language" style="width:auto"><option value="en" selected="">English</option><option value="bg">Български</option></select></nav></header><main id="main"><div style="font-family:system-ui,&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[8078,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0f0f8c3bd37be31e.js\",\"549\",\"static/chunks/549-1fe42544e4b72942.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"AppearanceProvider\"]\n3:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0f0f8c3bd37be31e.js\",\"549\",\"static/chunks/549-1fe42544e4b72942.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"LanguageProvider\"]\n4:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0f0f8c3bd37be31e.js\",\"549\",\"static/chunks/549-1fe42544e4b72942.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"DialogHost\"]\n5:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0f0f8c3bd37be31e.js\",\"549\",\"static/chunks/549-1fe42544e4b72942.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"SkipLink\"]\n6:I[966,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0f0f8c3bd37be31e.js\",\"549\",\"static/chunks/549-1fe42544e4b72942.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"Shell\"]\n7:I[5204,[],\"\"]\n8:I[2642,[],\"\"]\n9:I[7712,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0f0f8c3bd37be31e.js\",\"549\",\"static/chunks/549-1fe42544e4b72942.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"ScrollJump\"]\na:I[1701,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0f0f8c3bd37be31e.js\",\"549\",\"static/chunks/549-1fe42544e4b72942.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"StartDialogHost\"]\nb:I[433,[],\"OutletBoundary\"]\nd:I[9884,[],\"AsyncMetadataOutlet\"]\nf:I[433,[],\"ViewportBoundary\"]\n11:I[433,[],\"MetadataBoundary\"]\n12:\"$Sreact.suspense\"\n14"])</script><script>self.__next_f.push([1,":I[3536,[],\"\"]\n:HL[\"/_next/static/css/eaec9cc6fe8aceb7.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"BX8Nw248DTY9xAfUu2pOH\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/eaec9cc6fe8aceb7.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"data-theme\":\"light\",\"data-textsize\":\"normal\",\"data-contrast\":\"normal\",\"data-motion\":\"normal\",\"data-links\":\"plain\",\"data-focus\":\"normal\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n(function () {\\n try {\\n var d = document.documentElement;\\n var raw = localStorage.getItem('cop.appearance');\\n var a = raw ? JSON.parse(raw) : {};\\n if (!a || typeof a !== 'object') a = {};\\n d.dataset.theme = a.theme === 'dark' ? 'dark' : 'light';\\n d.dataset.textsize = [\\\"small\\\",\\\"normal\\\",\\\"large\\\",\\\"huge\\\",\\\"giant\\\"].indexOf(a.textSize) \u003e= 0 ? a.textSize : 'normal';\\n d.dataset.contrast = a.highContrast ? 'high' : 'normal';\\n d.dataset.motion = a.reduceMotion ? 'reduced' : 'normal';\\n d.dataset.links = a.underlineLinks ? 'underline' : 'plain';\\n d.dataset.focus = a.strongFocus ? 'strong' : 'normal';\\n } catch (e) {}\\n})();\\n\"}}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"children\":[[\"$\",\"$L5\",null,{}],[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L7\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L8\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}],[\"$\",\"$L9\",null,{}],[\"$\",\"$La\",null,{}]]}]}]}]}]]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L7\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L8\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$Lb\",null,{\"children\":[\"$Lc\",[\"$\",\"$Ld\",null,{\"promise\":\"$@e\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$Lf\",null,{\"children\":\"$L10\"}],null],[\"$\",\"$L11\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$12\",null,{\"fallback\":null,\"children\":\"$L13\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$14\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"10:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\nc:null\n"])</script><script>self.__next_f.push([1,"e:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"copilot-operator\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Runs task loops with Microsoft 365 Copilot on this machine.\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"13:\"$e:metadata\"\n"])</script></body></html>
16
+ </script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><a class="skip-link" href="#main">Skip to the content</a><div class="wrap"><header class="top"><h1><a href="/">copilot-operator</a></h1><nav aria-label="Main"><a href="/"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M3 4h18v16H3zM9 4v16M3 15h6" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Workbench</span></a><a href="/sessions"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v4H4zM4 11h16v4H4zM4 17h10v2H4z"></path></svg><span>Sessions</span></a><a href="/defaults"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm8.5 4 1.5 1-1.6 2.8-1.8-.4a7 7 0 0 1-1.5 1.5l.4 1.8L14.7 21l-1-1.5a7 7 0 0 1-3.4 0l-1 1.5-2.8-1.6.4-1.8A7 7 0 0 1 5.4 16l-1.8.4L2 13.6 3.5 12.6V11.4L2 10.4l1.6-2.8 1.8.4A7 7 0 0 1 6.9 6.5l-.4-1.8L9.3 3l1 1.5a7 7 0 0 1 3.4 0l1-1.5 2.8 1.6-.4 1.8a7 7 0 0 1 1.5 1.5l1.8-.4L22 10.4l-1.5 1z"></path></svg><span>Settings</span></a><a href="/import"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3v10m0 0 4-4m-4 4-4-4M4 15v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Plan from JSON</span></a><a href="/history"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 1 0 8.5 6M12 7v5l3 2M3 4v5h5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Task register</span></a><a href="/level1"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M6 3h9l5 5v13H6zM14 3v6h6M9 13h7M9 17h7" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 1 prompt</span></a><a href="/presets"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M5 4h14v4H5zM5 10h14v4H5zM5 16h9v4H5z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 2 presets</span></a><a href="/appearance"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 0 0 0 18c1.5 0 2-1 2-2s-1-1.5-1-2.5S14 15 15.5 15H17a4 4 0 0 0 4-4 8 8 0 0 0-9-8zM8 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"></path></svg><span>Appearance</span></a><a href="/system"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v10H4zM2 19h20M9 15v4M15 15v4" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>System</span></a><select aria-label="Language" style="width:auto"><option value="en" selected="">English</option><option value="bg">Български</option></select></nav></header><main id="main"><div style="font-family:system-ui,&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[8078,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-88233b4570638286.js\",\"549\",\"static/chunks/549-13aab16a40600608.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"AppearanceProvider\"]\n3:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-88233b4570638286.js\",\"549\",\"static/chunks/549-13aab16a40600608.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"LanguageProvider\"]\n4:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-88233b4570638286.js\",\"549\",\"static/chunks/549-13aab16a40600608.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"DialogHost\"]\n5:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-88233b4570638286.js\",\"549\",\"static/chunks/549-13aab16a40600608.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"SkipLink\"]\n6:I[966,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-88233b4570638286.js\",\"549\",\"static/chunks/549-13aab16a40600608.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"Shell\"]\n7:I[5204,[],\"\"]\n8:I[2642,[],\"\"]\n9:I[7712,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-88233b4570638286.js\",\"549\",\"static/chunks/549-13aab16a40600608.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"ScrollJump\"]\na:I[1701,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-88233b4570638286.js\",\"549\",\"static/chunks/549-13aab16a40600608.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-12f138ee04d33c1e.js\"],\"StartDialogHost\"]\nb:I[433,[],\"OutletBoundary\"]\nd:I[9884,[],\"AsyncMetadataOutlet\"]\nf:I[433,[],\"ViewportBoundary\"]\n11:I[433,[],\"MetadataBoundary\"]\n12:\"$Sreact.suspense\"\n14"])</script><script>self.__next_f.push([1,":I[3536,[],\"\"]\n:HL[\"/_next/static/css/70ceb261074b139c.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"L6g_c8hW3p_AUNzreQ3Sj\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/70ceb261074b139c.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"data-theme\":\"light\",\"data-textsize\":\"normal\",\"data-contrast\":\"normal\",\"data-motion\":\"normal\",\"data-links\":\"plain\",\"data-focus\":\"normal\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n(function () {\\n try {\\n var d = document.documentElement;\\n var raw = localStorage.getItem('cop.appearance');\\n var a = raw ? JSON.parse(raw) : {};\\n if (!a || typeof a !== 'object') a = {};\\n d.dataset.theme = a.theme === 'dark' ? 'dark' : 'light';\\n d.dataset.textsize = [\\\"small\\\",\\\"normal\\\",\\\"large\\\",\\\"huge\\\",\\\"giant\\\"].indexOf(a.textSize) \u003e= 0 ? a.textSize : 'normal';\\n d.dataset.contrast = a.highContrast ? 'high' : 'normal';\\n d.dataset.motion = a.reduceMotion ? 'reduced' : 'normal';\\n d.dataset.links = a.underlineLinks ? 'underline' : 'plain';\\n d.dataset.focus = a.strongFocus ? 'strong' : 'normal';\\n } catch (e) {}\\n})();\\n\"}}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"children\":[[\"$\",\"$L5\",null,{}],[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L7\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L8\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}],[\"$\",\"$L9\",null,{}],[\"$\",\"$La\",null,{}]]}]}]}]}]]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L7\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L8\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$Lb\",null,{\"children\":[\"$Lc\",[\"$\",\"$Ld\",null,{\"promise\":\"$@e\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$Lf\",null,{\"children\":\"$L10\"}],null],[\"$\",\"$L11\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$12\",null,{\"fallback\":null,\"children\":\"$L13\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$14\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"10:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\nc:null\n"])</script><script>self.__next_f.push([1,"e:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"copilot-operator\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Runs task loops with Microsoft 365 Copilot on this machine.\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"13:\"$e:metadata\"\n"])</script></body></html>