copilot-operator 0.1.63 → 0.1.66
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 +53 -3
- package/dist/src/api/operator.service.js +479 -57
- package/dist/src/exec/dangerous.js +12 -0
- package/dist/src/exec/runner.js +75 -2
- package/dist/src/exec/stepEnv.js +13 -2
- package/dist/src/orchestrator/taskRunner.js +12 -1
- package/dist/src/plan/kerrigan.js +63 -10
- package/dist/src/plan/systemGuide.js +202 -2
- package/dist/src/queue/queue.js +71 -4
- package/dist/src/queue/queueBranch.js +66 -0
- package/dist/src/session/compose.js +15 -0
- package/dist/src/session/store.js +4 -0
- package/dist/src/vcs/newBranch.js +241 -0
- package/dist/src/vcs/remoteAuth.js +119 -0
- package/dist/web/404.html +2 -2
- package/dist/web/_next/static/chunks/1024-444e9060299d04ba.js +1 -0
- package/dist/web/_next/static/chunks/1077.b88b069535f7008e.js +1 -0
- package/dist/web/_next/static/chunks/1548.9e01803e48173ea9.js +1 -0
- package/dist/web/_next/static/chunks/2163.018cd5f719ae4b3d.js +1 -0
- package/dist/web/_next/static/chunks/6262-d074473db83ee798.js +1 -0
- package/dist/web/_next/static/chunks/714.281f68f85df26013.js +1 -0
- package/dist/web/_next/static/chunks/7220.3bd10a3e4e053e0c.js +1 -0
- package/dist/web/_next/static/chunks/7921-1c173d00d23b3589.js +1 -0
- package/dist/web/_next/static/chunks/8124-bb544c96a7c0e7e3.js +1 -0
- package/dist/web/_next/static/chunks/8584.c7cd52c2e7075bcb.js +1 -0
- package/dist/web/_next/static/chunks/9067.feaf894390db1a88.js +1 -0
- package/dist/web/_next/static/chunks/9747.7cee8a2d8301f25c.js +1 -0
- package/dist/web/_next/static/chunks/app/{layout-9201c637ca24b2c9.js → layout-5e0e7601702723bb.js} +1 -1
- package/dist/web/_next/static/chunks/app/page-95379244849623fc.js +1 -0
- package/dist/web/_next/static/chunks/app/queue/page-fb49cb2d3dc6d14c.js +1 -0
- package/dist/web/_next/static/chunks/{webpack-38c956574db7c7a6.js → webpack-5ea108bc2e386c55.js} +1 -1
- package/dist/web/_next/static/css/a112074f3d1a8a07.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 +4 -2
- package/dist/web/_next/static/chunks/1077.155f883ebfb223ae.js +0 -1
- package/dist/web/_next/static/chunks/1548.52fe19b2bb6dbe66.js +0 -1
- package/dist/web/_next/static/chunks/2163.51278cbd88674f1a.js +0 -1
- package/dist/web/_next/static/chunks/714.a3555e6b7e5f4339.js +0 -1
- package/dist/web/_next/static/chunks/7220.a7dcaec140695190.js +0 -1
- package/dist/web/_next/static/chunks/7921-b7eba39a21993047.js +0 -1
- package/dist/web/_next/static/chunks/8124-5458b17433987fab.js +0 -1
- package/dist/web/_next/static/chunks/8584.baf85c4394dc04eb.js +0 -1
- package/dist/web/_next/static/chunks/9067.2d7665cd257d7b47.js +0 -1
- package/dist/web/_next/static/chunks/9747.66a374501673612f.js +0 -1
- package/dist/web/_next/static/chunks/app/page-03f129240e06a07c.js +0 -1
- package/dist/web/_next/static/chunks/app/queue/page-f86936d39121ade8.js +0 -1
- package/dist/web/_next/static/css/2f2419505403ce07.css +0 -1
- /package/dist/web/_next/static/{kxZRE1oIu_arurqhfP4mS → BbWvNQTsh3pH7ZN_RKR60}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{kxZRE1oIu_arurqhfP4mS → BbWvNQTsh3pH7ZN_RKR60}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "New branch from main", in the chat (operator, 2026-10-26: "a button near the skill option: it takes the latest of
|
|
3
|
+
* main and makes a new local branch for the new task, a copy of the remote main; if the remote asks for a password, a
|
|
4
|
+
* window the bot never reads; and when the branch cannot simply be changed — uncommitted changes or another problem —
|
|
5
|
+
* the program offers a choice").
|
|
6
|
+
*
|
|
7
|
+
* Two steps, as the page shows them:
|
|
8
|
+
*
|
|
9
|
+
* 1. The preview fetches the remote's main (asking through Git's own password window when it must, `remoteAuth.ts`)
|
|
10
|
+
* and reads the folder: the branch it is on, what is not committed, anything half done. It changes nothing else.
|
|
11
|
+
* 2. Creating it, after checking the folder is still what the preview showed: a new local branch at the remote's
|
|
12
|
+
* main, not tracking it (a push of the task's work never goes to main by mistake), checked out. What was not
|
|
13
|
+
* committed is, as the operator chooses:
|
|
14
|
+
* - taken to the new branch, as git carries changes across a checkout — refused by git, with nothing moved, when
|
|
15
|
+
* the remote's main changed the same files; then the other choice is offered;
|
|
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.
|
|
18
|
+
* Nothing is deleted: no branch, and no change that is not first kept. Ignored files are not touched.
|
|
19
|
+
*
|
|
20
|
+
* When the remote cannot be fetched — a password not given, no network — the operator may go on from the remote's main
|
|
21
|
+
* as it was last fetched here, said with its date.
|
|
22
|
+
*/
|
|
23
|
+
import { existsSync } from 'node:fs';
|
|
24
|
+
import { rm } from 'node:fs/promises';
|
|
25
|
+
import { tmpdir } from 'node:os';
|
|
26
|
+
import { join, resolve } from 'node:path';
|
|
27
|
+
import { createHash } from 'node:crypto';
|
|
28
|
+
import { branchNameFrom, freeBranchName, git, lastFetchedAt, porcelainPaths, RUNNER_EMAIL } from './git.js';
|
|
29
|
+
import { fetchAsOperator } from './remoteAuth.js';
|
|
30
|
+
const short = (c) => (c ?? '').slice(0, 8);
|
|
31
|
+
const lines = (s) => s.split(/\r?\n/).map((l) => l.trim()).filter(Boolean);
|
|
32
|
+
function stamp(now = new Date()) {
|
|
33
|
+
const p = (n) => String(n).padStart(2, '0');
|
|
34
|
+
return `${now.getFullYear()}${p(now.getMonth() + 1)}${p(now.getDate())}-${p(now.getHours())}${p(now.getMinutes())}`;
|
|
35
|
+
}
|
|
36
|
+
/** A merge, rebase, cherry-pick or revert half done: the folder is the operator's to finish first. */
|
|
37
|
+
function operationInProgress(gitDir) {
|
|
38
|
+
for (const [file, what] of [
|
|
39
|
+
['MERGE_HEAD', 'a merge'],
|
|
40
|
+
['rebase-merge', 'a rebase'],
|
|
41
|
+
['rebase-apply', 'a rebase'],
|
|
42
|
+
['CHERRY_PICK_HEAD', 'a cherry-pick'],
|
|
43
|
+
['REVERT_HEAD', 'a revert'],
|
|
44
|
+
]) {
|
|
45
|
+
if (existsSync(join(gitDir, file)))
|
|
46
|
+
return what;
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
const refused = (repoDir, problem, extra = {}) => ({ ok: false, problem, repoDir, changed: [], untracked: [], ...extra });
|
|
51
|
+
/**
|
|
52
|
+
* What making the branch would start from. `fetch`: the preview, which fetches the remote's main — through `askpass`,
|
|
53
|
+
* Git's password window, when given; without a fetch, what was last fetched (going on after a fetch that failed, and
|
|
54
|
+
* the creation itself, which compares against what the preview read).
|
|
55
|
+
*/
|
|
56
|
+
export async function planNewBranch(folder, opts) {
|
|
57
|
+
const inside = await git(folder, ['rev-parse', '--is-inside-work-tree']);
|
|
58
|
+
if (!inside.ok || inside.stdout !== 'true')
|
|
59
|
+
return refused(folder, `${folder} is not a git repository, so there is no main to make a branch from.`);
|
|
60
|
+
const top = await git(folder, ['rev-parse', '--show-toplevel']);
|
|
61
|
+
const repoDir = top.ok && top.stdout ? resolve(top.stdout) : folder;
|
|
62
|
+
const gitDir = (await git(repoDir, ['rev-parse', '--absolute-git-dir'])).stdout;
|
|
63
|
+
const busy = gitDir ? operationInProgress(gitDir) : null;
|
|
64
|
+
if (busy)
|
|
65
|
+
return refused(repoDir, `The repository is in the middle of ${busy}. Finish it or abort it first; nothing was changed.`);
|
|
66
|
+
const headR = await git(repoDir, ['rev-parse', '--verify', '--quiet', 'HEAD']);
|
|
67
|
+
const branchR = await git(repoDir, ['symbolic-ref', '--quiet', '--short', 'HEAD']);
|
|
68
|
+
const branch = branchR.ok && branchR.stdout ? branchR.stdout : null;
|
|
69
|
+
const remotes = lines((await git(repoDir, ['remote'])).stdout);
|
|
70
|
+
if (remotes.length === 0)
|
|
71
|
+
return refused(repoDir, 'The repository has no remote, so there is no remote main to make the branch from.');
|
|
72
|
+
const remote = remotes.includes('origin') ? 'origin' : remotes[0];
|
|
73
|
+
// Read before fetching: a fetch that fails empties FETCH_HEAD, and with it the time of the last one that worked.
|
|
74
|
+
const lastBefore = gitDir ? lastFetchedAt(gitDir) : undefined;
|
|
75
|
+
let fetched;
|
|
76
|
+
if (opts.fetch) {
|
|
77
|
+
// Only the remote's main: one connection, one password at most.
|
|
78
|
+
fetched = await fetchAsOperator(repoDir, remote, { askpass: opts.askpass ?? null, refspecs: [`+refs/heads/main:refs/remotes/${remote}/main`] });
|
|
79
|
+
// A remote whose main is called master: asked for by that name, once the first said it has no main.
|
|
80
|
+
if (!fetched.ok && /couldn't find remote ref|could not find remote ref/i.test(fetched.detail ?? '')) {
|
|
81
|
+
fetched = await fetchAsOperator(repoDir, remote, { askpass: opts.askpass ?? null, refspecs: [`+refs/heads/master:refs/remotes/${remote}/master`] });
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
let target = '';
|
|
85
|
+
for (const name of ['main', 'master']) {
|
|
86
|
+
if ((await git(repoDir, ['rev-parse', '--verify', '--quiet', `refs/remotes/${remote}/${name}`])).ok) {
|
|
87
|
+
target = `${remote}/${name}`;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const lastFetched = fetched && !fetched.ok ? lastBefore : gitDir ? lastFetchedAt(gitDir) : undefined;
|
|
92
|
+
if (!target) {
|
|
93
|
+
return refused(repoDir, fetched && !fetched.ok ? `${remote} could not be fetched (${fetched.detail}), and no main of it is known here yet.` : `No main (or master) of ${remote} is known here.`, {
|
|
94
|
+
...(fetched ? { fetched } : {}),
|
|
95
|
+
remote,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
const targetCommit = (await git(repoDir, ['rev-parse', '--verify', '--quiet', `refs/remotes/${target}^{commit}`])).stdout;
|
|
99
|
+
if (!targetCommit)
|
|
100
|
+
return refused(repoDir, `${target} could not be read.`);
|
|
101
|
+
const targetSubject = (await git(repoDir, ['log', '-1', '--format=%s', targetCommit])).stdout;
|
|
102
|
+
const status = await git(repoDir, ['status', '--porcelain', '--untracked-files=no']);
|
|
103
|
+
const changed = porcelainPaths(status.stdout);
|
|
104
|
+
const untracked = lines((await git(repoDir, ['ls-files', '--others', '--exclude-standard'])).stdout);
|
|
105
|
+
const suggested = await freeBranchName(repoDir, `task/${stamp()}`);
|
|
106
|
+
const fingerprint = createHash('sha256')
|
|
107
|
+
.update([headR.stdout, branch ?? '', targetCommit, status.stdout, untracked.join('\n')].join('\0'))
|
|
108
|
+
.digest('hex')
|
|
109
|
+
.slice(0, 16);
|
|
110
|
+
return {
|
|
111
|
+
ok: true,
|
|
112
|
+
repoDir,
|
|
113
|
+
branch,
|
|
114
|
+
...(headR.stdout ? { head: headR.stdout } : {}),
|
|
115
|
+
remote,
|
|
116
|
+
target,
|
|
117
|
+
targetCommit,
|
|
118
|
+
...(targetSubject ? { targetSubject } : {}),
|
|
119
|
+
...(fetched ? { fetched } : {}),
|
|
120
|
+
...(lastFetched ? { lastFetched } : {}),
|
|
121
|
+
changed,
|
|
122
|
+
untracked,
|
|
123
|
+
suggested,
|
|
124
|
+
fingerprint,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
/** Whether git takes `name` as a new branch here: a legal name, and not one in use. */
|
|
128
|
+
export async function branchNameProblem(repoDir, name) {
|
|
129
|
+
const n = name.trim();
|
|
130
|
+
if (!n)
|
|
131
|
+
return 'Write the new branch\'s name.';
|
|
132
|
+
const legal = await git(repoDir, ['check-ref-format', '--branch', n]);
|
|
133
|
+
if (!legal.ok || n.startsWith('-'))
|
|
134
|
+
return `"${n}" cannot be a branch's name: no spaces, no "..", and not starting or ending with "/" or ".".`;
|
|
135
|
+
if ((await git(repoDir, ['rev-parse', '--verify', '--quiet', `refs/heads/${n}`])).ok)
|
|
136
|
+
return `There is a branch called "${n}" already; choose another name.`;
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Every uncommitted change and new file, as one commit on top of HEAD on a branch of its own, made with a temporary
|
|
141
|
+
* index — then checked to hold all of them, so nothing is removed from the folder that is not kept.
|
|
142
|
+
*/
|
|
143
|
+
async function keepUncommitted(dir, head, branch, message) {
|
|
144
|
+
const index = join(tmpdir(), `cop-saved-index-${process.pid}-${Date.now()}`);
|
|
145
|
+
const env = { ...process.env, GIT_INDEX_FILE: index };
|
|
146
|
+
try {
|
|
147
|
+
const read = await git(dir, ['read-tree', head], 60_000, env);
|
|
148
|
+
if (!read.ok)
|
|
149
|
+
return { problem: read.stderr || 'git read-tree failed' };
|
|
150
|
+
const added = await git(dir, ['add', '-A', '--', '.'], 300_000, env);
|
|
151
|
+
if (!added.ok)
|
|
152
|
+
return { problem: `the changes could not be read into git: ${added.stderr || added.stdout}` };
|
|
153
|
+
const differs = await git(dir, ['diff-files', '--name-only'], 120_000, env);
|
|
154
|
+
const outside = await git(dir, ['ls-files', '--others', '--exclude-standard'], 120_000, env);
|
|
155
|
+
if (!differs.ok || differs.stdout || !outside.ok || outside.stdout) {
|
|
156
|
+
return { problem: `not every change could be kept (${[differs.stdout, outside.stdout].filter(Boolean).join(', ').slice(0, 300) || differs.stderr || outside.stderr}), so nothing was moved.` };
|
|
157
|
+
}
|
|
158
|
+
const tree = await git(dir, ['write-tree'], 60_000, env);
|
|
159
|
+
if (!tree.ok || !tree.stdout)
|
|
160
|
+
return { problem: tree.stderr || 'git write-tree failed' };
|
|
161
|
+
const commit = await git(dir, ['-c', 'user.name=copilot-operator', '-c', `user.email=${RUNNER_EMAIL}`, 'commit-tree', tree.stdout, '-p', head, '-m', message]);
|
|
162
|
+
if (!commit.ok || !commit.stdout)
|
|
163
|
+
return { problem: commit.stderr || 'git commit-tree failed' };
|
|
164
|
+
const made = await git(dir, ['branch', branch, commit.stdout]);
|
|
165
|
+
if (!made.ok)
|
|
166
|
+
return { problem: made.stderr || `the branch ${branch} could not be made` };
|
|
167
|
+
return { commit: commit.stdout };
|
|
168
|
+
}
|
|
169
|
+
finally {
|
|
170
|
+
await rm(index, { force: true });
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/** Makes the branch and checks it out, after checking the folder is still what the preview showed. */
|
|
174
|
+
export async function createNewBranch(folder, opts) {
|
|
175
|
+
const plan = await planNewBranch(folder, { fetch: false });
|
|
176
|
+
if (!plan.ok)
|
|
177
|
+
return { ok: false, problem: plan.problem ?? 'the folder could not be read.' };
|
|
178
|
+
if (!opts.fingerprint || plan.fingerprint !== opts.fingerprint) {
|
|
179
|
+
return { ok: false, problem: 'The folder changed since it was read (a commit, a branch, a changed or new file). Look at it again; nothing was changed.' };
|
|
180
|
+
}
|
|
181
|
+
const repoDir = plan.repoDir;
|
|
182
|
+
const name = opts.name.trim();
|
|
183
|
+
const bad = await branchNameProblem(repoDir, name);
|
|
184
|
+
if (bad)
|
|
185
|
+
return { ok: false, problem: bad };
|
|
186
|
+
const target = plan.target;
|
|
187
|
+
const targetCommit = plan.targetCommit;
|
|
188
|
+
const files = plan.changed.length + plan.untracked.length;
|
|
189
|
+
const done = async (saved) => {
|
|
190
|
+
const nowBranch = (await git(repoDir, ['symbolic-ref', '--quiet', '--short', 'HEAD'])).stdout;
|
|
191
|
+
const nowHead = (await git(repoDir, ['rev-parse', 'HEAD'])).stdout;
|
|
192
|
+
if (nowBranch !== name || nowHead !== targetCommit)
|
|
193
|
+
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;
|
|
195
|
+
const result = `The folder is on the new branch ${name}, made from ${target} (${short(targetCommit)}).` +
|
|
196
|
+
(saved ? ` What was not committed is kept on ${saved.branch} (${saved.files} file(s)).` : carried > 0 ? ` ${carried} uncommitted file(s) came with it.` : '');
|
|
197
|
+
return { ok: true, branch: name, commit: targetCommit, target, ...(saved ? { saved } : {}), carried, result };
|
|
198
|
+
};
|
|
199
|
+
if (files === 0 || opts.carry === 'take') {
|
|
200
|
+
// As git carries changes across a checkout; it refuses, and moves nothing, when a change would be overwritten.
|
|
201
|
+
const moved = await git(repoDir, ['switch', '--quiet', '--no-track', '-c', name, targetCommit], 300_000);
|
|
202
|
+
if (!moved.ok) {
|
|
203
|
+
const said = (moved.stderr || moved.stdout).trim();
|
|
204
|
+
const conflict = /would be overwritten|overwritten by checkout|untracked working tree files/i.test(said);
|
|
205
|
+
return conflict
|
|
206
|
+
? { ok: false, conflict: true, problem: `The uncommitted changes cannot be taken to the new branch: ${target} changed the same files (${said.split(/\r?\n/).slice(1, 4).map((l) => l.trim()).filter(Boolean).join(', ') || said.split(/\r?\n/)[0]}). Nothing was moved.` }
|
|
207
|
+
: { ok: false, problem: `The branch could not be made: ${said.split(/\r?\n/)[0] || 'git switch failed'}. Nothing was moved.` };
|
|
208
|
+
}
|
|
209
|
+
return done();
|
|
210
|
+
}
|
|
211
|
+
// Put aside: kept first, checked whole; only then is the folder moved, and left clean.
|
|
212
|
+
const head = plan.head;
|
|
213
|
+
if (!head)
|
|
214
|
+
return { ok: false, problem: 'The repository has no commit yet to keep the changes on top of. Make a first commit, then try again.' };
|
|
215
|
+
const saved = await freeBranchName(repoDir, `${branchNameFrom(['saved'], opts.prefix || 'cop/')}/${stamp()}`);
|
|
216
|
+
const message = [
|
|
217
|
+
'Keep uncommitted work before a new branch from main',
|
|
218
|
+
'',
|
|
219
|
+
`Everything that was not committed in the folder on ${plan.branch ?? 'a detached HEAD'} (${short(head)}), kept here before the new branch ${name} was made from ${target} (${short(targetCommit)}).`,
|
|
220
|
+
'To take a file back: git restore --source <this branch> -- <path>',
|
|
221
|
+
'',
|
|
222
|
+
...[...plan.changed.map((p) => `- changed: ${p}`), ...plan.untracked.map((p) => `- new: ${p}`)].slice(0, 300),
|
|
223
|
+
'',
|
|
224
|
+
'Committed by copilot-operator. Not pushed.',
|
|
225
|
+
'',
|
|
226
|
+
].join('\n');
|
|
227
|
+
const kept = await keepUncommitted(repoDir, head, saved, message);
|
|
228
|
+
if ('problem' in kept)
|
|
229
|
+
return { ok: false, problem: kept.problem };
|
|
230
|
+
// Everything is kept; the forced switch drops the tracked changes that are on the saved branch.
|
|
231
|
+
const moved = await git(repoDir, ['switch', '--quiet', '--no-track', '--discard-changes', '-c', name, targetCommit], 300_000);
|
|
232
|
+
if (!moved.ok)
|
|
233
|
+
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
|
+
// The new files, kept on the saved branch, out of the folder; ignored files stay (no -x).
|
|
235
|
+
if (plan.untracked.length > 0) {
|
|
236
|
+
const cleaned = await git(repoDir, ['clean', '-fd', '--quiet'], 300_000);
|
|
237
|
+
if (!cleaned.ok)
|
|
238
|
+
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
|
+
}
|
|
240
|
+
return done({ branch: saved, commit: kept.commit, files });
|
|
241
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a fetch the operator asked for gets past a remote that wants a password — without the bot ever seeing it.
|
|
3
|
+
*
|
|
4
|
+
* First made on 2026-10-03 (an SSH key with a passphrase); brought back on 2026-10-26 for "New branch from main" in
|
|
5
|
+
* the chat (operator: "if the remote main asks for a password, open a window the bot never reads; the operator types
|
|
6
|
+
* the password there and it goes to version control; dynamic, so no security policy is hit").
|
|
7
|
+
*
|
|
8
|
+
* Not a field on the bot's page: a password typed there passes through the browser, the API, this process and its
|
|
9
|
+
* memory, and the bot would hold the one secret that unlocks the operator's key or account. So the bot asks nobody
|
|
10
|
+
* anything. It lets ssh (and git, for HTTPS) ask through Git for Windows' own password window, `git-askpass.exe` —
|
|
11
|
+
* a program that ships with Git, not a script — or Git Credential Manager's own window: the operator types into it,
|
|
12
|
+
* and the answer goes from the window straight back to ssh or git through a pipe the bot is not part of. The bot reads
|
|
13
|
+
* only what `git fetch` prints. Nothing is stored; the next fetch asks again (an ssh-agent or the credential manager,
|
|
14
|
+
* when the operator has one, answers instead).
|
|
15
|
+
*
|
|
16
|
+
* Only for a fetch the operator just pressed a button for: a run's own fetches stay silent, since a window nobody
|
|
17
|
+
* answers would hold the run until it times out.
|
|
18
|
+
*/
|
|
19
|
+
import { execFile } from 'node:child_process';
|
|
20
|
+
import { existsSync } from 'node:fs';
|
|
21
|
+
import { resolve } from 'node:path';
|
|
22
|
+
import { git, gitFetch } from './git.js';
|
|
23
|
+
/** No prompt anywhere: what every fetch of a run uses. */
|
|
24
|
+
export const QUIET_FETCH_ENV = { ...process.env, GIT_TERMINAL_PROMPT: '0', GCM_INTERACTIVE: 'never', GIT_ASKPASS: '', SSH_ASKPASS: '' };
|
|
25
|
+
/** Git for Windows' password window, next to the git that runs here; null when there is none. */
|
|
26
|
+
export async function askpassProgram() {
|
|
27
|
+
const exec = await git(process.cwd(), ['--exec-path']);
|
|
28
|
+
if (!exec.ok || !exec.stdout)
|
|
29
|
+
return null;
|
|
30
|
+
// <Git>\mingw64\libexec\git-core → <Git>\mingw64\bin\git-askpass.exe
|
|
31
|
+
const candidate = resolve(exec.stdout, '..', '..', 'bin', 'git-askpass.exe');
|
|
32
|
+
return existsSync(candidate) ? candidate : null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The environment for a fetch the operator is present for: ssh asks through the password window even with no terminal
|
|
36
|
+
* (`SSH_ASKPASS_REQUIRE=force`; `DISPLAY` for an older ssh that wants one), and git asks through it — or through the
|
|
37
|
+
* credential manager's own window — for an HTTPS user name or password. No terminal prompt: the bot's console is not
|
|
38
|
+
* where the operator is looking.
|
|
39
|
+
*/
|
|
40
|
+
export function operatorFetchEnv(askpass) {
|
|
41
|
+
return {
|
|
42
|
+
...process.env,
|
|
43
|
+
GIT_TERMINAL_PROMPT: '0',
|
|
44
|
+
GCM_INTERACTIVE: 'auto',
|
|
45
|
+
GIT_ASKPASS: askpass,
|
|
46
|
+
SSH_ASKPASS: askpass,
|
|
47
|
+
SSH_ASKPASS_REQUIRE: 'force',
|
|
48
|
+
DISPLAY: process.env.DISPLAY || 'needs-to-be-defined',
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/** A failed fetch, said so the operator knows whether it was the password. */
|
|
52
|
+
export function describeFetchFailure(stderr) {
|
|
53
|
+
const lines = stderr.split(/\r?\n/).map((l) => l.trim()).filter(Boolean);
|
|
54
|
+
const auth = /permission denied|publickey|passphrase|authentication failed|could not read (username|password)|host key verification failed|terminal prompts disabled|cancel/i.test(stderr);
|
|
55
|
+
return { detail: lines.slice(0, 3).join(' ') || 'git fetch failed', auth };
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Closes the password windows of a fetch that was given up on: every process of exactly this program started since
|
|
59
|
+
* `since`. Needed because stopping git and its process tree does not reach them (Git for Windows starts ssh, and ssh
|
|
60
|
+
* the window, whose Windows parent is already gone; seen live on 2026-10-03). Matched by the program's full path and
|
|
61
|
+
* its start time, so nothing else is touched. A command given to PowerShell as it runs, not a script file.
|
|
62
|
+
*/
|
|
63
|
+
export function closePasswordWindows(program, since) {
|
|
64
|
+
if (process.platform !== 'win32')
|
|
65
|
+
return Promise.resolve(0);
|
|
66
|
+
const script = [
|
|
67
|
+
`$path = '${program.replace(/'/g, "''")}'`,
|
|
68
|
+
`$since = [datetime]::Parse('${since.toISOString()}').ToUniversalTime()`,
|
|
69
|
+
'$n = 0',
|
|
70
|
+
"Get-CimInstance Win32_Process -Filter \"Name='git-askpass.exe' OR Name='$([IO.Path]::GetFileName($path))'\" |",
|
|
71
|
+
' Where-Object { $_.ExecutablePath -and $_.ExecutablePath -ieq $path -and $_.CreationDate.ToUniversalTime() -ge $since } |',
|
|
72
|
+
' ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue; $n++ }',
|
|
73
|
+
'$n',
|
|
74
|
+
].join('\n');
|
|
75
|
+
return new Promise((done) => {
|
|
76
|
+
execFile('powershell.exe', ['-NoProfile', '-NonInteractive', '-Command', script], { windowsHide: true, timeout: 30_000 }, (_e, stdout) => {
|
|
77
|
+
done(Number.parseInt(String(stdout).trim(), 10) || 0);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/** The programs that are Git asking the operator: its password window and its credential manager's. */
|
|
82
|
+
const ASKING = ['git-askpass.exe', 'git-credential-manager.exe', 'git-credential-manager-core.exe'];
|
|
83
|
+
/**
|
|
84
|
+
* Whether Git is asking the operator for a password now, in a window opened since `sinceMs` (2026-10-26): what holds a
|
|
85
|
+
* step's idle clock and has the chat say where to look. A quick list of the processes first; their start time only
|
|
86
|
+
* when one of them is there — a command given to PowerShell as it runs, not a script file.
|
|
87
|
+
*/
|
|
88
|
+
export async function passwordWindowOpen(sinceMs) {
|
|
89
|
+
if (process.platform !== 'win32')
|
|
90
|
+
return false;
|
|
91
|
+
const listed = await new Promise((done) => execFile('tasklist', ['/FO', 'CSV', '/NH', '/FI', 'IMAGENAME eq git-*'], { windowsHide: true, timeout: 10_000 }, (_e, stdout) => done(String(stdout ?? '').toLowerCase())));
|
|
92
|
+
if (!ASKING.some((n) => listed.includes(`"${n}"`)))
|
|
93
|
+
return false;
|
|
94
|
+
const filter = ASKING.map((n) => `Name='${n}'`).join(' OR ');
|
|
95
|
+
const script = [
|
|
96
|
+
`$since = [datetime]::Parse('${new Date(sinceMs - 1000).toISOString()}').ToUniversalTime()`,
|
|
97
|
+
`@(Get-CimInstance Win32_Process -Filter "${filter}" | Where-Object { $_.CreationDate.ToUniversalTime() -ge $since }).Count`,
|
|
98
|
+
].join('\n');
|
|
99
|
+
return await new Promise((done) => execFile('powershell.exe', ['-NoProfile', '-NonInteractive', '-Command', script], { windowsHide: true, timeout: 20_000 }, (_e, stdout) => done((Number.parseInt(String(stdout).trim(), 10) || 0) > 0)));
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* A fetch the operator just pressed a button for, and is looking at: with Git's password window when there is one
|
|
103
|
+
* (five minutes to type, the window not hidden), quiet otherwise. One connection only; tried once more when the first
|
|
104
|
+
* try fails for another reason than a password given up on (see `gitFetch`); a window left on screen by a fetch that
|
|
105
|
+
* was given up on is closed. `refspecs` fetches only those branches.
|
|
106
|
+
*/
|
|
107
|
+
export async function fetchAsOperator(repoDir, remote, opts) {
|
|
108
|
+
const asked = !!opts.askpass;
|
|
109
|
+
const env = asked ? operatorFetchEnv(opts.askpass) : QUIET_FETCH_ENV;
|
|
110
|
+
const args = [...(asked ? [] : ['-c', 'credential.interactive=false']), 'fetch', '--quiet', '--no-tags', remote, ...(opts.refspecs ?? [])];
|
|
111
|
+
const started = new Date(Date.now() - 1000);
|
|
112
|
+
const f = await gitFetch(repoDir, args, asked ? 300_000 : 120_000, env, { windowsHide: !asked, killTree: true });
|
|
113
|
+
if (!f.ok && asked && /gave up after/.test(f.stderr))
|
|
114
|
+
await closePasswordWindows(opts.askpass, started);
|
|
115
|
+
if (f.ok)
|
|
116
|
+
return { ok: true, asked, ...(f.retried ? { retried: true } : {}) };
|
|
117
|
+
const why = describeFetchFailure(f.stderr || f.stdout);
|
|
118
|
+
return { ok: false, detail: why.detail, auth: why.auth, asked };
|
|
119
|
+
}
|
package/dist/web/404.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--BbWvNQTsh3pH7ZN_RKR60--><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/a112074f3d1a8a07.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-5ea108bc2e386c55.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-1c173d00d23b3589.js" async=""></script><script src="/_next/static/chunks/6262-d074473db83ee798.js" async=""></script><script src="/_next/static/chunks/8124-bb544c96a7c0e7e3.js" async=""></script><script src="/_next/static/chunks/app/layout-5e0e7601702723bb.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-38c956574db7c7a6.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-b7eba39a21993047.js\",\"8124\",\"static/chunks/8124-5458b17433987fab.js\",\"7177\",\"static/chunks/app/layout-9201c637ca24b2c9.js\"],\"AppearanceProvider\"]\n3:I[8205,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-b7eba39a21993047.js\",\"8124\",\"static/chunks/8124-5458b17433987fab.js\",\"7177\",\"static/chunks/app/layout-9201c637ca24b2c9.js\"],\"LanguageProvider\"]\n4:I[51035,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-b7eba39a21993047.js\",\"8124\",\"static/chunks/8124-5458b17433987fab.js\",\"7177\",\"static/chunks/app/layout-9201c637ca24b2c9.js\"],\"DialogHost\"]\n5:I[16752,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-b7eba39a21993047.js\",\"8124\",\"static/chunks/8124-5458b17433987fab.js\",\"7177\",\"static/chunks/app/layout-9201c637ca24b2c9.js\"],\"SkipLink\"]\n6:I[68300,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-b7eba39a21993047.js\",\"8124\",\"static/chunks/8124-5458b17433987fab.js\",\"7177\",\"static/chunks/app/layout-9201c637ca24b2c9.js\"],\"Shell\"]\n7:I[25204,[],\"\"]\n8:I[42642,[],\"\"]\n9:I[87712,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-b7eba39a21993047.js\",\"8124\",\"static/chunks/8124-5458b17433987fab.js\",\"7177\",\"static/chunks/app/layout-9201c637ca24b2c9.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/2f2419505403ce07.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"kxZRE1oIu_arurqhfP4mS\",\"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/2f2419505403ce07.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-5ea108bc2e386c55.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-1c173d00d23b3589.js\",\"6262\",\"static/chunks/6262-d074473db83ee798.js\",\"8124\",\"static/chunks/8124-bb544c96a7c0e7e3.js\",\"7177\",\"static/chunks/app/layout-5e0e7601702723bb.js\"],\"AppearanceProvider\"]\n3:I[8205,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-1c173d00d23b3589.js\",\"6262\",\"static/chunks/6262-d074473db83ee798.js\",\"8124\",\"static/chunks/8124-bb544c96a7c0e7e3.js\",\"7177\",\"static/chunks/app/layout-5e0e7601702723bb.js\"],\"LanguageProvider\"]\n4:I[51035,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-1c173d00d23b3589.js\",\"6262\",\"static/chunks/6262-d074473db83ee798.js\",\"8124\",\"static/chunks/8124-bb544c96a7c0e7e3.js\",\"7177\",\"static/chunks/app/layout-5e0e7601702723bb.js\"],\"DialogHost\"]\n5:I[16752,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-1c173d00d23b3589.js\",\"6262\",\"static/chunks/6262-d074473db83ee798.js\",\"8124\",\"static/chunks/8124-bb544c96a7c0e7e3.js\",\"7177\",\"static/chunks/app/layout-5e0e7601702723bb.js\"],\"SkipLink\"]\n6:I[68300,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-1c173d00d23b3589.js\",\"6262\",\"static/chunks/6262-d074473db83ee798.js\",\"8124\",\"static/chunks/8124-bb544c96a7c0e7e3.js\",\"7177\",\"static/chunks/app/layout-5e0e7601702723bb.js\"],\"Shell\"]\n7:I[25204,[],\"\"]\n8:I[42642,[],\"\"]\n9:I[87712,[\"8197\",\"static/chunks/8197-e2fcb43f38a2b4a7.js\",\"7921\",\"static/chunks/7921-1c173d00d23b3589.js\",\"6262\",\"static/chunks/6262-d074473db83ee798.js\",\"8124\",\"static/chunks/8124-bb544c96a7c0e7e3.js\",\"7177\",\"static/chunks/app/layout-5e0e7601702723bb.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/a112074f3d1a8a07.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"BbWvNQTsh3pH7ZN_RKR60\",\"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/a112074f3d1a8a07.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:()=>o,u:()=>i});var n=t(73365),r=t(1521),a=t(15549),l=t(8205);let i="::by-hand::";function o(e){var s,t,o;let{id:c,chosen:d,onChange:p,none:u,byHand:m,catalogue:h,disabled:x=!1,style:v}=e,{t:j}=(0,l.kj)(),k=function(e){let[s,t]=(0,r.useState)(null);return(0,r.useEffect)(()=>{if(void 0!==e)return;let s=!0;return a.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:[],b=e=>e.toLowerCase().replace(/[-‐‑‒–—_]+/g," ").replace(/\s+/g," ").trim(),y=d&&d!==i?w.find(e=>b(e.name)===b(d)):void 0,f=null!=(t=null==y?void 0:y.name)?t:d,g=!!y||d===i&&void 0!==m,N=w.filter(e=>!e.group),C=new Map;for(let e of w)e.group&&C.set(e.group,[...null!=(o=C.get(e.group))?o:[],e]);return(0,n.jsxs)("select",{id:c,value:f,onChange:e=>p(e.target.value),disabled:x,style:{width:"auto",minWidth:280,...v},children:[void 0!==m&&(0,n.jsx)("option",{value:i,children:m}),void 0!==u&&(0,n.jsx)("option",{value:"",children:u}),d&&!g&&(0,n.jsx)("option",{value:d,children:j("model.notInList",{name:d})}),N.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:()=>u});var n=t(73365),r=t(1521),a=t(8205),l=t(33389),i=t(24872),o=t(79717),c=t(65132);let d={same:"retry.same",fresh:"retry.fresh",continue:"retry.continue",restore:"retry.restore",accept:"retry.accept"},p={plan:"pk.waitsPlan",question:"pk.waitsQuestion",retry:"pk.waitsRetry",command:"pk.waitsCommand",model:"pk.waitsModel",password:"pk.waitsPassword"};function u(e){var s;let{parked:t,onAnswer:u}=e,{t:m}=(0,a.kj)(),h=(0,a.W3)(),x=(0,r.useId)(),[v,j]=(0,r.useState)(""),{locked:k,err:w,choose:b,mark:y}=(0,l.p)(),[f,g]=(0,r.useState)(""),N=t.approval,C=async(e,s)=>{await b(e,()=>u(s))&&g("stop"in s?"stopped":"answered")};return t.answer||f?(0,n.jsx)("p",{className:"small pk-answered",role:"status",children:m("stopped"===f?"pk.stopped":"pk.answered")}):(0,n.jsxs)("div",{className:"pk",role:"group","aria-label":m("pk.title"),children:[(0,n.jsxs)("p",{className:"small pk-head",children:[(0,n.jsx)("strong",{children:m("pk.title")})," ",(0,n.jsx)("span",{className:"muted",children:m("pk.since",{at:h(t.at),what:m(p[t.kind])})})]}),"plan"===t.kind&&N.plan&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.D,{plan:N.plan.plan,showApproval:!1}),(0,n.jsx)("label",{htmlFor:"".concat(x,"-note"),className:"small",children:m("pk.note")}),(0,n.jsx)("textarea",{id:"".concat(x,"-note"),className:"prose",rows:2,value:v,onChange:e=>j(e.target.value),disabled:k}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("button",{type:"button",className:"primary",...y("approve"),onClick:()=>void C("approve",{decision:"approve",...v.trim()?{note:v.trim()}:{}}),children:m("pk.approve")}),(0,n.jsx)("button",{type:"button",...y("revise"),disabled:k||!v.trim(),onClick:()=>void C("revise",{decision:"revise",note:v.trim()}),title:v.trim()?void 0:m("pk.reviseWhy"),children:m("pk.revise")})]})]}),"question"===t.kind&&N.question&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.s,{text:N.question.text}),N.question.why&&(0,n.jsx)("p",{className:"muted small",children:N.question.why}),(0,n.jsx)("div",{className:"cs-copy-row",children:(0,n.jsx)(i.i,{text:[N.question.text,null!=(s=N.question.why)?s:"",...N.question.options.map((e,s)=>"".concat(s+1,". ").concat(e))].filter(Boolean).join("\n"),what:"chat.copyQuestion"})}),N.question.options.length>0&&(0,n.jsx)("div",{className:"row cs-options",children:N.question.options.map((e,s)=>(0,n.jsx)("button",{type:"button",className:0===s?"primary cs-option":"cs-option",...y("option-".concat(s)),onClick:()=>void C("option-".concat(s),{answer:e}),children:e},e))}),(0,n.jsx)("label",{htmlFor:"".concat(x,"-answer"),className:"small",children:m("lead.answer")}),(0,n.jsx)("textarea",{id:"".concat(x,"-answer"),className:"prose",rows:2,value:v,onChange:e=>j(e.target.value),disabled:k}),(0,n.jsx)("div",{className:"row",children:(0,n.jsx)("button",{type:"button",className:"primary",...y("written"),disabled:k||!v.trim(),onClick:()=>void C("written",{answer:v.trim()}),children:m("lead.send")})})]}),"retry"===t.kind&&N.retry&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("p",{className:"small",children:[m("retry.title",{n:N.retry.n})," — ",N.retry.title]}),N.retry.reason&&(0,n.jsx)("p",{className:"small",children:m("retry.reason",{reason:N.retry.reason})}),"unknown"===N.retry.sideEffects&&(0,n.jsx)("p",{className:"reason small",children:m("retry.unknown")}),(0,n.jsx)("div",{className:"row",children:N.retry.choices.map((e,s)=>(0,n.jsx)("button",{type:"button",className:0===s?"primary":void 0,...y(e),onClick:()=>void C(e,{choice:e}),children:m(d[e])},e))})]}),"command"===t.kind&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("pre",{className:"cs-out",children:N.description}),N.platform&&(0,n.jsx)("p",{className:"reason small",children:m("approval.platform",{platform:N.platform})}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("button",{type:"button",className:"primary",...y("run"),onClick:()=>void C("run",{decision:"run"}),children:m("pk.run")}),(0,n.jsx)("button",{type:"button",...y("skip"),onClick:()=>void C("skip",{decision:"skip"}),children:m("pk.skip")})]})]}),("model"===t.kind||"password"===t.kind)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"small",children:m("model"===t.kind?"pk.modelWhy":"pk.passwordWhy")}),(0,n.jsx)("div",{className:"row",children:(0,n.jsx)("button",{type:"button",className:"primary",...y("resume"),onClick:()=>void C("resume",{resume:!0}),children:m("pk.resume")})})]}),(0,n.jsx)("div",{className:"row pk-stop",children:(0,n.jsx)("button",{type:"button",className:"quiet",...y("stop"),onClick:()=>void C("stop",{stop:!0}),children:m("pk.stop")})}),w&&(0,n.jsx)("p",{className:"err",role:"alert",children:w})]})}},41370:(e,s,t)=>{t.d(s,{q:()=>r});var n=t(1521);function r(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:450,[t,r]=(0,n.useState)(1);return(0,n.useEffect)(()=>{if(!e)return void r(1);let t=window.setInterval(()=>r(e=>e%3+1),s);return()=>window.clearInterval(t)},[e,s]),".".repeat(t)}},65132:(e,s,t)=>{t.d(s,{s:()=>i});var n=t(73365),r=t(1521);function a(e,s){let t,r=[],a=/(`[^`\n]+`)|(\*\*[^*\n]+\*\*)|(\*[^*\n]+\*)/g,l=0,i=0;for(;null!==(t=a.exec(e));){t.index>l&&r.push(e.slice(l,t.index));let a=t[0],o="".concat(s,"-i").concat(i+=1);a.startsWith("`")?r.push((0,n.jsx)("code",{children:a.slice(1,-1)},o)):a.startsWith("**")?r.push((0,n.jsx)("strong",{children:a.slice(2,-2)},o)):r.push((0,n.jsx)("em",{children:a.slice(1,-1)},o)),l=t.index+a.length}return l<e.length&&r.push(e.slice(l)),r}function l(e){let s=/^\s*[-*•]\s+(.*)$/.exec(e);if(s)return s[1];let t=/^\s*\d+[.)]\s+(.*)$/.exec(e);return t?t[1]:null}function i(e){let{text:s,className:t}=e,i=[],o=s.replace(/\r\n/g,"\n").split("\n"),c=0,d=0;for(;c<o.length;){let e=o[c];if(e.trim().startsWith("```")){let e=[];for(c+=1;c<o.length&&!o[c].trim().startsWith("```");)e.push(o[c++]);c+=1,e.length>0&&i.push((0,n.jsx)("pre",{children:e.join("\n")},"b".concat(d+=1)));continue}if(null!==l(e)){let e=[];for(;c<o.length&&null!==l(o[c]);)e.push(l(o[c++]));i.push((0,n.jsx)("ul",{children:e.map((e,s)=>(0,n.jsx)("li",{children:a(e,"b".concat(d,"-").concat(s))},s))},"b".concat(d+=1)));continue}if(""===e.trim()){c+=1;continue}let s=[];for(;c<o.length&&""!==o[c].trim()&&null===l(o[c])&&!o[c].trim().startsWith("```");)s.push(o[c++]);let t=d+=1;i.push((0,n.jsx)("p",{children:s.map((e,s)=>(0,n.jsxs)(r.Fragment,{children:[s>0&&(0,n.jsx)("br",{}),a(e,"b".concat(t,"-").concat(s))]},s))},"b".concat(t)))}return(0,n.jsx)("div",{className:"rich ".concat(null!=t?t:""),children:i})}}}]);
|