aegiscode 7.0.24 → 7.0.26
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 +7 -3
- package/scripts/check.mjs +52 -1
- package/scripts/demo.mjs +94 -1
- package/scripts/predist.mjs +75 -1
- package/scripts/runtests.mjs +56 -1
- package/scripts/seal-gate.mjs +74 -1
- package/src/agents.js +139 -1
- package/src/app.js +2957 -1
- package/src/art.js +289 -1
- package/src/chatflow.js +3023 -1
- package/src/checkpoint.js +90 -1
- package/src/clipboard.js +424 -1
- package/src/cloudsync.js +528 -1
- package/src/commands.js +4089 -1
- package/src/config.js +581 -1
- package/src/connect.js +349 -1
- package/src/credentials.js +33 -1
- package/src/deps.js +232 -1
- package/src/devrun.js +187 -1
- package/src/diff.js +333 -1
- package/src/diffview.js +296 -1
- package/src/engine.js +297 -1
- package/src/entitlement.js +355 -1
- package/src/events.js +707 -1
- package/src/export.js +67 -1
- package/src/filepreview.js +153 -1
- package/src/fingerprint.js +592 -1
- package/src/format.js +259 -1
- package/src/fuzzy.js +119 -1
- package/src/history.js +423 -1
- package/src/init.js +175 -1
- package/src/input.js +139 -1
- package/src/keys.js +183 -1
- package/src/markdown.js +306 -1
- package/src/models.js +507 -1
- package/src/naming.js +57 -1
- package/src/overlays.js +462 -1
- package/src/panels.js +1418 -1
- package/src/ping.js +226 -1
- package/src/presence.js +238 -1
- package/src/render.js +516 -1
- package/src/screen.js +518 -1
- package/src/screens.js +896 -1
- package/src/secret.js +59 -1
- package/src/securefs.js +359 -1
- package/src/settings.js +155 -1
- package/src/shared.js +52 -1
- package/src/sharedpaths.js +53 -1
- package/src/signup.js +156 -1
- package/src/summarize.js +95 -1
- package/src/sysdiag.js +585 -1
- package/src/system.js +40 -1
- package/src/theme.js +570 -1
- package/src/title.js +220 -1
- package/src/todos.js +115 -1
- package/src/tokens.js +263 -1
- package/src/topup.js +210 -1
- package/src/update.js +191 -1
- package/vendor/client/aegis.js +2441 -1
- package/vendor/client/attest.js +518 -1
- package/vendor/client/authorship-key.js +410 -1
- package/vendor/client/auto-provision.js +134 -1
- package/vendor/client/brain-catalog.js +268 -1
- package/vendor/client/byok-catalog.js +199 -1
- package/vendor/client/catalog-client.js +487 -1
- package/vendor/client/conversation-export.js +177 -1
- package/vendor/client/credentials.js +494 -1
- package/vendor/client/device-fingerprint.js +141 -1
- package/vendor/client/drive-connect.js +110 -1
- package/vendor/client/drive-upload.js +234 -1
- package/vendor/client/env-file.js +1273 -1
- package/vendor/client/fingerprint.js +1064 -1
- package/vendor/client/foreign-memory.js +669 -1
- package/vendor/client/google-signin.js +133 -1
- package/vendor/client/hooks.js +430 -1
- package/vendor/client/model-discovery.js +373 -1
- package/vendor/client/naming.js +283 -1
- package/vendor/client/platform.js +937 -1
- package/vendor/client/prefs.js +351 -1
- package/vendor/client/presence-constants.js +107 -1
- package/vendor/client/presence.js +438 -1
- package/vendor/client/record-vault.js +1055 -3
- package/vendor/client/session-store.js +575 -1
- package/vendor/client/topup.js +297 -1
- package/vendor/client/touch.js +458 -1
- package/vendor/client/update.js +763 -1
- package/vendor/client/user-models.js +381 -1
- package/vendor/desktop/lib/local/agents.js +105 -1
- package/vendor/desktop/lib/local/attachments.js +276 -1
- package/vendor/desktop/lib/local/autonomous.js +1045 -1
- package/vendor/desktop/lib/local/claude-pro.js +1028 -1
- package/vendor/desktop/lib/local/context.js +125 -1
- package/vendor/desktop/lib/local/engine.js +3666 -1
- package/vendor/desktop/lib/local/entitlement.js +660 -1
- package/vendor/desktop/lib/local/git-scope.js +228 -1
- package/vendor/desktop/lib/local/local.js +2145 -1
- package/vendor/desktop/lib/local/prompt.js +280 -1
- package/vendor/desktop/lib/local/queue.js +560 -1
- package/vendor/desktop/lib/local/session-rounds.js +238 -1
- package/vendor/desktop/lib/local/spill.js +75 -1
- package/vendor/desktop/lib/local/turn-guard.js +300 -1
- package/vendor/desktop/lib/local/worktree-lock.js +235 -1
- package/vendor/desktop/lib/settings.js +890 -1
- package/vendor/desktop/renderer/usage.js +1239 -1
- package/vendor/hosts/install.js +638 -1
- package/vendor/hosts/openai-shim.js +515 -1
- package/vendor/hosts/spec.js +164 -1
- package/vendor/hosts/targets.js +346 -1
- package/vendor/mcp/server.js +221 -1
- package/vendor/mcp/tools.js +408 -1
- package/vendor/one/src/child.js +285 -1
- package/vendor/one/src/permissions.js +383 -1
- package/SOURCE-OFFER.txt +0 -9
|
@@ -1,3 +1,282 @@
|
|
|
1
1
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
2
|
// Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
|
|
3
|
-
|
|
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
|
+
* prompt.js — the desktop client's system prompt (client half of
|
|
10
|
+
* the upstream engine's tool calling).
|
|
11
|
+
*
|
|
12
|
+
* The upstream engine sends a real persona on every provider turn
|
|
13
|
+
* (src/backend.js MAIN_CHAT_PROMPT plus a docs/operating-context.md block).
|
|
14
|
+
* The desktop renderer used to send nothing at all, so every model answered a
|
|
15
|
+
* bare user string with no identity, no work rules and no idea which machine
|
|
16
|
+
* it was on — hence the "which OS are you using?" round trips.
|
|
17
|
+
*
|
|
18
|
+
* MAIN_CHAT_PROMPT below is the same identity + truthfulness rule set, ported
|
|
19
|
+
* verbatim where it still applies, including the CLI's "delegate with the
|
|
20
|
+
* task tool" rule now that the desktop has a subagent runner (engine.js
|
|
21
|
+
* runSubagent). One naming deviation from the CLI text: the tool names are
|
|
22
|
+
* readFile/writeFile/editFile/listDir/glob/grep/exec/task (lowerCamelCase,
|
|
23
|
+
* matching this repo's existing tool vocabulary — see
|
|
24
|
+
* desktop/lib/local/tools.js) rather than the CLI's Read/Write/Edit/Grep/
|
|
25
|
+
* Bash/Task.
|
|
26
|
+
*
|
|
27
|
+
* The environment preamble names the platform, the home directory and the
|
|
28
|
+
* repo roots the host already knows (main.js), so the model stops asking.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/** Identity + work rules. Ported from the upstream engine reference. */
|
|
32
|
+
const MAIN_CHAT_PROMPT =
|
|
33
|
+
`You are Aegiscodex, a terminal coding assistant working in the user's repository: read and ` +
|
|
34
|
+
`reason about code, write and edit files, run shell commands, investigate bugs. Work rules:\n` +
|
|
35
|
+
`- Output is billed by the token and is the largest line on the bill, so spend it where it is ` +
|
|
36
|
+
` read. Before a tool call, one short sentence on what you are about to find out. Do NOT ` +
|
|
37
|
+
` restate file contents, diffs, command output or test results the user can already see. ` +
|
|
38
|
+
` Finish with the answer in a few lines — expand only when asked to explain, or when the ` +
|
|
39
|
+
` change's correctness depends on a detail the user must check.\n` +
|
|
40
|
+
`- Batch independent tool calls into ONE turn: read several files, or grep for several ` +
|
|
41
|
+
` patterns, at once, or use one exec command that does the whole job. Every round ` +
|
|
42
|
+
` re-sends the prefix and bills fresh output; one call per round is the expensive shape.\n` +
|
|
43
|
+
`- Edit in one call, not one hunk per round: editFile takes an \`edits\` array, so every hunk ` +
|
|
44
|
+
` you already know about for one file goes in a single call. A fix you can see is a fix you ` +
|
|
45
|
+
` can also write without asking the tool anything in between.\n` +
|
|
46
|
+
`- Run the thing you changed before you call it done. A patch you never executed is a ` +
|
|
47
|
+
` hypothesis; when the repo has a test or repro command, run it (or the narrowest slice of ` +
|
|
48
|
+
` it) and report what it printed. If you cannot run it, say which command you would have run. ` +
|
|
49
|
+
`- Use tools silently. A one-line reason is enough; do not narrate your plan as a story. ` +
|
|
50
|
+
`- Never claim what a tool found or what a command returned before the tool actually runs. ` +
|
|
51
|
+
` Report only the results you really received. ` + `- Before starting a fix or feature, check whether they have asked for it before and whether ` +
|
|
52
|
+
` it was delivered: recalled memory, \`queue.jsonl\`, \`PLAN.md\`/notes and \`git log\` — ` +
|
|
53
|
+
` ONE batched command over sources that exist: if the Environment block says this ` +
|
|
54
|
+
` directory has no version control, skip it. ` +
|
|
55
|
+
` If it was resolved before and the problem is back, report how it was resolved and ` +
|
|
56
|
+
` why it regressed, then fix the cause — never re-fix blind as if it were new. ` +
|
|
57
|
+
` If it was never met, say so plainly before starting. ` +
|
|
58
|
+
`- Match the response to the request. A greeting, a question you already know the answer to, ` +
|
|
59
|
+
` or a request for an opinion is answered in plain words with NO tools. Reach for a tool ` +
|
|
60
|
+
` only when the answer depends on something in this repo or on this machine. ` +
|
|
61
|
+
` "hey" is not a task.\n` +
|
|
62
|
+
`- WHEN THE USER HAS ASKED FOR WORK: act, don't just inspect. After at most 2 rounds of ` +
|
|
63
|
+
` reading or exploration, start making changes with writeFile or editFile. Reconnaissance ` +
|
|
64
|
+
` is not progress — implement, then verify. This is about HOW to carry out a task you were ` +
|
|
65
|
+
` given; it is never a reason to invent one. Never write or modify a file the user ` +
|
|
66
|
+
` did not ask you to touch.\n` +
|
|
67
|
+
`- Zero tolerance for stalling: once the cause is identified and only the edit remains, make ` +
|
|
68
|
+
` it in the same turn. Never end a turn with an empty or no-op response, or a "let me ` +
|
|
69
|
+
` continue"/"I'll now…" placeholder when the user says continue — that wastes their turn. ` +
|
|
70
|
+
` This has been flagged as non-compliance before; treat it as a hard rule. ` +
|
|
71
|
+
`- When you have what you need, stop using tools and give a concise, direct answer. Never ` +
|
|
72
|
+
` end a turn with an intention like "Let me check…" — that is not an answer. ` +
|
|
73
|
+
`- When a focused multi-step sub-task can be delegated, use the task tool to spawn a ` +
|
|
74
|
+
` specialist subagent rather than doing it inline. ` +
|
|
75
|
+
`- If the user references a workflow you don't recognize, inspect the repo/scripts for that ` +
|
|
76
|
+
` mechanism before acting.`;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The tool line: what each tool is, and the two facts a schema cannot carry.
|
|
80
|
+
*
|
|
81
|
+
* It used to restate the path rule in full — absolute, `~` expansion, relative
|
|
82
|
+
* resolution — which `PATH_ARG_DESC` already says once per path argument in nine
|
|
83
|
+
* schemas. That duplication is what `d01068b` unwound from the schemas; this is
|
|
84
|
+
* the other end of it. What stays is the part no schema carries: the
|
|
85
|
+
* platform-specific example (the one form a model gets wrong) and the persistent
|
|
86
|
+
* shell, which is a property of the session rather than an argument.
|
|
87
|
+
*/
|
|
88
|
+
const TOOL_LINE =
|
|
89
|
+
'Tools: readFile, writeFile, editFile, listDir, glob, grep, exec, task. Paths are absolute ' +
|
|
90
|
+
'in the form THIS machine uses (see the Environment block): on win32 that means ' +
|
|
91
|
+
'C:\\Users\\you\\Desktop\\file.txt, not /home/you/Desktop/file.txt or /tmp/file.txt. ' +
|
|
92
|
+
'exec runs in a persistent shell session — cd and exported env vars carry across calls ' +
|
|
93
|
+
'within the turn. task spawns a specialist subagent (its own tool loop, same model).';
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* One durable-language entry as a sentence fragment, accepting the three shapes
|
|
97
|
+
* a host can hand in without this file growing a dependency on the avatar
|
|
98
|
+
* module that produces them: a bare string, `{ code, name }`, or a folded
|
|
99
|
+
* profile facet `{ key, value }` (whose `value` is already prose —
|
|
100
|
+
* "writes durably in Swedish (sv), so reply in Swedish unless asked otherwise" —
|
|
101
|
+
* and is preferred as-is rather than re-rendered into something longer).
|
|
102
|
+
*/
|
|
103
|
+
function languageLine(entry) {
|
|
104
|
+
if (typeof entry === 'string') return entry.trim();
|
|
105
|
+
if (!entry || typeof entry !== 'object') return '';
|
|
106
|
+
if (typeof entry.value === 'string' && entry.value.trim()) return entry.value.trim();
|
|
107
|
+
const name = typeof entry.name === 'string' ? entry.name.trim() : '';
|
|
108
|
+
const code = typeof entry.code === 'string' ? entry.code.trim() : typeof entry.key === 'string' ? entry.key.trim() : '';
|
|
109
|
+
if (name && code) return `${name} (${code})`;
|
|
110
|
+
return name || code;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Render the environment preamble. Everything is optional: a missing field is
|
|
115
|
+
* simply omitted, so a headless caller can build a persona with nothing but
|
|
116
|
+
* the identity block.
|
|
117
|
+
*/
|
|
118
|
+
function environmentPreamble(env = {}) {
|
|
119
|
+
const {
|
|
120
|
+
platform,
|
|
121
|
+
arch,
|
|
122
|
+
homedir,
|
|
123
|
+
desktopdir,
|
|
124
|
+
dataDir,
|
|
125
|
+
locale,
|
|
126
|
+
localeName,
|
|
127
|
+
languages,
|
|
128
|
+
cwd,
|
|
129
|
+
vcs,
|
|
130
|
+
shell,
|
|
131
|
+
shellKind,
|
|
132
|
+
roots,
|
|
133
|
+
appVersion,
|
|
134
|
+
model,
|
|
135
|
+
} = env || {};
|
|
136
|
+
const bits = [];
|
|
137
|
+
if (platform) bits.push(`platform: ${platform}${arch ? ` (${arch})` : ''}`);
|
|
138
|
+
// The other half of "who and where is this machine": the platform line says
|
|
139
|
+
// what it runs, this says what language its user is in. It was the ONE
|
|
140
|
+
// environment fact a turn never carried, and the consequence was visible —
|
|
141
|
+
// the model mirrored whatever language the message arrived in and otherwise
|
|
142
|
+
// fell back to this prompt's English, so a Swedish user could not stop being
|
|
143
|
+
// greeted in English and a one-word request ("städa") arrived with no
|
|
144
|
+
// language to be read in.
|
|
145
|
+
if (locale) {
|
|
146
|
+
const base = String(locale).split('-')[0].toLowerCase();
|
|
147
|
+
const name = localeName ? ` (${localeName})` : '';
|
|
148
|
+
// The instruction is only load-bearing for a NON-English host: English is
|
|
149
|
+
// this prompt's own language, so "reply in English" would be noise that
|
|
150
|
+
// competes with whatever language the request is actually written in.
|
|
151
|
+
bits.push(
|
|
152
|
+
base === 'en'
|
|
153
|
+
? `locale: ${locale}${name}`
|
|
154
|
+
: `locale: ${locale}${name} — the user's own machine and account run in this language, ` +
|
|
155
|
+
'so expect requests written in it and answer in the language the user writes to you ' +
|
|
156
|
+
'in. Use this to resolve an otherwise ambiguous request (a bare path, a pasted ' +
|
|
157
|
+
'error, a one-word command) — never to override a request written in another language.'
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
// Durable EVIDENCE, which is deliberately a separate line from `locale`: one
|
|
161
|
+
// is how the machine is configured, the other is what the user's own saved
|
|
162
|
+
// writing is in, and they can disagree (an English-configured machine used by
|
|
163
|
+
// someone who writes Swedish all day). The request in front of the model
|
|
164
|
+
// still outranks both, so the line says so rather than reading as an order to
|
|
165
|
+
// switch languages.
|
|
166
|
+
const langLines = (Array.isArray(languages) ? languages : [])
|
|
167
|
+
.map((entry) => languageLine(entry))
|
|
168
|
+
.filter(Boolean);
|
|
169
|
+
if (langLines.length) {
|
|
170
|
+
bits.push(
|
|
171
|
+
`recorded language evidence from the user's own saved writing: ${langLines.join('; ')} — ` +
|
|
172
|
+
'the language of the request in front of you always wins; this is evidence, not an ' +
|
|
173
|
+
'instruction to switch'
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
if (homedir) bits.push(`home directory: ${homedir}`);
|
|
177
|
+
// Named explicitly because `~/Desktop` is a GUESS that is wrong on two of the
|
|
178
|
+
// three platforms this app ships to: OneDrive folder redirection moves it on
|
|
179
|
+
// Windows, and a localised Linux session translates the directory itself
|
|
180
|
+
// (a Swedish desktop has ~/Skrivbord and no ~/Desktop). "Put this on my
|
|
181
|
+
// desktop" is a real request, and this is the line that makes it land.
|
|
182
|
+
if (desktopdir) {
|
|
183
|
+
bits.push(
|
|
184
|
+
`desktop directory: ${desktopdir} — use this exact path when the user says "my desktop"; ` +
|
|
185
|
+
'do NOT build it yourself from the home directory',
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
// Same failure mode as the desktop line, one directory over, and reported
|
|
189
|
+
// live: asked about the AEGIS data directory, DeepSeek emitted
|
|
190
|
+
// `C:\Users\Dator.aegiscode` — the home directory with the separator dropped —
|
|
191
|
+
// got an empty listing, and concluded the store did not exist. The path is
|
|
192
|
+
// given verbatim AND the wrong form is named, because a model reading a
|
|
193
|
+
// missing path cannot tell a typo from an empty directory.
|
|
194
|
+
if (dataDir) {
|
|
195
|
+
bits.push(
|
|
196
|
+
`AEGIS data directory: ${dataDir} — the store itself (config, sessions, ` +
|
|
197
|
+
'credentials, queue). Use this exact path; do NOT append it to the home directory ' +
|
|
198
|
+
'yourself, because a dropped separator ("C:\\Users\\you.aegiscode") names a path that ' +
|
|
199
|
+
'does not exist and looks like an empty directory rather than a mistake',
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
if (cwd) bits.push(`working directory: ${cwd}`);
|
|
203
|
+
// The version-control fact, which turns the work rules' "check whether this
|
|
204
|
+
// was already delivered" from a guess into a decision. Measured: in a temp
|
|
205
|
+
// workspace with no `.git`, the model still ran `git log` on its second round
|
|
206
|
+
// of all three tasks, spent a round on a guaranteed failure, and carried the
|
|
207
|
+
// error into the rest of the turn. Stated only when the host actually probed
|
|
208
|
+
// (`null`/`undefined` means "could not tell", and silence beats a wrong fact).
|
|
209
|
+
if (vcs === 'git') {
|
|
210
|
+
bits.push(
|
|
211
|
+
`version control: this directory IS inside a git work tree, so \`git log\`, ` +
|
|
212
|
+
'`git diff` and `git status` are usable for checking what was already done',
|
|
213
|
+
);
|
|
214
|
+
} else if (vcs === '') {
|
|
215
|
+
bits.push(
|
|
216
|
+
`version control: this directory is NOT a git repository and has no history to ` +
|
|
217
|
+
'consult — do NOT run `git log`, `git diff`, `git blame` or `git status`; they ' +
|
|
218
|
+
'fail here and cost a round. Read the files that exist instead',
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
if (shell) bits.push(`exec shell: ${shell}${shellKind ? ` (${shellKind})` : ''}`);
|
|
222
|
+
if (model) bits.push(`model: ${model}`);
|
|
223
|
+
if (appVersion) bits.push(`AEGIS Desktop ${appVersion}`);
|
|
224
|
+
|
|
225
|
+
const rootList = Array.isArray(roots) ? roots.filter(Boolean) : [];
|
|
226
|
+
const lines = [];
|
|
227
|
+
if (bits.length) lines.push(bits.join('\n'));
|
|
228
|
+
if (rootList.length) {
|
|
229
|
+
lines.push(`repo roots:\n${rootList.map((r) => ` - ${r}`).join('\n')}`);
|
|
230
|
+
}
|
|
231
|
+
// The command dialect, stated as an instruction rather than left for the model
|
|
232
|
+
// to infer from `platform: win32`. Inference is what failed: a model handed a
|
|
233
|
+
// Windows machine still reached for `ls`, `cat`, `grep` and `mkdir -p`, none
|
|
234
|
+
// of which exist in PowerShell, so every exec call failed until it guessed.
|
|
235
|
+
const dialect = commandDialectLine(platform, shellKind);
|
|
236
|
+
if (dialect) lines.push(dialect);
|
|
237
|
+
if (!lines.length) return '';
|
|
238
|
+
return `# Environment\n${lines.join('\n')}`;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* How `exec` commands must be written on this host. Empty when the platform is
|
|
243
|
+
* unknown — a guess here would be worse than silence.
|
|
244
|
+
*/
|
|
245
|
+
function commandDialectLine(platform, shellKind) {
|
|
246
|
+
if (!platform) return '';
|
|
247
|
+
if (platform === 'win32') {
|
|
248
|
+
return (
|
|
249
|
+
`This is Windows: exec runs ${shellKind === 'powershell' ? 'PowerShell' : 'a Windows shell'}, ` +
|
|
250
|
+
'so use Windows-native commands — Get-ChildItem/dir, Get-Content/type, Select-String/findstr, ' +
|
|
251
|
+
'where, New-Item -ItemType Directory — NOT ls, cat, grep, mkdir -p, touch or rm -rf, which do ' +
|
|
252
|
+
'not exist here. Separate paths with \\, and never assume /tmp, /usr or /home exist.'
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
if (platform === 'darwin') {
|
|
256
|
+
return (
|
|
257
|
+
'This is macOS: exec runs a POSIX shell and the standard Unix commands are available, but the ' +
|
|
258
|
+
'userland is BSD, not GNU — sed -i needs an argument (sed -i \'\'), and readlink -f, ' +
|
|
259
|
+
'date -d and sed -r are absent. Prefer portable forms, or python3.'
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
return 'This is a POSIX host: the standard Unix commands are available in exec.';
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* The full system prompt for a desktop chat turn: identity + work rules +
|
|
267
|
+
* the tool line + the environment block. Never empty.
|
|
268
|
+
*/
|
|
269
|
+
function buildSystemPrompt(env = {}) {
|
|
270
|
+
const parts = [MAIN_CHAT_PROMPT, TOOL_LINE];
|
|
271
|
+
const preamble = environmentPreamble(env);
|
|
272
|
+
if (preamble) parts.push(preamble);
|
|
273
|
+
return parts.join('\n\n');
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
module.exports = {
|
|
277
|
+
MAIN_CHAT_PROMPT,
|
|
278
|
+
TOOL_LINE,
|
|
279
|
+
environmentPreamble,
|
|
280
|
+
commandDialectLine,
|
|
281
|
+
buildSystemPrompt,
|
|
282
|
+
};
|