@zuzuucodes/cli 1.0.1 → 1.1.0
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/README.md +4 -4
- package/bin/zuzuu.mjs +6 -3
- package/package.json +1 -1
- package/zuzuu/actions/adapter.mjs +2 -2
- package/zuzuu/actions/inbox.mjs +4 -4
- package/zuzuu/actions/manifest.mjs +3 -3
- package/zuzuu/actions/trail.mjs +1 -1
- package/zuzuu/commands/act-author.mjs +3 -3
- package/zuzuu/commands/act.mjs +58 -13
- package/zuzuu/commands/code.mjs +1 -1
- package/zuzuu/commands/digest.mjs +1 -1
- package/zuzuu/commands/doctor.mjs +3 -3
- package/zuzuu/commands/eval.mjs +44 -19
- package/zuzuu/commands/generation.mjs +40 -5
- package/zuzuu/commands/hook.mjs +6 -6
- package/zuzuu/commands/init.mjs +43 -18
- package/zuzuu/commands/knowledge.mjs +1 -1
- package/zuzuu/commands/migrate.mjs +109 -9
- package/zuzuu/commands/review.mjs +72 -5
- package/zuzuu/commands/status.mjs +3 -3
- package/zuzuu/commands/web.mjs +75 -0
- package/zuzuu/digest.mjs +2 -2
- package/zuzuu/faculty/generation.mjs +2 -2
- package/zuzuu/faculty/proposal.mjs +1 -1
- package/zuzuu/faculty/trail.mjs +2 -2
- package/zuzuu/guardrails/adapter.mjs +1 -1
- package/zuzuu/guardrails.mjs +1 -1
- package/zuzuu/inject.mjs +6 -6
- package/zuzuu/instructions/adapter.mjs +1 -1
- package/zuzuu/knowledge/inbox.mjs +1 -1
- package/zuzuu/knowledge/items.mjs +1 -1
- package/zuzuu/knowledge/proposals.mjs +1 -1
- package/zuzuu/knowledge/registry.mjs +2 -2
- package/zuzuu/live/install.mjs +3 -3
- package/zuzuu/live/live-store.mjs +2 -2
- package/zuzuu/memory/adapter.mjs +1 -1
- package/zuzuu/miners/guardrails.mjs +1 -1
- package/zuzuu/miners/instructions.mjs +1 -1
- package/zuzuu/miners/memory.mjs +3 -3
- package/zuzuu/scaffold.mjs +27 -22
- package/zuzuu/store.mjs +6 -5
package/zuzuu/scaffold.mjs
CHANGED
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
// user edits to any seeded file always survive a re-init.
|
|
6
6
|
//
|
|
7
7
|
// Layout = the five faculties (docs/DESIGN.md §3①, the 5+3 anatomy):
|
|
8
|
-
//
|
|
8
|
+
// .zuzuu/agent.json + knowledge/ memory/ actions/ instructions/ guardrails/
|
|
9
|
+
// The home is HIDDEN (.zuzuu/, like .git — decided 2026-06-12, DESIGN §13):
|
|
10
|
+
// transparency comes from porcelain (zz status/explain/digest) + plain-text
|
|
11
|
+
// files inside; the only visible footprint is the managed block + .gitignore lines.
|
|
9
12
|
// Guardrails became first-class (enforced via the PreToolUse gate) on 2026-06-10;
|
|
10
13
|
// the old instructions/guardrails.md advisory seed left the layout (existing
|
|
11
14
|
// projects keep theirs — no-clobber — but new scaffolds get the real faculty).
|
|
@@ -16,10 +19,12 @@ import { SEED_TYPES, SEED_ATTRIBUTES, SEED_RELATIONS } from './knowledge/registr
|
|
|
16
19
|
|
|
17
20
|
export const MANIFEST_VERSION = 3;
|
|
18
21
|
|
|
19
|
-
const AGENT_README = `#
|
|
22
|
+
const AGENT_README = `# .zuzuu/ — your agent's home (hidden, like .git — yours to read & version)
|
|
20
23
|
|
|
21
24
|
This directory is your agent's evolving brain. Five **faculties** grow from how you
|
|
22
|
-
actually work — and **nothing changes without your approval**.
|
|
25
|
+
actually work — and **nothing changes without your approval**. It's dot-prefixed to
|
|
26
|
+
stay out of your way; everything inside is plain text, versioned in git, and
|
|
27
|
+
surfaced by \`zuzuu status\` / \`zuzuu explain\` / \`zuzuu digest\`.
|
|
23
28
|
|
|
24
29
|
## The five faculties
|
|
25
30
|
- **knowledge/** — what's TRUE (facts about this project)
|
|
@@ -61,7 +66,7 @@ checks health.
|
|
|
61
66
|
|
|
62
67
|
const MEMORY_README = `# memory/ — episodic faculty (what HAPPENED)
|
|
63
68
|
|
|
64
|
-
Curated recollections of past sessions, distilled from the observability traces (
|
|
69
|
+
Curated recollections of past sessions, distilled from the observability traces (\`.zuzuu/.traces/\`).
|
|
65
70
|
- **Who writes:** zuzuu (distillation — *not built yet*), human (curation). Raw traces stay in traces/ — this is the *curated* layer.
|
|
66
71
|
- **Where:** one Markdown file per entry under \`entries/\`, named \`<id>.md\`.
|
|
67
72
|
|
|
@@ -72,7 +77,7 @@ id: mem-2026-06-11-flaky-ci-retry # mem-<YYYY-MM-DD>-<slug>, stable
|
|
|
72
77
|
date: 2026-06-11 # ISO date the episode occurred
|
|
73
78
|
title: Flaky CI fixed by pinning node 22
|
|
74
79
|
provenance: # links back to observability
|
|
75
|
-
sessions: [ses_abc123] # ids that exist in
|
|
80
|
+
sessions: [ses_abc123] # ids that exist in .zuzuu/sessions.json
|
|
76
81
|
hosts: [claude-code]
|
|
77
82
|
tags: [ci, flaky-test] # optional
|
|
78
83
|
status: curated # curated (human) | proposed (reserved — future distiller)
|
|
@@ -138,24 +143,24 @@ const RULES_SEED =
|
|
|
138
143
|
|
|
139
144
|
/** The layout contract: dirs + seed files (relative to the project root). */
|
|
140
145
|
export const LAYOUT = {
|
|
141
|
-
dirs: ['
|
|
146
|
+
dirs: ['.zuzuu', '.zuzuu/knowledge', '.zuzuu/knowledge/registry', '.zuzuu/knowledge/items', '.zuzuu/knowledge/inbox', '.zuzuu/knowledge/proposals', '.zuzuu/memory', '.zuzuu/memory/entries', '.zuzuu/memory/inbox', '.zuzuu/memory/proposals', '.zuzuu/actions', '.zuzuu/actions/inbox', '.zuzuu/instructions', '.zuzuu/instructions/inbox', '.zuzuu/instructions/proposals', '.zuzuu/guardrails', '.zuzuu/guardrails/inbox', '.zuzuu/guardrails/proposals', '.zuzuu/generations', '.zuzuu/generations/snapshots'],
|
|
142
147
|
files: {
|
|
143
|
-
'
|
|
144
|
-
'
|
|
145
|
-
'
|
|
146
|
-
'
|
|
147
|
-
'
|
|
148
|
-
'
|
|
149
|
-
'
|
|
150
|
-
'
|
|
151
|
-
'
|
|
152
|
-
'
|
|
153
|
-
'
|
|
148
|
+
'.zuzuu/README.md': AGENT_README,
|
|
149
|
+
'.zuzuu/knowledge/README.md': KNOWLEDGE_README,
|
|
150
|
+
'.zuzuu/memory/README.md': MEMORY_README,
|
|
151
|
+
'.zuzuu/actions/README.md': ACTIONS_README,
|
|
152
|
+
'.zuzuu/instructions/README.md': INSTRUCTIONS_README,
|
|
153
|
+
'.zuzuu/instructions/project.md': PROJECT_SEED,
|
|
154
|
+
'.zuzuu/guardrails/README.md': GUARDRAILS_README,
|
|
155
|
+
'.zuzuu/guardrails/rules.json': RULES_SEED,
|
|
156
|
+
'.zuzuu/knowledge/registry/types.json': JSON.stringify(SEED_TYPES, null, 2) + '\n',
|
|
157
|
+
'.zuzuu/knowledge/registry/attributes.json': JSON.stringify(SEED_ATTRIBUTES, null, 2) + '\n',
|
|
158
|
+
'.zuzuu/knowledge/registry/relations.json': JSON.stringify(SEED_RELATIONS, null, 2) + '\n',
|
|
154
159
|
},
|
|
155
160
|
};
|
|
156
161
|
|
|
157
162
|
/** Gitignore lines the project needs (trace blobs + liveness state stay local). */
|
|
158
|
-
export const IGNORE_LINES = ['
|
|
163
|
+
export const IGNORE_LINES = ['.zuzuu/.traces/', '.zuzuu/.live/', '.zuzuu/knowledge/.index.db', '.gemini/settings.json', '.codex/hooks.json', '.pi/extensions/zuzuu.ts'];
|
|
159
164
|
|
|
160
165
|
export function manifest(initializedAt) {
|
|
161
166
|
return {
|
|
@@ -172,7 +177,7 @@ export function manifest(initializedAt) {
|
|
|
172
177
|
export function planScaffold(cwd) {
|
|
173
178
|
const dirs = LAYOUT.dirs.filter((d) => !existsSync(join(cwd, d)));
|
|
174
179
|
const files = Object.keys(LAYOUT.files).filter((f) => !existsSync(join(cwd, f)));
|
|
175
|
-
const manifestMissing = !existsSync(join(cwd, '
|
|
180
|
+
const manifestMissing = !existsSync(join(cwd, '.zuzuu', 'agent.json'));
|
|
176
181
|
return { dirs, files, manifestMissing };
|
|
177
182
|
}
|
|
178
183
|
|
|
@@ -186,8 +191,8 @@ export function applyScaffold(cwd, { now = Date.now() } = {}) {
|
|
|
186
191
|
for (const d of plan.dirs) mkdirSync(join(cwd, d), { recursive: true });
|
|
187
192
|
for (const f of plan.files) writeFileSync(join(cwd, f), LAYOUT.files[f]);
|
|
188
193
|
if (plan.manifestMissing) {
|
|
189
|
-
mkdirSync(join(cwd, '
|
|
190
|
-
writeFileSync(join(cwd, '
|
|
194
|
+
mkdirSync(join(cwd, '.zuzuu'), { recursive: true });
|
|
195
|
+
writeFileSync(join(cwd, '.zuzuu', 'agent.json'), JSON.stringify(manifest(new Date(now).toISOString()), null, 2) + '\n');
|
|
191
196
|
}
|
|
192
197
|
return plan;
|
|
193
198
|
}
|
|
@@ -209,5 +214,5 @@ export function ensureGitignore(cwd) {
|
|
|
209
214
|
|
|
210
215
|
/** Is there a zuzuu home here already? (the git-detect question) */
|
|
211
216
|
export function homeExists(cwd) {
|
|
212
|
-
return existsSync(join(cwd, '
|
|
217
|
+
return existsSync(join(cwd, '.zuzuu'));
|
|
213
218
|
}
|
package/zuzuu/store.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
// The git-native
|
|
1
|
+
// The git-native .zuzuu/ store (the hidden faculty home — the .git model:
|
|
2
|
+
// transparency via porcelain, not an un-dotted dir).
|
|
2
3
|
//
|
|
3
4
|
// Layout (entire.io-style split — linkage in git, blobs out of the diff):
|
|
4
|
-
//
|
|
5
|
+
// .zuzuu/sessions.json tracked — the session index (small, diff-friendly,
|
|
5
6
|
// each entry links to a git commit)
|
|
6
|
-
//
|
|
7
|
+
// .zuzuu/.traces/<host>-<id>.otlp.jsonl gitignored — the bulky OTLP blobs (dot-prefixed)
|
|
7
8
|
//
|
|
8
9
|
// Trace blobs are git-ignored in Phase 1; Phase 2 moves them to an orphan branch.
|
|
9
10
|
|
|
@@ -24,10 +25,10 @@ export function repoRoot(cwd = process.cwd()) {
|
|
|
24
25
|
return git(['rev-parse', '--show-toplevel'], cwd) || cwd;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
/** Resolve the faculty home: the
|
|
28
|
+
/** Resolve the faculty home: the hidden `.zuzuu/`. The single chokepoint for the
|
|
28
29
|
* whole CLI. */
|
|
29
30
|
export function homeDir(root = repoRoot()) {
|
|
30
|
-
return join(root, '
|
|
31
|
+
return join(root, '.zuzuu');
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
/** Internal liveness dir (git-ignored, dot-prefixed) under the home. */
|