@nuucognition/flint-cli 0.5.6-dev.6 → 0.5.6-dev.8

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/bin/flint.js CHANGED
@@ -13,6 +13,8 @@ const tsxPath = join(__dirname, '..', 'node_modules', '.bin', 'tsx');
13
13
  // Set dev mode for local development (running from source)
14
14
  const result = spawnSync(tsxPath, [srcEntry, ...process.argv.slice(2)], {
15
15
  stdio: 'inherit',
16
+ shell: true,
17
+ windowsHide: true,
16
18
  env: { ...process.env, FLINT_MODE: 'dev' },
17
19
  });
18
20
 
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-RD3WIRZN.js";
19
19
  import {
20
20
  syncPlateRepos
21
- } from "./chunk-EQTCR2NT.js";
21
+ } from "./chunk-CMEX7263.js";
22
22
  import {
23
23
  addShardToConfig,
24
24
  createFlintJson,
@@ -123,7 +123,7 @@ function parseWorkspaceToml(content) {
123
123
  const config = {};
124
124
  let currentSection = null;
125
125
  let currentPath = null;
126
- for (const line of content.split("\n")) {
126
+ for (const line of content.split(/\r?\n/)) {
127
127
  const trimmed = line.trim();
128
128
  if (!trimmed || trimmed.startsWith("#")) {
129
129
  continue;
@@ -348,7 +348,7 @@ async function findMarkdownFiles(dir) {
348
348
  return results;
349
349
  }
350
350
  function stripLdTags(content) {
351
- const lines = content.split("\n");
351
+ const lines = content.split(/\r?\n/);
352
352
  const filtered = lines.filter((line) => !LD_TAG_PATTERN.test(line));
353
353
  if (filtered.length === lines.length) {
354
354
  return { stripped: content, had: false };
@@ -721,7 +721,7 @@ function isRedundant(bareTag, allTags) {
721
721
  return allTags.some((tag) => tag !== bareTag && isPrefixedTag(tag));
722
722
  }
723
723
  function migrateContent(content) {
724
- const lines = content.split("\n");
724
+ const lines = content.split(/\r?\n/);
725
725
  let fmStart = -1;
726
726
  let fmEnd = -1;
727
727
  for (let i = 0; i < lines.length; i++) {
@@ -835,8 +835,8 @@ var artifactTemplateCleanup = {
835
835
  if (changed) {
836
836
  await ctx.write(relativePath, result);
837
837
  filesModified++;
838
- const origLines = content.split("\n");
839
- const newLines = result.split("\n");
838
+ const origLines = content.split(/\r?\n/);
839
+ const newLines = result.split(/\r?\n/);
840
840
  if (origLines.length !== newLines.length) {
841
841
  tagsStripped += origLines.length - newLines.length;
842
842
  }
@@ -1605,7 +1605,7 @@ function escapeRegExp(value) {
1605
1605
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1606
1606
  }
1607
1607
  function getSectionBody(toml, sectionName) {
1608
- const lines = toml.split("\n");
1608
+ const lines = toml.split(/\r?\n/);
1609
1609
  const header = `[${sectionName}]`;
1610
1610
  const start = lines.findIndex((line) => line.trim() === header);
1611
1611
  if (start === -1) return null;
@@ -1846,7 +1846,7 @@ async function findMarkdownFiles3(dir) {
1846
1846
  return results;
1847
1847
  }
1848
1848
  function parseFrontmatter(content) {
1849
- const lines = content.split("\n");
1849
+ const lines = content.split(/\r?\n/);
1850
1850
  if (lines[0]?.trim() !== "---") {
1851
1851
  return { hasFrontmatter: false, frontmatterLines: [], bodyStart: 0 };
1852
1852
  }
@@ -1892,7 +1892,7 @@ function extractSessionValues(lines, startIdx) {
1892
1892
  function rewriteFrontmatter(content) {
1893
1893
  const { hasFrontmatter, frontmatterLines, bodyStart } = parseFrontmatter(content);
1894
1894
  if (!hasFrontmatter) return null;
1895
- const lines = content.split("\n");
1895
+ const lines = content.split(/\r?\n/);
1896
1896
  const allIds = [];
1897
1897
  const linesToRemove = /* @__PURE__ */ new Set();
1898
1898
  let hasOldFields = false;
@@ -2752,15 +2752,15 @@ async function setIdentity(flintPath, name) {
2752
2752
  async function getIdentity(flintPath) {
2753
2753
  return readIdentityState(flintPath);
2754
2754
  }
2755
- var FRONTMATTER_RE = /^---\n([\s\S]*?)\n---\n?/;
2755
+ var FRONTMATTER_RE = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;
2756
2756
  function parseArtifactFile(content) {
2757
2757
  const match = content.match(FRONTMATTER_RE);
2758
2758
  if (!match) {
2759
- return { frontmatter: {}, body: content };
2759
+ return { frontmatter: {}, body: content.replace(/\r\n/g, "\n") };
2760
2760
  }
2761
2761
  const frontmatterSource = match[1] ?? "";
2762
2762
  const frontmatter = parseYaml(frontmatterSource, { logLevel: "error" }) ?? {};
2763
- const body = content.slice(match[0].length);
2763
+ const body = content.slice(match[0].length).replace(/\r\n/g, "\n");
2764
2764
  return { frontmatter, body };
2765
2765
  }
2766
2766
  function stringifyArtifact(frontmatter, body) {
@@ -3031,7 +3031,7 @@ function rewriteWikilinks(content, oldTitle, newTitle) {
3031
3031
  const targetPath = hashIndex >= 0 ? rawTarget.slice(0, hashIndex) : rawTarget;
3032
3032
  const suffix = hashIndex >= 0 ? rawTarget.slice(hashIndex) : "";
3033
3033
  const normalizedPath = targetPath.replace(/\\/g, "/");
3034
- const segments = normalizedPath.split("/");
3034
+ const segments = normalizedPath.split(/[/\\]/);
3035
3035
  const lastSegment = segments[segments.length - 1] ?? "";
3036
3036
  const bareSegment = getArtifactTitleFromFilename(lastSegment);
3037
3037
  if (bareSegment !== oldTitle) {
@@ -4859,7 +4859,7 @@ async function listRemoteVersionTags(source) {
4859
4859
  try {
4860
4860
  const { stdout } = await execAsync3(`git ls-remote --tags ${url}`, { timeout: 3e4 });
4861
4861
  const tags = [];
4862
- for (const line of stdout.trim().split("\n")) {
4862
+ for (const line of stdout.trim().split(/\r?\n/)) {
4863
4863
  if (!line) continue;
4864
4864
  const ref = line.split(" ")[1];
4865
4865
  if (!ref) continue;
@@ -5935,7 +5935,8 @@ function getGitRemoteUrl(shardPath) {
5935
5935
  return execSync("git remote get-url origin", {
5936
5936
  cwd: shardPath,
5937
5937
  encoding: "utf-8",
5938
- stdio: ["pipe", "pipe", "pipe"]
5938
+ stdio: ["pipe", "pipe", "pipe"],
5939
+ windowsHide: true
5939
5940
  }).trim() || null;
5940
5941
  } catch {
5941
5942
  return null;
@@ -6260,7 +6261,8 @@ async function runShardScript(flintPath, shardIdentifier, scriptName, args = [])
6260
6261
  FLINT_ROOT: resolvedFlintPath,
6261
6262
  FLINT_SHARD: shardFolder
6262
6263
  },
6263
- stdio: ["inherit", "pipe", "pipe"]
6264
+ stdio: ["inherit", "pipe", "pipe"],
6265
+ windowsHide: true
6264
6266
  });
6265
6267
  let stdout = "";
6266
6268
  let stderr = "";
@@ -6456,7 +6458,7 @@ async function getGitStatus(flintPath) {
6456
6458
  const { stdout: statusOut } = await execAsync4("git status --porcelain", {
6457
6459
  cwd: flintPath
6458
6460
  });
6459
- const lines = statusOut.trim().split("\n").filter(Boolean);
6461
+ const lines = statusOut.trim().split(/\r?\n/).filter(Boolean);
6460
6462
  const staged = [];
6461
6463
  const unstaged = [];
6462
6464
  const untracked = [];
@@ -6527,7 +6529,7 @@ async function listTags(cwd, pattern) {
6527
6529
  const args = pattern ? ["tag", "-l", pattern] : ["tag", "-l"];
6528
6530
  const result = await runGit(cwd, args);
6529
6531
  if (!result.success) return [];
6530
- return result.output.trim().split("\n").filter(Boolean);
6532
+ return result.output.trim().split(/\r?\n/).filter(Boolean);
6531
6533
  }
6532
6534
  async function pushTags(cwd, remote = "origin") {
6533
6535
  return runGit(cwd, ["push", remote, "--tags"]);
@@ -6586,7 +6588,7 @@ async function getRebaseBranch(cwd) {
6586
6588
  async function getConflictFiles(cwd) {
6587
6589
  const result = await runGit(cwd, ["diff", "--name-only", "--diff-filter=U"]);
6588
6590
  if (result.success && result.output.trim()) {
6589
- return result.output.trim().split("\n").filter(Boolean);
6591
+ return result.output.trim().split(/\r?\n/).filter(Boolean);
6590
6592
  }
6591
6593
  return [];
6592
6594
  }
@@ -6597,11 +6599,11 @@ async function hasConflictMarkers(cwd, files) {
6597
6599
  if (!filesToCheck || filesToCheck.length === 0) {
6598
6600
  const result = await runGit(cwd, ["diff", "--name-only", "HEAD"]);
6599
6601
  if (result.success && result.output.trim()) {
6600
- filesToCheck = result.output.trim().split("\n").filter(Boolean);
6602
+ filesToCheck = result.output.trim().split(/\r?\n/).filter(Boolean);
6601
6603
  } else {
6602
6604
  const staged = await runGit(cwd, ["diff", "--name-only", "--cached"]);
6603
6605
  if (staged.success && staged.output.trim()) {
6604
- filesToCheck = staged.output.trim().split("\n").filter(Boolean);
6606
+ filesToCheck = staged.output.trim().split(/\r?\n/).filter(Boolean);
6605
6607
  } else {
6606
6608
  return [];
6607
6609
  }
@@ -6836,7 +6838,7 @@ async function syncFlint(flintPath, progress) {
6836
6838
  }
6837
6839
  if (requiredMeshExports.length > 0) {
6838
6840
  const registry = await getFlintRegistry2();
6839
- const { buildExportByName: buildExportByName2, scanExports: scanExports2 } = await import("./exports-VR7XB6MC-5N77WY3S.js");
6841
+ const { buildExportByName: buildExportByName2, scanExports: scanExports2 } = await import("./exports-OZQUMYQI-NXQCDWW6.js");
6840
6842
  for (const ref of requiredMeshExports) {
6841
6843
  const parts = ref.split("/");
6842
6844
  if (parts.length !== 2) {
@@ -6985,7 +6987,7 @@ async function syncFlint(flintPath, progress) {
6985
6987
  const hasSourcePlates = Object.values(plateDeclarations).some((d) => d.source);
6986
6988
  const hasRepoPlates = Object.values(plateDeclarations).some((d) => d.repo);
6987
6989
  if (hasSourcePlates) {
6988
- const { syncDeclaredPlates: syncDeclaredPlates2 } = await import("./plates-XORPQ3RU-JXVRGC23.js");
6990
+ const { syncDeclaredPlates: syncDeclaredPlates2 } = await import("./plates-4TK56CGM-DZB24SP6.js");
6989
6991
  const plateResults = await syncDeclaredPlates2(flintPath, plateDeclarations);
6990
6992
  result.plates = plateResults;
6991
6993
  for (const pr of plateResults) {
@@ -7546,7 +7548,7 @@ function mapClaudeEntry(raw, toolIdMap) {
7546
7548
  return [];
7547
7549
  }
7548
7550
  function parseJsonl(text) {
7549
- return text.split("\n").map((line) => line.trim()).filter((line) => line.length > 0).map((line) => {
7551
+ return text.split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0).map((line) => {
7550
7552
  try {
7551
7553
  return JSON.parse(line);
7552
7554
  } catch {
@@ -7683,7 +7685,7 @@ var TranscriptWatcher = class {
7683
7685
  }
7684
7686
  this.byteOffset = fileSize;
7685
7687
  const text = buffer.toString("utf-8");
7686
- const lines = text.split("\n").filter((line) => line.trim().length > 0);
7688
+ const lines = text.split(/\r?\n/).filter((line) => line.trim().length > 0);
7687
7689
  const newEntries = [];
7688
7690
  for (const line of lines) {
7689
7691
  let raw;
@@ -7,7 +7,7 @@ import {
7
7
  setPlateDeclaration
8
8
  } from "./chunk-LLLVBA4Q.js";
9
9
 
10
- // ../../packages/flint/dist/chunk-K73HFKXL.js
10
+ // ../../packages/flint/dist/chunk-CUQDSELF.js
11
11
  import { spawn } from "child_process";
12
12
  import { exec } from "child_process";
13
13
  import { mkdir, mkdtemp, readdir, readFile, rename, rm, stat, writeFile } from "fs/promises";
@@ -815,7 +815,8 @@ function spawnBufferedProcess(command, args, options) {
815
815
  ...process.env,
816
816
  ...options.env
817
817
  },
818
- stdio: ["ignore", "pipe", "pipe"]
818
+ stdio: ["ignore", "pipe", "pipe"],
819
+ windowsHide: true
819
820
  });
820
821
  let stdout = "";
821
822
  let stderr = "";
@@ -911,7 +912,8 @@ function spawnPlateDevServer(flintPath, plate) {
911
912
  PLATE_ROOT: plate.path,
912
913
  PLATE_NAME: plate.manifest.name
913
914
  },
914
- stdio: "inherit"
915
+ stdio: "inherit",
916
+ windowsHide: true
915
917
  });
916
918
  }
917
919
 
@@ -2,7 +2,7 @@ import {
2
2
  readFlintToml
3
3
  } from "./chunk-LLLVBA4Q.js";
4
4
 
5
- // ../../packages/flint/dist/chunk-NRALZ6JV.js
5
+ // ../../packages/flint/dist/chunk-V7QRWUHU.js
6
6
  import { readdir, readFile, mkdir, writeFile, rm, stat, copyFile } from "fs/promises";
7
7
  import { join, basename, dirname, resolve, relative, sep, extname } from "path";
8
8
  async function exists(path) {
@@ -80,7 +80,7 @@ async function expandEmbeds(content, flintPath, visited = /* @__PURE__ */ new Se
80
80
  newVisited.add(sourcePath);
81
81
  embeddedContent = await expandEmbeds(embeddedContent, flintPath, newVisited);
82
82
  const fileName = basename(sourcePath, ".md");
83
- const quotedContent = embeddedContent.trim().split("\n").map((line) => `> ${line}`).join("\n");
83
+ const quotedContent = embeddedContent.trim().split(/\r?\n/).map((line) => `> ${line}`).join("\n");
84
84
  const formattedEmbed = `> **${fileName}**
85
85
  >
86
86
  ${quotedContent}`;
@@ -180,7 +180,7 @@ import {
180
180
  writeReferencesState,
181
181
  writeSession,
182
182
  writeTinderboxToml
183
- } from "./chunk-JNUGUTRO.js";
183
+ } from "./chunk-4TNIFXOI.js";
184
184
  import {
185
185
  cleanRegistryFile,
186
186
  findFlintByName,
@@ -221,7 +221,7 @@ import {
221
221
  resolveDocument,
222
222
  scanExportEligible,
223
223
  scanExports
224
- } from "./chunk-IUKEMLPH.js";
224
+ } from "./chunk-E35UCJ2H.js";
225
225
  import {
226
226
  buildPlate,
227
227
  clearPlateDevUrl,
@@ -241,7 +241,7 @@ import {
241
241
  syncPlateRepos,
242
242
  updatePlate,
243
243
  updatePlateFromRepo
244
- } from "./chunk-EQTCR2NT.js";
244
+ } from "./chunk-CMEX7263.js";
245
245
  import {
246
246
  FLINT_CONFIG_FILENAME,
247
247
  FLINT_JSON_FILENAME,
@@ -6,7 +6,7 @@ import {
6
6
  resolveDocument,
7
7
  scanExportEligible,
8
8
  scanExports
9
- } from "./chunk-IUKEMLPH.js";
9
+ } from "./chunk-E35UCJ2H.js";
10
10
  import "./chunk-LLLVBA4Q.js";
11
11
  import "./chunk-JSBRDJBE.js";
12
12
  export {
package/dist/index.js CHANGED
@@ -114,7 +114,7 @@ import {
114
114
  updateSession,
115
115
  updateShards,
116
116
  updateSourceRepository
117
- } from "./chunk-JNUGUTRO.js";
117
+ } from "./chunk-4TNIFXOI.js";
118
118
  import {
119
119
  cleanRegistryFile,
120
120
  findFlintByName,
@@ -141,7 +141,7 @@ import {
141
141
  resolveDocument,
142
142
  scanExportEligible,
143
143
  scanExports
144
- } from "./chunk-IUKEMLPH.js";
144
+ } from "./chunk-E35UCJ2H.js";
145
145
  import {
146
146
  buildPlate,
147
147
  getPlate,
@@ -150,7 +150,7 @@ import {
150
150
  listPlateTools,
151
151
  listPlates,
152
152
  runPlateTool
153
- } from "./chunk-EQTCR2NT.js";
153
+ } from "./chunk-CMEX7263.js";
154
154
  import {
155
155
  addExportToConfig,
156
156
  addLatticeDeclaration,
@@ -2656,11 +2656,11 @@ function openObsidianVaultChooser() {
2656
2656
  const uri = "obsidian://choose-vault";
2657
2657
  try {
2658
2658
  if (os2 === "darwin") {
2659
- execSync(`open "${uri}"`, { stdio: "pipe" });
2659
+ execSync(`open "${uri}"`, { stdio: "pipe", windowsHide: true });
2660
2660
  } else if (os2 === "win32") {
2661
- execSync(`start "" "${uri}"`, { stdio: "pipe" });
2661
+ execSync(`start "" "${uri}"`, { stdio: "pipe", windowsHide: true });
2662
2662
  } else {
2663
- execSync(`xdg-open "${uri}"`, { stdio: "pipe" });
2663
+ execSync(`xdg-open "${uri}"`, { stdio: "pipe", windowsHide: true });
2664
2664
  }
2665
2665
  } catch {
2666
2666
  }
@@ -2689,7 +2689,7 @@ Cloning ${pc6.cyan(url)}...
2689
2689
  `);
2690
2690
  tempDir = await mkdtemp(join3(tmpdir(), "flint-clone-"));
2691
2691
  try {
2692
- await execAsync(`git clone "${url}" "${tempDir}"`, { timeout: 12e4 });
2692
+ await execAsync(`git clone "${url}" "${tempDir}"`, { timeout: 12e4, windowsHide: true });
2693
2693
  } catch (err) {
2694
2694
  const message = err instanceof Error ? err.message : String(err);
2695
2695
  throw new Error(`Git clone failed: ${message}`);
@@ -3237,7 +3237,8 @@ Shard not installed: "${shorthand}"`));
3237
3237
  const child = spawn(fullCmd, [], {
3238
3238
  cwd: shardDir,
3239
3239
  stdio: "inherit",
3240
- shell: true
3240
+ shell: true,
3241
+ windowsHide: true
3241
3242
  });
3242
3243
  child.on("close", (code) => {
3243
3244
  process.exit(code ?? 1);
@@ -5722,7 +5723,7 @@ async function openInObsidian(path10) {
5722
5723
  if (os2 === "darwin") {
5723
5724
  await execAsync2(`open -a "Obsidian" "${path10}"`);
5724
5725
  } else if (os2 === "win32") {
5725
- await execAsync2(`start "" "Obsidian" "${path10}"`);
5726
+ await execAsync2(`start "" "${path10}"`);
5726
5727
  } else {
5727
5728
  try {
5728
5729
  await execAsync2(`obsidian "${path10}"`);
@@ -5850,7 +5851,7 @@ function sendNotification(title, message) {
5850
5851
  spawnSync('osascript', [
5851
5852
  '-e',
5852
5853
  'display notification "' + escapeAppleScriptString(message) + '" with title "' + escapeAppleScriptString(title) + '"',
5853
- ], { stdio: 'ignore' });
5854
+ ], { stdio: 'ignore', windowsHide: true });
5854
5855
  } catch {
5855
5856
  // Notification is best-effort
5856
5857
  }
@@ -5860,6 +5861,7 @@ const agentCmd = resolveCommand('claude');
5860
5861
  const child = spawn(agentCmd.cmd, [...agentCmd.prependArgs, ...claudeArgs], {
5861
5862
  cwd: flintPath,
5862
5863
  stdio: ['ignore', 'ignore', 'pipe'],
5864
+ windowsHide: true,
5863
5865
  });
5864
5866
 
5865
5867
  let stderr = '';
@@ -5923,7 +5925,7 @@ function sendNotification(title, message) {
5923
5925
  "-e",
5924
5926
  `display notification "${escapeAppleScriptString(message)}" with title "${escapeAppleScriptString(title)}"`
5925
5927
  ],
5926
- { stdio: "ignore" }
5928
+ { stdio: "ignore", windowsHide: true }
5927
5929
  );
5928
5930
  } catch {
5929
5931
  }
@@ -6073,7 +6075,8 @@ function startDetachedClaudeMonitor(flintPath, sessionId, prompt6, claudeArgs, r
6073
6075
  });
6074
6076
  const monitor = spawn2(process.execPath, ["-e", DETACHED_CLAUDE_MONITOR], {
6075
6077
  cwd: flintPath,
6076
- detached: true,
6078
+ detached: process.platform !== "win32",
6079
+ windowsHide: true,
6077
6080
  stdio: "ignore",
6078
6081
  env: {
6079
6082
  ...process.env,
@@ -6691,7 +6694,7 @@ obsidianCommand.command("update").description("Force pull latest .obsidian from
6691
6694
  }
6692
6695
  try {
6693
6696
  const expectedUrl = getExpectedRepoUrl();
6694
- const currentUrl = execSync2("git remote get-url origin", { cwd: obsidianDir, encoding: "utf-8" }).trim();
6697
+ const currentUrl = execSync2("git remote get-url origin", { cwd: obsidianDir, encoding: "utf-8", windowsHide: true }).trim();
6695
6698
  if (currentUrl !== expectedUrl) {
6696
6699
  console.log(pc18.dim("Detected wrong platform repo. Re-cloning with correct one..."));
6697
6700
  await rm2(obsidianDir, { recursive: true, force: true });
@@ -6699,8 +6702,8 @@ obsidianCommand.command("update").description("Force pull latest .obsidian from
6699
6702
  console.log(pc18.green("Re-cloned .obsidian with correct platform repo."));
6700
6703
  } else {
6701
6704
  console.log(pc18.dim("Fetching latest from remote..."));
6702
- execSync2("git fetch origin", { cwd: obsidianDir, stdio: "pipe" });
6703
- execSync2("git reset --hard origin/main", { cwd: obsidianDir, stdio: "pipe" });
6705
+ execSync2("git fetch origin", { cwd: obsidianDir, stdio: "pipe", windowsHide: true });
6706
+ execSync2("git reset --hard origin/main", { cwd: obsidianDir, stdio: "pipe", windowsHide: true });
6704
6707
  console.log(pc18.green("Updated .obsidian to latest from remote."));
6705
6708
  }
6706
6709
  } catch (err) {
@@ -6726,19 +6729,19 @@ if (isFeatureEnabled(FEATURES, "obsidian.push", resolveRuntimeSync({ cliname: "f
6726
6729
  }
6727
6730
  console.log(pc18.dim("Staging changes..."));
6728
6731
  try {
6729
- execSync2("git add -A", { cwd: obsidianDir, stdio: "pipe" });
6730
- const status = execSync2("git status --porcelain", { cwd: obsidianDir, encoding: "utf-8" });
6732
+ execSync2("git add -A", { cwd: obsidianDir, stdio: "pipe", windowsHide: true });
6733
+ const status = execSync2("git status --porcelain", { cwd: obsidianDir, encoding: "utf-8", windowsHide: true });
6731
6734
  if (!status.trim()) {
6732
6735
  console.log(pc18.yellow("No changes to commit."));
6733
6736
  return;
6734
6737
  }
6735
6738
  console.log(pc18.dim("Committing..."));
6736
- const commitResult = spawnSync2("git", ["commit", "-m", cmdOptions.message], { cwd: obsidianDir, stdio: "pipe" });
6739
+ const commitResult = spawnSync2("git", ["commit", "-m", cmdOptions.message], { cwd: obsidianDir, stdio: "pipe", windowsHide: true });
6737
6740
  if (commitResult.status !== 0) {
6738
6741
  throw new Error(commitResult.stderr?.toString() || "git commit failed");
6739
6742
  }
6740
6743
  console.log(pc18.dim("Pushing to remote..."));
6741
- execSync2("git push origin main", { cwd: obsidianDir, stdio: "pipe" });
6744
+ execSync2("git push origin main", { cwd: obsidianDir, stdio: "pipe", windowsHide: true });
6742
6745
  console.log(pc18.green("Pushed .obsidian changes to remote."));
6743
6746
  } catch (err) {
6744
6747
  const message = err instanceof Error ? err.message : String(err);
@@ -7223,7 +7226,7 @@ repoCommand.command("add").description("Add a plate from a git repo").argument("
7223
7226
  getPlateDeclaration,
7224
7227
  nameFormats,
7225
7228
  updateGitignore: updateGitignore2
7226
- } = await import("./dist-IQXEJ4E7.js");
7229
+ } = await import("./dist-OOF7XLTD.js");
7227
7230
  const { proper, slug } = nameFormats(name);
7228
7231
  const existing = await getPlateDeclaration(flintPath, slug);
7229
7232
  if (existing) {
@@ -7235,7 +7238,7 @@ repoCommand.command("add").description("Add a plate from a git repo").argument("
7235
7238
  Cloning ${url}...`));
7236
7239
  await clonePlateFromRepo(flintPath, slug, url, platePath);
7237
7240
  await addPlateDeclaration(flintPath, slug, platePath, { title: proper });
7238
- const { setPlateRepo } = await import("./dist-IQXEJ4E7.js");
7241
+ const { setPlateRepo } = await import("./dist-OOF7XLTD.js");
7239
7242
  await setPlateRepo(flintPath, slug, url);
7240
7243
  await updateGitignore2(flintPath);
7241
7244
  console.log(pc22.green(`
@@ -7253,7 +7256,7 @@ Added plate: ${pc22.bold(proper)}`));
7253
7256
  repoCommand.command("remove").description("Remove a repo-sourced plate").argument("<name>", "Plate declaration name or slug").option("-p, --path <dir>", "Path to flint (default: auto-detect)").action(async (name, options) => {
7254
7257
  try {
7255
7258
  const flintPath = await resolveFlintPath2(options.path);
7256
- const { removePlateDeclaration, updateGitignore: updateGitignore2 } = await import("./dist-IQXEJ4E7.js");
7259
+ const { removePlateDeclaration, updateGitignore: updateGitignore2 } = await import("./dist-OOF7XLTD.js");
7257
7260
  const { rm: rm6, stat: stat11 } = await import("fs/promises");
7258
7261
  const { join: join24 } = await import("path");
7259
7262
  const plate = await getPlate(flintPath, name);
@@ -7281,7 +7284,7 @@ plateCommand.addCommand(repoCommand);
7281
7284
  plateCommand.command("install").description("Install a Plate from GitHub releases").argument("<name-or-source>", "Plate slug or GitHub owner/repo").option("--version <version>", "Install a specific version").option("-p, --path <dir>", "Path to flint (default: auto-detect)").action(async (nameOrSource, options) => {
7282
7285
  try {
7283
7286
  const flintPath = await resolveFlintPath2(options.path);
7284
- const { installPlate } = await import("./dist-IQXEJ4E7.js");
7287
+ const { installPlate } = await import("./dist-OOF7XLTD.js");
7285
7288
  const result = await installPlate(flintPath, nameOrSource, { version: options.version });
7286
7289
  console.log(pc22.green(`
7287
7290
  Installed plate: ${pc22.bold(result.plate.manifest.title)}`));
@@ -7305,7 +7308,7 @@ Installed plate: ${pc22.bold(result.plate.manifest.title)}`));
7305
7308
  plateCommand.command("update").description("Update installed Plates from GitHub releases").argument("[name]", "Optional plate slug").option("-p, --path <dir>", "Path to flint (default: auto-detect)").action(async (name, options) => {
7306
7309
  try {
7307
7310
  const flintPath = await resolveFlintPath2(options.path);
7308
- const { updatePlate } = await import("./dist-IQXEJ4E7.js");
7311
+ const { updatePlate } = await import("./dist-OOF7XLTD.js");
7309
7312
  const results = await updatePlate(flintPath, name);
7310
7313
  if (results.length === 0) {
7311
7314
  console.log(pc22.dim("\nAll installed plates are already up to date.\n"));
@@ -7325,7 +7328,7 @@ plateCommand.command("update").description("Update installed Plates from GitHub
7325
7328
  plateCommand.command("push").description("Initialize a plate as a git repo, set remote, and push").argument("<name>", "Plate name").argument("<url>", "Git remote URL").option("-p, --path <dir>", "Path to flint (default: auto-detect)").action(async (name, url, options) => {
7326
7329
  try {
7327
7330
  const flintPath = await resolveFlintPath2(options.path);
7328
- const { setPlateRepo } = await import("./dist-IQXEJ4E7.js");
7331
+ const { setPlateRepo } = await import("./dist-OOF7XLTD.js");
7329
7332
  console.log(pc22.dim(`
7330
7333
  Pushing plate "${name}"...`));
7331
7334
  const result = await initPlateRepo(flintPath, name, url);
@@ -7351,7 +7354,7 @@ Pushing plate "${name}"...`));
7351
7354
  plateCommand.command("sync").description("Sync plates that have a repo configured").option("-p, --path <dir>", "Path to flint (default: auto-detect)").action(async (options) => {
7352
7355
  try {
7353
7356
  const flintPath = await resolveFlintPath2(options.path);
7354
- const { getPlateDeclarations, syncPlateRepos } = await import("./dist-IQXEJ4E7.js");
7357
+ const { getPlateDeclarations, syncPlateRepos } = await import("./dist-OOF7XLTD.js");
7355
7358
  const declarations = await getPlateDeclarations(flintPath);
7356
7359
  const hasRepos = Object.values(declarations).some((d) => d.repo);
7357
7360
  if (!hasRepos) {
@@ -7424,7 +7427,7 @@ plateCommand.command("build").description("Run the Plate build script").argument
7424
7427
  plateCommand.command("dev").description("Register or clear a dev server override for a Plate").argument("<name>", "Plate declaration name or manifest name").argument("[url]", "Dev server URL, e.g. http://localhost:5174").option("--off", "Disable the current dev override").option("-p, --path <dir>", "Path to flint (default: auto-detect)").action(async (name, url, options) => {
7425
7428
  try {
7426
7429
  const flintPath = await resolveFlintPath2(options.path);
7427
- const { clearPlateDevUrl, setPlateDevUrl } = await import("./dist-IQXEJ4E7.js");
7430
+ const { clearPlateDevUrl, setPlateDevUrl } = await import("./dist-OOF7XLTD.js");
7428
7431
  if (options.off) {
7429
7432
  await clearPlateDevUrl(flintPath, name);
7430
7433
  console.log(pc22.green(`
@@ -8136,7 +8139,8 @@ var latticeCommand = new Command21("lattice").description("Manage lattice connec
8136
8139
  const child = spawn3(cmd, cmdArgs, {
8137
8140
  cwd: entry.path,
8138
8141
  env: { ...process.env, ...envLocal },
8139
- stdio: "inherit"
8142
+ stdio: "inherit",
8143
+ windowsHide: true
8140
8144
  });
8141
8145
  child.on("close", (code) => process.exit(code ?? 1));
8142
8146
  child.on("error", () => process.exit(1));
@@ -10743,7 +10747,7 @@ var JsonlTranscriptWatcher = class {
10743
10747
  }
10744
10748
  this.byteOffset = fileSize;
10745
10749
  const pendingText = `${this.buffer}${buffer2.toString("utf-8")}`;
10746
- const lines = pendingText.split("\n");
10750
+ const lines = pendingText.split(/\r?\n/);
10747
10751
  this.buffer = lines.pop() ?? "";
10748
10752
  const newEntries = [];
10749
10753
  for (const line of lines) {
@@ -10927,11 +10931,11 @@ function createJsonSessionWatcher(transcriptPath, mapper, options) {
10927
10931
  }
10928
10932
  function isCommandOnPath(name) {
10929
10933
  const cmd = process.platform === "win32" ? "where" : "which";
10930
- return spawnSync3(cmd, [name], { stdio: "ignore" }).status === 0;
10934
+ return spawnSync3(cmd, [name], { stdio: "ignore", windowsHide: true }).status === 0;
10931
10935
  }
10932
10936
  function resolveCommand(name) {
10933
10937
  if (process.platform !== "win32") return { cmd: name, prependArgs: [] };
10934
- const where = spawnSync3("where", [name], { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] });
10938
+ const where = spawnSync3("where", [name], { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"], windowsHide: true });
10935
10939
  const firstLine = (where.stdout ?? "").trim().split(/\r?\n/)[0]?.trim();
10936
10940
  if (where.status !== 0 || !firstLine) return { cmd: name, prependArgs: [] };
10937
10941
  const resolved = firstLine;
@@ -11048,7 +11052,7 @@ function resolveCodexSessionIndex(root, nativeSessionId) {
11048
11052
  if (!existsSync7(indexPath)) {
11049
11053
  return null;
11050
11054
  }
11051
- const lines = readFileSync5(indexPath, "utf-8").split("\n");
11055
+ const lines = readFileSync5(indexPath, "utf-8").split(/\r?\n/);
11052
11056
  for (const line of lines) {
11053
11057
  const trimmed = line.trim();
11054
11058
  if (trimmed.length === 0) {
@@ -11364,7 +11368,8 @@ function resolveGeminiResumeTarget(nativeSessionId, cwd) {
11364
11368
  const result = spawnSync22("gemini", ["--list-sessions"], {
11365
11369
  cwd,
11366
11370
  encoding: "utf-8",
11367
- stdio: ["ignore", "pipe", "pipe"]
11371
+ stdio: ["ignore", "pipe", "pipe"],
11372
+ windowsHide: true
11368
11373
  });
11369
11374
  if (result.status !== 0) {
11370
11375
  return nativeSessionId;
@@ -11761,9 +11766,9 @@ function sendNotification2(session, exitCode) {
11761
11766
  const body = `${session.runtime}:${session.id}`;
11762
11767
  try {
11763
11768
  if (process.platform === "darwin") {
11764
- spawnSync32("osascript", ["-e", `display notification "${body}" with title "${title}"`], { stdio: "ignore" });
11769
+ spawnSync32("osascript", ["-e", `display notification "${body}" with title "${title}"`], { stdio: "ignore", windowsHide: true });
11765
11770
  } else if (process.platform === "linux") {
11766
- spawnSync32("notify-send", [title, body], { stdio: "ignore" });
11771
+ spawnSync32("notify-send", [title, body], { stdio: "ignore", windowsHide: true });
11767
11772
  }
11768
11773
  } catch {
11769
11774
  }
@@ -11860,7 +11865,7 @@ async function spawnHarnessProcess(options) {
11860
11865
  const resolved = resolveCommand(commandName);
11861
11866
  const child = spawn4(resolved.cmd, [...resolved.prependArgs, ...harness.buildSpawnArgs(options.config)], {
11862
11867
  cwd: options.cwd,
11863
- detached: true,
11868
+ detached: process.platform !== "win32",
11864
11869
  windowsHide: true,
11865
11870
  stdio: ["ignore", "ignore", "pipe"],
11866
11871
  env: buildHarnessSpawnEnv(options.cwd, options.sessionId)
@@ -13928,7 +13933,8 @@ async function executeHook(options) {
13928
13933
  PATH: envPathEntries.join(path4.delimiter)
13929
13934
  },
13930
13935
  shell: true,
13931
- stdio: ["pipe", "pipe", "pipe"]
13936
+ stdio: ["pipe", "pipe", "pipe"],
13937
+ windowsHide: true
13932
13938
  });
13933
13939
  let stdout = "";
13934
13940
  let stderr = "";
@@ -15042,7 +15048,7 @@ function registerOrbhRoutes(app, ctx, options) {
15042
15048
  const resolved = resolveCommand(harness.name);
15043
15049
  const child = spawn22(resolved.cmd, [...resolved.prependArgs, ...args], {
15044
15050
  cwd: ctx.flintPath,
15045
- detached: true,
15051
+ detached: process.platform !== "win32",
15046
15052
  windowsHide: true,
15047
15053
  stdio: ["ignore", "ignore", "pipe"],
15048
15054
  env: buildHarnessSpawnEnv(ctx.flintPath, session.id)
@@ -16787,7 +16793,8 @@ serverCommand.command("dev").description("Start the server in dev mode with auto
16787
16793
  const child = spawn6("tsx", ["watch", devEntry], {
16788
16794
  env,
16789
16795
  stdio: "inherit",
16790
- cwd: serverPkgDir
16796
+ cwd: serverPkgDir,
16797
+ windowsHide: true
16791
16798
  });
16792
16799
  child.on("exit", (code) => process.exit(code ?? 0));
16793
16800
  process.on("SIGTERM", () => child.kill("SIGTERM"));
@@ -17100,7 +17107,7 @@ async function exportCodexSession(flintPath, sessionId, startedAt) {
17100
17107
  // src/commands/code.ts
17101
17108
  function sessionReferencedInMesh(flintPath, sessionId) {
17102
17109
  try {
17103
- execSync3(`grep -r "${sessionId}" "${join14(flintPath, "Mesh")}" --include="*.md" -l`, { stdio: "pipe" });
17110
+ execSync3(`grep -r "${sessionId}" "${join14(flintPath, "Mesh")}" --include="*.md" -l`, { stdio: "pipe", windowsHide: true });
17104
17111
  return true;
17105
17112
  } catch {
17106
17113
  return false;
@@ -17181,7 +17188,8 @@ async function bootstrapCodexSession(cwd, initPrompt) {
17181
17188
  const codexCmd = resolveCommand("codex");
17182
17189
  const proc = spawn7(codexCmd.cmd, [...codexCmd.prependArgs, "app-server"], {
17183
17190
  stdio: ["pipe", "pipe", "pipe"],
17184
- cwd
17191
+ cwd,
17192
+ windowsHide: true
17185
17193
  });
17186
17194
  const rl = createInterface5({ input: proc.stdout });
17187
17195
  const send = (msg) => proc.stdin.write(`${JSON.stringify(msg)}
@@ -17267,7 +17275,8 @@ codeCommand.command("claude").description("Open Claude Code TUI").option("-p, --
17267
17275
  const claudeCmd = resolveCommand("claude");
17268
17276
  const child = spawn7(claudeCmd.cmd, [...claudeCmd.prependArgs, ...args], {
17269
17277
  cwd: flintPath,
17270
- stdio: "inherit"
17278
+ stdio: "inherit",
17279
+ windowsHide: true
17271
17280
  });
17272
17281
  child.on("error", (err) => {
17273
17282
  if (err.code === "ENOENT") {
@@ -17343,7 +17352,8 @@ codeCommand.command("codex").description("Open Codex TUI with session tracking")
17343
17352
  resumePrompt
17344
17353
  ], {
17345
17354
  cwd: flintPath,
17346
- stdio: "inherit"
17355
+ stdio: "inherit",
17356
+ windowsHide: true
17347
17357
  });
17348
17358
  child.on("error", (err) => {
17349
17359
  console.error(pc29.red(`Error: ${err.message}`));
@@ -17438,6 +17448,7 @@ codeCommand.command("gemini").description("Open Gemini CLI with Orbh session tra
17438
17448
  const child = spawn7(geminiCmd.cmd, [...geminiCmd.prependArgs, ...args], {
17439
17449
  cwd: flintPath,
17440
17450
  stdio: "inherit",
17451
+ windowsHide: true,
17441
17452
  env: { ...process.env, ORBH_SESSION_ID: session.id }
17442
17453
  });
17443
17454
  if (child.pid) {
@@ -17877,7 +17888,7 @@ var updateCommand = new Command29("update").description("Update flint-cli to the
17877
17888
  console.log(` Installing ${PACKAGE_NAME}@latest...`);
17878
17889
  console.log();
17879
17890
  try {
17880
- execSync4(`npm install -g ${PACKAGE_NAME}@latest`, { stdio: "inherit" });
17891
+ execSync4(`npm install -g ${PACKAGE_NAME}@latest`, { stdio: "inherit", windowsHide: true });
17881
17892
  console.log();
17882
17893
  console.log(pc34.green(` \u2713 Updated to ${latestVersion}`));
17883
17894
  } catch {
@@ -17978,7 +17989,7 @@ var sendCommand = new Command30("send").description("Send files to another Flint
17978
17989
  console.log();
17979
17990
  let sourceFlintName = "Unknown";
17980
17991
  try {
17981
- const { readFlintToml: readFlintToml3 } = await import("./dist-IQXEJ4E7.js");
17992
+ const { readFlintToml: readFlintToml3 } = await import("./dist-OOF7XLTD.js");
17982
17993
  const toml = await readFlintToml3(flintPath);
17983
17994
  if (toml?.flint?.name) {
17984
17995
  sourceFlintName = toml.flint.name;
@@ -19639,7 +19650,7 @@ async function resolveCtx(optionPath) {
19639
19650
  }
19640
19651
  function sessionReferencedInMesh2(flintPath, sessionId) {
19641
19652
  try {
19642
- execSync5(`grep -r "${sessionId}" "${join19(flintPath, "Mesh")}" --include="*.md" -l`, { stdio: "pipe" });
19653
+ execSync5(`grep -r "${sessionId}" "${join19(flintPath, "Mesh")}" --include="*.md" -l`, { stdio: "pipe", windowsHide: true });
19643
19654
  return true;
19644
19655
  } catch {
19645
19656
  return false;
@@ -19696,9 +19707,9 @@ function escapeAS(v) {
19696
19707
  function notify(title, message) {
19697
19708
  try {
19698
19709
  if (process.platform === 'darwin') {
19699
- spawnSync('osascript', ['-e', 'display notification "' + escapeAS(message) + '" with title "' + escapeAS(title) + '"'], { stdio: 'ignore' });
19710
+ spawnSync('osascript', ['-e', 'display notification "' + escapeAS(message) + '" with title "' + escapeAS(title) + '"'], { stdio: 'ignore', windowsHide: true });
19700
19711
  } else if (process.platform === 'linux') {
19701
- spawnSync('notify-send', [title, message], { stdio: 'ignore' });
19712
+ spawnSync('notify-send', [title, message], { stdio: 'ignore', windowsHide: true });
19702
19713
  }
19703
19714
  } catch {}
19704
19715
  }
@@ -19707,7 +19718,7 @@ function notify(title, message) {
19707
19718
  let spawnCmd = command;
19708
19719
  let spawnArgs = args;
19709
19720
  if (process.platform === 'win32') {
19710
- const where = spawnSync('where', [command], { encoding: 'utf-8', stdio: ['ignore', 'pipe', 'ignore'] });
19721
+ const where = spawnSync('where', [command], { encoding: 'utf-8', stdio: ['ignore', 'pipe', 'ignore'], windowsHide: true });
19711
19722
  if (where.status === 0 && where.stdout) {
19712
19723
  const resolved = where.stdout.trim().split(/\r?\n/)[0].trim();
19713
19724
  if (resolved.toLowerCase().endsWith('.cmd')) {
@@ -20008,7 +20019,7 @@ function startDetachedMonitor(sessionsDir, sessionId, cwd, command, args) {
20008
20019
  const config = JSON.stringify({ sessionPath, cwd, command, args });
20009
20020
  const monitor = spawn8(process.execPath, ["-e", DETACHED_ORB_MONITOR], {
20010
20021
  cwd,
20011
- detached: true,
20022
+ detached: process.platform !== "win32",
20012
20023
  windowsHide: true,
20013
20024
  stdio: "ignore",
20014
20025
  env: { ...process.env, ORBH_MONITOR_CONFIG: config, ORBH_SESSION_ID: sessionId }
@@ -20272,6 +20283,7 @@ ${prompt6}` : initPrompt;
20272
20283
  const child = spawn8(spawnCommand, spawnArgs, {
20273
20284
  cwd: flintPath,
20274
20285
  stdio: "inherit",
20286
+ windowsHide: true,
20275
20287
  env: { ...process.env, ORBH_SESSION_ID: session.id }
20276
20288
  });
20277
20289
  if (child.pid) {
@@ -17,7 +17,7 @@ import {
17
17
  syncPlateRepos,
18
18
  updatePlate,
19
19
  updatePlateFromRepo
20
- } from "./chunk-EQTCR2NT.js";
20
+ } from "./chunk-CMEX7263.js";
21
21
  import "./chunk-LLLVBA4Q.js";
22
22
  import "./chunk-JSBRDJBE.js";
23
23
  export {
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "@nuucognition/flint-cli",
3
- "version": "0.5.6-dev.6",
3
+ "version": "0.5.6-dev.8",
4
4
  "type": "module",
5
5
  "description": "Flint cognitive workspace CLI",
6
6
  "license": "PROPRIETARY",
7
7
  "bin": {
8
- "flint": "./bin/flint-prod.js",
9
- "flint-dev": "./bin/flint.js"
8
+ "flint": "./bin/flint-prod.js"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public"
10
12
  },
11
13
  "files": [
12
14
  "bin/",
@@ -26,9 +28,6 @@
26
28
  "engines": {
27
29
  "node": ">=20"
28
30
  },
29
- "publishConfig": {
30
- "access": "public"
31
- },
32
31
  "devDependencies": {
33
32
  "@nuucognition/cli-core": "link:../../../main/packages/cli-core",
34
33
  "@types/node": "^20.19.9",
@@ -39,11 +38,11 @@
39
38
  "@nuucognition/flint-sdk": "0.0.1",
40
39
  "@nuucognition/flint-server": "0.0.1",
41
40
  "@nuucognition/flint": "0.1.0",
42
- "@nuucognition/flint-migrations": "0.1.0",
43
41
  "@nuucognition/eslint-config": "0.0.0",
44
- "@nuucognition/orbh": "0.0.1-dev.0",
42
+ "@nuucognition/flint-migrations": "0.1.0",
43
+ "@nuucognition/typescript-config": "0.0.0",
45
44
  "@nuucognition/orbh-cli": "0.1.0",
46
- "@nuucognition/typescript-config": "0.0.0"
45
+ "@nuucognition/orbh": "0.0.1-dev.0"
47
46
  },
48
47
  "scripts": {
49
48
  "predev": "turbo build --filter=@nuucognition/flint-cli^...",