@bitcobblers/wod-wiki-engine 0.59.2246 → 0.60.2248

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.
@@ -858,13 +858,13 @@ function csvToTelemetryBundle(csv) {
858
858
  }
859
859
 
860
860
  // src/version.ts
861
- var VERSION = "0.59.2246";
862
- var GIT_SHA = "222739e";
863
- var BUILD_TIME = "2026-11-18T17:13:06.344Z";
861
+ var VERSION = "0.60.2248";
862
+ var GIT_SHA = "e331129";
863
+ var BUILD_TIME = "2026-11-19T04:20:48.739Z";
864
864
  var SEMVER = {
865
- version: "0.59.2246",
866
- gitSha: "222739e",
867
- buildTime: "2026-11-18T17:13:06.344Z"
865
+ version: "0.60.2248",
866
+ gitSha: "e331129",
867
+ buildTime: "2026-11-19T04:20:48.739Z"
868
868
  };
869
869
  var SEED_SCHEMA = 9;
870
870
  var SEED_REGISTERED_WIDGETS = KNOWN_SECTION_WIDGETS;
@@ -3974,6 +3974,12 @@ async function cloneRemoteRecord(storage, reader, input) {
3974
3974
  );
3975
3975
  return clonedNote;
3976
3976
  }
3977
+ var portableTextDecoder = new TextDecoder();
3978
+ function decodePortableFileContent(entry) {
3979
+ if (typeof entry.content === "string") return entry.content;
3980
+ if (entry.bytes instanceof Uint8Array) return portableTextDecoder.decode(entry.bytes);
3981
+ throw new Error(`PortableFileEntry '${entry.path}' is missing both 'content' and 'bytes'.`);
3982
+ }
3977
3983
  async function exportPortableFilesFromStorage(storage, options = {}) {
3978
3984
  const telemetryFormat = options.telemetryFormat ?? "jsonl";
3979
3985
  const [allNotes, allSessions, allEvents, allRevisions] = await Promise.all([
@@ -4057,12 +4063,12 @@ async function ingestPortableFilesIntoStorage(storage, files, options = {}) {
4057
4063
  );
4058
4064
  const telemetryBundles = [];
4059
4065
  for (const jf of jsonlFiles) {
4060
- const parsed = parseNoteBundleFromJsonl(jf.content);
4066
+ const parsed = parseNoteBundleFromJsonl(decodePortableFileContent(jf));
4061
4067
  errors.push(...parsed.errors.map((e) => `${jf.path}: ${e}`));
4062
4068
  telemetryBundles.push(...parsed.bundles);
4063
4069
  }
4064
4070
  for (const cf of csvFiles) {
4065
- const parsed = csvToTelemetryBundle(cf.content);
4071
+ const parsed = csvToTelemetryBundle(decodePortableFileContent(cf));
4066
4072
  errors.push(...parsed.errors.map((e) => `${cf.path}: ${e}`));
4067
4073
  telemetryBundles.push(...parsed.bundles);
4068
4074
  }
@@ -4086,7 +4092,7 @@ async function ingestPortableFilesIntoStorage(storage, files, options = {}) {
4086
4092
  for (const mf of mdFiles) {
4087
4093
  try {
4088
4094
  const fallbackTitle = (mf.path.split("/").at(-1) ?? "Imported Note").replace(/\.md$/i, "");
4089
- const parsed = parseNoteMarkdown(mf.content, { fallbackTitle });
4095
+ const parsed = parseNoteMarkdown(decodePortableFileContent(mf), { fallbackTitle });
4090
4096
  const noteId = parsed.id ?? await seedNoteId(`import:${mf.path}:${now}`);
4091
4097
  const existing = await noteStore.get(noteId);
4092
4098
  const nextRev = existing && existing.rawContent !== parsed.rawContent ? existing.sourceRevision + 1 : existing?.sourceRevision ?? 1;
@@ -4610,21 +4616,12 @@ async function prepareJournalSessionRun(storage, input) {
4610
4616
  targetId: clonedNoteId,
4611
4617
  noteId: clonedNoteId,
4612
4618
  createdAt: startedAt
4613
- },
4614
- {
4615
- id: makeNotebookLinkId("notebook/journal", "session", sessionId),
4616
- notebookId: "notebook/journal",
4617
- targetKind: "session",
4618
- targetId: sessionId,
4619
- noteId: clonedNoteId,
4620
- createdAt: startedAt
4621
4619
  }
4622
4620
  ];
4623
4621
  await tx.readwrite("notes").put(clonedNote);
4624
4622
  if (revisions.length > 0) await tx.readwrite("block_revisions").putMany(revisions);
4625
4623
  if (projections.length > 0) await tx.readwrite("block_index").putMany(projections);
4626
4624
  await tx.readwrite("page_notes").put(pageNote);
4627
- await tx.readwrite("sessions").put(session2);
4628
4625
  await tx.readwrite("notebook_links").putMany(links2);
4629
4626
  return {
4630
4627
  note: clonedNote,
@@ -4686,15 +4683,6 @@ async function prepareJournalSessionRun(storage, input) {
4686
4683
  noteId: sourceNote.id,
4687
4684
  createdAt: startedAt
4688
4685
  }));
4689
- links.push({
4690
- id: makeNotebookLinkId("notebook/journal", "session", sessionId),
4691
- notebookId: "notebook/journal",
4692
- targetKind: "session",
4693
- targetId: sessionId,
4694
- noteId: sourceNote.id,
4695
- createdAt: startedAt
4696
- });
4697
- await tx.readwrite("sessions").put(session);
4698
4686
  await tx.readwrite("notebook_links").putMany(links);
4699
4687
  return {
4700
4688
  note: updatedNote,
@@ -4923,6 +4911,19 @@ function buildQueryServiceStoresFromStorage(storage, options = {}) {
4923
4911
  },
4924
4912
  feedCatalogStore
4925
4913
  };
4914
+ const sessionStore = {
4915
+ getAll: async () => {
4916
+ const rows = await storage.readonly("sessions").getAll();
4917
+ return rows.map((s) => ({
4918
+ id: s.id,
4919
+ noteId: s.noteId,
4920
+ startedAt: s.startTime,
4921
+ ...s.completed ? { completedAt: s.endTime } : {},
4922
+ createdAt: s.createdAt
4923
+ }));
4924
+ }
4925
+ };
4926
+ Object.assign(stores, { sessionStore });
4926
4927
  if (options.datasetStore) {
4927
4928
  stores.datasetStore = options.datasetStore;
4928
4929
  }
@@ -4936,5 +4937,5 @@ function buildQueryServiceStoresFromStorage(storage, options = {}) {
4936
4937
  }
4937
4938
 
4938
4939
  export { APP_ORIGIN, BUILD_TIME, CANVAS_CHUNK_ID, DASHBOARDS_CHUNK_ID, DirectoryHandleFeedTree, EFFORTS_CHUNK_ID, EQUIPMENT_CHUNK_ID, 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, backfillFeedProvenance, buildNoteProvenance, buildQueryServiceStoresFromStorage, buildStatementTree, canvasRouteSlug, checkUnpublishedFeedChanges, cloneRemoteRecord, composeNoteMarkdown, createIRFile, createUserNotebookLanding, csvToEquipmentLabels, csvToSessionRows, csvToTelemetryBundle, decodeUtf8, deleteFeedSourceHeadless, effortToMarkdown, emptySeedMeta, encodeUtf8, equipmentToCsv, equipmentToMarkdown, exportPortableFilesFromStorage, extractNoteIdentity, extractTypedTags, feedIdOfMetaKey, getNoteNotebooks, getNotePublicationSummary, ingestPortableFilesIntoStorage, injectIdentityFrontmatter, isIRFile, listFeedSubscriptionsHeadless, listScopedPropertyOverrides, makeNotebookLinkId, makeScopedOverrideId, migrateNotebookVocabulary, normalizeFeedTreePath, notebookSlugForChunkId, parseCsvLine, parseFrontmatterDateMs, parseNoteMarkdown, prepareJournalSessionRun, previewRemoteNotebook, previewRemoteRecord, promoteNoteToNotebooks, promoteReferencedOverridesToNotebook, publishFeedFromStorage, qrInlineScript, readFrontmatterMeta, recordPublishedFeedCheckpoint, removeNoteFromNotebook, removeSeedSourceContent, renderFeedLandingHtml, resolveScopedPropertyCatalog, resolveUpstreamProvenance, saveScopedPropertyOverride, seedMetaKey, seedNoteId, seedNoteSourceId, seedPrecedenceRank, seedSourceTier, sessionToCsv, setNoteNotebooks, setNotebookPublic, setSessionPublic, sha256HexAsync, splitCsvRecords, statementToNode, subscribeFeedSourceHeadless, telemetryBundleToCsv, unsubscribeFeedSourceHeadless };
4939
- //# sourceMappingURL=chunk-E6Y2XOUM.mjs.map
4940
- //# sourceMappingURL=chunk-E6Y2XOUM.mjs.map
4940
+ //# sourceMappingURL=chunk-JRPNOWDS.mjs.map
4941
+ //# sourceMappingURL=chunk-JRPNOWDS.mjs.map