@inetafrica/open-claudia 2.6.37 → 2.6.38
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/bin/cli.js +18 -0
- package/bin/ideas.js +69 -0
- package/bin/keyring.js +64 -0
- package/bin/lessons.js +72 -0
- package/bin/pack.js +45 -2
- package/bot.js +8 -0
- package/core/actions.js +4 -2
- package/core/config.js +10 -1
- package/core/day-seeds.js +98 -0
- package/core/dream.js +413 -18
- package/core/handlers.js +129 -8
- package/core/ideas.js +114 -0
- package/core/keyring.js +79 -0
- package/core/lessons.js +276 -0
- package/core/pack-review.js +95 -14
- package/core/packs.js +95 -2
- package/core/recall/graph.js +17 -0
- package/core/recall/index.js +12 -5
- package/core/redact.js +25 -3
- package/core/runner.js +33 -1
- package/core/subagent.js +20 -4
- package/core/system-prompt.js +39 -0
- package/package.json +11 -3
- package/test-abilities.js +53 -0
- package/test-ability-couse.js +68 -0
- package/test-ability-extraction.js +109 -0
- package/test-ability-merge-guard.js +42 -0
- package/test-ability-tiers.js +57 -0
- package/test-ability-transfer.js +70 -0
- package/test-learning-e2e.js +98 -0
- package/test-project-transcripts-smoke.js +50 -0
- package/test-recall-engine.js +7 -5
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const os = require("os");
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const assert = require("assert");
|
|
5
|
+
const { ProjectTranscripts, normalizeProjectPath, projectHash } = require("./project-transcripts");
|
|
6
|
+
|
|
7
|
+
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "open-claudia-transcripts-"));
|
|
8
|
+
const project = path.join(tmp, "repo");
|
|
9
|
+
fs.mkdirSync(project);
|
|
10
|
+
|
|
11
|
+
const transcripts = new ProjectTranscripts({
|
|
12
|
+
configDir: tmp,
|
|
13
|
+
maxEntryChars: 100,
|
|
14
|
+
redact: (value) => String(value).replace(/SECRET/g, "[REDACTED]"),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const normalized = normalizeProjectPath(project);
|
|
18
|
+
const hash = projectHash(project);
|
|
19
|
+
assert.strictEqual(hash, projectHash(normalized));
|
|
20
|
+
|
|
21
|
+
const result = transcripts.append({
|
|
22
|
+
role: "user",
|
|
23
|
+
text: "hello SECRET " + "x".repeat(100),
|
|
24
|
+
userId: "telegram:1",
|
|
25
|
+
chat: { transport: "telegram", id: "1" },
|
|
26
|
+
projectName: "repo",
|
|
27
|
+
projectPath: project,
|
|
28
|
+
backend: "codex",
|
|
29
|
+
sessionId: "sess-1",
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
assert.ok(result.transcriptPath.startsWith(path.join(tmp, "transcripts")));
|
|
33
|
+
assert.ok(fs.existsSync(result.transcriptPath));
|
|
34
|
+
const line = fs.readFileSync(result.transcriptPath, "utf8").trim();
|
|
35
|
+
const entry = JSON.parse(line);
|
|
36
|
+
assert.strictEqual(entry.project.path, normalized);
|
|
37
|
+
// The stored hash is per-user (projectHash seeds with userId), so verify it
|
|
38
|
+
// against the same user the entry was written for — not the path-only hash above.
|
|
39
|
+
assert.strictEqual(entry.project.hash, projectHash(normalized, "telegram:1"));
|
|
40
|
+
assert.strictEqual(entry.backend, "codex");
|
|
41
|
+
assert.ok(entry.truncated);
|
|
42
|
+
assert.ok(!entry.text.includes("SECRET"));
|
|
43
|
+
assert.ok(entry.text.includes("[REDACTED]"));
|
|
44
|
+
|
|
45
|
+
const note = transcripts.buildPointerNote(project, "repo", "telegram:1");
|
|
46
|
+
assert.ok(note.includes(result.transcriptPath));
|
|
47
|
+
assert.ok(note.includes("Do not read the whole file"));
|
|
48
|
+
|
|
49
|
+
fs.rmSync(tmp, { recursive: true, force: true });
|
|
50
|
+
console.log("project-transcripts smoke OK");
|
package/test-recall-engine.js
CHANGED
|
@@ -3,18 +3,20 @@ const assert = require("assert");
|
|
|
3
3
|
const recall = require("./core/recall");
|
|
4
4
|
|
|
5
5
|
// --- selector ---
|
|
6
|
-
assert.strictEqual(recall.
|
|
7
|
-
assert.strictEqual(recall.activeEngineName({
|
|
8
|
-
assert.strictEqual(recall.activeEngineName({ recallEngine:
|
|
6
|
+
assert.strictEqual(recall.DEFAULT_ENGINE, "discoverer", "discoverer is the product default");
|
|
7
|
+
assert.strictEqual(recall.activeEngineName({}), "discoverer", "no setting → default (discoverer)");
|
|
8
|
+
assert.strictEqual(recall.activeEngineName({ recallEngine: null }), "discoverer", "null setting → default");
|
|
9
|
+
assert.strictEqual(recall.activeEngineName({ recallEngine: "classic" }), "classic", "classic still selectable as opt-out");
|
|
10
|
+
assert.strictEqual(recall.activeEngineName({ recallEngine: "nope" }), "discoverer", "unknown → default");
|
|
9
11
|
assert.strictEqual(recall.activeEngineName({ recallEngine: "CLASSIC" }), "classic", "case-insensitive");
|
|
10
12
|
assert.ok(recall.listEngines().includes("classic"));
|
|
11
13
|
assert.strictEqual(typeof recall.getEngine("classic").run, "function");
|
|
12
|
-
assert.strictEqual(recall.getEngine("bogus").name, "classic", "getEngine
|
|
14
|
+
assert.strictEqual(recall.getEngine("bogus").name, "classic", "getEngine hard-floor stays classic (crash-proof)");
|
|
13
15
|
|
|
14
16
|
// env override when no setting
|
|
15
17
|
const prev = process.env.RECALL_ENGINE;
|
|
16
18
|
process.env.RECALL_ENGINE = "classic";
|
|
17
|
-
assert.strictEqual(recall.activeEngineName(null), "classic");
|
|
19
|
+
assert.strictEqual(recall.activeEngineName(null), "classic", "env var overrides the default when no per-channel setting");
|
|
18
20
|
if (prev === undefined) delete process.env.RECALL_ENGINE; else process.env.RECALL_ENGINE = prev;
|
|
19
21
|
|
|
20
22
|
// --- classic engine orchestration: calls helpers and returns their blocks ---
|