jorgex-stack 1.9.62 → 1.9.64
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/README.md +17 -30
- package/dist/browser-playwright.d.ts +2 -0
- package/dist/browser-playwright.js +955 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +9694 -1866
- package/dist/pi-ci-artifact.js +341 -35
- package/dist/quality-verifier.js +399 -29
- package/package.json +3 -2
- package/stack/mcp/servers.json +1 -1
- package/stack/system-prompt/browser-playwright.md +1 -1
- package/upstreams.json +8 -8
- package/dist/chunk-2CBCBOP7.js +0 -245
- package/dist/chunk-4USZMJ3I.js +0 -554
- package/dist/chunk-66WVKOU4.js +0 -693
- package/dist/chunk-B76ZJXXD.js +0 -989
- package/dist/chunk-BSHTDTJL.js +0 -781
- package/dist/chunk-KGL5VNVZ.js +0 -305
- package/dist/chunk-KKN4OYHD.js +0 -704
- package/dist/chunk-N5IC2JBJ.js +0 -467
- package/dist/chunk-NQZVJFV2.js +0 -33
- package/dist/claude-code-BBHLN5TD.js +0 -12
- package/dist/codex-ALGP2YBC.js +0 -12
- package/dist/official-engram-setup-4WIXM4EF.js +0 -34
- package/dist/opencode-VG2IZRRF.js +0 -32
- package/dist/pi-CKFSPGJU.js +0 -13
package/dist/chunk-2CBCBOP7.js
DELETED
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
registerOfficialSetupVerifier
|
|
4
|
-
} from "./chunk-B76ZJXXD.js";
|
|
5
|
-
import {
|
|
6
|
-
HOME,
|
|
7
|
-
samePath
|
|
8
|
-
} from "./chunk-NQZVJFV2.js";
|
|
9
|
-
|
|
10
|
-
// src/adapters/pi.ts
|
|
11
|
-
import fs from "fs";
|
|
12
|
-
import path from "path";
|
|
13
|
-
function piSystemPromptFile(targetDir) {
|
|
14
|
-
const configDir = targetDir === void 0 ? process.env.PI_CODING_AGENT_DIR ?? path.join(HOME, ".pi", "agent") : path.join(path.resolve(targetDir), "pi-agent");
|
|
15
|
-
return path.join(configDir, "AGENTS.md");
|
|
16
|
-
}
|
|
17
|
-
var piAdapter = {
|
|
18
|
-
id: "pi",
|
|
19
|
-
paths(configDir) {
|
|
20
|
-
const piConfigDir = path.dirname(piSystemPromptFile());
|
|
21
|
-
const agentsHome = samePath(configDir, piConfigDir) ? HOME : path.join(path.dirname(configDir), "home");
|
|
22
|
-
return {
|
|
23
|
-
systemPromptFile: path.join(configDir, "AGENTS.md"),
|
|
24
|
-
agentsDir: path.join(configDir, "agents"),
|
|
25
|
-
skillsDir: path.join(agentsHome, ".agents", "skills"),
|
|
26
|
-
commandsDir: path.join(configDir, "prompts"),
|
|
27
|
-
pluginsDir: null,
|
|
28
|
-
scriptsDir: path.join(configDir, "scripts"),
|
|
29
|
-
outputStylesDir: null,
|
|
30
|
-
profilesDir: null
|
|
31
|
-
};
|
|
32
|
-
},
|
|
33
|
-
renderCommand(file, content) {
|
|
34
|
-
return { file, content: content.replace(/\{\{input\}\}/g, "$ARGUMENTS") };
|
|
35
|
-
},
|
|
36
|
-
// La guía Context7 se habilita al adoptar su registro HTTP en Pi.
|
|
37
|
-
adaptSystemPromptSections(sections) {
|
|
38
|
-
const modular = { ...sections };
|
|
39
|
-
delete modular.context7;
|
|
40
|
-
return modular;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
function isRecord(value) {
|
|
44
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
45
|
-
}
|
|
46
|
-
function piPackageSource(entry) {
|
|
47
|
-
if (typeof entry === "string") return entry;
|
|
48
|
-
if (!isRecord(entry)) return null;
|
|
49
|
-
const source = entry["source"];
|
|
50
|
-
return typeof source === "string" ? source : null;
|
|
51
|
-
}
|
|
52
|
-
function isSafePiVersionSpec(spec) {
|
|
53
|
-
if (spec === "" || /[\r\n]/.test(spec)) return false;
|
|
54
|
-
if (spec.includes("/") || spec.includes("\\") || spec.includes(":") || spec.includes("#") || spec.includes("?")) {
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
if (spec.startsWith(".")) return false;
|
|
58
|
-
const lower = spec.toLowerCase();
|
|
59
|
-
if (lower.endsWith(".tar.gz") || lower.endsWith(".tgz") || lower.endsWith(".tar")) return false;
|
|
60
|
-
return /^[A-Za-z0-9._\-^~><=| +*xXv]+$/.test(spec);
|
|
61
|
-
}
|
|
62
|
-
function claimsProtectedName(source, name) {
|
|
63
|
-
return source === `npm:${name}` || source.startsWith(`npm:${name}@`);
|
|
64
|
-
}
|
|
65
|
-
function isNamedPiSource(source, name) {
|
|
66
|
-
if (source === `npm:${name}`) return true;
|
|
67
|
-
const prefix = `npm:${name}@`;
|
|
68
|
-
if (!source.startsWith(prefix)) return false;
|
|
69
|
-
return isSafePiVersionSpec(source.slice(prefix.length));
|
|
70
|
-
}
|
|
71
|
-
function isGentleSource(source) {
|
|
72
|
-
return isNamedPiSource(source, "gentle-engram");
|
|
73
|
-
}
|
|
74
|
-
function isAdapterSource(source) {
|
|
75
|
-
return isNamedPiSource(source, "pi-mcp-adapter");
|
|
76
|
-
}
|
|
77
|
-
function isExactPiEngramMcp(value, engramBin) {
|
|
78
|
-
if (!isRecord(value)) return false;
|
|
79
|
-
if (typeof engramBin !== "string" || engramBin === "" || !path.isAbsolute(engramBin)) return false;
|
|
80
|
-
const keys = Object.keys(value).sort();
|
|
81
|
-
if (keys.length !== 4 || keys[0] !== "args" || keys[1] !== "command" || keys[2] !== "directTools" || keys[3] !== "lifecycle") {
|
|
82
|
-
return false;
|
|
83
|
-
}
|
|
84
|
-
if (value["command"] !== engramBin) return false;
|
|
85
|
-
if (value["lifecycle"] !== "lazy") return false;
|
|
86
|
-
if (value["directTools"] !== false) return false;
|
|
87
|
-
const args = value["args"];
|
|
88
|
-
if (!Array.isArray(args) || args.length !== 2 || args[0] !== "mcp" || args[1] !== "--tools=agent") {
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
function errnoCode(error) {
|
|
94
|
-
return error instanceof Error && "code" in error && typeof error.code === "string" ? error.code : "UNKNOWN";
|
|
95
|
-
}
|
|
96
|
-
async function verifyOfficialSetup(args) {
|
|
97
|
-
void args.homeDir;
|
|
98
|
-
const passed = [];
|
|
99
|
-
const missing = [];
|
|
100
|
-
let duplicates = false;
|
|
101
|
-
let packagesDetail = null;
|
|
102
|
-
try {
|
|
103
|
-
const raw = fs.readFileSync(path.join(args.configDir, "settings.json"), "utf8");
|
|
104
|
-
let parsed;
|
|
105
|
-
try {
|
|
106
|
-
parsed = JSON.parse(raw);
|
|
107
|
-
} catch {
|
|
108
|
-
packagesDetail = "packages:invalid";
|
|
109
|
-
missing.push(packagesDetail);
|
|
110
|
-
packagesDetail = "singleton inv\xE1lido en settings.json (JSON no parseable)";
|
|
111
|
-
throw new Error("__invalid__");
|
|
112
|
-
}
|
|
113
|
-
if (!isRecord(parsed) || !Array.isArray(parsed["packages"])) {
|
|
114
|
-
missing.push("packages:missing");
|
|
115
|
-
packagesDetail = "singleton incompleto en settings.json (falta packages[])";
|
|
116
|
-
} else {
|
|
117
|
-
const sources = parsed["packages"].map(piPackageSource);
|
|
118
|
-
const unsafeClaimed = sources.filter(
|
|
119
|
-
(source) => source !== null && (claimsProtectedName(source, "gentle-engram") && !isGentleSource(source) || claimsProtectedName(source, "pi-mcp-adapter") && !isAdapterSource(source))
|
|
120
|
-
);
|
|
121
|
-
if (unsafeClaimed.length > 0) {
|
|
122
|
-
missing.push("packages:invalid");
|
|
123
|
-
packagesDetail = `singleton inv\xE1lido en settings.json (selector inseguro que reclama nombre protegido: ${unsafeClaimed[0]})`;
|
|
124
|
-
} else {
|
|
125
|
-
const gentle = sources.filter((source) => source !== null && isGentleSource(source));
|
|
126
|
-
const adapter = sources.filter((source) => source !== null && isAdapterSource(source));
|
|
127
|
-
if (gentle.length === 1 && adapter.length === 1) {
|
|
128
|
-
passed.push("packages");
|
|
129
|
-
packagesDetail = null;
|
|
130
|
-
} else {
|
|
131
|
-
duplicates = gentle.length > 1 || adapter.length > 1;
|
|
132
|
-
if (duplicates) missing.push("packages:duplicate");
|
|
133
|
-
else if (gentle.length === 0 || adapter.length === 0) {
|
|
134
|
-
const absent = [
|
|
135
|
-
...gentle.length === 0 ? ["gentle-engram"] : [],
|
|
136
|
-
...adapter.length === 0 ? ["pi-mcp-adapter"] : []
|
|
137
|
-
].join(" + ");
|
|
138
|
-
missing.push("packages:missing");
|
|
139
|
-
void absent;
|
|
140
|
-
} else {
|
|
141
|
-
missing.push("packages:missing");
|
|
142
|
-
}
|
|
143
|
-
const detail2 = duplicates ? `singleton duplicado en settings.json (gentle-engram x${gentle.length}, pi-mcp-adapter x${adapter.length})` : `singleton incompleto en settings.json (falta ${gentle.length === 0 ? "gentle-engram" : "pi-mcp-adapter"})`;
|
|
144
|
-
packagesDetail = detail2;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
} catch (error) {
|
|
149
|
-
if (error instanceof Error && error.message === "__invalid__") {
|
|
150
|
-
} else {
|
|
151
|
-
const code = errnoCode(error);
|
|
152
|
-
if (code === "ENOENT") {
|
|
153
|
-
missing.push("packages:missing");
|
|
154
|
-
packagesDetail = "singleton incompleto en settings.json (ausente)";
|
|
155
|
-
} else {
|
|
156
|
-
missing.push("packages:unreadable");
|
|
157
|
-
packagesDetail = `singleton ilegible en settings.json (unreadable ${code})`;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
let mcpDetail = null;
|
|
162
|
-
if (typeof args.engramBin !== "string" || args.engramBin === "") {
|
|
163
|
-
missing.push("mcp:missing");
|
|
164
|
-
mcpDetail = "mcp inv\xE1lido en mcp.json (sin engramBin absoluto)";
|
|
165
|
-
} else {
|
|
166
|
-
try {
|
|
167
|
-
const raw = fs.readFileSync(path.join(args.configDir, "mcp.json"), "utf8");
|
|
168
|
-
let parsed;
|
|
169
|
-
try {
|
|
170
|
-
parsed = JSON.parse(raw);
|
|
171
|
-
} catch {
|
|
172
|
-
missing.push("mcp:invalid");
|
|
173
|
-
mcpDetail = "mcp inv\xE1lido en mcp.json (JSON no parseable)";
|
|
174
|
-
parsed = null;
|
|
175
|
-
throw new Error("__invalid_mcp__");
|
|
176
|
-
}
|
|
177
|
-
if (!isRecord(parsed)) {
|
|
178
|
-
missing.push("mcp:invalid");
|
|
179
|
-
mcpDetail = "mcp inv\xE1lido en mcp.json (ra\xEDz no objeto)";
|
|
180
|
-
} else {
|
|
181
|
-
const servers = parsed["mcpServers"];
|
|
182
|
-
if (!isRecord(servers) || servers["engram"] === void 0) {
|
|
183
|
-
const alt = isRecord(parsed["servers"]) ? parsed["servers"]["engram"] : void 0;
|
|
184
|
-
if (alt === void 0) {
|
|
185
|
-
missing.push("mcp:missing");
|
|
186
|
-
mcpDetail = "mcp ausente en mcp.json (falta mcpServers.engram)";
|
|
187
|
-
} else if (isExactPiEngramMcp(alt, args.engramBin)) {
|
|
188
|
-
passed.push("mcp");
|
|
189
|
-
mcpDetail = null;
|
|
190
|
-
} else {
|
|
191
|
-
missing.push("mcp:invalid");
|
|
192
|
-
mcpDetail = `mcp inv\xE1lido en mcp.json (se exige forma directa can\xF3nica: command === engramBin absoluto, args === ["mcp","--tools=agent"], lifecycle === "lazy", directTools === false)`;
|
|
193
|
-
}
|
|
194
|
-
} else if (isExactPiEngramMcp(servers["engram"], args.engramBin)) {
|
|
195
|
-
const legacy = isRecord(parsed["servers"]) ? parsed["servers"]["engram"] : void 0;
|
|
196
|
-
if (legacy !== void 0) {
|
|
197
|
-
missing.push("mcp:conflict");
|
|
198
|
-
mcpDetail = "mcp en conflicto en mcp.json (servers.engram legacy coexiste con mcpServers.engram can\xF3nico; conflicto fail-closed sin activar Pi)";
|
|
199
|
-
} else {
|
|
200
|
-
passed.push("mcp");
|
|
201
|
-
mcpDetail = null;
|
|
202
|
-
}
|
|
203
|
-
} else {
|
|
204
|
-
const foreign = isRecord(servers["engram"]) && typeof servers["engram"]["command"] === "string" && servers["engram"]["command"] !== args.engramBin && !String(servers["engram"]["command"]).includes("node") && !JSON.stringify(servers["engram"]).includes(args.engramBin);
|
|
205
|
-
missing.push(foreign ? "mcp:conflict" : "mcp:invalid");
|
|
206
|
-
mcpDetail = foreign ? `mcp en conflicto en mcp.json (no apunta al binario oficial ${args.engramBin}); se preserva sin reescribir` : `mcp inv\xE1lido en mcp.json (se exige forma directa can\xF3nica: command === engramBin absoluto, args === ["mcp","--tools=agent"], lifecycle === "lazy", directTools === false)`;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
} catch (error) {
|
|
210
|
-
if (error instanceof Error && error.message === "__invalid_mcp__") {
|
|
211
|
-
} else {
|
|
212
|
-
const code = errnoCode(error);
|
|
213
|
-
if (code === "ENOENT") {
|
|
214
|
-
if (mcpDetail === null && !missing.some((entry) => entry.startsWith("mcp:"))) {
|
|
215
|
-
missing.push("mcp:missing");
|
|
216
|
-
mcpDetail = "mcp ausente en mcp.json (falta mcpServers.engram)";
|
|
217
|
-
}
|
|
218
|
-
} else {
|
|
219
|
-
missing.push("mcp:unreadable");
|
|
220
|
-
mcpDetail = `mcp ilegible en mcp.json (unreadable ${code}, parcial sin activar Pi)`;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
if (missing.length === 0) {
|
|
226
|
-
return { ok: true, layers: passed, duplicates: false };
|
|
227
|
-
}
|
|
228
|
-
const detail = `Pi: setup oficial Engram incompleto (${[
|
|
229
|
-
...packagesDetail !== null ? [packagesDetail] : [],
|
|
230
|
-
...mcpDetail !== null ? [mcpDetail] : []
|
|
231
|
-
].join("; ")}; falta: ${missing.join(", ")}).`;
|
|
232
|
-
return {
|
|
233
|
-
ok: false,
|
|
234
|
-
layers: [...passed, ...missing],
|
|
235
|
-
duplicates,
|
|
236
|
-
reason: detail
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
registerOfficialSetupVerifier("pi", verifyOfficialSetup);
|
|
240
|
-
|
|
241
|
-
export {
|
|
242
|
-
piSystemPromptFile,
|
|
243
|
-
piAdapter,
|
|
244
|
-
verifyOfficialSetup
|
|
245
|
-
};
|