aegisone 1.0.34 → 1.0.35

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.
Files changed (226) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +1 -1
  3. package/SOURCE-OFFER.txt +9 -0
  4. package/bin/aegis.js +1 -322
  5. package/package.json +4 -5
  6. package/scripts/bump.mjs +1 -211
  7. package/scripts/bundle.js +1 -129
  8. package/scripts/predist.mjs +1 -976
  9. package/src/child.js +1 -285
  10. package/src/dispatch.js +1 -269
  11. package/src/doctor.js +1 -639
  12. package/src/host.js +1 -111
  13. package/src/permissions.js +1 -383
  14. package/src/probes.js +1 -159
  15. package/src/release.js +1 -409
  16. package/vendor/cli/package.json +3 -7
  17. package/vendor/cli/scripts/check.mjs +1 -52
  18. package/vendor/cli/scripts/demo.mjs +1 -94
  19. package/vendor/cli/scripts/predist.mjs +1 -75
  20. package/vendor/cli/scripts/runtests.mjs +1 -56
  21. package/vendor/cli/scripts/seal-gate.mjs +1 -74
  22. package/vendor/cli/src/agents.js +1 -139
  23. package/vendor/cli/src/app.js +1 -2957
  24. package/vendor/cli/src/art.js +1 -289
  25. package/vendor/cli/src/chatflow.js +1 -3023
  26. package/vendor/cli/src/checkpoint.js +1 -90
  27. package/vendor/cli/src/clipboard.js +1 -424
  28. package/vendor/cli/src/cloudsync.js +1 -528
  29. package/vendor/cli/src/commands.js +1 -4089
  30. package/vendor/cli/src/config.js +1 -581
  31. package/vendor/cli/src/connect.js +1 -349
  32. package/vendor/cli/src/credentials.js +1 -33
  33. package/vendor/cli/src/deps.js +1 -232
  34. package/vendor/cli/src/devrun.js +1 -187
  35. package/vendor/cli/src/diff.js +1 -333
  36. package/vendor/cli/src/diffview.js +1 -296
  37. package/vendor/cli/src/engine.js +1 -297
  38. package/vendor/cli/src/entitlement.js +1 -355
  39. package/vendor/cli/src/events.js +1 -707
  40. package/vendor/cli/src/export.js +1 -67
  41. package/vendor/cli/src/filepreview.js +1 -153
  42. package/vendor/cli/src/fingerprint.js +1 -592
  43. package/vendor/cli/src/format.js +1 -259
  44. package/vendor/cli/src/fuzzy.js +1 -119
  45. package/vendor/cli/src/history.js +1 -423
  46. package/vendor/cli/src/init.js +1 -175
  47. package/vendor/cli/src/input.js +1 -139
  48. package/vendor/cli/src/keys.js +1 -183
  49. package/vendor/cli/src/markdown.js +1 -306
  50. package/vendor/cli/src/models.js +1 -507
  51. package/vendor/cli/src/naming.js +1 -57
  52. package/vendor/cli/src/overlays.js +1 -462
  53. package/vendor/cli/src/panels.js +1 -1418
  54. package/vendor/cli/src/ping.js +1 -226
  55. package/vendor/cli/src/presence.js +1 -238
  56. package/vendor/cli/src/render.js +1 -516
  57. package/vendor/cli/src/screen.js +1 -518
  58. package/vendor/cli/src/screens.js +1 -896
  59. package/vendor/cli/src/secret.js +1 -59
  60. package/vendor/cli/src/securefs.js +1 -359
  61. package/vendor/cli/src/settings.js +1 -155
  62. package/vendor/cli/src/shared.js +1 -52
  63. package/vendor/cli/src/sharedpaths.js +1 -53
  64. package/vendor/cli/src/signup.js +1 -156
  65. package/vendor/cli/src/summarize.js +1 -95
  66. package/vendor/cli/src/sysdiag.js +1 -585
  67. package/vendor/cli/src/system.js +1 -40
  68. package/vendor/cli/src/theme.js +1 -570
  69. package/vendor/cli/src/title.js +1 -220
  70. package/vendor/cli/src/todos.js +1 -115
  71. package/vendor/cli/src/tokens.js +1 -263
  72. package/vendor/cli/src/topup.js +1 -210
  73. package/vendor/cli/src/update.js +1 -191
  74. package/vendor/cli/vendor/client/aegis.js +1 -2441
  75. package/vendor/cli/vendor/client/attest.js +1 -518
  76. package/vendor/cli/vendor/client/authorship-key.js +1 -410
  77. package/vendor/cli/vendor/client/auto-provision.js +1 -134
  78. package/vendor/cli/vendor/client/brain-catalog.js +1 -268
  79. package/vendor/cli/vendor/client/byok-catalog.js +1 -199
  80. package/vendor/cli/vendor/client/catalog-client.js +1 -487
  81. package/vendor/cli/vendor/client/conversation-export.js +1 -177
  82. package/vendor/cli/vendor/client/credentials.js +1 -494
  83. package/vendor/cli/vendor/client/device-fingerprint.js +1 -141
  84. package/vendor/cli/vendor/client/drive-connect.js +1 -110
  85. package/vendor/cli/vendor/client/drive-upload.js +1 -234
  86. package/vendor/cli/vendor/client/env-file.js +1 -1273
  87. package/vendor/cli/vendor/client/fingerprint.js +1 -1064
  88. package/vendor/cli/vendor/client/foreign-memory.js +1 -669
  89. package/vendor/cli/vendor/client/google-signin.js +1 -133
  90. package/vendor/cli/vendor/client/hooks.js +1 -430
  91. package/vendor/cli/vendor/client/model-discovery.js +1 -373
  92. package/vendor/cli/vendor/client/naming.js +1 -283
  93. package/vendor/cli/vendor/client/platform.js +1 -937
  94. package/vendor/cli/vendor/client/prefs.js +1 -351
  95. package/vendor/cli/vendor/client/presence-constants.js +1 -107
  96. package/vendor/cli/vendor/client/presence.js +1 -438
  97. package/vendor/cli/vendor/client/record-vault.js +3 -1055
  98. package/vendor/cli/vendor/client/session-store.js +1 -575
  99. package/vendor/cli/vendor/client/topup.js +1 -297
  100. package/vendor/cli/vendor/client/touch.js +1 -458
  101. package/vendor/cli/vendor/client/update.js +1 -763
  102. package/vendor/cli/vendor/client/user-models.js +1 -381
  103. package/vendor/cli/vendor/desktop/lib/local/agents.js +1 -105
  104. package/vendor/cli/vendor/desktop/lib/local/attachments.js +1 -276
  105. package/vendor/cli/vendor/desktop/lib/local/autonomous.js +1 -1045
  106. package/vendor/cli/vendor/desktop/lib/local/claude-pro.js +1 -1028
  107. package/vendor/cli/vendor/desktop/lib/local/context.js +1 -125
  108. package/vendor/cli/vendor/desktop/lib/local/engine.js +1 -3666
  109. package/vendor/cli/vendor/desktop/lib/local/entitlement.js +1 -660
  110. package/vendor/cli/vendor/desktop/lib/local/git-scope.js +1 -228
  111. package/vendor/cli/vendor/desktop/lib/local/local.js +1 -2145
  112. package/vendor/cli/vendor/desktop/lib/local/prompt.js +1 -280
  113. package/vendor/cli/vendor/desktop/lib/local/queue.js +1 -560
  114. package/vendor/cli/vendor/desktop/lib/local/session-rounds.js +1 -238
  115. package/vendor/cli/vendor/desktop/lib/local/spill.js +1 -75
  116. package/vendor/cli/vendor/desktop/lib/local/turn-guard.js +1 -300
  117. package/vendor/cli/vendor/desktop/lib/local/worktree-lock.js +1 -235
  118. package/vendor/cli/vendor/desktop/lib/settings.js +1 -890
  119. package/vendor/cli/vendor/desktop/renderer/usage.js +1 -1239
  120. package/vendor/cli/vendor/hosts/install.js +1 -638
  121. package/vendor/cli/vendor/hosts/openai-shim.js +1 -515
  122. package/vendor/cli/vendor/hosts/spec.js +1 -164
  123. package/vendor/cli/vendor/hosts/targets.js +1 -346
  124. package/vendor/cli/vendor/mcp/server.js +1 -221
  125. package/vendor/cli/vendor/mcp/tools.js +1 -408
  126. package/vendor/cli/vendor/one/src/child.js +1 -285
  127. package/vendor/cli/vendor/one/src/permissions.js +1 -383
  128. package/vendor/desktop/bin/aegis.js +1 -32
  129. package/vendor/desktop/lib/account-key.js +1 -56
  130. package/vendor/desktop/lib/auto.js +1 -461
  131. package/vendor/desktop/lib/avatar/companion.js +1 -698
  132. package/vendor/desktop/lib/avatar/cosmetics.js +1 -532
  133. package/vendor/desktop/lib/avatar/events.js +1 -344
  134. package/vendor/desktop/lib/avatar/holder-turn.js +1 -350
  135. package/vendor/desktop/lib/avatar/holders.js +1 -612
  136. package/vendor/desktop/lib/avatar/identity.js +1 -641
  137. package/vendor/desktop/lib/avatar/level.js +1 -368
  138. package/vendor/desktop/lib/avatar/mirror.js +1 -524
  139. package/vendor/desktop/lib/avatar/persona.js +1 -388
  140. package/vendor/desktop/lib/avatar/profile.js +1 -977
  141. package/vendor/desktop/lib/avatar/register.js +1 -307
  142. package/vendor/desktop/lib/avatar/store.js +1 -472
  143. package/vendor/desktop/lib/avatar/tiers.js +1 -38
  144. package/vendor/desktop/lib/avatar/transfer.js +1 -415
  145. package/vendor/desktop/lib/avatar/turn.js +1 -216
  146. package/vendor/desktop/lib/avatar/voice.js +1 -328
  147. package/vendor/desktop/lib/avatar/xp.js +1 -404
  148. package/vendor/desktop/lib/deep-link.js +1 -120
  149. package/vendor/desktop/lib/fingerprint.js +2 -347
  150. package/vendor/desktop/lib/google-connect.js +1 -323
  151. package/vendor/desktop/lib/local/agents.js +1 -105
  152. package/vendor/desktop/lib/local/attachments.js +1 -276
  153. package/vendor/desktop/lib/local/autonomous.js +1 -1045
  154. package/vendor/desktop/lib/local/claude-pro.js +1 -1028
  155. package/vendor/desktop/lib/local/context.js +1 -125
  156. package/vendor/desktop/lib/local/engine.js +1 -3666
  157. package/vendor/desktop/lib/local/entitlement.js +1 -660
  158. package/vendor/desktop/lib/local/git-scope.js +1 -228
  159. package/vendor/desktop/lib/local/local.js +1 -2145
  160. package/vendor/desktop/lib/local/prompt.js +1 -280
  161. package/vendor/desktop/lib/local/queue.js +1 -560
  162. package/vendor/desktop/lib/local/session-rounds.js +1 -238
  163. package/vendor/desktop/lib/local/spill.js +1 -75
  164. package/vendor/desktop/lib/local/telemetry.js +1 -470
  165. package/vendor/desktop/lib/local/turn-guard.js +1 -300
  166. package/vendor/desktop/lib/local/worktree-lock.js +1 -235
  167. package/vendor/desktop/lib/provider-key-mirror.js +1 -252
  168. package/vendor/desktop/lib/quick-launcher.js +1 -84
  169. package/vendor/desktop/lib/settings.js +1 -890
  170. package/vendor/desktop/lib/sync/memory-queue.js +1 -60
  171. package/vendor/desktop/lib/sync/persist-gate.js +1 -148
  172. package/vendor/desktop/lib/sync/sessions.js +1 -106
  173. package/vendor/desktop/lib/window-state.js +1 -66
  174. package/vendor/desktop/package.json +2 -4
  175. package/vendor/desktop/preload.js +1 -679
  176. package/vendor/desktop/renderer/app.js +1 -7250
  177. package/vendor/desktop/renderer/avatar/assemble.js +1 -335
  178. package/vendor/desktop/renderer/avatar/avatar.js +1 -380
  179. package/vendor/desktop/renderer/avatar/cards.js +1 -141
  180. package/vendor/desktop/renderer/avatar/hud.js +1 -206
  181. package/vendor/desktop/renderer/avatar/machine.js +1 -213
  182. package/vendor/desktop/renderer/avatar/pane.js +1 -439
  183. package/vendor/desktop/renderer/avatar/parts.js +1 -437
  184. package/vendor/desktop/renderer/budget.js +1 -172
  185. package/vendor/desktop/renderer/companion.js +1 -223
  186. package/vendor/desktop/renderer/diff.js +1 -359
  187. package/vendor/desktop/renderer/diffview.js +1 -336
  188. package/vendor/desktop/renderer/filepreview.js +1 -211
  189. package/vendor/desktop/renderer/fingerprint.js +3 -789
  190. package/vendor/desktop/renderer/markdown.js +1 -168
  191. package/vendor/desktop/renderer/provider-mark.js +1 -311
  192. package/vendor/desktop/renderer/provider-toolbar.js +1 -134
  193. package/vendor/desktop/renderer/providers.js +1 -259
  194. package/vendor/desktop/renderer/quick.js +1 -285
  195. package/vendor/desktop/renderer/stream-policy.js +1 -387
  196. package/vendor/desktop/renderer/transcript-view.js +1 -323
  197. package/vendor/desktop/renderer/usage.js +1 -1239
  198. package/vendor/desktop/vendor/aegis.js +1 -2441
  199. package/vendor/desktop/vendor/attest.js +1 -518
  200. package/vendor/desktop/vendor/authorship-key.js +1 -410
  201. package/vendor/desktop/vendor/auto-provision.js +1 -134
  202. package/vendor/desktop/vendor/brain-catalog.js +1 -268
  203. package/vendor/desktop/vendor/byok-catalog.js +1 -199
  204. package/vendor/desktop/vendor/catalog-client.js +1 -487
  205. package/vendor/desktop/vendor/conversation-export.js +1 -177
  206. package/vendor/desktop/vendor/credentials.js +1 -494
  207. package/vendor/desktop/vendor/device-fingerprint.js +1 -141
  208. package/vendor/desktop/vendor/drive-connect.js +1 -110
  209. package/vendor/desktop/vendor/drive-upload.js +1 -234
  210. package/vendor/desktop/vendor/env-file.js +1 -1273
  211. package/vendor/desktop/vendor/fingerprint.js +1 -1064
  212. package/vendor/desktop/vendor/foreign-memory.js +1 -669
  213. package/vendor/desktop/vendor/google-signin.js +1 -133
  214. package/vendor/desktop/vendor/hooks.js +1 -430
  215. package/vendor/desktop/vendor/model-discovery.js +1 -373
  216. package/vendor/desktop/vendor/naming.js +1 -283
  217. package/vendor/desktop/vendor/platform.js +1 -937
  218. package/vendor/desktop/vendor/prefs.js +1 -351
  219. package/vendor/desktop/vendor/presence-constants.js +1 -107
  220. package/vendor/desktop/vendor/presence.js +1 -438
  221. package/vendor/desktop/vendor/record-vault.js +3 -1055
  222. package/vendor/desktop/vendor/session-store.js +1 -575
  223. package/vendor/desktop/vendor/topup.js +1 -297
  224. package/vendor/desktop/vendor/touch.js +1 -458
  225. package/vendor/desktop/vendor/update.js +1 -763
  226. package/vendor/desktop/vendor/user-models.js +1 -381
@@ -1,78 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  // SPDX-License-Identifier: AGPL-3.0-or-later
3
3
  // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
4
- // AEGIS Code (aegiscode) — source: https://github.com/aegisinfo/aegiscode-plugin
5
- // Conveying a modified copy, or running one as a network service, owes the
6
- // corresponding source under this licence (§5/§13) — see LICENSING.md.
7
- /**
8
- * Pre-publish staging for the `aegiscode` package — a THIN WRAPPER.
9
- *
10
- * The manifest (and both shape emitters, and both proofs) moved to
11
- * `one/scripts/predist.mjs` in AEGISONE's phase ON2 (plan D6): one manifest,
12
- * two shapes. This file used to hold its own list of forty repo-relative
13
- * modules, kept in sync with `desktop/scripts/predist.mjs` by discipline alone.
14
- * It now holds no list at all, and its length is a test
15
- * (`test/one-vendor.test.mjs`: wrappers stay under eighty lines).
16
- *
17
- * Everything the CLI needs is unchanged as seen from outside: `npm run predist`,
18
- * `prepublishOnly`, `precheck` and `pretest` still run this file, it still
19
- * stages `cli/vendor/` in the repo's relative shape, and it still prints the
20
- * same proof lines (the staged registry loads standalone, the editor layer
21
- * resolves the STAGED server, the staged gate module loads).
22
- *
23
- * It also REFUSES to stage from a tree whose safety files are not the sealed
24
- * ones — the publish gate, which lives beside this file (`./seal-gate.mjs`)
25
- * because a gate is not a manifest and this file has a line budget. That is the
26
- * one moment the question can be asked from outside the artifact.
27
- *
28
- * If the shared stager is not reachable the file is missing — this directory is
29
- * inside the published tarball, where `one/` is not shipped, and running predist
30
- * there is meaningless anyway (the vendor tree it would build is already in the
31
- * package). Say that plainly instead of failing with a MODULE_NOT_FOUND.
32
- */
33
- import path from 'node:path';
34
- import { fileURLToPath, pathToFileURL } from 'node:url';
35
- import { sealGate } from './seal-gate.mjs';
36
-
37
- const HERE = path.dirname(fileURLToPath(import.meta.url));
38
- const SHARED = path.join(HERE, '..', '..', 'one', 'scripts', 'predist.mjs');
39
-
40
- async function main(argv) {
41
- // `--quiet` is forwarded, not swallowed: `prepack` passes it so these
42
- // progress lines do not corrupt `npm pack --json`; publishing keeps them.
43
- const args = Array.isArray(argv) ? argv : process.argv.slice(2), quiet = args.includes('--quiet') ? ['--quiet'] : [];
44
- const gate = sealGate();
45
- if (!gate.ok && !process.env.AEGIS_ALLOW_UNSEALED) {
46
- process.stderr.write(
47
- `${gate.line}\n` +
48
- `cut: refusing to stage a package from it. Reseal the tree deliberately, or set ` +
49
- `AEGIS_ALLOW_UNSEALED=1 to stage a build that is known not to be the published one.\n`
50
- );
51
- return 1;
52
- }
53
- process.stderr.write(
54
- gate.ok
55
- ? `${gate.line}\n`
56
- : `${gate.line}\ncut: AEGIS_ALLOW_UNSEALED is set — staging anyway; this artifact will ` +
57
- `not match the published manifest.\n`
58
- );
59
- let shared;
60
- try {
61
- shared = await import(pathToFileURL(SHARED).href);
62
- } catch (error) {
63
- process.stderr.write(
64
- `predist: the shared stager is not reachable at ${SHARED}.\n` +
65
- `predist: it lives in the repo (one/scripts/predist.mjs) and is not shipped ` +
66
- `inside the aegiscode tarball — a built package already carries its vendor tree.\n` +
67
- `${(error && error.message) || error}\n`
68
- );
69
- return 1;
70
- }
71
- return shared.main(['--mirror-only', ...quiet]);
72
- }
73
-
74
- if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
75
- process.exitCode = await main(process.argv.slice(2));
76
- }
77
-
78
- export { main, sealGate };
4
+ import e from"node:path";import{fileURLToPath as t,pathToFileURL as r}from"node:url";import{sealGate as s}from"./seal-gate.mjs";const a=e.dirname(t(import.meta.url)),i=e.join(a,"..","..","one","scripts","predist.mjs");async function o(e){const t=(Array.isArray(e)?e:process.argv.slice(2)).includes("--quiet")?["--quiet"]:[],a=s();if(!a.ok&&!process.env.AEGIS_ALLOW_UNSEALED)return process.stderr.write(`${a.line}\ncut: refusing to stage a package from it. Reseal the tree deliberately, or set AEGIS_ALLOW_UNSEALED=1 to stage a build that is known not to be the published one.\n`),1;let o;process.stderr.write(a.ok?`${a.line}\n`:`${a.line}\ncut: AEGIS_ALLOW_UNSEALED is set — staging anyway; this artifact will not match the published manifest.\n`);try{o=await import(r(i).href)}catch(e){return process.stderr.write(`predist: the shared stager is not reachable at ${i}.\npredist: it lives in the repo (one/scripts/predist.mjs) and is not shipped inside the aegiscode tarball — a built package already carries its vendor tree.\n${e&&e.message||e}\n`),1}return o.main(["--mirror-only",...t])}process.argv[1]&&e.resolve(process.argv[1])===t(import.meta.url)&&(process.exitCode=await o(process.argv.slice(2)));export{o as main,s as sealGate};
@@ -1,59 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  // SPDX-License-Identifier: AGPL-3.0-or-later
3
3
  // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
4
- // AEGIS Code (aegiscode) — source: https://github.com/aegisinfo/aegiscode-plugin
5
- // Conveying a modified copy, or running one as a network service, owes the
6
- // corresponding source under this licence (§5/§13) — see LICENSING.md.
7
- /**
8
- * Run every `test/cli-*.test.mjs` and report all of them.
9
- *
10
- * This replaces `for f in …; do node "$f" || exit 1; done`. That loop stops at
11
- * the first failure, and since the files run in glob (alphabetical) order, one
12
- * broken file silently hides every file after it — `cli-click` sorts 5th of 28,
13
- * so a single failure there meant 23 test files had not run at all while the
14
- * command still looked like "the suite".
15
- *
16
- * Failures are collected, each file's own output is streamed through, and the
17
- * summary names what failed. Exit is non-zero if anything failed, so CI and
18
- * `npm test` still gate on it.
19
- */
20
- import { readdirSync } from 'node:fs';
21
- import { spawnSync } from 'node:child_process';
22
- import { dirname, join, resolve } from 'node:path';
23
- import { fileURLToPath } from 'node:url';
24
-
25
- const here = dirname(fileURLToPath(import.meta.url));
26
- const testDir = resolve(here, '..', '..', 'test');
27
-
28
- const files = readdirSync(testDir)
29
- .filter((f) => /^cli-.*\.test\.mjs$/.test(f))
30
- .sort();
31
-
32
- if (files.length === 0) {
33
- process.stderr.write(`no cli-*.test.mjs found in ${testDir}\n`);
34
- process.exit(1);
35
- }
36
-
37
- const failed = [];
38
- const passed = [];
39
-
40
- for (const f of files) {
41
- const full = join(testDir, f);
42
- process.stdout.write(`\n── ${f} ${'─'.repeat(Math.max(0, 60 - f.length))}\n`);
43
- const res = spawnSync(process.execPath, [full], { stdio: 'inherit' });
44
- if (res.status === 0) {
45
- passed.push(f);
46
- } else {
47
- failed.push({ f, status: res.status, signal: res.signal });
48
- }
49
- }
50
-
51
- process.stdout.write(`\n${'═'.repeat(64)}\n`);
52
- process.stdout.write(`cli suite: ${passed.length}/${files.length} files passed\n`);
53
- if (failed.length) {
54
- process.stdout.write(`\nFAILED (${failed.length}):\n`);
55
- for (const { f, status, signal } of failed) {
56
- process.stdout.write(` ✗ ${f}${signal ? ` (signal ${signal})` : ` (exit ${status})`}\n`);
57
- }
58
- process.exit(1);
59
- }
4
+ import{readdirSync as s}from"node:fs";import{spawnSync as t}from"node:child_process";import{dirname as e,join as o,resolve as r}from"node:path";import{fileURLToPath as n}from"node:url";const i=r(e(n(import.meta.url)),"..","..","test"),a=s(i).filter((s=>/^cli-.*\.test\.mjs$/.test(s))).sort();0===a.length&&(process.stderr.write(`no cli-*.test.mjs found in ${i}\n`),process.exit(1));const c=[],p=[];for(const s of a){const e=o(i,s);process.stdout.write(`\n── ${s} ${"─".repeat(Math.max(0,60-s.length))}\n`);const r=t(process.execPath,[e],{stdio:"inherit"});0===r.status?p.push(s):c.push({f:s,status:r.status,signal:r.signal})}if(process.stdout.write(`\n${"═".repeat(64)}\n`),process.stdout.write(`cli suite: ${p.length}/${a.length} files passed\n`),c.length){process.stdout.write(`\nFAILED (${c.length}):\n`);for(const{f:s,status:t,signal:e}of c)process.stdout.write(` ✗ ${s}${e?` (signal ${e})`:` (exit ${t})`}\n`);process.exit(1)}
@@ -1,76 +1,3 @@
1
1
  // SPDX-License-Identifier: AGPL-3.0-or-later
2
2
  // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
- // AEGIS Code (aegiscode) — source: https://github.com/aegisinfo/aegiscode-plugin
4
- // Conveying a modified copy, or running one as a network service, owes the
5
- // corresponding source under this licence (§5/§13) — see LICENSING.md.
6
- /**
7
- * The publish gate — the half of the provenance story that is a control rather
8
- * than a deterrent.
9
- *
10
- * `cli/src/limits.js` and `cli/src/provenance.js` live INSIDE the package they
11
- * guard, so whoever edits the safety files can also delete the lines that would
12
- * have noticed. That is not fixable from within the package, and pretending
13
- * otherwise is the mistake both gates already refuse to make in their own
14
- * headers. Staging a tarball is the one moment the question can be asked from
15
- * OUTSIDE the artifact — on the maintainer's machine, before the bytes are
16
- * copied — which makes this the only point at which a modified tree is STOPPED
17
- * instead of merely reported on.
18
- *
19
- * Both gates are asked, and separately on purpose: the interlock's set covers
20
- * `src/limits.js` itself while the manifest does not, and the manifest covers
21
- * the entry point while the interlock lists a different set. A tree has to
22
- * satisfy both to be staged.
23
- *
24
- * It lives in its own file rather than inline in `predist.mjs` because that
25
- * file is a THIN WRAPPER by contract — `test/one-vendor.test.mjs` fails it
26
- * above eighty lines, and the manifest it used to hold is exactly the
27
- * duplication that rule exists to prevent. A gate is not a manifest, but the
28
- * rule is a line count, and the honest way to satisfy it is to move the gate
29
- * out rather than to raise the limit for it.
30
- *
31
- * Importing this file stages nothing.
32
- */
33
-
34
- import path from 'node:path';
35
- import { createRequire } from 'node:module';
36
- import { fileURLToPath } from 'node:url';
37
-
38
- const HERE = path.dirname(fileURLToPath(import.meta.url));
39
- const CLI_ROOT = path.join(HERE, '..');
40
- const require = createRequire(import.meta.url);
41
-
42
- /**
43
- * Ask both gates about the tree that is about to be staged.
44
- *
45
- * @returns {{ ok: boolean, line: string }} `line` is what the maintainer reads;
46
- * it may name files, because a maintainer is who it is talking to. The RUNTIME
47
- * reports are the ones that must not (see cli/src/provenance.js).
48
- */
49
- function sealGate() {
50
- let limits;
51
- let provenance;
52
- try {
53
- limits = require(path.join(CLI_ROOT, 'src', 'limits.js'));
54
- provenance = require(path.join(CLI_ROOT, 'src', 'provenance.js'));
55
- } catch (error) {
56
- return {
57
- ok: false,
58
- line: `cut: the safety modules are unreadable (${(error && error.message) || error}).`,
59
- };
60
- }
61
- const interlock = limits.check();
62
- if (interlock.tripped) {
63
- return {
64
- ok: false,
65
- line: `cut: the sealed set has moved (${interlock.code}) — this tree is not the published one.`,
66
- };
67
- }
68
- const report = provenance.selfCheck();
69
- if (!report.ok) return { ok: false, line: `cut: ${report.problems.join('; ')}` };
70
- return {
71
- ok: true,
72
- line: `cut: ${report.checked} sealed units verified — this tree is the published one.`,
73
- };
74
- }
75
-
76
- export { sealGate };
3
+ import e from"node:path";import{createRequire as t}from"node:module";import{fileURLToPath as o}from"node:url";const r=e.dirname(o(import.meta.url)),i=e.join(r,".."),s=t(import.meta.url);function n(){let t,o;try{t=s(e.join(i,"src","limits.js")),o=s(e.join(i,"src","provenance.js"))}catch(e){return{ok:!1,line:`cut: the safety modules are unreadable (${e&&e.message||e}).`}}const r=t.check();if(r.tripped)return{ok:!1,line:`cut: the sealed set has moved (${r.code}) — this tree is not the published one.`};const n=o.selfCheck();return n.ok?{ok:!0,line:`cut: ${n.checked} sealed units verified — this tree is the published one.`}:{ok:!1,line:`cut: ${n.problems.join("; ")}`}}export{n as sealGate};
@@ -1,141 +1,3 @@
1
1
  // SPDX-License-Identifier: AGPL-3.0-or-later
2
2
  // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
- // AEGIS Code (aegiscode) — source: https://github.com/aegisinfo/aegiscode-plugin
4
- // Conveying a modified copy, or running one as a network service, owes the
5
- // corresponding source under this licence (§5/§13) — see LICENSING.md.
6
- 'use strict';
7
-
8
- /**
9
- * Sub-agent prompt presets — ported verbatim from the upstream engine reference
10
- * (which in turn came from the reference's slash-commands builtinCommands.ts
11
- * buildMultiAgents() and the research-council member prompts). This build has
12
- * no parallel-agent runtime, so the presets are prompt composition:
13
- * /agents <role> <task> and /research <question> build the same specialist
14
- * prompts the reference hands to real sub-agents and run them through the
15
- * normal chat flow (c.runPrompt).
16
- */
17
-
18
- /** Role → system prompt, verbatim from the reference's buildMultiAgents. */
19
- const AGENT_PRESETS = {
20
- synthesizer: `You are a senior technical lead. Given analysis from multiple specialist agents, synthesize their findings into a clear, actionable summary.
21
- Structure your response as: key findings, recommended approach, top action items.
22
- Be direct, concrete, and avoid repeating everything the agents said.
23
- Focus on delivering a decision-ready synthesis.`,
24
-
25
- architect: `You are a System Architect. Design the new application architecture.
26
- Define: project structure, tech stack, directory layout, key modules, data flow, API design.
27
- Consider: scalability, maintainability, testing strategy, deployment.
28
- Output a concrete file tree and architecture decisions log. Be specific.`,
29
-
30
- scaffolder: `You are a Project Scaffolder. Build the complete application from scratch.
31
-
32
- YOUR JOB IS TO CREATE ALL PROJECT FILES - not just describe them.
33
-
34
- Use Write to create: package.json, tsconfig.json, source files, configs, tests.
35
- Generate COMPLETE, WORKING code - not stubs or placeholders.
36
- Set up build scripts, lint config, and any necessary tooling.
37
-
38
- After creating files, use Bash to run: npm/pnpm install, then build/compile.
39
- Fix any errors until the project builds successfully.
40
-
41
- Be thorough - a real, runnable project is the goal.`,
42
-
43
- planner: `You are a Refactoring Planner. Given the analyzer findings, create a step-by-step plan.
44
- Each step: file path, what to change, why, risk level (LOW/MEDIUM/HIGH).
45
- Include before/after snippets. Order by impact. Be concrete.`,
46
-
47
- implementer: `You are an Implementation Engineer. Execute the refactoring plan.
48
- Use Edit and Write to make actual code changes.
49
- After each change, use Read to verify correctness. Keep existing code style.
50
- Run build commands to ensure nothing is broken.`,
51
-
52
- reviewer: `You are a Code Reviewer. Review the approach and code.
53
- Check: logic errors, type safety, error handling, performance, security.
54
- Be critical but constructive. Report specific issues with file paths.`,
55
-
56
- debugger: `You are a Debugging Specialist. Analyze potential issues and edge cases.
57
- Identify: failure modes, error handling gaps, testing considerations.
58
- Think about what could go wrong and how to prevent it.`,
59
-
60
- scanner: `You are a Security Vulnerability Scanner.
61
- Scan for: hardcoded API keys/secrets, SQL injection, XSS, unsafe eval/exec, path traversal.
62
- Use Grep with targeted patterns. Report every finding with: file path, severity (CRITICAL/HIGH/MEDIUM/LOW), line number.`,
63
-
64
- analyzer: `You are a Code Analyzer. Find refactoring opportunities.
65
- Look for: duplicated code, long functions (>20 lines), complex conditionals, unused imports,
66
- circular dependencies, inconsistent patterns. Report with file paths and line numbers.`,
67
- };
68
-
69
- /** Human-readable role label for a preset id (falls back to the id). */
70
- function agentRoleLabel(role) {
71
- const labels = {
72
- synthesizer: 'Technical Lead', architect: 'System Architect',
73
- scaffolder: 'Project Scaffolder', planner: 'Refactoring Planner',
74
- implementer: 'Implementation Engineer', reviewer: 'Code Reviewer',
75
- debugger: 'Debugging Specialist', scanner: 'Vulnerability Scanner',
76
- analyzer: 'Code Analyzer',
77
- };
78
- return labels[role] || role;
79
- }
80
-
81
- /** Compose a sub-agent prompt: the role's system prompt + the task. */
82
- function composeAgentPrompt(role, task) {
83
- return `${AGENT_PRESETS[role]}\n\nTask: ${task}\n\nRespond directly — no preamble.`;
84
- }
85
-
86
- /** Every preset id, in palette order. */
87
- function agentRoles() {
88
- return Object.keys(AGENT_PRESETS);
89
- }
90
-
91
- /**
92
- * The research-council prompt (Analyst/Architect/Ethicist/Pragmatist),
93
- * ported from the reference's /research command. Includes the workspace
94
- * context note so the model can read real files.
95
- */
96
- function composeResearchPrompt(question, workspaceRoot = process.cwd()) {
97
- return [
98
- `Research the following question from four perspectives, then synthesize:`,
99
- ``,
100
- `Question: ${question}`,
101
- ``,
102
- `You are a research council with these members:`,
103
- `- Analyst: reasons from data, statistics, and empirical evidence; values measurable outcomes.`,
104
- `- Architect: evaluates designs, tradeoffs, and architectural decisions; focuses on scalability, maintainability, and system coherence.`,
105
- `- Ethicist: evaluates safety, fairness, privacy, and societal impact; raises concerns others miss.`,
106
- `- Pragmatist: evaluates practicality, implementation effort, and real-world constraints; balances idealism with what works in production.`,
107
- ``,
108
- `Workspace: ${workspaceRoot} — read files with Read, search with Grep, browse with Glob, and check recent git changes with Git to ground your analysis in the real codebase.`,
109
- ``,
110
- `Format: one reasoned section per perspective, then a Synthesis with a clear recommendation. Always state VOTE: approve, reject, or abstain and REASONING with clear justification.`,
111
- ].join('\n');
112
- }
113
-
114
- /**
115
- * A structured debate prompt for the current model (the reference runs a
116
- * real multi-model DiscussionRoom; this build simulates the debate on the
117
- * one configured backend, which the note makes explicit).
118
- */
119
- function composeDebatePrompt(topic, modelId = '') {
120
- return [
121
- `Hold a structured debate on: ${topic}`,
122
- ``,
123
- `Present two opposing positions fairly (with the strongest argument FOR and AGAINST), then act as moderator:`,
124
- `1. Opening statements for each side.`,
125
- `2. Rebuttals — each side attacks the other's weakest claim.`,
126
- `3. Cross-examination questions and answers.`,
127
- `4. Closing statements.`,
128
- `5. A moderator verdict summarizing where each side won and a final recommendation.`,
129
- ``,
130
- `Be rigorous and balanced — steelman both sides before judging.${modelId ? ` (Simulated on ${modelId} — the reference runs a multi-model discussion.)` : ''}`,
131
- ].join('\n');
132
- }
133
-
134
- module.exports = {
135
- AGENT_PRESETS,
136
- agentRoleLabel,
137
- composeAgentPrompt,
138
- agentRoles,
139
- composeResearchPrompt,
140
- composeDebatePrompt,
141
- };
3
+ "use strict";const AGENT_PRESETS={synthesizer:"You are a senior technical lead. Given analysis from multiple specialist agents, synthesize their findings into a clear, actionable summary.\nStructure your response as: key findings, recommended approach, top action items.\nBe direct, concrete, and avoid repeating everything the agents said.\nFocus on delivering a decision-ready synthesis.",architect:"You are a System Architect. Design the new application architecture.\nDefine: project structure, tech stack, directory layout, key modules, data flow, API design.\nConsider: scalability, maintainability, testing strategy, deployment.\nOutput a concrete file tree and architecture decisions log. Be specific.",scaffolder:"You are a Project Scaffolder. Build the complete application from scratch.\n\nYOUR JOB IS TO CREATE ALL PROJECT FILES - not just describe them.\n\nUse Write to create: package.json, tsconfig.json, source files, configs, tests.\nGenerate COMPLETE, WORKING code - not stubs or placeholders.\nSet up build scripts, lint config, and any necessary tooling.\n\nAfter creating files, use Bash to run: npm/pnpm install, then build/compile.\nFix any errors until the project builds successfully.\n\nBe thorough - a real, runnable project is the goal.",planner:"You are a Refactoring Planner. Given the analyzer findings, create a step-by-step plan.\nEach step: file path, what to change, why, risk level (LOW/MEDIUM/HIGH).\nInclude before/after snippets. Order by impact. Be concrete.",implementer:"You are an Implementation Engineer. Execute the refactoring plan.\nUse Edit and Write to make actual code changes.\nAfter each change, use Read to verify correctness. Keep existing code style.\nRun build commands to ensure nothing is broken.",reviewer:"You are a Code Reviewer. Review the approach and code.\nCheck: logic errors, type safety, error handling, performance, security.\nBe critical but constructive. Report specific issues with file paths.",debugger:"You are a Debugging Specialist. Analyze potential issues and edge cases.\nIdentify: failure modes, error handling gaps, testing considerations.\nThink about what could go wrong and how to prevent it.",scanner:"You are a Security Vulnerability Scanner.\nScan for: hardcoded API keys/secrets, SQL injection, XSS, unsafe eval/exec, path traversal.\nUse Grep with targeted patterns. Report every finding with: file path, severity (CRITICAL/HIGH/MEDIUM/LOW), line number.",analyzer:"You are a Code Analyzer. Find refactoring opportunities.\nLook for: duplicated code, long functions (>20 lines), complex conditionals, unused imports,\ncircular dependencies, inconsistent patterns. Report with file paths and line numbers."};function agentRoleLabel(e){return{synthesizer:"Technical Lead",architect:"System Architect",scaffolder:"Project Scaffolder",planner:"Refactoring Planner",implementer:"Implementation Engineer",reviewer:"Code Reviewer",debugger:"Debugging Specialist",scanner:"Vulnerability Scanner",analyzer:"Code Analyzer"}[e]||e}function composeAgentPrompt(e,t){return`${AGENT_PRESETS[e]}\n\nTask: ${t}\n\nRespond directly — no preamble.`}function agentRoles(){return Object.keys(AGENT_PRESETS)}function composeResearchPrompt(e,t=process.cwd()){return["Research the following question from four perspectives, then synthesize:","",`Question: ${e}`,"","You are a research council with these members:","- Analyst: reasons from data, statistics, and empirical evidence; values measurable outcomes.","- Architect: evaluates designs, tradeoffs, and architectural decisions; focuses on scalability, maintainability, and system coherence.","- Ethicist: evaluates safety, fairness, privacy, and societal impact; raises concerns others miss.","- Pragmatist: evaluates practicality, implementation effort, and real-world constraints; balances idealism with what works in production.","",`Workspace: ${t} — read files with Read, search with Grep, browse with Glob, and check recent git changes with Git to ground your analysis in the real codebase.`,"","Format: one reasoned section per perspective, then a Synthesis with a clear recommendation. Always state VOTE: approve, reject, or abstain and REASONING with clear justification."].join("\n")}function composeDebatePrompt(e,t=""){return[`Hold a structured debate on: ${e}`,"","Present two opposing positions fairly (with the strongest argument FOR and AGAINST), then act as moderator:","1. Opening statements for each side.","2. Rebuttals — each side attacks the other's weakest claim.","3. Cross-examination questions and answers.","4. Closing statements.","5. A moderator verdict summarizing where each side won and a final recommendation.","","Be rigorous and balanced — steelman both sides before judging."+(t?` (Simulated on ${t} — the reference runs a multi-model discussion.)`:"")].join("\n")}module.exports={AGENT_PRESETS:AGENT_PRESETS,agentRoleLabel:agentRoleLabel,composeAgentPrompt:composeAgentPrompt,agentRoles:agentRoles,composeResearchPrompt:composeResearchPrompt,composeDebatePrompt:composeDebatePrompt};