@mmnto/cli 1.87.0 → 1.89.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.
Files changed (89) hide show
  1. package/dist/author-sandbox.d.ts +32 -0
  2. package/dist/author-sandbox.d.ts.map +1 -0
  3. package/dist/author-sandbox.js +95 -0
  4. package/dist/author-sandbox.js.map +1 -0
  5. package/dist/authored-rule-intake-prewindow.test.d.ts +2 -0
  6. package/dist/authored-rule-intake-prewindow.test.d.ts.map +1 -0
  7. package/dist/authored-rule-intake-prewindow.test.js +84 -0
  8. package/dist/authored-rule-intake-prewindow.test.js.map +1 -0
  9. package/dist/authored-rule-intake.d.ts +21 -1
  10. package/dist/authored-rule-intake.d.ts.map +1 -1
  11. package/dist/authored-rule-intake.js +56 -1
  12. package/dist/authored-rule-intake.js.map +1 -1
  13. package/dist/commands/authored-whitelist.d.ts.map +1 -1
  14. package/dist/commands/authored-whitelist.js +19 -8
  15. package/dist/commands/authored-whitelist.js.map +1 -1
  16. package/dist/commands/eject.d.ts.map +1 -1
  17. package/dist/commands/eject.js +10 -6
  18. package/dist/commands/eject.js.map +1 -1
  19. package/dist/commands/eject.test.js +5 -1
  20. package/dist/commands/eject.test.js.map +1 -1
  21. package/dist/commands/init-templates.d.ts +4 -0
  22. package/dist/commands/init-templates.d.ts.map +1 -1
  23. package/dist/commands/init-templates.js +25 -1
  24. package/dist/commands/init-templates.js.map +1 -1
  25. package/dist/commands/init.test.js +8 -3
  26. package/dist/commands/init.test.js.map +1 -1
  27. package/dist/commands/rule-author-command.test.js +29 -2
  28. package/dist/commands/rule-author-command.test.js.map +1 -1
  29. package/dist/commands/rule-author-teardown.test.d.ts +2 -0
  30. package/dist/commands/rule-author-teardown.test.d.ts.map +1 -0
  31. package/dist/commands/rule-author-teardown.test.js +123 -0
  32. package/dist/commands/rule-author-teardown.test.js.map +1 -0
  33. package/dist/commands/rule-author.d.ts +1 -0
  34. package/dist/commands/rule-author.d.ts.map +1 -1
  35. package/dist/commands/rule-author.js +143 -2
  36. package/dist/commands/rule-author.js.map +1 -1
  37. package/dist/commands/spine-authored-cert-corpus.d.ts +15 -0
  38. package/dist/commands/spine-authored-cert-corpus.d.ts.map +1 -1
  39. package/dist/commands/spine-authored-cert-corpus.js +17 -1
  40. package/dist/commands/spine-authored-cert-corpus.js.map +1 -1
  41. package/dist/commands/spine-authored-cert-corpus.test.js +440 -4
  42. package/dist/commands/spine-authored-cert-corpus.test.js.map +1 -1
  43. package/dist/commands/spine-authored-materialize.d.ts +55 -0
  44. package/dist/commands/spine-authored-materialize.d.ts.map +1 -0
  45. package/dist/commands/spine-authored-materialize.js +315 -0
  46. package/dist/commands/spine-authored-materialize.js.map +1 -0
  47. package/dist/commands/spine-cert-materialize.d.ts.map +1 -1
  48. package/dist/commands/spine-cert-materialize.js +17 -0
  49. package/dist/commands/spine-cert-materialize.js.map +1 -1
  50. package/dist/commands/spine-cert-persist.d.ts +17 -1
  51. package/dist/commands/spine-cert-persist.d.ts.map +1 -1
  52. package/dist/commands/spine-cert-persist.js +17 -5
  53. package/dist/commands/spine-cert-persist.js.map +1 -1
  54. package/dist/commands/spine-cert-persist.test.js +60 -0
  55. package/dist/commands/spine-cert-persist.test.js.map +1 -1
  56. package/dist/commands/spine-cert-run-corpus.d.ts +18 -28
  57. package/dist/commands/spine-cert-run-corpus.d.ts.map +1 -1
  58. package/dist/commands/spine-cert-run-corpus.js +162 -21
  59. package/dist/commands/spine-cert-run-corpus.js.map +1 -1
  60. package/dist/commands/spine-derive-labels.d.ts.map +1 -1
  61. package/dist/commands/spine-derive-labels.js +9 -1
  62. package/dist/commands/spine-derive-labels.js.map +1 -1
  63. package/dist/commands/spine-freeze-orchestration.test.d.ts +2 -0
  64. package/dist/commands/spine-freeze-orchestration.test.d.ts.map +1 -0
  65. package/dist/commands/spine-freeze-orchestration.test.js +468 -0
  66. package/dist/commands/spine-freeze-orchestration.test.js.map +1 -0
  67. package/dist/commands/spine-freeze-split.d.ts +10 -0
  68. package/dist/commands/spine-freeze-split.d.ts.map +1 -0
  69. package/dist/commands/spine-freeze-split.js +131 -0
  70. package/dist/commands/spine-freeze-split.js.map +1 -0
  71. package/dist/commands/spine-windtunnel.d.ts +35 -0
  72. package/dist/commands/spine-windtunnel.d.ts.map +1 -1
  73. package/dist/commands/spine-windtunnel.js +47 -7
  74. package/dist/commands/spine-windtunnel.js.map +1 -1
  75. package/dist/index.js +21 -0
  76. package/dist/index.js.map +1 -1
  77. package/dist/spine-fixture-ancestry.d.ts +20 -0
  78. package/dist/spine-fixture-ancestry.d.ts.map +1 -0
  79. package/dist/spine-fixture-ancestry.js +46 -0
  80. package/dist/spine-fixture-ancestry.js.map +1 -0
  81. package/dist/spine-fixture-ancestry.test.d.ts +2 -0
  82. package/dist/spine-fixture-ancestry.test.d.ts.map +1 -0
  83. package/dist/spine-fixture-ancestry.test.js +62 -0
  84. package/dist/spine-fixture-ancestry.test.js.map +1 -0
  85. package/dist/spine-freeze-proof.d.ts +89 -0
  86. package/dist/spine-freeze-proof.d.ts.map +1 -0
  87. package/dist/spine-freeze-proof.js +237 -0
  88. package/dist/spine-freeze-proof.js.map +1 -0
  89. package/package.json +2 -2
@@ -0,0 +1,237 @@
1
+ // ─── ADR-112 §5.1/§8 R1 — the shared-history freeze proof (topology-first) ────
2
+ //
3
+ // The cli-side git plumbing for the (a) commit-anchored tamper-evidence leg
4
+ // (codex fold-1): TOPOLOGY IS THE PROOF. Every assertion here derives from the
5
+ // SHARED ref (`origin/main` by default) — never HEAD, a local branch, or a
6
+ // local-only ref — because `GIT_COMMITTER_DATE` is trivially settable while a
7
+ // rewrite of shared history is observable. The one timestamp comparison
8
+ // (`frozenAt` ≤ the introducing commit's committer date) is a CONSISTENCY CHECK
9
+ // with its own distinct diagnostic (t2/t8), never the proof.
10
+ //
11
+ // Failure rows are a NON-ALIASING partition (codex fold-4): each row names a
12
+ // distinct way the freeze chain can be broken, with a `freeze-proof[<row>]`
13
+ // prefix so no two failures read alike. "Uncommitted" and "committed locally
14
+ // but not shared" are DIFFERENT rows — only the latter can fool a local
15
+ // HEAD-ancestor proof. Library module (static imports, like
16
+ // authored-rule-intake.ts); command wrappers stay lazy.
17
+ import * as fs from 'node:fs';
18
+ import * as path from 'node:path';
19
+ import { canonicalStringify, FROZEN_SPLIT_FILE, FrozenSplitArtifactSchema, SPLIT_REF_RE, TotemError, verifyFreezeIntegrity, } from '@mmnto/totem';
20
+ /** The shared ref the proof derives from. Tests point this at a real fixture remote. */
21
+ export const DEFAULT_SHARED_REF = 'origin/main';
22
+ /** LF-normalize for blob comparison (the same normalization `generateInputHash` applies). */
23
+ const lf = (s) => s.replace(/\r\n/g, '\n');
24
+ /**
25
+ * Optional-read `git show <commit>:<path>` — returns `undefined` where the blob
26
+ * cannot be rendered (a deletion commit in the path's rev-list is the legitimate
27
+ * case). The optionality is this helper's CONTRACT, not a swallowed failure: the
28
+ * one caller treats `undefined` as skip-this-commit and keeps its own fail-loud
29
+ * for the no-commit-matches outcome.
30
+ */
31
+ function tryGitShow(commit, relPath, cwd, safeExec) {
32
+ try {
33
+ // LC_ALL=C pins git's stderr prose — the family regex below parses it, and a
34
+ // localized message would misclassify blob-absence as a real fault (CR #2293
35
+ // round 3), resurfacing the deletion-commit crash on non-C locales.
36
+ return safeExec('git', ['show', `${commit}:${relPath}`], {
37
+ cwd,
38
+ env: { ...process.env, LC_ALL: 'C', LANG: 'C' },
39
+ }).replace(/\r\n/g, '\n');
40
+ }
41
+ catch (err) {
42
+ // ONLY the blob-absent family degrades to undefined (the optional-read
43
+ // contract); any other git fault propagates — fail loud, never drift.
44
+ const message = err instanceof Error ? err.message : String(err);
45
+ if (!/does not exist|exists on disk, but not in|invalid object name|bad revision/i.test(message)) {
46
+ throw err;
47
+ }
48
+ return undefined;
49
+ }
50
+ }
51
+ /** One fail-loud row of the freeze-proof failure partition — distinct, never aliasing. */
52
+ export function freezeProofFailure(row, detail, fix, cause) {
53
+ return new TotemError('GATE_INVALID', `freeze-proof[${row}]: ${detail}`, fix, cause);
54
+ }
55
+ function gitText(args, cwd, safeExec, what) {
56
+ try {
57
+ return safeExec('git', args, { cwd }).replace(/\r\n/g, '\n');
58
+ }
59
+ catch (err) {
60
+ throw new TotemError('GIT_FAILED', `freeze-proof: git ${what} failed in ${cwd}`, 'Verify git is installed and the repository/ref is valid.', err);
61
+ }
62
+ }
63
+ /**
64
+ * Resolve a frozen-split artifact by its content-addressed `splitRef` inside the
65
+ * tracked freeze home (`<totemDir>/spine/<gate>/frozen-split.json`). Fail-loud
66
+ * rows: `ref-unresolved` (no artifact carries the ref — including the
67
+ * artifact-absent case), `ref-ambiguous` (more than one does), and
68
+ * `artifact-integrity` (an artifact whose recomputed content address or
69
+ * commitment does not match its own fields — an in-place edit, t7).
70
+ */
71
+ export function resolveFrozenSplitByRef(totemDir, repoRoot, splitRef) {
72
+ const spineDir = path.join(totemDir, 'spine');
73
+ const candidates = [];
74
+ if (fs.existsSync(spineDir)) {
75
+ for (const entry of fs.readdirSync(spineDir, { withFileTypes: true })) {
76
+ if (!entry.isDirectory())
77
+ continue;
78
+ const p = path.join(spineDir, entry.name, FROZEN_SPLIT_FILE);
79
+ if (fs.existsSync(p))
80
+ candidates.push(p);
81
+ }
82
+ }
83
+ const matches = [];
84
+ for (const absPath of candidates) {
85
+ let parsed;
86
+ try {
87
+ parsed = FrozenSplitArtifactSchema.parse(JSON.parse(fs.readFileSync(absPath, 'utf-8')));
88
+ }
89
+ catch (err) {
90
+ throw freezeProofFailure('artifact-integrity', `frozen split at ${absPath} is malformed or violates the artifact schema`, 'A frozen artifact is never hand-edited; restore it from shared history.', err);
91
+ }
92
+ if (parsed.splitRef !== splitRef)
93
+ continue;
94
+ const integrity = verifyFreezeIntegrity(parsed);
95
+ if (!integrity.ok) {
96
+ throw freezeProofFailure('artifact-integrity', `frozen split at ${absPath} fails its own content address/commitment — expected splitRef ${integrity.expectedSplitRef} / commitment ${integrity.expectedCommitment}, artifact carries ${parsed.splitRef} / ${parsed.freezeCommitment} (in-place edit, t7)`, 'A frozen artifact is never edited after freeze; restore it from shared history or re-freeze via a new PR.');
97
+ }
98
+ matches.push({
99
+ artifact: parsed,
100
+ absPath,
101
+ relPath: path.relative(repoRoot, absPath).replace(/\\/g, '/'),
102
+ });
103
+ }
104
+ if (matches.length === 0) {
105
+ throw freezeProofFailure('ref-unresolved', `no frozen split artifact under ${spineDir} carries splitRef ${splitRef}`, `Run \`totem spine freeze-split\` and land the artifact (${FROZEN_SPLIT_FILE}) via the freeze PR before authoring.`);
106
+ }
107
+ if (matches.length > 1) {
108
+ throw freezeProofFailure('ref-ambiguous', `${matches.length} frozen split artifacts carry splitRef ${splitRef}: ${matches.map((m) => m.relPath).join(', ')}`, 'A content-addressed ref must resolve to exactly one tracked artifact; remove the duplicates.');
109
+ }
110
+ return matches[0];
111
+ }
112
+ /**
113
+ * The (a)-leg shared-history proof for a frozen split artifact. Topology rows:
114
+ * `artifact-uncommitted` (working tree only) · `artifact-not-shared` (committed
115
+ * locally, absent from the shared ref's ancestry — the row a HEAD-ancestor proof
116
+ * would miss) · `artifact-blob-differs` (current bytes ≠ the blob at the shared
117
+ * introducing commit — covers post-freeze edits whether or not committed) ·
118
+ * `temporal-consistency` (frozenAt postdates the introducing commit's committer
119
+ * date — t2/t8's distinct diagnostic; a consistency check, never the proof).
120
+ */
121
+ export function verifySharedFrozenSplit(args) {
122
+ const { repoRoot, resolved, safeExec } = args;
123
+ const sharedRef = args.sharedRef ?? DEFAULT_SHARED_REF;
124
+ const { relPath, absPath, artifact } = resolved;
125
+ try {
126
+ safeExec('git', ['ls-files', '--error-unmatch', '--', relPath], { cwd: repoRoot });
127
+ }
128
+ catch (err) {
129
+ throw freezeProofFailure('artifact-uncommitted', `frozen split ${relPath} is not tracked — it exists in the working tree only, so the commit-anchor has nothing to anchor to (t5)`, 'Commit the frozen artifact and land it on the shared ref via the freeze PR before authoring.', err);
130
+ }
131
+ // The anchor is the first shared commit carrying THIS CONTENT — not merely the
132
+ // first commit touching the path: a legitimate re-freeze reuses the path with
133
+ // new content, and its anchor is the re-freeze commit, while the superseded
134
+ // version keeps its own (older) anchor in history.
135
+ const pathCommits = gitText(['rev-list', '--reverse', sharedRef, '--', relPath], repoRoot, safeExec, `rev-list ${sharedRef} -- ${relPath}`)
136
+ .split('\n')
137
+ .filter((l) => l.trim().length > 0);
138
+ if (pathCommits.length === 0) {
139
+ throw freezeProofFailure('artifact-not-shared', `frozen split ${relPath} is tracked locally but absent from ${sharedRef} ancestry — a local commit is not a shared anchor (back-dating it would be unobservable)`, `Push/merge the freeze PR so the artifact lands on ${sharedRef}, then author.`);
140
+ }
141
+ const currentBytes = lf(fs.readFileSync(absPath, 'utf-8')).trim();
142
+ let introducing;
143
+ for (const commit of pathCommits) {
144
+ // Optional read by CONTRACT: `rev-list -- <path>` includes commits that DELETE
145
+ // the path, and `git show` legitimately cannot render the blob there (GCA #2293
146
+ // round 2). An unreadable commit simply cannot be the introducing match — skipping
147
+ // is the detector's correct read, and a fully-unmatched artifact still fail-louds
148
+ // as artifact-blob-differs below (the conservative direction is preserved).
149
+ const blob = tryGitShow(commit, relPath, repoRoot, safeExec);
150
+ if (blob !== undefined && lf(blob).trim() === currentBytes) {
151
+ introducing = commit;
152
+ break;
153
+ }
154
+ }
155
+ if (introducing === undefined) {
156
+ throw freezeProofFailure('artifact-blob-differs', `frozen split ${relPath} matches NO shared version of the path on ${sharedRef} — the working copy was modified after freeze, or this freeze never landed (t7)`, 'Restore the artifact from shared history; a legitimate re-freeze lands via a new PR before authoring.');
157
+ }
158
+ const committerDate = gitText(['show', '-s', '--format=%cI', introducing], repoRoot, safeExec, `show -s ${introducing}`).trim();
159
+ // Schema construction enforces presence, but a schema-bypassed artifact must
160
+ // fail LOUD here — `Date.parse('')` is NaN and every NaN comparison is false,
161
+ // which would silently no-op the consistency row (greptile #2293 round 1).
162
+ const frozenAt = artifact.split.frozenAt;
163
+ if (frozenAt === undefined) {
164
+ throw freezeProofFailure('artifact-integrity', `frozen split ${relPath} carries no split.frozenAt — the temporal-consistency check cannot run on a stampless artifact`, 'A frozen artifact always carries its freeze instant; restore it from shared history.');
165
+ }
166
+ // Git committer dates are SECOND-granular while frozenAt carries milliseconds —
167
+ // a freeze committed within the same second must not false-positive. The row
168
+ // fires only when frozenAt exceeds the committer date's whole second.
169
+ const GIT_TIMESTAMP_GRANULARITY_MS = 1000;
170
+ const frozenAtMs = Date.parse(frozenAt);
171
+ const committerDateMs = Date.parse(committerDate);
172
+ // An unparseable instant on EITHER side would make every comparison false and
173
+ // silently no-op the row (GCA #2293 round 3 — the same NaN class as the
174
+ // stampless case above, on the parse leg).
175
+ if (Number.isNaN(frozenAtMs) || Number.isNaN(committerDateMs)) {
176
+ throw freezeProofFailure('temporal-consistency', `temporal-consistency inputs unparseable: frozenAt "${frozenAt}" / committerDate "${committerDate}" (${introducing.slice(0, 12)}) — the row cannot run on malformed instants`, 'Both the artifact frozenAt and the commit date must be valid ISO-8601 instants; restore the artifact from shared history.');
177
+ }
178
+ if (frozenAtMs >= committerDateMs + GIT_TIMESTAMP_GRANULARITY_MS) {
179
+ throw freezeProofFailure('temporal-consistency', `temporal regression: frozenAt ${frozenAt} postdates the introducing commit's committer date ${committerDate} (${introducing.slice(0, 12)}) — the stamp claims a freeze AFTER the commit that carries it. Topology remains the proof; this consistency check names clock skew or a doctored stamp (t2/t8)`, 'Re-freeze via a new PR with an honestly-stamped instant; never edit the artifact in place.');
180
+ }
181
+ return { introducingCommit: introducing, committerDate };
182
+ }
183
+ /**
184
+ * Resolve + PROVE the freeze binding for a splitRef, in one home. Returns
185
+ * `undefined` for a legacy free-text ref (no artifact exists to bind — the
186
+ * pre-R1 adherence-class shape); for a content-addressed ref it resolves the
187
+ * artifact (integrity-checked) AND runs the shared-history proof, so a binding
188
+ * NEVER enters a consumer unproven regardless of which boundary constructs it
189
+ * (authoring intake, cert-run resolve, or the labels deriver).
190
+ */
191
+ export function resolveProvenFreezeBinding(args) {
192
+ if (!SPLIT_REF_RE.test(args.splitRef))
193
+ return undefined;
194
+ const resolved = resolveFrozenSplitByRef(args.totemDir, args.repoRoot, args.splitRef);
195
+ verifySharedFrozenSplit({
196
+ repoRoot: args.repoRoot,
197
+ resolved,
198
+ safeExec: args.safeExec,
199
+ ...(args.sharedRef !== undefined ? { sharedRef: args.sharedRef } : {}),
200
+ });
201
+ return { artifact: resolved.artifact };
202
+ }
203
+ /**
204
+ * The ledger half of the (a) leg: every EFFECTIVE authoring-ledger entry must
205
+ * have entered shared history STRICTLY LATER than the freeze artifact — by
206
+ * ancestry, not timestamps (t3). Rows: `entry-not-shared` (the row is not in the
207
+ * shared ref's history of the ledger file — uncommitted, dirty, or local-only) ·
208
+ * `entry-not-after-freeze` (introduced in the same commit as, or not a
209
+ * descendant of, the freeze's introducing commit).
210
+ */
211
+ export function assertLedgerEntriesAfterFreeze(args) {
212
+ const { repoRoot, ledgerRelPath, entries, freezeIntroducingCommit, safeExec } = args;
213
+ const sharedRef = args.sharedRef ?? DEFAULT_SHARED_REF;
214
+ for (const { ruleId, entry } of entries) {
215
+ const line = canonicalStringify(entry);
216
+ const introducing = gitText(['log', '--format=%H', '--reverse', `-S${line}`, sharedRef, '--', ledgerRelPath], repoRoot, safeExec, `log -S<entry ${ruleId}> ${sharedRef} -- ${ledgerRelPath}`)
217
+ .split('\n')
218
+ .filter((l) => l.trim().length > 0)[0];
219
+ if (introducing === undefined) {
220
+ throw freezeProofFailure('entry-not-shared', `authoring-ledger entry for '${ruleId}' is not in ${sharedRef}'s history of ${ledgerRelPath} — uncommitted, dirty, or local-only rows cannot anchor the freeze→author chronology`, 'Land the authoring commit on the shared ref; the cert chain reads shared history only.');
221
+ }
222
+ if (introducing === freezeIntroducingCommit) {
223
+ throw freezeProofFailure('entry-not-after-freeze', `authoring-ledger entry for '${ruleId}' entered shared history in the SAME commit as the freeze artifact (${introducing.slice(0, 12)}) — authoring must be strictly later than the freeze (t3)`, 'Freeze first (one PR), author after (a later PR); never combine them in one commit.');
224
+ }
225
+ try {
226
+ safeExec('git', ['merge-base', '--is-ancestor', freezeIntroducingCommit, introducing], {
227
+ cwd: repoRoot,
228
+ });
229
+ }
230
+ catch (err) {
231
+ // Non-zero exit = not-an-ancestor (or a git fault) — both honestly fail the row
232
+ // (conservative: an unprovable ordering never passes).
233
+ throw freezeProofFailure('entry-not-after-freeze', `authoring-ledger entry for '${ruleId}' (introduced ${introducing.slice(0, 12)}) does not descend from the freeze artifact's introducing commit ${freezeIntroducingCommit.slice(0, 12)} — not strictly later by ancestry (t3; timestamps are not consulted)`, 'The entry predates the freeze or lives on a divergent line; re-author under the frozen split.', err);
234
+ }
235
+ }
236
+ }
237
+ //# sourceMappingURL=spine-freeze-proof.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spine-freeze-proof.js","sourceRoot":"","sources":["../src/spine-freeze-proof.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,EAAE;AACF,4EAA4E;AAC5E,+EAA+E;AAC/E,2EAA2E;AAC3E,8EAA8E;AAC9E,wEAAwE;AACxE,gFAAgF;AAChF,6DAA6D;AAC7D,EAAE;AACF,6EAA6E;AAC7E,4EAA4E;AAC5E,6EAA6E;AAC7E,wEAAwE;AACxE,4DAA4D;AAC5D,wDAAwD;AAExD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EAEjB,yBAAyB,EACzB,YAAY,EACZ,UAAU,EACV,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAItB,wFAAwF;AACxF,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAC;AAEhD,6FAA6F;AAC7F,MAAM,EAAE,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAE3D;;;;;;GAMG;AACH,SAAS,UAAU,CACjB,MAAc,EACd,OAAe,E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oEAAoE,uBAAuB,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,sEAAsE,EAC5P,+FAA+F,EAC/F,GAAG,CACJ,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmnto/cli",
3
- "version": "1.87.0",
3
+ "version": "1.89.0",
4
4
  "description": "CLI for Totem — AI persistent memory and context layer",
5
5
  "type": "module",
6
6
  "engines": {
@@ -28,7 +28,7 @@
28
28
  "smol-toml": "^1.6.1",
29
29
  "yaml": "^2.4.0",
30
30
  "zod": "^3.24.0",
31
- "@mmnto/totem": "1.87.0"
31
+ "@mmnto/totem": "1.89.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@anthropic-ai/sdk": "^0.98.0",