copilot-operator 0.1.57 → 0.1.59
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 +11 -0
- package/dist/src/api/operator.service.js +28 -6
- package/dist/src/cli.js +1 -0
- package/dist/src/config/schema.js +16 -0
- package/dist/src/exec/authorizer.js +16 -4
- package/dist/src/exec/platforms.js +87 -0
- package/dist/src/orchestrator/leadRunner.js +22 -3
- package/dist/src/orchestrator/taskRunner.js +86 -9
- package/dist/src/plan/kerrigan.js +4 -4
- package/dist/src/plan/systemGuide.js +100 -77
- package/dist/src/protocol/parser.js +3 -2
- package/dist/src/protocol/replySchema.js +20 -2
- package/dist/web/404.html +2 -2
- package/dist/web/_next/static/chunks/1077.34c33df752c793fd.js +1 -0
- package/dist/web/_next/static/chunks/1548.9bd3216f2e2ed40a.js +1 -0
- package/dist/web/_next/static/chunks/2163.c764c5ddf04e8f3c.js +1 -0
- package/dist/web/_next/static/chunks/4512-bf72c643d4a4db71.js +1 -0
- package/dist/web/_next/static/chunks/714.ce1d54a2c2b5474f.js +1 -0
- package/dist/web/_next/static/chunks/7220.07100b580a566f9c.js +1 -0
- package/dist/web/_next/static/chunks/7921-97fcfd1f6aff2774.js +1 -0
- package/dist/web/_next/static/chunks/8584.d863bb44ea78998d.js +1 -0
- package/dist/web/_next/static/chunks/9067.3d3d65b5fb1c6a61.js +1 -0
- package/dist/web/_next/static/chunks/9747.af530d25cd7cc8fb.js +1 -0
- package/dist/web/_next/static/chunks/app/page-c3c50d426109e8c5.js +1 -0
- package/dist/web/_next/static/chunks/app/settings/page-e485720f199e3194.js +1 -0
- package/dist/web/_next/static/chunks/{webpack-d103630008e57024.js → webpack-d210ad961e7a9237.js} +1 -1
- package/dist/web/_next/static/css/e544b477e4b4b108.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/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/prompts/lead1.md +7 -1
- package/prompts/level1.md +31 -1
- package/dist/web/_next/static/chunks/1077.7e88c156c16718c0.js +0 -1
- package/dist/web/_next/static/chunks/1548.a7127a9edf3f266b.js +0 -1
- package/dist/web/_next/static/chunks/2163.60f52655ceb57752.js +0 -1
- package/dist/web/_next/static/chunks/4512-8bcb4b34f41115b4.js +0 -1
- package/dist/web/_next/static/chunks/714.bee36b765509e92c.js +0 -1
- package/dist/web/_next/static/chunks/7220.c9c5c5f25baafec7.js +0 -1
- package/dist/web/_next/static/chunks/7921-fb0045927b0e86a8.js +0 -1
- package/dist/web/_next/static/chunks/8584.97613589db58864f.js +0 -1
- package/dist/web/_next/static/chunks/9067.f7e111c6aa999784.js +0 -1
- package/dist/web/_next/static/chunks/9747.a5828643aaff11c0.js +0 -1
- package/dist/web/_next/static/chunks/app/page-8e85b507af649f85.js +0 -1
- package/dist/web/_next/static/chunks/app/settings/page-b39878dce98ded94.js +0 -1
- package/dist/web/_next/static/css/4bf77b2aec4626c2.css +0 -1
- /package/dist/web/_next/static/{g2MUlOzNxfAGFR7EI9zQv → Gan_sPghz9GR_aVaCL2ah}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{g2MUlOzNxfAGFR7EI9zQv → Gan_sPghz9GR_aVaCL2ah}/_ssgManifest.js +0 -0
|
@@ -391,6 +391,10 @@ let OperatorController = class OperatorController {
|
|
|
391
391
|
setDefaultModel(body) {
|
|
392
392
|
return this.ops.setDefaultModel(body?.model ?? '').catch(fail);
|
|
393
393
|
}
|
|
394
|
+
/** The model the lead of two chats starts on (2026-10-23). An empty name leaves its chat on whatever it is. */
|
|
395
|
+
setDefaultLeadModel(body) {
|
|
396
|
+
return this.ops.setDefaultLeadModel(body?.model ?? '').catch(fail);
|
|
397
|
+
}
|
|
394
398
|
/** The model of the independent review. An empty name means "the session's own". */
|
|
395
399
|
setDefaultReviewModel(body) {
|
|
396
400
|
return this.ops.setDefaultReviewModel(body?.model ?? '').catch(fail);
|
|
@@ -750,6 +754,13 @@ __decorate([
|
|
|
750
754
|
__metadata("design:paramtypes", [Object]),
|
|
751
755
|
__metadata("design:returntype", Promise)
|
|
752
756
|
], OperatorController.prototype, "setDefaultModel", null);
|
|
757
|
+
__decorate([
|
|
758
|
+
Put('models/lead-default'),
|
|
759
|
+
__param(0, Body()),
|
|
760
|
+
__metadata("design:type", Function),
|
|
761
|
+
__metadata("design:paramtypes", [Object]),
|
|
762
|
+
__metadata("design:returntype", Promise)
|
|
763
|
+
], OperatorController.prototype, "setDefaultLeadModel", null);
|
|
753
764
|
__decorate([
|
|
754
765
|
Put('models/review-default'),
|
|
755
766
|
__param(0, Body()),
|
|
@@ -786,6 +786,7 @@ let OperatorService = class OperatorService {
|
|
|
786
786
|
lockedToConfirm: cfg.policyLock?.maxMode === 'confirm',
|
|
787
787
|
// Read once per run like the rest of the policy: a change in Settings applies from the next start.
|
|
788
788
|
networkFetch: cfg.execution.networkFetch,
|
|
789
|
+
platformAccess: cfg.execution.questions === 'agree' ? 'allow' : 'ask',
|
|
789
790
|
};
|
|
790
791
|
/*
|
|
791
792
|
* An unattended run that cannot legally execute anything is stopped here, where the operator
|
|
@@ -880,6 +881,8 @@ let OperatorService = class OperatorService {
|
|
|
880
881
|
await this.setDefaultModel(to);
|
|
881
882
|
if (which === 'review' && (now.defaultReviewModel ?? '').trim() === from)
|
|
882
883
|
await this.setDefaultReviewModel(to);
|
|
884
|
+
if (which === 'lead' && (now.defaultLeadModel ?? '').trim() === from)
|
|
885
|
+
await this.setDefaultLeadModel(to);
|
|
883
886
|
},
|
|
884
887
|
seen: async (options, current) => {
|
|
885
888
|
await this.store.saveModels({ options, current: current ?? undefined, readAt: new Date().toISOString() });
|
|
@@ -1408,10 +1411,11 @@ let OperatorService = class OperatorService {
|
|
|
1408
1411
|
sessionId: ask.sessionId,
|
|
1409
1412
|
taskId: ask.taskId,
|
|
1410
1413
|
stepId: 0,
|
|
1411
|
-
description:
|
|
1414
|
+
description: `${(ask.actor ?? 'lead') === 'lead' ? 'The lead asks' : 'The chat asks'}: ${ask.question}`,
|
|
1412
1415
|
createdAt: new Date().toISOString(),
|
|
1413
|
-
|
|
1414
|
-
|
|
1416
|
+
// The lead's, or since 2026-10-23 the chat's own (plan mode's or the worker's).
|
|
1417
|
+
actor: ask.actor ?? 'lead',
|
|
1418
|
+
question: { text: ask.question, ...(ask.why ? { why: ask.why } : {}), options: ask.options, ...(ask.commands?.some(Boolean) ? { commands: ask.commands } : {}) },
|
|
1415
1419
|
};
|
|
1416
1420
|
this.waiting.set(approval.id, {
|
|
1417
1421
|
approval,
|
|
@@ -1596,12 +1600,13 @@ let OperatorService = class OperatorService {
|
|
|
1596
1600
|
description: `[${step.shell ?? 'pwsh'}] ${step.cmd}`,
|
|
1597
1601
|
createdAt: new Date().toISOString(),
|
|
1598
1602
|
...(ctx.actor ? { actor: ctx.actor } : {}),
|
|
1599
|
-
...(held ? { network: held.network } : {}),
|
|
1603
|
+
...(held?.network ? { network: held.network } : {}),
|
|
1604
|
+
...(held?.platform ? { platform: held.platform } : {}),
|
|
1600
1605
|
};
|
|
1601
1606
|
this.waiting.set(approval.id, { approval, resolve: resolvePromise });
|
|
1602
1607
|
this.bus.publish({ sessionId: approval.sessionId, taskId: approval.taskId, type: 'approval-requested', level: 'warn',
|
|
1603
1608
|
message: held
|
|
1604
|
-
? `held for the operator — ${held.network}: ${approval.description}`
|
|
1609
|
+
? `held for the operator — ${[held.platform ? `it reaches ${held.platform} with the operator's access` : '', held.network ?? ''].filter(Boolean).join('; ')}: ${approval.description}`
|
|
1605
1610
|
: `waiting for approval: ${approval.description}`,
|
|
1606
1611
|
data: { ...approval } });
|
|
1607
1612
|
}), signal);
|
|
@@ -1974,13 +1979,26 @@ let OperatorService = class OperatorService {
|
|
|
1974
1979
|
const cached = await this.store.getModels();
|
|
1975
1980
|
const defaultModel = cfg.copilot.defaultModel ?? '';
|
|
1976
1981
|
const defaultReviewModel = cfg.copilot.defaultReviewModel ?? '';
|
|
1977
|
-
|
|
1982
|
+
const defaultLeadModel = cfg.copilot.defaultLeadModel ?? '';
|
|
1983
|
+
return cached ? { ...cached, defaultModel, defaultLeadModel, defaultReviewModel } : { defaultModel, defaultLeadModel, defaultReviewModel, options: [], readAt: null };
|
|
1978
1984
|
}
|
|
1979
1985
|
/**
|
|
1980
1986
|
* Sets the model a new session's independent review starts on. An empty name clears it,
|
|
1981
1987
|
* which means the review runs on the session's own model — the weaker choice, and the one
|
|
1982
1988
|
* every session had before this existed.
|
|
1983
1989
|
*/
|
|
1990
|
+
/** Sets the model the lead of two chats starts on (2026-10-23). An empty name leaves its chat on whatever it is. */
|
|
1991
|
+
async setDefaultLeadModel(name) {
|
|
1992
|
+
await this.init();
|
|
1993
|
+
await this.settings.update((raw) => ({ ...raw, copilot: { ...(raw.copilot ?? {}), defaultLeadModel: name.trim() } }));
|
|
1994
|
+
this.bus.publish({
|
|
1995
|
+
sessionId: '*',
|
|
1996
|
+
type: 'default-lead-model-changed',
|
|
1997
|
+
level: 'info',
|
|
1998
|
+
message: name.trim() ? `the lead of two chats will start on ${name.trim()}` : 'the lead of two chats leaves the chat on its model',
|
|
1999
|
+
});
|
|
2000
|
+
return { defaultLeadModel: name.trim() };
|
|
2001
|
+
}
|
|
1984
2002
|
async setDefaultReviewModel(name) {
|
|
1985
2003
|
await this.init();
|
|
1986
2004
|
await this.settings.update((raw) => ({ ...raw, copilot: { ...(raw.copilot ?? {}), defaultReviewModel: name.trim() } }));
|
|
@@ -2125,12 +2143,16 @@ let OperatorService = class OperatorService {
|
|
|
2125
2143
|
const saved = cfg.copilot;
|
|
2126
2144
|
const work = (saved.defaultModel ?? '').trim();
|
|
2127
2145
|
const review = (saved.defaultReviewModel ?? '').trim();
|
|
2146
|
+
const lead = (saved.defaultLeadModel ?? '').trim();
|
|
2128
2147
|
const workNow = work ? pageModelFor(work, options) : null;
|
|
2129
2148
|
const reviewNow = review ? pageModelFor(review, options) : null;
|
|
2149
|
+
const leadNow = lead ? pageModelFor(lead, options) : null;
|
|
2130
2150
|
if (workNow && !sameModel(workNow.name, work))
|
|
2131
2151
|
await this.setDefaultModel(workNow.name);
|
|
2132
2152
|
if (reviewNow && !sameModel(reviewNow.name, review))
|
|
2133
2153
|
await this.setDefaultReviewModel(reviewNow.name);
|
|
2154
|
+
if (leadNow && !sameModel(leadNow.name, lead))
|
|
2155
|
+
await this.setDefaultLeadModel(leadNow.name);
|
|
2134
2156
|
return catalogue;
|
|
2135
2157
|
}
|
|
2136
2158
|
finally {
|
package/dist/src/cli.js
CHANGED
|
@@ -497,6 +497,7 @@ program
|
|
|
497
497
|
isolation: cfg.execution.isolation,
|
|
498
498
|
lockedToConfirm: cfg.policyLock?.maxMode === 'confirm',
|
|
499
499
|
networkFetch: cfg.execution.networkFetch,
|
|
500
|
+
platformAccess: cfg.execution.questions === 'agree' ? 'allow' : 'ask',
|
|
500
501
|
};
|
|
501
502
|
const authorizer = cfg.execution.mode === 'unattended'
|
|
502
503
|
? unattendedAuthorizer(policy)
|
|
@@ -115,6 +115,12 @@ export const RunConfigSchema = z.object({
|
|
|
115
115
|
* different from whatever did the work.
|
|
116
116
|
*/
|
|
117
117
|
defaultReviewModel: z.string().default(''),
|
|
118
|
+
/**
|
|
119
|
+
* The model the lead of two chats starts on (operator, 2026-10-23: "Model for the worker, Model for the lead, Model
|
|
120
|
+
* for the review" — `defaultModel` being the worker's: the one chat, or the worker of two chats). Empty leaves the
|
|
121
|
+
* lead's conversation on whatever it is set to.
|
|
122
|
+
*/
|
|
123
|
+
defaultLeadModel: z.string().default(''),
|
|
118
124
|
/**
|
|
119
125
|
* Choose the model by hand (operator's workaround, 2026-10-06): at the start of a run, and of a review's
|
|
120
126
|
* conversation, the runner does not touch the picker; a card in the UI asks the operator to choose the
|
|
@@ -123,6 +129,9 @@ export const RunConfigSchema = z.object({
|
|
|
123
129
|
* user choosing it by hand, and test the bot itself"); off, the runner chooses the model itself.
|
|
124
130
|
*/
|
|
125
131
|
manualModel: z.boolean().default(true),
|
|
132
|
+
/** The lead's and the review's models chosen by hand, each on its own (2026-10-23); absent, as `manualModel`. */
|
|
133
|
+
leadManualModel: z.boolean().optional(),
|
|
134
|
+
reviewManualModel: z.boolean().optional(),
|
|
126
135
|
replyTimeoutSec: z.number().int().positive().default(900),
|
|
127
136
|
signInTimeoutSec: z.number().int().positive().default(900),
|
|
128
137
|
humanWaitSec: z.number().int().positive().default(900),
|
|
@@ -169,6 +178,13 @@ export const RunConfigSchema = z.object({
|
|
|
169
178
|
* there, a fetch included, is put in front of a person anyway.
|
|
170
179
|
*/
|
|
171
180
|
networkFetch: z.enum(['ask', 'refuse', 'run']).default('ask'),
|
|
181
|
+
/**
|
|
182
|
+
* The bot's questions (operator, 2026-10-23: "an option in Settings to pass over questions — the user always agrees
|
|
183
|
+
* with what the bot proposes"): `ask` puts them to the operator — a command that reaches a platform with the
|
|
184
|
+
* operator's access (`exec/platforms.ts`), and a chat's or the lead's question with its answers to click; `agree`
|
|
185
|
+
* takes what the bot proposes — the command runs, the recommended answer is given — and says so in the chat.
|
|
186
|
+
*/
|
|
187
|
+
questions: z.enum(['ask', 'agree']).default('ask'),
|
|
172
188
|
/**
|
|
173
189
|
* Plan mode, for every session that does not set its own (see `PlanMode` in session/model.ts): a
|
|
174
190
|
* task's chat first looks at the project read-only and replies with a plan, and the work begins once
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { staticCheck, describeStep } from './policy.js';
|
|
2
2
|
import { networkFetchReason, networkFetchRefusal } from './network.js';
|
|
3
3
|
import { scriptNetworkReason } from './policy.js';
|
|
4
|
+
import { platformReason } from './platforms.js';
|
|
4
5
|
import { createInterface } from 'node:readline/promises';
|
|
5
6
|
import { stdin, stdout } from 'node:process';
|
|
6
7
|
/**
|
|
@@ -31,26 +32,37 @@ export function makeAuthorizer(cfg, ask, signal) {
|
|
|
31
32
|
return blocked;
|
|
32
33
|
const cwd = ctx.confinement?.cwd;
|
|
33
34
|
const network = networkFetchReason(step.cmd, cwd) ?? (cwd ? scriptNetworkReason(step.cmd, cwd) : null);
|
|
35
|
+
// A platform reached with the operator's access (2026-10-23): asked in every mode, unless Settings agree to it.
|
|
36
|
+
const platform = cfg.platformAccess === 'allow' ? null : platformReason(step.cmd, step.shell);
|
|
34
37
|
if (network) {
|
|
35
38
|
if (cfg.mode === 'unattended' && cfg.networkFetch === 'refuse')
|
|
36
39
|
return { action: 'skip', reason: networkFetchRefusal(network) };
|
|
37
|
-
if (cfg.mode === 'unattended' && cfg.networkFetch === 'run')
|
|
40
|
+
if (!platform && cfg.mode === 'unattended' && cfg.networkFetch === 'run')
|
|
38
41
|
return { action: 'run' };
|
|
39
|
-
return await ask(step, ctx, { network });
|
|
42
|
+
return await ask(step, ctx, { network, ...(platform ? { platform } : {}) });
|
|
40
43
|
}
|
|
44
|
+
if (platform)
|
|
45
|
+
return await ask(step, ctx, { platform });
|
|
41
46
|
if (cfg.mode === 'unattended')
|
|
42
47
|
return { action: 'run' };
|
|
43
48
|
return await ask(step, ctx);
|
|
44
49
|
},
|
|
45
50
|
};
|
|
46
51
|
}
|
|
52
|
+
/** What the chat is told when a command to a platform was held and nobody was there to allow it. */
|
|
53
|
+
export function platformRefusal(platform) {
|
|
54
|
+
return (`refused: this command reaches ${platform} with the operator's access, which only the operator may allow, and this run has ` +
|
|
55
|
+
'nobody to ask. Do the work without it, or say in `notes` what is needed there and end `blocked`.');
|
|
56
|
+
}
|
|
47
57
|
/** The terminal version: Enter runs, `s` skips, `q` aborts. */
|
|
48
58
|
export function terminalAuthorizer(cfg, print) {
|
|
49
59
|
return makeAuthorizer(cfg, async (step, _ctx, held) => {
|
|
50
60
|
print('');
|
|
51
61
|
print(` step ${step.id}: ${describeStep(step)}`);
|
|
52
|
-
if (held)
|
|
62
|
+
if (held?.network)
|
|
53
63
|
print(` held: ${held.network}`);
|
|
64
|
+
if (held?.platform)
|
|
65
|
+
print(` held: it reaches ${held.platform} with your access`);
|
|
54
66
|
const rl = createInterface({ input: stdin, output: stdout });
|
|
55
67
|
try {
|
|
56
68
|
const answer = (await rl.question(' [Enter] run [s] skip [q] abort > ')).trim().toLowerCase();
|
|
@@ -75,5 +87,5 @@ export function terminalAuthorizer(cfg, print) {
|
|
|
75
87
|
* those steps.
|
|
76
88
|
*/
|
|
77
89
|
export function unattendedAuthorizer(cfg) {
|
|
78
|
-
return makeAuthorizer({ ...cfg, mode: 'unattended' }, async (_step, _ctx, held) => held ? { action: 'skip', reason: networkFetchRefusal(held.network) } : { action: 'run' });
|
|
90
|
+
return makeAuthorizer({ ...cfg, mode: 'unattended' }, async (_step, _ctx, held) => held?.network ? { action: 'skip', reason: networkFetchRefusal(held.network) } : held?.platform ? { action: 'skip', reason: platformRefusal(held.platform) } : { action: 'run' });
|
|
79
91
|
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Commands that reach a platform outside this machine with the operator's own access (operator, 2026-10-23: "it asked
|
|
3
|
+
* me whether to run Azure CLI commands; ask the same for every other such platform — Jira, Vercel, AWS, GitHub —
|
|
4
|
+
* permission must come from the user"). Such a command acts in the operator's name, on their cloud, their tickets,
|
|
5
|
+
* their repositories, their packages: it is put to the operator in every run, an unattended one too, as a download is
|
|
6
|
+
* (`network.ts`), unless Settings say to agree with what the bot proposes (`execution.questions: agree`).
|
|
7
|
+
*
|
|
8
|
+
* Read by the programs a line starts (`commandHeads`, as the shell reads it), not by words anywhere in it: a file
|
|
9
|
+
* that mentions `az` is not a command to Azure.
|
|
10
|
+
*/
|
|
11
|
+
import { commandHeads, externalProgram } from './programs.js';
|
|
12
|
+
/** Platform command-line tools, by the program's name. */
|
|
13
|
+
const TOOLS = {
|
|
14
|
+
az: 'Azure (az)',
|
|
15
|
+
azd: 'Azure Developer CLI (azd)',
|
|
16
|
+
func: 'Azure Functions (func)',
|
|
17
|
+
aws: 'AWS (aws)',
|
|
18
|
+
sam: 'AWS SAM (sam)',
|
|
19
|
+
cdk: 'AWS CDK (cdk)',
|
|
20
|
+
eb: 'AWS Elastic Beanstalk (eb)',
|
|
21
|
+
eksctl: 'AWS EKS (eksctl)',
|
|
22
|
+
gcloud: 'Google Cloud (gcloud)',
|
|
23
|
+
gsutil: 'Google Cloud Storage (gsutil)',
|
|
24
|
+
bq: 'Google BigQuery (bq)',
|
|
25
|
+
gh: 'GitHub (gh)',
|
|
26
|
+
glab: 'GitLab (glab)',
|
|
27
|
+
jira: 'Jira (jira)',
|
|
28
|
+
acli: 'Atlassian (acli)',
|
|
29
|
+
vercel: 'Vercel (vercel)',
|
|
30
|
+
netlify: 'Netlify (netlify)',
|
|
31
|
+
heroku: 'Heroku (heroku)',
|
|
32
|
+
fly: 'Fly.io (fly)',
|
|
33
|
+
flyctl: 'Fly.io (flyctl)',
|
|
34
|
+
firebase: 'Firebase (firebase)',
|
|
35
|
+
doctl: 'DigitalOcean (doctl)',
|
|
36
|
+
wrangler: 'Cloudflare (wrangler)',
|
|
37
|
+
supabase: 'Supabase (supabase)',
|
|
38
|
+
railway: 'Railway (railway)',
|
|
39
|
+
kubectl: 'Kubernetes (kubectl)',
|
|
40
|
+
helm: 'Kubernetes (helm)',
|
|
41
|
+
oc: 'OpenShift (oc)',
|
|
42
|
+
terraform: 'Terraform (terraform)',
|
|
43
|
+
pulumi: 'Pulumi (pulumi)',
|
|
44
|
+
serverless: 'Serverless (serverless)',
|
|
45
|
+
sls: 'Serverless (sls)',
|
|
46
|
+
};
|
|
47
|
+
/** PowerShell modules that sign in to a platform or act on it, by the cmdlet's name. */
|
|
48
|
+
const CMDLETS = [
|
|
49
|
+
[/^(?:connect|disconnect)-azaccount$|^[A-Za-z]+-Az[A-Z]\w*$/, 'Azure (Az PowerShell)'],
|
|
50
|
+
[/^(?:connect|disconnect)-azuread$|^[A-Za-z]+-AzureAD\w*$/, 'Azure AD (AzureAD PowerShell)'],
|
|
51
|
+
[/^(?:connect|disconnect)-mggraph$|^[A-Za-z]+-Mg[A-Z]\w*$/, 'Microsoft Graph (PowerShell)'],
|
|
52
|
+
[/^(?:connect|disconnect)-exchangeonline$|^(?:connect|disconnect)-ippssession$/, 'Exchange Online (PowerShell)'],
|
|
53
|
+
[/^(?:connect|disconnect)-pnponline$|^[A-Za-z]+-PnP[A-Z]\w*$/, 'SharePoint (PnP PowerShell)'],
|
|
54
|
+
[/^(?:connect|disconnect)-microsoftteams$/, 'Microsoft Teams (PowerShell)'],
|
|
55
|
+
[/^(?:connect|disconnect)-msolservice$/, 'Microsoft Online (MSOnline PowerShell)'],
|
|
56
|
+
[/^(?:set|initialize)-awsdefault\w*$|^set-awscredential$/, 'AWS (AWS Tools for PowerShell)'],
|
|
57
|
+
];
|
|
58
|
+
/** Package registries and image registries, written to: publishing, signing in, removing. */
|
|
59
|
+
const REGISTRIES = [
|
|
60
|
+
[/(?:^|[\s;|&(])(?:npm|pnpm|yarn|bun)(?:\.cmd|\.exe)?\s+(?:[^\s;|&]+\s+)*?(?:publish|unpublish|deprecate|login|adduser|logout|owner|token|dist-tag|access)\b/i, 'the npm registry'],
|
|
61
|
+
[/(?:^|[\s;|&(])(?:docker|podman)(?:\.exe)?\s+(?:login|push|logout)\b/i, 'a container registry'],
|
|
62
|
+
[/(?:^|[\s;|&(])dotnet(?:\.exe)?\s+nuget\s+(?:push|delete)\b|(?:^|[\s;|&(])nuget(?:\.exe)?\s+(?:push|delete)\b/i, 'NuGet'],
|
|
63
|
+
[/(?:^|[\s;|&(])twine(?:\.exe)?\s+upload\b/i, 'PyPI (twine)'],
|
|
64
|
+
[/(?:^|[\s;|&(])gem\s+(?:push|yank|signin)\b/i, 'RubyGems'],
|
|
65
|
+
[/(?:^|[\s;|&(])cargo(?:\.exe)?\s+(?:publish|yank|login)\b/i, 'crates.io'],
|
|
66
|
+
];
|
|
67
|
+
/**
|
|
68
|
+
* The platform a command reaches with the operator's access, as the card names it, or null. `Connect-AzAccount` is
|
|
69
|
+
* Azure; `npm publish` the npm registry; `az login; gh repo list` the first one met.
|
|
70
|
+
*/
|
|
71
|
+
export function platformReason(command, shell) {
|
|
72
|
+
for (const head of commandHeads(command, shell)) {
|
|
73
|
+
const program = externalProgram(head);
|
|
74
|
+
if (program && TOOLS[program.toLowerCase()])
|
|
75
|
+
return TOOLS[program.toLowerCase()];
|
|
76
|
+
const bare = head.replace(/^.*[\\/]/, '').replace(/^['"]|['"]$/g, '');
|
|
77
|
+
// Cmdlets are matched as written (`Get-AzVM`, not `get-azvm`, keeps Az apart from words that start so), and
|
|
78
|
+
// case-insensitively for the verbs that sign in.
|
|
79
|
+
for (const [pattern, name] of CMDLETS)
|
|
80
|
+
if (pattern.test(bare) || pattern.test(bare.toLowerCase()))
|
|
81
|
+
return name;
|
|
82
|
+
}
|
|
83
|
+
for (const [pattern, name] of REGISTRIES)
|
|
84
|
+
if (pattern.test(command))
|
|
85
|
+
return name;
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
@@ -351,10 +351,16 @@ export async function runLeadTask(transport, session, task, deps) {
|
|
|
351
351
|
* The worker's model as chosen under the chat's box; with none chosen, the lead's — by hand when the lead's is.
|
|
352
352
|
* A worker with no model of its own would be asked about by hand on every conversation that named one.
|
|
353
353
|
*/
|
|
354
|
+
/*
|
|
355
|
+
* The worker's model as chosen under the chat's box; with none chosen, Settings' model for the worker (2026-10-23:
|
|
356
|
+
* three models in Settings — the worker's, the lead's, the review's); with none there either, the lead's, by hand
|
|
357
|
+
* when the lead's is — as before Settings had one for each.
|
|
358
|
+
*/
|
|
354
359
|
const own = lead2.workerModel?.trim();
|
|
355
|
-
|
|
360
|
+
const fromSettings = (cfg.copilot.defaultModel ?? '').trim();
|
|
361
|
+
if (lead2.workerManualModel || (!own && !fromSettings && now?.manualModel))
|
|
356
362
|
s.manualModel = true;
|
|
357
|
-
else if (own || now?.model?.trim()) {
|
|
363
|
+
else if (own || (!fromSettings && now?.model?.trim())) {
|
|
358
364
|
s.model = own || now?.model?.trim();
|
|
359
365
|
s.modelSource = 'operator';
|
|
360
366
|
}
|
|
@@ -600,12 +606,25 @@ export async function runLeadTask(transport, session, task, deps) {
|
|
|
600
606
|
case 'ask': {
|
|
601
607
|
round.question = { text: r.question, ...(r.why ? { why: r.why } : {}), ...(r.options.length > 0 ? { options: r.options } : {}) };
|
|
602
608
|
await saveLead();
|
|
609
|
+
/*
|
|
610
|
+
* Settings agree with what the bot proposes (2026-10-23): the lead's recommended answer, its first, is taken
|
|
611
|
+
* and said; with no answers given, it is told to go on as it proposes.
|
|
612
|
+
*/
|
|
613
|
+
if (cfg.execution.questions === 'agree') {
|
|
614
|
+
const agreed = r.options[0] ?? 'Go on as you propose.';
|
|
615
|
+
round.question.answer = agreed;
|
|
616
|
+
round.question.at = new Date().toISOString();
|
|
617
|
+
await saveLead();
|
|
618
|
+
sink.event('question-agreed', { round: round.n, question: r.question, answer: agreed }, `the lead asked: ${r.question} — answered as it recommends (Settings agree with what the bot proposes): ${agreed}`);
|
|
619
|
+
markdown = await tell(operatorAnswerMessage(agreed, max - lead.subtasks));
|
|
620
|
+
break;
|
|
621
|
+
}
|
|
603
622
|
if (!deps.askQuestion) {
|
|
604
623
|
markdown = await tell(NOBODY_TO_ASK);
|
|
605
624
|
break;
|
|
606
625
|
}
|
|
607
626
|
sink.event('lead-question', { round: round.n, question: r.question }, `the lead asks the operator: ${r.question}`, 'warn');
|
|
608
|
-
const got = await deps.askQuestion({ sessionId: session.id, taskId: task.id, question: r.question, ...(r.why ? { why: r.why } : {}), options: r.options });
|
|
627
|
+
const got = await deps.askQuestion({ sessionId: session.id, taskId: task.id, question: r.question, ...(r.why ? { why: r.why } : {}), options: r.options, actor: 'lead' });
|
|
609
628
|
if (got === 'stop' || signal?.aborted)
|
|
610
629
|
return await finish('aborted', 'the operator stopped the task at the lead\'s question');
|
|
611
630
|
round.question.answer = got.answer;
|
|
@@ -31,7 +31,7 @@ import { describeCrash } from '../transport/edgeCrash.js';
|
|
|
31
31
|
import { runReview, findingsMessage, deliverableFor } from './review.js';
|
|
32
32
|
import { allAboutTheTask, isRepeat, findingId } from '../protocol/reviewSchema.js';
|
|
33
33
|
import { repoState, workingTreePaths } from '../vcs/git.js';
|
|
34
|
-
import { describeStep, checkCommandRefusal, commandRefusal } from '../exec/policy.js';
|
|
34
|
+
import { describeStep, checkCommandRefusal, commandRefusal, staticCheck } from '../exec/policy.js';
|
|
35
35
|
import { networkFetchReason } from '../exec/network.js';
|
|
36
36
|
import { collectPolicyManifest, describePolicyManifest } from '../exec/policyManifest.js';
|
|
37
37
|
import { assessIsolation, readIsolationSignals } from '../exec/isolation.js';
|
|
@@ -76,10 +76,10 @@ async function followPageModels(which, wanted, result, session, store, hooks, fr
|
|
|
76
76
|
if (own) {
|
|
77
77
|
await store
|
|
78
78
|
?.updateSession(session.id, (s) => {
|
|
79
|
-
if (which === '
|
|
80
|
-
s.model = result.matched;
|
|
81
|
-
else
|
|
79
|
+
if (which === 'review')
|
|
82
80
|
s.review = { ...(s.review ?? {}), model: result.matched };
|
|
81
|
+
else
|
|
82
|
+
s.model = result.matched;
|
|
83
83
|
})
|
|
84
84
|
.catch(() => undefined);
|
|
85
85
|
}
|
|
@@ -643,7 +643,12 @@ export async function openSessionTransport(cfg, session, bus, runsDir, signal) {
|
|
|
643
643
|
export function effectiveModels(session, cfg) {
|
|
644
644
|
const pick = (own, source, settings) => own && source === 'operator' ? [own, 'session'] : settings ? [settings, 'settings'] : own ? [own, 'plan'] : ['', 'none'];
|
|
645
645
|
// Set by hand in the Copilot window: no name is asked for, neither the session's nor the one in Settings.
|
|
646
|
-
|
|
646
|
+
/*
|
|
647
|
+
* Settings' model for the conversation's part (2026-10-23): the lead's for the lead of two chats — the worker's when
|
|
648
|
+
* none is chosen for the lead, as before there were two — else the worker's.
|
|
649
|
+
*/
|
|
650
|
+
const fromSettings = ((session.lead ? cfg.copilot.defaultLeadModel?.trim() || cfg.copilot.defaultModel : cfg.copilot.defaultModel) ?? '').trim();
|
|
651
|
+
const [model, modelFrom] = session.manualModel ? ['', 'none'] : pick((session.model ?? '').trim(), session.modelSource, fromSettings);
|
|
647
652
|
const [reviewModel, reviewModelFrom] = pick((session.review?.model ?? '').trim(), session.reviewModelSource, (cfg.copilot.defaultReviewModel ?? '').trim());
|
|
648
653
|
return { model, reviewModel, modelFrom, reviewModelFrom };
|
|
649
654
|
}
|
|
@@ -653,7 +658,9 @@ export function effectiveModels(session, cfg) {
|
|
|
653
658
|
* model and has none from Settings either — its picker shows "by hand" for that, and what it shows is what happens.
|
|
654
659
|
*/
|
|
655
660
|
export function modelByHand(session, cfg) {
|
|
656
|
-
|
|
661
|
+
// Settings' "by hand" for the conversation's part (2026-10-23): the lead's has its own, absent as the worker's.
|
|
662
|
+
const settingsSay = session.lead ? (cfg.copilot.leadManualModel ?? cfg.copilot.manualModel) : cfg.copilot.manualModel;
|
|
663
|
+
if (settingsSay || session.manualModel)
|
|
657
664
|
return true;
|
|
658
665
|
return session.kind === 'chat' && !effectiveModels(session, cfg).model;
|
|
659
666
|
}
|
|
@@ -736,7 +743,7 @@ signal) {
|
|
|
736
743
|
const hand = await withOperatorHand(transport, wanted, result, hooks, session.id, bus, false, asks);
|
|
737
744
|
result = hand.result;
|
|
738
745
|
const goOnAsItIs = hand.goOnAsItIs;
|
|
739
|
-
const renamed = await followPageModels('model', wanted, result, session, store, hooks, modelFrom);
|
|
746
|
+
const renamed = await followPageModels(session.lead ? 'lead' : 'model', wanted, result, session, store, hooks, modelFrom);
|
|
740
747
|
if (renamed)
|
|
741
748
|
bus.publish({ sessionId: session.id, type: 'model-renamed', level: 'warn', message: renamed, data: { asked: wanted, chosen: result.matched } });
|
|
742
749
|
bus.publish({
|
|
@@ -1018,6 +1025,11 @@ export async function runTask(transport, session, task, deps) {
|
|
|
1018
1025
|
let disputes = [];
|
|
1019
1026
|
/** What the runner tells the model in its next message about the reply just processed. */
|
|
1020
1027
|
let runnerNotes = [];
|
|
1028
|
+
/*
|
|
1029
|
+
* Commands the operator chose an answer for (2026-10-23): the click is the permission for that one command, once.
|
|
1030
|
+
* The rules that refuse a command still apply to it.
|
|
1031
|
+
*/
|
|
1032
|
+
const consented = new Set();
|
|
1021
1033
|
/** The projects for reference only, watched for the length of the task (see `vcs/referenceGuard.ts`). */
|
|
1022
1034
|
let reference = null;
|
|
1023
1035
|
/** Steps the chat sent that were not run, for the handoff at the end. */
|
|
@@ -2160,7 +2172,8 @@ export async function runTask(transport, session, task, deps) {
|
|
|
2160
2172
|
* hand unless one is named (2026-10-17), and its review is too: asked on a card that says it is the review's
|
|
2161
2173
|
* and why a different, stronger model is worth choosing for it (operator, 2026-10-20).
|
|
2162
2174
|
*/
|
|
2163
|
-
|
|
2175
|
+
// The review's own "by hand" in Settings (2026-10-23), absent as the worker's.
|
|
2176
|
+
const reviewByHand = (cfg.copilot.reviewManualModel ?? cfg.copilot.manualModel) || !!session.manualModel || (session.kind === 'chat' && !model);
|
|
2164
2177
|
const repoDir = trackedRepoOf(session);
|
|
2165
2178
|
/*
|
|
2166
2179
|
* What changed, read from git rather than from anybody's account of it.
|
|
@@ -2646,6 +2659,67 @@ export async function runTask(transport, session, task, deps) {
|
|
|
2646
2659
|
* what the reply said, at greater length and one message later. The reason carries the
|
|
2647
2660
|
* approaches that were tried, and that is what the register shows.
|
|
2648
2661
|
*/
|
|
2662
|
+
/*
|
|
2663
|
+
* A question only the operator can answer (operator, 2026-10-23: "answers to click, not only a text field; when the
|
|
2664
|
+
* chat proposes a command for the user to run by hand, a button behind it, and the bot runs it"): put to the
|
|
2665
|
+
* operator with its answers — or, Settings agreeing with what the bot proposes, or nobody there to ask, the first,
|
|
2666
|
+
* which the chat recommends. The answer goes back; an answer that carries a command has it run here and now, as
|
|
2667
|
+
* this reply's step, its output going back with the answer.
|
|
2668
|
+
*/
|
|
2669
|
+
if (reply.status === 'ask') {
|
|
2670
|
+
const question = (reply.question ?? '').trim();
|
|
2671
|
+
const options = reply.options;
|
|
2672
|
+
const agree = cfg.execution.questions === 'agree' || !deps.askQuestion;
|
|
2673
|
+
let answer = options[0].answer;
|
|
2674
|
+
if (agree) {
|
|
2675
|
+
sink.event('question-agreed', { question, answer, why: cfg.execution.questions === 'agree' ? 'settings' : 'nobody to ask' }, `the chat asked: ${question} — answered as it recommends (${cfg.execution.questions === 'agree' ? 'Settings agree with what the bot proposes' : 'nobody is there to ask'}): ${answer}`);
|
|
2676
|
+
}
|
|
2677
|
+
else {
|
|
2678
|
+
sink.event('question-asked', { question, options: options.map((o) => o.answer) }, `the chat asks the operator: ${question}`, 'warn');
|
|
2679
|
+
await setTask((t) => {
|
|
2680
|
+
t.status = 'waiting-approval';
|
|
2681
|
+
});
|
|
2682
|
+
const got = await deps.askQuestion({
|
|
2683
|
+
sessionId: session.id,
|
|
2684
|
+
taskId: task.id,
|
|
2685
|
+
question,
|
|
2686
|
+
...(reply.why?.trim() ? { why: reply.why.trim() } : {}),
|
|
2687
|
+
options: options.map((o) => o.answer),
|
|
2688
|
+
commands: options.map((o) => o.run ?? null),
|
|
2689
|
+
actor: planning ? 'plan' : 'worker',
|
|
2690
|
+
});
|
|
2691
|
+
await setTask((t) => {
|
|
2692
|
+
t.status = 'running';
|
|
2693
|
+
});
|
|
2694
|
+
if (got === 'stop' || signal?.aborted)
|
|
2695
|
+
return await finish('aborted', 'stopped by the operator at its question', undefined, lastMarkdown);
|
|
2696
|
+
answer = got.answer;
|
|
2697
|
+
sink.event('question-answered', { question, answer }, `the operator answered: ${answer}`);
|
|
2698
|
+
}
|
|
2699
|
+
await record('QUESTION', `${question}\n\nAnswer${agree ? ' (as the chat recommends)' : ''}: ${answer}`);
|
|
2700
|
+
const chosen = options.find((o) => o.answer === answer);
|
|
2701
|
+
if (chosen?.run) {
|
|
2702
|
+
// Run as this reply's one step: through the step loop below, its output reported as any step's.
|
|
2703
|
+
consented.add(chosen.run.trim());
|
|
2704
|
+
const mutable = reply;
|
|
2705
|
+
mutable.status = 'continue';
|
|
2706
|
+
mutable.steps = [{ id: 1, type: 'command', cmd: chosen.run, ...(chosen.shell ? { shell: chosen.shell } : {}) }];
|
|
2707
|
+
runnerNotes.push(`${agree ? 'The runner took your recommended answer' : 'The operator answered your question'} ("${question}"): "${answer}". ` +
|
|
2708
|
+
'The runner ran the command that answer carries — step 1 below, its output with it. Go on from there.');
|
|
2709
|
+
}
|
|
2710
|
+
else {
|
|
2711
|
+
const message = `${agree ? 'The runner took your recommended answer' : 'The operator answered your question'} ("${question}"): "${answer}".\n\n` +
|
|
2712
|
+
'Go on with the work from here, in the same format.';
|
|
2713
|
+
await record('ANSWER', message);
|
|
2714
|
+
await pacer.throttleSend();
|
|
2715
|
+
const before = await transport.sendAndConfirm(message);
|
|
2716
|
+
const next = await transport.waitForReply(before);
|
|
2717
|
+
await saveReply('answer', next);
|
|
2718
|
+
lastMarkdown = next.markdown;
|
|
2719
|
+
await pacer.settle();
|
|
2720
|
+
continue;
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2649
2723
|
/*
|
|
2650
2724
|
* Plan mode: the reply that ends the planning phase — put to the operator or approved by the runner —
|
|
2651
2725
|
* and the two that do not belong in it. Answered here, in a message of its own, as a repair of the
|
|
@@ -2880,7 +2954,10 @@ export async function runTask(transport, session, task, deps) {
|
|
|
2880
2954
|
t.status = 'waiting-approval';
|
|
2881
2955
|
});
|
|
2882
2956
|
sink.event('step-proposed', { id: step.id, description: describeStep(step) }, `step ${step.id}: ${describeStep(step)}`);
|
|
2883
|
-
|
|
2957
|
+
// The command of an answer the operator chose (2026-10-23): their click allowed it; the refusing rules still hold.
|
|
2958
|
+
const decided = consented.delete(step.cmd.trim())
|
|
2959
|
+
? (staticCheck(step, { mode: 'confirm', denyPatterns: cfg.execution.denyPatterns, allowedPrograms: cfg.execution.allowedPrograms }, undefined, confinement) ?? { action: 'run' })
|
|
2960
|
+
: await authorizer.authorize(step, { sessionId: session.id, taskId: task.id, iteration: iterations, confinement, actor: planning ? 'plan' : 'worker' });
|
|
2884
2961
|
await setTask((t) => {
|
|
2885
2962
|
t.status = 'running';
|
|
2886
2963
|
});
|
|
@@ -137,7 +137,7 @@ You are **Kerrigan**. You help the person talking to you get their work done wit
|
|
|
137
137
|
- The person writes a task in the chat, about the **project folder** open there. The program sends it to **Microsoft 365 Copilot** (a work account) in an Edge window it opens and keeps open between messages; when the work on a message has ended, a card in that window says so, with an OK. Copilot cannot touch the machine itself: it answers with **PowerShell commands**, in a fixed JSON form.
|
|
138
138
|
- copilot-operator **runs those commands on the machine, in the project folder**, and sends back what they printed. Round after round, until Copilot says the task is **done** (with a summary of what it did), or **blocked** (with what it tried and what it needs), or a limit is reached.
|
|
139
139
|
- Copilot learns the project only through those commands: it lists files, reads them, runs the build and the tests. It is not sent the files themselves, and it knows nothing about the project that the task does not say and the commands cannot find.
|
|
140
|
-
- The person chooses how commands run: ${Q('
|
|
140
|
+
- The person chooses how commands run in Settings, under ${Q('exec.startMode')} (not in the chat): ${Q('exec.startModeAsk')} (they press ${Q('chat.askRun')}, ${Q('chat.askRunAll')} or ${Q('chat.askSkip')} on a card that says who asks) or ${Q('exec.startModeAuto')}. A list of forbidden commands applies either way; pushing to a remote is refused; nothing needs administrator rights.
|
|
141
141
|
- The model: ${Q('chat.model')} under the chat's box. When it is to be chosen by hand (the default), a card asks the person to choose the model in the Copilot window and press ${Q('approval.manualReady')}.
|
|
142
142
|
- ${Q('chat.planMode')} (a choice under the chat's box): Copilot first looks at the project with read-only commands and proposes a plan — what is there, how it means to do it, the stages, the files, how it will show it works — and nothing is changed until the person approves the plan (${Q('pm.approve')}), asks for another (${Q('pm.revise')}), or stops.
|
|
143
143
|
- ${Q('chat.review')} (under the chat's box, on unless unticked): when Copilot says the work is done, a conversation of its own reviews it — reads the changes, runs the checks — and sends back what it finds, up to ${n(rounds)} round(s) of fixing. When the model is chosen by hand, the card for the review's model says it is the review's: a different, stronger model than the one that did the work catches more mistakes.
|
|
@@ -180,7 +180,7 @@ ${skillsPart(lang, f.skills ?? [])}
|
|
|
180
180
|
- **Context Copilot cannot discover** — business rules, error messages copied word for word, the versions of the tools, why something is the way it is.
|
|
181
181
|
4. Never put passwords, tokens, keys or personal data in a task. If a command needs a secret, say where the program should read it from (an environment variable, a file that is already there) — not the secret.
|
|
182
182
|
5. The commands run in **PowerShell on Windows**. Say so when a task names commands, and prefer what is already installed on the machine; a step that downloads something from the network is asked about before it runs.
|
|
183
|
-
6. Suggest ${Q('chat.planMode')} for a change that touches several files or that the person wants to see planned first, and ${Q('
|
|
183
|
+
6. Suggest ${Q('chat.planMode')} for a change that touches several files or that the person wants to see planned first, and ${Q('exec.startModeAsk')} in Settings when they want to watch every step. Leave ${Q('chat.review')} on for work that matters; when they choose the models by hand, suggest a different, stronger model for the review than for the work. For a complex task that needs a plan and judgement along the way — a test suite to go through, a defect to investigate and report — suggest ${Q('chat.lead')}, and write the assignment in the shape under "Two chats": with two chats, suggest the strongest reasoning model for the lead and a model good at code for the worker.
|
|
184
184
|
7. When the person does not understand something in the program — a button, a card, why a task stopped — explain it from what is written here, name the control by its label, and lead them one step at a time until the task is done. If they are stuck, ask what they see on the screen.
|
|
185
185
|
8. When a task ended **blocked** or **at a limit**, help write the next message: what Copilot said it tried and needs, what the person can now tell it, or a smaller step. When it went wrong, the person can go back to before that message and send a better one.
|
|
186
186
|
9. When the same kind of task keeps coming back — a new automated test, a new entity, a database migration — suggest a skill for it in Settings, under "Skills", and help write it: a short name with hyphens (\`new-test\`), one line on what it is for, its project or every project, and instructions that say where the files go, the conventions, the steps, how to check the result and what to leave alone. A task of that kind then starts with \`/its-name\` (or the skill is chosen in ${Q('chat.skill')} under the chat's box), and the message only needs what is particular to it.
|
|
@@ -206,7 +206,7 @@ function bgText(f) {
|
|
|
206
206
|
- Човекът пише задание в чата, за **папката на проекта**, отворена там. Програмата го изпраща на **Microsoft 365 Copilot** (служебен акаунт) в прозорец на Edge, който отваря и държи отворен между съобщенията; когато работата по съобщение свърши, карта в този прозорец го казва, с бутон „ОК“. Copilot не може сам да пипа машината: отговаря с **команди на PowerShell**, в определен вид JSON.
|
|
207
207
|
- copilot-operator **изпълнява тези команди на машината, в папката на проекта**, и връща какво са изписали. Кръг след кръг, докато Copilot каже, че заданието е **готово** (с обобщение на направеното), или **блокирано** (с какво е опитал и какво му трябва), или се стигне ограничение.
|
|
208
208
|
- Copilot опознава проекта само чрез тези команди: изброява файлове, чете ги, пуска компилацията и тестовете. Самите файлове не му се изпращат и той не знае за проекта нищо, което заданието не казва и командите не могат да намерят.
|
|
209
|
-
- Човекът избира как се изпълняват
|
|
209
|
+
- Човекът избира как се изпълняват командите в Настройки, при ${Q('exec.startMode')} (не в чата): ${Q('exec.startModeAsk')} (натиска ${Q('chat.askRun')}, ${Q('chat.askRunAll')} или ${Q('chat.askSkip')} на карта, на която пише кой иска) или ${Q('exec.startModeAuto')}. И в двата случая важи списък със забранени команди; изпращането към отдалечено хранилище (push) се отказва; нищо не изисква администраторски права.
|
|
210
210
|
- Моделът: ${Q('chat.model')} под полето на чата. Когато се избира ръчно (по подразбиране), карта моли човека да избере модела в прозореца на Copilot и да натисне ${Q('approval.manualReady')}.
|
|
211
211
|
- ${Q('chat.planMode')} (избор под полето на чата): Copilot първо разглежда проекта само с команди, които четат, и предлага план — какво има, как смята да го направи, етапите, файловете, как ще покаже, че работи, — и нищо не се променя, докато човекът не одобри плана (${Q('pm.approve')}), не поиска друг (${Q('pm.revise')}) или не спре.
|
|
212
212
|
- ${Q('chat.review')} (под полето на чата, включена, освен ако не я изключат): когато Copilot каже, че работата е готова, отделен разговор я преглежда — чете промените, пуска проверките — и връща каквото открие, до ${n(rounds)} кръга поправка. Когато моделът се избира ръчно, картата за модела на рецензията казва, че е за нея: модел, различен и по-силен от този, с който е работено, хваща повече грешки.
|
|
@@ -249,7 +249,7 @@ ${skillsPart('bg', f.skills ?? [])}
|
|
|
249
249
|
- **Контекст, който Copilot не може да открие** — бизнес правила, съобщения за грешки, копирани дума по дума, версиите на инструментите, защо нещо е такова, каквото е.
|
|
250
250
|
4. Никога не слагай в заданието пароли, токени, ключове или лични данни. Ако команда има нужда от тайна, кажи откъде програмата да я прочете (променлива на средата, файл, който вече е там) — не самата тайна.
|
|
251
251
|
5. Командите се изпълняват в **PowerShell под Windows**. Кажи го, когато заданието посочва команди, и предпочитай това, което вече е инсталирано на машината; стъпка, която тегли нещо от мрежата, се пита, преди да се изпълни.
|
|
252
|
-
6. Предлагай ${Q('chat.planMode')} за промяна, която пипа няколко файла или която човекът иска първо да види планирана, и ${Q('
|
|
252
|
+
6. Предлагай ${Q('chat.planMode')} за промяна, която пипа няколко файла или която човекът иска първо да види планирана, и ${Q('exec.startModeAsk')} в Настройки, когато иска да следи всяка стъпка. Оставяй ${Q('chat.review')} включена за важна работа; когато моделите се избират ръчно, предлагай за рецензията различен и по-силен модел от този за работата. За сложна задача, която иска план и преценка по пътя — тестове за преглед, дефект за изследване и докладване, — предлагай ${Q('chat.lead')} и пиши заданието във вида от „Два чата“; с два чата предлагай най-силния модел за разсъждение за ръководителя и модел, добър с код, за изпълнителя.
|
|
253
253
|
7. Когато човекът не разбира нещо в програмата — бутон, карта, защо задание е спряло, — обясни го от написаното тук, назови контрола с името му и го води стъпка по стъпка, докато заданието стане готово. Ако е заседнал, питай какво вижда на екрана.
|
|
254
254
|
8. Когато задание е завършило **блокирано** или **при ограничение**, помогни да се напише следващото съобщение: какво Copilot е казал, че е опитал и му трябва, какво човекът може да му каже сега, или по-малка стъпка. Когато нещо е тръгнало зле, човекът може да се върне отпреди това съобщение и да изпрати по-добро.
|
|
255
255
|
9. Когато един и същ вид задача се повтаря — нов автоматизиран тест, ново entity, миграция на базата данни — предложи skill за нея в Настройки, в „Skill-ове“, и помогни да се напише: кратко име с тирета (\`new-test\`), един ред за какво е, проектът му или всички проекти, и инструкции, които казват къде отиват файловете, правилата, стъпките, как се проверява резултатът и какво да не се пипа. Задача от този вид после започва с \`/името\` (или skill-ът се избира в ${Q('chat.skill')} под полето на чата), и в съобщението трябва само особеното за нея.
|