aegiscode 5.2.32 → 6.0.0
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/README.md +123 -392
- package/bin/aegiscode.js +197 -0
- package/package.json +30 -83
- package/scripts/demo.mjs +92 -0
- package/scripts/predist.mjs +86 -0
- package/src/app.js +543 -0
- package/src/art.js +45 -0
- package/src/commands.js +163 -0
- package/src/deps.js +65 -0
- package/src/format.js +54 -0
- package/src/render.js +281 -0
- package/src/screen.js +177 -0
- package/src/theme.js +120 -0
- package/vendor/client/aegis.js +809 -0
- package/vendor/client/foreign-memory.js +666 -0
- package/vendor/desktop/renderer/usage.js +42 -0
- package/vendor/mcp/tools.js +356 -0
- package/LICENSE +0 -21
- package/bin/cli.js +0 -2362
- package/scripts/download-binary.mjs +0 -155
- package/scripts/empty-stub.mjs +0 -1
- package/scripts/ensure-node-version.mjs +0 -27
- package/scripts/install-alacritty.ps1 +0 -149
- package/scripts/install-alacritty.sh +0 -164
- package/scripts/install.sh +0 -121
- package/scripts/make-bin.mjs +0 -17
- package/scripts/release-local.sh +0 -68
- package/scripts/repro-compact.ts +0 -59
- package/scripts/repro-tokencount.ts +0 -45
- package/scripts/sharp-stub/index.js +0 -9
- package/scripts/sharp-stub/package.json +0 -5
package/scripts/release-local.sh
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Local release — mirrors what the GitHub "Build & Release" workflow does on a tag push
|
|
3
|
-
#
|
|
4
|
-
# Usage:
|
|
5
|
-
# ./scripts/release-local.sh # read version from package.json
|
|
6
|
-
# ./scripts/release-local.sh 4.21 # explicit version
|
|
7
|
-
#
|
|
8
|
-
# Steps:
|
|
9
|
-
# 1. Bump version in package.json (if --version given)
|
|
10
|
-
# 2. Create annotated git tag v<version>
|
|
11
|
-
# 3. Build (npm run build:publish)
|
|
12
|
-
# 4. Publish to npm (npm publish)
|
|
13
|
-
# 5. Push tag to origin (so GitHub Actions finishes the release)
|
|
14
|
-
#
|
|
15
|
-
# Requires: npm login (NPM_TOKEN in ~/.npmrc), git push access
|
|
16
|
-
set -euo pipefail
|
|
17
|
-
cd "$(dirname "$0")/.."
|
|
18
|
-
|
|
19
|
-
VERSION="${1:-}"
|
|
20
|
-
if [ -z "$VERSION" ]; then
|
|
21
|
-
VERSION=$(node -p "require('./package.json').version")
|
|
22
|
-
echo "→ Using current version from package.json: $VERSION"
|
|
23
|
-
else
|
|
24
|
-
# Strip leading v if provided
|
|
25
|
-
VERSION="${VERSION#v}"
|
|
26
|
-
node -e "const p=require('./package.json'); p.version='$VERSION'; require('fs').writeFileSync('package.json', JSON.stringify(p, null, 2)+'\n')"
|
|
27
|
-
echo "→ Bumped package.json version to $VERSION"
|
|
28
|
-
git add package.json
|
|
29
|
-
git commit -m "chore: bump version to v${VERSION}" || echo " (nothing to commit)"
|
|
30
|
-
fi
|
|
31
|
-
|
|
32
|
-
TAG="v${VERSION}"
|
|
33
|
-
|
|
34
|
-
# ── Check prerequisites ────────────────────────────────────────────────────
|
|
35
|
-
if ! git diff --cached --quiet 2>/dev/null; then
|
|
36
|
-
echo "⚠ You have staged but uncommitted changes. Commit or stash them first."
|
|
37
|
-
exit 1
|
|
38
|
-
fi
|
|
39
|
-
|
|
40
|
-
echo ""
|
|
41
|
-
echo "═══ aegiscodex- release v${VERSION} ═══"
|
|
42
|
-
|
|
43
|
-
# ── Tag ────────────────────────────────────────────────────────────────────
|
|
44
|
-
if git rev-parse "$TAG" >/dev/null 2>&1; then
|
|
45
|
-
echo "→ Tag $TAG already exists locally."
|
|
46
|
-
else
|
|
47
|
-
git tag -a "$TAG" -m "Release ${TAG}"
|
|
48
|
-
echo "→ Created tag $TAG"
|
|
49
|
-
fi
|
|
50
|
-
|
|
51
|
-
# ── Build ──────────────────────────────────────────────────────────────────
|
|
52
|
-
echo "→ Building..."
|
|
53
|
-
npm run build:publish
|
|
54
|
-
|
|
55
|
-
# ── Publish to npm ─────────────────────────────────────────────────────────
|
|
56
|
-
echo "→ Publishing to npm..."
|
|
57
|
-
npm publish --access public
|
|
58
|
-
|
|
59
|
-
# ── Push tag ───────────────────────────────────────────────────────────────
|
|
60
|
-
echo "→ Pushing tag $TAG to origin..."
|
|
61
|
-
git push origin "$TAG"
|
|
62
|
-
|
|
63
|
-
echo ""
|
|
64
|
-
echo "═══ Done — release v${VERSION} published to npm ═══"
|
|
65
|
-
echo " Tag: $TAG (pushed to origin)"
|
|
66
|
-
echo " npm: https://www.npmjs.com/package/aegiscode/v/${VERSION}"
|
|
67
|
-
echo ""
|
|
68
|
-
echo "GitHub Actions will now pick up the tag and create the GitHub Release."
|
package/scripts/repro-compact.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Verification: store-side (emergency) auto-compact in aegiscodex-
|
|
3
|
-
*
|
|
4
|
-
* Two properties the fix must hold:
|
|
5
|
-
* 1. No shadowing — the store-side path sits ABOVE the UI autoCompactThreshold,
|
|
6
|
-
* so growing up to (but below) the emergency fraction does NOT fire it,
|
|
7
|
-
* leaving normal compaction to the UI's LLM-quality path.
|
|
8
|
-
* 2. No balloon — once past the emergency threshold, continued growth re-fires
|
|
9
|
-
* it (no wall-clock cooldown), so context can't grow to 2× the window during
|
|
10
|
-
* a rapid burst of large turns.
|
|
11
|
-
*/
|
|
12
|
-
import { ContextManager } from '/home/neo/aegiscodex-/src/context/ContextManager.js';
|
|
13
|
-
|
|
14
|
-
const MAX_CTX = 24000;
|
|
15
|
-
const UI_FRACTION = 0.5; // UI path compacts here (LLM quality)
|
|
16
|
-
const EMERGENCY = Math.floor(MAX_CTX * 0.9); // store-side emergency threshold
|
|
17
|
-
|
|
18
|
-
async function run(label: string, threshold: number, iterations: number) {
|
|
19
|
-
const cm = new ContextManager({ compressionThreshold: threshold });
|
|
20
|
-
await cm.createSession();
|
|
21
|
-
|
|
22
|
-
const filler = 'The quick brown fox jumps over the lazy dog repeatedly. '.repeat(30); // ~1800 chars
|
|
23
|
-
let compactCount = 0;
|
|
24
|
-
const origLog = console.log;
|
|
25
|
-
(console as any).log = (...args: any[]) => {
|
|
26
|
-
if (args.join(' ').includes('[CompactionService] Fast compact')) compactCount++;
|
|
27
|
-
};
|
|
28
|
-
for (let i = 0; i < iterations; i++) {
|
|
29
|
-
await cm.addMessage('user', `user message ${i}: ${filler}`);
|
|
30
|
-
await cm.addMessage('assistant', `assistant reply ${i}: ${filler}`);
|
|
31
|
-
}
|
|
32
|
-
(console as any).log = origLog;
|
|
33
|
-
|
|
34
|
-
const tokens = cm.getTokenCount();
|
|
35
|
-
console.log(`\n=== ${label} ===`);
|
|
36
|
-
console.log('store-side compactions fired:', compactCount);
|
|
37
|
-
console.log('final store token count:', tokens);
|
|
38
|
-
await cm.cleanup();
|
|
39
|
-
return { compactCount, tokens };
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
async function main() {
|
|
43
|
-
// 1. Below emergency: grow to ~60% of window. Store-side must NOT fire.
|
|
44
|
-
const below = await run('Below emergency (UI owns compaction)', EMERGENCY, 4);
|
|
45
|
-
console.log('shadowing avoided (0 store compactions expected):', below.compactCount === 0 ? 'PASS' : 'FAIL');
|
|
46
|
-
|
|
47
|
-
// 2. Rapid large burst past emergency. Store-side must fire repeatedly and
|
|
48
|
-
// keep context bounded (no 60s cooldown blocking → no 2× balloon).
|
|
49
|
-
const burst = await run('Rapid burst past emergency', EMERGENCY, 120);
|
|
50
|
-
const balloonLimit = EMERGENCY * 1.5;
|
|
51
|
-
console.log('\n=== Summary ===');
|
|
52
|
-
console.log('emergency threshold:', EMERGENCY, '| balloon guard (<1.5×):', Math.floor(balloonLimit));
|
|
53
|
-
console.log('re-fired on continued growth (>1 compaction):', burst.compactCount > 1 ? 'PASS' : 'FAIL',
|
|
54
|
-
`(fired ${burst.compactCount}×)`);
|
|
55
|
-
console.log('context stayed bounded (<1.5× emergency):', burst.tokens < balloonLimit ? 'PASS' : 'FAIL',
|
|
56
|
-
`(final ${burst.tokens})`);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
main().catch(e => { console.error(e); process.exit(1); });
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reproduce the interactive turn flow: ContextManager.addMessage for each
|
|
3
|
-
* user/assistant turn, then the post-turn recount from useCommandProcessor.
|
|
4
|
-
* Verify the stored token count tracks the actual conversation.
|
|
5
|
-
*/
|
|
6
|
-
import { ContextManager } from '../src/context/ContextManager.js';
|
|
7
|
-
import { TokenCounter } from '../src/context/TokenCounter.js';
|
|
8
|
-
|
|
9
|
-
async function main() {
|
|
10
|
-
const cm = new ContextManager({});
|
|
11
|
-
await cm.createSession();
|
|
12
|
-
|
|
13
|
-
// Simulate what useCommandProcessor does per turn, with realistic content
|
|
14
|
-
const turns = 8;
|
|
15
|
-
for (let i = 0; i < turns; i++) {
|
|
16
|
-
const userMsg = `Turn ${i}: please review the function at src/agent/Agent.ts, explain the auto-compact logic, and tell me whether the inter-turn truncation respects the reserved response budget. ${'Details: '.repeat(3)}${i}`;
|
|
17
|
-
const assistantMsg = `## Analysis (turn ${i})\n\nThe auto-compact path checks TokenCounter.estimateMessagesTokens first, then falls back to the exact BPE count when over threshold. The reserved response budget of 10k tokens is subtracted from maxTokens before truncation, so a long tool output cannot starve the final answer.\n\n| step | tokens |\n|------|--------|\n| pre-filter | ~${100 + i * 50} |\n| exact count | ${200 + i * 100} |\n\nThis is a moderately long assistant reply to simulate real conversation bulk across many turns. ${'words '.repeat(10)}end.`;
|
|
18
|
-
|
|
19
|
-
// 1. user message (ContextManager.addMessage)
|
|
20
|
-
await cm.addMessage('user', userMsg);
|
|
21
|
-
|
|
22
|
-
// 2. assistant message (ContextManager.addMessage)
|
|
23
|
-
await cm.addMessage('assistant', assistantMsg);
|
|
24
|
-
|
|
25
|
-
// 3. post-turn recount (useCommandProcessor lines 427-431)
|
|
26
|
-
const modelName = 'claude-sonnet-4-20250514';
|
|
27
|
-
const totalTokens = TokenCounter.countTokens(
|
|
28
|
-
cm.getMessages().map(m => ({ role: m.role as any, content: m.content })),
|
|
29
|
-
modelName
|
|
30
|
-
);
|
|
31
|
-
cm.updateTokenCount(totalTokens);
|
|
32
|
-
|
|
33
|
-
const stored = cm.getTokenCount();
|
|
34
|
-
const raw = cm.getContext()!.layers.conversation.messages.length;
|
|
35
|
-
console.log(`after turn ${i + 1}: store=${stored} tokens, msgs=${raw}`);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const final = cm.getTokenCount();
|
|
39
|
-
console.log('\n=== RESULT ===');
|
|
40
|
-
console.log('turns:', turns, '| final stored token count:', final);
|
|
41
|
-
console.log(final > 4000 ? 'PASS: /compact would proceed' : 'FAIL: /compact would refuse (stuck under 4000)');
|
|
42
|
-
await cm.cleanup();
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
main().catch(e => { console.error(e); process.exit(1); });
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// aegiscode only uses @xenova/transformers for text embeddings (all-MiniLM-L6-v2),
|
|
2
|
-
// never image inputs — so the real `sharp` native binary (and its install-time
|
|
3
|
-
// prebuild-install download, a recurring source of `npm install` failures on
|
|
4
|
-
// flaky networks/unsupported platforms) is unneeded dead weight. This stub
|
|
5
|
-
// satisfies `import sharp from 'sharp'` without pulling in native bindings.
|
|
6
|
-
function sharp() {
|
|
7
|
-
throw new Error('sharp is stubbed out in aegiscode — image processing is not supported');
|
|
8
|
-
}
|
|
9
|
-
module.exports = sharp;
|