@mariozechner/pi-coding-agent 0.50.3 → 0.50.4
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 +33 -1
- package/dist/core/agent-session.d.ts +6 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +10 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +6 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +81 -5
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +4 -3
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +25 -12
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/tools/path-utils.d.ts.map +1 -1
- package/dist/core/tools/path-utils.js +28 -3
- package/dist/core/tools/path-utils.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +12 -1
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/daxnuts.d.ts +23 -0
- package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
- package/dist/modes/interactive/components/daxnuts.js +140 -0
- package/dist/modes/interactive/components/daxnuts.js.map +1 -0
- package/dist/modes/interactive/components/index.d.ts +1 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +1 -0
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +2 -2
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +1 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +2 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +30 -10
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +4 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +6 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +9 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +10 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +6 -7
- package/dist/utils/clipboard.js.map +1 -1
- package/docs/keybindings.md +4 -2
- package/docs/models.md +32 -0
- package/docs/rpc.md +21 -1
- package/examples/extensions/antigravity-image-gen.ts +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +5 -4
|
@@ -2,7 +2,8 @@ import { spawn, spawnSync } from "node:child_process";
|
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { homedir, tmpdir } from "node:os";
|
|
5
|
-
import { basename, dirname, join, relative, resolve } from "node:path";
|
|
5
|
+
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
6
|
+
import ignore from "ignore";
|
|
6
7
|
import { minimatch } from "minimatch";
|
|
7
8
|
import { CONFIG_DIR_NAME } from "../config.js";
|
|
8
9
|
import { looksLikeGitUrl } from "../utils/git.js";
|
|
@@ -13,6 +14,51 @@ const FILE_PATTERNS = {
|
|
|
13
14
|
prompts: /\.md$/,
|
|
14
15
|
themes: /\.json$/,
|
|
15
16
|
};
|
|
17
|
+
const IGNORE_FILE_NAMES = [".gitignore", ".ignore", ".fdignore"];
|
|
18
|
+
function toPosixPath(p) {
|
|
19
|
+
return p.split(sep).join("/");
|
|
20
|
+
}
|
|
21
|
+
function prefixIgnorePattern(line, prefix) {
|
|
22
|
+
const trimmed = line.trim();
|
|
23
|
+
if (!trimmed)
|
|
24
|
+
return null;
|
|
25
|
+
if (trimmed.startsWith("#") && !trimmed.startsWith("\\#"))
|
|
26
|
+
return null;
|
|
27
|
+
let pattern = line;
|
|
28
|
+
let negated = false;
|
|
29
|
+
if (pattern.startsWith("!")) {
|
|
30
|
+
negated = true;
|
|
31
|
+
pattern = pattern.slice(1);
|
|
32
|
+
}
|
|
33
|
+
else if (pattern.startsWith("\\!")) {
|
|
34
|
+
pattern = pattern.slice(1);
|
|
35
|
+
}
|
|
36
|
+
if (pattern.startsWith("/")) {
|
|
37
|
+
pattern = pattern.slice(1);
|
|
38
|
+
}
|
|
39
|
+
const prefixed = prefix ? `${prefix}${pattern}` : pattern;
|
|
40
|
+
return negated ? `!${prefixed}` : prefixed;
|
|
41
|
+
}
|
|
42
|
+
function addIgnoreRules(ig, dir, rootDir) {
|
|
43
|
+
const relativeDir = relative(rootDir, dir);
|
|
44
|
+
const prefix = relativeDir ? `${toPosixPath(relativeDir)}/` : "";
|
|
45
|
+
for (const filename of IGNORE_FILE_NAMES) {
|
|
46
|
+
const ignorePath = join(dir, filename);
|
|
47
|
+
if (!existsSync(ignorePath))
|
|
48
|
+
continue;
|
|
49
|
+
try {
|
|
50
|
+
const content = readFileSync(ignorePath, "utf-8");
|
|
51
|
+
const patterns = content
|
|
52
|
+
.split(/\r?\n/)
|
|
53
|
+
.map((line) => prefixIgnorePattern(line, prefix))
|
|
54
|
+
.filter((line) => Boolean(line));
|
|
55
|
+
if (patterns.length > 0) {
|
|
56
|
+
ig.add(patterns);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
catch { }
|
|
60
|
+
}
|
|
61
|
+
}
|
|
16
62
|
function isPattern(s) {
|
|
17
63
|
return s.startsWith("!") || s.startsWith("+") || s.startsWith("-") || s.includes("*") || s.includes("?");
|
|
18
64
|
}
|
|
@@ -29,10 +75,13 @@ function splitPatterns(entries) {
|
|
|
29
75
|
}
|
|
30
76
|
return { plain, patterns };
|
|
31
77
|
}
|
|
32
|
-
function collectFiles(dir, filePattern, skipNodeModules = true) {
|
|
78
|
+
function collectFiles(dir, filePattern, skipNodeModules = true, ignoreMatcher, rootDir) {
|
|
33
79
|
const files = [];
|
|
34
80
|
if (!existsSync(dir))
|
|
35
81
|
return files;
|
|
82
|
+
const root = rootDir ?? dir;
|
|
83
|
+
const ig = ignoreMatcher ?? ignore();
|
|
84
|
+
addIgnoreRules(ig, dir, root);
|
|
36
85
|
try {
|
|
37
86
|
const entries = readdirSync(dir, { withFileTypes: true });
|
|
38
87
|
for (const entry of entries) {
|
|
@@ -53,8 +102,12 @@ function collectFiles(dir, filePattern, skipNodeModules = true) {
|
|
|
53
102
|
continue;
|
|
54
103
|
}
|
|
55
104
|
}
|
|
105
|
+
const relPath = toPosixPath(relative(root, fullPath));
|
|
106
|
+
const ignorePath = isDir ? `${relPath}/` : relPath;
|
|
107
|
+
if (ig.ignores(ignorePath))
|
|
108
|
+
continue;
|
|
56
109
|
if (isDir) {
|
|
57
|
-
files.push(...collectFiles(fullPath, filePattern, skipNodeModules));
|
|
110
|
+
files.push(...collectFiles(fullPath, filePattern, skipNodeModules, ig, root));
|
|
58
111
|
}
|
|
59
112
|
else if (isFile && filePattern.test(entry.name)) {
|
|
60
113
|
files.push(fullPath);
|
|
@@ -66,10 +119,13 @@ function collectFiles(dir, filePattern, skipNodeModules = true) {
|
|
|
66
119
|
}
|
|
67
120
|
return files;
|
|
68
121
|
}
|
|
69
|
-
function collectSkillEntries(dir, includeRootFiles = true) {
|
|
122
|
+
function collectSkillEntries(dir, includeRootFiles = true, ignoreMatcher, rootDir) {
|
|
70
123
|
const entries = [];
|
|
71
124
|
if (!existsSync(dir))
|
|
72
125
|
return entries;
|
|
126
|
+
const root = rootDir ?? dir;
|
|
127
|
+
const ig = ignoreMatcher ?? ignore();
|
|
128
|
+
addIgnoreRules(ig, dir, root);
|
|
73
129
|
try {
|
|
74
130
|
const dirEntries = readdirSync(dir, { withFileTypes: true });
|
|
75
131
|
for (const entry of dirEntries) {
|
|
@@ -90,8 +146,12 @@ function collectSkillEntries(dir, includeRootFiles = true) {
|
|
|
90
146
|
continue;
|
|
91
147
|
}
|
|
92
148
|
}
|
|
149
|
+
const relPath = toPosixPath(relative(root, fullPath));
|
|
150
|
+
const ignorePath = isDir ? `${relPath}/` : relPath;
|
|
151
|
+
if (ig.ignores(ignorePath))
|
|
152
|
+
continue;
|
|
93
153
|
if (isDir) {
|
|
94
|
-
entries.push(...collectSkillEntries(fullPath, false));
|
|
154
|
+
entries.push(...collectSkillEntries(fullPath, false, ig, root));
|
|
95
155
|
}
|
|
96
156
|
else if (isFile) {
|
|
97
157
|
const isRootMd = includeRootFiles && entry.name.endsWith(".md");
|
|
@@ -114,6 +174,8 @@ function collectAutoPromptEntries(dir) {
|
|
|
114
174
|
const entries = [];
|
|
115
175
|
if (!existsSync(dir))
|
|
116
176
|
return entries;
|
|
177
|
+
const ig = ignore();
|
|
178
|
+
addIgnoreRules(ig, dir, dir);
|
|
117
179
|
try {
|
|
118
180
|
const dirEntries = readdirSync(dir, { withFileTypes: true });
|
|
119
181
|
for (const entry of dirEntries) {
|
|
@@ -131,6 +193,9 @@ function collectAutoPromptEntries(dir) {
|
|
|
131
193
|
continue;
|
|
132
194
|
}
|
|
133
195
|
}
|
|
196
|
+
const relPath = toPosixPath(relative(dir, fullPath));
|
|
197
|
+
if (ig.ignores(relPath))
|
|
198
|
+
continue;
|
|
134
199
|
if (isFile && entry.name.endsWith(".md")) {
|
|
135
200
|
entries.push(fullPath);
|
|
136
201
|
}
|
|
@@ -145,6 +210,8 @@ function collectAutoThemeEntries(dir) {
|
|
|
145
210
|
const entries = [];
|
|
146
211
|
if (!existsSync(dir))
|
|
147
212
|
return entries;
|
|
213
|
+
const ig = ignore();
|
|
214
|
+
addIgnoreRules(ig, dir, dir);
|
|
148
215
|
try {
|
|
149
216
|
const dirEntries = readdirSync(dir, { withFileTypes: true });
|
|
150
217
|
for (const entry of dirEntries) {
|
|
@@ -162,6 +229,9 @@ function collectAutoThemeEntries(dir) {
|
|
|
162
229
|
continue;
|
|
163
230
|
}
|
|
164
231
|
}
|
|
232
|
+
const relPath = toPosixPath(relative(dir, fullPath));
|
|
233
|
+
if (ig.ignores(relPath))
|
|
234
|
+
continue;
|
|
165
235
|
if (isFile && entry.name.endsWith(".json")) {
|
|
166
236
|
entries.push(fullPath);
|
|
167
237
|
}
|
|
@@ -213,6 +283,8 @@ function collectAutoExtensionEntries(dir) {
|
|
|
213
283
|
const entries = [];
|
|
214
284
|
if (!existsSync(dir))
|
|
215
285
|
return entries;
|
|
286
|
+
const ig = ignore();
|
|
287
|
+
addIgnoreRules(ig, dir, dir);
|
|
216
288
|
try {
|
|
217
289
|
const dirEntries = readdirSync(dir, { withFileTypes: true });
|
|
218
290
|
for (const entry of dirEntries) {
|
|
@@ -233,6 +305,10 @@ function collectAutoExtensionEntries(dir) {
|
|
|
233
305
|
continue;
|
|
234
306
|
}
|
|
235
307
|
}
|
|
308
|
+
const relPath = toPosixPath(relative(dir, fullPath));
|
|
309
|
+
const ignorePath = isDir ? `${relPath}/` : relPath;
|
|
310
|
+
if (ig.ignores(ignorePath))
|
|
311
|
+
continue;
|
|
236
312
|
if (isFile && (entry.name.endsWith(".ts") || entry.name.endsWith(".js"))) {
|
|
237
313
|
entries.push(fullPath);
|
|
238
314
|
}
|