@bitcobblers/wod-wiki-engine 0.63.2270 → 0.63.2271
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/agent.cjs +43 -2
- package/dist/agent.cjs.map +1 -1
- package/dist/agent.mjs +1 -1
- package/dist/{chunk-AK57GBML.mjs → chunk-F3M5TAUJ.mjs} +55 -12
- package/dist/chunk-F3M5TAUJ.mjs.map +1 -0
- package/dist/index.cjs +53 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +1 -1
- package/package.json +5 -5
- package/dist/chunk-AK57GBML.mjs.map +0 -1
package/dist/agent.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { buildQueryServiceStoresFromStorage, extractNoteIdentity, extractTypedTags, noteHasRecordedSessionsInTx, snapshotNoteRevisionIfHasSessionsInTx, makeNotebookLinkId, resolveScopedPropertyCatalog, effortToMarkdown, equipmentToMarkdown, saveScopedPropertyOverride, listFeedSubscriptionsHeadless, seedMetaKey, subscribeFeedSourceHeadless, unsubscribeFeedSourceHeadless, deleteFeedSourceHeadless, checkUnpublishedFeedChanges, MemoryFeedTree, publishFeedFromStorage, ingestPortableFilesIntoStorage, exportPortableFilesFromStorage, getJournalDayOverlay, readFrontmatterMeta, createUserNotebookLanding, setNotebookPublic, promoteNoteToNotebooks, removeNoteFromNotebook, deleteUserNotebook, getNoteNotebooks, resolveUpstreamProvenance, getNotePublicationSummary, listScheduleItemsForNote, listNoteRevisions, composeNoteMarkdown, buildNoteProvenance, listScheduleItemsByDateRange, scheduleNoteOnDate, batchScheduleNotes, updateScheduleItem, removeScheduleItem, buildStatementTree, prepareJournalSessionRun, localCivilDateKey, setSessionPublic, attributeSession } from './chunk-
|
|
1
|
+
import { buildQueryServiceStoresFromStorage, extractNoteIdentity, extractTypedTags, noteHasRecordedSessionsInTx, snapshotNoteRevisionIfHasSessionsInTx, makeNotebookLinkId, resolveScopedPropertyCatalog, effortToMarkdown, equipmentToMarkdown, saveScopedPropertyOverride, listFeedSubscriptionsHeadless, seedMetaKey, subscribeFeedSourceHeadless, unsubscribeFeedSourceHeadless, deleteFeedSourceHeadless, checkUnpublishedFeedChanges, MemoryFeedTree, publishFeedFromStorage, ingestPortableFilesIntoStorage, exportPortableFilesFromStorage, getJournalDayOverlay, readFrontmatterMeta, createUserNotebookLanding, setNotebookPublic, promoteNoteToNotebooks, removeNoteFromNotebook, deleteUserNotebook, getNoteNotebooks, resolveUpstreamProvenance, getNotePublicationSummary, listScheduleItemsForNote, listNoteRevisions, composeNoteMarkdown, buildNoteProvenance, listScheduleItemsByDateRange, scheduleNoteOnDate, batchScheduleNotes, updateScheduleItem, removeScheduleItem, buildStatementTree, prepareJournalSessionRun, localCivilDateKey, setSessionPublic, attributeSession } from './chunk-F3M5TAUJ.mjs';
|
|
2
2
|
import { BUILTIN_NOTEBOOKS, parseDocumentSections, KNOWN_SECTION_WIDGETS, isNoteEditable, reconcileNoteBlocks, validateNoteBlocks, toNotebookId, blockContentId, MetricType, orderPlacements, countNotesByNotebook, isSystemReadOnlyNotebook, isNotebookLanding, notebookSlugFromId, isNonPublishableNotebook } from '@bitcobblers/wod-wiki-core';
|
|
3
3
|
import { bundledEfforts, createReferenceIndex, parseScript, extractStatementRefs, createParser, findUnresolvedChoices, createMockClock, RuntimeStack, EventBus, frozenNow, ScriptRuntime, createCompiler, createAnalyticsEngineForBlock, StartSessionAction, NextEvent, toStoredOutputStatement } from '@bitcobblers/wod-wiki-lang';
|
|
4
4
|
import { rowsEqual, userDeletedSeedKey } from '@bitcobblers/wod-wiki-storage';
|
|
@@ -858,13 +858,13 @@ function csvToTelemetryBundle(csv) {
|
|
|
858
858
|
}
|
|
859
859
|
|
|
860
860
|
// src/version.ts
|
|
861
|
-
var VERSION = "0.63.
|
|
862
|
-
var GIT_SHA = "
|
|
863
|
-
var BUILD_TIME = "2026-11-
|
|
861
|
+
var VERSION = "0.63.2271";
|
|
862
|
+
var GIT_SHA = "b3b70b1";
|
|
863
|
+
var BUILD_TIME = "2026-11-27T02:37:15.802Z";
|
|
864
864
|
var SEMVER = {
|
|
865
|
-
version: "0.63.
|
|
866
|
-
gitSha: "
|
|
867
|
-
buildTime: "2026-11-
|
|
865
|
+
version: "0.63.2271",
|
|
866
|
+
gitSha: "b3b70b1",
|
|
867
|
+
buildTime: "2026-11-27T02:37:15.802Z"
|
|
868
868
|
};
|
|
869
869
|
var SEED_SCHEMA = 9;
|
|
870
870
|
var SEED_REGISTERED_WIDGETS = KNOWN_SECTION_WIDGETS;
|
|
@@ -1872,6 +1872,8 @@ async function applyPreparedSeedChunkInTx(tx, prepared) {
|
|
|
1872
1872
|
const seedCommit = row.commit ?? write.manifest.commit;
|
|
1873
1873
|
const existingRetention = existing;
|
|
1874
1874
|
const resolvedPin = pinnedNoteIds.has(id) || existingRetention?.retention === "session-pinned" ? "session-pinned" : existingRetention?.retention === "schedule-pinned" ? "schedule-pinned" : void 0;
|
|
1875
|
+
const parsedBuiltAt = typeof write.manifest.builtAt === "string" ? Date.parse(write.manifest.builtAt) : Number.NaN;
|
|
1876
|
+
const seedCreatedAt = write.manifest.version === 0 ? 0 : Number.isFinite(parsedBuiltAt) && parsedBuiltAt >= 9466848e5 ? parsedBuiltAt : Number.isFinite(write.meta.importedAt) && write.meta.importedAt >= 9466848e5 ? write.meta.importedAt : Date.now();
|
|
1875
1877
|
const note = {
|
|
1876
1878
|
...existing,
|
|
1877
1879
|
id,
|
|
@@ -1879,7 +1881,7 @@ async function applyPreparedSeedChunkInTx(tx, prepared) {
|
|
|
1879
1881
|
rawContent: row.content,
|
|
1880
1882
|
sourceRevision,
|
|
1881
1883
|
blocks: map,
|
|
1882
|
-
createdAt:
|
|
1884
|
+
createdAt: seedCreatedAt,
|
|
1883
1885
|
...date === void 0 ? {} : { date },
|
|
1884
1886
|
type: write.chunkId === DASHBOARDS_CHUNK_ID ? "dashboard" : "note",
|
|
1885
1887
|
sourceId,
|
|
@@ -1978,8 +1980,8 @@ async function applyPreparedSeedChunkInTx(tx, prepared) {
|
|
|
1978
1980
|
const slug = fm["slug"];
|
|
1979
1981
|
if (typeof slug === "string" && pagesBySlug.has(slug)) {
|
|
1980
1982
|
const pageId = pagesBySlug.get(slug);
|
|
1981
|
-
pages.push({ id: pageId, slug, title: titleFromPath(row.path), createdAt:
|
|
1982
|
-
pageNotes.push({ id: linkIds.get(id), pageId, noteId: id, createdAt:
|
|
1983
|
+
pages.push({ id: pageId, slug, title: titleFromPath(row.path), createdAt: seedCreatedAt });
|
|
1984
|
+
pageNotes.push({ id: linkIds.get(id), pageId, noteId: id, createdAt: seedCreatedAt });
|
|
1983
1985
|
}
|
|
1984
1986
|
result.totalNotes++;
|
|
1985
1987
|
result.totalBlocks += Object.keys(map).length;
|
|
@@ -2333,6 +2335,40 @@ function buildQueryServiceStoresFromStorage(storage, options = {}) {
|
|
|
2333
2335
|
const bundles = /* @__PURE__ */ new Map();
|
|
2334
2336
|
const uniqueIds = [...new Set(noteIds)];
|
|
2335
2337
|
if (uniqueIds.length === 0) return bundles;
|
|
2338
|
+
if (storage.queryDomain) {
|
|
2339
|
+
const CHUNK_SIZE = 100;
|
|
2340
|
+
let usedDomain = true;
|
|
2341
|
+
let matchedRows = 0;
|
|
2342
|
+
for (let offset = 0; offset < uniqueIds.length; offset += CHUNK_SIZE) {
|
|
2343
|
+
const chunk = uniqueIds.slice(offset, offset + CHUNK_SIZE);
|
|
2344
|
+
const result = await storage.queryDomain({
|
|
2345
|
+
plan: "detail",
|
|
2346
|
+
selection: [{ field: "id", values: chunk }]
|
|
2347
|
+
});
|
|
2348
|
+
if (!result || result.plan !== "detail") {
|
|
2349
|
+
usedDomain = false;
|
|
2350
|
+
bundles.clear();
|
|
2351
|
+
break;
|
|
2352
|
+
}
|
|
2353
|
+
matchedRows += result.rows.length;
|
|
2354
|
+
for (const row of result.rows) {
|
|
2355
|
+
bundles.set(row.note.id, {
|
|
2356
|
+
tags: row.tags.map((t) => ({ label: t.label, ...t.type ? { type: t.type } : {} })),
|
|
2357
|
+
links: [...row.links],
|
|
2358
|
+
pages: [...row.pages]
|
|
2359
|
+
});
|
|
2360
|
+
}
|
|
2361
|
+
}
|
|
2362
|
+
if (usedDomain && matchedRows > 0) {
|
|
2363
|
+
for (const id of uniqueIds) {
|
|
2364
|
+
if (!bundles.has(id)) {
|
|
2365
|
+
bundles.set(id, { tags: [], links: [], pages: [] });
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
return bundles;
|
|
2369
|
+
}
|
|
2370
|
+
bundles.clear();
|
|
2371
|
+
}
|
|
2336
2372
|
return storage.transaction(["page_notes", "note_tags", "tags", "page"], "readonly", async (tx) => {
|
|
2337
2373
|
const [pageLinkGroups, tagLinkGroups] = await Promise.all([
|
|
2338
2374
|
tx.readonly("page_notes").getAllFromIndexMany("by-note", uniqueIds),
|
|
@@ -5465,20 +5501,27 @@ async function deleteUserNotebook(storage, notebookIdOrSlug) {
|
|
|
5465
5501
|
);
|
|
5466
5502
|
let touchedMembers = 0;
|
|
5467
5503
|
const noteWriter = tx.readwrite("notes");
|
|
5504
|
+
const legacyColonTag = `notebook:${slug}`;
|
|
5505
|
+
const legacySlashTag = `notebook/${slug}`;
|
|
5468
5506
|
for (const note of allNotes) {
|
|
5469
5507
|
if (isNotebookLanding(note)) continue;
|
|
5470
5508
|
const hasSingle = note.notebookId === nbId;
|
|
5471
5509
|
const hasMulti = (note.notebookIds ?? []).includes(nbId);
|
|
5472
5510
|
const hasLink = linkedNoteIds.has(note.id);
|
|
5473
|
-
|
|
5511
|
+
const hasLegacyTag = (note.tags ?? []).some(
|
|
5512
|
+
(t) => t === legacyColonTag || t === legacySlashTag
|
|
5513
|
+
);
|
|
5514
|
+
if (!hasSingle && !hasMulti && !hasLink && !hasLegacyTag) continue;
|
|
5474
5515
|
const baseIds = note.notebookIds !== void 0 ? note.notebookIds : note.notebookId ? [note.notebookId] : [];
|
|
5475
5516
|
const remaining = baseIds.map((id) => toNotebookId$1(id)).filter((id) => id !== nbId);
|
|
5476
5517
|
const primaryUser = remaining.find(
|
|
5477
5518
|
(id) => id !== "notebook/journal" && id !== "notebook/playground"
|
|
5478
5519
|
);
|
|
5520
|
+
const nextTags = hasLegacyTag ? (note.tags ?? []).filter((t) => t !== legacyColonTag && t !== legacySlashTag) : note.tags;
|
|
5479
5521
|
const { notebookId: _droppedSingle, notebookIds: _droppedMulti, ...rest } = note;
|
|
5480
5522
|
await noteWriter.put({
|
|
5481
5523
|
...rest,
|
|
5524
|
+
...nextTags !== void 0 ? { tags: nextTags } : {},
|
|
5482
5525
|
notebookIds: remaining,
|
|
5483
5526
|
...primaryUser ? { notebookId: primaryUser } : {}
|
|
5484
5527
|
});
|
|
@@ -6780,5 +6823,5 @@ async function migrateDatedPageNotesToSchedule(storage) {
|
|
|
6780
6823
|
}
|
|
6781
6824
|
|
|
6782
6825
|
export { APP_ORIGIN, BUILD_TIME, CANVAS_CHUNK_ID, DASHBOARDS_CHUNK_ID, DirectoryHandleFeedTree, EFFORTS_CHUNK_ID, EQUIPMENT_CHUNK_ID, FEED_INDEX_META_PREFIX, FEED_REGISTRY_META_KEY, FEED_SUBSCRIPTIONS_META_KEY, FeedTreeError, GIT_SHA, HttpFeedTree, MemoryFeedTree, NOTE_ID_FRONTMATTER_KEY, PUBLISHED_FEED_META_KEY, QR_SCRIPT_ID, SEED_BROADCAST_CHANNEL, SEED_NAMESPACE, SEED_REGISTERED_WIDGETS, SEED_SCHEMA, SEMVER, SESSION_CSV_HEADER, TELEMETRY_CSV_HEADER, VERSION, applySeedChunk, applySeedChunks, assertNotebookIndex, assertSeedManifest, assertSeedRow, assertSeedRows, attributeSession, backfillFeedProvenance, batchScheduleNotes, buildContextualPageSource, buildNoteProvenance, buildQueryServiceStoresFromStorage, buildStatementTree, canvasRouteSlug, checkUnpublishedFeedChanges, cloneRemoteRecord, compileSeedRowFromMarkdown, composeNoteMarkdown, createIRFile, createUserNotebookLanding, csvToEquipmentLabels, csvToSessionRows, csvToTelemetryBundle, decodeUtf8, deleteFeedSourceHeadless, deleteUserNotebook, effortToMarkdown, emptySeedMeta, encodeUtf8, ensurePinnedExternalWorkout, equipmentToCsv, equipmentToMarkdown, exportPortableFilesFromStorage, extractNoteIdentity, extractTypedTags, feedIdOfMetaKey, feedIndexMetaKey, findNearbyMatchingScheduleItems, forkNoteToUserNotebook, getJournalDayOverlay, getNoteNotebooks, getNotePublicationSummary, getNoteRevision, getScheduleAndSessionCountsByNote, ingestPortableFilesIntoStorage, injectIdentityFrontmatter, isIRFile, listFeedSubscriptionsHeadless, listNoteRevisions, listScheduleItemsByDateRange, listScheduleItemsForNote, listScopedPropertyOverrides, localCivilDateKey, logSessionAgainstExternalWorkout, makeNotebookLinkId, makeScopedOverrideId, materializeCachedRemoteRecord, migrateDatedPageNotesToSchedule, migrateNotebookVocabulary, normalizeCivilDate, normalizeFeedTreePath, noteHasRecordedSessionsInTx, notebookSlugForChunkId, parseCsvLine, parseFrontmatterDateMs, parseNoteMarkdown, parseRemoteNoteId, prepareJournalSessionRun, previewRemoteNotebook, previewRemoteRecord, promoteNoteToNotebooks, promoteReferencedOverridesToNotebook, publishFeedFromStorage, qrInlineScript, readFeedRegistryHeadless, readFrontmatterMeta, reconcileRemovedFeedRecords, recordPublishedFeedCheckpoint, removeFeedNotebookContent, removeFeedSourceContentById, removeNoteFromNotebook, removeScheduleItem, removeSeedSourceContent, renderFeedLandingHtml, resolveScopedPropertyCatalog, resolveSessionCivilDate, resolveUpstreamProvenance, saveScopedPropertyOverride, scheduleNoteOnDate, seedMetaKey, seedNoteId, seedNoteSourceId, seedPrecedenceRank, seedSourceTier, sessionToCsv, setNoteNotebooks, setNotebookPublic, setSessionPublic, sha256HexAsync, snapshotNoteRevisionIfHasSessionsInTx, splitCsvRecords, statementToNode, subscribeFeedSourceHeadless, telemetryBundleToCsv, unsubscribeFeedSourceHeadless, updateScheduleItem, writeFeedRegistryHeadless };
|
|
6783
|
-
//# sourceMappingURL=chunk-
|
|
6784
|
-
//# sourceMappingURL=chunk-
|
|
6826
|
+
//# sourceMappingURL=chunk-F3M5TAUJ.mjs.map
|
|
6827
|
+
//# sourceMappingURL=chunk-F3M5TAUJ.mjs.map
|