@productbrain/mcp 0.0.1-beta.8845 → 0.0.1-beta.8849
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.
|
@@ -4327,7 +4327,6 @@ var relationsCreateVariant = z13.object({
|
|
|
4327
4327
|
from: z13.string().max(200),
|
|
4328
4328
|
to: z13.string().max(200),
|
|
4329
4329
|
type: z13.string().max(200),
|
|
4330
|
-
score: z13.number().optional(),
|
|
4331
4330
|
preview: z13.boolean().optional()
|
|
4332
4331
|
});
|
|
4333
4332
|
var relationsBatchCreateVariant = z13.object({
|
|
@@ -4367,7 +4366,7 @@ var relationsActionUnion = z13.discriminatedUnion("action", [
|
|
|
4367
4366
|
relationsSuggestVariant
|
|
4368
4367
|
]);
|
|
4369
4368
|
var RELATIONS_ACTION_SPECS = {
|
|
4370
|
-
create: { params: ["from", "to", "type", "
|
|
4369
|
+
create: { params: ["from", "to", "type", "preview"], description: "from, to, and type are required." },
|
|
4371
4370
|
"batch-create": { params: ["relations"], description: "relations (1-20 items) is required." },
|
|
4372
4371
|
dismiss: { params: ["from", "to", "type", "score"], description: "from and to are required." },
|
|
4373
4372
|
delete: { params: ["from", "to", "type"], description: "from, to, and type are required." },
|
|
@@ -4376,7 +4375,7 @@ var RELATIONS_ACTION_SPECS = {
|
|
|
4376
4375
|
};
|
|
4377
4376
|
function registerRelationsTools(server) {
|
|
4378
4377
|
const relationsHandlers = {
|
|
4379
|
-
create: (data) => handleCreate(data.from, data.to, data.type, data.
|
|
4378
|
+
create: (data) => handleCreate(data.from, data.to, data.type, data.preview),
|
|
4380
4379
|
"batch-create": (data) => handleBatchCreate(data.relations),
|
|
4381
4380
|
dismiss: (data) => handleDismiss(data.from, data.to, data.type ?? "related_to", data.score),
|
|
4382
4381
|
delete: (data) => handleDelete(data.from, data.to, data.type),
|
|
@@ -4403,16 +4402,14 @@ function registerRelationsTools(server) {
|
|
|
4403
4402
|
})
|
|
4404
4403
|
);
|
|
4405
4404
|
}
|
|
4406
|
-
async function handleCreate(from, to, type,
|
|
4405
|
+
async function handleCreate(from, to, type, preview) {
|
|
4407
4406
|
requireWriteAccess();
|
|
4408
4407
|
const agentSessionId = getAgentSessionId();
|
|
4409
4408
|
const result2 = await kernelMutation("chain.createEntryRelation", {
|
|
4410
4409
|
fromEntryId: from,
|
|
4411
4410
|
toEntryId: to,
|
|
4412
4411
|
type,
|
|
4413
|
-
|
|
4414
|
-
// WP-474 E4-REWIRE: explicit relate = human/agent-CHOSEN type → mark "user"
|
|
4415
|
-
// (DEC-1399: out of gate scope, but positively marked so the judge never keys off absence).
|
|
4412
|
+
// Explicit relate = the caller chose the verb; DEC-1915 / TASK-601: it is written exactly as sent.
|
|
4416
4413
|
proposedBy: "user",
|
|
4417
4414
|
sessionId: agentSessionId ?? void 0,
|
|
4418
4415
|
...preview ? { preview: true } : {}
|
|
@@ -4478,16 +4475,13 @@ ${result2.blockingReason ?? "This relation would be rejected."}` }],
|
|
|
4478
4475
|
)
|
|
4479
4476
|
};
|
|
4480
4477
|
}
|
|
4481
|
-
const suggested2 = result2.suggestedType;
|
|
4482
4478
|
const advisoryText = (result2.advisories ?? []).map((a) => `
|
|
4483
4479
|
|
|
4484
4480
|
\u26A0 **${a.ruleId}** (org stage: ${a.stage}): ${a.ruleText}`).join("");
|
|
4485
4481
|
return {
|
|
4486
4482
|
content: [{ type: "text", text: `# Preview: would relate ${from} \u2192 ${to} (${type})
|
|
4487
4483
|
|
|
4488
|
-
No DB writes \u2014 call without \`preview:true\` to create for real.${
|
|
4489
|
-
|
|
4490
|
-
**Type suggestion:** \`${suggested2.type}\` may be more precise (${suggested2.confidence}% confidence).` : ""}${advisoryText}` }],
|
|
4484
|
+
No DB writes \u2014 call without \`preview:true\` to create for real.${advisoryText}` }],
|
|
4491
4485
|
structuredContent: success(
|
|
4492
4486
|
`Preview: would relate ${from} \u2192 ${to} (${type}) \u2014 no DB writes`,
|
|
4493
4487
|
{
|
|
@@ -4495,7 +4489,6 @@ No DB writes \u2014 call without \`preview:true\` to create for real.${suggested
|
|
|
4495
4489
|
from,
|
|
4496
4490
|
to,
|
|
4497
4491
|
type,
|
|
4498
|
-
...suggested2 && { suggestedType: suggested2 },
|
|
4499
4492
|
...result2.advisories && result2.advisories.length > 0 && { advisories: result2.advisories }
|
|
4500
4493
|
},
|
|
4501
4494
|
[{ tool: "relations", description: "Create for real", parameters: { action: "create", from, to, type } }]
|
|
@@ -4509,13 +4502,6 @@ No DB writes \u2014 call without \`preview:true\` to create for real.${suggested
|
|
|
4509
4502
|
`**${from}** \u2014[${type}]\u2192 **${to}**`,
|
|
4510
4503
|
`**Workspace:** ${wsCtx.workspaceSlug} (${wsCtx.workspaceId})`
|
|
4511
4504
|
];
|
|
4512
|
-
const suggested = result2?.suggestedType;
|
|
4513
|
-
if (suggested) {
|
|
4514
|
-
lines.push("");
|
|
4515
|
-
lines.push(`**Type suggestion:** \`${suggested.type}\` may be more precise (${suggested.confidence}% confidence).`);
|
|
4516
|
-
lines.push(`_${suggested.reasoning}_`);
|
|
4517
|
-
lines.push(`To use instead: \`relations action=create from="${from}" to="${to}" type="${suggested.type}"\``);
|
|
4518
|
-
}
|
|
4519
4505
|
for (const a of result2?.advisories ?? []) {
|
|
4520
4506
|
lines.push("");
|
|
4521
4507
|
lines.push(`\u26A0 Written anyway (org stage: ${a.stage}): ${a.ruleText}`);
|
|
@@ -4529,7 +4515,6 @@ No DB writes \u2014 call without \`preview:true\` to create for real.${suggested
|
|
|
4529
4515
|
from,
|
|
4530
4516
|
to,
|
|
4531
4517
|
type,
|
|
4532
|
-
...suggested && { suggestedType: suggested },
|
|
4533
4518
|
...result2?.advisories && result2.advisories.length > 0 && { advisories: result2.advisories }
|
|
4534
4519
|
},
|
|
4535
4520
|
[{ tool: "relations", description: "See connections", parameters: { action: "find", entryId: from } }]
|
|
@@ -13938,4 +13923,4 @@ export {
|
|
|
13938
13923
|
createProductBrainServer,
|
|
13939
13924
|
initFeatureFlags
|
|
13940
13925
|
};
|
|
13941
|
-
//# sourceMappingURL=chunk-
|
|
13926
|
+
//# sourceMappingURL=chunk-QV6OOBAC.js.map
|