@bitcobblers/wod-wiki-engine 0.59.2236 → 0.59.2238
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 +396 -59
- package/dist/agent.cjs.map +1 -1
- package/dist/agent.d.cts +103 -25
- package/dist/agent.d.ts +103 -25
- package/dist/agent.mjs +153 -43
- package/dist/agent.mjs.map +1 -1
- package/dist/{chunk-KQYTRLW3.mjs → chunk-YUFWRUL6.mjs} +235 -26
- package/dist/chunk-YUFWRUL6.mjs.map +1 -0
- package/dist/index.cjs +239 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -9
- package/dist/index.d.ts +13 -9
- package/dist/index.mjs +1 -1
- package/dist/{ir-CKImc4T0.d.cts → ir-CQnh_Tid.d.cts} +42 -1
- package/dist/{ir-CKImc4T0.d.ts → ir-CQnh_Tid.d.ts} +42 -1
- package/package.json +5 -5
- package/dist/chunk-KQYTRLW3.mjs.map +0 -1
package/dist/agent.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extractNoteIdentity, extractTypedTags, makeNotebookLinkId, resolveScopedPropertyCatalog, effortToMarkdown, equipmentToMarkdown, saveScopedPropertyOverride, seedMetaKey, checkUnpublishedFeedChanges, MemoryFeedTree, publishFeedFromStorage, ingestPortableFilesIntoStorage, exportPortableFilesFromStorage, readFrontmatterMeta, createUserNotebookLanding, setNotebookPublic, promoteNoteToNotebooks, removeNoteFromNotebook, getNoteNotebooks, resolveUpstreamProvenance, getNotePublicationSummary, composeNoteMarkdown, buildNoteProvenance, buildStatementTree, prepareJournalSessionRun, setSessionPublic } from './chunk-
|
|
1
|
+
import { extractNoteIdentity, extractTypedTags, makeNotebookLinkId, resolveScopedPropertyCatalog, effortToMarkdown, equipmentToMarkdown, saveScopedPropertyOverride, listFeedSubscriptionsHeadless, seedMetaKey, subscribeFeedSourceHeadless, unsubscribeFeedSourceHeadless, deleteFeedSourceHeadless, checkUnpublishedFeedChanges, MemoryFeedTree, publishFeedFromStorage, ingestPortableFilesIntoStorage, exportPortableFilesFromStorage, readFrontmatterMeta, createUserNotebookLanding, setNotebookPublic, promoteNoteToNotebooks, removeNoteFromNotebook, getNoteNotebooks, resolveUpstreamProvenance, getNotePublicationSummary, composeNoteMarkdown, buildNoteProvenance, buildStatementTree, prepareJournalSessionRun, setSessionPublic } from './chunk-YUFWRUL6.mjs';
|
|
2
2
|
import { BUILTIN_NOTEBOOKS, parseDocumentSections, KNOWN_SECTION_WIDGETS, isNoteEditable, reconcileNoteBlocks, validateNoteBlocks, toNotebookId, blockContentId, MetricType, orderPlacements, isSystemReadOnlyNotebook, 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';
|
|
@@ -629,7 +629,7 @@ function noteDeepLink(note, baseUrl = "") {
|
|
|
629
629
|
const prefix = baseUrl.replace(/\/+$/, "");
|
|
630
630
|
return `${prefix}/note/${encodeURIComponent(note.id)}`;
|
|
631
631
|
}
|
|
632
|
-
var catalogLookupInputSchema = z.
|
|
632
|
+
var catalogLookupInputSchema = z.strictObject({
|
|
633
633
|
kind: z.enum(["effort", "equipment", "tag", "tag-type"]).describe("Catalog family to search or inspect."),
|
|
634
634
|
search: z.string().optional().describe("Case-insensitive slug, label, or alias filter."),
|
|
635
635
|
slug: z.string().optional().describe("Exact canonical slug/name to look up."),
|
|
@@ -729,7 +729,7 @@ var wodCatalogLookupTool = defineAgentTool({
|
|
|
729
729
|
};
|
|
730
730
|
}
|
|
731
731
|
});
|
|
732
|
-
var catalogUpsertInputSchema = z.
|
|
732
|
+
var catalogUpsertInputSchema = z.strictObject({
|
|
733
733
|
kind: z.enum(["effort", "equipment", "tag", "tag-type"]).describe("Property definition family to create or override."),
|
|
734
734
|
slug: z.string().min(1).describe('Canonical kebab-case slug (e.g. "kettlebell-swing", "barbell").'),
|
|
735
735
|
label: z.string().optional().describe("Human-readable display label."),
|
|
@@ -841,13 +841,17 @@ var wodCatalogUpsertTool = defineAgentTool({
|
|
|
841
841
|
}
|
|
842
842
|
});
|
|
843
843
|
var CATALOG_AGENT_TOOLS = [wodCatalogLookupTool, wodCatalogUpsertTool];
|
|
844
|
-
var feedManageInputSchema = z.
|
|
845
|
-
action: z.enum(["list", "status", "publish", "import-bundle"]).describe("Feed or portability operation to run."),
|
|
844
|
+
var feedManageInputSchema = z.strictObject({
|
|
845
|
+
action: z.enum(["list", "status", "publish", "import-bundle", "subscribe", "unsubscribe", "delete"]).describe("Feed or portability operation to run."),
|
|
846
|
+
sourceId: z.string().min(1).optional().describe('Target Feed source ID when action is "subscribe", "unsubscribe", or "delete".'),
|
|
847
|
+
notebookIds: z.array(z.string().min(1)).optional().describe('Optional subset of Notebook IDs when action="subscribe".'),
|
|
848
|
+
url: z.string().min(1).optional().describe("Optional Feed manifest URL when subscribing to a custom source."),
|
|
849
|
+
confirmId: z.string().optional().describe("Confirmation token (must match sourceId) for non-interactive unsubscribe/delete calls."),
|
|
846
850
|
notebookSlug: z.string().optional().describe("Optional Notebook slug filter when publishing."),
|
|
847
|
-
name: z.string().optional().describe("Optional Feed display name when publishing."),
|
|
851
|
+
name: z.string().optional().describe("Optional Feed display name when publishing or subscribing."),
|
|
848
852
|
description: z.string().optional().describe("Optional Feed description when publishing."),
|
|
849
853
|
files: z.array(
|
|
850
|
-
z.
|
|
854
|
+
z.strictObject({
|
|
851
855
|
path: z.string().min(1),
|
|
852
856
|
content: z.string()
|
|
853
857
|
})
|
|
@@ -856,7 +860,7 @@ var feedManageInputSchema = z.object({
|
|
|
856
860
|
var wodFeedManageTool = defineAgentTool({
|
|
857
861
|
name: "wod_feed_manage",
|
|
858
862
|
title: "Manage Feeds & Portability",
|
|
859
|
-
description: "Inspect installed Seed/Feed sources (`list`), check unpublished public Notebook changes (`status`), compile and publish public Notebooks (`publish`),
|
|
863
|
+
description: "Inspect installed Seed/Feed sources (`list`), check unpublished public Notebook changes (`status`), compile and publish public Notebooks (`publish`), import portable Markdown + JSONL/CSV files (`import-bundle`), or subscribe/unsubscribe/delete a Feed source.",
|
|
860
864
|
tier: 1,
|
|
861
865
|
domain: "feed",
|
|
862
866
|
annotations: {
|
|
@@ -867,27 +871,120 @@ var wodFeedManageTool = defineAgentTool({
|
|
|
867
871
|
openWorldHint: false
|
|
868
872
|
},
|
|
869
873
|
inputSchema: feedManageInputSchema,
|
|
870
|
-
cliEquivalent: "wod feed <list|status|publish> --json",
|
|
874
|
+
cliEquivalent: "wod feed <list|status|publish|subscribe|unsubscribe|delete> --json",
|
|
871
875
|
async execute(args, ctx) {
|
|
872
876
|
if (args.action === "list") {
|
|
873
877
|
const metaRows = await ctx.storage.readonly("meta").getAll();
|
|
878
|
+
const subscriptions = await listFeedSubscriptionsHeadless(ctx.storage);
|
|
874
879
|
const installedFeeds = [];
|
|
875
880
|
for (const row of metaRows) {
|
|
876
881
|
const obj = row;
|
|
877
882
|
if (typeof obj.key === "string" && obj.key.startsWith("seed:") && obj.key !== seedMetaKey("user")) {
|
|
883
|
+
const sourceId = obj.key.slice("seed:".length);
|
|
878
884
|
installedFeeds.push({
|
|
879
|
-
sourceId
|
|
885
|
+
sourceId,
|
|
880
886
|
seedVersion: obj.seedVersion,
|
|
881
887
|
builtAt: obj.builtAt,
|
|
882
888
|
importedAt: obj.importedAt,
|
|
883
|
-
chunkCount: Object.keys(obj.chunks ?? {}).length
|
|
889
|
+
chunkCount: Object.keys(obj.chunks ?? {}).length,
|
|
890
|
+
subscribed: subscriptions[sourceId]?.subscribed ?? true
|
|
884
891
|
});
|
|
885
892
|
}
|
|
886
893
|
}
|
|
887
894
|
return {
|
|
888
895
|
action: "list",
|
|
889
896
|
installedCount: installedFeeds.length,
|
|
890
|
-
feeds: installedFeeds
|
|
897
|
+
feeds: installedFeeds,
|
|
898
|
+
subscriptions
|
|
899
|
+
};
|
|
900
|
+
}
|
|
901
|
+
if (args.action === "subscribe") {
|
|
902
|
+
if (!args.sourceId) {
|
|
903
|
+
throw new Error('Provide `sourceId` when action="subscribe".');
|
|
904
|
+
}
|
|
905
|
+
const res = ctx.feedLifecycle?.subscribe ? await ctx.feedLifecycle.subscribe(args.sourceId, {
|
|
906
|
+
notebookIds: args.notebookIds,
|
|
907
|
+
url: args.url,
|
|
908
|
+
name: args.name
|
|
909
|
+
}) : await subscribeFeedSourceHeadless(ctx.storage, args.sourceId, {
|
|
910
|
+
notebookIds: args.notebookIds,
|
|
911
|
+
url: args.url,
|
|
912
|
+
name: args.name
|
|
913
|
+
});
|
|
914
|
+
await ctx.onMutated?.(["meta", "notes"]);
|
|
915
|
+
return {
|
|
916
|
+
action: "subscribe",
|
|
917
|
+
...res
|
|
918
|
+
};
|
|
919
|
+
}
|
|
920
|
+
if (args.action === "unsubscribe") {
|
|
921
|
+
if (!args.sourceId) {
|
|
922
|
+
throw new Error('Provide `sourceId` when action="unsubscribe".');
|
|
923
|
+
}
|
|
924
|
+
if (args.sourceId === "core") {
|
|
925
|
+
throw new Error("Core feed cannot be unsubscribed.");
|
|
926
|
+
}
|
|
927
|
+
await requireDestructiveConfirmation(
|
|
928
|
+
ctx,
|
|
929
|
+
{
|
|
930
|
+
action: "wod_feed_manage:unsubscribe",
|
|
931
|
+
targetId: args.sourceId,
|
|
932
|
+
summary: `Unsubscribe from feed '${args.sourceId}' and purge its imported notes`
|
|
933
|
+
},
|
|
934
|
+
args.confirmId
|
|
935
|
+
);
|
|
936
|
+
const res = ctx.feedLifecycle?.unsubscribe ? await ctx.feedLifecycle.unsubscribe(args.sourceId) : await unsubscribeFeedSourceHeadless(ctx.storage, args.sourceId);
|
|
937
|
+
await ctx.onMutated?.([
|
|
938
|
+
"meta",
|
|
939
|
+
"notes",
|
|
940
|
+
"tags",
|
|
941
|
+
"note_tags",
|
|
942
|
+
"block_index",
|
|
943
|
+
"block_efforts",
|
|
944
|
+
"block_equipment",
|
|
945
|
+
"page_notes",
|
|
946
|
+
"efforts",
|
|
947
|
+
"equipment",
|
|
948
|
+
"property_overrides"
|
|
949
|
+
]);
|
|
950
|
+
return {
|
|
951
|
+
action: "unsubscribe",
|
|
952
|
+
...res
|
|
953
|
+
};
|
|
954
|
+
}
|
|
955
|
+
if (args.action === "delete") {
|
|
956
|
+
if (!args.sourceId) {
|
|
957
|
+
throw new Error('Provide `sourceId` when action="delete".');
|
|
958
|
+
}
|
|
959
|
+
if (args.sourceId === "core") {
|
|
960
|
+
throw new Error("Core feed cannot be deleted.");
|
|
961
|
+
}
|
|
962
|
+
await requireDestructiveConfirmation(
|
|
963
|
+
ctx,
|
|
964
|
+
{
|
|
965
|
+
action: "wod_feed_manage:delete",
|
|
966
|
+
targetId: args.sourceId,
|
|
967
|
+
summary: `Delete feed source '${args.sourceId}' and purge all of its imported notes`
|
|
968
|
+
},
|
|
969
|
+
args.confirmId
|
|
970
|
+
);
|
|
971
|
+
const res = ctx.feedLifecycle?.delete ? await ctx.feedLifecycle.delete(args.sourceId) : await deleteFeedSourceHeadless(ctx.storage, args.sourceId);
|
|
972
|
+
await ctx.onMutated?.([
|
|
973
|
+
"meta",
|
|
974
|
+
"notes",
|
|
975
|
+
"tags",
|
|
976
|
+
"note_tags",
|
|
977
|
+
"block_index",
|
|
978
|
+
"block_efforts",
|
|
979
|
+
"block_equipment",
|
|
980
|
+
"page_notes",
|
|
981
|
+
"efforts",
|
|
982
|
+
"equipment",
|
|
983
|
+
"property_overrides"
|
|
984
|
+
]);
|
|
985
|
+
return {
|
|
986
|
+
action: "delete",
|
|
987
|
+
...res
|
|
891
988
|
};
|
|
892
989
|
}
|
|
893
990
|
if (args.action === "status") {
|
|
@@ -936,7 +1033,7 @@ var wodFeedManageTool = defineAgentTool({
|
|
|
936
1033
|
};
|
|
937
1034
|
}
|
|
938
1035
|
});
|
|
939
|
-
var exportBundleInputSchema = z.
|
|
1036
|
+
var exportBundleInputSchema = z.strictObject({
|
|
940
1037
|
noteIds: z.array(z.string()).optional().describe("Optional Note IDs to export (defaults to all user-owned Notes)."),
|
|
941
1038
|
telemetryFormat: z.enum(["jsonl", "csv", "both"]).optional().describe('Format for companion Session/Event telemetry files (default "jsonl").')
|
|
942
1039
|
});
|
|
@@ -966,7 +1063,7 @@ var wodExportBundleTool = defineAgentTool({
|
|
|
966
1063
|
};
|
|
967
1064
|
}
|
|
968
1065
|
});
|
|
969
|
-
var resetStorageInputSchema = z.
|
|
1066
|
+
var resetStorageInputSchema = z.strictObject({
|
|
970
1067
|
confirmToken: z.string().optional().describe('For non-interactive MCP/CLI calls, pass confirmToken="WIPE_STORAGE" to confirm wiping user storage.')
|
|
971
1068
|
});
|
|
972
1069
|
var wodResetStorageTool = defineAgentTool({
|
|
@@ -1004,7 +1101,7 @@ var FEED_AGENT_TOOLS = [
|
|
|
1004
1101
|
wodExportBundleTool,
|
|
1005
1102
|
wodResetStorageTool
|
|
1006
1103
|
];
|
|
1007
|
-
var journalDayInputSchema = z.
|
|
1104
|
+
var journalDayInputSchema = z.strictObject({
|
|
1008
1105
|
date: z.string().optional().describe('Calendar date in YYYY-MM-DD format, or "today" (defaults to "today").')
|
|
1009
1106
|
});
|
|
1010
1107
|
var wodJournalDayTool = defineAgentTool({
|
|
@@ -1099,7 +1196,7 @@ var wodJournalDayTool = defineAgentTool({
|
|
|
1099
1196
|
};
|
|
1100
1197
|
}
|
|
1101
1198
|
});
|
|
1102
|
-
var journalAddInputSchema = z.
|
|
1199
|
+
var journalAddInputSchema = z.strictObject({
|
|
1103
1200
|
date: z.string().optional().describe('Target Journal date in YYYY-MM-DD format or "today" (defaults to "today").'),
|
|
1104
1201
|
title: z.string().optional().describe("Workout title (defaults to # H1 heading or date)."),
|
|
1105
1202
|
content: z.string().min(1).describe("Markdown workout note or bare Whiteboard Script to schedule onto the Journal day."),
|
|
@@ -1163,7 +1260,7 @@ function isLandingNote(note) {
|
|
|
1163
1260
|
return note.id.startsWith("notebook/") && note.notebookId === note.id;
|
|
1164
1261
|
}
|
|
1165
1262
|
var RESERVED_SLUGS = new Set(BUILTIN_NOTEBOOKS.map((b) => b.slug));
|
|
1166
|
-
var notebookListInputSchema = z.
|
|
1263
|
+
var notebookListInputSchema = z.strictObject({
|
|
1167
1264
|
origin: z.enum(["all", "default", "user", "feed"]).optional().describe('Filter notebooks by origin (default "all").')
|
|
1168
1265
|
});
|
|
1169
1266
|
var wodNotebookListTool = defineAgentTool({
|
|
@@ -1250,7 +1347,7 @@ var wodNotebookListTool = defineAgentTool({
|
|
|
1250
1347
|
};
|
|
1251
1348
|
}
|
|
1252
1349
|
});
|
|
1253
|
-
var notebookSaveInputSchema = z.
|
|
1350
|
+
var notebookSaveInputSchema = z.strictObject({
|
|
1254
1351
|
action: z.enum(["create", "update", "promote", "detach", "set-public"]).describe("Operation to perform on a user Notebook."),
|
|
1255
1352
|
notebookId: z.string().optional().describe("Target Notebook slug or ID (required for update, promote, detach, set-public)."),
|
|
1256
1353
|
name: z.string().optional().describe("Display name when creating or renaming a Notebook."),
|
|
@@ -1379,7 +1476,7 @@ icon: ${JSON.stringify(nextIcon)}
|
|
|
1379
1476
|
};
|
|
1380
1477
|
}
|
|
1381
1478
|
});
|
|
1382
|
-
var notebookDeleteInputSchema = z.
|
|
1479
|
+
var notebookDeleteInputSchema = z.strictObject({
|
|
1383
1480
|
notebookId: z.string().min(1).describe("User Notebook ID or slug to delete (member Notes stay safe in notebook/journal)."),
|
|
1384
1481
|
confirmId: z.string().optional().describe("For non-interactive MCP/CLI calls, repeat the exact notebookId or slug to confirm deletion.")
|
|
1385
1482
|
});
|
|
@@ -1450,7 +1547,7 @@ var NOTEBOOK_AGENT_TOOLS = [
|
|
|
1450
1547
|
function isLandingNote2(note) {
|
|
1451
1548
|
return note.id.startsWith("notebook/") && note.notebookId === note.id;
|
|
1452
1549
|
}
|
|
1453
|
-
var noteListInputSchema = z.
|
|
1550
|
+
var noteListInputSchema = z.strictObject({
|
|
1454
1551
|
notebookId: z.string().optional().describe('Filter by notebook ID or slug (e.g. "journal", "custom", "guides", "notebook/strength").'),
|
|
1455
1552
|
search: z.string().optional().describe("Case-insensitive substring filter over title and Markdown content."),
|
|
1456
1553
|
tag: z.string().optional().describe("Filter to Notes carrying this tag label."),
|
|
@@ -1473,23 +1570,30 @@ var wodNoteListTool = defineAgentTool({
|
|
|
1473
1570
|
inputSchema: noteListInputSchema,
|
|
1474
1571
|
cliEquivalent: "wod note list --json",
|
|
1475
1572
|
async execute(args, ctx) {
|
|
1476
|
-
const allNotes = await ctx.storage.readonly("notes").getAll();
|
|
1477
1573
|
const targetNb = args.notebookId ? toNotebookId(args.notebookId) : void 0;
|
|
1478
1574
|
const includeSeed = args.includeSeed ?? Boolean(targetNb);
|
|
1479
1575
|
const searchLower = args.search?.trim().toLowerCase();
|
|
1480
1576
|
const tagLower = args.tag?.trim().toLowerCase();
|
|
1481
1577
|
const limit = args.limit ?? 50;
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
)
|
|
1489
|
-
|
|
1490
|
-
|
|
1578
|
+
const { allNotes, linkedNoteIdsForNb } = await ctx.storage.transaction(
|
|
1579
|
+
["notes", "notebook_links"],
|
|
1580
|
+
"readonly",
|
|
1581
|
+
async (tx) => {
|
|
1582
|
+
const notes = await tx.readonly("notes").getAll();
|
|
1583
|
+
let linkedIds;
|
|
1584
|
+
if (targetNb) {
|
|
1585
|
+
try {
|
|
1586
|
+
const links = await tx.readonly("notebook_links").getAllFromIndex("by-notebook", targetNb);
|
|
1587
|
+
linkedIds = new Set(
|
|
1588
|
+
links.filter((l) => l.targetKind === "note").map((l) => l.noteId)
|
|
1589
|
+
);
|
|
1590
|
+
} catch {
|
|
1591
|
+
linkedIds = /* @__PURE__ */ new Set();
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
return { allNotes: notes, linkedNoteIdsForNb: linkedIds };
|
|
1491
1595
|
}
|
|
1492
|
-
|
|
1596
|
+
);
|
|
1493
1597
|
const filtered = allNotes.filter((n) => {
|
|
1494
1598
|
if (isLandingNote2(n)) return false;
|
|
1495
1599
|
if (!includeSeed && (n.seedOrigin === "seed" || n.feedOrigin === "feed")) return false;
|
|
@@ -1526,7 +1630,7 @@ var wodNoteListTool = defineAgentTool({
|
|
|
1526
1630
|
};
|
|
1527
1631
|
}
|
|
1528
1632
|
});
|
|
1529
|
-
var noteGetInputSchema = z.
|
|
1633
|
+
var noteGetInputSchema = z.strictObject({
|
|
1530
1634
|
noteId: z.string().min(1).describe("Unique Note ID (UUID or seed route ID).")
|
|
1531
1635
|
});
|
|
1532
1636
|
var wodNoteGetTool = defineAgentTool({
|
|
@@ -1602,7 +1706,7 @@ var wodNoteGetTool = defineAgentTool({
|
|
|
1602
1706
|
};
|
|
1603
1707
|
}
|
|
1604
1708
|
});
|
|
1605
|
-
var noteUpsertInputSchema = z.
|
|
1709
|
+
var noteUpsertInputSchema = z.strictObject({
|
|
1606
1710
|
noteId: z.string().optional().describe("Existing Note ID to update, or omit to create a new Note."),
|
|
1607
1711
|
title: z.string().optional().describe("Note title (defaults to # H1 heading in content)."),
|
|
1608
1712
|
content: z.string().min(1).describe("Full Markdown document or Whiteboard Script body."),
|
|
@@ -1662,7 +1766,7 @@ var wodNoteUpsertTool = defineAgentTool({
|
|
|
1662
1766
|
};
|
|
1663
1767
|
}
|
|
1664
1768
|
});
|
|
1665
|
-
var noteCloneInputSchema = z.
|
|
1769
|
+
var noteCloneInputSchema = z.strictObject({
|
|
1666
1770
|
sourceNoteId: z.string().min(1).describe("Source Note ID (including read-only Seed/Feed Notes) to clone."),
|
|
1667
1771
|
targetNotebookId: z.string().optional().describe('Target writable user Notebook ID/slug (defaults to "notebook/journal").'),
|
|
1668
1772
|
title: z.string().optional().describe("Optional title override for the cloned Note."),
|
|
@@ -1729,7 +1833,7 @@ var wodNoteCloneTool = defineAgentTool({
|
|
|
1729
1833
|
};
|
|
1730
1834
|
}
|
|
1731
1835
|
});
|
|
1732
|
-
var noteDeleteInputSchema = z.
|
|
1836
|
+
var noteDeleteInputSchema = z.strictObject({
|
|
1733
1837
|
noteId: z.string().min(1).describe("ID of the Note to delete."),
|
|
1734
1838
|
confirmId: z.string().optional().describe("For non-interactive MCP/CLI calls, repeat the exact noteId to confirm deletion.")
|
|
1735
1839
|
});
|
|
@@ -1800,7 +1904,7 @@ function collectCollectibles(node, out = []) {
|
|
|
1800
1904
|
}
|
|
1801
1905
|
return out;
|
|
1802
1906
|
}
|
|
1803
|
-
var parseScriptInputSchema = z.
|
|
1907
|
+
var parseScriptInputSchema = z.strictObject({
|
|
1804
1908
|
source: z.string().min(1).describe("Whiteboard Script body OR full Markdown document containing ```time / ```wod blocks."),
|
|
1805
1909
|
sport: z.string().optional().describe('Optional sport fence dialect override (e.g. "crossfit", "climbing", "running").'),
|
|
1806
1910
|
save: z.boolean().optional().describe("Default false (dry-run syntax & metric inspection). Set true to persist as a Note."),
|
|
@@ -1914,7 +2018,7 @@ function applyCollectibleOverrides(body, overrides) {
|
|
|
1914
2018
|
}
|
|
1915
2019
|
return updated;
|
|
1916
2020
|
}
|
|
1917
|
-
var sessionRunHeadlessInputSchema = z.
|
|
2021
|
+
var sessionRunHeadlessInputSchema = z.strictObject({
|
|
1918
2022
|
noteId: z.string().optional().describe("Existing Note ID to execute (read-only Seed/Feed Notes are automatically cloned to notebook/journal)."),
|
|
1919
2023
|
blockId: z.string().optional().describe("Optional workout block ID on `noteId` (defaults to first wod block)."),
|
|
1920
2024
|
source: z.string().optional().describe("Inline Whiteboard Script or Markdown to persist & run when `noteId` is not supplied."),
|
|
@@ -2068,7 +2172,7 @@ var wodSessionRunHeadlessTool = defineAgentTool({
|
|
|
2068
2172
|
};
|
|
2069
2173
|
}
|
|
2070
2174
|
});
|
|
2071
|
-
var sessionListInputSchema = z.
|
|
2175
|
+
var sessionListInputSchema = z.strictObject({
|
|
2072
2176
|
noteId: z.string().optional().describe("Filter Sessions by owning Note ID."),
|
|
2073
2177
|
completedOnly: z.boolean().optional().describe("Filter to completed Sessions only."),
|
|
2074
2178
|
limit: z.number().int().min(1).max(200).optional().describe("Max Sessions to return (default 50).")
|
|
@@ -2130,7 +2234,7 @@ var wodSessionListTool = defineAgentTool({
|
|
|
2130
2234
|
};
|
|
2131
2235
|
}
|
|
2132
2236
|
});
|
|
2133
|
-
var sessionGetInputSchema = z.
|
|
2237
|
+
var sessionGetInputSchema = z.strictObject({
|
|
2134
2238
|
sessionId: z.string().min(1).describe("Session ID to inspect.")
|
|
2135
2239
|
});
|
|
2136
2240
|
var wodSessionGetTool = defineAgentTool({
|
|
@@ -2169,7 +2273,7 @@ var wodSessionGetTool = defineAgentTool({
|
|
|
2169
2273
|
};
|
|
2170
2274
|
}
|
|
2171
2275
|
});
|
|
2172
|
-
var sessionDeleteInputSchema = z.
|
|
2276
|
+
var sessionDeleteInputSchema = z.strictObject({
|
|
2173
2277
|
sessionId: z.string().min(1).describe("Session ID to delete."),
|
|
2174
2278
|
confirmId: z.string().optional().describe("For non-interactive MCP/CLI calls, repeat the exact sessionId to confirm deletion.")
|
|
2175
2279
|
});
|
|
@@ -2215,7 +2319,7 @@ var SESSION_AGENT_TOOLS = [
|
|
|
2215
2319
|
wodSessionGetTool,
|
|
2216
2320
|
wodSessionDeleteTool
|
|
2217
2321
|
];
|
|
2218
|
-
var validateWqlInputSchema = z.
|
|
2322
|
+
var validateWqlInputSchema = z.strictObject({
|
|
2219
2323
|
query: z.string().describe('WQL query string to validate and inspect (e.g. ":note{notebook:journal} last 7d" or "sum:volume by {effort}").'),
|
|
2220
2324
|
targetHint: z.string().optional().describe("Optional target plane to list valid filter keys & grouping dimensions for (note, session, effort, equipment, tag, feed, block, event).")
|
|
2221
2325
|
});
|
|
@@ -2254,7 +2358,7 @@ var wodValidateWqlTool = defineAgentTool({
|
|
|
2254
2358
|
};
|
|
2255
2359
|
}
|
|
2256
2360
|
});
|
|
2257
|
-
var queryWqlInputSchema = z.
|
|
2361
|
+
var queryWqlInputSchema = z.strictObject({
|
|
2258
2362
|
query: z.string().min(1).describe('WQL query expression (e.g. ":note{notebook:journal}", ":session last 30d", "sum:volume by {week}").'),
|
|
2259
2363
|
preferredUnit: z.string().optional().describe('Optional display unit conversion preference (e.g. "lb", "kg", "m", "mi").'),
|
|
2260
2364
|
limit: z.number().int().min(1).max(500).optional().describe("Maximum rows/items to return in the response payload (default 100).")
|
|
@@ -2640,6 +2744,7 @@ function zodSchemaToJsonSchema(schema) {
|
|
|
2640
2744
|
return z.toJSONSchema(schema, { target: "draft-2020-12" });
|
|
2641
2745
|
}
|
|
2642
2746
|
function exportAgentCapabilitiesManifest(options) {
|
|
2747
|
+
const isStatic = options?.deploymentTarget === "static";
|
|
2643
2748
|
return {
|
|
2644
2749
|
schemaVersion: "1.0.0",
|
|
2645
2750
|
name: "WOD Wiki Agent Surface",
|
|
@@ -2650,7 +2755,12 @@ function exportAgentCapabilitiesManifest(options) {
|
|
|
2650
2755
|
globalNamespace: "navigator.modelContext",
|
|
2651
2756
|
library: "@mcp-b/react-webmcp"
|
|
2652
2757
|
},
|
|
2653
|
-
mcp: {
|
|
2758
|
+
mcp: isStatic ? {
|
|
2759
|
+
httpEndpoint: null,
|
|
2760
|
+
stdioCommand: "wod mcp",
|
|
2761
|
+
sdk: "@modelcontextprotocol/sdk",
|
|
2762
|
+
deploymentNote: "HTTP /api/mcp is only mounted on self-hosted `wod server` deployments, not on static hosting."
|
|
2763
|
+
} : {
|
|
2654
2764
|
httpEndpoint: "/api/mcp",
|
|
2655
2765
|
stdioCommand: "wod mcp",
|
|
2656
2766
|
sdk: "@modelcontextprotocol/sdk"
|