aegiscode 6.5.2 → 6.5.3
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/package.json +1 -1
- package/src/app.js +31 -2
- package/src/deps.js +9 -1
- package/vendor/desktop/lib/local/prompt.js +9 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aegiscode",
|
|
3
3
|
"productName": "AEGIS Code",
|
|
4
|
-
"version": "6.5.
|
|
4
|
+
"version": "6.5.3",
|
|
5
5
|
"description": "aegiscode \u2014 the command-line version of AEGIS Desktop. The shared tool surface in your shell, over the same thin transport and tool registry as the MCP plugin and the desktop app. Ships transport + UI only; no brain.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "AEGIS Code",
|
package/src/app.js
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
const readline = require('node:readline');
|
|
22
22
|
const os = require('node:os');
|
|
23
23
|
const { randomUUID } = require('node:crypto');
|
|
24
|
-
const { createTools, createClient, usageTokens } = require('./deps.js');
|
|
24
|
+
const { createTools, createClient, usageTokens, buildSystemPrompt } = require('./deps.js');
|
|
25
25
|
const { createEngine } = require('./engine.js');
|
|
26
26
|
const { GLYPH, VERBS, themeOf, RESET, THEME_TABLE } = require('./theme.js');
|
|
27
27
|
const { LiveRegion, termWidth, w } = require('./screen.js');
|
|
@@ -41,6 +41,30 @@ const { fmtTokens, fmtEur, maskKey } = require('./format.js');
|
|
|
41
41
|
|
|
42
42
|
const VERSION = require('../package.json').version;
|
|
43
43
|
|
|
44
|
+
/**
|
|
45
|
+
* The persona for a turn this host did not get an explicit system prompt for.
|
|
46
|
+
*
|
|
47
|
+
* Built once and cached: it is the stable head of every request, and a prompt
|
|
48
|
+
* that changed between turns would defeat the provider's prompt cache for the
|
|
49
|
+
* whole conversation behind it.
|
|
50
|
+
*/
|
|
51
|
+
let _defaultSystem = null;
|
|
52
|
+
function defaultSystemPrompt() {
|
|
53
|
+
if (_defaultSystem === null) {
|
|
54
|
+
try {
|
|
55
|
+
_defaultSystem = buildSystemPrompt({
|
|
56
|
+
platform: process.platform,
|
|
57
|
+
arch: process.arch,
|
|
58
|
+
homedir: os.homedir(),
|
|
59
|
+
cwd: process.cwd(),
|
|
60
|
+
});
|
|
61
|
+
} catch {
|
|
62
|
+
_defaultSystem = ''; // never let persona construction break a turn
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return _defaultSystem || undefined;
|
|
66
|
+
}
|
|
67
|
+
|
|
44
68
|
function createApp(options = {}) {
|
|
45
69
|
const opts = {
|
|
46
70
|
model: null,
|
|
@@ -458,7 +482,12 @@ function createApp(options = {}) {
|
|
|
458
482
|
prompt,
|
|
459
483
|
messages: history,
|
|
460
484
|
model: commandCtx.model || undefined,
|
|
461
|
-
system
|
|
485
|
+
// A caller-supplied system wins; otherwise the shared persona. Sent
|
|
486
|
+
// explicitly rather than left to the server, because the pooled
|
|
487
|
+
// route takes the system prompt from the request and the CLI was
|
|
488
|
+
// sending none — the model got tool schemas and no rule about when
|
|
489
|
+
// to use them.
|
|
490
|
+
system: opts.system || defaultSystemPrompt(),
|
|
462
491
|
maxTokens: opts.maxTokens,
|
|
463
492
|
// `effort` is the pooled budget control, and it travels on every turn
|
|
464
493
|
// — this host only ever runs the 'aegis' class, whose calls are sized
|
package/src/deps.js
CHANGED
|
@@ -59,12 +59,19 @@ const enginePath = resolveShared(path.join('desktop', 'lib', 'local', 'engine.js
|
|
|
59
59
|
// Subagent role presets (/agents lists these; the model's task tool delegates
|
|
60
60
|
// to them by name) — lives beside engine.js, staged into the same vendor dir.
|
|
61
61
|
const agentsPath = resolveShared(path.join('desktop', 'lib', 'local', 'agents.js'));
|
|
62
|
+
// The persona the tool loop runs under. The CLI sent NO system prompt at all,
|
|
63
|
+
// so a pooled turn reached the model as a bare user message plus tool schemas
|
|
64
|
+
// with nothing saying when a tool is appropriate — which is how "hey" started
|
|
65
|
+
// running shell commands. Same file as the GUI, for the same reason engine.js
|
|
66
|
+
// is: two personas would drift, and only one of them would get fixed.
|
|
67
|
+
const promptPath = resolveShared(path.join('desktop', 'lib', 'local', 'prompt.js'));
|
|
62
68
|
|
|
63
69
|
const { createClient } = require(clientPath);
|
|
64
70
|
const { createTools } = require(toolsPath);
|
|
65
71
|
const { usageTokens } = require(usagePath);
|
|
66
72
|
const { createLocalEngine } = require(enginePath);
|
|
67
73
|
const { agentRoles, agentRoleLabel } = require(agentsPath);
|
|
74
|
+
const { buildSystemPrompt } = require(promptPath);
|
|
68
75
|
|
|
69
76
|
module.exports = {
|
|
70
77
|
createClient,
|
|
@@ -73,6 +80,7 @@ module.exports = {
|
|
|
73
80
|
createLocalEngine,
|
|
74
81
|
agentRoles,
|
|
75
82
|
agentRoleLabel,
|
|
76
|
-
|
|
83
|
+
buildSystemPrompt,
|
|
84
|
+
paths: { client: clientPath, tools: toolsPath, usage: usagePath, engine: enginePath, agents: agentsPath, prompt: promptPath },
|
|
77
85
|
roots,
|
|
78
86
|
};
|
|
@@ -31,8 +31,15 @@ const MAIN_CHAT_PROMPT =
|
|
|
31
31
|
`- Use tools silently. A one-line reason is enough; do not narrate your plan as a story. ` +
|
|
32
32
|
`- Never claim what a tool found or what a command returned before the tool actually runs. ` +
|
|
33
33
|
` Report only the results you really received. ` +
|
|
34
|
-
`-
|
|
35
|
-
`
|
|
34
|
+
`- Match the response to the request. A greeting, a question about something you already ` +
|
|
35
|
+
` know, or a request for an opinion is answered in plain words with NO tools. Only reach ` +
|
|
36
|
+
` for a tool when the answer genuinely depends on something in this repo or on this ` +
|
|
37
|
+
` machine. "hey" is not a task.\n` +
|
|
38
|
+
`- WHEN THE USER HAS ASKED FOR WORK: act, don't just inspect. After at most 2 rounds of ` +
|
|
39
|
+
` reading or exploration, start making changes with writeFile or editFile. Reconnaissance ` +
|
|
40
|
+
` is not progress — implement, then verify. This rule is about HOW to carry out a task you ` +
|
|
41
|
+
` were given; it is never a reason to invent one. Never write or modify a file the user ` +
|
|
42
|
+
` did not ask you to touch.\n` +
|
|
36
43
|
`- When you have what you need, stop using tools and give a concise, direct answer to the ` +
|
|
37
44
|
` user's question. Never end your turn with an intention like "Let me check…" or "I'll now…" ` +
|
|
38
45
|
` — that is not an answer. ` +
|