@productbrain/mcp 0.0.1-beta.7317 → 0.0.1-beta.7319
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.
|
@@ -6312,6 +6312,8 @@ var COLLECTIONS_ACTIONS = [
|
|
|
6312
6312
|
"label-apply",
|
|
6313
6313
|
"label-remove"
|
|
6314
6314
|
];
|
|
6315
|
+
var STATUS_CATEGORIES = ["draft", "current", "past", "discarded"];
|
|
6316
|
+
var statusListEntrySchema = z16.object({ label: z16.string().max(200), category: z16.enum(STATUS_CATEGORIES) });
|
|
6315
6317
|
var qualityCriterionSchema = z16.object({
|
|
6316
6318
|
field: z16.string().max(200).describe("Entry data field key this criterion applies to, e.g. 'description', 'owner'"),
|
|
6317
6319
|
// WP-480 S1: `max_length` — must mirror the Convex rule union, or the tool rejects a
|
|
@@ -6329,17 +6331,12 @@ var fieldSchema = z16.object({
|
|
|
6329
6331
|
displayHint: z16.enum(["hero", "badge", "meta", "section", "hidden", "inline-meta"]).optional().describe("V2 rendering hint: how the field should be displayed in Cortex"),
|
|
6330
6332
|
zone: z16.enum(["header", "body", "meta"]).optional().describe("V2 layout zone: where the field appears in the entry view"),
|
|
6331
6333
|
colorMap: z16.record(z16.string().max(50)).optional().describe("V2 value-to-semantic-color mapping, e.g. { critical: 'danger', low: 'success' }"),
|
|
6332
|
-
// ENT-61
|
|
6333
6334
|
accentSource: z16.boolean().optional().describe("When true, this field's colorMap value drives the card-level accent styling"),
|
|
6334
|
-
// ENT-61
|
|
6335
6335
|
iconMap: z16.record(z16.string(), z16.string().max(50)).optional().describe("Maps field values to icons (emoji/symbol), prepended to badge text"),
|
|
6336
6336
|
helpText: z16.string().max(2e3).optional().describe("Help text shown in editors and describe output"),
|
|
6337
6337
|
optionDescriptions: z16.record(z16.string().max(500)).optional().describe("Per-option guidance for select fields"),
|
|
6338
|
-
// BET-136
|
|
6339
6338
|
semanticRole: z16.enum(["problem", "appetite", "elements", "architecture", "done_when", "risks", "exclusions"]).optional().describe("Semantic role for schema-driven consumers \u2014 enables field-key-independent validation and rendering"),
|
|
6340
|
-
// BET-196
|
|
6341
6339
|
maxLength: z16.number().optional().describe("Maximum character length for field values. Three-tier resolution: explicit > displayHint > type fallback."),
|
|
6342
|
-
// BET-196
|
|
6343
6340
|
minLength: z16.number().optional().describe("Minimum character length for field values. Only explicit \u2014 no defaults.")
|
|
6344
6341
|
});
|
|
6345
6342
|
var collectionsSchema = z16.object({
|
|
@@ -6355,20 +6352,15 @@ var collectionsSchema = z16.object({
|
|
|
6355
6352
|
fields: z16.array(fieldSchema).max(200).optional().describe("Field definitions for create, or replacement schema for update (replaces all fields)"),
|
|
6356
6353
|
axis: z16.enum(["work", "none", "pending"]).optional().describe("REQUIRED for create: 'work' (needs stageLabelMap + validWorkflowStatuses), 'none', or 'pending'. For update: only settable on a non-system-stratum (custom) collection \u2014 the repair path for a legacy collection that predates the axis contract."),
|
|
6357
6354
|
stageLabelMap: z16.record(z16.string(), z16.enum(["open", "in_progress", "done", "stopped", "tag"])).optional().describe("Required when axis is 'work': maps each valid workflowStatus to a canonical stage."),
|
|
6358
|
-
// ENT-62
|
|
6359
6355
|
defaultCanonicalKey: z16.string().max(200).optional().describe("The canonical_key entries in this collection default to (e.g. 'decision', 'insight'). Consumers read from collection doc; code map is fallback."),
|
|
6360
|
-
// ENT-67
|
|
6361
6356
|
defaultWorkflowStatus: z16.string().max(200).optional().describe("Default workflowStatus for new entries. Must be in validWorkflowStatuses when set (e.g. 'hypothesis' for insights)."),
|
|
6362
|
-
// ENT-65
|
|
6363
6357
|
validWorkflowStatuses: z16.array(z16.string().max(200)).max(50).optional().describe("The allowed workflowStatus values for entries in this collection. New entries are validated against this list. Empty array means no constraint."),
|
|
6364
6358
|
// ENT-65, FEAT-200
|
|
6365
6359
|
classificationCheck: z16.string().max(500).optional().describe("LLM decision-tree check for this collection (3\u2013500 chars). Guides the classifier in routing entries here."),
|
|
6366
|
-
// ENT-65, FEAT-200
|
|
6367
6360
|
classificationPriority: z16.number().optional().describe("Classifier priority (1\u20139, lower = higher priority). Used with classificationCheck to order the decision tree."),
|
|
6368
|
-
// FEAT-301 Slice 2: quality gate criteria and usage guidance.
|
|
6369
|
-
// FEAT-257
|
|
6370
6361
|
qualityCriteria: z16.array(qualityCriterionSchema).max(50).optional().describe("Per-collection accept gate rules. 'required' rule hard-blocks accepts on empty fields; 'min_length'/'pattern' rules warn. Pass an empty array to clear all criteria."),
|
|
6371
6362
|
usageGuidance: z16.string().max(2e4).optional().describe("Plain-text guidance shown to agents and users: when to use this collection, when not to, and what makes a good entry."),
|
|
6363
|
+
statusList: z16.array(statusListEntrySchema).max(50).optional().describe(`Ordered status vocabulary: {label, category}[] (draft/current/past/discarded); draft first, exactly one 'discarded' labeled "discarded", labels unique. Re-validated server-side.`),
|
|
6372
6364
|
// For label-*
|
|
6373
6365
|
color: z16.string().max(50).optional().describe("For label-create/label-update: hex color, e.g. '#ef4444'."),
|
|
6374
6366
|
parentSlug: z16.string().max(200).optional().describe("For label-create: parent group slug for label hierarchy."),
|
|
@@ -6396,7 +6388,8 @@ var collectionsUpdateVariant = z16.object({
|
|
|
6396
6388
|
classificationCheck: z16.string().max(500).optional(),
|
|
6397
6389
|
classificationPriority: z16.number().optional(),
|
|
6398
6390
|
qualityCriteria: z16.array(qualityCriterionSchema).optional(),
|
|
6399
|
-
usageGuidance: z16.string().max(2e4).optional()
|
|
6391
|
+
usageGuidance: z16.string().max(2e4).optional(),
|
|
6392
|
+
statusList: z16.array(statusListEntrySchema).optional()
|
|
6400
6393
|
});
|
|
6401
6394
|
var collectionsAuditVariant = z16.object({ action: z16.literal("audit") });
|
|
6402
6395
|
var collectionsExportVariant = z16.object({ action: z16.literal("export") });
|
|
@@ -6439,7 +6432,7 @@ var collectionsActionUnion = z16.discriminatedUnion("action", [
|
|
|
6439
6432
|
var COLLECTIONS_ACTION_SPECS = {
|
|
6440
6433
|
list: { params: [], description: "Browse all collections; no params." },
|
|
6441
6434
|
describe: { params: ["slug"], description: "slug is required." },
|
|
6442
|
-
update: { params: ["slug", "name", "description", "purpose", "icon", "navGroup", "fields", "axis", "stageLabelMap", "defaultCanonicalKey", "defaultWorkflowStatus", "validWorkflowStatuses", "classificationCheck", "classificationPriority", "qualityCriteria", "usageGuidance"], description: "slug is required; at least one other field must be provided. axis/stageLabelMap are only settable on a non-system-stratum collection (the repair path for a legacy custom collection missing its axis declaration)." },
|
|
6435
|
+
update: { params: ["slug", "name", "description", "purpose", "icon", "navGroup", "fields", "axis", "stageLabelMap", "defaultCanonicalKey", "defaultWorkflowStatus", "validWorkflowStatuses", "classificationCheck", "classificationPriority", "qualityCriteria", "usageGuidance", "statusList"], description: "slug is required; at least one other field must be provided. axis/stageLabelMap are only settable on a non-system-stratum collection (the repair path for a legacy custom collection missing its axis declaration)." },
|
|
6443
6436
|
audit: { params: [], description: "Health report for all collections; no params." },
|
|
6444
6437
|
export: { params: [], description: "Full system_collection_definitions export; no params. Admin only." },
|
|
6445
6438
|
"label-list": { params: [], description: "List all labels; no params." },
|
|
@@ -6454,9 +6447,9 @@ function registerCollectionsTools(server) {
|
|
|
6454
6447
|
list: () => handleList2(),
|
|
6455
6448
|
describe: (data) => handleDescribe(data.slug),
|
|
6456
6449
|
update: (data) => {
|
|
6457
|
-
const hasChanges = data.name || data.description || data.purpose || data.icon || data.navGroup || data.fields || data.axis !== void 0 || data.stageLabelMap !== void 0 || data.defaultCanonicalKey !== void 0 || data.defaultWorkflowStatus !== void 0 || data.validWorkflowStatuses !== void 0 || data.classificationCheck !== void 0 || data.classificationPriority !== void 0 || data.qualityCriteria !== void 0 || data.usageGuidance !== void 0;
|
|
6450
|
+
const hasChanges = data.name || data.description || data.purpose || data.icon || data.navGroup || data.fields || data.axis !== void 0 || data.stageLabelMap !== void 0 || data.defaultCanonicalKey !== void 0 || data.defaultWorkflowStatus !== void 0 || data.validWorkflowStatuses !== void 0 || data.classificationCheck !== void 0 || data.classificationPriority !== void 0 || data.qualityCriteria !== void 0 || data.usageGuidance !== void 0 || data.statusList;
|
|
6458
6451
|
if (!hasChanges) {
|
|
6459
|
-
return Promise.resolve(validationResult("Provide at least one field to update (name, description, purpose, icon, navGroup, fields, axis, stageLabelMap, defaultCanonicalKey, defaultWorkflowStatus, validWorkflowStatuses, classificationCheck, classificationPriority, qualityCriteria, or
|
|
6452
|
+
return Promise.resolve(validationResult("Provide at least one field to update (name, description, purpose, icon, navGroup, fields, axis, stageLabelMap, defaultCanonicalKey, defaultWorkflowStatus, validWorkflowStatuses, classificationCheck, classificationPriority, qualityCriteria, usageGuidance, or statusList)."));
|
|
6460
6453
|
}
|
|
6461
6454
|
return handleUpdate(
|
|
6462
6455
|
data.slug,
|
|
@@ -6466,7 +6459,7 @@ function registerCollectionsTools(server) {
|
|
|
6466
6459
|
data.icon,
|
|
6467
6460
|
data.navGroup,
|
|
6468
6461
|
data.fields,
|
|
6469
|
-
{ axis: data.axis, stageLabelMap: data.stageLabelMap, defaultCanonicalKey: data.defaultCanonicalKey, defaultWorkflowStatus: data.defaultWorkflowStatus, validWorkflowStatuses: data.validWorkflowStatuses, classificationCheck: data.classificationCheck, classificationPriority: data.classificationPriority, qualityCriteria: data.qualityCriteria, usageGuidance: data.usageGuidance }
|
|
6462
|
+
{ axis: data.axis, stageLabelMap: data.stageLabelMap, defaultCanonicalKey: data.defaultCanonicalKey, defaultWorkflowStatus: data.defaultWorkflowStatus, validWorkflowStatuses: data.validWorkflowStatuses, classificationCheck: data.classificationCheck, classificationPriority: data.classificationPriority, qualityCriteria: data.qualityCriteria, usageGuidance: data.usageGuidance, statusList: data.statusList }
|
|
6470
6463
|
);
|
|
6471
6464
|
},
|
|
6472
6465
|
audit: () => handleAudit(),
|
|
@@ -6482,7 +6475,7 @@ function registerCollectionsTools(server) {
|
|
|
6482
6475
|
"collections",
|
|
6483
6476
|
{
|
|
6484
6477
|
title: "Collections",
|
|
6485
|
-
description: "Manage knowledge collections and workspace labels. Eleven actions:\n\n- **list**: Browse all collections \u2014 glossary, business rules, tracking events, etc. Returns slug, name, description, and field schema. Use before capture to see what exists.\n- **describe**: Full documentation for a single collection. Returns field help text, option decision guides, usage guidance, examples, and cross-references. Use when you need to understand a collection's purpose, field semantics, or option values.\n- **update**: Update an existing collection's name, description, purpose, icon, navGroup, fields, or (non-system collections only) axis/stageLabelMap. Only provide the fields you want to change. Creating a NEW collection is not offered here \u2014 ask a platform admin to provision it, or enable the module ontology pack that owns the drawer.\n- **audit**: Health report for all workspace collections. Checks classification metadata, icon presence, displayHint coverage per field, and field schema gaps vs system definitions. Returns total collections, count with issues, and per-collection issue list.\n- **export**: Full system_collection_definitions export as JSON. Includes all classification metadata (thinkingLayer, classificationPriority, classificationCheck, timelineRole, governanceRole, governanceFunction, etc.). Admin only.\n- **label-list/label-create/label-update/label-delete/label-apply/label-remove**: manage workspace labels (absorbs the `labels` tool) \u2014 list all labels, create/update/delete a label, or apply/remove a label on an entry. Labels can be applied to any entry across any collection for cross-domain filtering.",
|
|
6478
|
+
description: "Manage knowledge collections and workspace labels. Eleven actions:\n\n- **list**: Browse all collections \u2014 glossary, business rules, tracking events, etc. Returns slug, name, description, and field schema. Use before capture to see what exists.\n- **describe**: Full documentation for a single collection. Returns field help text, option decision guides, usage guidance, examples, and cross-references. Use when you need to understand a collection's purpose, field semantics, or option values.\n- **update**: Update an existing collection's name, description, purpose, icon, navGroup, fields, statusList, or (non-system collections only) axis/stageLabelMap. Only provide the fields you want to change. Creating a NEW collection is not offered here \u2014 ask a platform admin to provision it, or enable the module ontology pack that owns the drawer.\n- **audit**: Health report for all workspace collections. Checks classification metadata, icon presence, displayHint coverage per field, and field schema gaps vs system definitions. Returns total collections, count with issues, and per-collection issue list.\n- **export**: Full system_collection_definitions export as JSON. Includes all classification metadata (thinkingLayer, classificationPriority, classificationCheck, timelineRole, governanceRole, governanceFunction, etc.). Admin only.\n- **label-list/label-create/label-update/label-delete/label-apply/label-remove**: manage workspace labels (absorbs the `labels` tool) \u2014 list all labels, create/update/delete a label, or apply/remove a label on an entry. Labels can be applied to any entry across any collection for cross-domain filtering.",
|
|
6486
6479
|
inputSchema: collectionsSchema,
|
|
6487
6480
|
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false }
|
|
6488
6481
|
},
|
|
@@ -6537,6 +6530,12 @@ Valid \`workflowStatus\` values for entries in this collection:
|
|
|
6537
6530
|
${col.validWorkflowStatuses.map((s) => `- ${s}`).join("\n")}`
|
|
6538
6531
|
);
|
|
6539
6532
|
}
|
|
6533
|
+
if (col.statusList && col.statusList.length > 0) {
|
|
6534
|
+
sections.push(`
|
|
6535
|
+
## Status Vocabulary
|
|
6536
|
+
|
|
6537
|
+
${col.statusList.map((s) => `- \`${s.label}\` \u2192 ${s.category}`).join("\n")}`);
|
|
6538
|
+
}
|
|
6540
6539
|
if (col.fields.length > 0) {
|
|
6541
6540
|
const fieldDocs = col.fields.map((f) => {
|
|
6542
6541
|
const parts = [];
|
|
@@ -6586,6 +6585,8 @@ ${refList}`);
|
|
|
6586
6585
|
usageGuidance: col.usageGuidance ?? null,
|
|
6587
6586
|
// WP-480 S2: null = unconstrained by design (STD-34), not "unknown".
|
|
6588
6587
|
validWorkflowStatuses: col.validWorkflowStatuses && col.validWorkflowStatuses.length > 0 ? col.validWorkflowStatuses : null,
|
|
6588
|
+
statusList: col.statusList && col.statusList.length > 0 ? col.statusList : null,
|
|
6589
|
+
// T2: same null-means-undeclared posture
|
|
6589
6590
|
fieldCount: col.fields.length,
|
|
6590
6591
|
fields: col.fields.map((f) => ({
|
|
6591
6592
|
key: f.key,
|
|
@@ -6659,7 +6660,7 @@ async function handleUpdate(slug, name, description, purpose, icon, navGroup, fi
|
|
|
6659
6660
|
invalidateCollectionCacheForScope();
|
|
6660
6661
|
invalidateProfileCacheForScope();
|
|
6661
6662
|
invalidateHubCacheForScope();
|
|
6662
|
-
const changes = [name && "name", description && "description", purpose && "purpose", icon && "icon", navGroup && "navGroup", fields && "fields", meta.axis !== void 0 && "axis", meta.stageLabelMap !== void 0 && "stageLabelMap", meta.defaultCanonicalKey !== void 0 && "defaultCanonicalKey", meta.defaultWorkflowStatus !== void 0 && "defaultWorkflowStatus", meta.validWorkflowStatuses !== void 0 && "validWorkflowStatuses", meta.classificationCheck !== void 0 && "classificationCheck", meta.classificationPriority !== void 0 && "classificationPriority", meta.qualityCriteria !== void 0 && "qualityCriteria", meta.usageGuidance !== void 0 && "usageGuidance"].filter(Boolean).join(", ");
|
|
6663
|
+
const changes = [name && "name", description && "description", purpose && "purpose", icon && "icon", navGroup && "navGroup", fields && "fields", meta.axis !== void 0 && "axis", meta.stageLabelMap !== void 0 && "stageLabelMap", meta.defaultCanonicalKey !== void 0 && "defaultCanonicalKey", meta.defaultWorkflowStatus !== void 0 && "defaultWorkflowStatus", meta.validWorkflowStatuses !== void 0 && "validWorkflowStatuses", meta.classificationCheck !== void 0 && "classificationCheck", meta.classificationPriority !== void 0 && "classificationPriority", meta.qualityCriteria !== void 0 && "qualityCriteria", meta.usageGuidance !== void 0 && "usageGuidance", meta.statusList !== void 0 && "statusList"].filter(Boolean).join(", ");
|
|
6663
6664
|
return {
|
|
6664
6665
|
content: [{
|
|
6665
6666
|
type: "text",
|
|
@@ -14989,4 +14990,4 @@ export {
|
|
|
14989
14990
|
createProductBrainServer,
|
|
14990
14991
|
initFeatureFlags
|
|
14991
14992
|
};
|
|
14992
|
-
//# sourceMappingURL=chunk-
|
|
14993
|
+
//# sourceMappingURL=chunk-ONWBWDTM.js.map
|