@plune-ai/cli 0.37.0 → 0.39.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.
@@ -258,7 +258,7 @@ var PLUNE_TOOLS = [
258
258
  define({
259
259
  name: "plune_get",
260
260
  title: "Read one object",
261
- description: "Read one test case, run or review queue entry in full when you already hold its id \u2014 steps, state, history fields and everything the platform keeps on it.",
261
+ description: "Read one test case, run or review queue entry in full when you already hold its id \u2014 steps, state, history fields and everything the platform keeps on it. Writing results or proposing cases needs no read first; an edit that replaces a list or a text (tags, steps, a mission summary) needs the current value read first.",
262
262
  input: import_zod2.z.strictObject({ kind: import_zod2.z.enum(["test-case", "run", "review-item"]), id: id("Its id") }),
263
263
  output: import_zod2.z.object({ kind: import_zod2.z.string(), item: entity }),
264
264
  write: false,
@@ -268,9 +268,9 @@ var PLUNE_TOOLS = [
268
268
  define({
269
269
  name: "plune_cases_search",
270
270
  title: "Find test cases",
271
- description: "Find test cases of the project by filter \u2014 suite, state, tag, priority, text and the other filters of the case list \u2014 one page at a time, with the total and how many match.",
271
+ 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.",
272
272
  input: import_zod2.z.strictObject({
273
- 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: a list is OR inside one key, keys are AND-ed (e.g. {"suiteId": "s1", "tag": ["smoke"]})'),
273
+ 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"]})'),
274
274
  ...listPage
275
275
  }),
276
276
  output: import_zod2.z.object({
@@ -357,7 +357,7 @@ var PLUNE_TOOLS = [
357
357
  define({
358
358
  name: "plune_mission_create",
359
359
  title: "Create a mission",
360
- description: "Create a testing mission for a product: its name, a short description of what the product is, where it runs, and whether documentation exists. It starts as a draft you fill in.",
360
+ description: "Create a testing mission for a product the user has named: its name, a short description of what the product is, where it runs, and whether documentation exists. It starts as a draft. Do not guess a mission from an unclear request, not even as a placeholder draft: when the user has not said which product, ask with plune_question_ask first.",
361
361
  input: import_zod2.z.strictObject({ ...missionFields, dry_run: dryRun }),
362
362
  output: writeOutput,
363
363
  write: true,
@@ -420,7 +420,7 @@ var PLUNE_TOOLS = [
420
420
  define({
421
421
  name: "plune_question_ask",
422
422
  title: "Ask a person",
423
- description: "Ask a person what you do not know instead of guessing: a plain question with up to three options, or a request for access to an API description, the code, staging or a HAR file.",
423
+ description: "Ask a person what you do not know instead of guessing. When the request leaves the target or scope unclear (which product, which cases), call this first, before any write, rather than only asking in your reply: it needs no mission, waits in the review queue, and its answer is read with plune_question_list. A plain question takes up to three options; an access question asks for an API description, the code, staging or a HAR file.",
424
424
  input: questionInput.superRefine((b, ctx) => {
425
425
  if (b.template === "plain" && b.access !== void 0) ctx.addIssue({ code: "custom", message: "access belongs to an access question" });
426
426
  if (b.template === "access" && b.options !== void 0) ctx.addIssue({ code: "custom", message: "options belong to a plain question" });
@@ -464,9 +464,9 @@ var PLUNE_TOOLS = [
464
464
  define({
465
465
  name: "plune_discover_tools",
466
466
  title: "Find more tools",
467
- description: "Look for a capability that is not in your tool list \u2014 editing cases, writing results, starting runs, cataloguing API endpoints, a raw API call \u2014 and switch the ones you need on for this session.",
467
+ description: "Look for a capability that is not in your tool list \u2014 editing cases (plune_cases_update), writing results into a run (plune_results_write), starting runs (plune_run_create), cataloguing API endpoints (plune_endpoint_propose), a raw API call (plune_api_request) \u2014 and switch the ones you need on for this session by name, in one call. A tool switched on can be called from the next step, and its description in this answer says what it needs. Writing results needs no read of the run first; editing a case replaces its title, tags and steps whole, so read the case before changing them.",
468
468
  input: import_zod2.z.strictObject({
469
- query: import_zod2.z.string().trim().min(1).max(200).optional().describe('Words of the task, e.g. "write results"'),
469
+ query: import_zod2.z.string().trim().min(1).max(200).optional().describe('Two or three words of the task, e.g. "write results": a tool is listed only when every word is in its name, title or description'),
470
470
  names: import_zod2.z.array(import_zod2.z.string().min(1)).min(1).max(MAX_VISIBLE_TOOLS).optional().describe("Tools to switch on")
471
471
  }),
472
472
  output: import_zod2.z.object({
@@ -512,10 +512,10 @@ var PLUNE_TOOLS = [
512
512
  define({
513
513
  name: "plune_results_write",
514
514
  title: "Write results into a run",
515
- description: "Record up to 100 test results into an open run in one request \u2014 passed, failed, skipped, with their keys and evidence \u2014 and learn how many the platform accepted.",
515
+ description: "Record up to 100 test results into an open run in one request \u2014 passed, failed, skipped, with their keys and evidence \u2014 and learn how many the platform accepted. The run id is enough: the run need not be read first. Each result names its case by testCaseId, found with plune_cases_search; when no case matches a name, ask the person instead of searching on.",
516
516
  input: import_zod2.z.strictObject({
517
517
  runId: id("The run id"),
518
- results: import_zod2.z.array(import_zod2.z.record(import_zod2.z.string(), import_zod2.z.unknown())).min(1).max(BATCH_MAX).describe("Results as POST /v1/runs/:id/results takes them"),
518
+ results: import_zod2.z.array(import_zod2.z.record(import_zod2.z.string(), import_zod2.z.unknown())).min(1).max(BATCH_MAX).describe("Results as POST /v1/runs/:id/results takes them: each with testCaseId, a resultKey of your own and a status"),
519
519
  combination: import_zod2.z.number().int().min(0).optional(),
520
520
  configuration: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.string()).optional(),
521
521
  dry_run: dryRun
@@ -632,7 +632,7 @@ function createPluneApi(opts) {
632
632
  method: req.method,
633
633
  headers: req.body === void 0 ? headers : { ...headers, "content-type": "application/json" },
634
634
  ...req.body === void 0 ? {} : { body: JSON.stringify(req.body) },
635
- // Host pinning (#1283): a redirect elsewhere would carry the token there.
635
+ // Host pinning: a redirect elsewhere would carry the token there.
636
636
  redirect: "manual"
637
637
  });
638
638
  } catch {
@@ -1,12 +1,12 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  /**
4
- * The tool contract of Plune's agent surface (plune-ai/plune#1284, plune-ai/cli#146): names, task descriptions, input and
4
+ * The tool contract of Plune's agent surface (plune-ai/cli#146): names, task descriptions, input and
5
5
  * output schemas, and which tools write. The MCP server (`plune mcp serve`) registers exactly these, and the platform's
6
- * built-in agent (plune-ai/plune#2202) imports them from `@plune-ai/cli/mcp-tools`, so the two paths cannot drift apart.
6
+ * built-in agent imports them from `@plune-ai/cli/mcp-tools`, so the two paths cannot drift apart.
7
7
  *
8
8
  * `visibility`: `core` tools are listed to a client from the start; `discoverable` ones only after `plune_discover_tools`
9
- * names them (Qase's 17-of-41 rule, plune#1284 AC-01/AC-02). `endpoints` is what the tool calls on the platform, the
9
+ * names them (Qase's 17-of-41 rule). `endpoints` is what the tool calls on the platform, the
10
10
  * signature the no-duplicates check reads.
11
11
  */
12
12
  type ToolVisibility = 'core' | 'discoverable';
@@ -21,7 +21,7 @@ interface PluneToolDefinition {
21
21
  readonly visibility: ToolVisibility;
22
22
  readonly endpoints: readonly string[];
23
23
  }
24
- /** What a client sees before it asks for more (plune#1284 AC-01). */
24
+ /** What a client sees before it asks for more. */
25
25
  declare const MAX_VISIBLE_TOOLS = 20;
26
26
  declare const PLUNE_TOOLS: readonly [{
27
27
  name: string;
@@ -927,7 +927,7 @@ interface PluneToolExecutor {
927
927
  visibleTools(): PluneToolName[];
928
928
  execute(name: string, input: unknown): Promise<ToolOutcome>;
929
929
  }
930
- /** How long a confirm value of the escape hatch lives — the platform's own five minutes (#1280). */
930
+ /** How long a confirm value of the escape hatch lives — the platform's own five minutes. */
931
931
  declare const CONFIRM_TTL_MS: number;
932
932
  declare function createPluneToolExecutor(opts: PluneToolExecutorOptions): PluneToolExecutor;
933
933
 
@@ -945,12 +945,12 @@ declare class PluneNetworkError extends Error {
945
945
  }
946
946
 
947
947
  /**
948
- * Input shapes of the tools, mirrored from the platform's contracts (`plune-ai/plune` `src/contracts/mission.ts`,
948
+ * Input shapes of the tools, mirrored from the platform's contracts (`src/contracts/mission.ts`,
949
949
  * `mission-strategy.ts`, `review-item.ts`, `cairn-ingest.ts`, `api-endpoint.ts`). Mirrored, not imported: the platform
950
950
  * depends on this package, not the other way round. The platform validates every body again, so a drift here shows up
951
951
  * as its 400 with the field named — never as a write the caller did not mean.
952
952
  */
953
- /** Objects one call takes (plune#1284 AC-03). */
953
+ /** Objects one call takes. */
954
954
  declare const BATCH_MAX = 100;
955
955
 
956
956
  export { BATCH_MAX, CONFIRM_TTL_MS, MAX_VISIBLE_TOOLS, PLUNE_TOOLS, PLUNE_TOOL_NAMES, PluneApiError, PluneNetworkError, type PluneToolDefinition, type PluneToolExecutor, type PluneToolExecutorOptions, type PluneToolName, type TokenScope, type ToolError, type ToolOutcome, type ToolVisibility, createPluneToolExecutor, defaultVisibleTools, isPluneToolName, pluneTool };
@@ -1,12 +1,12 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  /**
4
- * The tool contract of Plune's agent surface (plune-ai/plune#1284, plune-ai/cli#146): names, task descriptions, input and
4
+ * The tool contract of Plune's agent surface (plune-ai/cli#146): names, task descriptions, input and
5
5
  * output schemas, and which tools write. The MCP server (`plune mcp serve`) registers exactly these, and the platform's
6
- * built-in agent (plune-ai/plune#2202) imports them from `@plune-ai/cli/mcp-tools`, so the two paths cannot drift apart.
6
+ * built-in agent imports them from `@plune-ai/cli/mcp-tools`, so the two paths cannot drift apart.
7
7
  *
8
8
  * `visibility`: `core` tools are listed to a client from the start; `discoverable` ones only after `plune_discover_tools`
9
- * names them (Qase's 17-of-41 rule, plune#1284 AC-01/AC-02). `endpoints` is what the tool calls on the platform, the
9
+ * names them (Qase's 17-of-41 rule). `endpoints` is what the tool calls on the platform, the
10
10
  * signature the no-duplicates check reads.
11
11
  */
12
12
  type ToolVisibility = 'core' | 'discoverable';
@@ -21,7 +21,7 @@ interface PluneToolDefinition {
21
21
  readonly visibility: ToolVisibility;
22
22
  readonly endpoints: readonly string[];
23
23
  }
24
- /** What a client sees before it asks for more (plune#1284 AC-01). */
24
+ /** What a client sees before it asks for more. */
25
25
  declare const MAX_VISIBLE_TOOLS = 20;
26
26
  declare const PLUNE_TOOLS: readonly [{
27
27
  name: string;
@@ -927,7 +927,7 @@ interface PluneToolExecutor {
927
927
  visibleTools(): PluneToolName[];
928
928
  execute(name: string, input: unknown): Promise<ToolOutcome>;
929
929
  }
930
- /** How long a confirm value of the escape hatch lives — the platform's own five minutes (#1280). */
930
+ /** How long a confirm value of the escape hatch lives — the platform's own five minutes. */
931
931
  declare const CONFIRM_TTL_MS: number;
932
932
  declare function createPluneToolExecutor(opts: PluneToolExecutorOptions): PluneToolExecutor;
933
933
 
@@ -945,12 +945,12 @@ declare class PluneNetworkError extends Error {
945
945
  }
946
946
 
947
947
  /**
948
- * Input shapes of the tools, mirrored from the platform's contracts (`plune-ai/plune` `src/contracts/mission.ts`,
948
+ * Input shapes of the tools, mirrored from the platform's contracts (`src/contracts/mission.ts`,
949
949
  * `mission-strategy.ts`, `review-item.ts`, `cairn-ingest.ts`, `api-endpoint.ts`). Mirrored, not imported: the platform
950
950
  * depends on this package, not the other way round. The platform validates every body again, so a drift here shows up
951
951
  * as its 400 with the field named — never as a write the caller did not mean.
952
952
  */
953
- /** Objects one call takes (plune#1284 AC-03). */
953
+ /** Objects one call takes. */
954
954
  declare const BATCH_MAX = 100;
955
955
 
956
956
  export { BATCH_MAX, CONFIRM_TTL_MS, MAX_VISIBLE_TOOLS, PLUNE_TOOLS, PLUNE_TOOL_NAMES, PluneApiError, PluneNetworkError, type PluneToolDefinition, type PluneToolExecutor, type PluneToolExecutorOptions, type PluneToolName, type TokenScope, type ToolError, type ToolOutcome, type ToolVisibility, createPluneToolExecutor, defaultVisibleTools, isPluneToolName, pluneTool };
package/dist/mcp-tools.js CHANGED
@@ -222,7 +222,7 @@ var PLUNE_TOOLS = [
222
222
  define({
223
223
  name: "plune_get",
224
224
  title: "Read one object",
225
- description: "Read one test case, run or review queue entry in full when you already hold its id \u2014 steps, state, history fields and everything the platform keeps on it.",
225
+ description: "Read one test case, run or review queue entry in full when you already hold its id \u2014 steps, state, history fields and everything the platform keeps on it. Writing results or proposing cases needs no read first; an edit that replaces a list or a text (tags, steps, a mission summary) needs the current value read first.",
226
226
  input: z2.strictObject({ kind: z2.enum(["test-case", "run", "review-item"]), id: id("Its id") }),
227
227
  output: z2.object({ kind: z2.string(), item: entity }),
228
228
  write: false,
@@ -232,9 +232,9 @@ var PLUNE_TOOLS = [
232
232
  define({
233
233
  name: "plune_cases_search",
234
234
  title: "Find test cases",
235
- description: "Find test cases of the project by filter \u2014 suite, state, tag, priority, text and the other filters of the case list \u2014 one page at a time, with the total and how many match.",
235
+ 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.",
236
236
  input: z2.strictObject({
237
- filters: z2.record(z2.string(), z2.union([z2.string(), z2.array(z2.string())])).optional().describe('Query filters of GET /v1/test-cases: a list is OR inside one key, keys are AND-ed (e.g. {"suiteId": "s1", "tag": ["smoke"]})'),
237
+ filters: z2.record(z2.string(), z2.union([z2.string(), z2.array(z2.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"]})'),
238
238
  ...listPage
239
239
  }),
240
240
  output: z2.object({
@@ -321,7 +321,7 @@ var PLUNE_TOOLS = [
321
321
  define({
322
322
  name: "plune_mission_create",
323
323
  title: "Create a mission",
324
- description: "Create a testing mission for a product: its name, a short description of what the product is, where it runs, and whether documentation exists. It starts as a draft you fill in.",
324
+ description: "Create a testing mission for a product the user has named: its name, a short description of what the product is, where it runs, and whether documentation exists. It starts as a draft. Do not guess a mission from an unclear request, not even as a placeholder draft: when the user has not said which product, ask with plune_question_ask first.",
325
325
  input: z2.strictObject({ ...missionFields, dry_run: dryRun }),
326
326
  output: writeOutput,
327
327
  write: true,
@@ -384,7 +384,7 @@ var PLUNE_TOOLS = [
384
384
  define({
385
385
  name: "plune_question_ask",
386
386
  title: "Ask a person",
387
- description: "Ask a person what you do not know instead of guessing: a plain question with up to three options, or a request for access to an API description, the code, staging or a HAR file.",
387
+ description: "Ask a person what you do not know instead of guessing. When the request leaves the target or scope unclear (which product, which cases), call this first, before any write, rather than only asking in your reply: it needs no mission, waits in the review queue, and its answer is read with plune_question_list. A plain question takes up to three options; an access question asks for an API description, the code, staging or a HAR file.",
388
388
  input: questionInput.superRefine((b, ctx) => {
389
389
  if (b.template === "plain" && b.access !== void 0) ctx.addIssue({ code: "custom", message: "access belongs to an access question" });
390
390
  if (b.template === "access" && b.options !== void 0) ctx.addIssue({ code: "custom", message: "options belong to a plain question" });
@@ -428,9 +428,9 @@ var PLUNE_TOOLS = [
428
428
  define({
429
429
  name: "plune_discover_tools",
430
430
  title: "Find more tools",
431
- description: "Look for a capability that is not in your tool list \u2014 editing cases, writing results, starting runs, cataloguing API endpoints, a raw API call \u2014 and switch the ones you need on for this session.",
431
+ description: "Look for a capability that is not in your tool list \u2014 editing cases (plune_cases_update), writing results into a run (plune_results_write), starting runs (plune_run_create), cataloguing API endpoints (plune_endpoint_propose), a raw API call (plune_api_request) \u2014 and switch the ones you need on for this session by name, in one call. A tool switched on can be called from the next step, and its description in this answer says what it needs. Writing results needs no read of the run first; editing a case replaces its title, tags and steps whole, so read the case before changing them.",
432
432
  input: z2.strictObject({
433
- query: z2.string().trim().min(1).max(200).optional().describe('Words of the task, e.g. "write results"'),
433
+ query: z2.string().trim().min(1).max(200).optional().describe('Two or three words of the task, e.g. "write results": a tool is listed only when every word is in its name, title or description'),
434
434
  names: z2.array(z2.string().min(1)).min(1).max(MAX_VISIBLE_TOOLS).optional().describe("Tools to switch on")
435
435
  }),
436
436
  output: z2.object({
@@ -476,10 +476,10 @@ var PLUNE_TOOLS = [
476
476
  define({
477
477
  name: "plune_results_write",
478
478
  title: "Write results into a run",
479
- description: "Record up to 100 test results into an open run in one request \u2014 passed, failed, skipped, with their keys and evidence \u2014 and learn how many the platform accepted.",
479
+ description: "Record up to 100 test results into an open run in one request \u2014 passed, failed, skipped, with their keys and evidence \u2014 and learn how many the platform accepted. The run id is enough: the run need not be read first. Each result names its case by testCaseId, found with plune_cases_search; when no case matches a name, ask the person instead of searching on.",
480
480
  input: z2.strictObject({
481
481
  runId: id("The run id"),
482
- results: z2.array(z2.record(z2.string(), z2.unknown())).min(1).max(BATCH_MAX).describe("Results as POST /v1/runs/:id/results takes them"),
482
+ results: z2.array(z2.record(z2.string(), z2.unknown())).min(1).max(BATCH_MAX).describe("Results as POST /v1/runs/:id/results takes them: each with testCaseId, a resultKey of your own and a status"),
483
483
  combination: z2.number().int().min(0).optional(),
484
484
  configuration: z2.record(z2.string(), z2.string()).optional(),
485
485
  dry_run: dryRun
@@ -596,7 +596,7 @@ function createPluneApi(opts) {
596
596
  method: req.method,
597
597
  headers: req.body === void 0 ? headers : { ...headers, "content-type": "application/json" },
598
598
  ...req.body === void 0 ? {} : { body: JSON.stringify(req.body) },
599
- // Host pinning (#1283): a redirect elsewhere would carry the token there.
599
+ // Host pinning: a redirect elsewhere would carry the token there.
600
600
  redirect: "manual"
601
601
  });
602
602
  } catch {