@nuucognition/flint-cli 0.5.0-alpha.1 → 0.5.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/README.md CHANGED
@@ -8,8 +8,15 @@ Flint extends Mesh with shards, git integration, and structured modules for AI-a
8
8
  ## Installation
9
9
 
10
10
  ```bash
11
- # Install via the internal Flint install script.
12
- # For local development in this monorepo:
11
+ npm install -g @nuucognition/flint-cli
12
+ ```
13
+
14
+ Flint CLI is also installed automatically as a dependency of `@nuucognition/steel-cli` and `@nuucognition/tinderbox-cli`.
15
+
16
+ ### Local Development
17
+
18
+ ```bash
19
+ # From the flint monorepo root:
13
20
  pnpm install
14
21
  pnpm --filter @nuucognition/flint-cli dev
15
22
  ```
@@ -182,7 +182,7 @@ async function cleanRegistryFile() {
182
182
  return result;
183
183
  }
184
184
  async function registerFlintByPath(path, options) {
185
- const { readFlintToml, hasFlintToml } = await import("./mesh-config-BAIYF4KD-QNNQOBSL.js");
185
+ const { readFlintToml, hasFlintToml } = await import("./mesh-config-BAIYF4KD-W2RGZQ2V.js");
186
186
  const isFlint = await hasFlintToml(path);
187
187
  if (!isFlint) {
188
188
  throw new Error(`Not a valid flint: ${path}
@@ -1512,7 +1512,6 @@ async function removeMeshExportFromConfig(flintPath, ref) {
1512
1512
 
1513
1513
  export {
1514
1514
  parse,
1515
- stringify,
1516
1515
  getFlintConfigDir,
1517
1516
  isInsideMesh,
1518
1517
  getTypePrefix,
@@ -2,7 +2,7 @@ import {
2
2
  getMeshExportSources,
3
3
  getSourceRepositories,
4
4
  nameFormats
5
- } from "./chunk-XCVQLFHY.js";
5
+ } from "./chunk-CBGQBE6C.js";
6
6
 
7
7
  // ../../packages/flint/dist/chunk-S7VC3H7U.js
8
8
  import { readFile, writeFile, mkdir, stat, readdir, unlink } from "fs/promises";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  readFlintToml
3
- } from "./chunk-XCVQLFHY.js";
3
+ } from "./chunk-CBGQBE6C.js";
4
4
 
5
- // ../../packages/flint/dist/chunk-ZN66KTQR.js
5
+ // ../../packages/flint/dist/chunk-WMDJDFRK.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) {
@@ -186,12 +186,18 @@ async function resolveDocument(docRef, flintPath) {
186
186
  const docName = basename(trimmedRef);
187
187
  const fileName = docName.endsWith(".md") ? docName : `${docName}.md`;
188
188
  const meshDir = join(flintPath, "Mesh");
189
- const matches = await findFilesRecursively(meshDir, fileName);
190
- if (matches.length === 0) {
191
- return null;
192
- }
193
- matches.sort();
194
- return matches[0] ?? null;
189
+ const meshMatches = await findFilesRecursively(meshDir, fileName);
190
+ if (meshMatches.length > 0) {
191
+ meshMatches.sort();
192
+ return meshMatches[0] ?? null;
193
+ }
194
+ const shardsDir = join(flintPath, "Shards");
195
+ const shardMatches = await findFilesRecursively(shardsDir, fileName);
196
+ if (shardMatches.length > 0) {
197
+ shardMatches.sort();
198
+ return shardMatches[0] ?? null;
199
+ }
200
+ return null;
195
201
  }
196
202
  async function resolveDocumentCached(docRef, flintPath, cache) {
197
203
  const key = docRef.trim();
@@ -212,7 +218,7 @@ function getDisambiguatedExportName(flintPath, sourcePath, baseName) {
212
218
  return `${baseName} (${dirLabel})`;
213
219
  }
214
220
  async function scanExports(flintPath) {
215
- const { readFlintToml: readFlintToml2 } = await import("./mesh-config-BAIYF4KD-QNNQOBSL.js");
221
+ const { readFlintToml: readFlintToml2 } = await import("./mesh-config-BAIYF4KD-W2RGZQ2V.js");
216
222
  const config = await readFlintToml2(flintPath);
217
223
  const declarations = config?.exports?.required;
218
224
  if (!declarations || declarations.length === 0) {
@@ -239,7 +245,7 @@ async function scanExportsFromConfig(flintPath, declarations) {
239
245
  async function scanExportEligible(flintPath) {
240
246
  const meshDir = join(flintPath, "Mesh");
241
247
  if (!await exists(meshDir)) return [];
242
- const { readFlintToml: readFlintToml2 } = await import("./mesh-config-BAIYF4KD-QNNQOBSL.js");
248
+ const { readFlintToml: readFlintToml2 } = await import("./mesh-config-BAIYF4KD-W2RGZQ2V.js");
243
249
  const config = await readFlintToml2(flintPath);
244
250
  const declared = new Set(
245
251
  (config?.exports?.required || []).map((d) => d.file.replace(/\.md$/, "").toLowerCase())