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.
- package/SOURCE-OFFER.txt +9 -0
- package/package.json +4 -7
- package/scripts/check.mjs +1 -52
- package/scripts/demo.mjs +1 -94
- package/scripts/predist.mjs +1 -75
- package/scripts/runtests.mjs +1 -56
- package/scripts/seal-gate.mjs +1 -74
- package/src/agents.js +1 -139
- package/src/app.js +1 -2957
- package/src/art.js +1 -289
- package/src/chatflow.js +1 -3023
- package/src/checkpoint.js +1 -90
- package/src/clipboard.js +1 -424
- package/src/cloudsync.js +1 -528
- package/src/commands.js +1 -4089
- package/src/config.js +1 -581
- package/src/connect.js +1 -349
- package/src/credentials.js +1 -33
- package/src/deps.js +1 -232
- package/src/devrun.js +1 -187
- package/src/diff.js +1 -333
- package/src/diffview.js +1 -296
- package/src/engine.js +1 -297
- package/src/entitlement.js +1 -355
- package/src/events.js +1 -707
- package/src/export.js +1 -67
- package/src/filepreview.js +1 -153
- package/src/fingerprint.js +1 -592
- package/src/format.js +1 -259
- package/src/fuzzy.js +1 -119
- package/src/history.js +1 -423
- package/src/init.js +1 -175
- package/src/input.js +1 -139
- package/src/keys.js +1 -183
- package/src/markdown.js +1 -306
- package/src/models.js +1 -507
- package/src/naming.js +1 -57
- package/src/overlays.js +1 -462
- package/src/panels.js +1 -1418
- package/src/ping.js +1 -226
- package/src/presence.js +1 -238
- package/src/render.js +1 -516
- package/src/screen.js +1 -518
- package/src/screens.js +1 -896
- package/src/secret.js +1 -59
- package/src/securefs.js +1 -359
- package/src/settings.js +1 -155
- package/src/shared.js +1 -52
- package/src/sharedpaths.js +1 -53
- package/src/signup.js +1 -156
- package/src/summarize.js +1 -95
- package/src/sysdiag.js +1 -585
- package/src/system.js +1 -40
- package/src/theme.js +1 -570
- package/src/title.js +1 -220
- package/src/todos.js +1 -115
- package/src/tokens.js +1 -263
- package/src/topup.js +1 -210
- package/src/update.js +1 -191
- package/vendor/client/aegis.js +1 -2441
- package/vendor/client/attest.js +1 -518
- package/vendor/client/authorship-key.js +1 -410
- package/vendor/client/auto-provision.js +1 -134
- package/vendor/client/brain-catalog.js +1 -268
- package/vendor/client/byok-catalog.js +1 -199
- package/vendor/client/catalog-client.js +1 -487
- package/vendor/client/conversation-export.js +1 -177
- package/vendor/client/credentials.js +1 -494
- package/vendor/client/device-fingerprint.js +1 -141
- package/vendor/client/drive-connect.js +1 -110
- package/vendor/client/drive-upload.js +1 -234
- package/vendor/client/env-file.js +1 -1273
- package/vendor/client/fingerprint.js +1 -1064
- package/vendor/client/foreign-memory.js +1 -669
- package/vendor/client/google-signin.js +1 -133
- package/vendor/client/hooks.js +1 -430
- package/vendor/client/model-discovery.js +1 -373
- package/vendor/client/naming.js +1 -283
- package/vendor/client/platform.js +1 -937
- package/vendor/client/prefs.js +1 -351
- package/vendor/client/presence-constants.js +1 -107
- package/vendor/client/presence.js +1 -438
- package/vendor/client/record-vault.js +3 -1055
- package/vendor/client/session-store.js +1 -575
- package/vendor/client/topup.js +1 -297
- package/vendor/client/touch.js +1 -458
- package/vendor/client/update.js +1 -763
- package/vendor/client/user-models.js +1 -381
- package/vendor/desktop/lib/local/agents.js +1 -105
- package/vendor/desktop/lib/local/attachments.js +1 -276
- package/vendor/desktop/lib/local/autonomous.js +1 -1045
- package/vendor/desktop/lib/local/claude-pro.js +1 -1028
- package/vendor/desktop/lib/local/context.js +1 -125
- package/vendor/desktop/lib/local/engine.js +1 -3666
- package/vendor/desktop/lib/local/entitlement.js +1 -660
- package/vendor/desktop/lib/local/exec-plan.js +1 -269
- package/vendor/desktop/lib/local/git-scope.js +1 -228
- package/vendor/desktop/lib/local/integrity.js +1 -163
- package/vendor/desktop/lib/local/local.js +1 -2145
- package/vendor/desktop/lib/local/prompt.js +1 -280
- package/vendor/desktop/lib/local/queue.js +1 -560
- package/vendor/desktop/lib/local/session-rounds.js +1 -238
- package/vendor/desktop/lib/local/shell.js +1 -712
- package/vendor/desktop/lib/local/spill.js +1 -75
- package/vendor/desktop/lib/local/tools.js +1 -1328
- package/vendor/desktop/lib/local/turn-guard.js +1 -300
- package/vendor/desktop/lib/local/worktree-lock.js +1 -235
- package/vendor/desktop/lib/settings.js +1 -890
- package/vendor/desktop/main.js +1 -4890
- package/vendor/desktop/renderer/usage.js +1 -1239
- package/vendor/hosts/install.js +1 -638
- package/vendor/hosts/openai-shim.js +1 -515
- package/vendor/hosts/spec.js +1 -164
- package/vendor/hosts/targets.js +1 -346
- package/vendor/mcp/server.js +1 -221
- package/vendor/mcp/tools.js +1 -408
- package/vendor/one/src/child.js +1 -285
- 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
|
-
|
|
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};
|