aegiscode 7.0.26 → 7.0.28

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 (118) hide show
  1. package/SOURCE-OFFER.txt +9 -0
  2. package/package.json +4 -7
  3. package/scripts/check.mjs +1 -52
  4. package/scripts/demo.mjs +1 -94
  5. package/scripts/predist.mjs +1 -75
  6. package/scripts/runtests.mjs +1 -56
  7. package/scripts/seal-gate.mjs +1 -74
  8. package/src/agents.js +1 -139
  9. package/src/app.js +1 -2957
  10. package/src/art.js +1 -289
  11. package/src/chatflow.js +1 -3023
  12. package/src/checkpoint.js +1 -90
  13. package/src/clipboard.js +1 -424
  14. package/src/cloudsync.js +1 -528
  15. package/src/commands.js +1 -4089
  16. package/src/config.js +1 -581
  17. package/src/connect.js +1 -349
  18. package/src/credentials.js +1 -33
  19. package/src/deps.js +1 -232
  20. package/src/devrun.js +1 -187
  21. package/src/diff.js +1 -333
  22. package/src/diffview.js +1 -296
  23. package/src/engine.js +1 -297
  24. package/src/entitlement.js +1 -355
  25. package/src/events.js +1 -707
  26. package/src/export.js +1 -67
  27. package/src/filepreview.js +1 -153
  28. package/src/fingerprint.js +1 -592
  29. package/src/format.js +1 -259
  30. package/src/fuzzy.js +1 -119
  31. package/src/history.js +1 -423
  32. package/src/init.js +1 -175
  33. package/src/input.js +1 -139
  34. package/src/keys.js +1 -183
  35. package/src/markdown.js +1 -306
  36. package/src/models.js +1 -507
  37. package/src/naming.js +1 -57
  38. package/src/overlays.js +1 -462
  39. package/src/panels.js +1 -1418
  40. package/src/ping.js +1 -226
  41. package/src/presence.js +1 -238
  42. package/src/render.js +1 -516
  43. package/src/screen.js +1 -518
  44. package/src/screens.js +1 -896
  45. package/src/secret.js +1 -59
  46. package/src/securefs.js +1 -359
  47. package/src/settings.js +1 -155
  48. package/src/shared.js +1 -52
  49. package/src/sharedpaths.js +1 -53
  50. package/src/signup.js +1 -156
  51. package/src/summarize.js +1 -95
  52. package/src/sysdiag.js +1 -585
  53. package/src/system.js +1 -40
  54. package/src/theme.js +1 -570
  55. package/src/title.js +1 -220
  56. package/src/todos.js +1 -115
  57. package/src/tokens.js +1 -263
  58. package/src/topup.js +1 -210
  59. package/src/update.js +1 -191
  60. package/vendor/client/aegis.js +1 -2441
  61. package/vendor/client/attest.js +1 -518
  62. package/vendor/client/authorship-key.js +1 -410
  63. package/vendor/client/auto-provision.js +1 -134
  64. package/vendor/client/brain-catalog.js +1 -268
  65. package/vendor/client/byok-catalog.js +1 -199
  66. package/vendor/client/catalog-client.js +1 -487
  67. package/vendor/client/conversation-export.js +1 -177
  68. package/vendor/client/credentials.js +1 -494
  69. package/vendor/client/device-fingerprint.js +1 -141
  70. package/vendor/client/drive-connect.js +1 -110
  71. package/vendor/client/drive-upload.js +1 -234
  72. package/vendor/client/env-file.js +1 -1273
  73. package/vendor/client/fingerprint.js +1 -1064
  74. package/vendor/client/foreign-memory.js +1 -669
  75. package/vendor/client/google-signin.js +1 -133
  76. package/vendor/client/hooks.js +1 -430
  77. package/vendor/client/model-discovery.js +1 -373
  78. package/vendor/client/naming.js +1 -283
  79. package/vendor/client/platform.js +1 -937
  80. package/vendor/client/prefs.js +1 -351
  81. package/vendor/client/presence-constants.js +1 -107
  82. package/vendor/client/presence.js +1 -438
  83. package/vendor/client/record-vault.js +3 -1055
  84. package/vendor/client/session-store.js +1 -575
  85. package/vendor/client/topup.js +1 -297
  86. package/vendor/client/touch.js +1 -458
  87. package/vendor/client/update.js +1 -763
  88. package/vendor/client/user-models.js +1 -381
  89. package/vendor/desktop/lib/local/agents.js +1 -105
  90. package/vendor/desktop/lib/local/attachments.js +1 -276
  91. package/vendor/desktop/lib/local/autonomous.js +1 -1045
  92. package/vendor/desktop/lib/local/claude-pro.js +1 -1028
  93. package/vendor/desktop/lib/local/context.js +1 -125
  94. package/vendor/desktop/lib/local/engine.js +1 -3666
  95. package/vendor/desktop/lib/local/entitlement.js +1 -660
  96. package/vendor/desktop/lib/local/exec-plan.js +1 -269
  97. package/vendor/desktop/lib/local/git-scope.js +1 -228
  98. package/vendor/desktop/lib/local/integrity.js +1 -163
  99. package/vendor/desktop/lib/local/local.js +1 -2145
  100. package/vendor/desktop/lib/local/prompt.js +1 -280
  101. package/vendor/desktop/lib/local/queue.js +1 -560
  102. package/vendor/desktop/lib/local/session-rounds.js +1 -238
  103. package/vendor/desktop/lib/local/shell.js +1 -712
  104. package/vendor/desktop/lib/local/spill.js +1 -75
  105. package/vendor/desktop/lib/local/tools.js +1 -1328
  106. package/vendor/desktop/lib/local/turn-guard.js +1 -300
  107. package/vendor/desktop/lib/local/worktree-lock.js +1 -235
  108. package/vendor/desktop/lib/settings.js +1 -890
  109. package/vendor/desktop/main.js +1 -4890
  110. package/vendor/desktop/renderer/usage.js +1 -1239
  111. package/vendor/hosts/install.js +1 -638
  112. package/vendor/hosts/openai-shim.js +1 -515
  113. package/vendor/hosts/spec.js +1 -164
  114. package/vendor/hosts/targets.js +1 -346
  115. package/vendor/mcp/server.js +1 -221
  116. package/vendor/mcp/tools.js +1 -408
  117. package/vendor/one/src/child.js +1 -285
  118. package/vendor/one/src/permissions.js +1 -383
@@ -1,165 +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
- * integrity — the desktop's copy of the second gate.
10
- *
11
- * `cli/src/limits.js` guards the CLI and says why it is shaped this way; read
12
- * that header first, the reasoning is the same and is not repeated here. This
13
- * file is the same question asked of the DESKTOP, which until now had no
14
- * second gate at all: `aegis-desktop` shipped no verifier, so a build whose
15
- * own bytes had been rewritten ran normally and only `provenance check` on the
16
- * CLI face would ever have said otherwise.
17
- *
18
- * What is covered is the set of files that OWN a privilege rather than the
19
- * whole tree — the same doctrine as the CLI's `UNITS`, because the point is to
20
- * make removing the question expensive, not to make it exhaustive:
21
- *
22
- * - `main.js` the Electron bootstrap: IPC registration, the spawn
23
- * sites, and the window that serves the renderer;
24
- * - `lib/local/shell.js` the process that actually executes `exec`;
25
- * - `lib/local/tools.js` the tool surface handed to the model;
26
- * - `lib/local/exec-plan.js` the rule that decides what may run batched.
27
- *
28
- * A digest is taken over those files *as one closed set*, so changing any one
29
- * changes the whole, and compared to a value sealed into this file. On a
30
- * mismatch:
31
- *
32
- * - one bland line on stderr naming no file, no category, no remedy;
33
- * - `AEGIS_REDUCED_MODE=1` in the environment for modules that opt in; and
34
- * - `armed()` returns true, which every owner above is expected to consult
35
- * before exercising its privilege (`main.js` refuses to create a window).
36
- *
37
- * The paths are base64 and the sealed digest is XORed with a derived pad. As
38
- * with the CLI's interlock this is obfuscation and not cryptography: whoever
39
- * holds the bytes can read it. The cost raised is the cost of *noticing* —
40
- * there is no runtime switch, no manifest naming what is covered, and no
41
- * self-describing failure to imitate.
42
- *
43
- * THIS FILE IS NOT IN ITS OWN SET. The seal lives here, so including it would
44
- * make the digest self-referential and unstable — it is covered by the pack
45
- * audit's manifest instead.
46
- *
47
- * A tree that is mid-edit trips this on purpose. Resealing happens during the
48
- * build, after obfuscation, via `tools/obfuscate-faces.mjs` — the source tree's
49
- * seal is written by `node tools/desktop-seal.mjs --write`. There is no
50
- * environment variable that disables the check, because a gate with a
51
- * documented off switch is a gate the manipulator reads about in this file.
52
- */
53
-
54
- const { createHash } = require('node:crypto');
55
- const { existsSync, readFileSync } = require('node:fs');
56
- const path = require('node:path');
57
-
58
- /** The desktop package root: this file is `lib/local/`, so up two. */
59
- const PACKAGE_ROOT = path.join(__dirname, '..', '..');
60
-
61
- /** Domain separator, so this digest cannot be confused with any other. */
62
- const SALT = 'aegis-desktop-interlock-v1';
63
- /** Pad derivation, so the sealed value is not a plain digest of the set. */
64
- const PAD = 'aegis-desktop-pad-v1';
65
-
66
- const sha256 = (data) => createHash('sha256').update(data).digest('hex');
67
- const PAD_HEX = sha256(PAD);
68
-
69
- /** Nibble-wise XOR against the derived pad; self-inverse. */
70
- function unmask(sealed) {
71
- let out = '';
72
- for (let i = 0; i < sealed.length; i++) {
73
- const a = parseInt(sealed[i], 16);
74
- const b = parseInt(PAD_HEX[i % PAD_HEX.length], 16);
75
- if (Number.isNaN(a) || Number.isNaN(b)) return null;
76
- out += (a ^ b).toString(16);
77
- }
78
- return out;
79
- }
80
-
81
- /**
82
- * The sealed set, base64 so a `cat` of this file is not a table of contents.
83
- * Order is part of the digest: reordering is as detectable as editing.
84
- */
85
- const UNITS = Object.freeze([
86
- { id: 'd1', rel: Buffer.from('bWFpbi5qcw==', 'base64').toString('utf8') },
87
- { id: 'd2', rel: Buffer.from('bGliL2xvY2FsL3NoZWxsLmpz', 'base64').toString('utf8') },
88
- { id: 'd3', rel: Buffer.from('bGliL2xvY2FsL3Rvb2xzLmpz', 'base64').toString('utf8') },
89
- { id: 'd4', rel: Buffer.from('bGliL2xvY2FsL2V4ZWMtcGxhbi5qcw==', 'base64').toString('utf8') },
90
- ]);
91
-
92
- /**
93
- * The masked digest of the sealed set. Rewritten ONLY by the seal writer
94
- * (`tools/desktop-seal.mjs` in the source tree, `tools/obfuscate-faces.mjs`
95
- * after obfuscation), never by hand.
96
- */
97
- const SEALED = 'dc27eef1b63a4ba52eaacc8476dcf5de82020d3d4614662a44b9b99fa18e5579';
98
-
99
- /**
100
- * Ask the question. Never throws — a check that can break the program it is
101
- * checking is a check an attacker would rather have present.
102
- *
103
- * @returns {{ tripped: boolean, code: string|null, units: number }}
104
- */
105
- function check() {
106
- const parts = [];
107
- for (const unit of UNITS) {
108
- const abs = path.join(PACKAGE_ROOT, unit.rel);
109
- if (!existsSync(abs)) return { tripped: true, code: 'd1', units: UNITS.length };
110
- try {
111
- parts.push(sha256(readFileSync(abs)));
112
- } catch {
113
- return { tripped: true, code: 'd1', units: UNITS.length };
114
- }
115
- }
116
- const combined = sha256(`${SALT}\n${parts.join('\n')}`);
117
- const sealed = typeof SEALED === 'string' ? SEALED.trim() : '';
118
- if (sealed.length !== 64) return { tripped: true, code: 'd2', units: UNITS.length };
119
- const expected = unmask(sealed);
120
- if (expected !== combined) return { tripped: true, code: 'd3', units: UNITS.length };
121
- return { tripped: false, code: null, units: UNITS.length };
122
- }
123
-
124
- /** The only sentence a failing build says about itself. Blunt, not a manual. */
125
- function line(state) {
126
- if (!state || !state.tripped) return null;
127
- return `aegis-desktop: reduced mode (${state.code}) — this build is not the one that was published.\n`;
128
- }
129
-
130
- /**
131
- * Ask once, remember the answer, and print the one bland line on the way.
132
- *
133
- * Memoised for one process, and only so that several callers produce one
134
- * sentence instead of several. It is NOT a cache an attacker can prime: the
135
- * first caller computes it from the bytes on disk and every later caller gets
136
- * that verdict. Cannot throw, for the same reason `check` cannot.
137
- *
138
- * @returns {boolean} true when this build is not the published one.
139
- */
140
- let ARMED = null;
141
- function armed() {
142
- if (ARMED !== null) return ARMED;
143
- let state;
144
- try {
145
- state = check();
146
- } catch {
147
- state = { tripped: true, code: 'd2', units: UNITS.length };
148
- }
149
- ARMED = Boolean(state.tripped);
150
- if (ARMED) {
151
- // The mark is the mechanism; the line is only its announcement.
152
- process.env.AEGIS_REDUCED_MODE = '1';
153
- const said = line(state);
154
- if (said) process.stderr.write(said);
155
- }
156
- return ARMED;
157
- }
158
-
159
- /** The seal writer's half of the contract; the tool owns the mapping. */
160
- function sealOf(files) {
161
- const parts = files.map((abs) => sha256(readFileSync(abs)));
162
- return sha256(`${SALT}\n${parts.join('\n')}`);
163
- }
164
-
165
- module.exports = { UNITS, SALT, PAD, check, armed, line, sealOf, mask: unmask };
3
+ "use strict";const{createHash:createHash}=require("node:crypto"),{existsSync:existsSync,readFileSync:readFileSync}=require("node:fs"),path=require("node:path"),PACKAGE_ROOT=path.join(__dirname,"..",".."),SALT="aegis-desktop-interlock-v1",PAD="aegis-desktop-pad-v1",sha256=e=>createHash("sha256").update(e).digest("hex"),PAD_HEX=sha256(PAD);function unmask(e){let t="";for(let n=0;n<e.length;n++){const r=parseInt(e[n],16),s=parseInt(PAD_HEX[n%PAD_HEX.length],16);if(Number.isNaN(r)||Number.isNaN(s))return null;t+=(r^s).toString(16)}return t}const UNITS=Object.freeze([{id:"d1",rel:Buffer.from("bWFpbi5qcw==","base64").toString("utf8")},{id:"d2",rel:Buffer.from("bGliL2xvY2FsL3NoZWxsLmpz","base64").toString("utf8")},{id:"d3",rel:Buffer.from("bGliL2xvY2FsL3Rvb2xzLmpz","base64").toString("utf8")},{id:"d4",rel:Buffer.from("bGliL2xvY2FsL2V4ZWMtcGxhbi5qcw==","base64").toString("utf8")}]),SEALED="dc27eef1b63a4ba52eaacc8476dcf5de82020d3d4614662a44b9b99fa18e5579";function check(){const e=[];for(const t of UNITS){const n=path.join(PACKAGE_ROOT,t.rel);if(!existsSync(n))return{tripped:!0,code:"d1",units:UNITS.length};try{e.push(sha256(readFileSync(n)))}catch{return{tripped:!0,code:"d1",units:UNITS.length}}}const t=sha256(`${SALT}\n${e.join("\n")}`),n="string"==typeof SEALED?SEALED.trim():"";return 64!==n.length?{tripped:!0,code:"d2",units:UNITS.length}:unmask(n)!==t?{tripped:!0,code:"d3",units:UNITS.length}:{tripped:!1,code:null,units:UNITS.length}}function line(e){return e&&e.tripped?`aegis-desktop: reduced mode (${e.code}) — this build is not the one that was published.\n`:null}let ARMED=null;function armed(){if(null!==ARMED)return ARMED;let e;try{e=check()}catch{e={tripped:!0,code:"d2",units:UNITS.length}}if(ARMED=Boolean(e.tripped),ARMED){process.env.AEGIS_REDUCED_MODE="1";const t=line(e);t&&process.stderr.write(t)}return ARMED}function sealOf(e){const t=e.map((e=>sha256(readFileSync(e))));return sha256(`${SALT}\n${t.join("\n")}`)}module.exports={UNITS:UNITS,SALT:SALT,PAD:PAD,check:check,armed:armed,line:line,sealOf:sealOf,mask:unmask};