aegisone 1.0.10 → 1.0.16

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 (36) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/scripts/predist.mjs +19 -0
  4. package/src/child.js +121 -2
  5. package/vendor/cli/package.json +3 -2
  6. package/vendor/cli/src/app.js +176 -13
  7. package/vendor/cli/src/chatflow.js +193 -38
  8. package/vendor/cli/src/commands.js +82 -4
  9. package/vendor/cli/src/deps.js +29 -2
  10. package/vendor/cli/src/engine.js +8 -1
  11. package/vendor/cli/src/models.js +78 -3
  12. package/vendor/cli/src/overlays.js +20 -7
  13. package/vendor/cli/src/topup.js +1 -1
  14. package/vendor/cli/vendor/client/aegis.js +119 -5
  15. package/vendor/cli/vendor/client/auto-provision.js +89 -17
  16. package/vendor/cli/vendor/client/credentials.js +8 -2
  17. package/vendor/cli/vendor/client/device-fingerprint.js +1 -8
  18. package/vendor/cli/vendor/client/env-file.js +262 -8
  19. package/vendor/cli/vendor/desktop/lib/local/claude-pro.js +755 -0
  20. package/vendor/cli/vendor/desktop/lib/local/engine.js +329 -12
  21. package/vendor/cli/vendor/mcp/server.js +1 -1
  22. package/vendor/cli/vendor/one/src/child.js +287 -0
  23. package/vendor/cli/vendor/one/src/permissions.js +371 -0
  24. package/vendor/desktop/lib/account-key.js +60 -0
  25. package/vendor/desktop/lib/local/claude-pro.js +755 -0
  26. package/vendor/desktop/lib/local/engine.js +329 -12
  27. package/vendor/desktop/main.js +109 -33
  28. package/vendor/desktop/package.json +4 -3
  29. package/vendor/desktop/preload.js +8 -0
  30. package/vendor/desktop/renderer/app.js +50 -0
  31. package/vendor/desktop/renderer/index.html +11 -0
  32. package/vendor/desktop/vendor/aegis.js +119 -5
  33. package/vendor/desktop/vendor/auto-provision.js +89 -17
  34. package/vendor/desktop/vendor/credentials.js +8 -2
  35. package/vendor/desktop/vendor/device-fingerprint.js +1 -8
  36. package/vendor/desktop/vendor/env-file.js +262 -8
@@ -0,0 +1,60 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
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
+ // SPDX-License-Identifier: AGPL-3.0-or-later
7
+ // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
8
+ 'use strict';
9
+
10
+ /**
11
+ * The desktop's view of whether this machine has an AEGIS account key. When
12
+ * startup could not provision one, the banner says why and offers a retry.
13
+ * Pure: Electron, the store and the provisioner are injected.
14
+ */
15
+
16
+ function createAccountKey({ aegis, credentials, persistKey, provision, describeFailure, onChange }) {
17
+ let failure = null;
18
+ let inFlight = null;
19
+
20
+ function status() {
21
+ if (aegis.apiKey || !failure) return null;
22
+ return { status: 'no-key', reason: failure };
23
+ }
24
+
25
+ function recordStartup(result) {
26
+ failure = (result.key || aegis.apiKey) ? null : describeFailure(result);
27
+ onChange(status());
28
+ }
29
+
30
+ function registerAccount() {
31
+ if (!inFlight) {
32
+ inFlight = (async () => {
33
+ try {
34
+ const result = await provision(aegis, credentials);
35
+ if (result.key) {
36
+ persistKey(result.key);
37
+ failure = null;
38
+ } else {
39
+ failure = describeFailure(result);
40
+ }
41
+ const state = status();
42
+ onChange(state);
43
+ return state;
44
+ } finally {
45
+ inFlight = null;
46
+ }
47
+ })();
48
+ }
49
+ return inFlight;
50
+ }
51
+
52
+ return { status, recordStartup, registerAccount };
53
+ }
54
+
55
+ // A key this host saved on purpose outranks one minted for a fresh device at startup.
56
+ function startupKeyOverride({ mintedKey, hostKey }) {
57
+ return mintedKey && hostKey && hostKey !== mintedKey ? hostKey : null;
58
+ }
59
+
60
+ module.exports = { createAccountKey, startupKeyOverride };