@mmnto/cli 1.99.0 → 1.101.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/dist/commands/config-drift.test.js +5 -2
- package/dist/commands/config-drift.test.js.map +1 -1
- package/dist/commands/doctor-parity.d.ts.map +1 -1
- package/dist/commands/doctor-parity.js +57 -2
- package/dist/commands/doctor-parity.js.map +1 -1
- package/dist/commands/doctor-parity.test.js +60 -0
- package/dist/commands/doctor-parity.test.js.map +1 -1
- package/dist/commands/doctor.d.ts +19 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +132 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/doctor.test.js +1 -0
- package/dist/commands/doctor.test.js.map +1 -1
- package/dist/commands/gate-install.d.ts.map +1 -1
- package/dist/commands/gate-install.js +12 -3
- package/dist/commands/gate-install.js.map +1 -1
- package/dist/commands/gate-install.test.js +13 -1
- package/dist/commands/gate-install.test.js.map +1 -1
- package/dist/commands/init-templates.d.ts +59 -7
- package/dist/commands/init-templates.d.ts.map +1 -1
- package/dist/commands/init-templates.js +223 -2
- package/dist/commands/init-templates.js.map +1 -1
- package/dist/commands/init.d.ts +38 -4
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +196 -13
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/init.test.js +13 -0
- package/dist/commands/init.test.js.map +1 -1
- package/dist/commands/install-hooks-exit-contract.test.d.ts +2 -0
- package/dist/commands/install-hooks-exit-contract.test.d.ts.map +1 -0
- package/dist/commands/install-hooks-exit-contract.test.js +339 -0
- package/dist/commands/install-hooks-exit-contract.test.js.map +1 -0
- package/dist/commands/install-hooks.d.ts +53 -1
- package/dist/commands/install-hooks.d.ts.map +1 -1
- package/dist/commands/install-hooks.js +239 -52
- package/dist/commands/install-hooks.js.map +1 -1
- package/dist/commands/install-hooks.test.js +105 -39
- package/dist/commands/install-hooks.test.js.map +1 -1
- package/dist/commands/lint-staleness.d.ts +122 -0
- package/dist/commands/lint-staleness.d.ts.map +1 -0
- package/dist/commands/lint-staleness.js +163 -0
- package/dist/commands/lint-staleness.js.map +1 -0
- package/dist/commands/lint-staleness.test.d.ts +2 -0
- package/dist/commands/lint-staleness.test.d.ts.map +1 -0
- package/dist/commands/lint-staleness.test.js +173 -0
- package/dist/commands/lint-staleness.test.js.map +1 -0
- package/dist/commands/lint.d.ts.map +1 -1
- package/dist/commands/lint.js +142 -3
- package/dist/commands/lint.js.map +1 -1
- package/dist/commands/prepare-wrapper.test.d.ts +2 -0
- package/dist/commands/prepare-wrapper.test.d.ts.map +1 -0
- package/dist/commands/prepare-wrapper.test.js +284 -0
- package/dist/commands/prepare-wrapper.test.js.map +1 -0
- package/dist/commands/tools-hook-parity.test.d.ts +2 -0
- package/dist/commands/tools-hook-parity.test.d.ts.map +1 -0
- package/dist/commands/tools-hook-parity.test.js +37 -0
- package/dist/commands/tools-hook-parity.test.js.map +1 -0
- package/dist/commands/wrap.d.ts.map +1 -1
- package/dist/commands/wrap.js +3 -2
- package/dist/commands/wrap.js.map +1 -1
- package/dist/commands/wrap.test.js +11 -1
- package/dist/commands/wrap.test.js.map +1 -1
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// ─── Reflex versioning ────────────────────────────────────
|
|
4
4
|
// Bump REFLEX_VERSION whenever the AI_PROMPT_BLOCK content changes materially.
|
|
5
5
|
// This allows `totem init` to detect stale blocks and offer upgrades.
|
|
6
|
-
export const REFLEX_VERSION =
|
|
6
|
+
export const REFLEX_VERSION = 7;
|
|
7
7
|
export const REFLEX_START = '<!-- totem:reflexes:start -->';
|
|
8
8
|
export const REFLEX_END = '<!-- totem:reflexes:end -->';
|
|
9
9
|
export const REFLEX_VERSION_RE = /<!-- totem:reflexes:version:(\d+) -->/;
|
|
@@ -41,6 +41,7 @@ Totem provides CLI commands that map to your development lifecycle. Use them at
|
|
|
41
41
|
2. **Before Implementation:** Run \`totem spec <issue-url-or-topic>\` to generate an architectural plan and review related context before writing code.
|
|
42
42
|
3. **Before Push:** Run \`totem lint\` for a fast compiled-rules check (zero LLM, ~2s). **Before PR:** Run \`totem review\` for a full AI-powered code review against project knowledge (~18s).
|
|
43
43
|
4. **End of Session:** Run \`totem handoff\` to generate a snapshot for the next agent session with current progress and open threads.
|
|
44
|
+
5. **Managed hooks self-repair:** \`totem init\` distributes \`.totem/prepare.cjs\` and wires \`package.json\` \`prepare\` to it only when no \`prepare\` script exists. The wrapper runs \`totem hook install\` on every \`pnpm install\`, drift-repairing the managed Claude/Gemini hooks — no manual re-install needed.
|
|
44
45
|
|
|
45
46
|
### Cloud / PR Review Bots
|
|
46
47
|
[FOR CLOUD BOTS ONLY — e.g., Gemini Code Assist, GitHub Copilot PR Review]
|
|
@@ -54,6 +55,61 @@ You must be highly defensive of your own context window. If you notice this sess
|
|
|
54
55
|
${REFLEX_END}
|
|
55
56
|
`;
|
|
56
57
|
export const TOTEM_FILE_MARKER = '// [totem] auto-generated';
|
|
58
|
+
/**
|
|
59
|
+
* The end marker that CLOSES every managed whole-file session hook template
|
|
60
|
+
* (`.claude/hooks/*.cjs`, `.gemini/hooks/*.js`). Mirrors the #2406 git-hook
|
|
61
|
+
* bounded-ownership semantics (`TOTEM_HOOK_END` et al.) for the JS/CJS hook
|
|
62
|
+
* family: a marker-headed file whose end marker is present with nothing after
|
|
63
|
+
* it is a bounded totem-OWNED whole file, safe to drift-repair without
|
|
64
|
+
* `--force`. A LEGACY file written by a pre-#2410 template carries no in-file
|
|
65
|
+
* end marker → not bounded → declines bare repair and takes one
|
|
66
|
+
* `totem hook install --force` (identical to the shipped #2406 git-hook
|
|
67
|
+
* migration). Collision-free against {@link TOTEM_FILE_MARKER}: the `end `
|
|
68
|
+
* infix means the start marker is never a substring of the end marker.
|
|
69
|
+
*/
|
|
70
|
+
export const TOTEM_FILE_END = '// [totem] end auto-generated';
|
|
71
|
+
/**
|
|
72
|
+
* Whether the totem `marker` OPENS the file — only whitespace may precede it. The
|
|
73
|
+
* ownership GATE for the session-hook family (`.claude/hooks/*.cjs`,
|
|
74
|
+
* `.gemini/hooks/*.js` — no shebang preamble): a user-owned file that merely QUOTES
|
|
75
|
+
* the marker string somewhere in its body is NOT marker-headed and must never be
|
|
76
|
+
* regenerated or overwritten, not even under `--force` (mmnto-ai/totem#2413 — the
|
|
77
|
+
* `includes(marker)` false-positive that let a quoting user file be clobbered).
|
|
78
|
+
* Distinct from install-hooks' `isTotemOwnedWholeFile`, which additionally tolerates
|
|
79
|
+
* a `#!`-shebang preamble that is legitimate for git hooks but never appears here.
|
|
80
|
+
*/
|
|
81
|
+
export function markerOpensFile(content, marker) {
|
|
82
|
+
const idx = content.indexOf(marker);
|
|
83
|
+
if (idx === -1)
|
|
84
|
+
return false;
|
|
85
|
+
return content.slice(0, idx).trim().length === 0;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Whether a marker-headed session-hook file is a bounded totem-OWNED whole file —
|
|
89
|
+
* the precondition for a no-force drift-repair (mmnto-ai/totem#2410). The single
|
|
90
|
+
* shared ownership checker for the session-hook family, consumed by both init's
|
|
91
|
+
* `scaffoldFile` and install-hooks' `regenerateManagedSessionHooks`
|
|
92
|
+
* (mmnto-ai/totem#2413 — was two divergent twins). The session-hook analog of
|
|
93
|
+
* install-hooks' git-hook `isTotemOwnedWholeFile`, minus the shebang preamble the
|
|
94
|
+
* JS/CJS family never carries:
|
|
95
|
+
* - the marker must OPEN the file (only whitespace before it — no user content);
|
|
96
|
+
* - the `endMarker` must be present;
|
|
97
|
+
* - nothing but trailing whitespace may follow the end marker (else a whole-file
|
|
98
|
+
* rewrite would clobber appended user content).
|
|
99
|
+
*/
|
|
100
|
+
export function isBoundedOwnedFile(content, marker, endMarker) {
|
|
101
|
+
const idx = content.indexOf(marker);
|
|
102
|
+
if (idx === -1)
|
|
103
|
+
return false;
|
|
104
|
+
if (content.slice(0, idx).trim().length !== 0)
|
|
105
|
+
return false;
|
|
106
|
+
const end = content.indexOf(endMarker, idx + marker.length);
|
|
107
|
+
if (end === -1)
|
|
108
|
+
return false;
|
|
109
|
+
if (content.slice(end + endMarker.length).trim().length !== 0)
|
|
110
|
+
return false;
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
57
113
|
// ─── Bare-ref regex (xrepo-qualify-refs sealed at mmnto-ai/totem-strategy#145) ───
|
|
58
114
|
//
|
|
59
115
|
// Mirrors the compiled rule pattern at lessonHash "xrepo-qualify-refs"
|
|
@@ -107,6 +163,7 @@ try {
|
|
|
107
163
|
// surface a NON-fatal breadcrumb (matches the Claude-side hook) rather than swallow.
|
|
108
164
|
process.stderr.write('[SessionStart] orient briefing unavailable (non-fatal): ' + (err instanceof Error ? err.message : String(err)) + '\\n');
|
|
109
165
|
}
|
|
166
|
+
${TOTEM_FILE_END}
|
|
110
167
|
`;
|
|
111
168
|
export const GEMINI_BEFORE_TOOL = `// [totem] auto-generated — Gemini CLI BeforeTool hook
|
|
112
169
|
// Intercepts:
|
|
@@ -161,6 +218,7 @@ module.exports = function beforeTool(toolName, toolInput) {
|
|
|
161
218
|
throw new Error('[Totem Error] Shield check failed. Fix violations before pushing.\\n' + err.message);
|
|
162
219
|
}
|
|
163
220
|
};
|
|
221
|
+
${TOTEM_FILE_END}
|
|
164
222
|
`;
|
|
165
223
|
export const GEMINI_SKILL = `<!-- [totem] auto-generated — Totem Architect skill -->
|
|
166
224
|
# Totem Architect
|
|
@@ -289,6 +347,7 @@ process.stdin.on('end', () => {
|
|
|
289
347
|
);
|
|
290
348
|
process.exit(2);
|
|
291
349
|
});
|
|
350
|
+
${TOTEM_FILE_END}
|
|
292
351
|
`;
|
|
293
352
|
export const CLAUDE_PREWRITESHIELD_ENTRY = {
|
|
294
353
|
matcher: 'Write|Edit',
|
|
@@ -438,6 +497,7 @@ try {
|
|
|
438
497
|
'\\n',
|
|
439
498
|
);
|
|
440
499
|
}
|
|
500
|
+
${TOTEM_FILE_END}
|
|
441
501
|
`;
|
|
442
502
|
export const CLAUDE_SESSION_START_ENTRY = {
|
|
443
503
|
hooks: [
|
|
@@ -663,6 +723,7 @@ process.stdin.on('end', () => {
|
|
|
663
723
|
);
|
|
664
724
|
process.exit(2);
|
|
665
725
|
});
|
|
726
|
+
${TOTEM_FILE_END}
|
|
666
727
|
`;
|
|
667
728
|
// The PreToolUse entry constant for the freeze-check gate. The \`--event\`
|
|
668
729
|
// is baked into the command string per-entry (one wrapper, N gates = N
|
|
@@ -688,6 +749,166 @@ export const CLAUDE_GATE_WRAPPER_ENTRY = {
|
|
|
688
749
|
},
|
|
689
750
|
],
|
|
690
751
|
};
|
|
752
|
+
// ─── Init-distributed prepare wrapper (mmnto-ai/totem#2410 PR-B) ─────────
|
|
753
|
+
//
|
|
754
|
+
// `totem init` distributes this dependency-free CommonJS wrapper to
|
|
755
|
+
// `.totem/prepare.cjs` and wires the consumer's `package.json` `prepare` script
|
|
756
|
+
// to invoke it (`node .totem/prepare.cjs`). On every `pnpm install` (the npm
|
|
757
|
+
// `prepare` lifecycle) it runs `totem hook install`, so a consumer repo's managed
|
|
758
|
+
// hooks self-repair without a manual step. It is a MANAGED_SESSION_HOOKS roster
|
|
759
|
+
// member (below), so `totem hook install` itself drift-repairs it for adopters.
|
|
760
|
+
//
|
|
761
|
+
// The repo-relative install path + the canonical `prepare` script command, shared
|
|
762
|
+
// by init's wiring and the doctor parity sensor so both key off one source of truth.
|
|
763
|
+
export const PREPARE_SCRIPT_REL = '.totem/prepare.cjs';
|
|
764
|
+
export const PREPARE_SCRIPT_COMMAND = 'node .totem/prepare.cjs';
|
|
765
|
+
// Wrapper semantics (strategy#894 Option B, Tenet-4 core):
|
|
766
|
+
// - ALL logic runs in Node — NEVER a shell (the Windows quoting class, mmnto-ai/totem#2351).
|
|
767
|
+
// - CLI RESOLUTION: `@mmnto/cli` ships an `exports` map declaring only an `import`
|
|
768
|
+
// condition and NO `./package.json` subpath, so from this CommonJS wrapper BOTH
|
|
769
|
+
// `require.resolve('@mmnto/cli/package.json')` AND `require.resolve('@mmnto/cli')`
|
|
770
|
+
// throw ERR_PACKAGE_PATH_NOT_EXPORTED (verified against the real manifest at
|
|
771
|
+
// packages/cli/package.json, mmnto-ai/totem#2410 PR-B). The working alternative:
|
|
772
|
+
// a manual node_modules walk from the wrapper's own dir + the install cwd, reading
|
|
773
|
+
// package.json directly off disk — it bypasses the exports gate entirely.
|
|
774
|
+
// - NOT INSTALLED: the walk finds no `@mmnto/cli` → ONE stderr line naming the
|
|
775
|
+
// declared-skip class (CLI absent → hooks skipped; strategy#630 class) → exit 0.
|
|
776
|
+
// - INSTALLED: spawn `node <bin> hook install` (stdio inherited) and propagate the
|
|
777
|
+
// child's exit code VERBATIM — a genuine `hook install` failure fails `prepare`
|
|
778
|
+
// LOUD (exit != 0); the CLI's OWN declared skips are exit 0 and pass through. A
|
|
779
|
+
// spawn-level error (child.error set) → print + exit 1.
|
|
780
|
+
//
|
|
781
|
+
// Marker-headed (opens the file) + end-marker-bounded, so a bare `totem hook install`
|
|
782
|
+
// bounded-repairs it and a user-owned `.totem/prepare.cjs` is never clobbered.
|
|
783
|
+
export const PREPARE_WRAPPER = `${TOTEM_FILE_MARKER} — Totem init-distributed prepare wrapper (mmnto-ai/totem#2410)
|
|
784
|
+
// Runs \`totem hook install\` on \`pnpm install\` (the npm \`prepare\` lifecycle) so a
|
|
785
|
+
// consumer repo's managed hooks self-repair without a manual step. Dependency-free
|
|
786
|
+
// CommonJS by design — Node execs a \`.cjs\` via plain \`node\`, no build step. ALL
|
|
787
|
+
// logic is in Node, NEVER a shell (the Windows quoting class, mmnto-ai/totem#2351).
|
|
788
|
+
//
|
|
789
|
+
// CLI resolution note: @mmnto/cli's \`exports\` map declares only an \`import\` condition
|
|
790
|
+
// and no \`./package.json\` subpath, so \`require.resolve\` (both the package and its
|
|
791
|
+
// package.json) throws ERR_PACKAGE_PATH_NOT_EXPORTED from this CommonJS file. The
|
|
792
|
+
// working alternative is a manual node_modules walk that reads package.json off disk.
|
|
793
|
+
'use strict';
|
|
794
|
+
|
|
795
|
+
const fs = require('fs');
|
|
796
|
+
const path = require('path');
|
|
797
|
+
const { spawnSync } = require('child_process');
|
|
798
|
+
|
|
799
|
+
// Walk up from each start dir looking for node_modules/@mmnto/cli/package.json.
|
|
800
|
+
// Bypasses the exports gate that blocks require.resolve from a CommonJS wrapper.
|
|
801
|
+
function findCliPackageJson(startDirs) {
|
|
802
|
+
for (const start of startDirs) {
|
|
803
|
+
if (typeof start !== 'string' || start.length === 0) continue;
|
|
804
|
+
let dir = start;
|
|
805
|
+
while (true) {
|
|
806
|
+
const candidate = path.join(dir, 'node_modules', '@mmnto', 'cli', 'package.json');
|
|
807
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
808
|
+
const parent = path.dirname(dir);
|
|
809
|
+
if (parent === dir) break;
|
|
810
|
+
dir = parent;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
return null;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
const pkgJsonPath = findCliPackageJson([__dirname, process.cwd()]);
|
|
817
|
+
if (pkgJsonPath === null) {
|
|
818
|
+
// Declared skip (strategy#630 class): the CLI is not a dependency here, so there
|
|
819
|
+
// is nothing to install — exit 0 so \`prepare\` (and thus \`pnpm install\`) succeeds.
|
|
820
|
+
process.stderr.write(
|
|
821
|
+
'[totem prepare] @mmnto/cli is not installed — skipping hook install ' +
|
|
822
|
+
'(managed hooks will be set up once the CLI is a dependency).\\n',
|
|
823
|
+
);
|
|
824
|
+
process.exit(0);
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
// Read the bin entry off the resolved manifest and resolve it to an absolute path.
|
|
828
|
+
let binJs;
|
|
829
|
+
try {
|
|
830
|
+
const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8'));
|
|
831
|
+
const bin = pkg && pkg.bin;
|
|
832
|
+
let binRel = null;
|
|
833
|
+
if (typeof bin === 'string') {
|
|
834
|
+
binRel = bin;
|
|
835
|
+
} else if (bin && typeof bin === 'object') {
|
|
836
|
+
binRel = bin.totem || bin[Object.keys(bin)[0]] || null;
|
|
837
|
+
}
|
|
838
|
+
if (typeof binRel !== 'string' || binRel.length === 0) {
|
|
839
|
+
process.stderr.write(
|
|
840
|
+
'[totem prepare] @mmnto/cli is installed but declares no usable bin — ' +
|
|
841
|
+
'cannot run hook install. Reinstall @mmnto/cli.\\n',
|
|
842
|
+
);
|
|
843
|
+
process.exit(1);
|
|
844
|
+
}
|
|
845
|
+
binJs = path.resolve(path.dirname(pkgJsonPath), binRel);
|
|
846
|
+
} catch (err) {
|
|
847
|
+
process.stderr.write(
|
|
848
|
+
'[totem prepare] could not read @mmnto/cli package.json: ' +
|
|
849
|
+
(err && err.message ? err.message : String(err)) +
|
|
850
|
+
'\\n',
|
|
851
|
+
);
|
|
852
|
+
process.exit(1);
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
// Spawn \`node <bin> hook install\` — never a shell (the Windows quoting class).
|
|
856
|
+
const child = spawnSync(process.execPath, [binJs, 'hook', 'install'], { stdio: 'inherit' });
|
|
857
|
+
if (child.error) {
|
|
858
|
+
process.stderr.write(
|
|
859
|
+
'[totem prepare] failed to spawn totem hook install: ' +
|
|
860
|
+
(child.error.message || String(child.error)) +
|
|
861
|
+
'\\n',
|
|
862
|
+
);
|
|
863
|
+
process.exit(1);
|
|
864
|
+
}
|
|
865
|
+
// Propagate the child's exit code verbatim: a genuine hook-install failure fails
|
|
866
|
+
// prepare loud; the CLI's own declared skips already exit 0.
|
|
867
|
+
process.exit(child.status == null ? 1 : child.status);
|
|
868
|
+
${TOTEM_FILE_END}
|
|
869
|
+
`;
|
|
870
|
+
export const MANAGED_SESSION_HOOKS = [
|
|
871
|
+
{
|
|
872
|
+
rel: '.claude/hooks/PreWriteShield.cjs',
|
|
873
|
+
content: CLAUDE_PREWRITESHIELD,
|
|
874
|
+
marker: TOTEM_FILE_MARKER,
|
|
875
|
+
endMarker: TOTEM_FILE_END,
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
rel: '.claude/hooks/SessionStart.cjs',
|
|
879
|
+
content: CLAUDE_SESSION_START,
|
|
880
|
+
marker: TOTEM_FILE_MARKER,
|
|
881
|
+
endMarker: TOTEM_FILE_END,
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
rel: '.claude/hooks/gate-wrapper.cjs',
|
|
885
|
+
content: CLAUDE_GATE_WRAPPER,
|
|
886
|
+
marker: TOTEM_FILE_MARKER,
|
|
887
|
+
endMarker: TOTEM_FILE_END,
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
rel: '.gemini/hooks/SessionStart.js',
|
|
891
|
+
content: GEMINI_SESSION_START,
|
|
892
|
+
marker: TOTEM_FILE_MARKER,
|
|
893
|
+
endMarker: TOTEM_FILE_END,
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
rel: '.gemini/hooks/BeforeTool.js',
|
|
897
|
+
content: GEMINI_BEFORE_TOOL,
|
|
898
|
+
marker: TOTEM_FILE_MARKER,
|
|
899
|
+
endMarker: TOTEM_FILE_END,
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
// The init-distributed prepare wrapper (mmnto-ai/totem#2410 PR-B). A roster member
|
|
903
|
+
// so `totem hook install` drift-repairs it for adopters (init creates it; this verb
|
|
904
|
+
// regenerates-if-present). Not a session hook per se, but the same bounded-ownership
|
|
905
|
+
// whole-file semantics apply.
|
|
906
|
+
rel: PREPARE_SCRIPT_REL,
|
|
907
|
+
content: PREPARE_WRAPPER,
|
|
908
|
+
marker: TOTEM_FILE_MARKER,
|
|
909
|
+
endMarker: TOTEM_FILE_END,
|
|
910
|
+
},
|
|
911
|
+
];
|
|
691
912
|
// ─── Claude Code skill distribution (mmnto-ai/totem#1890 Phase C slice 3) ───
|
|
692
913
|
//
|
|
693
914
|
// Skills are surfaced into consumer repos at `.claude/skills/<name>/SKILL.md`.
|
|
@@ -776,7 +997,7 @@ ${SKILL_MARKER_START}
|
|
|
776
997
|
|
|
777
998
|
Session-start bring-up. **Read-only** — no mutations, no dispatches, no board edits until the operator rules on next steps (Proposal 295 d2: read-only orient + grounded next-work). Solo — no agent fleet (\`feedback_session_start_derive_cheaply\`: cheap derivation IS the validation dogfood).
|
|
778
999
|
|
|
779
|
-
1. **Consume the injected orientation.** On Claude Code seats the SessionStart hook already injects
|
|
1000
|
+
1. **Consume the injected orientation.** On Claude Code seats the SessionStart hook already injects the latest journal + carryforward, inbound mail, branch/ticket-matched context, and a bounded session-orientation slice (parked/freeze state, open PRs, board↔issue coherence drift, and an open-issue-count pointer) — do not re-run what it injected. Everything else the bring-up needs (the full board in-flight set, corpus freshness, doctrine currency) is derived on demand via \`totem orient\`. On a hook-less seat (other vendors, cold starts), derive it all: \`totem orient\`.
|
|
780
1001
|
|
|
781
1002
|
2. **Poll mail since last signoff.** \`totem mail\` — shows unread cross-repo mail addressed to this repo's agent(s) (ADR-106 §3). Unread = inbound − handled: consumption is tracked by \`processed/\` marks (\`feedback_check_outbox_before_replying\`), so the CLI path needs no cutoff stamp. Read every hit before proceeding — new mail can reprioritize everything below. (Fallback — a seat that must stamp-poll instead derives the cutoff from the newest journal's CONTENT date, the filename stamp or frontmatter, **never file mtime**, which git resets on clone/worktree and silently reports "inbox clean" over waiting mail; mmnto-ai/totem-strategy#813.)
|
|
782
1003
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-templates.js","sourceRoot":"","sources":["../../src/commands/init-templates.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,qEAAqE;AAMrE,6DAA6D;AAC7D,+EAA+E;AAC/E,sEAAsE;AAEtE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAChC,MAAM,CAAC,MAAM,YAAY,GAAG,+BAA+B,CAAC;AAC5D,MAAM,CAAC,MAAM,UAAU,GAAG,6BAA6B,CAAC;AACxD,MAAM,CAAC,MAAM,iBAAiB,GAAG,uCAAuC,CAAC;AACzE,MAAM,CAAC,MAA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L,OAAO,EAAE,MAAM,kBAAkB,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,CAAC;gBAC9D,QAAQ,EAAE,YAAY;aACvB,CAAC;QACJ,KAAK,MAAM;YACT,OAAO;gBACL,OAAO,EAAE,MAAM,kBAAkB,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,CAAC;gBAC9D,QAAQ,EAAE,YAAY;aACvB,CAAC;QACJ;YACE,OAAO;gBACL,OAAO,EAAE,MAAM,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,CAAC;gBAC1D,QAAQ,EAAE,iBAAiB;aAC5B,CAAC;IACN,CAAC;AACH,CAAC"}
|
package/dist/commands/init.d.ts
CHANGED
|
@@ -10,11 +10,45 @@ export declare function probeOllamaFloor(): Promise<{
|
|
|
10
10
|
message: string;
|
|
11
11
|
}>;
|
|
12
12
|
/**
|
|
13
|
-
* Scaffold a file with idempotency — skips
|
|
14
|
-
*
|
|
13
|
+
* Scaffold a file with idempotency — skips any file the totem `marker` does NOT
|
|
14
|
+
* OPEN (a user-owned file, or one that merely QUOTES the marker in its body — the
|
|
15
|
+
* positional ownership gate shared with `regenerateManagedSessionHooks`,
|
|
16
|
+
* mmnto-ai/totem#2413). When the caller threads an `endMarker`, a marker-headed
|
|
17
|
+
* whole file that is a bounded totem-owned region (marker opens it, end marker
|
|
18
|
+
* present, nothing after) and whose content has DRIFTED from canonical is repaired
|
|
19
|
+
* in place (`refreshed`) — the #2406 git-hook bounded drift-repair, generalized to
|
|
20
|
+
* the session-hook family (mmnto-ai/totem#2410, the lc#806 stale-SessionStart fix).
|
|
21
|
+
* A marker-headed file that is NOT bounded (legacy template with no end marker, or
|
|
22
|
+
* user content after the end marker) keeps the pre-#2410 `exists` behavior and emits
|
|
23
|
+
* a one-line notice. Creates parent directories as needed.
|
|
15
24
|
*/
|
|
16
|
-
export declare function scaffoldFile(filePath: string, content: string, marker?: string): {
|
|
17
|
-
action: 'created' | 'exists' | 'skipped';
|
|
25
|
+
export declare function scaffoldFile(filePath: string, content: string, marker?: string, endMarker?: string): {
|
|
26
|
+
action: 'created' | 'exists' | 'skipped' | 'refreshed';
|
|
27
|
+
err?: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Wire a consumer `package.json`'s `prepare` script to the init-distributed prepare
|
|
31
|
+
* wrapper (mmnto-ai/totem#2410 PR-B). User-owned content is never overwritten (Prop 289):
|
|
32
|
+
*
|
|
33
|
+
* - No `prepare` script → set `"prepare": "node .totem/prepare.cjs"` (`wired`).
|
|
34
|
+
* - `prepare` already exactly that → `exists` (no write; the file is left byte-identical).
|
|
35
|
+
* - A DIFFERENT existing `prepare` (or a non-string value) → `declined` (NO write, byte-
|
|
36
|
+
* identical): the caller prints the canonical line to add manually.
|
|
37
|
+
* - No `package.json` → `missing` (nothing to wire).
|
|
38
|
+
* - Unreadable / invalid JSON / a non-object root / a present-but-non-object
|
|
39
|
+
* `scripts` → `unparseable` (surfaced, never a crash; a non-object `scripts` is
|
|
40
|
+
* user content we must NOT silently replace — the decline posture, not a clobber).
|
|
41
|
+
* - A write that throws (perms/FS) → `write-failed` (distinct from a parse/shape
|
|
42
|
+
* problem, so the caller can tell "couldn't read your file" from "couldn't save it").
|
|
43
|
+
*
|
|
44
|
+
* On the `wired` path the file is rewritten with 2-space JSON + a trailing newline
|
|
45
|
+
* (mirrors `scaffoldMcpConfig`, the repo's package.json-edit precedent); existing keys
|
|
46
|
+
* keep their order and `prepare` is appended within `scripts` (stable key order).
|
|
47
|
+
*/
|
|
48
|
+
export declare function wirePreparePackageJson(pkgPath: string): {
|
|
49
|
+
action: 'wired' | 'exists' | 'declined' | 'missing' | 'unparseable' | 'write-failed';
|
|
50
|
+
/** The different existing `prepare` value, for the decline notice (present only when a string). */
|
|
51
|
+
existing?: string;
|
|
18
52
|
err?: string;
|
|
19
53
|
};
|
|
20
54
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAOA,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAGL,KAAK,SAAS,EAGf,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAOA,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAGL,KAAK,SAAS,EAGf,MAAM,kBAAkB,CAAC;AA6B1B,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EACL,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,cAAc,GACf,MAAM,qBAAqB,CAAC;AAQ7B,eAAO,MAAM,6BAA6B,2BAA2B,CAAC;AAItE,wBAAsB,gBAAgB,IAAI,OAAO,CAAC;IAChD,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC,CAsBD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,MAA0B,EAClC,SAAS,CAAC,EAAE,MAAM,GACjB;IAAE,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAmD1E;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG;IACvD,MAAM,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,cAAc,CAAC;IACrF,mGAAmG;IACnG,QAAQ,CAAC,EAAE,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