@productbrain/mcp 0.0.1-beta.5214 → 0.0.1-beta.5231

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.
@@ -4708,14 +4708,21 @@ async function handleVerifyEntry({ entryId }) {
4708
4708
  import { z as z9 } from "zod/v3";
4709
4709
  var moveEntrySchema = z9.object({
4710
4710
  entryId: z9.string().describe("Entry ID to move, e.g. '<PREFIX>-<n>'"),
4711
- toCollection: z9.string().describe("Target collection slug, e.g. 'decisions', 'architecture'")
4711
+ toCollection: z9.string().describe("Target collection slug, e.g. 'decisions', 'architecture'"),
4712
+ // WP-707 S2 (TASK-146): optional atomic move+RETYPE — validates and persists the entry's NEW
4713
+ // canonicalKey and its destination collection in the SAME write (convex/agentKnowledge/
4714
+ // moveToCollectionOperation.ts round 3, DEC-1622). Omit for a plain same-kind relocation.
4715
+ canonicalKey: z9.string().optional().describe(
4716
+ "Optional: also reclassify the entry to this canonical key atomically with the move (e.g. 'decision', 'objective'). Omit for a plain relocation."
4717
+ )
4712
4718
  });
4713
- async function handleMoveEntry(entryId, toCollection) {
4719
+ async function handleMoveEntry(entryId, toCollection, canonicalKey) {
4714
4720
  try {
4715
4721
  const sessionId = getAgentSessionId();
4716
4722
  const result2 = await kernelMutation("chain.moveToCollection", {
4717
4723
  entryId,
4718
4724
  toCollectionSlug: toCollection,
4725
+ canonicalKey,
4719
4726
  changedBy: sessionId ? `agent:${sessionId}` : void 0
4720
4727
  });
4721
4728
  if (result2.outcome === "refused") {
@@ -4736,7 +4743,7 @@ ${recovery}`,
4736
4743
  const lines = [
4737
4744
  `## Move Result`,
4738
4745
  "",
4739
- `Moved **${result2.entryId}** from \`${result2.fromCollection}\` \u2192 \`${result2.toCollection}\``
4746
+ `Moved **${result2.entryId}** from \`${result2.fromCollection}\` \u2192 \`${result2.toCollection}\`` + (canonicalKey ? ` and reclassified to \`${canonicalKey}\`` : "")
4740
4747
  ];
4741
4748
  if (result2.workflowStatusReset) {
4742
4749
  lines.push(``, `\u26A0\uFE0F Workflow status \`${result2.previousWorkflowStatus}\` was reset (incompatible with target collection).`);
@@ -4827,7 +4834,7 @@ var coherencyAcknowledgementFlatSchema = z10.object({
4827
4834
  });
4828
4835
  var entriesSchema = z10.object({
4829
4836
  action: z10.enum(ENTRIES_ACTIONS).describe(
4830
- "'list': browse entries with filters. 'get': fetch one entry by ID. 'batch': fetch multiple entries. 'search': full-text search. 'update': change fields on an existing entry (draft by default). 'commit': accept a draft entry onto the Chain. 'history': audit trail for an entry. 'move': reclassify an entry to a different collection. 'verify': mark an entry as verified (lightweight \u2014 no codebase scan; see `quality action=verify-chain` for the codebase-scanning check)."
4837
+ "'list': browse entries with filters. 'get': fetch one entry by ID. 'batch': fetch multiple entries. 'search': full-text search. 'update': change fields on an existing entry (draft by default). 'commit': accept a draft entry onto the Chain. 'history': audit trail for an entry. 'move': relocate an entry to a different collection (pass `canonicalKey` too for an atomic move+retype). 'verify': mark an entry as verified (lightweight \u2014 no codebase scan; see `quality action=verify-chain` for that)."
4831
4838
  ),
4832
4839
  entryId: z10.string().max(200).optional().describe(
4833
4840
  "Entry ID, e.g. '<PREFIX>-<n>'. Required for: get, update, commit, history, move, verify."
@@ -4847,7 +4854,7 @@ var entriesSchema = z10.object({
4847
4854
  data: z10.record(z10.unknown()).optional().describe("For 'update': fields to update (merged with existing data)."),
4848
4855
  order: z10.number().optional().describe("For 'update': new sort order."),
4849
4856
  canonicalKey: z10.string().max(200).optional().describe(
4850
- "For 'update': semantic type (e.g. 'decision', 'tension'). Only changeable on draft/uncommitted entries."
4857
+ "For 'update': semantic type (e.g. 'decision', 'tension'); only changeable on draft/uncommitted entries. For 'move': optional atomic move+retype target."
4851
4858
  ),
4852
4859
  autoPublish: z10.boolean().optional().default(false).describe(
4853
4860
  "For 'update': only true when the user explicitly asks to publish. Default false = draft."
@@ -4900,7 +4907,9 @@ var entriesHistoryVariant = getHistorySchema.extend({ action: z10.literal("histo
4900
4907
  var entriesMoveVariant = z10.object({
4901
4908
  action: z10.literal("move"),
4902
4909
  entryId: z10.string().max(200),
4903
- toCollection: z10.string().max(200)
4910
+ toCollection: z10.string().max(200),
4911
+ canonicalKey: z10.string().max(200).optional()
4912
+ // WP-707 S2: optional atomic move+RETYPE.
4904
4913
  });
4905
4914
  var entriesVerifyVariant = verifyEntrySchema.extend({ action: z10.literal("verify") });
4906
4915
  var entriesActionUnion = z10.discriminatedUnion("action", [
@@ -4922,7 +4931,7 @@ var ENTRIES_ACTION_SPECS = {
4922
4931
  update: { params: ["entryId", "name", "status", "workflowStatus", "data", "order", "canonicalKey", "autoPublish", "changeNote", "sourceRef", "sourceExcerpt", "steeringOverrideReason", "coherencyAcknowledgement"], description: "entryId is required; every other field is optional." },
4923
4932
  commit: { params: ["entryId", "preview", "steeringOverrideReason", "coherencyAcknowledgement"], description: "entryId is required." },
4924
4933
  history: { params: ["entryId"], description: "entryId is required." },
4925
- move: { params: ["entryId", "toCollection"], description: "Both entryId and toCollection are required." },
4934
+ move: { params: ["entryId", "toCollection", "canonicalKey"], description: "entryId and toCollection are required; canonicalKey is optional (atomic move+retype)." },
4926
4935
  verify: { params: ["entryId"], description: "entryId is required." }
4927
4936
  };
4928
4937
  var entriesGetOutputSchema = z10.object({
@@ -5020,14 +5029,14 @@ function registerEntriesTools(server) {
5020
5029
  update: (data) => handleUpdateEntry(data, "entries"),
5021
5030
  commit: (data) => handleCommitEntry(data, "entries"),
5022
5031
  history: (data) => handleGetHistory(data),
5023
- move: (data) => handleMoveEntry(data.entryId, data.toCollection),
5032
+ move: (data) => handleMoveEntry(data.entryId, data.toCollection, data.canonicalKey),
5024
5033
  verify: (data) => handleVerifyEntry(data)
5025
5034
  };
5026
5035
  server.registerTool(
5027
5036
  "entries",
5028
5037
  {
5029
5038
  title: "Entries",
5030
- description: 'Read and manage entries on the Chain. One tool for the entry lifecycle.\n\n- **list**: Browse entries with optional filters (collection, status, tag, label). Use collections action=list first to discover slugs.\n- **get**: Fetch a single entry by ID \u2014 full record with data, labels, relations, history.\n- **batch**: Fetch multiple entries (max 20) in one call. Same shape as get per entry.\n- **search**: Full-text search across entries. Scope by collection or filter by status.\n- **update**: Change fields on an existing entry (draft by default \u2014 never autoPublish without explicit user confirmation).\n- **commit**: Accept a draft entry onto the Chain (SSOT). Runs the contradiction preflight first.\n- **history**: Audit trail for an entry.\n- **move**: Reclassify an entry to a different collection.\n- **verify**: Mark an entry as verified (lightweight, no codebase scan \u2014 see `quality action=verify-chain` for that).\n\nUse `entries action=get entryId="..."` to fetch one. Use `entries action=search query="..."` to discover.',
5039
+ description: 'Read and manage entries on the Chain. One tool for the entry lifecycle.\n\n- **list**: Browse entries with optional filters (collection, status, tag, label). Use collections action=list first to discover slugs.\n- **get**: Fetch a single entry by ID \u2014 full record with data, labels, relations, history.\n- **batch**: Fetch multiple entries (max 20) in one call. Same shape as get per entry.\n- **search**: Full-text search across entries. Scope by collection or filter by status.\n- **update**: Change fields on an existing entry (draft by default \u2014 never autoPublish without explicit user confirmation).\n- **commit**: Accept a draft entry onto the Chain (SSOT). Runs the contradiction preflight first.\n- **history**: Audit trail for an entry.\n- **move**: Relocate an entry to a different collection; pass canonicalKey too for an atomic move+retype.\n- **verify**: Mark an entry as verified (lightweight, no codebase scan \u2014 see `quality action=verify-chain` for that).\n\nUse `entries action=get entryId="..."` to fetch one. Use `entries action=search query="..."` to discover.',
5031
5040
  inputSchema: entriesSchema,
5032
5041
  // Mixed read/write noun (§3 R3): can't be marked read-only once update/commit/move
5033
5042
  // live here too — accepted for the 11-tool default (§9 R3).
@@ -16499,4 +16508,4 @@ export {
16499
16508
  createProductBrainServer,
16500
16509
  initFeatureFlags
16501
16510
  };
16502
- //# sourceMappingURL=chunk-YNQTQKJI.js.map
16511
+ //# sourceMappingURL=chunk-7KB3B4TN.js.map