@nuucognition/flint-cli 0.6.0-dev.1 → 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 +132 -97
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -8344,7 +8344,7 @@ ${notes}
|
|
|
8344
8344
|
}
|
|
8345
8345
|
});
|
|
8346
8346
|
|
|
8347
|
-
// ../../packages/flint/dist/chunk-
|
|
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";
|
|
@@ -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
|
-
|
|
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
|
|
9297
|
-
"../../packages/flint/dist/chunk-
|
|
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-
|
|
9309
|
-
var
|
|
9310
|
-
__export(
|
|
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
|
|
9405
|
-
"../../packages/flint/dist/state-
|
|
9405
|
+
var init_state_NEYMF6ZB = __esm({
|
|
9406
|
+
"../../packages/flint/dist/state-NEYMF6ZB.js"() {
|
|
9406
9407
|
"use strict";
|
|
9407
|
-
|
|
9408
|
+
init_chunk_FSCS2POG();
|
|
9408
9409
|
}
|
|
9409
9410
|
});
|
|
9410
9411
|
|
|
9411
|
-
// ../../packages/flint/dist/chunk-
|
|
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(() => (
|
|
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
|
|
9640
|
-
"../../packages/flint/dist/chunk-
|
|
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;
|
|
@@ -9716,7 +9717,7 @@ var init_utils_BBA2XQZO = __esm({
|
|
|
9716
9717
|
}
|
|
9717
9718
|
});
|
|
9718
9719
|
|
|
9719
|
-
// ../../packages/flint/dist/chunk-
|
|
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";
|
|
@@ -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 ||
|
|
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
|
|
13148
|
-
"../../packages/flint/dist/chunk-
|
|
13148
|
+
var init_chunk_FG5TDNHZ = __esm({
|
|
13149
|
+
"../../packages/flint/dist/chunk-FG5TDNHZ.js"() {
|
|
13149
13150
|
"use strict";
|
|
13150
|
-
|
|
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-
|
|
13681
|
-
var
|
|
13682
|
-
__export(
|
|
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
|
|
13705
|
-
"../../packages/flint/dist/registries-
|
|
13705
|
+
var init_registries_QVGCW7J2 = __esm({
|
|
13706
|
+
"../../packages/flint/dist/registries-QVGCW7J2.js"() {
|
|
13706
13707
|
"use strict";
|
|
13707
|
-
|
|
13708
|
+
init_chunk_LUKWQDG3();
|
|
13708
13709
|
}
|
|
13709
13710
|
});
|
|
13710
13711
|
|
|
13711
|
-
// ../../packages/flint/dist/installer-
|
|
13712
|
-
var
|
|
13713
|
-
__export(
|
|
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
|
|
13747
|
-
"../../packages/flint/dist/installer-
|
|
13747
|
+
var init_installer_TT7WMU5R = __esm({
|
|
13748
|
+
"../../packages/flint/dist/installer-TT7WMU5R.js"() {
|
|
13748
13749
|
"use strict";
|
|
13749
|
-
|
|
13750
|
-
|
|
13750
|
+
init_chunk_FG5TDNHZ();
|
|
13751
|
+
init_chunk_FSCS2POG();
|
|
13751
13752
|
init_chunk_STM4NXTT();
|
|
13752
13753
|
}
|
|
13753
13754
|
});
|
|
@@ -17180,7 +17181,7 @@ async function moveFlint(nameOrPath, destination, options3 = {}) {
|
|
|
17180
17181
|
async function removeTinderboxFlint(flint) {
|
|
17181
17182
|
const entry = await findFlintByPath(flint.path);
|
|
17182
17183
|
if (entry) {
|
|
17183
|
-
const { unregisterFlint: unregisterFlint2 } = await Promise.resolve().then(() => (
|
|
17184
|
+
const { unregisterFlint: unregisterFlint2 } = await Promise.resolve().then(() => (init_registries_QVGCW7J2(), registries_QVGCW7J2_exports));
|
|
17184
17185
|
await unregisterFlint2(entry.path);
|
|
17185
17186
|
}
|
|
17186
17187
|
await rm42(flint.path, { recursive: true, force: true });
|
|
@@ -17200,6 +17201,41 @@ async function installDependency(flintPath, source, version) {
|
|
|
17200
17201
|
await cleanupResolvedSource(resolved);
|
|
17201
17202
|
}
|
|
17202
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
|
+
}
|
|
17203
17239
|
function withHealthMeta(result, category, shard) {
|
|
17204
17240
|
return {
|
|
17205
17241
|
...result,
|
|
@@ -19196,7 +19232,7 @@ async function syncFlint(flintPath) {
|
|
|
19196
19232
|
{
|
|
19197
19233
|
const pending = await getPendingMigrations(flintPath);
|
|
19198
19234
|
if (pending.length > 0) {
|
|
19199
|
-
const { getAllShardsWithVersions: getAllShardsWithVersions2 } = await Promise.resolve().then(() => (
|
|
19235
|
+
const { getAllShardsWithVersions: getAllShardsWithVersions2 } = await Promise.resolve().then(() => (init_installer_TT7WMU5R(), installer_TT7WMU5R_exports));
|
|
19200
19236
|
const shardsForMigrationCheck = await getAllShardsWithVersions2(flintPath);
|
|
19201
19237
|
const folderByShorthand = /* @__PURE__ */ new Map();
|
|
19202
19238
|
const shardVersionByShorthand = /* @__PURE__ */ new Map();
|
|
@@ -19652,7 +19688,7 @@ function getDisambiguatedExportName(flintPath, sourcePath, baseName) {
|
|
|
19652
19688
|
return `${baseName} (${dirLabel})`;
|
|
19653
19689
|
}
|
|
19654
19690
|
async function scanExports(flintPath) {
|
|
19655
|
-
const { readFlintToml: readFlintToml22 } = await Promise.resolve().then(() => (
|
|
19691
|
+
const { readFlintToml: readFlintToml22 } = await Promise.resolve().then(() => (init_state_NEYMF6ZB(), state_NEYMF6ZB_exports));
|
|
19656
19692
|
const config = await readFlintToml22(flintPath);
|
|
19657
19693
|
const declarations = config?.exports?.bundles;
|
|
19658
19694
|
if (!declarations || declarations.length === 0) {
|
|
@@ -19679,7 +19715,7 @@ async function scanExportsFromConfig(flintPath, declarations) {
|
|
|
19679
19715
|
async function scanExportEligible(flintPath) {
|
|
19680
19716
|
const meshDir = join152(flintPath, "Mesh");
|
|
19681
19717
|
if (!await exists22(meshDir)) return [];
|
|
19682
|
-
const { readFlintToml: readFlintToml22 } = await Promise.resolve().then(() => (
|
|
19718
|
+
const { readFlintToml: readFlintToml22 } = await Promise.resolve().then(() => (init_state_NEYMF6ZB(), state_NEYMF6ZB_exports));
|
|
19683
19719
|
const config = await readFlintToml22(flintPath);
|
|
19684
19720
|
const declared = new Set(
|
|
19685
19721
|
(config?.exports?.bundles ?? []).map((d) => d.file.replace(/\.md$/, "").toLowerCase())
|
|
@@ -20433,41 +20469,6 @@ async function listDevLocalFolders(flintPath) {
|
|
|
20433
20469
|
}
|
|
20434
20470
|
return out;
|
|
20435
20471
|
}
|
|
20436
|
-
async function healScaffolding(folderPath, entry) {
|
|
20437
|
-
for (const sub of SHARD_SPEC_DIRS_SOURCE) {
|
|
20438
|
-
await fs10.mkdir(path14.join(folderPath, sub), { recursive: true });
|
|
20439
|
-
}
|
|
20440
|
-
const yamlPath = path14.join(folderPath, "shard.yaml");
|
|
20441
|
-
if (!await fileExists22(yamlPath)) {
|
|
20442
|
-
const stub = `shard-spec: "0.2.0"
|
|
20443
|
-
version: "0.1.0"
|
|
20444
|
-
name: ${entry.name}
|
|
20445
|
-
shorthand: ${entry.name}
|
|
20446
|
-
description: ""
|
|
20447
|
-
`;
|
|
20448
|
-
await fs10.writeFile(yamlPath, stub, "utf-8");
|
|
20449
|
-
}
|
|
20450
|
-
const readmePath = path14.join(folderPath, "README.md");
|
|
20451
|
-
if (!await fileExists22(readmePath)) {
|
|
20452
|
-
await fs10.writeFile(readmePath, `# ${entry.name}
|
|
20453
|
-
`, "utf-8");
|
|
20454
|
-
}
|
|
20455
|
-
const releasePath = path14.join(folderPath, "RELEASE.md");
|
|
20456
|
-
if (!await fileExists22(releasePath)) {
|
|
20457
|
-
await fs10.writeFile(releasePath, "# 0.1.0\n\n- Initial shard scaffold\n", "utf-8");
|
|
20458
|
-
}
|
|
20459
|
-
const migrationsPath = path14.join(folderPath, "MIGRATIONS.md");
|
|
20460
|
-
if (!await fileExists22(migrationsPath)) {
|
|
20461
|
-
await fs10.writeFile(
|
|
20462
|
-
migrationsPath,
|
|
20463
|
-
`# Migrations
|
|
20464
|
-
|
|
20465
|
-
Migration notes for ${entry.name}. Latest version at top, separated by \`---\`.
|
|
20466
|
-
`,
|
|
20467
|
-
"utf-8"
|
|
20468
|
-
);
|
|
20469
|
-
}
|
|
20470
|
-
}
|
|
20471
20472
|
async function directoryExists(p) {
|
|
20472
20473
|
try {
|
|
20473
20474
|
const s = await fs10.stat(p);
|
|
@@ -20553,6 +20554,14 @@ async function fileExists3(p) {
|
|
|
20553
20554
|
return false;
|
|
20554
20555
|
}
|
|
20555
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
|
+
}
|
|
20556
20565
|
function partitionIntent9(world) {
|
|
20557
20566
|
const shards = world.intent.shards;
|
|
20558
20567
|
return partitionEntries({
|
|
@@ -20589,14 +20598,14 @@ async function readSourceState(source, flintRoot) {
|
|
|
20589
20598
|
return { sourcePath: null, sourceMissing: false, sourceVersion: null };
|
|
20590
20599
|
}
|
|
20591
20600
|
const sourcePath = path16.isAbsolute(source) ? source : path16.resolve(flintRoot, source);
|
|
20592
|
-
const exists32 = await
|
|
20601
|
+
const exists32 = await directoryExists3(sourcePath);
|
|
20593
20602
|
if (!exists32) {
|
|
20594
20603
|
return { sourcePath, sourceMissing: true, sourceVersion: null };
|
|
20595
20604
|
}
|
|
20596
20605
|
const snap = await readShardManifestSnapshot(sourcePath).catch(() => null);
|
|
20597
20606
|
return { sourcePath, sourceMissing: false, sourceVersion: snap?.version ?? null };
|
|
20598
20607
|
}
|
|
20599
|
-
async function
|
|
20608
|
+
async function directoryExists3(p) {
|
|
20600
20609
|
try {
|
|
20601
20610
|
const s = await fs12.stat(p);
|
|
20602
20611
|
return s.isDirectory();
|
|
@@ -20604,14 +20613,6 @@ async function directoryExists2(p) {
|
|
|
20604
20613
|
return false;
|
|
20605
20614
|
}
|
|
20606
20615
|
}
|
|
20607
|
-
async function fileExists4(p) {
|
|
20608
|
-
try {
|
|
20609
|
-
await fs12.stat(p);
|
|
20610
|
-
return true;
|
|
20611
|
-
} catch {
|
|
20612
|
-
return false;
|
|
20613
|
-
}
|
|
20614
|
-
}
|
|
20615
20616
|
function isInstalledShapedFolder(name) {
|
|
20616
20617
|
if (name.startsWith(".")) return false;
|
|
20617
20618
|
if (name.startsWith("(Dev Remote) ") || name.startsWith("(Dev Local) ")) return false;
|
|
@@ -20722,13 +20723,13 @@ function registerAllFeatures() {
|
|
|
20722
20723
|
for (const feature of allFeatures) registerFeature(feature);
|
|
20723
20724
|
registered = true;
|
|
20724
20725
|
}
|
|
20725
|
-
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;
|
|
20726
20727
|
var init_dist4 = __esm({
|
|
20727
20728
|
"../../packages/flint/dist/index.js"() {
|
|
20728
20729
|
"use strict";
|
|
20729
|
-
|
|
20730
|
-
|
|
20731
|
-
|
|
20730
|
+
init_chunk_LUKWQDG3();
|
|
20731
|
+
init_chunk_FG5TDNHZ();
|
|
20732
|
+
init_chunk_FSCS2POG();
|
|
20732
20733
|
init_chunk_STM4NXTT();
|
|
20733
20734
|
init_dist();
|
|
20734
20735
|
init_dist();
|
|
@@ -21632,13 +21633,14 @@ var init_dist4 = __esm({
|
|
|
21632
21633
|
async apply(drift, world) {
|
|
21633
21634
|
const payload = drift.payload;
|
|
21634
21635
|
if (payload.kind === "damaged") {
|
|
21635
|
-
await
|
|
21636
|
+
await healShardScaffolding(payload.resolvedPath, payload.entry.name);
|
|
21636
21637
|
}
|
|
21637
21638
|
return [];
|
|
21638
21639
|
}
|
|
21639
21640
|
};
|
|
21640
21641
|
DEV_REMOTE_SHARDS_FEATURE_ID = "dev-remote-shards";
|
|
21641
21642
|
SHARDS_DIR2 = "Shards";
|
|
21643
|
+
REQUIRED_ROOT_FILES2 = [...ROOT_MARKDOWN_FILES].filter((f) => f !== "shard.yaml");
|
|
21642
21644
|
devRemoteShards = {
|
|
21643
21645
|
id: DEV_REMOTE_SHARDS_FEATURE_ID,
|
|
21644
21646
|
healStrategy: {
|
|
@@ -21660,12 +21662,40 @@ var init_dist4 = __esm({
|
|
|
21660
21662
|
for (const entry of intent) {
|
|
21661
21663
|
const folderPath = await findDevRemoteFolder(world.root, entry.name);
|
|
21662
21664
|
if (!folderPath) {
|
|
21663
|
-
declared.push({
|
|
21665
|
+
declared.push({
|
|
21666
|
+
name: entry.name,
|
|
21667
|
+
folderPath: null,
|
|
21668
|
+
hasManifest: false,
|
|
21669
|
+
shardSpec: null,
|
|
21670
|
+
manifestErrors: [],
|
|
21671
|
+
missingDirs: [],
|
|
21672
|
+
missingRootFiles: []
|
|
21673
|
+
});
|
|
21664
21674
|
continue;
|
|
21665
21675
|
}
|
|
21666
21676
|
const hasManifest = await fileExists3(path15.join(folderPath, "shard.yaml"));
|
|
21667
21677
|
const { shardSpec, errors: manifestErrors } = hasManifest ? await readShardSpecAndErrors2(folderPath) : { shardSpec: null, errors: [] };
|
|
21668
|
-
|
|
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
|
+
});
|
|
21669
21699
|
}
|
|
21670
21700
|
const onDiskFolders = await listDevPrefixedFolders(world.root, "(Dev Remote) ");
|
|
21671
21701
|
return { declared, onDiskFolders };
|
|
@@ -21683,13 +21713,13 @@ var init_dist4 = __esm({
|
|
|
21683
21713
|
});
|
|
21684
21714
|
continue;
|
|
21685
21715
|
}
|
|
21686
|
-
if (!a.hasManifest) {
|
|
21716
|
+
if (!a.hasManifest || a.missingDirs.length > 0 || a.missingRootFiles.length > 0) {
|
|
21687
21717
|
drifts.push({
|
|
21688
21718
|
feature: DEV_REMOTE_SHARDS_FEATURE_ID,
|
|
21689
21719
|
kind: "damaged",
|
|
21690
21720
|
payload: { kind: "damaged", entry, folderPath: a.folderPath }
|
|
21691
21721
|
});
|
|
21692
|
-
continue;
|
|
21722
|
+
if (!a.hasManifest) continue;
|
|
21693
21723
|
}
|
|
21694
21724
|
if (a.manifestErrors.length > 0) {
|
|
21695
21725
|
drifts.push({
|
|
@@ -21737,7 +21767,7 @@ var init_dist4 = __esm({
|
|
|
21737
21767
|
await cloneEntry(world.root, payload.entry);
|
|
21738
21768
|
}
|
|
21739
21769
|
if (payload.kind === "damaged") {
|
|
21740
|
-
await
|
|
21770
|
+
await healShardScaffolding(payload.folderPath, payload.entry.name);
|
|
21741
21771
|
}
|
|
21742
21772
|
return [];
|
|
21743
21773
|
}
|
|
@@ -21769,8 +21799,6 @@ var init_dist4 = __esm({
|
|
|
21769
21799
|
for (const entry of entries) {
|
|
21770
21800
|
if (!entry.isDirectory()) continue;
|
|
21771
21801
|
if (!isInstalledShapedFolder(entry.name)) continue;
|
|
21772
|
-
const yaml = path16.join(shardsDir, entry.name, "shard.yaml");
|
|
21773
|
-
if (!await fileExists4(yaml)) continue;
|
|
21774
21802
|
onDiskNames.push(entry.name);
|
|
21775
21803
|
byKebab.set(folderToKebab(entry.name), entry.name);
|
|
21776
21804
|
}
|
|
@@ -159976,8 +160004,15 @@ Cannot promote: "${devFolderName}" already exists.`));
|
|
|
159976
160004
|
return;
|
|
159977
160005
|
}
|
|
159978
160006
|
await rename11(shardPath, devPath);
|
|
159979
|
-
await removeShardFromConfig(flintPath, match2.name);
|
|
160007
|
+
await removeShardFromConfig(flintPath, match2.name, { mode: "dev-local" });
|
|
159980
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
|
+
}
|
|
159981
160016
|
await updateGitignore(flintPath);
|
|
159982
160017
|
console.log(export_pc.green(`
|
|
159983
160018
|
${export_pc.bold(devFolderName)} promoted to Dev Remote`));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuucognition/flint-cli",
|
|
3
|
-
"version": "0.6.0-dev.
|
|
3
|
+
"version": "0.6.0-dev.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Flint cognitive workspace CLI",
|
|
6
6
|
"license": "PROPRIETARY",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"tsx": "^4.19.2",
|
|
35
35
|
"typescript": "^5.9.2",
|
|
36
36
|
"@nuucognition/flint-server": "0.0.1",
|
|
37
|
-
"@nuucognition/flint-sdk": "0.0.1",
|
|
38
|
-
"@nuucognition/flint": "0.1.0",
|
|
39
37
|
"@nuucognition/eslint-config": "0.0.0",
|
|
38
|
+
"@nuucognition/flint-sdk": "0.0.1",
|
|
40
39
|
"@nuucognition/flint-migrations": "0.1.0",
|
|
41
|
-
"@nuucognition/
|
|
40
|
+
"@nuucognition/flint": "0.1.0",
|
|
42
41
|
"@nuucognition/orbh-cli": "0.1.0-dev.1",
|
|
42
|
+
"@nuucognition/orbh": "0.0.1-dev.0",
|
|
43
43
|
"@nuucognition/typescript-config": "0.0.0"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|