copilot-operator 0.1.47 → 0.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/api/operator.controller.js +62 -0
- package/dist/src/api/operator.service.js +39 -0
- package/dist/src/plan/systemGuide.js +96 -16
- package/dist/src/session/taskExchange.js +230 -0
- package/dist/src/session/workspaceGit.js +212 -0
- package/dist/src/transport/chatSession.js +28 -4
- package/dist/web/404.html +2 -2
- package/dist/web/_next/static/chunks/534-56c68930a1a3c10f.js +1 -0
- package/dist/web/_next/static/chunks/549-c32dd718a1809d4d.js +1 -0
- package/dist/web/_next/static/chunks/867-0e5d0d5472bf185f.js +1 -0
- package/dist/web/_next/static/chunks/app/history/page-95bab4c1b1ff9339.js +1 -0
- package/dist/web/_next/static/chunks/app/layout-a1314921eeba8ad5.js +1 -0
- package/dist/web/_next/static/chunks/app/page-4d8f0851fe672925.js +1 -0
- package/dist/web/_next/static/chunks/app/sessions/view/{page-835d3533fdc63082.js → page-adb64f8ba3d8c06e.js} +1 -1
- package/dist/web/_next/static/css/{70ceb261074b139c.css → 4335e4ce269ba1ea.css} +1 -1
- package/dist/web/appearance.html +2 -2
- package/dist/web/appearance.txt +10 -10
- package/dist/web/defaults.html +2 -2
- package/dist/web/defaults.txt +10 -10
- package/dist/web/history.html +2 -2
- package/dist/web/history.txt +10 -10
- package/dist/web/import.html +2 -2
- package/dist/web/import.txt +10 -10
- package/dist/web/index.html +2 -2
- package/dist/web/index.txt +10 -10
- package/dist/web/level1.html +2 -2
- package/dist/web/level1.txt +10 -10
- package/dist/web/presets.html +2 -2
- package/dist/web/presets.txt +10 -10
- package/dist/web/sessions/view.html +2 -2
- package/dist/web/sessions/view.txt +10 -10
- package/dist/web/sessions.html +2 -2
- package/dist/web/sessions.txt +10 -10
- package/dist/web/system.html +2 -2
- package/dist/web/system.txt +10 -10
- package/package.json +3 -2
- package/dist/web/_next/static/chunks/549-8732dd2c1339bc5d.js +0 -1
- package/dist/web/_next/static/chunks/867-7fb52be342fa64e5.js +0 -1
- package/dist/web/_next/static/chunks/897-5a34109533c3da50.js +0 -1
- package/dist/web/_next/static/chunks/app/history/page-0bb537407fed5944.js +0 -1
- package/dist/web/_next/static/chunks/app/layout-485ce9395cb17998.js +0 -1
- package/dist/web/_next/static/chunks/app/page-ed6a5a2ff1b6285e.js +0 -1
- /package/dist/web/_next/static/{HT6yqFoDPOXChAZVDxshC → z74_FBfnnXW5IJCHTgTH2}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{HT6yqFoDPOXChAZVDxshC → z74_FBfnnXW5IJCHTgTH2}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The open project folder's git, as an IDE's Source Control view shows it (operator's request, 2026-10-19: "see
|
|
3
|
+
* which files changed and how — the diff; let the Commits button show Git as VS Code does"):
|
|
4
|
+
*
|
|
5
|
+
* - the changes: what is staged (the index against HEAD) and what is not (the working tree against the index), the
|
|
6
|
+
* files git does not track yet among them, each with its letter and its lines added and removed;
|
|
7
|
+
* - the history of the branch, newest first, and for a commit the files it changed;
|
|
8
|
+
* - for any of those files, its two versions, for the side-by-side view.
|
|
9
|
+
*
|
|
10
|
+
* Read-only, every command of it: nothing here stages, commits, checks out or writes a file. A file's two versions
|
|
11
|
+
* are given only for a file the list itself names, so the view cannot be pointed at anything else in the repository
|
|
12
|
+
* or outside it.
|
|
13
|
+
*/
|
|
14
|
+
import { readFile, stat } from 'node:fs/promises';
|
|
15
|
+
import { isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
16
|
+
import { fileAt, git, gitBytes, looksLikeRepo } from '../vcs/git.js';
|
|
17
|
+
/** git's empty tree: what a repository with no commit yet is compared with. */
|
|
18
|
+
const EMPTY_TREE = '4b825dc642cb6eb9a060e54bf8d69288fbee4904';
|
|
19
|
+
const MAX_FILE = 2 * 1024 * 1024;
|
|
20
|
+
const MAX_COMMITS = 200;
|
|
21
|
+
const SHA = /^[0-9a-f]{7,40}$/i;
|
|
22
|
+
async function hasHead(dir) {
|
|
23
|
+
return (await git(dir, ['rev-parse', '--verify', '--quiet', 'HEAD'])).ok;
|
|
24
|
+
}
|
|
25
|
+
/** `--name-status -z` read into files, renames and copies with both their paths. */
|
|
26
|
+
function nameStatus(out) {
|
|
27
|
+
const tokens = out.split('\0');
|
|
28
|
+
const files = [];
|
|
29
|
+
for (let i = 0; i < tokens.length;) {
|
|
30
|
+
const status = tokens[i] ?? '';
|
|
31
|
+
if (!status)
|
|
32
|
+
break;
|
|
33
|
+
const letter = status[0];
|
|
34
|
+
if (letter === 'R' || letter === 'C') {
|
|
35
|
+
files.push({ status: letter, oldPath: tokens[i + 1] ?? '', path: tokens[i + 2] ?? '', added: 0, removed: 0 });
|
|
36
|
+
i += 3;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
files.push({ status: letter, path: tokens[i + 1] ?? '', added: 0, removed: 0 });
|
|
40
|
+
i += 2;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return files;
|
|
44
|
+
}
|
|
45
|
+
/** `--numstat -z` counted into the files it names. */
|
|
46
|
+
function addCounts(files, out) {
|
|
47
|
+
const parts = out.split('\0');
|
|
48
|
+
for (let i = 0; i < parts.length;) {
|
|
49
|
+
const head = parts[i] ?? '';
|
|
50
|
+
if (!head)
|
|
51
|
+
break;
|
|
52
|
+
const [added = '0', removed = '0', path = ''] = head.split('\t');
|
|
53
|
+
// A rename is "added<TAB>removed<TAB>" followed by the old path and the new one.
|
|
54
|
+
const newPath = path === '' ? (parts[i + 2] ?? '') : path;
|
|
55
|
+
i += path === '' ? 3 : 1;
|
|
56
|
+
const file = files.find((f) => f.path === newPath);
|
|
57
|
+
if (file) {
|
|
58
|
+
file.added = added === '-' ? -1 : Number(added) || 0;
|
|
59
|
+
file.removed = removed === '-' ? -1 : Number(removed) || 0;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async function diffFiles(dir, args) {
|
|
64
|
+
const names = await gitBytes(dir, ['diff', '--name-status', '-M', '-z', ...args]);
|
|
65
|
+
if (!names.ok)
|
|
66
|
+
return [];
|
|
67
|
+
const files = nameStatus(names.stdout.toString('utf8'));
|
|
68
|
+
const counts = await gitBytes(dir, ['diff', '--numstat', '-M', '-z', ...args]);
|
|
69
|
+
if (counts.ok)
|
|
70
|
+
addCounts(files, counts.stdout.toString('utf8'));
|
|
71
|
+
return files;
|
|
72
|
+
}
|
|
73
|
+
/** A file git does not track yet: all of it added, counted in lines when it is text. */
|
|
74
|
+
async function untracked(dir, path) {
|
|
75
|
+
const full = join(dir, path);
|
|
76
|
+
const info = await stat(full).catch(() => null);
|
|
77
|
+
let added = 0;
|
|
78
|
+
if (info?.isFile() && info.size <= MAX_FILE) {
|
|
79
|
+
const bytes = await readFile(full).catch(() => Buffer.alloc(0));
|
|
80
|
+
if (bytes.subarray(0, 8000).includes(0))
|
|
81
|
+
added = -1;
|
|
82
|
+
else {
|
|
83
|
+
const text = bytes.toString('utf8');
|
|
84
|
+
added = text === '' ? 0 : text.split('\n').length - (text.endsWith('\n') ? 1 : 0);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return { status: 'U', path, added, removed: added < 0 ? -1 : 0 };
|
|
88
|
+
}
|
|
89
|
+
/** The folder's git as the Source Control view shows it. */
|
|
90
|
+
export async function workspaceGit(dir) {
|
|
91
|
+
const none = { dir, isRepo: false, staged: [], changes: [], commits: [], moreCommits: false };
|
|
92
|
+
if (!dir || !looksLikeRepo(dir))
|
|
93
|
+
return none;
|
|
94
|
+
const head = await hasHead(dir);
|
|
95
|
+
const branch = (await git(dir, ['rev-parse', '--abbrev-ref', 'HEAD'])).stdout || undefined;
|
|
96
|
+
const sha = head ? (await git(dir, ['rev-parse', 'HEAD'])).stdout : undefined;
|
|
97
|
+
const staged = await diffFiles(dir, ['--cached', head ? 'HEAD' : EMPTY_TREE]);
|
|
98
|
+
const unstaged = await diffFiles(dir, []);
|
|
99
|
+
// In conflict: git's `U` in `--name-status`, said as the IDE says it.
|
|
100
|
+
for (const f of [...staged, ...unstaged])
|
|
101
|
+
if (f.status === 'U')
|
|
102
|
+
f.status = '!';
|
|
103
|
+
const others = await gitBytes(dir, ['ls-files', '--others', '--exclude-standard', '-z']);
|
|
104
|
+
const fresh = others.ok ? others.stdout.toString('utf8').split('\0').filter(Boolean).sort().slice(0, 2000) : [];
|
|
105
|
+
const changes = [...unstaged, ...(await Promise.all(fresh.map((p) => untracked(dir, p))))];
|
|
106
|
+
let upstream;
|
|
107
|
+
const up = await git(dir, ['rev-parse', '--abbrev-ref', '--symbolic-full-name', '@{upstream}']);
|
|
108
|
+
if (up.ok && up.stdout) {
|
|
109
|
+
const counts = await git(dir, ['rev-list', '--left-right', '--count', `${up.stdout}...HEAD`]);
|
|
110
|
+
const [behind = '0', ahead = '0'] = counts.stdout.split(/\s+/);
|
|
111
|
+
upstream = { name: up.stdout, ahead: Number(ahead) || 0, behind: Number(behind) || 0 };
|
|
112
|
+
}
|
|
113
|
+
const commits = [];
|
|
114
|
+
if (head) {
|
|
115
|
+
const log = await gitBytes(dir, ['log', `-n${MAX_COMMITS + 1}`, '--format=%H%x1f%h%x1f%an%x1f%aI%x1f%s%x1e']);
|
|
116
|
+
if (log.ok) {
|
|
117
|
+
for (const record of log.stdout.toString('utf8').split('\x1e')) {
|
|
118
|
+
const [full = '', short = '', author = '', at = '', subject = ''] = record.trim().split('\x1f');
|
|
119
|
+
if (full)
|
|
120
|
+
commits.push({ sha: full, short, author, at, subject });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
dir,
|
|
126
|
+
isRepo: true,
|
|
127
|
+
...(branch ? { branch } : {}),
|
|
128
|
+
...(sha ? { head: sha } : {}),
|
|
129
|
+
...(upstream ? { upstream } : {}),
|
|
130
|
+
staged,
|
|
131
|
+
changes,
|
|
132
|
+
commits: commits.slice(0, MAX_COMMITS),
|
|
133
|
+
moreCommits: commits.length > MAX_COMMITS,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
/** One commit: who, when, what it says, and the files it changed (a first commit against nothing). */
|
|
137
|
+
export async function workspaceCommit(dir, sha) {
|
|
138
|
+
if (!SHA.test(sha))
|
|
139
|
+
throw new Error('That is not a commit.');
|
|
140
|
+
if (!looksLikeRepo(dir))
|
|
141
|
+
throw new Error('The project folder is not a git repository.');
|
|
142
|
+
const info = await gitBytes(dir, ['show', '-s', '--format=%H%x1f%h%x1f%an%x1f%aI%x1f%s%x1f%b', sha]);
|
|
143
|
+
if (!info.ok)
|
|
144
|
+
throw new Error(`There is no commit ${sha} in the project folder.`);
|
|
145
|
+
const [full = '', short = '', author = '', at = '', subject = '', body = ''] = info.stdout.toString('utf8').split('\x1f');
|
|
146
|
+
const parent = await git(dir, ['rev-parse', '--verify', '--quiet', `${full}^`]);
|
|
147
|
+
const files = await diffFiles(dir, [parent.ok ? `${full}^` : EMPTY_TREE, full]);
|
|
148
|
+
return { sha: full, short, author, at, subject, body: body.trim(), files };
|
|
149
|
+
}
|
|
150
|
+
/** A path the view was given, as git writes it, or why it is not one. */
|
|
151
|
+
function cleanPath(dir, path) {
|
|
152
|
+
const clean = path.replace(/\\/g, '/').replace(/^\/+/, '');
|
|
153
|
+
const rel = relative(resolve(dir), resolve(dir, clean));
|
|
154
|
+
if (!clean || isAbsolute(clean) || rel.startsWith('..') || rel.split(sep).includes('.git'))
|
|
155
|
+
throw new Error('That path is not inside the project folder.');
|
|
156
|
+
return clean;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* The two versions of one file the view lists: for a staged change, HEAD and the index; for a change not staged, the
|
|
160
|
+
* index and the working tree (a file git does not track: nothing, and the file on disk); for a commit's file, its
|
|
161
|
+
* parent's version and the commit's.
|
|
162
|
+
*/
|
|
163
|
+
export async function workspaceGitVersions(dir, area, path, commit) {
|
|
164
|
+
const want = cleanPath(dir, path);
|
|
165
|
+
let file;
|
|
166
|
+
let before = { bytes: null, tooLarge: false };
|
|
167
|
+
let after = { bytes: null, tooLarge: false };
|
|
168
|
+
if (area === 'commit') {
|
|
169
|
+
const c = await workspaceCommit(dir, commit ?? '');
|
|
170
|
+
file = c.files.find((f) => f.path === want);
|
|
171
|
+
if (!file)
|
|
172
|
+
throw new Error('That file is not one this commit changed.');
|
|
173
|
+
const parent = await git(dir, ['rev-parse', '--verify', '--quiet', `${c.sha}^`]);
|
|
174
|
+
if (file.status !== 'A' && parent.ok)
|
|
175
|
+
before = await fileAt(dir, `${c.sha}^`, file.oldPath ?? file.path, MAX_FILE);
|
|
176
|
+
if (file.status !== 'D')
|
|
177
|
+
after = await fileAt(dir, c.sha, file.path, MAX_FILE);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
const state = await workspaceGit(dir);
|
|
181
|
+
file = (area === 'staged' ? state.staged : state.changes).find((f) => f.path === want);
|
|
182
|
+
if (!file)
|
|
183
|
+
throw new Error(area === 'staged' ? 'That file has no staged change.' : 'That file has no change in the working tree.');
|
|
184
|
+
if (area === 'staged') {
|
|
185
|
+
if (file.status !== 'A' && state.head)
|
|
186
|
+
before = await fileAt(dir, 'HEAD', file.oldPath ?? file.path, MAX_FILE);
|
|
187
|
+
if (file.status !== 'D')
|
|
188
|
+
after = await fileAt(dir, '', file.path, MAX_FILE);
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
// Against the index, which is HEAD's version where nothing is staged; a file git does not track has neither.
|
|
192
|
+
if (file.status !== 'U')
|
|
193
|
+
before = await fileAt(dir, '', file.oldPath ?? file.path, MAX_FILE);
|
|
194
|
+
if (file.status !== 'D') {
|
|
195
|
+
const info = await stat(join(dir, file.path)).catch(() => null);
|
|
196
|
+
if (info?.isFile())
|
|
197
|
+
after = info.size > MAX_FILE ? { bytes: null, tooLarge: true } : { bytes: await readFile(join(dir, file.path)), tooLarge: false };
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
const binary = [before.bytes, after.bytes].some((b) => !!b && b.subarray(0, 8000).includes(0));
|
|
202
|
+
const text = (b) => (b === null || binary ? null : b.toString('utf8').replace(/^/, ''));
|
|
203
|
+
return {
|
|
204
|
+
path: file.path,
|
|
205
|
+
...(file.oldPath ? { oldPath: file.oldPath } : {}),
|
|
206
|
+
status: file.status,
|
|
207
|
+
before: text(before.bytes),
|
|
208
|
+
after: text(after.bytes),
|
|
209
|
+
binary,
|
|
210
|
+
tooLarge: before.tooLarge || after.tooLarge,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
@@ -31,6 +31,25 @@ export function chatCode(sessionId) {
|
|
|
31
31
|
const tail = /-([a-z0-9]{3,8})$/i.exec(sessionId)?.[1];
|
|
32
32
|
return (tail ?? sessionId.replace(/[^a-z0-9]/gi, '').slice(-6)).toLowerCase();
|
|
33
33
|
}
|
|
34
|
+
/** Cyrillic letters in Latin ones: the Bulgarian streamlined system, with the Russian and Ukrainian letters it lacks. */
|
|
35
|
+
const CYRILLIC = {
|
|
36
|
+
а: 'a', б: 'b', в: 'v', г: 'g', д: 'd', е: 'e', ж: 'zh', з: 'z', и: 'i', й: 'y', к: 'k', л: 'l', м: 'm', н: 'n',
|
|
37
|
+
о: 'o', п: 'p', р: 'r', с: 's', т: 't', у: 'u', ф: 'f', х: 'h', ц: 'ts', ч: 'ch', ш: 'sh', щ: 'sht', ъ: 'a', ь: 'y',
|
|
38
|
+
ю: 'yu', я: 'ya', ё: 'yo', ы: 'y', э: 'e', є: 'ye', і: 'i', ї: 'yi', ґ: 'g',
|
|
39
|
+
};
|
|
40
|
+
/** A text in Latin letters: Cyrillic transliterated, accents taken off; what is left of other scripts is kept. */
|
|
41
|
+
export function latin(text) {
|
|
42
|
+
let out = '';
|
|
43
|
+
for (const ch of text) {
|
|
44
|
+
const lower = ch.toLowerCase();
|
|
45
|
+
const mapped = CYRILLIC[lower];
|
|
46
|
+
if (mapped === undefined)
|
|
47
|
+
out += ch;
|
|
48
|
+
else
|
|
49
|
+
out += ch === lower ? mapped : mapped.charAt(0).toUpperCase() + mapped.slice(1);
|
|
50
|
+
}
|
|
51
|
+
return out.normalize('NFKD').replace(/[\u0300-\u036f]/g, '');
|
|
52
|
+
}
|
|
34
53
|
/**
|
|
35
54
|
* Builds the chat name. Shape:
|
|
36
55
|
*
|
|
@@ -50,11 +69,16 @@ export function buildChatName(runId, label) {
|
|
|
50
69
|
return `op/${runId}`.slice(0, MAX_CHAT_NAME);
|
|
51
70
|
}
|
|
52
71
|
const room = MAX_CHAT_NAME - prefix.length;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
72
|
+
/*
|
|
73
|
+
* In Latin letters, Cyrillic transliterated ("Създай калкулатор" gives "Sazday-kalkulator"). Copilot's rename dialog
|
|
74
|
+
* refused a Bulgarian name of 50 letters, and then the same cut to 50 bytes, and took only a short Latin one: two
|
|
75
|
+
* refusals before every first message of a new chat (operator, 2026-10-19: "why two attempts — should it not be
|
|
76
|
+
* one?"). An ASCII name is the same length by any count, so the first name offered is the one it takes; the shorter
|
|
77
|
+
* forms of `chatNameForms` stay for a refusal nobody expects.
|
|
78
|
+
*/
|
|
79
|
+
const clean = latin(label)
|
|
56
80
|
.replace(/\s+/g, '-')
|
|
57
|
-
.replace(/[
|
|
81
|
+
.replace(/[^A-Za-z0-9._-]/g, '')
|
|
58
82
|
.replace(/-{2,}/g, '-')
|
|
59
83
|
.replace(/^-|-$/g, '')
|
|
60
84
|
.slice(0, room);
|
package/dist/web/404.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--z74_FBfnnXW5IJCHTgTH2--><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/4335e4ce269ba1ea.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-0e5d0d5472bf185f.js" async=""></script><script src="/_next/static/chunks/549-c32dd718a1809d4d.js" async=""></script><script src="/_next/static/chunks/499-751e0be9d4f86e2d.js" async=""></script><script src="/_next/static/chunks/app/layout-a1314921eeba8ad5.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>copilot-operator</title><meta name="description" content="Runs task loops with Microsoft 365 Copilot on this machine."/><script>
|
|
2
2
|
(function () {
|
|
3
3
|
try {
|
|
4
4
|
var d = document.documentElement;
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
d.dataset.focus = a.strongFocus ? 'strong' : 'normal';
|
|
14
14
|
} catch (e) {}
|
|
15
15
|
})();
|
|
16
|
-
</script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><a class="skip-link" href="#main">Skip to the content</a><div class="wrap"><header class="top"><h1><a href="/">copilot-operator</a></h1><nav aria-label="Main"><a href="/"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M3 4h18v16H3zM9 4v16M3 15h6" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Workbench</span></a><a href="/sessions"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v4H4zM4 11h16v4H4zM4 17h10v2H4z"></path></svg><span>Sessions</span></a><a href="/defaults"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm8.5 4 1.5 1-1.6 2.8-1.8-.4a7 7 0 0 1-1.5 1.5l.4 1.8L14.7 21l-1-1.5a7 7 0 0 1-3.4 0l-1 1.5-2.8-1.6.4-1.8A7 7 0 0 1 5.4 16l-1.8.4L2 13.6 3.5 12.6V11.4L2 10.4l1.6-2.8 1.8.4A7 7 0 0 1 6.9 6.5l-.4-1.8L9.3 3l1 1.5a7 7 0 0 1 3.4 0l1-1.5 2.8 1.6-.4 1.8a7 7 0 0 1 1.5 1.5l1.8-.4L22 10.4l-1.5 1z"></path></svg><span>Settings</span></a><a href="/import"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3v10m0 0 4-4m-4 4-4-4M4 15v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Plan from JSON</span></a><a href="/history"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 1 0 8.5 6M12 7v5l3 2M3 4v5h5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Task register</span></a><a href="/level1"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M6 3h9l5 5v13H6zM14 3v6h6M9 13h7M9 17h7" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 1 prompt</span></a><a href="/presets"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M5 4h14v4H5zM5 10h14v4H5zM5 16h9v4H5z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 2 presets</span></a><a href="/appearance"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 0 0 0 18c1.5 0 2-1 2-2s-1-1.5-1-2.5S14 15 15.5 15H17a4 4 0 0 0 4-4 8 8 0 0 0-9-8zM8 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"></path></svg><span>Appearance</span></a><a href="/system"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v10H4zM2 19h20M9 15v4M15 15v4" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>System</span></a><select aria-label="Language" style="width:auto"><option value="en" selected="">English</option><option value="bg">Български</option></select></nav></header><main id="main"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--></main></div><script src="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[8078,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7fb52be342fa64e5.js\",\"549\",\"static/chunks/549-8732dd2c1339bc5d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-485ce9395cb17998.js\"],\"AppearanceProvider\"]\n3:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7fb52be342fa64e5.js\",\"549\",\"static/chunks/549-8732dd2c1339bc5d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-485ce9395cb17998.js\"],\"LanguageProvider\"]\n4:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7fb52be342fa64e5.js\",\"549\",\"static/chunks/549-8732dd2c1339bc5d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-485ce9395cb17998.js\"],\"DialogHost\"]\n5:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7fb52be342fa64e5.js\",\"549\",\"static/chunks/549-8732dd2c1339bc5d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-485ce9395cb17998.js\"],\"SkipLink\"]\n6:I[966,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7fb52be342fa64e5.js\",\"549\",\"static/chunks/549-8732dd2c1339bc5d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-485ce9395cb17998.js\"],\"Shell\"]\n7:I[5204,[],\"\"]\n8:I[2642,[],\"\"]\n9:I[7712,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7fb52be342fa64e5.js\",\"549\",\"static/chunks/549-8732dd2c1339bc5d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-485ce9395cb17998.js\"],\"ScrollJump\"]\na:I[1701,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7fb52be342fa64e5.js\",\"549\",\"static/chunks/549-8732dd2c1339bc5d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-485ce9395cb17998.js\"],\"StartDialogHost\"]\nb:I[433,[],\"OutletBoundary\"]\nd:I[9884,[],\"AsyncMetadataOutlet\"]\nf:I[433,[],\"ViewportBoundary\"]\n11:I[433,[],\"MetadataBoundary\"]\n12:\"$Sreact.suspense\"\n14"])</script><script>self.__next_f.push([1,":I[3536,[],\"\"]\n:HL[\"/_next/static/css/70ceb261074b139c.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"HT6yqFoDPOXChAZVDxshC\",\"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>
|
|
16
|
+
</script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><a class="skip-link" href="#main">Skip to the content</a><div class="wrap"><header class="top"><h1><a href="/">copilot-operator</a></h1><nav aria-label="Main"><a href="/"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M3 4h18v16H3zM9 4v16M3 15h6" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Workbench</span></a><a href="/sessions"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v4H4zM4 11h16v4H4zM4 17h10v2H4z"></path></svg><span>Sessions</span></a><a href="/defaults"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm8.5 4 1.5 1-1.6 2.8-1.8-.4a7 7 0 0 1-1.5 1.5l.4 1.8L14.7 21l-1-1.5a7 7 0 0 1-3.4 0l-1 1.5-2.8-1.6.4-1.8A7 7 0 0 1 5.4 16l-1.8.4L2 13.6 3.5 12.6V11.4L2 10.4l1.6-2.8 1.8.4A7 7 0 0 1 6.9 6.5l-.4-1.8L9.3 3l1 1.5a7 7 0 0 1 3.4 0l1-1.5 2.8 1.6-.4 1.8a7 7 0 0 1 1.5 1.5l1.8-.4L22 10.4l-1.5 1z"></path></svg><span>Settings</span></a><a href="/import"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3v10m0 0 4-4m-4 4-4-4M4 15v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Plan from JSON</span></a><a href="/history"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 1 0 8.5 6M12 7v5l3 2M3 4v5h5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Task register</span></a><a href="/level1"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M6 3h9l5 5v13H6zM14 3v6h6M9 13h7M9 17h7" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 1 prompt</span></a><a href="/presets"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M5 4h14v4H5zM5 10h14v4H5zM5 16h9v4H5z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 2 presets</span></a><a href="/appearance"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 0 0 0 18c1.5 0 2-1 2-2s-1-1.5-1-2.5S14 15 15.5 15H17a4 4 0 0 0 4-4 8 8 0 0 0-9-8zM8 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"></path></svg><span>Appearance</span></a><a href="/system"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v10H4zM2 19h20M9 15v4M15 15v4" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>System</span></a><select aria-label="Language" style="width:auto"><option value="en" selected="">English</option><option value="bg">Български</option></select></nav></header><main id="main"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--></main></div><script src="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[8078,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0e5d0d5472bf185f.js\",\"549\",\"static/chunks/549-c32dd718a1809d4d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-a1314921eeba8ad5.js\"],\"AppearanceProvider\"]\n3:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0e5d0d5472bf185f.js\",\"549\",\"static/chunks/549-c32dd718a1809d4d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-a1314921eeba8ad5.js\"],\"LanguageProvider\"]\n4:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0e5d0d5472bf185f.js\",\"549\",\"static/chunks/549-c32dd718a1809d4d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-a1314921eeba8ad5.js\"],\"DialogHost\"]\n5:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0e5d0d5472bf185f.js\",\"549\",\"static/chunks/549-c32dd718a1809d4d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-a1314921eeba8ad5.js\"],\"SkipLink\"]\n6:I[966,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0e5d0d5472bf185f.js\",\"549\",\"static/chunks/549-c32dd718a1809d4d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-a1314921eeba8ad5.js\"],\"Shell\"]\n7:I[5204,[],\"\"]\n8:I[2642,[],\"\"]\n9:I[7712,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0e5d0d5472bf185f.js\",\"549\",\"static/chunks/549-c32dd718a1809d4d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-a1314921eeba8ad5.js\"],\"ScrollJump\"]\na:I[1701,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-0e5d0d5472bf185f.js\",\"549\",\"static/chunks/549-c32dd718a1809d4d.js\",\"499\",\"static/chunks/499-751e0be9d4f86e2d.js\",\"177\",\"static/chunks/app/layout-a1314921eeba8ad5.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/4335e4ce269ba1ea.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"z74_FBfnnXW5IJCHTgTH2\",\"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/4335e4ce269ba1ea.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([[534],{287:(e,t,s)=>{s.d(t,{y:()=>h,f:()=>u});var n=s(3365),l=s(1521),a=s(5549),i=s(867),r=s(7527),c=s(1035),d=s(1701),o=s(4811);function u(e){var t,s,u;let{target:f,intro:m,initial:p="one",focusFirst:x=!1,checkContract:g=!0,onClose:j}=e,{t:y}=(0,i.kj)(),k=(0,o.p)(),[v,N]=(0,l.useState)(null),[b,w]=(0,l.useState)(p),[S,C]=(0,l.useState)(!1),[q,I]=(0,l.useState)(""),[F,R]=(0,l.useState)(!1),E=(0,l.useRef)(null),L=(0,l.useRef)(null),T=(0,l.useRef)(null),M=(0,l.useId)(),H=()=>a.FH.session(f.sessionId).then(N).catch(e=>I(e.message));(0,l.useEffect)(()=>{H(),g&&a.FH.contractCheck(f.sessionId,f.taskId).then(e=>R(e.conflicts.length>0)).catch(()=>void 0)},[f.sessionId,f.taskId]),(0,r.z)(H,3e3,!!(null==v?void 0:v.running));let O=null!==v;if((0,l.useEffect)(()=>{var e,t,s;if(!O||(null==(t=E.current)||null==(e=t.scrollIntoView)||e.call(t,{block:"nearest"}),!x))return;let n=L.current;n&&!n.disabled?n.focus():null==(s=T.current)||s.focus()},[O,x]),!v)return(0,n.jsx)("div",{className:"notice calm",style:{marginTop:8},children:(0,n.jsx)("span",{className:"small",children:q||y("runq.loading")})});let D=function(e,t){let s=e.tasks.findIndex(e=>e.id===t),n=s>=0?e.tasks[s]:void 0,l=s>=0?e.tasks.slice(0,s):[],a=s>=0?e.tasks.slice(s+1):[],i="continue"!==e.onFailure,r=-1;return a.forEach((e,t)=>{"queued"===e.status&&(r=t)}),{task:n,followingQueued:a.filter(e=>"queued"===e.status),laterRan:a.filter(e=>"queued"!==e.status),earlierRan:l.filter(e=>"queued"!==e.status),chain:i,chainGap:i?l.find(e=>"done"!==e.status):void 0,chainGapLater:i&&r>0?a.slice(0,r).find(e=>"queued"!==e.status&&"done"!==e.status):void 0}}(v,f.taskId),W=(null==(t=D.task)?void 0:t.status)==="queued",G="following"===b?[D.task,...D.followingQueued]:D.task?[D.task]:[],Q=v.running?y("runq.sessionRunning"):!1===v.active?y("runq.sessionInactive"):"",P=async e=>{if("unattended"!==e||k||await (0,c.Z)(y("batch.unattendedConfirm",{n:1}))){C(!0),I(""),R(!1);try{var t,s;let n=await a.FH.suggestedRunName([f.sessionId]).then(e=>e.name).catch(()=>void 0),l=await (0,d.L)({sessionIds:[f.sessionId],mode:e,start:t=>a.FH.startBatch([f.sessionId],e,"stop",void 0,void 0,n,G.map(e=>e.id),t)});if(!l.started&&!l.reply)return;let i=null!=(t=l.reply)?t:{started:!0};if(!l.started){I(y("batch.notStarted",{reason:null!=(s=i.reason)?s:""}));let e=await a.FH.contractCheck(f.sessionId,f.taskId).catch(()=>({conflicts:[]}));R(e.conflicts.length>0);return}I(y("runq.started",{n:G.length})),j(!0)}catch(e){I(e.message)}finally{C(!1)}}},V=y("runq.title",{title:f.title});return(0,n.jsxs)("div",{ref:E,className:"notice calm",role:"group","aria-label":V,style:{marginTop:8},children:[m&&(0,n.jsx)("p",{className:"small",style:{marginTop:0},children:m}),(0,n.jsx)("strong",{children:V}),W?(0,n.jsxs)(n.Fragment,{children:[D.followingQueued.length>0&&(0,n.jsxs)("div",{className:"small",role:"radiogroup","aria-label":V,style:{marginTop:6},children:[(0,n.jsxs)("label",{className:"option-inline",children:[(0,n.jsx)("input",{type:"radio",name:"runq-".concat(M),checked:"one"===b,onChange:()=>w("one"),disabled:S}),y("runq.onlyThis")]}),(0,n.jsxs)("label",{className:"option-inline",title:y("runq.followingWhy"),children:[(0,n.jsx)("input",{type:"radio",name:"runq-".concat(M),checked:"following"===b,onChange:()=>w("following"),disabled:S}),y("runq.following",{n:D.followingQueued.length,session:v.name})]})]}),(0,n.jsx)("div",{className:"small",style:{marginTop:6},children:y("runq.willRun")}),(0,n.jsx)("ol",{className:"small",style:{margin:"4px 0",paddingLeft:22},children:G.map(e=>(0,n.jsx)("li",{children:e.title},e.id))}),(0,n.jsxs)("ul",{className:"small",style:{margin:"4px 0",paddingLeft:18},children:[D.chain&&G.length>1&&(0,n.jsx)("li",{children:y("runq.chainStops")}),D.earlierRan.length>0&&(0,n.jsx)("li",{children:y("runq.untouched",{n:D.earlierRan.length})}),D.laterRan.length>0&&(0,n.jsx)("li",{children:y("runq.laterRan",{list:D.laterRan.map(e=>'"'.concat(e.title,'"')).join(", ")})}),"one"===b&&D.followingQueued.length>0&&(0,n.jsx)("li",{children:y("runq.restWait",{n:D.followingQueued.length})})]}),D.chainGap&&(0,n.jsx)("div",{className:"notice caution small",style:{marginTop:6},children:y("runq.chainGap",{before:D.chainGap.title,status:y("status.".concat(D.chainGap.status))})}),"following"===b&&D.chainGapLater&&(0,n.jsx)("div",{className:"notice caution small",style:{marginTop:6},children:y("runq.chainGapLater",{between:D.chainGapLater.title,status:y("status.".concat(D.chainGapLater.status))})}),Q&&(0,n.jsx)("p",{className:"small",children:Q})]}):(0,n.jsx)("p",{className:"small",children:y("runq.notQueued",{status:y("status.".concat(null!=(u=null==(s=D.task)?void 0:s.status)?u:"queued"))})}),(0,n.jsxs)("div",{className:"row",style:{marginTop:8},children:[W&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{ref:L,className:"primary",disabled:S||!!Q,onClick:()=>void P("confirm"),title:y("runq.goWhy"),children:y("runq.go")}),(0,n.jsx)("button",{disabled:S||!!Q,onClick:()=>void P("unattended"),title:y("runq.unattendedWhy"),children:y("runq.unattended")})]}),(0,n.jsx)("button",{ref:T,className:"quiet",disabled:S,onClick:()=>j(!1),children:m?y("runq.later"):y("dialog.cancel")}),q&&(0,n.jsx)("span",{className:"small",role:"status",children:q})]}),F&&(0,n.jsx)(h,{target:f,onApplied:(e,t)=>{H(),0===e&&(R(!1),I(t))}})]})}function h(e){let{target:t,onApplied:s}=e,{t:r}=(0,i.kj)(),[c,d]=(0,l.useState)(null),[o,u]=(0,l.useState)([]),[h,f]=(0,l.useState)(!1),[m,p]=(0,l.useState)(""),[x,g]=(0,l.useState)(null),[j,y]=(0,l.useState)(null),k=(0,l.useId)();(0,l.useEffect)(()=>{d(null),Promise.all([a.FH.contractCheck(t.sessionId,t.taskId),a.FH.session(t.sessionId)]).then(e=>{var s;let[n,l]=e,a=l.tasks.find(e=>e.id===t.taskId);d(n.conflicts),u(n.conflicts.map(e=>e.fixes.length>0?0:-1)),g(null!=(s=null==a?void 0:a.status)?s:null),y(a?{readOnly:a.readOnly,scope:a.scope,checks:a.checks}:null)}).catch(e=>p(e.message))},[t.sessionId,t.taskId]);let v=async()=>{if(c){f(!0),p("");try{let e=await a.FH.applyContractFix(t.sessionId,t.taskId,o,c.map(e=>e.text)),n=r("cfix.applied",{list:(j?function(e,t,s){var n,l,a,i;let r=[];!!t.readOnly!=!!s.readOnly&&r.push(e(s.readOnly?"cfix.chReadOnlyOn":"cfix.chReadOnlyOff"));let c=(null!=(n=t.scope)?n:[]).join(", "),d=(null!=(l=s.scope)?l:[]).join(", ");c!==d&&r.push(d?e("cfix.chScope",{paths:d}):e("cfix.chScopeRemoved"));let o=new Set((null!=(a=s.checks)?a:[]).map(e=>e.name));for(let s of null!=(i=t.checks)?i:[])o.has(s.name)||r.push(e("cfix.chDropped",{check:s.name}));return r.join("; ")}(r,j,e.task):e.applied.join("; "))||r("cfix.chNothing")});p(n+(e.remaining.length>0?" ".concat(r("cfix.remaining",{n:e.remaining.length})):"")),d(e.remaining),u(e.remaining.map(e=>e.fixes.length>0?0:-1)),g("queued"),y({readOnly:e.task.readOnly,scope:e.task.scope,checks:e.task.checks}),s(e.remaining.length,n)}catch(e){p(e.message)}finally{f(!1)}}},N=r("cfix.title",{title:t.title});return(0,n.jsxs)("div",{className:"notice caution",role:"group","aria-label":N,style:{marginTop:8},children:[(0,n.jsx)("strong",{children:N}),(0,n.jsx)("p",{className:"why",children:r("cfix.why")}),null===c?(0,n.jsx)("p",{className:"small",children:m||r("cfix.loading")}):0===c.length?(0,n.jsx)("p",{className:"small",role:"status",children:m||r("cfix.none")}):(0,n.jsxs)(n.Fragment,{children:[c.map((e,t)=>(0,n.jsxs)("fieldset",{className:"small",style:{margin:"8px 0",border:0,padding:0},children:[(0,n.jsx)("legend",{style:{fontWeight:600},children:e.text}),e.fixes.map((e,s)=>(0,n.jsxs)("label",{className:"option-inline",style:{display:"block"},children:[(0,n.jsx)("input",{type:"radio",name:"cfix-".concat(k,"-").concat(t),checked:o[t]===s,onChange:()=>u(e=>e.map((e,n)=>n===t?s:e)),disabled:h}),"add-to-scope"===e.kind?r("cfix.addToScope",{path:e.path}):"not-read-only"===e.kind?e.scope.length>0?r("cfix.notReadOnly",{paths:e.scope.join(", ")}):r("cfix.notReadOnlyAll"):"drop-scope"===e.kind?r("cfix.dropScope"):r("cfix.dropCheck",{check:e.check}),0===s&&(0,n.jsxs)("span",{className:"muted",children:[" ",r("cfix.minimal")]})]},s)),(0,n.jsxs)("label",{className:"option-inline",style:{display:"block"},children:[(0,n.jsx)("input",{type:"radio",name:"cfix-".concat(k,"-").concat(t),checked:-1===o[t],onChange:()=>u(e=>e.map((e,s)=>s===t?-1:e)),disabled:h}),e.fixes.length>0?r("cfix.leave"):r("cfix.noFix")]})]},t)),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("button",{className:"primary",disabled:h||o.every(e=>-1===e),onClick:()=>void v(),children:"queued"===x?r("cfix.applyQueued"):r("cfix.apply")}),m&&(0,n.jsx)("span",{className:"small",role:"status",children:m})]})]})]})}},853:(e,t,s)=>{function n(e){if(null===e||""===e)return[];let t=e.split(/\r?\n/);return""===t[t.length-1]&&t.pop(),t}function l(e,t){let s=function(e,t){let s=0;for(;s<e.length&&s<t.length&&e[s]===t[s];)s+=1;let n=e.length,l=t.length;for(;n>s&&l>s&&e[n-1]===t[l-1];)n-=1,l-=1;let a=[];for(let e=0;e<s;e+=1)a.push({kind:"same",a:e,b:e});for(let i of function(e,t){let s=e.length,n=t.length;if(0===s)return t.map((e,t)=>({kind:"add",b:t}));if(0===n)return e.map((e,t)=>({kind:"del",a:t}));let l=s+n,a=l+1,i=new Int32Array(2*l+3),r=[];for(let c=0;c<=Math.min(l,2e3);c+=1){r.push(i.slice(a-c-1,a+c+2));for(let l=-c;l<=c;l+=2){let d=l===-c||l!==c&&i[a+l-1]<i[a+l+1]?i[a+l+1]:i[a+l-1]+1,o=d-l;for(;d<s&&o<n&&e[d]===t[o];)d+=1,o+=1;if(i[a+l]=d,d>=s&&o>=n)return function(e,t,s,n){let l=[],a=t.length,i=s.length;for(let t=n;t>0;t-=1){let s=e[t],n=e=>s[e+t+1],r=a-i,c=r===-t||r!==t&&n(r-1)<n(r+1)?r+1:r-1,d=n(c),o=d-c;for(;a>d&&i>o;)a-=1,i-=1,l.push({kind:"same",a:a,b:i});a===d?l.push({kind:"add",b:o}):l.push({kind:"del",a:d}),a=d,i=o}for(;a>0&&i>0;)a-=1,i-=1,l.push({kind:"same",a:a,b:i});return l.reverse()}(r,e,t,c)}}return[...e.map((e,t)=>({kind:"del",a:t})),...t.map((e,t)=>({kind:"add",b:t}))]}(e.slice(s,n),t.slice(s,l)))a.push({kind:i.kind,...void 0!==i.a?{a:i.a+s}:{},...void 0!==i.b?{b:i.b+s}:{}});for(let t=0;n+t<e.length;t+=1)a.push({kind:"same",a:n+t,b:l+t});return a}(e,t),n=[];for(let l=0;l<s.length;){let a=s[l];if("same"===a.kind){n.push({kind:"same",left:{no:a.a+1,text:e[a.a]},right:{no:a.b+1,text:t[a.b]}}),l+=1;continue}let i=[],r=[];for(;l<s.length&&"same"!==s[l].kind;){let e=s[l];"del"===e.kind?i.push(e.a):r.push(e.b),l+=1}let c=Math.max(i.length,r.length);for(let s=0;s<c;s+=1){let l=i[s],a=r[s];n.push({kind:void 0!==l&&void 0!==a?"change":void 0!==l?"del":"add",...void 0!==l?{left:{no:l+1,text:e[l]}}:{},...void 0!==a?{right:{no:a+1,text:t[a]}}:{}})}}return n}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(n)return e.map((e,t)=>({type:"row",row:e,index:t}));let l=[];for(let n=0;n<e.length;){if("same"!==e[n].kind){l.push({type:"row",row:e[n],index:n}),n+=1;continue}let a=n;for(;a<e.length&&"same"===e[a].kind;)a+=1;let i=0===n?0:t,r=a===e.length?0:t,c=a-n-i-r;if(c>1&&!s.has(n+i)){for(let t=n;t<n+i;t+=1)l.push({type:"row",row:e[t],index:t});l.push({type:"gap",from:n+i,count:c});for(let t=a-r;t<a;t+=1)l.push({type:"row",row:e[t],index:t})}else for(let t=n;t<a;t+=1)l.push({type:"row",row:e[t],index:t});n=a}return l}function i(e,t){let s=0;for(;s<e.length&&s<t.length&&e[s]===t[s];)s+=1;let n=e.length,l=t.length;for(;n>s&&l>s&&e[n-1]===t[l-1];)n-=1,l-=1;return{start:s,leftEnd:n,rightEnd:l}}s.d(t,{$8:()=>a,Dx:()=>n,Nj:()=>i,Qp:()=>l})},3374:(e,t,s)=>{s.d(t,{c:()=>l});var n=s(1521);function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,[s,l]=(0,n.useState)(()=>Date.now());return(0,n.useEffect)(()=>{if(!e)return;l(Date.now());let s=window.setInterval(()=>l(Date.now()),t);return()=>window.clearInterval(s)},[e,t]),s}},4811:(e,t,s)=>{s.d(t,{p:()=>a});var n=s(1521),l=s(5549);function a(){let[e,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let e=!0;return l.FH.settings().then(s=>{var n;let l=null!=(n=s.raw.execution)?n:{};e&&t("unattended"===l.mode)}).catch(()=>void 0),()=>{e=!1}},[]),e}},5132:(e,t,s)=>{s.d(t,{s:()=>r});var n=s(3365),l=s(1521);function a(e,t){let s,l=[],a=/(`[^`\n]+`)|(\*\*[^*\n]+\*\*)|(\*[^*\n]+\*)/g,i=0,r=0;for(;null!==(s=a.exec(e));){s.index>i&&l.push(e.slice(i,s.index));let a=s[0],c="".concat(t,"-i").concat(r+=1);a.startsWith("`")?l.push((0,n.jsx)("code",{children:a.slice(1,-1)},c)):a.startsWith("**")?l.push((0,n.jsx)("strong",{children:a.slice(2,-2)},c)):l.push((0,n.jsx)("em",{children:a.slice(1,-1)},c)),i=s.index+a.length}return i<e.length&&l.push(e.slice(i)),l}function i(e){let t=/^\s*[-*•]\s+(.*)$/.exec(e);if(t)return t[1];let s=/^\s*\d+[.)]\s+(.*)$/.exec(e);return s?s[1]:null}function r(e){let{text:t,className:s}=e,r=[],c=t.replace(/\r\n/g,"\n").split("\n"),d=0,o=0;for(;d<c.length;){let e=c[d];if(e.trim().startsWith("```")){let e=[];for(d+=1;d<c.length&&!c[d].trim().startsWith("```");)e.push(c[d++]);d+=1,e.length>0&&r.push((0,n.jsx)("pre",{children:e.join("\n")},"b".concat(o+=1)));continue}if(null!==i(e)){let e=[];for(;d<c.length&&null!==i(c[d]);)e.push(i(c[d++]));r.push((0,n.jsx)("ul",{children:e.map((e,t)=>(0,n.jsx)("li",{children:a(e,"b".concat(o,"-").concat(t))},t))},"b".concat(o+=1)));continue}if(""===e.trim()){d+=1;continue}let t=[];for(;d<c.length&&""!==c[d].trim()&&null===i(c[d])&&!c[d].trim().startsWith("```");)t.push(c[d++]);let s=o+=1;r.push((0,n.jsx)("p",{children:t.map((e,t)=>(0,n.jsxs)(l.Fragment,{children:[t>0&&(0,n.jsx)("br",{}),a(e,"b".concat(s,"-").concat(t))]},t))},"b".concat(s)))}return(0,n.jsx)("div",{className:"rich ".concat(null!=s?s:""),children:r})}},6481:(e,t,s)=>{s.d(t,{CV:()=>d,Q1:()=>u});var n=s(3365),l=s(1521),a=s(5549),i=s(4969),r=s(867),c=s(853);function d(e){let{sessionId:t,taskId:s,runId:a,title:i,files:c}=e,{t:d}=(0,r.kj)(),[u,h]=(0,l.useState)(!1);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:"linkish",onClick:()=>h(!0),title:d("diff.openWhy"),children:d("diff.open",{n:c})}),u&&(0,n.jsx)(o,{sessionId:t,taskId:s,runId:a,title:i,onClose:()=>h(!1)})]})}function o(e){var t,s,d,o,h,f,m;let{sessionId:p,taskId:x,runId:g,title:j,onClose:y}=e,{t:k}=(0,r.kj)(),[v,N]=(0,l.useState)(null),[b,w]=(0,l.useState)(""),[S,C]=(0,l.useState)(0),[q,I]=(0,l.useState)(new Map),[F,R]=(0,l.useState)(!1),[E,L]=(0,l.useState)(!0),[T,M]=(0,l.useState)(new Map),[H,O]=(0,l.useState)(-1),D=(0,l.useRef)(null),W=(0,l.useRef)(null),G=(0,l.useRef)(null);(0,i.V)(W,!0,G),(0,l.useEffect)(()=>{a.FH.taskChanges(p,x,g).then(N).catch(e=>w(e.message))},[p,x,g]);let Q=null!=(d=null==v?void 0:v.files)?d:[],P=Q[S];(0,l.useEffect)(()=>{!P||q.has(P.path)||a.FH.taskChangeFile(p,x,P.path,g).then(e=>I(t=>new Map(t).set(P.path,e))).catch(e=>I(t=>new Map(t).set(P.path,e.message)))},[P,q,p,x,g]);let V=P?q.get(P.path):void 0,A=(0,l.useMemo)(()=>!V||"string"==typeof V||V.binary||V.tooLarge?[]:(0,c.Qp)((0,c.Dx)(V.before),(0,c.Dx)(V.after)),[V]),B=P&&T.get(P.path)||new Set,$=(0,l.useMemo)(()=>(0,c.$8)(A,3,B,F),[A,B,F]),_=(0,l.useMemo)(()=>A.flatMap((e,t)=>"same"!==e.kind&&(0===t||"same"===A[t-1].kind)?[t]:[]),[A]);(0,l.useEffect)(()=>{O(-1),D.current&&(D.current.scrollTop=0)},[S]);let K=(0,l.useCallback)(e=>{var t;if(0===_.length)return;let s=H<0?1===e?0:_.length-1:Math.min(_.length-1,Math.max(0,H+e));O(s);let n=null==(t=D.current)?void 0:t.querySelector('[data-row="'.concat(_[s],'"]'));null==n||n.scrollIntoView({block:"center"})},[H,_]),U=(0,l.useCallback)(e=>C(t=>Math.min(Math.max(0,t+e),Math.max(0,Q.length-1))),[Q.length]);(0,l.useEffect)(()=>{let e=e=>{if(!e.ctrlKey&&!e.metaKey&&!e.altKey){if("Escape"===e.key)y();else if("n"===e.key)K(1);else if("p"===e.key)K(-1);else if("]"===e.key)U(1);else{if("["!==e.key)return;U(-1)}e.preventDefault()}};window.addEventListener("keydown",e);let t=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",e),document.body.style.overflow=t}},[K,U,y]);let z=Q.reduce((e,t)=>({added:e.added+Math.max(0,t.added),removed:e.removed+Math.max(0,t.removed)}),{added:0,removed:0});return(0,n.jsxs)("div",{ref:W,className:"diff-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"diff-title",children:[(0,n.jsxs)("div",{className:"diff-head",children:[(0,n.jsx)("h2",{id:"diff-title",children:k("diff.title",{title:j})}),(null==v?void 0:v.ok)&&(0,n.jsxs)("span",{className:"muted small",children:[v.branch?"".concat(v.branch," \xb7 "):"",null==(t=v.base)?void 0:t.slice(0,8)," → ",null==(s=v.commit)?void 0:s.slice(0,8)," \xb7 ",k("diff.summary",{n:Q.length,a:z.added,r:z.removed})]}),(0,n.jsx)("span",{className:"grow"}),(0,n.jsx)("span",{className:"muted small",children:k("diff.keys")}),(0,n.jsx)("button",{ref:G,type:"button",onClick:y,children:k("diff.close")})]}),b&&(0,n.jsx)("div",{className:"err",style:{padding:12},children:b}),!v&&!b&&(0,n.jsx)("div",{className:"muted",style:{padding:12},children:k("diff.loading")}),v&&!v.ok&&(0,n.jsx)("div",{className:"notice caution",style:{margin:12},children:v.problem}),(null==v?void 0:v.ok)&&0===Q.length&&(0,n.jsx)("div",{className:"notice",style:{margin:12},children:k("diff.nothing")}),(null==v?void 0:v.ok)&&Q.length>0&&(0,n.jsxs)("div",{className:"diff-body",children:[(0,n.jsx)("nav",{className:"diff-files","aria-label":k("diff.files"),children:Q.map((e,t)=>{let s=e.path.lastIndexOf("/");return(0,n.jsxs)("button",{type:"button",className:"diff-file".concat(t===S?" on":""),onClick:()=>C(t),title:e.oldPath?"".concat(e.oldPath," → ").concat(e.path):e.path,children:[(0,n.jsx)("span",{className:"diff-status s-".concat(e.status),children:e.status}),(0,n.jsxs)("span",{className:"diff-path",children:[s>=0&&(0,n.jsx)("span",{className:"muted",children:e.path.slice(0,s+1)}),(0,n.jsx)("strong",{children:e.path.slice(s+1)})]}),(0,n.jsx)("span",{className:"diff-counts",children:e.added<0?k("diff.binaryShort"):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("span",{className:"plus",children:["+",e.added]})," ",(0,n.jsxs)("span",{className:"minus",children:["−",e.removed]})]})})]},e.path)})}),(0,n.jsxs)("div",{className:"diff-main",children:[P&&(0,n.jsxs)("div",{className:"diff-toolbar",children:[(0,n.jsx)("strong",{className:"diff-name",children:P.oldPath?"".concat(P.oldPath," → ").concat(P.path):P.path}),(0,n.jsx)("span",{className:"muted small",children:"A"===P.status?k("diff.added"):"D"===P.status?k("diff.deleted"):"R"===P.status?k("diff.renamed"):""}),(0,n.jsx)("span",{className:"grow"}),(0,n.jsx)("button",{type:"button",className:"quiet",onClick:()=>K(-1),disabled:0===_.length,children:k("diff.prevChange")}),(0,n.jsx)("button",{type:"button",className:"quiet",onClick:()=>K(1),disabled:0===_.length,children:k("diff.nextChange")}),(0,n.jsx)("span",{className:"muted small",children:_.length>0?k("diff.changeN",{i:H<0?"–":H+1,n:_.length}):""}),(0,n.jsx)("button",{type:"button",className:"quiet",onClick:()=>U(-1),disabled:0===S,children:k("diff.prevFile")}),(0,n.jsx)("button",{type:"button",className:"quiet",onClick:()=>U(1),disabled:S>=Q.length-1,children:k("diff.nextFile")}),(0,n.jsxs)("label",{className:"option-inline",children:[(0,n.jsx)("input",{type:"checkbox",checked:F,onChange:e=>R(e.target.checked)})," ",k("diff.whole")]}),(0,n.jsxs)("label",{className:"option-inline",children:[(0,n.jsx)("input",{type:"checkbox",checked:E,onChange:e=>L(e.target.checked)})," ",k("diff.wrap")]})]}),(0,n.jsxs)("div",{className:"diff-scroll",ref:D,children:[void 0===V&&(0,n.jsx)("div",{className:"muted",style:{padding:12},children:k("diff.loading")}),"string"==typeof V&&(0,n.jsx)("div",{className:"err",style:{padding:12},children:V}),V&&"string"!=typeof V&&V.binary&&(0,n.jsx)("div",{className:"notice",style:{margin:12},children:k("diff.binary")}),V&&"string"!=typeof V&&V.tooLarge&&(0,n.jsx)("div",{className:"notice",style:{margin:12},children:k("diff.tooLarge")}),V&&"string"!=typeof V&&!V.binary&&!V.tooLarge&&(0,n.jsxs)(n.Fragment,{children:[(null!=(o=V.before)?o:"").includes("\r\n")!==(null!=(h=V.after)?h:"").includes("\r\n")&&null!==V.before&&null!==V.after&&(0,n.jsx)("div",{className:"notice small",style:{margin:8},children:k("diff.eol",{from:(null!=(f=V.before)?f:"").includes("\r\n")?"CRLF":"LF",to:(null!=(m=V.after)?m:"").includes("\r\n")?"CRLF":"LF"})}),A.length>0&&0===_.length&&(0,n.jsx)("div",{className:"notice small",style:{margin:8},children:k("diff.sameText")}),(0,n.jsxs)("table",{className:"diff-table".concat(E?"":" nowrap"),children:[(0,n.jsxs)("colgroup",{children:[(0,n.jsx)("col",{className:"num"}),(0,n.jsx)("col",{}),(0,n.jsx)("col",{className:"num"}),(0,n.jsx)("col",{})]}),(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{colSpan:2,children:k("diff.before")}),(0,n.jsx)("th",{colSpan:2,children:k("diff.after")})]})}),(0,n.jsx)("tbody",{children:$.map(e=>"gap"===e.type?(0,n.jsx)("tr",{className:"diff-gap",children:(0,n.jsx)("td",{colSpan:4,children:(0,n.jsx)("button",{type:"button",className:"linkish small",onClick:()=>{var t;return t=e.from,void(P&&M(e=>{var s;return new Map(e).set(P.path,new Set([...null!=(s=e.get(P.path))?s:[],t]))}))},children:k("diff.gap",{n:e.count})})})},"g".concat(e.from)):(0,n.jsx)(u,{row:e.row,index:e.index,current:H>=0&&_[H]===e.index},e.index))})]})]})]})]})]})]})}function u(e){var t,s,a,i;let{row:r,index:d,current:o}=e,u="change"===r.kind?(0,c.Nj)(r.left.text,r.right.text):null,h=e=>{let t=r[e];if(!t)return null;if(!u)return t.text;let s="left"===e?u.leftEnd:u.rightEnd;return(0,n.jsxs)(l.Fragment,{children:[t.text.slice(0,u.start),(0,n.jsx)("mark",{children:t.text.slice(u.start,s)}),t.text.slice(s)]})};return(0,n.jsxs)("tr",{className:"diff-row ".concat(r.kind).concat(o?" current":""),"data-row":d,children:[(0,n.jsx)("td",{className:"num",children:null!=(a=null==(t=r.left)?void 0:t.no)?a:""}),(0,n.jsx)("td",{className:"code l".concat(r.left?"":" empty"),children:h("left")}),(0,n.jsx)("td",{className:"num",children:null!=(i=null==(s=r.right)?void 0:s.no)?i:""}),(0,n.jsx)("td",{className:"code r".concat(r.right?"":" empty"),children:h("right")})]})}},7619:(e,t,s)=>{s.d(t,{P:()=>o});var n=s(3365),l=s(1521),a=s(5549),i=s(867),r=s(7908),c=s(5132);function d(e){let{text:t,follow:s}=e,{ref:l}=(0,r.U)(s,t);return(0,n.jsx)("pre",{ref:l,className:"story-out".concat(s?" terminal":""),children:t})}function o(e){let{sessionId:t,taskId:s,runId:o,live:h}=e,{t:f}=(0,i.kj)(),[m,p]=(0,l.useState)(null),[x,g]=(0,l.useState)(""),[j,y]=(0,l.useState)(!0),[k,v]=(0,l.useState)(!0),[N,b]=(0,l.useState)(new Set),[w,S]=(0,l.useState)(new Set),[C,q]=(0,l.useState)(new Set),I=!!(null==m?void 0:m.live),F=(0,l.useRef)(0);F.current+=1;let R=(0,r.U)(I,F.current),E=(0,l.useRef)(null),L=(0,l.useRef)(!1);if((0,l.useEffect)(()=>{if(!m)return;let e=[],t=(s,n)=>s.forEach((s,l)=>{let a="".concat(n).concat(l);"review"===s.kind?t(s.entries,"".concat(a,"-")):"step"!==s.kind||s.outcome||e.push(a)});t(m.entries,"e"),e.some(e=>!w.has(e))&&S(t=>new Set([...t,...e])),m.live&&!L.current&&E.current&&(L.current=!0,E.current.scrollIntoView({block:"nearest",behavior:"smooth"}))},[m,w]),(0,l.useEffect)(()=>{let e,n=!0,l=async()=>{try{let i=await a.FH.taskStory(t,s,o);if(!n)return;p(i),g(""),(i.live||h)&&(e=setTimeout(l,2e3))}catch(t){if(!n)return;g(t.message),h&&(e=setTimeout(l,2e3))}};return l(),()=>{n=!1,e&&clearTimeout(e)}},[t,s,o,h]),x&&!m)return(0,n.jsx)("div",{className:"err small",children:x});if(!m)return(0,n.jsx)("div",{className:"muted small",children:f("story.loading")});let T=e=>N.has(e)||w.has(e)&&!C.has(e),M=e=>{let t=T(e);b(s=>{let n=new Set(s);return t?n.delete(e):n.add(e),n}),q(s=>{let n=new Set(s);return t?n.add(e):n.delete(e),n})},H=(e,t)=>{if(!("review"===e.kind?j||k:"step"===e.kind?k:j))return null;if("review"===e.kind)return(0,n.jsxs)("li",{className:"story-review",children:[(0,n.jsxs)("div",{className:"story-head",children:[(0,n.jsx)(u,{at:e.at}),(0,n.jsx)("span",{className:"chip",children:f("story.review",{n:e.round})})]}),(0,n.jsx)("ol",{className:"story",children:e.entries.map((e,s)=>H(e,"".concat(t,"-").concat(s)))})]},t);if("step"===e.kind){let s=T(t),l=!e.outcome&&m.live;return(0,n.jsxs)("li",{className:"story-step".concat(e.failed?" failed":""),children:[(0,n.jsxs)("div",{className:"story-head",children:[(0,n.jsx)(u,{at:e.at}),(0,n.jsx)("span",{className:"chip",children:f("story.step",{it:e.iteration,id:e.id})}),e.outcome&&(0,n.jsxs)("span",{className:"badge ".concat(e.failed?"failed":"done"),children:[e.outcome,void 0!==e.exitCode?" \xb7 exit ".concat(e.exitCode):"",void 0!==e.durationMs?" \xb7 ".concat((0,a.c5)(e.durationMs)):""]}),!e.outcome&&(0,n.jsx)("span",{className:"badge running",children:f("story.running")}),e.failed&&(0,n.jsx)("span",{className:"badge failed",children:f("story.failedHere")})]}),(0,n.jsx)("pre",{className:"story-cmd",children:e.command}),e.output&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:"linkish small",onClick:()=>M(t),children:s?f("story.hideOutput"):f("story.showOutput",{n:e.output.length})}),s&&(0,n.jsx)(d,{text:e.output,follow:l})]})]},t)}let s=N.has(t),l="sent"===e.kind?f("story.bot"):f("story.chat"),i="reply"===e.kind&&("blocked"===e.status||"failed"===e.status);return(0,n.jsxs)("li",{className:"story-msg ".concat(e.kind).concat(i?" failed":""),children:[(0,n.jsxs)("div",{className:"story-head",children:[(0,n.jsx)(u,{at:e.at}),(0,n.jsx)("strong",{children:l}),(0,n.jsx)("span",{className:"muted small",children:e.label}),"reply"===e.kind&&e.status&&(0,n.jsx)("span",{className:"badge ".concat(i?"failed":"done"===e.status?"done":""),children:e.status})]}),"reply"===e.kind&&e.notes&&(0,n.jsx)("p",{className:"story-notes",children:e.notes}),(0,n.jsx)("button",{type:"button",className:"linkish small",onClick:()=>M(t),children:s?f("story.hideText"):f("story.showText",{n:e.text.length})}),s&&(0,n.jsx)("pre",{className:"story-out",children:e.text})]},t)},O=m.close,D=O&&"done"!==O.status;return(0,n.jsxs)("div",{className:"story-box",ref:E,children:[(0,n.jsxs)("div",{className:"row small",style:{marginBottom:6},children:[(0,n.jsxs)("label",{className:"option-inline",children:[(0,n.jsx)("input",{type:"checkbox",checked:j,onChange:e=>y(e.target.checked)})," ",f("story.showChat")]}),(0,n.jsxs)("label",{className:"option-inline",children:[(0,n.jsx)("input",{type:"checkbox",checked:k,onChange:e=>v(e.target.checked)})," ",f("story.showCommands")]}),m.live&&(0,n.jsxs)("span",{className:"live",children:[(0,n.jsx)("span",{className:"dot","aria-hidden":"true"})," ",f("story.live")]}),m.live&&!R.following&&(0,n.jsx)("button",{type:"button",className:"quiet small",onClick:R.follow,title:f("story.followWhy"),children:f("story.follow")}),x&&(0,n.jsx)("span",{className:"err",children:x})]}),(0,n.jsxs)("div",{className:"story-fixed",children:[(0,n.jsx)("strong",{children:f("story.prompt")}),(0,n.jsx)("pre",{className:"story-out always",children:m.prompt})]}),(0,n.jsx)("div",{ref:R.ref,className:"story-scroll".concat(m.live?" live":""),children:(0,n.jsx)("ol",{className:"story",children:m.entries.map((e,t)=>H(e,"e".concat(t)))})}),O?(0,n.jsxs)("div",{className:"story-fixed close".concat(D?" failed":""),children:[(0,n.jsx)("strong",{children:D?f("story.endedBadly",{status:O.status}):f("story.ended")}),O.reason&&(0,n.jsx)("p",{className:"err small",children:O.reason}),O.summary&&(0,n.jsx)(c.s,{text:O.summary,className:"what"}),O.checks&&O.checks.length>0&&(0,n.jsx)("ul",{className:"small",style:{margin:"6px 0 0",paddingLeft:18},children:O.checks.map((e,t)=>(0,n.jsxs)("li",{className:e.passed?"":"err",children:[e.passed?"✓":"✗"," ",e.name,!e.passed&&e.detail?" — ".concat(e.detail):""]},t))})]}):(0,n.jsx)("div",{className:"story-fixed muted small",children:f("story.notEnded")})]})}function u(e){let{at:t}=e,s=(0,i.W3)(),{locale:l}=(0,i.kj)();if(!t)return null;let a=new Date(t),r="bg"===l?"bg-BG":void 0,c=a.toLocaleTimeString(r,{hour12:!1}),d=new Date().toDateString()===a.toDateString();return(0,n.jsx)("time",{className:"story-when",dateTime:t,title:s(t),children:d?c:"".concat(a.toLocaleDateString(r)," ").concat(c)})}},7908:(e,t,s)=>{s.d(t,{U:()=>l});var n=s(1521);function l(e,t){let[s,l]=(0,n.useState)(null),a=(0,n.useRef)(!0),[i,r]=(0,n.useState)(!0),c=(0,n.useCallback)(e=>l(e),[]);return(0,n.useLayoutEffect)(()=>{if(!s)return;let e=()=>{let e=s.scrollHeight-s.scrollTop-s.clientHeight<=24;a.current=e,r(e)};return s.addEventListener("scroll",e,{passive:!0}),()=>s.removeEventListener("scroll",e)},[s]),(0,n.useLayoutEffect)(()=>{s&&e&&a.current&&(s.scrollTop=s.scrollHeight)},[s,e,t]),{ref:c,following:i,follow:(0,n.useCallback)(()=>{a.current=!0,r(!0),s&&(s.scrollTop=s.scrollHeight)},[s])}}}}]);
|
|
@@ -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:()=>u,FZ:()=>r,Zm:()=>p,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 p(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 m(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 u={health:()=>m("/health"),doctor:()=>m("/doctor"),settings:()=>m("/settings"),saveSettings:t=>m("/settings",{method:"PUT",body:JSON.stringify(t)}),level1:()=>m("/level1"),setLevel1:t=>m("/level1",{method:"PUT",body:JSON.stringify({content:t})}),resetLevel1:()=>m("/level1",{method:"DELETE"}),presets:()=>m("/presets"),savePreset:(t,o)=>m("/presets/".concat(encodeURIComponent(t)),{method:"PUT",body:JSON.stringify({content:o})}),deletePreset:t=>m("/presets/".concat(encodeURIComponent(t)),{method:"DELETE"}),personas:()=>m("/personas"),savePersona:(t,o)=>m("/personas/".concat(encodeURIComponent(t)),{method:"PUT",body:JSON.stringify({content:o})}),deletePersona:t=>m("/personas/".concat(encodeURIComponent(t)),{method:"DELETE"}),sessions:()=>m("/sessions"),reorderSessions:t=>m("/sessions-order",{method:"PUT",body:JSON.stringify({ids:t})}),metrics:()=>m("/metrics"),preparePreview:function(t){let o=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return m("/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 m("/repo/prepare",{method:"POST",body:JSON.stringify({dir:t,fingerprint:o,...e})})},session:t=>m("/sessions/".concat(t)),createSession:(t,o)=>m("/sessions",{method:"POST",body:JSON.stringify({name:t,projectDir:o})}),updateSession:(t,o)=>m("/sessions/".concat(t),{method:"PUT",body:JSON.stringify(o)}),deleteSession:t=>m("/sessions/".concat(t),{method:"DELETE"}),addTask:(t,o)=>m("/sessions/".concat(t,"/tasks"),{method:"POST",body:JSON.stringify(o)}),updateTask:(t,o,e)=>m("/sessions/".concat(t,"/tasks/").concat(o),{method:"PUT",body:JSON.stringify(e)}),deleteTask:(t,o)=>m("/sessions/".concat(t,"/tasks/").concat(o),{method:"DELETE"}),continueTask:(t,o,e)=>m("/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 m("/sessions/".concat(t,"/tasks/").concat(o,"/rerun"),{method:"POST",body:JSON.stringify({...e,...n.buildOnFinished?{buildOnFinished:!0}:{}})})},taskChanges:(t,o,e)=>m("/sessions/".concat(t,"/tasks/").concat(o,"/changes").concat(e?"?run=".concat(encodeURIComponent(e)):"")),taskChangeFile:(t,o,e,n)=>m("/sessions/".concat(t,"/tasks/").concat(o,"/changes/file?path=").concat(encodeURIComponent(e)).concat(n?"&run=".concat(encodeURIComponent(n)):"")),taskStory:(t,o,e)=>m("/sessions/".concat(t,"/tasks/").concat(o,"/story").concat(e?"?run=".concat(encodeURIComponent(e)):"")),taskFiles:(t,o,e)=>m("/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)=>m("/sessions/".concat(t,"/tasks/").concat(o,"/log").concat(e?"?run=".concat(encodeURIComponent(e)):""),{method:"POST",body:"{}"}),saveTaskFile:(t,o,e,n,s)=>m("/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)=>m("/sessions/".concat(t,"/start"),{method:"POST",body:JSON.stringify({mode:o,name:e,starts:n})},{timeoutMs:12e4}),startOptions:t=>m("/start/options?sessions=".concat(encodeURIComponent(t.join(",")))),startFetch:(t,o,e)=>m("/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 m("/start/failures".concat(t?"?unanswered=1":""))},startFailureUrl:t=>i("".concat(n,"/start/failures/").concat(encodeURIComponent(t),"/report")),terminalUrl:()=>i("".concat(n,"/terminal")),stop:t=>m("/sessions/".concat(t,"/stop"),{method:"POST",body:"{}"}),approvals:t=>m("/approvals".concat(t?"?session=".concat(encodeURIComponent(t)):"")),undoPreview:(t,o)=>m("/sessions/".concat(t,"/tasks/").concat(o,"/undo")),undoTask:(t,o,e)=>m("/sessions/".concat(t,"/tasks/").concat(o,"/undo"),{method:"POST",body:JSON.stringify({how:e})}),acceptTask:(t,o,e)=>m("/sessions/".concat(t,"/tasks/").concat(o,"/accept"),{method:"POST",body:JSON.stringify((null==e?void 0:e.trim())?{note:e}:{})}),addTaskNote:(t,o,e)=>m("/sessions/".concat(t,"/tasks/").concat(o,"/notes"),{method:"POST",body:JSON.stringify({text:e})}),kerriganReport:t=>m("/kerrigan/report",{method:"POST",body:JSON.stringify(t)}),checkChanges:t=>m("/changes/check",{method:"POST",body:JSON.stringify({text:t})}),applyChanges:t=>m("/changes/apply",{method:"POST",body:JSON.stringify({text:t})}),workspace:()=>m("/workspace"),workspaceFiles:()=>m("/workspace/files"),workspaceFile:t=>m("/workspace/file?path=".concat(encodeURIComponent(t))),workspaceGit:()=>m("/workspace/git"),workspaceCommit:t=>m("/workspace/git/commit?sha=".concat(encodeURIComponent(t))),workspaceGitFile:(t,o,e)=>m("/workspace/git/file?area=".concat(t,"&path=").concat(encodeURIComponent(o)).concat(e?"&commit=".concat(encodeURIComponent(e)):"")),chatThreads:()=>m("/chat/threads"),chatSend:(t,o,e,n)=>m("/chat",{method:"POST",body:JSON.stringify({text:t,...o?{threadId:o}:{},...e?{model:e}:{},...n?{manualModel:!0}:{}})}),chatRewind:(t,o)=>m("/chat/".concat(t,"/rewind"),{method:"POST",body:JSON.stringify({taskId:o})}),repoTree:function(t){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=arguments.length>2?arguments[2]:void 0;return m("/sessions/".concat(t,"/repo/tree?path=").concat(encodeURIComponent(o)).concat(e?"&task=".concat(encodeURIComponent(e)):""))},repoFile:(t,o,e)=>m("/sessions/".concat(t,"/repo/file?path=").concat(encodeURIComponent(o)).concat(e?"&task=".concat(encodeURIComponent(e)):"")),repoLog:t=>m("/sessions/".concat(t,"/repo/log")),sessionEvents:t=>m("/sessions/".concat(t,"/events")),decidePlan:(t,o,e)=>m("/approvals/".concat(t,"/plan"),{method:"POST",body:JSON.stringify({action:o,...(null==e?void 0:e.trim())?{note:e}:{}})}),decide:(t,o)=>m("/approvals/".concat(t),{method:"POST",body:JSON.stringify({action:o})}),setRunMode:(t,o)=>m("/sessions/".concat(t,"/mode"),{method:"POST",body:JSON.stringify({mode:o})}),streamUrl:t=>i("".concat(n,"/sessions/").concat(t,"/stream")),batch:()=>m("/batch").then(t=>null!=t?t:null),startBatch:(t,o,e,n,s,c,a,i)=>m("/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=>m("/batch/name?sessions=".concat(encodeURIComponent(t.join(",")))),stopBatch:()=>m("/batch/stop",{method:"POST",body:"{}"}),pauseBatch:()=>m("/batch/pause",{method:"POST",body:"{}"}),resumeBatch:()=>m("/batch/resume",{method:"POST",body:"{}"}),planBrief:t=>m("/plan/brief?lang=".concat(encodeURIComponent(t))),context:(t,o)=>m("/context/".concat(t,"?lang=").concat(encodeURIComponent(o))),setContext:(t,o)=>m("/context/".concat(t),{method:"PUT",body:JSON.stringify({content:o})}),resetContext:(t,o)=>m("/context/".concat(t,"?lang=").concat(encodeURIComponent(o)),{method:"DELETE"}),checkPlan:t=>m("/plan/check",{method:"POST",body:JSON.stringify({text:t})}),importPlan:t=>m("/plan/import",{method:"POST",body:JSON.stringify({text:t})}),browseFolder:t=>m("/browse-folder",{method:"POST",body:JSON.stringify({start:t})},{timeoutMs:null}),tasks:()=>m("/tasks"),activity:()=>m("/activity"),downloadBundle:async t=>{var 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 p=URL.createObjectURL(await c.blob()),h=document.createElement("a");return h.href=p,h.download=l,document.body.appendChild(h),h.click(),h.remove(),setTimeout(()=>URL.revokeObjectURL(p),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()))},taskExchangeUrl:(t,o)=>i("".concat(n,"/sessions/").concat(encodeURIComponent(t),"/tasks/").concat(encodeURIComponent(o),"/exchange")),debugExportUrl:t=>i("".concat(n,"/debug/export").concat(t.length>0?"?sessions=".concat(encodeURIComponent(t.join(","))):"")),vcsStatus:t=>m("/sessions/".concat(t,"/vcs")),runVcs:t=>m("/batch/vcs?ids=".concat(encodeURIComponent(t.join(",")))),runVcsPrepare:function(t,o,e){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return m("/batch/vcs/prepare",{method:"POST",body:JSON.stringify({sessionIds:t,repoDir:o,action:e,choices:n})})},vcsSnapshot:(t,o)=>m("/sessions/".concat(t,"/vcs/snapshot"),{method:"POST",body:JSON.stringify({choices:o})}),restorePreview:(t,o)=>m("/sessions/".concat(t,"/tasks/").concat(o,"/restore")),restore:(t,o)=>m("/sessions/".concat(t,"/tasks/").concat(o,"/restore"),{method:"POST",body:"{}"}),contractCheck:(t,o)=>m("/sessions/".concat(t,"/tasks/").concat(o,"/contract")),applyContractFix:(t,o,e,n)=>m("/sessions/".concat(t,"/tasks/").concat(o,"/contract-fix"),{method:"POST",body:JSON.stringify({choices:e,expect:n})}),restartPlan:(t,o)=>m("/sessions/".concat(t,"/tasks/").concat(o,"/restart")),restartFrom:function(t,o){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return m("/sessions/".concat(t,"/tasks/").concat(o,"/restart"),{method:"POST",body:JSON.stringify(e)})},repoCheck:t=>m("/repo?dir=".concat(encodeURIComponent(t))),project:()=>m("/project"),setProject:t=>m("/project",{method:"PUT",body:JSON.stringify(t)}),models:()=>m("/models"),setDefaultModel:t=>m("/models/default",{method:"PUT",body:JSON.stringify({model:t})}),setDefaultReviewModel:t=>m("/models/review-default",{method:"PUT",body:JSON.stringify({model:t})}),refreshModels:()=>m("/models/refresh",{method:"POST",body:"{}"},{timeoutMs:null}),login:t=>m("/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")}}}]);
|