@telora/daemon 0.19.31 → 0.19.34
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/build-info.json +6 -3
- package/dist/cli/connect.d.ts +115 -2
- package/dist/cli/connect.d.ts.map +1 -1
- package/dist/cli/connect.js +223 -18
- package/dist/cli/connect.js.map +1 -1
- package/dist/cli/harness-add.d.ts +37 -0
- package/dist/cli/harness-add.d.ts.map +1 -0
- package/dist/cli/harness-add.js +48 -0
- package/dist/cli/harness-add.js.map +1 -0
- package/dist/cli/open.d.ts +171 -0
- package/dist/cli/open.d.ts.map +1 -0
- package/dist/cli/open.js +323 -0
- package/dist/cli/open.js.map +1 -0
- package/dist/focus-engine.d.ts.map +1 -1
- package/dist/focus-engine.js +24 -0
- package/dist/focus-engine.js.map +1 -1
- package/dist/index.js +54 -8
- package/dist/index.js.map +1 -1
- package/dist/queries/code-metrics.d.ts +40 -0
- package/dist/queries/code-metrics.d.ts.map +1 -0
- package/dist/queries/code-metrics.js +24 -0
- package/dist/queries/code-metrics.js.map +1 -0
- package/dist/sensor-sweep.d.ts +137 -0
- package/dist/sensor-sweep.d.ts.map +1 -0
- package/dist/sensor-sweep.js +366 -0
- package/dist/sensor-sweep.js.map +1 -0
- package/dist/templates/agents-md.d.ts +8 -0
- package/dist/templates/agents-md.d.ts.map +1 -1
- package/dist/templates/agents-md.js +4 -3
- package/dist/templates/agents-md.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic whole-repo sensor sweep -- the DC baseline for artifact health.
|
|
3
|
+
*
|
|
4
|
+
* Peer of the other daemon loop ticks (drift-eval, verification, merge-back).
|
|
5
|
+
* Each tick walks every configured product's repo and, when the repo has drifted
|
|
6
|
+
* since the last snapshot, mines a deterministic snapshot into the code_metrics
|
|
7
|
+
* time series:
|
|
8
|
+
* - git churn + hotspot mass (change frequency x a language-agnostic size /
|
|
9
|
+
* indentation-complexity proxy over the changed set);
|
|
10
|
+
* - lint-gate ratchet exception counts harvested from scripts/lint-config.json;
|
|
11
|
+
* - dependency freshness derived from the package manifests.
|
|
12
|
+
*
|
|
13
|
+
* Purely deterministic: git + filesystem reads only, NO LLM and NO network
|
|
14
|
+
* beyond the local repo. Burn is drift-proportional: a product whose repo HEAD
|
|
15
|
+
* and manifest hash are unchanged since its last snapshot is skipped -- the
|
|
16
|
+
* sweep sees cold-code rot and environment drift that activity-gated sampling
|
|
17
|
+
* cannot, without re-mining an unchanged tree.
|
|
18
|
+
*
|
|
19
|
+
* All side effects (git, fs, the code_metrics query wrappers, the clock) are
|
|
20
|
+
* injected via `Deps` so the miners and the drift-skip logic are unit-testable
|
|
21
|
+
* without a real repo. Mirrors the drift-eval-loop.ts dependency-injection
|
|
22
|
+
* pattern.
|
|
23
|
+
*
|
|
24
|
+
* @module sensor-sweep
|
|
25
|
+
*/
|
|
26
|
+
import { readFileSync, readdirSync, existsSync } from 'node:fs';
|
|
27
|
+
import { join } from 'node:path';
|
|
28
|
+
import { runGitSync } from './git-types.js';
|
|
29
|
+
import { configForProduct } from './config.js';
|
|
30
|
+
import { getLatestCodeMetrics, createCodeMetricsSnapshot } from './queries/code-metrics.js';
|
|
31
|
+
/** How many recent commits define the churn/hotspot mining window. */
|
|
32
|
+
const DEFAULT_COMMIT_WINDOW = 500;
|
|
33
|
+
const MS_PER_DAY = 86_400_000;
|
|
34
|
+
/**
|
|
35
|
+
* Parse `git log -n<N> --numstat --format=COMMIT:%H %aI` output into per-file
|
|
36
|
+
* churn. Pure: no git process. Binary numstat rows (`-\t-`) are skipped.
|
|
37
|
+
*/
|
|
38
|
+
export function parseNumstatPerFile(output) {
|
|
39
|
+
const perFile = new Map();
|
|
40
|
+
let commitMs = 0;
|
|
41
|
+
for (const rawLine of output.split('\n')) {
|
|
42
|
+
const line = rawLine.trimEnd();
|
|
43
|
+
if (!line)
|
|
44
|
+
continue;
|
|
45
|
+
if (line.startsWith('COMMIT:')) {
|
|
46
|
+
// "COMMIT:<sha> <iso8601>"
|
|
47
|
+
const rest = line.slice('COMMIT:'.length).trim();
|
|
48
|
+
const spaceIdx = rest.indexOf(' ');
|
|
49
|
+
const iso = spaceIdx >= 0 ? rest.slice(spaceIdx + 1).trim() : '';
|
|
50
|
+
const parsed = iso ? Date.parse(iso) : NaN;
|
|
51
|
+
commitMs = Number.isNaN(parsed) ? commitMs : parsed;
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
const parts = line.split('\t');
|
|
55
|
+
if (parts.length < 3)
|
|
56
|
+
continue;
|
|
57
|
+
const added = parts[0];
|
|
58
|
+
const removed = parts[1];
|
|
59
|
+
const file = parts[2];
|
|
60
|
+
if (!file)
|
|
61
|
+
continue;
|
|
62
|
+
if (added === '-' || removed === '-')
|
|
63
|
+
continue; // binary
|
|
64
|
+
const lines = (parseInt(added, 10) || 0) + (parseInt(removed, 10) || 0);
|
|
65
|
+
const existing = perFile.get(file);
|
|
66
|
+
if (existing) {
|
|
67
|
+
existing.changeCount += 1;
|
|
68
|
+
existing.linesChanged += lines;
|
|
69
|
+
if (commitMs > existing.lastCommitMs)
|
|
70
|
+
existing.lastCommitMs = commitMs;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
perFile.set(file, { changeCount: 1, linesChanged: lines, lastCommitMs: commitMs });
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return perFile;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Language-agnostic complexity proxy for a file body: line count plus the sum of
|
|
80
|
+
* per-line indentation depth (leading whitespace, tabs counted as one level).
|
|
81
|
+
* Deeper, longer files score higher without any per-language AST tooling.
|
|
82
|
+
*/
|
|
83
|
+
export function complexityProxy(content) {
|
|
84
|
+
let score = 0;
|
|
85
|
+
for (const line of content.split('\n')) {
|
|
86
|
+
if (!line.trim())
|
|
87
|
+
continue;
|
|
88
|
+
score += 1; // one per non-blank line
|
|
89
|
+
const leading = line.length - line.trimStart().length;
|
|
90
|
+
// Normalize indentation: tabs and 2-space steps both count as ~1 level.
|
|
91
|
+
score += Math.floor(leading / 2);
|
|
92
|
+
}
|
|
93
|
+
return score;
|
|
94
|
+
}
|
|
95
|
+
/** Map a repo-relative path to an area = its first `depth` path segments. */
|
|
96
|
+
export function areaOf(filePath, depth = 2) {
|
|
97
|
+
const segments = filePath.split('/').filter(Boolean);
|
|
98
|
+
if (segments.length <= 1)
|
|
99
|
+
return '(root)';
|
|
100
|
+
return segments.slice(0, depth).join('/');
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Aggregate per-file churn + complexity into per-area metrics and repo totals.
|
|
104
|
+
* `complexityFor(file)` returns the size/complexity proxy for a changed file
|
|
105
|
+
* (injected so tests need no fs); a missing file falls back to its linesChanged.
|
|
106
|
+
*/
|
|
107
|
+
export function aggregateAreas(perFile, complexityFor, nowMs, depth = 2) {
|
|
108
|
+
const byArea = new Map();
|
|
109
|
+
let totalChurn = 0;
|
|
110
|
+
let totalHotspotMass = 0;
|
|
111
|
+
for (const [file, churn] of perFile) {
|
|
112
|
+
const complexity = complexityFor(file);
|
|
113
|
+
const sizeProxy = complexity == null ? churn.linesChanged : complexity;
|
|
114
|
+
const hotspot = churn.changeCount * sizeProxy;
|
|
115
|
+
totalChurn += churn.linesChanged;
|
|
116
|
+
totalHotspotMass += hotspot;
|
|
117
|
+
const area = areaOf(file, depth);
|
|
118
|
+
const bucket = byArea.get(area) ?? { churn: 0, hotspotMass: 0, files: new Set(), newestMs: 0 };
|
|
119
|
+
bucket.churn += churn.linesChanged;
|
|
120
|
+
bucket.hotspotMass += hotspot;
|
|
121
|
+
bucket.files.add(file);
|
|
122
|
+
if (churn.lastCommitMs > bucket.newestMs)
|
|
123
|
+
bucket.newestMs = churn.lastCommitMs;
|
|
124
|
+
byArea.set(area, bucket);
|
|
125
|
+
}
|
|
126
|
+
const areas = [...byArea.entries()]
|
|
127
|
+
.map(([area, b]) => ({
|
|
128
|
+
area,
|
|
129
|
+
churn: b.churn,
|
|
130
|
+
hotspotMass: b.hotspotMass,
|
|
131
|
+
fileCount: b.files.size,
|
|
132
|
+
ageDays: b.newestMs > 0 ? Math.max(0, Math.round((nowMs - b.newestMs) / MS_PER_DAY)) : 0,
|
|
133
|
+
}))
|
|
134
|
+
.sort((a, b) => b.hotspotMass - a.hotspotMass);
|
|
135
|
+
return { areas, totalChurn, totalHotspotMass };
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Count lint-gate ratchet exceptions from a parsed scripts/lint-config.json.
|
|
139
|
+
* Each top-level category (except `_comment`) is an array of allowlist entries;
|
|
140
|
+
* a growing count is accumulating debt the ratchet is holding back.
|
|
141
|
+
*/
|
|
142
|
+
export function countRatchets(lintConfig) {
|
|
143
|
+
const detail = {};
|
|
144
|
+
let total = 0;
|
|
145
|
+
if (lintConfig && typeof lintConfig === 'object') {
|
|
146
|
+
for (const [key, value] of Object.entries(lintConfig)) {
|
|
147
|
+
if (key.startsWith('_'))
|
|
148
|
+
continue;
|
|
149
|
+
if (Array.isArray(value)) {
|
|
150
|
+
detail[key] = value.length;
|
|
151
|
+
total += value.length;
|
|
152
|
+
}
|
|
153
|
+
else if (value && typeof value === 'object') {
|
|
154
|
+
// Nested { category: [...] } shapes contribute their array lengths.
|
|
155
|
+
for (const inner of Object.values(value)) {
|
|
156
|
+
if (Array.isArray(inner))
|
|
157
|
+
total += inner.length;
|
|
158
|
+
}
|
|
159
|
+
detail[key] = total;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return { total, detail };
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Derive dependency freshness from manifests alone (no registry / network).
|
|
167
|
+
* `outdated` is a deterministic risk proxy: a dependency pinned to a pre-1.0
|
|
168
|
+
* (0.x) major, or to an unbounded/floating range (`*`, `latest`, `x`), reads as
|
|
169
|
+
* a freshness/stability risk. Also returns a stable manifest hash for the
|
|
170
|
+
* drift-skip key.
|
|
171
|
+
*/
|
|
172
|
+
export function analyzeManifests(manifests) {
|
|
173
|
+
const detail = {};
|
|
174
|
+
let dependencyCount = 0;
|
|
175
|
+
let dependencyOutdated = 0;
|
|
176
|
+
const hashParts = [];
|
|
177
|
+
const sorted = [...manifests].sort((a, b) => a.path.localeCompare(b.path));
|
|
178
|
+
for (const manifest of sorted) {
|
|
179
|
+
const content = manifest.content;
|
|
180
|
+
let count = 0;
|
|
181
|
+
let outdated = 0;
|
|
182
|
+
if (content && typeof content === 'object') {
|
|
183
|
+
const c = content;
|
|
184
|
+
for (const section of ['dependencies', 'devDependencies']) {
|
|
185
|
+
const deps = c[section];
|
|
186
|
+
if (deps && typeof deps === 'object' && !Array.isArray(deps)) {
|
|
187
|
+
for (const [name, spec] of Object.entries(deps)) {
|
|
188
|
+
const specStr = String(spec);
|
|
189
|
+
count += 1;
|
|
190
|
+
hashParts.push(`${manifest.path}:${name}@${specStr}`);
|
|
191
|
+
if (isOutdatedSpec(specStr))
|
|
192
|
+
outdated += 1;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
detail[manifest.path] = { count, outdated };
|
|
198
|
+
dependencyCount += count;
|
|
199
|
+
dependencyOutdated += outdated;
|
|
200
|
+
}
|
|
201
|
+
return { dependencyCount, dependencyOutdated, detail, manifestHash: fnv1a(hashParts.join('\n')) };
|
|
202
|
+
}
|
|
203
|
+
/** Pre-1.0 major or unbounded/floating range => a deterministic freshness risk. */
|
|
204
|
+
export function isOutdatedSpec(spec) {
|
|
205
|
+
const s = spec.trim();
|
|
206
|
+
if (s === '*' || s === 'latest' || s === 'x' || s === '')
|
|
207
|
+
return true;
|
|
208
|
+
// Strip a single leading range operator, then test for a 0.x major.
|
|
209
|
+
const stripped = s.replace(/^[\^~>=<]+/, '');
|
|
210
|
+
return /^0\./.test(stripped);
|
|
211
|
+
}
|
|
212
|
+
/** FNV-1a 32-bit -- a small, dependency-free deterministic string hash. */
|
|
213
|
+
export function fnv1a(input) {
|
|
214
|
+
let hash = 0x811c9dc5;
|
|
215
|
+
for (let i = 0; i < input.length; i++) {
|
|
216
|
+
hash ^= input.charCodeAt(i);
|
|
217
|
+
hash = Math.imul(hash, 0x01000193);
|
|
218
|
+
}
|
|
219
|
+
return (hash >>> 0).toString(16).padStart(8, '0');
|
|
220
|
+
}
|
|
221
|
+
export function defaultSensorSweepDeps() {
|
|
222
|
+
return {
|
|
223
|
+
gitNumstat: (repoPath, window) => {
|
|
224
|
+
const result = runGitSync(['log', `-n${window}`, '--numstat', '--format=COMMIT:%H %aI'], repoPath, { timeoutMs: 60_000 });
|
|
225
|
+
return result.success ? (result.output ?? '') : '';
|
|
226
|
+
},
|
|
227
|
+
listTrackedFiles: (repoPath) => {
|
|
228
|
+
const result = runGitSync(['ls-files'], repoPath, { timeoutMs: 30_000 });
|
|
229
|
+
if (!result.success)
|
|
230
|
+
return [];
|
|
231
|
+
return result.output.split('\n').map((l) => l.trim()).filter(Boolean);
|
|
232
|
+
},
|
|
233
|
+
readFile: (repoPath, relPath) => {
|
|
234
|
+
try {
|
|
235
|
+
return readFileSync(join(repoPath, relPath), 'utf8');
|
|
236
|
+
}
|
|
237
|
+
catch {
|
|
238
|
+
return null;
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
readLintConfig: (repoPath) => {
|
|
242
|
+
try {
|
|
243
|
+
return JSON.parse(readFileSync(join(repoPath, 'scripts', 'lint-config.json'), 'utf8'));
|
|
244
|
+
}
|
|
245
|
+
catch {
|
|
246
|
+
return null;
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
readManifests: (repoPath) => discoverManifests(repoPath),
|
|
250
|
+
resolveHeadSha: (repoPath) => {
|
|
251
|
+
const result = runGitSync(['rev-parse', 'HEAD'], repoPath, { timeoutMs: 15_000 });
|
|
252
|
+
return result.success ? result.output.trim() : null;
|
|
253
|
+
},
|
|
254
|
+
getLatest: getLatestCodeMetrics,
|
|
255
|
+
createSnapshot: createCodeMetricsSnapshot,
|
|
256
|
+
now: () => Date.now(),
|
|
257
|
+
commitWindow: DEFAULT_COMMIT_WINDOW,
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
/** Discover package.json manifests at the repo root and one level into packages/ + mcp/. */
|
|
261
|
+
function discoverManifests(repoPath) {
|
|
262
|
+
const found = [];
|
|
263
|
+
const candidates = ['package.json'];
|
|
264
|
+
for (const workspace of ['packages', 'mcp']) {
|
|
265
|
+
const dir = join(repoPath, workspace);
|
|
266
|
+
if (!existsSync(dir))
|
|
267
|
+
continue;
|
|
268
|
+
let entries = [];
|
|
269
|
+
try {
|
|
270
|
+
entries = readdirSync(dir, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name);
|
|
271
|
+
}
|
|
272
|
+
catch {
|
|
273
|
+
entries = [];
|
|
274
|
+
}
|
|
275
|
+
for (const name of entries)
|
|
276
|
+
candidates.push(join(workspace, name, 'package.json'));
|
|
277
|
+
}
|
|
278
|
+
for (const rel of candidates) {
|
|
279
|
+
const abs = join(repoPath, rel);
|
|
280
|
+
if (!existsSync(abs))
|
|
281
|
+
continue;
|
|
282
|
+
try {
|
|
283
|
+
found.push({ path: rel.split(/[\\/]/).join('/'), content: JSON.parse(readFileSync(abs, 'utf8')) });
|
|
284
|
+
}
|
|
285
|
+
catch {
|
|
286
|
+
// Skip unparseable manifests -- deterministic omission, not a crash.
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
return found;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Mine one repo into a snapshot input. Pure over the injected deps -- no global
|
|
293
|
+
* git/fs. Returns null when HEAD cannot be resolved (an unusable repo).
|
|
294
|
+
*/
|
|
295
|
+
export function mineRepoSnapshot(repoPath, deps) {
|
|
296
|
+
const repoHead = deps.resolveHeadSha(repoPath);
|
|
297
|
+
if (!repoHead)
|
|
298
|
+
return null;
|
|
299
|
+
const perFile = parseNumstatPerFile(deps.gitNumstat(repoPath, deps.commitWindow));
|
|
300
|
+
const complexityCache = new Map();
|
|
301
|
+
const complexityFor = (file) => {
|
|
302
|
+
if (complexityCache.has(file))
|
|
303
|
+
return complexityCache.get(file) ?? null;
|
|
304
|
+
const body = deps.readFile(repoPath, file);
|
|
305
|
+
const value = body == null ? null : complexityProxy(body);
|
|
306
|
+
complexityCache.set(file, value);
|
|
307
|
+
return value;
|
|
308
|
+
};
|
|
309
|
+
const { areas, totalChurn, totalHotspotMass } = aggregateAreas(perFile, complexityFor, deps.now());
|
|
310
|
+
const ratchets = countRatchets(deps.readLintConfig(repoPath));
|
|
311
|
+
const manifests = analyzeManifests(deps.readManifests(repoPath));
|
|
312
|
+
const fileCount = deps.listTrackedFiles(repoPath).length;
|
|
313
|
+
return {
|
|
314
|
+
repoHead,
|
|
315
|
+
manifestHash: manifests.manifestHash,
|
|
316
|
+
hotspotMass: totalHotspotMass,
|
|
317
|
+
totalChurn,
|
|
318
|
+
fileCount,
|
|
319
|
+
ratchetCount: ratchets.total,
|
|
320
|
+
dependencyCount: manifests.dependencyCount,
|
|
321
|
+
dependencyOutdated: manifests.dependencyOutdated,
|
|
322
|
+
areas,
|
|
323
|
+
ratchetDetail: ratchets.detail,
|
|
324
|
+
dependencyDetail: manifests.detail,
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Run one sensor-sweep tick across every configured product. Drift-proportional:
|
|
329
|
+
* a product whose repo HEAD + manifest hash match its last snapshot is skipped.
|
|
330
|
+
* Per-product try/catch keeps one bad repo from aborting the sweep.
|
|
331
|
+
*/
|
|
332
|
+
export async function runSensorSweepTick(config, depOverrides = {}) {
|
|
333
|
+
const deps = { ...defaultSensorSweepDeps(), ...depOverrides };
|
|
334
|
+
const counts = {
|
|
335
|
+
productsScanned: 0,
|
|
336
|
+
snapshotsWritten: 0,
|
|
337
|
+
skippedUnchanged: 0,
|
|
338
|
+
errors: 0,
|
|
339
|
+
};
|
|
340
|
+
for (const product of config.products) {
|
|
341
|
+
counts.productsScanned++;
|
|
342
|
+
try {
|
|
343
|
+
const pc = configForProduct(config, product);
|
|
344
|
+
const snapshot = mineRepoSnapshot(pc.repoPath, deps);
|
|
345
|
+
if (!snapshot) {
|
|
346
|
+
counts.errors++;
|
|
347
|
+
continue;
|
|
348
|
+
}
|
|
349
|
+
const latest = await deps.getLatest(product.id);
|
|
350
|
+
if (latest && latest.repoHead === snapshot.repoHead && latest.manifestHash === snapshot.manifestHash) {
|
|
351
|
+
// Nothing drifted since the last snapshot -- skip re-mining (DC baseline
|
|
352
|
+
// is unchanged; burn stays proportional to drift, not calendar time).
|
|
353
|
+
counts.skippedUnchanged++;
|
|
354
|
+
continue;
|
|
355
|
+
}
|
|
356
|
+
await deps.createSnapshot(product.id, snapshot);
|
|
357
|
+
counts.snapshotsWritten++;
|
|
358
|
+
}
|
|
359
|
+
catch (err) {
|
|
360
|
+
counts.errors++;
|
|
361
|
+
console.warn('[sensor-sweep] product tick failed:', err.message);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
return counts;
|
|
365
|
+
}
|
|
366
|
+
//# sourceMappingURL=sensor-sweep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sensor-sweep.js","sourceRoot":"","sources":["../src/sensor-sweep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAI5F,sEAAsE;AACtE,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAClC,MAAM,UAAU,GAAG,UAAU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YACX,CAAC;YACD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAChD,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ,IAAI,MAAM,CAAC,YAAY,KAAK,QAAQ,CAAC,YAAY,EAAE,CAAC;gBACrG,yEAAyE;gBACzE,sEAAsE;gBACtE,MAAM,CAAC,gBAAgB,EAAE,CAAC;gBAC1B,SAAS;YACX,CAAC;YACD,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;YAChD,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC5B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,CAAC,MAAM,EAAE,CAAC;YAChB,OAAO,CAAC,IAAI,CAAC,qCAAqC,EAAG,GAAa,CAAC,OAAO,CAAC,CAAC;QAC9E,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -35,6 +35,14 @@ export interface AgentsMdConnectionInvariant {
|
|
|
35
35
|
organizationId: string;
|
|
36
36
|
/** Product UUID. */
|
|
37
37
|
productId: string;
|
|
38
|
+
/**
|
|
39
|
+
* Override the MCP-registration sentence spliced into the seed body. Defaults
|
|
40
|
+
* to the Codex location (`~/.codex/config.toml`). Harnesses that read AGENTS.md
|
|
41
|
+
* but load MCP from a different file (Cursor -> `.cursor/mcp.json`, VS Code ->
|
|
42
|
+
* `.vscode/mcp.json`) pass their own sentence so the seeded discipline names
|
|
43
|
+
* the right file.
|
|
44
|
+
*/
|
|
45
|
+
mcpRegistrationSentence?: string;
|
|
38
46
|
}
|
|
39
47
|
/**
|
|
40
48
|
* Render a fresh-repo AGENTS.md seed block.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents-md.d.ts","sourceRoot":"","sources":["../../src/templates/agents-md.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAaH,eAAO,MAAM,sBAAsB,+BAA+B,CAAC;AACnE,eAAO,MAAM,oBAAoB,6BAA6B,CAAC;AAE/D;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB;IACpB,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"agents-md.d.ts","sourceRoot":"","sources":["../../src/templates/agents-md.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAaH,eAAO,MAAM,sBAAsB,+BAA+B,CAAC;AACnE,eAAO,MAAM,oBAAoB,6BAA6B,CAAC;AAE/D;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AA4BD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,2BAA2B,GAAG,MAAM,CAcvE"}
|
|
@@ -60,9 +60,10 @@ function renderConnectionInvariant(inv) {
|
|
|
60
60
|
* place (no churn, no duplication).
|
|
61
61
|
*/
|
|
62
62
|
export function renderAgentsMd(inv) {
|
|
63
|
-
// Replace the Claude-specific `.mcp.json` MCP location with the
|
|
64
|
-
//
|
|
65
|
-
|
|
63
|
+
// Replace the Claude-specific `.mcp.json` MCP location with the harness's
|
|
64
|
+
// own. Defaults to the Codex location (~/.codex/config.toml); Cursor/VS Code
|
|
65
|
+
// pass their project-config path via `inv.mcpRegistrationSentence`.
|
|
66
|
+
const body = SEED_BODY.replace(SEED_MCP_REGISTRATION_SENTENCE, inv.mcpRegistrationSentence ?? CODEX_MCP_REGISTRATION_SENTENCE);
|
|
66
67
|
const block = `${TELORA_AGENTS_MD_BEGIN}\n` +
|
|
67
68
|
`${renderConnectionInvariant(inv)}` +
|
|
68
69
|
`${body}` +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents-md.js","sourceRoot":"","sources":["../../src/templates/agents-md.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,SAAS,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,+BAA+B,GACnC,gEAAgE,CAAC;AAEnE,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AACnE,MAAM,CAAC,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"agents-md.js","sourceRoot":"","sources":["../../src/templates/agents-md.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,SAAS,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,+BAA+B,GACnC,gEAAgE,CAAC;AAEnE,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AACnE,MAAM,CAAC,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AA0B/D;;;;GAIG;AACH,SAAS,yBAAyB,CAAC,GAAgC;IACjE,MAAM,YAAY,GAAG,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,WAAW,KAAK,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC;IAC/F,OAAO,CACL,wBAAwB;QACxB,IAAI;QACJ,4EAA4E;QAC5E,0EAA0E;QAC1E,6BAA6B;QAC7B,IAAI;QACJ,iBAAiB,GAAG,CAAC,SAAS,IAAI;QAClC,mBAAmB,GAAG,CAAC,cAAc,IAAI;QACzC,cAAc,YAAY,IAAI;QAC9B,IAAI;QACJ,8EAA8E;QAC9E,+EAA+E;QAC/E,2EAA2E;QAC3E,eAAe;QACf,IAAI,CACL,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,GAAgC;IAC7D,0EAA0E;IAC1E,6EAA6E;IAC7E,oEAAoE;IACpE,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAC5B,8BAA8B,EAC9B,GAAG,CAAC,uBAAuB,IAAI,+BAA+B,CAC/D,CAAC;IACF,MAAM,KAAK,GACT,GAAG,sBAAsB,IAAI;QAC7B,GAAG,yBAAyB,CAAC,GAAG,CAAC,EAAE;QACnC,GAAG,IAAI,EAAE;QACT,GAAG,oBAAoB,IAAI,CAAC;IAC9B,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telora/daemon",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.34",
|
|
4
4
|
"description": "Agent orchestration daemon for Telora - spawns and manages Claude Code instances",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@telora/daemon": "^0.19.2",
|
|
40
40
|
"@telora/daemon-core": "^0.2.57",
|
|
41
|
-
"@telora/mcp-products": "^0.22.
|
|
41
|
+
"@telora/mcp-products": "^0.22.93",
|
|
42
42
|
"commander": "^14.0.3",
|
|
43
43
|
"yaml": "^2.4.0",
|
|
44
44
|
"zod": "^4.3.6"
|