aegisone 1.0.22 → 1.0.24

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 -939
  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 -369
  14. package/src/probes.js +1 -159
  15. package/src/release.js +1 -409
  16. package/vendor/cli/bin/aegiscode.js +2 -914
  17. package/vendor/cli/package.json +3 -7
  18. package/vendor/cli/scripts/check.mjs +1 -52
  19. package/vendor/cli/scripts/demo.mjs +1 -94
  20. package/vendor/cli/scripts/predist.mjs +1 -75
  21. package/vendor/cli/scripts/runtests.mjs +1 -56
  22. package/vendor/cli/scripts/seal-gate.mjs +1 -74
  23. package/vendor/cli/src/agents.js +1 -139
  24. package/vendor/cli/src/app.js +1 -2932
  25. package/vendor/cli/src/art.js +1 -289
  26. package/vendor/cli/src/autonomous.js +1 -515
  27. package/vendor/cli/src/caps.js +1 -879
  28. package/vendor/cli/src/chatflow.js +1 -3020
  29. package/vendor/cli/src/checkpoint.js +1 -90
  30. package/vendor/cli/src/clipboard.js +1 -424
  31. package/vendor/cli/src/cloudsync.js +1 -528
  32. package/vendor/cli/src/commands.js +1 -4003
  33. package/vendor/cli/src/config.js +1 -581
  34. package/vendor/cli/src/connect.js +1 -349
  35. package/vendor/cli/src/credentials.js +1 -33
  36. package/vendor/cli/src/deps.js +1 -232
  37. package/vendor/cli/src/devrun.js +1 -187
  38. package/vendor/cli/src/diff.js +1 -333
  39. package/vendor/cli/src/diffview.js +1 -296
  40. package/vendor/cli/src/engine.js +1 -297
  41. package/vendor/cli/src/entitlement.js +1 -355
  42. package/vendor/cli/src/events.js +1 -707
  43. package/vendor/cli/src/export.js +1 -67
  44. package/vendor/cli/src/fingerprint.js +1 -592
  45. package/vendor/cli/src/format.js +1 -259
  46. package/vendor/cli/src/fuzzy.js +1 -119
  47. package/vendor/cli/src/gate.js +1 -55
  48. package/vendor/cli/src/history.js +1 -401
  49. package/vendor/cli/src/init.js +1 -175
  50. package/vendor/cli/src/input.js +1 -139
  51. package/vendor/cli/src/keys.js +1 -183
  52. package/vendor/cli/src/limits.js +1 -190
  53. package/vendor/cli/src/markdown.js +1 -306
  54. package/vendor/cli/src/mcp.js +1 -694
  55. package/vendor/cli/src/models.js +1 -487
  56. package/vendor/cli/src/naming.js +1 -229
  57. package/vendor/cli/src/overlays.js +1 -461
  58. package/vendor/cli/src/panels.js +1 -1418
  59. package/vendor/cli/src/permissions.js +1 -290
  60. package/vendor/cli/src/ping.js +1 -226
  61. package/vendor/cli/src/presence.js +1 -238
  62. package/vendor/cli/src/provenance.js +2 -182
  63. package/vendor/cli/src/render.js +1 -515
  64. package/vendor/cli/src/screen.js +1 -518
  65. package/vendor/cli/src/screens.js +1 -896
  66. package/vendor/cli/src/secret.js +1 -59
  67. package/vendor/cli/src/securefs.js +1 -359
  68. package/vendor/cli/src/settings.js +1 -155
  69. package/vendor/cli/src/shared.js +1 -52
  70. package/vendor/cli/src/sharedpaths.js +1 -53
  71. package/vendor/cli/src/signup.js +1 -156
  72. package/vendor/cli/src/summarize.js +1 -95
  73. package/vendor/cli/src/sysdiag.js +1 -585
  74. package/vendor/cli/src/system.js +1 -40
  75. package/vendor/cli/src/theme.js +1 -570
  76. package/vendor/cli/src/title.js +1 -220
  77. package/vendor/cli/src/todos.js +1 -115
  78. package/vendor/cli/src/tokens.js +1 -263
  79. package/vendor/cli/src/topup.js +1 -210
  80. package/vendor/cli/src/update.js +1 -181
  81. package/vendor/cli/vendor/client/aegis.js +1 -2179
  82. package/vendor/cli/vendor/client/attest.js +1 -442
  83. package/vendor/cli/vendor/client/authorship-key.js +1 -410
  84. package/vendor/cli/vendor/client/auto-provision.js +1 -134
  85. package/vendor/cli/vendor/client/brain-catalog.js +1 -268
  86. package/vendor/cli/vendor/client/byok-catalog.js +1 -230
  87. package/vendor/cli/vendor/client/credentials.js +1 -494
  88. package/vendor/cli/vendor/client/device-fingerprint.js +1 -141
  89. package/vendor/cli/vendor/client/drive-connect.js +1 -110
  90. package/vendor/cli/vendor/client/drive-upload.js +1 -174
  91. package/vendor/cli/vendor/client/env-file.js +1 -1273
  92. package/vendor/cli/vendor/client/fingerprint.js +1 -1064
  93. package/vendor/cli/vendor/client/foreign-memory.js +1 -669
  94. package/vendor/cli/vendor/client/google-signin.js +1 -133
  95. package/vendor/cli/vendor/client/hooks.js +1 -430
  96. package/vendor/cli/vendor/client/model-discovery.js +1 -373
  97. package/vendor/cli/vendor/client/platform.js +1 -937
  98. package/vendor/cli/vendor/client/prefs.js +1 -351
  99. package/vendor/cli/vendor/client/presence-constants.js +1 -107
  100. package/vendor/cli/vendor/client/presence.js +1 -438
  101. package/vendor/cli/vendor/client/record-vault.js +3 -1055
  102. package/vendor/cli/vendor/client/session-store.js +1 -548
  103. package/vendor/cli/vendor/client/topup.js +1 -297
  104. package/vendor/cli/vendor/client/touch.js +1 -458
  105. package/vendor/cli/vendor/client/update.js +1 -704
  106. package/vendor/cli/vendor/client/user-models.js +1 -381
  107. package/vendor/cli/vendor/desktop/lib/local/agents.js +1 -105
  108. package/vendor/cli/vendor/desktop/lib/local/autonomous.js +1 -1045
  109. package/vendor/cli/vendor/desktop/lib/local/claude-pro.js +1 -993
  110. package/vendor/cli/vendor/desktop/lib/local/context.js +1 -95
  111. package/vendor/cli/vendor/desktop/lib/local/engine.js +1 -3301
  112. package/vendor/cli/vendor/desktop/lib/local/entitlement.js +1 -660
  113. package/vendor/cli/vendor/desktop/lib/local/git-scope.js +1 -228
  114. package/vendor/cli/vendor/desktop/lib/local/local.js +1 -2135
  115. package/vendor/cli/vendor/desktop/lib/local/prompt.js +1 -275
  116. package/vendor/cli/vendor/desktop/lib/local/queue.js +1 -560
  117. package/vendor/cli/vendor/desktop/lib/local/session-rounds.js +1 -208
  118. package/vendor/cli/vendor/desktop/lib/local/shell.js +1 -680
  119. package/vendor/cli/vendor/desktop/lib/local/tools.js +1 -1238
  120. package/vendor/cli/vendor/desktop/lib/local/turn-guard.js +1 -300
  121. package/vendor/cli/vendor/desktop/lib/local/worktree-lock.js +1 -235
  122. package/vendor/cli/vendor/desktop/lib/settings.js +1 -890
  123. package/vendor/cli/vendor/desktop/renderer/usage.js +1 -1239
  124. package/vendor/cli/vendor/hosts/install.js +1 -638
  125. package/vendor/cli/vendor/hosts/openai-shim.js +1 -515
  126. package/vendor/cli/vendor/hosts/spec.js +1 -164
  127. package/vendor/cli/vendor/hosts/targets.js +1 -346
  128. package/vendor/cli/vendor/mcp/server.js +1 -221
  129. package/vendor/cli/vendor/mcp/tools.js +1 -408
  130. package/vendor/cli/vendor/one/src/child.js +1 -285
  131. package/vendor/cli/vendor/one/src/permissions.js +1 -369
  132. package/vendor/desktop/bin/aegis.js +1 -32
  133. package/vendor/desktop/lib/account-key.js +1 -56
  134. package/vendor/desktop/lib/auto.js +1 -430
  135. package/vendor/desktop/lib/avatar/companion.js +1 -698
  136. package/vendor/desktop/lib/avatar/cosmetics.js +1 -532
  137. package/vendor/desktop/lib/avatar/events.js +1 -344
  138. package/vendor/desktop/lib/avatar/holder-turn.js +1 -350
  139. package/vendor/desktop/lib/avatar/holders.js +1 -612
  140. package/vendor/desktop/lib/avatar/identity.js +1 -641
  141. package/vendor/desktop/lib/avatar/level.js +1 -368
  142. package/vendor/desktop/lib/avatar/mirror.js +1 -524
  143. package/vendor/desktop/lib/avatar/persona.js +1 -388
  144. package/vendor/desktop/lib/avatar/profile.js +1 -977
  145. package/vendor/desktop/lib/avatar/register.js +1 -307
  146. package/vendor/desktop/lib/avatar/store.js +1 -472
  147. package/vendor/desktop/lib/avatar/tiers.js +1 -38
  148. package/vendor/desktop/lib/avatar/transfer.js +1 -415
  149. package/vendor/desktop/lib/avatar/turn.js +1 -216
  150. package/vendor/desktop/lib/avatar/voice.js +1 -328
  151. package/vendor/desktop/lib/avatar/xp.js +1 -404
  152. package/vendor/desktop/lib/deep-link.js +1 -120
  153. package/vendor/desktop/lib/fingerprint.js +2 -347
  154. package/vendor/desktop/lib/google-connect.js +1 -227
  155. package/vendor/desktop/lib/local/agents.js +1 -105
  156. package/vendor/desktop/lib/local/autonomous.js +1 -1045
  157. package/vendor/desktop/lib/local/claude-pro.js +1 -993
  158. package/vendor/desktop/lib/local/context.js +1 -95
  159. package/vendor/desktop/lib/local/engine.js +1 -3301
  160. package/vendor/desktop/lib/local/entitlement.js +1 -660
  161. package/vendor/desktop/lib/local/git-scope.js +1 -228
  162. package/vendor/desktop/lib/local/local.js +1 -2135
  163. package/vendor/desktop/lib/local/prompt.js +1 -275
  164. package/vendor/desktop/lib/local/queue.js +1 -560
  165. package/vendor/desktop/lib/local/session-rounds.js +1 -208
  166. package/vendor/desktop/lib/local/shell.js +1 -680
  167. package/vendor/desktop/lib/local/telemetry.js +1 -470
  168. package/vendor/desktop/lib/local/tools.js +1 -1238
  169. package/vendor/desktop/lib/local/turn-guard.js +1 -300
  170. package/vendor/desktop/lib/local/worktree-lock.js +1 -235
  171. package/vendor/desktop/lib/provider-key-mirror.js +1 -252
  172. package/vendor/desktop/lib/quick-launcher.js +1 -84
  173. package/vendor/desktop/lib/settings.js +1 -890
  174. package/vendor/desktop/lib/sync/memory-queue.js +1 -60
  175. package/vendor/desktop/lib/sync/persist-gate.js +1 -148
  176. package/vendor/desktop/lib/sync/sessions.js +1 -106
  177. package/vendor/desktop/lib/window-state.js +1 -66
  178. package/vendor/desktop/main.js +1 -4529
  179. package/vendor/desktop/package.json +3 -5
  180. package/vendor/desktop/preload.js +1 -636
  181. package/vendor/desktop/renderer/app.js +1 -6660
  182. package/vendor/desktop/renderer/avatar/assemble.js +1 -335
  183. package/vendor/desktop/renderer/avatar/avatar.js +1 -380
  184. package/vendor/desktop/renderer/avatar/cards.js +1 -141
  185. package/vendor/desktop/renderer/avatar/hud.js +1 -206
  186. package/vendor/desktop/renderer/avatar/machine.js +1 -213
  187. package/vendor/desktop/renderer/avatar/pane.js +1 -439
  188. package/vendor/desktop/renderer/avatar/parts.js +1 -437
  189. package/vendor/desktop/renderer/budget.js +1 -168
  190. package/vendor/desktop/renderer/companion.js +1 -223
  191. package/vendor/desktop/renderer/diff.js +1 -359
  192. package/vendor/desktop/renderer/diffview.js +1 -336
  193. package/vendor/desktop/renderer/fingerprint.js +3 -736
  194. package/vendor/desktop/renderer/markdown.js +1 -168
  195. package/vendor/desktop/renderer/provider-toolbar.js +1 -134
  196. package/vendor/desktop/renderer/providers.js +1 -259
  197. package/vendor/desktop/renderer/quick.js +1 -191
  198. package/vendor/desktop/renderer/stream-policy.js +1 -306
  199. package/vendor/desktop/renderer/transcript-view.js +1 -323
  200. package/vendor/desktop/renderer/usage.js +1 -1239
  201. package/vendor/desktop/vendor/aegis.js +1 -2179
  202. package/vendor/desktop/vendor/attest.js +1 -442
  203. package/vendor/desktop/vendor/authorship-key.js +1 -410
  204. package/vendor/desktop/vendor/auto-provision.js +1 -134
  205. package/vendor/desktop/vendor/brain-catalog.js +1 -268
  206. package/vendor/desktop/vendor/byok-catalog.js +1 -230
  207. package/vendor/desktop/vendor/credentials.js +1 -494
  208. package/vendor/desktop/vendor/device-fingerprint.js +1 -141
  209. package/vendor/desktop/vendor/drive-connect.js +1 -110
  210. package/vendor/desktop/vendor/drive-upload.js +1 -174
  211. package/vendor/desktop/vendor/env-file.js +1 -1273
  212. package/vendor/desktop/vendor/fingerprint.js +1 -1064
  213. package/vendor/desktop/vendor/foreign-memory.js +1 -669
  214. package/vendor/desktop/vendor/google-signin.js +1 -133
  215. package/vendor/desktop/vendor/hooks.js +1 -430
  216. package/vendor/desktop/vendor/model-discovery.js +1 -373
  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 -548
  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 -704
  226. package/vendor/desktop/vendor/user-models.js +1 -381
package/bin/aegis.js CHANGED
@@ -1,325 +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
- 'use strict';
8
-
9
- /**
10
- * AEGISONE — the `aegis` command.
11
- *
12
- * This file is deliberately thin, and deliberately boring. It does exactly
13
- * three things, in this order:
14
- *
15
- * 1. gather the process facts (`src/probes.js`) — the only impure read in
16
- * the product's dispatch path;
17
- * 2. ask the pure rule which face runs (`src/dispatch.js`);
18
- * 3. hand off to that face, forwarding argv untouched and exiting with the
19
- * child's status.
20
- *
21
- * There is no third behaviour hiding in here. If you are looking for the
22
- * decision, it is not in this file — that is the point of it not being here:
23
- * everything decided in `run()` is a line a test cannot reach on a headless
24
- * box, and this product is authored on one.
25
- *
26
- * `aegiscode` is wired to this same bin and is forwarded verbatim as the
27
- * compatibility spelling; see the first rule in `dispatch.js`.
28
- *
29
- * Debugging: `AEGISONE_PRINT_DECISION=1 aegis …` prints the decision as one
30
- * JSON line on stderr and continues. It never changes the face.
31
- */
32
-
33
- const fs = require('node:fs');
34
- const path = require('node:path');
35
- const { spawnSync, spawn } = require('node:child_process');
36
- const { decide, FACE } = require('../src/dispatch.js');
37
- const probes = require('../src/probes.js');
38
- const release = require('../src/release.js');
39
-
40
- const EXIT_USAGE = 2;
41
- const PRODUCT = require('../package.json');
42
-
43
- /**
44
- * Where a face manifest can be, nearest to furthest:
45
- *
46
- * 1. `vendor/<face>/package.json` — inside the published product tarball,
47
- * which vendors both faces (plan D6);
48
- * 2. `../<face>/package.json` — a checkout of this repo, where the faces are
49
- * siblings of `one/`.
50
- *
51
- * Both are tried, in that order, because the answer differs between an installed
52
- * product and the tree it was built from, and `--version --verbose` must report
53
- * what is actually there rather than what the derivation says should be.
54
- */
55
- function faceManifestPaths(face, dir) {
56
- const binDir = dir || __dirname;
57
- return [
58
- path.join(binDir, '..', 'vendor', face.dir, 'package.json'),
59
- path.join(binDir, '..', '..', face.dir, 'package.json')
60
- ];
61
- }
62
-
63
- /** The version each face actually carries beside this product (`null` if none). */
64
- function readFaceVersions(dir) {
65
- return release.FACE_LINES.map((face) => {
66
- for (const candidate of faceManifestPaths(face, dir)) {
67
- try {
68
- return { package: face.package, version: JSON.parse(fs.readFileSync(candidate, 'utf8')).version, source: candidate };
69
- } catch {
70
- /* try the next layout */
71
- }
72
- }
73
- return { package: face.package, version: null, source: null };
74
- });
75
- }
76
-
77
- function write(stream, line) {
78
- try {
79
- stream.write(line.endsWith('\n') ? line : line + '\n');
80
- } catch {
81
- /* a closed pipe is not our problem to report */
82
- }
83
- }
84
-
85
- /** Exit status for a finished child, in shell terms (128 + n when signalled). */
86
- function statusOf(res) {
87
- if (typeof res.status === 'number') return res.status;
88
- if (res.signal === 'SIGINT') return 130;
89
- if (res.signal === 'SIGTERM') return 143;
90
- return 1;
91
- }
92
-
93
- /**
94
- * Decide, report, hand off.
95
- *
96
- * @param {string[]} argv arguments after the program name
97
- * @param {object} [deps] injected for tests: { input, spawnSync, spawn, env,
98
- * stderr, stdout }
99
- * @returns {number} the process exit code
100
- */
101
- function run(argv, deps) {
102
- const d = deps || {};
103
- const stderr = d.stderr || process.stderr;
104
- const stdout = d.stdout || process.stdout;
105
- const base = d.input || probes.collect({ argv });
106
- // The `argv` parameter wins over whatever an injected input carries. It used
107
- // to be silently ignored when `deps.input` was present, which meant a caller
108
- // could hand in arguments and have a completely different set decided on —
109
- // and a test found it. One source of truth: the argv you pass is the argv
110
- // that is decided on.
111
- const input = Array.isArray(argv) ? { ...base, argv } : base;
112
-
113
- // ── D4: `aegis --version` is the PRODUCT's version, not the face's. ───────
114
- // ON1 left this branch open on purpose: `--version` reached the dispatcher as
115
- // a terminal-face verb, so `aegis --version` printed the CLI face's `6.x`
116
- // version and the product had no version of its own to print. It is answered
117
- // here, before the decision, because it is not a question about which face
118
- // runs — and only in the two shapes `release.versionRequest` accepts, so no
119
- // prompt or flag can be swallowed by it.
120
- const asked = release.versionRequest(input.argv);
121
- if (asked) {
122
- const faces = asked.verbose
123
- ? (d.readFaceVersions ? d.readFaceVersions() : readFaceVersions(d.binDir))
124
- : null;
125
- write(stdout, release.renderVersion({ product: { name: PRODUCT.name, version: PRODUCT.version }, faces }));
126
- return 0;
127
- }
128
-
129
- // ── D7: `doctor` is answered here, before the face decision. ─────────────
130
- // It is a *product* verb: `aegis doctor` is a question about this install,
131
- // not about which face runs, and it must answer on a machine with no display
132
- // (ON1 routes `doctor` to the terminal face so it can never open a window —
133
- // but going through the CLI would mean the report only exists when the
134
- // terminal face is installed). The answer plus its exit code is the product's
135
- // own (0 healthy / 1 warn / 2 broken), and scripts branch on it, so it is
136
- // returned unmodified — never merged with a child's status.
137
- const doctorAt = (input.argv || []).indexOf('doctor');
138
- if (doctorAt !== -1 && !(input.argv || []).slice(0, doctorAt).some((a) => !a.startsWith('-'))) {
139
- const doctor = d.doctor || require('../src/doctor.js');
140
- const code = doctor.main((input.argv || []).slice(doctorAt + 1), Object.assign({ env: input.env, stdout }, d.doctorDeps || {}));
141
- return typeof code === 'number' ? code : EXIT_USAGE;
142
- }
143
-
144
- const decision = decide(input);
145
-
146
- // ── D8: the permission posture, resolved ONCE, before any hand-off. ───────
147
- //
148
- // `--dangerously-skip-permissions` is a product flag, not a face flag: it is
149
- // answered HERE (like `--version` and `doctor` above) because its effect
150
- // spans both faces — the confirmation gate the user is about to run inside,
151
- // and the Claude child whose prompt nobody can answer (D8 rules 3–5).
152
- //
153
- // Three things happen, in this order, and nothing else:
154
- //
155
- // 1. the posture is resolved from the flag, the environment and whether a
156
- // human is present (rule 5 lives in `cli/src/permissions.js`
157
- // `resolveSkip()`, so this face and the terminal face share it);
158
- // 2. a skip prints the one line rule 3 requires, naming the classes; a
159
- // rule-5 refusal prints its warning and the run stays gated;
160
- // 3. the flag is STRIPPED from the arguments forwarded to a face (the CLI's
161
- // parser has never heard of it, and silently eating a flag is its own
162
- // small lie), and the resolved decision is handed to the child through
163
- // `AEGISONE_SKIP_PERMISSIONS` — the product's own spelling, which the
164
- // face reads. The user-facing `AEGIS_SKIP_PERMISSIONS` is never
165
- // forwarded as an authorisation: rule 5's check has already been applied
166
- // to it here, and re-applying it one process down would be a second
167
- // place to get it wrong.
168
- const perms = d.permissions || require('../src/permissions.js');
169
- const skipFlagAt = (input.argv || []).indexOf(perms.SKIP_FLAG || '--dangerously-skip-permissions');
170
- const ttyInteractive = Boolean(input.tty && input.tty.stdin && input.tty.stdout);
171
- const childKind = ttyInteractive ? 'interactive' : 'headless';
172
- // The store's answer, read through the faces' OWN module (cli/src/config.js
173
- // `confirmPosture()`, resolved by layout exactly like the evaluator), never by
174
- // cracking `preferences.json` open here: that key has one reader per face and
175
- // a third would be the split brain ON8 removed. `d.stored` is injectable for
176
- // tests; a store that cannot be read answers `undefined`, which leaves the
177
- // gate exactly as it was.
178
- const stored = d.stored || perms.storedPermissionFacts(d.storedOpts || {});
179
- const posture = perms.resolvePosture({
180
- // `d.rules` still wins when a caller set it (tests, embedding); otherwise
181
- // the rule set the user actually wrote. It was never filled in before, so
182
- // rule 4's `--allowedTools`/`--disallowedTools` — "the child's policy
183
- // tracks ours" — were built from an empty set.
184
- rules: d.rules !== undefined ? d.rules : stored.rules,
185
- // The stored posture: a user who already ran `/automode` (or flipped the
186
- // window's switch) is NOT asked again one process down. This is the half
187
- // that was missing — the flag resolved here, the setting did not.
188
- gate: d.gate !== undefined ? d.gate : stored.confirmationsOn,
189
- flag: skipFlagAt !== -1,
190
- env: input.env,
191
- interactive: ttyInteractive,
192
- childKind,
193
- });
194
-
195
- if (posture.warning) write(stderr, `aegis: ${posture.warning}`);
196
- // Rule 3's report is for a FLAG typed for one run. A stored posture is a
197
- // setting the user can see and undo in both faces' own UI, so it is not
198
- // announced on every launch (see resolvePosture's `skipFromFlag`).
199
- if (posture.skip && posture.skipFromFlag) write(stderr, perms.skipReport(posture));
200
-
201
- const faceArgs = skipFlagAt === -1
202
- ? decision.args
203
- : decision.args.filter((a) => a !== (perms.SKIP_FLAG || '--dangerously-skip-permissions'));
204
- // Forwarded only for a skip that was ASKED for (the flag, or the product's own
205
- // env spelling). Deliberately NOT for the stored posture: `AEGISONE_SKIP_
206
- // PERMISSIONS` short-circuits the face's own read on every tool round, so
207
- // forwarding a setting through it would freeze a live, toggleable posture for
208
- // the whole process — `/automode on` inside the session could then never
209
- // restore confirmations. The face reads the same store the window writes and
210
- // gets the same answer on its own; the child's argv is what needed the fix.
211
- const postureEnv = posture.skipFromFlag ? { AEGISONE_SKIP_PERMISSIONS: '1' } : {};
212
-
213
- if ((input.env || {}).AEGISONE_PRINT_DECISION === '1') { write(
214
- stderr,
215
- 'aegis: decision ' +
216
- JSON.stringify({
217
- face: decision.face,
218
- kind: decision.kind,
219
- reason: decision.reason,
220
- args: faceArgs,
221
- skip: posture.skip,
222
- })
223
- );
224
- }
225
-
226
- // ── Refused outright: an explicit request the machine cannot honour. ──────
227
- if (decision.face === null) {
228
- write(stderr, `aegis: ${decision.error}`);
229
- if (decision.hint) write(stderr, `aegis: ${decision.hint}`);
230
- return decision.code || EXIT_USAGE;
231
- }
232
-
233
- // ── One line explaining a fallback. Never silence, never a question. ─────
234
- if (decision.notice) write(stderr, `aegis: ${decision.notice} — running the terminal face.`);
235
-
236
- const doSpawn = d.spawnSync || spawnSync;
237
- const doSpawnAsync = d.spawn || spawn;
238
- const spawnEnv = Object.assign({}, process.env, d.env || {});
239
-
240
- if (decision.face === FACE.TUI) {
241
- const bin = input._cliBin || d.cliBin;
242
- if (!bin) {
243
- write(stderr, 'aegis: the terminal face is not installed beside aegisone.');
244
- write(stderr, 'aegis: reinstall aegisone, or set AEGISONE_CLI_BIN to bin/aegiscode.js.');
245
- return 127;
246
- }
247
- const res = doSpawn(process.execPath, [bin, ...faceArgs], {
248
- stdio: 'inherit',
249
- env: Object.assign({}, spawnEnv, postureEnv),
250
- argv0: 'aegiscode',
251
- });
252
- return statusOf(res || {});
253
- }
254
-
255
- // ── GUI ──────────────────────────────────────────────────────────────────
256
- // The dispatch rule already refused this path unless Electron resolved, so a
257
- // miss here means the tree changed under us; say so rather than fall back to
258
- // a terminal, because the user did ask for the window.
259
- const electron = input._electron || d.electron;
260
- const main = input._desktopMain || d.desktopMain;
261
- if (!electron || !main) {
262
- write(
263
- stderr,
264
- 'aegis: cannot open the window — Electron or the desktop entry point went missing after the check.'
265
- );
266
- write(stderr, 'aegis: Use --tui for the terminal face.');
267
- return EXIT_USAGE;
268
- }
269
-
270
- // Handed to **Node**, not to Electron — and this was a live bug, not a
271
- // preference. `desktop/bin/aegis.js` is a launcher: under Node it does
272
- // `require('electron')` and gets the path to the binary, then spawns it with
273
- // the app dir. Running that file *inside* Electron instead makes the same
274
- // require return the Electron module object, and `spawn(object, …)` dies with
275
- // ERR_INVALID_ARG_TYPE inside the app's own bootstrap. The desktop package
276
- // already owns "find Electron and launch it"; AEGISONE delegates to it
277
- // rather than keeping a second, divergent copy of that logic. The resolved
278
- // Electron path is still what the *probe* consumes — capability to open a
279
- // window is one question, and who does the opening is another.
280
- //
281
- // ELECTRON_RUN_AS_NODE would make Electron behave as plain node and never
282
- // open a window — the classic silent-no-op, removed rather than inherited.
283
- delete spawnEnv.ELECTRON_RUN_AS_NODE;
284
-
285
- // `spawn`, not `spawnSync`: the window should not hold the shell's tty
286
- // hostage. The parent waits only so the exit code is still the child's.
287
- const child = doSpawnAsync(process.execPath, [main, ...faceArgs], {
288
- stdio: 'inherit',
289
- env: Object.assign({}, spawnEnv, postureEnv),
290
- detached: false,
291
- });
292
-
293
- return new Promise((resolve) => {
294
- child.on('error', (err) => {
295
- write(stderr, `aegis: could not start the window: ${err && err.message}`);
296
- resolve(1);
297
- });
298
- child.on('exit', (code, signal) => resolve(statusOf({ status: code, signal })));
299
- });
300
- }
301
-
302
- /** Synchronous wrapper for the entry point: returns a code or a Promise. */
303
- function main(argv) {
304
- const outcome = run(argv);
305
- if (typeof outcome === 'number') {
306
- process.exitCode = outcome;
307
- return outcome;
308
- }
309
- return outcome.then((code) => {
310
- process.exitCode = code;
311
- return code;
312
- });
313
- }
314
-
315
- module.exports = { main, run, statusOf, EXIT_USAGE };
316
-
317
- if (require.main === module) {
318
- const result = main(process.argv.slice(2));
319
- if (result && typeof result.then === 'function') {
320
- result.catch((err) => {
321
- write(process.stderr, `aegis: ${(err && err.stack) || err}`);
322
- process.exitCode = 1;
323
- });
324
- }
325
- }
4
+ "use strict";const fs=require("node:fs"),path=require("node:path"),{spawnSync:spawnSync,spawn:spawn}=require("node:child_process"),{decide:decide,FACE:FACE}=require("../src/dispatch.js"),probes=require("../src/probes.js"),release=require("../src/release.js"),EXIT_USAGE=2,PRODUCT=require("../package.json");function faceManifestPaths(e,s){const r=s||__dirname;return[path.join(r,"..","vendor",e.dir,"package.json"),path.join(r,"..","..",e.dir,"package.json")]}function readFaceVersions(e){return release.FACE_LINES.map((s=>{for(const r of faceManifestPaths(s,e))try{return{package:s.package,version:JSON.parse(fs.readFileSync(r,"utf8")).version,source:r}}catch{}return{package:s.package,version:null,source:null}}))}function write(e,s){try{e.write(s.endsWith("\n")?s:s+"\n")}catch{}}function statusOf(e){return"number"==typeof e.status?e.status:"SIGINT"===e.signal?130:"SIGTERM"===e.signal?143:1}function run(e,s){const r=s||{},t=r.stderr||process.stderr,n=r.stdout||process.stdout,i=r.input||probes.collect({argv:e}),a=Array.isArray(e)?{...i,argv:e}:i,o=release.versionRequest(a.argv);if(o){const e=o.verbose?r.readFaceVersions?r.readFaceVersions():readFaceVersions(r.binDir):null;return write(n,release.renderVersion({product:{name:PRODUCT.name,version:PRODUCT.version},faces:e})),0}const c=(a.argv||[]).indexOf("doctor");if(-1!==c&&!(a.argv||[]).slice(0,c).some((e=>!e.startsWith("-")))){const e=(r.doctor||require("../src/doctor.js")).main((a.argv||[]).slice(c+1),Object.assign({env:a.env,stdout:n},r.doctorDeps||{}));return"number"==typeof e?e:EXIT_USAGE}const d=decide(a),u=r.permissions||require("../src/permissions.js"),p=(a.argv||[]).indexOf(u.SKIP_FLAG||"--dangerously-skip-permissions"),g=Boolean(a.tty&&a.tty.stdin&&a.tty.stdout),l=g?"interactive":"headless",f=r.stored||u.storedPermissionFacts(r.storedOpts||{}),h=u.resolvePosture({rules:void 0!==r.rules?r.rules:f.rules,gate:void 0!==r.gate?r.gate:f.confirmationsOn,flag:-1!==p,env:a.env,interactive:g,childKind:l});h.warning&&write(t,`aegis: ${h.warning}`),h.skip&&h.skipFromFlag&&write(t,u.skipReport(h));const v=-1===p?d.args:d.args.filter((e=>e!==(u.SKIP_FLAG||"--dangerously-skip-permissions"))),w=h.skipFromFlag?{AEGISONE_SKIP_PERMISSIONS:"1"}:{};if("1"===(a.env||{}).AEGISONE_PRINT_DECISION&&write(t,"aegis: decision "+JSON.stringify({face:d.face,kind:d.kind,reason:d.reason,args:v,skip:h.skip})),null===d.face)return write(t,`aegis: ${d.error}`),d.hint&&write(t,`aegis: ${d.hint}`),d.code||EXIT_USAGE;d.notice&&write(t,`aegis: ${d.notice} — running the terminal face.`);const m=r.spawnSync||spawnSync,E=r.spawn||spawn,S=Object.assign({},process.env,r.env||{});if(d.face===FACE.TUI){const e=a._cliBin||r.cliBin;return e?statusOf(m(process.execPath,[e,...v],{stdio:"inherit",env:Object.assign({},S,w),argv0:"aegiscode"})||{}):(write(t,"aegis: the terminal face is not installed beside aegisone."),write(t,"aegis: reinstall aegisone, or set AEGISONE_CLI_BIN to bin/aegiscode.js."),127)}const O=a._electron||r.electron,I=a._desktopMain||r.desktopMain;if(!O||!I)return write(t,"aegis: cannot open the window — Electron or the desktop entry point went missing after the check."),write(t,"aegis: Use --tui for the terminal face."),EXIT_USAGE;delete S.ELECTRON_RUN_AS_NODE;const _=E(process.execPath,[I,...v],{stdio:"inherit",env:Object.assign({},S,w),detached:!1});return new Promise((e=>{_.on("error",(s=>{write(t,`aegis: could not start the window: ${s&&s.message}`),e(1)})),_.on("exit",((s,r)=>e(statusOf({status:s,signal:r}))))}))}function main(e){const s=run(e);return"number"==typeof s?(process.exitCode=s,s):s.then((e=>(process.exitCode=e,e)))}if(module.exports={main:main,run:run,statusOf:statusOf,EXIT_USAGE:EXIT_USAGE},require.main===module){const e=main(process.argv.slice(2));e&&"function"==typeof e.then&&e.catch((e=>{write(process.stderr,`aegis: ${e&&e.stack||e}`),process.exitCode=1}))}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aegisone",
3
3
  "productName": "AEGISONE",
4
- "version": "1.0.22",
4
+ "version": "1.0.24",
5
5
  "description": "AEGISONE — one product, two faces. `aegis` opens the window when there is nothing else to do and runs the terminal otherwise; `aegiscode` keeps behaving exactly as it always has.",
6
6
  "author": {
7
7
  "name": "AEGIS Code",
@@ -19,15 +19,14 @@
19
19
  "install.sh",
20
20
  "install.ps1",
21
21
  "vendor",
22
- "README.md"
22
+ "README.md",
23
+ "SOURCE-OFFER.txt",
24
+ "LICENSE"
23
25
  ],
24
26
  "engines": {
25
27
  "node": ">=22.0.0"
26
28
  },
27
29
  "scripts": {
28
- "predist": "node scripts/predist.mjs",
29
- "prepack": "node scripts/predist.mjs --quiet",
30
- "prepublishOnly": "npm run predist",
31
30
  "bump": "node scripts/bump.mjs",
32
31
  "compat": "node test/one-compat.test.mjs",
33
32
  "size": "node scripts/bundle.mjs --json"
package/scripts/bump.mjs CHANGED
@@ -1,214 +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
- * AEGISONE — the bump: ONE command, ONE version, three manifests, one README
9
- * line (plan D4, ON3 step 1).
10
- *
11
- * The commit this replaces read
12
- * `chore(release): aegis-desktop 0.8.28, aegiscode 6.8.30` — three hand-typed
13
- * numbers, kept in step by whoever was cutting the release. Every failure mode
14
- * of that was real: a face bumped but not the product, a product tag with a
15
- * stale face, a desktop version that disagrees with the README the tag ships
16
- * with. This script computes all four from `one/package.json` and the
17
- * derivation in `one/src/release.js`, so there is nothing left to remember.
18
- *
19
- * node one/scripts/bump.mjs 1.0.1 # set the product version
20
- * node one/scripts/bump.mjs patch # ...or let it do the arithmetic
21
- * node one/scripts/bump.mjs 1.0.1 --dry-run # print the diff, write nothing
22
- *
23
- * It REFUSES to bump a tree that is already inconsistent with the product
24
- * version it carries: a bump is not a repair, and silently overwriting drift
25
- * would destroy the evidence of how it happened. Fix the drift, then bump.
26
- *
27
- * Everything under `one/` obeys the Phase 30.1 seam rule: no `process.*` read
28
- * at module scope, all IO behind `main(argv, io)`, so importing this file in a
29
- * test stages and writes nothing.
30
- */
31
-
32
- import fs from 'node:fs';
33
- import path from 'node:path';
34
- import { fileURLToPath } from 'node:url';
35
- import { createRequire } from 'node:module';
36
-
37
- const HERE = path.dirname(fileURLToPath(import.meta.url));
38
- const require = createRequire(import.meta.url);
39
- const release = require('../src/release.js');
40
-
41
- /** Repo root — `one/scripts/` -> `one/` -> repo. */
42
- export const ROOT = path.join(HERE, '..', '..');
43
-
44
- /**
45
- * The four documents a bump writes, in the order a reviewer reads them: the
46
- * source of truth first, then the line in the product README that ships with
47
- * the tag, then the two derived faces.
48
- */
49
- export function bumpTargets(root) {
50
- const dir = root || ROOT;
51
- return [
52
- { file: 'one/package.json', kind: 'json', abs: path.join(dir, 'one', 'package.json') },
53
- { file: 'one/README.md', kind: 'readme', abs: path.join(dir, 'one', 'README.md') },
54
- { file: 'cli/package.json', kind: 'json', abs: path.join(dir, 'cli', 'package.json') },
55
- { file: 'desktop/package.json', kind: 'json', abs: path.join(dir, 'desktop', 'package.json') }
56
- ];
57
- }
58
-
59
- /**
60
- * Build the plan for a bump: read the four documents, compute every new version
61
- * from the derivation, and hand back the exact new contents.
62
- *
63
- * @param {{root?: string, version: string, io?: object, read?: Function, repair?: boolean}} input
64
- * @returns {{version: string, faces: object, files: Array<object>, changed: number}}
65
- */
66
- export function plan(input) {
67
- const src = input || {};
68
- const root = src.root || ROOT;
69
- const read = src.read || ((abs) => fs.readFileSync(abs, 'utf8'));
70
- const version = release.parseVersion(src.version).text;
71
- const repair = src.repair === true;
72
-
73
- const targets = bumpTargets(root);
74
- const faces = release.deriveFaceVersions(version);
75
- // Who gets which number: the product manifest and the README carry the
76
- // product version; each face carries the version derived for it.
77
- const versionFor = (file) => {
78
- if (file === 'one/package.json' || file === 'one/README.md') return version;
79
- if (file === 'cli/package.json') return faces.aegiscode.version;
80
- if (file === 'desktop/package.json') return faces['aegis-desktop'].version;
81
- throw new Error(`no version rule for ${file}`);
82
- };
83
- const documents = targets.map((t) => ({
84
- file: t.file,
85
- kind: t.kind,
86
- content: read(t.abs),
87
- version: versionFor(t.file)
88
- }));
89
-
90
- // Refuse a tree that is already drifting: the manifests must equal what the
91
- // derivation says for the product version they carry today, or a bump would
92
- // launder the drift into "the new version".
93
- //
94
- // `repair: true` is the one exception, and it is narrow on purpose. It exists
95
- // for the case that has actually happened: a face was bumped by hand and
96
- // PUBLISHED (`aegiscode 7.0.11`) without the product moving, so the tree can
97
- // only be made consistent going FORWARD — product 1.0.19 is what derives
98
- // 7.0.11 again. Refusing here would leave the drift unreachable, since the
99
- // script also refuses to run from it. What a repair may never do is move a
100
- // face BACKWARDS: that would re-cut a published version, so each face's new
101
- // number is checked against the one already on disk, not just against the
102
- // derivation.
103
- const currentProduct = JSON.parse(documents[0].content).version;
104
- const expected = release.deriveFaceVersions(currentProduct);
105
- for (const doc of documents.slice(2)) {
106
- const name = JSON.parse(doc.content).name;
107
- const want = expected[name];
108
- if (!want) throw new Error(`${doc.file}: unexpected package name ${JSON.stringify(name)}`);
109
- const got = JSON.parse(doc.content).version;
110
- if (got !== want.version && !repair) {
111
- throw new Error(
112
- `${doc.file} carries ${name} ${got}, but product ${currentProduct} derives ${want.version} — ` +
113
- 'the tree is already inconsistent; run `node test/one-version.test.mjs` to see all of it, ' +
114
- 'then bump from a clean state'
115
- );
116
- }
117
- if (repair) {
118
- // A published number is never rewritten, by a bump or a repair.
119
- const to = release.deriveFaceVersion(version, release.FACE_LINES.find((f) => f.package === name));
120
- const gotCounter = release.releaseCounter(got);
121
- if (release.releaseCounter(to) < gotCounter) {
122
- throw new Error(
123
- `repair would move ${name} backwards: ${got} -> ${to} — a published version is never re-cut`
124
- );
125
- }
126
- }
127
- }
128
-
129
- const files = release.planBump({ version, documents });
130
- return {
131
- version,
132
- from: currentProduct,
133
- faces,
134
- files,
135
- changed: files.filter((f) => !f.unchanged).length
136
- };
137
- }
138
-
139
- /**
140
- * CLI entry. `argv` and the streams are parameters; the process is read here and
141
- * nowhere at module scope.
142
- */
143
- export function main(argv, io) {
144
- const o = io || {};
145
- const out = o.stdout || process.stdout;
146
- const errOut = o.stderr || process.stderr;
147
- const args = (Array.isArray(argv) ? argv : []).map(String);
148
- const dryRun = args.includes('--dry-run');
149
- // `--repair` is the escape hatch for a tree whose face was bumped and
150
- // published by hand. It is not implied by anything: without it, drift is
151
- // still a hard error.
152
- const repair = args.includes('--repair');
153
- const positional = args.filter((a) => !a.startsWith('--'));
154
- if (positional.length !== 1) {
155
- errOut.write('usage: node one/scripts/bump.mjs <major|minor|patch|X.Y.Z> [--dry-run] [--repair]\n');
156
- return 2;
157
- }
158
-
159
- let built;
160
- try {
161
- const current = JSON.parse(fs.readFileSync(path.join(ROOT, 'one', 'package.json'), 'utf8')).version;
162
- built = plan({ root: ROOT, version: release.nextVersion(current, positional[0]), repair });
163
- } catch (error) {
164
- errOut.write(`bump: ${(error && error.message) || error}\n`);
165
- return 1;
166
- }
167
-
168
- let written = 0;
169
- for (const file of built.files) {
170
- if (file.unchanged) continue;
171
- if (dryRun) {
172
- out.write(release.unifiedDiff(file.before, file.content, file.file));
173
- } else {
174
- fs.writeFileSync(path.join(ROOT, file.file), file.content);
175
- written++;
176
- }
177
- }
178
-
179
- if (dryRun) {
180
- out.write(
181
- `bump: dry run — ${built.from} -> ${built.version}; ` +
182
- `aegiscode ${built.faces.aegiscode.version}, aegis-desktop ${built.faces['aegis-desktop'].version}; ` +
183
- 'nothing written\n'
184
- );
185
- } else {
186
- out.write(
187
- `bump: ${built.from} -> ${built.version} (aegiscode ${built.faces.aegiscode.version}, ` +
188
- `aegis-desktop ${built.faces['aegis-desktop'].version}) — ${written} file(s) written\n`
189
- );
190
- }
191
- return 0;
192
- }
193
-
194
- /**
195
- * Run when — and only when — this file was started directly. The process reads
196
- * live inside a function on purpose: `one/`'s seam rule forbids them at module
197
- * scope, and this is the file that would have broken it.
198
- */
199
- function runIfDirect() {
200
- const entry = process.argv[1];
201
- let direct = false;
202
- if (entry) {
203
- try {
204
- direct = path.resolve(entry) === fileURLToPath(import.meta.url);
205
- } catch {
206
- direct = false;
207
- }
208
- }
209
- if (!direct) return false;
210
- process.exitCode = main(process.argv.slice(2));
211
- return true;
212
- }
213
-
214
- runIfDirect();
4
+ import e from"node:fs";import r from"node:path";import{fileURLToPath as n}from"node:url";import{createRequire as o}from"node:module";const s=r.dirname(n(import.meta.url)),i=o(import.meta.url)("../src/release.js");export const ROOT=r.join(s,"..","..");export function bumpTargets(e){const n=e||ROOT;return[{file:"one/package.json",kind:"json",abs:r.join(n,"one","package.json")},{file:"one/README.md",kind:"readme",abs:r.join(n,"one","README.md")},{file:"cli/package.json",kind:"json",abs:r.join(n,"cli","package.json")},{file:"desktop/package.json",kind:"json",abs:r.join(n,"desktop","package.json")}]}export function plan(r){const n=r||{},o=n.root||ROOT,s=n.read||(r=>e.readFileSync(r,"utf8")),t=i.parseVersion(n.version).text,a=!0===n.repair,c=bumpTargets(o),p=i.deriveFaceVersions(t),d=e=>{if("one/package.json"===e||"one/README.md"===e)return t;if("cli/package.json"===e)return p.aegiscode.version;if("desktop/package.json"===e)return p["aegis-desktop"].version;throw new Error(`no version rule for ${e}`)},f=c.map((e=>({file:e.file,kind:e.kind,content:s(e.abs),version:d(e.file)}))),l=JSON.parse(f[0].content).version,u=i.deriveFaceVersions(l);for(const e of f.slice(2)){const r=JSON.parse(e.content).name,n=u[r];if(!n)throw new Error(`${e.file}: unexpected package name ${JSON.stringify(r)}`);const o=JSON.parse(e.content).version;if(o!==n.version&&!a)throw new Error(`${e.file} carries ${r} ${o}, but product ${l} derives ${n.version} — the tree is already inconsistent; run \`node test/one-version.test.mjs\` to see all of it, then bump from a clean state`);if(a){const e=i.deriveFaceVersion(t,i.FACE_LINES.find((e=>e.package===r))),n=i.releaseCounter(o);if(i.releaseCounter(e)<n)throw new Error(`repair would move ${r} backwards: ${o} -> ${e} — a published version is never re-cut`)}}const m=i.planBump({version:t,documents:f});return{version:t,from:l,faces:p,files:m,changed:m.filter((e=>!e.unchanged)).length}}export function main(n,o){const s=o||{},t=s.stdout||process.stdout,a=s.stderr||process.stderr,c=(Array.isArray(n)?n:[]).map(String),p=c.includes("--dry-run"),d=c.includes("--repair"),f=c.filter((e=>!e.startsWith("--")));if(1!==f.length)return a.write("usage: node one/scripts/bump.mjs <major|minor|patch|X.Y.Z> [--dry-run] [--repair]\n"),2;let l;try{const n=JSON.parse(e.readFileSync(r.join(ROOT,"one","package.json"),"utf8")).version;l=plan({root:ROOT,version:i.nextVersion(n,f[0]),repair:d})}catch(e){return a.write(`bump: ${e&&e.message||e}\n`),1}let u=0;for(const n of l.files)n.unchanged||(p?t.write(i.unifiedDiff(n.before,n.content,n.file)):(e.writeFileSync(r.join(ROOT,n.file),n.content),u++));return p?t.write(`bump: dry run — ${l.from} -> ${l.version}; aegiscode ${l.faces.aegiscode.version}, aegis-desktop ${l.faces["aegis-desktop"].version}; nothing written\n`):t.write(`bump: ${l.from} -> ${l.version} (aegiscode ${l.faces.aegiscode.version}, aegis-desktop ${l.faces["aegis-desktop"].version}) — ${u} file(s) written\n`),0}!function(){const e=process.argv[1];let o=!1;if(e)try{o=r.resolve(e)===n(import.meta.url)}catch{o=!1}o&&(process.exitCode=main(process.argv.slice(2)))}();