@productbrain/mcp 0.0.1-beta.12081 → 0.0.1-beta.12087

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.
@@ -40,7 +40,7 @@ import {
40
40
  runWithToolContext,
41
41
  setSessionOriented,
42
42
  startAgentSession
43
- } from "./chunk-4DVP3ALV.js";
43
+ } from "./chunk-IC37VVQA.js";
44
44
 
45
45
  // src/server.ts
46
46
  import { McpServer as McpServer2 } from "@modelcontextprotocol/sdk/server/mcp.js";
@@ -1021,7 +1021,15 @@ var captureSuccessOutputSchema = z5.object({
1021
1021
  required: z5.boolean().optional()
1022
1022
  })).optional(),
1023
1023
  // TASK-160: the server's birth-floor verdict must survive the strict output contract.
1024
- spineFloor: z5.object({ relationType: z5.string(), parentKind: z5.string(), exempt: z5.boolean(), linkWritten: z5.boolean().optional() }).optional(),
1024
+ spineFloor: z5.object({
1025
+ relationType: z5.string(),
1026
+ parentKind: z5.string(),
1027
+ exempt: z5.boolean(),
1028
+ linkWritten: z5.boolean().optional(),
1029
+ line: z5.string().optional(),
1030
+ nextTo: z5.string().optional()
1031
+ }).optional(),
1032
+ // TASK-1164: the kernel's line about the rung above, and the Next's target
1025
1033
  // WP-751 M3a-1b (TASK-189, DEC-1700): `coherencyRefusal` and `contradictionAdvisory` are deleted with the
1026
1034
  // client-side auto-commit attempt that alone populated them (its gate refusal, the commit's advisory).
1027
1035
  replayed: z5.literal(true).optional(),
@@ -1300,8 +1308,8 @@ Use \`context action=get\` to inspect the existing entry, or \`entries action=up
1300
1308
  lines.push(`## Accepted: ${finalEntryId}`);
1301
1309
  lines.push(`**${name}** added to your knowledge base.`);
1302
1310
  } else if (spineFloor) {
1303
- const { relationType: relationType2, parentKind, exempt, linkWritten } = spineFloor, id = finalEntryId, to = `<${parentKind.toUpperCase().replace(/_/g, "-")}-ID>`;
1304
- lines.push("", "## Saved as draft", `**${name}** ${exempt ? SPINE_FLOOR_EXEMPT_SENTENCE : `kept as a draft. ${rungLine(parentKind)}`}`);
1311
+ const { relationType: relationType2, parentKind, exempt, linkWritten, line, nextTo } = spineFloor, id = finalEntryId, to = nextTo ?? `<${parentKind.toUpperCase().replace(/_/g, "-")}-ID>`;
1312
+ lines.push("", "## Saved as draft", `**${name}** ${exempt ? SPINE_FLOOR_EXEMPT_SENTENCE : `kept as a draft. ${line ?? rungLine(parentKind)}`}`);
1305
1313
  lines.push(exempt || linkWritten ? `Next: \`entries action=accept entryId="${id}"\`.` : `Next: \`relations action=create from="${id}" type="${relationType2}" to="${to}"\`.`);
1306
1314
  }
1307
1315
  if (groundingCaveat) lines.push("", groundingCaveat);
@@ -3178,14 +3186,17 @@ var relationsSchema = z13.object({
3178
3186
  type: relationType.optional().describe("Relation type, for create, delete and each batch-create item."),
3179
3187
  relations: z13.array(relationItemSchema).min(1).max(RELATION_BATCH_MAX).optional().describe("For 'batch-create': array of {from, to, type}."),
3180
3188
  // WP-316 S3: Preview gate — dry-run mode for action=create.
3181
- preview: z13.boolean().optional().describe("For 'create': if true, checks the relation and writes nothing.")
3189
+ preview: z13.boolean().optional().describe("For 'create': if true, checks the relation and writes nothing."),
3190
+ move: z13.boolean().optional().describe("For 'create' with part_of: move the entry off the parent it already hangs on, in one write.")
3182
3191
  });
3183
3192
  var relationsCreateVariant = z13.object({
3184
3193
  action: z13.literal("create"),
3185
3194
  from: z13.string().max(200),
3186
3195
  to: z13.string().max(200),
3187
3196
  type: relationType,
3188
- preview: z13.boolean().optional()
3197
+ preview: z13.boolean().optional(),
3198
+ move: z13.boolean().optional()
3199
+ // TASK-1164 (DEC-2295 addendum)
3189
3200
  });
3190
3201
  var relationsBatchCreateVariant = z13.object({
3191
3202
  action: z13.literal("batch-create"),
@@ -3203,13 +3214,13 @@ var relationsActionUnion = z13.discriminatedUnion("action", [
3203
3214
  relationsDeleteVariant
3204
3215
  ]);
3205
3216
  var RELATIONS_ACTION_SPECS = {
3206
- create: { params: ["from", "to", "type", "preview"], description: "from, to, and type are required." },
3217
+ create: { params: ["from", "to", "type", "preview", "move"], description: "from, to, and type are required." },
3207
3218
  "batch-create": { params: ["relations"], description: "relations (1-20 items) is required." },
3208
3219
  delete: { params: ["from", "to", "type"], description: "from, to, and type are required." }
3209
3220
  };
3210
3221
  function registerRelationsTools(server) {
3211
3222
  const relationsHandlers = {
3212
- create: (data) => handleCreate(data.from, data.to, data.type, data.preview),
3223
+ create: (data) => handleCreate(data.from, data.to, data.type, data.preview, data.move),
3213
3224
  "batch-create": (data) => handleBatchCreate(data.relations),
3214
3225
  delete: (data) => handleDelete(data.from, data.to, data.type)
3215
3226
  };
@@ -3235,7 +3246,7 @@ The spine links, child to parent: ${SPINE_RUNG_LINES.join(" ")}`,
3235
3246
  })
3236
3247
  );
3237
3248
  }
3238
- async function handleCreate(from, to, type, preview) {
3249
+ async function handleCreate(from, to, type, preview, move) {
3239
3250
  requireWriteAccess();
3240
3251
  const agentSessionId = getAgentSessionId();
3241
3252
  const result2 = await kernelMutation("chain.createEntryRelation", {
@@ -3245,7 +3256,9 @@ async function handleCreate(from, to, type, preview) {
3245
3256
  // Explicit relate = the caller chose the verb; DEC-1915 / TASK-601: it is written exactly as sent.
3246
3257
  proposedBy: "user",
3247
3258
  sessionId: agentSessionId ?? void 0,
3248
- ...preview ? { preview: true } : {}
3259
+ ...preview ? { preview: true } : {},
3260
+ ...move ? { move: true } : {}
3261
+ // TASK-1164
3249
3262
  });
3250
3263
  if (result2 && "outcome" in result2 && result2.outcome === "refused") {
3251
3264
  const refusal = result2.refusal;
@@ -11870,4 +11883,4 @@ export {
11870
11883
  SERVER_VERSION,
11871
11884
  createProductBrainServer
11872
11885
  };
11873
- //# sourceMappingURL=chunk-KMC5H4BZ.js.map
11886
+ //# sourceMappingURL=chunk-AT2VBGDM.js.map