@nfinitmonkeys/clan-engine 0.2.0 → 0.4.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 +62 -10
- package/dist/apply.js +7 -1
- package/dist/brain-build.d.ts +57 -8
- package/dist/brain-build.js +179 -17
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +29 -7
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/inspect.js +102 -5
- package/dist/inventory.d.ts +3 -1
- package/dist/inventory.js +4 -2
- package/dist/mcp.d.ts +10 -0
- package/dist/mcp.js +11 -0
- package/dist/reconcile.js +24 -4
- package/dist/templates.d.ts +4 -1
- package/dist/templates.js +244 -20
- package/dist/types.d.ts +35 -1
- package/dist/types.js +1 -1
- package/package.json +4 -1
package/dist/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* file's marker so a future engine can tell "my old output" from "my current
|
|
7
7
|
* output" and run migrations. Bump LAYOUT_VERSION when the template SHAPE
|
|
8
8
|
* changes (a path moves, a format changes); bump ENGINE_VERSION freely. */
|
|
9
|
-
export declare const ENGINE_VERSION = "0.
|
|
9
|
+
export declare const ENGINE_VERSION = "0.3.0";
|
|
10
10
|
export declare const LAYOUT_VERSION = 1;
|
|
11
11
|
/** The marker key written into generated-file frontmatter / headers. */
|
|
12
12
|
export declare const GENERATED_BY = "clan-engine";
|
|
@@ -22,6 +22,12 @@ export interface ClanIdentity {
|
|
|
22
22
|
description: string;
|
|
23
23
|
tier: Tier;
|
|
24
24
|
mode: Mode;
|
|
25
|
+
/** district box HTTP port (from .district/district.config.yaml http.port). */
|
|
26
|
+
boxPort?: string;
|
|
27
|
+
/** EXISTING vault root (repo-relative) when one was detected at a non-default
|
|
28
|
+
* location — overrides the tier default so applying never mints a duplicate
|
|
29
|
+
* vault (e.g. the jungle repo's own .brain/ despite tier jungle). */
|
|
30
|
+
brainRoot?: string;
|
|
25
31
|
/** connected-mode credentials (drive .mcp.json). */
|
|
26
32
|
jungle?: {
|
|
27
33
|
apiUrl: string;
|
|
@@ -40,6 +46,30 @@ export interface GeneratedFile {
|
|
|
40
46
|
/** POSIX chmod to apply after write (e.g. 0o755 for scripts). */
|
|
41
47
|
chmod?: number;
|
|
42
48
|
}
|
|
49
|
+
/** Input handed to a brain-build curation hook. The engine stays zero-LLM —
|
|
50
|
+
* the hook is supplied by a caller that has one (e.g. @nfinitmonkeys/clan). */
|
|
51
|
+
export interface BrainCurateInput {
|
|
52
|
+
/** The mechanical candidate pages (already sanitized + create-only filtered). */
|
|
53
|
+
pages: GeneratedFile[];
|
|
54
|
+
identity: ClanIdentity;
|
|
55
|
+
/** Provenance, one line per candidate: "<page path> ← <source file>". */
|
|
56
|
+
sourceNotes: string[];
|
|
57
|
+
}
|
|
58
|
+
/** Returns the curated page set (replaces/augments the candidates). The engine
|
|
59
|
+
* re-gates EVERY curated body through scanSensitive + create-only regardless —
|
|
60
|
+
* an LLM echoing a secret from context is held back like a mined one. */
|
|
61
|
+
export type BrainCurator = (input: BrainCurateInput) => Promise<GeneratedFile[]>;
|
|
62
|
+
/**
|
|
63
|
+
* The clan itself as an encrypted-brain recipient — its alphaId plus its X25519
|
|
64
|
+
* ENCRYPTION public key (SPKI DER base64, the same convention as
|
|
65
|
+
* step_up_devices.public_key_spki). Handed to brain-build so a page marked
|
|
66
|
+
* `private: true` can be encrypted to the owner BEFORE any write. The private
|
|
67
|
+
* half NEVER reaches the engine; only this public identity does. Shape matches
|
|
68
|
+
* @nfinitmonkeys/clan-crypto's Recipient. */
|
|
69
|
+
export interface BrainOwner {
|
|
70
|
+
alphaId: string;
|
|
71
|
+
spkiB64: string;
|
|
72
|
+
}
|
|
43
73
|
export type ActionKind = 'create' | 'update' | 'backup-replace' | 'merge' | 'append' | 'remove' | 'skip';
|
|
44
74
|
export interface PlanAction {
|
|
45
75
|
kind: ActionKind;
|
|
@@ -89,6 +119,10 @@ export interface InspectResult {
|
|
|
89
119
|
/** brain vault present + its layout version (from .brain-meta.json). */
|
|
90
120
|
hasBrain: boolean;
|
|
91
121
|
brainLayoutVersion?: number;
|
|
122
|
+
/** where an EXISTING vault lives (repo-relative), checked across every known
|
|
123
|
+
* root (.district/brain > .brain > .brains/*) — reconcile scaffolds THERE,
|
|
124
|
+
* never a tier-default duplicate. Unset when no vault exists yet. */
|
|
125
|
+
brainRoot?: string;
|
|
92
126
|
/** the reconciled state classification. */
|
|
93
127
|
state: NodeState;
|
|
94
128
|
/** actionable notes for the wizard / caller. */
|
package/dist/types.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* file's marker so a future engine can tell "my old output" from "my current
|
|
7
7
|
* output" and run migrations. Bump LAYOUT_VERSION when the template SHAPE
|
|
8
8
|
* changes (a path moves, a format changes); bump ENGINE_VERSION freely. */
|
|
9
|
-
export const ENGINE_VERSION = '0.
|
|
9
|
+
export const ENGINE_VERSION = '0.3.0';
|
|
10
10
|
export const LAYOUT_VERSION = 1;
|
|
11
11
|
/** The marker key written into generated-file frontmatter / headers. */
|
|
12
12
|
export const GENERATED_BY = 'clan-engine';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nfinitmonkeys/clan-engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Deterministic setup engine for Nfinit Monkeys clans \u2014 the single template + reconciliation authority behind the published CLIs and the internal fleet tooling. Idempotent, dry-run-by-default, non-destructive.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -37,5 +37,8 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"yaml": "^2.9.0"
|
|
40
|
+
},
|
|
41
|
+
"optionalDependencies": {
|
|
42
|
+
"@nfinitmonkeys/clan-crypto": "^0.1.0"
|
|
40
43
|
}
|
|
41
44
|
}
|