@karmaniverous/stan-cli 0.11.6 → 0.11.7

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 CHANGED
@@ -100,7 +100,7 @@ scripts:
100
100
  typecheck: npm run typecheck
101
101
  ```
102
102
 
103
- See [STAN Configuration](https://docs.karmanivero.us/stan/documents/Stan_Configuration.html) for more!
103
+ See [STAN Configuration](./docs-src/configuration.md) for more!
104
104
 
105
105
  ---
106
106
 
@@ -130,7 +130,7 @@ See [STAN Configuration](https://docs.karmanivero.us/stan/documents/Stan_Configu
130
130
  stan patch -f file.patch # from file
131
131
  ```
132
132
 
133
- See [CLI Usage & Examples](https://docs.karmanivero.us/stan/documents/CLI_Usage___Examples.html) for more!
133
+ See [CLI Usage & Examples](./docs-src/cli-examples.md) for more!
134
134
 
135
135
  ---
136
136
 
@@ -138,23 +138,24 @@ See [CLI Usage & Examples](https://docs.karmanivero.us/stan/documents/CLI_Usage_
138
138
 
139
139
  - [API reference](https://docs.karmanivero.us/stan)
140
140
  - Guides:
141
- - [Getting Started](https://docs.karmanivero.us/stan/documents/Getting_Started.html) — Install the CLI, initialize a repo, and attach archives in chat. Recommended chat setup: import the STAN GPT agent into TypingMind (bootloader included; requires GPT‑5 access) via [this link](https://www.typingmind.com/characters/c-01K5X5RVA4N1DWBQWWJBYDNX2W).
142
- - [The STAN Loop](https://docs.karmanivero.us/stan/documents/The_STAN_Loop.html) — How Build & Snapshot → Share & Baseline → Discuss & Patch work together.
143
- - [CLI Usage & Examples](https://docs.karmanivero.us/stan/documents/CLI_Usage___Examples.html) — Common flags and invocation patterns, including `-p`, `-P`, `-S`, `-A`, and `-c`.
144
- - [Migration — Namespaced Configuration](https://docs.karmanivero.us/stan/documents/Migration.html) — Upgrade legacy configs using `stan init` (backs up `.bak`; supports `--dry-run`).
145
- - [Stan Configuration](https://docs.karmanivero.us/stan/documents/Stan_Configuration.html) — All config keys, includes/excludes semantics, and phase‑scoped CLI defaults.
146
- - [Patch Workflow & Diagnostics](https://docs.karmanivero.us/stan/documents/Patch_Workflow___Diagnostics.html) — Unified diff policy, diagnostics envelopes, and assistant expectations.
147
- - [Archives & Snapshots](https://docs.karmanivero.us/stan/documents/Archives___Snapshots.html) — What goes into `archive.tar`/`archive.diff.tar`, combine mode, and snapshot history. Additional references:
141
+ - [Getting Started](./docs-src/getting-started.md) — Install the CLI, initialize a repo, and attach archives in chat. Recommended chat setup: import the STAN GPT agent into TypingMind (bootloader included; requires GPT‑5 access) via [this link](https://www.typingmind.com/characters/c-01K5X5RVA4N1DWBQWWJBYDNX2W).
142
+ - [The STAN Loop](./docs-src/the-stan-loop.md) — How Build & Snapshot → Share & Baseline → Discuss & Patch work together.
143
+ - [CLI Usage & Examples](./docs-src/cli-examples.md) — Common flags and invocation patterns, including `-p`, `-P`, `-S`, `-A`, and `-c`.
144
+ - [Migration — Namespaced Configuration](./docs-src/migration.md) — Upgrade legacy configs using `stan init` (backs up `.bak`; supports `--dry-run`).
145
+ - [Stan Configuration](./docs-src/configuration.md) — All config keys, includes/excludes semantics, and phase‑scoped CLI defaults.
146
+ - [Patch Workflow & Diagnostics](./docs-src/patch-workflow.md) — Unified diff policy, diagnostics envelopes, and assistant expectations.
147
+ - [Archives & Snapshots](./docs-src/archives-and-snapshots.md) — What goes into `archive.tar`/`archive.diff.tar`, combine mode, and snapshot history. Additional references:
148
148
 
149
149
  - The following documents are maintained by STAN and live under `<stanPath>/system/` in your repo:
150
150
  - `stan.project.md` contains your evolving project requirements.
151
151
  - `stan-todo.md` contains your evolving development plan.
152
+
152
153
  - Case studies:
153
- - [rrstack](https://docs.karmanivero.us/stan/documents/Case_Study_%E2%80%94_rrstack.html) — how STAN enabled rapid development in a couple of days.
154
- - Comparison: [Why STAN Over Alternatives?](https://docs.karmanivero.us/stan/documents/Why_STAN_Over_Alternatives_.html)
155
- - Tutorial: [Quickstart (End‑to‑End)](<https://docs.karmanivero.us/stan/documents/Tutorial_%E2%80%94_Quickstart_(End%E2%80%91to%E2%80%91End).html>)
154
+ - [rrstack](./docs-src/case-studies/rrstack.md) — how STAN enabled rapid development in a couple of days.
155
+ - Comparison: [Why STAN Over Alternatives?](./docs-src/why-stan-over-alternatives.md)
156
+ - Tutorial: [Quickstart (End‑to‑End)](./docs-src/tutorial-quickstart.md)
156
157
  - FAQ: answers to common questions and pitfalls.
157
- - Contributing: [Dev Quickstart](https://docs.karmanivero.us/stan/documents/Contributing_%E2%80%94_Dev_Quickstart.html)
158
+ - Contributing: [Dev Quickstart](./contributing.md)
158
159
 
159
160
  ---
160
161
 
@@ -168,7 +169,7 @@ See [CLI Usage & Examples](https://docs.karmanivero.us/stan/documents/CLI_Usage_
168
169
 
169
170
  ## Contributing
170
171
 
171
- - See the [Contributing — Dev Quickstart](https://docs.karmanivero.us/stan/documents/Contributing_%E2%80%94_Dev_Quickstart.html) for local setup and workflow tips.
172
+ - See the [Contributing — Dev Quickstart](./contributing.md) for local setup and workflow tips.
172
173
 
173
174
  - Keep the loop simple. Each stage ends with one command.
174
175
  - Favor small, testable modules; treat >300 LOC as design feedback.
package/dist/cli/stan.js CHANGED
@@ -32254,6 +32254,11 @@ async function handleSnap(opts) {
32254
32254
  try {
32255
32255
  const coreModUnknown = await Promise.resolve().then(function () { return index; });
32256
32256
  const core = coreModUnknown;
32257
+ const ensureOutFn = typeof core.ensureOutputDir === 'function'
32258
+ ? core.ensureOutputDir
32259
+ : typeof core.default?.ensureOutputDir === 'function'
32260
+ ? core.default.ensureOutputDir
32261
+ : null;
32257
32262
  const loadConfigFn = typeof core.loadConfig === 'function'
32258
32263
  ? core.loadConfig
32259
32264
  : typeof core.default?.loadConfig === 'function'
@@ -32265,19 +32270,67 @@ async function handleSnap(opts) {
32265
32270
  ? core.default.writeArchiveSnapshot
32266
32271
  : null;
32267
32272
  if (writeSnapshotFn) {
32273
+ // Make sure <stanPath>/diff (and output) exist before writing the snapshot.
32274
+ // This avoids ENOENT when snapping a fresh repo or temp workspace.
32275
+ try {
32276
+ if (ensureOutFn) {
32277
+ await ensureOutFn(cwd, stanPath, true);
32278
+ }
32279
+ }
32280
+ catch {
32281
+ /* best‑effort directory ensure */
32282
+ }
32268
32283
  let includes = [];
32269
32284
  let excludes = [];
32285
+ // Overlay inputs derived the same way as “run”:
32286
+ // - overlay enabled state from cliDefaults.run.facets
32287
+ // - inactive facets contribute subtree excludes; anchors re-include breadcrumbs
32288
+ let anchors = [];
32289
+ let overlayExcludes = [];
32270
32290
  try {
32271
32291
  const cfg = loadConfigFn ? await loadConfigFn(cwd) : null;
32272
32292
  includes = Array.isArray(cfg?.includes) ? cfg.includes : [];
32273
32293
  excludes = Array.isArray(cfg?.excludes) ? cfg.excludes : [];
32294
+ // Decide overlay enablement from run defaults (snap has no facet flags).
32295
+ const eff = getRunDefaults(cwd);
32296
+ try {
32297
+ const ov = await computeFacetOverlay({
32298
+ cwd,
32299
+ stanPath,
32300
+ enabled: eff.facets,
32301
+ activate: [],
32302
+ deactivate: [],
32303
+ nakedActivateAll: false,
32304
+ });
32305
+ // Always keep anchors (breadcrumbs) materialized in snapshot selection.
32306
+ anchors = Array.isArray(ov.anchorsOverlay) ? ov.anchorsOverlay : [];
32307
+ // Only map subtree roots into excludes when overlay is enabled.
32308
+ overlayExcludes =
32309
+ ov.enabled && Array.isArray(ov.excludesOverlay)
32310
+ ? ov.excludesOverlay
32311
+ : [];
32312
+ }
32313
+ catch {
32314
+ // best-effort overlay; fall back to engine selection only
32315
+ anchors = [];
32316
+ overlayExcludes = [];
32317
+ }
32274
32318
  }
32275
32319
  catch {
32276
32320
  // best-effort
32277
32321
  includes = [];
32278
32322
  excludes = [];
32323
+ anchors = [];
32324
+ overlayExcludes = [];
32279
32325
  }
32280
- await writeSnapshotFn({ cwd, stanPath, includes, excludes });
32326
+ const excludesFinal = [...excludes, ...overlayExcludes];
32327
+ await writeSnapshotFn({
32328
+ cwd,
32329
+ stanPath,
32330
+ includes,
32331
+ excludes: excludesFinal,
32332
+ anchors,
32333
+ });
32281
32334
  }
32282
32335
  }
32283
32336
  catch {
package/package.json CHANGED
@@ -164,5 +164,5 @@
164
164
  },
165
165
  "type": "module",
166
166
  "types": "dist/types/index.d.ts",
167
- "version": "0.11.6"
167
+ "version": "0.11.7"
168
168
  }