copilot-operator 0.1.69 → 0.1.75
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 +6 -3
- package/dist/src/api/operator.service.js +58 -13
- package/dist/src/api/server.js +10 -0
- package/dist/src/cli.js +3 -0
- package/dist/src/config/lockedPolicy.js +14 -0
- package/dist/src/config/schema.js +29 -0
- package/dist/src/exec/authorizer.js +47 -8
- package/dist/src/exec/dangerous.js +1 -1
- package/dist/src/exec/npmScripts.js +180 -0
- package/dist/src/exec/platforms.js +45 -1
- package/dist/src/exec/policy.js +124 -9
- package/dist/src/exec/policyManifest.js +15 -0
- package/dist/src/exec/processes.js +8 -3
- package/dist/src/exec/programs.js +6 -1
- package/dist/src/exec/redaction.js +17 -2
- package/dist/src/exec/scriptFiles.js +230 -34
- package/dist/src/exec/scriptKinds.js +86 -0
- package/dist/src/exec/stepEnv.js +9 -2
- package/dist/src/orchestrator/handoff.js +80 -29
- package/dist/src/orchestrator/hold.js +83 -4
- package/dist/src/orchestrator/leadRunner.js +5 -2
- package/dist/src/orchestrator/review.js +13 -3
- package/dist/src/orchestrator/taskRunner.js +106 -19
- package/dist/src/plan/kerrigan.js +36 -15
- package/dist/src/plan/systemGuide.js +117 -22
- package/dist/src/protocol/leadSchema.js +8 -1
- package/dist/src/protocol/replySchema.js +13 -3
- package/dist/src/protocol/reviewSchema.js +4 -1
- package/dist/src/queue/queue.js +8 -4
- package/dist/src/session/checkpoint.js +48 -0
- package/dist/src/session/compose.js +1 -1
- package/dist/src/session/story.js +14 -0
- package/dist/src/vcs/gitConfigGuard.js +126 -0
- package/dist/src/vcs/newBranch.js +76 -13
- package/dist/web/404.html +2 -2
- package/dist/web/_next/static/chunks/1024-67625a65f58057ae.js +1 -0
- package/dist/web/_next/static/chunks/1077.14d6c828d8f71111.js +1 -0
- package/dist/web/_next/static/chunks/1548.2f75926c6e664f79.js +1 -0
- package/dist/web/_next/static/chunks/2163.f9f1ad4af05520cc.js +1 -0
- package/dist/web/_next/static/chunks/714.4507656685cb9337.js +1 -0
- package/dist/web/_next/static/chunks/7220.9bc9dd9f211b11e4.js +1 -0
- package/dist/web/_next/static/chunks/7921-9aaec581982b2329.js +1 -0
- package/dist/web/_next/static/chunks/8124-a39d85dff0db6600.js +1 -0
- package/dist/web/_next/static/chunks/8584.f2cb3ca81223d626.js +1 -0
- package/dist/web/_next/static/chunks/9067.a6cb3b9157a80921.js +1 -0
- package/dist/web/_next/static/chunks/9747.15aa40a046d54a2a.js +1 -0
- package/dist/web/_next/static/chunks/9929-2e0b1d006ebd5345.js +1 -0
- package/dist/web/_next/static/chunks/app/{layout-e23bb58f3ea117d5.js → layout-52a2079ffa83c21f.js} +1 -1
- package/dist/web/_next/static/chunks/app/page-80730838a81da226.js +1 -0
- package/dist/web/_next/static/chunks/app/queue/{page-fb49cb2d3dc6d14c.js → page-82f724d0842f4870.js} +1 -1
- package/dist/web/_next/static/chunks/app/settings/page-4f3c739287d7f32e.js +1 -0
- package/dist/web/_next/static/chunks/{webpack-77c6c045264c9213.js → webpack-f9f820c51a8952c8.js} +1 -1
- package/dist/web/_next/static/css/63b30b8e1a4aa500.css +1 -0
- package/dist/web/defaults.html +2 -2
- package/dist/web/defaults.txt +8 -8
- package/dist/web/index.html +3 -3
- package/dist/web/index.txt +9 -9
- package/dist/web/queue.html +2 -2
- package/dist/web/queue.txt +9 -9
- package/dist/web/settings.html +2 -2
- package/dist/web/settings.txt +9 -9
- package/dist/web/system.html +2 -2
- package/dist/web/system.txt +9 -9
- package/package.json +3 -2
- package/prompts/level1.md +50 -27
- package/dist/web/_next/static/chunks/1024-e4e596b184e05e91.js +0 -1
- package/dist/web/_next/static/chunks/1077.b3943e5b41c4bef4.js +0 -1
- package/dist/web/_next/static/chunks/1548.0ff0c0ece685ffe7.js +0 -1
- package/dist/web/_next/static/chunks/2163.9cfb1b06beaf5001.js +0 -1
- package/dist/web/_next/static/chunks/6262-d074473db83ee798.js +0 -1
- package/dist/web/_next/static/chunks/714.bee98f5a3db75882.js +0 -1
- package/dist/web/_next/static/chunks/7220.610988766a1104b7.js +0 -1
- package/dist/web/_next/static/chunks/7921-ac5793d5663674b2.js +0 -1
- package/dist/web/_next/static/chunks/8124-665327221384ba6e.js +0 -1
- package/dist/web/_next/static/chunks/8584.9220e445a8ce2265.js +0 -1
- package/dist/web/_next/static/chunks/9067.f05516f2f2a2e8f5.js +0 -1
- package/dist/web/_next/static/chunks/9747.e249434ff7e05f4f.js +0 -1
- package/dist/web/_next/static/chunks/app/page-fd49cf4fb6681d30.js +0 -1
- package/dist/web/_next/static/chunks/app/settings/page-7d120feb5af0ace9.js +0 -1
- package/dist/web/_next/static/css/52131c6d864daf3f.css +0 -1
- /package/dist/web/_next/static/{8i6gf0zoo-KiUKdzxsCJR → 9DmRzBb0M5BZ3dvVpbFMM}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{8i6gf0zoo-KiUKdzxsCJR → 9DmRzBb0M5BZ3dvVpbFMM}/_ssgManifest.js +0 -0
|
@@ -82,6 +82,42 @@ export async function changedSince(dir, before, id) {
|
|
|
82
82
|
await git(dir, ['update-ref', '-d', ref]).catch(() => undefined);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Adds to the safety record what `git clean -f -d` would remove now: the record photographed the folder through the
|
|
87
|
+
* .gitignore of then, and a file it ignored is not in it. The record as it now is, or why it could not be kept.
|
|
88
|
+
*/
|
|
89
|
+
async function keepWhatCleanTakes(dir, ref, safety) {
|
|
90
|
+
// `clean` has no -z: one name a line, quoted C-style only where it holds a quote, a backslash or a control character.
|
|
91
|
+
const doomed = await git(dir, ['-c', 'core.quotePath=false', 'clean', '-n', '-d'], 60_000);
|
|
92
|
+
if (!doomed.ok)
|
|
93
|
+
return { problem: `git could not tell which files going back removes: ${doomed.stderr.split('\n')[0]}. Nothing was removed.` };
|
|
94
|
+
const unquote = (p) => (p.startsWith('"') && p.endsWith('"') ? p.slice(1, -1).replace(/\\(["\\])/g, '$1') : p);
|
|
95
|
+
const paths = doomed.stdout.split(/\r?\n/).filter((l) => l.startsWith('Would remove ')).map((l) => unquote(l.slice('Would remove '.length)));
|
|
96
|
+
if (paths.length === 0)
|
|
97
|
+
return { commit: safety };
|
|
98
|
+
const kept = new Set((await git(dir, ['ls-tree', '-r', '--name-only', '-z', safety], 60_000)).stdout.split('\0').filter(Boolean));
|
|
99
|
+
const missing = paths.filter((p) => (p.endsWith('/') ? ![...kept].some((k) => k.startsWith(p)) : !kept.has(p)));
|
|
100
|
+
if (missing.length === 0)
|
|
101
|
+
return { commit: safety };
|
|
102
|
+
const scratch = await mkdtemp(join(tmpdir(), 'cop-checkpoint-'));
|
|
103
|
+
const env = { ...process.env, GIT_INDEX_FILE: join(scratch, 'index') };
|
|
104
|
+
try {
|
|
105
|
+
const problem = 'the files going back would remove could not be kept first, so nothing was removed';
|
|
106
|
+
if (!(await git(dir, ['read-tree', safety], 60_000, env)).ok)
|
|
107
|
+
return { problem: `${problem}.` };
|
|
108
|
+
const add = await git(dir, ['add', '-f', '--', ...missing], 120_000, env);
|
|
109
|
+
if (!add.ok)
|
|
110
|
+
return { problem: `${problem} (${add.stderr.split('\n')[0]}).` };
|
|
111
|
+
const tree = await git(dir, ['write-tree'], 60_000, env);
|
|
112
|
+
const commit = tree.ok ? await git(dir, [...AUTHOR, 'commit-tree', tree.stdout, '-p', safety, '-m', 'files going back removes, kept with the folder as it was']) : tree;
|
|
113
|
+
if (!commit.ok || !(await git(dir, ['update-ref', ref, commit.stdout])).ok)
|
|
114
|
+
return { problem: `${problem}.` };
|
|
115
|
+
return { commit: commit.stdout };
|
|
116
|
+
}
|
|
117
|
+
finally {
|
|
118
|
+
await rm(scratch, { recursive: true, force: true }).catch(() => undefined);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
85
121
|
/**
|
|
86
122
|
* Puts the folder back as `cp` photographed it: its branch checked out at its commit, its working tree with the
|
|
87
123
|
* same uncommitted changes. The folder as it is now is photographed first, under `refs/copilot-operator/safety/`.
|
|
@@ -102,6 +138,18 @@ export async function restoreCheckpoint(dir, cp) {
|
|
|
102
138
|
: await step(['checkout', '--force', '--detach', cp.head], `${cp.head.slice(0, 8)} could not be checked out`)) ??
|
|
103
139
|
// At the commit it was on: a commit made after it, by the chat or by hand, is undone here (kept in the safety record).
|
|
104
140
|
(cp.branch ? await step(['reset', '--hard', cp.head], `${cp.branch} could not be put back at ${cp.head.slice(0, 8)}`) : null) ??
|
|
141
|
+
/*
|
|
142
|
+
* What git would remove now and the safety record does not hold — a file the .gitignore of now ignored, and the
|
|
143
|
+
* .gitignore put back does not (audit, 2026-10-27: a `.env` the chat had ignored went for good) — is added to the
|
|
144
|
+
* record first, so the clean below loses nothing.
|
|
145
|
+
*/
|
|
146
|
+
(await (async () => {
|
|
147
|
+
const kept = await keepWhatCleanTakes(dir, `refs/copilot-operator/safety/${stamp}`, safety.commit);
|
|
148
|
+
if ('problem' in kept)
|
|
149
|
+
return kept.problem;
|
|
150
|
+
safety.commit = kept.commit;
|
|
151
|
+
return null;
|
|
152
|
+
})()) ??
|
|
105
153
|
// Files made since that git does not track go; ignored ones (builds, installs) stay.
|
|
106
154
|
(await step(['clean', '-f', '-d'], 'the files made since could not be removed')) ??
|
|
107
155
|
// And the uncommitted changes as they were, untracked files included.
|
|
@@ -25,7 +25,7 @@ const TASK_HEADER = '## Task';
|
|
|
25
25
|
* and a note that is empty simply leaves nothing behind.
|
|
26
26
|
*/
|
|
27
27
|
function runnerBlock(input) {
|
|
28
|
-
const notes = [input.workDirNote, input.readOnlyNote, input.referenceNote, input.scopeNote, input.approachesNote, input.vcsNote, input.shellNote, input.planNote, input.operatorNotes].map((n) => (n ?? '').trim()).filter((n) => n.length > 0);
|
|
28
|
+
const notes = [input.workDirNote, input.readOnlyNote, input.referenceNote, input.scopeNote, input.approachesNote, input.vcsNote, input.shellNote, input.scriptsNote, input.planNote, input.operatorNotes].map((n) => (n ?? '').trim()).filter((n) => n.length > 0);
|
|
29
29
|
return notes.length > 0 ? `${notes.join('\n\n')}\n\n` : '';
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
@@ -249,6 +249,20 @@ export async function buildStory(runsDir, runId, task, live) {
|
|
|
249
249
|
if (!placedReviews.has(round))
|
|
250
250
|
entries.push(await reviewRound(join(dir, 'review', String(round)), round));
|
|
251
251
|
}
|
|
252
|
+
// Each handoff where it happened: after the last entry before it was put to the operator.
|
|
253
|
+
for (const name of (await readdir(join(dir, 'handoffs')).catch(() => [])).filter((n) => n.endsWith('.json')).sort()) {
|
|
254
|
+
const kept = await readFile(join(dir, 'handoffs', name), 'utf8').then((t) => JSON.parse(t)).catch(() => null);
|
|
255
|
+
if (!kept?.card)
|
|
256
|
+
continue;
|
|
257
|
+
const at = kept.askedAt;
|
|
258
|
+
let place = entries.length;
|
|
259
|
+
if (at) {
|
|
260
|
+
const later = entries.findIndex((e) => e.at !== undefined && e.at > at);
|
|
261
|
+
if (later >= 0)
|
|
262
|
+
place = later;
|
|
263
|
+
}
|
|
264
|
+
entries.splice(place, 0, { kind: 'handoff', revision: kept.card.revision ?? 1, card: kept.card, outcome: kept.outcome ?? 'nobody', ...(kept.answer ? { answer: clip(kept.answer) } : {}), ...(at ? { at } : {}), ...(kept.answeredAt ? { answeredAt: kept.answeredAt } : {}) });
|
|
265
|
+
}
|
|
252
266
|
const ended = task.status !== 'queued' && task.status !== 'running' && task.status !== 'waiting-approval';
|
|
253
267
|
return {
|
|
254
268
|
runId,
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The git settings a step might change so that the runner's own git runs a program (audit, 2026-10-27).
|
|
3
|
+
*
|
|
4
|
+
* The step gate refuses `git config` writes and lines that go into `.git` (`repositoryInternalsRefusal`), but it reads
|
|
5
|
+
* what a step says, and a program a step starts — a project script, a test — can write `.git\config` or the operator's
|
|
6
|
+
* `.gitconfig` with nothing in the line to show it. A filter driver, `core.worktree`, an include or an alias written
|
|
7
|
+
* there is run, or followed, by the runner's next `git status`, checkpoint or commit: with the bot's environment, no
|
|
8
|
+
* approval and no log. So the files are read before each of the chat's steps and again after it; where a key that names
|
|
9
|
+
* a program or a path changed, the file is put back as it was, and the step's result says so. Keys that only describe
|
|
10
|
+
* the repository — a branch's upstream, a remote's fetch spec, the user's name — are left as the step left them.
|
|
11
|
+
*/
|
|
12
|
+
import { existsSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
13
|
+
import { homedir } from 'node:os';
|
|
14
|
+
import { join, resolve } from 'node:path';
|
|
15
|
+
import { gitSync } from './git.js';
|
|
16
|
+
/** Keys whose value git runs, or follows to another file or folder. */
|
|
17
|
+
const NAMES_A_PROGRAM = [
|
|
18
|
+
/^filter\./,
|
|
19
|
+
/^diff\.[^.]+\.(?:textconv|command)$/,
|
|
20
|
+
/^merge\.[^.]+\.driver$/,
|
|
21
|
+
/^core\.(?:hookspath|fsmonitor|sshcommand|gitproxy|pager|editor|askpass|worktree|attributesfile|excludesfile|alternaterefscommand)$/,
|
|
22
|
+
/^credential\./,
|
|
23
|
+
/^gpg\./,
|
|
24
|
+
/^include\./,
|
|
25
|
+
/^includeif\./,
|
|
26
|
+
/^alias\./,
|
|
27
|
+
/^sequence\.editor$/,
|
|
28
|
+
/^uploadpack\./,
|
|
29
|
+
/^receive\./,
|
|
30
|
+
/^remote\.[^.]+\.(?:uploadpack|receivepack|proxy|vcs|url|pushurl)$/,
|
|
31
|
+
/^url\./,
|
|
32
|
+
/^http\./,
|
|
33
|
+
/^protocol\./,
|
|
34
|
+
/^safe\./,
|
|
35
|
+
/^difftool\./,
|
|
36
|
+
/^mergetool\./,
|
|
37
|
+
/^pager\./,
|
|
38
|
+
/^browser\./,
|
|
39
|
+
/^web\.browser$/,
|
|
40
|
+
/^man\./,
|
|
41
|
+
/^instaweb\./,
|
|
42
|
+
/^sendemail\./,
|
|
43
|
+
/^submodule\.[^.]+\.update$/,
|
|
44
|
+
/^ssh\./,
|
|
45
|
+
];
|
|
46
|
+
const dangerous = (key) => NAMES_A_PROGRAM.some((re) => re.test(key));
|
|
47
|
+
/** The configuration files a step could change: the repository's own, its worktree's, and the operator's. */
|
|
48
|
+
function configFiles(cwd) {
|
|
49
|
+
const out = [];
|
|
50
|
+
for (const name of ['config', 'config.worktree']) {
|
|
51
|
+
const r = gitSync(cwd, ['rev-parse', '--git-path', name]);
|
|
52
|
+
if (r.ok && r.stdout)
|
|
53
|
+
out.push(resolve(cwd, r.stdout));
|
|
54
|
+
}
|
|
55
|
+
const home = process.env.USERPROFILE || homedir();
|
|
56
|
+
out.push(join(home, '.gitconfig'));
|
|
57
|
+
out.push(process.env.XDG_CONFIG_HOME ? join(process.env.XDG_CONFIG_HOME, 'git', 'config') : join(home, '.config', 'git', 'config'));
|
|
58
|
+
return [...new Set(out)];
|
|
59
|
+
}
|
|
60
|
+
const bytesOf = (file) => {
|
|
61
|
+
try {
|
|
62
|
+
return existsSync(file) ? readFileSync(file) : null;
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
/** The keys of one config file, with their values, read by git itself without following includes. */
|
|
69
|
+
function keysOf(file, cwd) {
|
|
70
|
+
const out = new Map();
|
|
71
|
+
if (!existsSync(file))
|
|
72
|
+
return out;
|
|
73
|
+
const r = gitSync(cwd, ['config', '--file', file, '--no-includes', '--list', '-z']);
|
|
74
|
+
for (const entry of r.stdout.split('\0')) {
|
|
75
|
+
if (!entry)
|
|
76
|
+
continue;
|
|
77
|
+
const at = entry.indexOf('\n');
|
|
78
|
+
const key = (at < 0 ? entry : entry.slice(0, at)).toLowerCase();
|
|
79
|
+
out.set(key, `${out.get(key) ?? ''}\u0001${at < 0 ? '' : entry.slice(at + 1)}`);
|
|
80
|
+
}
|
|
81
|
+
return out;
|
|
82
|
+
}
|
|
83
|
+
/** What the chat is told of it, with the step's output. */
|
|
84
|
+
export function gitConfigMessage(changes) {
|
|
85
|
+
return (`this step changed git settings that name a program or a path git follows (${changes.flatMap((c) => c.keys).join(', ')}); ` +
|
|
86
|
+
'they were put back as they were. The runner owns the repository and runs git itself; leave its settings alone.');
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Reads the configuration now; the function it returns, called after the step, puts back each file in which a key
|
|
90
|
+
* that names a program or a path changed, and says which.
|
|
91
|
+
*/
|
|
92
|
+
export function watchGitConfig(cwd) {
|
|
93
|
+
const files = configFiles(cwd);
|
|
94
|
+
const before = files.map((file) => ({ file, bytes: bytesOf(file) }));
|
|
95
|
+
return () => {
|
|
96
|
+
const changes = [];
|
|
97
|
+
for (const { file, bytes } of before) {
|
|
98
|
+
const now = bytesOf(file);
|
|
99
|
+
if (bytes === null ? now === null : now !== null && bytes.equals(now))
|
|
100
|
+
continue;
|
|
101
|
+
const was = new Map();
|
|
102
|
+
if (bytes !== null) {
|
|
103
|
+
// Read as it was through a copy: git reads a file, and the file is no longer what it was.
|
|
104
|
+
const copy = `${file}.cop-before`;
|
|
105
|
+
try {
|
|
106
|
+
writeFileSync(copy, bytes);
|
|
107
|
+
for (const [k, v] of keysOf(copy, cwd))
|
|
108
|
+
was.set(k, v);
|
|
109
|
+
}
|
|
110
|
+
finally {
|
|
111
|
+
rmSync(copy, { force: true });
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
const is = keysOf(file, cwd);
|
|
115
|
+
const keys = [...new Set([...was.keys(), ...is.keys()])].filter((k) => was.get(k) !== is.get(k) && dangerous(k));
|
|
116
|
+
if (keys.length === 0)
|
|
117
|
+
continue;
|
|
118
|
+
if (bytes === null)
|
|
119
|
+
rmSync(file, { force: true });
|
|
120
|
+
else
|
|
121
|
+
writeFileSync(file, bytes);
|
|
122
|
+
changes.push({ file, keys });
|
|
123
|
+
}
|
|
124
|
+
return changes;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
@@ -14,7 +14,11 @@
|
|
|
14
14
|
* - taken to the new branch, as git carries changes across a checkout — refused by git, with nothing moved, when
|
|
15
15
|
* the remote's main changed the same files; then the other choice is offered;
|
|
16
16
|
* - put aside: one commit on a branch of its own (`<prefix>saved/<when>`), made with a temporary index and
|
|
17
|
-
* checked to hold every change before anything moves, then the folder is left clean on the new branch
|
|
17
|
+
* checked to hold every change before anything moves, then the folder is left clean on the new branch;
|
|
18
|
+
* - committed on the branch the folder is on (operator, 2026-10-28: "a third choice: commit them on the branch we
|
|
19
|
+
* are on, the one before we change to the new one"): one commit of all of them, the new files too, under the
|
|
20
|
+
* operator's own git name (the bot's, where git has none), checked to have left nothing out, then the new
|
|
21
|
+
* branch. Not on a detached HEAD, where no branch would hold it. Not pushed.
|
|
18
22
|
* Nothing is deleted: no branch, and no change that is not first kept. Ignored files are not touched.
|
|
19
23
|
*
|
|
20
24
|
* When the remote cannot be fetched — a password not given, no network — the operator may go on from the remote's main
|
|
@@ -140,7 +144,7 @@ export async function branchNameProblem(repoDir, name) {
|
|
|
140
144
|
* Every uncommitted change and new file, as one commit on top of HEAD on a branch of its own, made with a temporary
|
|
141
145
|
* index — then checked to hold all of them, so nothing is removed from the folder that is not kept.
|
|
142
146
|
*/
|
|
143
|
-
async function keepUncommitted(dir, head, branch, message) {
|
|
147
|
+
async function keepUncommitted(dir, head, branch, message, author) {
|
|
144
148
|
const index = join(tmpdir(), `cop-saved-index-${process.pid}-${Date.now()}`);
|
|
145
149
|
const env = { ...process.env, GIT_INDEX_FILE: index };
|
|
146
150
|
try {
|
|
@@ -158,18 +162,25 @@ async function keepUncommitted(dir, head, branch, message) {
|
|
|
158
162
|
const tree = await git(dir, ['write-tree'], 60_000, env);
|
|
159
163
|
if (!tree.ok || !tree.stdout)
|
|
160
164
|
return { problem: tree.stderr || 'git write-tree failed' };
|
|
161
|
-
const commit = await git(dir, [
|
|
165
|
+
const commit = await git(dir, [...(author ?? BOT_AUTHOR), 'commit-tree', tree.stdout, '-p', head, '-m', message]);
|
|
162
166
|
if (!commit.ok || !commit.stdout)
|
|
163
167
|
return { problem: commit.stderr || 'git commit-tree failed' };
|
|
164
|
-
|
|
165
|
-
if (
|
|
166
|
-
|
|
168
|
+
// On a branch of its own (put aside), or nowhere yet: the caller moves the branch it was made for.
|
|
169
|
+
if (branch) {
|
|
170
|
+
const made = await git(dir, ['branch', branch, commit.stdout]);
|
|
171
|
+
if (!made.ok)
|
|
172
|
+
return { problem: made.stderr || `the branch ${branch} could not be made` };
|
|
173
|
+
}
|
|
167
174
|
return { commit: commit.stdout };
|
|
168
175
|
}
|
|
169
176
|
finally {
|
|
170
177
|
await rm(index, { force: true });
|
|
171
178
|
}
|
|
172
179
|
}
|
|
180
|
+
/** The bot's own name on a commit. */
|
|
181
|
+
const BOT_AUTHOR = ['-c', 'user.name=copilot-operator', '-c', `user.email=${RUNNER_EMAIL}`];
|
|
182
|
+
/** The commit message when the operator wrote none. */
|
|
183
|
+
export const COMMIT_BEFORE_NEW_BRANCH = 'Work in progress, before a new branch from main';
|
|
173
184
|
/** Makes the branch and checks it out, after checking the folder is still what the preview showed. */
|
|
174
185
|
export async function createNewBranch(folder, opts) {
|
|
175
186
|
const plan = await planNewBranch(folder, { fetch: false });
|
|
@@ -186,15 +197,21 @@ export async function createNewBranch(folder, opts) {
|
|
|
186
197
|
const target = plan.target;
|
|
187
198
|
const targetCommit = plan.targetCommit;
|
|
188
199
|
const files = plan.changed.length + plan.untracked.length;
|
|
189
|
-
const done = async (saved) => {
|
|
200
|
+
const done = async (saved, committed) => {
|
|
190
201
|
const nowBranch = (await git(repoDir, ['symbolic-ref', '--quiet', '--short', 'HEAD'])).stdout;
|
|
191
202
|
const nowHead = (await git(repoDir, ['rev-parse', 'HEAD'])).stdout;
|
|
192
203
|
if (nowBranch !== name || nowHead !== targetCommit)
|
|
193
204
|
return { ok: false, problem: `The folder is on ${nowBranch || 'a detached HEAD'} at ${short(nowHead)}, not on ${name} at ${short(targetCommit)} as it should be.` };
|
|
194
|
-
const carried = saved ? 0 : files;
|
|
205
|
+
const carried = saved || committed ? 0 : files;
|
|
195
206
|
const result = `The folder is on the new branch ${name}, made from ${target} (${short(targetCommit)}).` +
|
|
196
|
-
(saved
|
|
197
|
-
|
|
207
|
+
(saved
|
|
208
|
+
? ` What was not committed is kept on ${saved.branch} (${saved.files} file(s)).`
|
|
209
|
+
: committed
|
|
210
|
+
? ` What was not committed is committed on ${committed.branch} as ${short(committed.commit)} (${committed.files} file(s)), not pushed.`
|
|
211
|
+
: carried > 0
|
|
212
|
+
? ` ${carried} uncommitted file(s) came with it.`
|
|
213
|
+
: '');
|
|
214
|
+
return { ok: true, branch: name, commit: targetCommit, target, ...(saved ? { saved } : {}), ...(committed ? { committed } : {}), carried, result };
|
|
198
215
|
};
|
|
199
216
|
if (files === 0 || opts.carry === 'take') {
|
|
200
217
|
// As git carries changes across a checkout; it refuses, and moves nothing, when a change would be overwritten.
|
|
@@ -208,6 +225,48 @@ export async function createNewBranch(folder, opts) {
|
|
|
208
225
|
}
|
|
209
226
|
return done();
|
|
210
227
|
}
|
|
228
|
+
/*
|
|
229
|
+
* Committed on the branch the folder is on (2026-10-28): every change and new file in one commit there, under the
|
|
230
|
+
* operator's own git name — it is their branch — or the bot's where git has none. Made as putting aside is, with a
|
|
231
|
+
* temporary index, and checked to hold everything, so nothing in the folder or its index is touched until it is
|
|
232
|
+
* whole; then the branch is moved to it, only if it is still where it was, and the index read from it. The
|
|
233
|
+
* repository's hooks are not run, as for every git the bot runs (`SAFE_GIT`).
|
|
234
|
+
*/
|
|
235
|
+
if (opts.carry === 'commit') {
|
|
236
|
+
const here = plan.branch;
|
|
237
|
+
const head = plan.head;
|
|
238
|
+
if (!here)
|
|
239
|
+
return { ok: false, problem: 'The folder is on a detached HEAD: there is no branch to commit them on. Take them to the new branch or put them aside; nothing was moved.' };
|
|
240
|
+
if (!head)
|
|
241
|
+
return { ok: false, problem: `${here} has no commit yet to commit them on top of. Make a first commit, then try again; nothing was moved.` };
|
|
242
|
+
const own = (await git(repoDir, ['config', 'user.email'])).stdout && (await git(repoDir, ['config', 'user.name'])).stdout;
|
|
243
|
+
const message = [
|
|
244
|
+
opts.message?.trim() || COMMIT_BEFORE_NEW_BRANCH,
|
|
245
|
+
'',
|
|
246
|
+
`Committed on ${here} before the new branch ${name} was made from ${target} (${short(targetCommit)}).`,
|
|
247
|
+
'',
|
|
248
|
+
...[...plan.changed.map((p) => `- changed: ${p}`), ...plan.untracked.map((p) => `- new: ${p}`)].slice(0, 300),
|
|
249
|
+
'',
|
|
250
|
+
].join('\n');
|
|
251
|
+
const made = await keepUncommitted(repoDir, head, null, message, own ? [] : BOT_AUTHOR);
|
|
252
|
+
if ('problem' in made)
|
|
253
|
+
return { ok: false, problem: `The changes could not be committed on ${here}: ${made.problem}` };
|
|
254
|
+
const moved = await git(repoDir, ['update-ref', '-m', 'copilot-operator: commit before a new branch from main', `refs/heads/${here}`, made.commit, head]);
|
|
255
|
+
if (!moved.ok)
|
|
256
|
+
return { ok: false, problem: `${here} moved while the commit was made (${moved.stderr.split(/\r?\n/)[0]}); nothing was changed. Look at it again.` };
|
|
257
|
+
// The index as the new commit has it: the folder already does.
|
|
258
|
+
const indexed = await git(repoDir, ['read-tree', 'HEAD'], 120_000);
|
|
259
|
+
if (!indexed.ok)
|
|
260
|
+
return { ok: false, problem: `${here} has the commit ${short(made.commit)}, but the index could not be read from it (${indexed.stderr.split(/\r?\n/)[0]}), so the folder was not moved.` };
|
|
261
|
+
const left = await git(repoDir, ['status', '--porcelain']);
|
|
262
|
+
if (!left.ok || left.stdout.trim()) {
|
|
263
|
+
return { ok: false, problem: `${here} has the commit ${short(made.commit)}, but not every change is in it (${lines(left.stdout).slice(0, 5).join(', ') || left.stderr}), so the folder was not moved.` };
|
|
264
|
+
}
|
|
265
|
+
const switched = await git(repoDir, ['switch', '--quiet', '--no-track', '-c', name, targetCommit], 300_000);
|
|
266
|
+
if (!switched.ok)
|
|
267
|
+
return { ok: false, problem: `What was not committed is committed on ${here} as ${short(made.commit)}, but the new branch could not be made: ${(switched.stderr || switched.stdout).split(/\r?\n/)[0]}.` };
|
|
268
|
+
return done(undefined, { branch: here, commit: made.commit, files });
|
|
269
|
+
}
|
|
211
270
|
// Put aside: kept first, checked whole; only then is the folder moved, and left clean.
|
|
212
271
|
const head = plan.head;
|
|
213
272
|
if (!head)
|
|
@@ -231,9 +290,13 @@ export async function createNewBranch(folder, opts) {
|
|
|
231
290
|
const moved = await git(repoDir, ['switch', '--quiet', '--no-track', '--discard-changes', '-c', name, targetCommit], 300_000);
|
|
232
291
|
if (!moved.ok)
|
|
233
292
|
return { ok: false, problem: `The branch could not be made: ${(moved.stderr || moved.stdout).split(/\r?\n/)[0]}. What was not committed is kept on ${saved}.` };
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
293
|
+
/*
|
|
294
|
+
* The new files, kept on the saved branch, out of the folder — those and no others (audit, 2026-10-27): a plain
|
|
295
|
+
* `clean` also took a file the old branch's .gitignore ignored and the new one's does not, which was never saved.
|
|
296
|
+
* Named a hundred at a time, literally, so a name is never read as a pattern.
|
|
297
|
+
*/
|
|
298
|
+
for (let i = 0; i < plan.untracked.length; i += 100) {
|
|
299
|
+
const cleaned = await git(repoDir, ['--literal-pathspecs', 'clean', '-fd', '--quiet', '--', ...plan.untracked.slice(i, i + 100)], 300_000);
|
|
237
300
|
if (!cleaned.ok)
|
|
238
301
|
return { ok: false, problem: `The new branch ${name} is made, but the new files could not be taken out of the folder: ${cleaned.stderr}. They are kept on ${saved}.` };
|
|
239
302
|
}
|
package/dist/web/404.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--9DmRzBb0M5BZ3dvVpbFMM--><html lang="en" data-theme="light" data-textsize="normal" data-contrast="normal" data-motion="normal" data-links="plain" data-focus="normal" data-night="off"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/63b30b8e1a4aa500.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-f9f820c51a8952c8.js"/><script src="/_next/static/chunks/c7879cf7-fabe25011515220e.js" async=""></script><script src="/_next/static/chunks/3131-8ec8b632ebf0450d.js" async=""></script><script src="/_next/static/chunks/main-app-d23441ca81b3a063.js" async=""></script><script src="/_next/static/chunks/8197-e2fcb43f38a2b4a7.js" async=""></script><script src="/_next/static/chunks/7921-9aaec581982b2329.js" async=""></script><script src="/_next/static/chunks/9929-2e0b1d006ebd5345.js" async=""></script><script src="/_next/static/chunks/8124-a39d85dff0db6600.js" async=""></script><script src="/_next/static/chunks/app/layout-52a2079ffa83c21f.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."/><link rel="icon" href="/icon.svg?23b6e9b8199c9069" type="image/svg+xml" sizes="any"/><script>(function(){try{
|
|
2
2
|
var d=document.documentElement,raw=localStorage.getItem('cop.appearance'),a=raw?JSON.parse(raw):{};
|
|
3
3
|
if(!a||typeof a!=='object')a={};
|
|
4
4
|
d.dataset.theme=a.theme==='dark'||a.theme==='light'?a.theme:window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light';
|
|
@@ -11,4 +11,4 @@ d.dataset.night=a.nightLight?'on':'off';
|
|
|
11
11
|
d.dataset.cursor=a.systemCursor?'system':'own';
|
|
12
12
|
var l=(localStorage.getItem('cop.locale')||'').toLowerCase();
|
|
13
13
|
if(["ar"].indexOf(l)>=0){d.dir='rtl';d.lang=l;}
|
|
14
|
-
}catch(e){}})();</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 class="brand-link" href="/"><svg class="brand-logo" viewBox="0 0 200 120" aria-hidden="true" focusable="false"><defs><mask id="cop-logo-R56db" maskUnits="userSpaceOnUse" x="0" y="0" width="200" height="120"><rect width="200" height="120" fill="#fff"></rect><path d="M50 3L94 60L94 62.6L69.5 89.6L30.5 89.6L6 62.6L6 60Z" transform="translate(104 14) scale(0.74) rotate(42 50 50)" fill="#000" stroke="#000" stroke-width="18" stroke-linejoin="round"></path></mask></defs><g mask="url(#cop-logo-R56db)" fill="none" stroke="var(--logo-orbit)" stroke-linecap="round"><ellipse cx="96" cy="64" rx="86" ry="36" transform="rotate(-25 96 64)" stroke-width="6.5"></ellipse><path d="M70 104 C112 124 166 112 186 86 C194 74 192 60 184 52" stroke-width="6"></path><path d="M22 28 C18 42 22 56 34 70" stroke-width="2.4"></path></g><path class="brand-plane" d="M50 3C54.6 3 56.6 8.2 56.6 14.5L56.6 35.5L91.5 55.8C93.2 56.8 94 58.2 94 60L94 62.6L56.6 52.8L55.4 74.5L69.5 84.6L69.5 89.6L52.6 85.6L50 89.8L47.4 85.6L30.5 89.6L30.5 84.6L44.6 74.5L43.4 52.8L6 62.6L6 60C6 58.2 6.8 56.8 8.5 55.8L43.4 35.5L43.4 14.5C43.4 8.2 45.4 3 50 3Z" transform="translate(104 14) scale(0.74) rotate(42 50 50)" fill="var(--logo-plane)"></path></svg>copilot-operator</a></h1><nav aria-label="Main"><a href="/"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v11H9l-5 4zM8 9h8M8 12h5" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Chat</span></a><a href="/queue"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 6h16M4 12h16M4 18h10M17 16l3 2-3 2z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"></path></svg><span>Queue</span></a><a href="/settings"><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="/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><span class="nav-pair"><button type="button" class="lang-btn ap-btn" aria-label="Appearance: theme and text" title="Appearance: theme and text" aria-expanded="false"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true"><circle cx="12" cy="12" r="8.5"></circle><path d="M12 3.5a8.5 8.5 0 0 1 0 17z" fill="currentColor" stroke="none"></path></svg><span aria-hidden="true">Appearance</span></button><span class="lang-menu"><button type="button" class="lang-btn" aria-haspopup="menu" aria-expanded="false" title="The language of the interface"><svg class="lang-globe" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6.5" fill="none" stroke="currentColor" stroke-width="1.3"></circle><path d="M1.5 8h13M8 1.5c2 2 2.8 4 2.8 6.5S10 12.5 8 14.5M8 1.5C6 3.5 5.2 5.5 5.2 8S6 12.5 8 14.5" fill="none" stroke="currentColor" stroke-width="1.1"></path></svg><span lang="en">Language</span><span aria-hidden="true">▾</span></button></span></span></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-77c6c045264c9213.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[98078,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-ac5793d5663674b2.js\",\"6262\",\"static/chunks/6262-d074473db83ee798.js\",\"8124\",\"static/chunks/8124-665327221384ba6e.js\",\"7177\",\"static/chunks/app/layout-e23bb58f3ea117d5.js\"],\"AppearanceProvider\"]\n3:I[8205,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-ac5793d5663674b2.js\",\"6262\",\"static/chunks/6262-d074473db83ee798.js\",\"8124\",\"static/chunks/8124-665327221384ba6e.js\",\"7177\",\"static/chunks/app/layout-e23bb58f3ea117d5.js\"],\"LanguageProvider\"]\n4:I[51035,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-ac5793d5663674b2.js\",\"6262\",\"static/chunks/6262-d074473db83ee798.js\",\"8124\",\"static/chunks/8124-665327221384ba6e.js\",\"7177\",\"static/chunks/app/layout-e23bb58f3ea117d5.js\"],\"DialogHost\"]\n5:I[16752,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-ac5793d5663674b2.js\",\"6262\",\"static/chunks/6262-d074473db83ee798.js\",\"8124\",\"static/chunks/8124-665327221384ba6e.js\",\"7177\",\"static/chunks/app/layout-e23bb58f3ea117d5.js\"],\"SkipLink\"]\n6:I[98333,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-ac5793d5663674b2.js\",\"6262\",\"static/chunks/6262-d074473db83ee798.js\",\"8124\",\"static/chunks/8124-665327221384ba6e.js\",\"7177\",\"static/chunks/app/layout-e23bb58f3ea117d5.js\"],\"Shell\"]\n7:I[25204,[],\"\"]\n8:I[42642,[],\"\"]\n9:I[87712,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-ac5793d5663674b2.js\",\"6262\",\"static/chunks/6262-d074473db83ee798.js\",\"8124\",\"static/chunks/8124-665327221384ba6e.js\",\"7177\",\"static/chunks/app/layout-e23bb58f3ea117d5.js\"],\"ScrollJump\"]\na:I[60433,[],\"OutletBoundary\"]\nc:I[19884,[],\"AsyncMetadataOutlet\"]\ne:I[60433,[],\"ViewportBoundary\"]\n10:I[60433,[],\"MetadataBoundary\"]\n11:\"$Sreact.suspense\"\n13:I[3536,[],\"\"]\n:HL[\"/_next/static/css/52131c6d864daf3f.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"8i6gf0zoo-KiUKdzxsCJR\",\"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/52131c6d864daf3f.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\",\"data-night\":\"off\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"(function(){try{\\nvar d=document.documentElement,raw=localStorage.getItem('cop.appearance'),a=raw?JSON.parse(raw):{};\\nif(!a||typeof a!=='object')a={};\\nd.dataset.theme=a.theme==='dark'||a.theme==='light'?a.theme:window.matchMedia\u0026\u0026window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light';\\nd.dataset.textsize=[\\\"smallest\\\",\\\"verysmall\\\",\\\"compact\\\",\\\"small\\\",\\\"normal\\\",\\\"large\\\",\\\"huge\\\",\\\"giant\\\"].indexOf(a.textSize)\u003e=0?a.textSize:'normal';\\nd.dataset.contrast=a.highContrast?'high':'normal';\\nd.dataset.motion=a.reduceMotion?'reduced':'normal';\\nd.dataset.links=a.underlineLinks?'underline':'plain';\\nd.dataset.focus=a.strongFocus?'strong':'normal';\\nd.dataset.night=a.nightLight?'on':'off';\\nd.dataset.cursor=a.systemCursor?'system':'own';\\nvar l=(localStorage.getItem('cop.locale')||'').toLowerCase();\\nif([\\\"ar\\\"].indexOf(l)\u003e=0){d.dir='rtl';d.lang=l;}\\n}catch(e){}})();\"}}]}],[\"$\",\"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,{}]]}]}]}]}]]}]]}],{\"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,[\"$\",\"$La\",null,{\"children\":[\"$Lb\",[\"$\",\"$Lc\",null,{\"promise\":\"$@d\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$Le\",null,{\"children\":\"$Lf\"}],null],[\"$\",\"$L10\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$11\",null,{\"fallback\":null,\"children\":\"$L12\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$13\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"f:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\nb:null\n"])</script><script>self.__next_f.push([1,"14:I[66644,[],\"IconMark\"]\nd:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"copilot-operator\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Runs task loops with Microsoft 365 Copilot on this machine.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/icon.svg?23b6e9b8199c9069\",\"type\":\"image/svg+xml\",\"sizes\":\"any\"}],[\"$\",\"$L14\",\"3\",{}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"12:\"$d:metadata\"\n"])</script></body></html>
|
|
14
|
+
}catch(e){}})();</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 class="brand-link" href="/"><svg class="brand-logo" viewBox="0 0 200 120" aria-hidden="true" focusable="false"><defs><mask id="cop-logo-R56db" maskUnits="userSpaceOnUse" x="0" y="0" width="200" height="120"><rect width="200" height="120" fill="#fff"></rect><path d="M50 3L94 60L94 62.6L69.5 89.6L30.5 89.6L6 62.6L6 60Z" transform="translate(104 14) scale(0.74) rotate(42 50 50)" fill="#000" stroke="#000" stroke-width="18" stroke-linejoin="round"></path></mask></defs><g mask="url(#cop-logo-R56db)" fill="none" stroke="var(--logo-orbit)" stroke-linecap="round"><ellipse cx="96" cy="64" rx="86" ry="36" transform="rotate(-25 96 64)" stroke-width="6.5"></ellipse><path d="M70 104 C112 124 166 112 186 86 C194 74 192 60 184 52" stroke-width="6"></path><path d="M22 28 C18 42 22 56 34 70" stroke-width="2.4"></path></g><path class="brand-plane" d="M50 3C54.6 3 56.6 8.2 56.6 14.5L56.6 35.5L91.5 55.8C93.2 56.8 94 58.2 94 60L94 62.6L56.6 52.8L55.4 74.5L69.5 84.6L69.5 89.6L52.6 85.6L50 89.8L47.4 85.6L30.5 89.6L30.5 84.6L44.6 74.5L43.4 52.8L6 62.6L6 60C6 58.2 6.8 56.8 8.5 55.8L43.4 35.5L43.4 14.5C43.4 8.2 45.4 3 50 3Z" transform="translate(104 14) scale(0.74) rotate(42 50 50)" fill="var(--logo-plane)"></path></svg>copilot-operator</a></h1><nav aria-label="Main"><a href="/"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v11H9l-5 4zM8 9h8M8 12h5" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Chat</span></a><a href="/queue"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 6h16M4 12h16M4 18h10M17 16l3 2-3 2z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"></path></svg><span>Queue</span></a><a href="/settings"><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="/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><span class="nav-pair"><button type="button" class="lang-btn ap-btn" aria-label="Appearance: theme and text" title="Appearance: theme and text" aria-expanded="false"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true"><circle cx="12" cy="12" r="8.5"></circle><path d="M12 3.5a8.5 8.5 0 0 1 0 17z" fill="currentColor" stroke="none"></path></svg><span aria-hidden="true">Appearance</span></button><span class="lang-menu"><button type="button" class="lang-btn" aria-haspopup="menu" aria-expanded="false" title="The language of the interface"><svg class="lang-globe" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6.5" fill="none" stroke="currentColor" stroke-width="1.3"></circle><path d="M1.5 8h13M8 1.5c2 2 2.8 4 2.8 6.5S10 12.5 8 14.5M8 1.5C6 3.5 5.2 5.5 5.2 8S6 12.5 8 14.5" fill="none" stroke="currentColor" stroke-width="1.1"></path></svg><span lang="en">Language</span><span aria-hidden="true">▾</span></button></span></span></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-f9f820c51a8952c8.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[98078,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-9aaec581982b2329.js\",\"9929\",\"static/chunks/9929-2e0b1d006ebd5345.js\",\"8124\",\"static/chunks/8124-a39d85dff0db6600.js\",\"7177\",\"static/chunks/app/layout-52a2079ffa83c21f.js\"],\"AppearanceProvider\"]\n3:I[8205,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-9aaec581982b2329.js\",\"9929\",\"static/chunks/9929-2e0b1d006ebd5345.js\",\"8124\",\"static/chunks/8124-a39d85dff0db6600.js\",\"7177\",\"static/chunks/app/layout-52a2079ffa83c21f.js\"],\"LanguageProvider\"]\n4:I[51035,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-9aaec581982b2329.js\",\"9929\",\"static/chunks/9929-2e0b1d006ebd5345.js\",\"8124\",\"static/chunks/8124-a39d85dff0db6600.js\",\"7177\",\"static/chunks/app/layout-52a2079ffa83c21f.js\"],\"DialogHost\"]\n5:I[16752,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-9aaec581982b2329.js\",\"9929\",\"static/chunks/9929-2e0b1d006ebd5345.js\",\"8124\",\"static/chunks/8124-a39d85dff0db6600.js\",\"7177\",\"static/chunks/app/layout-52a2079ffa83c21f.js\"],\"SkipLink\"]\n6:I[98333,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-9aaec581982b2329.js\",\"9929\",\"static/chunks/9929-2e0b1d006ebd5345.js\",\"8124\",\"static/chunks/8124-a39d85dff0db6600.js\",\"7177\",\"static/chunks/app/layout-52a2079ffa83c21f.js\"],\"Shell\"]\n7:I[25204,[],\"\"]\n8:I[42642,[],\"\"]\n9:I[87712,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-9aaec581982b2329.js\",\"9929\",\"static/chunks/9929-2e0b1d006ebd5345.js\",\"8124\",\"static/chunks/8124-a39d85dff0db6600.js\",\"7177\",\"static/chunks/app/layout-52a2079ffa83c21f.js\"],\"ScrollJump\"]\na:I[60433,[],\"OutletBoundary\"]\nc:I[19884,[],\"AsyncMetadataOutlet\"]\ne:I[60433,[],\"ViewportBoundary\"]\n10:I[60433,[],\"MetadataBoundary\"]\n11:\"$Sreact.suspense\"\n13:I[3536,[],\"\"]\n:HL[\"/_next/static/css/63b30b8e1a4aa500.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"9DmRzBb0M5BZ3dvVpbFMM\",\"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/63b30b8e1a4aa500.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\",\"data-night\":\"off\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"(function(){try{\\nvar d=document.documentElement,raw=localStorage.getItem('cop.appearance'),a=raw?JSON.parse(raw):{};\\nif(!a||typeof a!=='object')a={};\\nd.dataset.theme=a.theme==='dark'||a.theme==='light'?a.theme:window.matchMedia\u0026\u0026window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light';\\nd.dataset.textsize=[\\\"smallest\\\",\\\"verysmall\\\",\\\"compact\\\",\\\"small\\\",\\\"normal\\\",\\\"large\\\",\\\"huge\\\",\\\"giant\\\"].indexOf(a.textSize)\u003e=0?a.textSize:'normal';\\nd.dataset.contrast=a.highContrast?'high':'normal';\\nd.dataset.motion=a.reduceMotion?'reduced':'normal';\\nd.dataset.links=a.underlineLinks?'underline':'plain';\\nd.dataset.focus=a.strongFocus?'strong':'normal';\\nd.dataset.night=a.nightLight?'on':'off';\\nd.dataset.cursor=a.systemCursor?'system':'own';\\nvar l=(localStorage.getItem('cop.locale')||'').toLowerCase();\\nif([\\\"ar\\\"].indexOf(l)\u003e=0){d.dir='rtl';d.lang=l;}\\n}catch(e){}})();\"}}]}],[\"$\",\"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,{}]]}]}]}]}]]}]]}],{\"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,[\"$\",\"$La\",null,{\"children\":[\"$Lb\",[\"$\",\"$Lc\",null,{\"promise\":\"$@d\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$Le\",null,{\"children\":\"$Lf\"}],null],[\"$\",\"$L10\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$11\",null,{\"fallback\":null,\"children\":\"$L12\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$13\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"f:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\nb:null\n"])</script><script>self.__next_f.push([1,"14:I[66644,[],\"IconMark\"]\nd:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"copilot-operator\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Runs task loops with Microsoft 365 Copilot on this machine.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/icon.svg?23b6e9b8199c9069\",\"type\":\"image/svg+xml\",\"sizes\":\"any\"}],[\"$\",\"$L14\",\"3\",{}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"12:\"$d:metadata\"\n"])</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1024],{24784:(e,s,t)=>{t.d(s,{Yb:()=>i,u:()=>l});var n=t(73365),a=t(1521),r=t(15549),o=t(8205);let l="::by-hand::";function i(e){var s,t,i;let{id:d,chosen:c,onChange:p,none:u,byHand:m,catalogue:h,disabled:v=!1,style:x}=e,{t:j}=(0,o.kj)(),k=function(e){let[s,t]=(0,a.useState)(null);return(0,a.useEffect)(()=>{if(void 0!==e)return;let s=!0;return r.FH.models().then(e=>{s&&t(e)}).catch(()=>void 0),()=>{s=!1}},[e]),void 0!==e?e:s}(h),w=null!=(s=null==k?void 0:k.options)?s:[],y=e=>e.toLowerCase().replace(/[-‐‑‒–—_]+/g," ").replace(/\s+/g," ").trim(),b=c&&c!==l?w.find(e=>y(e.name)===y(c)):void 0,N=null!=(t=null==b?void 0:b.name)?t:c,f=!!b||c===l&&void 0!==m,g=w.filter(e=>!e.group),C=new Map;for(let e of w)e.group&&C.set(e.group,[...null!=(i=C.get(e.group))?i:[],e]);return(0,n.jsxs)("select",{id:d,value:N,onChange:e=>p(e.target.value),disabled:v,style:{width:"auto",minWidth:280,...x},children:[void 0!==m&&(0,n.jsx)("option",{value:l,children:m}),void 0!==u&&(0,n.jsx)("option",{value:"",children:u}),c&&!f&&(0,n.jsx)("option",{value:c,children:j("model.notInList",{name:c})}),g.map(e=>(0,n.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(j("model.unavailable")):""]},e.name)),[...C.entries()].map(e=>{let[s,t]=e;return(0,n.jsx)("optgroup",{label:s,children:t.map(e=>(0,n.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(j("model.unavailable")):""]},e.name))},s)})]})}},34982:(e,s,t)=>{t.d(s,{a:()=>m});var n=t(73365),a=t(1521),r=t(8205),o=t(33389),l=t(24872),i=t(79717),d=t(65132),c=t(68176);let p={same:"retry.same",fresh:"retry.fresh",continue:"retry.continue",restore:"retry.restore",accept:"retry.accept"},u={plan:"pk.waitsPlan",question:"pk.waitsQuestion",retry:"pk.waitsRetry",command:"pk.waitsCommand",model:"pk.waitsModel",password:"pk.waitsPassword"};function m(e){var s,t;let{parked:m,onAnswer:h}=e,{t:v}=(0,r.kj)(),x=(0,r.W3)(),j=(0,a.useId)(),[k,w]=(0,a.useState)(""),{locked:y,err:b,choose:N,mark:f}=(0,o.p)(),[g,C]=(0,a.useState)(""),q=m.approval,F=async(e,s)=>{await N(e,()=>h(s))&&C("stop"in s?"stopped":"answered")};return m.answer||g?(0,n.jsx)("p",{className:"small pk-answered",role:"status",children:v("stopped"===g?"pk.stopped":"pk.answered")}):(0,n.jsxs)("div",{className:"pk",role:"group","aria-label":v("pk.title"),children:[(0,n.jsxs)("p",{className:"small pk-head",children:[(0,n.jsx)("strong",{children:v("pk.title")})," ",(0,n.jsx)("span",{className:"muted",children:v("pk.since",{at:x(m.at),what:v(u[m.kind])})})]}),"plan"===m.kind&&q.plan&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.D,{plan:q.plan.plan,showApproval:!1}),(0,n.jsx)("label",{htmlFor:"".concat(j,"-note"),className:"small",children:v("pk.note")}),(0,n.jsx)("textarea",{id:"".concat(j,"-note"),className:"prose",rows:2,value:k,onChange:e=>w(e.target.value),disabled:y}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("button",{type:"button",className:"primary",...f("approve"),onClick:()=>void F("approve",{decision:"approve",...k.trim()?{note:k.trim()}:{}}),children:v("pk.approve")}),(0,n.jsx)("button",{type:"button",...f("revise"),disabled:y||!k.trim(),onClick:()=>void F("revise",{decision:"revise",note:k.trim()}),title:k.trim()?void 0:v("pk.reviseWhy"),children:v("pk.revise")})]})]}),"question"===m.kind&&(null==(s=q.question)?void 0:s.handoff)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Lp,{card:q.question.handoff,why:q.question.text}),(0,n.jsx)("label",{htmlFor:"".concat(j,"-out"),className:"small",children:v("ho.output")}),(0,n.jsx)("textarea",{id:"".concat(j,"-out"),className:"prose",rows:4,dir:"ltr",value:k,onChange:e=>w(e.target.value),placeholder:v("ho.outputPlaceholder"),disabled:y}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("button",{type:"button",className:"primary",...f("ran"),disabled:y||!k.trim(),onClick:()=>void F("ran",{answer:k.trim(),ran:!0,outcome:"ran"}),children:v("ho.send")}),(0,n.jsx)("button",{type:"button",...f("revise"),disabled:y||!k.trim(),onClick:()=>void F("revise",{answer:k.trim(),outcome:"revise"}),title:v("pk.handoffReviseWhy"),children:v("ho.revise")}),(0,n.jsx)("button",{type:"button",...f("declined"),onClick:()=>void F("declined",{answer:k.trim(),ran:!1,outcome:"declined"}),title:v("ho.notRunWhy"),children:v("ho.notRun")})]})]}),"question"===m.kind&&q.question&&!q.question.handoff&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.s,{text:q.question.text}),q.question.why&&(0,n.jsx)("p",{className:"muted small",children:q.question.why}),(0,n.jsx)("div",{className:"cs-copy-row",children:(0,n.jsx)(l.i,{text:[q.question.text,null!=(t=q.question.why)?t:"",...q.question.options.map((e,s)=>"".concat(s+1,". ").concat(e))].filter(Boolean).join("\n"),what:"chat.copyQuestion"})}),q.question.options.length>0&&(0,n.jsx)("div",{className:"row cs-options",children:q.question.options.map((e,s)=>(0,n.jsx)("button",{type:"button",className:0===s?"primary cs-option":"cs-option",...f("option-".concat(s)),onClick:()=>void F("option-".concat(s),{answer:e}),children:e},e))}),(0,n.jsx)("label",{htmlFor:"".concat(j,"-answer"),className:"small",children:v("lead.answer")}),(0,n.jsx)("textarea",{id:"".concat(j,"-answer"),className:"prose",rows:2,value:k,onChange:e=>w(e.target.value),disabled:y}),(0,n.jsx)("div",{className:"row",children:(0,n.jsx)("button",{type:"button",className:"primary",...f("written"),disabled:y||!k.trim(),onClick:()=>void F("written",{answer:k.trim()}),children:v("lead.send")})})]}),"retry"===m.kind&&q.retry&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("p",{className:"small",children:[v("retry.title",{n:q.retry.n})," — ",q.retry.title]}),q.retry.reason&&(0,n.jsx)("p",{className:"small",children:v("retry.reason",{reason:q.retry.reason})}),"unknown"===q.retry.sideEffects&&(0,n.jsx)("p",{className:"reason small",children:v("retry.unknown")}),(0,n.jsx)("div",{className:"row",children:q.retry.choices.map((e,s)=>(0,n.jsx)("button",{type:"button",className:0===s?"primary":void 0,...f(e),onClick:()=>void F(e,{choice:e}),children:v(p[e])},e))})]}),"command"===m.kind&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("pre",{className:"cs-out",children:q.description}),q.platform&&(0,n.jsx)("p",{className:"reason small",children:v("approval.platform",{platform:q.platform})}),q.readOnly&&(0,n.jsx)("p",{className:"reason small",children:v("approval.readOnly")}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("button",{type:"button",className:"primary",...f("run"),onClick:()=>void F("run",{decision:"run"}),children:v("pk.run")}),(0,n.jsx)("button",{type:"button",...f("skip"),onClick:()=>void F("skip",{decision:"skip"}),children:v("pk.skip")})]})]}),("model"===m.kind||"password"===m.kind)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"small",children:v("model"===m.kind?"pk.modelWhy":"pk.passwordWhy")}),(0,n.jsx)("div",{className:"row",children:(0,n.jsx)("button",{type:"button",className:"primary",...f("resume"),onClick:()=>void F("resume",{resume:!0}),children:v("pk.resume")})})]}),(0,n.jsx)("div",{className:"row pk-stop",children:(0,n.jsx)("button",{type:"button",className:"quiet",...f("stop"),onClick:()=>void F("stop",{stop:!0}),children:v("pk.stop")})}),b&&(0,n.jsx)("p",{className:"err",role:"alert",children:b})]})}},41370:(e,s,t)=>{t.d(s,{q:()=>a});var n=t(1521);function a(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:450,[t,a]=(0,n.useState)(1);return(0,n.useEffect)(()=>{if(!e)return void a(1);let t=window.setInterval(()=>a(e=>e%3+1),s);return()=>window.clearInterval(t)},[e,s]),".".repeat(t)}}}]);
|