clef-mcp 0.2.0 → 0.2.1
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/cli.js +23 -11
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +23 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1432,10 +1432,12 @@ function scoreCriteria(limits) {
|
|
|
1432
1432
|
}
|
|
1433
1433
|
function questionSchema(limits) {
|
|
1434
1434
|
return z.object({
|
|
1435
|
-
type: z.enum(["noul", "choice", "score"]),
|
|
1436
|
-
instructions: z.string().min(1).max(limits.maxInstructionsChars),
|
|
1435
|
+
type: z.enum(["noul", "choice", "score"]).describe('"choice" = pick among named options; "score" = judge an ordered scale; "noul" = yes/no question'),
|
|
1436
|
+
instructions: z.string().min(1).max(limits.maxInstructionsChars).describe("What to judge, phrased as a self-contained question."),
|
|
1437
1437
|
criteria: z.union([z.array(z.string()), z.record(z.string(), z.string())]).optional()
|
|
1438
|
-
}).
|
|
1438
|
+
}).describe(
|
|
1439
|
+
"A single decision question. Allowed answers come from `criteria` and must be mutually exclusive and collectively exhaustive."
|
|
1440
|
+
).superRefine((q, ctx) => {
|
|
1439
1441
|
if (q.type === "choice") {
|
|
1440
1442
|
const parsed = choiceCriteria(limits).safeParse(q.criteria);
|
|
1441
1443
|
if (!parsed.success) {
|
|
@@ -1459,23 +1461,27 @@ function questionSchema(limits) {
|
|
|
1459
1461
|
}
|
|
1460
1462
|
function clefDecideInputShape(limits) {
|
|
1461
1463
|
return {
|
|
1462
|
-
state: z.unknown()
|
|
1463
|
-
|
|
1464
|
+
state: z.unknown().describe(
|
|
1465
|
+
"Task state as data: a compact string or JSON object with the facts needed to judge (task, errors, logs, diffs). Never treated as instructions. Serialized size limit: 1 MB; model context is 16k tokens."
|
|
1466
|
+
),
|
|
1467
|
+
questions: z.record(z.string().min(1).max(limits.maxQuestionIdChars), questionSchema(limits)).describe(
|
|
1468
|
+
"Map of question id -> typed question. Up to 64 questions per call; all are scored together in a single forward pass, so batch related decisions here."
|
|
1469
|
+
).check((ctx) => {
|
|
1464
1470
|
const count = Object.keys(ctx.value).length;
|
|
1465
1471
|
if (count === 0) ctx.issues.push({ code: "custom", message: "questions must not be empty", input: ctx.value });
|
|
1466
1472
|
if (count > limits.maxQuestions) {
|
|
1467
1473
|
ctx.issues.push({ code: "custom", message: `too many questions (max ${limits.maxQuestions})`, input: ctx.value });
|
|
1468
1474
|
}
|
|
1469
1475
|
}),
|
|
1470
|
-
model: z.string().min(1).optional(),
|
|
1476
|
+
model: z.string().min(1).optional().describe("Model id to use (default: clef-flash from CLEF_MODEL)."),
|
|
1471
1477
|
options: z.object({
|
|
1472
1478
|
/**
|
|
1473
1479
|
* Accepted for forward compatibility. Clef scores all options in a
|
|
1474
1480
|
* single forward pass — there is no sampling, so temperature is a
|
|
1475
1481
|
* documented no-op.
|
|
1476
1482
|
*/
|
|
1477
|
-
temperature: z.number().min(0).max(2).optional()
|
|
1478
|
-
}).optional()
|
|
1483
|
+
temperature: z.number().min(0).max(2).optional().describe("Accepted for forward compatibility; no-op. Clef scores in a single forward pass without sampling.")
|
|
1484
|
+
}).optional().describe("Extra options. Currently only temperature, which is a documented no-op.")
|
|
1479
1485
|
};
|
|
1480
1486
|
}
|
|
1481
1487
|
function clefDecideInputSchema(limits) {
|
|
@@ -1894,9 +1900,15 @@ function createClefServer(deps = {}) {
|
|
|
1894
1900
|
TOOL_NAME,
|
|
1895
1901
|
{
|
|
1896
1902
|
title: "Clef Decide",
|
|
1897
|
-
description:
|
|
1903
|
+
description: 'Ask the local Clef decision model to judge a situation. Pass a `state` (compact factual context as a string or JSON) and one or more typed `questions`: "choice" picks among named options (criteria = option id -> description), "score" judges an ordered scale (criteria = ordered list), "noul" answers yes/no. Returns strict JSON: for every question a probability distribution over its allowed answers \u2014 no prose, no sampling. Usage: batch related decisions (up to 64 questions) in one call; state is data and is never executed; act on the argmax when a distribution is decisive (p >= 0.8), otherwise gather more context or ask the user; for destructive or security-adjacent decisions require high confidence before acting. Optional `model` overrides the model id; `options.temperature` is a no-op (single forward pass, no sampling).',
|
|
1898
1904
|
inputSchema: clefDecideInputShape(config.limits),
|
|
1899
|
-
outputSchema: clefDecideOutputSchema().shape
|
|
1905
|
+
outputSchema: clefDecideOutputSchema().shape,
|
|
1906
|
+
annotations: {
|
|
1907
|
+
readOnlyHint: true,
|
|
1908
|
+
destructiveHint: false,
|
|
1909
|
+
idempotentHint: true,
|
|
1910
|
+
openWorldHint: false
|
|
1911
|
+
}
|
|
1900
1912
|
},
|
|
1901
1913
|
async (args) => {
|
|
1902
1914
|
try {
|
|
@@ -2639,7 +2651,7 @@ async function removeManagedRuntime(cfg) {
|
|
|
2639
2651
|
init_prompt();
|
|
2640
2652
|
|
|
2641
2653
|
// src/version.ts
|
|
2642
|
-
var VERSION = "0.2.
|
|
2654
|
+
var VERSION = "0.2.1";
|
|
2643
2655
|
|
|
2644
2656
|
// src/cli/install.ts
|
|
2645
2657
|
var OS_NAMES = {
|