@mycompbox/compbox-mcp 1.10.0 → 1.11.0
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/index.js +63 -26
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -397,7 +397,7 @@ function interviewFieldKeys() {
|
|
|
397
397
|
}
|
|
398
398
|
return out;
|
|
399
399
|
}
|
|
400
|
-
function buildInterviewSystemPrompt(definition = INTERVIEW_DEFINITION) {
|
|
400
|
+
function buildInterviewSystemPrompt(definition = INTERVIEW_DEFINITION, seedContext) {
|
|
401
401
|
const requiredSections = definition.filter((s) => s.required);
|
|
402
402
|
const optionalSections = definition.filter((s) => !s.required);
|
|
403
403
|
const renderSection = (s) => {
|
|
@@ -413,7 +413,7 @@ ${followUps}`;
|
|
|
413
413
|
"description"
|
|
414
414
|
];
|
|
415
415
|
const completionShape = completionKeys.map((k) => `"${k}": "..."`).join(", ");
|
|
416
|
-
|
|
416
|
+
const base = `You are the CompBox request-formulator, interviewing an employee to turn their idea into a well-formed Epic Request. Ask exactly ONE short, focused question at a time \u2014 never multiple questions in one message, never preamble or explanation.
|
|
417
417
|
|
|
418
418
|
Work through these interview sections in order. Cover EVERY required section; for optional sections, ask about them too, but if the employee has nothing to add or declines, move on and leave that field out (never invent or pad it):
|
|
419
419
|
|
|
@@ -435,6 +435,27 @@ Once you have gathered the required sections (and covered the optional ones), re
|
|
|
435
435
|
\`\`\`
|
|
436
436
|
|
|
437
437
|
Until then, respond with ONLY your next question as plain text \u2014 no JSON, no labels, no numbering.`;
|
|
438
|
+
if (!seedContext || seedContext.priorTranscript.length === 0) {
|
|
439
|
+
return base;
|
|
440
|
+
}
|
|
441
|
+
return `${renderContinuationHeader(seedContext.priorTranscript)}
|
|
442
|
+
|
|
443
|
+
${base}`;
|
|
444
|
+
}
|
|
445
|
+
function renderContinuationHeader(priorTranscript) {
|
|
446
|
+
const transcript = priorTranscript.map((t) => `${t.role === "agent" ? "You" : "Employee"}: ${t.content}`).join("\n");
|
|
447
|
+
return `\u26A0\uFE0F CONTINUATION \u2014 this is NOT a fresh interview. You already interviewed this employee; below is that prior conversation, and an Epic Request already exists from it. Your job now is to ENRICH that same request, not restart it.
|
|
448
|
+
|
|
449
|
+
Prior conversation:
|
|
450
|
+
${transcript}
|
|
451
|
+
|
|
452
|
+
How to continue:
|
|
453
|
+
- Read the prior conversation first. Do NOT re-ask anything already answered there.
|
|
454
|
+
- Use the section list below only as a checklist of what a complete request needs. Identify which sections are MISSING or THIN, and ask focused questions to fill ONLY those gaps \u2014 still one short question at a time.
|
|
455
|
+
- If the prior conversation already covers everything well, go straight to the completion JSON.
|
|
456
|
+
- When you emit the final completion JSON, MERGE the prior answers with whatever new detail you gathered \u2014 restate and expand every field using the WHOLE conversation (old + new). Never drop or shorten content that was already captured; the goal is a richer request than before, meeting the same length minimums.
|
|
457
|
+
|
|
458
|
+
`;
|
|
438
459
|
}
|
|
439
460
|
function interviewFieldKeysFor(definition) {
|
|
440
461
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -10640,26 +10661,6 @@ function registerSkillPackTools(server2) {
|
|
|
10640
10661
|
}
|
|
10641
10662
|
|
|
10642
10663
|
// src/tools/index.ts
|
|
10643
|
-
var CANONICAL_TOOL_PREFIX = "compbox__";
|
|
10644
|
-
var LEGACY_ALIAS_PREFIX = "spectree__";
|
|
10645
|
-
function withLegacyAliases(server2) {
|
|
10646
|
-
return new Proxy(server2, {
|
|
10647
|
-
get(target, prop, receiver) {
|
|
10648
|
-
if (prop === "registerTool") {
|
|
10649
|
-
return (name, config, handler) => {
|
|
10650
|
-
const registered = target.registerTool(name, config, handler);
|
|
10651
|
-
if (name.startsWith(CANONICAL_TOOL_PREFIX)) {
|
|
10652
|
-
const legacyName = LEGACY_ALIAS_PREFIX + name.slice(CANONICAL_TOOL_PREFIX.length);
|
|
10653
|
-
target.registerTool(legacyName, config, handler);
|
|
10654
|
-
}
|
|
10655
|
-
return registered;
|
|
10656
|
-
};
|
|
10657
|
-
}
|
|
10658
|
-
const value = Reflect.get(target, prop, receiver);
|
|
10659
|
-
return typeof value === "function" ? value.bind(target) : value;
|
|
10660
|
-
}
|
|
10661
|
-
});
|
|
10662
|
-
}
|
|
10663
10664
|
var toolRegistrars = [
|
|
10664
10665
|
registerHelpTools,
|
|
10665
10666
|
// Help and documentation tools
|
|
@@ -10717,17 +10718,53 @@ var toolRegistrars = [
|
|
|
10717
10718
|
// Skill pack management
|
|
10718
10719
|
];
|
|
10719
10720
|
function registerAllTools(server2) {
|
|
10720
|
-
const aliasedServer = withLegacyAliases(server2);
|
|
10721
10721
|
for (const registrar of toolRegistrars) {
|
|
10722
|
-
registrar(
|
|
10722
|
+
registrar(server2);
|
|
10723
|
+
}
|
|
10724
|
+
}
|
|
10725
|
+
|
|
10726
|
+
// src/legacy-aliases.ts
|
|
10727
|
+
var CANONICAL_TOOL_PREFIX = "compbox__";
|
|
10728
|
+
var LEGACY_ALIAS_PREFIX = "spectree__";
|
|
10729
|
+
function rewriteLegacyToolCall(message) {
|
|
10730
|
+
if ("method" in message && message.method === "tools/call" && "params" in message && message.params !== null && typeof message.params === "object") {
|
|
10731
|
+
const params = message.params;
|
|
10732
|
+
const name = params.name;
|
|
10733
|
+
if (typeof name === "string" && name.startsWith(LEGACY_ALIAS_PREFIX)) {
|
|
10734
|
+
return {
|
|
10735
|
+
...message,
|
|
10736
|
+
params: {
|
|
10737
|
+
...params,
|
|
10738
|
+
name: CANONICAL_TOOL_PREFIX + name.slice(LEGACY_ALIAS_PREFIX.length)
|
|
10739
|
+
}
|
|
10740
|
+
};
|
|
10741
|
+
}
|
|
10723
10742
|
}
|
|
10743
|
+
return message;
|
|
10744
|
+
}
|
|
10745
|
+
function withLegacyToolCallRewrite(transport) {
|
|
10746
|
+
return new Proxy(transport, {
|
|
10747
|
+
get(target, prop, receiver) {
|
|
10748
|
+
const value = Reflect.get(target, prop, receiver);
|
|
10749
|
+
return typeof value === "function" ? value.bind(target) : value;
|
|
10750
|
+
},
|
|
10751
|
+
set(target, prop, value, receiver) {
|
|
10752
|
+
if (prop === "onmessage" && typeof value === "function") {
|
|
10753
|
+
const handler = value;
|
|
10754
|
+
const wrapped = (message, extra) => handler(rewriteLegacyToolCall(message), extra);
|
|
10755
|
+
target.onmessage = wrapped;
|
|
10756
|
+
return true;
|
|
10757
|
+
}
|
|
10758
|
+
return Reflect.set(target, prop, value, receiver);
|
|
10759
|
+
}
|
|
10760
|
+
});
|
|
10724
10761
|
}
|
|
10725
10762
|
|
|
10726
10763
|
// src/index.ts
|
|
10727
10764
|
var SERVER_NAME = "compbox-mcp";
|
|
10728
10765
|
function resolveServerVersion() {
|
|
10729
10766
|
if (true) {
|
|
10730
|
-
return "1.
|
|
10767
|
+
return "1.11.0";
|
|
10731
10768
|
}
|
|
10732
10769
|
const require2 = createRequire(import.meta.url);
|
|
10733
10770
|
for (const candidate of ["../package.json", "./package.json"]) {
|
|
@@ -10778,7 +10815,7 @@ registerAllTools(server);
|
|
|
10778
10815
|
async function main() {
|
|
10779
10816
|
const { token, baseUrl } = validateEnvironment();
|
|
10780
10817
|
initializeApiClient({ token, baseUrl });
|
|
10781
|
-
const transport = new StdioServerTransport();
|
|
10818
|
+
const transport = withLegacyToolCallRewrite(new StdioServerTransport());
|
|
10782
10819
|
await server.connect(transport);
|
|
10783
10820
|
console.error(`${SERVER_NAME} v${SERVER_VERSION} started (stdio transport)`);
|
|
10784
10821
|
console.error(`API endpoint: ${baseUrl}`);
|