@nuucognition/flint-cli 0.6.0-dev.0 → 0.6.0-dev.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.
package/dist/index.js CHANGED
@@ -455,8 +455,8 @@ var init_parseUtil = __esm({
455
455
  init_errors();
456
456
  init_en();
457
457
  makeIssue = (params) => {
458
- const { data, path: path29, errorMaps, issueData } = params;
459
- const fullPath = [...path29, ...issueData.path || []];
458
+ const { data, path: path30, errorMaps, issueData } = params;
459
+ const fullPath = [...path30, ...issueData.path || []];
460
460
  const fullIssue = {
461
461
  ...issueData,
462
462
  path: fullPath
@@ -767,11 +767,11 @@ var init_types = __esm({
767
767
  init_parseUtil();
768
768
  init_util();
769
769
  ParseInputLazyPath = class {
770
- constructor(parent, value, path29, key) {
770
+ constructor(parent, value, path30, key) {
771
771
  this._cachedPath = [];
772
772
  this.parent = parent;
773
773
  this.data = value;
774
- this._path = path29;
774
+ this._path = path30;
775
775
  this._key = key;
776
776
  }
777
777
  get path() {
@@ -5117,9 +5117,9 @@ async function readLocalState(flintPath) {
5117
5117
  }
5118
5118
  }
5119
5119
  async function writeLocalState(flintPath, state) {
5120
- const path29 = getLocalStatePath(flintPath);
5121
- await mkdir2(dirname4(path29), { recursive: true });
5122
- await writeFile2(path29, JSON.stringify(state, null, 2) + "\n");
5120
+ const path30 = getLocalStatePath(flintPath);
5121
+ await mkdir2(dirname4(path30), { recursive: true });
5122
+ await writeFile2(path30, JSON.stringify(state, null, 2) + "\n");
5123
5123
  }
5124
5124
  async function getLocalFlintVersion(flintPath) {
5125
5125
  const state = await readLocalState(flintPath);
@@ -5168,8 +5168,8 @@ function parseWorkspaceToml(content) {
5168
5168
  }
5169
5169
  return config;
5170
5170
  }
5171
- function generateReferenceMarkdown(path29) {
5172
- return `**Path:** ${path29}
5171
+ function generateReferenceMarkdown(path30) {
5172
+ return `**Path:** ${path30}
5173
5173
  **Type:** codebase
5174
5174
 
5175
5175
  ## Key Paths
@@ -5181,9 +5181,9 @@ function generateReferenceMarkdown(path29) {
5181
5181
  (add notes here)
5182
5182
  `;
5183
5183
  }
5184
- async function isDirectory(path29) {
5184
+ async function isDirectory(path30) {
5185
5185
  try {
5186
- const s = await stat(path29);
5186
+ const s = await stat(path30);
5187
5187
  return s.isDirectory();
5188
5188
  } catch {
5189
5189
  return false;
@@ -5225,17 +5225,17 @@ async function readFlintJson(flintPath) {
5225
5225
  async function writeFlintJsonFile(flintPath, data) {
5226
5226
  await writeFile22(join32(flintPath, FLINT_JSON), JSON.stringify(data, null, 2) + "\n");
5227
5227
  }
5228
- async function isDirectory2(path29) {
5228
+ async function isDirectory2(path30) {
5229
5229
  try {
5230
- const s = await stat3(path29);
5230
+ const s = await stat3(path30);
5231
5231
  return s.isDirectory();
5232
5232
  } catch {
5233
5233
  return false;
5234
5234
  }
5235
5235
  }
5236
- async function fileExists(path29) {
5236
+ async function fileExists(path30) {
5237
5237
  try {
5238
- await stat3(path29);
5238
+ await stat3(path30);
5239
5239
  return true;
5240
5240
  } catch {
5241
5241
  return false;
@@ -5358,16 +5358,16 @@ async function readFlintJson2(flintPath) {
5358
5358
  async function writeFlintJsonFile2(flintPath, data) {
5359
5359
  await writeFile32(join6(flintPath, FLINT_JSON2), JSON.stringify(data, null, 2) + "\n");
5360
5360
  }
5361
- async function pathExists(path29) {
5361
+ async function pathExists(path30) {
5362
5362
  try {
5363
- await stat6(path29);
5363
+ await stat6(path30);
5364
5364
  return true;
5365
5365
  } catch {
5366
5366
  return false;
5367
5367
  }
5368
5368
  }
5369
- async function ensureDir(path29) {
5370
- await mkdir42(path29, { recursive: true });
5369
+ async function ensureDir(path30) {
5370
+ await mkdir42(path30, { recursive: true });
5371
5371
  }
5372
5372
  function toKebabCase(name) {
5373
5373
  return name.replace(/\([^)]*\)\s*/g, "").toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "").replace(/^-+|-+$/g, "");
@@ -5627,11 +5627,11 @@ async function renameDeclaredRepoFolders(ctx, baseDir, repositories, changes, wa
5627
5627
  changes.push(`Renamed ${baseDir}/${legacyName} \u2192 ${baseDir}/${repo.name}`);
5628
5628
  }
5629
5629
  }
5630
- async function removeDirIfEmpty(path29) {
5630
+ async function removeDirIfEmpty(path30) {
5631
5631
  try {
5632
- const entries = await readdir6(path29);
5632
+ const entries = await readdir6(path30);
5633
5633
  if (entries.length === 0) {
5634
- await rmdir(path29);
5634
+ await rmdir(path30);
5635
5635
  }
5636
5636
  } catch {
5637
5637
  }
@@ -6377,24 +6377,24 @@ function createMigrationContext(flintPath, options3 = {}) {
6377
6377
  log,
6378
6378
  warn,
6379
6379
  error: error3,
6380
- async exists(path29) {
6380
+ async exists(path30) {
6381
6381
  try {
6382
- await access2(resolve18(path29));
6382
+ await access2(resolve18(path30));
6383
6383
  return true;
6384
6384
  } catch {
6385
6385
  return false;
6386
6386
  }
6387
6387
  },
6388
- async read(path29) {
6389
- return readFile6(resolve18(path29), "utf-8");
6388
+ async read(path30) {
6389
+ return readFile6(resolve18(path30), "utf-8");
6390
6390
  },
6391
- async write(path29, content) {
6392
- const fullPath = resolve18(path29);
6391
+ async write(path30, content) {
6392
+ const fullPath = resolve18(path30);
6393
6393
  await mkdir6(dirname22(fullPath), { recursive: true });
6394
6394
  await writeFile5(fullPath, content, "utf-8");
6395
6395
  },
6396
- async delete(path29) {
6397
- await unlink2(resolve18(path29));
6396
+ async delete(path30) {
6397
+ await unlink2(resolve18(path30));
6398
6398
  },
6399
6399
  // ── Intent (flint.toml) ──────────────────────────────────────────────
6400
6400
  async readIntentText() {
@@ -6432,14 +6432,14 @@ function createMigrationContext(flintPath, options3 = {}) {
6432
6432
  await mkdir6(dirname22(dest), { recursive: true });
6433
6433
  await rename6(resolve18(from), dest);
6434
6434
  },
6435
- async rm(path29, options22) {
6436
- await fsRm(resolve18(path29), { recursive: options22?.recursive ?? false, force: true });
6435
+ async rm(path30, options22) {
6436
+ await fsRm(resolve18(path30), { recursive: options22?.recursive ?? false, force: true });
6437
6437
  },
6438
- async mkdir(path29, options22) {
6439
- await mkdir6(resolve18(path29), { recursive: options22?.recursive ?? true });
6438
+ async mkdir(path30, options22) {
6439
+ await mkdir6(resolve18(path30), { recursive: options22?.recursive ?? true });
6440
6440
  },
6441
- async readDir(path29) {
6442
- return readdir9(resolve18(path29));
6441
+ async readDir(path30) {
6442
+ return readdir9(resolve18(path30));
6443
6443
  }
6444
6444
  }
6445
6445
  };
@@ -8344,7 +8344,7 @@ ${notes}
8344
8344
  }
8345
8345
  });
8346
8346
 
8347
- // ../../packages/flint/dist/chunk-4IVT374N.js
8347
+ // ../../packages/flint/dist/chunk-FSCS2POG.js
8348
8348
  import { join as join13 } from "path";
8349
8349
  import { stat as stat10 } from "fs/promises";
8350
8350
  import { basename as basename2, dirname as dirname5, isAbsolute, join as join23 } from "path";
@@ -8417,8 +8417,8 @@ async function findFlintRoot(startPath) {
8417
8417
  }
8418
8418
  return null;
8419
8419
  }
8420
- async function isInsideFlint(path29) {
8421
- const flintRoot = await findFlintRoot(path29);
8420
+ async function isInsideFlint(path30) {
8421
+ const flintRoot = await findFlintRoot(path30);
8422
8422
  return flintRoot !== null;
8423
8423
  }
8424
8424
  function getTypePrefix() {
@@ -8511,9 +8511,9 @@ function isDevShard(decl) {
8511
8511
  const mode = resolveShardMode(decl);
8512
8512
  return mode === "dev-remote" || mode === "dev-local";
8513
8513
  }
8514
- async function exists(path29) {
8514
+ async function exists(path30) {
8515
8515
  try {
8516
- await stat22(path29);
8516
+ await stat22(path30);
8517
8517
  return true;
8518
8518
  } catch {
8519
8519
  return false;
@@ -8761,17 +8761,18 @@ async function addShardToConfig(flintPath, shardName, source, options3 = {}) {
8761
8761
  }
8762
8762
  await writeFlintToml(flintPath, config);
8763
8763
  }
8764
- async function removeShardFromConfig(flintPath, shardName) {
8764
+ async function removeShardFromConfig(flintPath, shardName, options3 = {}) {
8765
8765
  const config = await readFlintToml(flintPath);
8766
8766
  if (!config?.shards) return;
8767
8767
  const kebabName = toKebabCase3(shardName);
8768
- if (config.shards.installed) {
8768
+ const mode = options3.mode;
8769
+ if ((!mode || mode === "installed") && config.shards.installed) {
8769
8770
  config.shards.installed = config.shards.installed.filter((e) => e.name !== kebabName);
8770
8771
  }
8771
- if (config.shards["dev-remote"]) {
8772
+ if ((!mode || mode === "dev-remote") && config.shards["dev-remote"]) {
8772
8773
  config.shards["dev-remote"] = config.shards["dev-remote"].filter((e) => e.name !== kebabName);
8773
8774
  }
8774
- if (config.shards["dev-local"]) {
8775
+ if ((!mode || mode === "dev-local") && config.shards["dev-local"]) {
8775
8776
  config.shards["dev-local"] = config.shards["dev-local"].filter((e) => e.name !== kebabName);
8776
8777
  }
8777
8778
  await writeFlintToml(flintPath, config);
@@ -9293,8 +9294,8 @@ async function completeShardMigrationStep(flintPath, stepId) {
9293
9294
  await writeFlintJson2(flintPath, json);
9294
9295
  }
9295
9296
  var FLINT_DIR, FLINT_CONFIG_FILENAME, FLINT_JSON_FILENAME, FLINT_VERSION;
9296
- var init_chunk_4IVT374N = __esm({
9297
- "../../packages/flint/dist/chunk-4IVT374N.js"() {
9297
+ var init_chunk_FSCS2POG = __esm({
9298
+ "../../packages/flint/dist/chunk-FSCS2POG.js"() {
9298
9299
  "use strict";
9299
9300
  init_dist();
9300
9301
  init_dist2();
@@ -9305,9 +9306,9 @@ var init_chunk_4IVT374N = __esm({
9305
9306
  }
9306
9307
  });
9307
9308
 
9308
- // ../../packages/flint/dist/state-A3L3HMLE.js
9309
- var state_A3L3HMLE_exports = {};
9310
- __export(state_A3L3HMLE_exports, {
9309
+ // ../../packages/flint/dist/state-NEYMF6ZB.js
9310
+ var state_NEYMF6ZB_exports = {};
9311
+ __export(state_NEYMF6ZB_exports, {
9311
9312
  FLINT_CONFIG_FILENAME: () => FLINT_CONFIG_FILENAME,
9312
9313
  FLINT_DIR: () => FLINT_DIR,
9313
9314
  FLINT_JSON_FILENAME: () => FLINT_JSON_FILENAME,
@@ -9401,14 +9402,14 @@ __export(state_A3L3HMLE_exports, {
9401
9402
  writeFlintToml: () => writeFlintToml,
9402
9403
  writeLatticesState: () => writeLatticesState
9403
9404
  });
9404
- var init_state_A3L3HMLE = __esm({
9405
- "../../packages/flint/dist/state-A3L3HMLE.js"() {
9405
+ var init_state_NEYMF6ZB = __esm({
9406
+ "../../packages/flint/dist/state-NEYMF6ZB.js"() {
9406
9407
  "use strict";
9407
- init_chunk_4IVT374N();
9408
+ init_chunk_FSCS2POG();
9408
9409
  }
9409
9410
  });
9410
9411
 
9411
- // ../../packages/flint/dist/chunk-DM3D33H6.js
9412
+ // ../../packages/flint/dist/chunk-LUKWQDG3.js
9412
9413
  import os4 from "os";
9413
9414
  import path2 from "path";
9414
9415
  import { resolve } from "path";
@@ -9602,7 +9603,7 @@ async function cleanRegistryFile() {
9602
9603
  return result;
9603
9604
  }
9604
9605
  async function registerFlintByPath(p, options3) {
9605
- const { readFlintToml: readFlintToml3, hasFlintToml: hasFlintToml2 } = await Promise.resolve().then(() => (init_state_A3L3HMLE(), state_A3L3HMLE_exports));
9606
+ const { readFlintToml: readFlintToml3, hasFlintToml: hasFlintToml2 } = await Promise.resolve().then(() => (init_state_NEYMF6ZB(), state_NEYMF6ZB_exports));
9606
9607
  const isFlint2 = await hasFlintToml2(p);
9607
9608
  if (!isFlint2) {
9608
9609
  throw new Error(`Not a valid flint: ${p}
@@ -9636,8 +9637,8 @@ Missing flint.toml`);
9636
9637
  return entry;
9637
9638
  }
9638
9639
  var REGISTRY_VERSION, GLOBAL_FLINT_DIR, GLOBAL_FLINT_REGISTRY_PATH, FlintRegistryEntrySchema, FlintRegistrySchema, FALLBACK;
9639
- var init_chunk_DM3D33H6 = __esm({
9640
- "../../packages/flint/dist/chunk-DM3D33H6.js"() {
9640
+ var init_chunk_LUKWQDG3 = __esm({
9641
+ "../../packages/flint/dist/chunk-LUKWQDG3.js"() {
9641
9642
  "use strict";
9642
9643
  init_zod();
9643
9644
  REGISTRY_VERSION = 1;
@@ -9661,9 +9662,9 @@ var init_chunk_DM3D33H6 = __esm({
9661
9662
 
9662
9663
  // ../../packages/flint/dist/chunk-STM4NXTT.js
9663
9664
  import { access as access3 } from "fs/promises";
9664
- async function exists2(path29) {
9665
+ async function exists2(path30) {
9665
9666
  try {
9666
- await access3(path29);
9667
+ await access3(path30);
9667
9668
  return true;
9668
9669
  } catch {
9669
9670
  return false;
@@ -9716,7 +9717,7 @@ var init_utils_BBA2XQZO = __esm({
9716
9717
  }
9717
9718
  });
9718
9719
 
9719
- // ../../packages/flint/dist/chunk-M6GPU35N.js
9720
+ // ../../packages/flint/dist/chunk-FG5TDNHZ.js
9720
9721
  import { mkdir as mkdir23, readdir as readdir23, copyFile, rm as rm23, readFile as readFile34, writeFile as writeFile24, rmdir as rmdir2 } from "fs/promises";
9721
9722
  import { spawn as spawn2 } from "child_process";
9722
9723
  import { join as join43, resolve as resolve2, dirname as dirname6 } from "path";
@@ -9766,51 +9767,51 @@ function isRecord(value) {
9766
9767
  function isNonEmptyString(value) {
9767
9768
  return typeof value === "string" && value.trim().length > 0;
9768
9769
  }
9769
- function addIssue(issues, path29, message) {
9770
- issues.push(`Invalid "${path29}": ${message}`);
9770
+ function addIssue(issues, path30, message) {
9771
+ issues.push(`Invalid "${path30}": ${message}`);
9771
9772
  }
9772
- function validateString(value, path29, issues, options3 = {}) {
9773
+ function validateString(value, path30, issues, options3 = {}) {
9773
9774
  if (value === void 0) {
9774
9775
  if (options3.required) {
9775
- issues.push(`Missing required field "${path29}"`);
9776
+ issues.push(`Missing required field "${path30}"`);
9776
9777
  }
9777
9778
  return void 0;
9778
9779
  }
9779
9780
  if (!isNonEmptyString(value)) {
9780
- addIssue(issues, path29, "expected a non-empty string");
9781
+ addIssue(issues, path30, "expected a non-empty string");
9781
9782
  return void 0;
9782
9783
  }
9783
9784
  if (options3.exact && value !== options3.exact) {
9784
- addIssue(issues, path29, `expected "${options3.exact}", got "${value}"`);
9785
+ addIssue(issues, path30, `expected "${options3.exact}", got "${value}"`);
9785
9786
  return void 0;
9786
9787
  }
9787
9788
  if (options3.singleLine && /\r|\n/.test(value)) {
9788
- addIssue(issues, path29, "expected a single-line string");
9789
+ addIssue(issues, path30, "expected a single-line string");
9789
9790
  return void 0;
9790
9791
  }
9791
9792
  if (options3.pattern && !options3.pattern.test(value)) {
9792
- addIssue(issues, path29, options3.patternDescription ?? `expected to match ${options3.pattern}`);
9793
+ addIssue(issues, path30, options3.patternDescription ?? `expected to match ${options3.pattern}`);
9793
9794
  return void 0;
9794
9795
  }
9795
9796
  return value;
9796
9797
  }
9797
- function validateStringArray(value, path29, issues) {
9798
+ function validateStringArray(value, path30, issues) {
9798
9799
  if (value === void 0) return void 0;
9799
9800
  if (!Array.isArray(value)) {
9800
- addIssue(issues, path29, "expected an array of strings");
9801
+ addIssue(issues, path30, "expected an array of strings");
9801
9802
  return void 0;
9802
9803
  }
9803
9804
  const items = [];
9804
9805
  value.forEach((entry, index) => {
9805
- const item = validateString(entry, `${path29}[${index}]`, issues);
9806
+ const item = validateString(entry, `${path30}[${index}]`, issues);
9806
9807
  if (item !== void 0) {
9807
9808
  items.push(item);
9808
9809
  }
9809
9810
  });
9810
9811
  return items;
9811
9812
  }
9812
- function validateNodeScriptPath(value, path29, issues, options3 = {}) {
9813
- const validated = validateString(value, path29, issues, {
9813
+ function validateNodeScriptPath(value, path30, issues, options3 = {}) {
9814
+ const validated = validateString(value, path30, issues, {
9814
9815
  required: options3.required,
9815
9816
  singleLine: true
9816
9817
  });
@@ -9818,19 +9819,19 @@ function validateNodeScriptPath(value, path29, issues, options3 = {}) {
9818
9819
  return void 0;
9819
9820
  }
9820
9821
  if (validated.startsWith("/") || validated.startsWith("\\")) {
9821
- addIssue(issues, path29, "expected a relative path inside the shard");
9822
+ addIssue(issues, path30, "expected a relative path inside the shard");
9822
9823
  return void 0;
9823
9824
  }
9824
9825
  if (validated.split(/[\\/]+/).some((segment) => segment === "..")) {
9825
- addIssue(issues, path29, "path traversal is not allowed");
9826
+ addIssue(issues, path30, "path traversal is not allowed");
9826
9827
  return void 0;
9827
9828
  }
9828
9829
  if (!validated.endsWith(".js")) {
9829
- addIssue(issues, path29, 'expected a Node.js ".js" file');
9830
+ addIssue(issues, path30, 'expected a Node.js ".js" file');
9830
9831
  return void 0;
9831
9832
  }
9832
9833
  if (options3.prefix && !validated.startsWith(`${options3.prefix}/`)) {
9833
- addIssue(issues, path29, `expected a path under "${options3.prefix}/"`);
9834
+ addIssue(issues, path30, `expected a path under "${options3.prefix}/"`);
9834
9835
  return void 0;
9835
9836
  }
9836
9837
  return validated;
@@ -10054,8 +10055,8 @@ function normalizeLegacyManifest(raw, _context) {
10054
10055
  install
10055
10056
  };
10056
10057
  }
10057
- function addWarning(warnings, path29, message) {
10058
- warnings.push(`"${path29}": ${message}`);
10058
+ function addWarning(warnings, path30, message) {
10059
+ warnings.push(`"${path30}": ${message}`);
10059
10060
  }
10060
10061
  function parseShardManifestContent(content, manifestPath) {
10061
10062
  let parsed;
@@ -10627,9 +10628,9 @@ function classifyGitError(error3) {
10627
10628
  }
10628
10629
  return "unknown";
10629
10630
  }
10630
- async function pathExists3(path29) {
10631
+ async function pathExists3(path30) {
10631
10632
  try {
10632
- await stat23(path29);
10633
+ await stat23(path30);
10633
10634
  return true;
10634
10635
  } catch {
10635
10636
  return false;
@@ -11182,8 +11183,8 @@ async function updateShardLocalStateSetup(flintPath, name, shorthand, setup) {
11182
11183
  await syncSetupStateFile(getShardLocalStatePath(flintPath, name), shorthand, setup, { setup });
11183
11184
  }
11184
11185
  async function getShardSetupState(flintPath, name) {
11185
- const readLayer = async (path29) => {
11186
- const snap = await readSetupStateFileSnapshot(path29, "required");
11186
+ const readLayer = async (path30) => {
11187
+ const snap = await readSetupStateFileSnapshot(path30, "required");
11187
11188
  return snap ? { exists: true, setup: snap.setup } : { exists: false, setup: null };
11188
11189
  };
11189
11190
  return {
@@ -11193,8 +11194,8 @@ async function getShardSetupState(flintPath, name) {
11193
11194
  }
11194
11195
  async function setShardSetupState(flintPath, name, shorthand, scope, setup) {
11195
11196
  await ensureShardSystemFolders(flintPath);
11196
- const path29 = scope === "flint" ? getShardStatePath(flintPath, name) : getShardLocalStatePath(flintPath, name);
11197
- await syncSetupStateFile(path29, shorthand, setup, { setup });
11197
+ const path30 = scope === "flint" ? getShardStatePath(flintPath, name) : getShardLocalStatePath(flintPath, name);
11198
+ await syncSetupStateFile(path30, shorthand, setup, { setup });
11198
11199
  }
11199
11200
  function processTemplate(content) {
11200
11201
  const now = /* @__PURE__ */ new Date();
@@ -11997,7 +11998,7 @@ async function installShardFromDev(flintPath, devFolderName, options3 = {}) {
11997
11998
  ensureState: true,
11998
11999
  mode: "installed"
11999
12000
  });
12000
- const configSource = options3.source || `Shards/${manifest.name}`;
12001
+ const configSource = options3.source || `./Shards/${devFolderName}`;
12001
12002
  await addShardToConfig(flintPath, manifest.name, configSource, {
12002
12003
  version: options3.version
12003
12004
  });
@@ -13144,10 +13145,10 @@ function escapeRegex2(str) {
13144
13145
  return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
13145
13146
  }
13146
13147
  var SHARD_SPEC_VERSION, SUPPORTED_SHARD_SPECS, SHORTHAND_PATTERN, SEMVER_PATTERN, OWNER_REPO_PATTERN, TITLE_CASE_PATTERN, FORBIDDEN_BRANCH_REFS, TYPE_DECLARATION_PATTERN, ShardManifestValidationError, MANAGED_SECTION_START, MANAGED_SECTION_END, execAsync2, execFileAsync5, SHARDS_REPOS_FOLDER, SHARD_SYSTEM_FOLDER_NAMES, DEV_PREFIX_SKIP_FILES;
13147
- var init_chunk_M6GPU35N = __esm({
13148
- "../../packages/flint/dist/chunk-M6GPU35N.js"() {
13148
+ var init_chunk_FG5TDNHZ = __esm({
13149
+ "../../packages/flint/dist/chunk-FG5TDNHZ.js"() {
13149
13150
  "use strict";
13150
- init_chunk_4IVT374N();
13151
+ init_chunk_FSCS2POG();
13151
13152
  init_chunk_STM4NXTT();
13152
13153
  init_dist2();
13153
13154
  SHARD_SPEC_VERSION = "0.2.0";
@@ -13677,9 +13678,9 @@ var init_dist3 = __esm({
13677
13678
  }
13678
13679
  });
13679
13680
 
13680
- // ../../packages/flint/dist/registries-PR74R6QG.js
13681
- var registries_PR74R6QG_exports = {};
13682
- __export(registries_PR74R6QG_exports, {
13681
+ // ../../packages/flint/dist/registries-QVGCW7J2.js
13682
+ var registries_QVGCW7J2_exports = {};
13683
+ __export(registries_QVGCW7J2_exports, {
13683
13684
  GLOBAL_FLINT_DIR: () => GLOBAL_FLINT_DIR,
13684
13685
  GLOBAL_FLINT_REGISTRY_PATH: () => GLOBAL_FLINT_REGISTRY_PATH,
13685
13686
  cleanRegistryFile: () => cleanRegistryFile,
@@ -13701,16 +13702,16 @@ __export(registries_PR74R6QG_exports, {
13701
13702
  upsertFlintEntry: () => upsertFlintEntry,
13702
13703
  writeJsonRegistry: () => writeJsonRegistry
13703
13704
  });
13704
- var init_registries_PR74R6QG = __esm({
13705
- "../../packages/flint/dist/registries-PR74R6QG.js"() {
13705
+ var init_registries_QVGCW7J2 = __esm({
13706
+ "../../packages/flint/dist/registries-QVGCW7J2.js"() {
13706
13707
  "use strict";
13707
- init_chunk_DM3D33H6();
13708
+ init_chunk_LUKWQDG3();
13708
13709
  }
13709
13710
  });
13710
13711
 
13711
- // ../../packages/flint/dist/installer-JAKV746Y.js
13712
- var installer_JAKV746Y_exports = {};
13713
- __export(installer_JAKV746Y_exports, {
13712
+ // ../../packages/flint/dist/installer-TT7WMU5R.js
13713
+ var installer_TT7WMU5R_exports = {};
13714
+ __export(installer_TT7WMU5R_exports, {
13714
13715
  cloneShardToDev: () => cloneShardToDev,
13715
13716
  finishShardMigrationStep: () => finishShardMigrationStep,
13716
13717
  getAllShardsWithVersions: () => getAllShardsWithVersions,
@@ -13743,11 +13744,11 @@ __export(installer_JAKV746Y_exports, {
13743
13744
  uninstallShard: () => uninstallShard,
13744
13745
  updateShards: () => updateShards
13745
13746
  });
13746
- var init_installer_JAKV746Y = __esm({
13747
- "../../packages/flint/dist/installer-JAKV746Y.js"() {
13747
+ var init_installer_TT7WMU5R = __esm({
13748
+ "../../packages/flint/dist/installer-TT7WMU5R.js"() {
13748
13749
  "use strict";
13749
- init_chunk_M6GPU35N();
13750
- init_chunk_4IVT374N();
13750
+ init_chunk_FG5TDNHZ();
13751
+ init_chunk_FSCS2POG();
13751
13752
  init_chunk_STM4NXTT();
13752
13753
  }
13753
13754
  });
@@ -14106,42 +14107,44 @@ import { randomUUID as randomUUID22 } from "crypto";
14106
14107
  import { fileURLToPath as fileURLToPath2 } from "url";
14107
14108
  import { stat as stat82 } from "fs/promises";
14108
14109
  import { join as join142 } from "path";
14110
+ import path22 from "path";
14111
+ import { fileURLToPath as fileURLToPath22 } from "url";
14109
14112
  import { readdir as readdir92, readFile as readFile82, mkdir as mkdir12, writeFile as writeFile82, rm as rm62, stat as stat92, copyFile as copyFile2 } from "fs/promises";
14110
14113
  import { join as join152, basename as basename5, dirname as dirname52, resolve as resolve6, relative as relative3, sep as sep3, extname as extname2 } from "path";
14111
14114
  import { promises as fs42 } from "fs";
14112
- import path42 from "path";
14115
+ import path52 from "path";
14113
14116
  import { promises as fs22 } from "fs";
14114
- import path22 from "path";
14115
- import { promises as fs32 } from "fs";
14116
14117
  import path32 from "path";
14118
+ import { promises as fs32 } from "fs";
14119
+ import path42 from "path";
14117
14120
  import { promises as fs52 } from "fs";
14118
- import path52 from "path";
14119
14121
  import path6 from "path";
14122
+ import path7 from "path";
14120
14123
  import { randomUUID as randomUUID32 } from "crypto";
14121
14124
  import { promises as fs72 } from "fs";
14122
- import path7 from "path";
14123
14125
  import path8 from "path";
14124
- import { promises as fs8 } from "fs";
14125
14126
  import path9 from "path";
14127
+ import { promises as fs8 } from "fs";
14126
14128
  import path10 from "path";
14127
14129
  import path11 from "path";
14130
+ import path12 from "path";
14128
14131
  import { exec as exec5 } from "child_process";
14129
14132
  import { promises as fs9 } from "fs";
14130
- import path12 from "path";
14133
+ import path13 from "path";
14131
14134
  import { promisify as promisify62 } from "util";
14132
14135
  import { promises as fs10 } from "fs";
14133
- import path13 from "path";
14134
- import { promises as fs11 } from "fs";
14135
14136
  import path14 from "path";
14136
- import { promises as fs12 } from "fs";
14137
+ import { promises as fs11 } from "fs";
14137
14138
  import path15 from "path";
14138
- import { promises as fs13 } from "fs";
14139
+ import { promises as fs12 } from "fs";
14139
14140
  import path16 from "path";
14140
- import { promises as fs14 } from "fs";
14141
+ import { promises as fs13 } from "fs";
14141
14142
  import path17 from "path";
14143
+ import { promises as fs14 } from "fs";
14144
+ import path18 from "path";
14142
14145
  import { exec as exec6 } from "child_process";
14143
14146
  import { promises as fs15 } from "fs";
14144
- import path18 from "path";
14147
+ import path19 from "path";
14145
14148
  import { promisify as promisify72 } from "util";
14146
14149
  function formatFlintFolderName(name) {
14147
14150
  const prefix = getTypePrefix();
@@ -14228,20 +14231,20 @@ Create notes in \`Mesh/\` and link them with \`[[wiki-links]]\`.
14228
14231
  async function createMediaDir(flintPath) {
14229
14232
  await mkdir24(join25(flintPath, "Media"), { recursive: true });
14230
14233
  }
14231
- async function isValidFlint(path192) {
14234
+ async function isValidFlint(path202) {
14232
14235
  try {
14233
- const stats = await stat24(path192);
14236
+ const stats = await stat24(path202);
14234
14237
  if (!stats.isDirectory()) {
14235
14238
  return false;
14236
14239
  }
14237
- return hasFlintToml(path192);
14240
+ return hasFlintToml(path202);
14238
14241
  } catch {
14239
14242
  return false;
14240
14243
  }
14241
14244
  }
14242
- async function getFlintNameFromPath(path192) {
14245
+ async function getFlintNameFromPath(path202) {
14243
14246
  try {
14244
- const toml = await readFlintToml(path192);
14247
+ const toml = await readFlintToml(path202);
14245
14248
  if (!toml) return null;
14246
14249
  return toml.flint?.name ?? null;
14247
14250
  } catch {
@@ -14431,9 +14434,9 @@ function normalizePlateName(name) {
14431
14434
  function isSlug(value) {
14432
14435
  return /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(value);
14433
14436
  }
14434
- async function fileExists2(path192) {
14437
+ async function fileExists2(path202) {
14435
14438
  try {
14436
- await stat32(path192);
14439
+ await stat32(path202);
14437
14440
  return true;
14438
14441
  } catch {
14439
14442
  return false;
@@ -16131,9 +16134,9 @@ async function createArtifactFromTemplate(flintPath, request) {
16131
16134
  throw new Error(`Unsupported template: ${request.template}`);
16132
16135
  }
16133
16136
  }
16134
- async function pathExists4(path192) {
16137
+ async function pathExists4(path202) {
16135
16138
  try {
16136
- await stat42(path192);
16139
+ await stat42(path202);
16137
16140
  return true;
16138
16141
  } catch {
16139
16142
  return false;
@@ -16388,9 +16391,9 @@ function getTinderboxFlintMode(declaration) {
16388
16391
  function getTinderboxFolderName(name) {
16389
16392
  return `(Flint) ${name}`;
16390
16393
  }
16391
- async function pathExists32(path192) {
16394
+ async function pathExists32(path202) {
16392
16395
  try {
16393
- await stat52(path192);
16396
+ await stat52(path202);
16394
16397
  return true;
16395
16398
  } catch {
16396
16399
  return false;
@@ -16681,10 +16684,10 @@ async function reconcileTinderbox(root, config) {
16681
16684
  });
16682
16685
  return { matched, undeclared, missing, renamed };
16683
16686
  }
16684
- function buildFlintEntry(path192, name, toml) {
16687
+ function buildFlintEntry(path202, name, toml) {
16685
16688
  const entry = {
16686
16689
  name,
16687
- path: resolve32(path192),
16690
+ path: resolve32(path202),
16688
16691
  source: "local"
16689
16692
  };
16690
16693
  if (toml?.flint.tags?.length) {
@@ -17093,15 +17096,15 @@ async function setTinderboxIdentity(root, name) {
17093
17096
  }
17094
17097
  return { applied, failed };
17095
17098
  }
17096
- async function countFiles(path192) {
17097
- const stats = await stat52(path192);
17099
+ async function countFiles(path202) {
17100
+ const stats = await stat52(path202);
17098
17101
  if (!stats.isDirectory()) {
17099
17102
  return 1;
17100
17103
  }
17101
- const entries = await readdir42(path192, { withFileTypes: true });
17104
+ const entries = await readdir42(path202, { withFileTypes: true });
17102
17105
  let count = 1;
17103
17106
  for (const entry of entries) {
17104
- count += await countFiles(join92(path192, entry.name));
17107
+ count += await countFiles(join92(path202, entry.name));
17105
17108
  }
17106
17109
  return count;
17107
17110
  }
@@ -17178,7 +17181,7 @@ async function moveFlint(nameOrPath, destination, options3 = {}) {
17178
17181
  async function removeTinderboxFlint(flint) {
17179
17182
  const entry = await findFlintByPath(flint.path);
17180
17183
  if (entry) {
17181
- const { unregisterFlint: unregisterFlint2 } = await Promise.resolve().then(() => (init_registries_PR74R6QG(), registries_PR74R6QG_exports));
17184
+ const { unregisterFlint: unregisterFlint2 } = await Promise.resolve().then(() => (init_registries_QVGCW7J2(), registries_QVGCW7J2_exports));
17182
17185
  await unregisterFlint2(entry.path);
17183
17186
  }
17184
17187
  await rm42(flint.path, { recursive: true, force: true });
@@ -17198,6 +17201,41 @@ async function installDependency(flintPath, source, version) {
17198
17201
  await cleanupResolvedSource(resolved);
17199
17202
  }
17200
17203
  }
17204
+ async function healShardScaffolding(folderPath, name) {
17205
+ for (const sub of SHARD_SPEC_DIRS_SOURCE) {
17206
+ await mkdir92(join102(folderPath, sub), { recursive: true });
17207
+ }
17208
+ const yamlPath = join102(folderPath, "shard.yaml");
17209
+ if (!await exists2(yamlPath)) {
17210
+ const stub = `shard-spec: "0.2.0"
17211
+ version: "0.1.0"
17212
+ name: ${name}
17213
+ shorthand: ${name}
17214
+ description: ""
17215
+ `;
17216
+ await writeFile72(yamlPath, stub, "utf-8");
17217
+ }
17218
+ const readmePath = join102(folderPath, "README.md");
17219
+ if (!await exists2(readmePath)) {
17220
+ await writeFile72(readmePath, `# ${name}
17221
+ `, "utf-8");
17222
+ }
17223
+ const releasePath = join102(folderPath, "RELEASE.md");
17224
+ if (!await exists2(releasePath)) {
17225
+ await writeFile72(releasePath, "# 0.1.0\n\n- Initial shard scaffold\n", "utf-8");
17226
+ }
17227
+ const migrationsPath = join102(folderPath, "MIGRATIONS.md");
17228
+ if (!await exists2(migrationsPath)) {
17229
+ await writeFile72(
17230
+ migrationsPath,
17231
+ `# Migrations
17232
+
17233
+ Migration notes for ${name}. Latest version at top, separated by \`---\`.
17234
+ `,
17235
+ "utf-8"
17236
+ );
17237
+ }
17238
+ }
17201
17239
  function withHealthMeta(result, category, shard) {
17202
17240
  return {
17203
17241
  ...result,
@@ -19054,8 +19092,8 @@ async function isRebaseInProgress(cwd) {
19054
19092
  const result = await runGit(cwd, ["rev-parse", "--git-path", "rebase-merge"]);
19055
19093
  if (result.success) {
19056
19094
  const { access: access32 } = await import("fs/promises");
19057
- const path192 = await import("path");
19058
- const rebasePath = path192.resolve(cwd, result.output.trim());
19095
+ const path202 = await import("path");
19096
+ const rebasePath = path202.resolve(cwd, result.output.trim());
19059
19097
  try {
19060
19098
  await access32(rebasePath);
19061
19099
  return true;
@@ -19065,8 +19103,8 @@ async function isRebaseInProgress(cwd) {
19065
19103
  const result2 = await runGit(cwd, ["rev-parse", "--git-path", "rebase-apply"]);
19066
19104
  if (result2.success) {
19067
19105
  const { access: access32 } = await import("fs/promises");
19068
- const path192 = await import("path");
19069
- const rebasePath = path192.resolve(cwd, result2.output.trim());
19106
+ const path202 = await import("path");
19107
+ const rebasePath = path202.resolve(cwd, result2.output.trim());
19070
19108
  try {
19071
19109
  await access32(rebasePath);
19072
19110
  return true;
@@ -19080,8 +19118,8 @@ async function getRebaseBranch(cwd) {
19080
19118
  const result = await runGit(cwd, ["rev-parse", "--git-path", "rebase-merge/head-name"]);
19081
19119
  if (result.success) {
19082
19120
  const { readFile: readFile92 } = await import("fs/promises");
19083
- const path192 = await import("path");
19084
- const headNamePath = path192.resolve(cwd, result.output.trim());
19121
+ const path202 = await import("path");
19122
+ const headNamePath = path202.resolve(cwd, result.output.trim());
19085
19123
  try {
19086
19124
  const ref = (await readFile92(headNamePath, "utf-8")).trim();
19087
19125
  return ref.replace(/^refs\/heads\//, "");
@@ -19099,7 +19137,7 @@ async function getConflictFiles(cwd) {
19099
19137
  }
19100
19138
  async function hasConflictMarkers(cwd, files) {
19101
19139
  const { readFile: readFile92 } = await import("fs/promises");
19102
- const path192 = await import("path");
19140
+ const path202 = await import("path");
19103
19141
  let filesToCheck = files;
19104
19142
  if (!filesToCheck || filesToCheck.length === 0) {
19105
19143
  const result = await runGit(cwd, ["diff", "--name-only", "HEAD"]);
@@ -19117,7 +19155,7 @@ async function hasConflictMarkers(cwd, files) {
19117
19155
  const conflicted = [];
19118
19156
  for (const file of filesToCheck) {
19119
19157
  try {
19120
- const content = await readFile92(path192.resolve(cwd, file), "utf-8");
19158
+ const content = await readFile92(path202.resolve(cwd, file), "utf-8");
19121
19159
  if (content.includes("<<<<<<<") && content.includes("=======") && content.includes(">>>>>>>")) {
19122
19160
  conflicted.push(file);
19123
19161
  }
@@ -19194,7 +19232,7 @@ async function syncFlint(flintPath) {
19194
19232
  {
19195
19233
  const pending = await getPendingMigrations(flintPath);
19196
19234
  if (pending.length > 0) {
19197
- const { getAllShardsWithVersions: getAllShardsWithVersions2 } = await Promise.resolve().then(() => (init_installer_JAKV746Y(), installer_JAKV746Y_exports));
19235
+ const { getAllShardsWithVersions: getAllShardsWithVersions2 } = await Promise.resolve().then(() => (init_installer_TT7WMU5R(), installer_TT7WMU5R_exports));
19198
19236
  const shardsForMigrationCheck = await getAllShardsWithVersions2(flintPath);
19199
19237
  const folderByShorthand = /* @__PURE__ */ new Map();
19200
19238
  const shardVersionByShorthand = /* @__PURE__ */ new Map();
@@ -19413,6 +19451,13 @@ async function resolveSource(flintPath, ref) {
19413
19451
  return { status: "unfulfilled", name: ref, type: "flint-bundle", path: sourcePath };
19414
19452
  }
19415
19453
  }
19454
+ function resolvePromptsBasePath() {
19455
+ try {
19456
+ return resolvePackageBasePath("@nuucognition/flint", import.meta.url);
19457
+ } catch {
19458
+ return path22.resolve(path22.dirname(fileURLToPath22(import.meta.url)), "_flint");
19459
+ }
19460
+ }
19416
19461
  async function loadFlintPrompt(name, variables = {}) {
19417
19462
  return loadPrompt(name, variables, {
19418
19463
  basePath: PROMPTS_BASE_PATH,
@@ -19430,9 +19475,9 @@ async function buildFlintApplicationPrompt(flintPath) {
19430
19475
  }
19431
19476
  return (await loadFlintPrompt("flint-application", { person })).trim();
19432
19477
  }
19433
- async function exists22(path192) {
19478
+ async function exists22(path202) {
19434
19479
  try {
19435
- await stat92(path192);
19480
+ await stat92(path202);
19436
19481
  return true;
19437
19482
  } catch {
19438
19483
  return false;
@@ -19643,7 +19688,7 @@ function getDisambiguatedExportName(flintPath, sourcePath, baseName) {
19643
19688
  return `${baseName} (${dirLabel})`;
19644
19689
  }
19645
19690
  async function scanExports(flintPath) {
19646
- const { readFlintToml: readFlintToml22 } = await Promise.resolve().then(() => (init_state_A3L3HMLE(), state_A3L3HMLE_exports));
19691
+ const { readFlintToml: readFlintToml22 } = await Promise.resolve().then(() => (init_state_NEYMF6ZB(), state_NEYMF6ZB_exports));
19647
19692
  const config = await readFlintToml22(flintPath);
19648
19693
  const declarations = config?.exports?.bundles;
19649
19694
  if (!declarations || declarations.length === 0) {
@@ -19670,7 +19715,7 @@ async function scanExportsFromConfig(flintPath, declarations) {
19670
19715
  async function scanExportEligible(flintPath) {
19671
19716
  const meshDir = join152(flintPath, "Mesh");
19672
19717
  if (!await exists22(meshDir)) return [];
19673
- const { readFlintToml: readFlintToml22 } = await Promise.resolve().then(() => (init_state_A3L3HMLE(), state_A3L3HMLE_exports));
19718
+ const { readFlintToml: readFlintToml22 } = await Promise.resolve().then(() => (init_state_NEYMF6ZB(), state_NEYMF6ZB_exports));
19674
19719
  const config = await readFlintToml22(flintPath);
19675
19720
  const declared = new Set(
19676
19721
  (config?.exports?.bundles ?? []).map((d) => d.file.replace(/\.md$/, "").toLowerCase())
@@ -19866,13 +19911,13 @@ async function applyEffect(world, effect) {
19866
19911
  await writeFlintJsonPatch(world.root, effect.patch);
19867
19912
  return;
19868
19913
  case "writeSharedFile":
19869
- await writeFile9(path22.resolve(world.root, effect.path), effect.contents);
19914
+ await writeFile9(path32.resolve(world.root, effect.path), effect.contents);
19870
19915
  return;
19871
19916
  case "deleteSharedPath":
19872
- await deletePath(path22.resolve(world.root, effect.path));
19917
+ await deletePath(path32.resolve(world.root, effect.path));
19873
19918
  return;
19874
19919
  case "writeLocalFile":
19875
- await writeFile9(path22.resolve(world.root, ".flint", effect.path), effect.contents);
19920
+ await writeFile9(path32.resolve(world.root, ".flint", effect.path), effect.contents);
19876
19921
  return;
19877
19922
  }
19878
19923
  }
@@ -19883,25 +19928,25 @@ async function writeFlintJsonPatch(root, patch) {
19883
19928
  await writeFlintJson2(root, merged);
19884
19929
  }
19885
19930
  async function writeFile9(file, contents) {
19886
- await fs22.mkdir(path22.dirname(file), { recursive: true });
19931
+ await fs22.mkdir(path32.dirname(file), { recursive: true });
19887
19932
  await fs22.writeFile(file, contents, "utf8");
19888
19933
  }
19889
19934
  async function deletePath(target) {
19890
19935
  await fs22.rm(target, { recursive: true, force: true });
19891
19936
  }
19892
19937
  async function syncMarkers(root, set) {
19893
- const dir = path32.join(root, set.dir);
19938
+ const dir = path42.join(root, set.dir);
19894
19939
  await fs32.mkdir(dir, { recursive: true });
19895
19940
  const expected = /* @__PURE__ */ new Set();
19896
19941
  for (const entry of set.entries) {
19897
19942
  expected.add(entry.filename);
19898
- const file = path32.join(dir, entry.filename);
19943
+ const file = path42.join(dir, entry.filename);
19899
19944
  await fs32.writeFile(file, renderMarker(entry), "utf8");
19900
19945
  }
19901
19946
  const existing = await fs32.readdir(dir, { withFileTypes: true });
19902
19947
  for (const dirent of existing) {
19903
19948
  if (expected.has(dirent.name)) continue;
19904
- await fs32.rm(path32.join(dir, dirent.name), { recursive: true, force: true });
19949
+ await fs32.rm(path42.join(dir, dirent.name), { recursive: true, force: true });
19905
19950
  }
19906
19951
  }
19907
19952
  function renderMarker(marker) {
@@ -20002,15 +20047,15 @@ async function runPhase(features2, world, opts, plan, receipts) {
20002
20047
  return dispatchDrifts(drifts, features2, world, opts, plan, receipts);
20003
20048
  }
20004
20049
  async function pruneMetadataParents(root, markerDirs) {
20005
- const METADATA_ROOT = path42.join("Mesh", "Metadata");
20050
+ const METADATA_ROOT = path52.join("Mesh", "Metadata");
20006
20051
  const expectedByParent = /* @__PURE__ */ new Map();
20007
20052
  for (const dir of markerDirs) {
20008
- const norm = path42.normalize(dir);
20009
- if (!norm.startsWith(METADATA_ROOT + path42.sep) && norm !== METADATA_ROOT) continue;
20053
+ const norm = path52.normalize(dir);
20054
+ if (!norm.startsWith(METADATA_ROOT + path52.sep) && norm !== METADATA_ROOT) continue;
20010
20055
  let cur = norm;
20011
- while (cur !== METADATA_ROOT && cur !== "." && cur !== path42.dirname(cur)) {
20012
- const parent = path42.dirname(cur);
20013
- const child = path42.basename(cur);
20056
+ while (cur !== METADATA_ROOT && cur !== "." && cur !== path52.dirname(cur)) {
20057
+ const parent = path52.dirname(cur);
20058
+ const child = path52.basename(cur);
20014
20059
  if (!expectedByParent.has(parent)) expectedByParent.set(parent, /* @__PURE__ */ new Set());
20015
20060
  expectedByParent.get(parent).add(child);
20016
20061
  if (parent === METADATA_ROOT) break;
@@ -20018,7 +20063,7 @@ async function pruneMetadataParents(root, markerDirs) {
20018
20063
  }
20019
20064
  }
20020
20065
  for (const [parent, expected] of expectedByParent) {
20021
- const parentAbs = path42.join(root, parent);
20066
+ const parentAbs = path52.join(root, parent);
20022
20067
  let entries;
20023
20068
  try {
20024
20069
  entries = await fs42.readdir(parentAbs, { withFileTypes: true });
@@ -20027,7 +20072,7 @@ async function pruneMetadataParents(root, markerDirs) {
20027
20072
  }
20028
20073
  for (const dirent of entries) {
20029
20074
  if (expected.has(dirent.name)) continue;
20030
- await fs42.rm(path42.join(parentAbs, dirent.name), { recursive: true, force: true });
20075
+ await fs42.rm(path52.join(parentAbs, dirent.name), { recursive: true, force: true });
20031
20076
  }
20032
20077
  }
20033
20078
  }
@@ -20061,7 +20106,7 @@ async function loadWorld(root, opts = {}) {
20061
20106
  const parseErrors = [];
20062
20107
  const intent = await readIntent(root, parseErrors);
20063
20108
  const entity = await readEntity(root, parseErrors);
20064
- const local = await walkLocal(path52.join(root, localDir), root, parseErrors);
20109
+ const local = await walkLocal(path6.join(root, localDir), root, parseErrors);
20065
20110
  return { root, intent, entity, local, parseErrors };
20066
20111
  }
20067
20112
  async function readIntent(root, parseErrors) {
@@ -20131,7 +20176,7 @@ async function walkLocal(dir, root, parseErrors) {
20131
20176
  throw err;
20132
20177
  }
20133
20178
  for (const entry of entries) {
20134
- const full = path52.join(dir, entry.name);
20179
+ const full = path6.join(dir, entry.name);
20135
20180
  if (entry.isDirectory()) {
20136
20181
  out[entry.name] = await walkLocal(full, root, parseErrors);
20137
20182
  } else {
@@ -20142,7 +20187,7 @@ async function walkLocal(dir, root, parseErrors) {
20142
20187
  JSON.parse(content);
20143
20188
  } catch (err) {
20144
20189
  parseErrors.push({
20145
- source: path52.relative(root, full),
20190
+ source: path6.relative(root, full),
20146
20191
  path: full,
20147
20192
  message: err instanceof Error ? err.message : String(err)
20148
20193
  });
@@ -20214,7 +20259,7 @@ function partitionIntent(world) {
20214
20259
  });
20215
20260
  }
20216
20261
  function renderBody2(entry) {
20217
- const repoPath = path7.join(BUNDLE_EXPORTS_DIR, `(Bundle) ${entry.name}`);
20262
+ const repoPath = path8.join(BUNDLE_EXPORTS_DIR, `(Bundle) ${entry.name}`);
20218
20263
  return [
20219
20264
  `# ${entry.name}`,
20220
20265
  "",
@@ -20355,7 +20400,7 @@ function toSnake6(name) {
20355
20400
  return name.trim().replace(/[^A-Za-z0-9]+/g, "_").replace(/^_+|_+$/g, "").toLowerCase();
20356
20401
  }
20357
20402
  function renderMarkerBody(entry) {
20358
- const repoPath = path12.join(WORKSPACE_REPOS_DIR, entry.name);
20403
+ const repoPath = path13.join(WORKSPACE_REPOS_DIR, entry.name);
20359
20404
  return [
20360
20405
  `# ${entry.name}`,
20361
20406
  "",
@@ -20406,7 +20451,7 @@ async function readShardSpecAndErrors(folderPath) {
20406
20451
  return { shardSpec: snapshot?.["shard-spec"] ?? null, errors };
20407
20452
  }
20408
20453
  async function listDevLocalFolders(flintPath) {
20409
- const shardsDir = path13.join(flintPath, SHARDS_DIR);
20454
+ const shardsDir = path14.join(flintPath, SHARDS_DIR);
20410
20455
  let entries;
20411
20456
  try {
20412
20457
  entries = await fs10.readdir(shardsDir, { withFileTypes: true });
@@ -20424,41 +20469,6 @@ async function listDevLocalFolders(flintPath) {
20424
20469
  }
20425
20470
  return out;
20426
20471
  }
20427
- async function healScaffolding(folderPath, entry) {
20428
- for (const sub of SHARD_SPEC_DIRS_SOURCE) {
20429
- await fs10.mkdir(path13.join(folderPath, sub), { recursive: true });
20430
- }
20431
- const yamlPath = path13.join(folderPath, "shard.yaml");
20432
- if (!await fileExists22(yamlPath)) {
20433
- const stub = `shard-spec: "0.2.0"
20434
- version: "0.1.0"
20435
- name: ${entry.name}
20436
- shorthand: ${entry.name}
20437
- description: ""
20438
- `;
20439
- await fs10.writeFile(yamlPath, stub, "utf-8");
20440
- }
20441
- const readmePath = path13.join(folderPath, "README.md");
20442
- if (!await fileExists22(readmePath)) {
20443
- await fs10.writeFile(readmePath, `# ${entry.name}
20444
- `, "utf-8");
20445
- }
20446
- const releasePath = path13.join(folderPath, "RELEASE.md");
20447
- if (!await fileExists22(releasePath)) {
20448
- await fs10.writeFile(releasePath, "# 0.1.0\n\n- Initial shard scaffold\n", "utf-8");
20449
- }
20450
- const migrationsPath = path13.join(folderPath, "MIGRATIONS.md");
20451
- if (!await fileExists22(migrationsPath)) {
20452
- await fs10.writeFile(
20453
- migrationsPath,
20454
- `# Migrations
20455
-
20456
- Migration notes for ${entry.name}. Latest version at top, separated by \`---\`.
20457
- `,
20458
- "utf-8"
20459
- );
20460
- }
20461
- }
20462
20472
  async function directoryExists(p) {
20463
20473
  try {
20464
20474
  const s = await fs10.stat(p);
@@ -20490,7 +20500,7 @@ async function readShardSpecAndErrors2(folderPath) {
20490
20500
  return { shardSpec: snapshot?.["shard-spec"] ?? null, errors };
20491
20501
  }
20492
20502
  async function listDevPrefixedFolders(flintPath, prefix) {
20493
- const shardsDir = path14.join(flintPath, SHARDS_DIR2);
20503
+ const shardsDir = path15.join(flintPath, SHARDS_DIR2);
20494
20504
  let entries;
20495
20505
  try {
20496
20506
  entries = await fs11.readdir(shardsDir, { withFileTypes: true });
@@ -20517,7 +20527,7 @@ async function cloneEntry(flintPath, entry) {
20517
20527
  }
20518
20528
  }
20519
20529
  async function findDevRemoteFolder(flintPath, kebabName) {
20520
- const shardsDir = path14.join(flintPath, SHARDS_DIR2);
20530
+ const shardsDir = path15.join(flintPath, SHARDS_DIR2);
20521
20531
  let entries;
20522
20532
  try {
20523
20533
  entries = await fs11.readdir(shardsDir, { withFileTypes: true });
@@ -20531,7 +20541,7 @@ async function findDevRemoteFolder(flintPath, kebabName) {
20531
20541
  const display = entry.name.slice("(Dev Remote) ".length);
20532
20542
  const displayKebab = display.replace(/[^A-Za-z0-9]+/g, "-").replace(/^-+|-+$/g, "").toLowerCase();
20533
20543
  if (displayKebab === lowered) {
20534
- return path14.join(shardsDir, entry.name);
20544
+ return path15.join(shardsDir, entry.name);
20535
20545
  }
20536
20546
  }
20537
20547
  return null;
@@ -20544,6 +20554,14 @@ async function fileExists3(p) {
20544
20554
  return false;
20545
20555
  }
20546
20556
  }
20557
+ async function directoryExists2(p) {
20558
+ try {
20559
+ const s = await fs11.stat(p);
20560
+ return s.isDirectory();
20561
+ } catch {
20562
+ return false;
20563
+ }
20564
+ }
20547
20565
  function partitionIntent9(world) {
20548
20566
  const shards = world.intent.shards;
20549
20567
  return partitionEntries({
@@ -20575,19 +20593,19 @@ async function uninstallInstalledShard(flintPath, name) {
20575
20593
  }
20576
20594
  async function readSourceState(source, flintRoot) {
20577
20595
  if (!source) return { sourcePath: null, sourceMissing: false, sourceVersion: null };
20578
- const isExternalLocal = source.startsWith("./") || source.startsWith("../") || path15.isAbsolute(source);
20596
+ const isExternalLocal = source.startsWith("./") || source.startsWith("../") || path16.isAbsolute(source);
20579
20597
  if (!isExternalLocal) {
20580
20598
  return { sourcePath: null, sourceMissing: false, sourceVersion: null };
20581
20599
  }
20582
- const sourcePath = path15.isAbsolute(source) ? source : path15.resolve(flintRoot, source);
20583
- const exists32 = await directoryExists2(sourcePath);
20600
+ const sourcePath = path16.isAbsolute(source) ? source : path16.resolve(flintRoot, source);
20601
+ const exists32 = await directoryExists3(sourcePath);
20584
20602
  if (!exists32) {
20585
20603
  return { sourcePath, sourceMissing: true, sourceVersion: null };
20586
20604
  }
20587
20605
  const snap = await readShardManifestSnapshot(sourcePath).catch(() => null);
20588
20606
  return { sourcePath, sourceMissing: false, sourceVersion: snap?.version ?? null };
20589
20607
  }
20590
- async function directoryExists2(p) {
20608
+ async function directoryExists3(p) {
20591
20609
  try {
20592
20610
  const s = await fs12.stat(p);
20593
20611
  return s.isDirectory();
@@ -20595,14 +20613,6 @@ async function directoryExists2(p) {
20595
20613
  return false;
20596
20614
  }
20597
20615
  }
20598
- async function fileExists4(p) {
20599
- try {
20600
- await fs12.stat(p);
20601
- return true;
20602
- } catch {
20603
- return false;
20604
- }
20605
- }
20606
20616
  function isInstalledShapedFolder(name) {
20607
20617
  if (name.startsWith(".")) return false;
20608
20618
  if (name.startsWith("(Dev Remote) ") || name.startsWith("(Dev Local) ")) return false;
@@ -20616,7 +20626,7 @@ function driftOf6(payload) {
20616
20626
  return { feature: INSTALLED_SHARDS_FEATURE_ID, kind: payload.kind, payload };
20617
20627
  }
20618
20628
  async function collectManifests(flintPath) {
20619
- const shardsDir = path16.join(flintPath, SHARDS_DIR4);
20629
+ const shardsDir = path17.join(flintPath, SHARDS_DIR4);
20620
20630
  let entries;
20621
20631
  try {
20622
20632
  entries = await fs13.readdir(shardsDir, { withFileTypes: true });
@@ -20627,7 +20637,7 @@ async function collectManifests(flintPath) {
20627
20637
  for (const entry of entries) {
20628
20638
  if (!entry.isDirectory()) continue;
20629
20639
  if (entry.name.startsWith("(Shards)")) continue;
20630
- const folderPath = path16.join(shardsDir, entry.name);
20640
+ const folderPath = path17.join(shardsDir, entry.name);
20631
20641
  const read = await readShardManifest(folderPath).catch(() => null);
20632
20642
  const manifest = read?.manifest ?? await readShardManifestSnapshot(folderPath).catch(() => null);
20633
20643
  if (!manifest) continue;
@@ -20651,7 +20661,7 @@ function driftOf7(payload) {
20651
20661
  return { feature: FLINT_BUNDLES_FEATURE_ID, kind: payload.kind, payload };
20652
20662
  }
20653
20663
  function renderBody7(args) {
20654
- const repoPath = path17.join(FLINT_BUNDLES_DIR, args.bundleName);
20664
+ const repoPath = path18.join(FLINT_BUNDLES_DIR, args.bundleName);
20655
20665
  return [
20656
20666
  `# ${args.bundleName}`,
20657
20667
  "",
@@ -20674,8 +20684,8 @@ async function copyDir3(src, dst) {
20674
20684
  await fs14.mkdir(dst, { recursive: true });
20675
20685
  const entries = await fs14.readdir(src, { withFileTypes: true });
20676
20686
  for (const entry of entries) {
20677
- const s = path17.join(src, entry.name);
20678
- const d = path17.join(dst, entry.name);
20687
+ const s = path18.join(src, entry.name);
20688
+ const d = path18.join(dst, entry.name);
20679
20689
  if (entry.isDirectory()) await copyDir3(s, d);
20680
20690
  else if (entry.isFile()) await fs14.copyFile(s, d);
20681
20691
  }
@@ -20692,7 +20702,7 @@ function partitionIntent11(world) {
20692
20702
  });
20693
20703
  }
20694
20704
  function renderBody8(entry) {
20695
- const repoPath = path18.join(SOURCE_REPOS_DIR, entry.name);
20705
+ const repoPath = path19.join(SOURCE_REPOS_DIR, entry.name);
20696
20706
  return [
20697
20707
  `# ${entry.name}`,
20698
20708
  "",
@@ -20713,13 +20723,13 @@ function registerAllFeatures() {
20713
20723
  for (const feature of allFeatures) registerFeature(feature);
20714
20724
  registered = true;
20715
20725
  }
20716
- var STANDARD_DIRECTORIES, execAsync3, OBSIDIAN_REPO_URL, OBSIDIAN_WINDOWS_REPO_URL, GLOBAL_CONFIG_FILENAME, execAsync22, DEFAULT_PLATES_ORG, PLATE_SKIP_DIRS, FRONTMATTER_RE, SKIP_DIRS, execAsync32, REFERENCES_LOCAL_FILE, FulfillmentSchema, ReferencesLocalSchema, FALLBACK2, execFileAsync6, TINDERBOX_CONFIG_FILENAME, REQUIRED_FLINT_DIRS, SHARD_SYSTEM_FOLDERS, SHARD_SPEC_DIRS_INSTALLED, SHARD_SPEC_DIRS_SOURCE, OPTIONAL_SHARD_ROOT_DIRS, SHARD_DIRS_ALLOWING_NESTING, ROOT_MARKDOWN_FILES, SHARD_NAME_PATTERN, SHARD_NAME_REGEX, SHARD_SEMVER_REGEX, SHARD_SCRIPT_REGEX, DEV_SHARD_SCRIPT_REGEX, MARKDOWN_FILENAME_LINE_REGEX, MARKDOWN_CODE_FENCE_REGEX, MARKDOWN_COMMENT_REGEX, MARKDOWN_LIFECYCLE_REGEX, SKILL_REFERENCE_REGEX, WORKFLOW_REFERENCE_REGEX, TEMPLATE_REFERENCE_REGEX, KNOWLEDGE_REFERENCE_REGEX, HUMAN_CHECKPOINT_REGEX, TYPE_DEFINITION_PROPERTIES, TEMPLATE_LINK_TARGET_REGEX, VALID_COMMAND_NAME, execAsync4, __dirname2, presetsCache, PROMPTS_BASE_PATH, IntentFrameSchema, EntityFrameSchema, features, KERNEL_FEATURE_ID, EMPTY_INTENT, EMPTY_ENTITY, IDENTITY_FEATURE_ID, IDENTITY_MARKERS_DIR, identity2, BUNDLE_EXPORTS_FEATURE_ID, BUNDLE_EXPORTS_DIR, BUNDLE_EXPORTS_MARKERS_DIR, BundleExportEntrySchema, bundleExports, CODEBASE_REFERENCES_FEATURE_ID, CODEBASE_REFERENCES_MARKERS_DIR, CodebaseReferenceEntrySchema, codebaseReferences, FLINT_BUNDLE_REFERENCES_FEATURE_ID, FLINT_BUNDLE_REFERENCES_MARKERS_DIR, FlintBundleReferenceEntrySchema, flintBundleReferences, FLINT_REFERENCES_FEATURE_ID, FLINT_REFERENCES_MARKERS_DIR, FlintReferenceEntrySchema, flintReferences, LATTICE_REFERENCES_FEATURE_ID, LATTICE_REFERENCES_MARKERS_DIR, LatticeReferenceEntrySchema, latticeReferences, execAsync5, WORKSPACE_REPOS_FEATURE_ID, WORKSPACE_REPOS_DIR, WORKSPACE_REPOS_MARKERS_DIR, WorkspaceRepoEntrySchema, workspaceRepos, NAME, OWNER_REPO, LOCAL_SOURCE, InstalledShardEntrySchema, DevRemoteShardEntrySchema, DevLocalShardEntrySchema, DEV_LOCAL_SHARDS_FEATURE_ID, SHARDS_DIR, REQUIRED_ROOT_FILES, devLocalShards, DEV_REMOTE_SHARDS_FEATURE_ID, SHARDS_DIR2, devRemoteShards, INSTALLED_SHARDS_FEATURE_ID, SHARDS_DIR3, installedShards, SHARD_REPOS_FEATURE_ID, SHARDS_DIR4, shardRepos, FLINT_BUNDLES_FEATURE_ID, FLINT_BUNDLES_DIR, FLINT_BUNDLES_MARKERS_DIR, FlintBundleEntrySchema, flintBundles, execAsync6, SOURCE_REPOS_FEATURE_ID, SOURCE_REPOS_DIR, SOURCE_REPOS_MARKERS_DIR, SourceRepoEntrySchema, sourceRepos, allFeatures, registered;
20726
+ var STANDARD_DIRECTORIES, execAsync3, OBSIDIAN_REPO_URL, OBSIDIAN_WINDOWS_REPO_URL, GLOBAL_CONFIG_FILENAME, execAsync22, DEFAULT_PLATES_ORG, PLATE_SKIP_DIRS, FRONTMATTER_RE, SKIP_DIRS, execAsync32, REFERENCES_LOCAL_FILE, FulfillmentSchema, ReferencesLocalSchema, FALLBACK2, execFileAsync6, TINDERBOX_CONFIG_FILENAME, REQUIRED_FLINT_DIRS, SHARD_SYSTEM_FOLDERS, SHARD_SPEC_DIRS_INSTALLED, SHARD_SPEC_DIRS_SOURCE, OPTIONAL_SHARD_ROOT_DIRS, SHARD_DIRS_ALLOWING_NESTING, ROOT_MARKDOWN_FILES, SHARD_NAME_PATTERN, SHARD_NAME_REGEX, SHARD_SEMVER_REGEX, SHARD_SCRIPT_REGEX, DEV_SHARD_SCRIPT_REGEX, MARKDOWN_FILENAME_LINE_REGEX, MARKDOWN_CODE_FENCE_REGEX, MARKDOWN_COMMENT_REGEX, MARKDOWN_LIFECYCLE_REGEX, SKILL_REFERENCE_REGEX, WORKFLOW_REFERENCE_REGEX, TEMPLATE_REFERENCE_REGEX, KNOWLEDGE_REFERENCE_REGEX, HUMAN_CHECKPOINT_REGEX, TYPE_DEFINITION_PROPERTIES, TEMPLATE_LINK_TARGET_REGEX, VALID_COMMAND_NAME, execAsync4, __dirname2, presetsCache, PROMPTS_BASE_PATH, IntentFrameSchema, EntityFrameSchema, features, KERNEL_FEATURE_ID, EMPTY_INTENT, EMPTY_ENTITY, IDENTITY_FEATURE_ID, IDENTITY_MARKERS_DIR, identity2, BUNDLE_EXPORTS_FEATURE_ID, BUNDLE_EXPORTS_DIR, BUNDLE_EXPORTS_MARKERS_DIR, BundleExportEntrySchema, bundleExports, CODEBASE_REFERENCES_FEATURE_ID, CODEBASE_REFERENCES_MARKERS_DIR, CodebaseReferenceEntrySchema, codebaseReferences, FLINT_BUNDLE_REFERENCES_FEATURE_ID, FLINT_BUNDLE_REFERENCES_MARKERS_DIR, FlintBundleReferenceEntrySchema, flintBundleReferences, FLINT_REFERENCES_FEATURE_ID, FLINT_REFERENCES_MARKERS_DIR, FlintReferenceEntrySchema, flintReferences, LATTICE_REFERENCES_FEATURE_ID, LATTICE_REFERENCES_MARKERS_DIR, LatticeReferenceEntrySchema, latticeReferences, execAsync5, WORKSPACE_REPOS_FEATURE_ID, WORKSPACE_REPOS_DIR, WORKSPACE_REPOS_MARKERS_DIR, WorkspaceRepoEntrySchema, workspaceRepos, NAME, OWNER_REPO, LOCAL_SOURCE, InstalledShardEntrySchema, DevRemoteShardEntrySchema, DevLocalShardEntrySchema, DEV_LOCAL_SHARDS_FEATURE_ID, SHARDS_DIR, REQUIRED_ROOT_FILES, devLocalShards, DEV_REMOTE_SHARDS_FEATURE_ID, SHARDS_DIR2, REQUIRED_ROOT_FILES2, devRemoteShards, INSTALLED_SHARDS_FEATURE_ID, SHARDS_DIR3, installedShards, SHARD_REPOS_FEATURE_ID, SHARDS_DIR4, shardRepos, FLINT_BUNDLES_FEATURE_ID, FLINT_BUNDLES_DIR, FLINT_BUNDLES_MARKERS_DIR, FlintBundleEntrySchema, flintBundles, execAsync6, SOURCE_REPOS_FEATURE_ID, SOURCE_REPOS_DIR, SOURCE_REPOS_MARKERS_DIR, SourceRepoEntrySchema, sourceRepos, allFeatures, registered;
20717
20727
  var init_dist4 = __esm({
20718
20728
  "../../packages/flint/dist/index.js"() {
20719
20729
  "use strict";
20720
- init_chunk_DM3D33H6();
20721
- init_chunk_M6GPU35N();
20722
- init_chunk_4IVT374N();
20730
+ init_chunk_LUKWQDG3();
20731
+ init_chunk_FG5TDNHZ();
20732
+ init_chunk_FSCS2POG();
20723
20733
  init_chunk_STM4NXTT();
20724
20734
  init_dist();
20725
20735
  init_dist();
@@ -20832,7 +20842,7 @@ var init_dist4 = __esm({
20832
20842
  execAsync4 = promisify52(exec4);
20833
20843
  __dirname2 = dirname42(fileURLToPath2(import.meta.url));
20834
20844
  presetsCache = null;
20835
- PROMPTS_BASE_PATH = resolvePackageBasePath("@nuucognition/flint", import.meta.url);
20845
+ PROMPTS_BASE_PATH = resolvePromptsBasePath();
20836
20846
  IntentFrameSchema = external_exports.object({
20837
20847
  flint: external_exports.object({
20838
20848
  name: external_exports.string(),
@@ -20856,7 +20866,7 @@ var init_dist4 = __esm({
20856
20866
  EMPTY_INTENT = { flint: { name: "" } };
20857
20867
  EMPTY_ENTITY = {};
20858
20868
  IDENTITY_FEATURE_ID = "identity";
20859
- IDENTITY_MARKERS_DIR = path6.join("Mesh", "Metadata", "Constitutive", "Identity");
20869
+ IDENTITY_MARKERS_DIR = path7.join("Mesh", "Metadata", "Constitutive", "Identity");
20860
20870
  identity2 = {
20861
20871
  id: IDENTITY_FEATURE_ID,
20862
20872
  healStrategy: { unidentified: "auto", unnamed: "block" },
@@ -20929,7 +20939,7 @@ var init_dist4 = __esm({
20929
20939
  };
20930
20940
  BUNDLE_EXPORTS_FEATURE_ID = "bundle-exports";
20931
20941
  BUNDLE_EXPORTS_DIR = "Exports";
20932
- BUNDLE_EXPORTS_MARKERS_DIR = path7.join(
20942
+ BUNDLE_EXPORTS_MARKERS_DIR = path8.join(
20933
20943
  "Mesh",
20934
20944
  "Metadata",
20935
20945
  "Outputs",
@@ -20951,12 +20961,12 @@ var init_dist4 = __esm({
20951
20961
  return { malformedDeclarations: partitionIntent(world).malformed };
20952
20962
  },
20953
20963
  async readActual(world) {
20954
- const dir = path7.join(world.root, BUNDLE_EXPORTS_DIR);
20964
+ const dir = path8.join(world.root, BUNDLE_EXPORTS_DIR);
20955
20965
  try {
20956
20966
  const items = await fs72.readdir(dir, { withFileTypes: true });
20957
20967
  return items.filter((d) => d.isDirectory() && d.name.startsWith("(Bundle) ")).map((d) => ({
20958
20968
  name: d.name.slice("(Bundle) ".length),
20959
- path: path7.join(dir, d.name)
20969
+ path: path8.join(dir, d.name)
20960
20970
  }));
20961
20971
  } catch (err) {
20962
20972
  if (err.code === "ENOENT") return [];
@@ -20975,7 +20985,7 @@ var init_dist4 = __esm({
20975
20985
  payload: {
20976
20986
  kind: "missing",
20977
20987
  entry,
20978
- targetPath: path7.join(BUNDLE_EXPORTS_DIR, `(Bundle) ${entry.name}`)
20988
+ targetPath: path8.join(BUNDLE_EXPORTS_DIR, `(Bundle) ${entry.name}`)
20979
20989
  }
20980
20990
  });
20981
20991
  }
@@ -20988,7 +20998,7 @@ var init_dist4 = __esm({
20988
20998
  payload: {
20989
20999
  kind: "extra",
20990
21000
  bundleName: a.name,
20991
- targetPath: path7.join(BUNDLE_EXPORTS_DIR, `(Bundle) ${a.name}`)
21001
+ targetPath: path8.join(BUNDLE_EXPORTS_DIR, `(Bundle) ${a.name}`)
20992
21002
  }
20993
21003
  });
20994
21004
  }
@@ -21030,7 +21040,7 @@ var init_dist4 = __esm({
21030
21040
  }
21031
21041
  };
21032
21042
  CODEBASE_REFERENCES_FEATURE_ID = "codebase-references";
21033
- CODEBASE_REFERENCES_MARKERS_DIR = path8.join(
21043
+ CODEBASE_REFERENCES_MARKERS_DIR = path9.join(
21034
21044
  "Mesh",
21035
21045
  "Metadata",
21036
21046
  "References",
@@ -21100,7 +21110,7 @@ var init_dist4 = __esm({
21100
21110
  }
21101
21111
  };
21102
21112
  FLINT_BUNDLE_REFERENCES_FEATURE_ID = "flint-bundle-references";
21103
- FLINT_BUNDLE_REFERENCES_MARKERS_DIR = path9.join(
21113
+ FLINT_BUNDLE_REFERENCES_MARKERS_DIR = path10.join(
21104
21114
  "Mesh",
21105
21115
  "Metadata",
21106
21116
  "References",
@@ -21172,7 +21182,7 @@ var init_dist4 = __esm({
21172
21182
  `Cannot fulfill flint bundle reference "${payload.entry.name}": producing flint "${flint}" not found in ~/.nuucognition/flint/registry.json. Run \`flint register\` inside that flint.`
21173
21183
  );
21174
21184
  }
21175
- const bundlePath = path9.join(producer.path, "Exports", `(Bundle) ${bundle}`);
21185
+ const bundlePath = path10.join(producer.path, "Exports", `(Bundle) ${bundle}`);
21176
21186
  if (!await isDir(bundlePath)) {
21177
21187
  throw new Error(
21178
21188
  `Cannot fulfill flint bundle reference "${payload.entry.name}": producer flint "${flint}" has no export at ${bundlePath}. Run \`flint export bundle ${bundle}\` inside that flint.`
@@ -21200,7 +21210,7 @@ var init_dist4 = __esm({
21200
21210
  }
21201
21211
  };
21202
21212
  FLINT_REFERENCES_FEATURE_ID = "flint-references";
21203
- FLINT_REFERENCES_MARKERS_DIR = path10.join(
21213
+ FLINT_REFERENCES_MARKERS_DIR = path11.join(
21204
21214
  "Mesh",
21205
21215
  "Metadata",
21206
21216
  "References",
@@ -21285,7 +21295,7 @@ var init_dist4 = __esm({
21285
21295
  }
21286
21296
  };
21287
21297
  LATTICE_REFERENCES_FEATURE_ID = "lattice-references";
21288
- LATTICE_REFERENCES_MARKERS_DIR = path11.join(
21298
+ LATTICE_REFERENCES_MARKERS_DIR = path12.join(
21289
21299
  "Mesh",
21290
21300
  "Metadata",
21291
21301
  "References",
@@ -21356,8 +21366,8 @@ var init_dist4 = __esm({
21356
21366
  };
21357
21367
  execAsync5 = promisify62(exec5);
21358
21368
  WORKSPACE_REPOS_FEATURE_ID = "workspace-repos";
21359
- WORKSPACE_REPOS_DIR = path12.join("Workspace", "Repos");
21360
- WORKSPACE_REPOS_MARKERS_DIR = path12.join("Mesh", "Metadata", "Related", "Repos");
21369
+ WORKSPACE_REPOS_DIR = path13.join("Workspace", "Repos");
21370
+ WORKSPACE_REPOS_MARKERS_DIR = path13.join("Mesh", "Metadata", "Related", "Repos");
21361
21371
  WorkspaceRepoEntrySchema = external_exports.object({
21362
21372
  name: external_exports.string().min(1),
21363
21373
  url: external_exports.string().url()
@@ -21377,7 +21387,7 @@ var init_dist4 = __esm({
21377
21387
  return { malformedDeclarations: partitionIntent6(world).malformed };
21378
21388
  },
21379
21389
  async readActual(world) {
21380
- const dir = path12.join(world.root, WORKSPACE_REPOS_DIR);
21390
+ const dir = path13.join(world.root, WORKSPACE_REPOS_DIR);
21381
21391
  let entries;
21382
21392
  try {
21383
21393
  const items = await fs9.readdir(dir, { withFileTypes: true });
@@ -21388,7 +21398,7 @@ var init_dist4 = __esm({
21388
21398
  }
21389
21399
  const repos = [];
21390
21400
  for (const name of entries) {
21391
- const repoPath = path12.join(dir, name);
21401
+ const repoPath = path13.join(dir, name);
21392
21402
  const [originUrl, hasUncommittedChanges2] = await Promise.all([
21393
21403
  readOriginUrl(repoPath),
21394
21404
  readDirty(repoPath)
@@ -21408,7 +21418,7 @@ var init_dist4 = __esm({
21408
21418
  driftOf5({
21409
21419
  kind: "missing",
21410
21420
  entry,
21411
- targetPath: path12.join(WORKSPACE_REPOS_DIR, entry.name)
21421
+ targetPath: path13.join(WORKSPACE_REPOS_DIR, entry.name)
21412
21422
  })
21413
21423
  );
21414
21424
  continue;
@@ -21430,7 +21440,7 @@ var init_dist4 = __esm({
21430
21440
  driftOf5({
21431
21441
  kind: "extra",
21432
21442
  name: cloned.name,
21433
- targetPath: path12.join(WORKSPACE_REPOS_DIR, cloned.name)
21443
+ targetPath: path13.join(WORKSPACE_REPOS_DIR, cloned.name)
21434
21444
  })
21435
21445
  );
21436
21446
  }
@@ -21443,8 +21453,8 @@ var init_dist4 = __esm({
21443
21453
  async apply(drift, world) {
21444
21454
  const payload = drift.payload;
21445
21455
  if (payload.kind !== "missing") return [];
21446
- const target = path12.join(world.root, payload.targetPath);
21447
- await fs9.mkdir(path12.dirname(target), { recursive: true });
21456
+ const target = path13.join(world.root, payload.targetPath);
21457
+ await fs9.mkdir(path13.dirname(target), { recursive: true });
21448
21458
  await execAsync5(
21449
21459
  `git clone ${shellQuote(payload.entry.url)} ${shellQuote(target)}`
21450
21460
  );
@@ -21526,20 +21536,20 @@ var init_dist4 = __esm({
21526
21536
  const intent = partitionIntent7(world).valid;
21527
21537
  const declared = [];
21528
21538
  for (const entry of intent) {
21529
- const resolvedPath = path13.isAbsolute(entry.source) ? entry.source : path13.resolve(world.root, entry.source);
21539
+ const resolvedPath = path14.isAbsolute(entry.source) ? entry.source : path14.resolve(world.root, entry.source);
21530
21540
  const exists32 = await directoryExists(resolvedPath);
21531
- const hasManifest = exists32 ? await fileExists22(path13.join(resolvedPath, "shard.yaml")) : false;
21541
+ const hasManifest = exists32 ? await fileExists22(path14.join(resolvedPath, "shard.yaml")) : false;
21532
21542
  const { shardSpec, errors: manifestErrors } = hasManifest ? await readShardSpecAndErrors(resolvedPath) : { shardSpec: null, errors: [] };
21533
21543
  const missingDirs = [];
21534
21544
  const missingRootFiles = [];
21535
21545
  if (exists32) {
21536
21546
  for (const sub of SHARD_SPEC_DIRS_SOURCE) {
21537
- if (!await directoryExists(path13.join(resolvedPath, sub))) {
21547
+ if (!await directoryExists(path14.join(resolvedPath, sub))) {
21538
21548
  missingDirs.push(sub);
21539
21549
  }
21540
21550
  }
21541
21551
  for (const f of REQUIRED_ROOT_FILES) {
21542
- if (!await fileExists22(path13.join(resolvedPath, f))) {
21552
+ if (!await fileExists22(path14.join(resolvedPath, f))) {
21543
21553
  missingRootFiles.push(f);
21544
21554
  }
21545
21555
  }
@@ -21614,7 +21624,7 @@ var init_dist4 = __esm({
21614
21624
  payload: {
21615
21625
  kind: "orphan",
21616
21626
  name: folderName,
21617
- folderPath: path13.join(SHARDS_DIR, folderName)
21627
+ folderPath: path14.join(SHARDS_DIR, folderName)
21618
21628
  }
21619
21629
  });
21620
21630
  }
@@ -21623,13 +21633,14 @@ var init_dist4 = __esm({
21623
21633
  async apply(drift, world) {
21624
21634
  const payload = drift.payload;
21625
21635
  if (payload.kind === "damaged") {
21626
- await healScaffolding(payload.resolvedPath, payload.entry);
21636
+ await healShardScaffolding(payload.resolvedPath, payload.entry.name);
21627
21637
  }
21628
21638
  return [];
21629
21639
  }
21630
21640
  };
21631
21641
  DEV_REMOTE_SHARDS_FEATURE_ID = "dev-remote-shards";
21632
21642
  SHARDS_DIR2 = "Shards";
21643
+ REQUIRED_ROOT_FILES2 = [...ROOT_MARKDOWN_FILES].filter((f) => f !== "shard.yaml");
21633
21644
  devRemoteShards = {
21634
21645
  id: DEV_REMOTE_SHARDS_FEATURE_ID,
21635
21646
  healStrategy: {
@@ -21651,12 +21662,40 @@ var init_dist4 = __esm({
21651
21662
  for (const entry of intent) {
21652
21663
  const folderPath = await findDevRemoteFolder(world.root, entry.name);
21653
21664
  if (!folderPath) {
21654
- declared.push({ name: entry.name, folderPath: null, hasManifest: false, shardSpec: null, manifestErrors: [] });
21665
+ declared.push({
21666
+ name: entry.name,
21667
+ folderPath: null,
21668
+ hasManifest: false,
21669
+ shardSpec: null,
21670
+ manifestErrors: [],
21671
+ missingDirs: [],
21672
+ missingRootFiles: []
21673
+ });
21655
21674
  continue;
21656
21675
  }
21657
- const hasManifest = await fileExists3(path14.join(folderPath, "shard.yaml"));
21676
+ const hasManifest = await fileExists3(path15.join(folderPath, "shard.yaml"));
21658
21677
  const { shardSpec, errors: manifestErrors } = hasManifest ? await readShardSpecAndErrors2(folderPath) : { shardSpec: null, errors: [] };
21659
- declared.push({ name: entry.name, folderPath, hasManifest, shardSpec, manifestErrors });
21678
+ const missingDirs = [];
21679
+ const missingRootFiles = [];
21680
+ for (const sub of SHARD_SPEC_DIRS_SOURCE) {
21681
+ if (!await directoryExists2(path15.join(folderPath, sub))) {
21682
+ missingDirs.push(sub);
21683
+ }
21684
+ }
21685
+ for (const f of REQUIRED_ROOT_FILES2) {
21686
+ if (!await fileExists3(path15.join(folderPath, f))) {
21687
+ missingRootFiles.push(f);
21688
+ }
21689
+ }
21690
+ declared.push({
21691
+ name: entry.name,
21692
+ folderPath,
21693
+ hasManifest,
21694
+ shardSpec,
21695
+ manifestErrors,
21696
+ missingDirs,
21697
+ missingRootFiles
21698
+ });
21660
21699
  }
21661
21700
  const onDiskFolders = await listDevPrefixedFolders(world.root, "(Dev Remote) ");
21662
21701
  return { declared, onDiskFolders };
@@ -21674,13 +21713,13 @@ var init_dist4 = __esm({
21674
21713
  });
21675
21714
  continue;
21676
21715
  }
21677
- if (!a.hasManifest) {
21716
+ if (!a.hasManifest || a.missingDirs.length > 0 || a.missingRootFiles.length > 0) {
21678
21717
  drifts.push({
21679
21718
  feature: DEV_REMOTE_SHARDS_FEATURE_ID,
21680
21719
  kind: "damaged",
21681
21720
  payload: { kind: "damaged", entry, folderPath: a.folderPath }
21682
21721
  });
21683
- continue;
21722
+ if (!a.hasManifest) continue;
21684
21723
  }
21685
21724
  if (a.manifestErrors.length > 0) {
21686
21725
  drifts.push({
@@ -21716,7 +21755,7 @@ var init_dist4 = __esm({
21716
21755
  payload: {
21717
21756
  kind: "orphan",
21718
21757
  name: folderName,
21719
- folderPath: path14.join(SHARDS_DIR2, folderName)
21758
+ folderPath: path15.join(SHARDS_DIR2, folderName)
21720
21759
  }
21721
21760
  });
21722
21761
  }
@@ -21728,7 +21767,7 @@ var init_dist4 = __esm({
21728
21767
  await cloneEntry(world.root, payload.entry);
21729
21768
  }
21730
21769
  if (payload.kind === "damaged") {
21731
- await cloneEntry(world.root, payload.entry);
21770
+ await healShardScaffolding(payload.folderPath, payload.entry.name);
21732
21771
  }
21733
21772
  return [];
21734
21773
  }
@@ -21754,14 +21793,12 @@ var init_dist4 = __esm({
21754
21793
  const intent = partitionIntent9(world).valid;
21755
21794
  const onDiskNames = [];
21756
21795
  const byKebab = /* @__PURE__ */ new Map();
21757
- const shardsDir = path15.join(world.root, SHARDS_DIR3);
21796
+ const shardsDir = path16.join(world.root, SHARDS_DIR3);
21758
21797
  try {
21759
21798
  const entries = await fs12.readdir(shardsDir, { withFileTypes: true });
21760
21799
  for (const entry of entries) {
21761
21800
  if (!entry.isDirectory()) continue;
21762
21801
  if (!isInstalledShapedFolder(entry.name)) continue;
21763
- const yaml = path15.join(shardsDir, entry.name, "shard.yaml");
21764
- if (!await fileExists4(yaml)) continue;
21765
21802
  onDiskNames.push(entry.name);
21766
21803
  byKebab.set(folderToKebab(entry.name), entry.name);
21767
21804
  }
@@ -21777,7 +21814,7 @@ var init_dist4 = __esm({
21777
21814
  if (!folderName) {
21778
21815
  installed.push({
21779
21816
  name: entry.name,
21780
- folderPath: path15.join(shardsDir, entry.name),
21817
+ folderPath: path16.join(shardsDir, entry.name),
21781
21818
  manifestVersion: null,
21782
21819
  recordedVersion: null,
21783
21820
  manifestErrors: [],
@@ -21787,7 +21824,7 @@ var init_dist4 = __esm({
21787
21824
  });
21788
21825
  continue;
21789
21826
  }
21790
- const folderPath = path15.join(shardsDir, folderName);
21827
+ const folderPath = path16.join(shardsDir, folderName);
21791
21828
  const manifestRead = await readShardManifest(folderPath).catch(() => null);
21792
21829
  const manifestSnap = manifestRead?.manifest ?? await readShardManifestSnapshot(folderPath).catch(() => null);
21793
21830
  const manifestVersion = manifestSnap?.version ?? null;
@@ -21823,7 +21860,7 @@ var init_dist4 = __esm({
21823
21860
  driftOf6({
21824
21861
  kind: "not-installed",
21825
21862
  entry,
21826
- targetPath: path15.join(SHARDS_DIR3, entry.name)
21863
+ targetPath: path16.join(SHARDS_DIR3, entry.name)
21827
21864
  })
21828
21865
  );
21829
21866
  continue;
@@ -21868,7 +21905,7 @@ var init_dist4 = __esm({
21868
21905
  driftOf6({
21869
21906
  kind: "orphan",
21870
21907
  name: folderName,
21871
- folderPath: path15.join(SHARDS_DIR3, folderName)
21908
+ folderPath: path16.join(SHARDS_DIR3, folderName)
21872
21909
  })
21873
21910
  );
21874
21911
  }
@@ -21922,8 +21959,8 @@ var init_dist4 = __esm({
21922
21959
  }
21923
21960
  };
21924
21961
  FLINT_BUNDLES_FEATURE_ID = "flint-bundles";
21925
- FLINT_BUNDLES_DIR = path17.join("Sources", "Bundles");
21926
- FLINT_BUNDLES_MARKERS_DIR = path17.join(
21962
+ FLINT_BUNDLES_DIR = path18.join("Sources", "Bundles");
21963
+ FLINT_BUNDLES_MARKERS_DIR = path18.join(
21927
21964
  "Mesh",
21928
21965
  "Metadata",
21929
21966
  "Sources",
@@ -21950,10 +21987,10 @@ var init_dist4 = __esm({
21950
21987
  return { malformedDeclarations: partitionIntent10(world).malformed };
21951
21988
  },
21952
21989
  async readActual(world) {
21953
- const dir = path17.join(world.root, FLINT_BUNDLES_DIR);
21990
+ const dir = path18.join(world.root, FLINT_BUNDLES_DIR);
21954
21991
  try {
21955
21992
  const items = await fs14.readdir(dir, { withFileTypes: true });
21956
- return items.filter((d) => d.isDirectory()).map((d) => ({ name: d.name, path: path17.join(dir, d.name) }));
21993
+ return items.filter((d) => d.isDirectory()).map((d) => ({ name: d.name, path: path18.join(dir, d.name) }));
21957
21994
  } catch (err) {
21958
21995
  if (err.code === "ENOENT") return [];
21959
21996
  throw err;
@@ -21970,7 +22007,7 @@ var init_dist4 = __esm({
21970
22007
  driftOf7({
21971
22008
  kind: "missing",
21972
22009
  entry,
21973
- targetPath: path17.join(FLINT_BUNDLES_DIR, bundle)
22010
+ targetPath: path18.join(FLINT_BUNDLES_DIR, bundle)
21974
22011
  })
21975
22012
  );
21976
22013
  }
@@ -21981,7 +22018,7 @@ var init_dist4 = __esm({
21981
22018
  driftOf7({
21982
22019
  kind: "extra",
21983
22020
  bundleName: a.name,
21984
- targetPath: path17.join(FLINT_BUNDLES_DIR, a.name)
22021
+ targetPath: path18.join(FLINT_BUNDLES_DIR, a.name)
21985
22022
  })
21986
22023
  );
21987
22024
  }
@@ -21998,15 +22035,15 @@ var init_dist4 = __esm({
21998
22035
  `Cannot import bundle "${payload.entry.name}": producing flint "${flint}" not found in ~/.nuucognition/flint/registry.json. Run \`flint register\` inside that flint.`
21999
22036
  );
22000
22037
  }
22001
- const sourceDir = path17.join(producer.path, "Exports", `(Bundle) ${bundle}`);
22038
+ const sourceDir = path18.join(producer.path, "Exports", `(Bundle) ${bundle}`);
22002
22039
  if (!await isDir2(sourceDir)) {
22003
22040
  throw new Error(
22004
22041
  `Cannot import bundle "${payload.entry.name}": producer flint "${flint}" has no export at ${sourceDir}. Run \`flint export bundle ${bundle}\` inside that flint.`
22005
22042
  );
22006
22043
  }
22007
- const targetDir = path17.join(world.root, payload.targetPath);
22044
+ const targetDir = path18.join(world.root, payload.targetPath);
22008
22045
  await fs14.rm(targetDir, { recursive: true, force: true });
22009
- await fs14.mkdir(path17.dirname(targetDir), { recursive: true });
22046
+ await fs14.mkdir(path18.dirname(targetDir), { recursive: true });
22010
22047
  await copyDir3(sourceDir, targetDir);
22011
22048
  return [];
22012
22049
  },
@@ -22026,8 +22063,8 @@ var init_dist4 = __esm({
22026
22063
  };
22027
22064
  execAsync6 = promisify72(exec6);
22028
22065
  SOURCE_REPOS_FEATURE_ID = "source-repos";
22029
- SOURCE_REPOS_DIR = path18.join("Sources", "Repos");
22030
- SOURCE_REPOS_MARKERS_DIR = path18.join("Mesh", "Metadata", "Sources", "Repos");
22066
+ SOURCE_REPOS_DIR = path19.join("Sources", "Repos");
22067
+ SOURCE_REPOS_MARKERS_DIR = path19.join("Mesh", "Metadata", "Sources", "Repos");
22031
22068
  SourceRepoEntrySchema = external_exports.object({
22032
22069
  name: external_exports.string().min(1),
22033
22070
  url: external_exports.string().url()
@@ -22042,10 +22079,10 @@ var init_dist4 = __esm({
22042
22079
  return { malformedDeclarations: partitionIntent11(world).malformed };
22043
22080
  },
22044
22081
  async readActual(world) {
22045
- const dir = path18.join(world.root, SOURCE_REPOS_DIR);
22082
+ const dir = path19.join(world.root, SOURCE_REPOS_DIR);
22046
22083
  try {
22047
22084
  const items = await fs15.readdir(dir, { withFileTypes: true });
22048
- return items.filter((d) => d.isDirectory()).map((d) => ({ name: d.name, path: path18.join(dir, d.name) }));
22085
+ return items.filter((d) => d.isDirectory()).map((d) => ({ name: d.name, path: path19.join(dir, d.name) }));
22049
22086
  } catch (err) {
22050
22087
  if (err.code === "ENOENT") return [];
22051
22088
  throw err;
@@ -22063,7 +22100,7 @@ var init_dist4 = __esm({
22063
22100
  payload: {
22064
22101
  kind: "missing",
22065
22102
  entry,
22066
- targetPath: path18.join(SOURCE_REPOS_DIR, entry.name)
22103
+ targetPath: path19.join(SOURCE_REPOS_DIR, entry.name)
22067
22104
  }
22068
22105
  });
22069
22106
  }
@@ -22076,7 +22113,7 @@ var init_dist4 = __esm({
22076
22113
  payload: {
22077
22114
  kind: "extra",
22078
22115
  name: repo.name,
22079
- targetPath: path18.join(SOURCE_REPOS_DIR, repo.name)
22116
+ targetPath: path19.join(SOURCE_REPOS_DIR, repo.name)
22080
22117
  }
22081
22118
  });
22082
22119
  }
@@ -22086,12 +22123,12 @@ var init_dist4 = __esm({
22086
22123
  async apply(drift, world) {
22087
22124
  const payload = drift.payload;
22088
22125
  if (payload.kind !== "missing") return [];
22089
- const target = path18.join(world.root, payload.targetPath);
22090
- await fs15.mkdir(path18.dirname(target), { recursive: true });
22126
+ const target = path19.join(world.root, payload.targetPath);
22127
+ await fs15.mkdir(path19.dirname(target), { recursive: true });
22091
22128
  await execAsync6(
22092
22129
  `git clone --depth 1 ${shellQuote2(payload.entry.url)} ${shellQuote2(target)}`
22093
22130
  );
22094
- await fs15.rm(path18.join(target, ".git"), { recursive: true, force: true });
22131
+ await fs15.rm(path19.join(target, ".git"), { recursive: true, force: true });
22095
22132
  return [];
22096
22133
  },
22097
22134
  markers(intent) {
@@ -69672,15 +69709,15 @@ var require_route2 = __commonJS({
69672
69709
  };
69673
69710
  }
69674
69711
  function wrapConversion(toModel, graph) {
69675
- const path29 = [graph[toModel].parent, toModel];
69712
+ const path30 = [graph[toModel].parent, toModel];
69676
69713
  let fn = conversions[graph[toModel].parent][toModel];
69677
69714
  let cur = graph[toModel].parent;
69678
69715
  while (graph[cur].parent) {
69679
- path29.unshift(graph[cur].parent);
69716
+ path30.unshift(graph[cur].parent);
69680
69717
  fn = link5(conversions[graph[cur].parent][cur], fn);
69681
69718
  cur = graph[cur].parent;
69682
69719
  }
69683
- fn.conversion = path29;
69720
+ fn.conversion = path30;
69684
69721
  return fn;
69685
69722
  }
69686
69723
  module.exports = function(fromModel) {
@@ -83379,7 +83416,7 @@ var require_brace_expansion = __commonJS({
83379
83416
 
83380
83417
  // src/index.ts
83381
83418
  import { readFileSync as readFileSync18 } from "fs";
83382
- import { fileURLToPath as fileURLToPath7 } from "url";
83419
+ import { fileURLToPath as fileURLToPath8 } from "url";
83383
83420
  import { dirname as dirname13, join as join49 } from "path";
83384
83421
 
83385
83422
  // ../../../main/packages/cli-core/dist/index.js
@@ -84463,7 +84500,7 @@ var require_command = __commonJS2({
84463
84500
  "use strict";
84464
84501
  var EventEmitter3 = __require2("events").EventEmitter;
84465
84502
  var childProcess2 = __require2("child_process");
84466
- var path29 = __require2("path");
84503
+ var path210 = __require2("path");
84467
84504
  var fs62 = __require2("fs");
84468
84505
  var process112 = __require2("process");
84469
84506
  var { Argument: Argument2, humanReadableArgName } = require_argument();
@@ -85396,9 +85433,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
85396
85433
  let launchWithNode = false;
85397
85434
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
85398
85435
  function findFile(baseDir, baseName) {
85399
- const localBin = path29.resolve(baseDir, baseName);
85436
+ const localBin = path210.resolve(baseDir, baseName);
85400
85437
  if (fs62.existsSync(localBin)) return localBin;
85401
- if (sourceExt.includes(path29.extname(baseName))) return void 0;
85438
+ if (sourceExt.includes(path210.extname(baseName))) return void 0;
85402
85439
  const foundExt = sourceExt.find(
85403
85440
  (ext2) => fs62.existsSync(`${localBin}${ext2}`)
85404
85441
  );
@@ -85416,17 +85453,17 @@ Expecting one of '${allowedValues.join("', '")}'`);
85416
85453
  } catch (err) {
85417
85454
  resolvedScriptPath = this._scriptPath;
85418
85455
  }
85419
- executableDir = path29.resolve(
85420
- path29.dirname(resolvedScriptPath),
85456
+ executableDir = path210.resolve(
85457
+ path210.dirname(resolvedScriptPath),
85421
85458
  executableDir
85422
85459
  );
85423
85460
  }
85424
85461
  if (executableDir) {
85425
85462
  let localFile = findFile(executableDir, executableFile);
85426
85463
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
85427
- const legacyName = path29.basename(
85464
+ const legacyName = path210.basename(
85428
85465
  this._scriptPath,
85429
- path29.extname(this._scriptPath)
85466
+ path210.extname(this._scriptPath)
85430
85467
  );
85431
85468
  if (legacyName !== this._name) {
85432
85469
  localFile = findFile(
@@ -85437,7 +85474,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
85437
85474
  }
85438
85475
  executableFile = localFile || executableFile;
85439
85476
  }
85440
- launchWithNode = sourceExt.includes(path29.extname(executableFile));
85477
+ launchWithNode = sourceExt.includes(path210.extname(executableFile));
85441
85478
  let proc;
85442
85479
  if (process112.platform !== "win32") {
85443
85480
  if (launchWithNode) {
@@ -86277,7 +86314,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
86277
86314
  * @return {Command}
86278
86315
  */
86279
86316
  nameFromFilename(filename) {
86280
- this._name = path29.basename(filename, path29.extname(filename));
86317
+ this._name = path210.basename(filename, path210.extname(filename));
86281
86318
  return this;
86282
86319
  }
86283
86320
  /**
@@ -129343,15 +129380,15 @@ var require_route = __commonJS2({
129343
129380
  };
129344
129381
  }
129345
129382
  function wrapConversion(toModel, graph) {
129346
- const path29 = [graph[toModel].parent, toModel];
129383
+ const path210 = [graph[toModel].parent, toModel];
129347
129384
  let fn = conversions[graph[toModel].parent][toModel];
129348
129385
  let cur = graph[toModel].parent;
129349
129386
  while (graph[cur].parent) {
129350
- path29.unshift(graph[cur].parent);
129387
+ path210.unshift(graph[cur].parent);
129351
129388
  fn = link32(conversions[graph[cur].parent][cur], fn);
129352
129389
  cur = graph[cur].parent;
129353
129390
  }
129354
- fn.conversion = path29;
129391
+ fn.conversion = path210;
129355
129392
  return fn;
129356
129393
  }
129357
129394
  module.exports = function(fromModel) {
@@ -150191,10 +150228,10 @@ async function loadAuth(env22 = "prod") {
150191
150228
  }
150192
150229
  function loadAuthSync(env22 = "prod") {
150193
150230
  ensureNuuDirSync();
150194
- const path29 = authPath(env22);
150195
- if (!existsSync(path29)) return null;
150231
+ const path210 = authPath(env22);
150232
+ if (!existsSync(path210)) return null;
150196
150233
  try {
150197
- return normalizeCredentials(JSON.parse(readFileSync(path29, "utf-8")));
150234
+ return normalizeCredentials(JSON.parse(readFileSync(path210, "utf-8")));
150198
150235
  } catch (error22) {
150199
150236
  if (error22.code === "ENOENT") {
150200
150237
  return null;
@@ -151284,9 +151321,9 @@ function stringify(obj, { maxDepth = 1e3, numbersAsFloat = false } = {}) {
151284
151321
  return str + "\n";
151285
151322
  return str;
151286
151323
  }
151287
- async function readConfigFile(path29) {
151324
+ async function readConfigFile(path210) {
151288
151325
  try {
151289
- const content = await fsReadFile(path29, "utf-8");
151326
+ const content = await fsReadFile(path210, "utf-8");
151290
151327
  return parse(content);
151291
151328
  } catch (error22) {
151292
151329
  if (error22.code === "ENOENT") {
@@ -151295,9 +151332,9 @@ async function readConfigFile(path29) {
151295
151332
  throw error22;
151296
151333
  }
151297
151334
  }
151298
- function readConfigFileSync(path29) {
151335
+ function readConfigFileSync(path210) {
151299
151336
  try {
151300
- const content = fsReadFileSync(path29, "utf-8");
151337
+ const content = fsReadFileSync(path210, "utf-8");
151301
151338
  return parse(content);
151302
151339
  } catch (error22) {
151303
151340
  if (error22.code === "ENOENT") {
@@ -151306,15 +151343,15 @@ function readConfigFileSync(path29) {
151306
151343
  throw error22;
151307
151344
  }
151308
151345
  }
151309
- async function writeConfigFile(path29, data) {
151310
- await mkdir3(dirname2(path29), { recursive: true });
151311
- await fsWriteFile(path29, `${stringify(data)}
151346
+ async function writeConfigFile(path210, data) {
151347
+ await mkdir3(dirname2(path210), { recursive: true });
151348
+ await fsWriteFile(path210, `${stringify(data)}
151312
151349
  `, "utf-8");
151313
151350
  }
151314
- async function setConfigField(path29, key, value) {
151315
- const existing = await readConfigFile(path29) ?? {};
151351
+ async function setConfigField(path210, key, value) {
151352
+ const existing = await readConfigFile(path210) ?? {};
151316
151353
  existing[key] = value;
151317
- await writeConfigFile(path29, existing);
151354
+ await writeConfigFile(path210, existing);
151318
151355
  }
151319
151356
  var CONFIG_FILENAME = "config.toml";
151320
151357
  function getConfigDir(cliname, profile2) {
@@ -155730,9 +155767,9 @@ function compareVersions(left, right) {
155730
155767
  function sortMigrations(migrations3) {
155731
155768
  return [...migrations3].sort((left, right) => compareVersions(left.version, right.version));
155732
155769
  }
155733
- async function readMigrationState(path29) {
155770
+ async function readMigrationState(path210) {
155734
155771
  try {
155735
- const content = await readFile3(path29, "utf-8");
155772
+ const content = await readFile3(path210, "utf-8");
155736
155773
  return JSON.parse(content);
155737
155774
  } catch (error22) {
155738
155775
  if (error22.code === "ENOENT") {
@@ -155741,9 +155778,9 @@ async function readMigrationState(path29) {
155741
155778
  throw error22;
155742
155779
  }
155743
155780
  }
155744
- async function writeMigrationState(path29, state) {
155745
- await mkdir4(dirname3(path29), { recursive: true });
155746
- await writeFile3(path29, `${JSON.stringify(state, null, 2)}
155781
+ async function writeMigrationState(path210, state) {
155782
+ await mkdir4(dirname3(path210), { recursive: true });
155783
+ await writeFile3(path210, `${JSON.stringify(state, null, 2)}
155747
155784
  `, "utf-8");
155748
155785
  }
155749
155786
  async function backupAppDir(cliname, appDir, currentVersion, nextVersion) {
@@ -156134,25 +156171,25 @@ import { promisify as promisify9 } from "util";
156134
156171
  import { homedir as homedir4 } from "os";
156135
156172
  import { access as access6 } from "fs/promises";
156136
156173
  import { createInterface } from "readline";
156137
- function abbreviatePath(path29) {
156174
+ function abbreviatePath(path30) {
156138
156175
  const home = homedir4();
156139
- if (path29.startsWith(home)) {
156140
- return path29.replace(home, "~");
156176
+ if (path30.startsWith(home)) {
156177
+ return path30.replace(home, "~");
156141
156178
  }
156142
- return path29;
156179
+ return path30;
156143
156180
  }
156144
- function expandPath(path29) {
156145
- if (path29.startsWith("~/")) {
156146
- return path29.replace("~", homedir4());
156181
+ function expandPath(path30) {
156182
+ if (path30.startsWith("~/")) {
156183
+ return path30.replace("~", homedir4());
156147
156184
  }
156148
- return path29;
156185
+ return path30;
156149
156186
  }
156150
156187
  function padEnd(str, length) {
156151
156188
  return str.padEnd(length);
156152
156189
  }
156153
- async function checkPathExists(path29) {
156190
+ async function checkPathExists(path30) {
156154
156191
  try {
156155
- await access6(path29);
156192
+ await access6(path30);
156156
156193
  return true;
156157
156194
  } catch {
156158
156195
  return false;
@@ -156476,12 +156513,12 @@ function resolvePath2(flint, fullPath) {
156476
156513
  }
156477
156514
  function printFlint(flint, opts) {
156478
156515
  const { nameColWidth, showStatus, fullPath, indent = " " } = opts;
156479
- const path29 = resolvePath2(flint, fullPath);
156516
+ const path30 = resolvePath2(flint, fullPath);
156480
156517
  const isBroken = showStatus && !flint.valid;
156481
156518
  const tags = formatTags(flint.tags);
156482
156519
  const nameCell = tags ? `${export_pc.bold(flint.name)} ${tags}` : export_pc.bold(flint.name);
156483
156520
  const status = showStatus ? statusBadge(flint) + " " : "";
156484
- const pathColor = isBroken ? export_pc.red(path29) : export_pc.dim(path29);
156521
+ const pathColor = isBroken ? export_pc.red(path30) : export_pc.dim(path30);
156485
156522
  console.log(`${indent}${pad(nameCell, nameColWidth)}${status}${pathColor}`);
156486
156523
  if (flint.description) {
156487
156524
  console.log(`${indent} ${export_pc.dim(truncate2(flint.description, 65))}`);
@@ -156489,10 +156526,10 @@ function printFlint(flint, opts) {
156489
156526
  }
156490
156527
  function printGroupRow(flint, opts) {
156491
156528
  const { nameColWidth, showStatus, fullPath } = opts;
156492
- const path29 = resolvePath2(flint, fullPath);
156529
+ const path30 = resolvePath2(flint, fullPath);
156493
156530
  const isBroken = showStatus && !flint.valid;
156494
156531
  const status = showStatus ? statusBadge(flint) + " " : "";
156495
- const pathColor = isBroken ? export_pc.red(path29) : export_pc.dim(path29);
156532
+ const pathColor = isBroken ? export_pc.red(path30) : export_pc.dim(path30);
156496
156533
  console.log(` ${pad(flint.name, nameColWidth)}${status}${pathColor}`);
156497
156534
  }
156498
156535
  function measureNameCol(flints) {
@@ -156748,17 +156785,17 @@ import { promisify as promisify10 } from "util";
156748
156785
  import { resolve as resolve9 } from "path";
156749
156786
  import { platform as platform5 } from "os";
156750
156787
  var execAsync8 = promisify10(exec8);
156751
- async function openInObsidian(path29) {
156788
+ async function openInObsidian(path30) {
156752
156789
  const os7 = platform5();
156753
156790
  if (os7 === "darwin") {
156754
- await execAsync8(`open -a "Obsidian" "${path29}"`);
156791
+ await execAsync8(`open -a "Obsidian" "${path30}"`);
156755
156792
  } else if (os7 === "win32") {
156756
- await execAsync8(`start "" "${path29}"`);
156793
+ await execAsync8(`start "" "${path30}"`);
156757
156794
  } else {
156758
156795
  try {
156759
- await execAsync8(`obsidian "${path29}"`);
156796
+ await execAsync8(`obsidian "${path30}"`);
156760
156797
  } catch {
156761
- await execAsync8(`xdg-open "${path29}"`);
156798
+ await execAsync8(`xdg-open "${path30}"`);
156762
156799
  }
156763
156800
  }
156764
156801
  }
@@ -158187,11 +158224,11 @@ var resolveCommand = new Command("resolve").description("Resolve a reference to
158187
158224
  // src/commands/references/lattice.ts
158188
158225
  init_dist4();
158189
158226
  import fs16 from "fs";
158190
- import path19 from "path";
158227
+ import path20 from "path";
158191
158228
  import crypto2 from "crypto";
158192
158229
  import { spawn as spawn4 } from "child_process";
158193
158230
  function getRegistryPath() {
158194
- return path19.join(getConfigDir("lattice"), "registry.json");
158231
+ return path20.join(getConfigDir("lattice"), "registry.json");
158195
158232
  }
158196
158233
  function readRegistry() {
158197
158234
  const registryPath = getRegistryPath();
@@ -158205,7 +158242,7 @@ function resolveLattice(name) {
158205
158242
  return entry;
158206
158243
  }
158207
158244
  function readPinsToml(latticeRoot) {
158208
- const pinsPath = path19.join(latticeRoot, "pins.toml");
158245
+ const pinsPath = path20.join(latticeRoot, "pins.toml");
158209
158246
  if (!fs16.existsSync(pinsPath)) return [];
158210
158247
  const content = fs16.readFileSync(pinsPath, "utf-8");
158211
158248
  const records = [];
@@ -158220,7 +158257,7 @@ function readPinsToml(latticeRoot) {
158220
158257
  return records;
158221
158258
  }
158222
158259
  function addToPinsToml(latticeRoot, id, title) {
158223
- const pinsPath = path19.join(latticeRoot, "pins.toml");
158260
+ const pinsPath = path20.join(latticeRoot, "pins.toml");
158224
158261
  const existing = readPinsToml(latticeRoot);
158225
158262
  if (existing.some((p) => p.id === id)) return false;
158226
158263
  existing.push({ id, title });
@@ -158233,7 +158270,7 @@ ${records}
158233
158270
  return true;
158234
158271
  }
158235
158272
  function removeFromPinsToml(latticeRoot, id) {
158236
- const pinsPath = path19.join(latticeRoot, "pins.toml");
158273
+ const pinsPath = path20.join(latticeRoot, "pins.toml");
158237
158274
  const existing = readPinsToml(latticeRoot);
158238
158275
  const pin = existing.find((p) => p.id === id);
158239
158276
  if (!pin) return null;
@@ -158253,10 +158290,10 @@ ${records}
158253
158290
  return pin;
158254
158291
  }
158255
158292
  function generateBaseContextFile(flintRoot, latticeName, lang, sourcePath) {
158256
- const latticeDir = path19.join(flintRoot, "Mesh", "Lattice", latticeName);
158257
- const pinsDir = path19.join(latticeDir, "Pins");
158293
+ const latticeDir = path20.join(flintRoot, "Mesh", "Lattice", latticeName);
158294
+ const pinsDir = path20.join(latticeDir, "Pins");
158258
158295
  fs16.mkdirSync(pinsDir, { recursive: true });
158259
- const contextPath = path19.join(latticeDir, `(Lattice) ${latticeName}.md`);
158296
+ const contextPath = path20.join(latticeDir, `(Lattice) ${latticeName}.md`);
158260
158297
  if (fs16.existsSync(contextPath)) return;
158261
158298
  const id = crypto2.randomUUID();
158262
158299
  const content = `---
@@ -158312,27 +158349,27 @@ flint lattice run ${latticeName} get ${recordId}
158312
158349
  `;
158313
158350
  }
158314
158351
  function materializePin(flintRoot, latticeName, recordId, title) {
158315
- const pinsDir = path19.join(flintRoot, "Mesh", "Lattice", latticeName, "Pins");
158352
+ const pinsDir = path20.join(flintRoot, "Mesh", "Lattice", latticeName, "Pins");
158316
158353
  fs16.mkdirSync(pinsDir, { recursive: true });
158317
158354
  const pinFileName = `(Lattice) ${latticeName} . ${title}.md`;
158318
- const pinFilePath = path19.join(pinsDir, pinFileName);
158355
+ const pinFilePath = path20.join(pinsDir, pinFileName);
158319
158356
  if (fs16.existsSync(pinFilePath)) return false;
158320
158357
  fs16.writeFileSync(pinFilePath, generatePinFileContent(latticeName, recordId, title), "utf-8");
158321
158358
  updateBaseContextPins(flintRoot, latticeName, "add", title);
158322
158359
  return true;
158323
158360
  }
158324
158361
  function dematerializePin(flintRoot, latticeName, title) {
158325
- const pinsDir = path19.join(flintRoot, "Mesh", "Lattice", latticeName, "Pins");
158362
+ const pinsDir = path20.join(flintRoot, "Mesh", "Lattice", latticeName, "Pins");
158326
158363
  const pinFileName = `(Lattice) ${latticeName} . ${title}.md`;
158327
- const pinFilePath = path19.join(pinsDir, pinFileName);
158364
+ const pinFilePath = path20.join(pinsDir, pinFileName);
158328
158365
  if (!fs16.existsSync(pinFilePath)) return false;
158329
158366
  fs16.unlinkSync(pinFilePath);
158330
158367
  updateBaseContextPins(flintRoot, latticeName, "remove", title);
158331
158368
  return true;
158332
158369
  }
158333
158370
  function updateBaseContextPins(flintRoot, latticeName, action, title) {
158334
- const contextDir = path19.join(flintRoot, "Mesh", "Lattice", latticeName);
158335
- const contextPath = path19.join(contextDir, `(Lattice) ${latticeName}.md`);
158371
+ const contextDir = path20.join(flintRoot, "Mesh", "Lattice", latticeName);
158372
+ const contextPath = path20.join(contextDir, `(Lattice) ${latticeName}.md`);
158336
158373
  if (!fs16.existsSync(contextPath)) return;
158337
158374
  const content = fs16.readFileSync(contextPath, "utf-8");
158338
158375
  const wikilink = `- [[(Lattice) ${latticeName} . ${title}]]`;
@@ -158403,7 +158440,7 @@ var latticeCommand = new Command("lattice").description("Manage lattice connecti
158403
158440
  }
158404
158441
  const entry = { path: fulfillment.path, lang: fulfillment.lang, registered: fulfillment.fulfilled };
158405
158442
  const envLocal = {};
158406
- const envPath = path19.join(entry.path, ".env.local");
158443
+ const envPath = path20.join(entry.path, ".env.local");
158407
158444
  if (fs16.existsSync(envPath)) {
158408
158445
  for (const line of fs16.readFileSync(envPath, "utf-8").split("\n")) {
158409
158446
  const trimmed = line.trim();
@@ -158418,7 +158455,7 @@ var latticeCommand = new Command("lattice").description("Manage lattice connecti
158418
158455
  }
158419
158456
  }
158420
158457
  const entryFile = entry.lang === "python" ? "main.py" : "main.js";
158421
- const entryPoint = path19.join(entry.path, entryFile);
158458
+ const entryPoint = path20.join(entry.path, entryFile);
158422
158459
  const cmd = entry.lang === "python" ? "uv" : "node";
158423
158460
  const cmdArgs = entry.lang === "python" ? ["run", "python", entryPoint, fn, ...args] : [entryPoint, fn, ...args];
158424
158461
  const child = spawn4(cmd, cmdArgs, {
@@ -158521,7 +158558,7 @@ var latticeCommand = new Command("lattice").description("Manage lattice connecti
158521
158558
  process.exit(1);
158522
158559
  }
158523
158560
  const pins = readPinsToml(fulfillment.path);
158524
- const pinsDir = path19.join(flintPath, "Mesh", "Lattice", name, "Pins");
158561
+ const pinsDir = path20.join(flintPath, "Mesh", "Lattice", name, "Pins");
158525
158562
  let added = 0;
158526
158563
  let removed = 0;
158527
158564
  for (const pin of pins) {
@@ -158533,7 +158570,7 @@ var latticeCommand = new Command("lattice").description("Manage lattice connecti
158533
158570
  const declaredFiles = new Set(pins.map((p) => `(Lattice) ${name} . ${p.title}.md`));
158534
158571
  for (const file of fs16.readdirSync(pinsDir)) {
158535
158572
  if (file.endsWith(".md") && !declaredFiles.has(file)) {
158536
- fs16.unlinkSync(path19.join(pinsDir, file));
158573
+ fs16.unlinkSync(path20.join(pinsDir, file));
158537
158574
  removed++;
158538
158575
  }
158539
158576
  }
@@ -158552,9 +158589,9 @@ init_dist4();
158552
158589
  import { readFile as readFile13, stat as stat15 } from "fs/promises";
158553
158590
  import { join as join27, basename as basename7 } from "path";
158554
158591
  import { createInterface as createInterface5 } from "readline";
158555
- async function exists3(path29) {
158592
+ async function exists3(path30) {
158556
158593
  try {
158557
- await stat15(path29);
158594
+ await stat15(path30);
158558
158595
  return true;
158559
158596
  } catch {
158560
158597
  return false;
@@ -158835,9 +158872,9 @@ init_dist4();
158835
158872
  import { randomUUID as randomUUID6 } from "crypto";
158836
158873
  import { copyFile as copyFile4, mkdir as mkdir15, writeFile as writeFile11, unlink as unlink3, stat as stat16 } from "fs/promises";
158837
158874
  import { join as join28, basename as basename8, resolve as resolve16 } from "path";
158838
- async function exists4(path29) {
158875
+ async function exists4(path30) {
158839
158876
  try {
158840
- await stat16(path29);
158877
+ await stat16(path30);
158841
158878
  return true;
158842
158879
  } catch {
158843
158880
  return false;
@@ -159967,8 +160004,15 @@ Cannot promote: "${devFolderName}" already exists.`));
159967
160004
  return;
159968
160005
  }
159969
160006
  await rename11(shardPath, devPath);
159970
- await removeShardFromConfig(flintPath, match2.name);
160007
+ await removeShardFromConfig(flintPath, match2.name, { mode: "dev-local" });
159971
160008
  await addShardToConfig(flintPath, devFolderName, `Shards/${devFolderName}`, { mode: "dev-remote", remote: ownerRepo });
160009
+ const tomlAfter = await readFlintToml(flintPath);
160010
+ const installedEntry = tomlAfter?.shards?.installed?.find((e) => e.name === match2.name);
160011
+ const oldDevSource = `./Shards/${match2.folderName}`;
160012
+ if (installedEntry && installedEntry.source === oldDevSource) {
160013
+ installedEntry.source = `./Shards/${devFolderName}`;
160014
+ await writeFlintToml(flintPath, tomlAfter);
160015
+ }
159972
160016
  await updateGitignore(flintPath);
159973
160017
  console.log(export_pc.green(`
159974
160018
  ${export_pc.bold(devFolderName)} promoted to Dev Remote`));
@@ -161730,7 +161774,7 @@ import { createInterface as createInterface7 } from "readline";
161730
161774
  import { spawn as spawn8, spawnSync as spawnSync6 } from "child_process";
161731
161775
  import { existsSync as existsSync17, readFileSync as readFileSync14 } from "fs";
161732
161776
  import { dirname as dirname12, join as join36, resolve as resolvePath3 } from "path";
161733
- import { fileURLToPath as fileURLToPath5, pathToFileURL } from "url";
161777
+ import { fileURLToPath as fileURLToPath6, pathToFileURL } from "url";
161734
161778
 
161735
161779
  // ../../packages/orbh/dist/index.js
161736
161780
  import { existsSync as existsSync22, readFileSync as readFileSync22 } from "fs";
@@ -161775,7 +161819,8 @@ import { randomUUID as randomUUID33 } from "crypto";
161775
161819
  init_dist3();
161776
161820
  import { watch as watch3 } from "fs";
161777
161821
  import { access as access7 } from "fs/promises";
161778
- import path20 from "path";
161822
+ import path21 from "path";
161823
+ import { fileURLToPath as fileURLToPath5 } from "url";
161779
161824
  import { spawn as spawn32, spawnSync as spawnSync5 } from "child_process";
161780
161825
  import { spawn as spawn23, spawnSync as spawnSync4 } from "child_process";
161781
161826
  import { createWriteStream, existsSync as existsSync152, readdirSync as readdirSync7, readFileSync as readFileSync12, renameSync as renameSync2 } from "fs";
@@ -163066,8 +163111,8 @@ function diffEntries(previous, next) {
163066
163111
  newEntries: next.slice(index)
163067
163112
  };
163068
163113
  }
163069
- function loadJsonFile(path29) {
163070
- return JSON.parse(readFileSync32(path29, "utf-8"));
163114
+ function loadJsonFile(path210) {
163115
+ return JSON.parse(readFileSync32(path210, "utf-8"));
163071
163116
  }
163072
163117
  function isSessionInfo(value) {
163073
163118
  return isRecord6(value) && typeof value.id === "string";
@@ -164804,8 +164849,8 @@ function diffEntries2(previous, next) {
164804
164849
  }
164805
164850
  return previous.length === next.length && index === next.length ? [] : next.slice(index);
164806
164851
  }
164807
- function isStreamCapturePath(path29) {
164808
- return path29.endsWith(".jsonl");
164852
+ function isStreamCapturePath(path210) {
164853
+ return path210.endsWith(".jsonl");
164809
164854
  }
164810
164855
  function createOpencodeSessionWatcher(transcriptPath, options3) {
164811
164856
  return new OpencodeSessionWatcher(transcriptPath, options3);
@@ -164948,11 +164993,11 @@ var init_opencode_session_watcher = __esm2({
164948
164993
  };
164949
164994
  }
164950
164995
  });
164951
- function normalizePath(path29) {
164996
+ function normalizePath(path210) {
164952
164997
  try {
164953
- return realpathSync(path29);
164998
+ return realpathSync(path210);
164954
164999
  } catch {
164955
- return path29;
165000
+ return path210;
164956
165001
  }
164957
165002
  }
164958
165003
  function parseStartedAtMs3(startedAt) {
@@ -166428,7 +166473,14 @@ function createOrbhWatcher(sessionsDir, options3 = {}) {
166428
166473
  }
166429
166474
  };
166430
166475
  }
166431
- var PROMPTS_BASE_PATH2 = resolvePackageBasePath("@nuucognition/orbh", import.meta.url);
166476
+ function resolvePromptsBasePath2() {
166477
+ try {
166478
+ return resolvePackageBasePath("@nuucognition/orbh", import.meta.url);
166479
+ } catch {
166480
+ return path21.resolve(path21.dirname(fileURLToPath5(import.meta.url)), "_orbh");
166481
+ }
166482
+ }
166483
+ var PROMPTS_BASE_PATH2 = resolvePromptsBasePath2();
166432
166484
  var DEFAULT_ORBH_COMMAND_PATH = "orbh";
166433
166485
  function normalizePromptLayer(value) {
166434
166486
  return value.trim();
@@ -166440,7 +166492,7 @@ async function loadOrbhPrompt(name, variables = {}) {
166440
166492
  });
166441
166493
  }
166442
166494
  async function tryLoadHarnessPrompt(runtime2, variables) {
166443
- const harnessPath = path20.join(PROMPTS_BASE_PATH2, "prompts", "harness", `${runtime2}.md`);
166495
+ const harnessPath = path21.join(PROMPTS_BASE_PATH2, "prompts", "harness", `${runtime2}.md`);
166444
166496
  try {
166445
166497
  await access7(harnessPath);
166446
166498
  } catch {
@@ -167555,14 +167607,14 @@ init_registry();
167555
167607
  // ../../packages/orbh-server/dist/index.js
167556
167608
  init_dist();
167557
167609
  import { access as access8, readFile as readFile15 } from "fs/promises";
167558
- import path21 from "path";
167610
+ import path23 from "path";
167559
167611
  import { homedir as homedir9 } from "os";
167560
167612
  import { randomUUID as randomUUID8 } from "crypto";
167561
167613
  import { spawn as spawn7 } from "child_process";
167562
167614
  import { readFile as readFile26 } from "fs/promises";
167563
167615
  import Fastify from "fastify";
167564
167616
  import { readFile as readFile36, writeFile as writeFile12, mkdir as mkdir16, rm as rm13 } from "fs/promises";
167565
- import path23 from "path";
167617
+ import path24 from "path";
167566
167618
  var DEFAULT_HOST = "127.0.0.1";
167567
167619
  var DEFAULT_PORT = 13041;
167568
167620
  var DEFAULT_SESSIONS_DIR = ".orbh/sessions";
@@ -167575,7 +167627,7 @@ function expandHome(value) {
167575
167627
  return homedir9();
167576
167628
  }
167577
167629
  if (value.startsWith("~/")) {
167578
- return path21.join(homedir9(), value.slice(2));
167630
+ return path23.join(homedir9(), value.slice(2));
167579
167631
  }
167580
167632
  return value;
167581
167633
  }
@@ -167622,10 +167674,10 @@ async function maybeReadConfig(configPath) {
167622
167674
  return parsed;
167623
167675
  }
167624
167676
  async function loadOrbhConfig(options3 = {}) {
167625
- const cwd = path21.resolve(options3.cwd ?? process.cwd());
167626
- const configPath = options3.configPath ? path21.resolve(cwd, options3.configPath) : path21.join(cwd, DEFAULT_CONFIG_FILENAME);
167677
+ const cwd = path23.resolve(options3.cwd ?? process.cwd());
167678
+ const configPath = options3.configPath ? path23.resolve(cwd, options3.configPath) : path23.join(cwd, DEFAULT_CONFIG_FILENAME);
167627
167679
  const parsed = await maybeReadConfig(configPath);
167628
- const configDir = path21.dirname(configPath);
167680
+ const configDir = path23.dirname(configPath);
167629
167681
  const fileHost = normalizeHost(parsed?.server?.host);
167630
167682
  const filePort = normalizePort(parsed?.server?.port);
167631
167683
  const fileSessionsDir = normalizeSessionsDir(parsed?.sessions?.dir);
@@ -167636,7 +167688,7 @@ async function loadOrbhConfig(options3 = {}) {
167636
167688
  const overrideRuntimes = normalizeRuntimeOverrides(options3.overrides?.runtimes);
167637
167689
  const host = overrideHost ?? fileHost ?? DEFAULT_HOST;
167638
167690
  const port = overridePort ?? filePort ?? DEFAULT_PORT;
167639
- const sessionsDir = path21.resolve(
167691
+ const sessionsDir = path23.resolve(
167640
167692
  configDir,
167641
167693
  expandHome(overrideSessionsDir ?? fileSessionsDir ?? DEFAULT_SESSIONS_DIR)
167642
167694
  );
@@ -169261,15 +169313,15 @@ async function probeCompatibleServer(host, port) {
169261
169313
  return null;
169262
169314
  }
169263
169315
  function getOrbhServerStatePaths(cwd) {
169264
- const serverDir = path23.join(path23.resolve(cwd), SERVER_DIRNAME);
169316
+ const serverDir = path24.join(path24.resolve(cwd), SERVER_DIRNAME);
169265
169317
  return {
169266
- pidFilePath: path23.join(serverDir, PID_FILENAME),
169267
- stateFilePath: path23.join(serverDir, STATE_FILENAME2)
169318
+ pidFilePath: path24.join(serverDir, PID_FILENAME),
169319
+ stateFilePath: path24.join(serverDir, STATE_FILENAME2)
169268
169320
  };
169269
169321
  }
169270
169322
  async function writeOrbhServerState(config, state) {
169271
169323
  const paths = getOrbhServerStatePaths(config.cwd);
169272
- await mkdir16(path23.dirname(paths.pidFilePath), { recursive: true });
169324
+ await mkdir16(path24.dirname(paths.pidFilePath), { recursive: true });
169273
169325
  await writeFile12(paths.pidFilePath, `${state.pid}
169274
169326
  `, "utf-8");
169275
169327
  await writeFile12(paths.stateFilePath, JSON.stringify({
@@ -169375,25 +169427,25 @@ function isRecord9(value) {
169375
169427
  function normalizeKey(value) {
169376
169428
  return value.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
169377
169429
  }
169378
- function keyMatches(path29, key) {
169430
+ function keyMatches(path30, key) {
169379
169431
  const normalizedKey = normalizeKey(key);
169380
169432
  if (!normalizedKey) {
169381
169433
  return false;
169382
169434
  }
169383
- const normalizedPath = normalizeKey(path29);
169435
+ const normalizedPath = normalizeKey(path30);
169384
169436
  if (normalizedPath === normalizedKey || normalizedPath.endsWith(normalizedKey) || normalizedPath === `${normalizedKey}id`) {
169385
169437
  return true;
169386
169438
  }
169387
- return path29.split(".").map((part) => normalizeKey(part)).some((part) => part === normalizedKey || part === `${normalizedKey}id`);
169439
+ return path30.split(".").map((part) => normalizeKey(part)).some((part) => part === normalizedKey || part === `${normalizedKey}id`);
169388
169440
  }
169389
- function collectScalarMatches(value, path29, matches) {
169441
+ function collectScalarMatches(value, path30, matches) {
169390
169442
  if (value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
169391
- matches.push({ path: path29, value: String(value) });
169443
+ matches.push({ path: path30, value: String(value) });
169392
169444
  return;
169393
169445
  }
169394
169446
  if (Array.isArray(value)) {
169395
169447
  value.forEach((entry, index) => {
169396
- collectScalarMatches(entry, `${path29}.${index}`, matches);
169448
+ collectScalarMatches(entry, `${path30}.${index}`, matches);
169397
169449
  });
169398
169450
  return;
169399
169451
  }
@@ -169401,7 +169453,7 @@ function collectScalarMatches(value, path29, matches) {
169401
169453
  return;
169402
169454
  }
169403
169455
  for (const [key, entry] of Object.entries(value)) {
169404
- const nextPath = path29 ? `${path29}.${key}` : key;
169456
+ const nextPath = path30 ? `${path30}.${key}` : key;
169405
169457
  collectScalarMatches(entry, nextPath, matches);
169406
169458
  }
169407
169459
  }
@@ -172749,7 +172801,7 @@ function createStandaloneOrbhCommand() {
172749
172801
  });
172750
172802
  return command;
172751
172803
  }
172752
- var __dirname5 = dirname12(fileURLToPath5(import.meta.url));
172804
+ var __dirname5 = dirname12(fileURLToPath6(import.meta.url));
172753
172805
  var pkg2 = JSON.parse(readFileSync14(join36(__dirname5, "..", "package.json"), "utf-8"));
172754
172806
  function createStandaloneOrbhProgram() {
172755
172807
  return createStandaloneOrbhCommand().version(formatVersion(pkg2.version ?? "0.0.0", "orbh"));
@@ -173909,7 +173961,7 @@ var tinderboxCommand = new Command("tinderbox").description("Orchestrate operati
173909
173961
  // src/commands/server/server.ts
173910
173962
  init_dist4();
173911
173963
  import { createRequire as createRequire2 } from "module";
173912
- import path27 from "path";
173964
+ import path28 from "path";
173913
173965
  import { spawn as spawn11 } from "child_process";
173914
173966
  import { stat as stat21 } from "fs/promises";
173915
173967
 
@@ -174492,8 +174544,8 @@ var FlintServerClient = class {
174492
174544
  }
174493
174545
  return url;
174494
174546
  }
174495
- async requestRaw(method, path29, options3 = {}) {
174496
- const url = this.buildUrl(path29, options3.query);
174547
+ async requestRaw(method, path30, options3 = {}) {
174548
+ const url = this.buildUrl(path30, options3.query);
174497
174549
  const headers = new Headers(this.baseHeaders);
174498
174550
  if (options3.headers) {
174499
174551
  const extra = new Headers(options3.headers);
@@ -174514,8 +174566,8 @@ var FlintServerClient = class {
174514
174566
  }
174515
174567
  return response;
174516
174568
  }
174517
- async requestJson(method, path29, options3 = {}) {
174518
- const response = await this.requestRaw(method, path29, options3);
174569
+ async requestJson(method, path30, options3 = {}) {
174570
+ const response = await this.requestRaw(method, path30, options3);
174519
174571
  return response.json();
174520
174572
  }
174521
174573
  };
@@ -174579,14 +174631,14 @@ import fastifyCors from "@fastify/cors";
174579
174631
  import fastifyStatic from "@fastify/static";
174580
174632
  import { stat as stat53 } from "fs/promises";
174581
174633
  import path72 from "path";
174582
- import { fileURLToPath as fileURLToPath6 } from "url";
174634
+ import { fileURLToPath as fileURLToPath7 } from "url";
174583
174635
  import { join as join54 } from "path";
174584
174636
  import { readdirSync as readdirSync22, existsSync as existsSync43 } from "fs";
174585
174637
  import { randomUUID as randomUUID10, createHash as createHash3 } from "crypto";
174586
174638
  import { EventEmitter as EventEmitter2 } from "events";
174587
174639
  import { readFile as readFile18, stat as stat20 } from "fs/promises";
174588
174640
  import { spawn as spawn10 } from "child_process";
174589
- import path25 from "path";
174641
+ import path26 from "path";
174590
174642
  import chokidar from "chokidar";
174591
174643
  import { glob } from "glob";
174592
174644
 
@@ -175394,11 +175446,11 @@ var qmarksTestNoExtDot = ([$0]) => {
175394
175446
  return (f) => f.length === len && f !== "." && f !== "..";
175395
175447
  };
175396
175448
  var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
175397
- var path24 = {
175449
+ var path25 = {
175398
175450
  win32: { sep: "\\" },
175399
175451
  posix: { sep: "/" }
175400
175452
  };
175401
- var sep4 = defaultPlatform === "win32" ? path24.win32.sep : path24.posix.sep;
175453
+ var sep4 = defaultPlatform === "win32" ? path25.win32.sep : path25.posix.sep;
175402
175454
  minimatch.sep = sep4;
175403
175455
  var GLOBSTAR = /* @__PURE__ */ Symbol("globstar **");
175404
175456
  minimatch.GLOBSTAR = GLOBSTAR;
@@ -176128,7 +176180,7 @@ init_dist();
176128
176180
  import { parse as parseYaml6 } from "yaml";
176129
176181
  import { existsSync as existsSync19, watch as watch4 } from "fs";
176130
176182
  import { stat as stat25 } from "fs/promises";
176131
- import path26 from "path";
176183
+ import path27 from "path";
176132
176184
  import { mkdir as mkdir19, readFile as readFile27, writeFile as writeFile15 } from "fs/promises";
176133
176185
  import { homedir as homedir12 } from "os";
176134
176186
  import { join as join41, resolve as resolve17 } from "path";
@@ -176151,7 +176203,7 @@ import { writeFile as writeFile35, mkdir as mkdir33, readdir as readdir43, readF
176151
176203
  import { join as join46 } from "path";
176152
176204
  var DEFAULT_EVENT_LOG_SIZE = 200;
176153
176205
  function computeRuntimeId(flintPath) {
176154
- const resolved = path25.resolve(flintPath);
176206
+ const resolved = path26.resolve(flintPath);
176155
176207
  return createHash3("sha1").update(resolved).digest("hex").slice(0, 10);
176156
176208
  }
176157
176209
  function createRuntime(options3) {
@@ -176171,8 +176223,8 @@ var FlintRuntimeImpl = class {
176171
176223
  sessionCache = /* @__PURE__ */ new Map();
176172
176224
  startedAt = null;
176173
176225
  constructor(options3) {
176174
- this.flintPath = path25.resolve(options3.flintPath);
176175
- this.hooksPath = options3.hooksPath ? path25.resolve(options3.hooksPath) : path25.join(this.flintPath, "flint-hooks.toml");
176226
+ this.flintPath = path26.resolve(options3.flintPath);
176227
+ this.hooksPath = options3.hooksPath ? path26.resolve(options3.hooksPath) : path26.join(this.flintPath, "flint-hooks.toml");
176176
176228
  this.id = computeRuntimeId(this.flintPath);
176177
176229
  this.eventLogSize = options3.eventLogSize ?? DEFAULT_EVENT_LOG_SIZE;
176178
176230
  this.logger = options3.logger ?? {
@@ -176194,7 +176246,7 @@ var FlintRuntimeImpl = class {
176194
176246
  }
176195
176247
  await this.reloadHooks();
176196
176248
  await this.seedCaches();
176197
- const relativeHooksPath = path25.relative(this.flintPath, this.hooksPath);
176249
+ const relativeHooksPath = path26.relative(this.flintPath, this.hooksPath);
176198
176250
  const watchPatterns = [
176199
176251
  "Mesh/**/*.md",
176200
176252
  ".orbh/sessions/*.json",
@@ -176263,7 +176315,7 @@ var FlintRuntimeImpl = class {
176263
176315
  sessionFiles.map(async (filePath) => {
176264
176316
  const snapshot = await this.readSessionSnapshot(filePath);
176265
176317
  if (snapshot) {
176266
- const sessionId = path25.basename(filePath, ".json");
176318
+ const sessionId = path26.basename(filePath, ".json");
176267
176319
  this.sessionCache.set(sessionId, snapshot);
176268
176320
  }
176269
176321
  })
@@ -176271,7 +176323,7 @@ var FlintRuntimeImpl = class {
176271
176323
  }
176272
176324
  async handleWatchEvent(event, filePath) {
176273
176325
  const normalized = normalizePath2(filePath);
176274
- if (normalized === normalizePath2(path25.relative(this.flintPath, this.hooksPath))) {
176326
+ if (normalized === normalizePath2(path26.relative(this.flintPath, this.hooksPath))) {
176275
176327
  if (event === "change") {
176276
176328
  this.logger.info?.("Reloading hooks config");
176277
176329
  await this.reloadHooks();
@@ -176288,7 +176340,7 @@ var FlintRuntimeImpl = class {
176288
176340
  }
176289
176341
  if (normalized.startsWith(".orbh/sessions/")) {
176290
176342
  if (event === "unlink") {
176291
- const sessionId = path25.basename(normalized, ".json");
176343
+ const sessionId = path26.basename(normalized, ".json");
176292
176344
  this.sessionCache.delete(sessionId);
176293
176345
  return;
176294
176346
  }
@@ -176305,7 +176357,7 @@ var FlintRuntimeImpl = class {
176305
176357
  this.frontmatterCache.set(relativePath, snapshot);
176306
176358
  await this.emitEvent("FileChanged", {
176307
176359
  path: relativePath,
176308
- absolutePath: path25.join(this.flintPath, relativePath),
176360
+ absolutePath: path26.join(this.flintPath, relativePath),
176309
176361
  frontmatter: snapshot,
176310
176362
  previousFrontmatter: previous ?? null
176311
176363
  });
@@ -176315,7 +176367,7 @@ var FlintRuntimeImpl = class {
176315
176367
  if (previous.status !== snapshot.status) {
176316
176368
  await this.emitEvent("StatusChanged", {
176317
176369
  path: relativePath,
176318
- absolutePath: path25.join(this.flintPath, relativePath),
176370
+ absolutePath: path26.join(this.flintPath, relativePath),
176319
176371
  field: "status",
176320
176372
  from: previous.status ?? null,
176321
176373
  to: snapshot.status ?? null,
@@ -176327,7 +176379,7 @@ var FlintRuntimeImpl = class {
176327
176379
  for (const tag3 of addedTags) {
176328
176380
  await this.emitEvent("TagAdded", {
176329
176381
  path: relativePath,
176330
- absolutePath: path25.join(this.flintPath, relativePath),
176382
+ absolutePath: path26.join(this.flintPath, relativePath),
176331
176383
  tag: tag3,
176332
176384
  tags: snapshot.tags
176333
176385
  });
@@ -176335,7 +176387,7 @@ var FlintRuntimeImpl = class {
176335
176387
  for (const tag3 of removedTags) {
176336
176388
  await this.emitEvent("TagRemoved", {
176337
176389
  path: relativePath,
176338
- absolutePath: path25.join(this.flintPath, relativePath),
176390
+ absolutePath: path26.join(this.flintPath, relativePath),
176339
176391
  tag: tag3,
176340
176392
  tags: snapshot.tags
176341
176393
  });
@@ -176346,7 +176398,7 @@ var FlintRuntimeImpl = class {
176346
176398
  if (!snapshot) {
176347
176399
  return;
176348
176400
  }
176349
- const sessionId = path25.basename(relativePath, ".json");
176401
+ const sessionId = path26.basename(relativePath, ".json");
176350
176402
  const previous = this.sessionCache.get(sessionId);
176351
176403
  this.sessionCache.set(sessionId, snapshot);
176352
176404
  if (!previous && snapshot.status === "active") {
@@ -176412,7 +176464,7 @@ var FlintRuntimeImpl = class {
176412
176464
  }
176413
176465
  }
176414
176466
  async readFrontmatterSnapshot(relativePath) {
176415
- const absolutePath = path25.join(this.flintPath, relativePath);
176467
+ const absolutePath = path26.join(this.flintPath, relativePath);
176416
176468
  const content = await safeReadFile(absolutePath);
176417
176469
  if (!content) {
176418
176470
  return null;
@@ -176423,7 +176475,7 @@ var FlintRuntimeImpl = class {
176423
176475
  return { status, tags };
176424
176476
  }
176425
176477
  async readSessionSnapshot(relativePath) {
176426
- const absolutePath = path25.join(this.flintPath, relativePath);
176478
+ const absolutePath = path26.join(this.flintPath, relativePath);
176427
176479
  const content = await safeReadFile(absolutePath);
176428
176480
  if (!content) {
176429
176481
  return null;
@@ -176541,15 +176593,15 @@ async function executeHook(options3) {
176541
176593
  logger.debug?.("Running hook", hook.command);
176542
176594
  await new Promise((resolve23, reject) => {
176543
176595
  const envPathEntries = [
176544
- path25.join(flintPath, "node_modules", ".bin"),
176545
- path25.join(process.cwd(), "node_modules", ".bin"),
176596
+ path26.join(flintPath, "node_modules", ".bin"),
176597
+ path26.join(process.cwd(), "node_modules", ".bin"),
176546
176598
  process.env.PATH
176547
176599
  ].filter(Boolean);
176548
176600
  const child = spawn10(command, {
176549
176601
  cwd: flintPath,
176550
176602
  env: {
176551
176603
  ...process.env,
176552
- PATH: envPathEntries.join(path25.delimiter)
176604
+ PATH: envPathEntries.join(path26.delimiter)
176553
176605
  },
176554
176606
  shell: true,
176555
176607
  stdio: ["pipe", "pipe", "pipe"],
@@ -176617,11 +176669,11 @@ function resolveHookCommand(command, flintPath) {
176617
176669
  const parts = trimmed.split(/\s+/);
176618
176670
  const target = parts[0] ?? "";
176619
176671
  const rest = parts.slice(1).join(" ");
176620
- const extension = path25.extname(target);
176672
+ const extension = path26.extname(target);
176621
176673
  if (!extension) {
176622
176674
  return trimmed;
176623
176675
  }
176624
- const resolvedTarget = path25.isAbsolute(target) ? target : path25.join(flintPath, target);
176676
+ const resolvedTarget = path26.isAbsolute(target) ? target : path26.join(flintPath, target);
176625
176677
  const quotedTarget = quoteIfNeeded(resolvedTarget);
176626
176678
  const suffix = rest ? ` ${rest}` : "";
176627
176679
  if (extension === ".ts") {
@@ -176659,15 +176711,15 @@ var CONTENT_TYPES = {
176659
176711
  ".woff2": "font/woff2"
176660
176712
  };
176661
176713
  function contentTypeFor(filePath) {
176662
- return CONTENT_TYPES[path26.extname(filePath).toLowerCase()] ?? "application/octet-stream";
176714
+ return CONTENT_TYPES[path27.extname(filePath).toLowerCase()] ?? "application/octet-stream";
176663
176715
  }
176664
176716
  function isImmutableAsset(filePath) {
176665
- return /\.[a-f0-9]{8,}\./i.test(path26.basename(filePath));
176717
+ return /\.[a-f0-9]{8,}\./i.test(path27.basename(filePath));
176666
176718
  }
176667
176719
  async function resolveFlintPath5(inputPath) {
176668
- const resolved = path26.resolve(inputPath);
176669
- const flintToml = path26.join(resolved, "flint.toml");
176670
- const flintState = path26.join(resolved, ".flint");
176720
+ const resolved = path27.resolve(inputPath);
176721
+ const flintToml = path27.join(resolved, "flint.toml");
176722
+ const flintState = path27.join(resolved, ".flint");
176671
176723
  const hasConfig = await exists5(flintToml);
176672
176724
  const hasState = await exists5(flintState);
176673
176725
  if (!hasConfig && !hasState) {
@@ -178302,7 +178354,7 @@ async function startFlintServer(options3 = {}) {
178302
178354
  suppressedPaths,
178303
178355
  suppressPath
178304
178356
  };
178305
- const __dirname7 = path72.dirname(fileURLToPath6(import.meta.url));
178357
+ const __dirname7 = path72.dirname(fileURLToPath7(import.meta.url));
178306
178358
  const dashboardDist = path72.resolve(__dirname7, "..", "..", "..", "apps", "flint-dashboard", "dist");
178307
178359
  try {
178308
178360
  await stat53(dashboardDist);
@@ -178610,12 +178662,12 @@ serverCommand.command("dev").description(
178610
178662
  const serverPkgJson = require3.resolve(
178611
178663
  `${FLINT_SERVER_PACKAGE}/package.json`
178612
178664
  );
178613
- serverPkgDir = path27.dirname(serverPkgJson);
178665
+ serverPkgDir = path28.dirname(serverPkgJson);
178614
178666
  } catch {
178615
178667
  console.error(export_pc.red("Error: flint-server package not found."));
178616
178668
  process.exit(1);
178617
178669
  }
178618
- const devEntry = path27.join(serverPkgDir, "src", "dev.ts");
178670
+ const devEntry = path28.join(serverPkgDir, "src", "dev.ts");
178619
178671
  try {
178620
178672
  await stat21(devEntry);
178621
178673
  } catch {
@@ -178737,10 +178789,10 @@ serverCommand.command("list").description("List all running Flint servers from t
178737
178789
  init_dist4();
178738
178790
  import { readFile as readFile19, readdir as readdir17, rm as rm14 } from "fs/promises";
178739
178791
  import { join as join47 } from "path";
178740
- async function exists6(path29) {
178792
+ async function exists6(path30) {
178741
178793
  try {
178742
178794
  const { stat: stat26 } = await import("fs/promises");
178743
- await stat26(path29);
178795
+ await stat26(path30);
178744
178796
  return true;
178745
178797
  } catch {
178746
178798
  return false;
@@ -179338,12 +179390,12 @@ var helperCommand = new Command("helper").description("Helper utilities for Flin
179338
179390
 
179339
179391
  // src/commands/system/runtime.ts
179340
179392
  init_dist4();
179341
- import path28 from "path";
179393
+ import path29 from "path";
179342
179394
  var runtimeCommand = new Command("runtime").description("Manage Flint runtimes");
179343
179395
  runtimeCommand.command("start [flintPath]").description("Start runtime for a Flint").option("--server <url>", "Server URL", "http://127.0.0.1:13040").action(async (flintPath, options3) => {
179344
179396
  const serverUrl = options3.server;
179345
179397
  const client = new FlintServerClient({ baseUrl: serverUrl });
179346
- const resolvedPath = flintPath ? path28.resolve(flintPath) : await findFlintRoot(process.cwd());
179398
+ const resolvedPath = flintPath ? path29.resolve(flintPath) : await findFlintRoot(process.cwd());
179347
179399
  if (!resolvedPath) {
179348
179400
  console.error(export_pc.red("Error: Not inside a Flint workspace. Provide a path or cd into one."));
179349
179401
  process.exit(1);
@@ -179367,7 +179419,7 @@ runtimeCommand.command("stop [runtimeId]").description("Stop a running runtime")
179367
179419
  let id = runtimeId;
179368
179420
  try {
179369
179421
  if (!id) {
179370
- const lookupPath = options3.path ? path28.resolve(options3.path) : await findFlintRoot(process.cwd());
179422
+ const lookupPath = options3.path ? path29.resolve(options3.path) : await findFlintRoot(process.cwd());
179371
179423
  if (!lookupPath) {
179372
179424
  console.error(export_pc.red("Error: Provide a runtime ID or Flint path."));
179373
179425
  process.exit(1);
@@ -179443,7 +179495,7 @@ var whoamiCommand = new Command("whoami").description("Show the current person i
179443
179495
 
179444
179496
  // src/index.ts
179445
179497
  registerAllFeatures();
179446
- var __dirname6 = dirname13(fileURLToPath7(import.meta.url));
179498
+ var __dirname6 = dirname13(fileURLToPath8(import.meta.url));
179447
179499
  var pkg3 = JSON.parse(readFileSync18(join49(__dirname6, "..", "package.json"), "utf-8"));
179448
179500
  var profile = getBuildMode("flint");
179449
179501
  await runCliMigrations({