invar-tools 1.15.1__py3-none-any.whl → 1.15.3__py3-none-any.whl
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.
- invar/templates/pi-tools/invar/index.ts +102 -24
- {invar_tools-1.15.1.dist-info → invar_tools-1.15.3.dist-info}/METADATA +1 -1
- {invar_tools-1.15.1.dist-info → invar_tools-1.15.3.dist-info}/RECORD +8 -8
- {invar_tools-1.15.1.dist-info → invar_tools-1.15.3.dist-info}/WHEEL +0 -0
- {invar_tools-1.15.1.dist-info → invar_tools-1.15.3.dist-info}/entry_points.txt +0 -0
- {invar_tools-1.15.1.dist-info → invar_tools-1.15.3.dist-info}/licenses/LICENSE +0 -0
- {invar_tools-1.15.1.dist-info → invar_tools-1.15.3.dist-info}/licenses/LICENSE-GPL +0 -0
- {invar_tools-1.15.1.dist-info → invar_tools-1.15.3.dist-info}/licenses/NOTICE +0 -0
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import { Type } from "@sinclair/typebox";
|
|
9
9
|
import type { CustomToolFactory } from "@mariozechner/pi-coding-agent";
|
|
10
|
+
import * as fs from "fs";
|
|
11
|
+
import * as path from "path";
|
|
10
12
|
|
|
11
13
|
const factory: CustomToolFactory = (pi) => {
|
|
12
14
|
// Helper to resolve invar command (with uvx fallback)
|
|
@@ -67,18 +69,24 @@ const factory: CustomToolFactory = (pi) => {
|
|
|
67
69
|
const cmd = await resolveInvarCommand();
|
|
68
70
|
const args = [...cmd.args, "guard"];
|
|
69
71
|
|
|
72
|
+
// Handle optional parameters with defaults
|
|
73
|
+
const changed = params.changed ?? true;
|
|
74
|
+
const contractsOnly = params.contracts_only ?? false;
|
|
75
|
+
const coverage = params.coverage ?? false;
|
|
76
|
+
const strict = params.strict ?? false;
|
|
77
|
+
|
|
70
78
|
// Default is --changed (check modified files)
|
|
71
|
-
if (
|
|
79
|
+
if (changed === false) {
|
|
72
80
|
args.push("--all");
|
|
73
81
|
}
|
|
74
82
|
|
|
75
|
-
if (
|
|
83
|
+
if (contractsOnly) {
|
|
76
84
|
args.push("-c");
|
|
77
85
|
}
|
|
78
|
-
if (
|
|
86
|
+
if (coverage) {
|
|
79
87
|
args.push("--coverage");
|
|
80
88
|
}
|
|
81
|
-
if (
|
|
89
|
+
if (strict) {
|
|
82
90
|
args.push("--strict");
|
|
83
91
|
}
|
|
84
92
|
|
|
@@ -115,6 +123,11 @@ const factory: CustomToolFactory = (pi) => {
|
|
|
115
123
|
async execute(toolCallId, params, onUpdate, ctx, signal) {
|
|
116
124
|
const cmd = await resolveInvarCommand();
|
|
117
125
|
|
|
126
|
+
// Validate required parameter
|
|
127
|
+
if (!params.target) {
|
|
128
|
+
throw new Error("Missing required parameter: target (file path or file::symbol)");
|
|
129
|
+
}
|
|
130
|
+
|
|
118
131
|
if (!isValidPath(params.target)) {
|
|
119
132
|
throw new Error("Invalid target path: contains unsafe characters or path traversal");
|
|
120
133
|
}
|
|
@@ -161,19 +174,21 @@ const factory: CustomToolFactory = (pi) => {
|
|
|
161
174
|
async execute(toolCallId, params, onUpdate, ctx, signal) {
|
|
162
175
|
const cmd = await resolveInvarCommand();
|
|
163
176
|
|
|
164
|
-
|
|
177
|
+
// Handle optional parameters with defaults
|
|
178
|
+
const targetPath = params.path ?? ".";
|
|
179
|
+
const topN = params.top ?? 10;
|
|
180
|
+
|
|
181
|
+
if (targetPath !== "." && !isValidPath(targetPath)) {
|
|
165
182
|
throw new Error("Invalid path: contains unsafe characters or path traversal");
|
|
166
183
|
}
|
|
167
184
|
|
|
168
185
|
const args = [...cmd.args, "map"];
|
|
169
186
|
|
|
170
|
-
if (
|
|
171
|
-
args.push(
|
|
187
|
+
if (targetPath !== ".") {
|
|
188
|
+
args.push(targetPath);
|
|
172
189
|
}
|
|
173
190
|
|
|
174
|
-
|
|
175
|
-
args.push("--top", params.top.toString());
|
|
176
|
-
}
|
|
191
|
+
args.push("--top", topN.toString());
|
|
177
192
|
|
|
178
193
|
const result = await pi.exec(cmd.command, args, {
|
|
179
194
|
cwd: pi.cwd,
|
|
@@ -191,8 +206,8 @@ const factory: CustomToolFactory = (pi) => {
|
|
|
191
206
|
return {
|
|
192
207
|
content: [{ type: "text", text: result.stdout }],
|
|
193
208
|
details: {
|
|
194
|
-
path:
|
|
195
|
-
top:
|
|
209
|
+
path: targetPath,
|
|
210
|
+
top: topN,
|
|
196
211
|
},
|
|
197
212
|
};
|
|
198
213
|
},
|
|
@@ -219,14 +234,22 @@ const factory: CustomToolFactory = (pi) => {
|
|
|
219
234
|
async execute(toolCallId, params, onUpdate, ctx, signal) {
|
|
220
235
|
const cmd = await resolveInvarCommand();
|
|
221
236
|
|
|
237
|
+
// Validate required parameter
|
|
238
|
+
if (!params.file) {
|
|
239
|
+
throw new Error("Missing required parameter: file (markdown file path)");
|
|
240
|
+
}
|
|
241
|
+
|
|
222
242
|
if (!isValidPath(params.file)) {
|
|
223
243
|
throw new Error("Invalid file path: contains unsafe characters or path traversal");
|
|
224
244
|
}
|
|
225
245
|
|
|
246
|
+
// Handle optional parameter with default
|
|
247
|
+
const maxDepth = params.depth ?? 6;
|
|
248
|
+
|
|
226
249
|
const args = [...cmd.args, "doc", "toc", params.file];
|
|
227
250
|
|
|
228
|
-
if (
|
|
229
|
-
args.push("--depth",
|
|
251
|
+
if (maxDepth !== 6) {
|
|
252
|
+
args.push("--depth", maxDepth.toString());
|
|
230
253
|
}
|
|
231
254
|
|
|
232
255
|
const result = await pi.exec(cmd.command, args, {
|
|
@@ -246,7 +269,7 @@ const factory: CustomToolFactory = (pi) => {
|
|
|
246
269
|
content: [{ type: "text", text: result.stdout }],
|
|
247
270
|
details: {
|
|
248
271
|
file: params.file,
|
|
249
|
-
depth:
|
|
272
|
+
depth: maxDepth,
|
|
250
273
|
},
|
|
251
274
|
};
|
|
252
275
|
},
|
|
@@ -274,13 +297,24 @@ const factory: CustomToolFactory = (pi) => {
|
|
|
274
297
|
async execute(toolCallId, params, onUpdate, ctx, signal) {
|
|
275
298
|
const cmd = await resolveInvarCommand();
|
|
276
299
|
|
|
300
|
+
// Validate required parameters
|
|
301
|
+
if (!params.file) {
|
|
302
|
+
throw new Error("Missing required parameter: file (markdown file path)");
|
|
303
|
+
}
|
|
304
|
+
if (!params.section) {
|
|
305
|
+
throw new Error("Missing required parameter: section (section path or identifier)");
|
|
306
|
+
}
|
|
307
|
+
|
|
277
308
|
if (!isValidPath(params.file) || !isValidPath(params.section)) {
|
|
278
309
|
throw new Error("Invalid file or section path: contains unsafe characters or path traversal");
|
|
279
310
|
}
|
|
280
311
|
|
|
312
|
+
// Handle optional parameter with default
|
|
313
|
+
const includeChildren = params.children ?? true;
|
|
314
|
+
|
|
281
315
|
const args = [...cmd.args, "doc", "read", params.file, params.section, "--json"];
|
|
282
316
|
|
|
283
|
-
if (
|
|
317
|
+
if (includeChildren === false) {
|
|
284
318
|
args.push("--no-children");
|
|
285
319
|
}
|
|
286
320
|
|
|
@@ -333,12 +367,21 @@ const factory: CustomToolFactory = (pi) => {
|
|
|
333
367
|
async execute(toolCallId, params, onUpdate, ctx, signal) {
|
|
334
368
|
const cmd = await resolveInvarCommand();
|
|
335
369
|
|
|
370
|
+
// Validate required parameters
|
|
371
|
+
if (!params.file) {
|
|
372
|
+
throw new Error("Missing required parameter: file (markdown file path)");
|
|
373
|
+
}
|
|
374
|
+
if (!params.pattern) {
|
|
375
|
+
throw new Error("Missing required parameter: pattern (glob pattern for section titles)");
|
|
376
|
+
}
|
|
377
|
+
|
|
336
378
|
if (!isValidPath(params.file)) {
|
|
337
379
|
throw new Error("Invalid file path: contains unsafe characters or path traversal");
|
|
338
380
|
}
|
|
339
381
|
|
|
340
382
|
const args = [...cmd.args, "doc", "find", params.pattern, params.file, "--json"];
|
|
341
383
|
|
|
384
|
+
// Handle optional parameters
|
|
342
385
|
if (params.content) {
|
|
343
386
|
args.push("--content", params.content);
|
|
344
387
|
}
|
|
@@ -395,13 +438,25 @@ const factory: CustomToolFactory = (pi) => {
|
|
|
395
438
|
async execute(toolCallId, params, onUpdate, ctx, signal) {
|
|
396
439
|
const cmd = await resolveInvarCommand();
|
|
397
440
|
|
|
441
|
+
// Validate required parameters
|
|
442
|
+
if (!params.file) {
|
|
443
|
+
throw new Error("Missing required parameter: file (markdown file path)");
|
|
444
|
+
}
|
|
445
|
+
if (!params.section) {
|
|
446
|
+
throw new Error("Missing required parameter: section (section path or identifier)");
|
|
447
|
+
}
|
|
448
|
+
if (!params.content) {
|
|
449
|
+
throw new Error("Missing required parameter: content (new content for section)");
|
|
450
|
+
}
|
|
451
|
+
|
|
398
452
|
if (!isValidPath(params.file) || !isValidPath(params.section)) {
|
|
399
453
|
throw new Error("Invalid file or section path: contains unsafe characters or path traversal");
|
|
400
454
|
}
|
|
401
455
|
|
|
456
|
+
// Handle optional parameter with default
|
|
457
|
+
const keepHeading = params.keep_heading ?? true;
|
|
458
|
+
|
|
402
459
|
// Write content to temporary file to avoid shell injection
|
|
403
|
-
const fs = require("fs");
|
|
404
|
-
const path = require("path");
|
|
405
460
|
const tmpFile = path.join(pi.cwd, `.invar-tmp-${Date.now()}.txt`);
|
|
406
461
|
|
|
407
462
|
try {
|
|
@@ -417,7 +472,7 @@ const factory: CustomToolFactory = (pi) => {
|
|
|
417
472
|
tmpFile,
|
|
418
473
|
];
|
|
419
474
|
|
|
420
|
-
if (
|
|
475
|
+
if (keepHeading === false) {
|
|
421
476
|
args.push("--no-keep-heading");
|
|
422
477
|
}
|
|
423
478
|
|
|
@@ -478,13 +533,25 @@ const factory: CustomToolFactory = (pi) => {
|
|
|
478
533
|
async execute(toolCallId, params, onUpdate, ctx, signal) {
|
|
479
534
|
const cmd = await resolveInvarCommand();
|
|
480
535
|
|
|
536
|
+
// Validate required parameters
|
|
537
|
+
if (!params.file) {
|
|
538
|
+
throw new Error("Missing required parameter: file (markdown file path)");
|
|
539
|
+
}
|
|
540
|
+
if (!params.anchor) {
|
|
541
|
+
throw new Error("Missing required parameter: anchor (section path for insertion point)");
|
|
542
|
+
}
|
|
543
|
+
if (!params.content) {
|
|
544
|
+
throw new Error("Missing required parameter: content (content to insert)");
|
|
545
|
+
}
|
|
546
|
+
|
|
481
547
|
if (!isValidPath(params.file) || !isValidPath(params.anchor)) {
|
|
482
548
|
throw new Error("Invalid file or anchor path: contains unsafe characters or path traversal");
|
|
483
549
|
}
|
|
484
550
|
|
|
551
|
+
// Handle optional parameter with default
|
|
552
|
+
const position = params.position ?? "after";
|
|
553
|
+
|
|
485
554
|
// Write content to temporary file
|
|
486
|
-
const fs = require("fs");
|
|
487
|
-
const path = require("path");
|
|
488
555
|
const tmpFile = path.join(pi.cwd, `.invar-tmp-${Date.now()}.txt`);
|
|
489
556
|
|
|
490
557
|
try {
|
|
@@ -500,8 +567,8 @@ const factory: CustomToolFactory = (pi) => {
|
|
|
500
567
|
tmpFile,
|
|
501
568
|
];
|
|
502
569
|
|
|
503
|
-
if (
|
|
504
|
-
args.push("--position",
|
|
570
|
+
if (position !== "after") {
|
|
571
|
+
args.push("--position", position);
|
|
505
572
|
}
|
|
506
573
|
|
|
507
574
|
const result = await pi.exec(cmd.command, args, {
|
|
@@ -558,13 +625,24 @@ const factory: CustomToolFactory = (pi) => {
|
|
|
558
625
|
async execute(toolCallId, params, onUpdate, ctx, signal) {
|
|
559
626
|
const cmd = await resolveInvarCommand();
|
|
560
627
|
|
|
628
|
+
// Validate required parameters
|
|
629
|
+
if (!params.file) {
|
|
630
|
+
throw new Error("Missing required parameter: file (markdown file path)");
|
|
631
|
+
}
|
|
632
|
+
if (!params.section) {
|
|
633
|
+
throw new Error("Missing required parameter: section (section path or identifier)");
|
|
634
|
+
}
|
|
635
|
+
|
|
561
636
|
if (!isValidPath(params.file) || !isValidPath(params.section)) {
|
|
562
637
|
throw new Error("Invalid file or section path: contains unsafe characters or path traversal");
|
|
563
638
|
}
|
|
564
639
|
|
|
640
|
+
// Handle optional parameter with default
|
|
641
|
+
const includeChildren = params.children ?? true;
|
|
642
|
+
|
|
565
643
|
const args = [...cmd.args, "doc", "delete", params.file, params.section];
|
|
566
644
|
|
|
567
|
-
if (
|
|
645
|
+
if (includeChildren === false) {
|
|
568
646
|
args.push("--no-children");
|
|
569
647
|
}
|
|
570
648
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: invar-tools
|
|
3
|
-
Version: 1.15.
|
|
3
|
+
Version: 1.15.3
|
|
4
4
|
Summary: AI-native software engineering tools with design-by-contract verification
|
|
5
5
|
Project-URL: Homepage, https://github.com/tefx/invar
|
|
6
6
|
Project-URL: Documentation, https://github.com/tefx/invar#readme
|
|
@@ -143,7 +143,7 @@ invar/templates/onboard/assessment.md.jinja,sha256=EzqF0VUcxJZG2bVJLxTOyQlAERRbh
|
|
|
143
143
|
invar/templates/onboard/roadmap.md.jinja,sha256=gmvZk4Hdwe0l3qSFV15QGcsr-OPMhsc6-1K9F2SFSIQ,3939
|
|
144
144
|
invar/templates/onboard/patterns/python.md,sha256=3wwucAcQz0DlggtpqYo-ZCnmrXgBQ0aBgUHN_EZ1VW0,8681
|
|
145
145
|
invar/templates/onboard/patterns/typescript.md,sha256=yOVfHtdAdjKkWNh66_dR7z2xEA4sggbIcCKthW-fqac,11983
|
|
146
|
-
invar/templates/pi-tools/invar/index.ts,sha256=
|
|
146
|
+
invar/templates/pi-tools/invar/index.ts,sha256=7xonqiDDUtY09gjRzxet-Xr7_Dxl1AfB0xqiUmBFeKE,22581
|
|
147
147
|
invar/templates/protocol/INVAR.md.jinja,sha256=t2ZIQZJvzDTJMrRw_ijUo6ScZmeNK0-nV-H7ztTIyQQ,1464
|
|
148
148
|
invar/templates/protocol/python/architecture-examples.md,sha256=O96LH9WFpk7G9MrhSbifLS5pyibTIDG-_EGFF7g3V4M,1175
|
|
149
149
|
invar/templates/protocol/python/contracts-syntax.md,sha256=Q6supTQ3tChVrlN7xhcdb3Q8VGIESxQLA-mQvrNIZmo,1162
|
|
@@ -181,10 +181,10 @@ invar/templates/skills/invar-reflect/template.md,sha256=Rr5hvbllvmd8jSLf_0ZjyKt6
|
|
|
181
181
|
invar/templates/skills/investigate/SKILL.md.jinja,sha256=cp6TBEixBYh1rLeeHOR1yqEnFqv1NZYePORMnavLkQI,3231
|
|
182
182
|
invar/templates/skills/propose/SKILL.md.jinja,sha256=6BuKiCqO1AEu3VtzMHy1QWGqr_xqG9eJlhbsKT4jev4,3463
|
|
183
183
|
invar/templates/skills/review/SKILL.md.jinja,sha256=ET5mbdSe_eKgJbi2LbgFC-z1aviKcHOBw7J5Q28fr4U,14105
|
|
184
|
-
invar_tools-1.15.
|
|
185
|
-
invar_tools-1.15.
|
|
186
|
-
invar_tools-1.15.
|
|
187
|
-
invar_tools-1.15.
|
|
188
|
-
invar_tools-1.15.
|
|
189
|
-
invar_tools-1.15.
|
|
190
|
-
invar_tools-1.15.
|
|
184
|
+
invar_tools-1.15.3.dist-info/METADATA,sha256=8cn5xZHmi9QvgHc1iPzFdol25Q302gRncWutGH6_ZgQ,28595
|
|
185
|
+
invar_tools-1.15.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
186
|
+
invar_tools-1.15.3.dist-info/entry_points.txt,sha256=RwH_EhqgtFPsnO6RcrwrAb70Zyfb8Mh6uUtztWnUxGk,102
|
|
187
|
+
invar_tools-1.15.3.dist-info/licenses/LICENSE,sha256=qeFksp4H4kfTgQxPCIu3OdagXyiZcgBlVfsQ6M5oFyk,10767
|
|
188
|
+
invar_tools-1.15.3.dist-info/licenses/LICENSE-GPL,sha256=IvZfC6ZbP7CLjytoHVzvpDZpD-Z3R_qa1GdMdWlWQ6Q,35157
|
|
189
|
+
invar_tools-1.15.3.dist-info/licenses/NOTICE,sha256=joEyMyFhFY8Vd8tTJ-a3SirI0m2Sd0WjzqYt3sdcglc,2561
|
|
190
|
+
invar_tools-1.15.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|