@productbrain/mcp 0.0.1-beta.12101 → 0.0.1-beta.12114
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.
- package/dist/{chunk-WLWNFSAV.js → chunk-OJL74TF6.js} +23 -10
- package/dist/{chunk-WLWNFSAV.js.map → chunk-OJL74TF6.js.map} +1 -1
- package/dist/{chunk-PD5WOI5O.js → chunk-X3F2D6NI.js} +2 -1
- package/dist/chunk-X3F2D6NI.js.map +1 -0
- package/dist/cli/index.js +1 -1
- package/dist/http.js +2 -2
- package/dist/index.js +2 -2
- package/dist/{setup-MXUCMJIY.js → setup-IC6J7EMW.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-PD5WOI5O.js.map +0 -1
- /package/dist/{setup-MXUCMJIY.js.map → setup-IC6J7EMW.js.map} +0 -0
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
runWithToolContext,
|
|
41
41
|
setSessionOriented,
|
|
42
42
|
startAgentSession
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-X3F2D6NI.js";
|
|
44
44
|
|
|
45
45
|
// src/server.ts
|
|
46
46
|
import { McpServer as McpServer2 } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -9278,6 +9278,8 @@ function isStructural(value) {
|
|
|
9278
9278
|
]) {
|
|
9279
9279
|
if (value[key] != null && !isStringArray(value[key])) return false;
|
|
9280
9280
|
}
|
|
9281
|
+
const stranded = value.strandedWorkPackages;
|
|
9282
|
+
if (stranded != null && !(Array.isArray(stranded) && stranded.every((w) => isRecord(w) && typeof w.id === "string" && isStringArray(w.pastTargetIds)))) return false;
|
|
9281
9283
|
return value.visionPurposeConnectivityTruncated === void 0 || typeof value.visionPurposeConnectivityTruncated === "boolean";
|
|
9282
9284
|
}
|
|
9283
9285
|
function isStrategy(value) {
|
|
@@ -9291,7 +9293,7 @@ function readSpineVerdict(value) {
|
|
|
9291
9293
|
if (!isRecord(value) || typeof value.noSpineEntries !== "boolean") return { kind: "malformed" };
|
|
9292
9294
|
if (value.noSpineEntries) return { kind: "empty" };
|
|
9293
9295
|
if (!isStructural(value.structural) || !Array.isArray(value.perStrategy) || !value.perStrategy.every(isStrategy) || !isStory(value.story)) return { kind: "malformed" };
|
|
9294
|
-
for (const key of ["strategiesTruncated", "perStrategyEvaluationTruncated", "objectivesTruncated", "keyResultsTruncated"]) {
|
|
9296
|
+
for (const key of ["strategiesTruncated", "perStrategyEvaluationTruncated", "objectivesTruncated", "keyResultsTruncated", "workPackagesTruncated"]) {
|
|
9295
9297
|
if (value[key] !== void 0 && typeof value[key] !== "boolean") return { kind: "malformed" };
|
|
9296
9298
|
}
|
|
9297
9299
|
return { kind: "graded", verdict: value };
|
|
@@ -9302,7 +9304,7 @@ function describeSpineStaleness(changedMemberCount, membershipTruncated = false,
|
|
|
9302
9304
|
return reason + (membershipTruncated ? "; membership scan incomplete" : "");
|
|
9303
9305
|
}
|
|
9304
9306
|
if (relationsChanged) {
|
|
9305
|
-
return "
|
|
9307
|
+
return "a part_of or validates link changed since this check ran" + (membershipTruncated ? "; membership scan incomplete" : "");
|
|
9306
9308
|
}
|
|
9307
9309
|
return "freshness could not be verified; the changed-entry count is unknown" + (membershipTruncated ? "; membership scan incomplete" : "");
|
|
9308
9310
|
}
|
|
@@ -10100,6 +10102,10 @@ Session lifecycle, wrapup review, and work package facilitation.
|
|
|
10100
10102
|
})
|
|
10101
10103
|
);
|
|
10102
10104
|
}
|
|
10105
|
+
async function readAllowanceLine() {
|
|
10106
|
+
const usage = await kernelQuery("usage.getWorkspaceSummary", { periodDays: 1 }).catch(() => null);
|
|
10107
|
+
return usage?.allowanceLine;
|
|
10108
|
+
}
|
|
10103
10109
|
async function handleStart2(data) {
|
|
10104
10110
|
const result2 = await startAgentSession(data?.role, data?.team);
|
|
10105
10111
|
const lines = [];
|
|
@@ -10107,6 +10113,8 @@ async function handleStart2(data) {
|
|
|
10107
10113
|
`Session ${result2.sessionId} active. Pass sessionId="${result2.sessionId}" on every write: the connection does not remember your session between calls. Initiated by ${result2.initiatedBy}. Workspace ${result2.workspaceName}. Scope: ${result2.toolsScope}. Orient with a task before substantive work: it is advice for captures, relations, accepts, ticks and questions; workflow checkpoints and organisation-structure writes still require it.`
|
|
10108
10114
|
);
|
|
10109
10115
|
if (!result2.briefing?.firstReply) lines.push(FEEDBACK_SUBMIT_HINT);
|
|
10116
|
+
const allowanceLine = await readAllowanceLine();
|
|
10117
|
+
if (allowanceLine) lines.push(allowanceLine);
|
|
10110
10118
|
const questionNotice = result2.notices?.find((n) => n.source === QUESTION_ACK_GATE_SOURCE_ID);
|
|
10111
10119
|
const noticeLines = formatNoticeLines(result2.notices?.filter((n) => n !== questionNotice));
|
|
10112
10120
|
if (noticeLines.length > 0) lines.push("", "Notices:", ...noticeLines);
|
|
@@ -10138,8 +10146,10 @@ async function handleStart2(data) {
|
|
|
10138
10146
|
notices: result2.notices ?? [],
|
|
10139
10147
|
ruleLists: result2.ruleLists,
|
|
10140
10148
|
// TASK-436
|
|
10141
|
-
briefing: result2.briefing
|
|
10149
|
+
briefing: result2.briefing,
|
|
10142
10150
|
// TASK-552
|
|
10151
|
+
...allowanceLine ? { allowanceLine } : {}
|
|
10152
|
+
// TASK-1014
|
|
10143
10153
|
// TASK-670 (WP-820): orient's only action is `task`; the agent fills in the task it is doing.
|
|
10144
10154
|
// FEAT-1409 spine core: notice next-actions are appended through this SAME existing
|
|
10145
10155
|
// `next` field (HARD CONSTRAINT 2) — never a parallel action list.
|
|
@@ -10762,20 +10772,22 @@ async function handleUsageSummary(periodDays) {
|
|
|
10762
10772
|
`## Usage Summary \u2014 ${ws.workspaceName}`,
|
|
10763
10773
|
`Period: last ${summary.periodDays} days`,
|
|
10764
10774
|
"",
|
|
10765
|
-
`**Total
|
|
10775
|
+
`**Total credits:** ${summary.totalCostCredits.toLocaleString("en-US")} (${summary.totalRequests} requests)`,
|
|
10776
|
+
// TASK-1014: never a currency
|
|
10777
|
+
summary.allowanceLine,
|
|
10766
10778
|
`**Total tokens:** ${summary.totalTokens.toLocaleString()} (cached: ${summary.cachedTokens.toLocaleString()}, reasoning: ${summary.reasoningTokens.toLocaleString()})`,
|
|
10767
10779
|
`**Cache hit rate:** ${(summary.cacheHitRate * 100).toFixed(1)}%`
|
|
10768
10780
|
];
|
|
10769
10781
|
if (summary.modelBreakdown.length > 0) {
|
|
10770
10782
|
lines.push("", "### Model Breakdown");
|
|
10771
10783
|
for (const m of summary.modelBreakdown) {
|
|
10772
|
-
lines.push(`- **${m.model}**:
|
|
10784
|
+
lines.push(`- **${m.model}**: ${m.costCredits.toLocaleString("en-US")} credits (${m.requests} requests)`);
|
|
10773
10785
|
}
|
|
10774
10786
|
}
|
|
10775
10787
|
if (summary.featureBreakdown.length > 0) {
|
|
10776
10788
|
lines.push("", "### Feature Breakdown");
|
|
10777
10789
|
for (const f of summary.featureBreakdown) {
|
|
10778
|
-
lines.push(`- **${f.feature}**:
|
|
10790
|
+
lines.push(`- **${f.feature}**: ${f.costCredits.toLocaleString("en-US")} credits (${f.requests} requests)`);
|
|
10779
10791
|
}
|
|
10780
10792
|
}
|
|
10781
10793
|
if (sessionId) {
|
|
@@ -10789,11 +10801,12 @@ async function handleUsageSummary(periodDays) {
|
|
|
10789
10801
|
}
|
|
10790
10802
|
],
|
|
10791
10803
|
structuredContent: success(
|
|
10792
|
-
`Usage for ${ws.workspaceName}:
|
|
10804
|
+
`Usage for ${ws.workspaceName}: ${summary.totalCostCredits.toLocaleString("en-US")} credits over ${summary.periodDays} days, ${summary.totalRequests} requests.`,
|
|
10793
10805
|
{
|
|
10794
10806
|
periodDays: summary.periodDays,
|
|
10795
10807
|
totalTokens: summary.totalTokens,
|
|
10796
|
-
|
|
10808
|
+
totalCostCredits: summary.totalCostCredits,
|
|
10809
|
+
allowanceLine: summary.allowanceLine,
|
|
10797
10810
|
totalRequests: summary.totalRequests,
|
|
10798
10811
|
cacheHitRate: summary.cacheHitRate,
|
|
10799
10812
|
modelBreakdown: summary.modelBreakdown,
|
|
@@ -11883,4 +11896,4 @@ export {
|
|
|
11883
11896
|
SERVER_VERSION,
|
|
11884
11897
|
createProductBrainServer
|
|
11885
11898
|
};
|
|
11886
|
-
//# sourceMappingURL=chunk-
|
|
11899
|
+
//# sourceMappingURL=chunk-OJL74TF6.js.map
|