@clawtopia/werewolf-evolution 0.1.0 → 0.1.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.
@@ -1793,6 +1793,7 @@ var MIGRATION_DATA_START = "<!-- WEREWOLF_EVOLUTION_MIGRATION_DATA_START -->";
1793
1793
  var MIGRATION_DATA_END = "<!-- WEREWOLF_EVOLUTION_MIGRATION_DATA_END -->";
1794
1794
  var LEGACY_DEBRIEF_GATE_START = "<!-- WOLF_PLAY_DEBRIEF_GATE_START -->";
1795
1795
  var LEGACY_DEBRIEF_GATE_END = "<!-- WOLF_PLAY_DEBRIEF_GATE_END -->";
1796
+ var LEGACY_RUNTIME_HEADING = /^## wolf-play runtime v1[ \t]*\r?$/gm;
1796
1797
  var LEGACY_UNMARKED_DEBRIEF_GATE = `## wolf-play debrief gate
1797
1798
 
1798
1799
  \u4EC5\u5728 POSTGAME_DEBRIEF \u6216\u7528\u6237\u660E\u786E\u8981\u6C42\u590D\u76D8\u6587\u4EF6\u7EF4\u62A4\u65F6\u751F\u6548\u3002\u9996\u6279\u6587\u4EF6\u8BFB\u53D6\u5FC5\u987B\u4F9D\u6B21\u5B8C\u6210\u5F53\u524D
@@ -1924,9 +1925,21 @@ function readRuntime(content) {
1924
1925
  }
1925
1926
  if (legacyStarts === 0 && legacyEnds === 0) return inspectRuntimeProjection(content);
1926
1927
  if (legacyStarts !== 1 || legacyEnds !== 1) throw new Error("LEGACY_RUNTIME_MARKERS_INVALID");
1927
- return inspectRuntimeProjection(
1928
- content.replace(LEGACY_RUNTIME_START, RUNTIME_START).replace(LEGACY_RUNTIME_END, RUNTIME_END)
1929
- );
1928
+ let normalized = content.replace(LEGACY_RUNTIME_START, RUNTIME_START).replace(LEGACY_RUNTIME_END, RUNTIME_END);
1929
+ const start = normalized.indexOf(RUNTIME_START);
1930
+ const end = normalized.indexOf(RUNTIME_END, start);
1931
+ if (start >= 0 && end > start) {
1932
+ const blockEnd = end + RUNTIME_END.length;
1933
+ const block = normalized.slice(start, blockEnd);
1934
+ const headings = [...block.matchAll(LEGACY_RUNTIME_HEADING)];
1935
+ if (headings.length > 1) throw new Error("LEGACY_RUNTIME_HEADING_INVALID");
1936
+ if (headings.length === 1) {
1937
+ const heading = headings[0];
1938
+ const normalizedBlock = `${block.slice(0, heading.index)}## werewolf-play runtime v1${block.slice(heading.index + heading[0].length)}`;
1939
+ normalized = `${normalized.slice(0, start)}${normalizedBlock}${normalized.slice(blockEnd)}`;
1940
+ }
1941
+ }
1942
+ return inspectRuntimeProjection(normalized);
1930
1943
  }
1931
1944
  function stripLegacyDebriefGate(content) {
1932
1945
  let next = content;
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  sha256,
24
24
  verifyWorkspaceDocuments,
25
25
  workspaceChanges
26
- } from "./chunk-3A7SOBN4.js";
26
+ } from "./chunk-UZXHRLA6.js";
27
27
 
28
28
  // index.ts
29
29
  import {
package/dist/setup.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  import { z } from 'zod';
2
3
 
3
4
  declare const migrationMarkerSchema: z.ZodObject<{
package/dist/setup.js CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  import {
2
3
  assertSafeWorkspacePath,
3
4
  assertWorkspaceOwner,
@@ -15,7 +16,7 @@ import {
15
16
  runWorkspaceSetupExclusive,
16
17
  runWorkspaceTransaction,
17
18
  verifyWorkspaceDocuments
18
- } from "./chunk-3A7SOBN4.js";
19
+ } from "./chunk-UZXHRLA6.js";
19
20
 
20
21
  // src/setup.ts
21
22
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clawtopia/werewolf-evolution",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Deterministic postgame evolution runtime for the Clawtopia Werewolf Play skill.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -38,6 +38,7 @@
38
38
  "scripts": {
39
39
  "build": "tsup index.ts setup.ts --format esm --dts --out-dir dist --clean",
40
40
  "lint": "tsc --noEmit",
41
+ "pretest": "npm run build",
41
42
  "test": "vitest run",
42
43
  "prepack": "npm run build"
43
44
  },