@mulmoclaude/core 6.0.0 → 6.0.1
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/collection/registry/server/index.cjs +2 -2
- package/dist/collection/registry/server/index.js +2 -2
- package/dist/collection/server/index.cjs +2 -2
- package/dist/collection/server/index.js +2 -2
- package/dist/collection-watchers/index.cjs +2 -2
- package/dist/collection-watchers/index.js +2 -2
- package/dist/{discovery-CYIV1J5l.cjs → discovery-BkCeYBf6.cjs} +26 -14
- package/dist/discovery-BkCeYBf6.cjs.map +1 -0
- package/dist/{discovery-duLlygnJ.js → discovery-DR4GNqrp.js} +26 -14
- package/dist/discovery-DR4GNqrp.js.map +1 -0
- package/dist/dist-734JaRYi.cjs.map +1 -1
- package/dist/dist-BmO4oSQy.js.map +1 -1
- package/dist/feeds/server/index.cjs +2 -2
- package/dist/feeds/server/index.js +2 -2
- package/dist/google/index.cjs +1 -1
- package/dist/google/index.js +1 -1
- package/dist/{server-ByKWGQn2.cjs → server-CQ88wv71.cjs} +2 -2
- package/dist/{server-ByKWGQn2.cjs.map → server-CQ88wv71.cjs.map} +1 -1
- package/dist/{server-CA-alqqN.js → server-Dh7pgRRg.js} +2 -2
- package/dist/{server-CA-alqqN.js.map → server-Dh7pgRRg.js.map} +1 -1
- package/dist/workspace-setup/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/discovery-CYIV1J5l.cjs.map +0 -1
- package/dist/discovery-duLlygnJ.js.map +0 -1
|
@@ -11,6 +11,21 @@ import { lstat, mkdir, open, readFile, readdir, rename, stat, unlink, writeFile
|
|
|
11
11
|
import { tmpdir } from "node:os";
|
|
12
12
|
import iconv from "iconv-lite";
|
|
13
13
|
import { z } from "zod";
|
|
14
|
+
// ../common/dist/concurrency.js
|
|
15
|
+
/** Run `worker` over `items` with at most `limit` in flight, preserving
|
|
16
|
+
* input order in the results. The call rejects with the first `worker`
|
|
17
|
+
* rejection, but the other runners keep draining the queue — make
|
|
18
|
+
* `worker` total (never throw) when every item must be attempted. */
|
|
19
|
+
async function mapWithConcurrency(items, limit, worker) {
|
|
20
|
+
const results = new Array(items.length);
|
|
21
|
+
const pending = items.entries();
|
|
22
|
+
const runnerCount = Math.min(Math.max(1, Math.floor(limit) || 1), items.length);
|
|
23
|
+
const runners = Array.from({ length: runnerCount }, async () => {
|
|
24
|
+
for (const [index, item] of pending) results[index] = await worker(item, index);
|
|
25
|
+
});
|
|
26
|
+
await Promise.all(runners);
|
|
27
|
+
return results;
|
|
28
|
+
}
|
|
14
29
|
// src/host/hostSlot.ts
|
|
15
30
|
function createHostSlot(name) {
|
|
16
31
|
let current = null;
|
|
@@ -795,6 +810,7 @@ function appManifestReason(failure, root) {
|
|
|
795
810
|
return `${manifestPath} ${failure.detail}`;
|
|
796
811
|
}
|
|
797
812
|
// src/collection/server/io.ts
|
|
813
|
+
var LIST_READ_CONCURRENCY = 64;
|
|
798
814
|
/** True iff `filePath` exists and is a regular file (NOT a symlink).
|
|
799
815
|
* Defends `listItems` / `readItem` against `*.json` symlinks placed
|
|
800
816
|
* inside an otherwise-contained data dir — without this, a record
|
|
@@ -847,19 +863,15 @@ async function listItems(dataDir, opts = {}) {
|
|
|
847
863
|
if (isErrorWithCode(err) && err.code === "ENOENT") return [];
|
|
848
864
|
throw err;
|
|
849
865
|
}
|
|
850
|
-
const
|
|
851
|
-
|
|
852
|
-
if (
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
}
|
|
860
|
-
results.push(record);
|
|
861
|
-
}
|
|
862
|
-
return results;
|
|
866
|
+
const filePaths = entries.filter(isRecordFileName).map((name) => path.join(dataDir, name));
|
|
867
|
+
return (await mapWithConcurrency(filePaths, LIST_READ_CONCURRENCY, tryReadRecord)).filter((record, index) => {
|
|
868
|
+
if (record !== null) return true;
|
|
869
|
+
log.warn("collections", "skipping record (missing, symlink, or unreadable)", { path: filePaths[index] });
|
|
870
|
+
return false;
|
|
871
|
+
});
|
|
872
|
+
}
|
|
873
|
+
function isRecordFileName(name) {
|
|
874
|
+
return name.endsWith(".json") && !name.startsWith(".");
|
|
863
875
|
}
|
|
864
876
|
/** Read one record by id. Returns null when the file is missing,
|
|
865
877
|
* when the resolved path escapes the workspace via a symlink, or
|
|
@@ -3347,4 +3359,4 @@ function toDetail(collection) {
|
|
|
3347
3359
|
}
|
|
3348
3360
|
export { collectionChangePayload as $, readItem as A, SCHEMA_FILE as B, CollectionQueryZ as C, generateItemId as D, deleteItem as E, loadAppManifest as F, resolveTemplatePath as G, isUnderRealRoot as H, parseAppManifest as I, BackendUnavailableError as J, safeRecordId as K, sharedItemsPath as L, writeItem as M, APP_MANIFEST_FILE as N, isRegularFile as O, appManifestReason as P, collectionChangeKey as Q, pageFromFullRead as R, compileJsonlQuery as S, MAX_QUERY_ROWS as T, itemFilePath as U, isContainedInRoot as V, resolveDataDir as W, COLLECTION_ROOT_REQUIRED as X, isBackendUnavailable as Y, archiveDir as Z, dedupeByRecordId as _, createForwardingLogger as _t, toDetail as a, isPresetSlug as at, queryCsv as b, resolveMutateSet as c, peekWorkspaceRoot as ct, storeFor as d, setCollectionChangePublisher as dt, collectionsRegistriesConfigPath as et, checkpointSqliteDatabase as f, setFirestoreAccessor as ft, decodeCsvRecordId as g, stagingSkillDir as gt, csvRowToItem as h, skillsStagingDir as ht, resolvePrimaryField as i, hostSupportsSharedCollections as it, resolveCreateItemId as j, listItems as k, collectionWritable as l, projectSkillsDir as lt, cacheDir as m, sharedCollectionChangePayload as mt, discoverCollections as n, firestoreHandle as nt, toSummary as o, localCollectionKey as ot, MAX_CSV_ROWS as p, setSharedCollectionsSupport as pt, safeSlugName as q, loadCollection as r, getWorkspaceRoot as rt, CollectionSchemaZ as s, log as st, acceptParsedSchema as t, configureCollectionHost as tt, readOnlyRefusal as u, publishCollectionChange as ut, encodeCsvRecordId as v, createHostSlot as vt, DEFAULT_QUERY_ROWS as w, compileCsvQuery as x, normalizeCsvValue as y, projectItemFields as z };
|
|
3349
3361
|
|
|
3350
|
-
//# sourceMappingURL=discovery-
|
|
3362
|
+
//# sourceMappingURL=discovery-DR4GNqrp.js.map
|