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/index.d.ts
CHANGED
|
@@ -435,6 +435,6 @@ declare function clefDecideOutputSchema(): z.ZodObject<{
|
|
|
435
435
|
/** `state` cannot be size-checked inside zod (it is `unknown`), so it is validated separately. */
|
|
436
436
|
declare function validateStateSize(state: unknown, limits: Limits): void;
|
|
437
437
|
|
|
438
|
-
declare const VERSION = "0.2.
|
|
438
|
+
declare const VERSION = "0.2.1";
|
|
439
439
|
|
|
440
440
|
export { CLEF_FLASH, type ClefConfig, type ClefDecideInput, type ClefDecideOutput, type ClefDecisionAnswer, ClefError, ClefErrorCode, type ClefQuestion, type ClefRuntime, type ClefServerDeps, DEFAULT_LIMITS, type DownloadProgress, type InstallModelResult, type Limits, LlamaCppRuntime, type LlamaCppRuntimeOptions, type LogLevel, type Logger, MODELS, type ModelManifest, type ModelSpec, type PlatformInfo, type ProbeResult, type QuantSpec, type QuestionType, type ResolvedBinary, type RunningClefServer, type RuntimeHealth, SERVER_INSTRUCTIONS, StderrLogger, type SystemOneRequest, type SystemOneResponse, TOOL_NAME, VERSION, assertSupportedPlatform, clefDecideInputSchema, clefDecideOutputSchema, createClefServer, createLogger, deepVerifyChecksum, defaultClefHome, detectPlatform, downloadFile, downloadManagedLlama, ensureLlamaRuntime, errorJson, exitCodeFor, fetchFileInfo, findInstalledManifest, formatBytes, fromSystemOneResponse, getModelSpec, getQuantSpec, installModel, limitsFromEnv, loadConfig, manifestPathFor, modelQuantDir, pathsFor, pickQuant, probeInference, readModelManifest, removeManagedRuntime, resolveLlamaServerBinary, toSystemOneRequest, validateStateSize, verifyModelFiles, writeModelManifest };
|
package/dist/index.js
CHANGED
|
@@ -1503,10 +1503,12 @@ function scoreCriteria(limits) {
|
|
|
1503
1503
|
}
|
|
1504
1504
|
function questionSchema(limits) {
|
|
1505
1505
|
return z.object({
|
|
1506
|
-
type: z.enum(["noul", "choice", "score"]),
|
|
1507
|
-
instructions: z.string().min(1).max(limits.maxInstructionsChars),
|
|
1506
|
+
type: z.enum(["noul", "choice", "score"]).describe('"choice" = pick among named options; "score" = judge an ordered scale; "noul" = yes/no question'),
|
|
1507
|
+
instructions: z.string().min(1).max(limits.maxInstructionsChars).describe("What to judge, phrased as a self-contained question."),
|
|
1508
1508
|
criteria: z.union([z.array(z.string()), z.record(z.string(), z.string())]).optional()
|
|
1509
|
-
}).
|
|
1509
|
+
}).describe(
|
|
1510
|
+
"A single decision question. Allowed answers come from `criteria` and must be mutually exclusive and collectively exhaustive."
|
|
1511
|
+
).superRefine((q, ctx) => {
|
|
1510
1512
|
if (q.type === "choice") {
|
|
1511
1513
|
const parsed = choiceCriteria(limits).safeParse(q.criteria);
|
|
1512
1514
|
if (!parsed.success) {
|
|
@@ -1530,23 +1532,27 @@ function questionSchema(limits) {
|
|
|
1530
1532
|
}
|
|
1531
1533
|
function clefDecideInputShape(limits) {
|
|
1532
1534
|
return {
|
|
1533
|
-
state: z.unknown()
|
|
1534
|
-
|
|
1535
|
+
state: z.unknown().describe(
|
|
1536
|
+
"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."
|
|
1537
|
+
),
|
|
1538
|
+
questions: z.record(z.string().min(1).max(limits.maxQuestionIdChars), questionSchema(limits)).describe(
|
|
1539
|
+
"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."
|
|
1540
|
+
).check((ctx) => {
|
|
1535
1541
|
const count = Object.keys(ctx.value).length;
|
|
1536
1542
|
if (count === 0) ctx.issues.push({ code: "custom", message: "questions must not be empty", input: ctx.value });
|
|
1537
1543
|
if (count > limits.maxQuestions) {
|
|
1538
1544
|
ctx.issues.push({ code: "custom", message: `too many questions (max ${limits.maxQuestions})`, input: ctx.value });
|
|
1539
1545
|
}
|
|
1540
1546
|
}),
|
|
1541
|
-
model: z.string().min(1).optional(),
|
|
1547
|
+
model: z.string().min(1).optional().describe("Model id to use (default: clef-flash from CLEF_MODEL)."),
|
|
1542
1548
|
options: z.object({
|
|
1543
1549
|
/**
|
|
1544
1550
|
* Accepted for forward compatibility. Clef scores all options in a
|
|
1545
1551
|
* single forward pass — there is no sampling, so temperature is a
|
|
1546
1552
|
* documented no-op.
|
|
1547
1553
|
*/
|
|
1548
|
-
temperature: z.number().min(0).max(2).optional()
|
|
1549
|
-
}).optional()
|
|
1554
|
+
temperature: z.number().min(0).max(2).optional().describe("Accepted for forward compatibility; no-op. Clef scores in a single forward pass without sampling.")
|
|
1555
|
+
}).optional().describe("Extra options. Currently only temperature, which is a documented no-op.")
|
|
1550
1556
|
};
|
|
1551
1557
|
}
|
|
1552
1558
|
function clefDecideInputSchema(limits) {
|
|
@@ -1857,9 +1863,15 @@ function createClefServer(deps = {}) {
|
|
|
1857
1863
|
TOOL_NAME,
|
|
1858
1864
|
{
|
|
1859
1865
|
title: "Clef Decide",
|
|
1860
|
-
description:
|
|
1866
|
+
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).',
|
|
1861
1867
|
inputSchema: clefDecideInputShape(config.limits),
|
|
1862
|
-
outputSchema: clefDecideOutputSchema().shape
|
|
1868
|
+
outputSchema: clefDecideOutputSchema().shape,
|
|
1869
|
+
annotations: {
|
|
1870
|
+
readOnlyHint: true,
|
|
1871
|
+
destructiveHint: false,
|
|
1872
|
+
idempotentHint: true,
|
|
1873
|
+
openWorldHint: false
|
|
1874
|
+
}
|
|
1863
1875
|
},
|
|
1864
1876
|
async (args) => {
|
|
1865
1877
|
try {
|
|
@@ -1914,7 +1926,7 @@ function createClefServer(deps = {}) {
|
|
|
1914
1926
|
}
|
|
1915
1927
|
|
|
1916
1928
|
// src/version.ts
|
|
1917
|
-
var VERSION = "0.2.
|
|
1929
|
+
var VERSION = "0.2.1";
|
|
1918
1930
|
export {
|
|
1919
1931
|
CLEF_FLASH,
|
|
1920
1932
|
ClefError,
|