copilot-operator 0.1.43 → 0.1.44

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 +54 -0
  2. package/dist/src/api/operator.service.js +86 -0
  3. package/dist/src/plan/systemGuide.js +138 -2
  4. package/dist/src/session/workspace.js +71 -0
  5. package/dist/web/404.html +2 -2
  6. package/dist/web/_next/static/chunks/549-1fe42544e4b72942.js +1 -0
  7. package/dist/web/_next/static/chunks/867-0f0f8c3bd37be31e.js +1 -0
  8. package/dist/web/_next/static/chunks/app/layout-12f138ee04d33c1e.js +1 -0
  9. package/dist/web/_next/static/chunks/app/page-09c6e2d42098f8d4.js +1 -0
  10. package/dist/web/_next/static/css/{72c85e4322c21223.css → eaec9cc6fe8aceb7.css} +1 -1
  11. package/dist/web/appearance.html +2 -2
  12. package/dist/web/appearance.txt +10 -10
  13. package/dist/web/defaults.html +2 -2
  14. package/dist/web/defaults.txt +10 -10
  15. package/dist/web/history.html +2 -2
  16. package/dist/web/history.txt +10 -10
  17. package/dist/web/import.html +2 -2
  18. package/dist/web/import.txt +10 -10
  19. package/dist/web/index.html +2 -2
  20. package/dist/web/index.txt +10 -10
  21. package/dist/web/level1.html +2 -2
  22. package/dist/web/level1.txt +10 -10
  23. package/dist/web/presets.html +2 -2
  24. package/dist/web/presets.txt +10 -10
  25. package/dist/web/sessions/view.html +2 -2
  26. package/dist/web/sessions/view.txt +10 -10
  27. package/dist/web/sessions.html +2 -2
  28. package/dist/web/sessions.txt +10 -10
  29. package/dist/web/system.html +2 -2
  30. package/dist/web/system.txt +10 -10
  31. package/package.json +3 -2
  32. package/dist/web/_next/static/chunks/549-2415dd26f4e53d07.js +0 -1
  33. package/dist/web/_next/static/chunks/867-aea30f560bc18eaf.js +0 -1
  34. package/dist/web/_next/static/chunks/app/layout-dc602b727480a653.js +0 -1
  35. package/dist/web/_next/static/chunks/app/page-d73a8ff300862cd8.js +0 -1
  36. /package/dist/web/_next/static/{WmzBz4QN36pcz4PL_cfEW → BX8Nw248DTY9xAfUu2pOH}/_buildManifest.js +0 -0
  37. /package/dist/web/_next/static/{WmzBz4QN36pcz4PL_cfEW → BX8Nw248DTY9xAfUu2pOH}/_ssgManifest.js +0 -0
@@ -524,6 +524,28 @@ let OperatorController = class OperatorController {
524
524
  resetContext(kind, lang) {
525
525
  return this.ops.resetContext(asContextKind(kind), lang ?? 'en');
526
526
  }
527
+ /** The project folder the workbench has open, its files on disk, and one of them. Read-only. */
528
+ workspace() {
529
+ return this.ops.workspace().catch(fail);
530
+ }
531
+ workspaceFiles() {
532
+ return this.ops.workspaceFiles().catch(fail);
533
+ }
534
+ workspaceFile(path) {
535
+ if (!path)
536
+ throw new BadRequestException('path is required');
537
+ return this.ops.workspaceFile(path).catch(fail);
538
+ }
539
+ /** The chat's conversations, newest first. */
540
+ chatThreads() {
541
+ return this.ops.chatThreads().catch(fail);
542
+ }
543
+ /** A message in the chat: a task of its conversation (made in the open folder if there is none), or a note while it works. */
544
+ chatSend(body = {}) {
545
+ if (typeof body?.text !== 'string' || !body.text.trim())
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);
548
+ }
527
549
  /** One folder of the session's repository at its branch (or the task's commit): read-only, for the workbench. */
528
550
  repoTree(id, path, task) {
529
551
  return this.ops.repoTree(id, path ?? '', task?.trim() || undefined).catch(fail);
@@ -1196,6 +1218,38 @@ __decorate([
1196
1218
  __metadata("design:paramtypes", [String, String]),
1197
1219
  __metadata("design:returntype", Promise)
1198
1220
  ], OperatorController.prototype, "resetContext", null);
1221
+ __decorate([
1222
+ Get('workspace'),
1223
+ __metadata("design:type", Function),
1224
+ __metadata("design:paramtypes", []),
1225
+ __metadata("design:returntype", Promise)
1226
+ ], OperatorController.prototype, "workspace", null);
1227
+ __decorate([
1228
+ Get('workspace/files'),
1229
+ __metadata("design:type", Function),
1230
+ __metadata("design:paramtypes", []),
1231
+ __metadata("design:returntype", Promise)
1232
+ ], OperatorController.prototype, "workspaceFiles", null);
1233
+ __decorate([
1234
+ Get('workspace/file'),
1235
+ __param(0, Query('path')),
1236
+ __metadata("design:type", Function),
1237
+ __metadata("design:paramtypes", [String]),
1238
+ __metadata("design:returntype", Promise)
1239
+ ], OperatorController.prototype, "workspaceFile", null);
1240
+ __decorate([
1241
+ Get('chat/threads'),
1242
+ __metadata("design:type", Function),
1243
+ __metadata("design:paramtypes", []),
1244
+ __metadata("design:returntype", Promise)
1245
+ ], OperatorController.prototype, "chatThreads", null);
1246
+ __decorate([
1247
+ Post('chat'),
1248
+ __param(0, Body()),
1249
+ __metadata("design:type", Function),
1250
+ __metadata("design:paramtypes", [Object]),
1251
+ __metadata("design:returntype", Promise)
1252
+ ], OperatorController.prototype, "chatSend", null);
1199
1253
  __decorate([
1200
1254
  Get('sessions/:id/repo/tree'),
1201
1255
  __param(0, Param('id')),
@@ -47,6 +47,7 @@ function sameFolder(a, b) {
47
47
  }
48
48
  import { composeLevel2, composePrompt, importPlan, personaBlock, plannedSessionSignature, taskSignature } from '../plan/importPlan.js';
49
49
  import { checkChanges, kerriganReport } from '../plan/changes.js';
50
+ import { workspaceFile, workspaceFiles, workspaceInfo } from '../session/workspace.js';
50
51
  import { readInterruption } from '../session/interruption.js';
51
52
  import { baseRefOf, branchAt, commitInterrupted, nextAttemptBranch, repoDirOf, trackedRepoOf, vcsPreflight, restorePoint, restorePreview, restoreToBase, revertTaskWork, undoThisPreview, sessionBranches, sessionBranchName } from '../vcs/taskVcs.js';
52
53
  import { branchExists, changedFilesBetween, commitsBetween, fileAt, freeBranchName, git, gitAvailable, localBranches, looksLikeRepo, plannedBranchName, repoUnusableReason } from '../vcs/git.js';
@@ -2239,6 +2240,91 @@ let OperatorService = class OperatorService {
2239
2240
  duplicates: check.duplicates,
2240
2241
  };
2241
2242
  }
2243
+ // --- the workspace and its chat (2026-10-17, "like Windsurf") ------------------------------
2244
+ /** The project folder the workbench has open: Settings → the default project. */
2245
+ async workspace() {
2246
+ await this.init();
2247
+ const cfg = await this.settings.load();
2248
+ return await workspaceInfo(cfg.project?.rootDir ?? '', cfg.project?.name ?? '');
2249
+ }
2250
+ async workspaceFiles() {
2251
+ const ws = await this.workspace();
2252
+ if (!ws.ok)
2253
+ throw new Error(ws.problem ?? 'No project folder is open.');
2254
+ return { dir: ws.dir, ...(await workspaceFiles(ws.dir)) };
2255
+ }
2256
+ async workspaceFile(path) {
2257
+ const ws = await this.workspace();
2258
+ if (!ws.ok)
2259
+ throw new Error(ws.problem ?? 'No project folder is open.');
2260
+ return await workspaceFile(ws.dir, path);
2261
+ }
2262
+ /** The chat's conversations, newest first. */
2263
+ async chatThreads() {
2264
+ await this.init();
2265
+ return (await this.store.listSessions())
2266
+ .filter((s) => s.kind === 'chat')
2267
+ .sort((a, b) => b.createdAt.localeCompare(a.createdAt))
2268
+ .map((s) => ({ id: s.id, name: s.name, createdAt: s.createdAt, status: s.status, turns: s.tasks.length, running: this.running.has(s.id), repoDir: s.vcs?.repoDir || s.projectDir }));
2269
+ }
2270
+ /**
2271
+ * A message written in the chat. With no conversation yet, one is made in the open project folder: a session of
2272
+ * kind `chat`, one branch for all of it, no independent review, plan mode off, so each message is answered as
2273
+ * it would be in an IDE's chat. The message becomes a task of it, queued; the caller starts it (the start window
2274
+ * the first time, where the work starts being asked once). While the conversation is working, the message is a
2275
+ * note to the task in flight, which the chat gets with its next report.
2276
+ */
2277
+ async chatSend(input) {
2278
+ await this.init();
2279
+ const text = (input.text ?? '').trim();
2280
+ if (!text)
2281
+ throw new Error('The message is empty.');
2282
+ if (text.length > MAX_INSTRUCTION_CHARS)
2283
+ throw new Error(`The message is ${text.length} characters; it can be at most ${MAX_INSTRUCTION_CHARS}.`);
2284
+ let session = input.threadId ? await this.store.getSession(input.threadId) : null;
2285
+ if (input.threadId && (!session || session.kind !== 'chat'))
2286
+ throw new Error('That conversation is not there any more. Start a new one.');
2287
+ if (session) {
2288
+ const inFlight = session.tasks.find((t) => t.status === 'running' || t.status === 'waiting-approval');
2289
+ if (inFlight && this.running.has(session.id)) {
2290
+ await this.addTaskNote(session.id, inFlight.id, text);
2291
+ return { threadId: session.id, taskId: inFlight.id, noted: true, needsStart: false };
2292
+ }
2293
+ }
2294
+ else {
2295
+ const ws = await this.workspace();
2296
+ if (!ws.ok)
2297
+ throw new Error(ws.problem ?? 'No project folder is open.');
2298
+ const title = text.split(/\r?\n/)[0].trim().slice(0, 60);
2299
+ const created = await this.store.createSession(`chat: ${title}`, ws.dir);
2300
+ session = await this.store.updateSession(created.id, (s) => {
2301
+ s.kind = 'chat';
2302
+ s.onFailure = 'continue';
2303
+ s.review = { enabled: false, model: '' };
2304
+ 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: '' };
2316
+ s.projectDir = ws.dir;
2317
+ });
2318
+ this.bus.publish({ sessionId: session.id, type: 'chat-started', level: 'info', message: `a conversation in ${ws.dir}` });
2319
+ }
2320
+ const task = await this.store.addTask(session.id, {
2321
+ title: text.split(/\r?\n/)[0].trim().slice(0, 80) || 'message',
2322
+ level2: '',
2323
+ prompt: text,
2324
+ });
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) };
2327
+ }
2242
2328
  // --- the repository, read-only, for the workbench (2026-10-14) ------------------------------
2243
2329
  /**
2244
2330
  * Where a session's work is in its repository: the session's branch in per-session mode, the task's own
@@ -845,6 +845,14 @@ export const SYSTEM_GUIDE = [
845
845
  doesEn: 'Opens the command palette (also Ctrl+K): any task, session, page or command, found by a few letters.',
846
846
  doesBg: 'Отваря палитрата с команди (и с Ctrl+K): всяка задача, сесия, страница или команда, по няколко букви.',
847
847
  },
848
+ {
849
+ key: 'wb.startChat',
850
+ kind: 'button',
851
+ en: 'Write in the chat',
852
+ bg: 'Пиши в чата',
853
+ doesEn: 'On the welcome: puts the keyboard in the chat on the right.',
854
+ doesBg: 'В поздрава: слага курсора в чата вдясно.',
855
+ },
848
856
  {
849
857
  key: 'wb.welcome',
850
858
  kind: 'note',
@@ -1163,6 +1171,14 @@ export const SYSTEM_GUIDE = [
1163
1171
  doesEn: 'The task\'s earlier attempts, with how each ended and whether it was undone.',
1164
1172
  doesBg: 'По-ранните опити на задачата, с това как е завършил всеки и дали е отменен.',
1165
1173
  },
1174
+ {
1175
+ key: 'wb.conversation',
1176
+ kind: 'disclosure',
1177
+ en: 'Its conversation',
1178
+ bg: 'Разговорът ѝ',
1179
+ doesEn: 'The task\'s exchange with Copilot: every message, reply and command with its output; open while it runs.',
1180
+ doesBg: 'Обменът на задачата с Copilot: всяко съобщение, отговор и команда с изхода ѝ; отворено, докато върви.',
1181
+ },
1166
1182
  ],
1167
1183
  },
1168
1184
  {
@@ -1198,8 +1214,8 @@ export const SYSTEM_GUIDE = [
1198
1214
  kind: 'tab',
1199
1215
  en: 'Chat',
1200
1216
  bg: 'Чат',
1201
- doesEn: 'The chosen task\'s conversation as it happens, and the box to write to it.',
1202
- doesBg: 'Разговорът на избраната задача, докато върви, и полето за писане до нея.',
1217
+ doesEn: 'The chat of the open project folder, as in an IDE: a message is sent to Copilot, the commands it answers with run in the folder and their output goes back, until it is done; shown as the conversation.',
1218
+ doesBg: 'Чатът на отворената папка, както в IDE: съобщението отива при Copilot, командите, с които отговаря, се изпълняват в папката и изходът им се връща, докато свърши; показва се като разговор.',
1203
1219
  },
1204
1220
  {
1205
1221
  key: 'wb.kerriganTab',
@@ -1209,6 +1225,126 @@ export const SYSTEM_GUIDE = [
1209
1225
  doesEn: 'Tell Kerrigan what happened and apply the changes she answers with.',
1210
1226
  doesBg: 'Кажи на Кериган какво се случи и приложи промените, с които отговори.',
1211
1227
  },
1228
+ {
1229
+ key: 'chat.thread',
1230
+ kind: 'select',
1231
+ en: 'Conversation',
1232
+ bg: 'Разговор',
1233
+ doesEn: 'Which conversation of the chat is shown: an earlier one, or "New conversation".',
1234
+ doesBg: 'Кой разговор на чата се показва: по-ранен или „Нов разговор“.',
1235
+ },
1236
+ {
1237
+ key: 'chat.newThread',
1238
+ kind: 'select',
1239
+ en: 'New conversation',
1240
+ bg: 'Нов разговор',
1241
+ doesEn: 'In that list: a new conversation, made by the next message.',
1242
+ doesBg: 'В този списък: нов разговор, който започва със следващото съобщение.',
1243
+ },
1244
+ {
1245
+ key: 'chat.newChat',
1246
+ kind: 'button',
1247
+ en: 'New conversation',
1248
+ bg: 'Нов разговор',
1249
+ doesEn: 'The + beside the list: starts a new conversation.',
1250
+ doesBg: 'Плюсът до списъка: започва нов разговор.',
1251
+ },
1252
+ {
1253
+ key: 'chat.welcome',
1254
+ kind: 'note',
1255
+ en: 'Ask for a change in {folder}',
1256
+ bg: 'Поискай промяна в {folder}',
1257
+ doesEn: 'With no conversation chosen: what the chat works on (the open folder and its branch) and a few messages to begin with.',
1258
+ doesBg: 'Когато няма избран разговор: върху какво работи чатът (отворената папка и клонът ѝ) и няколко съобщения за начало.',
1259
+ },
1260
+ {
1261
+ key: 'chat.openFolder',
1262
+ kind: 'button',
1263
+ en: 'Open a folder',
1264
+ bg: 'Отвори папка',
1265
+ doesEn: 'Opens the machine\'s folder dialog; the folder chosen becomes the project the chat and the Files view work on (Settings → project folder).',
1266
+ doesBg: 'Отваря прозореца за избор на папка; избраната става проектът, върху който работят чатът и изгледът „Файлове“ (Настройки → папка на проекта).',
1267
+ },
1268
+ {
1269
+ key: 'chat.input',
1270
+ kind: 'field',
1271
+ en: 'Message to the chat',
1272
+ bg: 'Съобщение до чата',
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
+ doesBg: 'Съобщението: какво да се промени или попита. Enter го изпраща, Shift+Enter започва нов ред; докато работи, написаното се добавя към това, което прави.',
1275
+ },
1276
+ {
1277
+ key: 'chat.mode',
1278
+ kind: 'select',
1279
+ en: 'How commands run',
1280
+ bg: 'Как се изпълняват командите',
1281
+ doesEn: 'Whether the commands the chat sends wait for you or run at once.',
1282
+ doesBg: 'Дали командите от чата чакат теб, или се изпълняват веднага.',
1283
+ },
1284
+ {
1285
+ key: 'chat.modeAsk',
1286
+ kind: 'select',
1287
+ en: 'Ask before each command',
1288
+ bg: 'Питай преди всяка команда',
1289
+ doesEn: 'Each command waits on a card in the conversation: Run, Run this and the rest, or Skip.',
1290
+ doesBg: 'Всяка команда чака на карта в разговора: Изпълни, Изпълни тази и останалите или Пропусни.',
1291
+ },
1292
+ {
1293
+ key: 'chat.modeAuto',
1294
+ kind: 'select',
1295
+ en: 'Run commands without asking',
1296
+ bg: 'Изпълнявай командите без питане',
1297
+ doesEn: 'Commands run at once, as in an unattended run; the list of forbidden commands still applies.',
1298
+ doesBg: 'Командите се изпълняват веднага, както при пускане без надзор; списъкът със забранени команди пак важи.',
1299
+ },
1300
+ {
1301
+ key: 'chat.send',
1302
+ kind: 'button',
1303
+ en: 'Send',
1304
+ 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: 'Изпраща съобщението: първото в разговора пита откъде да започне работата (прозорецът за начало), следващите продължават, където е.',
1307
+ },
1308
+ {
1309
+ key: 'chat.sendNote',
1310
+ kind: 'button',
1311
+ en: 'Add to it',
1312
+ bg: 'Добави',
1313
+ doesEn: 'While it works: adds the message to what it is doing; it gets it with its next report.',
1314
+ doesBg: 'Докато работи: добавя съобщението към това, което прави; получава го със следващия си отчет.',
1315
+ },
1316
+ {
1317
+ key: 'chat.stop',
1318
+ kind: 'button',
1319
+ en: 'Stop',
1320
+ bg: 'Спри',
1321
+ doesEn: 'While it works: stops it; the message in flight ends stopped and can be carried on.',
1322
+ doesBg: 'Докато работи: спира го; текущото съобщение завършва спряно и може да продължи.',
1323
+ },
1324
+ {
1325
+ key: 'chat.askRun',
1326
+ kind: 'button',
1327
+ en: 'Run',
1328
+ bg: 'Изпълни',
1329
+ doesEn: 'On a command waiting in the conversation: runs it.',
1330
+ doesBg: 'На команда, която чака в разговора: изпълнява я.',
1331
+ },
1332
+ {
1333
+ key: 'chat.askRunAll',
1334
+ kind: 'button',
1335
+ en: 'Run this and the rest',
1336
+ bg: 'Изпълни тази и останалите',
1337
+ doesEn: 'Runs it and stops asking for the rest of this message.',
1338
+ doesBg: 'Изпълнява я и спира да пита за останалото от това съобщение.',
1339
+ },
1340
+ {
1341
+ key: 'chat.askSkip',
1342
+ kind: 'button',
1343
+ en: 'Skip',
1344
+ bg: 'Пропусни',
1345
+ doesEn: 'Does not run it; the chat is told and goes on.',
1346
+ doesBg: 'Не я изпълнява; чатът научава и продължава.',
1347
+ },
1212
1348
  {
1213
1349
  key: 'wb.toggleChat',
1214
1350
  kind: 'button',
@@ -0,0 +1,71 @@
1
+ /**
2
+ * The workspace: the project folder the workbench has open (Settings → project folder), read as it is on disk —
3
+ * the working tree, not a commit — for the explorer and the editor, the way an IDE shows the folder it opened
4
+ * (operator's request, 2026-10-17: "like Windsurf"). Read-only: nothing here writes to the folder.
5
+ */
6
+ import { existsSync, statSync } from 'node:fs';
7
+ import { readdir, readFile, stat } from 'node:fs/promises';
8
+ import { basename, isAbsolute, join, relative, resolve, sep } from 'node:path';
9
+ import { git, looksLikeRepo, repoState } from '../vcs/git.js';
10
+ export async function workspaceInfo(dir, name = '') {
11
+ const d = dir.trim();
12
+ if (!d)
13
+ return { dir: '', name: '', ok: false, isRepo: false, problem: 'No project folder is open. Choose one with "Open a folder".' };
14
+ if (!existsSync(d) || !statSync(d).isDirectory())
15
+ return { dir: d, name: name || basename(d), ok: false, isRepo: false, problem: `The folder ${d} does not exist.` };
16
+ const isRepo = looksLikeRepo(d);
17
+ const state = isRepo ? await repoState(d) : null;
18
+ return { dir: d, name: name || basename(d), ok: true, isRepo, ...(state?.branch ? { branch: state.branch } : {}) };
19
+ }
20
+ /** Folders never worth listing: what a build or an install writes, and git's own. */
21
+ const SKIP = new Set(['.git', 'node_modules', '.next', '.next-export', 'dist', 'build', 'out', 'coverage', '.venv', 'venv', '__pycache__', 'bin', 'obj', '.vs', '.idea', '.copilot-operator']);
22
+ const MAX_FILES = 20_000;
23
+ /**
24
+ * Every file of the folder, as repository-relative paths with forward slashes. In a repository, git's own list —
25
+ * what it tracks and what it would add, ignored files left out — so the explorer shows the project and not what
26
+ * a build left; elsewhere a walk that skips the usual build folders.
27
+ */
28
+ export async function workspaceFiles(dir) {
29
+ if (looksLikeRepo(dir)) {
30
+ const r = await git(dir, ['ls-files', '--cached', '--others', '--exclude-standard', '-z'], 60_000);
31
+ if (r.ok) {
32
+ const all = [...new Set(r.stdout.split('\0').filter(Boolean))].filter((p) => existsSync(join(dir, p)));
33
+ return { files: all.slice(0, MAX_FILES).sort(), truncated: all.length > MAX_FILES };
34
+ }
35
+ }
36
+ const files = [];
37
+ const walk = async (rel) => {
38
+ if (files.length >= MAX_FILES)
39
+ return;
40
+ const entries = await readdir(join(dir, rel), { withFileTypes: true }).catch(() => []);
41
+ for (const e of entries) {
42
+ const p = rel ? `${rel}/${e.name}` : e.name;
43
+ if (e.isDirectory()) {
44
+ if (!SKIP.has(e.name))
45
+ await walk(p);
46
+ }
47
+ else if (e.isFile())
48
+ files.push(p);
49
+ if (files.length >= MAX_FILES)
50
+ return;
51
+ }
52
+ };
53
+ await walk('');
54
+ return { files: files.sort(), truncated: files.length >= MAX_FILES };
55
+ }
56
+ /** One file of the folder as it is on disk, as text; a binary or very large one is said to be one. */
57
+ export async function workspaceFile(dir, path, maxBytes = 2 * 1024 * 1024) {
58
+ const clean = path.replace(/\\/g, '/').replace(/^\/+/, '');
59
+ const full = resolve(dir, clean);
60
+ const rel = relative(resolve(dir), full);
61
+ if (!clean || isAbsolute(clean) || rel.startsWith('..') || rel.split(sep).includes('.git'))
62
+ throw new Error('That path is not inside the project folder.');
63
+ const st = await stat(full).catch(() => null);
64
+ if (!st?.isFile())
65
+ throw new Error(`There is no file ${clean} in the project folder.`);
66
+ if (st.size > maxBytes)
67
+ return { path: clean, text: null, binary: false, tooLarge: true, size: st.size };
68
+ const bytes = await readFile(full);
69
+ const binary = bytes.subarray(0, 8000).includes(0);
70
+ return { path: clean, text: binary ? null : bytes.toString('utf8').replace(/^/, ''), binary, tooLarge: false, size: st.size };
71
+ }
package/dist/web/404.html CHANGED
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html><!--WmzBz4QN36pcz4PL_cfEW--><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/72c85e4322c21223.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-aea30f560bc18eaf.js" async=""></script><script src="/_next/static/chunks/549-2415dd26f4e53d07.js" async=""></script><script src="/_next/static/chunks/499-751e0be9d4f86e2d.js" async=""></script><script src="/_next/static/chunks/app/layout-dc602b727480a653.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><!--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>
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-aea30f560bc18eaf.js\",\"549\",\"static/chunks/549-2415dd26f4e53d07.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-dc602b727480a653.js\"],\"AppearanceProvider\"]\n3:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-aea30f560bc18eaf.js\",\"549\",\"static/chunks/549-2415dd26f4e53d07.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-dc602b727480a653.js\"],\"LanguageProvider\"]\n4:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-aea30f560bc18eaf.js\",\"549\",\"static/chunks/549-2415dd26f4e53d07.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-dc602b727480a653.js\"],\"DialogHost\"]\n5:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-aea30f560bc18eaf.js\",\"549\",\"static/chunks/549-2415dd26f4e53d07.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-dc602b727480a653.js\"],\"SkipLink\"]\n6:I[966,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-aea30f560bc18eaf.js\",\"549\",\"static/chunks/549-2415dd26f4e53d07.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-dc602b727480a653.js\"],\"Shell\"]\n7:I[5204,[],\"\"]\n8:I[2642,[],\"\"]\n9:I[7712,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-aea30f560bc18eaf.js\",\"549\",\"static/chunks/549-2415dd26f4e53d07.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-dc602b727480a653.js\"],\"ScrollJump\"]\na:I[1701,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-aea30f560bc18eaf.js\",\"549\",\"static/chunks/549-2415dd26f4e53d07.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-dc602b727480a653.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/72c85e4322c21223.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"WmzBz4QN36pcz4PL_cfEW\",\"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/72c85e4322c21223.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-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>
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[549],{5549:(t,o,e)=>{e.d(o,{AV:()=>a,Dh:()=>h,FH:()=>m,FZ:()=>r,Zm:()=>u,aT:()=>s,c5:()=>f,dK:()=>l,nC:()=>n,rt:()=>d,ub:()=>i,zi:()=>y});let n="/api";function s(t,o){return"/sessions/view?id=".concat(encodeURIComponent(t)).concat(o?"#".concat(o):"")}let c="cop-api-token";function a(){try{let t=/(?:^#|&)token=([0-9a-f]{16,})/i.exec(window.location.hash);if(t)return window.localStorage.setItem(c,t[1]),window.history.replaceState(null,"",window.location.pathname+window.location.search),t[1];return window.localStorage.getItem(c)||""}catch(t){return""}}function i(t){let o=a();return o?"".concat(t).concat(t.includes("?")?"&":"?","token=").concat(encodeURIComponent(o)):t}let r=["exit-zero","exit-nonzero","output-contains","output-omits","output-matches","file-exists","file-missing","file-contains"];function d(t){return t.startsWith("exit-")||t.startsWith("output-")}function l(t){return"output-contains"===t||"output-omits"===t||"output-matches"===t||"file-contains"===t}function u(t){return"limit-reached"===t.status||"aborted"===t.status||!!t.limit&&("failed"===t.status||"blocked"===t.status)}function h(t){return("failed"===t.status||"blocked"===t.status)&&"contract-conflict"!==t.stopCode}async function p(t,o){let e,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=void 0===s.timeoutMs?3e4:s.timeoutMs;try{var i;e=await fetch("".concat(n).concat(t),{...o,...null!==c&&!(null==o?void 0:o.signal)?{signal:AbortSignal.timeout(c)}:{},headers:{"content-type":"application/json",...a()?{"x-cop-token":a()}:{},...null!=(i=null==o?void 0:o.headers)?i:{}}})}catch(o){if("TimeoutError"===o.name)throw Error("The API did not answer within ".concat(Math.round((null!=c?c:0)/1e3)," s (").concat(t.split("?")[0],"). It may be busy; try again."));throw o}if(!e.ok){let t="".concat(e.status," ").concat(e.statusText);try{let o=await e.json();(null==o?void 0:o.message)&&(t=Array.isArray(o.message)?o.message.join("; "):o.message)}catch(t){}throw Error(t)}let r=await e.text();return r?JSON.parse(r):void 0}let m={health:()=>p("/health"),doctor:()=>p("/doctor"),settings:()=>p("/settings"),saveSettings:t=>p("/settings",{method:"PUT",body:JSON.stringify(t)}),level1:()=>p("/level1"),setLevel1:t=>p("/level1",{method:"PUT",body:JSON.stringify({content:t})}),resetLevel1:()=>p("/level1",{method:"DELETE"}),presets:()=>p("/presets"),savePreset:(t,o)=>p("/presets/".concat(encodeURIComponent(t)),{method:"PUT",body:JSON.stringify({content:o})}),deletePreset:t=>p("/presets/".concat(encodeURIComponent(t)),{method:"DELETE"}),personas:()=>p("/personas"),savePersona:(t,o)=>p("/personas/".concat(encodeURIComponent(t)),{method:"PUT",body:JSON.stringify({content:o})}),deletePersona:t=>p("/personas/".concat(encodeURIComponent(t)),{method:"DELETE"}),sessions:()=>p("/sessions"),reorderSessions:t=>p("/sessions-order",{method:"PUT",body:JSON.stringify({ids:t})}),metrics:()=>p("/metrics"),preparePreview:function(t){let o=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return p("/repo/prepare/preview",{method:"POST",body:JSON.stringify({dir:t,fetch:o})},{timeoutMs:33e4})},prepareProject:function(t,o){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return p("/repo/prepare",{method:"POST",body:JSON.stringify({dir:t,fingerprint:o,...e})})},session:t=>p("/sessions/".concat(t)),createSession:(t,o)=>p("/sessions",{method:"POST",body:JSON.stringify({name:t,projectDir:o})}),updateSession:(t,o)=>p("/sessions/".concat(t),{method:"PUT",body:JSON.stringify(o)}),deleteSession:t=>p("/sessions/".concat(t),{method:"DELETE"}),addTask:(t,o)=>p("/sessions/".concat(t,"/tasks"),{method:"POST",body:JSON.stringify(o)}),updateTask:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o),{method:"PUT",body:JSON.stringify(e)}),deleteTask:(t,o)=>p("/sessions/".concat(t,"/tasks/").concat(o),{method:"DELETE"}),continueTask:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/continue"),{method:"POST",body:JSON.stringify((null==e?void 0:e.trim())?{instruction:e}:{})}),rerunTask:function(t,o){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return p("/sessions/".concat(t,"/tasks/").concat(o,"/rerun"),{method:"POST",body:JSON.stringify({...e,...n.buildOnFinished?{buildOnFinished:!0}:{}})})},taskChanges:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/changes").concat(e?"?run=".concat(encodeURIComponent(e)):"")),taskChangeFile:(t,o,e,n)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/changes/file?path=").concat(encodeURIComponent(e)).concat(n?"&run=".concat(encodeURIComponent(n)):"")),taskStory:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/story").concat(e?"?run=".concat(encodeURIComponent(e)):"")),taskFiles:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/files").concat(e?"?run=".concat(encodeURIComponent(e)):"")),taskLogUrl:(t,o,e)=>"".concat(n,"/sessions/").concat(t,"/tasks/").concat(o,"/log").concat(e?"?run=".concat(encodeURIComponent(e)):""),taskFileUrl:(t,o,e,s,c)=>"".concat(n,"/sessions/").concat(t,"/tasks/").concat(o,"/files/").concat(e,"/").concat(encodeURIComponent(s)).concat(c?"?run=".concat(encodeURIComponent(c)):""),saveTaskLog:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/log").concat(e?"?run=".concat(encodeURIComponent(e)):""),{method:"POST",body:"{}"}),saveTaskFile:(t,o,e,n,s)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/files/").concat(e,"/").concat(encodeURIComponent(n)).concat(s?"?run=".concat(encodeURIComponent(s)):""),{method:"POST",body:"{}"}),start:(t,o,e,n)=>p("/sessions/".concat(t,"/start"),{method:"POST",body:JSON.stringify({mode:o,name:e,starts:n})},{timeoutMs:12e4}),startOptions:t=>p("/start/options?sessions=".concat(encodeURIComponent(t.join(",")))),startFetch:(t,o,e)=>p("/start/fetch",{method:"POST",body:JSON.stringify({dir:t,remote:o,...e?{branches:e}:{}})},{timeoutMs:33e4}),startFailures:function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return p("/start/failures".concat(t?"?unanswered=1":""))},startFailureUrl:t=>i("".concat(n,"/start/failures/").concat(encodeURIComponent(t),"/report")),terminalUrl:()=>i("".concat(n,"/terminal")),stop:t=>p("/sessions/".concat(t,"/stop"),{method:"POST",body:"{}"}),approvals:t=>p("/approvals".concat(t?"?session=".concat(encodeURIComponent(t)):"")),undoPreview:(t,o)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/undo")),undoTask:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/undo"),{method:"POST",body:JSON.stringify({how:e})}),acceptTask:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/accept"),{method:"POST",body:JSON.stringify((null==e?void 0:e.trim())?{note:e}:{})}),addTaskNote:(t,o,e)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/notes"),{method:"POST",body:JSON.stringify({text:e})}),kerriganReport:t=>p("/kerrigan/report",{method:"POST",body:JSON.stringify(t)}),checkChanges:t=>p("/changes/check",{method:"POST",body:JSON.stringify({text:t})}),applyChanges:t=>p("/changes/apply",{method:"POST",body:JSON.stringify({text:t})}),workspace:()=>p("/workspace"),workspaceFiles:()=>p("/workspace/files"),workspaceFile:t=>p("/workspace/file?path=".concat(encodeURIComponent(t))),chatThreads:()=>p("/chat/threads"),chatSend:(t,o)=>p("/chat",{method:"POST",body:JSON.stringify({text:t,...o?{threadId:o}:{}})}),repoTree:function(t){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=arguments.length>2?arguments[2]:void 0;return p("/sessions/".concat(t,"/repo/tree?path=").concat(encodeURIComponent(o)).concat(e?"&task=".concat(encodeURIComponent(e)):""))},repoFile:(t,o,e)=>p("/sessions/".concat(t,"/repo/file?path=").concat(encodeURIComponent(o)).concat(e?"&task=".concat(encodeURIComponent(e)):"")),repoLog:t=>p("/sessions/".concat(t,"/repo/log")),sessionEvents:t=>p("/sessions/".concat(t,"/events")),decidePlan:(t,o,e)=>p("/approvals/".concat(t,"/plan"),{method:"POST",body:JSON.stringify({action:o,...(null==e?void 0:e.trim())?{note:e}:{}})}),decide:(t,o)=>p("/approvals/".concat(t),{method:"POST",body:JSON.stringify({action:o})}),setRunMode:(t,o)=>p("/sessions/".concat(t,"/mode"),{method:"POST",body:JSON.stringify({mode:o})}),streamUrl:t=>i("".concat(n,"/sessions/").concat(t,"/stream")),batch:()=>p("/batch").then(t=>null!=t?t:null),startBatch:(t,o,e,n,s,c,a,i)=>p("/batch/start",{method:"POST",body:JSON.stringify({sessionIds:t,mode:o,onFailure:e,model:n,reviewModel:s,name:c,taskIds:a,starts:i})},{timeoutMs:12e4}),suggestedRunName:t=>p("/batch/name?sessions=".concat(encodeURIComponent(t.join(",")))),stopBatch:()=>p("/batch/stop",{method:"POST",body:"{}"}),pauseBatch:()=>p("/batch/pause",{method:"POST",body:"{}"}),resumeBatch:()=>p("/batch/resume",{method:"POST",body:"{}"}),planBrief:t=>p("/plan/brief?lang=".concat(encodeURIComponent(t))),context:(t,o)=>p("/context/".concat(t,"?lang=").concat(encodeURIComponent(o))),setContext:(t,o)=>p("/context/".concat(t),{method:"PUT",body:JSON.stringify({content:o})}),resetContext:(t,o)=>p("/context/".concat(t,"?lang=").concat(encodeURIComponent(o)),{method:"DELETE"}),checkPlan:t=>p("/plan/check",{method:"POST",body:JSON.stringify({text:t})}),importPlan:t=>p("/plan/import",{method:"POST",body:JSON.stringify({text:t})}),browseFolder:t=>p("/browse-folder",{method:"POST",body:JSON.stringify({start:t})},{timeoutMs:null}),tasks:()=>p("/tasks"),activity:()=>p("/activity"),downloadBundle:async t=>{var o,e,s;let c=await fetch("".concat(n,"/export/bundle"),{method:"POST",headers:{"content-type":"application/json",...a()?{"x-cop-token":a()}:{}},body:JSON.stringify({tasks:t})});if(!c.ok)throw Error(await c.text()||"".concat(c.status," ").concat(c.statusText));let i=null!=(s=c.headers.get("content-disposition"))?s:"",r=null==(o=/filename\*=UTF-8''([^;]+)/i.exec(i))?void 0:o[1],d=null==(e=/filename="([^"]+)"/i.exec(i))?void 0:e[1],l=null!=d?d:"copilot-operator-bundle.json";if(r)try{l=decodeURIComponent(r)}catch(t){}let u=URL.createObjectURL(await c.blob()),h=document.createElement("a");return h.href=u,h.download=l,document.body.appendChild(h),h.click(),h.remove(),setTimeout(()=>URL.revokeObjectURL(u),1e4),l},exportUrl:(t,o)=>{let e=new URLSearchParams;return o.run&&e.set("run",o.run),o.session&&e.set("session",o.session),o.task&&e.set("task",o.task),i("".concat(n,"/export/").concat(t,"?").concat(e.toString()))},debugExportUrl:t=>i("".concat(n,"/debug/export").concat(t.length>0?"?sessions=".concat(encodeURIComponent(t.join(","))):"")),vcsStatus:t=>p("/sessions/".concat(t,"/vcs")),runVcs:t=>p("/batch/vcs?ids=".concat(encodeURIComponent(t.join(",")))),runVcsPrepare:function(t,o,e){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return p("/batch/vcs/prepare",{method:"POST",body:JSON.stringify({sessionIds:t,repoDir:o,action:e,choices:n})})},vcsSnapshot:(t,o)=>p("/sessions/".concat(t,"/vcs/snapshot"),{method:"POST",body:JSON.stringify({choices:o})}),restorePreview:(t,o)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/restore")),restore:(t,o)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/restore"),{method:"POST",body:"{}"}),contractCheck:(t,o)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/contract")),applyContractFix:(t,o,e,n)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/contract-fix"),{method:"POST",body:JSON.stringify({choices:e,expect:n})}),restartPlan:(t,o)=>p("/sessions/".concat(t,"/tasks/").concat(o,"/restart")),restartFrom:function(t,o){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return p("/sessions/".concat(t,"/tasks/").concat(o,"/restart"),{method:"POST",body:JSON.stringify(e)})},repoCheck:t=>p("/repo?dir=".concat(encodeURIComponent(t))),project:()=>p("/project"),setProject:t=>p("/project",{method:"PUT",body:JSON.stringify(t)}),models:()=>p("/models"),setDefaultModel:t=>p("/models/default",{method:"PUT",body:JSON.stringify({model:t})}),setDefaultReviewModel:t=>p("/models/review-default",{method:"PUT",body:JSON.stringify({model:t})}),refreshModels:()=>p("/models/refresh",{method:"POST",body:"{}"},{timeoutMs:null}),login:t=>p("/login",{method:"POST",body:JSON.stringify({account:(null==t?void 0:t.trim())||void 0})},{timeoutMs:null})};function y(t){return t<1024?"".concat(t," B"):t<1048576?"".concat((t/1024).toFixed(1)," KB"):"".concat((t/1048576).toFixed(1)," MB")}function f(t){if(void 0===t)return"";let o=Math.round(t/1e3);if(o<60)return"".concat(o,"s");let e=Math.floor(o/60);return e<60?"".concat(e,"m ").concat(o%60,"s"):"".concat(Math.floor(e/60),"h ").concat(e%60,"m")}}}]);