@karmaniverous/stan-core 0.8.0 → 0.8.2

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.
@@ -155,6 +155,13 @@ List numbering policy (requirements & plan docs)
155
155
  - Before building any non‑trivial module (e.g., interactive prompts/UIs, argument parsing, selection lists, archiving/diffing helpers, spinners), search npm and GitHub for actively‑maintained, battle‑tested libraries.
156
156
  - Present 1–3 viable candidates with trade‑offs and a short plan. Discuss and agree on an approach before writing custom code.
157
157
 
158
+ Discussion Protocol ("Discuss before implementing")
159
+ - When the user provides new context (archives, scripts) and instructs to "discuss before implementing" (or similar):
160
+ 1. Ingest the new information.
161
+ 2. Engage in a **design-level discussion** (requirements analysis, approach options, trade-offs).
162
+ 3. **STOP.** Do not emit code patches or File Ops in the current turn.
163
+ 4. Wait until the discussion has reached an **actionable conclusion** and the user explicitly confirms to proceed.
164
+
158
165
  # Design‑first lifecycle (always prefer design before code)
159
166
 
160
167
  1. Iterate on design until convergence
@@ -1149,7 +1156,7 @@ Goal: prevent broken Markdown when emitting fenced blocks, especially diffs and
1149
1156
 
1150
1157
  Default wrapper
1151
1158
 
1152
- - Use **tilde fences** for all fenced code blocks we emit (Patch blocks, Full Listings, templates/examples, and Commit Message blocks).
1159
+ - Use **tilde fences** for all fenced code blocks we emit (**File Ops**, Patch blocks, Full Listings, templates/examples, and Commit Message blocks).
1153
1160
  - Start with a **default fence of `~~~~`** (4 tildes). Tilde fences are valid Markdown but rare in code/docs, so collisions are much less common than with backtick fences.
1154
1161
 
1155
1162
  Algorithm (tilde-based)
@@ -1161,13 +1168,14 @@ Algorithm (tilde-based)
1161
1168
 
1162
1169
  Hard rule (applies everywhere)
1163
1170
  - Do not rely on a fixed tilde count. Always compute, then re‑scan.
1164
- - This applies to Patch blocks, Full Listings, the Dependency Bug Report template, patch-failure diagnostics envelopes, and any example that includes fenced blocks.
1171
+ - This applies to **File Ops**, Patch blocks, Full Listings, the Dependency Bug Report template, patch-failure diagnostics envelopes, and any example that includes fenced blocks.
1172
+ - **Anti-pattern:** Never emit File Ops as a raw Markdown list. They must be inside a tilde fence to be copy-pasteable by tooling.
1165
1173
 
1166
1174
  # Response Format (MANDATORY)
1167
1175
 
1168
1176
  CRITICAL: Fence Hygiene (Nested Code Blocks) and Coverage
1169
1177
 
1170
- - Use **tilde fences** for all fenced blocks emitted in replies (Patch blocks, Full Listings, and Commit Message). Default is `~~~~`.
1178
+ - Use **tilde fences** for all fenced blocks emitted in replies (**File Ops**, Patch blocks, Full Listings, and Commit Message). Default is `~~~~`.
1171
1179
  - You MUST compute fence lengths dynamically to ensure that each outer fence has one more `~` than any `~` run it contains (minimum 4).
1172
1180
  - Algorithm:
1173
1181
  1. Collect all code blocks you will emit (every “Patch” per file; any optional “Full Listing” blocks, if requested).
@@ -1267,7 +1275,7 @@ Before sending a reply, verify all of the following:
1267
1275
 
1268
1276
  3. Fence hygiene (+1 rule)
1269
1277
  - For every fenced block, the outer fence is strictly longer than any internal `~` run (minimum 4).
1270
- - Patches, optional Full Listings, and commit message all satisfy the +1 rule.
1278
+ - File Ops, Patches, optional Full Listings, and commit message all satisfy the +1 rule.
1271
1279
  4. Section headings
1272
1280
  - Headings match the template exactly (names and order).
1273
1281
 
@@ -147,6 +147,11 @@ declare function createMetaArchive(cwd: string, stanPath: string, selection?: {
147
147
  * (combine mode). Known STAN archive files remain excluded by tar filter.
148
148
  */
149
149
  includeOutputDir?: boolean;
150
+ /**
151
+ * Output file name (default: `archive.meta.tar`).
152
+ * Written to `<stanPath>/output/<fileName>`.
153
+ */
154
+ fileName?: string;
150
155
  }): Promise<string>;
151
156
 
152
157
  /**
@@ -925,6 +930,11 @@ declare const writeDependencyMetaFile: (args: {
925
930
  stanPath: string;
926
931
  meta: DependencyMetaFile;
927
932
  }) => Promise<string>;
933
+ declare const writeDependencyMapFile: (args: {
934
+ cwd: string;
935
+ stanPath: string;
936
+ map: DependencyMapFile;
937
+ }) => Promise<string>;
928
938
 
929
939
  /**
930
940
  * Compile an engine‑parity matcher that returns true when any pattern matches.
@@ -959,5 +969,5 @@ declare const assembleSystemMonolith: (cwd: string, stanPath: string) => Promise
959
969
 
960
970
  declare const CORE_VERSION: string;
961
971
 
962
- export { CORE_VERSION, DEFAULT_OPEN_COMMAND, DEFAULT_STAN_PATH, applyPatchPipeline, applyWithJsDiff, assembleSystemMonolith, buildDependencyMeta, computeContextAllowlistPlan, computeSelectedNodeIds, createArchive, createArchiveDiff, createArchiveDiffWithDependencyContext, createArchiveWithDependencyContext, createContextArchiveDiffWithDependencyContext, createContextArchiveWithDependencyContext, createMetaArchive, dependencyMapFileSchema, dependencyMapNodeSchema, dependencyMetaFileSchema, dependencyMetaNodeSchema, dependencyStateEntrySchema, dependencyStateFileSchema, detectAndCleanPatch, ensureOutputDir, executeFileOps, expandEntry, findConfigPathSync, getPackagedSystemPromptPath, loadConfig, loadConfigSync, makeGlobMatcher, parseDependencyStateFile, parseFileOpsBlock, prepareDependencyContext, prepareImports, resolveStanPath, resolveStanPathSync, stageDependencyContext, stagePreparedDependencyContext, summarizeContextAllowlistBudget, validateDependencySelection, validateDependencySelectionOrThrow, validateOrThrow, validateResponseMessage, writeArchiveSnapshot, writeDependencyMetaFile };
972
+ export { CORE_VERSION, DEFAULT_OPEN_COMMAND, DEFAULT_STAN_PATH, applyPatchPipeline, applyWithJsDiff, assembleSystemMonolith, buildDependencyMeta, computeContextAllowlistPlan, computeSelectedNodeIds, createArchive, createArchiveDiff, createArchiveDiffWithDependencyContext, createArchiveWithDependencyContext, createContextArchiveDiffWithDependencyContext, createContextArchiveWithDependencyContext, createMetaArchive, dependencyMapFileSchema, dependencyMapNodeSchema, dependencyMetaFileSchema, dependencyMetaNodeSchema, dependencyStateEntrySchema, dependencyStateFileSchema, detectAndCleanPatch, ensureOutputDir, executeFileOps, expandEntry, findConfigPathSync, getPackagedSystemPromptPath, loadConfig, loadConfigSync, makeGlobMatcher, parseDependencyStateFile, parseFileOpsBlock, prepareDependencyContext, prepareImports, resolveStanPath, resolveStanPathSync, stageDependencyContext, stagePreparedDependencyContext, summarizeContextAllowlistBudget, validateDependencySelection, validateDependencySelectionOrThrow, validateOrThrow, validateResponseMessage, writeArchiveSnapshot, writeDependencyMapFile, writeDependencyMetaFile };
963
973
  export type { ApplyResult, AssembleResult, AttemptCapture, Block, BlockKind, BudgetEntry, BudgetSource, BuildDependencyMetaArgs, BuildDependencyMetaResult, ContextAllowlistBudget, ContextAllowlistPlan, ContextConfig, ContextModeSelection, CreateArchiveDiffWithDependencyContextResult, CreateArchiveFromFilesOptions, CreateArchiveOptions, CreateArchiveWithDependencyContextResult, CreateContextArchiveDiffResult, CreateContextArchiveOptions, CreateContextArchiveResult, DependencyContextInputs, DependencyMapFile, DependencyMapNode, DependencyMetaFile, DependencyMetaNode, DependencyStateEntry, DependencyStateFile, DependencyValidationMismatch, FileOp, FileOpsPlan, ImportsMap, JsDiffOutcome, NodeSource, NormalizedDependencyStateEntry, OpResult, PipelineOutcome, PrepareDependencyContextResult, SelectionReport, SelectionReportCounts, SnapshotUpdateMode, StageDependencyContextArgs, StageDependencyContextResult, StagePreparedDependencyContextResult, StagedEntry, ValidateDependencySelectionResult, ValidateResponseOptions, ValidationResult };
package/package.json CHANGED
@@ -151,5 +151,5 @@
151
151
  },
152
152
  "type": "module",
153
153
  "types": "dist/types/index.d.ts",
154
- "version": "0.8.0"
154
+ "version": "0.8.2"
155
155
  }