@productbrain/mcp 0.0.1-beta.2115 → 0.0.1-beta.2128
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.
|
@@ -3431,6 +3431,20 @@ function renderWhyLine(e) {
|
|
|
3431
3431
|
}
|
|
3432
3432
|
return { line: null, why, whySourceKey: null };
|
|
3433
3433
|
}
|
|
3434
|
+
function renderVerificationLine(e) {
|
|
3435
|
+
if (!e.verificationStatus) return null;
|
|
3436
|
+
const verifiedBy = typeof e.verifiedBy === "string" ? e.verifiedBy : void 0;
|
|
3437
|
+
const attestation = e.attestation && typeof e.attestation === "object" ? e.attestation : void 0;
|
|
3438
|
+
const strength = attestation && typeof attestation.strength === "string" ? attestation.strength : void 0;
|
|
3439
|
+
const basis = attestation && typeof attestation.basis === "string" ? attestation.basis : void 0;
|
|
3440
|
+
let who;
|
|
3441
|
+
if (basis && basis !== "attested") {
|
|
3442
|
+
who = verifiedBy ? ` (${verifiedBy})` : "";
|
|
3443
|
+
} else {
|
|
3444
|
+
who = verifiedBy ? ` \u2014 by ${verifiedBy}${strength ? ` (${strength})` : ""}` : "";
|
|
3445
|
+
}
|
|
3446
|
+
return `**Verification:** ${String(e.verificationStatus)}${who}`;
|
|
3447
|
+
}
|
|
3434
3448
|
var ENTRIES_ACTIONS = ["list", "get", "batch", "search"];
|
|
3435
3449
|
var entriesSchema = z4.object({
|
|
3436
3450
|
action: z4.enum(ENTRIES_ACTIONS).describe(
|
|
@@ -3457,6 +3471,14 @@ var entriesGetOutputSchema = z4.object({
|
|
|
3457
3471
|
origin: z4.string().optional(),
|
|
3458
3472
|
originDetail: z4.string().optional(),
|
|
3459
3473
|
verificationStatus: z4.string().optional(),
|
|
3474
|
+
// Attestation-model finding (PR #341 review): the server's honest verifier label and
|
|
3475
|
+
// derived attestation strength/basis — connectors NEVER re-derive strength (spec §5),
|
|
3476
|
+
// they only render what chain.getEntry ships. Mirrors packages/cli EntryFromApi.
|
|
3477
|
+
verifiedBy: z4.string().optional(),
|
|
3478
|
+
attestation: z4.object({
|
|
3479
|
+
strength: z4.enum(["human-direct", "delegated", "system", "unattested"]),
|
|
3480
|
+
basis: z4.string().optional()
|
|
3481
|
+
}).optional(),
|
|
3460
3482
|
sourceRef: z4.string().optional(),
|
|
3461
3483
|
sourceExcerpt: z4.string().optional(),
|
|
3462
3484
|
why: z4.string().optional(),
|
|
@@ -3501,6 +3523,13 @@ var entriesBatchOutputSchema = z4.object({
|
|
|
3501
3523
|
origin: z4.string().optional(),
|
|
3502
3524
|
originDetail: z4.string().optional(),
|
|
3503
3525
|
verificationStatus: z4.string().optional(),
|
|
3526
|
+
// Attestation-model finding (PR #341 review): mirror entriesGetOutputSchema — batch
|
|
3527
|
+
// entries now carry the same honest verifiedBy/attestation fields.
|
|
3528
|
+
verifiedBy: z4.string().optional(),
|
|
3529
|
+
attestation: z4.object({
|
|
3530
|
+
strength: z4.enum(["human-direct", "delegated", "system", "unattested"]),
|
|
3531
|
+
basis: z4.string().optional()
|
|
3532
|
+
}).optional(),
|
|
3504
3533
|
sourceRef: z4.string().optional(),
|
|
3505
3534
|
sourceExcerpt: z4.string().optional(),
|
|
3506
3535
|
// TEN-2191: mirror entriesGetOutputSchema — batch entries now carry why/whyQuality.
|
|
@@ -3587,7 +3616,8 @@ async function handleGet(entryId) {
|
|
|
3587
3616
|
const detail = e.originDetail ? ` (${e.originDetail})` : "";
|
|
3588
3617
|
lines.push(`**Origin:** ${e.origin}${detail}`);
|
|
3589
3618
|
}
|
|
3590
|
-
|
|
3619
|
+
const verificationLine = renderVerificationLine(e);
|
|
3620
|
+
if (verificationLine) lines.push(verificationLine);
|
|
3591
3621
|
if (e.sourceRef) lines.push(`**Source ref:** ${e.sourceRef}`);
|
|
3592
3622
|
if (e.sourceExcerpt) lines.push(`**Source excerpt:** ${e.sourceExcerpt}`);
|
|
3593
3623
|
if (epistemic) {
|
|
@@ -3638,6 +3668,11 @@ async function handleGet(entryId) {
|
|
|
3638
3668
|
...e.origin ? { origin: String(e.origin) } : {},
|
|
3639
3669
|
...e.originDetail ? { originDetail: String(e.originDetail) } : {},
|
|
3640
3670
|
...e.verificationStatus ? { verificationStatus: String(e.verificationStatus) } : {},
|
|
3671
|
+
// Attestation-model finding (PR #341 review): forward the server's honest verifier
|
|
3672
|
+
// label + derived attestation strength/basis on the structured payload too — the
|
|
3673
|
+
// agent surface must see the same fields the text render displays (spec §5).
|
|
3674
|
+
...typeof e.verifiedBy === "string" ? { verifiedBy: e.verifiedBy } : {},
|
|
3675
|
+
...e.attestation && typeof e.attestation === "object" ? { attestation: e.attestation } : {},
|
|
3641
3676
|
...e.sourceRef ? { sourceRef: String(e.sourceRef) } : {},
|
|
3642
3677
|
...e.sourceExcerpt ? { sourceExcerpt: String(e.sourceExcerpt) } : {},
|
|
3643
3678
|
// TEN-2191: surface the WHY and its quality in the structured payload too.
|
|
@@ -3698,9 +3733,8 @@ async function handleBatch(entryIds) {
|
|
|
3698
3733
|
const detail = entry.originDetail ? ` (${entry.originDetail})` : "";
|
|
3699
3734
|
lines.push(`**Origin:** ${entry.origin}${detail}`);
|
|
3700
3735
|
}
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
}
|
|
3736
|
+
const entryVerificationLine = renderVerificationLine(entry);
|
|
3737
|
+
if (entryVerificationLine) lines.push(entryVerificationLine);
|
|
3704
3738
|
if (entry.sourceRef) {
|
|
3705
3739
|
lines.push(`**Source ref:** ${entry.sourceRef}`);
|
|
3706
3740
|
}
|
|
@@ -3756,6 +3790,10 @@ async function handleBatch(entryIds) {
|
|
|
3756
3790
|
...entry.origin ? { origin: String(entry.origin) } : {},
|
|
3757
3791
|
...entry.originDetail ? { originDetail: String(entry.originDetail) } : {},
|
|
3758
3792
|
...entry.verificationStatus ? { verificationStatus: String(entry.verificationStatus) } : {},
|
|
3793
|
+
// Attestation-model finding (PR #341 review): mirror handleGet — forward the
|
|
3794
|
+
// honest verifier label + derived attestation on batch's structured payload too.
|
|
3795
|
+
...typeof entry.verifiedBy === "string" ? { verifiedBy: entry.verifiedBy } : {},
|
|
3796
|
+
...entry.attestation && typeof entry.attestation === "object" ? { attestation: entry.attestation } : {},
|
|
3759
3797
|
...entry.sourceRef ? { sourceRef: String(entry.sourceRef) } : {},
|
|
3760
3798
|
...entry.sourceExcerpt ? { sourceExcerpt: String(entry.sourceExcerpt) } : {},
|
|
3761
3799
|
...entry.workflowStatus ? { workflowStatus: String(entry.workflowStatus) } : {},
|
|
@@ -9925,8 +9963,19 @@ function registerVerifyTools(server) {
|
|
|
9925
9963
|
annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false }
|
|
9926
9964
|
},
|
|
9927
9965
|
thinWrapper(async ({ entryId }) => {
|
|
9928
|
-
const
|
|
9929
|
-
|
|
9966
|
+
const agentSessionId = getAgentSessionId();
|
|
9967
|
+
const result = await kernelMutation(
|
|
9968
|
+
"chain.verifyEntry",
|
|
9969
|
+
{
|
|
9970
|
+
entryId,
|
|
9971
|
+
...agentSessionId ? { sessionId: agentSessionId } : {}
|
|
9972
|
+
}
|
|
9973
|
+
);
|
|
9974
|
+
const basis = result.attestation?.basis;
|
|
9975
|
+
const strength = result.attestation?.strength;
|
|
9976
|
+
const verifiedBySuffix = result.verifiedBy ? basis && basis !== "attested" ? ` (${result.verifiedBy})` : ` \u2014 by ${result.verifiedBy}${strength ? ` (${strength})` : ""}` : "";
|
|
9977
|
+
const message = result.alreadyVerified ? `Entry ${entryId} is already verified${verifiedBySuffix}.` : `Entry ${entryId} verified${verifiedBySuffix}.`;
|
|
9978
|
+
return successResult(message, message, result);
|
|
9930
9979
|
})
|
|
9931
9980
|
);
|
|
9932
9981
|
trackWriteTool(verifyEntryTool);
|
|
@@ -14650,4 +14699,4 @@ export {
|
|
|
14650
14699
|
createProductBrainServer,
|
|
14651
14700
|
initFeatureFlags
|
|
14652
14701
|
};
|
|
14653
|
-
//# sourceMappingURL=chunk-
|
|
14702
|
+
//# sourceMappingURL=chunk-3CONR5XB.js.map
|