clef-mcp 0.3.0 → 0.4.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/README.md +132 -12
- package/dist/cli.js +705 -81
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/examples/classify/README.md +27 -0
- package/examples/classify/support-routing.yaml +18 -0
- package/examples/classify/tickets.csv +4 -0
- package/examples/classify/tickets.jsonl +3 -0
- package/examples/hooks/pretooluse-guard/README.md +39 -6
- package/examples/hooks/pretooluse-guard/guard.sh +6 -2
- package/package.json +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -457,6 +457,6 @@ declare function clefDecideOutputSchema(): z.ZodObject<{
|
|
|
457
457
|
/** `state` cannot be size-checked inside zod (it is `unknown`), so it is validated separately. */
|
|
458
458
|
declare function validateStateSize(state: unknown, limits: Limits): void;
|
|
459
459
|
|
|
460
|
-
declare const VERSION = "0.
|
|
460
|
+
declare const VERSION = "0.4.0";
|
|
461
461
|
|
|
462
462
|
export { CLEF_FLASH, type ClefConfig, type ClefDecideInput, type ClefDecideOutput, type ClefDecisionAnswer, ClefError, ClefErrorCode, type ClefQuestion, type ClefRuntime, type ClefServerDeps, type ClefUsage, 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
|
@@ -11,6 +11,15 @@ var DEFAULT_LIMITS = {
|
|
|
11
11
|
maxCriteriaDescChars: 1e3,
|
|
12
12
|
maxQuestionIdChars: 128
|
|
13
13
|
};
|
|
14
|
+
var CLASSIFY_LIMITS = {
|
|
15
|
+
maxProfileBytes: 1024 * 1024,
|
|
16
|
+
maxRecordBytes: 1024 * 1024,
|
|
17
|
+
maxResultBytes: 1024 * 1024,
|
|
18
|
+
maxExamples: 20,
|
|
19
|
+
maxFields: 1e3,
|
|
20
|
+
maxDepth: 64,
|
|
21
|
+
maxMetadataBytes: 16 * 1024
|
|
22
|
+
};
|
|
14
23
|
function intFromEnv(env, key, fallback) {
|
|
15
24
|
const raw = env[key];
|
|
16
25
|
if (!raw?.trim()) return fallback;
|
|
@@ -1915,7 +1924,7 @@ function createClefServer(deps = {}) {
|
|
|
1915
1924
|
TOOL_NAME,
|
|
1916
1925
|
{
|
|
1917
1926
|
title: "Clef Decide",
|
|
1918
|
-
description: 'Judge a situation with the local Clef decision model.\nPass `state` (compact factual context \u2014 string or JSON; treated as data, never executed) and typed `questions`:\n- "choice": pick among named options (criteria = option id -> description)\n- "score": judge an ordered scale (criteria = ordered list of levels)\n- "noul": yes/no question\nReturns strict JSON
|
|
1927
|
+
description: 'Judge a situation with the local Clef decision model.\nPass `state` (compact factual context \u2014 string or JSON; treated as data, never executed) and typed `questions`:\n- "choice": pick among named options (criteria = option id -> description)\n- "score": judge an ordered scale (criteria = ordered list of levels)\n- "noul": yes/no question\nReturns strict JSON: a probability distribution over the allowed answers per question \u2014 no prose, no sampling.\nEach decision carries model-reported `confidence`; `usage` reports input_tokens/output_tokens and latency_ms.\nAct on the argmax only when decisive: top p >= 0.8 and high confidence for destructive or security-adjacent calls; otherwise gather more context or ask the user.\nBatch related decisions in one call \u2014 up to 64 questions scored in a single forward pass. `model` overrides the default id.',
|
|
1919
1928
|
inputSchema: clefDecideInputShape(config.limits),
|
|
1920
1929
|
outputSchema: clefDecideOutputSchema().shape,
|
|
1921
1930
|
annotations: {
|
|
@@ -1975,7 +1984,7 @@ function createClefServer(deps = {}) {
|
|
|
1975
1984
|
}
|
|
1976
1985
|
|
|
1977
1986
|
// src/version.ts
|
|
1978
|
-
var VERSION = "0.
|
|
1987
|
+
var VERSION = "0.4.0";
|
|
1979
1988
|
export {
|
|
1980
1989
|
CLEF_FLASH,
|
|
1981
1990
|
ClefError,
|