@productbrain/mcp 0.0.1-beta.15497 → 0.0.1-beta.15502
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.
|
@@ -1052,7 +1052,11 @@ This client stopped waiting after ${error.elapsedMs}ms. ${recovery}`
|
|
|
1052
1052
|
})
|
|
1053
1053
|
};
|
|
1054
1054
|
}
|
|
1055
|
-
function resumeReplayedCapture(replay,
|
|
1055
|
+
function resumeReplayedCapture(replay, typedName) {
|
|
1056
|
+
const name = replay.name ?? typedName;
|
|
1057
|
+
const saved = replay.savedAs ? `
|
|
1058
|
+
|
|
1059
|
+
${replay.savedAs}` : "";
|
|
1056
1060
|
const links = replay.links ?? [];
|
|
1057
1061
|
const status2 = isTrustAccepted(replay.status) ? "committed" : "draft";
|
|
1058
1062
|
const summary = `Already captured as ${replay.entryId}; this re-send returned that entry and wrote no second one.`;
|
|
@@ -1070,7 +1074,7 @@ ${typedLinks.map((l) => l.line).join("\n")}` : "");
|
|
|
1070
1074
|
type: "text",
|
|
1071
1075
|
text: `# Already Captured: ${replay.entryId}
|
|
1072
1076
|
|
|
1073
|
-
${summary}${linkBlock}${draftLines.map((l) => `
|
|
1077
|
+
${summary}${saved}${linkBlock}${draftLines.map((l) => `
|
|
1074
1078
|
${l}`).join("")}
|
|
1075
1079
|
|
|
1076
1080
|
Read it with \`context action=get\`.`
|
|
@@ -1079,6 +1083,7 @@ Read it with \`context action=get\`.`
|
|
|
1079
1083
|
entryId: replay.entryId,
|
|
1080
1084
|
collection: replay.collection,
|
|
1081
1085
|
name,
|
|
1086
|
+
...replay.savedAs ? { savedAs: replay.savedAs } : {},
|
|
1082
1087
|
status: status2,
|
|
1083
1088
|
replayed: true,
|
|
1084
1089
|
...links.length ? { links } : {},
|
|
@@ -1303,6 +1308,8 @@ var captureSuccessOutputSchema = z5.object({
|
|
|
1303
1308
|
entryId: z5.string(),
|
|
1304
1309
|
collection: z5.string(),
|
|
1305
1310
|
name: z5.string(),
|
|
1311
|
+
savedAs: z5.string().optional(),
|
|
1312
|
+
// TASK-1901: the kernel's line when the name was stored other than typed
|
|
1306
1313
|
status: z5.enum(["draft", "committed", "proposed", "draft_on_failure"]),
|
|
1307
1314
|
// "committed": only a re-send of an entry accepted since (captureTimeoutOutcome.ts); a create never accepts (DEC-2331)
|
|
1308
1315
|
// WP-480 S1: `qualityScore` deleted (accepted breaking output change); the server verdict stays as `qualityVerdict`.
|
|
@@ -1441,6 +1448,8 @@ ${context.trim()}` : description;
|
|
|
1441
1448
|
let groundingCaveat = "";
|
|
1442
1449
|
const agentId = getAgentSessionId();
|
|
1443
1450
|
let finalEntryId;
|
|
1451
|
+
let savedName = name;
|
|
1452
|
+
let savedAs;
|
|
1444
1453
|
let landedCollection;
|
|
1445
1454
|
let replyFields = [];
|
|
1446
1455
|
let classifierMeta;
|
|
@@ -1543,6 +1552,8 @@ No DB writes \u2014 call without \`preview:true\` to capture for real.${result2.
|
|
|
1543
1552
|
}
|
|
1544
1553
|
const created = result2;
|
|
1545
1554
|
finalEntryId = created.entryId;
|
|
1555
|
+
savedName = created.name ?? name;
|
|
1556
|
+
savedAs = created.savedAs;
|
|
1546
1557
|
landedCollection = created.collection ?? collectionSlug ?? "";
|
|
1547
1558
|
replyFields = created.fields ?? [];
|
|
1548
1559
|
classifierMeta = created.classification ? classifierFromReply(created.classification) : void 0;
|
|
@@ -1595,8 +1606,10 @@ Use \`context action=get\` to inspect the existing entry, or \`entries action=up
|
|
|
1595
1606
|
}
|
|
1596
1607
|
const finalStatus = "draft";
|
|
1597
1608
|
const lines = [
|
|
1598
|
-
`# Captured: ${finalEntryId ||
|
|
1599
|
-
`**${
|
|
1609
|
+
`# Captured: ${finalEntryId || savedName}`,
|
|
1610
|
+
`**${savedName}** added to \`${landedCollection}\` as \`${finalStatus}\``,
|
|
1611
|
+
...savedAs ? [savedAs] : [],
|
|
1612
|
+
// TASK-1901: never a warning
|
|
1600
1613
|
`**Workspace:** ${wsCtx.workspaceSlug} (${wsCtx.workspaceId})`
|
|
1601
1614
|
];
|
|
1602
1615
|
if (classifierMeta) {
|
|
@@ -1613,7 +1626,7 @@ Use \`context action=get\` to inspect the existing entry, or \`entries action=up
|
|
|
1613
1626
|
for (const l of linkOutcomes) lines.push(`- ${l.line}`);
|
|
1614
1627
|
}
|
|
1615
1628
|
if (typedLinks.length > 0) lines.push("", ...typedLinks.map((l) => l.line));
|
|
1616
|
-
lines.push(...draftReplyLines(
|
|
1629
|
+
lines.push(...draftReplyLines(savedName, finalEntryId, spineFloor, missingFieldLines), ...possibleClashes.length ? ["", ...possibleClashes] : []);
|
|
1617
1630
|
if (groundingCaveat) lines.push("", groundingCaveat);
|
|
1618
1631
|
const named = groundingReport.duplicates.slice(0, 3).map((d) => `${d.entryId} "${d.name}"`).join(", ");
|
|
1619
1632
|
if (named) lines.push("", `**Possible match:** ${named}. Nothing was written to it; to change it, use \`entries action=update\`.`);
|
|
@@ -1652,7 +1665,7 @@ Use \`context action=get\` to inspect the existing entry, or \`entries action=up
|
|
|
1652
1665
|
const next = [{ tool: "context", description: "Review the draft alternative", parameters: { action: "get", entryId: finalEntryId } }];
|
|
1653
1666
|
next.push(spineFloor && !spineFloor.exempt && !spineFloor.linkWritten ? { tool: "relations", description: missingParentLine(spineFloor.parentKind.replace(/_/g, " ")), parameters: { action: "create", from: finalEntryId, type: spineFloor.relationType } } : { tool: "entries", description: "Accept onto Chain", parameters: { action: "accept", entryId: finalEntryId } });
|
|
1654
1667
|
const qualityPhrase = verdictQualityPhrase(verdictResult);
|
|
1655
|
-
const summary = `Captured ${finalEntryId} (${
|
|
1668
|
+
const summary = `Captured ${finalEntryId} (${savedName}) as draft in ${landedCollection}. ${qualityPhrase}`;
|
|
1656
1669
|
const expectedFields = replyFields.map((f) => ({ key: f.key, type: f.type, ...f.required && { required: true } }));
|
|
1657
1670
|
const captureContractForEnvelope = {
|
|
1658
1671
|
requiredFields: replyFields.filter((f) => f.required === true).map((f) => f.key),
|
|
@@ -1673,7 +1686,8 @@ Use \`context action=get\` to inspect the existing entry, or \`entries action=up
|
|
|
1673
1686
|
{
|
|
1674
1687
|
entryId: finalEntryId,
|
|
1675
1688
|
collection: landedCollection,
|
|
1676
|
-
name,
|
|
1689
|
+
name: savedName,
|
|
1690
|
+
...savedAs ? { savedAs } : {},
|
|
1677
1691
|
status: finalStatus,
|
|
1678
1692
|
// WP-480 S1: the server verdict rides `qualityVerdict` (named breaking
|
|
1679
1693
|
// output-contract change, pre-launch).
|
|
@@ -1981,6 +1995,8 @@ ${mcp}`, "QUALITY_HELD", mcp.split("\n")[0] ?? mcp, mcp.split("\n")[1] ?? mcp, v
|
|
|
1981
1995
|
``,
|
|
1982
1996
|
applied.receipt ?? `**${entryId}** \u2014 ${versionMode}.`,
|
|
1983
1997
|
// TASK-773: a draft team's discard names the drafts it took
|
|
1998
|
+
...applied.savedAs ? [applied.savedAs] : [],
|
|
1999
|
+
// TASK-1901: the name as stored, one plain line, never under the warnings
|
|
1984
2000
|
...changedLine ? [changedLine] : [],
|
|
1985
2001
|
...applied.qualityOverride ? [applied.qualityOverride] : [],
|
|
1986
2002
|
// TASK-954: the recorded line, never a silent clear
|
|
@@ -2018,6 +2034,8 @@ ${mcp}`, "QUALITY_HELD", mcp.split("\n")[0] ?? mcp, mcp.split("\n")[1] ?? mcp, v
|
|
|
2018
2034
|
structuredContent: success(summary, {
|
|
2019
2035
|
entryId: id,
|
|
2020
2036
|
versionMode,
|
|
2037
|
+
...applied.savedAs ? { savedAs: applied.savedAs } : {},
|
|
2038
|
+
// TASK-1901
|
|
2021
2039
|
fieldsApplied: appliedFields,
|
|
2022
2040
|
// PR B: renamed from fieldsProvided (caller intent) — this is the server's verdict, matching the text above
|
|
2023
2041
|
// BET-192: normalization breakdown in structuredContent — symmetric with capture tool
|
|
@@ -12597,4 +12615,4 @@ export {
|
|
|
12597
12615
|
SERVER_VERSION,
|
|
12598
12616
|
createProductBrainServer
|
|
12599
12617
|
};
|
|
12600
|
-
//# sourceMappingURL=chunk-
|
|
12618
|
+
//# sourceMappingURL=chunk-3IHJH6F7.js.map
|