@plune-ai/cli 0.36.0 → 0.38.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 +54 -3
- package/THIRD_PARTY_NOTICES +229 -0
- package/dist/cli.cjs +28789 -10649
- package/dist/index.cjs +2484 -168
- package/dist/index.d.cts +79 -4
- package/dist/index.d.ts +79 -4
- package/dist/index.js +2484 -168
- package/dist/mcp-tools.cjs +50 -12
- package/dist/mcp-tools.d.cts +9 -0
- package/dist/mcp-tools.d.ts +9 -0
- package/dist/mcp-tools.js +50 -12
- package/package.json +2 -1
- package/skills/qa-mission/SKILL.md +243 -0
- package/skills/qa-mission/references/tool-calls.md +157 -0
package/dist/mcp-tools.cjs
CHANGED
|
@@ -204,6 +204,7 @@ var writeOutput = import_zod.z.object({
|
|
|
204
204
|
request: plannedRequest.optional(),
|
|
205
205
|
result: entity.optional()
|
|
206
206
|
});
|
|
207
|
+
var strategyOutput = writeOutput.extend({ checked: import_zod.z.boolean().optional(), findings: import_zod.z.array(import_zod.z.unknown()).optional() });
|
|
207
208
|
var batchOutput = import_zod.z.object({
|
|
208
209
|
dryRun: import_zod.z.boolean(),
|
|
209
210
|
requested: import_zod.z.number().int(),
|
|
@@ -239,7 +240,7 @@ var PLUNE_TOOLS = [
|
|
|
239
240
|
define({
|
|
240
241
|
name: "plune_project_context",
|
|
241
242
|
title: "Project context",
|
|
242
|
-
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,
|
|
243
|
+
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.",
|
|
243
244
|
input: import_zod2.z.strictObject({}),
|
|
244
245
|
output: import_zod2.z.object({
|
|
245
246
|
projectId: import_zod2.z.string().nullable(),
|
|
@@ -247,11 +248,12 @@ var PLUNE_TOOLS = [
|
|
|
247
248
|
suites: import_zod2.z.array(entity),
|
|
248
249
|
cases: import_zod2.z.object({ total: import_zod2.z.number().int() }),
|
|
249
250
|
missions: import_zod2.z.array(entity),
|
|
250
|
-
reviewQueue: import_zod2.z.object({ pending: import_zod2.z.number().int(), more: import_zod2.z.boolean() })
|
|
251
|
+
reviewQueue: import_zod2.z.object({ pending: import_zod2.z.number().int(), more: import_zod2.z.boolean() }),
|
|
252
|
+
memoryRules: import_zod2.z.array(import_zod2.z.object({ id: import_zod2.z.string(), text: import_zod2.z.string() })).describe("Rules a person accepted in the review queue and has not retired; a proposed or rejected rule is never here")
|
|
251
253
|
}),
|
|
252
254
|
write: false,
|
|
253
255
|
visibility: "core",
|
|
254
|
-
endpoints: ["GET /v1/projects", "GET /v1/suites", "GET /v1/test-cases", "GET /v1/missions", "GET /v1/review-items"]
|
|
256
|
+
endpoints: ["GET /v1/projects", "GET /v1/suites", "GET /v1/test-cases", "GET /v1/missions", "GET /v1/review-items", "GET /v1/memory/rules"]
|
|
255
257
|
}),
|
|
256
258
|
define({
|
|
257
259
|
name: "plune_get",
|
|
@@ -284,10 +286,11 @@ var PLUNE_TOOLS = [
|
|
|
284
286
|
define({
|
|
285
287
|
name: "plune_review_list",
|
|
286
288
|
title: "Read the review queue",
|
|
287
|
-
description: "See what waits for a decision in the review queue \u2014 proposed cases, discovered tests, endpoints, strategies, reports \u2014 narrowed by state and
|
|
289
|
+
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.",
|
|
288
290
|
input: import_zod2.z.strictObject({
|
|
289
291
|
state: import_zod2.z.enum(REVIEW_STATES).optional(),
|
|
290
292
|
kinds: import_zod2.z.array(import_zod2.z.enum(REVIEW_KINDS)).min(1).optional().describe("Questions are read with the question tool"),
|
|
293
|
+
missionId: import_zod2.z.string().min(1).optional().describe("Only the entries of this mission"),
|
|
291
294
|
...listPage
|
|
292
295
|
}),
|
|
293
296
|
output: import_zod2.z.object({ items: import_zod2.z.array(entity), nextCursor: import_zod2.z.string().nullable() }),
|
|
@@ -322,10 +325,11 @@ var PLUNE_TOOLS = [
|
|
|
322
325
|
description: "Propose up to 100 new test cases for a person to review: they land in the review queue as proposals and become cases only when someone approves them. Nothing is created silently.",
|
|
323
326
|
input: import_zod2.z.strictObject({
|
|
324
327
|
target: import_zod2.z.string().trim().min(1).max(2048).describe("What the cases test: the product address, or the mission name"),
|
|
328
|
+
missionId: import_zod2.z.string().min(1).optional().describe("The mission these cases are for: the review queue can then be read by it"),
|
|
325
329
|
cases: import_zod2.z.array(proposedCase).min(1).max(BATCH_MAX),
|
|
326
330
|
dry_run: dryRun
|
|
327
331
|
}),
|
|
328
|
-
output: batchOutput,
|
|
332
|
+
output: batchOutput.extend({ itemIds: import_zod2.z.array(import_zod2.z.string()).optional().describe("The ids of the review-queue entries created, when the platform names them") }),
|
|
329
333
|
write: true,
|
|
330
334
|
visibility: "core",
|
|
331
335
|
endpoints: ["POST /v1/ingest/cairn"]
|
|
@@ -442,7 +446,7 @@ var PLUNE_TOOLS = [
|
|
|
442
446
|
title: "Propose a test strategy",
|
|
443
447
|
description: "Propose a test strategy for a mission in ISTQB sections \u2014 objectives, scope in and out, approach, levels and techniques, risks, entry and exit criteria \u2014 for a person to accept.",
|
|
444
448
|
input: import_zod2.z.strictObject({ missionId, content: strategyContent, dry_run: dryRun }),
|
|
445
|
-
output:
|
|
449
|
+
output: strategyOutput,
|
|
446
450
|
write: true,
|
|
447
451
|
visibility: "core",
|
|
448
452
|
endpoints: ["POST /v1/missions/:id/strategy"]
|
|
@@ -658,6 +662,17 @@ var fail = (code, message, extra = {}) => ({
|
|
|
658
662
|
ok: false,
|
|
659
663
|
error: { code, message, ...extra }
|
|
660
664
|
});
|
|
665
|
+
function detailLines(body) {
|
|
666
|
+
const b = asRecord(body);
|
|
667
|
+
const lines = [...asArray(b["findings"]), ...asArray(b["details"])].map((d) => {
|
|
668
|
+
if (typeof d === "string") return `- ${d}`;
|
|
669
|
+
const f = asRecord(d);
|
|
670
|
+
const where = [f["rule"], f["path"]].filter((x) => typeof x === "string").join(" at ");
|
|
671
|
+
const said = typeof f["message"] === "string" ? f["message"] : where === "" ? JSON.stringify(d) : "";
|
|
672
|
+
return `- ${[where, said].filter(Boolean).join(": ")}`;
|
|
673
|
+
});
|
|
674
|
+
return lines.length === 0 ? "" : "\n" + lines.join("\n");
|
|
675
|
+
}
|
|
661
676
|
function errorOf(err) {
|
|
662
677
|
if (err instanceof PluneApiError) {
|
|
663
678
|
if (err.status === 401)
|
|
@@ -665,7 +680,7 @@ function errorOf(err) {
|
|
|
665
680
|
if (err.status === 403 && err.message === READ_ONLY_REFUSAL)
|
|
666
681
|
return { status: 403, code: "read_only_token", message: `Plune refused (403): ${readScopeMessage("it cannot write")}` };
|
|
667
682
|
const code = err.code ?? `http_${err.status}`;
|
|
668
|
-
return { status: err.status, code, message: `Plune refused (${err.status} ${code}): ${err.message}`, details: err.body };
|
|
683
|
+
return { status: err.status, code, message: `Plune refused (${err.status} ${code}): ${err.message}${detailLines(err.body)}`, details: err.body };
|
|
669
684
|
}
|
|
670
685
|
if (err instanceof PluneNetworkError) return { code: "network", message: `${err.message}. Check PLUNE_API_URL and the network.` };
|
|
671
686
|
throw err;
|
|
@@ -738,13 +753,19 @@ function createPluneToolExecutor(opts) {
|
|
|
738
753
|
const str = (v) => v;
|
|
739
754
|
const handlers = {
|
|
740
755
|
async plune_project_context() {
|
|
741
|
-
const [projects, suites, cases, missions, queue] = await Promise.all([
|
|
756
|
+
const [projects, suites, cases, missions, queue, memory] = await Promise.all([
|
|
742
757
|
call({ method: "GET", path: "/v1/projects" }),
|
|
743
758
|
call({ method: "GET", path: "/v1/suites" }),
|
|
744
759
|
call({ method: "GET", path: "/v1/test-cases", query: { limit: "1", stability: "0" } }),
|
|
745
760
|
call({ method: "GET", path: "/v1/missions" }),
|
|
746
|
-
call({ method: "GET", path: "/v1/review-items", query: { state: "pending", limit: "100" } })
|
|
761
|
+
call({ method: "GET", path: "/v1/review-items", query: { state: "pending", limit: "100" } }),
|
|
762
|
+
// A platform that keeps no project memory yet answers 404: no rules, and the rest of the context still stands.
|
|
763
|
+
call({ method: "GET", path: "/v1/memory/rules", query: { state: "in_force" } }).catch((err) => {
|
|
764
|
+
if (err instanceof PluneApiError && err.status === 404) return { status: 404, body: { rules: [] } };
|
|
765
|
+
throw err;
|
|
766
|
+
})
|
|
747
767
|
]);
|
|
768
|
+
const memoryRules = asArray(asRecord(memory.body)["rules"]).map(asRecord).filter((r) => r["inForce"] === true && typeof r["id"] === "string" && typeof r["text"] === "string").map((r) => ({ id: str(r["id"]), text: str(r["text"]) }));
|
|
748
769
|
const projectList = asArray(asRecord(projects.body)["projects"]);
|
|
749
770
|
const only = projectList.length === 1 ? asRecord(projectList[0])["id"] : void 0;
|
|
750
771
|
const projectId2 = opts.projectId ?? (typeof only === "string" ? only : null);
|
|
@@ -755,7 +776,8 @@ function createPluneToolExecutor(opts) {
|
|
|
755
776
|
suites: asArray(asRecord(suites.body)["suites"]),
|
|
756
777
|
cases: { total: typeof total === "number" ? total : 0 },
|
|
757
778
|
missions: asArray(asRecord(missions.body)["missions"]),
|
|
758
|
-
reviewQueue: { pending: asArray(asRecord(queue.body)["items"]).length, more: cursorOf(asRecord(queue.body)["nextCursor"]) !== null }
|
|
779
|
+
reviewQueue: { pending: asArray(asRecord(queue.body)["items"]).length, more: cursorOf(asRecord(queue.body)["nextCursor"]) !== null },
|
|
780
|
+
memoryRules
|
|
759
781
|
};
|
|
760
782
|
},
|
|
761
783
|
async plune_get(i) {
|
|
@@ -783,6 +805,7 @@ function createPluneToolExecutor(opts) {
|
|
|
783
805
|
const query = withoutUndefined({
|
|
784
806
|
state: i["state"],
|
|
785
807
|
kind: kinds?.join(","),
|
|
808
|
+
missionId: i["missionId"],
|
|
786
809
|
limit: i["limit"] === void 0 ? void 0 : String(i["limit"]),
|
|
787
810
|
cursor: i["cursor"]
|
|
788
811
|
});
|
|
@@ -812,12 +835,17 @@ function createPluneToolExecutor(opts) {
|
|
|
812
835
|
const req = {
|
|
813
836
|
method: "POST",
|
|
814
837
|
path: "/v1/ingest/cairn",
|
|
815
|
-
body: {
|
|
838
|
+
body: {
|
|
839
|
+
schemaVersion: 1,
|
|
840
|
+
run: withoutUndefined({ runId: `mcp-${sessionId}-${proposals}`, mode: "design", target: str(i["target"]), missionId: i["missionId"] }),
|
|
841
|
+
cases
|
|
842
|
+
}
|
|
816
843
|
};
|
|
817
844
|
if (i["dry_run"] === true) return { dryRun: true, requested: cases.length, applied: 0, requests: [planned(req)] };
|
|
818
845
|
const summary = asRecord((await call(req)).body);
|
|
819
846
|
const proposed = summary["proposed"];
|
|
820
|
-
|
|
847
|
+
const ids = asArray(summary["itemIds"]).filter((x) => typeof x === "string");
|
|
848
|
+
return { dryRun: false, requested: cases.length, applied: typeof proposed === "number" ? proposed : 0, ...ids.length > 0 ? { itemIds: ids } : {}, report: summary };
|
|
821
849
|
},
|
|
822
850
|
async plune_cases_generate(i) {
|
|
823
851
|
const { dry_run, projectId: projectId2, ...body } = i;
|
|
@@ -869,6 +897,16 @@ function createPluneToolExecutor(opts) {
|
|
|
869
897
|
return { questions, nextCursor: cursorOf(body["nextCursor"]) };
|
|
870
898
|
},
|
|
871
899
|
async plune_strategy_propose(i) {
|
|
900
|
+
const req = { method: "POST", path: path("/v1/missions/:id/strategy", str(i["missionId"])), body: i["content"] };
|
|
901
|
+
if (i["dry_run"] === true) {
|
|
902
|
+
try {
|
|
903
|
+
const res = await call({ ...req, path: `${req.path}/check` });
|
|
904
|
+
return { dryRun: true, checked: true, findings: asArray(asRecord(res.body)["findings"]), request: planned(req) };
|
|
905
|
+
} catch (err) {
|
|
906
|
+
if (!(err instanceof PluneApiError && (err.status === 404 && err.code !== "mission_not_found" || err.status === 403 && err.message === READ_ONLY_REFUSAL))) throw err;
|
|
907
|
+
return { dryRun: true, checked: false, request: planned(req) };
|
|
908
|
+
}
|
|
909
|
+
}
|
|
872
910
|
return write({ method: "POST", path: path("/v1/missions/:id/strategy", str(i["missionId"])), body: i["content"] }, i["dry_run"]);
|
|
873
911
|
},
|
|
874
912
|
async plune_report_request(i) {
|
package/dist/mcp-tools.d.cts
CHANGED
|
@@ -46,6 +46,10 @@ declare const PLUNE_TOOLS: readonly [{
|
|
|
46
46
|
pending: z.ZodNumber;
|
|
47
47
|
more: z.ZodBoolean;
|
|
48
48
|
}, z.core.$strip>;
|
|
49
|
+
memoryRules: z.ZodArray<z.ZodObject<{
|
|
50
|
+
id: z.ZodString;
|
|
51
|
+
text: z.ZodString;
|
|
52
|
+
}, z.core.$strip>>;
|
|
49
53
|
}, z.core.$strip>;
|
|
50
54
|
write: false;
|
|
51
55
|
visibility: "core";
|
|
@@ -113,6 +117,7 @@ declare const PLUNE_TOOLS: readonly [{
|
|
|
113
117
|
report: "report";
|
|
114
118
|
memory_rule: "memory_rule";
|
|
115
119
|
}>>>;
|
|
120
|
+
missionId: z.ZodOptional<z.ZodString>;
|
|
116
121
|
}, z.core.$strict>;
|
|
117
122
|
output: z.ZodObject<{
|
|
118
123
|
items: z.ZodArray<z.ZodObject<{
|
|
@@ -163,6 +168,7 @@ declare const PLUNE_TOOLS: readonly [{
|
|
|
163
168
|
description: string;
|
|
164
169
|
input: z.ZodObject<{
|
|
165
170
|
target: z.ZodString;
|
|
171
|
+
missionId: z.ZodOptional<z.ZodString>;
|
|
166
172
|
cases: z.ZodArray<z.ZodObject<{
|
|
167
173
|
title: z.ZodString;
|
|
168
174
|
steps: z.ZodArray<z.ZodString>;
|
|
@@ -204,6 +210,7 @@ declare const PLUNE_TOOLS: readonly [{
|
|
|
204
210
|
code: z.ZodOptional<z.ZodString>;
|
|
205
211
|
}, z.core.$strip>>>;
|
|
206
212
|
report: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
213
|
+
itemIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
207
214
|
}, z.core.$strip>;
|
|
208
215
|
write: true;
|
|
209
216
|
visibility: "core";
|
|
@@ -634,6 +641,8 @@ declare const PLUNE_TOOLS: readonly [{
|
|
|
634
641
|
result: z.ZodOptional<z.ZodObject<{
|
|
635
642
|
id: z.ZodOptional<z.ZodString>;
|
|
636
643
|
}, z.core.$loose>>;
|
|
644
|
+
checked: z.ZodOptional<z.ZodBoolean>;
|
|
645
|
+
findings: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
637
646
|
}, z.core.$strip>;
|
|
638
647
|
write: true;
|
|
639
648
|
visibility: "core";
|
package/dist/mcp-tools.d.ts
CHANGED
|
@@ -46,6 +46,10 @@ declare const PLUNE_TOOLS: readonly [{
|
|
|
46
46
|
pending: z.ZodNumber;
|
|
47
47
|
more: z.ZodBoolean;
|
|
48
48
|
}, z.core.$strip>;
|
|
49
|
+
memoryRules: z.ZodArray<z.ZodObject<{
|
|
50
|
+
id: z.ZodString;
|
|
51
|
+
text: z.ZodString;
|
|
52
|
+
}, z.core.$strip>>;
|
|
49
53
|
}, z.core.$strip>;
|
|
50
54
|
write: false;
|
|
51
55
|
visibility: "core";
|
|
@@ -113,6 +117,7 @@ declare const PLUNE_TOOLS: readonly [{
|
|
|
113
117
|
report: "report";
|
|
114
118
|
memory_rule: "memory_rule";
|
|
115
119
|
}>>>;
|
|
120
|
+
missionId: z.ZodOptional<z.ZodString>;
|
|
116
121
|
}, z.core.$strict>;
|
|
117
122
|
output: z.ZodObject<{
|
|
118
123
|
items: z.ZodArray<z.ZodObject<{
|
|
@@ -163,6 +168,7 @@ declare const PLUNE_TOOLS: readonly [{
|
|
|
163
168
|
description: string;
|
|
164
169
|
input: z.ZodObject<{
|
|
165
170
|
target: z.ZodString;
|
|
171
|
+
missionId: z.ZodOptional<z.ZodString>;
|
|
166
172
|
cases: z.ZodArray<z.ZodObject<{
|
|
167
173
|
title: z.ZodString;
|
|
168
174
|
steps: z.ZodArray<z.ZodString>;
|
|
@@ -204,6 +210,7 @@ declare const PLUNE_TOOLS: readonly [{
|
|
|
204
210
|
code: z.ZodOptional<z.ZodString>;
|
|
205
211
|
}, z.core.$strip>>>;
|
|
206
212
|
report: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
213
|
+
itemIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
207
214
|
}, z.core.$strip>;
|
|
208
215
|
write: true;
|
|
209
216
|
visibility: "core";
|
|
@@ -634,6 +641,8 @@ declare const PLUNE_TOOLS: readonly [{
|
|
|
634
641
|
result: z.ZodOptional<z.ZodObject<{
|
|
635
642
|
id: z.ZodOptional<z.ZodString>;
|
|
636
643
|
}, z.core.$loose>>;
|
|
644
|
+
checked: z.ZodOptional<z.ZodBoolean>;
|
|
645
|
+
findings: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
637
646
|
}, z.core.$strip>;
|
|
638
647
|
write: true;
|
|
639
648
|
visibility: "core";
|
package/dist/mcp-tools.js
CHANGED
|
@@ -168,6 +168,7 @@ var writeOutput = z.object({
|
|
|
168
168
|
request: plannedRequest.optional(),
|
|
169
169
|
result: entity.optional()
|
|
170
170
|
});
|
|
171
|
+
var strategyOutput = writeOutput.extend({ checked: z.boolean().optional(), findings: z.array(z.unknown()).optional() });
|
|
171
172
|
var batchOutput = z.object({
|
|
172
173
|
dryRun: z.boolean(),
|
|
173
174
|
requested: z.number().int(),
|
|
@@ -203,7 +204,7 @@ var PLUNE_TOOLS = [
|
|
|
203
204
|
define({
|
|
204
205
|
name: "plune_project_context",
|
|
205
206
|
title: "Project context",
|
|
206
|
-
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,
|
|
207
|
+
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.",
|
|
207
208
|
input: z2.strictObject({}),
|
|
208
209
|
output: z2.object({
|
|
209
210
|
projectId: z2.string().nullable(),
|
|
@@ -211,11 +212,12 @@ var PLUNE_TOOLS = [
|
|
|
211
212
|
suites: z2.array(entity),
|
|
212
213
|
cases: z2.object({ total: z2.number().int() }),
|
|
213
214
|
missions: z2.array(entity),
|
|
214
|
-
reviewQueue: z2.object({ pending: z2.number().int(), more: z2.boolean() })
|
|
215
|
+
reviewQueue: z2.object({ pending: z2.number().int(), more: z2.boolean() }),
|
|
216
|
+
memoryRules: z2.array(z2.object({ id: z2.string(), text: z2.string() })).describe("Rules a person accepted in the review queue and has not retired; a proposed or rejected rule is never here")
|
|
215
217
|
}),
|
|
216
218
|
write: false,
|
|
217
219
|
visibility: "core",
|
|
218
|
-
endpoints: ["GET /v1/projects", "GET /v1/suites", "GET /v1/test-cases", "GET /v1/missions", "GET /v1/review-items"]
|
|
220
|
+
endpoints: ["GET /v1/projects", "GET /v1/suites", "GET /v1/test-cases", "GET /v1/missions", "GET /v1/review-items", "GET /v1/memory/rules"]
|
|
219
221
|
}),
|
|
220
222
|
define({
|
|
221
223
|
name: "plune_get",
|
|
@@ -248,10 +250,11 @@ var PLUNE_TOOLS = [
|
|
|
248
250
|
define({
|
|
249
251
|
name: "plune_review_list",
|
|
250
252
|
title: "Read the review queue",
|
|
251
|
-
description: "See what waits for a decision in the review queue \u2014 proposed cases, discovered tests, endpoints, strategies, reports \u2014 narrowed by state and
|
|
253
|
+
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.",
|
|
252
254
|
input: z2.strictObject({
|
|
253
255
|
state: z2.enum(REVIEW_STATES).optional(),
|
|
254
256
|
kinds: z2.array(z2.enum(REVIEW_KINDS)).min(1).optional().describe("Questions are read with the question tool"),
|
|
257
|
+
missionId: z2.string().min(1).optional().describe("Only the entries of this mission"),
|
|
255
258
|
...listPage
|
|
256
259
|
}),
|
|
257
260
|
output: z2.object({ items: z2.array(entity), nextCursor: z2.string().nullable() }),
|
|
@@ -286,10 +289,11 @@ var PLUNE_TOOLS = [
|
|
|
286
289
|
description: "Propose up to 100 new test cases for a person to review: they land in the review queue as proposals and become cases only when someone approves them. Nothing is created silently.",
|
|
287
290
|
input: z2.strictObject({
|
|
288
291
|
target: z2.string().trim().min(1).max(2048).describe("What the cases test: the product address, or the mission name"),
|
|
292
|
+
missionId: z2.string().min(1).optional().describe("The mission these cases are for: the review queue can then be read by it"),
|
|
289
293
|
cases: z2.array(proposedCase).min(1).max(BATCH_MAX),
|
|
290
294
|
dry_run: dryRun
|
|
291
295
|
}),
|
|
292
|
-
output: batchOutput,
|
|
296
|
+
output: batchOutput.extend({ itemIds: z2.array(z2.string()).optional().describe("The ids of the review-queue entries created, when the platform names them") }),
|
|
293
297
|
write: true,
|
|
294
298
|
visibility: "core",
|
|
295
299
|
endpoints: ["POST /v1/ingest/cairn"]
|
|
@@ -406,7 +410,7 @@ var PLUNE_TOOLS = [
|
|
|
406
410
|
title: "Propose a test strategy",
|
|
407
411
|
description: "Propose a test strategy for a mission in ISTQB sections \u2014 objectives, scope in and out, approach, levels and techniques, risks, entry and exit criteria \u2014 for a person to accept.",
|
|
408
412
|
input: z2.strictObject({ missionId, content: strategyContent, dry_run: dryRun }),
|
|
409
|
-
output:
|
|
413
|
+
output: strategyOutput,
|
|
410
414
|
write: true,
|
|
411
415
|
visibility: "core",
|
|
412
416
|
endpoints: ["POST /v1/missions/:id/strategy"]
|
|
@@ -622,6 +626,17 @@ var fail = (code, message, extra = {}) => ({
|
|
|
622
626
|
ok: false,
|
|
623
627
|
error: { code, message, ...extra }
|
|
624
628
|
});
|
|
629
|
+
function detailLines(body) {
|
|
630
|
+
const b = asRecord(body);
|
|
631
|
+
const lines = [...asArray(b["findings"]), ...asArray(b["details"])].map((d) => {
|
|
632
|
+
if (typeof d === "string") return `- ${d}`;
|
|
633
|
+
const f = asRecord(d);
|
|
634
|
+
const where = [f["rule"], f["path"]].filter((x) => typeof x === "string").join(" at ");
|
|
635
|
+
const said = typeof f["message"] === "string" ? f["message"] : where === "" ? JSON.stringify(d) : "";
|
|
636
|
+
return `- ${[where, said].filter(Boolean).join(": ")}`;
|
|
637
|
+
});
|
|
638
|
+
return lines.length === 0 ? "" : "\n" + lines.join("\n");
|
|
639
|
+
}
|
|
625
640
|
function errorOf(err) {
|
|
626
641
|
if (err instanceof PluneApiError) {
|
|
627
642
|
if (err.status === 401)
|
|
@@ -629,7 +644,7 @@ function errorOf(err) {
|
|
|
629
644
|
if (err.status === 403 && err.message === READ_ONLY_REFUSAL)
|
|
630
645
|
return { status: 403, code: "read_only_token", message: `Plune refused (403): ${readScopeMessage("it cannot write")}` };
|
|
631
646
|
const code = err.code ?? `http_${err.status}`;
|
|
632
|
-
return { status: err.status, code, message: `Plune refused (${err.status} ${code}): ${err.message}`, details: err.body };
|
|
647
|
+
return { status: err.status, code, message: `Plune refused (${err.status} ${code}): ${err.message}${detailLines(err.body)}`, details: err.body };
|
|
633
648
|
}
|
|
634
649
|
if (err instanceof PluneNetworkError) return { code: "network", message: `${err.message}. Check PLUNE_API_URL and the network.` };
|
|
635
650
|
throw err;
|
|
@@ -702,13 +717,19 @@ function createPluneToolExecutor(opts) {
|
|
|
702
717
|
const str = (v) => v;
|
|
703
718
|
const handlers = {
|
|
704
719
|
async plune_project_context() {
|
|
705
|
-
const [projects, suites, cases, missions, queue] = await Promise.all([
|
|
720
|
+
const [projects, suites, cases, missions, queue, memory] = await Promise.all([
|
|
706
721
|
call({ method: "GET", path: "/v1/projects" }),
|
|
707
722
|
call({ method: "GET", path: "/v1/suites" }),
|
|
708
723
|
call({ method: "GET", path: "/v1/test-cases", query: { limit: "1", stability: "0" } }),
|
|
709
724
|
call({ method: "GET", path: "/v1/missions" }),
|
|
710
|
-
call({ method: "GET", path: "/v1/review-items", query: { state: "pending", limit: "100" } })
|
|
725
|
+
call({ method: "GET", path: "/v1/review-items", query: { state: "pending", limit: "100" } }),
|
|
726
|
+
// A platform that keeps no project memory yet answers 404: no rules, and the rest of the context still stands.
|
|
727
|
+
call({ method: "GET", path: "/v1/memory/rules", query: { state: "in_force" } }).catch((err) => {
|
|
728
|
+
if (err instanceof PluneApiError && err.status === 404) return { status: 404, body: { rules: [] } };
|
|
729
|
+
throw err;
|
|
730
|
+
})
|
|
711
731
|
]);
|
|
732
|
+
const memoryRules = asArray(asRecord(memory.body)["rules"]).map(asRecord).filter((r) => r["inForce"] === true && typeof r["id"] === "string" && typeof r["text"] === "string").map((r) => ({ id: str(r["id"]), text: str(r["text"]) }));
|
|
712
733
|
const projectList = asArray(asRecord(projects.body)["projects"]);
|
|
713
734
|
const only = projectList.length === 1 ? asRecord(projectList[0])["id"] : void 0;
|
|
714
735
|
const projectId2 = opts.projectId ?? (typeof only === "string" ? only : null);
|
|
@@ -719,7 +740,8 @@ function createPluneToolExecutor(opts) {
|
|
|
719
740
|
suites: asArray(asRecord(suites.body)["suites"]),
|
|
720
741
|
cases: { total: typeof total === "number" ? total : 0 },
|
|
721
742
|
missions: asArray(asRecord(missions.body)["missions"]),
|
|
722
|
-
reviewQueue: { pending: asArray(asRecord(queue.body)["items"]).length, more: cursorOf(asRecord(queue.body)["nextCursor"]) !== null }
|
|
743
|
+
reviewQueue: { pending: asArray(asRecord(queue.body)["items"]).length, more: cursorOf(asRecord(queue.body)["nextCursor"]) !== null },
|
|
744
|
+
memoryRules
|
|
723
745
|
};
|
|
724
746
|
},
|
|
725
747
|
async plune_get(i) {
|
|
@@ -747,6 +769,7 @@ function createPluneToolExecutor(opts) {
|
|
|
747
769
|
const query = withoutUndefined({
|
|
748
770
|
state: i["state"],
|
|
749
771
|
kind: kinds?.join(","),
|
|
772
|
+
missionId: i["missionId"],
|
|
750
773
|
limit: i["limit"] === void 0 ? void 0 : String(i["limit"]),
|
|
751
774
|
cursor: i["cursor"]
|
|
752
775
|
});
|
|
@@ -776,12 +799,17 @@ function createPluneToolExecutor(opts) {
|
|
|
776
799
|
const req = {
|
|
777
800
|
method: "POST",
|
|
778
801
|
path: "/v1/ingest/cairn",
|
|
779
|
-
body: {
|
|
802
|
+
body: {
|
|
803
|
+
schemaVersion: 1,
|
|
804
|
+
run: withoutUndefined({ runId: `mcp-${sessionId}-${proposals}`, mode: "design", target: str(i["target"]), missionId: i["missionId"] }),
|
|
805
|
+
cases
|
|
806
|
+
}
|
|
780
807
|
};
|
|
781
808
|
if (i["dry_run"] === true) return { dryRun: true, requested: cases.length, applied: 0, requests: [planned(req)] };
|
|
782
809
|
const summary = asRecord((await call(req)).body);
|
|
783
810
|
const proposed = summary["proposed"];
|
|
784
|
-
|
|
811
|
+
const ids = asArray(summary["itemIds"]).filter((x) => typeof x === "string");
|
|
812
|
+
return { dryRun: false, requested: cases.length, applied: typeof proposed === "number" ? proposed : 0, ...ids.length > 0 ? { itemIds: ids } : {}, report: summary };
|
|
785
813
|
},
|
|
786
814
|
async plune_cases_generate(i) {
|
|
787
815
|
const { dry_run, projectId: projectId2, ...body } = i;
|
|
@@ -833,6 +861,16 @@ function createPluneToolExecutor(opts) {
|
|
|
833
861
|
return { questions, nextCursor: cursorOf(body["nextCursor"]) };
|
|
834
862
|
},
|
|
835
863
|
async plune_strategy_propose(i) {
|
|
864
|
+
const req = { method: "POST", path: path("/v1/missions/:id/strategy", str(i["missionId"])), body: i["content"] };
|
|
865
|
+
if (i["dry_run"] === true) {
|
|
866
|
+
try {
|
|
867
|
+
const res = await call({ ...req, path: `${req.path}/check` });
|
|
868
|
+
return { dryRun: true, checked: true, findings: asArray(asRecord(res.body)["findings"]), request: planned(req) };
|
|
869
|
+
} catch (err) {
|
|
870
|
+
if (!(err instanceof PluneApiError && (err.status === 404 && err.code !== "mission_not_found" || err.status === 403 && err.message === READ_ONLY_REFUSAL))) throw err;
|
|
871
|
+
return { dryRun: true, checked: false, request: planned(req) };
|
|
872
|
+
}
|
|
873
|
+
}
|
|
836
874
|
return write({ method: "POST", path: path("/v1/missions/:id/strategy", str(i["missionId"])), body: i["content"] }, i["dry_run"]);
|
|
837
875
|
},
|
|
838
876
|
async plune_report_request(i) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plune-ai/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"description": "AI-powered assertion testing for LLM apps — write assertions, run them against any provider, get a pass/fail report (local, CI, or diff).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"files": [
|
|
44
44
|
"dist",
|
|
45
|
+
"skills",
|
|
45
46
|
"README.md",
|
|
46
47
|
"LICENSE",
|
|
47
48
|
"THIRD_PARTY_NOTICES"
|