aura-code 0.5.0 → 0.10.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/README.md +47 -164
- package/dist/agent/affect.d.ts +13 -0
- package/dist/agent/affect.js +34 -0
- package/dist/agent/affect.js.map +1 -0
- package/dist/agent/compactor.d.ts +27 -4
- package/dist/agent/compactor.js +185 -54
- package/dist/agent/compactor.js.map +1 -1
- package/dist/agent/confess.d.ts +35 -0
- package/dist/agent/confess.js +296 -0
- package/dist/agent/confess.js.map +1 -0
- package/dist/agent/domain-expertise.d.ts +22 -0
- package/dist/agent/domain-expertise.js +110 -0
- package/dist/agent/domain-expertise.js.map +1 -0
- package/dist/agent/executive-queue.d.ts +26 -0
- package/dist/agent/executive-queue.js +50 -0
- package/dist/agent/executive-queue.js.map +1 -0
- package/dist/agent/generational-flush.d.ts +28 -0
- package/dist/agent/generational-flush.js +48 -0
- package/dist/agent/generational-flush.js.map +1 -0
- package/dist/agent/loop-profile.d.ts +50 -0
- package/dist/agent/loop-profile.js +88 -0
- package/dist/agent/loop-profile.js.map +1 -0
- package/dist/agent/loop.d.ts +14 -5
- package/dist/agent/loop.js +167 -23
- package/dist/agent/loop.js.map +1 -1
- package/dist/agent/memory-consolidate.d.ts +14 -0
- package/dist/agent/memory-consolidate.js +141 -0
- package/dist/agent/memory-consolidate.js.map +1 -0
- package/dist/agent/mixture.d.ts +33 -0
- package/dist/agent/mixture.js +138 -0
- package/dist/agent/mixture.js.map +1 -0
- package/dist/agent/spawner.js +2 -2
- package/dist/agent/spawner.js.map +1 -1
- package/dist/agent/system-prompt.d.ts +1 -1
- package/dist/agent/system-prompt.js +49 -13
- package/dist/agent/system-prompt.js.map +1 -1
- package/dist/agent/unified-memory.d.ts +15 -0
- package/dist/agent/unified-memory.js +164 -0
- package/dist/agent/unified-memory.js.map +1 -0
- package/dist/checkpoints/engine.d.ts +44 -0
- package/dist/checkpoints/engine.js +324 -0
- package/dist/checkpoints/engine.js.map +1 -0
- package/dist/cli/command-palette.d.ts +26 -0
- package/dist/cli/command-palette.js +133 -0
- package/dist/cli/command-palette.js.map +1 -0
- package/dist/cli/context-health.d.ts +51 -0
- package/dist/cli/context-health.js +187 -0
- package/dist/cli/context-health.js.map +1 -0
- package/dist/cli/diamond.d.ts +67 -0
- package/dist/cli/diamond.js +222 -12
- package/dist/cli/diamond.js.map +1 -1
- package/dist/cli/dic.d.ts +2 -0
- package/dist/cli/dic.js +106 -0
- package/dist/cli/dic.js.map +1 -0
- package/dist/cli/diff-view.d.ts +18 -0
- package/dist/cli/diff-view.js +114 -0
- package/dist/cli/diff-view.js.map +1 -0
- package/dist/cli/display.d.ts +18 -4
- package/dist/cli/display.js +74 -146
- package/dist/cli/display.js.map +1 -1
- package/dist/cli/help-data.d.ts +7 -0
- package/dist/cli/help-data.js +80 -0
- package/dist/cli/help-data.js.map +1 -0
- package/dist/cli/index.js +1001 -788
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/markdown.d.ts +5 -0
- package/dist/cli/markdown.js +128 -0
- package/dist/cli/markdown.js.map +1 -0
- package/dist/cli/model-select.d.ts +39 -0
- package/dist/cli/model-select.js +65 -0
- package/dist/cli/model-select.js.map +1 -0
- package/dist/cli/tui.d.ts +34 -0
- package/dist/cli/tui.js +1176 -0
- package/dist/cli/tui.js.map +1 -0
- package/dist/config/defaults.d.ts +6 -17
- package/dist/config/defaults.js +25 -39
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/project-config.d.ts +2 -6
- package/dist/config/project-config.js +2 -2
- package/dist/config/project-config.js.map +1 -1
- package/dist/doctor/checks.d.ts +18 -0
- package/dist/doctor/checks.js +524 -0
- package/dist/doctor/checks.js.map +1 -0
- package/dist/doctor/index.d.ts +4 -0
- package/dist/doctor/index.js +229 -0
- package/dist/doctor/index.js.map +1 -0
- package/dist/doctor/repair.d.ts +19 -0
- package/dist/doctor/repair.js +126 -0
- package/dist/doctor/repair.js.map +1 -0
- package/dist/doctor/types.d.ts +38 -0
- package/dist/doctor/types.js +10 -0
- package/dist/doctor/types.js.map +1 -0
- package/dist/dream/dream.d.ts +79 -36
- package/dist/dream/dream.js +327 -117
- package/dist/dream/dream.js.map +1 -1
- package/dist/dream/episode.d.ts +17 -0
- package/dist/dream/episode.js +116 -0
- package/dist/dream/episode.js.map +1 -0
- package/dist/dream/okf.d.ts +10 -0
- package/dist/dream/okf.js +280 -0
- package/dist/dream/okf.js.map +1 -0
- package/dist/dream/parser.d.ts +60 -0
- package/dist/dream/parser.js +176 -0
- package/dist/dream/parser.js.map +1 -0
- package/dist/dream/reconcile.d.ts +69 -0
- package/dist/dream/reconcile.js +303 -0
- package/dist/dream/reconcile.js.map +1 -0
- package/dist/kanban/engine.d.ts +26 -0
- package/dist/kanban/engine.js +208 -0
- package/dist/kanban/engine.js.map +1 -0
- package/dist/kanban/types.d.ts +19 -0
- package/dist/kanban/types.js +9 -1
- package/dist/kanban/types.js.map +1 -1
- package/dist/machina/index.d.ts +16 -0
- package/dist/machina/index.js +61 -0
- package/dist/machina/index.js.map +1 -0
- package/dist/machina/render-html.d.ts +2 -0
- package/dist/machina/render-html.js +191 -0
- package/dist/machina/render-html.js.map +1 -0
- package/dist/machina/render-terminal.d.ts +2 -0
- package/dist/machina/render-terminal.js +99 -0
- package/dist/machina/render-terminal.js.map +1 -0
- package/dist/machina/repair.d.ts +23 -0
- package/dist/machina/repair.js +98 -0
- package/dist/machina/repair.js.map +1 -0
- package/dist/machina/spec.d.ts +61 -0
- package/dist/machina/spec.js +124 -0
- package/dist/machina/spec.js.map +1 -0
- package/dist/machina/verify.d.ts +39 -0
- package/dist/machina/verify.js +95 -0
- package/dist/machina/verify.js.map +1 -0
- package/dist/mining/extract.d.ts +34 -0
- package/dist/mining/extract.js +229 -0
- package/dist/mining/extract.js.map +1 -0
- package/dist/mining/refine.d.ts +28 -0
- package/dist/mining/refine.js +256 -0
- package/dist/mining/refine.js.map +1 -0
- package/dist/perception/extractor.js +5 -3
- package/dist/perception/extractor.js.map +1 -1
- package/dist/perception/graph-store.d.ts +0 -11
- package/dist/perception/graph-store.js +0 -33
- package/dist/perception/graph-store.js.map +1 -1
- package/dist/perception/index.d.ts +1 -1
- package/dist/perception/index.js +1 -2
- package/dist/perception/index.js.map +1 -1
- package/dist/plugins/commands.d.ts +38 -0
- package/dist/plugins/commands.js +134 -0
- package/dist/plugins/commands.js.map +1 -0
- package/dist/plugins/frontmatter.d.ts +14 -0
- package/dist/plugins/frontmatter.js +78 -0
- package/dist/plugins/frontmatter.js.map +1 -0
- package/dist/plugins/hooks.d.ts +12 -0
- package/dist/plugins/hooks.js +148 -0
- package/dist/plugins/hooks.js.map +1 -0
- package/dist/plugins/loader.d.ts +7 -0
- package/dist/plugins/loader.js +255 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/plugins/market.d.ts +23 -0
- package/dist/plugins/market.js +281 -0
- package/dist/plugins/market.js.map +1 -0
- package/dist/plugins/types.d.ts +90 -0
- package/dist/plugins/types.js +20 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/providers/anthropic-oauth-draft.d.ts +119 -0
- package/dist/providers/anthropic-oauth-draft.js +414 -0
- package/dist/providers/anthropic-oauth-draft.js.map +1 -0
- package/dist/providers/anthropic.d.ts +4 -1
- package/dist/providers/anthropic.js +34 -6
- package/dist/providers/anthropic.js.map +1 -1
- package/dist/providers/factory.d.ts +71 -14
- package/dist/providers/factory.js +205 -124
- package/dist/providers/factory.js.map +1 -1
- package/dist/providers/google.js +8 -21
- package/dist/providers/google.js.map +1 -1
- package/dist/providers/live-models.d.ts +23 -0
- package/dist/providers/live-models.js +145 -0
- package/dist/providers/live-models.js.map +1 -0
- package/dist/providers/openai-compatible.d.ts +1 -12
- package/dist/providers/openai-compatible.js +71 -108
- package/dist/providers/openai-compatible.js.map +1 -1
- package/dist/providers/resilient-factory.js +1 -1
- package/dist/providers/resilient-factory.js.map +1 -1
- package/dist/rem/graph.d.ts +72 -0
- package/dist/rem/graph.js +139 -0
- package/dist/rem/graph.js.map +1 -0
- package/dist/rem/index.d.ts +16 -0
- package/dist/rem/index.js +60 -0
- package/dist/rem/index.js.map +1 -0
- package/dist/rem/render-html.d.ts +2 -0
- package/dist/rem/render-html.js +189 -0
- package/dist/rem/render-html.js.map +1 -0
- package/dist/rem/render-terminal.d.ts +4 -0
- package/dist/rem/render-terminal.js +94 -0
- package/dist/rem/render-terminal.js.map +1 -0
- package/dist/repl/queue.d.ts +22 -0
- package/dist/repl/queue.js +165 -0
- package/dist/repl/queue.js.map +1 -0
- package/dist/repl/side-channel.d.ts +23 -0
- package/dist/repl/side-channel.js +63 -0
- package/dist/repl/side-channel.js.map +1 -0
- package/dist/research/council.d.ts +5 -2
- package/dist/research/council.js +73 -10
- package/dist/research/council.js.map +1 -1
- package/dist/ruby/alternator.d.ts +11 -30
- package/dist/ruby/alternator.js +59 -38
- package/dist/ruby/alternator.js.map +1 -1
- package/dist/ruby/episode-capture.d.ts +0 -10
- package/dist/ruby/episode-capture.js +0 -33
- package/dist/ruby/episode-capture.js.map +1 -1
- package/dist/ruby/types.js +1 -1
- package/dist/ruby/types.js.map +1 -1
- package/dist/safety/path-jail.d.ts +17 -0
- package/dist/safety/path-jail.js +100 -0
- package/dist/safety/path-jail.js.map +1 -0
- package/dist/safety/permissions.d.ts +12 -21
- package/dist/safety/permissions.js +81 -216
- package/dist/safety/permissions.js.map +1 -1
- package/dist/safety/ssrf.d.ts +29 -0
- package/dist/safety/ssrf.js +185 -0
- package/dist/safety/ssrf.js.map +1 -0
- package/dist/server/index.js +64 -10
- package/dist/server/index.js.map +1 -1
- package/dist/setup/first-run.d.ts +0 -24
- package/dist/setup/first-run.js +10 -344
- package/dist/setup/first-run.js.map +1 -1
- package/dist/setup/key-store.d.ts +12 -0
- package/dist/setup/key-store.js +108 -0
- package/dist/setup/key-store.js.map +1 -0
- package/dist/setup/provider-registry.js +31 -18
- package/dist/setup/provider-registry.js.map +1 -1
- package/dist/setup/provider-test.d.ts +7 -0
- package/dist/setup/provider-test.js +73 -10
- package/dist/setup/provider-test.js.map +1 -1
- package/dist/setup/provider-wizard.d.ts +4 -1
- package/dist/setup/provider-wizard.js +92 -26
- package/dist/setup/provider-wizard.js.map +1 -1
- package/dist/setup/xiaomi.d.ts +1 -1
- package/dist/setup/xiaomi.js +3 -3
- package/dist/setup/xiaomi.js.map +1 -1
- package/dist/tools/browser.js +6 -4
- package/dist/tools/browser.js.map +1 -1
- package/dist/tools/clipboard.js +7 -1
- package/dist/tools/clipboard.js.map +1 -1
- package/dist/tools/dictate.d.ts +60 -0
- package/dist/tools/dictate.js +983 -0
- package/dist/tools/dictate.js.map +1 -0
- package/dist/tools/dictate_patched.js +1057 -0
- package/dist/tools/edit-file.js +10 -2
- package/dist/tools/edit-file.js.map +1 -1
- package/dist/tools/gmail-tool.d.ts +5 -1
- package/dist/tools/gmail-tool.js +151 -11
- package/dist/tools/gmail-tool.js.map +1 -1
- package/dist/tools/http-request.js +14 -4
- package/dist/tools/http-request.js.map +1 -1
- package/dist/tools/image-read.js +34 -2
- package/dist/tools/image-read.js.map +1 -1
- package/dist/tools/index.d.ts +16 -1
- package/dist/tools/index.js +59 -8
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/mcp.js +12 -0
- package/dist/tools/mcp.js.map +1 -1
- package/dist/tools/read-file.js +10 -14
- package/dist/tools/read-file.js.map +1 -1
- package/dist/tools/telegram-audio-policy.d.ts +30 -0
- package/dist/tools/telegram-audio-policy.js +49 -0
- package/dist/tools/telegram-audio-policy.js.map +1 -0
- package/dist/tools/telegram-bot.js +1136 -539
- package/dist/tools/telegram-bot.js.map +1 -1
- package/dist/tools/telegram-voice.d.ts +18 -5
- package/dist/tools/telegram-voice.js +54 -12
- package/dist/tools/telegram-voice.js.map +1 -1
- package/dist/tools/telegram.d.ts +3 -3
- package/dist/tools/telegram.js +5 -84
- package/dist/tools/telegram.js.map +1 -1
- package/dist/tools/tools.d.ts +2 -14
- package/dist/tools/tools.js +79 -144
- package/dist/tools/tools.js.map +1 -1
- package/dist/tools/web-fetch.js +39 -7
- package/dist/tools/web-fetch.js.map +1 -1
- package/dist/tools/web-search.js +2 -3
- package/dist/tools/web-search.js.map +1 -1
- package/dist/util/errors.js +1 -15
- package/dist/util/errors.js.map +1 -1
- package/dist/util/json-repair.d.ts +11 -0
- package/dist/util/json-repair.js +31 -0
- package/dist/util/json-repair.js.map +1 -0
- package/dist/util/rate-limiter.js +2 -8
- package/dist/util/rate-limiter.js.map +1 -1
- package/dist/viz/index.js +793 -792
- package/dist/viz/index.js.map +1 -1
- package/dist/viz/reader.d.ts +33 -0
- package/dist/viz/reader.js +343 -0
- package/dist/viz/reader.js.map +1 -0
- package/package.json +13 -32
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.consolidateMemory = consolidateMemory;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const os = __importStar(require("os"));
|
|
40
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
41
|
+
// Memory consolidation — one-time (idempotent) migration that merges the 8
|
|
42
|
+
// overlapping ~/.aura/memory namespaces into a clean structure:
|
|
43
|
+
//
|
|
44
|
+
// identity.json — global identity/facts, prompt-visible everywhere
|
|
45
|
+
// (who Dušan is, who Aura is, preferences, relationship)
|
|
46
|
+
// project.json — machine/project state that isn't identity
|
|
47
|
+
// (paths, recovery notes, service state, tool locations)
|
|
48
|
+
//
|
|
49
|
+
// Originals are backed up to ~/.aura/memory/.pre-unify-<ts>/ first. Conflicting
|
|
50
|
+
// values for the same canonical key are PRESERVED as a CONFLICT entry rather
|
|
51
|
+
// than silently picking a winner (that's where auto-dedupe goes wrong).
|
|
52
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
53
|
+
const MEMORY_DIR = path.join(os.homedir(), '.aura', 'memory');
|
|
54
|
+
// Keys that describe WHO Dušan/Aura are (global identity) vs machine state.
|
|
55
|
+
// Anything not listed as project-state defaults to identity.
|
|
56
|
+
const PROJECT_STATE_KEYS = new Set([
|
|
57
|
+
'learnlight', 'linux-login-recovery', 'webcam-surveillance',
|
|
58
|
+
'update-on-other-machines', 'personal-tools-location',
|
|
59
|
+
'personal-content-save-location', 'sluzbeni-glasnik-grupa',
|
|
60
|
+
'desktop-install-options', 'telegram-bot-status-line',
|
|
61
|
+
'lessonprep_automation_path', 'clipai-pro', 'aura_code_path',
|
|
62
|
+
'aura_code_status', 'system-recovery-state-2026-06-30',
|
|
63
|
+
'weekly-backup-system', 'root-overflow-protection',
|
|
64
|
+
]);
|
|
65
|
+
// Namespaces that hold identity-ish content and should be merged.
|
|
66
|
+
const SOURCE_NAMESPACES = ['default', 'user', 'user_prefs', 'relationship', 'aura-core'];
|
|
67
|
+
function loadJson(file) {
|
|
68
|
+
try {
|
|
69
|
+
return fs.existsSync(file) ? JSON.parse(fs.readFileSync(file, 'utf8')) : {};
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return {};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function norm(s) {
|
|
76
|
+
return s.replace(/\s+/g, ' ').trim().toLowerCase();
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Merge the identity namespaces into identity.json + project.json.
|
|
80
|
+
* Idempotent: if identity.json already exists it does nothing (unless force).
|
|
81
|
+
*/
|
|
82
|
+
function consolidateMemory(opts = {}) {
|
|
83
|
+
const identityFile = path.join(MEMORY_DIR, 'identity.json');
|
|
84
|
+
const projectFile = path.join(MEMORY_DIR, 'project.json');
|
|
85
|
+
if (!opts.force && fs.existsSync(identityFile)) {
|
|
86
|
+
return { backupDir: '', identityKeys: 0, projectKeys: 0, conflicts: [], alreadyDone: true };
|
|
87
|
+
}
|
|
88
|
+
fs.mkdirSync(MEMORY_DIR, { recursive: true });
|
|
89
|
+
// 1. Back up every source namespace first.
|
|
90
|
+
const backupDir = path.join(MEMORY_DIR, `.pre-unify-${Date.now()}`);
|
|
91
|
+
fs.mkdirSync(backupDir, { recursive: true });
|
|
92
|
+
for (const ns of [...SOURCE_NAMESPACES, 'identity', 'project']) {
|
|
93
|
+
const f = path.join(MEMORY_DIR, `${ns}.json`);
|
|
94
|
+
if (fs.existsSync(f))
|
|
95
|
+
fs.copyFileSync(f, path.join(backupDir, `${ns}.json`));
|
|
96
|
+
}
|
|
97
|
+
const identity = {};
|
|
98
|
+
const project = {};
|
|
99
|
+
const conflicts = [];
|
|
100
|
+
// 2. Merge. A key already present with a DIFFERENT value becomes a CONFLICT
|
|
101
|
+
// entry that keeps both, tagged with their source namespaces.
|
|
102
|
+
const place = (target, ns, key, entry) => {
|
|
103
|
+
const existing = target[key];
|
|
104
|
+
if (!existing) {
|
|
105
|
+
target[key] = { value: entry.value, updated: entry.updated };
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (norm(existing.value) === norm(entry.value))
|
|
109
|
+
return; // true duplicate — keep one
|
|
110
|
+
// Genuine conflict: preserve both instead of picking a winner.
|
|
111
|
+
const conflictKey = `${key}__CONFLICT`;
|
|
112
|
+
if (!target[conflictKey]) {
|
|
113
|
+
target[conflictKey] = {
|
|
114
|
+
value: `[CONFLICT — reconcile manually]\n(A) ${existing.value}\n(B, from ${ns}) ${entry.value}`,
|
|
115
|
+
updated: new Date().toISOString(),
|
|
116
|
+
};
|
|
117
|
+
conflicts.push(key);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
target[conflictKey].value += `\n(+, from ${ns}) ${entry.value}`;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
for (const ns of SOURCE_NAMESPACES) {
|
|
124
|
+
const store = loadJson(path.join(MEMORY_DIR, `${ns}.json`));
|
|
125
|
+
for (const [key, entry] of Object.entries(store)) {
|
|
126
|
+
const target = PROJECT_STATE_KEYS.has(key) ? project : identity;
|
|
127
|
+
place(target, ns, key, entry);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
// 3. Write the consolidated stores.
|
|
131
|
+
fs.writeFileSync(identityFile, JSON.stringify(identity, null, 2), 'utf8');
|
|
132
|
+
fs.writeFileSync(projectFile, JSON.stringify(project, null, 2), 'utf8');
|
|
133
|
+
return {
|
|
134
|
+
backupDir,
|
|
135
|
+
identityKeys: Object.keys(identity).length,
|
|
136
|
+
projectKeys: Object.keys(project).length,
|
|
137
|
+
conflicts,
|
|
138
|
+
alreadyDone: false,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=memory-consolidate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-consolidate.js","sourceRoot":"","sources":["../../src/agent/memory-consolidate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,8CA+DC;AA7HD,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AAEzB,gFAAgF;AAChF,2EAA2E;AAC3E,gEAAgE;AAChE,EAAE;AACF,sEAAsE;AACtE,4EAA4E;AAC5E,+DAA+D;AAC/D,4EAA4E;AAC5E,EAAE;AACF,gFAAgF;AAChF,6EAA6E;AAC7E,wEAAwE;AACxE,gFAAgF;AAEhF,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAK9D,4EAA4E;AAC5E,6DAA6D;AAC7D,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC;IACjC,YAAY,EAAE,sBAAsB,EAAE,qBAAqB;IAC3D,0BAA0B,EAAE,yBAAyB;IACrD,gCAAgC,EAAE,wBAAwB;IAC1D,yBAAyB,EAAE,0BAA0B;IACrD,4BAA4B,EAAE,YAAY,EAAE,gBAAgB;IAC5D,kBAAkB,EAAE,kCAAkC;IACtD,sBAAsB,EAAE,0BAA0B;CACnD,CAAC,CAAC;AAEH,kEAAkE;AAClE,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;AAEzF,SAAS,QAAQ,CAAC,IAAY;IAC5B,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,UAAU,CAAC,IAAI,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C,KAAK,IAAI,cAAc,EAAE,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC;QAClE,CAAC;IACH,CAAC,CAAC;IAEF,KAAK,MAAM,EAAE,IAAI,iBAAiB,EAAE,CAAC;QACnC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;QAC5D,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACjD,MAAM,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC;YAChE,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;IAED,oCAAoC;IACpC,EAAE,CAAC,aAAa,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAC1E,EAAE,CAAC,aAAa,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAExE,OAAO;QACL,SAAS;QACT,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM;QAC1C,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM;QACxC,SAAS;QACT,WAAW,EAAE,KAAK;KACnB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mixture of Agents — Phase 2: parallel domain sub-agents.
|
|
3
|
+
*
|
|
4
|
+
* For exploratory-shaped tasks (per loop-profile.ts — that's where ambiguity
|
|
5
|
+
* actually benefits from multiple angles), fan out 2-3 read-only sub-agents
|
|
6
|
+
* in parallel, each framed with a different domain lens, then synthesize
|
|
7
|
+
* their reports into one answer with a real model call.
|
|
8
|
+
*
|
|
9
|
+
* Design constraints (see docs/MIXTURE_OF_AGENTS.md):
|
|
10
|
+
* - Read-only only — parallel sub-agents never edit files.
|
|
11
|
+
* - Gated by task shape AND an explicit opt-in (--moa). The N-call cost is
|
|
12
|
+
* real; it stays off the default path until benchmarks justify it.
|
|
13
|
+
* - Synthesis is an actual provider call — reconciling N expert opinions
|
|
14
|
+
* is judgment, not pattern matching.
|
|
15
|
+
*/
|
|
16
|
+
import type { LLMProvider } from '../providers/types.js';
|
|
17
|
+
import type { ProjectContext } from './context.js';
|
|
18
|
+
import type { Display } from '../cli/display.js';
|
|
19
|
+
import type { LoopResult } from './loop.js';
|
|
20
|
+
export interface MixtureOptions {
|
|
21
|
+
provider: LLMProvider;
|
|
22
|
+
task: string;
|
|
23
|
+
context: ProjectContext;
|
|
24
|
+
display: Display;
|
|
25
|
+
/** Optional model pricing id, as in LoopOptions. */
|
|
26
|
+
pricingModel?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Run the mixture: N parallel read-only sub-agents + one synthesis call.
|
|
30
|
+
* Returns a LoopResult so callers can treat it exactly like a single-agent
|
|
31
|
+
* run (summary display, cost footer, exit codes).
|
|
32
|
+
*/
|
|
33
|
+
export declare function runMixtureOfAgents(opts: MixtureOptions): Promise<LoopResult>;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Mixture of Agents — Phase 2: parallel domain sub-agents.
|
|
4
|
+
*
|
|
5
|
+
* For exploratory-shaped tasks (per loop-profile.ts — that's where ambiguity
|
|
6
|
+
* actually benefits from multiple angles), fan out 2-3 read-only sub-agents
|
|
7
|
+
* in parallel, each framed with a different domain lens, then synthesize
|
|
8
|
+
* their reports into one answer with a real model call.
|
|
9
|
+
*
|
|
10
|
+
* Design constraints (see docs/MIXTURE_OF_AGENTS.md):
|
|
11
|
+
* - Read-only only — parallel sub-agents never edit files.
|
|
12
|
+
* - Gated by task shape AND an explicit opt-in (--moa). The N-call cost is
|
|
13
|
+
* real; it stays off the default path until benchmarks justify it.
|
|
14
|
+
* - Synthesis is an actual provider call — reconciling N expert opinions
|
|
15
|
+
* is judgment, not pattern matching.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.runMixtureOfAgents = runMixtureOfAgents;
|
|
19
|
+
const loop_js_1 = require("./loop.js");
|
|
20
|
+
const permissions_js_1 = require("../safety/permissions.js");
|
|
21
|
+
const domain_expertise_js_1 = require("./domain-expertise.js");
|
|
22
|
+
/**
|
|
23
|
+
* Sub-agent streams would interleave garbage if they all wrote to the real
|
|
24
|
+
* display. Mute everything except warnings/errors, which are rare and
|
|
25
|
+
* worth surfacing (prefixed so the user can tell whose they are).
|
|
26
|
+
*/
|
|
27
|
+
function mutedDisplay(base, label) {
|
|
28
|
+
return {
|
|
29
|
+
agentThinking: () => { },
|
|
30
|
+
streamText: () => { },
|
|
31
|
+
streamEnd: () => { },
|
|
32
|
+
toolStart: () => { },
|
|
33
|
+
toolCall: () => { },
|
|
34
|
+
toolResult: () => { },
|
|
35
|
+
toolBlocked: () => { },
|
|
36
|
+
warning: (msg) => base.warning(`[${label}] ${msg}`),
|
|
37
|
+
success: () => { },
|
|
38
|
+
error: (msg) => base.error(`[${label}] ${msg}`),
|
|
39
|
+
header: () => { },
|
|
40
|
+
summary: () => { },
|
|
41
|
+
showPlan: () => { },
|
|
42
|
+
stepStarted: () => { },
|
|
43
|
+
stepCompleted: () => { },
|
|
44
|
+
contextBar: () => { },
|
|
45
|
+
contextDashboard: () => { },
|
|
46
|
+
compactionEvent: () => { },
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function perspectiveTask(lens, task) {
|
|
50
|
+
return [
|
|
51
|
+
`You are investigating as a ${lens} specialist. You are in read-only mode — do not modify any files or run state-changing commands.`,
|
|
52
|
+
'',
|
|
53
|
+
`Task: ${task}`,
|
|
54
|
+
'',
|
|
55
|
+
`Investigate the codebase strictly from the ${lens} angle. Your final message must be a compact report:`,
|
|
56
|
+
'1. FINDINGS — concrete observations with file paths / line references.',
|
|
57
|
+
`2. ANSWER — the most likely explanation or answer from the ${lens} perspective.`,
|
|
58
|
+
'3. CONFIDENCE — low / medium / high, with one sentence why.',
|
|
59
|
+
].join('\n');
|
|
60
|
+
}
|
|
61
|
+
const SYNTHESIS_SYSTEM = [
|
|
62
|
+
'You are synthesizing reports from parallel specialist investigators who each examined the same task from a different angle.',
|
|
63
|
+
'Reconcile them into ONE answer: where they agree, state it plainly; where they conflict, weigh confidence and evidence and say which reading you trust and why.',
|
|
64
|
+
'Do not enumerate the reports back — produce the merged answer a user should act on, citing file paths the specialists found.',
|
|
65
|
+
].join(' ');
|
|
66
|
+
/**
|
|
67
|
+
* Run the mixture: N parallel read-only sub-agents + one synthesis call.
|
|
68
|
+
* Returns a LoopResult so callers can treat it exactly like a single-agent
|
|
69
|
+
* run (summary display, cost footer, exit codes).
|
|
70
|
+
*/
|
|
71
|
+
async function runMixtureOfAgents(opts) {
|
|
72
|
+
const { provider, task, context, display } = opts;
|
|
73
|
+
const domains = (0, domain_expertise_js_1.classifyDomains)(task);
|
|
74
|
+
const lenses = domains.length > 0
|
|
75
|
+
? [...domains, 'generalist']
|
|
76
|
+
: ['architecture', 'generalist'];
|
|
77
|
+
display.header('Mixture of Agents', `${lenses.length} parallel read-only perspectives: ${lenses.join(', ')}`);
|
|
78
|
+
const runs = await Promise.all(lenses.map((lens) => (0, loop_js_1.runAgentLoop)({
|
|
79
|
+
provider,
|
|
80
|
+
task: perspectiveTask(lens, task),
|
|
81
|
+
context,
|
|
82
|
+
permissions: new permissions_js_1.PermissionSystem('read-only'),
|
|
83
|
+
display: mutedDisplay(display, lens),
|
|
84
|
+
// Sub-agents must not fan out further — one level of parallelism.
|
|
85
|
+
disableSpawn: true,
|
|
86
|
+
pricingModel: opts.pricingModel,
|
|
87
|
+
}).catch((e) => ({
|
|
88
|
+
success: false,
|
|
89
|
+
summary: `Perspective failed: ${String(e)}`,
|
|
90
|
+
turns: 0, toolCallCount: 0,
|
|
91
|
+
usage: { inputTokens: 0, outputTokens: 0, totalTokens: 0 },
|
|
92
|
+
costUsd: 0, history: [], toolCallLog: [],
|
|
93
|
+
}))));
|
|
94
|
+
runs.forEach((r, i) => {
|
|
95
|
+
display.success(`[${lenses[i]}] ${r.success ? 'reported' : 'failed'} — ${r.turns} turns, $${r.costUsd.toFixed(4)}`);
|
|
96
|
+
});
|
|
97
|
+
const usage = runs.reduce((acc, r) => ({
|
|
98
|
+
inputTokens: acc.inputTokens + r.usage.inputTokens,
|
|
99
|
+
outputTokens: acc.outputTokens + r.usage.outputTokens,
|
|
100
|
+
totalTokens: acc.totalTokens + r.usage.totalTokens,
|
|
101
|
+
}), { inputTokens: 0, outputTokens: 0, totalTokens: 0 });
|
|
102
|
+
const turns = runs.reduce((n, r) => n + r.turns, 0);
|
|
103
|
+
const toolCallCount = runs.reduce((n, r) => n + r.toolCallCount, 0);
|
|
104
|
+
let costUsd = runs.reduce((c, r) => c + r.costUsd, 0);
|
|
105
|
+
const succeeded = runs.filter((r) => r.success);
|
|
106
|
+
if (succeeded.length === 0) {
|
|
107
|
+
return {
|
|
108
|
+
success: false,
|
|
109
|
+
summary: `All ${lenses.length} perspectives failed:\n${runs.map((r, i) => `[${lenses[i]}] ${r.summary}`).join('\n')}`,
|
|
110
|
+
turns, toolCallCount, usage, costUsd, history: [], toolCallLog: [],
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
const reports = runs
|
|
114
|
+
.map((r, i) => `## Report from the ${lenses[i]} specialist${r.success ? '' : ' (FAILED — weigh accordingly)'}\n\n${r.summary}`)
|
|
115
|
+
.join('\n\n');
|
|
116
|
+
display.agentThinking();
|
|
117
|
+
const synthesis = await provider.complete(SYNTHESIS_SYSTEM, [
|
|
118
|
+
{ role: 'user', content: `Original task: ${task}\n\n${reports}` },
|
|
119
|
+
], []);
|
|
120
|
+
const su = synthesis.usage;
|
|
121
|
+
if (su) {
|
|
122
|
+
usage.inputTokens += su.inputTokens ?? 0;
|
|
123
|
+
usage.outputTokens += su.outputTokens ?? 0;
|
|
124
|
+
usage.totalTokens += (su.inputTokens ?? 0) + (su.outputTokens ?? 0);
|
|
125
|
+
costUsd += (0, loop_js_1.costFor)(opts.pricingModel ?? provider.model, su.inputTokens ?? 0, su.outputTokens ?? 0);
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
success: true,
|
|
129
|
+
summary: synthesis.text || '(Synthesis produced no output)',
|
|
130
|
+
turns: turns + 1,
|
|
131
|
+
toolCallCount,
|
|
132
|
+
usage,
|
|
133
|
+
costUsd,
|
|
134
|
+
history: [{ role: 'user', content: task }, { role: 'assistant', content: synthesis.text }],
|
|
135
|
+
toolCallLog: runs.flatMap((r) => r.toolCallLog),
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=mixture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mixture.js","sourceRoot":"","sources":["../../src/agent/mixture.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAuEH,gDA8EC;AA/ID,uCAAkD;AAClD,6DAA4D;AAC5D,+DAAwD;AAWxD;;;;GAIG;AACH,SAAS,YAAY,CAAC,IAAa,EAAE,KAAa;IAChD,OAAO;QACL,aAAa,EAAE,GAAG,EAAE,GAAE,CAAC;QACvB,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC;QACpB,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC;QACnB,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC;QACnB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;QAClB,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC;QACpB,WAAW,EAAE,GAAG,EAAE,GAAE,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E,EAAE,CAAC,WAAW,IAAI,CAAC,EAAE,EAAE,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC;IACrG,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,SAAS,CAAC,IAAI,IAAI,gCAAgC;QAC3D,KAAK,EAAE,KAAK,GAAG,CAAC;QAChB,aAAa;QACb,KAAK;QACL,OAAO;QACP,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;QAC1F,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;KAChD,CAAC;AACJ,CAAC"}
|
package/dist/agent/spawner.js
CHANGED
|
@@ -39,7 +39,6 @@ exports.clearSpawner = clearSpawner;
|
|
|
39
39
|
exports.makeDefaultSpawner = makeDefaultSpawner;
|
|
40
40
|
exports.executeSpawnTask = executeSpawnTask;
|
|
41
41
|
const factory_js_1 = require("../providers/factory.js");
|
|
42
|
-
const defaults_js_1 = require("../config/defaults.js");
|
|
43
42
|
let active = null;
|
|
44
43
|
/**
|
|
45
44
|
* Wire up the spawn_task tool to a real implementation. Called by the
|
|
@@ -74,7 +73,8 @@ function makeDefaultSpawner(ctx, baseConfig, display) {
|
|
|
74
73
|
context: ctx,
|
|
75
74
|
permissions: new PermissionSystem(level),
|
|
76
75
|
display,
|
|
77
|
-
maxTurns:
|
|
76
|
+
// No explicit maxTurns: let loop-profile size the sub-agent's
|
|
77
|
+
// budget from its task shape, same as the top-level loop.
|
|
78
78
|
});
|
|
79
79
|
const cost = result.costUsd.toFixed(4);
|
|
80
80
|
return `[subagent ${model}]\n${result.summary}\n[cost: $${cost} · ${result.turns} turns · ${result.toolCallCount} tools]`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawner.js","sourceRoot":"","sources":["../../src/agent/spawner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"spawner.js","sourceRoot":"","sources":["../../src/agent/spawner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,0CAEC;AAED,oCAEC;AAKD,gDA8BC;AAED,4CAWC;AAjFD,wDAAyD;AAoBzD,IAAI,MAAM,GAAyB,IAAI,CAAC;AAExC;;;;GAIG;AACH,SAAgB,eAAe,CAAC,OAAsB;IACpD,MAAM,GAAG,OAAO,CAAC;AACnB,CAAC;AAED,SAAgB,YAAY;IAC1B,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAChC,GAAmB,EACnB,UAAqE,EACrE,OAAgB;IAEhB,OAAO;QACL,KAAK,CAAC,KAAK,CAAC,IAAkB;YAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,eAAe,CAAC;YAC5C,MAAM,QAAQ,GAAgB,IAAA,2BAAc,EAAC;gBAC3C,KAAK;gBACL,MAAM,EAAE,UAAU,CAAC,MAAM;gBACzB,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO;aAC5D,CAAC,CAAC;YACH,iEAAiE;YACjE,MAAM,EAAE,YAAY,EAAE,GAAG,wDAAa,WAAW,GAAC,CAAC;YACnD,MAAM,EAAE,gBAAgB,EAAE,GAAG,wDAAa,0BAA0B,GAAC,CAAC;YACtE,MAAM,KAAK,GAAyB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC;YACzE,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC;gBAChC,QAAQ;gBACR,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,OAAO,E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IAAI,EAAE,QAAQ,EAAG,WAAW,EAAE,yDAAyD,EAAE;YACpG,QAAQ,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,uFAAuF,EAAE;YAClI,GAAG,EAAM,EAAE,IAAI,EAAE,QAAQ,EAAG,WAAW,EAAE,8CAA8C,EAAE;SAC1F;QACD,QAAQ,EAAE,CAAC,MAAM,CAAC;KACnB;CACF,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ProjectContext } from './context.js';
|
|
2
|
-
export declare function buildSystemPrompt(ctx: ProjectContext, providerName: string, task
|
|
2
|
+
export declare function buildSystemPrompt(ctx: ProjectContext, providerName: string, task: string): string;
|
|
3
3
|
export declare function buildArchitectPrompt(task: string, projectRoot: string): string;
|
|
@@ -2,10 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildSystemPrompt = buildSystemPrompt;
|
|
4
4
|
exports.buildArchitectPrompt = buildArchitectPrompt;
|
|
5
|
-
const
|
|
5
|
+
const domain_expertise_js_1 = require("./domain-expertise.js");
|
|
6
|
+
const unified_memory_js_1 = require("./unified-memory.js");
|
|
7
|
+
const confess_js_1 = require("./confess.js");
|
|
8
|
+
const loader_js_1 = require("../plugins/loader.js");
|
|
9
|
+
const WEB_KEYWORDS = /website|webpage|frontend|front-end|ui component|landing page|homepage|web app|portfolio|hero section|marketing page|site design|visual design|html.*css|make.*page|create.*page|build.*site/;
|
|
6
10
|
function buildSystemPrompt(ctx, providerName, task) {
|
|
7
|
-
const
|
|
8
|
-
|
|
11
|
+
const domainBlock = (0, domain_expertise_js_1.getDomainPromptBlock)(task);
|
|
12
|
+
// Unified memory: global identity/facts (shared with the Telegram bot) plus
|
|
13
|
+
// this project's reconciled lessons. Replaces the old dreams-only block.
|
|
14
|
+
const memoryBlock = (0, unified_memory_js_1.loadUnifiedMemory)({ projectRoot: ctx.root });
|
|
15
|
+
// Confessions: permanent lessons extracted from high-cost failures.
|
|
16
|
+
// Loaded separately so they sit above regular memory with elevated priority.
|
|
17
|
+
const confessionsBlock = (0, confess_js_1.loadConfessionsSection)();
|
|
18
|
+
// Plugin skills: inject relevant plugin skills when task matches their domain.
|
|
19
|
+
const pluginBlock = loadPluginSkillsBlock(task);
|
|
9
20
|
return `You are Aura — a precise, efficient AI coding agent.
|
|
10
21
|
You are working in a ${ctx.language} project called "${ctx.name}" (${ctx.framework}).
|
|
11
22
|
|
|
@@ -27,22 +38,22 @@ You are working in a ${ctx.language} project called "${ctx.name}" (${ctx.framewo
|
|
|
27
38
|
- When done, summarize exactly what changed and what was verified (tests passed, build succeeded, specific checks that passed).
|
|
28
39
|
- If the task requires a code change, you must eventually call write_file or edit_file to apply it. Do not spend all turns on read_file and search_code — at some point you must commit to making the change. Aim for a 2:1 ratio of reads to writes, not 100% reads.
|
|
29
40
|
- Never respond to a task with only prose. Always begin by using at least one tool (search_code, read_file, or list_dir) to investigate the codebase before summarizing or concluding. A response with zero tool calls is almost always incomplete.
|
|
30
|
-
- Not every task is a coding task. For questions, research, or information requests, use web_search/web_fetch and respond with the information directly — no code changes needed.
|
|
31
41
|
|
|
32
|
-
##
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
42
|
+
## Tool call arguments
|
|
43
|
+
- Never inline large multi-line content (HTML, generated code, long files) as a raw string inside a tool call's JSON arguments — models frequently produce invalid JSON when escaping quotes/newlines in big blocks, causing repeated failed calls.
|
|
44
|
+
- For content longer than ~30 lines, write it via run_shell using a heredoc (cat > file << 'EOF' ... EOF), or build it incrementally with edit_file on small, well-escaped chunks.
|
|
45
|
+
|
|
46
|
+
## Images and screenshots
|
|
47
|
+
- You CAN read local image files (screenshots, diagrams, photos). Never tell the user you cannot access local files or \`file://\` paths — you have the image_read tool.
|
|
48
|
+
- When the user references an image path — a plain path, or a \`file://\` URL like \`file:///home/user/shot.png\` — call \`image_read\` with \`action=ocr\` to extract the text/content, then answer from what it actually contains. Use \`action=info\` for dimensions/format.
|
|
49
|
+
- Never guess or invent what an image shows, and never ask the user to describe it before trying image_read first. Read it, then reason about it.
|
|
39
50
|
|
|
40
51
|
## Code standards
|
|
41
52
|
- Match the existing code style: indentation, naming conventions, comment style.
|
|
42
53
|
- Do not introduce new dependencies unless explicitly asked.
|
|
43
54
|
- Prefer targeted, minimal changes over rewrites.
|
|
44
55
|
- Add or update tests when you modify logic.
|
|
45
|
-
|
|
56
|
+
${domainBlock}${memoryBlock}${confessionsBlock}${pluginBlock}
|
|
46
57
|
## Safety
|
|
47
58
|
- Never delete files unless explicitly instructed.
|
|
48
59
|
- Never commit to git unless explicitly instructed.
|
|
@@ -71,7 +82,32 @@ ${ctx.readme}
|
|
|
71
82
|
### Recent git history
|
|
72
83
|
${ctx.recentCommits}
|
|
73
84
|
|
|
74
|
-
Provider: ${providerName}. Work efficiently — minimize unnecessary tool calls
|
|
85
|
+
Provider: ${providerName}. Work efficiently — minimize unnecessary tool calls.`;
|
|
86
|
+
}
|
|
87
|
+
/** Load plugin skills relevant to the current task. Cached per process. */
|
|
88
|
+
let _pluginSkillsCache = null;
|
|
89
|
+
function loadPluginSkillsBlock(task) {
|
|
90
|
+
if (_pluginSkillsCache === null) {
|
|
91
|
+
try {
|
|
92
|
+
const plugins = (0, loader_js_1.loadAllPlugins)();
|
|
93
|
+
const lines = [];
|
|
94
|
+
for (const p of plugins) {
|
|
95
|
+
for (const s of p.skills) {
|
|
96
|
+
lines.push(`\n\n## Plugin skill: ${s.name} (from ${p.name})\n${s.body}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
_pluginSkillsCache = lines.join('');
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
_pluginSkillsCache = '';
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (!_pluginSkillsCache)
|
|
106
|
+
return '';
|
|
107
|
+
// Only inject for web/UI tasks — avoid polluting non-design prompts
|
|
108
|
+
if (!WEB_KEYWORDS.test(task.toLowerCase()))
|
|
109
|
+
return '';
|
|
110
|
+
return `\n\n## Plugin instructions\nThese skill instructions from installed plugins apply to this task:${_pluginSkillsCache}`;
|
|
75
111
|
}
|
|
76
112
|
function buildArchitectPrompt(task, projectRoot) {
|
|
77
113
|
return `You are in architect mode. You are planning the implementation for: "${task}"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":";;AAQA,8CA6EC;AA0BD,oDAmCC;AAjJD,+DAA6D;AAC7D,2DAAwD;AACxD,6CAAsD;AACtD,oDAAsD;AAEtD,MAAM,YAAY,GAAG,6LAA6L,CAAC;AAEnN,SAAgB,iBAAiB,CAAC,GAAmB,EAAE,YAAoB,EAAE,IAAY;IACvF,MAAM,WAAW,GAAG,IAAA,0CAAoB,EAAC,IAAI,CAAC,CAAC;IAC/C,4EAA4E;IAC5E,yEAAyE;IACzE,MAAM,WAAW,GAAG,IAAA,qCAAiB,EAAC,EAAE,WAAW,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IACjE,oEAAoE;IACpE,6EAA6E;IAC7E,MAAM,gBAAgB,GAAG,IAAA,mCAAsB,GAAE,CAAC;IAClD,+EAA+E;IAC/E,MAAM,WAAW,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAEhD,OAAO;uBACc,GAAG,CAAC,QAAQ,oBAAoB,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmChF,WAAW,GAAG,WAAW,GAAG,gBAAgB,GAAG,WAAW;;;;;;;;;YAShD,GAAG,CAAC,QAAQ;aACX,GAAG,CAAC,SAAS;QAClB,GAAG,CAAC,IAAI;;;;EAId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ENTITY_FILE: string;
|
|
3
|
+
/** Global episodic-lessons digest (created by runGlobalReconciliation). */
|
|
4
|
+
export declare const GLOBAL_LESSONS_FILE: string;
|
|
5
|
+
export interface UnifiedMemoryOptions {
|
|
6
|
+
/** CLI passes its project root for per-project lessons; bot omits it. */
|
|
7
|
+
projectRoot?: string;
|
|
8
|
+
/** Total cap for the whole block (default ~4 KB). */
|
|
9
|
+
maxChars?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The single memory block both the CLI and the Telegram bot inject into their
|
|
13
|
+
* system prompts. Returns '' when there's nothing to add.
|
|
14
|
+
*/
|
|
15
|
+
export declare function loadUnifiedMemory(opts?: UnifiedMemoryOptions): string;
|