@nexus-cortex/core 4.54.0 → 4.54.1
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/dist/canon/index.d.ts +7 -13
- package/dist/canon/index.d.ts.map +1 -1
- package/dist/canon/index.js +7 -8
- package/dist/canon/index.js.map +1 -1
- package/package.json +5 -4
- package/dist/canon/canonArtifacts.d.ts +0 -14
- package/dist/canon/canonArtifacts.d.ts.map +0 -1
- package/dist/canon/canonArtifacts.js +0 -269
- package/dist/canon/canonArtifacts.js.map +0 -1
- package/dist/canon/canonGraph.d.ts +0 -30
- package/dist/canon/canonGraph.d.ts.map +0 -1
- package/dist/canon/canonGraph.js +0 -216
- package/dist/canon/canonGraph.js.map +0 -1
- package/dist/canon/canonPull.d.ts +0 -38
- package/dist/canon/canonPull.d.ts.map +0 -1
- package/dist/canon/canonPull.js +0 -133
- package/dist/canon/canonPull.js.map +0 -1
- package/dist/canon/canonSync.d.ts +0 -20
- package/dist/canon/canonSync.d.ts.map +0 -1
- package/dist/canon/canonSync.js +0 -243
- package/dist/canon/canonSync.js.map +0 -1
- package/dist/canon/canonTranslate.d.ts +0 -19
- package/dist/canon/canonTranslate.d.ts.map +0 -1
- package/dist/canon/canonTranslate.js +0 -719
- package/dist/canon/canonTranslate.js.map +0 -1
package/dist/canon/index.d.ts
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Canon — the canonical agent history & memory store
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Canon — the canonical agent history & memory store pipeline.
|
|
3
|
+
*
|
|
4
|
+
* The implementation lives in the standalone `nexus-canon` package (Phase C
|
|
5
|
+
* part 3 extraction); core re-exports it so the harness surface is unchanged
|
|
6
|
+
* and the one-implementation rule holds: the cortex CLI, cron wrappers, and
|
|
7
|
+
* standalone `nexus-canon` users all run the same code.
|
|
5
8
|
* Spec: docs/CANON.md. Plan: CANON_CROSS_HARNESS_PLAN.md.
|
|
6
9
|
*
|
|
7
10
|
* @module canon
|
|
8
11
|
*/
|
|
9
|
-
export
|
|
10
|
-
export type { CanonSyncOptions, CanonSyncResult } from './canonSync.js';
|
|
11
|
-
export { canonTranslate } from './canonTranslate.js';
|
|
12
|
-
export type { CanonTranslateOptions, CanonTranslateResult } from './canonTranslate.js';
|
|
13
|
-
export { canonList, canonPull, discoverCanonSessions } from './canonPull.js';
|
|
14
|
-
export type { CanonStoreOptions, CanonSession, CanonPullOptions, CanonPullResult } from './canonPull.js';
|
|
15
|
-
export { canonArtifacts } from './canonArtifacts.js';
|
|
16
|
-
export type { CanonArtifactsOptions, CanonArtifactsResult } from './canonArtifacts.js';
|
|
17
|
-
export { canonGraph, deriveProjectSessionMap, sessionProject } from './canonGraph.js';
|
|
18
|
-
export type { CanonGraphOptions, CanonGraphResult, ProjectEntry } from './canonGraph.js';
|
|
12
|
+
export * from 'nexus-canon';
|
|
19
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/canon/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/canon/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,cAAc,aAAa,CAAC"}
|
package/dist/canon/index.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Canon — the canonical agent history & memory store
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Canon — the canonical agent history & memory store pipeline.
|
|
3
|
+
*
|
|
4
|
+
* The implementation lives in the standalone `nexus-canon` package (Phase C
|
|
5
|
+
* part 3 extraction); core re-exports it so the harness surface is unchanged
|
|
6
|
+
* and the one-implementation rule holds: the cortex CLI, cron wrappers, and
|
|
7
|
+
* standalone `nexus-canon` users all run the same code.
|
|
5
8
|
* Spec: docs/CANON.md. Plan: CANON_CROSS_HARNESS_PLAN.md.
|
|
6
9
|
*
|
|
7
10
|
* @module canon
|
|
8
11
|
*/
|
|
9
|
-
export
|
|
10
|
-
export { canonTranslate } from './canonTranslate.js';
|
|
11
|
-
export { canonList, canonPull, discoverCanonSessions } from './canonPull.js';
|
|
12
|
-
export { canonArtifacts } from './canonArtifacts.js';
|
|
13
|
-
export { canonGraph, deriveProjectSessionMap, sessionProject } from './canonGraph.js';
|
|
12
|
+
export * from 'nexus-canon';
|
|
14
13
|
//# sourceMappingURL=index.js.map
|
package/dist/canon/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/canon/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/canon/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,cAAc,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexus-cortex/core",
|
|
3
|
-
"version": "4.54.
|
|
3
|
+
"version": "4.54.1",
|
|
4
4
|
"description": "Core orchestration library implementing Claude CLI architecture patterns",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -47,15 +47,16 @@
|
|
|
47
47
|
"@google/generative-ai": "^0.2.1",
|
|
48
48
|
"@gradio/client": "^2.3.1",
|
|
49
49
|
"@modelcontextprotocol/sdk": "^1.20.2",
|
|
50
|
-
"@nexus-cortex/executors": "4.54.
|
|
51
|
-
"@nexus-cortex/types": "4.54.
|
|
50
|
+
"@nexus-cortex/executors": "4.54.1",
|
|
51
|
+
"@nexus-cortex/types": "4.54.1",
|
|
52
52
|
"@types/uuid": "^10.0.0",
|
|
53
53
|
"ajv": "^8.12.0",
|
|
54
54
|
"chokidar": "^3.6.0",
|
|
55
55
|
"openai": "^4.104.0",
|
|
56
56
|
"tiktoken": "^1.0.22",
|
|
57
57
|
"undici": "^5.28.4",
|
|
58
|
-
"uuid": "^13.0.0"
|
|
58
|
+
"uuid": "^13.0.0",
|
|
59
|
+
"nexus-canon": "1.0.0"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
61
62
|
"@types/node": "^20.0.0",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface CanonArtifactsOptions {
|
|
2
|
-
store?: string;
|
|
3
|
-
home?: string;
|
|
4
|
-
dryRun?: boolean;
|
|
5
|
-
repoUrl?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface CanonArtifactsResult {
|
|
8
|
-
captured: number;
|
|
9
|
-
unchanged: number;
|
|
10
|
-
kinds: Record<string, number>;
|
|
11
|
-
pushed: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare function canonArtifacts(o?: CanonArtifactsOptions): Promise<CanonArtifactsResult>;
|
|
14
|
-
//# sourceMappingURL=canonArtifacts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"canonArtifacts.d.ts","sourceRoot":"","sources":["../../src/canon/canonArtifacts.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,MAAM,EAAE,OAAO,CAAC;CACjB;AAuCD,wBAAsB,cAAc,CAAC,CAAC,GAAE,qBAA0B,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAqLjG"}
|
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* canonArtifacts — the capability/artifact dimension capture leg
|
|
3
|
-
* (CANON_CROSS_HARNESS_PLAN.md §27p; Phase C part 2, leg 3).
|
|
4
|
-
*
|
|
5
|
-
* Discovers native capability artifacts and the intent layer, normalizes each
|
|
6
|
-
* into the store's taxonomy dirs (the CAPTURE side of the per-kind layout
|
|
7
|
-
* adapters: skill-dir → /skills/<id>/, agent-file → /agents/<id>.md,
|
|
8
|
-
* mcp/plugin registries → normalized JSON, project manifests → JSON with a
|
|
9
|
-
* thin `state` field), and writes one ArtifactManifest record per artifact
|
|
10
|
-
* under /canon/artifacts/<kind>/<id>.json. Content is blob-addressed with git
|
|
11
|
-
* blob SHAs computed locally (sha1 of "blob <len>\0"+bytes — identical to
|
|
12
|
-
* git's object id, so provenance survives any clone). Secret scrub at the
|
|
13
|
-
* push boundary, same pattern set as canonSync. Absences are VISIBLE in
|
|
14
|
-
* /canon/artifacts/ARTIFACTS.md (D8: never silent). Incremental via
|
|
15
|
-
* ~/.canon/artifacts-manifest.json keyed by primary-file blob refs.
|
|
16
|
-
* Projection-BACK (store → receiving harness layout) arrives with the
|
|
17
|
-
* artifact pull leg; stated in ARTIFACTS.md rather than implied.
|
|
18
|
-
*
|
|
19
|
-
* @module canon/canonArtifacts
|
|
20
|
-
*/
|
|
21
|
-
import * as crypto from 'node:crypto';
|
|
22
|
-
import * as fs from 'node:fs';
|
|
23
|
-
import * as path from 'node:path';
|
|
24
|
-
import { execFileSync } from 'node:child_process';
|
|
25
|
-
const SECRET_PATTERNS = [
|
|
26
|
-
[/sk-[A-Za-z0-9_-]{16,}/g, '[redacted:sk]'],
|
|
27
|
-
[/ghp_[A-Za-z0-9]{20,}/g, '[redacted:ghp]'],
|
|
28
|
-
[/github_pat_[A-Za-z0-9_]{20,}/g, '[redacted:ghpat]'],
|
|
29
|
-
[/hf_[A-Za-z0-9]{20,}/g, '[redacted:hf]'],
|
|
30
|
-
[/AIza[A-Za-z0-9_-]{20,}/g, '[redacted:aiza]'],
|
|
31
|
-
[/xai-[A-Za-z0-9]{20,}/g, '[redacted:xai]'],
|
|
32
|
-
[/nar_[A-Za-z0-9]{16,}/g, '[redacted:nar]'],
|
|
33
|
-
[/gsk_[A-Za-z0-9]{20,}/g, '[redacted:gsk]'],
|
|
34
|
-
[/xox[bpars]-[A-Za-z0-9-]{10,}/g, '[redacted:slack]'],
|
|
35
|
-
[/AKIA[A-Z0-9]{16}/g, '[redacted:akia]'],
|
|
36
|
-
[/eyJ[A-Za-z0-9_-]{20,}\.eyJ[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{10,}/g, '[redacted:jwt]'],
|
|
37
|
-
];
|
|
38
|
-
const scrub = (s) => SECRET_PATTERNS.reduce((v, [re, sub]) => v.replace(re, sub), s);
|
|
39
|
-
/** git blob id (12 hex) computed locally — identical to `git hash-object`. */
|
|
40
|
-
const blobRef = (content) => {
|
|
41
|
-
const buf = Buffer.isBuffer(content) ? content : Buffer.from(content);
|
|
42
|
-
return crypto.createHash('sha1')
|
|
43
|
-
.update(`blob ${buf.length}\0`).update(buf).digest('hex').slice(0, 12);
|
|
44
|
-
};
|
|
45
|
-
const walkFiles = (dir) => {
|
|
46
|
-
const out = [];
|
|
47
|
-
const rec = (d) => {
|
|
48
|
-
let es = [];
|
|
49
|
-
try {
|
|
50
|
-
es = fs.readdirSync(d, { withFileTypes: true });
|
|
51
|
-
}
|
|
52
|
-
catch {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
for (const e of es) {
|
|
56
|
-
const p = path.join(d, e.name);
|
|
57
|
-
if (e.isDirectory())
|
|
58
|
-
rec(p);
|
|
59
|
-
else if (e.isFile())
|
|
60
|
-
out.push(p);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
rec(dir);
|
|
64
|
-
return out.sort();
|
|
65
|
-
};
|
|
66
|
-
export async function canonArtifacts(o = {}) {
|
|
67
|
-
const HOME = o.home ?? process.env.HOME ?? '/home/runner/workspace';
|
|
68
|
-
const DRY = o.dryRun ?? false;
|
|
69
|
-
const STORE = o.store ?? '/tmp/canon-store';
|
|
70
|
-
const MANIFEST_PATH = path.join(HOME, '.canon', 'artifacts-manifest.json');
|
|
71
|
-
const CANON_REPO = o.repoUrl ?? process.env.CANON_REPO ?? 'https://github.com/Spitfire-Products/nexus-canon-store';
|
|
72
|
-
const env = { ...process.env, GIT_TERMINAL_PROMPT: '0' };
|
|
73
|
-
if (!fs.existsSync(path.join(STORE, '.git'))) {
|
|
74
|
-
console.log(`[canon-artifacts] no store at ${STORE} — cloning ${CANON_REPO}`);
|
|
75
|
-
execFileSync('git', ['clone', '-q', CANON_REPO, STORE], { encoding: 'utf8', env });
|
|
76
|
-
}
|
|
77
|
-
const incr = fs.existsSync(MANIFEST_PATH)
|
|
78
|
-
? JSON.parse(fs.readFileSync(MANIFEST_PATH, 'utf8')) : {};
|
|
79
|
-
let captured = 0, unchanged = 0;
|
|
80
|
-
const kinds = {};
|
|
81
|
-
const absences = [];
|
|
82
|
-
/** Normalize one artifact into the store + write its manifest record. */
|
|
83
|
-
const capture = (m, files) => {
|
|
84
|
-
const primaryFile = files.find((f) => f.rel === m.primary);
|
|
85
|
-
if (!primaryFile)
|
|
86
|
-
return;
|
|
87
|
-
const version = blobRef(primaryFile.bytes);
|
|
88
|
-
const key = `${m.kind}/${m.id}`;
|
|
89
|
-
kinds[m.kind] = (kinds[m.kind] ?? 0) + 1;
|
|
90
|
-
if (incr[key] === version) {
|
|
91
|
-
unchanged++;
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
if (!DRY) {
|
|
95
|
-
const destRoot = m.kind === 'skill' || m.kind === 'plugin'
|
|
96
|
-
? path.join(STORE, m.kind + 's', m.id)
|
|
97
|
-
: path.join(STORE, m.kind === 'mcp' ? 'mcp' : m.kind + 's');
|
|
98
|
-
const content = [];
|
|
99
|
-
for (const f of files) {
|
|
100
|
-
const scrubbed = Buffer.from(scrub(f.bytes.toString('utf8')));
|
|
101
|
-
const dest = m.kind === 'skill' || m.kind === 'plugin'
|
|
102
|
-
? path.join(destRoot, f.rel)
|
|
103
|
-
: path.join(destRoot, f.rel);
|
|
104
|
-
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
105
|
-
fs.writeFileSync(dest, scrubbed);
|
|
106
|
-
content.push({ path: f.rel, ref: blobRef(scrubbed), bytes: scrubbed.length });
|
|
107
|
-
}
|
|
108
|
-
const record = {
|
|
109
|
-
recordKind: 'artifact-manifest',
|
|
110
|
-
...m,
|
|
111
|
-
version,
|
|
112
|
-
timestamp: new Date().toISOString(),
|
|
113
|
-
content,
|
|
114
|
-
};
|
|
115
|
-
const recPath = path.join(STORE, 'canon', 'artifacts', m.kind, `${m.id}.json`);
|
|
116
|
-
fs.mkdirSync(path.dirname(recPath), { recursive: true });
|
|
117
|
-
fs.writeFileSync(recPath, JSON.stringify(record, null, 2) + '\n');
|
|
118
|
-
}
|
|
119
|
-
incr[key] = version;
|
|
120
|
-
captured++;
|
|
121
|
-
};
|
|
122
|
-
// ── skills: dir + SKILL.md (layout adapter: skill-dir → /skills/<id>/) ─────
|
|
123
|
-
for (const [harness, root] of [['claude-code', path.join(HOME, '.claude', 'skills')], ['agents-dir', path.join(HOME, '.agents', 'skills')]]) {
|
|
124
|
-
let entries = [];
|
|
125
|
-
try {
|
|
126
|
-
entries = fs.readdirSync(root);
|
|
127
|
-
}
|
|
128
|
-
catch {
|
|
129
|
-
absences.push(`${harness} skills root absent (${root})`);
|
|
130
|
-
continue;
|
|
131
|
-
}
|
|
132
|
-
for (const name of entries.sort()) {
|
|
133
|
-
const dir = path.join(root, name);
|
|
134
|
-
if (!fs.existsSync(path.join(dir, 'SKILL.md')))
|
|
135
|
-
continue;
|
|
136
|
-
const files = walkFiles(dir).map((p) => ({ rel: path.relative(dir, p), bytes: fs.readFileSync(p) }));
|
|
137
|
-
const desc = /^description:\s*(.+)$/m.exec(fs.readFileSync(path.join(dir, 'SKILL.md'), 'utf8'))?.[1];
|
|
138
|
-
capture({
|
|
139
|
-
kind: 'skill', id: name, name, description: desc?.slice(0, 200), primary: 'SKILL.md',
|
|
140
|
-
provenance: { harness, native: dir, ref: blobRef(fs.readFileSync(path.join(dir, 'SKILL.md'))) },
|
|
141
|
-
harnessCompat: { 'claude-code': 'supported', 'nexus-cortex': 'supported' },
|
|
142
|
-
projectionRules: { 'claude-code': '.claude/skills/<id>/', 'agents-dir': '.agents/skills/<id>/' },
|
|
143
|
-
}, files);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
// ── agents: single .md w/ frontmatter (layout adapter: file → /agents/) ────
|
|
147
|
-
const agentsRoot = path.join(HOME, '.claude', 'agents');
|
|
148
|
-
let agentFiles = [];
|
|
149
|
-
try {
|
|
150
|
-
agentFiles = fs.readdirSync(agentsRoot).filter((f) => f.endsWith('.md')).sort();
|
|
151
|
-
}
|
|
152
|
-
catch {
|
|
153
|
-
absences.push(`claude-code agents root absent (${agentsRoot})`);
|
|
154
|
-
}
|
|
155
|
-
for (const f of agentFiles) {
|
|
156
|
-
const abs = path.join(agentsRoot, f);
|
|
157
|
-
const bytes = fs.readFileSync(abs);
|
|
158
|
-
const id = path.basename(f, '.md');
|
|
159
|
-
const desc = /^description:\s*(.+)$/m.exec(bytes.toString('utf8'))?.[1];
|
|
160
|
-
capture({
|
|
161
|
-
kind: 'agent', id, name: id, description: desc?.slice(0, 200), primary: f,
|
|
162
|
-
provenance: { harness: 'claude-code', native: abs, ref: blobRef(bytes) },
|
|
163
|
-
harnessCompat: { 'claude-code': 'supported' },
|
|
164
|
-
projectionRules: { 'claude-code': '.claude/agents/<id>.md' },
|
|
165
|
-
}, [{ rel: f, bytes }]);
|
|
166
|
-
}
|
|
167
|
-
// ── mcp: config registries (normalized json) ───────────────────────────────
|
|
168
|
-
const mcpSources = [
|
|
169
|
-
['workspace', path.join(HOME, '.mcp.json')],
|
|
170
|
-
['nexus-terminal', path.join(HOME, 'nexus-terminal', '.mcp.json')],
|
|
171
|
-
['omniclaude-v4', path.join(HOME, 'omniclaude-v4', '.mcp.json')],
|
|
172
|
-
];
|
|
173
|
-
for (const [label, p] of mcpSources) {
|
|
174
|
-
if (!fs.existsSync(p)) {
|
|
175
|
-
absences.push(`mcp config absent (${p})`);
|
|
176
|
-
continue;
|
|
177
|
-
}
|
|
178
|
-
const bytes = fs.readFileSync(p);
|
|
179
|
-
capture({
|
|
180
|
-
kind: 'mcp', id: label, name: `${label} MCP servers`, primary: `${label}.json`,
|
|
181
|
-
provenance: { harness: 'claude-code', native: p, ref: blobRef(bytes) },
|
|
182
|
-
projectionRules: { 'claude-code': '.mcp.json' },
|
|
183
|
-
}, [{ rel: `${label}.json`, bytes }]);
|
|
184
|
-
}
|
|
185
|
-
// ── plugins: registry snapshot (bundle capture = follow-up, stated) ────────
|
|
186
|
-
const pluginsReg = path.join(HOME, '.claude', 'plugins', 'installed_plugins.json');
|
|
187
|
-
if (fs.existsSync(pluginsReg)) {
|
|
188
|
-
const bytes = fs.readFileSync(pluginsReg);
|
|
189
|
-
capture({
|
|
190
|
-
kind: 'plugin', id: 'installed-registry', name: 'Installed plugins registry', primary: 'installed_plugins.json',
|
|
191
|
-
provenance: { harness: 'claude-code', native: pluginsReg, ref: blobRef(bytes) },
|
|
192
|
-
projectionRules: { 'claude-code': '.claude/plugins/installed_plugins.json' },
|
|
193
|
-
}, [{ rel: 'installed_plugins.json', bytes }]);
|
|
194
|
-
}
|
|
195
|
-
else
|
|
196
|
-
absences.push(`plugins registry absent (${pluginsReg})`);
|
|
197
|
-
// ── plans: doc-snapshot + thin state (fork 1 — never an event log) ─────────
|
|
198
|
-
const plansRoot = path.join(HOME, '.claude', 'plans');
|
|
199
|
-
let planFiles = [];
|
|
200
|
-
try {
|
|
201
|
-
planFiles = fs.readdirSync(plansRoot).filter((f) => f.endsWith('.md')).sort();
|
|
202
|
-
}
|
|
203
|
-
catch {
|
|
204
|
-
absences.push(`plans root absent (${plansRoot})`);
|
|
205
|
-
}
|
|
206
|
-
for (const f of planFiles) {
|
|
207
|
-
const abs = path.join(plansRoot, f);
|
|
208
|
-
const bytes = fs.readFileSync(abs);
|
|
209
|
-
const id = path.basename(f, '.md');
|
|
210
|
-
capture({
|
|
211
|
-
kind: 'plan', id, primary: f,
|
|
212
|
-
provenance: { harness: 'claude-code', native: abs, ref: blobRef(bytes) },
|
|
213
|
-
state: { status: 'snapshot', capturedFrom: 'claude-code-plans' },
|
|
214
|
-
}, [{ rel: f, bytes }]);
|
|
215
|
-
}
|
|
216
|
-
// ── projects: manifests for known roots (roots + per-harness session dirs) ─
|
|
217
|
-
const projects = [
|
|
218
|
-
['workspace', HOME],
|
|
219
|
-
['omniclaude-v4', path.join(HOME, 'omniclaude-v4')],
|
|
220
|
-
['nexus-terminal', path.join(HOME, 'nexus-terminal')],
|
|
221
|
-
];
|
|
222
|
-
for (const [id, root] of projects) {
|
|
223
|
-
if (!fs.existsSync(root))
|
|
224
|
-
continue;
|
|
225
|
-
const doc = JSON.stringify({
|
|
226
|
-
id, root,
|
|
227
|
-
sessionDirs: { 'nexus-cortex': path.join(root, '.cortex', 'sessions'), 'claude-code': `~/.claude/projects/${root.replace(/\//g, '-')}` },
|
|
228
|
-
}, null, 2) + '\n';
|
|
229
|
-
capture({
|
|
230
|
-
kind: 'project', id, primary: `${id}.json`,
|
|
231
|
-
provenance: { harness: 'workspace', native: root, ref: blobRef(doc) },
|
|
232
|
-
state: { status: 'active' },
|
|
233
|
-
}, [{ rel: `${id}.json`, bytes: Buffer.from(doc) }]);
|
|
234
|
-
}
|
|
235
|
-
// ── visibility doc + commit ────────────────────────────────────────────────
|
|
236
|
-
const summary = `${captured} captured, ${unchanged} unchanged (${Object.entries(kinds).map(([k, n]) => `${k}:${n}`).join(', ') || 'none'})`;
|
|
237
|
-
let pushed = false;
|
|
238
|
-
if (!DRY) {
|
|
239
|
-
const md = `# /canon/artifacts — ArtifactManifest records (§27p second record kind)\n\n` +
|
|
240
|
-
`One JSON manifest per artifact: identity, content-derived version (primary-file git\n` +
|
|
241
|
-
`blob ref), blob-addressed content listing, provenance, harnessCompat, projectionRules.\n` +
|
|
242
|
-
`Bytes live in the store taxonomy dirs (/skills /agents /mcp /plugins /plans /projects).\n\n` +
|
|
243
|
-
`## Not captured this run (visible, never silent — D8)\n` +
|
|
244
|
-
(absences.length ? absences.map((a) => `- ${a}\n`).join('') : '- none\n') +
|
|
245
|
-
`\n## Projection-back\nRendering artifacts INTO a receiving harness's layout (the pull side of the\n` +
|
|
246
|
-
`per-kind layout adapters) arrives with the artifact pull leg; until then its\nabsence is stated here rather than implied.\n`;
|
|
247
|
-
const mdPath = path.join(STORE, 'canon', 'artifacts', 'ARTIFACTS.md');
|
|
248
|
-
fs.mkdirSync(path.dirname(mdPath), { recursive: true });
|
|
249
|
-
fs.writeFileSync(mdPath, md);
|
|
250
|
-
fs.mkdirSync(path.dirname(MANIFEST_PATH), { recursive: true });
|
|
251
|
-
fs.writeFileSync(MANIFEST_PATH, JSON.stringify(incr));
|
|
252
|
-
const git = (a) => execFileSync('git', a, { cwd: STORE, encoding: 'utf8', env });
|
|
253
|
-
git(['add', '-A']);
|
|
254
|
-
if (git(['status', '--porcelain']).trim()) {
|
|
255
|
-
git(['commit', '-q', '-m', `canon-artifacts: ${summary}`]);
|
|
256
|
-
git(['push', '-q', 'origin', 'main']);
|
|
257
|
-
console.log(`[canon-artifacts] pushed: ${summary}`);
|
|
258
|
-
pushed = true;
|
|
259
|
-
}
|
|
260
|
-
else {
|
|
261
|
-
console.log(`[canon-artifacts] no changes (${summary})`);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
else {
|
|
265
|
-
console.log(`[canon-artifacts DRY] would capture ${captured}, unchanged ${unchanged}`);
|
|
266
|
-
}
|
|
267
|
-
return { captured, unchanged, kinds, pushed };
|
|
268
|
-
}
|
|
269
|
-
//# sourceMappingURL=canonArtifacts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"canonArtifacts.js","sourceRoot":"","sources":["../../src/canon/canonArtifacts.ts"],"names":[],"mappings":"AAAA;;;;;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E,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAChD,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { type CanonSession } from './canonPull.js';
|
|
2
|
-
export interface ProjectEntry {
|
|
3
|
-
id: string;
|
|
4
|
-
/** Best-effort decoded root (claude-code encoding is lossy on dashes — encoded form is authoritative). */
|
|
5
|
-
root: string;
|
|
6
|
-
/** Store-relative canon session dir prefixes per harness. */
|
|
7
|
-
sessionPaths: Record<string, string[]>;
|
|
8
|
-
sessionCounts: Record<string, number>;
|
|
9
|
-
}
|
|
10
|
-
/** Derive the authoritative project ↔ session-path map from store paths. */
|
|
11
|
-
export declare function deriveProjectSessionMap(store: string): Record<string, ProjectEntry>;
|
|
12
|
-
/** Resolve which project a canon session belongs to (by path prefix). */
|
|
13
|
-
export declare function sessionProject(projects: Record<string, ProjectEntry>, s: CanonSession): string | undefined;
|
|
14
|
-
export interface CanonGraphOptions {
|
|
15
|
-
store?: string;
|
|
16
|
-
/** Limit to one project id (default: all mapped projects). */
|
|
17
|
-
project?: string;
|
|
18
|
-
/** Path to an external (graphify) node-link graph.json to fold into each project graph. */
|
|
19
|
-
mergeGraph?: string;
|
|
20
|
-
dryRun?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export interface CanonGraphResult {
|
|
23
|
-
projects: string[];
|
|
24
|
-
nodes: number;
|
|
25
|
-
links: number;
|
|
26
|
-
pushed: boolean;
|
|
27
|
-
}
|
|
28
|
-
/** Generate /projects/<id>.json manifests + /projects/<id>/graph.json (node-link, 🔒 criteria). */
|
|
29
|
-
export declare function canonGraph(o?: CanonGraphOptions): Promise<CanonGraphResult>;
|
|
30
|
-
//# sourceMappingURL=canonGraph.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"canonGraph.d.ts","sourceRoot":"","sources":["../../src/canon/canonGraph.ts"],"names":[],"mappings":"AAgCA,OAAO,EAAyB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI1E,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,0GAA0G;IAC1G,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACvC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAcD,4EAA4E;AAC5E,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAiCnF;AAED,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAO1G;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2FAA2F;IAC3F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,mGAAmG;AACnG,wBAAsB,UAAU,CAAC,CAAC,GAAE,iBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAkGrF"}
|