@bitcobblers/wod-wiki-engine 0.63.2275 → 0.63.2276
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 +45 -12
- package/dist/agent.cjs.map +1 -1
- package/dist/agent.mjs +4 -3
- package/dist/agent.mjs.map +1 -1
- package/dist/{chunk-4TWTS5TS.mjs → chunk-J3G7VFT6.mjs} +104 -18
- package/dist/chunk-J3G7VFT6.mjs.map +1 -0
- package/dist/index.cjs +103 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -8
- package/dist/index.d.ts +33 -8
- package/dist/index.mjs +1 -1
- package/package.json +5 -5
- package/dist/chunk-4TWTS5TS.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -941,13 +941,13 @@ function csvToTelemetryBundle(csv) {
|
|
|
941
941
|
}
|
|
942
942
|
|
|
943
943
|
// src/version.ts
|
|
944
|
-
var VERSION = "0.63.
|
|
945
|
-
var GIT_SHA = "
|
|
946
|
-
var BUILD_TIME = "2026-11-
|
|
944
|
+
var VERSION = "0.63.2276";
|
|
945
|
+
var GIT_SHA = "8f52262";
|
|
946
|
+
var BUILD_TIME = "2026-11-28T17:47:58.856Z";
|
|
947
947
|
var SEMVER = {
|
|
948
|
-
version: "0.63.
|
|
949
|
-
gitSha: "
|
|
950
|
-
buildTime: "2026-11-
|
|
948
|
+
version: "0.63.2276",
|
|
949
|
+
gitSha: "8f52262",
|
|
950
|
+
buildTime: "2026-11-28T17:47:58.856Z"
|
|
951
951
|
};
|
|
952
952
|
var SEED_SCHEMA = 9;
|
|
953
953
|
var SEED_REGISTERED_WIDGETS = wodWikiCore.KNOWN_SECTION_WIDGETS;
|
|
@@ -1421,6 +1421,55 @@ async function saveScopedPropertyOverride(storage, input) {
|
|
|
1421
1421
|
);
|
|
1422
1422
|
return overrideRecord;
|
|
1423
1423
|
}
|
|
1424
|
+
async function deleteScopedPropertyOverride(storage, input) {
|
|
1425
|
+
const targetNotebookId = wodWikiCore.toNotebookId(input.targetNotebookId);
|
|
1426
|
+
const cleanSlug = input.slug.trim().toLowerCase();
|
|
1427
|
+
if (!cleanSlug) {
|
|
1428
|
+
throw new Error("Deleting a property override requires a non-empty canonical slug.");
|
|
1429
|
+
}
|
|
1430
|
+
const nbSlug = wodWikiCore.notebookSlugFromId(targetNotebookId);
|
|
1431
|
+
const overrideId = makeScopedOverrideId(targetNotebookId, input.kind, cleanSlug);
|
|
1432
|
+
const defaultOwnerNoteId = `override/${nbSlug}/${input.kind}/${cleanSlug}`;
|
|
1433
|
+
return storage.transaction(
|
|
1434
|
+
["notes", "block_revisions", "property_overrides", "tags", "tag_types"],
|
|
1435
|
+
"readwrite",
|
|
1436
|
+
async (tx) => {
|
|
1437
|
+
const existing = await tx.readonly("property_overrides").get(overrideId);
|
|
1438
|
+
const ownerNoteId = existing?.ownerNoteId ?? defaultOwnerNoteId;
|
|
1439
|
+
const existingNote = await tx.readonly("notes").get(ownerNoteId);
|
|
1440
|
+
if (existing) {
|
|
1441
|
+
await tx.readwrite("property_overrides").delete(overrideId);
|
|
1442
|
+
}
|
|
1443
|
+
if (existingNote) {
|
|
1444
|
+
await tx.readwrite("notes").delete(ownerNoteId);
|
|
1445
|
+
}
|
|
1446
|
+
try {
|
|
1447
|
+
const revisions = await tx.readonly("block_revisions").getAllFromIndex("by-note", ownerNoteId);
|
|
1448
|
+
for (const rev of revisions) {
|
|
1449
|
+
await tx.readwrite("block_revisions").delete([rev.noteId, rev.blockId, rev.version]);
|
|
1450
|
+
}
|
|
1451
|
+
} catch {
|
|
1452
|
+
}
|
|
1453
|
+
if (existing && targetNotebookId === "notebook/custom") {
|
|
1454
|
+
const payloadId = typeof existing.payload?.id === "string" ? existing.payload.id : void 0;
|
|
1455
|
+
if (payloadId) {
|
|
1456
|
+
if (input.kind === "tag") {
|
|
1457
|
+
await tx.readwrite("tags").delete(payloadId).catch(() => {
|
|
1458
|
+
});
|
|
1459
|
+
} else if (input.kind === "tag-type") {
|
|
1460
|
+
await tx.readwrite("tag_types").delete(payloadId).catch(() => {
|
|
1461
|
+
});
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
return {
|
|
1466
|
+
deleted: Boolean(existing || existingNote),
|
|
1467
|
+
notebookId: targetNotebookId,
|
|
1468
|
+
ownerNoteId
|
|
1469
|
+
};
|
|
1470
|
+
}
|
|
1471
|
+
);
|
|
1472
|
+
}
|
|
1424
1473
|
async function listScopedPropertyOverrides(storage, filter) {
|
|
1425
1474
|
let rows;
|
|
1426
1475
|
try {
|
|
@@ -2395,13 +2444,14 @@ function buildQueryServiceStoresFromStorage(storage, options = {}) {
|
|
|
2395
2444
|
const res = options.isNotebookSubscribed(feedId, chunkId);
|
|
2396
2445
|
subscribed = typeof res === "boolean" ? res : Boolean(await res);
|
|
2397
2446
|
}
|
|
2447
|
+
const builtin = wodWikiCore.BUILTIN_NOTEBOOKS.find((b) => b.slug === slug);
|
|
2398
2448
|
rows.push({
|
|
2399
2449
|
id: notebookId,
|
|
2400
2450
|
feedId,
|
|
2401
2451
|
feedLabel: feedSourceId ?? "Yours (Local)",
|
|
2402
2452
|
chunkId,
|
|
2403
2453
|
slug,
|
|
2404
|
-
label: landing?.title ?? slug,
|
|
2454
|
+
label: builtin ? builtin.name : landing?.title ?? slug,
|
|
2405
2455
|
count,
|
|
2406
2456
|
subscribed,
|
|
2407
2457
|
installed: true,
|
|
@@ -4188,12 +4238,27 @@ async function ensureUserNotebookLanding(tx, notebookId, now) {
|
|
|
4188
4238
|
seedOrigin: "user"
|
|
4189
4239
|
});
|
|
4190
4240
|
}
|
|
4191
|
-
|
|
4241
|
+
var RESERVED_NOTEBOOK_SLUGS = new Set(
|
|
4242
|
+
wodWikiCore.BUILTIN_NOTEBOOKS.map((b) => b.slug)
|
|
4243
|
+
);
|
|
4244
|
+
function resolveUserNotebookSlug(rawName, takenSlugs) {
|
|
4192
4245
|
const trimmed = rawName.trim();
|
|
4193
|
-
let
|
|
4194
|
-
if (
|
|
4195
|
-
|
|
4246
|
+
let baseSlug = trimmed.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "notebook";
|
|
4247
|
+
if (RESERVED_NOTEBOOK_SLUGS.has(baseSlug) || wodWikiCore.isNonPublishableNotebook(baseSlug)) {
|
|
4248
|
+
baseSlug = `${baseSlug}-user`;
|
|
4249
|
+
}
|
|
4250
|
+
if (!takenSlugs || !takenSlugs.has(baseSlug)) {
|
|
4251
|
+
return baseSlug;
|
|
4252
|
+
}
|
|
4253
|
+
let slug = baseSlug;
|
|
4254
|
+
for (let i = 2; takenSlugs.has(slug); i++) {
|
|
4255
|
+
slug = `${baseSlug}-${i}`;
|
|
4196
4256
|
}
|
|
4257
|
+
return slug;
|
|
4258
|
+
}
|
|
4259
|
+
async function createUserNotebookLanding(storage, rawName) {
|
|
4260
|
+
const trimmed = rawName.trim();
|
|
4261
|
+
const slug = resolveUserNotebookSlug(trimmed);
|
|
4197
4262
|
const nbId = wodWikiCore.toNotebookId(slug);
|
|
4198
4263
|
await storage.transaction(["notes"], "readwrite", async (tx) => {
|
|
4199
4264
|
const existing = await tx.readonly("notes").get(nbId);
|
|
@@ -4464,11 +4529,32 @@ async function setNotebookPublic(storage, notebookIdOrSlug, isPublic) {
|
|
|
4464
4529
|
if (existing && (existing.feedOrigin === "feed" || existing.seedOrigin === "seed")) {
|
|
4465
4530
|
throw new Error(`Subscribed feed notebooks cannot be published directly (${notebookId}). Clone into a user notebook first.`);
|
|
4466
4531
|
}
|
|
4467
|
-
const
|
|
4532
|
+
const slug = wodWikiCore.notebookSlugFromId(notebookId);
|
|
4533
|
+
const builtin = wodWikiCore.BUILTIN_NOTEBOOKS.find((b) => b.slug === slug);
|
|
4534
|
+
const canonicalTitle = builtin?.name ?? slug;
|
|
4535
|
+
const canonicalRawContent = builtin ? `---
|
|
4536
|
+
description: ${JSON.stringify(builtin.description)}
|
|
4537
|
+
icon: ${JSON.stringify(builtin.icon)}
|
|
4538
|
+
---
|
|
4539
|
+
|
|
4540
|
+
# ${builtin.name}
|
|
4541
|
+
` : `# ${slug}
|
|
4542
|
+
`;
|
|
4543
|
+
const needsTitleHeal = Boolean(builtin && (!existing?.title || existing.title === builtin.slug));
|
|
4544
|
+
const needsRawHeal = Boolean(
|
|
4545
|
+
existing && needsTitleHeal && existing.rawContent.trim() === `# ${builtin.slug}`
|
|
4546
|
+
);
|
|
4547
|
+
const base = existing ? {
|
|
4548
|
+
...existing,
|
|
4549
|
+
...needsTitleHeal ? { title: builtin.name } : {},
|
|
4550
|
+
...needsRawHeal ? {
|
|
4551
|
+
rawContent: canonicalRawContent,
|
|
4552
|
+
sourceRevision: (existing.sourceRevision ?? 0) + 1
|
|
4553
|
+
} : {}
|
|
4554
|
+
} : {
|
|
4468
4555
|
id: notebookId,
|
|
4469
|
-
title:
|
|
4470
|
-
rawContent:
|
|
4471
|
-
`,
|
|
4556
|
+
title: canonicalTitle,
|
|
4557
|
+
rawContent: canonicalRawContent,
|
|
4472
4558
|
sourceRevision: 1,
|
|
4473
4559
|
blocks: {},
|
|
4474
4560
|
createdAt: Date.now(),
|
|
@@ -8620,6 +8706,7 @@ exports.csvToTelemetryBundle = csvToTelemetryBundle;
|
|
|
8620
8706
|
exports.decodeUtf8 = decodeUtf8;
|
|
8621
8707
|
exports.defineLanguagePack = defineLanguagePack;
|
|
8622
8708
|
exports.deleteFeedSourceHeadless = deleteFeedSourceHeadless;
|
|
8709
|
+
exports.deleteScopedPropertyOverride = deleteScopedPropertyOverride;
|
|
8623
8710
|
exports.deleteUserNotebook = deleteUserNotebook;
|
|
8624
8711
|
exports.effortToMarkdown = effortToMarkdown;
|
|
8625
8712
|
exports.emptySeedMeta = emptySeedMeta;
|
|
@@ -8688,6 +8775,7 @@ exports.renderFeedLandingHtml = renderFeedLandingHtml;
|
|
|
8688
8775
|
exports.resolveScopedPropertyCatalog = resolveScopedPropertyCatalog;
|
|
8689
8776
|
exports.resolveSessionCivilDate = resolveSessionCivilDate;
|
|
8690
8777
|
exports.resolveUpstreamProvenance = resolveUpstreamProvenance;
|
|
8778
|
+
exports.resolveUserNotebookSlug = resolveUserNotebookSlug;
|
|
8691
8779
|
exports.round1 = round1;
|
|
8692
8780
|
exports.saveScopedPropertyOverride = saveScopedPropertyOverride;
|
|
8693
8781
|
exports.scheduleNoteOnDate = scheduleNoteOnDate;
|