@mycompbox/compbox-mcp 1.21.3 → 1.21.4
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 +29 -10
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -130,7 +130,7 @@ var init_mailbox = __esm({
|
|
|
130
130
|
"failed"
|
|
131
131
|
];
|
|
132
132
|
TURN_ROLES = ["agent", "user"];
|
|
133
|
-
START_EXECUTION_KINDS = ["plan", "orchestrate"];
|
|
133
|
+
START_EXECUTION_KINDS = ["plan", "orchestrate", "refine"];
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
136
|
|
|
@@ -863,6 +863,18 @@ var init_interview_completion = __esm({
|
|
|
863
863
|
});
|
|
864
864
|
|
|
865
865
|
// ../shared/dist/interview-conversation.js
|
|
866
|
+
function requestLockReason(saved) {
|
|
867
|
+
if (!saved)
|
|
868
|
+
return null;
|
|
869
|
+
if (saved.status !== "pending")
|
|
870
|
+
return "status";
|
|
871
|
+
if (!saved.canEdit)
|
|
872
|
+
return "ownership";
|
|
873
|
+
return null;
|
|
874
|
+
}
|
|
875
|
+
function lockedRequestMessage(reason) {
|
|
876
|
+
return reason === "ownership" ? "Only the request's creator can change it; you can still discuss it." : "This request is locked, so it can't be changed any more.";
|
|
877
|
+
}
|
|
866
878
|
function renderSection(s) {
|
|
867
879
|
const tag = s.required ? "needed" : "nice to have";
|
|
868
880
|
return `- ${s.title} (${tag}): ${s.purpose} For example: ${s.followUps.slice(0, 2).join(" ")}`;
|
|
@@ -873,8 +885,10 @@ function renderSaved(saved) {
|
|
|
873
885
|
const issues = saved.compliance && saved.compliance.issues.length > 0 ? `
|
|
874
886
|
What the score says is missing or weak:
|
|
875
887
|
${saved.compliance.issues.slice(0, 8).map((i) => `- ${i.message}`).join("\n")}` : "";
|
|
876
|
-
const
|
|
877
|
-
|
|
888
|
+
const reason = requestLockReason(saved);
|
|
889
|
+
const locked = reason === null ? "It can still be changed." : reason === "status" ? `Its status is "${saved.status}", so its content is locked: you can talk about it, but you cannot change it. Never emit the completion JSON for a locked request.` : "Only the request's creator can change it, and the person you're talking to is not its creator, so its content is locked for them: you can talk about it, but you cannot change it. Never emit the completion JSON for a locked request. If they ask for a change, explain that only the creator can make it.";
|
|
890
|
+
const origin = saved.discussed ? `THE REQUEST ALREADY EXISTS. The person is discussing the existing request "${saved.title}"; this conversation did not create it.` : `THE REQUEST IS ALREADY SAVED. This conversation created the request "${saved.title}".`;
|
|
891
|
+
return `${origin} ${score} ${locked}${issues}
|
|
878
892
|
|
|
879
893
|
Its current content:
|
|
880
894
|
title: ${saved.title}
|
|
@@ -950,7 +964,7 @@ ${followUp}` : text;
|
|
|
950
964
|
async function runConversationStep(input, deps) {
|
|
951
965
|
const system = buildConversationSystemPrompt(input.saved);
|
|
952
966
|
const messages = toConversationMessages(input.turns);
|
|
953
|
-
const
|
|
967
|
+
const lockReason = requestLockReason(input.saved);
|
|
954
968
|
let requestId = input.saved?.id ?? null;
|
|
955
969
|
let savedNow = null;
|
|
956
970
|
let createdHere = false;
|
|
@@ -973,10 +987,11 @@ Send another message (for example "try again") when you're ready and I'll pick u
|
|
|
973
987
|
}
|
|
974
988
|
const draft = extractCompletionJson(reply);
|
|
975
989
|
if (draft) {
|
|
976
|
-
if (
|
|
977
|
-
|
|
990
|
+
if (lockReason) {
|
|
991
|
+
const why = lockReason === "ownership" ? "Only the request's creator can change it, and I'm not its creator." : "That request is locked and can't be changed.";
|
|
992
|
+
messages.push({ role: "assistant", content: reply }, { role: "user", content: `${why} Reply to me in plain text instead.` });
|
|
978
993
|
if (++repairs > JSON_REPAIRS)
|
|
979
|
-
return { kind: "error", text:
|
|
994
|
+
return { kind: "error", text: lockedRequestMessage(lockReason) };
|
|
980
995
|
continue;
|
|
981
996
|
}
|
|
982
997
|
let saved;
|
|
@@ -1019,7 +1034,7 @@ The request IS already saved, and the person will be shown its score. If you ask
|
|
|
1019
1034
|
return { kind: "message", text };
|
|
1020
1035
|
}
|
|
1021
1036
|
}
|
|
1022
|
-
function savedContextFromRecord(record) {
|
|
1037
|
+
function savedContextFromRecord(record, access) {
|
|
1023
1038
|
if (typeof record !== "object" || record === null)
|
|
1024
1039
|
return null;
|
|
1025
1040
|
const r = record;
|
|
@@ -1054,7 +1069,9 @@ function savedContextFromRecord(record) {
|
|
|
1054
1069
|
status: typeof r.status === "string" ? r.status : "pending",
|
|
1055
1070
|
description: typeof r.description === "string" ? r.description : "",
|
|
1056
1071
|
fields,
|
|
1057
|
-
compliance: complianceFromRecord(score)
|
|
1072
|
+
compliance: complianceFromRecord(score),
|
|
1073
|
+
canEdit: access.canEdit,
|
|
1074
|
+
...access.discussed ? { discussed: true } : {}
|
|
1058
1075
|
};
|
|
1059
1076
|
}
|
|
1060
1077
|
function complianceFromRecord(score) {
|
|
@@ -2048,6 +2065,7 @@ __export(dist_exports, {
|
|
|
2048
2065
|
isSubscriptionStatus: () => isSubscriptionStatus,
|
|
2049
2066
|
isTurnRole: () => isTurnRole,
|
|
2050
2067
|
isValidModelId: () => isValidModelId,
|
|
2068
|
+
lockedRequestMessage: () => lockedRequestMessage,
|
|
2051
2069
|
looksLikeCompletionAttempt: () => looksLikeCompletionAttempt,
|
|
2052
2070
|
mcpConfigSchema: () => mcpConfigSchema,
|
|
2053
2071
|
mcpServerConfigSchema: () => mcpServerConfigSchema,
|
|
@@ -2057,6 +2075,7 @@ __export(dist_exports, {
|
|
|
2057
2075
|
ok: () => ok,
|
|
2058
2076
|
probeProxyHealth: () => probeProxyHealth,
|
|
2059
2077
|
renderConversationPrompt: () => renderConversationPrompt,
|
|
2078
|
+
requestLockReason: () => requestLockReason,
|
|
2060
2079
|
resolveRouting: () => resolveRouting,
|
|
2061
2080
|
runConversationStep: () => runConversationStep,
|
|
2062
2081
|
safeReturnTo: () => safeReturnTo,
|
|
@@ -12270,7 +12289,7 @@ function withLegacyToolCallRewrite(transport) {
|
|
|
12270
12289
|
var SERVER_NAME = "compbox-mcp";
|
|
12271
12290
|
function resolveServerVersion() {
|
|
12272
12291
|
if (true) {
|
|
12273
|
-
return "1.21.
|
|
12292
|
+
return "1.21.4";
|
|
12274
12293
|
}
|
|
12275
12294
|
const require2 = createRequire(import.meta.url);
|
|
12276
12295
|
for (const candidate of ["../package.json", "./package.json"]) {
|