autodev-cli 1.4.97 → 1.4.101
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/media/profile/00-identity.md +8 -20
- package/media/profile/01-learning.md +12 -19
- package/media/profile/02-memory-mcp.md +4 -44
- package/media/profile/03-living-docs.md +10 -13
- package/media/profile/04-skill-files.md +3 -5
- package/media/profile/05-skill-creation.md +3 -14
- package/media/profile/06-core-rules.md +10 -47
- package/media/profile/07-core-loop.md +8 -25
- package/media/profile/08-thinking.md +10 -23
- package/media/profile/09-parallel-panel.md +9 -24
- package/media/profile/10-codebase-verification.md +7 -16
- package/media/profile/11-git-debug-security.md +5 -10
- package/media/profile/12-todo-format.md +3 -16
- package/media/profile/13-workflow-principles.md +3 -7
- package/media/profile/14-contracts.md +9 -12
- package/media/profile/15-soul.md +6 -8
- package/media/profile/16-journal.md +5 -32
- package/media/profile/17-issue-tracking.md +9 -14
- package/media/profile/18-knowledgebase.md +6 -9
- package/media/profile/19-subagent-context-management.md +11 -496
- package/media/profile/20-project-graph.md +23 -49
- package/out/commands/mcpOperate.js +150 -32
- package/out/commands/mcpOperate.js.map +1 -1
- package/out/core/controlSpec.d.ts +56 -0
- package/out/core/controlSpec.js +267 -0
- package/out/core/controlSpec.js.map +1 -0
- package/out/dispatcher.js +3 -1
- package/out/dispatcher.js.map +1 -1
- package/out/graphRender.d.ts +87 -0
- package/out/graphRender.js +279 -0
- package/out/graphRender.js.map +1 -0
- package/out/graphStore.d.ts +377 -2
- package/out/graphStore.js +1240 -64
- package/out/graphStore.js.map +1 -1
- package/out/journal.d.ts +35 -0
- package/out/journal.js +167 -0
- package/out/journal.js.map +1 -0
- package/out/messageBuilder.d.ts +1 -1
- package/out/messageBuilder.js +29 -29
- package/out/messageBuilder.js.map +1 -1
- package/out/periodicActions.d.ts +18 -0
- package/out/periodicActions.js +49 -0
- package/out/periodicActions.js.map +1 -1
- package/out/profileBuilder.d.ts +1 -1
- package/out/profileBuilder.js +31 -4
- package/out/profileBuilder.js.map +1 -1
- package/out/taskLoop.d.ts +19 -0
- package/out/taskLoop.js +214 -4
- package/out/taskLoop.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export interface ControlSpec {
|
|
2
|
+
/** Verify command(s) run after each task. GREEN (all exit 0) => keep. Empty => gate disabled. */
|
|
3
|
+
verify: string[];
|
|
4
|
+
/** Globs that must never be part of a kept edit. A task touching one is reverted. */
|
|
5
|
+
protected_files: string[];
|
|
6
|
+
/** What condition counts as "keep" — reserved; currently only 'green'. */
|
|
7
|
+
keep_on: string;
|
|
8
|
+
/** Max fix re-dispatches on a red verify before the change is discarded+reverted. */
|
|
9
|
+
max_fix_rounds: number;
|
|
10
|
+
/** Cheap auto-fix passes allowed for mechanical failures (type/import/syntax) before counting a real fix round. */
|
|
11
|
+
max_mechanical_fixes: number;
|
|
12
|
+
/** Hard wall-clock budget per task; exceeding it discards+reverts. null => no budget. */
|
|
13
|
+
budget_seconds: number | null;
|
|
14
|
+
/** Free-form conditions under which the agent should escalate instead of silently continuing. */
|
|
15
|
+
escalate_when: string[];
|
|
16
|
+
/** Free-form policy describing what to do when fix rounds are exhausted. */
|
|
17
|
+
exhaustion: string;
|
|
18
|
+
}
|
|
19
|
+
/** A spec with the verify gate active (verify has at least one command). */
|
|
20
|
+
export declare function isGateActive(spec: ControlSpec | null | undefined): spec is ControlSpec;
|
|
21
|
+
/**
|
|
22
|
+
* Extremely small YAML subset parser — enough for CONTROL.md.
|
|
23
|
+
* Supports: `key: scalar`, `key: [a, b]`, and a `key:` header followed by
|
|
24
|
+
* indented `- item` list lines. One level of nesting only. Comments (`#`) and
|
|
25
|
+
* blank lines are ignored. Quotes are stripped from scalars.
|
|
26
|
+
*/
|
|
27
|
+
export declare function parseControlYaml(text: string): Record<string, unknown>;
|
|
28
|
+
/**
|
|
29
|
+
* Load the control spec for a workspace, or null if none exists.
|
|
30
|
+
* Reads `.autodev/CONTROL.md` (first ```yaml fenced block) or `.autodev/control.yml`.
|
|
31
|
+
* Returns null on absence or parse failure — the caller then behaves as today.
|
|
32
|
+
*/
|
|
33
|
+
export declare function loadControlSpec(root: string): ControlSpec | null;
|
|
34
|
+
export interface VerifyResult {
|
|
35
|
+
/** All configured commands exited 0. */
|
|
36
|
+
ok: boolean;
|
|
37
|
+
/** Combined tail of stdout/stderr across commands (capped). */
|
|
38
|
+
output: string;
|
|
39
|
+
/** Exit code of the first failing command, or 0 if all passed. */
|
|
40
|
+
code: number;
|
|
41
|
+
/** True when the run was killed by the timeout. */
|
|
42
|
+
timedOut: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Run each verify command in sequence. GREEN only when every command exits 0.
|
|
46
|
+
* Captures combined output (tail-capped) for the fix hint and journal notes.
|
|
47
|
+
*/
|
|
48
|
+
export declare function runVerify(commands: string[], cwd: string, timeoutMs: number): VerifyResult;
|
|
49
|
+
/**
|
|
50
|
+
* Does a failure output look MECHANICAL (a cheap, local fix — type error, missing
|
|
51
|
+
* import, syntax error) rather than a genuine logic failure? Used to grant a cheap
|
|
52
|
+
* extra auto-fix pass before counting a real fix round.
|
|
53
|
+
*/
|
|
54
|
+
export declare function isMechanicalFailure(output: string): boolean;
|
|
55
|
+
/** True when `file` (repo-relative, forward slashes) matches any of the globs. */
|
|
56
|
+
export declare function matchesAnyGlob(file: string, globs: string[]): boolean;
|
|
@@ -0,0 +1,267 @@
|
|
|
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.isGateActive = isGateActive;
|
|
37
|
+
exports.parseControlYaml = parseControlYaml;
|
|
38
|
+
exports.loadControlSpec = loadControlSpec;
|
|
39
|
+
exports.runVerify = runVerify;
|
|
40
|
+
exports.isMechanicalFailure = isMechanicalFailure;
|
|
41
|
+
exports.matchesAnyGlob = matchesAnyGlob;
|
|
42
|
+
const fs = __importStar(require("fs"));
|
|
43
|
+
const path = __importStar(require("path"));
|
|
44
|
+
const child_process_1 = require("child_process");
|
|
45
|
+
/** A spec with the verify gate active (verify has at least one command). */
|
|
46
|
+
function isGateActive(spec) {
|
|
47
|
+
return !!spec && Array.isArray(spec.verify) && spec.verify.length > 0;
|
|
48
|
+
}
|
|
49
|
+
function asStringArray(v) {
|
|
50
|
+
if (v == null) {
|
|
51
|
+
return [];
|
|
52
|
+
}
|
|
53
|
+
if (Array.isArray(v)) {
|
|
54
|
+
return v.map(x => String(x).trim()).filter(Boolean);
|
|
55
|
+
}
|
|
56
|
+
const s = String(v).trim();
|
|
57
|
+
return s ? [s] : [];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Extremely small YAML subset parser — enough for CONTROL.md.
|
|
61
|
+
* Supports: `key: scalar`, `key: [a, b]`, and a `key:` header followed by
|
|
62
|
+
* indented `- item` list lines. One level of nesting only. Comments (`#`) and
|
|
63
|
+
* blank lines are ignored. Quotes are stripped from scalars.
|
|
64
|
+
*/
|
|
65
|
+
function parseControlYaml(text) {
|
|
66
|
+
const out = {};
|
|
67
|
+
const lines = text.split(/\r?\n/);
|
|
68
|
+
let listKey = null;
|
|
69
|
+
let listAcc = [];
|
|
70
|
+
const flushList = () => {
|
|
71
|
+
if (listKey !== null) {
|
|
72
|
+
out[listKey] = listAcc;
|
|
73
|
+
listKey = null;
|
|
74
|
+
listAcc = [];
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const stripQuotes = (s) => {
|
|
78
|
+
const t = s.trim();
|
|
79
|
+
if ((t.startsWith('"') && t.endsWith('"')) || (t.startsWith("'") && t.endsWith("'"))) {
|
|
80
|
+
return t.slice(1, -1);
|
|
81
|
+
}
|
|
82
|
+
return t;
|
|
83
|
+
};
|
|
84
|
+
for (const rawLine of lines) {
|
|
85
|
+
const line = rawLine.replace(/\s+#.*$/, ''); // strip trailing comments
|
|
86
|
+
if (!line.trim()) {
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
if (line.trim().startsWith('#')) {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
const listItem = line.match(/^\s*-\s+(.*)$/);
|
|
93
|
+
if (listItem && listKey !== null) {
|
|
94
|
+
listAcc.push(stripQuotes(listItem[1]));
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const kv = line.match(/^(\S[^:]*?):\s*(.*)$/);
|
|
98
|
+
if (kv) {
|
|
99
|
+
flushList();
|
|
100
|
+
const key = kv[1].trim();
|
|
101
|
+
const val = kv[2].trim();
|
|
102
|
+
if (val === '') {
|
|
103
|
+
// Could be the header of an indented list — start accumulating.
|
|
104
|
+
listKey = key;
|
|
105
|
+
listAcc = [];
|
|
106
|
+
}
|
|
107
|
+
else if (val.startsWith('[') && val.endsWith(']')) {
|
|
108
|
+
out[key] = val.slice(1, -1).split(',').map(s => stripQuotes(s)).filter(Boolean);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
out[key] = stripQuotes(val);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
flushList();
|
|
116
|
+
// A key that opened a list but got no items is an empty list.
|
|
117
|
+
return out;
|
|
118
|
+
}
|
|
119
|
+
function specFromRaw(raw) {
|
|
120
|
+
const num = (v, dflt) => {
|
|
121
|
+
const n = Number(v);
|
|
122
|
+
return Number.isFinite(n) && n >= 0 ? n : dflt;
|
|
123
|
+
};
|
|
124
|
+
const budgetRaw = raw['budget_seconds'];
|
|
125
|
+
const budget = budgetRaw == null || budgetRaw === '' ? null : num(budgetRaw, 0) || null;
|
|
126
|
+
return {
|
|
127
|
+
verify: asStringArray(raw['verify']),
|
|
128
|
+
protected_files: asStringArray(raw['protected_files'] ?? raw['protected']),
|
|
129
|
+
keep_on: (typeof raw['keep_on'] === 'string' && raw['keep_on']) ? String(raw['keep_on']) : 'green',
|
|
130
|
+
max_fix_rounds: num(raw['max_fix_rounds'], 3),
|
|
131
|
+
max_mechanical_fixes: num(raw['max_mechanical_fixes'], 1),
|
|
132
|
+
budget_seconds: budget,
|
|
133
|
+
escalate_when: asStringArray(raw['escalate_when']),
|
|
134
|
+
exhaustion: typeof raw['exhaustion'] === 'string' ? String(raw['exhaustion']) : '',
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Load the control spec for a workspace, or null if none exists.
|
|
139
|
+
* Reads `.autodev/CONTROL.md` (first ```yaml fenced block) or `.autodev/control.yml`.
|
|
140
|
+
* Returns null on absence or parse failure — the caller then behaves as today.
|
|
141
|
+
*/
|
|
142
|
+
function loadControlSpec(root) {
|
|
143
|
+
try {
|
|
144
|
+
const dir = path.join(root, '.autodev');
|
|
145
|
+
const ymlPath = path.join(dir, 'control.yml');
|
|
146
|
+
const mdPath = path.join(dir, 'CONTROL.md');
|
|
147
|
+
let yamlText = null;
|
|
148
|
+
if (fs.existsSync(ymlPath)) {
|
|
149
|
+
yamlText = fs.readFileSync(ymlPath, 'utf8');
|
|
150
|
+
}
|
|
151
|
+
else if (fs.existsSync(mdPath)) {
|
|
152
|
+
const md = fs.readFileSync(mdPath, 'utf8');
|
|
153
|
+
const fence = md.match(/```ya?ml\s*\n([\s\S]*?)```/i);
|
|
154
|
+
// Fall back to the whole file if the doc is written as bare YAML with no fence.
|
|
155
|
+
yamlText = fence ? fence[1] : md;
|
|
156
|
+
}
|
|
157
|
+
if (yamlText == null) {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
const raw = parseControlYaml(yamlText);
|
|
161
|
+
const spec = specFromRaw(raw);
|
|
162
|
+
// A CONTROL file that parses to nothing meaningful is treated as present-but-empty,
|
|
163
|
+
// NOT as a gate — verify is empty, so isGateActive() is false and the loop still
|
|
164
|
+
// behaves as today. We still return the spec so protected_files/budget could apply
|
|
165
|
+
// if the user set only those, but with no verify the gate itself stays off.
|
|
166
|
+
return spec;
|
|
167
|
+
}
|
|
168
|
+
catch {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Run each verify command in sequence. GREEN only when every command exits 0.
|
|
174
|
+
* Captures combined output (tail-capped) for the fix hint and journal notes.
|
|
175
|
+
*/
|
|
176
|
+
function runVerify(commands, cwd, timeoutMs) {
|
|
177
|
+
let output = '';
|
|
178
|
+
for (const cmd of commands) {
|
|
179
|
+
let r;
|
|
180
|
+
try {
|
|
181
|
+
r = (0, child_process_1.spawnSync)(cmd, {
|
|
182
|
+
cwd,
|
|
183
|
+
shell: true,
|
|
184
|
+
encoding: 'utf8',
|
|
185
|
+
timeout: timeoutMs > 0 ? timeoutMs : undefined,
|
|
186
|
+
maxBuffer: 8 * 1024 * 1024,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
catch (e) {
|
|
190
|
+
return { ok: false, output: `${output}\n$ ${cmd}\n${e instanceof Error ? e.message : String(e)}`.trim(), code: 1, timedOut: false };
|
|
191
|
+
}
|
|
192
|
+
const chunk = `$ ${cmd}\n${(r.stdout || '')}${(r.stderr || '')}`;
|
|
193
|
+
output = (output ? output + '\n' : '') + chunk;
|
|
194
|
+
const timedOut = r.signal === 'SIGTERM' && r.status == null;
|
|
195
|
+
if (r.status !== 0) {
|
|
196
|
+
const capped = output.length > 6000 ? '…' + output.slice(-6000) : output;
|
|
197
|
+
return { ok: false, output: capped, code: r.status ?? 1, timedOut };
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
const capped = output.length > 6000 ? '…' + output.slice(-6000) : output;
|
|
201
|
+
return { ok: true, output: capped, code: 0, timedOut: false };
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Does a failure output look MECHANICAL (a cheap, local fix — type error, missing
|
|
205
|
+
* import, syntax error) rather than a genuine logic failure? Used to grant a cheap
|
|
206
|
+
* extra auto-fix pass before counting a real fix round.
|
|
207
|
+
*/
|
|
208
|
+
function isMechanicalFailure(output) {
|
|
209
|
+
const s = output.toLowerCase();
|
|
210
|
+
return (/error ts\d+/.test(s) || // tsc: error TS2304
|
|
211
|
+
s.includes('cannot find name') ||
|
|
212
|
+
s.includes('cannot find module') ||
|
|
213
|
+
s.includes('is not defined') ||
|
|
214
|
+
s.includes('has no exported member') ||
|
|
215
|
+
s.includes('syntaxerror') ||
|
|
216
|
+
s.includes('unexpected token') ||
|
|
217
|
+
s.includes('unexpected identifier') ||
|
|
218
|
+
s.includes('missing import') ||
|
|
219
|
+
s.includes('no such file or directory') ||
|
|
220
|
+
s.includes('importerror') ||
|
|
221
|
+
s.includes('modulenotfounderror'));
|
|
222
|
+
}
|
|
223
|
+
/** Convert a simple glob (supporting **, *, ?) to a RegExp anchored to the whole path. */
|
|
224
|
+
function globToRegExp(glob) {
|
|
225
|
+
let re = '';
|
|
226
|
+
for (let i = 0; i < glob.length; i++) {
|
|
227
|
+
const c = glob[i];
|
|
228
|
+
if (c === '*') {
|
|
229
|
+
if (glob[i + 1] === '*') {
|
|
230
|
+
re += '.*';
|
|
231
|
+
i++;
|
|
232
|
+
if (glob[i + 1] === '/') {
|
|
233
|
+
i++;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
re += '[^/]*';
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
else if (c === '?') {
|
|
241
|
+
re += '[^/]';
|
|
242
|
+
}
|
|
243
|
+
else if ('.^$+{}()|[]\\'.includes(c)) {
|
|
244
|
+
re += '\\' + c;
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
re += c;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return new RegExp('^' + re + '$');
|
|
251
|
+
}
|
|
252
|
+
/** True when `file` (repo-relative, forward slashes) matches any of the globs. */
|
|
253
|
+
function matchesAnyGlob(file, globs) {
|
|
254
|
+
const norm = file.replace(/\\/g, '/').replace(/^\.\//, '');
|
|
255
|
+
return globs.some(g => {
|
|
256
|
+
const gg = g.replace(/^\.\//, '');
|
|
257
|
+
if (globToRegExp(gg).test(norm)) {
|
|
258
|
+
return true;
|
|
259
|
+
}
|
|
260
|
+
// A bare filename glob (no slash) should also match a basename anywhere.
|
|
261
|
+
if (!gg.includes('/') && globToRegExp(gg).test(norm.split('/').pop() || norm)) {
|
|
262
|
+
return true;
|
|
263
|
+
}
|
|
264
|
+
return false;
|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AC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC;YAAC,OAAO,IAAI,CAAC;QAAC,CAAC;QAC/F,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/out/dispatcher.js
CHANGED
|
@@ -100,7 +100,9 @@ showOutput) {
|
|
|
100
100
|
throw new Error('No workspace root provided');
|
|
101
101
|
}
|
|
102
102
|
const agentProfileFile = path.join(root, sessionState_1.AGENT_PROFILE_FILE);
|
|
103
|
-
|
|
103
|
+
// MESSAGE.md sits beside program.md in .autodev/ (do NOT derive it by string
|
|
104
|
+
// -replacing the profile filename — that broke when AGENT_PROFILE.md → program.md).
|
|
105
|
+
const messageFile = messageFilePath ?? path.join(root, '.autodev', 'MESSAGE.md');
|
|
104
106
|
(0, sessionState_1.autodevDir)(root);
|
|
105
107
|
ensureProjectGitignore(root, '.autodev/');
|
|
106
108
|
// Sensitive config files that may contain API keys or private server definitions
|
package/out/dispatcher.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../src/dispatcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,
|
|
1
|
+
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../src/dispatcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,wCAsIC;AAhND,uCAAyB;AAEzB,2CAA6B;AAC7B,2CAAoD;AAEpD,iDAA8I;AAC9I,0DAA4D;AAC5D,qEAAyI;AACzI,uEAA6F;AAC7F,yEAAsG;AAKtG,iEAAwF;AACxF,0DAA4G;AAC5G,uEAAoE;AAGpE,yEAAyE;AACzE,mEAQuC;AAPrC,4HAAA,uBAAuB,OAAA;AACvB,yHAAA,oBAAoB,OAAA;AACpB,2HAAA,sBAAsB,OAAA;AACtB,0HAAA,qBAAqB,OAAA;AACr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IAAA,sCAAuB,EAAC,IAAI,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;gBAAC,CAAC;YAChF,CAAC;QACH,CAAC;aAAM,CAAC;YACN,oEAAoE;YACpE,GAAG,CAAC,GAAG,WAAW,CAAC,KAAK,gCAAgC,iBAAiB,IAAI,KAAK,GAAG,CAAC,CAAC;QACzF,CAAC;QACD,OAAO;IACT,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Presentation for the project graph — how nodes/subgraphs are rendered for the
|
|
3
|
+
* model. Kept SEPARATE from the store (graphStore.ts) so it is pure and unit-
|
|
4
|
+
* testable, and so Tier 1 (ranking / summaries / graph_search) can build on it.
|
|
5
|
+
*
|
|
6
|
+
* Two rules the model relies on:
|
|
7
|
+
* - Truncation is EXPLICIT — an over-cap body ends with a pointer to the full
|
|
8
|
+
* text; a token-budgeted subgraph reports what it omitted. Never a silent clip.
|
|
9
|
+
* - Uncertainty is VISIBLE — unverified inferences and incident `contradicts`
|
|
10
|
+
* edges are surfaced inline so a silently-conflicting fact can't slip past.
|
|
11
|
+
*/
|
|
12
|
+
import type { GraphNode, GraphEdge, GraphMap, SearchResult, TocResult } from './graphStore';
|
|
13
|
+
/** Max body chars shown inline before an explicit truncation pointer. */
|
|
14
|
+
export declare const BODY_CAP = 200;
|
|
15
|
+
/** Default token budget for a rendered neighbourhood. */
|
|
16
|
+
export declare const DEFAULT_TOKEN_BUDGET = 1500;
|
|
17
|
+
export interface Conflict {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
}
|
|
21
|
+
type FmtNodeInput = Pick<GraphNode, 'id' | 'type' | 'name'> & Partial<Pick<GraphNode, 'source' | 'version' | 'inference' | 'supersededBy' | 'body' | 'summary'>>;
|
|
22
|
+
/** Extra summary presentation for {@link fmtNode} — a synthesized rollup and/or a staleness flag. */
|
|
23
|
+
export interface FmtOpts {
|
|
24
|
+
/** A synthesized structural rollup to show when the node has no authored summary. */
|
|
25
|
+
summary?: string;
|
|
26
|
+
/** True when `summary` above is a deterministic rollup, not authored (renders `≡~`). */
|
|
27
|
+
synthesized?: boolean;
|
|
28
|
+
/** True when the node's AUTHORED summary is stale (superseded / gained children). */
|
|
29
|
+
stale?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* One node as a compact, citable line. `conflicts` are the node's incident
|
|
33
|
+
* `contradicts` edges (from {@link GraphStore.contradictionsFor}); when present
|
|
34
|
+
* they are appended as `⚠ contradicts [id] "name"`. A summary — authored (`≡`) or
|
|
35
|
+
* a synthesized structural rollup via `opts.summary` (`≡~`) — is preferred over the
|
|
36
|
+
* body as the node's gist (Tier 1, item 3).
|
|
37
|
+
*/
|
|
38
|
+
export declare function fmtNode(n: FmtNodeInput, conflicts?: Conflict[], opts?: FmtOpts): string;
|
|
39
|
+
/**
|
|
40
|
+
* Render the cold-start anchor index (Tier 1, item 2): the connectivity hubs plus
|
|
41
|
+
* the open questions, freshest decisions, and live contradictions — the "where do
|
|
42
|
+
* I start" entry point an agent reads at task start.
|
|
43
|
+
*/
|
|
44
|
+
export declare function renderMap(m: GraphMap): string;
|
|
45
|
+
/**
|
|
46
|
+
* Render a graph_search bundle (Tier 1, item 4): a ranked, citable list. Each row
|
|
47
|
+
* cites `[id]` with a one-line WHY — the matched terms and the edge-path from its
|
|
48
|
+
* seed — plus contradiction / unverified-inference flags. Vectorless + explainable.
|
|
49
|
+
*/
|
|
50
|
+
export declare function renderSearch(res: SearchResult): string;
|
|
51
|
+
export interface NeighborsResult {
|
|
52
|
+
center: GraphNode;
|
|
53
|
+
nodes: GraphNode[];
|
|
54
|
+
edges: GraphEdge[];
|
|
55
|
+
dist: Record<string, number>;
|
|
56
|
+
}
|
|
57
|
+
/** Effective (authored or synthesized) summary of a node, for the full-detail line. */
|
|
58
|
+
export type EffSummary = {
|
|
59
|
+
text: string;
|
|
60
|
+
synthesized: boolean;
|
|
61
|
+
} | undefined;
|
|
62
|
+
export interface RenderNeighborsOpts {
|
|
63
|
+
tokenBudget?: number;
|
|
64
|
+
conflictsFor: (id: string) => Conflict[];
|
|
65
|
+
/** Pinned "core" nodes (item 4) — always prepended within budget, even off-neighbourhood. */
|
|
66
|
+
pinned?: GraphNode[];
|
|
67
|
+
/** Effective summary provider so a full line can show the authored/synthesized gist. */
|
|
68
|
+
effectiveSummaryFor?: (n: GraphNode) => EffSummary;
|
|
69
|
+
/** Deterministic branch rollup (item 5) — used to collapse a branch that won't fit. */
|
|
70
|
+
rollupFor?: (id: string) => string | undefined;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Render a bounded neighbourhood (Tier 2, item 4). Order: center → pinned core →
|
|
74
|
+
* neighbours ranked by hop-proximity then recency. Fill to `tokenBudget`; when a
|
|
75
|
+
* node won't fit, DEGRADE in tiers rather than silently drop — (a) body→name-only,
|
|
76
|
+
* (b) substitute a branch's rollup summary for its members, (c) explicit
|
|
77
|
+
* `…N more omitted`. Center + pinned nodes ALWAYS appear (degraded if need be).
|
|
78
|
+
*/
|
|
79
|
+
export declare function renderNeighbors(res: NeighborsResult, opts: RenderNeighborsOpts): string;
|
|
80
|
+
/**
|
|
81
|
+
* Render a navigable table-of-contents (Tier 2, item 2) as an indented outline —
|
|
82
|
+
* the PageIndex-style text-stripped overview. Each line carries `[id]` to drill a
|
|
83
|
+
* branch (`graph_toc root=<id>`) and its one-line summary; over-cap children
|
|
84
|
+
* collapse to `+K more`.
|
|
85
|
+
*/
|
|
86
|
+
export declare function renderToc(res: TocResult): string;
|
|
87
|
+
export {};
|