aegiscode 7.0.0 → 7.0.1
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/bin/aegiscode.js +137 -0
- package/package.json +1 -1
- package/scripts/check.mjs +5 -0
- package/scripts/demo.mjs +5 -0
- package/scripts/predist.mjs +29 -2
- package/scripts/runtests.mjs +5 -0
- package/scripts/seal-gate.mjs +76 -0
- package/src/agents.js +5 -0
- package/src/app.js +5 -0
- package/src/art.js +5 -0
- package/src/autonomous.js +23 -0
- package/src/caps.js +5 -0
- package/src/chatflow.js +104 -31
- package/src/checkpoint.js +5 -0
- package/src/clipboard.js +5 -0
- package/src/cloudsync.js +5 -0
- package/src/commands.js +326 -14
- package/src/config.js +5 -0
- package/src/credentials.js +5 -0
- package/src/deps.js +5 -0
- package/src/devrun.js +5 -0
- package/src/diff.js +5 -0
- package/src/diffview.js +5 -0
- package/src/engine.js +5 -0
- package/src/entitlement.js +5 -0
- package/src/events.js +15 -0
- package/src/export.js +5 -0
- package/src/fingerprint.js +5 -0
- package/src/format.js +5 -0
- package/src/fuzzy.js +5 -0
- package/src/gate.js +12 -0
- package/src/history.js +5 -0
- package/src/init.js +5 -0
- package/src/input.js +5 -0
- package/src/keys.js +29 -2
- package/src/limits.js +192 -0
- package/src/markdown.js +5 -0
- package/src/mcp.js +13 -0
- package/src/models.js +5 -0
- package/src/naming.js +5 -0
- package/src/overlays.js +7 -2
- package/src/panels.js +5 -0
- package/src/permissions.js +56 -1
- package/src/ping.js +5 -0
- package/src/presence.js +5 -0
- package/src/provenance.js +238 -0
- package/src/provenance.lock.json +36 -0
- package/src/render.js +5 -0
- package/src/screen.js +5 -0
- package/src/screens.js +48 -37
- package/src/secret.js +5 -0
- package/src/securefs.js +5 -0
- package/src/settings.js +5 -0
- package/src/shared.js +5 -0
- package/src/sharedpaths.js +5 -0
- package/src/signup.js +5 -0
- package/src/summarize.js +5 -0
- package/src/sysdiag.js +582 -0
- package/src/system.js +5 -0
- package/src/theme.js +5 -0
- package/src/title.js +5 -0
- package/src/todos.js +5 -0
- package/src/tokens.js +5 -0
- package/src/topup.js +5 -0
- package/src/update.js +5 -0
- package/vendor/client/aegis.js +5 -0
- package/vendor/client/attest.js +5 -0
- package/vendor/client/authorship-key.js +5 -0
- package/vendor/client/auto-provision.js +5 -0
- package/vendor/client/brain-catalog.js +5 -0
- package/vendor/client/byok-catalog.js +5 -0
- package/vendor/client/credentials.js +5 -0
- package/vendor/client/device-fingerprint.js +5 -0
- package/vendor/client/env-file.js +5 -0
- package/vendor/client/fingerprint.js +5 -0
- package/vendor/client/foreign-memory.js +5 -0
- package/vendor/client/hooks.js +5 -0
- package/vendor/client/model-discovery.js +332 -0
- package/vendor/client/platform.js +5 -0
- package/vendor/client/prefs.js +5 -0
- package/vendor/client/presence-constants.js +5 -0
- package/vendor/client/presence.js +5 -0
- package/vendor/client/record-vault.js +5 -0
- package/vendor/client/session-store.js +5 -0
- package/vendor/client/topup.js +5 -0
- package/vendor/client/touch.js +5 -0
- package/vendor/client/update.js +5 -0
- package/vendor/client/user-models.js +5 -0
- package/vendor/desktop/lib/local/aegis-seal.mjs +5 -0
- package/vendor/desktop/lib/local/agents.js +5 -0
- package/vendor/desktop/lib/local/autonomous.js +5 -0
- package/vendor/desktop/lib/local/context.js +5 -0
- package/vendor/desktop/lib/local/covenant.js +5 -0
- package/vendor/desktop/lib/local/engine.js +129 -0
- package/vendor/desktop/lib/local/entitlement.js +5 -0
- package/vendor/desktop/lib/local/git-scope.js +5 -0
- package/vendor/desktop/lib/local/local.js +5 -0
- package/vendor/desktop/lib/local/prompt.js +5 -0
- package/vendor/desktop/lib/local/queue.js +5 -0
- package/vendor/desktop/lib/local/session-rounds.js +5 -0
- package/vendor/desktop/lib/local/shell.js +88 -9
- package/vendor/desktop/lib/local/tools.js +13 -6
- package/vendor/desktop/lib/local/turn-guard.js +5 -0
- package/vendor/desktop/lib/local/worktree-lock.js +5 -0
- package/vendor/desktop/lib/settings.js +5 -0
- package/vendor/desktop/renderer/usage.js +5 -0
- package/vendor/mcp/server.js +5 -0
- package/vendor/mcp/tools.js +5 -0
- package/vendor/tools/agent-gate.mjs +23 -0
|
@@ -0,0 +1,238 @@
|
|
|
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
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* provenance — who this program is, and whether it is still the program that
|
|
10
|
+
* was published.
|
|
11
|
+
*
|
|
12
|
+
* Two questions, both asked from inside the CLI so the answer is available to
|
|
13
|
+
* the person running it and not only to whoever holds the git clone:
|
|
14
|
+
*
|
|
15
|
+
* 1. **Identity.** `IDENTITY` is the one place the product name, licence,
|
|
16
|
+
* copyright holder and source URL are written for a user to read: it is
|
|
17
|
+
* what `aegiscode provenance` prints, and what a rebranded copy has to
|
|
18
|
+
* deliberately delete rather than merely never mention. This half is
|
|
19
|
+
* *meant* to be read, and removing it is itself the evidence.
|
|
20
|
+
*
|
|
21
|
+
* 2. **Integrity of the safety files.** `selfCheck()` re-hashes the CLI files
|
|
22
|
+
* whose edit changes what the program ALLOWS — the agent-key gate, the
|
|
23
|
+
* permission evaluator, the frozen approval classes, the `runner with no
|
|
24
|
+
* one to answer it`, the entry point that wires them, the silent interlock
|
|
25
|
+
* in src/limits.js, and this file — against `provenance.lock.json`, which
|
|
26
|
+
* ships in the package.
|
|
27
|
+
*
|
|
28
|
+
* This half is deliberately OPAQUE. Its manifest carries no paths, only
|
|
29
|
+
* digests under non-identifying unit ids, and the manifest is the only
|
|
30
|
+
* place they appear: the id→path table lives in `UNITS` below, and every
|
|
31
|
+
* message this module emits names a unit id and nothing else. A report
|
|
32
|
+
* that said "src/gate.js: a1b2… → c3d4…" would be a repair manual for
|
|
33
|
+
* whoever neutered the gate, and the whole point of the check is that the
|
|
34
|
+
* build which fails it does not get told where to aim next.
|
|
35
|
+
*
|
|
36
|
+
* ## What this is not
|
|
37
|
+
*
|
|
38
|
+
* It is not DRM, and calling it tamper-proof would be a lie of the kind this
|
|
39
|
+
* repo keeps a ledger of. Whoever has the bytes can edit the safety file AND
|
|
40
|
+
* regenerate the lock; there is no key here and no server to ask, because a
|
|
41
|
+
* client that phones home to prove itself is a client that fails when the
|
|
42
|
+
* network does, and this program is used offline. What it buys is that the
|
|
43
|
+
* neutered build is no longer SILENT: either it announces the divergence to its
|
|
44
|
+
* own user, or its author deleted a check that is named in every file header and
|
|
45
|
+
* pinned by `tools/invariant-lock.mjs` — a deliberate act with a paper trail.
|
|
46
|
+
*
|
|
47
|
+
* The second gate is `src/limits.js`. It withholds capability instead of
|
|
48
|
+
* explaining a mismatch, so deleting the loud report is not enough: a build
|
|
49
|
+
* assembled that way still refuses its own privileged subcommands and says only
|
|
50
|
+
* that it is in reduced mode. It is also not asked from one place — each module
|
|
51
|
+
* that owns one of those privileges (`gate.js`, `mcp.js`, `autonomous.js`,
|
|
52
|
+
* `permissions.js`) asks it for itself, so the refusal survives the deletion of
|
|
53
|
+
* the entry point's call rather than going with it.
|
|
54
|
+
*
|
|
55
|
+
* ## Why a missing lock file is a failure, not a pass
|
|
56
|
+
*
|
|
57
|
+
* Fail-closed, like the repo's gate and its invariant lock, and for the same
|
|
58
|
+
* reason: deleting the manifest is the cheapest possible way to switch this off,
|
|
59
|
+
* so absence is reported (`unverifiable`) instead of being read as "nothing
|
|
60
|
+
* configured". `AEGIS_NO_PROVENANCE_CHECK=1` silences it for a development tree
|
|
61
|
+
* that is mid-edit — loudly, and by name, so it is never the quiet path.
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
const { createHash } = require('node:crypto');
|
|
65
|
+
const { existsSync, readFileSync } = require('node:fs');
|
|
66
|
+
const path = require('node:path');
|
|
67
|
+
const limits = require('./limits.js');
|
|
68
|
+
|
|
69
|
+
/** Everything a copy would have to change to look like its own product. */
|
|
70
|
+
const IDENTITY = Object.freeze({
|
|
71
|
+
product: 'AEGIS Code',
|
|
72
|
+
bin: 'aegiscode',
|
|
73
|
+
license: 'AGPL-3.0-or-later',
|
|
74
|
+
copyright: 'Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.',
|
|
75
|
+
source: 'https://github.com/aegisinfo/aegiscode-plugin',
|
|
76
|
+
homepage: 'https://aegiscloud.org',
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The sealed set: id → path. This table is the mapping the manifest refuses to
|
|
81
|
+
* carry, and the only reason a report can say `p3` at all. Keep it in step with
|
|
82
|
+
* `tools/provenance.mjs`, which writes both halves from it.
|
|
83
|
+
*/
|
|
84
|
+
const UNITS = Object.freeze([
|
|
85
|
+
Object.freeze({ id: 'p1', rel: 'bin/aegiscode.js' }),
|
|
86
|
+
Object.freeze({ id: 'p2', rel: 'src/provenance.js' }),
|
|
87
|
+
Object.freeze({ id: 'p3', rel: 'src/gate.js' }),
|
|
88
|
+
Object.freeze({ id: 'p4', rel: 'src/permissions.js' }),
|
|
89
|
+
Object.freeze({ id: 'p5', rel: 'src/caps.js' }),
|
|
90
|
+
Object.freeze({ id: 'p6', rel: 'src/autonomous.js' }),
|
|
91
|
+
Object.freeze({ id: 'p7', rel: 'src/limits.js' }),
|
|
92
|
+
Object.freeze({ id: 'p8', rel: 'src/mcp.js' }),
|
|
93
|
+
]);
|
|
94
|
+
|
|
95
|
+
const PACKAGE_ROOT = path.join(__dirname, '..');
|
|
96
|
+
const MANIFEST_FILE = path.join(__dirname, 'provenance.lock.json');
|
|
97
|
+
|
|
98
|
+
const sha256 = (data) => createHash('sha256').update(data).digest('hex');
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Read the shipped manifest. Two shapes are accepted:
|
|
102
|
+
*
|
|
103
|
+
* - current: `{ v: 1, alg: 'sha256', units: { p1: '<hex>', … } }` — ids only,
|
|
104
|
+
* no paths, nothing to read off the file except which digests moved;
|
|
105
|
+
* - legacy: `{ files: { '<rel path>': '<hex>' } }` — still honoured so a
|
|
106
|
+
* package built from an older tree can still be checked, and still reported
|
|
107
|
+
* by id rather than by path.
|
|
108
|
+
*/
|
|
109
|
+
function readManifest() {
|
|
110
|
+
try {
|
|
111
|
+
const parsed = JSON.parse(readFileSync(MANIFEST_FILE, 'utf8'));
|
|
112
|
+
if (!parsed) return null;
|
|
113
|
+
if (parsed.units && typeof parsed.units === 'object') {
|
|
114
|
+
return { units: parsed.units, legacyPaths: null };
|
|
115
|
+
}
|
|
116
|
+
if (parsed.files && typeof parsed.files === 'object') {
|
|
117
|
+
return { units: parsed.files, legacyPaths: parsed.files };
|
|
118
|
+
}
|
|
119
|
+
return null;
|
|
120
|
+
} catch {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** Resolve a unit's expected digest, in either manifest shape. */
|
|
126
|
+
function expectedFor(manifest, unit) {
|
|
127
|
+
if (!manifest) return undefined;
|
|
128
|
+
if (manifest.legacyPaths) return manifest.legacyPaths[unit.rel];
|
|
129
|
+
return manifest.units[unit.id];
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Compare this install's safety files to the shipped manifest.
|
|
134
|
+
*
|
|
135
|
+
* Never throws: this is a diagnostic, and a diagnostic that can break the
|
|
136
|
+
* program it is reporting on is worse than no diagnostic.
|
|
137
|
+
*
|
|
138
|
+
* Reports unit ids, never paths. See the header for why the difference matters.
|
|
139
|
+
*
|
|
140
|
+
* @returns {{ ok: boolean, checked: number, problems: string[], unverifiable: boolean }}
|
|
141
|
+
*/
|
|
142
|
+
function selfCheck() {
|
|
143
|
+
const manifest = readManifest();
|
|
144
|
+
if (!manifest) {
|
|
145
|
+
return {
|
|
146
|
+
ok: false,
|
|
147
|
+
checked: 0,
|
|
148
|
+
problems: [`${path.basename(MANIFEST_FILE)} is missing or unreadable`],
|
|
149
|
+
unverifiable: true,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
const problems = [];
|
|
153
|
+
let checked = 0;
|
|
154
|
+
for (const unit of UNITS) {
|
|
155
|
+
const abs = path.join(PACKAGE_ROOT, unit.rel);
|
|
156
|
+
if (!existsSync(abs)) {
|
|
157
|
+
problems.push(`${unit.id}: sealed unit missing from this install`);
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
try {
|
|
161
|
+
const actual = sha256(readFileSync(abs));
|
|
162
|
+
checked++;
|
|
163
|
+
const expected = expectedFor(manifest, unit);
|
|
164
|
+
if (expected && actual !== expected) problems.push(`${unit.id}: digest moved`);
|
|
165
|
+
} catch {
|
|
166
|
+
problems.push(`${unit.id}: unreadable`);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return { ok: problems.length === 0, checked, problems, unverifiable: false };
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* The one stderr line worth writing, or null when everything is as published.
|
|
174
|
+
*
|
|
175
|
+
* It names ids and counts. It does not name files, does not describe what those
|
|
176
|
+
* files do, and does not say how to re-seal: those three sentences are exactly
|
|
177
|
+
* what a tampered build would otherwise hand its author for free.
|
|
178
|
+
*
|
|
179
|
+
* A development tree can silence it with AEGIS_NO_PROVENANCE_CHECK=1; the
|
|
180
|
+
* silence is printed too, because a control that can be switched off quietly is
|
|
181
|
+
* not a control.
|
|
182
|
+
*/
|
|
183
|
+
function warning(report) {
|
|
184
|
+
if (!report || report.ok) return null;
|
|
185
|
+
if (process.env.AEGIS_NO_PROVENANCE_CHECK) {
|
|
186
|
+
return `aegiscode: provenance check SKIPPED (AEGIS_NO_PROVENANCE_CHECK is set): ${report.problems[0]}\n`;
|
|
187
|
+
}
|
|
188
|
+
return (
|
|
189
|
+
`aegiscode: provenance — ${report.problems.length} sealed unit${
|
|
190
|
+
report.problems.length === 1 ? '' : 's'
|
|
191
|
+
} do not match the published manifest (${IDENTITY.license}):\n` +
|
|
192
|
+
report.problems.map((p) => `aegiscode: ${p}\n`).join('') +
|
|
193
|
+
'aegiscode: this build is not the published one; do not trust what it reports about itself.\n'
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/** The human-readable answer for `aegiscode provenance`. */
|
|
198
|
+
function describe({ version } = {}) {
|
|
199
|
+
const report = selfCheck();
|
|
200
|
+
const lines = [
|
|
201
|
+
`${IDENTITY.product} (${IDENTITY.bin})${version ? ` ${version}` : ''} — ${IDENTITY.license}`,
|
|
202
|
+
`source: ${IDENTITY.source}`,
|
|
203
|
+
`homepage: ${IDENTITY.homepage}`,
|
|
204
|
+
IDENTITY.copyright,
|
|
205
|
+
];
|
|
206
|
+
// The identity half is MEANT to be read — it is the notice that has to travel
|
|
207
|
+
// with a copy, and withholding it would defeat the licence half of this file.
|
|
208
|
+
// The integrity half is not. A build that failed the silent gate does not get
|
|
209
|
+
// to report on itself: it is told exactly as much as any other module is
|
|
210
|
+
// (src/limits.js, "reduced mode"), and the ids it would otherwise print stay
|
|
211
|
+
// here. Asked through limits.armed() rather than trusting the caller, so that
|
|
212
|
+
// deleting the entry point's own refusal does not hand this back — the guard
|
|
213
|
+
// lives in a file the sealed set covers.
|
|
214
|
+
if (limits.armed()) {
|
|
215
|
+
lines.push('safety: reduced mode — this build is not the one that was published.');
|
|
216
|
+
return {
|
|
217
|
+
text: lines.join('\n') + '\n',
|
|
218
|
+
ok: false,
|
|
219
|
+
report: { ok: false, checked: report.checked, problems: [], unverifiable: report.unverifiable, withheld: true },
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
if (report.ok) {
|
|
223
|
+
lines.push(`safety: ${report.checked} sealed units verified`);
|
|
224
|
+
} else if (report.unverifiable) {
|
|
225
|
+
lines.push(`safety: UNVERIFIABLE — ${report.problems[0]}`);
|
|
226
|
+
} else {
|
|
227
|
+
lines.push(`safety: ${report.problems.length} sealed unit(s) do not match the published manifest:`);
|
|
228
|
+
for (const p of report.problems) lines.push(` ${p}`);
|
|
229
|
+
}
|
|
230
|
+
return { text: lines.join('\n') + '\n', ok: report.ok, report };
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/** The id→path mapping, for the development tool only. Never called at runtime. */
|
|
234
|
+
function sealMap() {
|
|
235
|
+
return UNITS.map((u) => ({ id: u.id, rel: u.rel }));
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
module.exports = { IDENTITY, UNITS, MANIFEST_FILE, selfCheck, warning, describe, sealMap };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"v": 1,
|
|
3
|
+
"alg": "sha256",
|
|
4
|
+
"comment": [
|
|
5
|
+
"Generated by tools/provenance.mjs (`lock --write`, which also seals the",
|
|
6
|
+
"interlock). Read that file, and cli/src/provenance.js, before editing this.",
|
|
7
|
+
"",
|
|
8
|
+
"IDS ONLY. The id-to-path table is in cli/src/provenance.js (`UNITS`) and is",
|
|
9
|
+
"never printed at runtime; this file deliberately does not name the files it",
|
|
10
|
+
"covers, because the manifest ships in the package and a manifest that listed",
|
|
11
|
+
"them would be a table of contents for whoever wants to edit one.",
|
|
12
|
+
"",
|
|
13
|
+
"cli/src/provenance.js re-hashes these at startup and writes one line to",
|
|
14
|
+
"stderr if a digest moved — by id, without naming the file or the fix. A",
|
|
15
|
+
"second, silent gate (cli/src/limits.js) asks the same question as a closed",
|
|
16
|
+
"set and, when it fails, withholds the privileged subcommands instead of",
|
|
17
|
+
"explaining anything.",
|
|
18
|
+
"",
|
|
19
|
+
"This is a speed bump with a loud voice, not DRM: whoever holds the bytes",
|
|
20
|
+
"can regenerate this file. It is worth regenerating only deliberately —",
|
|
21
|
+
"`tools/invariant-lock.mjs` pins this file and the safety files, so a silent",
|
|
22
|
+
"change upstream fails the lock instead of landing."
|
|
23
|
+
],
|
|
24
|
+
"license": "AGPL-3.0-or-later",
|
|
25
|
+
"source": "https://github.com/aegisinfo/aegiscode-plugin",
|
|
26
|
+
"units": {
|
|
27
|
+
"p1": "6ab4d502c73d950c4c17afaaa5afc350475050a0bb45e883a8fdb8c71ca04757",
|
|
28
|
+
"p2": "d63d147de5455eea111d000b748d7eef9572a11a08d31f2471d5ff146701342c",
|
|
29
|
+
"p3": "ff962ac8dbf42cecb2477e2f77bf5ec61f88aa1751b0d4e506bf030fbc5fc6c6",
|
|
30
|
+
"p4": "2e8385c3a653a2af324050b4b92aeb9d142fc6765c91a13ccc928c5d4a2dbedb",
|
|
31
|
+
"p5": "408d67f78f31f6d637a26d2852e0c809a260544e613afdc64b731401c0ba3801",
|
|
32
|
+
"p6": "2a934a1b76e1321457d0a2e7ebf91dcc9520097d6b62f7d5a99af0bd69c2cf97",
|
|
33
|
+
"p7": "904efedb3101cca9d7b81009dfe72216ce773e7ab8f5bc603327b2f76da356be",
|
|
34
|
+
"p8": "3cc054d06715e065fe635b37b7d1bb98bf7989d64453a572ddbb77cec5b830e7"
|
|
35
|
+
}
|
|
36
|
+
}
|
package/src/render.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
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.
|
|
1
6
|
'use strict';
|
|
2
7
|
|
|
3
8
|
/**
|
package/src/screen.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
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.
|
|
1
6
|
'use strict';
|
|
2
7
|
|
|
3
8
|
/**
|
package/src/screens.js
CHANGED
|
@@ -19,9 +19,12 @@
|
|
|
19
19
|
* - `runOnboarding` **returns** whether the user declined rather than calling
|
|
20
20
|
* `process.exit` from inside a library function, so the caller owns process
|
|
21
21
|
* lifecycle (and a test can drive the whole flow).
|
|
22
|
-
* - The
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* - The right-hand box is about *this* client: the commands that add a model
|
|
23
|
+
* and set a key, each held to this package's own registry. It used to be a
|
|
24
|
+
* `What's new` list of *this* package's release notes — never Aegiscodex's,
|
|
25
|
+
* printing another project's changelog in our banner would be a lie about
|
|
26
|
+
* what the user just installed — but a changelog is stale the moment the
|
|
27
|
+
* next release lands, and it answered no question a new user has.
|
|
25
28
|
*
|
|
26
29
|
* Every screen is split into a pure line-builder (`trustLines`,
|
|
27
30
|
* `themePickerLines`, `welcomeLines`) plus a thin key loop, so the exact
|
|
@@ -45,7 +48,8 @@ const VERSION = require('../package.json').version;
|
|
|
45
48
|
|
|
46
49
|
const PRODUCT = 'AEGIS Code';
|
|
47
50
|
|
|
48
|
-
/** The two boxes' contents.
|
|
51
|
+
/** The two boxes' contents. The right-hand box is `KEY_HELP` — the commands
|
|
52
|
+
* that add a model and set a key — not a changelog; see its comment below. */
|
|
49
53
|
const TIPS = [
|
|
50
54
|
' Run /init to create an AEGIS.md',
|
|
51
55
|
' Use ↑↓ to recall past prompts',
|
|
@@ -55,30 +59,38 @@ const TIPS = [
|
|
|
55
59
|
];
|
|
56
60
|
|
|
57
61
|
/**
|
|
58
|
-
* The
|
|
59
|
-
* rows in total**. The row count is load-bearing, not cosmetic: at 80×24 the
|
|
60
|
-
* welcome screen already fills exactly `rows - 1`, so a ninth row pushes the
|
|
61
|
-
* footer hint off the bottom of the commonest terminal there is. Retire the
|
|
62
|
-
* oldest entry rather than adding one.
|
|
62
|
+
* The second box: what this build can DO for you, not what changed in it.
|
|
63
63
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* the
|
|
64
|
+
* It used to be a hand-written `What's new` patch list, and that shape was the
|
|
65
|
+
* problem: a changelog on a welcome screen is read once and then goes stale by
|
|
66
|
+
* construction, so the box spent most of its life advertising releases the user
|
|
67
|
+
* was not running (it sat four minors behind while the package shipped 6.7.3)
|
|
68
|
+
* or, worse, patch notes for a version nobody can act on. The four things a new
|
|
69
|
+
* user actually has to know to get a turn running are all commands: how to add a
|
|
70
|
+
* model, how to set a provider key, how to set an AEGIS account key, and how to
|
|
71
|
+
* switch between the models they now hold. Those do not go stale — every command
|
|
72
|
+
* named here is asserted to exist in the registry by test/cli-onboarding.test.mjs,
|
|
73
|
+
* so a rename fails the suite instead of quietly leaving a dead route on the
|
|
74
|
+
* first screen the user reads.
|
|
75
|
+
*
|
|
76
|
+
* The row count is load-bearing, exactly as the patch list's was: at 80×24 the
|
|
77
|
+
* welcome screen fills rows-1 exactly (23 of 24), and `boxes()` receives an
|
|
78
|
+
* `avail` it never reads, so a tenth row would push the footer hint off the
|
|
79
|
+
* bottom of the commonest terminal there is. `test/cli-onboarding.test.mjs`
|
|
80
|
+
* pins the total; retire a row rather than adding one. Each provider row wraps
|
|
81
|
+
* its `argument list` onto a second row on purpose — a 60-cell command on a
|
|
82
|
+
* 39-cell box would be clipped mid-word by `boxLines()`, which reads as a
|
|
83
|
+
* rendering fault rather than as an example.
|
|
72
84
|
*/
|
|
73
|
-
const
|
|
74
|
-
'
|
|
75
|
-
'
|
|
76
|
-
'
|
|
77
|
-
'
|
|
78
|
-
'
|
|
79
|
-
'
|
|
80
|
-
'
|
|
81
|
-
' /
|
|
85
|
+
const KEY_HELP = [
|
|
86
|
+
' Add a model: /model add',
|
|
87
|
+
' <id> <name> <model> <url>',
|
|
88
|
+
' Set a provider key: /byok-key',
|
|
89
|
+
' <provider> — openai, anthropic',
|
|
90
|
+
' Set your account key: /key <key>',
|
|
91
|
+
' Switch model: /model, or alt+p',
|
|
92
|
+
' Reasoning effort: /effort',
|
|
93
|
+
' All commands: press / for the list',
|
|
82
94
|
];
|
|
83
95
|
|
|
84
96
|
/**
|
|
@@ -87,8 +99,8 @@ const WHATS_NEW = [
|
|
|
87
99
|
* screen, in place of the desktop host's welcome panel (BYOK + AEGIS Cloud).
|
|
88
100
|
*
|
|
89
101
|
* It is two plain rows and not a third box, and the reason is the same row
|
|
90
|
-
* budget `
|
|
91
|
-
* the Tips/
|
|
102
|
+
* budget `KEY_HELP` is held to: at 80×24 the rule, mark, title, tagline and
|
|
103
|
+
* the Tips/Models-and-keys pair already come to 21 of the 23 usable rows, so a
|
|
92
104
|
* boxed third panel (three rows minimum, two of them rules) would push the
|
|
93
105
|
* footer hint off the bottom of the commonest terminal there is. Two rows fit
|
|
94
106
|
* exactly: one route row, and the desktop line under it.
|
|
@@ -447,18 +459,17 @@ function boxLines(t, header, rows, boxW) {
|
|
|
447
459
|
return out;
|
|
448
460
|
}
|
|
449
461
|
|
|
450
|
-
/** The Tips +
|
|
462
|
+
/** The Tips + Models-and-keys boxes, side by side (stacked when too narrow). */
|
|
451
463
|
function boxes(t, cols, avail) {
|
|
452
464
|
const gap = 2;
|
|
453
465
|
const twoUp = Math.floor((cols - gap) / 2);
|
|
454
466
|
const tipRows = TIPS.map((s) => `${GLYPH.pointer}${s}`);
|
|
455
|
-
const newsRows =
|
|
456
|
-
// Name the running build in the header.
|
|
457
|
-
//
|
|
458
|
-
//
|
|
459
|
-
// user on a newer build
|
|
460
|
-
|
|
461
|
-
const newsHead = `What's new in v${VERSION}`;
|
|
467
|
+
const newsRows = KEY_HELP;
|
|
468
|
+
// Name the running build in the header. The rows below are commands and
|
|
469
|
+
// cannot go stale, but the header is the only place the screen says which
|
|
470
|
+
// build is running, and it is derived from `VERSION` rather than typed — so
|
|
471
|
+
// a user on a newer build is never reading notes written for an older one.
|
|
472
|
+
const newsHead = `Models & keys · v${VERSION}`;
|
|
462
473
|
if (twoUp >= 30) {
|
|
463
474
|
let a = boxLines(t, 'Tips for getting started', tipRows, twoUp);
|
|
464
475
|
let b = boxLines(t, newsHead, newsRows, twoUp);
|
|
@@ -840,7 +851,7 @@ async function runOnboarding(ctx, o = {}) {
|
|
|
840
851
|
module.exports = {
|
|
841
852
|
PRODUCT,
|
|
842
853
|
TIPS,
|
|
843
|
-
|
|
854
|
+
KEY_HELP,
|
|
844
855
|
CONNECT_BYOK,
|
|
845
856
|
CONNECT_CLOUD,
|
|
846
857
|
CONNECT_BOTH,
|
package/src/secret.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
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.
|
|
1
6
|
'use strict';
|
|
2
7
|
|
|
3
8
|
/**
|
package/src/securefs.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
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.
|
|
1
6
|
'use strict';
|
|
2
7
|
|
|
3
8
|
/**
|
package/src/settings.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
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.
|
|
1
6
|
'use strict';
|
|
2
7
|
|
|
3
8
|
/**
|
package/src/shared.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
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.
|
|
1
6
|
'use strict';
|
|
2
7
|
|
|
3
8
|
/**
|
package/src/sharedpaths.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
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.
|
|
1
6
|
'use strict';
|
|
2
7
|
|
|
3
8
|
/**
|
package/src/signup.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
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.
|
|
1
6
|
/**
|
|
2
7
|
* The one place the CLI tells a user where to get an account key.
|
|
3
8
|
*
|
package/src/summarize.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
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.
|
|
1
6
|
'use strict';
|
|
2
7
|
|
|
3
8
|
/**
|