total-recall-brain 3.6.7 → 3.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core/surface.mjs +40 -9
package/package.json
CHANGED
package/src/core/surface.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import path from 'path';
|
|
|
3
3
|
import crypto from 'crypto';
|
|
4
4
|
import { loadSkills, atomicWrite, walkMd } from './vault.mjs';
|
|
5
5
|
import { getNodes } from './vault-cache.mjs';
|
|
6
|
+
import matter from 'gray-matter';
|
|
6
7
|
import {
|
|
7
8
|
buildMemoryLayerIndex,
|
|
8
9
|
inferMemoryLayer,
|
|
@@ -362,6 +363,32 @@ Show all available commands.
|
|
|
362
363
|
}
|
|
363
364
|
}
|
|
364
365
|
|
|
366
|
+
// 3. Inject Installed Skills Inventory
|
|
367
|
+
if (skillsDir && fs.existsSync(skillsDir)) {
|
|
368
|
+
const installedSkills = [];
|
|
369
|
+
try {
|
|
370
|
+
const entries = fs.readdirSync(skillsDir);
|
|
371
|
+
for (const entry of entries) {
|
|
372
|
+
const fullPath = path.join(skillsDir, entry);
|
|
373
|
+
if (fs.statSync(fullPath).isDirectory()) {
|
|
374
|
+
const skillMdPath = path.join(fullPath, 'SKILL.md');
|
|
375
|
+
if (fs.existsSync(skillMdPath)) {
|
|
376
|
+
const raw = fs.readFileSync(skillMdPath, 'utf8');
|
|
377
|
+
const { data } = matter(raw);
|
|
378
|
+
if (data && data.name && data.description) {
|
|
379
|
+
installedSkills.push(`- **${data.name}** (\`.agent/skills/${entry}/SKILL.md\`): ${data.description}`);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
if (installedSkills.length > 0) {
|
|
385
|
+
combined += `\n\n## Installed Agent Skills\n\nYou have access to specialized 'skills' to help you with complex tasks. If a skill seems relevant to your current task, you MUST read its SKILL.md file before proceeding.\n\nAvailable skills:\n${installedSkills.join('\n')}`;
|
|
386
|
+
}
|
|
387
|
+
} catch (err) {
|
|
388
|
+
console.error('Error in skills injection:', err);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
365
392
|
return combined.trim();
|
|
366
393
|
}
|
|
367
394
|
|
|
@@ -425,14 +452,14 @@ async function writeShim(shimPath, skillsDir, nodes = [], { vaultDir, derivedDir
|
|
|
425
452
|
*/
|
|
426
453
|
const CLIENT_SHIMS = {
|
|
427
454
|
cursor: ['.cursorrules'],
|
|
428
|
-
'claude-code': ['
|
|
429
|
-
antigravity: [
|
|
430
|
-
gemini: [
|
|
431
|
-
codex: ['
|
|
455
|
+
'claude-code': ['.clauderules'],
|
|
456
|
+
antigravity: [],
|
|
457
|
+
gemini: [],
|
|
458
|
+
codex: ['.codexrules'],
|
|
432
459
|
vscode: ['.github/copilot-instructions.md', '.vscode/copilot-instructions.md'],
|
|
433
|
-
pi: [
|
|
460
|
+
pi: [],
|
|
434
461
|
aider: ['.aider.rules.md'],
|
|
435
|
-
windsurf: ['.windsurfrules'
|
|
462
|
+
windsurf: ['.windsurfrules'],
|
|
436
463
|
};
|
|
437
464
|
|
|
438
465
|
/**
|
|
@@ -466,9 +493,13 @@ async function compilePointers(instructionsFile, skillsDir, nodes = [], { vaultD
|
|
|
466
493
|
const connectedClients = readConnectedClients(clientsPath);
|
|
467
494
|
|
|
468
495
|
if (connectedClients === null) {
|
|
469
|
-
//
|
|
470
|
-
//
|
|
471
|
-
|
|
496
|
+
// Write out-of-the-box dotfiles to support IDEs automatically,
|
|
497
|
+
// avoiding duplicate .md files to prevent Antigravity context bloat.
|
|
498
|
+
for (const files of Object.values(CLIENT_SHIMS)) {
|
|
499
|
+
for (const file of files) {
|
|
500
|
+
await writeShim(path.join(baseDir, file), skillsDir, nodes, { vaultDir, derivedDir });
|
|
501
|
+
}
|
|
502
|
+
}
|
|
472
503
|
} else {
|
|
473
504
|
// Only write shims for connected clients
|
|
474
505
|
for (const client of connectedClients) {
|