@srobroek/pi-repomix 0.6.3 → 0.7.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/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/extensions/repomix.js +42 -2
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## repomix [0.7.0](https://github.com/srobroek/harness-plugins/compare/repomix--v0.6.3...repomix--v0.7.0) (2026-11-26)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **repomix:** pack on pi without asking by default ([7359d5c](https://github.com/srobroek/harness-plugins/commit/7359d5cc7d50242adf2d96e5ef5c09dd68e4f228))
|
|
6
|
+
|
|
1
7
|
## repomix [0.6.3](https://github.com/srobroek/harness-plugins/compare/repomix--v0.6.2...repomix--v0.6.3) (2026-11-24)
|
|
2
8
|
|
|
3
9
|
## repomix [0.6.2](https://github.com/srobroek/harness-plugins/compare/repomix--v0.6.1...repomix--v0.6.2) (2026-11-24)
|
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ is a prompt unless you configure otherwise. The shipped allowlist agents deny it
|
|
|
66
66
|
a pack in slices, and when `compress` loses information. It also carries a CLI recipe,
|
|
67
67
|
so it is exported to Claude Code.
|
|
68
68
|
|
|
69
|
-
The npm package exposes `repomix_pack` as a Pi tool. It
|
|
69
|
+
The npm package exposes `repomix_pack` as a Pi tool. It packs without asking; set `"repomix": {"confirmPack": true}` in `~/.pi/agent/settings.json` to confirm every pack, which a session without a UI then refuses. The pack is written under a temp directory, and only the path and metrics are returned.
|
|
70
70
|
|
|
71
71
|
## Optional: the repomix MCP server
|
|
72
72
|
|
package/extensions/repomix.js
CHANGED
|
@@ -2,6 +2,41 @@
|
|
|
2
2
|
// Generated by scripts/build.ts. Do not edit.
|
|
3
3
|
// plugins/repomix/pi-src/repomix.ts
|
|
4
4
|
import { statSync as statSync2 } from "fs";
|
|
5
|
+
import { join as join2 } from "path";
|
|
6
|
+
import { getAgentDir } from "@earendil-works/pi-coding-agent";
|
|
7
|
+
|
|
8
|
+
// lib/src/pi-settings.ts
|
|
9
|
+
import { readFileSync } from "fs";
|
|
10
|
+
var PI_SETTINGS_FILE = "settings.json";
|
|
11
|
+
var isObject = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
12
|
+
function loadPiPluginSettings(path, plugin, fallback) {
|
|
13
|
+
const unusable = (problem) => ({ options: {}, warning: `${plugin}: ${problem}; ${fallback}.` });
|
|
14
|
+
const unread = `so its "${plugin}" key was not read`;
|
|
15
|
+
let text;
|
|
16
|
+
try {
|
|
17
|
+
text = readFileSync(path, "utf8");
|
|
18
|
+
} catch (error) {
|
|
19
|
+
if (error.code === "ENOENT")
|
|
20
|
+
return { options: {} };
|
|
21
|
+
return unusable(`${path} could not be read, ${unread}`);
|
|
22
|
+
}
|
|
23
|
+
let settings;
|
|
24
|
+
try {
|
|
25
|
+
settings = JSON.parse(text.replace(/^\uFEFF/, ""));
|
|
26
|
+
} catch {
|
|
27
|
+
return unusable(`${path} is not valid JSON, ${unread}`);
|
|
28
|
+
}
|
|
29
|
+
if (!isObject(settings))
|
|
30
|
+
return unusable(`${path} is not a JSON object, ${unread}`);
|
|
31
|
+
const value = settings[plugin];
|
|
32
|
+
if (value === undefined)
|
|
33
|
+
return { options: {} };
|
|
34
|
+
if (!isObject(value))
|
|
35
|
+
return unusable(`the "${plugin}" key in ${path} is not an object`);
|
|
36
|
+
return { options: value };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// plugins/repomix/pi-src/repomix.ts
|
|
5
40
|
import { Type } from "typebox";
|
|
6
41
|
|
|
7
42
|
// plugins/repomix/shared/pack.ts
|
|
@@ -416,6 +451,9 @@ async function runPack(params, target, runner, signal, deps = {}) {
|
|
|
416
451
|
}
|
|
417
452
|
|
|
418
453
|
// plugins/repomix/pi-src/repomix.ts
|
|
454
|
+
function confirmPackSetting(path = join2(getAgentDir(), PI_SETTINGS_FILE)) {
|
|
455
|
+
return loadPiPluginSettings(path, "repomix", "repomix_pack packs without asking").options.confirmPack === true;
|
|
456
|
+
}
|
|
419
457
|
var properties = PACK_INPUT.properties;
|
|
420
458
|
var parameters = Type.Object({
|
|
421
459
|
directory: Type.Optional(Type.String({ description: properties.directory.description })),
|
|
@@ -451,9 +489,10 @@ function registerRepomix(pi, overrides = {}) {
|
|
|
451
489
|
return { content: [{ type: "text", text: `${PACK_TOOL}: ${target.directory} is not a directory` }], details: { ok: false } };
|
|
452
490
|
const runner = chooseRunner(which);
|
|
453
491
|
const resource = targetResource(target);
|
|
454
|
-
|
|
492
|
+
const confirm = confirmPackSetting(overrides.settingsPath);
|
|
493
|
+
if (confirm && !ctx.hasUI)
|
|
455
494
|
return { content: [{ type: "text", text: `${PACK_TOOL}: write refused because confirmation UI is unavailable for ${resource}` }], details: { ok: false } };
|
|
456
|
-
if (!await ctx.ui.confirm("Confirm repository pack", `Run ${runner.kind === "npx" ? `npx repomix@1.19.0` : "repomix"} to pack ${resource}? The pack will be written to a temporary file.`))
|
|
495
|
+
if (confirm && !await ctx.ui.confirm("Confirm repository pack", `Run ${runner.kind === "npx" ? `npx repomix@1.19.0` : "repomix"} to pack ${resource}? The pack will be written to a temporary file.`))
|
|
457
496
|
return { content: [{ type: "text", text: `${PACK_TOOL}: pack cancelled` }], details: { ok: false } };
|
|
458
497
|
try {
|
|
459
498
|
const result = await runPack(params, target, runner, signal, overrides);
|
|
@@ -480,6 +519,7 @@ function repomix_default(pi) {
|
|
|
480
519
|
registerRepomix(pi);
|
|
481
520
|
}
|
|
482
521
|
export {
|
|
522
|
+
confirmPackSetting,
|
|
483
523
|
repomix_default as default,
|
|
484
524
|
registerRepomix
|
|
485
525
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@srobroek/pi-repomix",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Pack a local or remote repo into one file with repomix for bulk context: external repos, module packs and version diffs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package"
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"provenance": true
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
26
27
|
"typebox": "*"
|
|
27
28
|
},
|
|
28
29
|
"pi": {
|