aura-code 0.5.0 → 0.6.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/README.md +3 -3
- package/dist/agent/context.d.ts +4 -0
- package/dist/agent/context.js +38 -0
- package/dist/agent/context.js.map +1 -1
- package/dist/agent/loop.js +16 -0
- package/dist/agent/loop.js.map +1 -1
- package/dist/agent/system-prompt.js +9 -1
- package/dist/agent/system-prompt.js.map +1 -1
- package/dist/cli/display.js +6 -1
- package/dist/cli/display.js.map +1 -1
- package/dist/cli/index.js +71 -8
- package/dist/cli/index.js.map +1 -1
- package/dist/config/defaults.js +8 -1
- package/dist/config/defaults.js.map +1 -1
- package/dist/dream/dream.d.ts +25 -2
- package/dist/dream/dream.js +36 -6
- package/dist/dream/dream.js.map +1 -1
- 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/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 +189 -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 +92 -0
- package/dist/machina/render-terminal.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 +27 -0
- package/dist/machina/verify.js +85 -0
- package/dist/machina/verify.js.map +1 -0
- package/dist/providers/anthropic.js +1 -1
- package/dist/providers/anthropic.js.map +1 -1
- package/dist/providers/factory.d.ts +33 -0
- package/dist/providers/factory.js +27 -0
- package/dist/providers/factory.js.map +1 -1
- package/dist/providers/google.js +1 -1
- package/dist/providers/google.js.map +1 -1
- package/dist/providers/openai-compatible.js +1 -1
- package/dist/providers/openai-compatible.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/research/council.d.ts +3 -2
- package/dist/research/council.js +47 -9
- package/dist/research/council.js.map +1 -1
- package/dist/tools/browser.js +8 -10
- package/dist/tools/browser.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/telegram-bot.js +6 -8
- package/dist/tools/telegram-bot.js.map +1 -1
- package/dist/tools/web-search.d.ts +20 -0
- package/dist/tools/web-search.js +134 -38
- package/dist/tools/web-search.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 +2 -1
|
@@ -0,0 +1,303 @@
|
|
|
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.reconcileDreams = reconcileDreams;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const SECTIONS = ['lessons', 'patterns', 'openThreads'];
|
|
40
|
+
function formatBulletsForPrompt(dreams) {
|
|
41
|
+
const blocks = [];
|
|
42
|
+
for (const section of SECTIONS) {
|
|
43
|
+
const label = section === 'openThreads' ? 'Open threads' : section.charAt(0).toUpperCase() + section.slice(1);
|
|
44
|
+
const bullets = [];
|
|
45
|
+
for (const dream of dreams) {
|
|
46
|
+
for (const b of dream[section]) {
|
|
47
|
+
const tag = b.tag ? `[${b.tag}] ` : '';
|
|
48
|
+
bullets.push(` - (${b.sourceDate}) ${tag}${b.text}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (bullets.length > 0) {
|
|
52
|
+
blocks.push(`### ${label}\n${bullets.join('\n')}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return blocks.join('\n\n');
|
|
56
|
+
}
|
|
57
|
+
function buildReconciliationPrompt(dreams) {
|
|
58
|
+
const system = `You are Aura's memory reconciliation system. You are given ALL bullets from ${dreams.length} dream files (the agent's nightly consolidation journal), grouped by section (Lessons, Patterns, Open threads). Each bullet is prefixed with its source date.
|
|
59
|
+
|
|
60
|
+
Your job: produce a RECONCILED memory — the current best understanding — by analyzing all bullets across all dreams.
|
|
61
|
+
|
|
62
|
+
For each bullet in your output, assign exactly ONE verdict:
|
|
63
|
+
|
|
64
|
+
- KEEP: unique claim, no overlap with others, retained as-is.
|
|
65
|
+
- STRENGTHEN: the same claim (or very similar) appeared in multiple dreams. Cite all dates.
|
|
66
|
+
- MERGE: two related but distinct claims combined into one clearer statement. Cite both source dates.
|
|
67
|
+
- SUPERSEDE: a newer claim replaces an older one (the old one is outdated). Cite both dates and state which is old vs new.
|
|
68
|
+
- CONFLICT: two claims contradict each other. Surface BOTH — do NOT resolve. State what conflicts with what.
|
|
69
|
+
- DROP: exact duplicate of another bullet already in the output. Do not include it.
|
|
70
|
+
|
|
71
|
+
IMPORTANT RULES:
|
|
72
|
+
- Do NOT invent new claims. Only work with what's in the input.
|
|
73
|
+
- Do NOT silently merge contradictions. If something changed, mark it CONFLICT or SUPERSEDE.
|
|
74
|
+
- Prefer CONFLICT over SUPERSEDE when you're unsure which is more current.
|
|
75
|
+
- Tags like [tooling], [bug], [todo] should be preserved when present.
|
|
76
|
+
- Open threads marked [todo] should be kept unless explicitly resolved by a later dream's lesson.
|
|
77
|
+
|
|
78
|
+
Respond with ONLY a JSON array. No markdown fences, no preamble, no explanation.
|
|
79
|
+
|
|
80
|
+
Each element:
|
|
81
|
+
{
|
|
82
|
+
"section": "lessons" | "patterns" | "openThreads",
|
|
83
|
+
"tag": "optional tag without brackets, or null",
|
|
84
|
+
"text": "the reconciled bullet text",
|
|
85
|
+
"action": "KEEP" | "STRENGTHEN" | "MERGE" | "SUPERSEDE" | "CONFLICT" | "DROP",
|
|
86
|
+
"sourceDates": ["2026-06-24", "2026-06-26"],
|
|
87
|
+
"conflictsWith": { "text": "the opposing claim", "date": "2026-06-24" } // only for CONFLICT, otherwise omit
|
|
88
|
+
}`;
|
|
89
|
+
const user = `Here are all ${dreams.length} dreams' bullets:\n\n${formatBulletsForPrompt(dreams)}`;
|
|
90
|
+
return { system, user };
|
|
91
|
+
}
|
|
92
|
+
const VALID_ACTIONS = new Set(['KEEP', 'STRENGTHEN', 'MERGE', 'SUPERSEDE', 'CONFLICT', 'DROP']);
|
|
93
|
+
function parseVerdicts(raw, totalDreams) {
|
|
94
|
+
// Strip markdown fences if the model wrapped the JSON
|
|
95
|
+
let cleaned = raw.trim();
|
|
96
|
+
if (cleaned.startsWith('```')) {
|
|
97
|
+
cleaned = cleaned.replace(/^```(?:json)?\s*\n?/, '').replace(/\n?```\s*$/, '');
|
|
98
|
+
}
|
|
99
|
+
let parsed;
|
|
100
|
+
try {
|
|
101
|
+
parsed = JSON.parse(cleaned);
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
// Try to extract a JSON array from the response
|
|
105
|
+
const match = cleaned.match(/\[[\s\S]*\]/);
|
|
106
|
+
if (!match)
|
|
107
|
+
return [];
|
|
108
|
+
try {
|
|
109
|
+
parsed = JSON.parse(match[0]);
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
return [];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (!Array.isArray(parsed))
|
|
116
|
+
return [];
|
|
117
|
+
const results = [];
|
|
118
|
+
for (const v of parsed) {
|
|
119
|
+
if (!v.text || !v.section || !v.action)
|
|
120
|
+
continue;
|
|
121
|
+
const action = v.action.toUpperCase();
|
|
122
|
+
if (!VALID_ACTIONS.has(action))
|
|
123
|
+
continue;
|
|
124
|
+
if (action === 'DROP')
|
|
125
|
+
continue; // dropped bullets don't appear in output
|
|
126
|
+
if (!SECTIONS.includes(v.section))
|
|
127
|
+
continue;
|
|
128
|
+
const sourceDates = Array.isArray(v.sourceDates) ? v.sourceDates.filter(d => typeof d === 'string') : [];
|
|
129
|
+
const confidence = totalDreams > 0 ? Math.round((sourceDates.length / totalDreams) * 100) / 100 : 0;
|
|
130
|
+
const bullet = {
|
|
131
|
+
section: v.section,
|
|
132
|
+
tag: (typeof v.tag === 'string' && v.tag.trim()) ? v.tag.trim() : undefined,
|
|
133
|
+
text: v.text.trim(),
|
|
134
|
+
action,
|
|
135
|
+
annotation: buildAnnotation(action, sourceDates, v.conflictsWith),
|
|
136
|
+
sourceDates,
|
|
137
|
+
confidence,
|
|
138
|
+
};
|
|
139
|
+
if (action === 'CONFLICT' && v.conflictsWith && typeof v.conflictsWith.text === 'string') {
|
|
140
|
+
bullet.conflictsWith = {
|
|
141
|
+
text: v.conflictsWith.text.trim(),
|
|
142
|
+
date: typeof v.conflictsWith.date === 'string' ? v.conflictsWith.date : 'unknown',
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
results.push(bullet);
|
|
146
|
+
}
|
|
147
|
+
return results;
|
|
148
|
+
}
|
|
149
|
+
function buildAnnotation(action, sourceDates, conflict) {
|
|
150
|
+
const dates = sourceDates.join(', ');
|
|
151
|
+
switch (action) {
|
|
152
|
+
case 'KEEP':
|
|
153
|
+
return sourceDates.length === 1 ? `from ${dates}` : `from ${dates}`;
|
|
154
|
+
case 'STRENGTHEN':
|
|
155
|
+
return `from ${sourceDates[0]}, strengthened ${sourceDates.slice(1).join(', ')}`;
|
|
156
|
+
case 'MERGE':
|
|
157
|
+
return `merged from ${dates}`;
|
|
158
|
+
case 'SUPERSEDE':
|
|
159
|
+
return sourceDates.length >= 2
|
|
160
|
+
? `superseded ${sourceDates[0]}, current from ${sourceDates[sourceDates.length - 1]}`
|
|
161
|
+
: `superseded, current from ${dates}`;
|
|
162
|
+
case 'CONFLICT':
|
|
163
|
+
return conflict?.date ? `conflicts with ${conflict.date}` : `conflicting claims from ${dates}`;
|
|
164
|
+
case 'DROP':
|
|
165
|
+
return 'dropped';
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
// ── Output formatting ────────────────────────────────────────────────────────
|
|
169
|
+
function buildReconciledMd(bullets, totalDreams) {
|
|
170
|
+
const now = new Date().toISOString().slice(0, 10);
|
|
171
|
+
// Frontmatter
|
|
172
|
+
const avgConfidence = bullets.length > 0
|
|
173
|
+
? Math.round((bullets.reduce((s, b) => s + b.confidence, 0) / bullets.length) * 100) / 100
|
|
174
|
+
: 0;
|
|
175
|
+
const frontmatter = [
|
|
176
|
+
'---',
|
|
177
|
+
`generated: ${now}`,
|
|
178
|
+
`source_dreams: ${totalDreams}`,
|
|
179
|
+
`total_beliefs: ${bullets.length}`,
|
|
180
|
+
`average_confidence: ${avgConfidence}`,
|
|
181
|
+
`last_reconciliation: ${now}`,
|
|
182
|
+
'---',
|
|
183
|
+
].join('\n');
|
|
184
|
+
// Group by section
|
|
185
|
+
const bySection = {
|
|
186
|
+
lessons: [],
|
|
187
|
+
patterns: [],
|
|
188
|
+
openThreads: [],
|
|
189
|
+
};
|
|
190
|
+
for (const b of bullets)
|
|
191
|
+
bySection[b.section].push(b);
|
|
192
|
+
// Render each section
|
|
193
|
+
const renderBullets = (items) => {
|
|
194
|
+
if (items.length === 0)
|
|
195
|
+
return '- none\n';
|
|
196
|
+
return items
|
|
197
|
+
.map(b => {
|
|
198
|
+
const tag = b.tag ? `[${b.tag}] ` : '';
|
|
199
|
+
const conf = ` (confidence: ${b.confidence})`;
|
|
200
|
+
return `- ${tag}${b.text} *${b.annotation}*${conf}`;
|
|
201
|
+
})
|
|
202
|
+
.join('\n') + '\n';
|
|
203
|
+
};
|
|
204
|
+
// Separate conflicts section
|
|
205
|
+
const conflicts = bullets.filter(b => b.action === 'CONFLICT');
|
|
206
|
+
const conflictsSection = conflicts.length > 0
|
|
207
|
+
? '\n## Conflicts\n\n' + conflicts.map(b => {
|
|
208
|
+
const against = b.conflictsWith
|
|
209
|
+
? `"${b.conflictsWith.text}" (${b.conflictsWith.date})`
|
|
210
|
+
: 'unknown prior belief';
|
|
211
|
+
return `- **${b.text}** vs ${against}`;
|
|
212
|
+
}).join('\n') + '\n'
|
|
213
|
+
: '';
|
|
214
|
+
// Stats summary
|
|
215
|
+
const actionCounts = {};
|
|
216
|
+
for (const b of bullets)
|
|
217
|
+
actionCounts[b.action] = (actionCounts[b.action] ?? 0) + 1;
|
|
218
|
+
const statsLine = Object.entries(actionCounts)
|
|
219
|
+
.map(([k, v]) => `${v} ${k}`)
|
|
220
|
+
.join(', ');
|
|
221
|
+
return [
|
|
222
|
+
frontmatter,
|
|
223
|
+
'',
|
|
224
|
+
`# Aura — Reconciled Memory`,
|
|
225
|
+
'',
|
|
226
|
+
`> Projected from ${totalDreams} dream(s). ${statsLine}.`,
|
|
227
|
+
'',
|
|
228
|
+
'## Lessons',
|
|
229
|
+
'',
|
|
230
|
+
renderBullets(bySection.lessons),
|
|
231
|
+
'## Patterns',
|
|
232
|
+
'',
|
|
233
|
+
renderBullets(bySection.patterns),
|
|
234
|
+
'## Open threads',
|
|
235
|
+
'',
|
|
236
|
+
renderBullets(bySection.openThreads),
|
|
237
|
+
conflictsSection,
|
|
238
|
+
'---',
|
|
239
|
+
'',
|
|
240
|
+
'*Generated by Aura Code · dream reconciliation · event-sourced memory.*',
|
|
241
|
+
].join('\n');
|
|
242
|
+
}
|
|
243
|
+
function buildLogSection(bullets, totalDreams) {
|
|
244
|
+
const actionCounts = {};
|
|
245
|
+
for (const b of bullets)
|
|
246
|
+
actionCounts[b.action] = (actionCounts[b.action] ?? 0) + 1;
|
|
247
|
+
const statsLine = Object.entries(actionCounts)
|
|
248
|
+
.map(([k, v]) => `${v} ${k}`)
|
|
249
|
+
.join(', ');
|
|
250
|
+
const conflicts = bullets.filter(b => b.action === 'CONFLICT');
|
|
251
|
+
const conflictLines = conflicts.length > 0
|
|
252
|
+
? '\n' + conflicts.map(b => {
|
|
253
|
+
const vs = b.conflictsWith ? ` vs "${b.conflictsWith.text}" (${b.conflictsWith.date})` : '';
|
|
254
|
+
return `- CONFLICT: "${b.text}"${vs}`;
|
|
255
|
+
}).join('\n')
|
|
256
|
+
: '';
|
|
257
|
+
return [
|
|
258
|
+
`\n## Reconciliation`,
|
|
259
|
+
'',
|
|
260
|
+
`> Reconciled ${totalDreams} dream(s): ${statsLine}.`,
|
|
261
|
+
`> Projection written to \`dreams/.reconciled.md\`.`,
|
|
262
|
+
conflictLines,
|
|
263
|
+
].join('\n').trimEnd() + '\n';
|
|
264
|
+
}
|
|
265
|
+
// ── Public API ───────────────────────────────────────────────────────────────
|
|
266
|
+
/**
|
|
267
|
+
* Run memory reconciliation across all existing dreams.
|
|
268
|
+
*
|
|
269
|
+
* Called by `runDream()` after the new dream is written, gated at ≥3 dreams.
|
|
270
|
+
* If this fails, the dream file is still intact — reconciliation is
|
|
271
|
+
* enhancement, not critical path.
|
|
272
|
+
*
|
|
273
|
+
* @returns The result, or null if reconciliation was skipped or failed.
|
|
274
|
+
*/
|
|
275
|
+
async function reconcileDreams(opts) {
|
|
276
|
+
const { projectRoot, provider, dreams } = opts;
|
|
277
|
+
if (dreams.length < 3)
|
|
278
|
+
return null; // 3-dream gate
|
|
279
|
+
const totalDreams = dreams.length;
|
|
280
|
+
const { system, user } = buildReconciliationPrompt(dreams);
|
|
281
|
+
let rawResponse;
|
|
282
|
+
try {
|
|
283
|
+
const res = await provider.complete(system, [{ role: 'user', content: user }], []);
|
|
284
|
+
rawResponse = (res.text ?? '').trim();
|
|
285
|
+
if (!rawResponse)
|
|
286
|
+
return null;
|
|
287
|
+
}
|
|
288
|
+
catch {
|
|
289
|
+
return null; // reconciliation is best-effort
|
|
290
|
+
}
|
|
291
|
+
const bullets = parseVerdicts(rawResponse, totalDreams);
|
|
292
|
+
if (bullets.length === 0)
|
|
293
|
+
return null;
|
|
294
|
+
const reconciledMd = buildReconciledMd(bullets, totalDreams);
|
|
295
|
+
const logSection = buildLogSection(bullets, totalDreams);
|
|
296
|
+
// Write .reconciled.md
|
|
297
|
+
const dir = path.join(projectRoot, 'dreams');
|
|
298
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
299
|
+
const outPath = path.join(dir, '.reconciled.md');
|
|
300
|
+
fs.writeFileSync(outPath, reconciledMd);
|
|
301
|
+
return { bullets, totalDreams, reconciledMd, logSection };
|
|
302
|
+
}
|
|
303
|
+
//# sourceMappingURL=reconcile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile.js","sourceRoot":"","sources":["../../src/dream/reconcile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwUA,0CAmCC;AA3WD,uCAAyB;AACzB,2CAA6B;AA4D7B,MAAM,QAAQ,GAAc,CAAC,SAAS,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;AAEnE,SAAS,sBAAsB,CAAC,MAAqB;IACnD,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,OAAO,KAAK,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC9G,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,CAAkB,EAAE,CAAC;gBAChD,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvC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AC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type VerificationReport } from './verify.js';
|
|
2
|
+
export interface MachinaRunResult {
|
|
3
|
+
report: VerificationReport;
|
|
4
|
+
terminalOutput: string;
|
|
5
|
+
htmlPath?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Run `:machina` — verify the AAM's structural claims against aura-code's
|
|
9
|
+
* own source tree (not the user's current project — see resolveAuraRepoRoot)
|
|
10
|
+
* and render the result. If `writeHtml` is true, also write a standalone
|
|
11
|
+
* `docs/machina.html` to the user's current project root for easy sharing.
|
|
12
|
+
*/
|
|
13
|
+
export declare function runMachina(opts: {
|
|
14
|
+
outputRoot: string;
|
|
15
|
+
writeHtml?: boolean;
|
|
16
|
+
}): MachinaRunResult;
|
|
@@ -0,0 +1,61 @@
|
|
|
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.runMachina = runMachina;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const verify_js_1 = require("./verify.js");
|
|
40
|
+
const render_terminal_js_1 = require("./render-terminal.js");
|
|
41
|
+
const render_html_js_1 = require("./render-html.js");
|
|
42
|
+
/**
|
|
43
|
+
* Run `:machina` — verify the AAM's structural claims against aura-code's
|
|
44
|
+
* own source tree (not the user's current project — see resolveAuraRepoRoot)
|
|
45
|
+
* and render the result. If `writeHtml` is true, also write a standalone
|
|
46
|
+
* `docs/machina.html` to the user's current project root for easy sharing.
|
|
47
|
+
*/
|
|
48
|
+
function runMachina(opts) {
|
|
49
|
+
const repoRoot = (0, verify_js_1.resolveAuraRepoRoot)();
|
|
50
|
+
const report = (0, verify_js_1.verifyAamClaims)(repoRoot);
|
|
51
|
+
const terminalOutput = (0, render_terminal_js_1.renderMachinaTerminal)(report);
|
|
52
|
+
if (!opts.writeHtml) {
|
|
53
|
+
return { report, terminalOutput };
|
|
54
|
+
}
|
|
55
|
+
const dir = path.join(opts.outputRoot, 'docs');
|
|
56
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
57
|
+
const htmlPath = path.join(dir, 'machina.html');
|
|
58
|
+
fs.writeFileSync(htmlPath, (0, render_html_js_1.wrapMachinaHtml)(report));
|
|
59
|
+
return { report, terminalOutput, htmlPath };
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/machina/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,gCAeC;AAjCD,uCAAyB;AACzB,2CAA6B;AAC7B,2CAA4F;AAC5F,6DAA6D;AAC7D,qDAAmD;AAQnD;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,IAAiD;IAC1E,MAAM,QAAQ,GAAG,IAAA,+BAAmB,GAAE,CAAC;IACvC,MAAM,MAAM,GAAG,IAAA,2BAAe,EAAC,QAAQ,CAAC,CAAC;IACzC,MAAM,cAAc,GAAG,IAAA,0CAAqB,EAAC,MAAM,CAAC,CAAC;IAErD,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;QACpB,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;IACpC,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC/C,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IAChD,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAA,gCAAe,EAAC,MAAM,CAAC,CAAC,CAAC;IAEpD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wrapMachinaHtml = wrapMachinaHtml;
|
|
4
|
+
const spec_js_1 = require("./spec.js");
|
|
5
|
+
function esc(s) {
|
|
6
|
+
return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
|
7
|
+
}
|
|
8
|
+
const COMPONENT_LABEL = {
|
|
9
|
+
S: 'S — state space',
|
|
10
|
+
P: 'P — primitives',
|
|
11
|
+
O: 'O — oracle',
|
|
12
|
+
delta: 'δ — transition',
|
|
13
|
+
s0: 's₀ — initial state',
|
|
14
|
+
limit: 'limit / invariant',
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A static SVG of the AAM tuple: s₀ feeding the loop, δ consulting O each
|
|
18
|
+
* iteration, gated by the safety check, looping back into S, with the
|
|
19
|
+
* compaction/maxTurns limits drawn as a boundary around the whole loop.
|
|
20
|
+
* Deliberately diagrammatic rather than data-driven (there is exactly one
|
|
21
|
+
* AAM, not a variable-size collection like the :rem graph) — fixed layout,
|
|
22
|
+
* no dependency on claim count.
|
|
23
|
+
*/
|
|
24
|
+
function buildTupleSvg() {
|
|
25
|
+
return `<svg viewBox="0 0 760 360" xmlns="http://www.w3.org/2000/svg" class="machina-graph">
|
|
26
|
+
<rect x="40" y="30" width="680" height="260" rx="16" class="bound-box" />
|
|
27
|
+
<text x="60" y="58" class="bound-label">finite machine — maxTurns, context compaction</text>
|
|
28
|
+
|
|
29
|
+
<circle cx="140" cy="180" r="46" class="node s0-node" />
|
|
30
|
+
<text x="140" y="175" class="node-label" text-anchor="middle">s₀</text>
|
|
31
|
+
<text x="140" y="193" class="node-sub" text-anchor="middle">task + ∅</text>
|
|
32
|
+
|
|
33
|
+
<circle cx="330" cy="180" r="50" class="node delta-node" />
|
|
34
|
+
<text x="330" y="174" class="node-label" text-anchor="middle">δ</text>
|
|
35
|
+
<text x="330" y="192" class="node-sub" text-anchor="middle">transition</text>
|
|
36
|
+
|
|
37
|
+
<circle cx="540" cy="100" r="42" class="node oracle-node" />
|
|
38
|
+
<text x="540" y="95" class="node-label" text-anchor="middle">O</text>
|
|
39
|
+
<text x="540" y="113" class="node-sub" text-anchor="middle">oracle</text>
|
|
40
|
+
|
|
41
|
+
<circle cx="540" cy="260" r="38" class="node safety-node" />
|
|
42
|
+
<text x="540" y="256" class="node-label" text-anchor="middle">safety</text>
|
|
43
|
+
<text x="540" y="272" class="node-sub" text-anchor="middle">gate</text>
|
|
44
|
+
|
|
45
|
+
<line x1="186" y1="180" x2="280" y2="180" class="edge edge-start" marker-end="url(#arrow)" />
|
|
46
|
+
<line x1="372" y1="160" x2="498" y2="110" class="edge edge-oracle" marker-end="url(#arrow)" />
|
|
47
|
+
<line x1="500" y1="130" x2="378" y2="172" class="edge edge-oracle-back" marker-end="url(#arrow)" />
|
|
48
|
+
<line x1="375" y1="195" x2="502" y2="245" class="edge edge-safety" marker-end="url(#arrow)" />
|
|
49
|
+
<line x1="505" y1="230" x2="378" y2="190" class="edge edge-safety-back" marker-end="url(#arrow)" />
|
|
50
|
+
<path d="M 330 230 C 330 290, 220 290, 175 215" class="edge edge-loop" marker-end="url(#arrow)" fill="none" />
|
|
51
|
+
<text x="250" y="305" class="loop-label">loop: s′ → s, until done or T_max</text>
|
|
52
|
+
|
|
53
|
+
<defs>
|
|
54
|
+
<marker id="arrow" markerWidth="9" markerHeight="9" refX="7" refY="4" orient="auto">
|
|
55
|
+
<path d="M0,0 L8,4 L0,8 z" class="arrow-head" />
|
|
56
|
+
</marker>
|
|
57
|
+
</defs>
|
|
58
|
+
</svg>`;
|
|
59
|
+
}
|
|
60
|
+
function buildClaimsTable(report) {
|
|
61
|
+
const rows = report.results.map(r => {
|
|
62
|
+
const ok = r.status === 'verified';
|
|
63
|
+
const cls = ok ? 'ok' : (r.status === 'drifted' ? 'drift' : 'missing');
|
|
64
|
+
const glyph = ok ? '✓' : (r.status === 'drifted' ? '⚠' : '✗');
|
|
65
|
+
return `<tr class="${cls}">
|
|
66
|
+
<td class="glyph">${glyph}</td>
|
|
67
|
+
<td class="comp">${esc(COMPONENT_LABEL[r.component])}</td>
|
|
68
|
+
<td class="loc"><code>${esc(r.file)}:${r.line}</code></td>
|
|
69
|
+
<td class="desc">${esc(r.description)}</td>
|
|
70
|
+
</tr>`;
|
|
71
|
+
}).join('\n');
|
|
72
|
+
return `<table class="claims-table">
|
|
73
|
+
<thead><tr><th></th><th>Component</th><th>Location</th><th>What's grounded there</th></tr></thead>
|
|
74
|
+
<tbody>${rows}</tbody>
|
|
75
|
+
</table>`;
|
|
76
|
+
}
|
|
77
|
+
function wrapMachinaHtml(report) {
|
|
78
|
+
const allOk = report.drifted.length === 0 && report.missing.length === 0;
|
|
79
|
+
const statusLine = allOk
|
|
80
|
+
? `All ${report.verifiedCount} structural claims verified against the current source.`
|
|
81
|
+
: `${report.verifiedCount}/${report.results.length} verified — ${report.drifted.length} drifted, ${report.missing.length} missing.`;
|
|
82
|
+
return `<!DOCTYPE html>
|
|
83
|
+
<html lang="en">
|
|
84
|
+
<head>
|
|
85
|
+
<meta charset="UTF-8">
|
|
86
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
87
|
+
<title>Machina — the Abstract Agent Machine</title>
|
|
88
|
+
<style>
|
|
89
|
+
:root {
|
|
90
|
+
--bg: #fdf6f0; --card: #fffaf5; --text: #3e2f24; --muted: #8a7768;
|
|
91
|
+
--accent: #cc785c; --accent-2: #5a9e6e; --accent-3: #9e6ecc; --border: #e8d5c8;
|
|
92
|
+
--code-bg: #f4ede6; --hr: #e0cebc; --warn: #b15439;
|
|
93
|
+
--shadow: 0 2px 12px rgba(62,47,36,0.06); --radius: 12px;
|
|
94
|
+
--serif: 'Georgia', 'Times New Roman', serif;
|
|
95
|
+
--sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
|
|
96
|
+
--mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
|
|
97
|
+
}
|
|
98
|
+
@media (prefers-color-scheme: dark) {
|
|
99
|
+
:root {
|
|
100
|
+
--bg: #1e1b18; --card: #26221e; --text: #ede0cc; --muted: #9e8e80;
|
|
101
|
+
--accent: #e08a6e; --accent-2: #6db880; --accent-3: #b48ee0; --border: #3a322a;
|
|
102
|
+
--code-bg: #2c2722; --hr: #3a322a; --warn: #e0876e;
|
|
103
|
+
--shadow: 0 2px 12px rgba(0,0,0,0.25);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
107
|
+
body { background: var(--bg); color: var(--text); font-family: var(--serif); line-height: 1.75; font-size: 18px; }
|
|
108
|
+
.container { max-width: 860px; margin: 0 auto; padding: 3rem 1.5rem 5rem; }
|
|
109
|
+
.hero { text-align: center; padding: 2.5rem 0 2rem; border-bottom: 2px solid var(--border); margin-bottom: 2.5rem; }
|
|
110
|
+
.hero .badge { display: inline-block; background: var(--accent-3); color: #fff; font-family: var(--sans); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; padding: 0.3em 1em; border-radius: 100px; margin-bottom: 1.25rem; }
|
|
111
|
+
.hero h1 { font-family: var(--sans); font-size: 2.2rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
|
|
112
|
+
.hero .meta { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); }
|
|
113
|
+
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2.25rem 2.75rem; margin-bottom: 2rem; }
|
|
114
|
+
@media (max-width: 700px) { .card { padding: 1.25rem; border-radius: 8px; } .hero h1 { font-size: 1.6rem; } .container { padding: 1.5rem 0.75rem 3rem; } }
|
|
115
|
+
.card h2 { font-family: var(--sans); font-size: 1.3rem; color: var(--accent); border-bottom: 2px solid var(--border); padding-bottom: 0.5rem; margin-bottom: 1.25rem; }
|
|
116
|
+
.tuple { font-family: var(--mono); font-size: 1.3rem; text-align: center; color: var(--accent-3); margin: 1rem 0 1.5rem; }
|
|
117
|
+
.tuple-defs { font-family: var(--sans); font-size: 0.95rem; }
|
|
118
|
+
.tuple-defs dt { font-weight: 700; color: var(--accent); float: left; width: 2.4rem; }
|
|
119
|
+
.tuple-defs dd { margin: 0 0 0.75rem 2.4rem; color: var(--text); }
|
|
120
|
+
.machina-graph { width: 100%; height: auto; display: block; margin: 1rem 0; }
|
|
121
|
+
.bound-box { fill: none; stroke: var(--border); stroke-width: 2; stroke-dasharray: 6 5; }
|
|
122
|
+
.bound-label { font-family: var(--sans); font-size: 11px; fill: var(--muted); }
|
|
123
|
+
.node { stroke-width: 2; fill: var(--card); }
|
|
124
|
+
.s0-node { stroke: var(--accent-2); }
|
|
125
|
+
.delta-node { stroke: var(--accent); }
|
|
126
|
+
.oracle-node { stroke: var(--accent-3); }
|
|
127
|
+
.safety-node { stroke: var(--warn); }
|
|
128
|
+
.node-label { font-family: var(--sans); font-size: 16px; font-weight: 700; fill: var(--text); }
|
|
129
|
+
.node-sub { font-family: var(--sans); font-size: 10px; fill: var(--muted); }
|
|
130
|
+
.edge { stroke: var(--muted); stroke-width: 1.6; opacity: 0.7; }
|
|
131
|
+
.edge-loop { stroke: var(--accent); stroke-width: 2; }
|
|
132
|
+
.arrow-head { fill: var(--muted); }
|
|
133
|
+
.loop-label { font-family: var(--sans); font-size: 11px; fill: var(--muted); }
|
|
134
|
+
p.prose { font-family: var(--sans); font-size: 1rem; color: var(--text); margin-bottom: 0.75rem; }
|
|
135
|
+
.claims-table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.88rem; }
|
|
136
|
+
.claims-table th { text-align: left; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.5rem 0.6rem; border-bottom: 2px solid var(--border); }
|
|
137
|
+
.claims-table td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--hr); vertical-align: top; }
|
|
138
|
+
.claims-table .glyph { width: 1.5rem; text-align: center; }
|
|
139
|
+
.claims-table tr.ok .glyph { color: var(--accent-2); }
|
|
140
|
+
.claims-table tr.drift .glyph, .claims-table tr.missing .glyph { color: var(--warn); }
|
|
141
|
+
.claims-table code { font-family: var(--mono); font-size: 0.82em; background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; }
|
|
142
|
+
.status-line { font-family: var(--sans); font-weight: 600; padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1.25rem; }
|
|
143
|
+
.status-line.ok { background: color-mix(in srgb, var(--accent-2) 15%, transparent); color: var(--accent-2); }
|
|
144
|
+
.status-line.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
|
|
145
|
+
.footer { text-align: center; margin-top: 1rem; font-family: var(--sans); font-size: 0.8rem; color: var(--muted); opacity: 0.7; }
|
|
146
|
+
</style>
|
|
147
|
+
</head>
|
|
148
|
+
<body>
|
|
149
|
+
<div class="container">
|
|
150
|
+
<header class="hero">
|
|
151
|
+
<div class="badge">Aura · Machina</div>
|
|
152
|
+
<h1>The Abstract Agent Machine</h1>
|
|
153
|
+
<div class="meta">A formal model of what aura-code is, independent of which oracle is plugged in</div>
|
|
154
|
+
</header>
|
|
155
|
+
|
|
156
|
+
<section class="card">
|
|
157
|
+
<p class="prose">${esc(spec_js_1.AAM_PREAMBLE)}</p>
|
|
158
|
+
<div class="tuple">AAM = (S, P, O, δ, s₀)</div>
|
|
159
|
+
<dl class="tuple-defs">
|
|
160
|
+
<dt>S</dt><dd>State space — conversation history plus loop counters. Every run lives inside S.</dd>
|
|
161
|
+
<dt>P</dt><dd>Primitives — the finite, fixed set of tool calls the machine can invoke. Finite and enumerable.</dd>
|
|
162
|
+
<dt>O</dt><dd>The oracle — the only swappable part of the tuple. LLM, human, rule table, or another AAM run recursively. Swapping O leaves S, P, δ, s₀ unchanged.</dd>
|
|
163
|
+
<dt>δ</dt><dd>Transition function — δ(s, O(s)) → s′: consult the oracle, run its output through the safety gate, execute tool calls against P, fold results into history.</dd>
|
|
164
|
+
<dt>s₀</dt><dd>Initial state — empty history plus the user's task as the first message.</dd>
|
|
165
|
+
</dl>
|
|
166
|
+
</section>
|
|
167
|
+
|
|
168
|
+
<section class="card">
|
|
169
|
+
<h2>The loop, diagrammed</h2>
|
|
170
|
+
${buildTupleSvg()}
|
|
171
|
+
</section>
|
|
172
|
+
|
|
173
|
+
<section class="card">
|
|
174
|
+
<h2>Grounding — verified against the live source</h2>
|
|
175
|
+
<div class="status-line ${allOk ? 'ok' : 'warn'}">${esc(statusLine)}</div>
|
|
176
|
+
${buildClaimsTable(report)}
|
|
177
|
+
</section>
|
|
178
|
+
|
|
179
|
+
<section class="card">
|
|
180
|
+
<h2>Why "unlimited" has a price</h2>
|
|
181
|
+
<p class="prose">${esc(spec_js_1.AAM_LIMITS_NOTE)}</p>
|
|
182
|
+
</section>
|
|
183
|
+
|
|
184
|
+
<footer class="footer"><p>Generated by Aura Code · :machina · claims verified against the checked-out source tree</p></footer>
|
|
185
|
+
</div>
|
|
186
|
+
</body>
|
|
187
|
+
</html>`;
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=render-html.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-html.js","sourceRoot":"","sources":["../../src/machina/render-html.ts"],"names":[],"mappings":";;AAgFA,0CAgHC;AAhMD,uCAA0D;AAG1D,SAAS,GAAG,CAAC,CAAS;IACpB,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACtG,CAAC;AAED,MAAM,eAAe,GAA6C;IAChE,CAAC,EAAE,iBAAiB;IACpB,CAAC,EAAE,gBAAgB;IACnB,CAAC,EAAE,YAAY;IACf,KAAK,EAAE,gBAAgB;IACvB,EAAE,EAAE,oBAAoB;IACxB,KAAK,EAAE,mBAAmB;CAC3B,CAAC;AAEF;;;;;;;GAOG;AACH,SAAS,aAAa;IACpB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;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