@mulmoclaude/core 0.28.0 → 0.30.0
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/assets/helps/collection-skills.md +18 -4
- package/dist/collection/core/backlinks.d.ts +28 -2
- package/dist/collection/core/ontologyGraph.d.ts +6 -2
- package/dist/collection/index.cjs +2 -1
- package/dist/collection/index.cjs.map +1 -1
- package/dist/collection/index.js +2 -2
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/registry/server/index.cjs +2 -2
- package/dist/collection/registry/server/index.js +2 -2
- package/dist/collection/server/backendAvailability.d.ts +5 -0
- package/dist/collection/server/index.cjs +4 -2
- package/dist/collection/server/index.d.ts +1 -0
- package/dist/collection/server/index.js +3 -3
- package/dist/collection/server/manageTool.d.ts +4 -0
- package/dist/collection/server/schemaDocs.d.ts +21 -0
- package/dist/collection/server/store.d.ts +37 -0
- package/dist/collection/server/watchFs.d.ts +17 -0
- package/dist/collection-watchers/index.cjs +114 -203
- package/dist/collection-watchers/index.cjs.map +1 -1
- package/dist/collection-watchers/index.d.ts +1 -1
- package/dist/collection-watchers/index.js +114 -202
- package/dist/collection-watchers/index.js.map +1 -1
- package/dist/collection-watchers/watcher.d.ts +8 -13
- package/dist/{discovery-BVdCgBFN.js → discovery-BbsJwVEq.js} +109 -8
- package/dist/discovery-BbsJwVEq.js.map +1 -0
- package/dist/{discovery-BKovdRpZ.cjs → discovery-Bklck7Ck.cjs} +119 -6
- package/dist/discovery-Bklck7Ck.cjs.map +1 -0
- 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/{promptSafety-cZIeiZtB.js → promptSafety-Bugq2kqL.js} +40 -5
- package/dist/promptSafety-Bugq2kqL.js.map +1 -0
- package/dist/{promptSafety-BFt2g_wn.cjs → promptSafety-DbE6eZmP.cjs} +45 -4
- package/dist/promptSafety-DbE6eZmP.cjs.map +1 -0
- package/dist/remote-view/index.cjs +8 -0
- package/dist/remote-view/index.cjs.map +1 -1
- package/dist/remote-view/index.d.ts +7 -0
- package/dist/remote-view/index.js +8 -1
- package/dist/remote-view/index.js.map +1 -1
- package/dist/{server-B8mvfZSF.js → server-8EZggEg7.js} +180 -15
- package/dist/server-8EZggEg7.js.map +1 -0
- package/dist/{server-rRQkNBvO.cjs → server-BOiz_HDi.cjs} +180 -15
- package/dist/server-BOiz_HDi.cjs.map +1 -0
- package/dist/whisper/client.cjs.map +1 -1
- package/dist/whisper/client.js.map +1 -1
- package/package.json +1 -1
- package/dist/discovery-BKovdRpZ.cjs.map +0 -1
- package/dist/discovery-BVdCgBFN.js.map +0 -1
- package/dist/promptSafety-BFt2g_wn.cjs.map +0 -1
- package/dist/promptSafety-cZIeiZtB.js.map +0 -1
- package/dist/server-B8mvfZSF.js.map +0 -1
- package/dist/server-rRQkNBvO.cjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-D6vf50IK.cjs");
|
|
2
2
|
const require_errors = require("./errors-7P5eMOSX.cjs");
|
|
3
3
|
const require_ids = require("./ids-DWmHjm17.cjs");
|
|
4
|
-
const require_promptSafety = require("./promptSafety-
|
|
5
|
-
const require_discovery = require("./discovery-
|
|
4
|
+
const require_promptSafety = require("./promptSafety-DbE6eZmP.cjs");
|
|
5
|
+
const require_discovery = require("./discovery-Bklck7Ck.cjs");
|
|
6
6
|
const require_skill_bridge_index = require("./skill-bridge/index.cjs");
|
|
7
7
|
let node_path = require("node:path");
|
|
8
8
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
@@ -545,7 +545,8 @@ async function countRecordFiles(dataDir, workspaceRoot) {
|
|
|
545
545
|
async function countRecords(collection, workspaceRoot) {
|
|
546
546
|
if (require_ids.storageKindFor(collection.schema) !== "file") try {
|
|
547
547
|
return (await require_discovery.storeFor(collection, { workspaceRoot }).page({ limit: 0 })).total;
|
|
548
|
-
} catch {
|
|
548
|
+
} catch (err) {
|
|
549
|
+
if (require_discovery.isBackendUnavailable(err)) return null;
|
|
549
550
|
return 0;
|
|
550
551
|
}
|
|
551
552
|
return countRecordFiles(collection.dataDir, workspaceRoot);
|
|
@@ -1126,6 +1127,151 @@ async function deleteCustomView(collection, viewId, opts = {}) {
|
|
|
1126
1127
|
viewId
|
|
1127
1128
|
};
|
|
1128
1129
|
}
|
|
1130
|
+
/** Ceiling for ANY assembled reply — topic or default — safely inside
|
|
1131
|
+
* the agent's per-result limit (the full doc is what overflowed it).
|
|
1132
|
+
* A matched section too large to fit degrades to its own prose plus a
|
|
1133
|
+
* list of its subsections to fetch individually; an oversized leaf is
|
|
1134
|
+
* clipped outright; the default drops whole core sections into a
|
|
1135
|
+
* pointer note. Sized so the CURRENT bundled doc's default reply
|
|
1136
|
+
* (~33KB) fits without degrading. */
|
|
1137
|
+
var SCHEMA_DOCS_RESULT_BUDGET = 36e3;
|
|
1138
|
+
/** Hard truncation for a body no sectioning trick can shrink further.
|
|
1139
|
+
* The marker tells the agent it did NOT see everything and how to get
|
|
1140
|
+
* the rest, so a silent cut can't read as complete coverage. The limit
|
|
1141
|
+
* is clamped at zero: a negative limit would make `slice(0, limit)`
|
|
1142
|
+
* count from the END and return almost the whole body — the exact
|
|
1143
|
+
* overflow this function exists to prevent. */
|
|
1144
|
+
function clip(text, limit) {
|
|
1145
|
+
const max = Math.max(0, limit);
|
|
1146
|
+
if (text.length <= max) return text;
|
|
1147
|
+
return `${text.slice(0, max)}\n\n[…clipped ${text.length - max} chars — fetch a narrower \`topic\`, or read the doc file directly]`;
|
|
1148
|
+
}
|
|
1149
|
+
/** Slack a budget-spending assembler must reserve for what it adds
|
|
1150
|
+
* AROUND the budgeted pieces — clip markers, join separators, pointer
|
|
1151
|
+
* notes — so the final hard cap doesn't eat the reply's own tail (in
|
|
1152
|
+
* renderDefault's case, the TOC). */
|
|
1153
|
+
var ASSEMBLY_RESERVE = 500;
|
|
1154
|
+
/** The sections every schema author needs, matched against headings so
|
|
1155
|
+
* the doc can be reorganised without touching this list (an unmatched
|
|
1156
|
+
* pattern is simply skipped): what a collection IS, the schema DSL and
|
|
1157
|
+
* its field types, and the create/edit walkthroughs. Advanced sections
|
|
1158
|
+
* (actions, bells, views, dataSource, storage) stay TOC-only. */
|
|
1159
|
+
var CORE_SECTION_PATTERNS = [
|
|
1160
|
+
"anatomy",
|
|
1161
|
+
"skill.md",
|
|
1162
|
+
"the dsl",
|
|
1163
|
+
"field types",
|
|
1164
|
+
"end-to-end",
|
|
1165
|
+
"editing an existing"
|
|
1166
|
+
];
|
|
1167
|
+
/** Backticks stripped + lowercased, so `topic: "dataSource"` matches the
|
|
1168
|
+
* heading "External data (CSV) collections — `dataSource`". */
|
|
1169
|
+
var normalize = (text) => text.toLowerCase().replace(/`/g, "");
|
|
1170
|
+
var sliceLines = (lines, from, until) => lines.slice(from, until).join("\n").trim();
|
|
1171
|
+
/** All `#`–`###` headings, skipping fenced code blocks (a `# comment`
|
|
1172
|
+
* inside an example must not become a section boundary). */
|
|
1173
|
+
function headingLines(lines) {
|
|
1174
|
+
const found = [];
|
|
1175
|
+
let fenced = false;
|
|
1176
|
+
lines.forEach((line, index) => {
|
|
1177
|
+
if (line.trimStart().startsWith("```")) fenced = !fenced;
|
|
1178
|
+
const match = fenced ? null : /^(#{1,3}) (.+)$/.exec(line);
|
|
1179
|
+
if (match) found.push({
|
|
1180
|
+
index,
|
|
1181
|
+
level: match[1].length,
|
|
1182
|
+
heading: match[2].trim()
|
|
1183
|
+
});
|
|
1184
|
+
});
|
|
1185
|
+
return found;
|
|
1186
|
+
}
|
|
1187
|
+
function parseSections(lines) {
|
|
1188
|
+
const heads = headingLines(lines);
|
|
1189
|
+
return heads.map((head, i) => {
|
|
1190
|
+
const closer = heads.slice(i + 1).find((other) => other.level <= head.level);
|
|
1191
|
+
return {
|
|
1192
|
+
level: head.level,
|
|
1193
|
+
heading: head.heading,
|
|
1194
|
+
start: head.index,
|
|
1195
|
+
ownEnd: heads[i + 1]?.index ?? lines.length,
|
|
1196
|
+
deepEnd: closer?.index ?? lines.length
|
|
1197
|
+
};
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1200
|
+
/** Bounded to half the reply budget: every render path appends the TOC,
|
|
1201
|
+
* so a doc with thousands of headings must not blow the ceiling through
|
|
1202
|
+
* the TOC itself — and renderDefault subtracts the TOC's length from
|
|
1203
|
+
* its budget, which must stay positive. */
|
|
1204
|
+
function tableOfContents(sections) {
|
|
1205
|
+
return clip(`Sections (call schemaDocs with \`topic: "<heading>"\` for any of them; \`topic: "all"\` for the full document):\n${sections.map((section) => `${" ".repeat(section.level - 1)}- ${section.heading}`).join("\n")}`, Math.floor(SCHEMA_DOCS_RESULT_BUDGET / 2));
|
|
1206
|
+
}
|
|
1207
|
+
/** The no-topic reply: the doc's intro + the core authoring sections
|
|
1208
|
+
* (own prose only — a core parent's advanced subsections stay TOC-only),
|
|
1209
|
+
* closed by the full table of contents. Budgeted: a core section that
|
|
1210
|
+
* no longer fits is dropped into a pointer note (the first is clipped
|
|
1211
|
+
* instead, so the reply is never bodiless) — an oversized workspace
|
|
1212
|
+
* copy must not recreate the overflow this module exists to prevent. */
|
|
1213
|
+
function renderDefault(lines, sections) {
|
|
1214
|
+
const isCore = (section, index) => index === 0 || CORE_SECTION_PATTERNS.some((pattern) => normalize(section.heading).includes(pattern));
|
|
1215
|
+
const toc = tableOfContents(sections);
|
|
1216
|
+
const parts = [];
|
|
1217
|
+
const skipped = [];
|
|
1218
|
+
let remaining = SCHEMA_DOCS_RESULT_BUDGET - toc.length - ASSEMBLY_RESERVE;
|
|
1219
|
+
for (const section of sections.filter(isCore)) {
|
|
1220
|
+
const body = sliceLines(lines, section.start, section.ownEnd);
|
|
1221
|
+
if (body.length > remaining && parts.length > 0) {
|
|
1222
|
+
skipped.push(section.heading);
|
|
1223
|
+
continue;
|
|
1224
|
+
}
|
|
1225
|
+
const fitted = clip(body, remaining);
|
|
1226
|
+
parts.push(fitted);
|
|
1227
|
+
remaining -= fitted.length;
|
|
1228
|
+
}
|
|
1229
|
+
const note = skipped.length > 0 ? `\n\n[Omitted for size — fetch each with \`topic\`: ${skipped.join(" · ")}]` : "";
|
|
1230
|
+
return `${parts.join("\n\n")}${note}\n\n---\n\n${toc}`;
|
|
1231
|
+
}
|
|
1232
|
+
/** Case-insensitive substring match on headings, minus any match already
|
|
1233
|
+
* contained in another match's subtree (its parent's deep body covers it). */
|
|
1234
|
+
function matchSections(sections, topic) {
|
|
1235
|
+
const needle = normalize(topic).trim();
|
|
1236
|
+
const matched = sections.filter((section) => normalize(section.heading).includes(needle));
|
|
1237
|
+
return matched.filter((section) => !matched.some((other) => other !== section && other.start < section.start && section.deepEnd <= other.deepEnd));
|
|
1238
|
+
}
|
|
1239
|
+
/** One matched section: its whole subtree when that fits the budget,
|
|
1240
|
+
* otherwise its own prose (budget-clipped) + a pointer list of
|
|
1241
|
+
* subsections to fetch — the list clipped to what the prose left over
|
|
1242
|
+
* (thousands of child headings must not overflow through the list
|
|
1243
|
+
* itself) — and a leaf with no subsections to offer is simply clipped. */
|
|
1244
|
+
function renderSection(lines, sections, section, budget) {
|
|
1245
|
+
const deep = sliceLines(lines, section.start, section.deepEnd);
|
|
1246
|
+
if (deep.length <= budget) return deep;
|
|
1247
|
+
const children = sections.filter((child) => child.start > section.start && child.start < section.deepEnd && child.level === section.level + 1);
|
|
1248
|
+
const own = clip(sliceLines(lines, section.start, section.ownEnd), budget);
|
|
1249
|
+
if (children.length === 0) return own;
|
|
1250
|
+
return `${own}\n\nSubsections (too large to include together — fetch each with \`topic\`):\n${clip(children.map((child) => `- ${child.heading}`).join("\n"), budget - own.length)}`;
|
|
1251
|
+
}
|
|
1252
|
+
function renderTopic(lines, sections, topic) {
|
|
1253
|
+
const matched = matchSections(sections, topic);
|
|
1254
|
+
if (matched.length === 0) return `manageCollection: no schemaDocs section matches '${require_promptSafety.defangForPrompt(topic)}'.\n\n${tableOfContents(sections)}`;
|
|
1255
|
+
const perMatch = Math.floor(SCHEMA_DOCS_RESULT_BUDGET / matched.length);
|
|
1256
|
+
return matched.map((section) => renderSection(lines, sections, section, perMatch)).join("\n\n");
|
|
1257
|
+
}
|
|
1258
|
+
/** Render the authoring reference for one schemaDocs call. Small docs and
|
|
1259
|
+
* docs without headings pass through verbatim — there is nothing better
|
|
1260
|
+
* to key a section off. The assembled reply gets one final hard cap: the
|
|
1261
|
+
* inner budgeting degrades gracefully, but per-piece overheads (clip
|
|
1262
|
+
* markers on thousands of matches, join separators, pointer notes) add
|
|
1263
|
+
* up outside any single piece's budget, and the ceiling must hold no
|
|
1264
|
+
* matter what shape of document arrives. Only the explicit \`"all"\`
|
|
1265
|
+
* opt-in and the small-doc verbatim path may exceed it. */
|
|
1266
|
+
function renderSchemaDocs(doc, topic) {
|
|
1267
|
+
const requested = topic?.trim() ?? "";
|
|
1268
|
+
if (normalize(requested) === "all") return doc;
|
|
1269
|
+
if (doc.length <= 2e4) return doc;
|
|
1270
|
+
const lines = doc.split("\n");
|
|
1271
|
+
const sections = parseSections(lines);
|
|
1272
|
+
if (sections.length === 0) return doc;
|
|
1273
|
+
return clip(requested ? renderTopic(lines, sections, requested) : renderDefault(lines, sections), SCHEMA_DOCS_RESULT_BUDGET);
|
|
1274
|
+
}
|
|
1129
1275
|
/** True for a launcher-managed preset slug (`mc-<something>`). The sync logic uses
|
|
1130
1276
|
* this to bound which active skills it may refresh/prune, so user-authored skills are
|
|
1131
1277
|
* never touched. */
|
|
@@ -1197,7 +1343,10 @@ async function loadRequestedItems(collection, ids, deps) {
|
|
|
1197
1343
|
const items = [];
|
|
1198
1344
|
const missing = [];
|
|
1199
1345
|
for (const recordId of ids) {
|
|
1200
|
-
const item = await store.read(recordId).catch(() =>
|
|
1346
|
+
const item = await store.read(recordId).catch((err) => {
|
|
1347
|
+
if (require_discovery.isBackendUnavailable(err)) throw err;
|
|
1348
|
+
return null;
|
|
1349
|
+
});
|
|
1201
1350
|
if (item) items.push(item);
|
|
1202
1351
|
else missing.push(recordId);
|
|
1203
1352
|
}
|
|
@@ -1258,7 +1407,8 @@ async function mergeWithExisting(collection, store, record, itemId) {
|
|
|
1258
1407
|
let existing;
|
|
1259
1408
|
try {
|
|
1260
1409
|
existing = await store.read(itemId);
|
|
1261
|
-
} catch {
|
|
1410
|
+
} catch (err) {
|
|
1411
|
+
if (require_discovery.isBackendUnavailable(err)) throw err;
|
|
1262
1412
|
return `'${itemId}' has a malformed stored file — mode "merge" needs to read it; fix the file (Read → correct → Write) or replace it whole with "upsert"`;
|
|
1263
1413
|
}
|
|
1264
1414
|
if (!existing) return `'${itemId}' not found — mode "merge" updates an existing record; use "upsert" or "create" to add it`;
|
|
@@ -1390,14 +1540,17 @@ async function handleGetOntology(deps) {
|
|
|
1390
1540
|
collections
|
|
1391
1541
|
});
|
|
1392
1542
|
}
|
|
1393
|
-
/** Return the collection-authoring reference (`collection-skills.md`)
|
|
1394
|
-
*
|
|
1395
|
-
*
|
|
1396
|
-
*
|
|
1397
|
-
|
|
1543
|
+
/** Return the collection-authoring reference (`collection-skills.md`),
|
|
1544
|
+
* rendered by `renderSchemaDocs` — the full doc overflows the agent's
|
|
1545
|
+
* per-result limit, so the default reply is the core guide + a table of
|
|
1546
|
+
* contents, and `topic` fetches individual sections. Workspace copy
|
|
1547
|
+
* first (reflects user edits), bundled asset as the always-present
|
|
1548
|
+
* fallback. Both reads guarded; if neither resolves the agent still
|
|
1549
|
+
* gets an actionable message instead of a thrown call. */
|
|
1550
|
+
async function handleSchemaDocs(deps, topic) {
|
|
1398
1551
|
const candidates = [node_path.default.join(resolveBase(deps), HELPS_DIR, SCHEMA_DOCS_FILE), ...deps.bundledHelpsDir ? [node_path.default.join(deps.bundledHelpsDir(), SCHEMA_DOCS_FILE)] : []];
|
|
1399
1552
|
for (const candidate of candidates) try {
|
|
1400
|
-
return await (0, node_fs_promises.readFile)(candidate, "utf-8");
|
|
1553
|
+
return renderSchemaDocs(await (0, node_fs_promises.readFile)(candidate, "utf-8"), topic);
|
|
1401
1554
|
} catch {}
|
|
1402
1555
|
return `manageCollection: could not read the collection-authoring reference (${SCHEMA_DOCS_FILE}).`;
|
|
1403
1556
|
}
|
|
@@ -1476,7 +1629,7 @@ async function handlePutSchema(slug, schemaArg, deps) {
|
|
|
1476
1629
|
written: true
|
|
1477
1630
|
});
|
|
1478
1631
|
}
|
|
1479
|
-
var MANAGE_COLLECTION_PROMPT = "Use `manageCollection` instead of raw Read/Write/Edit when working with a collection's records OR its schema (raw file I/O stays available as the escape hatch). Before authoring or changing a collection's `schema.json`, call `schemaDocs` to load the field/DSL reference,
|
|
1632
|
+
var MANAGE_COLLECTION_PROMPT = "Use `manageCollection` instead of raw Read/Write/Edit when working with a collection's records OR its schema (raw file I/O stays available as the escape hatch). Before authoring or changing a collection's `schema.json`, call `schemaDocs` to load the field/DSL reference — the default reply is the core authoring guide plus a table of contents; fetch advanced sections (actions, bells, calendar/kanban views, dataSource, storage) by passing their heading as `topic` rather than dumping `topic: \"all\"`. Then read with `getSchema` and write with `putSchema` — `putSchema` validates the whole schema before writing and returns actionable errors instead of silently failing discovery's validation. `getItems` is the only way to see computed values — `derived` fields (e.g. a portfolio's value), `toggle` projections, and `embed` records are host-computed and never present in the stored JSON files. On large collections pass `ids` and/or `fields` to keep the result small. For a question that spans collections (\"which clients have unpaid invoices?\"), start with `getOntology`: it lists every collection with its primaryKey, record count, and outbound `ref`/`embed` relations, so you know which collections to join before reading any records. `putItems` validates every row against the schema before writing (required fields, enum values, primaryKey = record id) and returns `{ written, rejected }`; fix each rejected row using its `problem` text and retry just those rows. Never include computed fields in a row you write. To update a few fields of an existing record, use `mode: \"merge\"` with a partial row ({ id, <changed fields> }) — the default upsert replaces the WHOLE record, so a partial upsert would silently erase every optional field it omits. `deleteItems` removes records by id and returns `{ deleted, rejected }`; an id that doesn't exist comes back rejected rather than counted as deleted, so check `rejected` before reporting a deletion as done. Answer aggregation questions (counts, sums, averages, group-bys) with `queryItems` on ANY collection — on a dataSource (CSV) collection it scans the whole file (getItems is row-capped, so aggregates computed from its output can be silently wrong on large files); on a file-backed collection it aggregates the enriched records, so computed fields (derived/rollup/toggle) are queryable columns.";
|
|
1480
1633
|
/** Validate getItems' optional `ids`/`fields` args, then delegate. */
|
|
1481
1634
|
async function dispatchGetItems(collection, args, deps) {
|
|
1482
1635
|
const ids = optionalStringArray(args.ids, "ids");
|
|
@@ -1510,8 +1663,16 @@ async function dispatchRecordAction(action, collection, args, deps) {
|
|
|
1510
1663
|
return typeof parsed === "string" ? parsed : handlePutItems(collection, parsed, deps);
|
|
1511
1664
|
}
|
|
1512
1665
|
async function manageCollectionHandler(deps, args) {
|
|
1666
|
+
try {
|
|
1667
|
+
return await dispatchManageCollection(deps, args);
|
|
1668
|
+
} catch (err) {
|
|
1669
|
+
if (require_discovery.isBackendUnavailable(err)) return `manageCollection: ${err.message}`;
|
|
1670
|
+
throw err;
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
async function dispatchManageCollection(deps, args) {
|
|
1513
1674
|
const action = typeof args.action === "string" ? args.action : "";
|
|
1514
|
-
if (action === "schemaDocs") return handleSchemaDocs(deps);
|
|
1675
|
+
if (action === "schemaDocs") return handleSchemaDocs(deps, typeof args.topic === "string" ? args.topic : void 0);
|
|
1515
1676
|
if (action === "getOntology") return handleGetOntology(deps);
|
|
1516
1677
|
const slug = typeof args.slug === "string" ? args.slug.trim() : "";
|
|
1517
1678
|
if (!slug) return "manageCollection: `slug` is required (the collection's slug).";
|
|
@@ -1524,7 +1685,7 @@ async function manageCollectionHandler(deps, args) {
|
|
|
1524
1685
|
}
|
|
1525
1686
|
var MANAGE_COLLECTION_DEFINITION = {
|
|
1526
1687
|
name: "manageCollection",
|
|
1527
|
-
description: "Read and write a schema-driven collection through the host — both its records and its structure. getItems returns records WITH computed values (derived formulas, toggles, embeds) the stored JSON files don't contain; putItems validates each row against the schema before writing; deleteItems removes records by id. getOntology maps the whole workspace: every collection with its record count and outbound ref/embed relations — call it first for cross-collection questions. schemaDocs returns the collection-authoring reference; getSchema/putSchema read and validate-then-write the collection's schema.json. Prefer it over raw file I/O on collections.",
|
|
1688
|
+
description: "Read and write a schema-driven collection through the host — both its records and its structure. getItems returns records WITH computed values (derived formulas, toggles, embeds) the stored JSON files don't contain; putItems validates each row against the schema before writing; deleteItems removes records by id. getOntology maps the whole workspace: every collection with its record count and outbound ref/embed relations — call it first for cross-collection questions. schemaDocs returns the collection-authoring reference — the core guide plus a table of contents by default; pass `topic` for a specific section. getSchema/putSchema read and validate-then-write the collection's schema.json. Prefer it over raw file I/O on collections.",
|
|
1528
1689
|
inputSchema: {
|
|
1529
1690
|
type: "object",
|
|
1530
1691
|
properties: {
|
|
@@ -1574,6 +1735,10 @@ var MANAGE_COLLECTION_DEFINITION = {
|
|
|
1574
1735
|
type: "object",
|
|
1575
1736
|
description: "putSchema: the full collection schema object (same shape as schema.json — title, icon, dataPath, primaryKey, fields, …). Call getSchema first for the current one, and schemaDocs for the field DSL."
|
|
1576
1737
|
},
|
|
1738
|
+
topic: {
|
|
1739
|
+
type: "string",
|
|
1740
|
+
description: "schemaDocs: fetch one section of the reference by heading (case-insensitive substring — e.g. \"field types\", \"kanban\", \"calendar\", \"dataSource\"). Omit for the core authoring guide plus a table of contents of every section; \"all\" returns the full document (large — it can exceed your tool-result limit)."
|
|
1741
|
+
},
|
|
1577
1742
|
query: {
|
|
1578
1743
|
type: "object",
|
|
1579
1744
|
description: "queryItems: a structured aggregation query — `{ groupBy?: [\"col\"], aggregates?: { alias: { op: \"count\"|\"sum\"|\"avg\"|\"min\"|\"max\", column? } }, where?: [{ field, op, value }], orderBy?: [{ field, dir? }], limit? }`. At least one of groupBy/aggregates. On a dataSource (CSV) collection it scans the WHOLE file uncapped (unlike getItems); on a file-backed collection it aggregates the ENRICHED records, so computed fields (derived/rollup/toggle) are queryable columns. Use it for counts / sums / averages / group-bys instead of arithmetic over getItems output."
|
|
@@ -1760,4 +1925,4 @@ Object.defineProperty(exports, "validateRecordObject", {
|
|
|
1760
1925
|
}
|
|
1761
1926
|
});
|
|
1762
1927
|
|
|
1763
|
-
//# sourceMappingURL=server-
|
|
1928
|
+
//# sourceMappingURL=server-BOiz_HDi.cjs.map
|