@plune-ai/cli 0.33.0 → 0.34.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.
@@ -0,0 +1,894 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * The tool contract of Plune's agent surface (plune-ai/plune#1284, plune-ai/cli#146): names, task descriptions, input and
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.
7
+ *
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
10
+ * signature the no-duplicates check reads.
11
+ */
12
+ type ToolVisibility = 'core' | 'discoverable';
13
+ interface PluneToolDefinition {
14
+ readonly name: string;
15
+ readonly title: string;
16
+ readonly description: string;
17
+ readonly input: z.ZodObject;
18
+ readonly output: z.ZodObject;
19
+ /** Needs a token with the `write` scope; refused for a `read` token. */
20
+ readonly write: boolean;
21
+ readonly visibility: ToolVisibility;
22
+ readonly endpoints: readonly string[];
23
+ }
24
+ /** What a client sees before it asks for more (plune#1284 AC-01). */
25
+ declare const MAX_VISIBLE_TOOLS = 20;
26
+ declare const PLUNE_TOOLS: readonly [{
27
+ name: string;
28
+ title: string;
29
+ description: string;
30
+ input: z.ZodObject<{}, z.core.$strict>;
31
+ output: z.ZodObject<{
32
+ projectId: z.ZodNullable<z.ZodString>;
33
+ projects: z.ZodArray<z.ZodObject<{
34
+ id: z.ZodOptional<z.ZodString>;
35
+ }, z.core.$loose>>;
36
+ suites: z.ZodArray<z.ZodObject<{
37
+ id: z.ZodOptional<z.ZodString>;
38
+ }, z.core.$loose>>;
39
+ cases: z.ZodObject<{
40
+ total: z.ZodNumber;
41
+ }, z.core.$strip>;
42
+ missions: z.ZodArray<z.ZodObject<{
43
+ id: z.ZodOptional<z.ZodString>;
44
+ }, z.core.$loose>>;
45
+ reviewQueue: z.ZodObject<{
46
+ pending: z.ZodNumber;
47
+ more: z.ZodBoolean;
48
+ }, z.core.$strip>;
49
+ }, z.core.$strip>;
50
+ write: false;
51
+ visibility: "core";
52
+ endpoints: string[];
53
+ }, {
54
+ name: string;
55
+ title: string;
56
+ description: string;
57
+ input: z.ZodObject<{
58
+ kind: z.ZodEnum<{
59
+ "test-case": "test-case";
60
+ run: "run";
61
+ "review-item": "review-item";
62
+ }>;
63
+ id: z.ZodString;
64
+ }, z.core.$strict>;
65
+ output: z.ZodObject<{
66
+ kind: z.ZodString;
67
+ item: z.ZodObject<{
68
+ id: z.ZodOptional<z.ZodString>;
69
+ }, z.core.$loose>;
70
+ }, z.core.$strip>;
71
+ write: false;
72
+ visibility: "core";
73
+ endpoints: string[];
74
+ }, {
75
+ name: string;
76
+ title: string;
77
+ description: string;
78
+ input: z.ZodObject<{
79
+ limit: z.ZodOptional<z.ZodNumber>;
80
+ cursor: z.ZodOptional<z.ZodString>;
81
+ filters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
82
+ }, z.core.$strict>;
83
+ output: z.ZodObject<{
84
+ testCases: z.ZodArray<z.ZodObject<{
85
+ id: z.ZodOptional<z.ZodString>;
86
+ }, z.core.$loose>>;
87
+ total: z.ZodOptional<z.ZodNumber>;
88
+ matching: z.ZodOptional<z.ZodNumber>;
89
+ nextCursor: z.ZodNullable<z.ZodString>;
90
+ }, z.core.$strip>;
91
+ write: false;
92
+ visibility: "core";
93
+ endpoints: string[];
94
+ }, {
95
+ name: string;
96
+ title: string;
97
+ description: string;
98
+ input: z.ZodObject<{
99
+ limit: z.ZodOptional<z.ZodNumber>;
100
+ cursor: z.ZodOptional<z.ZodString>;
101
+ state: z.ZodOptional<z.ZodEnum<{
102
+ pending: "pending";
103
+ changes_requested: "changes_requested";
104
+ approved: "approved";
105
+ rejected: "rejected";
106
+ }>>;
107
+ kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
108
+ endpoint: "endpoint";
109
+ result: "result";
110
+ proposal: "proposal";
111
+ discovered: "discovered";
112
+ strategy: "strategy";
113
+ report: "report";
114
+ memory_rule: "memory_rule";
115
+ }>>>;
116
+ }, z.core.$strict>;
117
+ output: z.ZodObject<{
118
+ items: z.ZodArray<z.ZodObject<{
119
+ id: z.ZodOptional<z.ZodString>;
120
+ }, z.core.$loose>>;
121
+ nextCursor: z.ZodNullable<z.ZodString>;
122
+ }, z.core.$strip>;
123
+ write: false;
124
+ visibility: "core";
125
+ endpoints: string[];
126
+ }, {
127
+ name: string;
128
+ title: string;
129
+ description: string;
130
+ input: z.ZodObject<{
131
+ itemIds: z.ZodArray<z.ZodString>;
132
+ verdict: z.ZodEnum<{
133
+ approved: "approved";
134
+ rejected: "rejected";
135
+ }>;
136
+ rejectionCategory: z.ZodOptional<z.ZodEnum<{
137
+ duplicate: "duplicate";
138
+ incorrect: "incorrect";
139
+ "out-of-scope": "out-of-scope";
140
+ "low-value": "low-value";
141
+ "not-testable": "not-testable";
142
+ other: "other";
143
+ }>>;
144
+ note: z.ZodOptional<z.ZodString>;
145
+ confirm: z.ZodOptional<z.ZodString>;
146
+ }, z.core.$strict>;
147
+ output: z.ZodObject<{
148
+ requested: z.ZodNumber;
149
+ applied: z.ZodNumber;
150
+ preview: z.ZodOptional<z.ZodObject<{
151
+ total: z.ZodNumber;
152
+ confirm: z.ZodString;
153
+ expiresInSeconds: z.ZodNumber;
154
+ }, z.core.$loose>>;
155
+ report: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
156
+ }, z.core.$strip>;
157
+ write: true;
158
+ visibility: "core";
159
+ endpoints: string[];
160
+ }, {
161
+ name: string;
162
+ title: string;
163
+ description: string;
164
+ input: z.ZodObject<{
165
+ target: z.ZodString;
166
+ cases: z.ZodArray<z.ZodObject<{
167
+ title: z.ZodString;
168
+ steps: z.ZodArray<z.ZodString>;
169
+ expected: z.ZodString;
170
+ execution: z.ZodOptional<z.ZodEnum<{
171
+ manual: "manual";
172
+ auto: "auto";
173
+ }>>;
174
+ technique: z.ZodOptional<z.ZodString>;
175
+ priority: z.ZodOptional<z.ZodString>;
176
+ source: z.ZodOptional<z.ZodObject<{
177
+ kind: z.ZodEnum<{
178
+ url: "url";
179
+ requirement: "requirement";
180
+ "openapi-operation": "openapi-operation";
181
+ "pasted-text": "pasted-text";
182
+ }>;
183
+ value: z.ZodString;
184
+ }, z.core.$strict>>;
185
+ rationale: z.ZodOptional<z.ZodString>;
186
+ }, z.core.$strict>>;
187
+ dry_run: z.ZodOptional<z.ZodBoolean>;
188
+ }, z.core.$strict>;
189
+ output: z.ZodObject<{
190
+ dryRun: z.ZodBoolean;
191
+ requested: z.ZodNumber;
192
+ applied: z.ZodNumber;
193
+ requests: z.ZodOptional<z.ZodArray<z.ZodObject<{
194
+ method: z.ZodString;
195
+ path: z.ZodString;
196
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
197
+ body: z.ZodOptional<z.ZodUnknown>;
198
+ }, z.core.$strip>>>;
199
+ results: z.ZodOptional<z.ZodArray<z.ZodObject<{
200
+ ok: z.ZodBoolean;
201
+ status: z.ZodOptional<z.ZodNumber>;
202
+ id: z.ZodOptional<z.ZodString>;
203
+ error: z.ZodOptional<z.ZodString>;
204
+ code: z.ZodOptional<z.ZodString>;
205
+ }, z.core.$strip>>>;
206
+ report: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
207
+ }, z.core.$strip>;
208
+ write: true;
209
+ visibility: "core";
210
+ endpoints: string[];
211
+ }, {
212
+ name: string;
213
+ title: string;
214
+ description: string;
215
+ input: z.ZodObject<{
216
+ dry_run: z.ZodOptional<z.ZodBoolean>;
217
+ name: z.ZodString;
218
+ summary: z.ZodOptional<z.ZodString>;
219
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
220
+ state: z.ZodOptional<z.ZodEnum<{
221
+ draft: "draft";
222
+ active: "active";
223
+ done: "done";
224
+ }>>;
225
+ documentation: z.ZodOptional<z.ZodEnum<{
226
+ unknown: "unknown";
227
+ provided: "provided";
228
+ none: "none";
229
+ }>>;
230
+ }, z.core.$strict>;
231
+ output: z.ZodObject<{
232
+ dryRun: z.ZodBoolean;
233
+ request: z.ZodOptional<z.ZodObject<{
234
+ method: z.ZodString;
235
+ path: z.ZodString;
236
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
237
+ body: z.ZodOptional<z.ZodUnknown>;
238
+ }, z.core.$strip>>;
239
+ result: z.ZodOptional<z.ZodObject<{
240
+ id: z.ZodOptional<z.ZodString>;
241
+ }, z.core.$loose>>;
242
+ }, z.core.$strip>;
243
+ write: true;
244
+ visibility: "core";
245
+ endpoints: string[];
246
+ }, {
247
+ name: string;
248
+ title: string;
249
+ description: string;
250
+ input: z.ZodObject<{
251
+ missionId: z.ZodString;
252
+ }, z.core.$strict>;
253
+ output: z.ZodObject<{
254
+ mission: z.ZodObject<{
255
+ id: z.ZodOptional<z.ZodString>;
256
+ }, z.core.$loose>;
257
+ }, z.core.$strip>;
258
+ write: false;
259
+ visibility: "core";
260
+ endpoints: string[];
261
+ }, {
262
+ name: string;
263
+ title: string;
264
+ description: string;
265
+ input: z.ZodObject<{
266
+ missionId: z.ZodString;
267
+ name: z.ZodOptional<z.ZodString>;
268
+ summary: z.ZodOptional<z.ZodString>;
269
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
270
+ state: z.ZodOptional<z.ZodEnum<{
271
+ draft: "draft";
272
+ active: "active";
273
+ done: "done";
274
+ }>>;
275
+ documentation: z.ZodOptional<z.ZodEnum<{
276
+ unknown: "unknown";
277
+ provided: "provided";
278
+ none: "none";
279
+ }>>;
280
+ dry_run: z.ZodOptional<z.ZodBoolean>;
281
+ }, z.core.$strict>;
282
+ output: z.ZodObject<{
283
+ dryRun: z.ZodBoolean;
284
+ request: z.ZodOptional<z.ZodObject<{
285
+ method: z.ZodString;
286
+ path: z.ZodString;
287
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
288
+ body: z.ZodOptional<z.ZodUnknown>;
289
+ }, z.core.$strip>>;
290
+ result: z.ZodOptional<z.ZodObject<{
291
+ id: z.ZodOptional<z.ZodString>;
292
+ }, z.core.$loose>>;
293
+ }, z.core.$strip>;
294
+ write: true;
295
+ visibility: "core";
296
+ endpoints: string[];
297
+ }, {
298
+ name: string;
299
+ title: string;
300
+ description: string;
301
+ input: z.ZodObject<{
302
+ missionId: z.ZodString;
303
+ kind: z.ZodEnum<{
304
+ url: "url";
305
+ openapi: "openapi";
306
+ repo: "repo";
307
+ ticket: "ticket";
308
+ file: "file";
309
+ }>;
310
+ ref: z.ZodOptional<z.ZodString>;
311
+ name: z.ZodOptional<z.ZodString>;
312
+ text: z.ZodOptional<z.ZodString>;
313
+ title: z.ZodOptional<z.ZodString>;
314
+ version: z.ZodOptional<z.ZodString>;
315
+ dry_run: z.ZodOptional<z.ZodBoolean>;
316
+ }, z.core.$strict>;
317
+ output: z.ZodObject<{
318
+ dryRun: z.ZodBoolean;
319
+ request: z.ZodOptional<z.ZodObject<{
320
+ method: z.ZodString;
321
+ path: z.ZodString;
322
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
323
+ body: z.ZodOptional<z.ZodUnknown>;
324
+ }, z.core.$strip>>;
325
+ result: z.ZodOptional<z.ZodObject<{
326
+ id: z.ZodOptional<z.ZodString>;
327
+ }, z.core.$loose>>;
328
+ }, z.core.$strip>;
329
+ write: true;
330
+ visibility: "core";
331
+ endpoints: string[];
332
+ }, {
333
+ name: string;
334
+ title: string;
335
+ description: string;
336
+ input: z.ZodObject<{
337
+ template: z.ZodEnum<{
338
+ plain: "plain";
339
+ access: "access";
340
+ }>;
341
+ text: z.ZodString;
342
+ missionId: z.ZodOptional<z.ZodString>;
343
+ options: z.ZodOptional<z.ZodArray<z.ZodString>>;
344
+ access: z.ZodOptional<z.ZodArray<z.ZodEnum<{
345
+ openapi: "openapi";
346
+ repo: "repo";
347
+ staging: "staging";
348
+ har: "har";
349
+ }>>>;
350
+ dry_run: z.ZodOptional<z.ZodBoolean>;
351
+ }, z.core.$strict>;
352
+ output: z.ZodObject<{
353
+ dryRun: z.ZodBoolean;
354
+ request: z.ZodOptional<z.ZodObject<{
355
+ method: z.ZodString;
356
+ path: z.ZodString;
357
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
358
+ body: z.ZodOptional<z.ZodUnknown>;
359
+ }, z.core.$strip>>;
360
+ result: z.ZodOptional<z.ZodObject<{
361
+ id: z.ZodOptional<z.ZodString>;
362
+ }, z.core.$loose>>;
363
+ }, z.core.$strip>;
364
+ write: true;
365
+ visibility: "core";
366
+ endpoints: string[];
367
+ }, {
368
+ name: string;
369
+ title: string;
370
+ description: string;
371
+ input: z.ZodObject<{
372
+ limit: z.ZodOptional<z.ZodNumber>;
373
+ cursor: z.ZodOptional<z.ZodString>;
374
+ missionId: z.ZodOptional<z.ZodString>;
375
+ state: z.ZodOptional<z.ZodEnum<{
376
+ pending: "pending";
377
+ changes_requested: "changes_requested";
378
+ approved: "approved";
379
+ rejected: "rejected";
380
+ }>>;
381
+ }, z.core.$strict>;
382
+ output: z.ZodObject<{
383
+ questions: z.ZodArray<z.ZodObject<{
384
+ id: z.ZodOptional<z.ZodString>;
385
+ }, z.core.$loose>>;
386
+ nextCursor: z.ZodNullable<z.ZodString>;
387
+ }, z.core.$strip>;
388
+ write: false;
389
+ visibility: "core";
390
+ endpoints: string[];
391
+ }, {
392
+ name: string;
393
+ title: string;
394
+ description: string;
395
+ input: z.ZodObject<{
396
+ missionId: z.ZodString;
397
+ content: z.ZodObject<{
398
+ objectives: z.ZodArray<z.ZodObject<{
399
+ text: z.ZodString;
400
+ source: z.ZodOptional<z.ZodObject<{
401
+ kind: z.ZodEnum<{
402
+ url: "url";
403
+ "mission-source": "mission-source";
404
+ "doc-section": "doc-section";
405
+ screen: "screen";
406
+ endpoint: "endpoint";
407
+ requirement: "requirement";
408
+ }>;
409
+ ref: z.ZodString;
410
+ }, z.core.$strict>>;
411
+ assumption: z.ZodOptional<z.ZodLiteral<true>>;
412
+ waitingOn: z.ZodOptional<z.ZodString>;
413
+ }, z.core.$strict>>;
414
+ scope: z.ZodObject<{
415
+ in: z.ZodArray<z.ZodObject<{
416
+ text: z.ZodString;
417
+ source: z.ZodOptional<z.ZodObject<{
418
+ kind: z.ZodEnum<{
419
+ url: "url";
420
+ "mission-source": "mission-source";
421
+ "doc-section": "doc-section";
422
+ screen: "screen";
423
+ endpoint: "endpoint";
424
+ requirement: "requirement";
425
+ }>;
426
+ ref: z.ZodString;
427
+ }, z.core.$strict>>;
428
+ assumption: z.ZodOptional<z.ZodLiteral<true>>;
429
+ waitingOn: z.ZodOptional<z.ZodString>;
430
+ }, z.core.$strict>>;
431
+ out: z.ZodArray<z.ZodObject<{
432
+ text: z.ZodString;
433
+ source: z.ZodOptional<z.ZodObject<{
434
+ kind: z.ZodEnum<{
435
+ url: "url";
436
+ "mission-source": "mission-source";
437
+ "doc-section": "doc-section";
438
+ screen: "screen";
439
+ endpoint: "endpoint";
440
+ requirement: "requirement";
441
+ }>;
442
+ ref: z.ZodString;
443
+ }, z.core.$strict>>;
444
+ assumption: z.ZodOptional<z.ZodLiteral<true>>;
445
+ waitingOn: z.ZodOptional<z.ZodString>;
446
+ }, z.core.$strict>>;
447
+ }, z.core.$strict>;
448
+ approach: z.ZodArray<z.ZodObject<{
449
+ text: z.ZodString;
450
+ source: z.ZodOptional<z.ZodObject<{
451
+ kind: z.ZodEnum<{
452
+ url: "url";
453
+ "mission-source": "mission-source";
454
+ "doc-section": "doc-section";
455
+ screen: "screen";
456
+ endpoint: "endpoint";
457
+ requirement: "requirement";
458
+ }>;
459
+ ref: z.ZodString;
460
+ }, z.core.$strict>>;
461
+ assumption: z.ZodOptional<z.ZodLiteral<true>>;
462
+ waitingOn: z.ZodOptional<z.ZodString>;
463
+ }, z.core.$strict>>;
464
+ profile: z.ZodObject<{
465
+ levels: z.ZodArray<z.ZodEnum<{
466
+ component: "component";
467
+ "component-integration": "component-integration";
468
+ system: "system";
469
+ "system-integration": "system-integration";
470
+ acceptance: "acceptance";
471
+ }>>;
472
+ characteristics: z.ZodArray<z.ZodEnum<{
473
+ "functional-suitability": "functional-suitability";
474
+ "performance-efficiency": "performance-efficiency";
475
+ compatibility: "compatibility";
476
+ "interaction-capability": "interaction-capability";
477
+ reliability: "reliability";
478
+ security: "security";
479
+ maintainability: "maintainability";
480
+ flexibility: "flexibility";
481
+ safety: "safety";
482
+ }>>;
483
+ techniques: z.ZodArray<z.ZodEnum<{
484
+ "equivalence-partitioning": "equivalence-partitioning";
485
+ "boundary-value": "boundary-value";
486
+ "decision-table": "decision-table";
487
+ "state-transition": "state-transition";
488
+ statement: "statement";
489
+ branch: "branch";
490
+ "error-guessing": "error-guessing";
491
+ exploratory: "exploratory";
492
+ checklist: "checklist";
493
+ }>>;
494
+ split: z.ZodObject<{
495
+ api: z.ZodNumber;
496
+ ui: z.ZodNumber;
497
+ manual: z.ZodNumber;
498
+ }, z.core.$strict>;
499
+ notes: z.ZodArray<z.ZodObject<{
500
+ text: z.ZodString;
501
+ source: z.ZodOptional<z.ZodObject<{
502
+ kind: z.ZodEnum<{
503
+ url: "url";
504
+ "mission-source": "mission-source";
505
+ "doc-section": "doc-section";
506
+ screen: "screen";
507
+ endpoint: "endpoint";
508
+ requirement: "requirement";
509
+ }>;
510
+ ref: z.ZodString;
511
+ }, z.core.$strict>>;
512
+ assumption: z.ZodOptional<z.ZodLiteral<true>>;
513
+ waitingOn: z.ZodOptional<z.ZodString>;
514
+ }, z.core.$strict>>;
515
+ }, z.core.$strict>;
516
+ risks: z.ZodArray<z.ZodObject<{
517
+ likelihood: z.ZodEnum<{
518
+ low: "low";
519
+ medium: "medium";
520
+ high: "high";
521
+ }>;
522
+ impact: z.ZodEnum<{
523
+ low: "low";
524
+ medium: "medium";
525
+ high: "high";
526
+ }>;
527
+ caseIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
528
+ requirementIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
529
+ text: z.ZodString;
530
+ source: z.ZodOptional<z.ZodObject<{
531
+ kind: z.ZodEnum<{
532
+ url: "url";
533
+ "mission-source": "mission-source";
534
+ "doc-section": "doc-section";
535
+ screen: "screen";
536
+ endpoint: "endpoint";
537
+ requirement: "requirement";
538
+ }>;
539
+ ref: z.ZodString;
540
+ }, z.core.$strict>>;
541
+ assumption: z.ZodOptional<z.ZodLiteral<true>>;
542
+ waitingOn: z.ZodOptional<z.ZodString>;
543
+ }, z.core.$strict>>;
544
+ entryCriteria: z.ZodArray<z.ZodObject<{
545
+ text: z.ZodString;
546
+ source: z.ZodOptional<z.ZodObject<{
547
+ kind: z.ZodEnum<{
548
+ url: "url";
549
+ "mission-source": "mission-source";
550
+ "doc-section": "doc-section";
551
+ screen: "screen";
552
+ endpoint: "endpoint";
553
+ requirement: "requirement";
554
+ }>;
555
+ ref: z.ZodString;
556
+ }, z.core.$strict>>;
557
+ assumption: z.ZodOptional<z.ZodLiteral<true>>;
558
+ waitingOn: z.ZodOptional<z.ZodString>;
559
+ }, z.core.$strict>>;
560
+ exitCriteria: z.ZodArray<z.ZodObject<{
561
+ text: z.ZodString;
562
+ source: z.ZodOptional<z.ZodObject<{
563
+ kind: z.ZodEnum<{
564
+ url: "url";
565
+ "mission-source": "mission-source";
566
+ "doc-section": "doc-section";
567
+ screen: "screen";
568
+ endpoint: "endpoint";
569
+ requirement: "requirement";
570
+ }>;
571
+ ref: z.ZodString;
572
+ }, z.core.$strict>>;
573
+ assumption: z.ZodOptional<z.ZodLiteral<true>>;
574
+ waitingOn: z.ZodOptional<z.ZodString>;
575
+ }, z.core.$strict>>;
576
+ }, z.core.$strict>;
577
+ dry_run: z.ZodOptional<z.ZodBoolean>;
578
+ }, z.core.$strict>;
579
+ output: z.ZodObject<{
580
+ dryRun: z.ZodBoolean;
581
+ request: z.ZodOptional<z.ZodObject<{
582
+ method: z.ZodString;
583
+ path: z.ZodString;
584
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
585
+ body: z.ZodOptional<z.ZodUnknown>;
586
+ }, z.core.$strip>>;
587
+ result: z.ZodOptional<z.ZodObject<{
588
+ id: z.ZodOptional<z.ZodString>;
589
+ }, z.core.$loose>>;
590
+ }, z.core.$strip>;
591
+ write: true;
592
+ visibility: "core";
593
+ endpoints: string[];
594
+ }, {
595
+ name: string;
596
+ title: string;
597
+ description: string;
598
+ input: z.ZodObject<{
599
+ missionId: z.ZodString;
600
+ dry_run: z.ZodOptional<z.ZodBoolean>;
601
+ }, z.core.$strict>;
602
+ output: z.ZodObject<{
603
+ dryRun: z.ZodBoolean;
604
+ request: z.ZodOptional<z.ZodObject<{
605
+ method: z.ZodString;
606
+ path: z.ZodString;
607
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
608
+ body: z.ZodOptional<z.ZodUnknown>;
609
+ }, z.core.$strip>>;
610
+ result: z.ZodOptional<z.ZodObject<{
611
+ id: z.ZodOptional<z.ZodString>;
612
+ }, z.core.$loose>>;
613
+ }, z.core.$strip>;
614
+ write: true;
615
+ visibility: "core";
616
+ endpoints: string[];
617
+ }, {
618
+ name: string;
619
+ title: string;
620
+ description: string;
621
+ input: z.ZodObject<{
622
+ query: z.ZodOptional<z.ZodString>;
623
+ names: z.ZodOptional<z.ZodArray<z.ZodString>>;
624
+ }, z.core.$strict>;
625
+ output: z.ZodObject<{
626
+ revealed: z.ZodArray<z.ZodString>;
627
+ available: z.ZodArray<z.ZodObject<{
628
+ name: z.ZodString;
629
+ title: z.ZodString;
630
+ description: z.ZodString;
631
+ write: z.ZodBoolean;
632
+ }, z.core.$strip>>;
633
+ visible: z.ZodArray<z.ZodString>;
634
+ }, z.core.$strip>;
635
+ write: false;
636
+ visibility: "core";
637
+ endpoints: string[];
638
+ }, {
639
+ name: string;
640
+ title: string;
641
+ description: string;
642
+ input: z.ZodObject<{
643
+ cases: z.ZodArray<z.ZodObject<{
644
+ id: z.ZodString;
645
+ changes: z.ZodRecord<z.ZodString, z.ZodUnknown>;
646
+ }, z.core.$strict>>;
647
+ dry_run: z.ZodOptional<z.ZodBoolean>;
648
+ }, z.core.$strict>;
649
+ output: z.ZodObject<{
650
+ dryRun: z.ZodBoolean;
651
+ requested: z.ZodNumber;
652
+ applied: z.ZodNumber;
653
+ requests: z.ZodOptional<z.ZodArray<z.ZodObject<{
654
+ method: z.ZodString;
655
+ path: z.ZodString;
656
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
657
+ body: z.ZodOptional<z.ZodUnknown>;
658
+ }, z.core.$strip>>>;
659
+ results: z.ZodOptional<z.ZodArray<z.ZodObject<{
660
+ ok: z.ZodBoolean;
661
+ status: z.ZodOptional<z.ZodNumber>;
662
+ id: z.ZodOptional<z.ZodString>;
663
+ error: z.ZodOptional<z.ZodString>;
664
+ code: z.ZodOptional<z.ZodString>;
665
+ }, z.core.$strip>>>;
666
+ report: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
667
+ }, z.core.$strip>;
668
+ write: true;
669
+ visibility: "discoverable";
670
+ endpoints: string[];
671
+ }, {
672
+ name: string;
673
+ title: string;
674
+ description: string;
675
+ input: z.ZodObject<{
676
+ run: z.ZodRecord<z.ZodString, z.ZodUnknown>;
677
+ dry_run: z.ZodOptional<z.ZodBoolean>;
678
+ }, z.core.$strict>;
679
+ output: z.ZodObject<{
680
+ dryRun: z.ZodBoolean;
681
+ request: z.ZodOptional<z.ZodObject<{
682
+ method: z.ZodString;
683
+ path: z.ZodString;
684
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
685
+ body: z.ZodOptional<z.ZodUnknown>;
686
+ }, z.core.$strip>>;
687
+ result: z.ZodOptional<z.ZodObject<{
688
+ id: z.ZodOptional<z.ZodString>;
689
+ }, z.core.$loose>>;
690
+ }, z.core.$strip>;
691
+ write: true;
692
+ visibility: "discoverable";
693
+ endpoints: string[];
694
+ }, {
695
+ name: string;
696
+ title: string;
697
+ description: string;
698
+ input: z.ZodObject<{
699
+ runId: z.ZodString;
700
+ results: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
701
+ combination: z.ZodOptional<z.ZodNumber>;
702
+ configuration: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
703
+ dry_run: z.ZodOptional<z.ZodBoolean>;
704
+ }, z.core.$strict>;
705
+ output: z.ZodObject<{
706
+ dryRun: z.ZodBoolean;
707
+ requested: z.ZodNumber;
708
+ applied: z.ZodNumber;
709
+ requests: z.ZodOptional<z.ZodArray<z.ZodObject<{
710
+ method: z.ZodString;
711
+ path: z.ZodString;
712
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
713
+ body: z.ZodOptional<z.ZodUnknown>;
714
+ }, z.core.$strip>>>;
715
+ results: z.ZodOptional<z.ZodArray<z.ZodObject<{
716
+ ok: z.ZodBoolean;
717
+ status: z.ZodOptional<z.ZodNumber>;
718
+ id: z.ZodOptional<z.ZodString>;
719
+ error: z.ZodOptional<z.ZodString>;
720
+ code: z.ZodOptional<z.ZodString>;
721
+ }, z.core.$strip>>>;
722
+ report: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
723
+ }, z.core.$strip>;
724
+ write: true;
725
+ visibility: "discoverable";
726
+ endpoints: string[];
727
+ }, {
728
+ name: string;
729
+ title: string;
730
+ description: string;
731
+ input: z.ZodObject<{
732
+ endpoints: z.ZodArray<z.ZodObject<{
733
+ method: z.ZodEnum<{
734
+ GET: "GET";
735
+ PUT: "PUT";
736
+ POST: "POST";
737
+ DELETE: "DELETE";
738
+ OPTIONS: "OPTIONS";
739
+ HEAD: "HEAD";
740
+ PATCH: "PATCH";
741
+ TRACE: "TRACE";
742
+ }>;
743
+ path: z.ZodString;
744
+ source: z.ZodEnum<{
745
+ spec: "spec";
746
+ code: "code";
747
+ traffic: "traffic";
748
+ }>;
749
+ trust: z.ZodOptional<z.ZodEnum<{
750
+ confirmed: "confirmed";
751
+ derived: "derived";
752
+ }>>;
753
+ summary: z.ZodOptional<z.ZodString>;
754
+ auth: z.ZodOptional<z.ZodArray<z.ZodString>>;
755
+ environment: z.ZodOptional<z.ZodString>;
756
+ seenAt: z.ZodOptional<z.ZodString>;
757
+ }, z.core.$strict>>;
758
+ dry_run: z.ZodOptional<z.ZodBoolean>;
759
+ }, z.core.$strict>;
760
+ output: z.ZodObject<{
761
+ dryRun: z.ZodBoolean;
762
+ requested: z.ZodNumber;
763
+ applied: z.ZodNumber;
764
+ requests: z.ZodOptional<z.ZodArray<z.ZodObject<{
765
+ method: z.ZodString;
766
+ path: z.ZodString;
767
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
768
+ body: z.ZodOptional<z.ZodUnknown>;
769
+ }, z.core.$strip>>>;
770
+ results: z.ZodOptional<z.ZodArray<z.ZodObject<{
771
+ ok: z.ZodBoolean;
772
+ status: z.ZodOptional<z.ZodNumber>;
773
+ id: z.ZodOptional<z.ZodString>;
774
+ error: z.ZodOptional<z.ZodString>;
775
+ code: z.ZodOptional<z.ZodString>;
776
+ }, z.core.$strip>>>;
777
+ report: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
778
+ }, z.core.$strip>;
779
+ write: true;
780
+ visibility: "discoverable";
781
+ endpoints: string[];
782
+ }, {
783
+ name: string;
784
+ title: string;
785
+ description: string;
786
+ input: z.ZodObject<{
787
+ method: z.ZodEnum<{
788
+ GET: "GET";
789
+ PUT: "PUT";
790
+ POST: "POST";
791
+ DELETE: "DELETE";
792
+ PATCH: "PATCH";
793
+ }>;
794
+ path: z.ZodString;
795
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
796
+ body: z.ZodOptional<z.ZodUnknown>;
797
+ confirm: z.ZodOptional<z.ZodString>;
798
+ dry_run: z.ZodOptional<z.ZodBoolean>;
799
+ }, z.core.$strict>;
800
+ output: z.ZodObject<{
801
+ status: z.ZodOptional<z.ZodNumber>;
802
+ body: z.ZodOptional<z.ZodUnknown>;
803
+ dryRun: z.ZodOptional<z.ZodBoolean>;
804
+ request: z.ZodOptional<z.ZodObject<{
805
+ method: z.ZodString;
806
+ path: z.ZodString;
807
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
808
+ body: z.ZodOptional<z.ZodUnknown>;
809
+ }, z.core.$strip>>;
810
+ preview: z.ZodOptional<z.ZodObject<{
811
+ method: z.ZodString;
812
+ path: z.ZodString;
813
+ confirm: z.ZodString;
814
+ expiresInSeconds: z.ZodNumber;
815
+ }, z.core.$loose>>;
816
+ }, z.core.$strip>;
817
+ write: true;
818
+ visibility: "discoverable";
819
+ endpoints: string[];
820
+ }];
821
+ type PluneToolName = (typeof PLUNE_TOOLS)[number]['name'];
822
+ declare const PLUNE_TOOL_NAMES: readonly PluneToolName[];
823
+ /** The definition of one tool; throws on a name the contract does not have. */
824
+ declare function pluneTool(name: string): PluneToolDefinition;
825
+ declare function isPluneToolName(name: string): name is PluneToolName;
826
+ /** The tools a client is shown before it asks for more; without the writers for a `read` token. */
827
+ declare function defaultVisibleTools(scope?: 'read' | 'write'): PluneToolName[];
828
+
829
+ /**
830
+ * Runs a tool of the contract against the platform's HTTP API. Transport-free: the MCP server wraps it, and so can the
831
+ * platform's built-in agent. One executor is one agent session — one `X-Plune-Session`, one set of revealed tools, one
832
+ * set of issued confirm values.
833
+ */
834
+ type TokenScope = 'read' | 'write';
835
+ interface ToolError {
836
+ status?: number;
837
+ code: string;
838
+ message: string;
839
+ details?: unknown;
840
+ }
841
+ type ToolOutcome = {
842
+ ok: true;
843
+ data: Record<string, unknown>;
844
+ } | {
845
+ ok: false;
846
+ error: ToolError;
847
+ };
848
+ interface PluneToolExecutorOptions {
849
+ token: string;
850
+ apiUrl: string;
851
+ projectId?: string | undefined;
852
+ /** Defaults to a fresh UUID: one session per executor. */
853
+ sessionId?: string | undefined;
854
+ /** The token's scope when it is known. `read` refuses every write before a request is made. */
855
+ scope?: TokenScope | undefined;
856
+ fetchImpl?: typeof fetch | undefined;
857
+ userAgent?: string | undefined;
858
+ now?: (() => number) | undefined;
859
+ }
860
+ interface PluneToolExecutor {
861
+ readonly sessionId: string;
862
+ /** The token's scope as known now: given, or learned from the platform's 403. */
863
+ scope(): TokenScope | undefined;
864
+ /** The tools a client should be shown now. */
865
+ visibleTools(): PluneToolName[];
866
+ execute(name: string, input: unknown): Promise<ToolOutcome>;
867
+ }
868
+ /** How long a confirm value of the escape hatch lives — the platform's own five minutes (#1280). */
869
+ declare const CONFIRM_TTL_MS: number;
870
+ declare function createPluneToolExecutor(opts: PluneToolExecutorOptions): PluneToolExecutor;
871
+
872
+ /** The platform answered, with a status outside 2xx. */
873
+ declare class PluneApiError extends Error {
874
+ readonly status: number;
875
+ readonly body: unknown;
876
+ constructor(status: number, body: unknown);
877
+ get code(): string | undefined;
878
+ }
879
+ /** The platform could not be reached at all. */
880
+ declare class PluneNetworkError extends Error {
881
+ readonly apiUrl: string;
882
+ constructor(apiUrl: string);
883
+ }
884
+
885
+ /**
886
+ * Input shapes of the tools, mirrored from the platform's contracts (`plune-ai/plune` `src/contracts/mission.ts`,
887
+ * `mission-strategy.ts`, `review-item.ts`, `cairn-ingest.ts`, `api-endpoint.ts`). Mirrored, not imported: the platform
888
+ * depends on this package, not the other way round. The platform validates every body again, so a drift here shows up
889
+ * as its 400 with the field named — never as a write the caller did not mean.
890
+ */
891
+ /** Objects one call takes (plune#1284 AC-03). */
892
+ declare const BATCH_MAX = 100;
893
+
894
+ 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 };