@productbrain/mcp 0.0.1-beta.4379 → 0.0.1-beta.4397
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.
|
@@ -7334,6 +7334,8 @@ var collectionsSchema = z16.object({
|
|
|
7334
7334
|
icon: z16.string().max(50).optional().describe("Emoji icon for the collection"),
|
|
7335
7335
|
navGroup: z16.enum(["daily", "strategic", "governance", "reference", "collections"]).optional().describe("Sidebar placement: 'daily', 'strategic', 'governance', 'reference', 'collections'"),
|
|
7336
7336
|
fields: z16.array(fieldSchema).max(200).optional().describe("Field definitions for create, or replacement schema for update (replaces all fields)"),
|
|
7337
|
+
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."),
|
|
7338
|
+
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."),
|
|
7337
7339
|
// ENT-62
|
|
7338
7340
|
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."),
|
|
7339
7341
|
// ENT-67
|
|
@@ -7366,6 +7368,9 @@ var collectionsCreateVariant = z16.object({
|
|
|
7366
7368
|
icon: z16.string().max(50).optional(),
|
|
7367
7369
|
navGroup: z16.enum(["daily", "strategic", "governance", "reference", "collections"]).optional(),
|
|
7368
7370
|
fields: z16.array(fieldSchema).min(1),
|
|
7371
|
+
axis: z16.enum(["work", "none", "pending"]),
|
|
7372
|
+
// required, mirrors the Convex door's axisValidator (PRRT_kwDORS4ils6ZiYjo)
|
|
7373
|
+
stageLabelMap: z16.record(z16.string(), z16.enum(["open", "in_progress", "done", "stopped", "tag"])).optional(),
|
|
7369
7374
|
defaultCanonicalKey: z16.string().max(200).optional(),
|
|
7370
7375
|
defaultWorkflowStatus: z16.string().max(200).optional(),
|
|
7371
7376
|
validWorkflowStatuses: z16.array(z16.string().max(200)).optional(),
|
|
@@ -7381,6 +7386,9 @@ var collectionsUpdateVariant = z16.object({
|
|
|
7381
7386
|
icon: z16.string().max(50).optional(),
|
|
7382
7387
|
navGroup: z16.enum(["daily", "strategic", "governance", "reference", "collections"]).optional(),
|
|
7383
7388
|
fields: z16.array(fieldSchema).optional(),
|
|
7389
|
+
axis: z16.enum(["work", "none", "pending"]).optional(),
|
|
7390
|
+
stageLabelMap: z16.record(z16.string(), z16.enum(["open", "in_progress", "done", "stopped", "tag"])).optional(),
|
|
7391
|
+
// WP-640 SWEEP (P1): axis/stageLabelMap repair legacy custom collections — see collections.ts's updateCollection.
|
|
7384
7392
|
defaultCanonicalKey: z16.string().max(200).optional(),
|
|
7385
7393
|
defaultWorkflowStatus: z16.string().max(200).optional(),
|
|
7386
7394
|
validWorkflowStatuses: z16.array(z16.string().max(200)).optional(),
|
|
@@ -7431,8 +7439,8 @@ var collectionsActionUnion = z16.discriminatedUnion("action", [
|
|
|
7431
7439
|
var COLLECTIONS_ACTION_SPECS = {
|
|
7432
7440
|
list: { params: [], description: "Browse all collections; no params." },
|
|
7433
7441
|
describe: { params: ["slug"], description: "slug is required." },
|
|
7434
|
-
create: { params: ["slug", "name", "description", "purpose", "icon", "navGroup", "fields", "defaultCanonicalKey", "defaultWorkflowStatus", "validWorkflowStatuses", "classificationCheck", "classificationPriority"], description: "slug, name, and
|
|
7435
|
-
update: { params: ["slug", "name", "description", "purpose", "icon", "navGroup", "fields", "defaultCanonicalKey", "defaultWorkflowStatus", "validWorkflowStatuses", "classificationCheck", "classificationPriority", "qualityCriteria", "usageGuidance"], description: "slug is required; at least one other field must be provided." },
|
|
7442
|
+
create: { params: ["slug", "name", "description", "purpose", "icon", "navGroup", "fields", "axis", "stageLabelMap", "defaultCanonicalKey", "defaultWorkflowStatus", "validWorkflowStatuses", "classificationCheck", "classificationPriority"], description: "slug, name, fields, and axis are required. axis:'work' also requires stageLabelMap + validWorkflowStatuses." },
|
|
7443
|
+
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)." },
|
|
7436
7444
|
audit: { params: [], description: "Health report for all collections; no params." },
|
|
7437
7445
|
export: { params: [], description: "Full system_collection_definitions export; no params. Admin only." },
|
|
7438
7446
|
"label-list": { params: [], description: "List all labels; no params." },
|
|
@@ -7454,12 +7462,12 @@ function registerCollectionsTools(server) {
|
|
|
7454
7462
|
data.icon,
|
|
7455
7463
|
data.navGroup ?? "collections",
|
|
7456
7464
|
data.fields,
|
|
7457
|
-
{ defaultCanonicalKey: data.defaultCanonicalKey, defaultWorkflowStatus: data.defaultWorkflowStatus, validWorkflowStatuses: data.validWorkflowStatuses, classificationCheck: data.classificationCheck, classificationPriority: data.classificationPriority }
|
|
7465
|
+
{ axis: data.axis, stageLabelMap: data.stageLabelMap, defaultCanonicalKey: data.defaultCanonicalKey, defaultWorkflowStatus: data.defaultWorkflowStatus, validWorkflowStatuses: data.validWorkflowStatuses, classificationCheck: data.classificationCheck, classificationPriority: data.classificationPriority }
|
|
7458
7466
|
),
|
|
7459
7467
|
update: (data) => {
|
|
7460
|
-
const hasChanges = data.name || data.description || data.purpose || data.icon || data.navGroup || data.fields || 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;
|
|
7468
|
+
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;
|
|
7461
7469
|
if (!hasChanges) {
|
|
7462
|
-
return Promise.resolve(validationResult("Provide at least one field to update (name, description, purpose, icon, navGroup, fields, defaultCanonicalKey, defaultWorkflowStatus, validWorkflowStatuses, classificationCheck, classificationPriority, qualityCriteria, or usageGuidance)."));
|
|
7470
|
+
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 usageGuidance)."));
|
|
7463
7471
|
}
|
|
7464
7472
|
return handleUpdate(
|
|
7465
7473
|
data.slug,
|
|
@@ -7469,7 +7477,7 @@ function registerCollectionsTools(server) {
|
|
|
7469
7477
|
data.icon,
|
|
7470
7478
|
data.navGroup,
|
|
7471
7479
|
data.fields,
|
|
7472
|
-
{ defaultCanonicalKey: data.defaultCanonicalKey, defaultWorkflowStatus: data.defaultWorkflowStatus, validWorkflowStatuses: data.validWorkflowStatuses, classificationCheck: data.classificationCheck, classificationPriority: data.classificationPriority, qualityCriteria: data.qualityCriteria, usageGuidance: data.usageGuidance }
|
|
7480
|
+
{ 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 }
|
|
7473
7481
|
);
|
|
7474
7482
|
},
|
|
7475
7483
|
audit: () => handleAudit(),
|
|
@@ -7485,7 +7493,7 @@ function registerCollectionsTools(server) {
|
|
|
7485
7493
|
"collections",
|
|
7486
7494
|
{
|
|
7487
7495
|
title: "Collections",
|
|
7488
|
-
description: "Manage knowledge collections and workspace labels. Twelve 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- **create**: Create a new collection. Provide slug, name, and field schema. Use when setting up a workspace or tracking a new type of knowledge.\n- **update**: Update an existing collection's name, description, purpose, icon, navGroup, or
|
|
7496
|
+
description: "Manage knowledge collections and workspace labels. Twelve 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- **create**: Create a new collection. Provide slug, name, and field schema. Use when setting up a workspace or tracking a new type of knowledge.\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.\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.",
|
|
7489
7497
|
inputSchema: collectionsSchema,
|
|
7490
7498
|
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false }
|
|
7491
7499
|
},
|
|
@@ -7645,6 +7653,9 @@ ${formatted}` }],
|
|
|
7645
7653
|
)
|
|
7646
7654
|
};
|
|
7647
7655
|
}
|
|
7656
|
+
function metaFields(m) {
|
|
7657
|
+
return Object.fromEntries(Object.entries(m).filter(([, v]) => v !== void 0));
|
|
7658
|
+
}
|
|
7648
7659
|
async function handleCreate2(slug, name, description, purpose, icon, navGroup, fields, meta = {}) {
|
|
7649
7660
|
requireWriteAccess();
|
|
7650
7661
|
try {
|
|
@@ -7656,11 +7667,7 @@ async function handleCreate2(slug, name, description, purpose, icon, navGroup, f
|
|
|
7656
7667
|
icon,
|
|
7657
7668
|
navGroup,
|
|
7658
7669
|
fields,
|
|
7659
|
-
...meta
|
|
7660
|
-
...meta.defaultWorkflowStatus !== void 0 && { defaultWorkflowStatus: meta.defaultWorkflowStatus },
|
|
7661
|
-
...meta.validWorkflowStatuses !== void 0 && { validWorkflowStatuses: meta.validWorkflowStatuses },
|
|
7662
|
-
...meta.classificationCheck !== void 0 && { classificationCheck: meta.classificationCheck },
|
|
7663
|
-
...meta.classificationPriority !== void 0 && { classificationPriority: meta.classificationPriority },
|
|
7670
|
+
...metaFields(meta),
|
|
7664
7671
|
createdBy: getAgentSessionId() ? `agent:${getAgentSessionId()}` : "mcp"
|
|
7665
7672
|
});
|
|
7666
7673
|
invalidateCollectionCacheForScope();
|
|
@@ -7722,18 +7729,12 @@ async function handleUpdate(slug, name, description, purpose, icon, navGroup, fi
|
|
|
7722
7729
|
...icon !== void 0 && { icon },
|
|
7723
7730
|
...navGroup !== void 0 && { navGroup },
|
|
7724
7731
|
...fields !== void 0 && { fields },
|
|
7725
|
-
...meta
|
|
7726
|
-
...meta.defaultWorkflowStatus !== void 0 && { defaultWorkflowStatus: meta.defaultWorkflowStatus },
|
|
7727
|
-
...meta.validWorkflowStatuses !== void 0 && { validWorkflowStatuses: meta.validWorkflowStatuses },
|
|
7728
|
-
...meta.classificationCheck !== void 0 && { classificationCheck: meta.classificationCheck },
|
|
7729
|
-
...meta.classificationPriority !== void 0 && { classificationPriority: meta.classificationPriority },
|
|
7730
|
-
...meta.qualityCriteria !== void 0 && { qualityCriteria: meta.qualityCriteria },
|
|
7731
|
-
...meta.usageGuidance !== void 0 && { usageGuidance: meta.usageGuidance }
|
|
7732
|
+
...metaFields(meta)
|
|
7732
7733
|
});
|
|
7733
7734
|
invalidateCollectionCacheForScope();
|
|
7734
7735
|
invalidateProfileCacheForScope();
|
|
7735
7736
|
invalidateHubCacheForScope();
|
|
7736
|
-
const changes = [name && "name", description && "description", purpose && "purpose", icon && "icon", navGroup && "navGroup", fields && "fields", 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(", ");
|
|
7737
|
+
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(", ");
|
|
7737
7738
|
return {
|
|
7738
7739
|
content: [{
|
|
7739
7740
|
type: "text",
|
|
@@ -17043,4 +17044,4 @@ export {
|
|
|
17043
17044
|
createProductBrainServer,
|
|
17044
17045
|
initFeatureFlags
|
|
17045
17046
|
};
|
|
17046
|
-
//# sourceMappingURL=chunk-
|
|
17047
|
+
//# sourceMappingURL=chunk-U4QDOV2F.js.map
|