aegisone 0.0.0-stage → 1.0.4

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 (266) hide show
  1. package/README.md +98 -2
  2. package/bin/aegis.js +295 -0
  3. package/install.ps1 +151 -0
  4. package/install.sh +178 -0
  5. package/package.json +44 -4
  6. package/scripts/bump.mjs +184 -0
  7. package/scripts/bundle.js +126 -0
  8. package/scripts/predist.mjs +673 -0
  9. package/src/child.js +163 -0
  10. package/src/dispatch.js +265 -0
  11. package/src/doctor.js +636 -0
  12. package/src/host.js +108 -0
  13. package/src/permissions.js +239 -0
  14. package/src/probes.js +156 -0
  15. package/src/release.js +397 -0
  16. package/vendor/cli/LICENSE +661 -0
  17. package/vendor/cli/README.md +745 -0
  18. package/vendor/cli/bin/aegiscode.js +742 -0
  19. package/vendor/cli/package.json +42 -0
  20. package/vendor/cli/scripts/check.mjs +50 -0
  21. package/vendor/cli/scripts/demo.mjs +92 -0
  22. package/vendor/cli/scripts/predist.mjs +48 -0
  23. package/vendor/cli/scripts/runtests.mjs +54 -0
  24. package/vendor/cli/src/agents.js +136 -0
  25. package/vendor/cli/src/app.js +2166 -0
  26. package/vendor/cli/src/art.js +286 -0
  27. package/vendor/cli/src/autonomous.js +468 -0
  28. package/vendor/cli/src/caps.js +876 -0
  29. package/vendor/cli/src/chatflow.js +2389 -0
  30. package/vendor/cli/src/checkpoint.js +87 -0
  31. package/vendor/cli/src/clipboard.js +421 -0
  32. package/vendor/cli/src/cloudsync.js +525 -0
  33. package/vendor/cli/src/commands.js +3014 -0
  34. package/vendor/cli/src/config.js +527 -0
  35. package/vendor/cli/src/credentials.js +30 -0
  36. package/vendor/cli/src/deps.js +106 -0
  37. package/vendor/cli/src/devrun.js +184 -0
  38. package/vendor/cli/src/diff.js +330 -0
  39. package/vendor/cli/src/diffview.js +293 -0
  40. package/vendor/cli/src/engine.js +142 -0
  41. package/vendor/cli/src/entitlement.js +323 -0
  42. package/vendor/cli/src/events.js +694 -0
  43. package/vendor/cli/src/export.js +64 -0
  44. package/vendor/cli/src/fingerprint.js +559 -0
  45. package/vendor/cli/src/format.js +84 -0
  46. package/vendor/cli/src/fuzzy.js +116 -0
  47. package/vendor/cli/src/gate.js +45 -0
  48. package/vendor/cli/src/history.js +398 -0
  49. package/vendor/cli/src/init.js +172 -0
  50. package/vendor/cli/src/input.js +136 -0
  51. package/vendor/cli/src/keys.js +153 -0
  52. package/vendor/cli/src/markdown.js +303 -0
  53. package/vendor/cli/src/mcp.js +683 -0
  54. package/vendor/cli/src/models.js +409 -0
  55. package/vendor/cli/src/naming.js +226 -0
  56. package/vendor/cli/src/overlays.js +338 -0
  57. package/vendor/cli/src/panels.js +1402 -0
  58. package/vendor/cli/src/permissions.js +237 -0
  59. package/vendor/cli/src/ping.js +223 -0
  60. package/vendor/cli/src/presence.js +235 -0
  61. package/vendor/cli/src/render.js +469 -0
  62. package/vendor/cli/src/screen.js +504 -0
  63. package/vendor/cli/src/screens.js +776 -0
  64. package/vendor/cli/src/secret.js +56 -0
  65. package/vendor/cli/src/securefs.js +356 -0
  66. package/vendor/cli/src/settings.js +152 -0
  67. package/vendor/cli/src/shared.js +49 -0
  68. package/vendor/cli/src/sharedpaths.js +50 -0
  69. package/vendor/cli/src/signup.js +153 -0
  70. package/vendor/cli/src/summarize.js +92 -0
  71. package/vendor/cli/src/system.js +37 -0
  72. package/vendor/cli/src/theme.js +567 -0
  73. package/vendor/cli/src/title.js +217 -0
  74. package/vendor/cli/src/todos.js +109 -0
  75. package/vendor/cli/src/tokens.js +230 -0
  76. package/vendor/cli/src/topup.js +207 -0
  77. package/vendor/cli/src/update.js +87 -0
  78. package/vendor/cli/vendor/client/aegis.js +1744 -0
  79. package/vendor/cli/vendor/client/attest.js +439 -0
  80. package/vendor/cli/vendor/client/authorship-key.js +407 -0
  81. package/vendor/cli/vendor/client/auto-provision.js +59 -0
  82. package/vendor/cli/vendor/client/brain-catalog.js +265 -0
  83. package/vendor/cli/vendor/client/byok-catalog.js +192 -0
  84. package/vendor/cli/vendor/client/credentials.js +478 -0
  85. package/vendor/cli/vendor/client/device-fingerprint.js +145 -0
  86. package/vendor/cli/vendor/client/env-file.js +1016 -0
  87. package/vendor/cli/vendor/client/fingerprint.js +1061 -0
  88. package/vendor/cli/vendor/client/foreign-memory.js +666 -0
  89. package/vendor/cli/vendor/client/hooks.js +427 -0
  90. package/vendor/cli/vendor/client/platform.js +934 -0
  91. package/vendor/cli/vendor/client/prefs.js +348 -0
  92. package/vendor/cli/vendor/client/presence-constants.js +104 -0
  93. package/vendor/cli/vendor/client/presence.js +435 -0
  94. package/vendor/cli/vendor/client/record-vault.js +834 -0
  95. package/vendor/cli/vendor/client/session-store.js +545 -0
  96. package/vendor/cli/vendor/client/topup.js +294 -0
  97. package/vendor/cli/vendor/client/touch.js +455 -0
  98. package/vendor/cli/vendor/client/update.js +343 -0
  99. package/vendor/cli/vendor/covenant/README.md +21 -0
  100. package/vendor/cli/vendor/covenant/aegis.seal +177 -0
  101. package/vendor/cli/vendor/desktop/lib/local/aegis-seal.mjs +236 -0
  102. package/vendor/cli/vendor/desktop/lib/local/agents.js +102 -0
  103. package/vendor/cli/vendor/desktop/lib/local/autonomous.js +921 -0
  104. package/vendor/cli/vendor/desktop/lib/local/context.js +92 -0
  105. package/vendor/cli/vendor/desktop/lib/local/covenant.js +562 -0
  106. package/vendor/cli/vendor/desktop/lib/local/engine.js +2155 -0
  107. package/vendor/cli/vendor/desktop/lib/local/entitlement.js +651 -0
  108. package/vendor/cli/vendor/desktop/lib/local/git-scope.js +225 -0
  109. package/vendor/cli/vendor/desktop/lib/local/local.js +2132 -0
  110. package/vendor/cli/vendor/desktop/lib/local/prompt.js +242 -0
  111. package/vendor/cli/vendor/desktop/lib/local/queue.js +557 -0
  112. package/vendor/cli/vendor/desktop/lib/local/session-rounds.js +205 -0
  113. package/vendor/cli/vendor/desktop/lib/local/shell.js +603 -0
  114. package/vendor/cli/vendor/desktop/lib/local/tools.js +1197 -0
  115. package/vendor/cli/vendor/desktop/lib/local/turn-guard.js +297 -0
  116. package/vendor/cli/vendor/desktop/lib/local/worktree-lock.js +232 -0
  117. package/vendor/cli/vendor/desktop/lib/settings.js +846 -0
  118. package/vendor/cli/vendor/desktop/renderer/usage.js +964 -0
  119. package/vendor/cli/vendor/hosts/install.js +638 -0
  120. package/vendor/cli/vendor/hosts/openai-shim.js +516 -0
  121. package/vendor/cli/vendor/hosts/spec.js +164 -0
  122. package/vendor/cli/vendor/hosts/targets.js +346 -0
  123. package/vendor/cli/vendor/mcp/server.js +219 -0
  124. package/vendor/cli/vendor/mcp/tools.js +405 -0
  125. package/vendor/cli/vendor/tools/agent-gate.mjs +1180 -0
  126. package/vendor/desktop/README.md +365 -0
  127. package/vendor/desktop/bin/aegis.js +30 -0
  128. package/vendor/desktop/lib/auto.js +423 -0
  129. package/vendor/desktop/lib/avatar/companion.js +695 -0
  130. package/vendor/desktop/lib/avatar/cosmetics.js +529 -0
  131. package/vendor/desktop/lib/avatar/events.js +341 -0
  132. package/vendor/desktop/lib/avatar/holder-turn.js +347 -0
  133. package/vendor/desktop/lib/avatar/holders.js +609 -0
  134. package/vendor/desktop/lib/avatar/identity.js +638 -0
  135. package/vendor/desktop/lib/avatar/level.js +365 -0
  136. package/vendor/desktop/lib/avatar/mirror.js +521 -0
  137. package/vendor/desktop/lib/avatar/packs/README.md +47 -0
  138. package/vendor/desktop/lib/avatar/packs/core-wardrobe.pack.json +15 -0
  139. package/vendor/desktop/lib/avatar/packs/local-voice-core.pack.json +16 -0
  140. package/vendor/desktop/lib/avatar/packs/seasonal-winter.pack.json +14 -0
  141. package/vendor/desktop/lib/avatar/persona.js +385 -0
  142. package/vendor/desktop/lib/avatar/profile.js +974 -0
  143. package/vendor/desktop/lib/avatar/register.js +304 -0
  144. package/vendor/desktop/lib/avatar/store.js +469 -0
  145. package/vendor/desktop/lib/avatar/tiers.js +35 -0
  146. package/vendor/desktop/lib/avatar/transfer.js +412 -0
  147. package/vendor/desktop/lib/avatar/turn.js +213 -0
  148. package/vendor/desktop/lib/avatar/voice.js +325 -0
  149. package/vendor/desktop/lib/avatar/xp.js +401 -0
  150. package/vendor/desktop/lib/deep-link.js +83 -0
  151. package/vendor/desktop/lib/fingerprint.js +327 -0
  152. package/vendor/desktop/lib/local/aegis-seal.mjs +236 -0
  153. package/vendor/desktop/lib/local/agents.js +102 -0
  154. package/vendor/desktop/lib/local/autonomous.js +921 -0
  155. package/vendor/desktop/lib/local/context.js +92 -0
  156. package/vendor/desktop/lib/local/covenant.js +562 -0
  157. package/vendor/desktop/lib/local/engine.js +2155 -0
  158. package/vendor/desktop/lib/local/entitlement.js +651 -0
  159. package/vendor/desktop/lib/local/git-scope.js +225 -0
  160. package/vendor/desktop/lib/local/local.js +2132 -0
  161. package/vendor/desktop/lib/local/prompt.js +242 -0
  162. package/vendor/desktop/lib/local/queue.js +557 -0
  163. package/vendor/desktop/lib/local/session-rounds.js +205 -0
  164. package/vendor/desktop/lib/local/shell.js +603 -0
  165. package/vendor/desktop/lib/local/telemetry.js +467 -0
  166. package/vendor/desktop/lib/local/tools.js +1197 -0
  167. package/vendor/desktop/lib/local/turn-guard.js +297 -0
  168. package/vendor/desktop/lib/local/worktree-lock.js +232 -0
  169. package/vendor/desktop/lib/provider-key-mirror.js +136 -0
  170. package/vendor/desktop/lib/quick-launcher.js +81 -0
  171. package/vendor/desktop/lib/settings.js +846 -0
  172. package/vendor/desktop/lib/sync/memory-queue.js +57 -0
  173. package/vendor/desktop/lib/sync/persist-gate.js +145 -0
  174. package/vendor/desktop/lib/sync/sessions.js +103 -0
  175. package/vendor/desktop/lib/window-state.js +63 -0
  176. package/vendor/desktop/main.js +3727 -0
  177. package/vendor/desktop/package.json +70 -0
  178. package/vendor/desktop/preload.js +557 -0
  179. package/vendor/desktop/renderer/app.js +5085 -0
  180. package/vendor/desktop/renderer/avatar/assemble.js +332 -0
  181. package/vendor/desktop/renderer/avatar/avatar.css +260 -0
  182. package/vendor/desktop/renderer/avatar/avatar.js +377 -0
  183. package/vendor/desktop/renderer/avatar/cards.js +138 -0
  184. package/vendor/desktop/renderer/avatar/hud.js +203 -0
  185. package/vendor/desktop/renderer/avatar/machine.js +210 -0
  186. package/vendor/desktop/renderer/avatar/pane.js +436 -0
  187. package/vendor/desktop/renderer/avatar/parts.js +434 -0
  188. package/vendor/desktop/renderer/budget.js +156 -0
  189. package/vendor/desktop/renderer/diff.js +356 -0
  190. package/vendor/desktop/renderer/diffview.js +333 -0
  191. package/vendor/desktop/renderer/fingerprint.css +143 -0
  192. package/vendor/desktop/renderer/fingerprint.js +583 -0
  193. package/vendor/desktop/renderer/fonts/4iCs6KVjbNBYlgoKcQ72j00.woff2 +0 -0
  194. package/vendor/desktop/renderer/fonts/4iCs6KVjbNBYlgoKcg72j00.woff2 +0 -0
  195. package/vendor/desktop/renderer/fonts/4iCs6KVjbNBYlgoKcw72j00.woff2 +0 -0
  196. package/vendor/desktop/renderer/fonts/4iCs6KVjbNBYlgoKew72j00.woff2 +0 -0
  197. package/vendor/desktop/renderer/fonts/4iCs6KVjbNBYlgoKfA72j00.woff2 +0 -0
  198. package/vendor/desktop/renderer/fonts/4iCs6KVjbNBYlgoKfw72.woff2 +0 -0
  199. package/vendor/desktop/renderer/fonts/4iCu6KVjbNBYlgoKej70l0k.woff2 +0 -0
  200. package/vendor/desktop/renderer/fonts/4iCu6KVjbNBYlgoKej73l0mwFg.woff2 +0 -0
  201. package/vendor/desktop/renderer/fonts/4iCu6KVjbNBYlgoKej74l0mwFg.woff2 +0 -0
  202. package/vendor/desktop/renderer/fonts/4iCu6KVjbNBYlgoKej75l0mwFg.woff2 +0 -0
  203. package/vendor/desktop/renderer/fonts/4iCu6KVjbNBYlgoKej76l0mwFg.woff2 +0 -0
  204. package/vendor/desktop/renderer/fonts/4iCu6KVjbNBYlgoKej7wl0mwFg.woff2 +0 -0
  205. package/vendor/desktop/renderer/fonts/4iCv6KVjbNBYlgoCjC3js2yNL4U.woff2 +0 -0
  206. package/vendor/desktop/renderer/fonts/4iCv6KVjbNBYlgoCjC3jsGyN.woff2 +0 -0
  207. package/vendor/desktop/renderer/fonts/4iCv6KVjbNBYlgoCjC3jtGyNL4U.woff2 +0 -0
  208. package/vendor/desktop/renderer/fonts/4iCv6KVjbNBYlgoCjC3jvGyNL4U.woff2 +0 -0
  209. package/vendor/desktop/renderer/fonts/4iCv6KVjbNBYlgoCjC3jvWyNL4U.woff2 +0 -0
  210. package/vendor/desktop/renderer/fonts/4iCv6KVjbNBYlgoCjC3jvmyNL4U.woff2 +0 -0
  211. package/vendor/desktop/renderer/fonts/4iCv6KVjbNBYlgoCxCvjs2yNL4U.woff2 +0 -0
  212. package/vendor/desktop/renderer/fonts/4iCv6KVjbNBYlgoCxCvjsGyN.woff2 +0 -0
  213. package/vendor/desktop/renderer/fonts/4iCv6KVjbNBYlgoCxCvjtGyNL4U.woff2 +0 -0
  214. package/vendor/desktop/renderer/fonts/4iCv6KVjbNBYlgoCxCvjvGyNL4U.woff2 +0 -0
  215. package/vendor/desktop/renderer/fonts/4iCv6KVjbNBYlgoCxCvjvWyNL4U.woff2 +0 -0
  216. package/vendor/desktop/renderer/fonts/4iCv6KVjbNBYlgoCxCvjvmyNL4U.woff2 +0 -0
  217. package/vendor/desktop/renderer/fonts/8vIH7w4qzmVxm25L9Hz_.woff2 +0 -0
  218. package/vendor/desktop/renderer/fonts/8vIH7w4qzmVxm2BL9A.woff2 +0 -0
  219. package/vendor/desktop/renderer/fonts/8vIH7w4qzmVxm2NL9Hz_.woff2 +0 -0
  220. package/vendor/desktop/renderer/fonts/NOTICE.md +57 -0
  221. package/vendor/desktop/renderer/fonts/aFTR7PB1QTsUX8KYvrGyEY2tbZX9.woff2 +0 -0
  222. package/vendor/desktop/renderer/fonts/aFTR7PB1QTsUX8KYvrGyEYOtbQ.woff2 +0 -0
  223. package/vendor/desktop/renderer/fonts/aFTR7PB1QTsUX8KYvumzEY2tbZX9.woff2 +0 -0
  224. package/vendor/desktop/renderer/fonts/aFTR7PB1QTsUX8KYvumzEYOtbQ.woff2 +0 -0
  225. package/vendor/desktop/renderer/fonts/aFTU7PB1QTsUX8KYthSQBLyM.woff2 +0 -0
  226. package/vendor/desktop/renderer/fonts/aFTU7PB1QTsUX8KYthqQBA.woff2 +0 -0
  227. package/vendor/desktop/renderer/fonts/aFTW7PB1QTsUX8KYth-gBqSI.woff2 +0 -0
  228. package/vendor/desktop/renderer/fonts/aFTW7PB1QTsUX8KYth-gCKSIUKw.woff2 +0 -0
  229. package/vendor/desktop/renderer/fonts/fonts.css +368 -0
  230. package/vendor/desktop/renderer/index.html +864 -0
  231. package/vendor/desktop/renderer/markdown.js +165 -0
  232. package/vendor/desktop/renderer/quick.css +151 -0
  233. package/vendor/desktop/renderer/quick.html +42 -0
  234. package/vendor/desktop/renderer/quick.js +188 -0
  235. package/vendor/desktop/renderer/stream-policy.js +281 -0
  236. package/vendor/desktop/renderer/style.css +2519 -0
  237. package/vendor/desktop/renderer/transcript-view.js +320 -0
  238. package/vendor/desktop/renderer/usage.js +964 -0
  239. package/vendor/desktop/renderer/vendor/NOTICE.md +20 -0
  240. package/vendor/desktop/renderer/vendor/aegis-highlight.js +135 -0
  241. package/vendor/desktop/renderer/vendor/marked.umd.js +80 -0
  242. package/vendor/desktop/renderer/vendor/purify.min.js +3 -0
  243. package/vendor/desktop/vendor/aegis.js +1744 -0
  244. package/vendor/desktop/vendor/agent-gate.mjs +1180 -0
  245. package/vendor/desktop/vendor/attest.js +439 -0
  246. package/vendor/desktop/vendor/authorship-key.js +407 -0
  247. package/vendor/desktop/vendor/auto-provision.js +59 -0
  248. package/vendor/desktop/vendor/brain-catalog.js +265 -0
  249. package/vendor/desktop/vendor/byok-catalog.js +192 -0
  250. package/vendor/desktop/vendor/covenant/README.md +21 -0
  251. package/vendor/desktop/vendor/covenant/aegis.seal +177 -0
  252. package/vendor/desktop/vendor/credentials.js +478 -0
  253. package/vendor/desktop/vendor/device-fingerprint.js +145 -0
  254. package/vendor/desktop/vendor/env-file.js +1016 -0
  255. package/vendor/desktop/vendor/fingerprint.js +1061 -0
  256. package/vendor/desktop/vendor/foreign-memory.js +666 -0
  257. package/vendor/desktop/vendor/hooks.js +427 -0
  258. package/vendor/desktop/vendor/platform.js +934 -0
  259. package/vendor/desktop/vendor/prefs.js +348 -0
  260. package/vendor/desktop/vendor/presence-constants.js +104 -0
  261. package/vendor/desktop/vendor/presence.js +435 -0
  262. package/vendor/desktop/vendor/record-vault.js +834 -0
  263. package/vendor/desktop/vendor/session-store.js +545 -0
  264. package/vendor/desktop/vendor/topup.js +294 -0
  265. package/vendor/desktop/vendor/touch.js +455 -0
  266. package/vendor/desktop/vendor/update.js +343 -0
package/install.sh ADDED
@@ -0,0 +1,178 @@
1
+ #!/bin/sh
2
+ # AEGISONE installer — plan ON6 (D2, D3).
3
+ #
4
+ # Two steps, in this order:
5
+ # 1. the npm path: `npm i -g <product>` installs the terminal face and the
6
+ # window face from one tarball;
7
+ # 2. the OS bundle for the window, named by `scripts/bundle.js`, which asks
8
+ # `client/platform.js` which OS this is. This script branches on no OS at
9
+ # all — there is no `uname`, no `$OSTYPE`, no `%OS%` in it.
10
+ #
11
+ # The rule that matters, and the reason this file is longer than three lines:
12
+ # **Electron is optional and its absence is not a failure.** When Electron
13
+ # cannot be installed the installer still exits 0, with a working terminal face
14
+ # and the one line the user needs — `aegis --tui`. It never fails, and it never
15
+ # leaves the user staring at "nothing happened".
16
+ #
17
+ # Faces (D3):
18
+ # AEGISONE_FACE=cli terminal only — Electron is never attempted
19
+ # AEGISONE_FACE=gui the window if Electron can be installed, the terminal
20
+ # (plus the --tui line) if it cannot
21
+ # default gui: the window when it is possible, never a no-op
22
+ #
23
+ # Spellings honoured afterwards: `aegis` (dispatch) · `aegis desktop` (force the
24
+ # window) · `aegis code` / `aegis --tui` (force the terminal) · `aegiscode` (the
25
+ # compatibility bin, unchanged).
26
+ #
27
+ # Test seam, used by CI and by `one/test/one-compat.test.mjs`:
28
+ # AEGISONE_ELECTRON_FORCE_ABSENT=1 simulate "Electron cannot be installed
29
+ # here" without touching the host.
30
+ set -eu
31
+
32
+ HERE=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
33
+ FACE=${AEGISONE_FACE:-gui}
34
+ FROM=${AEGISONE_PACKAGE:-aegisone}
35
+ PREFIX=${AEGISONE_PREFIX:-}
36
+ DRY_RUN=0
37
+
38
+ usage() {
39
+ cat <<'USAGE'
40
+ usage: install.sh [--face cli|gui] [--from <package|tarball>] [--prefix DIR] [--dry-run]
41
+
42
+ --face cli|gui which face to set up (default: gui; also AEGISONE_FACE)
43
+ --from <spec> what to install (default: aegisone; also AEGISONE_PACKAGE)
44
+ --prefix DIR install into DIR instead of the global prefix (also
45
+ AEGISONE_PREFIX) — how CI and the ON6 evidence run this
46
+ installer without touching the machine it runs on
47
+ --dry-run print every command and change nothing
48
+ USAGE
49
+ }
50
+
51
+ while [ $# -gt 0 ]; do
52
+ case "$1" in
53
+ --face)
54
+ [ $# -ge 2 ] || { usage >&2; exit 2; }
55
+ FACE=$2
56
+ shift 2
57
+ ;;
58
+ --from)
59
+ [ $# -ge 2 ] || { usage >&2; exit 2; }
60
+ FROM=$2
61
+ shift 2
62
+ ;;
63
+ --prefix)
64
+ [ $# -ge 2 ] || { usage >&2; exit 2; }
65
+ PREFIX=$2
66
+ shift 2
67
+ ;;
68
+ --dry-run) DRY_RUN=1; shift ;;
69
+ -h|--help) usage; exit 0 ;;
70
+ *) printf 'install: unknown option: %s\n' "$1" >&2; usage >&2; exit 2 ;;
71
+ esac
72
+ done
73
+
74
+ NPM_ARGS="install -g"
75
+ if [ -n "$PREFIX" ]; then
76
+ NPM_ARGS="$NPM_ARGS --prefix $PREFIX"
77
+ fi
78
+
79
+ # The face env var is honoured whatever its case; `tui` is accepted because D3
80
+ # spells the face both ways (`--tui` on the command, `cli` in the env).
81
+ FACE=$(printf '%s' "$FACE" | tr '[:upper:]' '[:lower:]')
82
+ case "$FACE" in
83
+ cli|tui) FACE=cli ;;
84
+ gui|desktop) FACE=gui ;;
85
+ *) printf 'install: AEGISONE_FACE/--face must be cli or gui (got: %s)\n' "$FACE" >&2; exit 2 ;;
86
+ esac
87
+
88
+ step() {
89
+ if [ "$DRY_RUN" = "1" ]; then
90
+ printf 'would run: %s\n' "$*"
91
+ return 0
92
+ fi
93
+ "$@"
94
+ }
95
+
96
+ # The OS bundle for the window, named by the platform seam — never by a shell
97
+ # OS test. `bundle.mjs` prints one line; if Node is missing we cannot run it and
98
+ # the product cannot run either, so that case is handled by its caller.
99
+ bundle_line() {
100
+ if command -v node >/dev/null 2>&1 && [ -f "$HERE/scripts/bundle.js" ]; then
101
+ node "$HERE/scripts/bundle.js" 2>/dev/null || printf 'AEGIS Desktop: https://github.com/aegiscloud-devs/aegiscode-plugin/releases\n'
102
+ else
103
+ printf 'AEGIS Desktop: https://github.com/aegiscloud-devs/aegiscode-plugin/releases\n'
104
+ fi
105
+ }
106
+
107
+ # ── Node is not optional for the npm path ────────────────────────────────────
108
+ if ! command -v node >/dev/null 2>&1; then
109
+ printf 'install: Node.js >= 18 was not found on PATH, so the npm path and the terminal face are unavailable here.\n' >&2
110
+ printf 'install: the window ships as a bundle that needs no Node — install it from:\n' >&2
111
+ bundle_line >&2
112
+ exit 1
113
+ fi
114
+
115
+ if ! command -v npm >/dev/null 2>&1; then
116
+ printf 'install: npm was not found on PATH (Node.js is present: %s).\n' "$(node --version)" >&2
117
+ printf 'install: the npm path is how AEGISONE is installed; see https://nodejs.org and re-run.\n' >&2
118
+ exit 1
119
+ fi
120
+
121
+ # The Electron requirement is *carried*, not re-invented here: it is read out of
122
+ # one/package.json's `optionalDependencies`, the same declaration the desktop
123
+ # package has carried since before AEGISONE existed. A second, hand-typed range
124
+ # in this script is exactly the drift ON6 exists to prevent.
125
+ ELECTRON_RANGE=$(node -e "try{const p=require(process.argv[1]);process.stdout.write((p.optionalDependencies&&p.optionalDependencies.electron)||'')}catch(e){}" "$HERE/package.json" 2>/dev/null || true)
126
+ if [ -z "$ELECTRON_RANGE" ]; then
127
+ ELECTRON_RANGE=$(node -e "try{process.stdout.write(require(process.argv[1]).optionalDependencies.electron)}catch(e){}" "$HERE/../desktop/package.json" 2>/dev/null || true)
128
+ fi
129
+
130
+ printf 'AEGISONE: installing %s (face: %s)\n' "$FROM" "$FACE"
131
+ step npm $NPM_ARGS "$FROM" || {
132
+ printf 'install: npm could not install %s.\n' "$FROM" >&2
133
+ printf 'install: for the window with no npm at all, use the OS bundle:\n' >&2
134
+ bundle_line >&2
135
+ exit 1
136
+ }
137
+
138
+ # ── The window: best effort, never fatal ────────────────────────────────────
139
+ ELECTRON_OK=0
140
+ if [ "$FACE" = "gui" ]; then
141
+ if [ "${AEGISONE_ELECTRON_FORCE_ABSENT:-0}" = "1" ]; then
142
+ printf 'install: Electron is unavailable on this machine (AEGISONE_ELECTRON_FORCE_ABSENT=1).\n'
143
+ elif [ -n "$ELECTRON_RANGE" ]; then
144
+ if step npm $NPM_ARGS "electron@$ELECTRON_RANGE"; then
145
+ ELECTRON_OK=1
146
+ fi
147
+ fi
148
+ fi
149
+
150
+ if [ "$FACE" = "gui" ] && [ "$ELECTRON_OK" = "1" ]; then
151
+ printf '\nAEGISONE is installed.\n'
152
+ printf ' aegis open the window (terminal when there is no display)\n'
153
+ printf ' aegis desktop force the window\n'
154
+ printf ' aegis code force the terminal\n'
155
+ printf ' aegis --tui the same, spelled the other way\n'
156
+ printf ' aegis doctor check this install (exit 0 when healthy)\n'
157
+ exit 0
158
+ fi
159
+
160
+ if [ "$FACE" = "cli" ]; then
161
+ printf '\nAEGISONE is installed with the terminal face only (AEGISONE_FACE=cli).\n'
162
+ printf ' aegis --tui run the terminal face\n'
163
+ printf ' aegis code the same, spelled the other way\n'
164
+ printf ' aegis doctor check this install (exit 0 when healthy)\n'
165
+ printf ' aegis desktop will refuse with exit 2 and name --tui until Electron is installed\n'
166
+ exit 0
167
+ fi
168
+
169
+ # Electron could not be installed. This is the whole point of ON6's installer:
170
+ # the user gets a working product and one clear line, never a failure and never
171
+ # silence.
172
+ printf '\nAEGISONE is installed, with the terminal face.\n'
173
+ printf 'aegis: the window needs Electron and it could not be installed here — everything else works.\n'
174
+ printf 'aegis: run `aegis --tui` (or `aegis code`) for the terminal face.\n'
175
+ printf 'aegis: `aegis desktop` will refuse with exit 2 and name --tui while Electron is missing.\n'
176
+ printf 'aegis: for the window, install the OS bundle:\n'
177
+ bundle_line
178
+ exit 0
package/package.json CHANGED
@@ -1,6 +1,46 @@
1
1
  {
2
2
  "name": "aegisone",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "productName": "AEGISONE",
4
+ "version": "1.0.4",
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
+ "author": {
7
+ "name": "AEGIS Code",
8
+ "email": "nborneklint@gmail.com"
9
+ },
10
+ "license": "AGPL-3.0-or-later",
11
+ "homepage": "https://aegiscloud.org",
12
+ "bin": {
13
+ "aegis": "bin/aegis.js"
14
+ },
15
+ "files": [
16
+ "bin",
17
+ "src",
18
+ "scripts",
19
+ "install.sh",
20
+ "install.ps1",
21
+ "vendor",
22
+ "README.md"
23
+ ],
24
+ "engines": {
25
+ "node": ">=18.0.0"
26
+ },
27
+ "scripts": {
28
+ "predist": "node scripts/predist.mjs",
29
+ "prepublishOnly": "npm run predist",
30
+ "bump": "node scripts/bump.mjs",
31
+ "compat": "node test/one-compat.test.mjs",
32
+ "size": "node scripts/bundle.mjs --json"
33
+ },
34
+ "optionalDependencies": {
35
+ "electron": "^33.0.0"
36
+ },
37
+ "keywords": [
38
+ "aegis",
39
+ "aegisone",
40
+ "aegiscode",
41
+ "aegiscloud",
42
+ "cli",
43
+ "desktop",
44
+ "llm"
45
+ ]
46
+ }
@@ -0,0 +1,184 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * AEGISONE — the bump: ONE command, ONE version, three manifests, one README
4
+ * line (plan D4, ON3 step 1).
5
+ *
6
+ * The commit this replaces read
7
+ * `chore(release): aegis-desktop 0.8.28, aegiscode 6.8.30` — three hand-typed
8
+ * numbers, kept in step by whoever was cutting the release. Every failure mode
9
+ * of that was real: a face bumped but not the product, a product tag with a
10
+ * stale face, a desktop version that disagrees with the README the tag ships
11
+ * with. This script computes all four from `one/package.json` and the
12
+ * derivation in `one/src/release.js`, so there is nothing left to remember.
13
+ *
14
+ * node one/scripts/bump.mjs 1.0.1 # set the product version
15
+ * node one/scripts/bump.mjs patch # ...or let it do the arithmetic
16
+ * node one/scripts/bump.mjs 1.0.1 --dry-run # print the diff, write nothing
17
+ *
18
+ * It REFUSES to bump a tree that is already inconsistent with the product
19
+ * version it carries: a bump is not a repair, and silently overwriting drift
20
+ * would destroy the evidence of how it happened. Fix the drift, then bump.
21
+ *
22
+ * Everything under `one/` obeys the Phase 30.1 seam rule: no `process.*` read
23
+ * at module scope, all IO behind `main(argv, io)`, so importing this file in a
24
+ * test stages and writes nothing.
25
+ */
26
+
27
+ import fs from 'node:fs';
28
+ import path from 'node:path';
29
+ import { fileURLToPath } from 'node:url';
30
+ import { createRequire } from 'node:module';
31
+
32
+ const HERE = path.dirname(fileURLToPath(import.meta.url));
33
+ const require = createRequire(import.meta.url);
34
+ const release = require('../src/release.js');
35
+
36
+ /** Repo root — `one/scripts/` -> `one/` -> repo. */
37
+ export const ROOT = path.join(HERE, '..', '..');
38
+
39
+ /**
40
+ * The four documents a bump writes, in the order a reviewer reads them: the
41
+ * source of truth first, then the line in the product README that ships with
42
+ * the tag, then the two derived faces.
43
+ */
44
+ export function bumpTargets(root) {
45
+ const dir = root || ROOT;
46
+ return [
47
+ { file: 'one/package.json', kind: 'json', abs: path.join(dir, 'one', 'package.json') },
48
+ { file: 'one/README.md', kind: 'readme', abs: path.join(dir, 'one', 'README.md') },
49
+ { file: 'cli/package.json', kind: 'json', abs: path.join(dir, 'cli', 'package.json') },
50
+ { file: 'desktop/package.json', kind: 'json', abs: path.join(dir, 'desktop', 'package.json') }
51
+ ];
52
+ }
53
+
54
+ /**
55
+ * Build the plan for a bump: read the four documents, compute every new version
56
+ * from the derivation, and hand back the exact new contents.
57
+ *
58
+ * @param {{root?: string, version: string, io?: object, read?: Function}} input
59
+ * @returns {{version: string, faces: object, files: Array<object>, changed: number}}
60
+ */
61
+ export function plan(input) {
62
+ const src = input || {};
63
+ const root = src.root || ROOT;
64
+ const read = src.read || ((abs) => fs.readFileSync(abs, 'utf8'));
65
+ const version = release.parseVersion(src.version).text;
66
+
67
+ const targets = bumpTargets(root);
68
+ const faces = release.deriveFaceVersions(version);
69
+ // Who gets which number: the product manifest and the README carry the
70
+ // product version; each face carries the version derived for it.
71
+ const versionFor = (file) => {
72
+ if (file === 'one/package.json' || file === 'one/README.md') return version;
73
+ if (file === 'cli/package.json') return faces.aegiscode.version;
74
+ if (file === 'desktop/package.json') return faces['aegis-desktop'].version;
75
+ throw new Error(`no version rule for ${file}`);
76
+ };
77
+ const documents = targets.map((t) => ({
78
+ file: t.file,
79
+ kind: t.kind,
80
+ content: read(t.abs),
81
+ version: versionFor(t.file)
82
+ }));
83
+
84
+ // Refuse a tree that is already drifting: the manifests must equal what the
85
+ // derivation says for the product version they carry today, or a bump would
86
+ // launder the drift into "the new version".
87
+ const currentProduct = JSON.parse(documents[0].content).version;
88
+ const expected = release.deriveFaceVersions(currentProduct);
89
+ for (const doc of documents.slice(2)) {
90
+ const name = JSON.parse(doc.content).name;
91
+ const want = expected[name];
92
+ if (!want) throw new Error(`${doc.file}: unexpected package name ${JSON.stringify(name)}`);
93
+ const got = JSON.parse(doc.content).version;
94
+ if (got !== want.version) {
95
+ throw new Error(
96
+ `${doc.file} carries ${name} ${got}, but product ${currentProduct} derives ${want.version} — ` +
97
+ 'the tree is already inconsistent; run `node test/one-version.test.mjs` to see all of it, ' +
98
+ 'then bump from a clean state'
99
+ );
100
+ }
101
+ }
102
+
103
+ const files = release.planBump({ version, documents });
104
+ return {
105
+ version,
106
+ from: currentProduct,
107
+ faces,
108
+ files,
109
+ changed: files.filter((f) => !f.unchanged).length
110
+ };
111
+ }
112
+
113
+ /**
114
+ * CLI entry. `argv` and the streams are parameters; the process is read here and
115
+ * nowhere at module scope.
116
+ */
117
+ export function main(argv, io) {
118
+ const o = io || {};
119
+ const out = o.stdout || process.stdout;
120
+ const errOut = o.stderr || process.stderr;
121
+ const args = (Array.isArray(argv) ? argv : []).map(String);
122
+ const dryRun = args.includes('--dry-run');
123
+ const positional = args.filter((a) => !a.startsWith('--'));
124
+ if (positional.length !== 1) {
125
+ errOut.write('usage: node one/scripts/bump.mjs <major|minor|patch|X.Y.Z> [--dry-run]\n');
126
+ return 2;
127
+ }
128
+
129
+ let built;
130
+ try {
131
+ const current = JSON.parse(fs.readFileSync(path.join(ROOT, 'one', 'package.json'), 'utf8')).version;
132
+ built = plan({ root: ROOT, version: release.nextVersion(current, positional[0]) });
133
+ } catch (error) {
134
+ errOut.write(`bump: ${(error && error.message) || error}\n`);
135
+ return 1;
136
+ }
137
+
138
+ let written = 0;
139
+ for (const file of built.files) {
140
+ if (file.unchanged) continue;
141
+ if (dryRun) {
142
+ out.write(release.unifiedDiff(file.before, file.content, file.file));
143
+ } else {
144
+ fs.writeFileSync(path.join(ROOT, file.file), file.content);
145
+ written++;
146
+ }
147
+ }
148
+
149
+ if (dryRun) {
150
+ out.write(
151
+ `bump: dry run — ${built.from} -> ${built.version}; ` +
152
+ `aegiscode ${built.faces.aegiscode.version}, aegis-desktop ${built.faces['aegis-desktop'].version}; ` +
153
+ 'nothing written\n'
154
+ );
155
+ } else {
156
+ out.write(
157
+ `bump: ${built.from} -> ${built.version} (aegiscode ${built.faces.aegiscode.version}, ` +
158
+ `aegis-desktop ${built.faces['aegis-desktop'].version}) — ${written} file(s) written\n`
159
+ );
160
+ }
161
+ return 0;
162
+ }
163
+
164
+ /**
165
+ * Run when — and only when — this file was started directly. The process reads
166
+ * live inside a function on purpose: `one/`'s seam rule forbids them at module
167
+ * scope, and this is the file that would have broken it.
168
+ */
169
+ function runIfDirect() {
170
+ const entry = process.argv[1];
171
+ let direct = false;
172
+ if (entry) {
173
+ try {
174
+ direct = path.resolve(entry) === fileURLToPath(import.meta.url);
175
+ } catch {
176
+ direct = false;
177
+ }
178
+ }
179
+ if (!direct) return false;
180
+ process.exitCode = main(process.argv.slice(2));
181
+ return true;
182
+ }
183
+
184
+ runIfDirect();
@@ -0,0 +1,126 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * bundle.js — which OS bundle a user needs for the window, and where it is.
5
+ *
6
+ * Why this is a Node script and not three lines of shell in `install.sh`:
7
+ * the installers must not become a *second* OS map. `client/platform.js` is the
8
+ * repo's single answer to "which OS is this" (and the stager ships it in both
9
+ * emitted shapes, D6), so the installers ask this script, and this script asks
10
+ * `src/host.js` → `client/platform.js`. The installers themselves branch on no
11
+ * OS at all: no `uname`, no `$OSTYPE`, no `%OS%`, no `process.platform`.
12
+ * `one/test/one-compat.test.mjs` asserts that with a grep.
13
+ *
14
+ * Nothing here is a promise about a build that exists: the artifact name comes
15
+ * from `desktop/electron-builder.yml`'s `artifactName`
16
+ * (`aegis-desktop-${version}-${os}-${arch}.${ext}`), the version from the face
17
+ * manifest beside this package (or the D4 derivation when it is not there), and
18
+ * the tag from `src/release.js`. The line printed names the release page rather
19
+ * than guessing an arch-specific URL that may not have been built.
20
+ *
21
+ * CommonJS, deliberately: everything in `one/` that runs is CJS (see
22
+ * `bin/aegis.js`, `src/*.js`); only the build-time stager and bump script are
23
+ * ESM. `install.sh` and `install.ps1` both shell out to this file by path.
24
+ *
25
+ * Usage: node one/scripts/bundle.js [--platform linux|darwin|win32] [--json]
26
+ */
27
+
28
+ const fs = require('node:fs');
29
+ const path = require('node:path');
30
+
31
+ const host = require('../src/host.js');
32
+ const release = require('../src/release.js');
33
+
34
+ const RELEASES = 'https://github.com/aegiscloud-devs/aegiscode-plugin/releases';
35
+
36
+ /**
37
+ * The electron-builder OS token and installer extension for a platform.
38
+ *
39
+ * The platform VALUE is never read from the process here — it arrives as an
40
+ * argument (from `--platform`, or from `src/host.js` → `client/platform.js`),
41
+ * and the Windows branch is taken from the seam's own `win32` flag rather than
42
+ * from a second `=== 'win32'` comparison.
43
+ *
44
+ * @param {object} [facts] `{ platform, win32 }` as `client/platform.js` gives it
45
+ */
46
+ function bundleFor(facts) {
47
+ const f = facts || {};
48
+ if (f.win32) return { os: 'win', ext: 'exe', bundle: 'NSIS installer' };
49
+ if (f.platform === 'darwin') return { os: 'mac', ext: 'dmg', bundle: 'disk image' };
50
+ if (f.platform === 'linux') return { os: 'linux', ext: 'AppImage', bundle: 'AppImage' };
51
+ // A platform electron-builder does not build for. Say so instead of printing a
52
+ // URL for an artifact that was never produced.
53
+ return { os: f.platform || 'unknown', ext: null, bundle: null };
54
+ }
55
+
56
+ /** The desktop face version actually beside this package, or the D4 derivation. */
57
+ function desktopVersion(dirs) {
58
+ for (const dir of dirs || []) {
59
+ try {
60
+ return JSON.parse(fs.readFileSync(path.join(dir, 'package.json'), 'utf8')).version;
61
+ } catch {
62
+ /* try the next layout */
63
+ }
64
+ }
65
+ const face = release.FACE_LINES.find((f) => f.dir === 'desktop');
66
+ return release.deriveFaceVersion(require('../package.json').version, face);
67
+ }
68
+
69
+ /** The two layouts a face manifest can be in, nearest first (same rule as bin/aegis.js). */
70
+ function faceDirs() {
71
+ return [
72
+ path.join(__dirname, '..', 'vendor', 'desktop'),
73
+ path.join(__dirname, '..', '..', 'desktop')
74
+ ];
75
+ }
76
+
77
+ /**
78
+ * The line an installer prints: one sentence, one URL, no invented artifact.
79
+ *
80
+ * @param {object} [deps] injected for tests: { facts, product, faceVersion, dirs, platform }
81
+ */
82
+ function describe(deps) {
83
+ const d = deps || {};
84
+ const facts = d.facts || host.hostSeams({ platform: d.platform });
85
+ const product = d.product || require('../package.json').version;
86
+ const faceVersion = d.faceVersion || desktopVersion(d.dirs || faceDirs());
87
+ const target = bundleFor(facts);
88
+ const tag = release.tagFor(product);
89
+ if (!target.ext) {
90
+ return `AEGIS Desktop: no prebuilt bundle for ${target.os} — ${RELEASES}/tag/${tag}`;
91
+ }
92
+ return (
93
+ `AEGIS Desktop ${faceVersion} for ${target.os} (${target.bundle}) — ${RELEASES}/tag/${tag} ` +
94
+ `(asset: aegis-desktop-${faceVersion}-${target.os}-*.${target.ext})`
95
+ );
96
+ }
97
+
98
+ function main(argv) {
99
+ const args = argv || [];
100
+ let platform;
101
+ let json = false;
102
+ for (let i = 0; i < args.length; i++) {
103
+ if (args[i] === '--platform') platform = args[++i];
104
+ else if (args[i] === '--json') json = true;
105
+ }
106
+ const facts = host.hostSeams({ platform });
107
+ const product = require('../package.json').version;
108
+ const faceVersion = desktopVersion(faceDirs());
109
+ const target = bundleFor(facts);
110
+ if (json) {
111
+ process.stdout.write(
112
+ JSON.stringify(
113
+ { platform: facts.platform, product, faceVersion, tag: release.tagFor(product), os: target.os, ext: target.ext },
114
+ null,
115
+ 2
116
+ ) + '\n'
117
+ );
118
+ } else {
119
+ process.stdout.write(describe({ facts, product, faceVersion }) + '\n');
120
+ }
121
+ return 0;
122
+ }
123
+
124
+ module.exports = { bundleFor, describe, desktopVersion, faceDirs, main, RELEASES };
125
+
126
+ if (require.main === module) process.exitCode = main(process.argv.slice(2));