@productbrain/mcp 0.0.1-beta.12112 → 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.
|
@@ -10102,6 +10102,10 @@ Session lifecycle, wrapup review, and work package facilitation.
|
|
|
10102
10102
|
})
|
|
10103
10103
|
);
|
|
10104
10104
|
}
|
|
10105
|
+
async function readAllowanceLine() {
|
|
10106
|
+
const usage = await kernelQuery("usage.getWorkspaceSummary", { periodDays: 1 }).catch(() => null);
|
|
10107
|
+
return usage?.allowanceLine;
|
|
10108
|
+
}
|
|
10105
10109
|
async function handleStart2(data) {
|
|
10106
10110
|
const result2 = await startAgentSession(data?.role, data?.team);
|
|
10107
10111
|
const lines = [];
|
|
@@ -10109,6 +10113,8 @@ async function handleStart2(data) {
|
|
|
10109
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.`
|
|
10110
10114
|
);
|
|
10111
10115
|
if (!result2.briefing?.firstReply) lines.push(FEEDBACK_SUBMIT_HINT);
|
|
10116
|
+
const allowanceLine = await readAllowanceLine();
|
|
10117
|
+
if (allowanceLine) lines.push(allowanceLine);
|
|
10112
10118
|
const questionNotice = result2.notices?.find((n) => n.source === QUESTION_ACK_GATE_SOURCE_ID);
|
|
10113
10119
|
const noticeLines = formatNoticeLines(result2.notices?.filter((n) => n !== questionNotice));
|
|
10114
10120
|
if (noticeLines.length > 0) lines.push("", "Notices:", ...noticeLines);
|
|
@@ -10140,8 +10146,10 @@ async function handleStart2(data) {
|
|
|
10140
10146
|
notices: result2.notices ?? [],
|
|
10141
10147
|
ruleLists: result2.ruleLists,
|
|
10142
10148
|
// TASK-436
|
|
10143
|
-
briefing: result2.briefing
|
|
10149
|
+
briefing: result2.briefing,
|
|
10144
10150
|
// TASK-552
|
|
10151
|
+
...allowanceLine ? { allowanceLine } : {}
|
|
10152
|
+
// TASK-1014
|
|
10145
10153
|
// TASK-670 (WP-820): orient's only action is `task`; the agent fills in the task it is doing.
|
|
10146
10154
|
// FEAT-1409 spine core: notice next-actions are appended through this SAME existing
|
|
10147
10155
|
// `next` field (HARD CONSTRAINT 2) — never a parallel action list.
|
|
@@ -10764,20 +10772,22 @@ async function handleUsageSummary(periodDays) {
|
|
|
10764
10772
|
`## Usage Summary \u2014 ${ws.workspaceName}`,
|
|
10765
10773
|
`Period: last ${summary.periodDays} days`,
|
|
10766
10774
|
"",
|
|
10767
|
-
`**Total
|
|
10775
|
+
`**Total credits:** ${summary.totalCostCredits.toLocaleString("en-US")} (${summary.totalRequests} requests)`,
|
|
10776
|
+
// TASK-1014: never a currency
|
|
10777
|
+
summary.allowanceLine,
|
|
10768
10778
|
`**Total tokens:** ${summary.totalTokens.toLocaleString()} (cached: ${summary.cachedTokens.toLocaleString()}, reasoning: ${summary.reasoningTokens.toLocaleString()})`,
|
|
10769
10779
|
`**Cache hit rate:** ${(summary.cacheHitRate * 100).toFixed(1)}%`
|
|
10770
10780
|
];
|
|
10771
10781
|
if (summary.modelBreakdown.length > 0) {
|
|
10772
10782
|
lines.push("", "### Model Breakdown");
|
|
10773
10783
|
for (const m of summary.modelBreakdown) {
|
|
10774
|
-
lines.push(`- **${m.model}**:
|
|
10784
|
+
lines.push(`- **${m.model}**: ${m.costCredits.toLocaleString("en-US")} credits (${m.requests} requests)`);
|
|
10775
10785
|
}
|
|
10776
10786
|
}
|
|
10777
10787
|
if (summary.featureBreakdown.length > 0) {
|
|
10778
10788
|
lines.push("", "### Feature Breakdown");
|
|
10779
10789
|
for (const f of summary.featureBreakdown) {
|
|
10780
|
-
lines.push(`- **${f.feature}**:
|
|
10790
|
+
lines.push(`- **${f.feature}**: ${f.costCredits.toLocaleString("en-US")} credits (${f.requests} requests)`);
|
|
10781
10791
|
}
|
|
10782
10792
|
}
|
|
10783
10793
|
if (sessionId) {
|
|
@@ -10791,11 +10801,12 @@ async function handleUsageSummary(periodDays) {
|
|
|
10791
10801
|
}
|
|
10792
10802
|
],
|
|
10793
10803
|
structuredContent: success(
|
|
10794
|
-
`Usage for ${ws.workspaceName}:
|
|
10804
|
+
`Usage for ${ws.workspaceName}: ${summary.totalCostCredits.toLocaleString("en-US")} credits over ${summary.periodDays} days, ${summary.totalRequests} requests.`,
|
|
10795
10805
|
{
|
|
10796
10806
|
periodDays: summary.periodDays,
|
|
10797
10807
|
totalTokens: summary.totalTokens,
|
|
10798
|
-
|
|
10808
|
+
totalCostCredits: summary.totalCostCredits,
|
|
10809
|
+
allowanceLine: summary.allowanceLine,
|
|
10799
10810
|
totalRequests: summary.totalRequests,
|
|
10800
10811
|
cacheHitRate: summary.cacheHitRate,
|
|
10801
10812
|
modelBreakdown: summary.modelBreakdown,
|
|
@@ -11885,4 +11896,4 @@ export {
|
|
|
11885
11896
|
SERVER_VERSION,
|
|
11886
11897
|
createProductBrainServer
|
|
11887
11898
|
};
|
|
11888
|
-
//# sourceMappingURL=chunk-
|
|
11899
|
+
//# sourceMappingURL=chunk-OJL74TF6.js.map
|