@mstar-harness/cli 2.0.1 → 2.0.3

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.
@@ -3992,6 +3992,7 @@ import { isAbsolute as isAbsolute3, resolve as resolve5 } from "node:path";
3992
3992
  import { execFileSync as execFileSync2 } from "node:child_process";
3993
3993
  import { mkdirSync as mkdirSync4, readFileSync as readFileSync4, realpathSync, statSync as statSync3, writeFileSync as writeFileSync3 } from "node:fs";
3994
3994
  import { basename as basename3, dirname as dirname4, isAbsolute as isAbsolute4, join as join5, resolve as resolve6 } from "node:path";
3995
+ import { existsSync as existsSync4, readdirSync as readdirSync3, readFileSync as readFileSync5 } from "node:fs";
3995
3996
  import { mkdirSync as mkdirSync5, readdirSync as readdirSync4, readFileSync as readFileSync6, writeFileSync as writeFileSync4 } from "node:fs";
3996
3997
  import { join as join7, resolve as resolve7 } from "node:path";
3997
3998
  import { existsSync as existsSync5, readdirSync as readdirSync5, readFileSync as readFileSync7 } from "node:fs";
@@ -5096,6 +5097,68 @@ function pushCadenceProbe(ciRunning, reviewWaveActive) {
5096
5097
  }
5097
5098
  return { ok: violations.length === 0, violations };
5098
5099
  }
5100
+ function parseCompassFrontmatter(filePath) {
5101
+ const content = readFileSync5(filePath, "utf8");
5102
+ const lines = content.split(/\r?\n/);
5103
+ if (lines[0]?.trim() !== "---") {
5104
+ throw new Error(`no YAML frontmatter fence in ${filePath} (expected first line "---")`);
5105
+ }
5106
+ const end = lines.indexOf("---", 1);
5107
+ if (end === -1) {
5108
+ throw new Error(`unterminated YAML frontmatter in ${filePath} (no closing "---")`);
5109
+ }
5110
+ const doc = {};
5111
+ let listKey = null;
5112
+ for (let i = 1;i < end; i += 1) {
5113
+ const line = lines[i] ?? "";
5114
+ if (!line.trim() || line.trim().startsWith("#"))
5115
+ continue;
5116
+ if (listKey !== null && /^\s*-\s+/.test(line)) {
5117
+ const item = line.replace(/^\s*-\s+/, "").trim().replace(/^["']|["']$/g, "");
5118
+ if (!Array.isArray(doc[listKey]))
5119
+ doc[listKey] = [];
5120
+ doc[listKey].push(item);
5121
+ continue;
5122
+ }
5123
+ listKey = null;
5124
+ const kv = line.match(/^([A-Za-z_][A-Za-z0-9_-]*):\s*(.*)$/);
5125
+ if (!kv) {
5126
+ throw new Error(`unsupported frontmatter line in ${filePath}: ${JSON.stringify(line)}`);
5127
+ }
5128
+ const value = kv[2].trim();
5129
+ doc[kv[1]] = value === "" ? null : /^\[.*\]$/.test(value) ? parseFlowArray(value, filePath) : value.replace(/^["']|["']$/g, "");
5130
+ listKey = value === "" ? kv[1] : null;
5131
+ }
5132
+ return doc;
5133
+ }
5134
+ function parseFlowArray(raw, filePath) {
5135
+ const inner = raw.slice(1, -1);
5136
+ if (/[[\]]/.test(inner)) {
5137
+ throw new Error(`nested flow-style array in ${filePath}: ${JSON.stringify(raw)} — only flat scalar items are supported (e.g. [a, b])`);
5138
+ }
5139
+ let quote = null;
5140
+ for (const ch of inner) {
5141
+ if (ch === '"' || ch === "'") {
5142
+ if (quote === null)
5143
+ quote = ch;
5144
+ else if (quote === ch)
5145
+ quote = null;
5146
+ } else if (ch === "," && quote !== null) {
5147
+ throw new Error(`ambiguous flow-style array in ${filePath}: ${JSON.stringify(raw)} — quoted item containing comma cannot be split unambiguously (flat scalar items only)`);
5148
+ }
5149
+ }
5150
+ if (quote !== null) {
5151
+ throw new Error(`unterminated ${quote} quote in flow-style array in ${filePath}: ${JSON.stringify(raw)}`);
5152
+ }
5153
+ const items = [];
5154
+ for (const part of inner.split(",")) {
5155
+ const item = part.trim().replace(/^["']|["']$/g, "");
5156
+ if (item === "")
5157
+ continue;
5158
+ items.push(item);
5159
+ }
5160
+ return items;
5161
+ }
5099
5162
  function violation6(severity, code, message, fix) {
5100
5163
  return { ok: false, severity, code, message, fix };
5101
5164
  }
@@ -6233,80 +6296,15 @@ function lintFiveQuestion(bodyText) {
6233
6296
  return { ok: violations.length === 0, violations };
6234
6297
  }
6235
6298
 
6236
- // src/compass.ts
6237
- import { readFileSync as readFileSync5 } from "node:fs";
6238
- function parseCompassFrontmatter(filePath) {
6239
- const content = readFileSync5(filePath, "utf8");
6240
- const lines = content.split(/\r?\n/);
6241
- if (lines[0]?.trim() !== "---") {
6242
- throw new Error(`no YAML frontmatter fence in ${filePath} (expected first line "---")`);
6243
- }
6244
- const end = lines.indexOf("---", 1);
6245
- if (end === -1) {
6246
- throw new Error(`unterminated YAML frontmatter in ${filePath} (no closing "---")`);
6247
- }
6248
- const doc = {};
6249
- let listKey = null;
6250
- for (let i = 1;i < end; i += 1) {
6251
- const line = lines[i] ?? "";
6252
- if (!line.trim() || line.trim().startsWith("#"))
6253
- continue;
6254
- if (listKey !== null && /^\s*-\s+/.test(line)) {
6255
- const item = line.replace(/^\s*-\s+/, "").trim().replace(/^["']|["']$/g, "");
6256
- if (!Array.isArray(doc[listKey]))
6257
- doc[listKey] = [];
6258
- doc[listKey].push(item);
6259
- continue;
6260
- }
6261
- listKey = null;
6262
- const kv = line.match(/^([A-Za-z_][A-Za-z0-9_-]*):\s*(.*)$/);
6263
- if (!kv) {
6264
- throw new Error(`unsupported frontmatter line in ${filePath}: ${JSON.stringify(line)}`);
6265
- }
6266
- const value = kv[2].trim();
6267
- doc[kv[1]] = value === "" ? null : /^\[.*\]$/.test(value) ? parseFlowArray(value, filePath) : value.replace(/^["']|["']$/g, "");
6268
- listKey = value === "" ? kv[1] : null;
6269
- }
6270
- return doc;
6271
- }
6272
- function parseFlowArray(raw, filePath) {
6273
- const inner = raw.slice(1, -1);
6274
- if (/[[\]]/.test(inner)) {
6275
- throw new Error(`nested flow-style array in ${filePath}: ${JSON.stringify(raw)} — only flat scalar items are supported (e.g. [a, b])`);
6276
- }
6277
- let quote = null;
6278
- for (const ch of inner) {
6279
- if (ch === '"' || ch === "'") {
6280
- if (quote === null)
6281
- quote = ch;
6282
- else if (quote === ch)
6283
- quote = null;
6284
- } else if (ch === "," && quote !== null) {
6285
- throw new Error(`ambiguous flow-style array in ${filePath}: ${JSON.stringify(raw)} — quoted item containing comma cannot be split unambiguously (flat scalar items only)`);
6286
- }
6287
- }
6288
- if (quote !== null) {
6289
- throw new Error(`unterminated ${quote} quote in flow-style array in ${filePath}: ${JSON.stringify(raw)}`);
6290
- }
6291
- const items = [];
6292
- for (const part of inner.split(",")) {
6293
- const item = part.trim().replace(/^["']|["']$/g, "");
6294
- if (item === "")
6295
- continue;
6296
- items.push(item);
6297
- }
6298
- return items;
6299
- }
6300
-
6301
6299
  // ../engine/dist/engine.js
6302
- import { existsSync as existsSync4, mkdirSync as mkdirSync6, readFileSync as readFileSync8, renameSync as renameSync2, unlinkSync as unlinkSync3, writeFileSync as writeFileSync5 } from "node:fs";
6300
+ import { existsSync as existsSync6, mkdirSync as mkdirSync6, readFileSync as readFileSync8, renameSync as renameSync2, unlinkSync as unlinkSync3, writeFileSync as writeFileSync5 } from "node:fs";
6303
6301
  import { randomUUID as randomUUID2 } from "node:crypto";
6304
6302
  import { basename as basename5, dirname as dirname5, join as join6, resolve as resolve9 } from "node:path";
6305
6303
  import { fileURLToPath } from "node:url";
6306
6304
  import { dirname as dirname32, isAbsolute as isAbsolute22, join as join32, resolve as resolve32 } from "node:path";
6307
6305
  import { AsyncLocalStorage as AsyncLocalStorage3 } from "node:async_hooks";
6308
6306
  function readJson2(filePath) {
6309
- if (!existsSync4(filePath))
6307
+ if (!existsSync6(filePath))
6310
6308
  return {};
6311
6309
  const content = readFileSync8(filePath, "utf8").trim();
6312
6310
  if (!content)
@@ -6336,7 +6334,7 @@ function resolveProjectRoot(startDir = process.cwd()) {
6336
6334
  const start = resolve9(startDir);
6337
6335
  let dir = start;
6338
6336
  for (;; ) {
6339
- if (existsSync4(join6(dir, "package.json")) || existsSync4(join6(dir, "bun.lock")))
6337
+ if (existsSync6(join6(dir, "package.json")) || existsSync6(join6(dir, "bun.lock")))
6340
6338
  return dir;
6341
6339
  const parent = dirname5(dir);
6342
6340
  if (parent === dir)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mstar-harness/cli",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "Morning Star harness CLI — installer bootstrap + mstar workflow verbs (path/status/lease/sdd/iteration/dispatch/worktree/lint/design-md/audit/compound/host/skill).",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -34,6 +34,6 @@
34
34
  "access": "public"
35
35
  },
36
36
  "devDependencies": {
37
- "@mstar-harness/engine": "2.0.1"
37
+ "@mstar-harness/engine": "2.0.3"
38
38
  }
39
39
  }