@productbrain/mcp 0.0.1-beta.13803 → 0.0.1-beta.13808
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-RQO4F4VT.js → chunk-KYQQAZVI.js} +51 -18
- package/dist/{chunk-RQO4F4VT.js.map → chunk-KYQQAZVI.js.map} +1 -1
- package/dist/{chunk-GZ5DC3GX.js → chunk-QLJ7VRKU.js} +19 -1
- package/dist/{chunk-GZ5DC3GX.js.map → chunk-QLJ7VRKU.js.map} +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/http.js +2 -2
- package/dist/index.js +2 -2
- package/dist/{setup-K2ZQAM66.js → setup-337PBIIW.js} +2 -2
- package/package.json +1 -1
- /package/dist/{setup-K2ZQAM66.js.map → setup-337PBIIW.js.map} +0 -0
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
PASS_SESSION_ID,
|
|
5
5
|
PASTE_NOW,
|
|
6
6
|
PERSON_STATUS_WORDS,
|
|
7
|
+
QUESTION_SEAT_WORDS,
|
|
8
|
+
QUESTION_TEAM_NEXT,
|
|
7
9
|
SPINE_RUNG_SEQUENCE,
|
|
8
10
|
START_NOTES_NOT_LOADED_LINE,
|
|
9
11
|
WORKSPACE_CLOSED,
|
|
@@ -31,6 +33,7 @@ import {
|
|
|
31
33
|
kernelMutation,
|
|
32
34
|
kernelQuery,
|
|
33
35
|
orientationRefusal,
|
|
36
|
+
questionSeatName,
|
|
34
37
|
recordSessionActivity,
|
|
35
38
|
requireActiveSession,
|
|
36
39
|
requireVendorTriageAccess,
|
|
@@ -45,7 +48,7 @@ import {
|
|
|
45
48
|
startAgentSession,
|
|
46
49
|
startTimingLine,
|
|
47
50
|
withAcceptPrompt
|
|
48
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-QLJ7VRKU.js";
|
|
49
52
|
|
|
50
53
|
// src/server.ts
|
|
51
54
|
import { McpServer as McpServer2 } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -11299,12 +11302,13 @@ import { z as z33 } from "zod/v3";
|
|
|
11299
11302
|
var QUESTION_ACTIONS = ["create", "assign", "answer", "force-close", "list"];
|
|
11300
11303
|
var questionSchema = z33.object({
|
|
11301
11304
|
action: z33.enum(QUESTION_ACTIONS).describe(
|
|
11302
|
-
|
|
11305
|
+
`'create': ask a question; toRole assigns it to that role at once. ${QUESTION_SEAT_WORDS.withoutTeam} (generic entry creation and move-and-retype also pair a routing facet). 'assign': reassign to a role (toRole required); the asker may do this once while a team lead holds it. 'answer': close the loop \u2014 writes the answer on the question and moves it to answered; --entry links an existing decision instead. 'force-close': Team-Lead-only escape hatch \u2014 reason required. 'list': what you owe; mine:true what you asked; role what waits on it.`
|
|
11303
11306
|
),
|
|
11304
11307
|
entryId: z33.string().max(200).optional().describe("Target question's id (human TEN-nnn form or a raw entry id). Required for every action except 'create'/'list'."),
|
|
11305
11308
|
text: z33.string().max(5e3).optional().describe("'create': the question text. 'answer': the answer text (mutually exclusive with answerEntryId, at most 2,000 characters)."),
|
|
11306
11309
|
blocks: z33.array(z33.string().max(200)).max(50).optional().describe("'create': entry ids this question is blocking (repeatable)."),
|
|
11307
11310
|
toRole: z33.string().max(200).optional().describe("The role (ROL-nnn or a raw entry id): optional on 'create', required on 'assign'."),
|
|
11311
|
+
toTeam: z33.string().max(200).optional().describe(`'create' and 'assign', with toRole (TEAM-nnn or a raw entry id): ${QUESTION_SEAT_WORDS.teamHelp}.`),
|
|
11308
11312
|
reason: z33.string().max(2e3).optional().describe("'force-close': required reason."),
|
|
11309
11313
|
answerEntryId: z33.string().max(200).optional().describe("'answer': point at an already-written entry instead of supplying text (mutually exclusive with text)."),
|
|
11310
11314
|
mine: z33.boolean().optional().describe("'list': true for arm C (every question YOU asked, every status). Omit/false for the ack-gate view (what you owe)."),
|
|
@@ -11314,10 +11318,12 @@ var createVariant = z33.object({
|
|
|
11314
11318
|
action: z33.literal("create"),
|
|
11315
11319
|
text: z33.string().min(1).max(5e3),
|
|
11316
11320
|
blocks: z33.array(z33.string().max(200)).max(50).optional(),
|
|
11317
|
-
toRole: z33.string().max(200).min(1).optional()
|
|
11321
|
+
toRole: z33.string().max(200).min(1).optional(),
|
|
11318
11322
|
// TASK-1334 (RULE-706): born assigned to the role asked
|
|
11323
|
+
toTeam: z33.string().max(200).min(1).optional()
|
|
11324
|
+
// DEC-2577: with Team Lead, the team whose lead is asked
|
|
11319
11325
|
});
|
|
11320
|
-
var assignVariant = z33.object({ action: z33.literal("assign"), entryId: z33.string().max(200), toRole: z33.string().max(200).min(1) });
|
|
11326
|
+
var assignVariant = z33.object({ action: z33.literal("assign"), entryId: z33.string().max(200), toRole: z33.string().max(200).min(1), toTeam: z33.string().max(200).min(1).optional() });
|
|
11321
11327
|
var answerVariant = z33.object({ action: z33.literal("answer"), entryId: z33.string().max(200), text: z33.string().max(2e3).optional(), answerEntryId: z33.string().max(200).optional() });
|
|
11322
11328
|
var forceCloseVariant = z33.object({ action: z33.literal("force-close"), entryId: z33.string().max(200), reason: z33.string().min(1).max(2e3) });
|
|
11323
11329
|
var listVariant = z33.object({ action: z33.literal("list"), mine: z33.boolean().optional(), role: z33.string().max(200).optional() });
|
|
@@ -11329,8 +11335,8 @@ var questionActionUnion = z33.discriminatedUnion("action", [
|
|
|
11329
11335
|
listVariant
|
|
11330
11336
|
]);
|
|
11331
11337
|
var QUESTION_ACTION_SPECS = {
|
|
11332
|
-
create: { params: ["text", "blocks", "toRole"], description: "text is required; blocks and
|
|
11333
|
-
assign: { params: ["entryId", "toRole"], description: "entryId and toRole are both required \u2014 assign is reassign-to-a-role only." },
|
|
11338
|
+
create: { params: ["text", "blocks", "toRole", "toTeam"], description: "text is required; blocks, toRole and toTeam are optional; toTeam goes with toRole." },
|
|
11339
|
+
assign: { params: ["entryId", "toRole", "toTeam"], description: "entryId and toRole are both required \u2014 assign is reassign-to-a-role only; toTeam is optional." },
|
|
11334
11340
|
answer: { params: ["entryId", "text", "answerEntryId"], description: "entryId is required; supply exactly one of text or answerEntryId." },
|
|
11335
11341
|
"force-close": { params: ["entryId", "reason"], description: "entryId and reason are both required." },
|
|
11336
11342
|
list: { params: ["mine", "role"], description: "mine and role are optional, not together \u2014 omit both for what you owe, mine:true for what you asked, role for what waits on that role." }
|
|
@@ -11351,36 +11357,55 @@ async function displayName(id) {
|
|
|
11351
11357
|
return void 0;
|
|
11352
11358
|
}
|
|
11353
11359
|
}
|
|
11360
|
+
async function seatName(roleName, owner) {
|
|
11361
|
+
const teamName = owner.ownerIsTeamLead && owner.ownerTeamId ? await displayName(owner.ownerTeamId) : void 0;
|
|
11362
|
+
return questionSeatName(roleName, teamName, Boolean(owner.ownerIsTeamLead));
|
|
11363
|
+
}
|
|
11354
11364
|
async function renderCreateConfirmation(result2) {
|
|
11355
|
-
const
|
|
11365
|
+
const roleName = result2.ownerRoleId ? await displayName(result2.ownerRoleId) ?? `an unresolved role (\`${result2.ownerRoleId}\` \u2014 reassign it)` : result2.ownerRoleId;
|
|
11366
|
+
const leadName = roleName ? await seatName(roleName, result2) : roleName;
|
|
11356
11367
|
const base = `Asked as ${result2.questionId ?? result2.entryId}. It is with ${leadName}.`;
|
|
11357
11368
|
const blocksHint = " If something is blocked on this, add blocks:[<entry-id>...].";
|
|
11358
11369
|
const nudge = result2.nudge ? ` ${result2.nudge}` : "";
|
|
11359
11370
|
return `${base}${blocksHint}${nudge}`;
|
|
11360
11371
|
}
|
|
11361
|
-
async function handleQuestionCreate(text, blocks, toRole) {
|
|
11372
|
+
async function handleQuestionCreate(text, blocks, toRole, toTeam) {
|
|
11373
|
+
if (toTeam && !toRole) return backpressureResult("question", "create", QUESTION_ACTION_SPECS.create, `${QUESTION_SEAT_WORDS.nameRoleWithTeam} ${QUESTION_TEAM_NEXT.mcp}`);
|
|
11362
11374
|
requireWriteAccess();
|
|
11363
11375
|
try {
|
|
11364
11376
|
const resolvedBlocks = blocks ? await Promise.all(blocks.map((b) => resolveEntryRef(b, "Blocked entry"))) : void 0;
|
|
11365
11377
|
const toRoleId = toRole ? await resolveEntryRef(toRole, "Role") : void 0;
|
|
11366
|
-
const
|
|
11378
|
+
const toTeamId = toTeam ? await resolveEntryRef(toTeam, "Team") : void 0;
|
|
11379
|
+
const result2 = await kernelMutation("question.create", {
|
|
11380
|
+
text,
|
|
11381
|
+
blocks: resolvedBlocks,
|
|
11382
|
+
...toRoleId ? { toRoleId } : {},
|
|
11383
|
+
...toTeamId ? { toTeamId } : {},
|
|
11384
|
+
sessionId: getAgentSessionId() ?? void 0
|
|
11385
|
+
});
|
|
11367
11386
|
const message = await renderCreateConfirmation(result2);
|
|
11368
11387
|
return successResult(message, message, result2);
|
|
11369
11388
|
} catch (err) {
|
|
11370
|
-
return questionErrorResult(err, "create", { text, blocks, toRole });
|
|
11389
|
+
return questionErrorResult(err, "create", { text, blocks, toRole, toTeam });
|
|
11371
11390
|
}
|
|
11372
11391
|
}
|
|
11373
|
-
async function handleQuestionAssign(entryId, toRole) {
|
|
11392
|
+
async function handleQuestionAssign(entryId, toRole, toTeam) {
|
|
11374
11393
|
requireWriteAccess();
|
|
11375
11394
|
try {
|
|
11376
11395
|
const resolvedEntryId = await resolveEntryRef(entryId, "Entry");
|
|
11377
11396
|
const resolvedToRoleId = await resolveEntryRef(toRole, "Role");
|
|
11378
|
-
const
|
|
11379
|
-
const
|
|
11397
|
+
const resolvedToTeamId = toTeam ? await resolveEntryRef(toTeam, "Team") : void 0;
|
|
11398
|
+
const result2 = await kernelMutation("question.assign", {
|
|
11399
|
+
entryId: resolvedEntryId,
|
|
11400
|
+
toRoleId: resolvedToRoleId,
|
|
11401
|
+
...resolvedToTeamId ? { toTeamId: resolvedToTeamId } : {},
|
|
11402
|
+
sessionId: getAgentSessionId() ?? void 0
|
|
11403
|
+
});
|
|
11404
|
+
const who = await seatName(await displayName(result2.ownerRoleId) ?? result2.ownerRoleId ?? "the target", result2);
|
|
11380
11405
|
const message = `${entryId} reassigned to ${who}. They'll see it at their next session.`;
|
|
11381
11406
|
return successResult(message, message, result2);
|
|
11382
11407
|
} catch (err) {
|
|
11383
|
-
return questionErrorResult(err, "assign", { entryId, toRole });
|
|
11408
|
+
return questionErrorResult(err, "assign", { entryId, toRole, toTeam });
|
|
11384
11409
|
}
|
|
11385
11410
|
}
|
|
11386
11411
|
async function handleQuestionAnswer(entryId, text, answerEntryId) {
|
|
@@ -11452,8 +11477,8 @@ function questionErrorResult(err, action, params = {}) {
|
|
|
11452
11477
|
}
|
|
11453
11478
|
function registerQuestionTools(server) {
|
|
11454
11479
|
const questionHandlers = {
|
|
11455
|
-
create: (data) => handleQuestionCreate(data.text, data.blocks, data.toRole),
|
|
11456
|
-
assign: (data) => handleQuestionAssign(data.entryId, data.toRole),
|
|
11480
|
+
create: (data) => handleQuestionCreate(data.text, data.blocks, data.toRole, data.toTeam),
|
|
11481
|
+
assign: (data) => handleQuestionAssign(data.entryId, data.toRole, data.toTeam),
|
|
11457
11482
|
answer: (data) => handleQuestionAnswer(data.entryId, data.text, data.answerEntryId),
|
|
11458
11483
|
"force-close": (data) => handleQuestionForceClose(data.entryId, data.reason),
|
|
11459
11484
|
list: (data) => handleQuestionList(data.mine, data.role)
|
|
@@ -11462,7 +11487,15 @@ function registerQuestionTools(server) {
|
|
|
11462
11487
|
"question",
|
|
11463
11488
|
{
|
|
11464
11489
|
title: "Question",
|
|
11465
|
-
description:
|
|
11490
|
+
description: `Routed questions \u2014 ask a role with \`toRole\` on create and the question is assigned to it at once. ${QUESTION_SEAT_WORDS.withoutTeam} Five actions:
|
|
11491
|
+
|
|
11492
|
+
- **create**: ask a question from text; \`toRole\` assigns it to that role at once; \`toTeam\`: ${QUESTION_SEAT_WORDS.teamHelp}.
|
|
11493
|
+
- **assign**: reassign to a role (\`toRole\` required, \`toTeam\` as on create); the asker may reassign their own question once while a team lead holds it.
|
|
11494
|
+
- **answer**: close the loop. Writes \`text\` on the question as its answer, or links an existing decision via \`answerEntryId\` \u2014 never both.
|
|
11495
|
+
- **force-close**: Team-Lead-only escape hatch (reason required) for a question that cannot otherwise be resolved.
|
|
11496
|
+
- **list**: what you owe (default); \`mine:true\` what you asked; \`role\` what waits on that role.
|
|
11497
|
+
|
|
11498
|
+
\`blocks\` (repeatable, on create) records what a question is holding up \u2014 pass entry ids it blocks.`,
|
|
11466
11499
|
inputSchema: questionSchema,
|
|
11467
11500
|
annotations: { readOnlyHint: false, idempotentHint: false, openWorldHint: false }
|
|
11468
11501
|
},
|
|
@@ -12094,4 +12127,4 @@ export {
|
|
|
12094
12127
|
SERVER_VERSION,
|
|
12095
12128
|
createProductBrainServer
|
|
12096
12129
|
};
|
|
12097
|
-
//# sourceMappingURL=chunk-
|
|
12130
|
+
//# sourceMappingURL=chunk-KYQQAZVI.js.map
|