@plune-ai/cli 0.39.6 → 0.39.8
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 +63 -0
- package/dist/cli.cjs +703 -378
- package/dist/execute-CR3Ixbxj.d.cts +944 -0
- package/dist/execute-CR3Ixbxj.d.ts +944 -0
- package/dist/index.cjs +331 -159
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +331 -159
- package/dist/mcp-http.cjs +1293 -0
- package/dist/mcp-http.d.cts +25 -0
- package/dist/mcp-http.d.ts +25 -0
- package/dist/mcp-http.js +1268 -0
- package/dist/mcp-tools.cjs +173 -9
- package/dist/mcp-tools.d.cts +3 -938
- package/dist/mcp-tools.d.ts +3 -938
- package/dist/mcp-tools.js +173 -9
- package/dist/reporter-core.cjs +51 -4
- package/dist/reporter-core.d.cts +10 -0
- package/dist/reporter-core.d.ts +10 -0
- package/dist/reporter-core.js +51 -4
- package/package.json +7 -1
- package/skills/plune/SKILL.md +23 -0
package/dist/mcp-tools.cjs
CHANGED
|
@@ -228,9 +228,171 @@ var bulkPreview = import_zod.z.looseObject({
|
|
|
228
228
|
expiresInSeconds: import_zod.z.number().int()
|
|
229
229
|
});
|
|
230
230
|
|
|
231
|
+
// src/mcp-testing/lint/thresholds.ts
|
|
232
|
+
var PLUNE_ANSWER_MEASURES = {
|
|
233
|
+
plune_project_context: { tokens: 387, of: "3 projects and 3 suites" },
|
|
234
|
+
plune_cases_search: { tokens: 7678, of: "a project of 48 cases" },
|
|
235
|
+
plune_review_list: { tokens: 695, of: "7 pending entries" },
|
|
236
|
+
plune_mission_get: { tokens: 455, of: "a mission with 5 sources" }
|
|
237
|
+
};
|
|
238
|
+
var HEADROOM = 0.1;
|
|
239
|
+
var limitOf = (measure) => Math.ceil(measure * (1 + HEADROOM));
|
|
240
|
+
var PLUNE_BUDGET = {
|
|
241
|
+
/** A limit is the measure times (1 + headroom), rounded up. */
|
|
242
|
+
headroom: HEADROOM,
|
|
243
|
+
/** A measure below this share of its limit means the limit is too loose: with 10% headroom a list may shrink ~12%. */
|
|
244
|
+
tooLooseShare: 0.8,
|
|
245
|
+
/** Whole tool lists, outputSchema and annotations included. */
|
|
246
|
+
lists: {
|
|
247
|
+
/** 2025 era, write scope, as listed first: 17 tools, measured 8927 on 2026-11-20 (8853 before the measured-answer lines of #2988). */
|
|
248
|
+
writeFirst: 9272,
|
|
249
|
+
/** 2025 era, write scope, after plune_discover_tools: 22 tools, measured 11403 on 2026-11-20 (11329 before the measured-answer lines). */
|
|
250
|
+
writeAll: 11926,
|
|
251
|
+
/** Read scope, either era: 7 tools, measured 2296 on 2026-11-20 (2222 before the measured-answer lines; a read token is not offered plune_discover_tools). */
|
|
252
|
+
read: 2445,
|
|
253
|
+
/** 2026-07-28 era, write scope: 17 tools, the list does not change after discover; measured 8927 on 2026-11-20 (8853 before the measured-answer lines). */
|
|
254
|
+
modernWrite: 9272
|
|
255
|
+
},
|
|
256
|
+
/** The biggest single tool, plune_strategy_propose, measured 2177. */
|
|
257
|
+
largestTool: 2395,
|
|
258
|
+
/**
|
|
259
|
+
* The text content of an answer, on live answers recorded in plune-budget.fixtures.ts, measured 2026-11-14 with the
|
|
260
|
+
* text unindented (before, with a two-space indent): the beta demo project of 2026-11-10 (cases in Ukrainian) gives
|
|
261
|
+
* plune_project_context with 3 projects, 3 suites, no missions 387 (548); plune_cases_search 7678 (10509) for the
|
|
262
|
+
* whole project of 48 cases (a page of 100 is not reached); plune_review_list of 7 pending entries 695 (895). The demo
|
|
263
|
+
* has no missions, so plune_mission_get reads a mission with 5 sources captured live on a beta test project on
|
|
264
|
+
* 2026-11-14: 455 (585; the synthetic mission it replaced measured 476 indented, under its limit of 524).
|
|
265
|
+
*/
|
|
266
|
+
answers: {
|
|
267
|
+
plune_project_context: limitOf(PLUNE_ANSWER_MEASURES.plune_project_context.tokens),
|
|
268
|
+
plune_cases_search: limitOf(PLUNE_ANSWER_MEASURES.plune_cases_search.tokens),
|
|
269
|
+
plune_review_list: limitOf(PLUNE_ANSWER_MEASURES.plune_review_list.tokens),
|
|
270
|
+
plune_mission_get: limitOf(PLUNE_ANSWER_MEASURES.plune_mission_get.tokens)
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
var LINT_THRESHOLDS = {
|
|
274
|
+
description: {
|
|
275
|
+
/** Shorter than this many characters says too little for a model to choose the tool. */
|
|
276
|
+
minLength: 40,
|
|
277
|
+
/** Longer than this many characters costs every request and buries the point. */
|
|
278
|
+
maxLength: 1e3
|
|
279
|
+
},
|
|
280
|
+
names: {
|
|
281
|
+
/** The specification's length bound for a tool name. */
|
|
282
|
+
maxLength: 128,
|
|
283
|
+
/** A naming style is the server's convention when more than this share of its tools use it. */
|
|
284
|
+
majorityShare: 0.5
|
|
285
|
+
},
|
|
286
|
+
similarity: {
|
|
287
|
+
/** Word-set overlap (Jaccard) of two names, the shared server prefix left out, above which they are confusable. */
|
|
288
|
+
names: 0.75,
|
|
289
|
+
/** Word-set overlap of two descriptions above which a model cannot tell the tools apart. */
|
|
290
|
+
descriptions: 0.6,
|
|
291
|
+
/** Overlap of two descriptions above which the tools are related enough that "when not to use" matters more. */
|
|
292
|
+
related: 0.35,
|
|
293
|
+
/** Words shorter than this are left out of a description's word set. */
|
|
294
|
+
minWordLength: 3,
|
|
295
|
+
/** Decimals an overlap is reported with. */
|
|
296
|
+
decimals: 2,
|
|
297
|
+
/**
|
|
298
|
+
* Tools above which the rules that compare every pair (`tools-similar`, `desc-no-when-not`) do not run and say
|
|
299
|
+
* `could-not-run`: the work grows with the square of a count the server chooses. Measured 2026-11-10 on one
|
|
300
|
+
* desktop core, with no two tools alike (the slowest case: no early stop): at 1000 tools the two rules take 0.25 s
|
|
301
|
+
* with 60-character descriptions and 2.3 s with 1000-character ones (`description.maxLength`); at 4000 short ones,
|
|
302
|
+
* 4.5 s. Well above the tool lists of real servers, which hold tens to hundreds.
|
|
303
|
+
*/
|
|
304
|
+
maxTools: 1e3
|
|
305
|
+
},
|
|
306
|
+
schema: {
|
|
307
|
+
/**
|
|
308
|
+
* Levels an input schema may nest (a named property, or an array's items, is one level below the node it is in)
|
|
309
|
+
* for the rules that read every node of it (`required-unknown-property`, `param-example-missing`); deeper, they
|
|
310
|
+
* say `could-not-run` for the tool. The server chooses the depth, and a node's path is as long as its depth.
|
|
311
|
+
* Hand-written and generated schemas nest to about 10-20 levels; 64 leaves three times that, and is the number
|
|
312
|
+
* the `--call` path stops copying an output schema at (counted there in JSON levels, two to a property).
|
|
313
|
+
* Measured 2026-11-10 on one desktop core: the two rules take 0.03 ms on a chain exactly 64 levels deep (0.09 ms
|
|
314
|
+
* with two siblings and an array at every level), and stop within 0.2 ms on a chain of 100 000 levels. The
|
|
315
|
+
* recursive walk this replaced overflowed the call stack at 10 000 levels.
|
|
316
|
+
*/
|
|
317
|
+
maxDepth: 64
|
|
318
|
+
},
|
|
319
|
+
size: {
|
|
320
|
+
/**
|
|
321
|
+
* Estimated tokens of the whole visible tool list above which the list is reported: the limit of our own biggest
|
|
322
|
+
* list (`budget.lists.writeAll`), so a server that costs more than all of ours is told so.
|
|
323
|
+
*/
|
|
324
|
+
maxListTokens: PLUNE_BUDGET.lists.writeAll,
|
|
325
|
+
/**
|
|
326
|
+
* The estimate: characters of a tool's JSON divided by this, rounded up, summed over the tools. No tokenizer, no
|
|
327
|
+
* network, the same number in CI on every run; a limit is a measure plus headroom, never an exact token count.
|
|
328
|
+
* Calibrated 2026-11-10 against a provider's token-counting endpoint on two current models (both gave the same
|
|
329
|
+
* counts): the estimate is low. On the same JSON (name, description, input schema: the fields a model API takes) a
|
|
330
|
+
* tool list costs 1.57-1.72 times the estimate, the tool-use preamble of ~320 tokens left out; the largest live
|
|
331
|
+
* answer (JSON with Ukrainian text) 1.84 times. The limits stay in estimated tokens; for real tokens multiply by
|
|
332
|
+
* ~1.7 (English JSON) to ~1.85 (Cyrillic). Table: docs/features/mcp-context-budget/budget.md.
|
|
333
|
+
*/
|
|
334
|
+
charsPerToken: 4,
|
|
335
|
+
budget: PLUNE_BUDGET
|
|
336
|
+
},
|
|
337
|
+
call: {
|
|
338
|
+
/**
|
|
339
|
+
* Estimated tokens of one `tools/call` result (its JSON, as the client receives it) above which the answer is
|
|
340
|
+
* reported: the limit of our own biggest answer (`budget.answers.plune_cases_search`), as `maxListTokens` is for
|
|
341
|
+
* the list.
|
|
342
|
+
*/
|
|
343
|
+
maxResultTokens: PLUNE_BUDGET.answers.plune_cases_search
|
|
344
|
+
},
|
|
345
|
+
language: {
|
|
346
|
+
/**
|
|
347
|
+
* A text is taken to be in a listed language when at least this many of its stop words occur; two, so a lone
|
|
348
|
+
* "a" or "in" of another Latin-script language does not pass for English.
|
|
349
|
+
*/
|
|
350
|
+
minStopwords: 2
|
|
351
|
+
},
|
|
352
|
+
/** Name words that say a tool returns a list, so it should take a page size or cursor. */
|
|
353
|
+
listVerbs: ["list", "search", "find", "query", "browse"],
|
|
354
|
+
/** Parameter names that page a list. */
|
|
355
|
+
pagingParams: ["limit", "cursor", "page", "offset", "pagesize", "perpage", "per_page", "page_size", "pagetoken", "page_token"],
|
|
356
|
+
/** Name words of a tool that changes something; a read-only hint on such a tool contradicts its name. */
|
|
357
|
+
writeVerbs: ["create", "add", "update", "edit", "delete", "remove", "set", "write", "put", "patch", "insert", "replace", "send"],
|
|
358
|
+
/** Name words of a tool that overwrites or removes, which is not an "additive only" update. */
|
|
359
|
+
overwriteVerbs: ["update", "edit", "set", "replace", "delete", "remove", "overwrite", "patch", "clear", "reset", "rename", "move"],
|
|
360
|
+
/** Parameter name words that say the value is not free text. Booleans only by the first word (`isActive`). */
|
|
361
|
+
typedParamWords: {
|
|
362
|
+
number: ["count", "limit", "max", "min", "size", "offset", "total", "amount", "number", "port", "timeout", "retries", "quantity", "index"],
|
|
363
|
+
boolean: ["is", "has", "can", "should", "allow", "enable", "enabled"],
|
|
364
|
+
date: ["date", "time", "timestamp", "since", "until", "deadline"],
|
|
365
|
+
url: ["url", "uri", "href", "link", "endpoint", "website"]
|
|
366
|
+
},
|
|
367
|
+
/**
|
|
368
|
+
* Words by language. `script` is the alphabet the language is written in; `letters`, when given, are letters the
|
|
369
|
+
* language has and its neighbours in the same alphabet do not, so a Russian text is not read as Ukrainian.
|
|
370
|
+
* Phrases match at the start of a word, so a stem (`не використов`) covers its inflected forms.
|
|
371
|
+
*/
|
|
372
|
+
languages: {
|
|
373
|
+
en: {
|
|
374
|
+
script: "Latin",
|
|
375
|
+
letters: "",
|
|
376
|
+
stopwords: ["the", "a", "an", "to", "of", "and", "or", "is", "are", "in", "for", "with", "it", "its", "as", "at", "be", "not", "can", "you", "your", "this", "that", "them", "by", "on", "from", "if", "when", "each"],
|
|
377
|
+
whenNot: ["do not", "don't", "instead", "rather than", "only", "not for", "avoid", "never"],
|
|
378
|
+
example: ["e.g.", "for example", "for instance", "such as", "example"],
|
|
379
|
+
closedSet: ["one of", "either"]
|
|
380
|
+
},
|
|
381
|
+
uk: {
|
|
382
|
+
script: "Cyrillic",
|
|
383
|
+
letters: "\u0456\u0457\u0454\u0491",
|
|
384
|
+
stopwords: ["\u0456", "\u0439", "\u0442\u0430", "\u0432", "\u0443", "\u043D\u0430", "\u0437", "\u0456\u0437", "\u0449\u043E", "\u0446\u0435", "\u0434\u043E", "\u043D\u0435", "\u0434\u043B\u044F", "\u044F\u043A", "\u0430\u0431\u043E", "\u043A\u043E\u043B\u0438", "\u0439\u043E\u0433\u043E", "\u0457\u0457", "\u0432\u0456\u0434"],
|
|
385
|
+
whenNot: ["\u043D\u0435 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432", "\u043D\u0435 \u0432\u0438\u043A\u043B\u0438\u043A", "\u043D\u0435 \u0437\u0430\u0441\u0442\u043E\u0441\u043E\u0432", "\u0437\u0430\u043C\u0456\u0441\u0442\u044C", "\u043B\u0438\u0448\u0435", "\u0442\u0456\u043B\u044C\u043A\u0438", "\u043D\u0435 \u0434\u043B\u044F", "\u043D\u0456\u043A\u043E\u043B\u0438"],
|
|
386
|
+
example: ["\u043D\u0430\u043F\u0440\u0438\u043A\u043B\u0430\u0434", "\u043D\u0430\u043F\u0440.", "\u043F\u0440\u0438\u043A\u043B\u0430\u0434", "\u0437\u043E\u043A\u0440\u0435\u043C\u0430"],
|
|
387
|
+
closedSet: ["\u043E\u0434\u043D\u0435 \u0437", "\u043E\u0434\u0438\u043D \u0437", "\u043E\u0434\u043D\u0430 \u0437", "\u043E\u0434\u043D\u0435 \u0456\u0437", "\u043E\u0434\u0438\u043D \u0456\u0437", "\u043E\u0434\u043D\u0430 \u0456\u0437"]
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
};
|
|
391
|
+
|
|
231
392
|
// src/mcp-tools/contract.ts
|
|
232
393
|
var MAX_VISIBLE_TOOLS = 20;
|
|
233
394
|
var define = (tool) => tool;
|
|
395
|
+
var measuredCost = (tool) => ` Measured answer: ~${PLUNE_ANSWER_MEASURES[tool].tokens} tokens (characters / 4) for ${PLUNE_ANSWER_MEASURES[tool].of}.`;
|
|
234
396
|
var listPage = {
|
|
235
397
|
limit: import_zod2.z.number().int().min(1).max(BATCH_MAX).optional(),
|
|
236
398
|
cursor: import_zod2.z.string().min(1).optional().describe("nextCursor of the previous page")
|
|
@@ -241,7 +403,7 @@ var PLUNE_TOOLS = [
|
|
|
241
403
|
define({
|
|
242
404
|
name: "plune_project_context",
|
|
243
405
|
title: "Project context",
|
|
244
|
-
description: "Start here: learn the project you are working in with one call \u2014 its projects, the suite tree, how many test cases it has, its testing missions, how much waits in the review queue, and the rules of its memory: what a person accepted for this project, to follow without asking again.",
|
|
406
|
+
description: "Start here: learn the project you are working in with one call \u2014 its projects, the suite tree, how many test cases it has, its testing missions, how much waits in the review queue, and the rules of its memory: what a person accepted for this project, to follow without asking again." + measuredCost("plune_project_context"),
|
|
245
407
|
input: import_zod2.z.strictObject({}),
|
|
246
408
|
output: import_zod2.z.object({
|
|
247
409
|
projectId: import_zod2.z.string().nullable(),
|
|
@@ -269,7 +431,7 @@ var PLUNE_TOOLS = [
|
|
|
269
431
|
define({
|
|
270
432
|
name: "plune_cases_search",
|
|
271
433
|
title: "Find test cases",
|
|
272
|
-
description: "Find test cases of the project by filter \u2014 free text in q, suite, state, tag, priority and the other filters of the case list \u2014 one page at a time, with the total and how many match.",
|
|
434
|
+
description: "Find test cases of the project by filter \u2014 free text in q, suite, state, tag, priority and the other filters of the case list \u2014 one page at a time, with the total and how many match." + measuredCost("plune_cases_search"),
|
|
273
435
|
input: import_zod2.z.strictObject({
|
|
274
436
|
filters: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.union([import_zod2.z.string(), import_zod2.z.array(import_zod2.z.string())])).optional().describe('Query filters of GET /v1/test-cases: free text is the key q, and a key the list does not know is ignored, so all cases come back; a list is OR inside one key, keys are AND-ed (e.g. {"q": "card", "tag": ["smoke"]})'),
|
|
275
437
|
...listPage
|
|
@@ -287,7 +449,7 @@ var PLUNE_TOOLS = [
|
|
|
287
449
|
define({
|
|
288
450
|
name: "plune_review_list",
|
|
289
451
|
title: "Read the review queue",
|
|
290
|
-
description: "See what waits for a decision in the review queue \u2014 proposed cases, discovered tests, endpoints, strategies, reports \u2014 narrowed by state, kind and mission, newest first, one page at a time. The mission filter needs a platform that supports it; an older one returns the whole queue.",
|
|
452
|
+
description: "See what waits for a decision in the review queue \u2014 proposed cases, discovered tests, endpoints, strategies, reports \u2014 narrowed by state, kind and mission, newest first, one page at a time. The mission filter needs a platform that supports it; an older one returns the whole queue." + measuredCost("plune_review_list"),
|
|
291
453
|
input: import_zod2.z.strictObject({
|
|
292
454
|
state: import_zod2.z.enum(REVIEW_STATES).optional(),
|
|
293
455
|
kinds: import_zod2.z.array(import_zod2.z.enum(REVIEW_KINDS)).min(1).optional().describe("Questions are read with the question tool"),
|
|
@@ -368,7 +530,7 @@ var PLUNE_TOOLS = [
|
|
|
368
530
|
define({
|
|
369
531
|
name: "plune_mission_get",
|
|
370
532
|
title: "Read a mission",
|
|
371
|
-
description: "Read a testing mission with everything it holds \u2014 its brief, state, documentation answer and every source attached to it \u2014 before planning or continuing the work on it.",
|
|
533
|
+
description: "Read a testing mission with everything it holds \u2014 its brief, state, documentation answer and every source attached to it \u2014 before planning or continuing the work on it." + measuredCost("plune_mission_get"),
|
|
372
534
|
input: import_zod2.z.strictObject({ missionId }),
|
|
373
535
|
output: import_zod2.z.object({ mission: entity }),
|
|
374
536
|
write: false,
|
|
@@ -685,8 +847,10 @@ function errorOf(err) {
|
|
|
685
847
|
return { status: 401, code: "token_rejected", message: `Plune rejected the token (401): ${err.message}. Run \`plune login\` or set PLUNE_TOKEN to a live token.` };
|
|
686
848
|
if (err.status === 403 && err.message === READ_ONLY_REFUSAL)
|
|
687
849
|
return { status: 403, code: "read_only_token", message: `Plune refused (403): ${readScopeMessage("it cannot write")}` };
|
|
688
|
-
const
|
|
689
|
-
|
|
850
|
+
const quota = err.status === 429 && asRecord(err.body)["quota"] !== void 0;
|
|
851
|
+
const code = err.code ?? (quota ? "quota_exceeded" : `http_${err.status}`);
|
|
852
|
+
const why = quota ? "a plan limit is reached, not a missing permission \u2014 " : err.status === 403 ? "the token or its user lacks the permission, not a plan limit \u2014 " : "";
|
|
853
|
+
return { status: err.status, code, message: `Plune refused (${err.status} ${code}): ${why}${err.message}${detailLines(err.body)}`, details: err.body };
|
|
690
854
|
}
|
|
691
855
|
if (err instanceof PluneNetworkError) return { code: "network", message: `${err.message}. Check PLUNE_API_URL and the network.` };
|
|
692
856
|
throw err;
|
|
@@ -720,7 +884,6 @@ function createPluneToolExecutor(opts) {
|
|
|
720
884
|
let scope = opts.scope;
|
|
721
885
|
const revealed = /* @__PURE__ */ new Set();
|
|
722
886
|
const confirms = /* @__PURE__ */ new Map();
|
|
723
|
-
let proposals = 0;
|
|
724
887
|
const visibleTools = () => {
|
|
725
888
|
const core = defaultVisibleTools(scope);
|
|
726
889
|
const extra = [...revealed].filter((n) => !(scope === "read" && pluneTool(n).write) && !core.includes(n));
|
|
@@ -839,13 +1002,12 @@ function createPluneToolExecutor(opts) {
|
|
|
839
1002
|
const stableId = (0, import_node_crypto.createHash)("sha256").update([c["title"], ...steps, c["expected"]].join("\n")).digest("hex").slice(0, 32);
|
|
840
1003
|
return withoutUndefined({ stableId, execution: "manual", ...c });
|
|
841
1004
|
});
|
|
842
|
-
proposals += 1;
|
|
843
1005
|
const req = {
|
|
844
1006
|
method: "POST",
|
|
845
1007
|
path: "/v1/ingest/cairn",
|
|
846
1008
|
body: {
|
|
847
1009
|
schemaVersion: 1,
|
|
848
|
-
run: withoutUndefined({ runId: `mcp-${sessionId}-${
|
|
1010
|
+
run: withoutUndefined({ runId: `mcp-${sessionId}-${(0, import_node_crypto.randomUUID)().slice(0, 8)}`, mode: "design", target: str(i["target"]), missionId: i["missionId"] }),
|
|
849
1011
|
cases
|
|
850
1012
|
}
|
|
851
1013
|
};
|
|
@@ -980,6 +1142,8 @@ function createPluneToolExecutor(opts) {
|
|
|
980
1142
|
if (isDeletion(req)) {
|
|
981
1143
|
const t = now();
|
|
982
1144
|
for (const [k, v] of confirms) if (v.expires <= t) confirms.delete(k);
|
|
1145
|
+
if (confirm === void 0 && opts.oneRequest === true)
|
|
1146
|
+
return fail("agent_cannot_delete", "Nothing was sent, and it will not be: the platform refuses an agent any deletion. A person deletes in the app.");
|
|
983
1147
|
if (confirm === void 0) {
|
|
984
1148
|
const value = (0, import_node_crypto.randomBytes)(24).toString("base64url");
|
|
985
1149
|
confirms.set(value, { fingerprint: fingerprint(req), expires: t + CONFIRM_TTL_MS });
|