File size: 1,680 Bytes
c44600e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env node

/**
 * @license
 * Copyright 2026 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */

/**
 * Diagnostic: instantiate the real Config and call the same listing functions
 * the inbox UI uses. Should print out all skills + skill patches + memory
 * patches the user would see in `/memory inbox`.
 */
import path from 'node:path';
import { fileURLToPath } from 'node:url';

const SCRIPT_DIR = path.dirname(fileURLToPath(import.meta.url));
const REPO_ROOT = path.resolve(SCRIPT_DIR, '..');
const corePath = path.join(REPO_ROOT, 'packages/core/dist/src/index.js');

const { Storage, listInboxSkills, listInboxPatches, listInboxMemoryPatches } =
  await import(corePath);

const cwd = process.cwd();
const storage = new Storage(cwd);
await storage.initialize();

const config = {
  storage,
  isTrustedFolder: () => true,
  getProjectRoot: () => cwd,
};

const [skills, skillPatches, memoryPatches] = await Promise.all([
  listInboxSkills(config),
  listInboxPatches(config),
  listInboxMemoryPatches(config),
]);

console.log(`\nInbox content for ${cwd}\n`);

console.log(`Skills (${skills.length}):`);
for (const s of skills) {
  console.log(`  - ${s.name} (${s.dirName})`);
}

console.log(`\nSkill update patches (${skillPatches.length}):`);
for (const p of skillPatches) {
  console.log(`  - ${p.name}  →  ${p.entries.length} entry/entries`);
}

console.log(`\nMemory patches (${memoryPatches.length}):`);
for (const m of memoryPatches) {
  console.log(
    `  - [${m.kind}] ${m.relativePath}  →  ${m.entries.length} entry/entries`,
  );
  for (const e of m.entries) {
    console.log(`      ${e.isNewFile ? 'CREATE' : 'UPDATE'} ${e.targetPath}`);
  }
}