poe-code 3.0.67 → 3.0.69-beta.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.
- package/README.md +18 -19
- package/dist/index.js +775 -325
- package/dist/index.js.map +4 -4
- package/dist/sdk/container.js +24 -10
- package/dist/sdk/container.js.map +1 -1
- package/dist/sdk/credentials.d.ts +1 -1
- package/dist/sdk/credentials.js +6 -19
- package/dist/sdk/credentials.js.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -31,34 +31,469 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
31
31
|
mod
|
|
32
32
|
));
|
|
33
33
|
|
|
34
|
+
// packages/auth/src/encrypted-file-auth-store.ts
|
|
35
|
+
import { createCipheriv, createDecipheriv, randomBytes, scrypt } from "node:crypto";
|
|
36
|
+
import { promises as fs } from "node:fs";
|
|
37
|
+
import { homedir, hostname, userInfo } from "node:os";
|
|
38
|
+
import path from "node:path";
|
|
39
|
+
function defaultMachineIdentity() {
|
|
40
|
+
return {
|
|
41
|
+
hostname: hostname(),
|
|
42
|
+
username: userInfo().username
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
async function deriveEncryptionKey(getMachineIdentity) {
|
|
46
|
+
const machineIdentity = await getMachineIdentity();
|
|
47
|
+
const secret = `${machineIdentity.hostname}:${machineIdentity.username}`;
|
|
48
|
+
return await new Promise((resolve, reject) => {
|
|
49
|
+
scrypt(secret, ENCRYPTION_SALT, ENCRYPTION_KEY_BYTES, (error2, derivedKey) => {
|
|
50
|
+
if (error2) {
|
|
51
|
+
reject(error2);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
resolve(Buffer.from(derivedKey));
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function parseEncryptedDocument(raw) {
|
|
59
|
+
try {
|
|
60
|
+
const parsed = JSON.parse(raw);
|
|
61
|
+
if (!isRecord(parsed)) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
if (parsed.version !== ENCRYPTION_VERSION) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
if (typeof parsed.iv !== "string" || typeof parsed.authTag !== "string" || typeof parsed.ciphertext !== "string") {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
version: parsed.version,
|
|
72
|
+
iv: parsed.iv,
|
|
73
|
+
authTag: parsed.authTag,
|
|
74
|
+
ciphertext: parsed.ciphertext
|
|
75
|
+
};
|
|
76
|
+
} catch {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function isRecord(value) {
|
|
81
|
+
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
82
|
+
}
|
|
83
|
+
function isNotFoundError(error2) {
|
|
84
|
+
return Boolean(
|
|
85
|
+
error2 && typeof error2 === "object" && "code" in error2 && error2.code === "ENOENT"
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
var ENCRYPTION_ALGORITHM, ENCRYPTION_VERSION, ENCRYPTION_KEY_BYTES, ENCRYPTION_IV_BYTES, ENCRYPTION_AUTH_TAG_BYTES, ENCRYPTION_SALT, ENCRYPTION_FILE_MODE, EncryptedFileAuthStore;
|
|
89
|
+
var init_encrypted_file_auth_store = __esm({
|
|
90
|
+
"packages/auth/src/encrypted-file-auth-store.ts"() {
|
|
91
|
+
"use strict";
|
|
92
|
+
ENCRYPTION_ALGORITHM = "aes-256-gcm";
|
|
93
|
+
ENCRYPTION_VERSION = 1;
|
|
94
|
+
ENCRYPTION_KEY_BYTES = 32;
|
|
95
|
+
ENCRYPTION_IV_BYTES = 12;
|
|
96
|
+
ENCRYPTION_AUTH_TAG_BYTES = 16;
|
|
97
|
+
ENCRYPTION_SALT = "poe-code:encrypted-file-auth-store:v1";
|
|
98
|
+
ENCRYPTION_FILE_MODE = 384;
|
|
99
|
+
EncryptedFileAuthStore = class {
|
|
100
|
+
fs;
|
|
101
|
+
filePath;
|
|
102
|
+
getMachineIdentity;
|
|
103
|
+
getRandomBytes;
|
|
104
|
+
keyPromise = null;
|
|
105
|
+
constructor(input = {}) {
|
|
106
|
+
this.fs = input.fs ?? fs;
|
|
107
|
+
this.filePath = input.filePath ?? path.join(
|
|
108
|
+
(input.getHomeDirectory ?? homedir)(),
|
|
109
|
+
".poe-code",
|
|
110
|
+
"credentials.enc"
|
|
111
|
+
);
|
|
112
|
+
this.getMachineIdentity = input.getMachineIdentity ?? defaultMachineIdentity;
|
|
113
|
+
this.getRandomBytes = input.getRandomBytes ?? randomBytes;
|
|
114
|
+
}
|
|
115
|
+
async getApiKey() {
|
|
116
|
+
let rawDocument;
|
|
117
|
+
try {
|
|
118
|
+
rawDocument = await this.fs.readFile(this.filePath, "utf8");
|
|
119
|
+
} catch (error2) {
|
|
120
|
+
if (isNotFoundError(error2)) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
throw error2;
|
|
124
|
+
}
|
|
125
|
+
const document = parseEncryptedDocument(rawDocument);
|
|
126
|
+
if (!document) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
const key = await this.getEncryptionKey();
|
|
130
|
+
try {
|
|
131
|
+
const iv = Buffer.from(document.iv, "base64");
|
|
132
|
+
const authTag = Buffer.from(document.authTag, "base64");
|
|
133
|
+
const ciphertext = Buffer.from(document.ciphertext, "base64");
|
|
134
|
+
if (iv.byteLength !== ENCRYPTION_IV_BYTES || authTag.byteLength !== ENCRYPTION_AUTH_TAG_BYTES) {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
const decipher = createDecipheriv(ENCRYPTION_ALGORITHM, key, iv);
|
|
138
|
+
decipher.setAuthTag(authTag);
|
|
139
|
+
const plaintext = Buffer.concat([decipher.update(ciphertext), decipher.final()]);
|
|
140
|
+
return plaintext.toString("utf8");
|
|
141
|
+
} catch {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
async setApiKey(apiKey) {
|
|
146
|
+
const key = await this.getEncryptionKey();
|
|
147
|
+
const iv = this.getRandomBytes(ENCRYPTION_IV_BYTES);
|
|
148
|
+
const cipher = createCipheriv(ENCRYPTION_ALGORITHM, key, iv);
|
|
149
|
+
const ciphertext = Buffer.concat([
|
|
150
|
+
cipher.update(apiKey, "utf8"),
|
|
151
|
+
cipher.final()
|
|
152
|
+
]);
|
|
153
|
+
const authTag = cipher.getAuthTag();
|
|
154
|
+
const document = {
|
|
155
|
+
version: ENCRYPTION_VERSION,
|
|
156
|
+
iv: iv.toString("base64"),
|
|
157
|
+
authTag: authTag.toString("base64"),
|
|
158
|
+
ciphertext: ciphertext.toString("base64")
|
|
159
|
+
};
|
|
160
|
+
await this.fs.mkdir(path.dirname(this.filePath), { recursive: true });
|
|
161
|
+
await this.fs.writeFile(this.filePath, JSON.stringify(document), {
|
|
162
|
+
encoding: "utf8"
|
|
163
|
+
});
|
|
164
|
+
await this.fs.chmod(this.filePath, ENCRYPTION_FILE_MODE);
|
|
165
|
+
}
|
|
166
|
+
async deleteApiKey() {
|
|
167
|
+
try {
|
|
168
|
+
await this.fs.unlink(this.filePath);
|
|
169
|
+
} catch (error2) {
|
|
170
|
+
if (!isNotFoundError(error2)) {
|
|
171
|
+
throw error2;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
getEncryptionKey() {
|
|
176
|
+
if (!this.keyPromise) {
|
|
177
|
+
this.keyPromise = deriveEncryptionKey(this.getMachineIdentity);
|
|
178
|
+
}
|
|
179
|
+
return this.keyPromise;
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
// packages/auth/src/keychain-auth-store.ts
|
|
186
|
+
import { spawn } from "node:child_process";
|
|
187
|
+
function runSecurityCommand(command, args) {
|
|
188
|
+
return new Promise((resolve) => {
|
|
189
|
+
const child = spawn(command, args, {
|
|
190
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
191
|
+
});
|
|
192
|
+
let stdout = "";
|
|
193
|
+
let stderr = "";
|
|
194
|
+
child.stdout?.setEncoding("utf8");
|
|
195
|
+
child.stdout?.on("data", (chunk) => {
|
|
196
|
+
stdout += chunk.toString();
|
|
197
|
+
});
|
|
198
|
+
child.stderr?.setEncoding("utf8");
|
|
199
|
+
child.stderr?.on("data", (chunk) => {
|
|
200
|
+
stderr += chunk.toString();
|
|
201
|
+
});
|
|
202
|
+
child.on("error", (error2) => {
|
|
203
|
+
const message = error2 instanceof Error ? error2.message : String(error2 ?? "Unknown error");
|
|
204
|
+
resolve({
|
|
205
|
+
stdout,
|
|
206
|
+
stderr: stderr ? `${stderr}${message}` : message,
|
|
207
|
+
exitCode: 127
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
child.on("close", (code) => {
|
|
211
|
+
resolve({
|
|
212
|
+
stdout,
|
|
213
|
+
stderr,
|
|
214
|
+
exitCode: code ?? 0
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
function stripTrailingLineBreak(value) {
|
|
220
|
+
if (value.endsWith("\r\n")) {
|
|
221
|
+
return value.slice(0, -2);
|
|
222
|
+
}
|
|
223
|
+
if (value.endsWith("\n") || value.endsWith("\r")) {
|
|
224
|
+
return value.slice(0, -1);
|
|
225
|
+
}
|
|
226
|
+
return value;
|
|
227
|
+
}
|
|
228
|
+
function isKeychainEntryNotFound(result) {
|
|
229
|
+
if (result.exitCode === KEYCHAIN_ITEM_NOT_FOUND_EXIT_CODE) {
|
|
230
|
+
return true;
|
|
231
|
+
}
|
|
232
|
+
const output = `${result.stderr}
|
|
233
|
+
${result.stdout}`.toLowerCase();
|
|
234
|
+
return output.includes("could not be found") || output.includes("item not found") || output.includes("errsecitemnotfound");
|
|
235
|
+
}
|
|
236
|
+
function createSecurityCliFailure(operation, result) {
|
|
237
|
+
const details = result.stderr.trim() || result.stdout.trim();
|
|
238
|
+
if (details) {
|
|
239
|
+
return new Error(
|
|
240
|
+
`Failed to ${operation}: security exited with code ${result.exitCode}: ${details}`
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
return new Error(`Failed to ${operation}: security exited with code ${result.exitCode}`);
|
|
244
|
+
}
|
|
245
|
+
var SECURITY_CLI, KEYCHAIN_SERVICE, KEYCHAIN_ACCOUNT, KEYCHAIN_ITEM_NOT_FOUND_EXIT_CODE, KeychainAuthStore;
|
|
246
|
+
var init_keychain_auth_store = __esm({
|
|
247
|
+
"packages/auth/src/keychain-auth-store.ts"() {
|
|
248
|
+
"use strict";
|
|
249
|
+
SECURITY_CLI = "security";
|
|
250
|
+
KEYCHAIN_SERVICE = "poe-code";
|
|
251
|
+
KEYCHAIN_ACCOUNT = "api-key";
|
|
252
|
+
KEYCHAIN_ITEM_NOT_FOUND_EXIT_CODE = 44;
|
|
253
|
+
KeychainAuthStore = class {
|
|
254
|
+
runCommand;
|
|
255
|
+
service;
|
|
256
|
+
account;
|
|
257
|
+
constructor(input = {}) {
|
|
258
|
+
this.runCommand = input.runCommand ?? runSecurityCommand;
|
|
259
|
+
this.service = input.service ?? KEYCHAIN_SERVICE;
|
|
260
|
+
this.account = input.account ?? KEYCHAIN_ACCOUNT;
|
|
261
|
+
}
|
|
262
|
+
async getApiKey() {
|
|
263
|
+
const result = await this.executeSecurityCommand(
|
|
264
|
+
["find-generic-password", "-s", this.service, "-a", this.account, "-w"],
|
|
265
|
+
"read API key from macOS Keychain"
|
|
266
|
+
);
|
|
267
|
+
if (result.exitCode === 0) {
|
|
268
|
+
return stripTrailingLineBreak(result.stdout);
|
|
269
|
+
}
|
|
270
|
+
if (isKeychainEntryNotFound(result)) {
|
|
271
|
+
return null;
|
|
272
|
+
}
|
|
273
|
+
throw createSecurityCliFailure("read API key from macOS Keychain", result);
|
|
274
|
+
}
|
|
275
|
+
async setApiKey(apiKey) {
|
|
276
|
+
const result = await this.executeSecurityCommand(
|
|
277
|
+
[
|
|
278
|
+
"add-generic-password",
|
|
279
|
+
"-s",
|
|
280
|
+
this.service,
|
|
281
|
+
"-a",
|
|
282
|
+
this.account,
|
|
283
|
+
"-w",
|
|
284
|
+
apiKey,
|
|
285
|
+
"-U"
|
|
286
|
+
],
|
|
287
|
+
"store API key in macOS Keychain"
|
|
288
|
+
);
|
|
289
|
+
if (result.exitCode !== 0) {
|
|
290
|
+
throw createSecurityCliFailure("store API key in macOS Keychain", result);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
async deleteApiKey() {
|
|
294
|
+
const result = await this.executeSecurityCommand(
|
|
295
|
+
["delete-generic-password", "-s", this.service, "-a", this.account],
|
|
296
|
+
"delete API key from macOS Keychain"
|
|
297
|
+
);
|
|
298
|
+
if (result.exitCode === 0 || isKeychainEntryNotFound(result)) {
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
throw createSecurityCliFailure("delete API key from macOS Keychain", result);
|
|
302
|
+
}
|
|
303
|
+
async executeSecurityCommand(args, operation) {
|
|
304
|
+
try {
|
|
305
|
+
return await this.runCommand(SECURITY_CLI, args);
|
|
306
|
+
} catch (error2) {
|
|
307
|
+
const message = error2 instanceof Error ? error2.message : String(error2);
|
|
308
|
+
throw new Error(`Failed to ${operation}: ${message}`);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
// packages/auth/src/create-auth-store.ts
|
|
316
|
+
import { promises as nodeFs } from "node:fs";
|
|
317
|
+
import { homedir as homedir2 } from "node:os";
|
|
318
|
+
import path2 from "node:path";
|
|
319
|
+
function createAuthStore(input = {}) {
|
|
320
|
+
const backend = resolveBackend(input);
|
|
321
|
+
const platform = input.platform ?? process.platform;
|
|
322
|
+
if (backend === "keychain" && platform !== MACOS_PLATFORM) {
|
|
323
|
+
throw new Error(
|
|
324
|
+
`POE_AUTH_BACKEND=keychain is only supported on macOS. Current platform: ${platform}`
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
const store = authStoreFactories[backend](input);
|
|
328
|
+
return {
|
|
329
|
+
backend,
|
|
330
|
+
store: enableLegacyCredentialsMigration(store, input)
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
function resolveBackend(input) {
|
|
334
|
+
const configuredBackend = input.backend ?? input.env?.[AUTH_BACKEND_ENV_VAR] ?? process.env[AUTH_BACKEND_ENV_VAR];
|
|
335
|
+
if (configuredBackend === "keychain") {
|
|
336
|
+
return "keychain";
|
|
337
|
+
}
|
|
338
|
+
return "file";
|
|
339
|
+
}
|
|
340
|
+
function enableLegacyCredentialsMigration(store, input) {
|
|
341
|
+
const migrationContext = createLegacyMigrationContext(input);
|
|
342
|
+
const readApiKeyFromStore = store.getApiKey.bind(store);
|
|
343
|
+
let hasCheckedLegacyCredentials = false;
|
|
344
|
+
let legacyMigrationPromise = null;
|
|
345
|
+
store.getApiKey = async () => {
|
|
346
|
+
const storedApiKey = await readApiKeyFromStore();
|
|
347
|
+
if (isNonEmptyString(storedApiKey)) {
|
|
348
|
+
return storedApiKey;
|
|
349
|
+
}
|
|
350
|
+
if (hasCheckedLegacyCredentials) {
|
|
351
|
+
return null;
|
|
352
|
+
}
|
|
353
|
+
if (!legacyMigrationPromise) {
|
|
354
|
+
legacyMigrationPromise = migrateLegacyApiKey(store, migrationContext).finally(() => {
|
|
355
|
+
hasCheckedLegacyCredentials = true;
|
|
356
|
+
legacyMigrationPromise = null;
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
return legacyMigrationPromise;
|
|
360
|
+
};
|
|
361
|
+
return store;
|
|
362
|
+
}
|
|
363
|
+
async function migrateLegacyApiKey(store, migrationContext) {
|
|
364
|
+
const legacyCredentials = await loadLegacyCredentials(
|
|
365
|
+
migrationContext.fs,
|
|
366
|
+
migrationContext.filePath
|
|
367
|
+
);
|
|
368
|
+
if (!legacyCredentials || !isNonEmptyString(legacyCredentials.apiKey)) {
|
|
369
|
+
return null;
|
|
370
|
+
}
|
|
371
|
+
const plaintextApiKey = legacyCredentials.apiKey;
|
|
372
|
+
try {
|
|
373
|
+
await store.setApiKey(plaintextApiKey);
|
|
374
|
+
delete legacyCredentials.apiKey;
|
|
375
|
+
await saveLegacyCredentials(
|
|
376
|
+
migrationContext.fs,
|
|
377
|
+
migrationContext.filePath,
|
|
378
|
+
legacyCredentials
|
|
379
|
+
);
|
|
380
|
+
} catch (error2) {
|
|
381
|
+
migrationContext.logWarning(
|
|
382
|
+
`Failed to migrate plaintext API key from ${migrationContext.filePath}.`,
|
|
383
|
+
error2
|
|
384
|
+
);
|
|
385
|
+
}
|
|
386
|
+
return plaintextApiKey;
|
|
387
|
+
}
|
|
388
|
+
function createLegacyMigrationContext(input) {
|
|
389
|
+
const legacyCredentialsInput = input.legacyCredentials;
|
|
390
|
+
const getHomeDirectory = legacyCredentialsInput?.getHomeDirectory ?? homedir2;
|
|
391
|
+
return {
|
|
392
|
+
fs: legacyCredentialsInput?.fs ?? input.fileStore?.fs ?? nodeFs,
|
|
393
|
+
filePath: legacyCredentialsInput?.filePath ?? path2.join(
|
|
394
|
+
getHomeDirectory(),
|
|
395
|
+
LEGACY_CREDENTIALS_RELATIVE_PATH
|
|
396
|
+
),
|
|
397
|
+
logWarning: legacyCredentialsInput?.logWarning ?? defaultMigrationWarning
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
async function loadLegacyCredentials(fs3, filePath) {
|
|
401
|
+
let raw;
|
|
402
|
+
try {
|
|
403
|
+
raw = await fs3.readFile(filePath, "utf8");
|
|
404
|
+
} catch (error2) {
|
|
405
|
+
if (isNotFoundError2(error2)) {
|
|
406
|
+
return null;
|
|
407
|
+
}
|
|
408
|
+
return null;
|
|
409
|
+
}
|
|
410
|
+
try {
|
|
411
|
+
const parsed = JSON.parse(raw);
|
|
412
|
+
if (!isRecord2(parsed)) {
|
|
413
|
+
return null;
|
|
414
|
+
}
|
|
415
|
+
return parsed;
|
|
416
|
+
} catch {
|
|
417
|
+
return null;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
async function saveLegacyCredentials(fs3, filePath, document) {
|
|
421
|
+
await fs3.mkdir(path2.dirname(filePath), { recursive: true });
|
|
422
|
+
await fs3.writeFile(filePath, `${JSON.stringify(document, null, 2)}
|
|
423
|
+
`, {
|
|
424
|
+
encoding: "utf8"
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
function defaultMigrationWarning(message, error2) {
|
|
428
|
+
const details = toErrorDetails(error2);
|
|
429
|
+
if (details.length > 0) {
|
|
430
|
+
console.warn(`${message} ${details}`);
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
console.warn(message);
|
|
434
|
+
}
|
|
435
|
+
function toErrorDetails(error2) {
|
|
436
|
+
if (error2 instanceof Error) {
|
|
437
|
+
return error2.message;
|
|
438
|
+
}
|
|
439
|
+
return typeof error2 === "string" ? error2 : "";
|
|
440
|
+
}
|
|
441
|
+
function isNonEmptyString(value) {
|
|
442
|
+
return typeof value === "string" && value.length > 0;
|
|
443
|
+
}
|
|
444
|
+
function isRecord2(value) {
|
|
445
|
+
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
446
|
+
}
|
|
447
|
+
function isNotFoundError2(error2) {
|
|
448
|
+
return Boolean(
|
|
449
|
+
error2 && typeof error2 === "object" && "code" in error2 && error2.code === "ENOENT"
|
|
450
|
+
);
|
|
451
|
+
}
|
|
452
|
+
var AUTH_BACKEND_ENV_VAR, MACOS_PLATFORM, LEGACY_CREDENTIALS_RELATIVE_PATH, authStoreFactories;
|
|
453
|
+
var init_create_auth_store = __esm({
|
|
454
|
+
"packages/auth/src/create-auth-store.ts"() {
|
|
455
|
+
"use strict";
|
|
456
|
+
init_encrypted_file_auth_store();
|
|
457
|
+
init_keychain_auth_store();
|
|
458
|
+
AUTH_BACKEND_ENV_VAR = "POE_AUTH_BACKEND";
|
|
459
|
+
MACOS_PLATFORM = "darwin";
|
|
460
|
+
LEGACY_CREDENTIALS_RELATIVE_PATH = ".poe-code/credentials.json";
|
|
461
|
+
authStoreFactories = {
|
|
462
|
+
file: (input) => new EncryptedFileAuthStore(input.fileStore),
|
|
463
|
+
keychain: (input) => new KeychainAuthStore(input.keychainStore)
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
});
|
|
467
|
+
|
|
468
|
+
// packages/auth/src/index.ts
|
|
469
|
+
var init_src = __esm({
|
|
470
|
+
"packages/auth/src/index.ts"() {
|
|
471
|
+
"use strict";
|
|
472
|
+
init_create_auth_store();
|
|
473
|
+
init_encrypted_file_auth_store();
|
|
474
|
+
init_keychain_auth_store();
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
|
|
34
478
|
// src/sdk/credentials.ts
|
|
35
|
-
import * as fs from "node:fs/promises";
|
|
36
|
-
import * as os from "node:os";
|
|
37
|
-
import * as path from "node:path";
|
|
38
479
|
async function getPoeApiKey() {
|
|
39
480
|
const envKey = process.env.POE_API_KEY;
|
|
40
481
|
if (typeof envKey === "string" && envKey.trim().length > 0) {
|
|
41
482
|
return envKey.trim();
|
|
42
483
|
}
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const parsed = JSON.parse(content);
|
|
48
|
-
if (typeof parsed === "object" && parsed !== null && typeof parsed.apiKey === "string" && parsed.apiKey.length > 0) {
|
|
49
|
-
return parsed.apiKey;
|
|
50
|
-
}
|
|
51
|
-
} catch {
|
|
484
|
+
const { store } = createAuthStore();
|
|
485
|
+
const storedKey = await store.getApiKey();
|
|
486
|
+
if (typeof storedKey === "string" && storedKey.trim().length > 0) {
|
|
487
|
+
return storedKey.trim();
|
|
52
488
|
}
|
|
53
489
|
throw new Error(
|
|
54
490
|
"No API key found. Set POE_API_KEY or run 'poe-code login'."
|
|
55
491
|
);
|
|
56
492
|
}
|
|
57
|
-
var CREDENTIALS_RELATIVE_PATH;
|
|
58
493
|
var init_credentials = __esm({
|
|
59
494
|
"src/sdk/credentials.ts"() {
|
|
60
495
|
"use strict";
|
|
61
|
-
|
|
496
|
+
init_src();
|
|
62
497
|
}
|
|
63
498
|
});
|
|
64
499
|
|
|
@@ -383,16 +818,16 @@ function getConfigFormat(pathOrFormat) {
|
|
|
383
818
|
}
|
|
384
819
|
return formatRegistry[formatName];
|
|
385
820
|
}
|
|
386
|
-
function detectFormat(
|
|
387
|
-
const ext = getExtension(
|
|
821
|
+
function detectFormat(path21) {
|
|
822
|
+
const ext = getExtension(path21);
|
|
388
823
|
return extensionMap[ext];
|
|
389
824
|
}
|
|
390
|
-
function getExtension(
|
|
391
|
-
const lastDot =
|
|
825
|
+
function getExtension(path21) {
|
|
826
|
+
const lastDot = path21.lastIndexOf(".");
|
|
392
827
|
if (lastDot === -1) {
|
|
393
828
|
return "";
|
|
394
829
|
}
|
|
395
|
-
return
|
|
830
|
+
return path21.slice(lastDot).toLowerCase();
|
|
396
831
|
}
|
|
397
832
|
var formatRegistry, extensionMap;
|
|
398
833
|
var init_formats = __esm({
|
|
@@ -414,7 +849,7 @@ var init_formats = __esm({
|
|
|
414
849
|
});
|
|
415
850
|
|
|
416
851
|
// packages/config-mutations/src/execution/path-utils.ts
|
|
417
|
-
import
|
|
852
|
+
import path3 from "node:path";
|
|
418
853
|
function expandHome(targetPath, homeDir) {
|
|
419
854
|
if (!targetPath?.startsWith("~")) {
|
|
420
855
|
return targetPath;
|
|
@@ -431,7 +866,7 @@ function expandHome(targetPath, homeDir) {
|
|
|
431
866
|
remainder = remainder.slice(1);
|
|
432
867
|
}
|
|
433
868
|
}
|
|
434
|
-
return remainder.length === 0 ? homeDir :
|
|
869
|
+
return remainder.length === 0 ? homeDir : path3.join(homeDir, remainder);
|
|
435
870
|
}
|
|
436
871
|
function validateHomePath(targetPath) {
|
|
437
872
|
if (typeof targetPath !== "string" || targetPath.length === 0) {
|
|
@@ -449,12 +884,12 @@ function resolvePath(rawPath, homeDir, pathMapper) {
|
|
|
449
884
|
if (!pathMapper) {
|
|
450
885
|
return expanded;
|
|
451
886
|
}
|
|
452
|
-
const rawDirectory =
|
|
887
|
+
const rawDirectory = path3.dirname(expanded);
|
|
453
888
|
const mappedDirectory = pathMapper.mapTargetDirectory({
|
|
454
889
|
targetDirectory: rawDirectory
|
|
455
890
|
});
|
|
456
|
-
const filename =
|
|
457
|
-
return filename.length === 0 ? mappedDirectory :
|
|
891
|
+
const filename = path3.basename(expanded);
|
|
892
|
+
return filename.length === 0 ? mappedDirectory : path3.join(mappedDirectory, filename);
|
|
458
893
|
}
|
|
459
894
|
var init_path_utils = __esm({
|
|
460
895
|
"packages/config-mutations/src/execution/path-utils.ts"() {
|
|
@@ -1115,7 +1550,7 @@ var init_types = __esm({
|
|
|
1115
1550
|
});
|
|
1116
1551
|
|
|
1117
1552
|
// packages/config-mutations/src/index.ts
|
|
1118
|
-
var
|
|
1553
|
+
var init_src2 = __esm({
|
|
1119
1554
|
"packages/config-mutations/src/index.ts"() {
|
|
1120
1555
|
"use strict";
|
|
1121
1556
|
init_config_mutation();
|
|
@@ -1135,38 +1570,38 @@ import { createTwoFilesPatch } from "diff";
|
|
|
1135
1570
|
import chalk from "chalk";
|
|
1136
1571
|
function createDryRunFileSystem(base, recorder) {
|
|
1137
1572
|
const proxy = {
|
|
1138
|
-
async readFile(
|
|
1573
|
+
async readFile(path21, encoding) {
|
|
1139
1574
|
if (encoding) {
|
|
1140
|
-
return base.readFile(
|
|
1575
|
+
return base.readFile(path21, encoding);
|
|
1141
1576
|
}
|
|
1142
|
-
return base.readFile(
|
|
1577
|
+
return base.readFile(path21);
|
|
1143
1578
|
},
|
|
1144
|
-
async writeFile(
|
|
1145
|
-
const previousContent = await tryReadText(base,
|
|
1579
|
+
async writeFile(path21, data, options) {
|
|
1580
|
+
const previousContent = await tryReadText(base, path21);
|
|
1146
1581
|
const nextContent = formatData(data, options?.encoding);
|
|
1147
1582
|
recorder.record({
|
|
1148
1583
|
type: "writeFile",
|
|
1149
|
-
path:
|
|
1584
|
+
path: path21,
|
|
1150
1585
|
nextContent,
|
|
1151
1586
|
previousContent
|
|
1152
1587
|
});
|
|
1153
1588
|
},
|
|
1154
|
-
async mkdir(
|
|
1155
|
-
recorder.record({ type: "mkdir", path:
|
|
1589
|
+
async mkdir(path21, options) {
|
|
1590
|
+
recorder.record({ type: "mkdir", path: path21, options });
|
|
1156
1591
|
},
|
|
1157
|
-
async stat(
|
|
1158
|
-
return base.stat(
|
|
1592
|
+
async stat(path21) {
|
|
1593
|
+
return base.stat(path21);
|
|
1159
1594
|
},
|
|
1160
|
-
async unlink(
|
|
1161
|
-
recorder.record({ type: "unlink", path:
|
|
1595
|
+
async unlink(path21) {
|
|
1596
|
+
recorder.record({ type: "unlink", path: path21 });
|
|
1162
1597
|
},
|
|
1163
|
-
async readdir(
|
|
1164
|
-
return base.readdir(
|
|
1598
|
+
async readdir(path21) {
|
|
1599
|
+
return base.readdir(path21);
|
|
1165
1600
|
}
|
|
1166
1601
|
};
|
|
1167
1602
|
if (typeof base.rm === "function") {
|
|
1168
|
-
proxy.rm = async (
|
|
1169
|
-
recorder.record({ type: "rm", path:
|
|
1603
|
+
proxy.rm = async (path21, options) => {
|
|
1604
|
+
recorder.record({ type: "rm", path: path21, options });
|
|
1170
1605
|
};
|
|
1171
1606
|
}
|
|
1172
1607
|
if (typeof base.copyFile === "function") {
|
|
@@ -1256,8 +1691,8 @@ function describeWriteChange(previous, next) {
|
|
|
1256
1691
|
}
|
|
1257
1692
|
return "update";
|
|
1258
1693
|
}
|
|
1259
|
-
function renderWriteCommand(
|
|
1260
|
-
const command = `cat > ${
|
|
1694
|
+
function renderWriteCommand(path21, change) {
|
|
1695
|
+
const command = `cat > ${path21}`;
|
|
1261
1696
|
if (change === "create") {
|
|
1262
1697
|
return renderOperationCommand(command, chalk.green, "# create");
|
|
1263
1698
|
}
|
|
@@ -1419,9 +1854,9 @@ function redactTomlLine(line) {
|
|
|
1419
1854
|
}
|
|
1420
1855
|
return line;
|
|
1421
1856
|
}
|
|
1422
|
-
async function tryReadText(base,
|
|
1857
|
+
async function tryReadText(base, path21) {
|
|
1423
1858
|
try {
|
|
1424
|
-
return await base.readFile(
|
|
1859
|
+
return await base.readFile(path21, "utf8");
|
|
1425
1860
|
} catch (error2) {
|
|
1426
1861
|
if (isNotFound(error2)) {
|
|
1427
1862
|
return null;
|
|
@@ -1447,7 +1882,7 @@ var REDACTED_PLACEHOLDER, JSON_SENSITIVE_KEYS, AUTH_SENSITIVE_KEYS, TOML_SENSITI
|
|
|
1447
1882
|
var init_dry_run = __esm({
|
|
1448
1883
|
"src/utils/dry-run.ts"() {
|
|
1449
1884
|
"use strict";
|
|
1450
|
-
|
|
1885
|
+
init_src2();
|
|
1451
1886
|
REDACTED_PLACEHOLDER = "<redacted>";
|
|
1452
1887
|
JSON_SENSITIVE_KEYS = ["apiKey", "api_key", "apiKeyHelper"];
|
|
1453
1888
|
AUTH_SENSITIVE_KEYS = ["key"];
|
|
@@ -1598,7 +2033,7 @@ var init_context = __esm({
|
|
|
1598
2033
|
});
|
|
1599
2034
|
|
|
1600
2035
|
// src/services/credentials.ts
|
|
1601
|
-
import
|
|
2036
|
+
import path4 from "node:path";
|
|
1602
2037
|
async function saveCredentials(options) {
|
|
1603
2038
|
const { fs: fs3, filePath, apiKey } = options;
|
|
1604
2039
|
const document = await readCredentialsDocument(fs3, filePath);
|
|
@@ -1691,7 +2126,7 @@ async function parseCredentialsDocument(fs3, filePath, raw) {
|
|
|
1691
2126
|
}
|
|
1692
2127
|
}
|
|
1693
2128
|
function normalizeCredentialsDocument(value) {
|
|
1694
|
-
if (!
|
|
2129
|
+
if (!isRecord3(value)) {
|
|
1695
2130
|
return {};
|
|
1696
2131
|
}
|
|
1697
2132
|
const document = {};
|
|
@@ -1705,12 +2140,12 @@ function normalizeCredentialsDocument(value) {
|
|
|
1705
2140
|
return document;
|
|
1706
2141
|
}
|
|
1707
2142
|
function normalizeConfiguredServices(value) {
|
|
1708
|
-
if (!
|
|
2143
|
+
if (!isRecord3(value)) {
|
|
1709
2144
|
return {};
|
|
1710
2145
|
}
|
|
1711
2146
|
const entries = {};
|
|
1712
2147
|
for (const [key, entry] of Object.entries(value)) {
|
|
1713
|
-
if (!
|
|
2148
|
+
if (!isRecord3(entry)) {
|
|
1714
2149
|
continue;
|
|
1715
2150
|
}
|
|
1716
2151
|
const normalized = normalizeConfiguredServiceMetadata({
|
|
@@ -1721,7 +2156,7 @@ function normalizeConfiguredServices(value) {
|
|
|
1721
2156
|
return entries;
|
|
1722
2157
|
}
|
|
1723
2158
|
async function writeCredentialsDocument(fs3, filePath, document) {
|
|
1724
|
-
await fs3.mkdir(
|
|
2159
|
+
await fs3.mkdir(path4.dirname(filePath), { recursive: true });
|
|
1725
2160
|
const payload = {};
|
|
1726
2161
|
if (document.apiKey) {
|
|
1727
2162
|
payload.apiKey = document.apiKey;
|
|
@@ -1741,25 +2176,25 @@ async function recoverInvalidCredentials(fs3, filePath, content) {
|
|
|
1741
2176
|
}
|
|
1742
2177
|
function createInvalidBackupPath(filePath) {
|
|
1743
2178
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
1744
|
-
const dir =
|
|
1745
|
-
const base =
|
|
1746
|
-
return
|
|
2179
|
+
const dir = path4.dirname(filePath);
|
|
2180
|
+
const base = path4.basename(filePath);
|
|
2181
|
+
return path4.join(dir, `${base}.invalid-${timestamp}.json`);
|
|
1747
2182
|
}
|
|
1748
|
-
function
|
|
2183
|
+
function isRecord3(value) {
|
|
1749
2184
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
1750
2185
|
}
|
|
1751
2186
|
var EMPTY_DOCUMENT;
|
|
1752
2187
|
var init_credentials2 = __esm({
|
|
1753
2188
|
"src/services/credentials.ts"() {
|
|
1754
2189
|
"use strict";
|
|
1755
|
-
|
|
2190
|
+
init_src2();
|
|
1756
2191
|
EMPTY_DOCUMENT = `${JSON.stringify({}, null, 2)}
|
|
1757
2192
|
`;
|
|
1758
2193
|
}
|
|
1759
2194
|
});
|
|
1760
2195
|
|
|
1761
2196
|
// src/cli/isolated-env.ts
|
|
1762
|
-
import
|
|
2197
|
+
import path5 from "node:path";
|
|
1763
2198
|
async function resolveIsolatedEnvDetails(env, isolated, providerName, fs3) {
|
|
1764
2199
|
if (!providerName) {
|
|
1765
2200
|
throw new Error("resolveIsolatedEnvDetails requires providerName.");
|
|
@@ -1781,7 +2216,7 @@ function resolveIsolatedTargetDirectory(input) {
|
|
|
1781
2216
|
const expanded = expandHomeShortcut(input.env, input.targetDirectory);
|
|
1782
2217
|
const baseDir = resolveIsolatedBaseDir(input.env, input.providerName);
|
|
1783
2218
|
const homeDir = input.env.homeDir;
|
|
1784
|
-
const homeDirWithSep = `${homeDir}${
|
|
2219
|
+
const homeDirWithSep = `${homeDir}${path5.sep}`;
|
|
1785
2220
|
if (expanded !== homeDir && !expanded.startsWith(homeDirWithSep)) {
|
|
1786
2221
|
throw new Error(
|
|
1787
2222
|
`Isolated config targets must live under the user's home directory (received "${input.targetDirectory}").`
|
|
@@ -1796,7 +2231,7 @@ function resolveIsolatedTargetDirectory(input) {
|
|
|
1796
2231
|
if (!expanded.startsWith(homeDirWithSep)) {
|
|
1797
2232
|
return expanded;
|
|
1798
2233
|
}
|
|
1799
|
-
const mapped =
|
|
2234
|
+
const mapped = path5.join(baseDir, expanded.slice(homeDirWithSep.length));
|
|
1800
2235
|
return stripAgentHome(mapped, baseDir, input.isolated.agentBinary);
|
|
1801
2236
|
}
|
|
1802
2237
|
function resolveIsolatedBaseDir(env, providerName) {
|
|
@@ -1845,9 +2280,9 @@ async function resolveIsolatedEnvValue(env, baseDir, value, fs3) {
|
|
|
1845
2280
|
function resolveIsolatedEnvPath(env, baseDir, value) {
|
|
1846
2281
|
switch (value.kind) {
|
|
1847
2282
|
case "isolatedDir":
|
|
1848
|
-
return value.relativePath ?
|
|
2283
|
+
return value.relativePath ? path5.join(baseDir, value.relativePath) : baseDir;
|
|
1849
2284
|
case "isolatedFile":
|
|
1850
|
-
return
|
|
2285
|
+
return path5.join(baseDir, value.relativePath);
|
|
1851
2286
|
}
|
|
1852
2287
|
}
|
|
1853
2288
|
function isEnvVarReference(value) {
|
|
@@ -1889,10 +2324,10 @@ async function applyIsolatedEnvRepairs(input) {
|
|
|
1889
2324
|
if (repair.kind !== "chmod") {
|
|
1890
2325
|
continue;
|
|
1891
2326
|
}
|
|
1892
|
-
if (
|
|
2327
|
+
if (path5.isAbsolute(repair.relativePath)) {
|
|
1893
2328
|
continue;
|
|
1894
2329
|
}
|
|
1895
|
-
const repairPath =
|
|
2330
|
+
const repairPath = path5.join(baseDir, repair.relativePath);
|
|
1896
2331
|
try {
|
|
1897
2332
|
await input.fs.chmod(repairPath, repair.mode);
|
|
1898
2333
|
} catch (error2) {
|
|
@@ -1943,13 +2378,13 @@ async function resolveCliSettingValue(value, env, fs3) {
|
|
|
1943
2378
|
}
|
|
1944
2379
|
function stripAgentHome(mapped, baseDir, agentBinary) {
|
|
1945
2380
|
const agentDir = `.${agentBinary}`;
|
|
1946
|
-
const prefix =
|
|
2381
|
+
const prefix = path5.join(baseDir, agentDir);
|
|
1947
2382
|
if (mapped === prefix) {
|
|
1948
2383
|
return baseDir;
|
|
1949
2384
|
}
|
|
1950
|
-
const withSep = `${prefix}${
|
|
2385
|
+
const withSep = `${prefix}${path5.sep}`;
|
|
1951
2386
|
if (mapped.startsWith(withSep)) {
|
|
1952
|
-
return
|
|
2387
|
+
return path5.join(baseDir, mapped.slice(withSep.length));
|
|
1953
2388
|
}
|
|
1954
2389
|
return mapped;
|
|
1955
2390
|
}
|
|
@@ -1960,28 +2395,28 @@ function expandHomeShortcut(env, input) {
|
|
|
1960
2395
|
if (input === "~") {
|
|
1961
2396
|
return env.homeDir;
|
|
1962
2397
|
}
|
|
1963
|
-
if (input.startsWith("~/") || input.startsWith(`~${
|
|
1964
|
-
return
|
|
2398
|
+
if (input.startsWith("~/") || input.startsWith(`~${path5.sep}`)) {
|
|
2399
|
+
return path5.join(env.homeDir, input.slice(2));
|
|
1965
2400
|
}
|
|
1966
|
-
if (input.startsWith("~./") || input.startsWith(`~.${
|
|
1967
|
-
return
|
|
2401
|
+
if (input.startsWith("~./") || input.startsWith(`~.${path5.sep}`)) {
|
|
2402
|
+
return path5.join(env.homeDir, `.${input.slice(3)}`);
|
|
1968
2403
|
}
|
|
1969
2404
|
return input;
|
|
1970
2405
|
}
|
|
1971
2406
|
var init_isolated_env = __esm({
|
|
1972
2407
|
"src/cli/isolated-env.ts"() {
|
|
1973
2408
|
"use strict";
|
|
1974
|
-
|
|
2409
|
+
init_src2();
|
|
1975
2410
|
init_credentials2();
|
|
1976
2411
|
}
|
|
1977
2412
|
});
|
|
1978
2413
|
|
|
1979
2414
|
// packages/agent-spawn/src/run-command.ts
|
|
1980
|
-
import { spawn } from "node:child_process";
|
|
2415
|
+
import { spawn as spawn2 } from "node:child_process";
|
|
1981
2416
|
function runCommand(command, args, options) {
|
|
1982
2417
|
return new Promise((resolve) => {
|
|
1983
2418
|
const hasStdin = options?.stdin != null;
|
|
1984
|
-
const child =
|
|
2419
|
+
const child = spawn2(command, args, {
|
|
1985
2420
|
stdio: [hasStdin ? "pipe" : "ignore", "pipe", "pipe"],
|
|
1986
2421
|
cwd: options?.cwd,
|
|
1987
2422
|
env: options?.env ? {
|
|
@@ -2184,7 +2619,7 @@ var init_registry = __esm({
|
|
|
2184
2619
|
});
|
|
2185
2620
|
|
|
2186
2621
|
// packages/agent-defs/src/index.ts
|
|
2187
|
-
var
|
|
2622
|
+
var init_src3 = __esm({
|
|
2188
2623
|
"packages/agent-defs/src/index.ts"() {
|
|
2189
2624
|
"use strict";
|
|
2190
2625
|
init_agents();
|
|
@@ -2337,7 +2772,7 @@ var allSpawnConfigs, lookup2;
|
|
|
2337
2772
|
var init_configs = __esm({
|
|
2338
2773
|
"packages/agent-spawn/src/configs/index.ts"() {
|
|
2339
2774
|
"use strict";
|
|
2340
|
-
|
|
2775
|
+
init_src3();
|
|
2341
2776
|
init_claude_code2();
|
|
2342
2777
|
init_codex2();
|
|
2343
2778
|
init_opencode2();
|
|
@@ -2372,7 +2807,7 @@ function resolveConfig(agentId) {
|
|
|
2372
2807
|
var init_resolve_config = __esm({
|
|
2373
2808
|
"packages/agent-spawn/src/configs/resolve-config.ts"() {
|
|
2374
2809
|
"use strict";
|
|
2375
|
-
|
|
2810
|
+
init_src3();
|
|
2376
2811
|
init_configs();
|
|
2377
2812
|
}
|
|
2378
2813
|
});
|
|
@@ -2425,7 +2860,7 @@ function buildCliArgs(config2, options, stdinMode) {
|
|
|
2425
2860
|
}
|
|
2426
2861
|
return args;
|
|
2427
2862
|
}
|
|
2428
|
-
async function
|
|
2863
|
+
async function spawn3(agentId, options, context) {
|
|
2429
2864
|
const { agentId: resolvedId, binaryName, spawnConfig } = resolveCliConfig(agentId);
|
|
2430
2865
|
const stdinMode = options.useStdin && spawnConfig.stdinMode ? spawnConfig.stdinMode : void 0;
|
|
2431
2866
|
const spawnArgs = buildCliArgs(spawnConfig, options, stdinMode);
|
|
@@ -3235,7 +3670,7 @@ var init_static = __esm({
|
|
|
3235
3670
|
});
|
|
3236
3671
|
|
|
3237
3672
|
// packages/design-system/src/index.ts
|
|
3238
|
-
var
|
|
3673
|
+
var init_src4 = __esm({
|
|
3239
3674
|
"packages/design-system/src/index.ts"() {
|
|
3240
3675
|
"use strict";
|
|
3241
3676
|
init_tokens();
|
|
@@ -3328,7 +3763,7 @@ async function renderAcpStream(events) {
|
|
|
3328
3763
|
var init_renderer = __esm({
|
|
3329
3764
|
"packages/agent-spawn/src/acp/renderer.ts"() {
|
|
3330
3765
|
"use strict";
|
|
3331
|
-
|
|
3766
|
+
init_src4();
|
|
3332
3767
|
}
|
|
3333
3768
|
});
|
|
3334
3769
|
|
|
@@ -3338,13 +3773,13 @@ function truncate2(text4, maxLength) {
|
|
|
3338
3773
|
if (maxLength <= 3) return text4.slice(0, maxLength);
|
|
3339
3774
|
return `${text4.slice(0, maxLength - 3)}...`;
|
|
3340
3775
|
}
|
|
3341
|
-
function
|
|
3776
|
+
function isNonEmptyString2(value) {
|
|
3342
3777
|
return typeof value === "string" && value.length > 0;
|
|
3343
3778
|
}
|
|
3344
3779
|
function extractThreadId(value) {
|
|
3345
3780
|
if (!value || typeof value !== "object") return;
|
|
3346
3781
|
const obj = value;
|
|
3347
|
-
const maybeThreadId =
|
|
3782
|
+
const maybeThreadId = isNonEmptyString2(obj.thread_id) && obj.thread_id || isNonEmptyString2(obj.threadId) && obj.threadId || isNonEmptyString2(obj.threadID) && obj.threadID || isNonEmptyString2(obj.session_id) && obj.session_id || isNonEmptyString2(obj.sessionId) && obj.sessionId || isNonEmptyString2(obj.sessionID) && obj.sessionID;
|
|
3348
3783
|
return maybeThreadId || void 0;
|
|
3349
3784
|
}
|
|
3350
3785
|
var init_utils = __esm({
|
|
@@ -3390,7 +3825,7 @@ async function* adaptClaude(lines) {
|
|
|
3390
3825
|
continue;
|
|
3391
3826
|
}
|
|
3392
3827
|
const eventType = event.type;
|
|
3393
|
-
if (!
|
|
3828
|
+
if (!isNonEmptyString2(eventType)) continue;
|
|
3394
3829
|
if (!emittedSessionStart) {
|
|
3395
3830
|
const threadId = extractThreadId(event);
|
|
3396
3831
|
emittedSessionStart = true;
|
|
@@ -3413,16 +3848,16 @@ async function* adaptClaude(lines) {
|
|
|
3413
3848
|
const item = block;
|
|
3414
3849
|
if (!item || typeof item !== "object") continue;
|
|
3415
3850
|
const blockType = item.type;
|
|
3416
|
-
if (!
|
|
3851
|
+
if (!isNonEmptyString2(blockType)) continue;
|
|
3417
3852
|
if (eventType === "assistant") {
|
|
3418
|
-
if (blockType === "text" &&
|
|
3853
|
+
if (blockType === "text" && isNonEmptyString2(item.text)) {
|
|
3419
3854
|
yield {
|
|
3420
3855
|
event: "agent_message",
|
|
3421
3856
|
text: item.text
|
|
3422
3857
|
};
|
|
3423
3858
|
continue;
|
|
3424
3859
|
}
|
|
3425
|
-
if (blockType === "tool_use" &&
|
|
3860
|
+
if (blockType === "tool_use" && isNonEmptyString2(item.id) && isNonEmptyString2(item.name)) {
|
|
3426
3861
|
const kind = TOOL_KIND_MAP[item.name] ?? "other";
|
|
3427
3862
|
toolKindsById.set(item.id, kind);
|
|
3428
3863
|
yield {
|
|
@@ -3436,25 +3871,25 @@ async function* adaptClaude(lines) {
|
|
|
3436
3871
|
continue;
|
|
3437
3872
|
}
|
|
3438
3873
|
if (eventType === "user") {
|
|
3439
|
-
if (!
|
|
3874
|
+
if (!isNonEmptyString2(item.tool_use_id)) continue;
|
|
3440
3875
|
if (blockType !== "tool_result") continue;
|
|
3441
3876
|
const kind = toolKindsById.get(item.tool_use_id);
|
|
3442
3877
|
toolKindsById.delete(item.tool_use_id);
|
|
3443
|
-
let
|
|
3878
|
+
let path21;
|
|
3444
3879
|
if (typeof item.content === "string") {
|
|
3445
|
-
|
|
3880
|
+
path21 = item.content;
|
|
3446
3881
|
} else {
|
|
3447
3882
|
try {
|
|
3448
|
-
|
|
3883
|
+
path21 = JSON.stringify(item.content);
|
|
3449
3884
|
} catch {
|
|
3450
|
-
|
|
3885
|
+
path21 = String(item.content);
|
|
3451
3886
|
}
|
|
3452
3887
|
}
|
|
3453
3888
|
yield {
|
|
3454
3889
|
event: "tool_complete",
|
|
3455
3890
|
id: item.tool_use_id,
|
|
3456
3891
|
kind,
|
|
3457
|
-
path:
|
|
3892
|
+
path: path21
|
|
3458
3893
|
};
|
|
3459
3894
|
}
|
|
3460
3895
|
}
|
|
@@ -3508,7 +3943,7 @@ async function* adaptCodex(lines) {
|
|
|
3508
3943
|
continue;
|
|
3509
3944
|
}
|
|
3510
3945
|
const eventType = event.type;
|
|
3511
|
-
if (!
|
|
3946
|
+
if (!isNonEmptyString2(eventType)) continue;
|
|
3512
3947
|
if (eventType === "thread.started") {
|
|
3513
3948
|
const maybeThreadId = extractThreadId(event);
|
|
3514
3949
|
yield { event: "session_start", threadId: maybeThreadId };
|
|
@@ -3532,23 +3967,23 @@ async function* adaptCodex(lines) {
|
|
|
3532
3967
|
const item = event.item ?? null;
|
|
3533
3968
|
if (!item || typeof item !== "object") continue;
|
|
3534
3969
|
const itemType = item.type;
|
|
3535
|
-
if (!
|
|
3970
|
+
if (!isNonEmptyString2(itemType)) continue;
|
|
3536
3971
|
if (eventType === "item.started") {
|
|
3537
|
-
if (!
|
|
3972
|
+
if (!isNonEmptyString2(item.id)) continue;
|
|
3538
3973
|
let kind;
|
|
3539
3974
|
let title;
|
|
3540
3975
|
if (itemType === "command_execution") {
|
|
3541
3976
|
kind = "exec";
|
|
3542
|
-
title = truncate2(
|
|
3977
|
+
title = truncate2(isNonEmptyString2(item.command) ? item.command : "", 80);
|
|
3543
3978
|
} else if (itemType === "file_edit") {
|
|
3544
3979
|
kind = "edit";
|
|
3545
|
-
title =
|
|
3980
|
+
title = isNonEmptyString2(item.path) ? item.path : "";
|
|
3546
3981
|
} else if (itemType === "thinking") {
|
|
3547
3982
|
kind = "think";
|
|
3548
3983
|
title = "thinking...";
|
|
3549
3984
|
} else if (itemType === "mcp_tool_call") {
|
|
3550
|
-
const server =
|
|
3551
|
-
const tool =
|
|
3985
|
+
const server = isNonEmptyString2(item.server) ? item.server : "unknown";
|
|
3986
|
+
const tool = isNonEmptyString2(item.tool) ? item.tool : "unknown";
|
|
3552
3987
|
kind = "other";
|
|
3553
3988
|
title = `${server}.${tool}`;
|
|
3554
3989
|
}
|
|
@@ -3561,25 +3996,25 @@ async function* adaptCodex(lines) {
|
|
|
3561
3996
|
}
|
|
3562
3997
|
if (eventType === "item.completed") {
|
|
3563
3998
|
if (itemType === "agent_message") {
|
|
3564
|
-
if (!
|
|
3999
|
+
if (!isNonEmptyString2(item.text)) continue;
|
|
3565
4000
|
yield { event: "agent_message", text: item.text };
|
|
3566
4001
|
continue;
|
|
3567
4002
|
}
|
|
3568
4003
|
if (itemType === "reasoning") {
|
|
3569
|
-
const text4 =
|
|
4004
|
+
const text4 = isNonEmptyString2(item.text) ? item.text : isNonEmptyString2(item.content) ? item.content : isNonEmptyString2(item.summary) ? item.summary : void 0;
|
|
3570
4005
|
if (!text4) continue;
|
|
3571
4006
|
yield { event: "reasoning", text: text4 };
|
|
3572
4007
|
continue;
|
|
3573
4008
|
}
|
|
3574
|
-
if (!
|
|
4009
|
+
if (!isNonEmptyString2(item.id)) continue;
|
|
3575
4010
|
if (itemType === "command_execution" || itemType === "file_edit" || itemType === "mcp_tool_call") {
|
|
3576
4011
|
const kindFromStart = toolKindById.get(item.id);
|
|
3577
4012
|
const kind = kindFromStart ?? (itemType === "command_execution" ? "exec" : itemType === "file_edit" ? "edit" : "other");
|
|
3578
|
-
const titleFromEvent =
|
|
3579
|
-
const
|
|
4013
|
+
const titleFromEvent = isNonEmptyString2(item.path) ? item.path : itemType === "mcp_tool_call" ? `${isNonEmptyString2(item.server) ? item.server : "unknown"}.${isNonEmptyString2(item.tool) ? item.tool : "unknown"}` : void 0;
|
|
4014
|
+
const path21 = titleFromEvent ?? toolTitleById.get(item.id) ?? "";
|
|
3580
4015
|
toolTitleById.delete(item.id);
|
|
3581
4016
|
toolKindById.delete(item.id);
|
|
3582
|
-
yield { event: "tool_complete", id: item.id, kind, path:
|
|
4017
|
+
yield { event: "tool_complete", id: item.id, kind, path: path21 };
|
|
3583
4018
|
}
|
|
3584
4019
|
}
|
|
3585
4020
|
}
|
|
@@ -3618,9 +4053,9 @@ async function* adaptKimi(lines) {
|
|
|
3618
4053
|
}
|
|
3619
4054
|
}
|
|
3620
4055
|
const role = event.role;
|
|
3621
|
-
if (!
|
|
4056
|
+
if (!isNonEmptyString2(role) || role !== "assistant") continue;
|
|
3622
4057
|
const content = event.content;
|
|
3623
|
-
if (!
|
|
4058
|
+
if (!isNonEmptyString2(content)) continue;
|
|
3624
4059
|
yield { event: "agent_message", text: content };
|
|
3625
4060
|
}
|
|
3626
4061
|
}
|
|
@@ -3649,7 +4084,7 @@ async function* adaptNative(lines) {
|
|
|
3649
4084
|
continue;
|
|
3650
4085
|
}
|
|
3651
4086
|
const maybeEventType = event?.event;
|
|
3652
|
-
if (!
|
|
4087
|
+
if (!isNonEmptyString2(maybeEventType)) {
|
|
3653
4088
|
yield {
|
|
3654
4089
|
event: "error",
|
|
3655
4090
|
message: `[adaptNative] Line missing string "event" field: ${truncate2(line, 200)}`
|
|
@@ -3708,23 +4143,23 @@ async function* adaptOpenCode(lines) {
|
|
|
3708
4143
|
}
|
|
3709
4144
|
if (!event || typeof event !== "object") continue;
|
|
3710
4145
|
const sessionID = extractThreadId(event);
|
|
3711
|
-
if (!emittedSessionStart &&
|
|
4146
|
+
if (!emittedSessionStart && isNonEmptyString2(sessionID)) {
|
|
3712
4147
|
emittedSessionStart = true;
|
|
3713
4148
|
yield { event: "session_start", threadId: sessionID };
|
|
3714
4149
|
}
|
|
3715
4150
|
const eventType = event.type;
|
|
3716
|
-
if (!
|
|
4151
|
+
if (!isNonEmptyString2(eventType)) continue;
|
|
3717
4152
|
if (eventType === "text") {
|
|
3718
4153
|
const part = event.part ?? null;
|
|
3719
4154
|
if (!part || typeof part !== "object") continue;
|
|
3720
|
-
if (!
|
|
4155
|
+
if (!isNonEmptyString2(part.text)) continue;
|
|
3721
4156
|
yield { event: "agent_message", text: part.text };
|
|
3722
4157
|
continue;
|
|
3723
4158
|
}
|
|
3724
4159
|
if (eventType === "tool_use") {
|
|
3725
4160
|
const part = event.part ?? null;
|
|
3726
4161
|
if (!part || typeof part !== "object") continue;
|
|
3727
|
-
if (!
|
|
4162
|
+
if (!isNonEmptyString2(part.callID) || !isNonEmptyString2(part.tool)) continue;
|
|
3728
4163
|
const state = part.state ?? null;
|
|
3729
4164
|
if (!state || typeof state !== "object") continue;
|
|
3730
4165
|
const kind = guessToolKind(part.tool);
|
|
@@ -3736,7 +4171,7 @@ async function* adaptOpenCode(lines) {
|
|
|
3736
4171
|
const maybeInput = state.input;
|
|
3737
4172
|
if (kind === "exec" && maybeInput && typeof maybeInput === "object") {
|
|
3738
4173
|
const command = maybeInput.command;
|
|
3739
|
-
if (
|
|
4174
|
+
if (isNonEmptyString2(command)) {
|
|
3740
4175
|
title = truncate2(command, 80);
|
|
3741
4176
|
}
|
|
3742
4177
|
}
|
|
@@ -3938,7 +4373,7 @@ var init_spawn2 = __esm({
|
|
|
3938
4373
|
});
|
|
3939
4374
|
|
|
3940
4375
|
// packages/agent-spawn/src/index.ts
|
|
3941
|
-
var
|
|
4376
|
+
var init_src5 = __esm({
|
|
3942
4377
|
"packages/agent-spawn/src/index.ts"() {
|
|
3943
4378
|
"use strict";
|
|
3944
4379
|
init_run_command();
|
|
@@ -3954,7 +4389,7 @@ var init_src4 = __esm({
|
|
|
3954
4389
|
});
|
|
3955
4390
|
|
|
3956
4391
|
// src/cli/commands/shared.ts
|
|
3957
|
-
import
|
|
4392
|
+
import path6 from "node:path";
|
|
3958
4393
|
function resolveCommandFlags(program) {
|
|
3959
4394
|
const opts = program.optsWithGlobals();
|
|
3960
4395
|
return {
|
|
@@ -4027,7 +4462,7 @@ function buildResumeCommand(canonicalService, threadId, cwd) {
|
|
|
4027
4462
|
if (!binaryName) {
|
|
4028
4463
|
return void 0;
|
|
4029
4464
|
}
|
|
4030
|
-
const resumeCwd =
|
|
4465
|
+
const resumeCwd = path6.resolve(cwd);
|
|
4031
4466
|
const args = spawnConfig.resumeCommand(threadId, resumeCwd);
|
|
4032
4467
|
const agentCommand = [binaryName, ...args.map(shlexQuote)].join(" ");
|
|
4033
4468
|
const needsCdPrefix = !args.includes(resumeCwd);
|
|
@@ -4118,13 +4553,13 @@ var init_shared = __esm({
|
|
|
4118
4553
|
"use strict";
|
|
4119
4554
|
init_context();
|
|
4120
4555
|
init_isolated_env();
|
|
4121
|
-
|
|
4122
|
-
|
|
4556
|
+
init_src5();
|
|
4557
|
+
init_src3();
|
|
4123
4558
|
}
|
|
4124
4559
|
});
|
|
4125
4560
|
|
|
4126
4561
|
// src/sdk/spawn-core.ts
|
|
4127
|
-
import
|
|
4562
|
+
import path7 from "node:path";
|
|
4128
4563
|
import chalk10 from "chalk";
|
|
4129
4564
|
async function spawnCore(container, service, options, flags = { dryRun: false, verbose: false }) {
|
|
4130
4565
|
const cwdOverride = resolveSpawnWorkingDirectory(
|
|
@@ -4222,10 +4657,10 @@ function resolveSpawnWorkingDirectory(baseDir, candidate) {
|
|
|
4222
4657
|
if (!candidate || candidate.trim().length === 0) {
|
|
4223
4658
|
return void 0;
|
|
4224
4659
|
}
|
|
4225
|
-
if (
|
|
4660
|
+
if (path7.isAbsolute(candidate)) {
|
|
4226
4661
|
return candidate;
|
|
4227
4662
|
}
|
|
4228
|
-
return
|
|
4663
|
+
return path7.resolve(baseDir, candidate);
|
|
4229
4664
|
}
|
|
4230
4665
|
var init_spawn_core = __esm({
|
|
4231
4666
|
"src/sdk/spawn-core.ts"() {
|
|
@@ -4235,14 +4670,14 @@ var init_spawn_core = __esm({
|
|
|
4235
4670
|
});
|
|
4236
4671
|
|
|
4237
4672
|
// src/cli/environment.ts
|
|
4238
|
-
import
|
|
4673
|
+
import path8 from "node:path";
|
|
4239
4674
|
function createCliEnvironment(init) {
|
|
4240
4675
|
const platform = init.platform ?? process.platform;
|
|
4241
4676
|
const variables = init.variables ?? process.env;
|
|
4242
4677
|
const credentialsPath = resolveCredentialsPath(init.homeDir);
|
|
4243
4678
|
const logDir = resolveLogDir(init.homeDir);
|
|
4244
4679
|
const { poeApiBaseUrl, poeBaseUrl } = resolvePoeBaseUrls(variables);
|
|
4245
|
-
const resolveHomePath = (...segments) =>
|
|
4680
|
+
const resolveHomePath = (...segments) => path8.join(init.homeDir, ...segments);
|
|
4246
4681
|
const getVariable = (name) => variables[name];
|
|
4247
4682
|
return {
|
|
4248
4683
|
cwd: init.cwd,
|
|
@@ -4258,10 +4693,10 @@ function createCliEnvironment(init) {
|
|
|
4258
4693
|
};
|
|
4259
4694
|
}
|
|
4260
4695
|
function resolveCredentialsPath(homeDir) {
|
|
4261
|
-
return
|
|
4696
|
+
return path8.join(homeDir, ".poe-code", "credentials.json");
|
|
4262
4697
|
}
|
|
4263
4698
|
function resolveLogDir(homeDir) {
|
|
4264
|
-
return
|
|
4699
|
+
return path8.join(homeDir, ".poe-code", "logs");
|
|
4265
4700
|
}
|
|
4266
4701
|
function resolvePoeBaseUrls(variables) {
|
|
4267
4702
|
const raw = variables.POE_BASE_URL;
|
|
@@ -4429,7 +4864,7 @@ function createServiceRegistry() {
|
|
|
4429
4864
|
var init_service_registry = __esm({
|
|
4430
4865
|
"src/cli/service-registry.ts"() {
|
|
4431
4866
|
"use strict";
|
|
4432
|
-
|
|
4867
|
+
init_src3();
|
|
4433
4868
|
}
|
|
4434
4869
|
});
|
|
4435
4870
|
|
|
@@ -4793,12 +5228,12 @@ function createLoggerFactory(emitter, theme) {
|
|
|
4793
5228
|
var init_logger2 = __esm({
|
|
4794
5229
|
"src/cli/logger.ts"() {
|
|
4795
5230
|
"use strict";
|
|
4796
|
-
|
|
5231
|
+
init_src4();
|
|
4797
5232
|
}
|
|
4798
5233
|
});
|
|
4799
5234
|
|
|
4800
5235
|
// src/cli/error-logger.ts
|
|
4801
|
-
import
|
|
5236
|
+
import path9 from "node:path";
|
|
4802
5237
|
var DEFAULT_MAX_SIZE, DEFAULT_MAX_BACKUPS, ErrorLogger;
|
|
4803
5238
|
var init_error_logger = __esm({
|
|
4804
5239
|
"src/cli/error-logger.ts"() {
|
|
@@ -4815,7 +5250,7 @@ var init_error_logger = __esm({
|
|
|
4815
5250
|
fileLoggingAvailable;
|
|
4816
5251
|
constructor(options) {
|
|
4817
5252
|
this.fs = options.fs;
|
|
4818
|
-
this.logFilePath =
|
|
5253
|
+
this.logFilePath = path9.join(options.logDir, "errors.log");
|
|
4819
5254
|
this.logToStderr = options.logToStderr ?? true;
|
|
4820
5255
|
this.maxSize = options.maxSize ?? DEFAULT_MAX_SIZE;
|
|
4821
5256
|
this.maxBackups = options.maxBackups ?? DEFAULT_MAX_BACKUPS;
|
|
@@ -4934,7 +5369,7 @@ ${entry.stack}`);
|
|
|
4934
5369
|
return `${this.logFilePath}.${index}`;
|
|
4935
5370
|
}
|
|
4936
5371
|
ensureLogDirectory() {
|
|
4937
|
-
const directory =
|
|
5372
|
+
const directory = path9.dirname(this.logFilePath);
|
|
4938
5373
|
try {
|
|
4939
5374
|
if (!this.fs.existsSync(directory)) {
|
|
4940
5375
|
this.fs.mkdirSync(directory, { recursive: true });
|
|
@@ -4952,7 +5387,7 @@ ${entry.stack}`);
|
|
|
4952
5387
|
});
|
|
4953
5388
|
|
|
4954
5389
|
// src/providers/index.ts
|
|
4955
|
-
import
|
|
5390
|
+
import path10 from "node:path";
|
|
4956
5391
|
import { readdir } from "node:fs/promises";
|
|
4957
5392
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
4958
5393
|
function isProviderModule(filename) {
|
|
@@ -4979,7 +5414,7 @@ async function loadProviders() {
|
|
|
4979
5414
|
for (const entry of entries) {
|
|
4980
5415
|
if (!entry.isFile()) continue;
|
|
4981
5416
|
if (!isProviderModule(entry.name)) continue;
|
|
4982
|
-
const moduleUrl = pathToFileURL(
|
|
5417
|
+
const moduleUrl = pathToFileURL(path10.join(currentDir, entry.name)).href;
|
|
4983
5418
|
const moduleExports = await import(moduleUrl);
|
|
4984
5419
|
if (!moduleExports.provider) {
|
|
4985
5420
|
throw new Error(`Provider module "${entry.name}" must export "provider".`);
|
|
@@ -4995,8 +5430,8 @@ var moduleDir, currentDir, defaultProviders;
|
|
|
4995
5430
|
var init_providers = __esm({
|
|
4996
5431
|
async "src/providers/index.ts"() {
|
|
4997
5432
|
"use strict";
|
|
4998
|
-
moduleDir =
|
|
4999
|
-
currentDir =
|
|
5433
|
+
moduleDir = path10.dirname(fileURLToPath(import.meta.url));
|
|
5434
|
+
currentDir = path10.basename(moduleDir) === "providers" ? moduleDir : path10.join(moduleDir, "providers");
|
|
5000
5435
|
defaultProviders = await loadProviders();
|
|
5001
5436
|
}
|
|
5002
5437
|
});
|
|
@@ -5313,11 +5748,11 @@ var init_poe_code_command_runner = __esm({
|
|
|
5313
5748
|
|
|
5314
5749
|
// src/sdk/container.ts
|
|
5315
5750
|
import * as fs2 from "node:fs/promises";
|
|
5316
|
-
import * as
|
|
5751
|
+
import * as os from "node:os";
|
|
5317
5752
|
import * as nodeFsSync from "node:fs";
|
|
5318
5753
|
function createSdkContainer(options) {
|
|
5319
5754
|
const cwd = options?.cwd ?? process.cwd();
|
|
5320
|
-
const homeDir = options?.homeDir ??
|
|
5755
|
+
const homeDir = options?.homeDir ?? os.homedir();
|
|
5321
5756
|
const variables = options?.variables ?? process.env;
|
|
5322
5757
|
const verbose = options?.verbose ?? false;
|
|
5323
5758
|
const environment = createCliEnvironment({
|
|
@@ -5336,23 +5771,44 @@ function createSdkContainer(options) {
|
|
|
5336
5771
|
});
|
|
5337
5772
|
loggerFactory.setErrorLogger(errorLogger);
|
|
5338
5773
|
const asyncFs = {
|
|
5339
|
-
readFile: ((
|
|
5774
|
+
readFile: ((path21, encoding) => {
|
|
5340
5775
|
if (encoding) {
|
|
5341
|
-
return fs2.readFile(
|
|
5776
|
+
return fs2.readFile(path21, encoding);
|
|
5342
5777
|
}
|
|
5343
|
-
return fs2.readFile(
|
|
5778
|
+
return fs2.readFile(path21);
|
|
5344
5779
|
}),
|
|
5345
|
-
writeFile: (
|
|
5346
|
-
mkdir: (
|
|
5780
|
+
writeFile: (path21, data, opts) => fs2.writeFile(path21, data, opts),
|
|
5781
|
+
mkdir: (path21, opts) => fs2.mkdir(path21, opts).then(() => {
|
|
5347
5782
|
}),
|
|
5348
|
-
stat: (
|
|
5349
|
-
rm: (
|
|
5350
|
-
unlink: (
|
|
5351
|
-
readdir: (
|
|
5783
|
+
stat: (path21) => fs2.stat(path21),
|
|
5784
|
+
rm: (path21, opts) => fs2.rm(path21, opts),
|
|
5785
|
+
unlink: (path21) => fs2.unlink(path21),
|
|
5786
|
+
readdir: (path21) => fs2.readdir(path21),
|
|
5352
5787
|
copyFile: (src, dest) => fs2.copyFile(src, dest),
|
|
5353
|
-
chmod: (
|
|
5788
|
+
chmod: (path21, mode) => fs2.chmod(path21, mode)
|
|
5354
5789
|
};
|
|
5355
5790
|
const contextFactory = createCommandContextFactory({ fs: asyncFs });
|
|
5791
|
+
const authFs = {
|
|
5792
|
+
readFile: (filePath, encoding) => fs2.readFile(filePath, encoding),
|
|
5793
|
+
writeFile: (filePath, data, options2) => fs2.writeFile(filePath, data, options2),
|
|
5794
|
+
mkdir: (directoryPath, options2) => fs2.mkdir(directoryPath, options2).then(() => void 0),
|
|
5795
|
+
unlink: (filePath) => fs2.unlink(filePath),
|
|
5796
|
+
chmod: (filePath, mode) => fs2.chmod(filePath, mode)
|
|
5797
|
+
};
|
|
5798
|
+
const { store: authStore } = createAuthStore({
|
|
5799
|
+
env: variables,
|
|
5800
|
+
platform: process.platform,
|
|
5801
|
+
fileStore: {
|
|
5802
|
+
fs: authFs,
|
|
5803
|
+
getHomeDirectory: () => homeDir
|
|
5804
|
+
},
|
|
5805
|
+
legacyCredentials: {
|
|
5806
|
+
fs: authFs,
|
|
5807
|
+
getHomeDirectory: () => homeDir
|
|
5808
|
+
}
|
|
5809
|
+
});
|
|
5810
|
+
const readApiKey = authStore.getApiKey.bind(authStore);
|
|
5811
|
+
const writeApiKey = authStore.setApiKey.bind(authStore);
|
|
5356
5812
|
const noopPrompts = async () => {
|
|
5357
5813
|
throw new Error("SDK does not support interactive prompts");
|
|
5358
5814
|
};
|
|
@@ -5361,15 +5817,8 @@ function createSdkContainer(options) {
|
|
|
5361
5817
|
prompts: noopPrompts,
|
|
5362
5818
|
promptLibrary,
|
|
5363
5819
|
apiKeyStore: {
|
|
5364
|
-
read:
|
|
5365
|
-
|
|
5366
|
-
filePath: environment.credentialsPath
|
|
5367
|
-
}),
|
|
5368
|
-
write: (value) => saveCredentials({
|
|
5369
|
-
fs: asyncFs,
|
|
5370
|
-
filePath: environment.credentialsPath,
|
|
5371
|
-
apiKey: value
|
|
5372
|
-
})
|
|
5820
|
+
read: readApiKey,
|
|
5821
|
+
write: writeApiKey
|
|
5373
5822
|
}
|
|
5374
5823
|
});
|
|
5375
5824
|
const registry2 = createServiceRegistry();
|
|
@@ -5429,15 +5878,15 @@ var init_container = __esm({
|
|
|
5429
5878
|
init_options();
|
|
5430
5879
|
init_logger2();
|
|
5431
5880
|
init_error_logger();
|
|
5432
|
-
|
|
5881
|
+
init_src5();
|
|
5433
5882
|
await init_providers();
|
|
5434
5883
|
init_poe_code_command_runner();
|
|
5435
|
-
|
|
5884
|
+
init_src();
|
|
5436
5885
|
}
|
|
5437
5886
|
});
|
|
5438
5887
|
|
|
5439
5888
|
// src/sdk/spawn.ts
|
|
5440
|
-
function
|
|
5889
|
+
function spawn4(service, promptOrOptions, maybeOptions) {
|
|
5441
5890
|
const options = typeof promptOrOptions === "string" ? { ...maybeOptions, prompt: promptOrOptions } : promptOrOptions;
|
|
5442
5891
|
const emptyEvents = (async function* () {
|
|
5443
5892
|
})();
|
|
@@ -5498,7 +5947,7 @@ function spawn3(service, promptOrOptions, maybeOptions) {
|
|
|
5498
5947
|
}
|
|
5499
5948
|
if (spawnConfig && spawnConfig.kind === "cli") {
|
|
5500
5949
|
resolveEventsOnce(emptyEvents);
|
|
5501
|
-
return
|
|
5950
|
+
return spawn3(service, {
|
|
5502
5951
|
prompt: options.prompt,
|
|
5503
5952
|
cwd: options.cwd,
|
|
5504
5953
|
model: options.model,
|
|
@@ -5530,7 +5979,7 @@ var init_spawn3 = __esm({
|
|
|
5530
5979
|
init_credentials();
|
|
5531
5980
|
init_spawn_core();
|
|
5532
5981
|
await init_container();
|
|
5533
|
-
|
|
5982
|
+
init_src5();
|
|
5534
5983
|
}
|
|
5535
5984
|
});
|
|
5536
5985
|
|
|
@@ -5652,13 +6101,13 @@ async function readErrorBody(response) {
|
|
|
5652
6101
|
}
|
|
5653
6102
|
}
|
|
5654
6103
|
function extractTextContent(data) {
|
|
5655
|
-
if (!
|
|
6104
|
+
if (!isRecord4(data)) return void 0;
|
|
5656
6105
|
const choices = data.choices;
|
|
5657
6106
|
if (!Array.isArray(choices) || choices.length === 0) return void 0;
|
|
5658
6107
|
const first = choices[0];
|
|
5659
|
-
if (!
|
|
6108
|
+
if (!isRecord4(first)) return void 0;
|
|
5660
6109
|
const message = first.message;
|
|
5661
|
-
if (!
|
|
6110
|
+
if (!isRecord4(message)) return void 0;
|
|
5662
6111
|
return typeof message.content === "string" ? message.content : void 0;
|
|
5663
6112
|
}
|
|
5664
6113
|
function extractMediaFromCompletion(data) {
|
|
@@ -5666,14 +6115,14 @@ function extractMediaFromCompletion(data) {
|
|
|
5666
6115
|
if (!content) return {};
|
|
5667
6116
|
try {
|
|
5668
6117
|
const parsed = JSON.parse(content);
|
|
5669
|
-
if (
|
|
6118
|
+
if (isRecord4(parsed) && typeof parsed.url === "string") {
|
|
5670
6119
|
return {
|
|
5671
6120
|
url: parsed.url,
|
|
5672
6121
|
mimeType: typeof parsed.mimeType === "string" ? parsed.mimeType : void 0,
|
|
5673
6122
|
data: typeof parsed.data === "string" ? parsed.data : void 0
|
|
5674
6123
|
};
|
|
5675
6124
|
}
|
|
5676
|
-
if (
|
|
6125
|
+
if (isRecord4(parsed) && typeof parsed.data === "string") {
|
|
5677
6126
|
return {
|
|
5678
6127
|
data: parsed.data,
|
|
5679
6128
|
mimeType: typeof parsed.mimeType === "string" ? parsed.mimeType : void 0
|
|
@@ -5707,7 +6156,7 @@ function isValidUrl(value) {
|
|
|
5707
6156
|
return false;
|
|
5708
6157
|
}
|
|
5709
6158
|
}
|
|
5710
|
-
function
|
|
6159
|
+
function isRecord4(value) {
|
|
5711
6160
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
5712
6161
|
}
|
|
5713
6162
|
var init_llm_client = __esm({
|
|
@@ -5848,8 +6297,8 @@ var init_container2 = __esm({
|
|
|
5848
6297
|
init_options();
|
|
5849
6298
|
init_logger2();
|
|
5850
6299
|
init_error_logger();
|
|
6300
|
+
init_src5();
|
|
5851
6301
|
init_src4();
|
|
5852
|
-
init_src3();
|
|
5853
6302
|
await init_providers();
|
|
5854
6303
|
init_poe_code_command_runner();
|
|
5855
6304
|
}
|
|
@@ -6027,7 +6476,7 @@ var init_configure = __esm({
|
|
|
6027
6476
|
});
|
|
6028
6477
|
|
|
6029
6478
|
// src/cli/commands/spawn.ts
|
|
6030
|
-
import
|
|
6479
|
+
import path11 from "node:path";
|
|
6031
6480
|
function registerSpawnCommand(program, container, options = {}) {
|
|
6032
6481
|
const spawnServices = container.registry.list().filter((service) => typeof service.spawn === "function" || getSpawnConfig(service.name)).map((service) => service.name);
|
|
6033
6482
|
const extraServices = options.extraServices ?? [];
|
|
@@ -6152,7 +6601,7 @@ function registerSpawnCommand(program, container, options = {}) {
|
|
|
6152
6601
|
if (!proceed) {
|
|
6153
6602
|
return;
|
|
6154
6603
|
}
|
|
6155
|
-
const { events, result } =
|
|
6604
|
+
const { events, result } = spawn4(canonicalService, {
|
|
6156
6605
|
prompt: spawnOptions.prompt,
|
|
6157
6606
|
args: spawnOptions.args,
|
|
6158
6607
|
model: spawnOptions.model,
|
|
@@ -6215,16 +6664,16 @@ function resolveSpawnWorkingDirectory2(baseDir, candidate) {
|
|
|
6215
6664
|
if (!candidate || candidate.trim().length === 0) {
|
|
6216
6665
|
return void 0;
|
|
6217
6666
|
}
|
|
6218
|
-
if (
|
|
6667
|
+
if (path11.isAbsolute(candidate)) {
|
|
6219
6668
|
return candidate;
|
|
6220
6669
|
}
|
|
6221
|
-
return
|
|
6670
|
+
return path11.resolve(baseDir, candidate);
|
|
6222
6671
|
}
|
|
6223
6672
|
var init_spawn4 = __esm({
|
|
6224
6673
|
async "src/cli/commands/spawn.ts"() {
|
|
6225
6674
|
"use strict";
|
|
6675
|
+
init_src5();
|
|
6226
6676
|
init_src4();
|
|
6227
|
-
init_src3();
|
|
6228
6677
|
init_credentials2();
|
|
6229
6678
|
init_shared();
|
|
6230
6679
|
init_spawn_core();
|
|
@@ -6233,7 +6682,7 @@ var init_spawn4 = __esm({
|
|
|
6233
6682
|
});
|
|
6234
6683
|
|
|
6235
6684
|
// src/sdk/research.ts
|
|
6236
|
-
import
|
|
6685
|
+
import path12 from "node:path";
|
|
6237
6686
|
async function research(container, options) {
|
|
6238
6687
|
const logger2 = options.logger;
|
|
6239
6688
|
const source = await resolveSource({
|
|
@@ -6243,7 +6692,7 @@ async function research(container, options) {
|
|
|
6243
6692
|
});
|
|
6244
6693
|
const researchPrompt = buildResearchPrompt(options.prompt);
|
|
6245
6694
|
const mode = options.mode ?? "read";
|
|
6246
|
-
const { events, result } =
|
|
6695
|
+
const { events, result } = spawn4(options.agent, {
|
|
6247
6696
|
prompt: researchPrompt,
|
|
6248
6697
|
args: options.args ?? [],
|
|
6249
6698
|
model: options.model,
|
|
@@ -6268,7 +6717,7 @@ async function research(container, options) {
|
|
|
6268
6717
|
markdown: markdownOutput
|
|
6269
6718
|
});
|
|
6270
6719
|
outputPath = buildOutputPath(container.env.homeDir, options.prompt);
|
|
6271
|
-
await ensureDirectory2(container.fs,
|
|
6720
|
+
await ensureDirectory2(container.fs, path12.dirname(outputPath));
|
|
6272
6721
|
await container.fs.writeFile(outputPath, document, {
|
|
6273
6722
|
encoding: "utf8"
|
|
6274
6723
|
});
|
|
@@ -6343,7 +6792,7 @@ function buildResearchDocument(input) {
|
|
|
6343
6792
|
}
|
|
6344
6793
|
function buildClonePath(homeDir, github) {
|
|
6345
6794
|
const slug = extractRepoSlug(github);
|
|
6346
|
-
return
|
|
6795
|
+
return path12.join(homeDir, ".poe-code", "repos", slug);
|
|
6347
6796
|
}
|
|
6348
6797
|
function extractRepoSlug(value) {
|
|
6349
6798
|
const trimmed = value.trim();
|
|
@@ -6381,7 +6830,7 @@ function extractRepoSlug(value) {
|
|
|
6381
6830
|
function buildOutputPath(homeDir, prompt, now = /* @__PURE__ */ new Date()) {
|
|
6382
6831
|
const timestamp = formatTimestamp(now);
|
|
6383
6832
|
const slug = buildSlug(prompt);
|
|
6384
|
-
return
|
|
6833
|
+
return path12.join(
|
|
6385
6834
|
homeDir,
|
|
6386
6835
|
".poe-code",
|
|
6387
6836
|
"research",
|
|
@@ -6402,7 +6851,7 @@ async function resolveSource(input) {
|
|
|
6402
6851
|
if (options.github) {
|
|
6403
6852
|
const cloneUrl = resolveGithubCloneUrl(options.github);
|
|
6404
6853
|
const clonePath = buildClonePath(container.env.homeDir, options.github);
|
|
6405
|
-
await ensureDirectory2(container.fs,
|
|
6854
|
+
await ensureDirectory2(container.fs, path12.dirname(clonePath));
|
|
6406
6855
|
const exists = await pathExists2(container.fs, clonePath);
|
|
6407
6856
|
if (!exists) {
|
|
6408
6857
|
const cloneResult = await container.commandRunner(
|
|
@@ -6500,10 +6949,10 @@ function formatYamlString(value) {
|
|
|
6500
6949
|
return JSON.stringify(value);
|
|
6501
6950
|
}
|
|
6502
6951
|
function resolvePath2(baseDir, candidate) {
|
|
6503
|
-
if (
|
|
6952
|
+
if (path12.isAbsolute(candidate)) {
|
|
6504
6953
|
return candidate;
|
|
6505
6954
|
}
|
|
6506
|
-
return
|
|
6955
|
+
return path12.resolve(baseDir, candidate);
|
|
6507
6956
|
}
|
|
6508
6957
|
function teeAcpStream(events) {
|
|
6509
6958
|
const chunks = [];
|
|
@@ -6563,7 +7012,7 @@ async function removePathFallback(fs3, target) {
|
|
|
6563
7012
|
if (stats && typeof stats.isDirectory === "function" && stats.isDirectory()) {
|
|
6564
7013
|
const entries = await fs3.readdir(target);
|
|
6565
7014
|
for (const entry of entries) {
|
|
6566
|
-
await removePathFallback(fs3,
|
|
7015
|
+
await removePathFallback(fs3, path12.join(target, entry));
|
|
6567
7016
|
}
|
|
6568
7017
|
}
|
|
6569
7018
|
try {
|
|
@@ -6729,7 +7178,7 @@ async function resolveResearchModel(input) {
|
|
|
6729
7178
|
var init_research2 = __esm({
|
|
6730
7179
|
async "src/cli/commands/research.ts"() {
|
|
6731
7180
|
"use strict";
|
|
6732
|
-
|
|
7181
|
+
init_src5();
|
|
6733
7182
|
init_credentials2();
|
|
6734
7183
|
await init_research();
|
|
6735
7184
|
init_errors();
|
|
@@ -6738,7 +7187,7 @@ var init_research2 = __esm({
|
|
|
6738
7187
|
});
|
|
6739
7188
|
|
|
6740
7189
|
// src/cli/isolated-env-runner.ts
|
|
6741
|
-
import { spawn as
|
|
7190
|
+
import { spawn as spawn5 } from "node:child_process";
|
|
6742
7191
|
async function isolatedEnvRunner(input) {
|
|
6743
7192
|
const details = await resolveIsolatedEnvDetails(
|
|
6744
7193
|
input.env,
|
|
@@ -6763,7 +7212,7 @@ async function isolatedEnvRunner(input) {
|
|
|
6763
7212
|
);
|
|
6764
7213
|
args = buildArgsWithMergedSettings(args, resolvedSettings);
|
|
6765
7214
|
}
|
|
6766
|
-
const child =
|
|
7215
|
+
const child = spawn5(details.agentBinary, args, {
|
|
6767
7216
|
stdio: "inherit",
|
|
6768
7217
|
env: {
|
|
6769
7218
|
...process.env,
|
|
@@ -6796,7 +7245,7 @@ async function configExists(fs3, filePath) {
|
|
|
6796
7245
|
var init_isolated_env_runner = __esm({
|
|
6797
7246
|
"src/cli/isolated-env-runner.ts"() {
|
|
6798
7247
|
"use strict";
|
|
6799
|
-
|
|
7248
|
+
init_src2();
|
|
6800
7249
|
init_isolated_env();
|
|
6801
7250
|
init_cli_settings_merge();
|
|
6802
7251
|
}
|
|
@@ -7302,7 +7751,7 @@ var init_test = __esm({
|
|
|
7302
7751
|
init_shared();
|
|
7303
7752
|
init_configure();
|
|
7304
7753
|
init_isolated_env();
|
|
7305
|
-
|
|
7754
|
+
init_src4();
|
|
7306
7755
|
}
|
|
7307
7756
|
});
|
|
7308
7757
|
|
|
@@ -7355,7 +7804,7 @@ var init_media_download = __esm({
|
|
|
7355
7804
|
});
|
|
7356
7805
|
|
|
7357
7806
|
// src/cli/commands/generate.ts
|
|
7358
|
-
import
|
|
7807
|
+
import path13 from "node:path";
|
|
7359
7808
|
function registerGenerateCommand(program, container) {
|
|
7360
7809
|
const generate2 = program.command("generate").description("Generate content via Poe API").option("--model <model>", `Model identifier (default: ${DEFAULT_TEXT_MODEL})`).option(
|
|
7361
7810
|
"--param <key=value>",
|
|
@@ -7618,11 +8067,11 @@ function getDefaultMimeType(type) {
|
|
|
7618
8067
|
return defaults[type];
|
|
7619
8068
|
}
|
|
7620
8069
|
function resolveOutputPath(filename, cwd) {
|
|
7621
|
-
if (
|
|
8070
|
+
if (path13.isAbsolute(filename)) {
|
|
7622
8071
|
return { path: filename, label: filename };
|
|
7623
8072
|
}
|
|
7624
8073
|
return {
|
|
7625
|
-
path:
|
|
8074
|
+
path: path13.join(cwd, filename),
|
|
7626
8075
|
label: `./${filename}`
|
|
7627
8076
|
};
|
|
7628
8077
|
}
|
|
@@ -7630,7 +8079,7 @@ var MODEL_ENV_KEYS2, DEFAULT_MODELS2;
|
|
|
7630
8079
|
var init_generate = __esm({
|
|
7631
8080
|
"src/cli/commands/generate.ts"() {
|
|
7632
8081
|
"use strict";
|
|
7633
|
-
|
|
8082
|
+
init_src4();
|
|
7634
8083
|
init_constants();
|
|
7635
8084
|
init_shared();
|
|
7636
8085
|
init_client_instance();
|
|
@@ -8726,8 +9175,8 @@ var init_parseUtil = __esm({
|
|
|
8726
9175
|
init_errors2();
|
|
8727
9176
|
init_en();
|
|
8728
9177
|
makeIssue = (params) => {
|
|
8729
|
-
const { data, path:
|
|
8730
|
-
const fullPath = [...
|
|
9178
|
+
const { data, path: path21, errorMaps, issueData } = params;
|
|
9179
|
+
const fullPath = [...path21, ...issueData.path || []];
|
|
8731
9180
|
const fullIssue = {
|
|
8732
9181
|
...issueData,
|
|
8733
9182
|
path: fullPath
|
|
@@ -9007,11 +9456,11 @@ var init_types3 = __esm({
|
|
|
9007
9456
|
init_parseUtil();
|
|
9008
9457
|
init_util();
|
|
9009
9458
|
ParseInputLazyPath = class {
|
|
9010
|
-
constructor(parent, value,
|
|
9459
|
+
constructor(parent, value, path21, key) {
|
|
9011
9460
|
this._cachedPath = [];
|
|
9012
9461
|
this.parent = parent;
|
|
9013
9462
|
this.data = value;
|
|
9014
|
-
this._path =
|
|
9463
|
+
this._path = path21;
|
|
9015
9464
|
this._key = key;
|
|
9016
9465
|
}
|
|
9017
9466
|
get path() {
|
|
@@ -12515,10 +12964,10 @@ function mergeDefs(...defs) {
|
|
|
12515
12964
|
function cloneDef(schema) {
|
|
12516
12965
|
return mergeDefs(schema._zod.def);
|
|
12517
12966
|
}
|
|
12518
|
-
function getElementAtPath(obj,
|
|
12519
|
-
if (!
|
|
12967
|
+
function getElementAtPath(obj, path21) {
|
|
12968
|
+
if (!path21)
|
|
12520
12969
|
return obj;
|
|
12521
|
-
return
|
|
12970
|
+
return path21.reduce((acc, key) => acc?.[key], obj);
|
|
12522
12971
|
}
|
|
12523
12972
|
function promiseAllObject(promisesObj) {
|
|
12524
12973
|
const keys = Object.keys(promisesObj);
|
|
@@ -12830,11 +13279,11 @@ function aborted(x, startIndex = 0) {
|
|
|
12830
13279
|
}
|
|
12831
13280
|
return false;
|
|
12832
13281
|
}
|
|
12833
|
-
function prefixIssues(
|
|
13282
|
+
function prefixIssues(path21, issues) {
|
|
12834
13283
|
return issues.map((iss) => {
|
|
12835
13284
|
var _a2;
|
|
12836
13285
|
(_a2 = iss).path ?? (_a2.path = []);
|
|
12837
|
-
iss.path.unshift(
|
|
13286
|
+
iss.path.unshift(path21);
|
|
12838
13287
|
return iss;
|
|
12839
13288
|
});
|
|
12840
13289
|
}
|
|
@@ -13210,7 +13659,7 @@ __export(regexes_exports, {
|
|
|
13210
13659
|
extendedDuration: () => extendedDuration,
|
|
13211
13660
|
guid: () => guid,
|
|
13212
13661
|
hex: () => hex,
|
|
13213
|
-
hostname: () =>
|
|
13662
|
+
hostname: () => hostname2,
|
|
13214
13663
|
html5Email: () => html5Email,
|
|
13215
13664
|
idnEmail: () => idnEmail,
|
|
13216
13665
|
integer: () => integer,
|
|
@@ -13277,7 +13726,7 @@ function fixedBase64(bodyLength, padding) {
|
|
|
13277
13726
|
function fixedBase64url(length) {
|
|
13278
13727
|
return new RegExp(`^[A-Za-z0-9_-]{${length}}$`);
|
|
13279
13728
|
}
|
|
13280
|
-
var cuid, cuid2, ulid, xid, ksuid, nanoid, duration, extendedDuration, guid, uuid, uuid4, uuid6, uuid7, email, html5Email, rfc5322Email, unicodeEmail, idnEmail, browserEmail, _emoji, ipv4, ipv6, mac, cidrv4, cidrv6, base64, base64url,
|
|
13729
|
+
var cuid, cuid2, ulid, xid, ksuid, nanoid, duration, extendedDuration, guid, uuid, uuid4, uuid6, uuid7, email, html5Email, rfc5322Email, unicodeEmail, idnEmail, browserEmail, _emoji, ipv4, ipv6, mac, cidrv4, cidrv6, base64, base64url, hostname2, domain, e164, dateSource, date, string, bigint, integer, number, boolean, _null, _undefined, lowercase, uppercase, hex, md5_hex, md5_base64, md5_base64url, sha1_hex, sha1_base64, sha1_base64url, sha256_hex, sha256_base64, sha256_base64url, sha384_hex, sha384_base64, sha384_base64url, sha512_hex, sha512_base64, sha512_base64url;
|
|
13281
13730
|
var init_regexes = __esm({
|
|
13282
13731
|
"node_modules/zod/v4/core/regexes.js"() {
|
|
13283
13732
|
init_util2();
|
|
@@ -13315,7 +13764,7 @@ var init_regexes = __esm({
|
|
|
13315
13764
|
cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
13316
13765
|
base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
13317
13766
|
base64url = /^[A-Za-z0-9_-]*$/;
|
|
13318
|
-
|
|
13767
|
+
hostname2 = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
|
|
13319
13768
|
domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
|
|
13320
13769
|
e164 = /^\+[1-9]\d{6,14}$/;
|
|
13321
13770
|
dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
|
|
@@ -18521,7 +18970,7 @@ __export(schemas_exports3, {
|
|
|
18521
18970
|
guid: () => guid2,
|
|
18522
18971
|
hash: () => hash,
|
|
18523
18972
|
hex: () => hex2,
|
|
18524
|
-
hostname: () =>
|
|
18973
|
+
hostname: () => hostname3,
|
|
18525
18974
|
httpUrl: () => httpUrl,
|
|
18526
18975
|
instanceof: () => _instanceof,
|
|
18527
18976
|
int: () => int,
|
|
@@ -18668,7 +19117,7 @@ function jwt(params) {
|
|
|
18668
19117
|
function stringFormat(format, fnOrRegex, _params = {}) {
|
|
18669
19118
|
return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
|
|
18670
19119
|
}
|
|
18671
|
-
function
|
|
19120
|
+
function hostname3(_params) {
|
|
18672
19121
|
return _stringFormat(ZodCustomStringFormat, "hostname", regexes_exports.hostname, _params);
|
|
18673
19122
|
}
|
|
18674
19123
|
function hex2(_params) {
|
|
@@ -24792,8 +25241,8 @@ var require_utils = __commonJS({
|
|
|
24792
25241
|
}
|
|
24793
25242
|
return ind;
|
|
24794
25243
|
}
|
|
24795
|
-
function removeDotSegments(
|
|
24796
|
-
let input =
|
|
25244
|
+
function removeDotSegments(path21) {
|
|
25245
|
+
let input = path21;
|
|
24797
25246
|
const output = [];
|
|
24798
25247
|
let nextSlash = -1;
|
|
24799
25248
|
let len = 0;
|
|
@@ -24992,8 +25441,8 @@ var require_schemes = __commonJS({
|
|
|
24992
25441
|
wsComponent.secure = void 0;
|
|
24993
25442
|
}
|
|
24994
25443
|
if (wsComponent.resourceName) {
|
|
24995
|
-
const [
|
|
24996
|
-
wsComponent.path =
|
|
25444
|
+
const [path21, query] = wsComponent.resourceName.split("?");
|
|
25445
|
+
wsComponent.path = path21 && path21 !== "/" ? path21 : void 0;
|
|
24997
25446
|
wsComponent.query = query;
|
|
24998
25447
|
wsComponent.resourceName = void 0;
|
|
24999
25448
|
}
|
|
@@ -34107,7 +34556,7 @@ var init_content = __esm({
|
|
|
34107
34556
|
});
|
|
34108
34557
|
|
|
34109
34558
|
// packages/tiny-stdio-mcp-server/src/index.ts
|
|
34110
|
-
var
|
|
34559
|
+
var init_src6 = __esm({
|
|
34111
34560
|
"packages/tiny-stdio-mcp-server/src/index.ts"() {
|
|
34112
34561
|
"use strict";
|
|
34113
34562
|
init_server();
|
|
@@ -34411,7 +34860,7 @@ var generateTextSchema, generateImageSchema, generateVideoSchema, generateAudioS
|
|
|
34411
34860
|
var init_mcp_server = __esm({
|
|
34412
34861
|
"src/cli/mcp-server.ts"() {
|
|
34413
34862
|
"use strict";
|
|
34414
|
-
|
|
34863
|
+
init_src6();
|
|
34415
34864
|
init_client_instance();
|
|
34416
34865
|
init_constants();
|
|
34417
34866
|
generateTextSchema = defineSchema({
|
|
@@ -34669,7 +35118,7 @@ ${panel.footer}`);
|
|
|
34669
35118
|
var init_command_not_found = __esm({
|
|
34670
35119
|
"src/cli/command-not-found.ts"() {
|
|
34671
35120
|
"use strict";
|
|
34672
|
-
|
|
35121
|
+
init_src4();
|
|
34673
35122
|
init_execution_context();
|
|
34674
35123
|
init_errors();
|
|
34675
35124
|
}
|
|
@@ -34704,7 +35153,7 @@ var agentMcpConfigs, supportedAgents;
|
|
|
34704
35153
|
var init_configs2 = __esm({
|
|
34705
35154
|
"packages/agent-mcp-config/src/configs.ts"() {
|
|
34706
35155
|
"use strict";
|
|
34707
|
-
|
|
35156
|
+
init_src3();
|
|
34708
35157
|
agentMcpConfigs = {
|
|
34709
35158
|
"claude-code": {
|
|
34710
35159
|
configFile: "~/.claude.json",
|
|
@@ -34817,9 +35266,9 @@ var init_shapes = __esm({
|
|
|
34817
35266
|
});
|
|
34818
35267
|
|
|
34819
35268
|
// packages/agent-mcp-config/src/apply.ts
|
|
34820
|
-
import
|
|
35269
|
+
import path14 from "node:path";
|
|
34821
35270
|
function getConfigDirectory(configPath) {
|
|
34822
|
-
return
|
|
35271
|
+
return path14.dirname(configPath);
|
|
34823
35272
|
}
|
|
34824
35273
|
function isConfigObject5(value) {
|
|
34825
35274
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
@@ -34908,7 +35357,7 @@ var UnsupportedAgentError;
|
|
|
34908
35357
|
var init_apply = __esm({
|
|
34909
35358
|
"packages/agent-mcp-config/src/apply.ts"() {
|
|
34910
35359
|
"use strict";
|
|
34911
|
-
|
|
35360
|
+
init_src2();
|
|
34912
35361
|
init_configs2();
|
|
34913
35362
|
init_shapes();
|
|
34914
35363
|
UnsupportedAgentError = class extends Error {
|
|
@@ -34921,7 +35370,7 @@ var init_apply = __esm({
|
|
|
34921
35370
|
});
|
|
34922
35371
|
|
|
34923
35372
|
// packages/agent-mcp-config/src/index.ts
|
|
34924
|
-
var
|
|
35373
|
+
var init_src7 = __esm({
|
|
34925
35374
|
"packages/agent-mcp-config/src/index.ts"() {
|
|
34926
35375
|
"use strict";
|
|
34927
35376
|
init_configs2();
|
|
@@ -35102,22 +35551,22 @@ var DEFAULT_MCP_AGENT;
|
|
|
35102
35551
|
var init_mcp = __esm({
|
|
35103
35552
|
"src/cli/commands/mcp.ts"() {
|
|
35104
35553
|
"use strict";
|
|
35105
|
-
|
|
35554
|
+
init_src4();
|
|
35106
35555
|
init_credentials2();
|
|
35107
35556
|
init_client_instance();
|
|
35108
35557
|
init_mcp_server();
|
|
35109
35558
|
init_shared();
|
|
35110
35559
|
init_mcp_output_format();
|
|
35111
35560
|
init_command_not_found();
|
|
35112
|
-
|
|
35561
|
+
init_src7();
|
|
35113
35562
|
init_execution_context();
|
|
35114
35563
|
DEFAULT_MCP_AGENT = "claude-code";
|
|
35115
35564
|
}
|
|
35116
35565
|
});
|
|
35117
35566
|
|
|
35118
35567
|
// packages/agent-skill-config/src/configs.ts
|
|
35119
|
-
import
|
|
35120
|
-
import
|
|
35568
|
+
import os2 from "node:os";
|
|
35569
|
+
import path15 from "node:path";
|
|
35121
35570
|
function resolveAgentSupport2(input, registry2 = agentSkillConfigs) {
|
|
35122
35571
|
const resolvedId = resolveAgentId(input);
|
|
35123
35572
|
if (!resolvedId) {
|
|
@@ -35133,7 +35582,7 @@ var agentSkillConfigs, supportedAgents2;
|
|
|
35133
35582
|
var init_configs3 = __esm({
|
|
35134
35583
|
"packages/agent-skill-config/src/configs.ts"() {
|
|
35135
35584
|
"use strict";
|
|
35136
|
-
|
|
35585
|
+
init_src3();
|
|
35137
35586
|
agentSkillConfigs = {
|
|
35138
35587
|
"claude-code": {
|
|
35139
35588
|
globalSkillDir: "~/.claude/skills",
|
|
@@ -35153,7 +35602,7 @@ var init_configs3 = __esm({
|
|
|
35153
35602
|
});
|
|
35154
35603
|
|
|
35155
35604
|
// packages/agent-skill-config/src/templates.ts
|
|
35156
|
-
import { readFile as
|
|
35605
|
+
import { readFile as readFile2 } from "node:fs/promises";
|
|
35157
35606
|
async function getTemplates() {
|
|
35158
35607
|
if (templatesCache) {
|
|
35159
35608
|
return templatesCache;
|
|
@@ -35162,7 +35611,7 @@ async function getTemplates() {
|
|
|
35162
35611
|
"./templates/poe-generate.md",
|
|
35163
35612
|
import.meta.url
|
|
35164
35613
|
);
|
|
35165
|
-
const poeGenerateTemplate = await
|
|
35614
|
+
const poeGenerateTemplate = await readFile2(poeGenerateTemplateUrl, "utf8");
|
|
35166
35615
|
templatesCache = {
|
|
35167
35616
|
"poe-generate.md": poeGenerateTemplate
|
|
35168
35617
|
};
|
|
@@ -35294,7 +35743,7 @@ var UnsupportedAgentError2, bundledSkillTemplateIds, SKILL_TEMPLATE_ID;
|
|
|
35294
35743
|
var init_apply2 = __esm({
|
|
35295
35744
|
"packages/agent-skill-config/src/apply.ts"() {
|
|
35296
35745
|
"use strict";
|
|
35297
|
-
|
|
35746
|
+
init_src2();
|
|
35298
35747
|
init_configs3();
|
|
35299
35748
|
init_templates();
|
|
35300
35749
|
UnsupportedAgentError2 = class extends Error {
|
|
@@ -35309,7 +35758,7 @@ var init_apply2 = __esm({
|
|
|
35309
35758
|
});
|
|
35310
35759
|
|
|
35311
35760
|
// packages/agent-skill-config/src/index.ts
|
|
35312
|
-
var
|
|
35761
|
+
var init_src8 = __esm({
|
|
35313
35762
|
"packages/agent-skill-config/src/index.ts"() {
|
|
35314
35763
|
"use strict";
|
|
35315
35764
|
init_configs3();
|
|
@@ -35533,8 +35982,8 @@ var DEFAULT_SKILL_AGENT;
|
|
|
35533
35982
|
var init_skill = __esm({
|
|
35534
35983
|
"src/cli/commands/skill.ts"() {
|
|
35535
35984
|
"use strict";
|
|
35536
|
-
|
|
35537
|
-
|
|
35985
|
+
init_src4();
|
|
35986
|
+
init_src8();
|
|
35538
35987
|
init_shared();
|
|
35539
35988
|
init_command_not_found();
|
|
35540
35989
|
DEFAULT_SKILL_AGENT = "claude-code";
|
|
@@ -35624,7 +36073,7 @@ async function displayVersion(container, currentVersion) {
|
|
|
35624
36073
|
var init_version2 = __esm({
|
|
35625
36074
|
"src/cli/commands/version.ts"() {
|
|
35626
36075
|
"use strict";
|
|
35627
|
-
|
|
36076
|
+
init_src4();
|
|
35628
36077
|
init_version();
|
|
35629
36078
|
init_exit_signals();
|
|
35630
36079
|
}
|
|
@@ -35749,10 +36198,10 @@ var init_registry2 = __esm({
|
|
|
35749
36198
|
});
|
|
35750
36199
|
|
|
35751
36200
|
// packages/worktree/src/create.ts
|
|
35752
|
-
import { join
|
|
36201
|
+
import { join } from "node:path";
|
|
35753
36202
|
async function createWorktree(opts) {
|
|
35754
36203
|
const branch = `poe-code/${opts.name}`;
|
|
35755
|
-
const worktreePath =
|
|
36204
|
+
const worktreePath = join(opts.worktreeDir, opts.name);
|
|
35756
36205
|
try {
|
|
35757
36206
|
await opts.deps.exec(`git worktree remove ${worktreePath} --force`, { cwd: opts.cwd });
|
|
35758
36207
|
} catch {
|
|
@@ -35827,7 +36276,7 @@ var init_list = __esm({
|
|
|
35827
36276
|
});
|
|
35828
36277
|
|
|
35829
36278
|
// packages/worktree/src/index.ts
|
|
35830
|
-
var
|
|
36279
|
+
var init_src9 = __esm({
|
|
35831
36280
|
"packages/worktree/src/index.ts"() {
|
|
35832
36281
|
"use strict";
|
|
35833
36282
|
init_create();
|
|
@@ -35916,13 +36365,13 @@ function getDirtyFiles(cwd) {
|
|
|
35916
36365
|
for (const line of lines) {
|
|
35917
36366
|
if (!line) continue;
|
|
35918
36367
|
if (line.length < 4) continue;
|
|
35919
|
-
let
|
|
36368
|
+
let path21 = line.slice(3).trim();
|
|
35920
36369
|
const renameArrow = " -> ";
|
|
35921
|
-
const arrowIndex =
|
|
36370
|
+
const arrowIndex = path21.lastIndexOf(renameArrow);
|
|
35922
36371
|
if (arrowIndex >= 0) {
|
|
35923
|
-
|
|
36372
|
+
path21 = path21.slice(arrowIndex + renameArrow.length).trim();
|
|
35924
36373
|
}
|
|
35925
|
-
if (
|
|
36374
|
+
if (path21) files.push(path21);
|
|
35926
36375
|
}
|
|
35927
36376
|
return files;
|
|
35928
36377
|
}
|
|
@@ -35934,7 +36383,7 @@ var init_utils2 = __esm({
|
|
|
35934
36383
|
|
|
35935
36384
|
// packages/ralph/src/plan/parser.ts
|
|
35936
36385
|
import { parse as parse7 } from "yaml";
|
|
35937
|
-
function
|
|
36386
|
+
function isRecord5(value) {
|
|
35938
36387
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
35939
36388
|
}
|
|
35940
36389
|
function asOptionalString(value, field) {
|
|
@@ -35985,7 +36434,7 @@ function normalizeStatus(value) {
|
|
|
35985
36434
|
);
|
|
35986
36435
|
}
|
|
35987
36436
|
function parseStory(value, index) {
|
|
35988
|
-
if (!
|
|
36437
|
+
if (!isRecord5(value)) throw new Error(`Invalid stories[${index}]: expected object`);
|
|
35989
36438
|
return {
|
|
35990
36439
|
id: asRequiredString(value.id, `stories[${index}].id`),
|
|
35991
36440
|
title: asRequiredString(value.title, `stories[${index}].title`),
|
|
@@ -36009,7 +36458,7 @@ function parsePlan(yamlContent) {
|
|
|
36009
36458
|
const message = error2 instanceof Error ? error2.message : String(error2);
|
|
36010
36459
|
throw new Error(`Invalid plan YAML: ${message}`, { cause: error2 });
|
|
36011
36460
|
}
|
|
36012
|
-
if (!
|
|
36461
|
+
if (!isRecord5(doc)) {
|
|
36013
36462
|
throw new Error("Invalid plan YAML: expected top-level object");
|
|
36014
36463
|
}
|
|
36015
36464
|
const storiesValue = doc.stories;
|
|
@@ -36075,17 +36524,17 @@ function serializePlan(prd) {
|
|
|
36075
36524
|
return yaml.endsWith("\n") ? yaml : `${yaml}
|
|
36076
36525
|
`;
|
|
36077
36526
|
}
|
|
36078
|
-
function lockPlanFile(
|
|
36079
|
-
return lockFile(
|
|
36527
|
+
function lockPlanFile(path21) {
|
|
36528
|
+
return lockFile(path21, { retries: 20, minTimeout: 25, maxTimeout: 250 });
|
|
36080
36529
|
}
|
|
36081
|
-
async function writePlan(
|
|
36530
|
+
async function writePlan(path21, prd, options = {}) {
|
|
36082
36531
|
const fs3 = options.fs ?? fsPromises2;
|
|
36083
36532
|
const lock = options.lock ?? lockPlanFile;
|
|
36084
|
-
await fs3.mkdir(dirname3(
|
|
36085
|
-
const release = await lock(
|
|
36533
|
+
await fs3.mkdir(dirname3(path21), { recursive: true });
|
|
36534
|
+
const release = await lock(path21);
|
|
36086
36535
|
try {
|
|
36087
36536
|
const yaml = serializePlan(prd);
|
|
36088
|
-
await fs3.writeFile(
|
|
36537
|
+
await fs3.writeFile(path21, yaml, { encoding: "utf8" });
|
|
36089
36538
|
} finally {
|
|
36090
36539
|
await release();
|
|
36091
36540
|
}
|
|
@@ -36104,7 +36553,7 @@ function renderPrompt(template, variables) {
|
|
|
36104
36553
|
var init_renderer2 = __esm({
|
|
36105
36554
|
"packages/ralph/src/prompt/renderer.ts"() {
|
|
36106
36555
|
"use strict";
|
|
36107
|
-
|
|
36556
|
+
init_src2();
|
|
36108
36557
|
}
|
|
36109
36558
|
});
|
|
36110
36559
|
|
|
@@ -36173,8 +36622,8 @@ var init_selector = __esm({
|
|
|
36173
36622
|
// packages/ralph/src/story/updater.ts
|
|
36174
36623
|
import { dirname as dirname4 } from "node:path";
|
|
36175
36624
|
import * as fsPromises3 from "node:fs/promises";
|
|
36176
|
-
function lockPlanFile2(
|
|
36177
|
-
return lockFile(
|
|
36625
|
+
function lockPlanFile2(path21) {
|
|
36626
|
+
return lockFile(path21, { retries: 20, minTimeout: 25, maxTimeout: 250 });
|
|
36178
36627
|
}
|
|
36179
36628
|
function assertStoryStatus(value) {
|
|
36180
36629
|
if (value === "open") return;
|
|
@@ -36255,9 +36704,9 @@ function appendSection(lines, title, items, options) {
|
|
|
36255
36704
|
}
|
|
36256
36705
|
lines.push("");
|
|
36257
36706
|
}
|
|
36258
|
-
async function writeRunMeta(
|
|
36707
|
+
async function writeRunMeta(path21, metadata, options = {}) {
|
|
36259
36708
|
const fs3 = options.fs ?? fsPromises4;
|
|
36260
|
-
await fs3.mkdir(dirname5(
|
|
36709
|
+
await fs3.mkdir(dirname5(path21), { recursive: true });
|
|
36261
36710
|
const lines = [];
|
|
36262
36711
|
lines.push("# Ralph Run Summary", "");
|
|
36263
36712
|
lines.push(`- Run ID: ${metadata.runId}`);
|
|
@@ -36286,7 +36735,7 @@ async function writeRunMeta(path20, metadata, options = {}) {
|
|
|
36286
36735
|
const git = metadata.git ?? null;
|
|
36287
36736
|
if (!git) {
|
|
36288
36737
|
lines.push("");
|
|
36289
|
-
await fs3.writeFile(
|
|
36738
|
+
await fs3.writeFile(path21, lines.join("\n"), { encoding: "utf8" });
|
|
36290
36739
|
return;
|
|
36291
36740
|
}
|
|
36292
36741
|
lines.push("", "## Git");
|
|
@@ -36301,7 +36750,7 @@ async function writeRunMeta(path20, metadata, options = {}) {
|
|
|
36301
36750
|
lines.push("");
|
|
36302
36751
|
} else {
|
|
36303
36752
|
lines.push("");
|
|
36304
|
-
await fs3.writeFile(
|
|
36753
|
+
await fs3.writeFile(path21, lines.join("\n"), { encoding: "utf8" });
|
|
36305
36754
|
return;
|
|
36306
36755
|
}
|
|
36307
36756
|
if (git.commits !== void 0 && git.commits !== null) {
|
|
@@ -36321,7 +36770,7 @@ async function writeRunMeta(path20, metadata, options = {}) {
|
|
|
36321
36770
|
appendSection(lines, "### Uncommitted Changes", git.dirtyFiles, {
|
|
36322
36771
|
emptyLabel: "(none)"
|
|
36323
36772
|
});
|
|
36324
|
-
await fs3.writeFile(
|
|
36773
|
+
await fs3.writeFile(path21, lines.join("\n"), { encoding: "utf8" });
|
|
36325
36774
|
}
|
|
36326
36775
|
var init_metadata = __esm({
|
|
36327
36776
|
"packages/ralph/src/run/metadata.ts"() {
|
|
@@ -36409,9 +36858,9 @@ async function defaultStreamingSpawn(agentId, options) {
|
|
|
36409
36858
|
exitCode: result.exitCode
|
|
36410
36859
|
};
|
|
36411
36860
|
}
|
|
36412
|
-
function absPath(cwd,
|
|
36413
|
-
if (!
|
|
36414
|
-
return
|
|
36861
|
+
function absPath(cwd, path21) {
|
|
36862
|
+
if (!path21) return resolvePath3(cwd);
|
|
36863
|
+
return path21.startsWith("/") ? path21 : resolvePath3(cwd, path21);
|
|
36415
36864
|
}
|
|
36416
36865
|
function pad2(value) {
|
|
36417
36866
|
return value < 10 ? `0${value}` : String(value);
|
|
@@ -36461,8 +36910,8 @@ async function appendToErrorsLog(fs3, errorsLogPath, message) {
|
|
|
36461
36910
|
await fs3.mkdir(dirname6(errorsLogPath), { recursive: true });
|
|
36462
36911
|
await fs3.writeFile(errorsLogPath, `${previous}${next}`, { encoding: "utf8" });
|
|
36463
36912
|
}
|
|
36464
|
-
function lockPlanFile3(
|
|
36465
|
-
return lockFile(
|
|
36913
|
+
function lockPlanFile3(path21) {
|
|
36914
|
+
return lockFile(path21, { retries: 20, minTimeout: 25, maxTimeout: 250 });
|
|
36466
36915
|
}
|
|
36467
36916
|
function getCurrentBranch(cwd) {
|
|
36468
36917
|
try {
|
|
@@ -36564,7 +37013,7 @@ async function defaultPromptOverbake(args) {
|
|
|
36564
37013
|
async function buildLoop(options) {
|
|
36565
37014
|
const fs3 = options.deps?.fs ?? fsPromises5;
|
|
36566
37015
|
const lock = options.deps?.lock ?? lockPlanFile3;
|
|
36567
|
-
const
|
|
37016
|
+
const spawn6 = options.deps?.spawn ?? defaultStreamingSpawn;
|
|
36568
37017
|
const git = options.deps?.git ?? {
|
|
36569
37018
|
getHead,
|
|
36570
37019
|
getCommitList,
|
|
@@ -36618,7 +37067,7 @@ async function buildLoop(options) {
|
|
|
36618
37067
|
});
|
|
36619
37068
|
worktreeBranch = entry.branch;
|
|
36620
37069
|
const worktreePath = entry.path;
|
|
36621
|
-
const symlinkFn = fs3.symlink ?? ((target,
|
|
37070
|
+
const symlinkFn = fs3.symlink ?? ((target, path21) => fsPromises5.symlink(target, path21));
|
|
36622
37071
|
const exec = worktreeDeps.exec;
|
|
36623
37072
|
const dirsToLink = [".poe-code-ralph", ".agents/poe-code-ralph"];
|
|
36624
37073
|
for (const dir of dirsToLink) {
|
|
@@ -36733,7 +37182,7 @@ async function buildLoop(options) {
|
|
|
36733
37182
|
let stderrForErrorsLog;
|
|
36734
37183
|
let overbakeAction = null;
|
|
36735
37184
|
try {
|
|
36736
|
-
const result = await
|
|
37185
|
+
const result = await spawn6(options.agent, {
|
|
36737
37186
|
prompt,
|
|
36738
37187
|
cwd,
|
|
36739
37188
|
model: options.model,
|
|
@@ -36906,10 +37355,10 @@ var init_loop = __esm({
|
|
|
36906
37355
|
"packages/ralph/src/build/loop.ts"() {
|
|
36907
37356
|
"use strict";
|
|
36908
37357
|
init_lock();
|
|
37358
|
+
init_src5();
|
|
36909
37359
|
init_src4();
|
|
36910
|
-
|
|
36911
|
-
|
|
36912
|
-
init_src8();
|
|
37360
|
+
init_src2();
|
|
37361
|
+
init_src9();
|
|
36913
37362
|
init_detector();
|
|
36914
37363
|
init_utils2();
|
|
36915
37364
|
init_parser();
|
|
@@ -36923,18 +37372,18 @@ var init_loop = __esm({
|
|
|
36923
37372
|
});
|
|
36924
37373
|
|
|
36925
37374
|
// packages/ralph/src/plan/resolver.ts
|
|
36926
|
-
import
|
|
37375
|
+
import path16 from "node:path";
|
|
36927
37376
|
import * as fsPromises6 from "node:fs/promises";
|
|
36928
37377
|
function isPlanCandidateFile(fileName) {
|
|
36929
37378
|
const lower = fileName.toLowerCase();
|
|
36930
37379
|
if (!lower.startsWith("plan")) {
|
|
36931
37380
|
return false;
|
|
36932
37381
|
}
|
|
36933
|
-
const ext =
|
|
37382
|
+
const ext = path16.extname(lower);
|
|
36934
37383
|
return ext === ".yml" || ext === ".yaml";
|
|
36935
37384
|
}
|
|
36936
37385
|
async function listPlanCandidates(fs3, cwd) {
|
|
36937
|
-
const plansDir =
|
|
37386
|
+
const plansDir = path16.join(cwd, ".agents", "poe-code-ralph", "plans");
|
|
36938
37387
|
let entries;
|
|
36939
37388
|
try {
|
|
36940
37389
|
entries = await fs3.readdir(plansDir);
|
|
@@ -36949,12 +37398,12 @@ async function listPlanCandidates(fs3, cwd) {
|
|
|
36949
37398
|
if (!isPlanCandidateFile(entry)) {
|
|
36950
37399
|
continue;
|
|
36951
37400
|
}
|
|
36952
|
-
const absPath2 =
|
|
37401
|
+
const absPath2 = path16.join(plansDir, entry);
|
|
36953
37402
|
const stats = await fs3.stat(absPath2);
|
|
36954
37403
|
if (!stats.isFile()) {
|
|
36955
37404
|
continue;
|
|
36956
37405
|
}
|
|
36957
|
-
const relativePath =
|
|
37406
|
+
const relativePath = path16.relative(cwd, absPath2);
|
|
36958
37407
|
const content = await fs3.readFile(absPath2, "utf8");
|
|
36959
37408
|
const plan = parsePlan(content);
|
|
36960
37409
|
const done = plan.stories.filter((s) => s.status === "done").length;
|
|
@@ -36973,7 +37422,7 @@ async function resolvePlanPath(options) {
|
|
|
36973
37422
|
const cwd = options.cwd;
|
|
36974
37423
|
const provided = options.plan?.trim();
|
|
36975
37424
|
if (provided) {
|
|
36976
|
-
const absPath2 =
|
|
37425
|
+
const absPath2 = path16.isAbsolute(provided) ? provided : path16.resolve(cwd, provided);
|
|
36977
37426
|
try {
|
|
36978
37427
|
const stats = await fs3.stat(absPath2);
|
|
36979
37428
|
if (!stats.isFile()) {
|
|
@@ -37022,21 +37471,21 @@ async function resolvePlanPath(options) {
|
|
|
37022
37471
|
var init_resolver = __esm({
|
|
37023
37472
|
"packages/ralph/src/plan/resolver.ts"() {
|
|
37024
37473
|
"use strict";
|
|
37025
|
-
|
|
37026
|
-
|
|
37474
|
+
init_src4();
|
|
37475
|
+
init_src2();
|
|
37027
37476
|
init_parser();
|
|
37028
37477
|
}
|
|
37029
37478
|
});
|
|
37030
37479
|
|
|
37031
37480
|
// packages/ralph/src/plan/generator.ts
|
|
37032
|
-
import
|
|
37481
|
+
import path17 from "node:path";
|
|
37033
37482
|
import * as fsPromises7 from "node:fs/promises";
|
|
37034
37483
|
var PLAN_PROMPT_TEMPLATE;
|
|
37035
37484
|
var init_generator = __esm({
|
|
37036
37485
|
"packages/ralph/src/plan/generator.ts"() {
|
|
37037
37486
|
"use strict";
|
|
37038
|
-
|
|
37039
|
-
|
|
37487
|
+
init_src5();
|
|
37488
|
+
init_src2();
|
|
37040
37489
|
init_renderer2();
|
|
37041
37490
|
PLAN_PROMPT_TEMPLATE = [
|
|
37042
37491
|
"# Plan",
|
|
@@ -37098,27 +37547,27 @@ function formatTimestamp3(date4) {
|
|
|
37098
37547
|
const seconds = pad22(date4.getSeconds());
|
|
37099
37548
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
37100
37549
|
}
|
|
37101
|
-
function validateLogPath(
|
|
37102
|
-
if (typeof
|
|
37550
|
+
function validateLogPath(path21) {
|
|
37551
|
+
if (typeof path21 !== "string" || path21.trim().length === 0) {
|
|
37103
37552
|
throw new Error(
|
|
37104
|
-
`Invalid activity log path: expected a non-empty string, got ${String(
|
|
37553
|
+
`Invalid activity log path: expected a non-empty string, got ${String(path21)}`
|
|
37105
37554
|
);
|
|
37106
37555
|
}
|
|
37107
|
-
if (
|
|
37556
|
+
if (path21.includes("\0")) {
|
|
37108
37557
|
throw new Error("Invalid activity log path: contains null byte");
|
|
37109
37558
|
}
|
|
37110
37559
|
}
|
|
37111
|
-
async function logActivity(
|
|
37112
|
-
validateLogPath(
|
|
37560
|
+
async function logActivity(path21, message, options = {}) {
|
|
37561
|
+
validateLogPath(path21);
|
|
37113
37562
|
const fs3 = options.fs ?? fsPromises8;
|
|
37114
|
-
const parent = dirname7(
|
|
37563
|
+
const parent = dirname7(path21);
|
|
37115
37564
|
if (parent && parent !== ".") {
|
|
37116
37565
|
await fs3.mkdir(parent, { recursive: true });
|
|
37117
37566
|
}
|
|
37118
37567
|
const entry = `[${formatTimestamp3(/* @__PURE__ */ new Date())}] ${message}
|
|
37119
37568
|
`;
|
|
37120
37569
|
try {
|
|
37121
|
-
await fs3.appendFile(
|
|
37570
|
+
await fs3.appendFile(path21, entry, { encoding: "utf8" });
|
|
37122
37571
|
} catch (error2) {
|
|
37123
37572
|
const detail = error2 instanceof Error ? error2.message : `Unknown error: ${String(error2)}`;
|
|
37124
37573
|
throw new Error(`Failed to append activity log entry: ${detail}`, { cause: error2 });
|
|
@@ -37131,7 +37580,7 @@ var init_activity = __esm({
|
|
|
37131
37580
|
});
|
|
37132
37581
|
|
|
37133
37582
|
// packages/ralph/src/config/loader.ts
|
|
37134
|
-
import
|
|
37583
|
+
import path18 from "node:path";
|
|
37135
37584
|
import * as fsPromises9 from "node:fs/promises";
|
|
37136
37585
|
import YAML from "yaml";
|
|
37137
37586
|
function isPlainObject2(value) {
|
|
@@ -37166,8 +37615,8 @@ function pickOptionalPositiveInt(config2, key, options) {
|
|
|
37166
37615
|
return value;
|
|
37167
37616
|
}
|
|
37168
37617
|
async function loadSingleConfig(configDir, fs3) {
|
|
37169
|
-
const yamlPath =
|
|
37170
|
-
const jsonPath =
|
|
37618
|
+
const yamlPath = path18.join(configDir, "config.yaml");
|
|
37619
|
+
const jsonPath = path18.join(configDir, "config.json");
|
|
37171
37620
|
let raw = null;
|
|
37172
37621
|
let format = null;
|
|
37173
37622
|
let sourcePath = null;
|
|
@@ -37240,14 +37689,14 @@ async function loadConfig(cwd, deps) {
|
|
|
37240
37689
|
const sources = [];
|
|
37241
37690
|
let merged = {};
|
|
37242
37691
|
if (deps?.homeDir) {
|
|
37243
|
-
const globalDir =
|
|
37692
|
+
const globalDir = path18.join(deps.homeDir, ".poe-code", "ralph");
|
|
37244
37693
|
const globalResult = await loadSingleConfig(globalDir, fs3);
|
|
37245
37694
|
if (globalResult) {
|
|
37246
37695
|
merged = globalResult.config;
|
|
37247
37696
|
sources.push({ path: globalResult.sourcePath, scope: "global" });
|
|
37248
37697
|
}
|
|
37249
37698
|
}
|
|
37250
|
-
const localDir =
|
|
37699
|
+
const localDir = path18.join(cwd, ".agents", "poe-code-ralph");
|
|
37251
37700
|
const localResult = await loadSingleConfig(localDir, fs3);
|
|
37252
37701
|
if (localResult) {
|
|
37253
37702
|
merged = mergeConfigs(merged, localResult.config);
|
|
@@ -37258,7 +37707,7 @@ async function loadConfig(cwd, deps) {
|
|
|
37258
37707
|
var init_loader = __esm({
|
|
37259
37708
|
"packages/ralph/src/config/loader.ts"() {
|
|
37260
37709
|
"use strict";
|
|
37261
|
-
|
|
37710
|
+
init_src2();
|
|
37262
37711
|
}
|
|
37263
37712
|
});
|
|
37264
37713
|
|
|
@@ -37269,7 +37718,7 @@ async function ralphBuild(options) {
|
|
|
37269
37718
|
cwd: options.cwd ?? process.cwd()
|
|
37270
37719
|
});
|
|
37271
37720
|
}
|
|
37272
|
-
var
|
|
37721
|
+
var init_src10 = __esm({
|
|
37273
37722
|
"packages/ralph/src/index.ts"() {
|
|
37274
37723
|
"use strict";
|
|
37275
37724
|
init_loop();
|
|
@@ -37289,12 +37738,12 @@ var require_PROMPT_worktree_merge = __commonJS({
|
|
|
37289
37738
|
});
|
|
37290
37739
|
|
|
37291
37740
|
// src/cli/commands/ralph-worktree.ts
|
|
37292
|
-
import
|
|
37741
|
+
import path19 from "node:path";
|
|
37293
37742
|
import { execSync as execSync3 } from "node:child_process";
|
|
37294
37743
|
function registerRalphWorktreeCommand(ralph, container) {
|
|
37295
37744
|
ralph.command("worktree").description("Merge a completed worktree back into the main branch.").argument("<name>", "Name of the worktree to merge").option("--agent <name>", "Agent to use for the merge").action(async function(name) {
|
|
37296
37745
|
const cwd = container.env.cwd;
|
|
37297
|
-
const registryFile =
|
|
37746
|
+
const registryFile = path19.join(cwd, ".poe-code-ralph", "worktrees.yaml");
|
|
37298
37747
|
const worktrees = await listWorktrees(cwd, registryFile, {
|
|
37299
37748
|
fs: {
|
|
37300
37749
|
readFile: (p, enc) => container.fs.readFile(p, enc),
|
|
@@ -37357,10 +37806,10 @@ function registerRalphWorktreeCommand(ralph, container) {
|
|
|
37357
37806
|
var init_ralph_worktree = __esm({
|
|
37358
37807
|
"src/cli/commands/ralph-worktree.ts"() {
|
|
37359
37808
|
"use strict";
|
|
37360
|
-
init_src3();
|
|
37361
|
-
init_src8();
|
|
37362
37809
|
init_src4();
|
|
37363
|
-
|
|
37810
|
+
init_src9();
|
|
37811
|
+
init_src5();
|
|
37812
|
+
init_src2();
|
|
37364
37813
|
init_errors();
|
|
37365
37814
|
}
|
|
37366
37815
|
});
|
|
@@ -37436,7 +37885,7 @@ var require_activity = __commonJS({
|
|
|
37436
37885
|
});
|
|
37437
37886
|
|
|
37438
37887
|
// src/cli/commands/ralph.ts
|
|
37439
|
-
import
|
|
37888
|
+
import path20 from "node:path";
|
|
37440
37889
|
async function loadRalphTemplates() {
|
|
37441
37890
|
const [
|
|
37442
37891
|
promptPartialPlan,
|
|
@@ -37521,7 +37970,7 @@ async function writeFileOrSkip(args) {
|
|
|
37521
37970
|
args.logger.info(`Skip: ${args.displayPath} (already exists)`);
|
|
37522
37971
|
return "skipped";
|
|
37523
37972
|
}
|
|
37524
|
-
await args.fs.mkdir(
|
|
37973
|
+
await args.fs.mkdir(path20.dirname(args.filePath), { recursive: true });
|
|
37525
37974
|
await args.fs.writeFile(args.filePath, args.contents, { encoding: "utf8" });
|
|
37526
37975
|
args.logger.info(`${exists ? "Overwrite" : "Create"}: ${args.displayPath}`);
|
|
37527
37976
|
return "written";
|
|
@@ -37557,22 +38006,22 @@ async function installRalphTemplates(args) {
|
|
|
37557
38006
|
const promptPlanContents = templates.promptPlan.replace("{{{PROMPT_PARTIAL_PLAN}}}", templates.promptPartialPlan);
|
|
37558
38007
|
const templateWrites = [
|
|
37559
38008
|
{
|
|
37560
|
-
targetPath:
|
|
38009
|
+
targetPath: path20.join(cwd, ".agents", "poe-code-ralph", "PROMPT_plan.md"),
|
|
37561
38010
|
displayPath: ".agents/poe-code-ralph/PROMPT_plan.md",
|
|
37562
38011
|
contents: promptPlanContents
|
|
37563
38012
|
},
|
|
37564
38013
|
{
|
|
37565
|
-
targetPath:
|
|
38014
|
+
targetPath: path20.join(cwd, ".agents", "poe-code-ralph", "PROMPT_build.md"),
|
|
37566
38015
|
displayPath: ".agents/poe-code-ralph/PROMPT_build.md",
|
|
37567
38016
|
contents: templates.promptBuild
|
|
37568
38017
|
},
|
|
37569
38018
|
{
|
|
37570
|
-
targetPath:
|
|
38019
|
+
targetPath: path20.join(cwd, ".agents", "poe-code-ralph", "references", "GUARDRAILS.md"),
|
|
37571
38020
|
displayPath: ".agents/poe-code-ralph/references/GUARDRAILS.md",
|
|
37572
38021
|
contents: templates.refGuardrails
|
|
37573
38022
|
},
|
|
37574
38023
|
{
|
|
37575
|
-
targetPath:
|
|
38024
|
+
targetPath: path20.join(cwd, ".agents", "poe-code-ralph", "references", "CONTEXT_ENGINEERING.md"),
|
|
37576
38025
|
displayPath: ".agents/poe-code-ralph/references/CONTEXT_ENGINEERING.md",
|
|
37577
38026
|
contents: templates.refContextEngineering
|
|
37578
38027
|
}
|
|
@@ -37590,22 +38039,22 @@ async function installRalphTemplates(args) {
|
|
|
37590
38039
|
const stateFiles = [
|
|
37591
38040
|
{
|
|
37592
38041
|
contents: templates.stateProgress,
|
|
37593
|
-
targetPath:
|
|
38042
|
+
targetPath: path20.join(cwd, ".poe-code-ralph", "progress.md"),
|
|
37594
38043
|
displayPath: ".poe-code-ralph/progress.md"
|
|
37595
38044
|
},
|
|
37596
38045
|
{
|
|
37597
38046
|
contents: templates.stateGuardrails,
|
|
37598
|
-
targetPath:
|
|
38047
|
+
targetPath: path20.join(cwd, ".poe-code-ralph", "guardrails.md"),
|
|
37599
38048
|
displayPath: ".poe-code-ralph/guardrails.md"
|
|
37600
38049
|
},
|
|
37601
38050
|
{
|
|
37602
38051
|
contents: templates.stateErrors,
|
|
37603
|
-
targetPath:
|
|
38052
|
+
targetPath: path20.join(cwd, ".poe-code-ralph", "errors.log"),
|
|
37604
38053
|
displayPath: ".poe-code-ralph/errors.log"
|
|
37605
38054
|
},
|
|
37606
38055
|
{
|
|
37607
38056
|
contents: templates.stateActivity,
|
|
37608
|
-
targetPath:
|
|
38057
|
+
targetPath: path20.join(cwd, ".poe-code-ralph", "activity.log"),
|
|
37609
38058
|
displayPath: ".poe-code-ralph/activity.log"
|
|
37610
38059
|
}
|
|
37611
38060
|
];
|
|
@@ -37652,7 +38101,7 @@ function registerRalphCommand(program, container) {
|
|
|
37652
38101
|
throw new ValidationError(message2);
|
|
37653
38102
|
}
|
|
37654
38103
|
const rawPath = options.activityLog?.trim() || configActivityLogPath || ".poe-code-ralph/activity.log";
|
|
37655
|
-
const resolvedPath =
|
|
38104
|
+
const resolvedPath = path20.isAbsolute(rawPath) ? rawPath : path20.resolve(container.env.cwd, rawPath);
|
|
37656
38105
|
await logActivity(resolvedPath, trimmedMessage, {
|
|
37657
38106
|
fs: container.fs
|
|
37658
38107
|
});
|
|
@@ -37664,7 +38113,7 @@ function registerRalphCommand(program, container) {
|
|
|
37664
38113
|
if (!planPath) {
|
|
37665
38114
|
throw new ValidationError("--plan <path> is required.");
|
|
37666
38115
|
}
|
|
37667
|
-
const resolvedPath =
|
|
38116
|
+
const resolvedPath = path20.isAbsolute(planPath) ? planPath : path20.resolve(cwd, planPath);
|
|
37668
38117
|
let content;
|
|
37669
38118
|
try {
|
|
37670
38119
|
content = await container.fs.readFile(resolvedPath, "utf8");
|
|
@@ -37838,7 +38287,7 @@ function registerRalphCommand(program, container) {
|
|
|
37838
38287
|
} else {
|
|
37839
38288
|
try {
|
|
37840
38289
|
const planContent = await container.fs.readFile(
|
|
37841
|
-
|
|
38290
|
+
path20.resolve(cwd, planPath),
|
|
37842
38291
|
"utf8"
|
|
37843
38292
|
);
|
|
37844
38293
|
const plan = parsePlan(planContent);
|
|
@@ -37872,7 +38321,7 @@ function registerRalphCommand(program, container) {
|
|
|
37872
38321
|
} else {
|
|
37873
38322
|
try {
|
|
37874
38323
|
const planContent = await container.fs.readFile(
|
|
37875
|
-
|
|
38324
|
+
path20.resolve(cwd, planPath),
|
|
37876
38325
|
"utf8"
|
|
37877
38326
|
);
|
|
37878
38327
|
const plan = parsePlan(planContent);
|
|
@@ -37928,10 +38377,10 @@ var templateImports, DEFAULT_RALPH_AGENT;
|
|
|
37928
38377
|
var init_ralph = __esm({
|
|
37929
38378
|
"src/cli/commands/ralph.ts"() {
|
|
37930
38379
|
"use strict";
|
|
37931
|
-
|
|
37932
|
-
|
|
37933
|
-
|
|
37934
|
-
|
|
38380
|
+
init_src4();
|
|
38381
|
+
init_src10();
|
|
38382
|
+
init_src8();
|
|
38383
|
+
init_src2();
|
|
37935
38384
|
init_errors();
|
|
37936
38385
|
init_shared();
|
|
37937
38386
|
init_ralph_worktree();
|
|
@@ -38149,7 +38598,7 @@ var init_usage = __esm({
|
|
|
38149
38598
|
"use strict";
|
|
38150
38599
|
init_shared();
|
|
38151
38600
|
init_errors();
|
|
38152
|
-
|
|
38601
|
+
init_src4();
|
|
38153
38602
|
}
|
|
38154
38603
|
});
|
|
38155
38604
|
|
|
@@ -38435,7 +38884,7 @@ var init_models = __esm({
|
|
|
38435
38884
|
init_shared();
|
|
38436
38885
|
init_credentials2();
|
|
38437
38886
|
init_errors();
|
|
38438
|
-
|
|
38887
|
+
init_src4();
|
|
38439
38888
|
MAX_VALUES_LENGTH = 105;
|
|
38440
38889
|
MAX_DEFAULT_LENGTH = 36;
|
|
38441
38890
|
}
|
|
@@ -38447,7 +38896,7 @@ var init_package = __esm({
|
|
|
38447
38896
|
"package.json"() {
|
|
38448
38897
|
package_default = {
|
|
38449
38898
|
name: "poe-code",
|
|
38450
|
-
version: "3.0.
|
|
38899
|
+
version: "3.0.69-beta.1",
|
|
38451
38900
|
description: "CLI tool to configure Poe API for developer workflows.",
|
|
38452
38901
|
type: "module",
|
|
38453
38902
|
main: "./dist/index.js",
|
|
@@ -38528,6 +38977,7 @@ var init_package = __esm({
|
|
|
38528
38977
|
devDependencies: {
|
|
38529
38978
|
"@eslint/js": "^9.0.0",
|
|
38530
38979
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
38980
|
+
"@poe-code/auth": "*",
|
|
38531
38981
|
"@poe-code/agent-spawn": "*",
|
|
38532
38982
|
"@poe-code/config-mutations": "*",
|
|
38533
38983
|
"@poe-code/design-system": "*",
|
|
@@ -38830,7 +39280,7 @@ var init_program = __esm({
|
|
|
38830
39280
|
async "src/cli/program.ts"() {
|
|
38831
39281
|
"use strict";
|
|
38832
39282
|
await init_container2();
|
|
38833
|
-
|
|
39283
|
+
init_src4();
|
|
38834
39284
|
init_configure();
|
|
38835
39285
|
await init_spawn4();
|
|
38836
39286
|
await init_research2();
|
|
@@ -38927,7 +39377,7 @@ function createPromptRunner(adapter = {
|
|
|
38927
39377
|
var init_prompt_runner = __esm({
|
|
38928
39378
|
"src/cli/prompt-runner.ts"() {
|
|
38929
39379
|
"use strict";
|
|
38930
|
-
|
|
39380
|
+
init_src4();
|
|
38931
39381
|
init_errors();
|
|
38932
39382
|
}
|
|
38933
39383
|
});
|
|
@@ -38938,17 +39388,17 @@ __export(bootstrap_exports, {
|
|
|
38938
39388
|
createCliMain: () => createCliMain,
|
|
38939
39389
|
isCliInvocation: () => isCliInvocation
|
|
38940
39390
|
});
|
|
38941
|
-
import * as
|
|
39391
|
+
import * as nodeFs2 from "node:fs/promises";
|
|
38942
39392
|
import * as nodeFsSync3 from "node:fs";
|
|
38943
39393
|
import { realpathSync } from "node:fs";
|
|
38944
|
-
import { homedir as
|
|
39394
|
+
import { homedir as homedir4 } from "node:os";
|
|
38945
39395
|
import { pathToFileURL as pathToFileURL2 } from "node:url";
|
|
38946
|
-
import { join as
|
|
39396
|
+
import { join as join2 } from "node:path";
|
|
38947
39397
|
import chalk13 from "chalk";
|
|
38948
39398
|
function createCliMain(programFactory) {
|
|
38949
39399
|
return async function runCli() {
|
|
38950
|
-
const homeDir =
|
|
38951
|
-
const logDir =
|
|
39400
|
+
const homeDir = homedir4();
|
|
39401
|
+
const logDir = join2(homeDir, ".poe-code", "logs");
|
|
38952
39402
|
const promptRunner = createPromptRunner();
|
|
38953
39403
|
const shouldLogToStderr = process.env.POE_CODE_STDERR_LOGS === "1" || process.env.POE_CODE_STDERR_LOGS === "true";
|
|
38954
39404
|
const errorLogger = new ErrorLogger({
|
|
@@ -38983,7 +39433,7 @@ function createCliMain(programFactory) {
|
|
|
38983
39433
|
} else {
|
|
38984
39434
|
log2.error(`Error: ${error2.message}`);
|
|
38985
39435
|
log2.message(
|
|
38986
|
-
`See logs at ${
|
|
39436
|
+
`See logs at ${join2(logDir, "errors.log")} for more details.`,
|
|
38987
39437
|
{ symbol: chalk13.magenta("\u25CF") }
|
|
38988
39438
|
);
|
|
38989
39439
|
}
|
|
@@ -39009,11 +39459,11 @@ var fsAdapter;
|
|
|
39009
39459
|
var init_bootstrap = __esm({
|
|
39010
39460
|
"src/cli/bootstrap.ts"() {
|
|
39011
39461
|
"use strict";
|
|
39012
|
-
|
|
39462
|
+
init_src4();
|
|
39013
39463
|
init_error_logger();
|
|
39014
39464
|
init_errors();
|
|
39015
39465
|
init_prompt_runner();
|
|
39016
|
-
fsAdapter =
|
|
39466
|
+
fsAdapter = nodeFs2;
|
|
39017
39467
|
}
|
|
39018
39468
|
});
|
|
39019
39469
|
|
|
@@ -39152,6 +39602,6 @@ export {
|
|
|
39152
39602
|
getPoeApiKey,
|
|
39153
39603
|
isCliInvocation2 as isCliInvocation,
|
|
39154
39604
|
main,
|
|
39155
|
-
|
|
39605
|
+
spawn4 as spawn
|
|
39156
39606
|
};
|
|
39157
39607
|
//# sourceMappingURL=index.js.map
|