copilot-operator 0.1.97 → 0.1.99
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/folderPicker.js +22 -22
- package/dist/src/api/operator.controller.js +21 -9
- package/dist/src/api/operator.service.js +233 -39
- package/dist/src/config/exportHome.js +51 -9
- package/dist/src/config/home.js +27 -11
- package/dist/src/exec/authorizer.js +11 -4
- package/dist/src/exec/commandHeads.js +25 -0
- package/dist/src/exec/confinement.js +50 -4
- package/dist/src/exec/network.js +11 -1
- package/dist/src/exec/npmScripts.js +33 -0
- package/dist/src/exec/policy.js +70 -6
- package/dist/src/exec/processes.js +24 -5
- package/dist/src/exec/programs.js +21 -0
- package/dist/src/exec/reportFile.js +2 -1
- package/dist/src/exec/runner.js +31 -9
- package/dist/src/exec/scriptFiles.js +133 -6
- package/dist/src/orchestrator/handoff.js +3 -3
- package/dist/src/orchestrator/kerriganRunner.js +14 -6
- package/dist/src/orchestrator/leadRunner.js +43 -23
- package/dist/src/orchestrator/review.js +66 -10
- package/dist/src/orchestrator/taskRunner.js +73 -14
- package/dist/src/plan/kerrigan.js +253 -253
- package/dist/src/plan/schema.js +3 -13
- package/dist/src/plan/systemGuide.js +2 -2
- package/dist/src/protocol/kerriganSchema.js +5 -1
- package/dist/src/protocol/replySchema.js +2 -2
- package/dist/src/queue/queue.js +86 -0
- package/dist/src/session/compose.js +14 -10
- package/dist/src/session/locatorFailures.js +27 -6
- package/dist/src/session/model.js +19 -0
- package/dist/src/session/workspace.js +20 -5
- package/dist/src/transport/copilotTransport.js +82 -62
- package/dist/src/util/zip.js +147 -44
- package/dist/src/vcs/newBranch.js +20 -3
- package/dist/src/vcs/referenceGuard.js +9 -4
- package/dist/web/404.html +2 -2
- package/dist/web/_next/static/chunks/1077.a4fe6ae48f3d3ff9.js +1 -0
- package/dist/web/_next/static/chunks/1548.765d6eed5325bd01.js +1 -0
- package/dist/web/_next/static/chunks/2163.e8d6c85412d5d411.js +1 -0
- package/dist/web/_next/static/chunks/{8124-967df691ec1bfeeb.js → 6240-8ba644c53ffab87d.js} +1 -1
- package/dist/web/_next/static/chunks/714.f2dcd6b41b58d1a7.js +1 -0
- package/dist/web/_next/static/chunks/7220.652a8a339c1e7401.js +1 -0
- package/dist/web/_next/static/chunks/7921-9cf1ece94fc89bb3.js +1 -0
- package/dist/web/_next/static/chunks/{8584.3301b056c97be517.js → 8584.7c438425140f1d8d.js} +1 -1
- package/dist/web/_next/static/chunks/9067.8c4e6a64620a45d9.js +1 -0
- package/dist/web/_next/static/chunks/9747.43d25bdff8737d09.js +1 -0
- package/dist/web/_next/static/chunks/app/{layout-7943a4391ad2f88f.js → layout-97259931ed97e20d.js} +1 -1
- package/dist/web/_next/static/chunks/app/page-26e4ea30eb076e6b.js +1 -0
- package/dist/web/_next/static/chunks/app/queue/page-7228e045f8ea10c4.js +1 -0
- package/dist/web/_next/static/chunks/app/settings/page-c915d61553e1025b.js +1 -0
- package/dist/web/_next/static/chunks/app/system/page-4d24f44eb9077fb7.js +1 -0
- package/dist/web/_next/static/chunks/{webpack-710628d673fa4afb.js → webpack-31db88c3d5781520.js} +1 -1
- package/dist/web/_next/static/css/{523d11041085f836.css → 87999096d96266fd.css} +1 -1
- package/dist/web/defaults.html +2 -2
- package/dist/web/defaults.txt +26 -25
- package/dist/web/index.html +3 -3
- package/dist/web/index.txt +26 -25
- package/dist/web/queue.html +2 -2
- package/dist/web/queue.txt +26 -25
- package/dist/web/settings.html +2 -2
- package/dist/web/settings.txt +26 -25
- package/dist/web/system.html +2 -2
- package/dist/web/system.txt +26 -25
- package/package.json +3 -2
- package/prompts/kerrigan1.md +2 -1
- package/prompts/lead1.md +2 -1
- package/prompts/level1.md +6 -1
- package/prompts/review1.md +7 -4
- package/dist/web/_next/static/chunks/1077.4da389906036b1bb.js +0 -1
- package/dist/web/_next/static/chunks/1548.4aa3e42afe4542ab.js +0 -1
- package/dist/web/_next/static/chunks/2163.4c6ce20cf967756c.js +0 -1
- package/dist/web/_next/static/chunks/714.ffb1325246519f64.js +0 -1
- package/dist/web/_next/static/chunks/7220.f483b83c11525063.js +0 -1
- package/dist/web/_next/static/chunks/7921-946e538fe3f9630f.js +0 -1
- package/dist/web/_next/static/chunks/9067.03cdfb01ebf6a35d.js +0 -1
- package/dist/web/_next/static/chunks/9747.fe06238bc42bd23d.js +0 -1
- package/dist/web/_next/static/chunks/app/page-6ec948e0cf4b24f0.js +0 -1
- package/dist/web/_next/static/chunks/app/queue/page-9cfc8f78d536cfb6.js +0 -1
- package/dist/web/_next/static/chunks/app/settings/page-9c2b961beb8b3dce.js +0 -1
- package/dist/web/_next/static/chunks/app/system/page-3466496814a70b62.js +0 -1
- /package/dist/web/_next/static/{D3ew46wEw5JXPsTVwZwFC → n8n-2FmbL8PhXulu4hTV5}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{D3ew46wEw5JXPsTVwZwFC → n8n-2FmbL8PhXulu4hTV5}/_ssgManifest.js +0 -0
|
@@ -13,28 +13,28 @@
|
|
|
13
13
|
import { spawn } from 'node:child_process';
|
|
14
14
|
import { existsSync } from 'node:fs';
|
|
15
15
|
/** Nothing is interpolated into the script; the start folder goes in as an environment variable. */
|
|
16
|
-
const SCRIPT = `
|
|
17
|
-
Add-Type -AssemblyName System.Windows.Forms | Out-Null
|
|
18
|
-
$dialog = New-Object System.Windows.Forms.FolderBrowserDialog
|
|
19
|
-
$dialog.Description = 'Select the project folder'
|
|
20
|
-
$dialog.ShowNewFolderButton = $false
|
|
21
|
-
if ($env:COP_PICKER_START -and (Test-Path -LiteralPath $env:COP_PICKER_START)) {
|
|
22
|
-
$dialog.SelectedPath = $env:COP_PICKER_START
|
|
23
|
-
}
|
|
24
|
-
# An owner window that is always on top, so the dialog lands in front of the browser
|
|
25
|
-
# instead of behind it.
|
|
26
|
-
$owner = New-Object System.Windows.Forms.Form
|
|
27
|
-
$owner.TopMost = $true
|
|
28
|
-
$owner.ShowInTaskbar = $false
|
|
29
|
-
$owner.Opacity = 0
|
|
30
|
-
$owner.Show()
|
|
31
|
-
$result = $dialog.ShowDialog($owner)
|
|
32
|
-
$owner.Close()
|
|
33
|
-
if ($result -eq [System.Windows.Forms.DialogResult]::OK) {
|
|
34
|
-
[Console]::Out.Write('PICKED:' + $dialog.SelectedPath)
|
|
35
|
-
} else {
|
|
36
|
-
[Console]::Out.Write('CANCELLED')
|
|
37
|
-
}
|
|
16
|
+
const SCRIPT = `
|
|
17
|
+
Add-Type -AssemblyName System.Windows.Forms | Out-Null
|
|
18
|
+
$dialog = New-Object System.Windows.Forms.FolderBrowserDialog
|
|
19
|
+
$dialog.Description = 'Select the project folder'
|
|
20
|
+
$dialog.ShowNewFolderButton = $false
|
|
21
|
+
if ($env:COP_PICKER_START -and (Test-Path -LiteralPath $env:COP_PICKER_START)) {
|
|
22
|
+
$dialog.SelectedPath = $env:COP_PICKER_START
|
|
23
|
+
}
|
|
24
|
+
# An owner window that is always on top, so the dialog lands in front of the browser
|
|
25
|
+
# instead of behind it.
|
|
26
|
+
$owner = New-Object System.Windows.Forms.Form
|
|
27
|
+
$owner.TopMost = $true
|
|
28
|
+
$owner.ShowInTaskbar = $false
|
|
29
|
+
$owner.Opacity = 0
|
|
30
|
+
$owner.Show()
|
|
31
|
+
$result = $dialog.ShowDialog($owner)
|
|
32
|
+
$owner.Close()
|
|
33
|
+
if ($result -eq [System.Windows.Forms.DialogResult]::OK) {
|
|
34
|
+
[Console]::Out.Write('PICKED:' + $dialog.SelectedPath)
|
|
35
|
+
} else {
|
|
36
|
+
[Console]::Out.Write('CANCELLED')
|
|
37
|
+
}
|
|
38
38
|
`;
|
|
39
39
|
/** Windows PowerShell first: it is always present and its dialog is the familiar one. */
|
|
40
40
|
function shellCandidates() {
|
|
@@ -23,7 +23,7 @@ import { Body, Controller, Delete, Get, Inject, Param, Post, Put, Query, Res, No
|
|
|
23
23
|
import { OperatorService } from './operator.service.js';
|
|
24
24
|
import { SettingsUnusableError } from './settings.js';
|
|
25
25
|
import { PolicyLockUnusableError } from '../config/lockedPolicy.js';
|
|
26
|
-
import { CHANGED_ON_DISK } from '../session/workspace.js';
|
|
26
|
+
import { CHANGED_ON_DISK, GONE_FROM_DISK } from '../session/workspace.js';
|
|
27
27
|
import { join } from 'node:path';
|
|
28
28
|
import { DefaultChatLocators, DefaultPickerLocators } from '../transport/locators.js';
|
|
29
29
|
import { platformTools } from '../exec/platforms.js';
|
|
@@ -247,15 +247,20 @@ let OperatorController = class OperatorController {
|
|
|
247
247
|
return this.ops.exportSizes();
|
|
248
248
|
}
|
|
249
249
|
/** Everything the bot has kept, as a .zip: `data/`, and `runs/` with `?runs=1`. See `config/exportHome.ts`. */
|
|
250
|
-
exportHome(runs, res) {
|
|
250
|
+
async exportHome(runs, res) {
|
|
251
251
|
try {
|
|
252
|
-
const { fileName,
|
|
252
|
+
const { fileName, write } = this.ops.exportHome(runs === '1' || runs === 'true');
|
|
253
253
|
res.type('application/zip');
|
|
254
254
|
res.setHeader('content-disposition', contentDisposition(fileName));
|
|
255
|
-
|
|
255
|
+
// Sent as it is written (2026-11-19), so its length is not known beforehand.
|
|
256
|
+
await write(res);
|
|
257
|
+
res.end();
|
|
256
258
|
}
|
|
257
259
|
catch (e) {
|
|
258
|
-
|
|
260
|
+
if (!res.headersSent)
|
|
261
|
+
failText(res, e);
|
|
262
|
+
else
|
|
263
|
+
res.destroy(e);
|
|
259
264
|
}
|
|
260
265
|
}
|
|
261
266
|
/** What the bot's console showed, the latest lines, as a text file. See `log/terminal.ts`. */
|
|
@@ -313,7 +318,12 @@ let OperatorController = class OperatorController {
|
|
|
313
318
|
workspaceFile(path, dir) {
|
|
314
319
|
if (!path)
|
|
315
320
|
throw new BadRequestException('path is required');
|
|
316
|
-
return this.ops.workspaceFile(path, dir || undefined).catch(
|
|
321
|
+
return this.ops.workspaceFile(path, dir || undefined).catch((e) => {
|
|
322
|
+
// Not there: 404, so the editor can tell it from a refusal (2026-11-19).
|
|
323
|
+
if (e.code === GONE_FROM_DISK)
|
|
324
|
+
throw new NotFoundException(e.message);
|
|
325
|
+
return fail(e);
|
|
326
|
+
});
|
|
317
327
|
}
|
|
318
328
|
/**
|
|
319
329
|
* The editor saving a file of the open folder. `base` is the version it was opened at; a file changed on disk since
|
|
@@ -325,11 +335,13 @@ let OperatorController = class OperatorController {
|
|
|
325
335
|
if (typeof body.text !== 'string')
|
|
326
336
|
throw new BadRequestException('text is required');
|
|
327
337
|
try {
|
|
328
|
-
return await this.ops.saveWorkspaceFile(body.path, body.text, typeof body.base === 'string' && body.base ? body.base : undefined, typeof body.dir === 'string' && body.dir ? body.dir : undefined);
|
|
338
|
+
return await this.ops.saveWorkspaceFile(body.path, body.text, typeof body.base === 'string' && body.base ? body.base : undefined, typeof body.dir === 'string' && body.dir ? body.dir : undefined, body.again === true);
|
|
329
339
|
}
|
|
330
340
|
catch (e) {
|
|
331
341
|
if (e.code === CHANGED_ON_DISK)
|
|
332
342
|
throw new ConflictException(e.message);
|
|
343
|
+
if (e.code === GONE_FROM_DISK)
|
|
344
|
+
throw new NotFoundException(e.message);
|
|
333
345
|
fail(e);
|
|
334
346
|
}
|
|
335
347
|
}
|
|
@@ -451,7 +463,7 @@ let OperatorController = class OperatorController {
|
|
|
451
463
|
}
|
|
452
464
|
/** The list as the page edits it: added, changed, moved, taken out, put back to wait. */
|
|
453
465
|
setQueue(body = {}) {
|
|
454
|
-
return this.ops.setQueue(body?.items).catch(fail);
|
|
466
|
+
return this.ops.setQueue(body?.items, body?.seen).catch(fail);
|
|
455
467
|
}
|
|
456
468
|
runQueue() {
|
|
457
469
|
return this.ops.runQueue().catch(fail);
|
|
@@ -786,7 +798,7 @@ __decorate([
|
|
|
786
798
|
__param(1, Res()),
|
|
787
799
|
__metadata("design:type", Function),
|
|
788
800
|
__metadata("design:paramtypes", [Object, Object]),
|
|
789
|
-
__metadata("design:returntype",
|
|
801
|
+
__metadata("design:returntype", Promise)
|
|
790
802
|
], OperatorController.prototype, "exportHome", null);
|
|
791
803
|
__decorate([
|
|
792
804
|
Get('terminal'),
|