@liangjie559567/ultrapower 5.5.19 → 5.5.21
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/bridge/codex-server.cjs +73 -84
- package/bridge/gemini-server.cjs +74 -84
- package/bridge/team-bridge.cjs +14 -3
- package/dist/config/loader.js +1 -1
- package/dist/config/loader.js.map +1 -1
- package/dist/hooks/bridge.d.ts.map +1 -1
- package/dist/hooks/bridge.js +1 -2
- package/dist/hooks/bridge.js.map +1 -1
- package/dist/hooks/ultrapilot/decomposer.d.ts.map +1 -1
- package/dist/hooks/ultrapilot/decomposer.js +1 -2
- package/dist/hooks/ultrapilot/decomposer.js.map +1 -1
- package/dist/lib/git-utils.d.ts.map +1 -1
- package/dist/lib/git-utils.js +3 -1
- package/dist/lib/git-utils.js.map +1 -1
- package/dist/team/bridge-entry.d.ts +2 -1
- package/dist/team/bridge-entry.d.ts.map +1 -1
- package/dist/team/bridge-entry.js +24 -5
- package/dist/team/bridge-entry.js.map +1 -1
- package/package.json +1 -1
- package/scripts/release-steps.mjs +1 -1
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
{
|
|
9
9
|
"name": "ultrapower",
|
|
10
10
|
"description": "Disciplined multi-agent orchestration: workflow enforcement + parallel execution",
|
|
11
|
-
"version": "5.5.
|
|
11
|
+
"version": "5.5.20",
|
|
12
12
|
"source": {
|
|
13
13
|
"source": "npm",
|
|
14
14
|
"package": "@liangjie559567/ultrapower",
|
|
15
|
-
"version": "5.5.
|
|
15
|
+
"version": "5.5.20"
|
|
16
16
|
},
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "liangjie559567"
|
package/bridge/codex-server.cjs
CHANGED
|
@@ -14293,8 +14293,8 @@ init_define_AGENT_PROMPTS_CODEX();
|
|
|
14293
14293
|
init_define_AGENT_PROMPTS();
|
|
14294
14294
|
init_define_AGENT_ROLES();
|
|
14295
14295
|
var import_child_process3 = require("child_process");
|
|
14296
|
-
var
|
|
14297
|
-
var
|
|
14296
|
+
var import_fs8 = require("fs");
|
|
14297
|
+
var import_path8 = require("path");
|
|
14298
14298
|
|
|
14299
14299
|
// src/mcp/shared-exec.ts
|
|
14300
14300
|
init_define_AGENT_PROMPTS_CODEX();
|
|
@@ -15412,8 +15412,8 @@ function buildFallbackChain(provider, resolvedModel, _config) {
|
|
|
15412
15412
|
init_define_AGENT_PROMPTS_CODEX();
|
|
15413
15413
|
init_define_AGENT_PROMPTS();
|
|
15414
15414
|
init_define_AGENT_ROLES();
|
|
15415
|
-
var
|
|
15416
|
-
var
|
|
15415
|
+
var import_fs7 = require("fs");
|
|
15416
|
+
var import_path7 = require("path");
|
|
15417
15417
|
|
|
15418
15418
|
// node_modules/jsonc-parser/lib/esm/main.js
|
|
15419
15419
|
init_define_AGENT_PROMPTS_CODEX();
|
|
@@ -16298,25 +16298,14 @@ var ParseErrorCode;
|
|
|
16298
16298
|
ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
|
|
16299
16299
|
})(ParseErrorCode || (ParseErrorCode = {}));
|
|
16300
16300
|
|
|
16301
|
-
// src/utils/paths.ts
|
|
16302
|
-
init_define_AGENT_PROMPTS_CODEX();
|
|
16303
|
-
init_define_AGENT_PROMPTS();
|
|
16304
|
-
init_define_AGENT_ROLES();
|
|
16305
|
-
var import_path7 = require("path");
|
|
16306
|
-
var import_fs7 = require("fs");
|
|
16307
|
-
var import_os = require("os");
|
|
16308
|
-
|
|
16309
16301
|
// src/utils/config-dir.ts
|
|
16310
16302
|
init_define_AGENT_PROMPTS_CODEX();
|
|
16311
16303
|
init_define_AGENT_PROMPTS();
|
|
16312
16304
|
init_define_AGENT_ROLES();
|
|
16313
|
-
|
|
16314
|
-
|
|
16315
|
-
function
|
|
16316
|
-
|
|
16317
|
-
return process.env.APPDATA || (0, import_path7.join)((0, import_os.homedir)(), "AppData", "Roaming");
|
|
16318
|
-
}
|
|
16319
|
-
return process.env.XDG_CONFIG_HOME || (0, import_path7.join)((0, import_os.homedir)(), ".config");
|
|
16305
|
+
var import_node_os = require("node:os");
|
|
16306
|
+
var import_node_path = require("node:path");
|
|
16307
|
+
function getConfigDir() {
|
|
16308
|
+
return process.env.CLAUDE_CONFIG_DIR || (0, import_node_path.join)((0, import_node_os.homedir)(), ".claude");
|
|
16320
16309
|
}
|
|
16321
16310
|
|
|
16322
16311
|
// src/lib/constants.ts
|
|
@@ -16454,18 +16443,18 @@ var DEFAULT_CONFIG = {
|
|
|
16454
16443
|
}
|
|
16455
16444
|
};
|
|
16456
16445
|
function getConfigPaths() {
|
|
16457
|
-
const userConfigDir =
|
|
16446
|
+
const userConfigDir = getConfigDir();
|
|
16458
16447
|
return {
|
|
16459
|
-
user: (0,
|
|
16460
|
-
project: (0,
|
|
16448
|
+
user: (0, import_path7.join)(userConfigDir, "claude-sisyphus", "config.jsonc"),
|
|
16449
|
+
project: (0, import_path7.join)(process.cwd(), ".claude", "sisyphus.jsonc")
|
|
16461
16450
|
};
|
|
16462
16451
|
}
|
|
16463
16452
|
function loadJsoncFile(path) {
|
|
16464
|
-
if (!(0,
|
|
16453
|
+
if (!(0, import_fs7.existsSync)(path)) {
|
|
16465
16454
|
return null;
|
|
16466
16455
|
}
|
|
16467
16456
|
try {
|
|
16468
|
-
const content = (0,
|
|
16457
|
+
const content = (0, import_fs7.readFileSync)(path, "utf-8");
|
|
16469
16458
|
const errors = [];
|
|
16470
16459
|
const result = parse4(content, errors, {
|
|
16471
16460
|
allowTrailingComma: true,
|
|
@@ -17114,25 +17103,25 @@ function validateAndReadFile(filePath, baseDir) {
|
|
|
17114
17103
|
}
|
|
17115
17104
|
try {
|
|
17116
17105
|
const workingDir = baseDir || process.cwd();
|
|
17117
|
-
const resolvedAbs = (0,
|
|
17118
|
-
const cwdReal = (0,
|
|
17119
|
-
const relAbs = (0,
|
|
17120
|
-
if (relAbs === ".." || relAbs.startsWith(".." +
|
|
17106
|
+
const resolvedAbs = (0, import_path8.resolve)(workingDir, filePath);
|
|
17107
|
+
const cwdReal = (0, import_fs8.realpathSync)(workingDir);
|
|
17108
|
+
const relAbs = (0, import_path8.relative)(cwdReal, resolvedAbs);
|
|
17109
|
+
if (relAbs === ".." || relAbs.startsWith(".." + import_path8.sep) || (0, import_path8.isAbsolute)(relAbs)) {
|
|
17121
17110
|
return `[BLOCKED] File '${filePath}' is outside the working directory. Only files within the project are allowed.`;
|
|
17122
17111
|
}
|
|
17123
|
-
const resolvedReal = (0,
|
|
17124
|
-
const relReal = (0,
|
|
17125
|
-
if (relReal === ".." || relReal.startsWith(".." +
|
|
17112
|
+
const resolvedReal = (0, import_fs8.realpathSync)(resolvedAbs);
|
|
17113
|
+
const relReal = (0, import_path8.relative)(cwdReal, resolvedReal);
|
|
17114
|
+
if (relReal === ".." || relReal.startsWith(".." + import_path8.sep) || (0, import_path8.isAbsolute)(relReal)) {
|
|
17126
17115
|
return `[BLOCKED] File '${filePath}' is outside the working directory. Only files within the project are allowed.`;
|
|
17127
17116
|
}
|
|
17128
|
-
const stats = (0,
|
|
17117
|
+
const stats = (0, import_fs8.statSync)(resolvedReal);
|
|
17129
17118
|
if (!stats.isFile()) {
|
|
17130
17119
|
return `--- File: ${filePath} --- (Not a regular file)`;
|
|
17131
17120
|
}
|
|
17132
17121
|
if (stats.size > MAX_FILE_SIZE) {
|
|
17133
17122
|
return `--- File: ${filePath} --- (File too large: ${(stats.size / 1024 / 1024).toFixed(1)}MB, max 5MB)`;
|
|
17134
17123
|
}
|
|
17135
|
-
return wrapUntrustedFileContent(filePath, (0,
|
|
17124
|
+
return wrapUntrustedFileContent(filePath, (0, import_fs8.readFileSync)(resolvedReal, "utf-8"));
|
|
17136
17125
|
} catch {
|
|
17137
17126
|
return `--- File: ${filePath} --- (Error reading file)`;
|
|
17138
17127
|
}
|
|
@@ -17156,7 +17145,7 @@ async function handleAskCodex(args) {
|
|
|
17156
17145
|
let baseDirReal;
|
|
17157
17146
|
const pathPolicy = process.env.OMC_ALLOW_EXTERNAL_WORKDIR === "1" ? "permissive" : "strict";
|
|
17158
17147
|
try {
|
|
17159
|
-
baseDirReal = (0,
|
|
17148
|
+
baseDirReal = (0, import_fs8.realpathSync)(baseDir);
|
|
17160
17149
|
baseDir = baseDirReal;
|
|
17161
17150
|
} catch (err) {
|
|
17162
17151
|
const errorToken = "E_WORKDIR_INVALID";
|
|
@@ -17171,13 +17160,13 @@ Suggested: ensure the working directory exists and is accessible`);
|
|
|
17171
17160
|
if (worktreeRoot) {
|
|
17172
17161
|
let worktreeReal;
|
|
17173
17162
|
try {
|
|
17174
|
-
worktreeReal = (0,
|
|
17163
|
+
worktreeReal = (0, import_fs8.realpathSync)(worktreeRoot);
|
|
17175
17164
|
} catch {
|
|
17176
17165
|
worktreeReal = "";
|
|
17177
17166
|
}
|
|
17178
17167
|
if (worktreeReal) {
|
|
17179
|
-
const relToWorktree = (0,
|
|
17180
|
-
if (relToWorktree.startsWith("..") || (0,
|
|
17168
|
+
const relToWorktree = (0, import_path8.relative)(worktreeReal, baseDirReal);
|
|
17169
|
+
if (relToWorktree.startsWith("..") || (0, import_path8.isAbsolute)(relToWorktree)) {
|
|
17181
17170
|
const errorToken = "E_WORKDIR_INVALID";
|
|
17182
17171
|
return singleErrorBlock(`${errorToken}: working_directory '${args.working_directory}' is outside the project worktree (${worktreeRoot}).
|
|
17183
17172
|
Requested: ${args.working_directory}
|
|
@@ -17223,12 +17212,12 @@ Suggested: use a working_directory within the project worktree, or set OMC_ALLOW
|
|
|
17223
17212
|
inlineRequestId = generatePromptId();
|
|
17224
17213
|
try {
|
|
17225
17214
|
const promptsDir = getPromptsDir(baseDir);
|
|
17226
|
-
(0,
|
|
17215
|
+
(0, import_fs8.mkdirSync)(promptsDir, { recursive: true });
|
|
17227
17216
|
const slug = slugify(inlinePrompt);
|
|
17228
|
-
const inlinePromptFile = (0,
|
|
17229
|
-
(0,
|
|
17217
|
+
const inlinePromptFile = (0, import_path8.join)(promptsDir, `codex-inline-${slug}-${inlineRequestId}.md`);
|
|
17218
|
+
(0, import_fs8.writeFileSync)(inlinePromptFile, inlinePrompt, { encoding: "utf-8", mode: 384 });
|
|
17230
17219
|
const resolvedPromptFileLocal = inlinePromptFile;
|
|
17231
|
-
const resolvedOutputFileLocal = !resolvedOutputFile || !resolvedOutputFile.trim() ? (0,
|
|
17220
|
+
const resolvedOutputFileLocal = !resolvedOutputFile || !resolvedOutputFile.trim() ? (0, import_path8.join)(promptsDir, `codex-inline-response-${slug}-${inlineRequestId}.md`) : resolvedOutputFile;
|
|
17232
17221
|
resolvedPromptFile = resolvedPromptFileLocal;
|
|
17233
17222
|
resolvedOutputFile = resolvedOutputFileLocal;
|
|
17234
17223
|
} catch (err) {
|
|
@@ -17246,10 +17235,10 @@ Suggested: use a working_directory within the project worktree, or set OMC_ALLOW
|
|
|
17246
17235
|
}
|
|
17247
17236
|
let resolvedPrompt;
|
|
17248
17237
|
const promptFile = effectivePromptFile;
|
|
17249
|
-
const resolvedPath = (0,
|
|
17250
|
-
const cwdReal = (0,
|
|
17251
|
-
const relPath = (0,
|
|
17252
|
-
if (!isExternalPromptAllowed() && (relPath === ".." || relPath.startsWith(".." +
|
|
17238
|
+
const resolvedPath = (0, import_path8.resolve)(baseDir, promptFile);
|
|
17239
|
+
const cwdReal = (0, import_fs8.realpathSync)(baseDir);
|
|
17240
|
+
const relPath = (0, import_path8.relative)(cwdReal, resolvedPath);
|
|
17241
|
+
if (!isExternalPromptAllowed() && (relPath === ".." || relPath.startsWith(".." + import_path8.sep) || (0, import_path8.isAbsolute)(relPath))) {
|
|
17253
17242
|
const errorToken = "E_PATH_OUTSIDE_WORKDIR_PROMPT";
|
|
17254
17243
|
return singleErrorBlock(`${errorToken}: prompt_file '${promptFile}' resolves outside working_directory '${baseDirReal}'.
|
|
17255
17244
|
Requested: ${promptFile}
|
|
@@ -17260,7 +17249,7 @@ Suggested: place the prompt file within the working directory or set working_dir
|
|
|
17260
17249
|
}
|
|
17261
17250
|
let resolvedReal;
|
|
17262
17251
|
try {
|
|
17263
|
-
resolvedReal = (0,
|
|
17252
|
+
resolvedReal = (0, import_fs8.realpathSync)(resolvedPath);
|
|
17264
17253
|
} catch (err) {
|
|
17265
17254
|
const errorToken = "E_PATH_RESOLUTION_FAILED";
|
|
17266
17255
|
return singleErrorBlock(`${errorToken}: Failed to resolve prompt_file '${promptFile}'.
|
|
@@ -17269,8 +17258,8 @@ Resolved working directory: ${baseDirReal}
|
|
|
17269
17258
|
Path policy: ${pathPolicy}
|
|
17270
17259
|
Suggested: ensure the prompt file exists and is accessible`);
|
|
17271
17260
|
}
|
|
17272
|
-
const relReal = (0,
|
|
17273
|
-
if (!isExternalPromptAllowed() && (relReal === ".." || relReal.startsWith(".." +
|
|
17261
|
+
const relReal = (0, import_path8.relative)(cwdReal, resolvedReal);
|
|
17262
|
+
if (!isExternalPromptAllowed() && (relReal === ".." || relReal.startsWith(".." + import_path8.sep) || (0, import_path8.isAbsolute)(relReal))) {
|
|
17274
17263
|
const errorToken = "E_PATH_OUTSIDE_WORKDIR_PROMPT";
|
|
17275
17264
|
return singleErrorBlock(`${errorToken}: prompt_file '${promptFile}' resolves to a path outside working_directory '${baseDirReal}'.
|
|
17276
17265
|
Requested: ${promptFile}
|
|
@@ -17281,7 +17270,7 @@ Path policy: ${pathPolicy}
|
|
|
17281
17270
|
Suggested: place the prompt file within the working directory or set working_directory to a common ancestor`);
|
|
17282
17271
|
}
|
|
17283
17272
|
try {
|
|
17284
|
-
resolvedPrompt = (0,
|
|
17273
|
+
resolvedPrompt = (0, import_fs8.readFileSync)(resolvedReal, "utf-8");
|
|
17285
17274
|
} catch (err) {
|
|
17286
17275
|
return singleErrorBlock(`Failed to read prompt_file '${promptFile}': ${err.message}`);
|
|
17287
17276
|
}
|
|
@@ -17416,16 +17405,16 @@ Codex CLI error: ${err.message}`);
|
|
|
17416
17405
|
init_define_AGENT_PROMPTS_CODEX();
|
|
17417
17406
|
init_define_AGENT_PROMPTS();
|
|
17418
17407
|
init_define_AGENT_ROLES();
|
|
17419
|
-
var
|
|
17420
|
-
var
|
|
17408
|
+
var import_fs12 = require("fs");
|
|
17409
|
+
var import_path12 = require("path");
|
|
17421
17410
|
|
|
17422
17411
|
// src/mcp/gemini-core.ts
|
|
17423
17412
|
init_define_AGENT_PROMPTS_CODEX();
|
|
17424
17413
|
init_define_AGENT_PROMPTS();
|
|
17425
17414
|
init_define_AGENT_ROLES();
|
|
17426
17415
|
var import_child_process4 = require("child_process");
|
|
17427
|
-
var
|
|
17428
|
-
var
|
|
17416
|
+
var import_fs9 = require("fs");
|
|
17417
|
+
var import_path9 = require("path");
|
|
17429
17418
|
var spawnedPids2 = /* @__PURE__ */ new Set();
|
|
17430
17419
|
function isSpawnedPid2(pid) {
|
|
17431
17420
|
return spawnedPids2.has(pid);
|
|
@@ -17449,8 +17438,8 @@ init_define_AGENT_ROLES();
|
|
|
17449
17438
|
init_define_AGENT_PROMPTS_CODEX();
|
|
17450
17439
|
init_define_AGENT_PROMPTS();
|
|
17451
17440
|
init_define_AGENT_ROLES();
|
|
17452
|
-
var
|
|
17453
|
-
var
|
|
17441
|
+
var import_fs10 = require("fs");
|
|
17442
|
+
var import_path10 = require("path");
|
|
17454
17443
|
var SqliteWorkerAdapter = class {
|
|
17455
17444
|
db = null;
|
|
17456
17445
|
cwd;
|
|
@@ -17461,11 +17450,11 @@ var SqliteWorkerAdapter = class {
|
|
|
17461
17450
|
try {
|
|
17462
17451
|
const betterSqlite3Module = await import("better-sqlite3");
|
|
17463
17452
|
const Database2 = betterSqlite3Module.default || betterSqlite3Module;
|
|
17464
|
-
const stateDir = (0,
|
|
17465
|
-
if (!(0,
|
|
17466
|
-
(0,
|
|
17453
|
+
const stateDir = (0, import_path10.join)(this.cwd, ".omc", "state");
|
|
17454
|
+
if (!(0, import_fs10.existsSync)(stateDir)) {
|
|
17455
|
+
(0, import_fs10.mkdirSync)(stateDir, { recursive: true });
|
|
17467
17456
|
}
|
|
17468
|
-
const dbPath = (0,
|
|
17457
|
+
const dbPath = (0, import_path10.join)(stateDir, "workers.db");
|
|
17469
17458
|
this.db = new Database2(dbPath);
|
|
17470
17459
|
this.db.pragma("journal_mode = WAL");
|
|
17471
17460
|
this.db.exec(`
|
|
@@ -17733,19 +17722,19 @@ var SqliteWorkerAdapter = class {
|
|
|
17733
17722
|
init_define_AGENT_PROMPTS_CODEX();
|
|
17734
17723
|
init_define_AGENT_PROMPTS();
|
|
17735
17724
|
init_define_AGENT_ROLES();
|
|
17736
|
-
var
|
|
17737
|
-
var
|
|
17725
|
+
var import_fs11 = require("fs");
|
|
17726
|
+
var import_path11 = require("path");
|
|
17738
17727
|
var JsonWorkerAdapter = class {
|
|
17739
17728
|
cwd;
|
|
17740
17729
|
stateDir;
|
|
17741
17730
|
constructor(cwd) {
|
|
17742
17731
|
this.cwd = cwd;
|
|
17743
|
-
this.stateDir = (0,
|
|
17732
|
+
this.stateDir = (0, import_path11.join)(cwd, ".omc", "state", "workers");
|
|
17744
17733
|
}
|
|
17745
17734
|
async init() {
|
|
17746
17735
|
try {
|
|
17747
|
-
if (!(0,
|
|
17748
|
-
(0,
|
|
17736
|
+
if (!(0, import_fs11.existsSync)(this.stateDir)) {
|
|
17737
|
+
(0, import_fs11.mkdirSync)(this.stateDir, { recursive: true });
|
|
17749
17738
|
}
|
|
17750
17739
|
return true;
|
|
17751
17740
|
} catch (error2) {
|
|
@@ -17757,12 +17746,12 @@ var JsonWorkerAdapter = class {
|
|
|
17757
17746
|
try {
|
|
17758
17747
|
const filePath = this.getWorkerFilePath(worker.workerId);
|
|
17759
17748
|
const tempPath = `${filePath}.tmp`;
|
|
17760
|
-
(0,
|
|
17761
|
-
if ((0,
|
|
17762
|
-
(0,
|
|
17749
|
+
(0, import_fs11.writeFileSync)(tempPath, JSON.stringify(worker, null, 2), "utf-8");
|
|
17750
|
+
if ((0, import_fs11.existsSync)(filePath)) {
|
|
17751
|
+
(0, import_fs11.unlinkSync)(filePath);
|
|
17763
17752
|
}
|
|
17764
|
-
(0,
|
|
17765
|
-
(0,
|
|
17753
|
+
(0, import_fs11.writeFileSync)(filePath, (0, import_fs11.readFileSync)(tempPath, "utf-8"));
|
|
17754
|
+
(0, import_fs11.unlinkSync)(tempPath);
|
|
17766
17755
|
return true;
|
|
17767
17756
|
} catch (error2) {
|
|
17768
17757
|
console.error("[JsonWorkerAdapter] Upsert failed:", error2);
|
|
@@ -17772,8 +17761,8 @@ var JsonWorkerAdapter = class {
|
|
|
17772
17761
|
async get(workerId) {
|
|
17773
17762
|
try {
|
|
17774
17763
|
const filePath = this.getWorkerFilePath(workerId);
|
|
17775
|
-
if (!(0,
|
|
17776
|
-
const content = (0,
|
|
17764
|
+
if (!(0, import_fs11.existsSync)(filePath)) return null;
|
|
17765
|
+
const content = (0, import_fs11.readFileSync)(filePath, "utf-8");
|
|
17777
17766
|
return JSON.parse(content);
|
|
17778
17767
|
} catch (error2) {
|
|
17779
17768
|
console.error("[JsonWorkerAdapter] Get failed:", error2);
|
|
@@ -17782,12 +17771,12 @@ var JsonWorkerAdapter = class {
|
|
|
17782
17771
|
}
|
|
17783
17772
|
async list(filter) {
|
|
17784
17773
|
try {
|
|
17785
|
-
if (!(0,
|
|
17786
|
-
const files = (0,
|
|
17774
|
+
if (!(0, import_fs11.existsSync)(this.stateDir)) return [];
|
|
17775
|
+
const files = (0, import_fs11.readdirSync)(this.stateDir).filter((f) => f.endsWith(".json"));
|
|
17787
17776
|
const workers = [];
|
|
17788
17777
|
for (const file of files) {
|
|
17789
17778
|
try {
|
|
17790
|
-
const content = (0,
|
|
17779
|
+
const content = (0, import_fs11.readFileSync)((0, import_path11.join)(this.stateDir, file), "utf-8");
|
|
17791
17780
|
const worker = JSON.parse(content);
|
|
17792
17781
|
if (this.matchesFilter(worker, filter)) {
|
|
17793
17782
|
workers.push(worker);
|
|
@@ -17807,8 +17796,8 @@ var JsonWorkerAdapter = class {
|
|
|
17807
17796
|
async delete(workerId) {
|
|
17808
17797
|
try {
|
|
17809
17798
|
const filePath = this.getWorkerFilePath(workerId);
|
|
17810
|
-
if (!(0,
|
|
17811
|
-
(0,
|
|
17799
|
+
if (!(0, import_fs11.existsSync)(filePath)) return false;
|
|
17800
|
+
(0, import_fs11.unlinkSync)(filePath);
|
|
17812
17801
|
return true;
|
|
17813
17802
|
} catch (error2) {
|
|
17814
17803
|
console.error("[JsonWorkerAdapter] Delete failed:", error2);
|
|
@@ -17856,7 +17845,7 @@ var JsonWorkerAdapter = class {
|
|
|
17856
17845
|
}
|
|
17857
17846
|
getWorkerFilePath(workerId) {
|
|
17858
17847
|
const safeId = workerId.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
17859
|
-
return (0,
|
|
17848
|
+
return (0, import_path11.join)(this.stateDir, `${safeId}.json`);
|
|
17860
17849
|
}
|
|
17861
17850
|
matchesFilter(worker, filter) {
|
|
17862
17851
|
if (!filter) return true;
|
|
@@ -18021,9 +18010,9 @@ function findJobStatusFile(provider, jobId, workingDirectory) {
|
|
|
18021
18010
|
return void 0;
|
|
18022
18011
|
}
|
|
18023
18012
|
const promptsDir = getPromptsDir(workingDirectory);
|
|
18024
|
-
if (!(0,
|
|
18013
|
+
if (!(0, import_fs12.existsSync)(promptsDir)) return void 0;
|
|
18025
18014
|
try {
|
|
18026
|
-
const files = (0,
|
|
18015
|
+
const files = (0, import_fs12.readdirSync)(promptsDir);
|
|
18027
18016
|
const escapedProvider = escapeRegex2(provider);
|
|
18028
18017
|
const escapedJobId = escapeRegex2(jobId);
|
|
18029
18018
|
const pattern = new RegExp(`^${escapedProvider}-status-(.+)-${escapedJobId}\\.json$`);
|
|
@@ -18034,7 +18023,7 @@ function findJobStatusFile(provider, jobId, workingDirectory) {
|
|
|
18034
18023
|
matches.push({
|
|
18035
18024
|
file: f,
|
|
18036
18025
|
slug: m[1],
|
|
18037
|
-
statusPath: (0,
|
|
18026
|
+
statusPath: (0, import_path12.join)(promptsDir, f)
|
|
18038
18027
|
});
|
|
18039
18028
|
}
|
|
18040
18029
|
}
|
|
@@ -18045,7 +18034,7 @@ function findJobStatusFile(provider, jobId, workingDirectory) {
|
|
|
18045
18034
|
let best;
|
|
18046
18035
|
for (const match of matches) {
|
|
18047
18036
|
try {
|
|
18048
|
-
const content = (0,
|
|
18037
|
+
const content = (0, import_fs12.readFileSync)(match.statusPath, "utf-8");
|
|
18049
18038
|
const status = JSON.parse(content);
|
|
18050
18039
|
const isActive = status.status === "spawned" || status.status === "running";
|
|
18051
18040
|
const spawnedAt = new Date(status.spawnedAt).getTime();
|
|
@@ -18553,18 +18542,18 @@ ${lines.join("\n\n")}`);
|
|
|
18553
18542
|
}
|
|
18554
18543
|
}
|
|
18555
18544
|
const promptsDir = getPromptsDir();
|
|
18556
|
-
if (!(0,
|
|
18545
|
+
if (!(0, import_fs12.existsSync)(promptsDir)) {
|
|
18557
18546
|
return textResult(`No ${provider} jobs found.`);
|
|
18558
18547
|
}
|
|
18559
18548
|
try {
|
|
18560
|
-
const files = (0,
|
|
18549
|
+
const files = (0, import_fs12.readdirSync)(promptsDir);
|
|
18561
18550
|
const statusFiles = files.filter(
|
|
18562
18551
|
(f) => f.startsWith(`${provider}-status-`) && f.endsWith(".json")
|
|
18563
18552
|
);
|
|
18564
18553
|
const jobs = [];
|
|
18565
18554
|
for (const file of statusFiles) {
|
|
18566
18555
|
try {
|
|
18567
|
-
const content = (0,
|
|
18556
|
+
const content = (0, import_fs12.readFileSync)((0, import_path12.join)(promptsDir, file), "utf-8");
|
|
18568
18557
|
const job = JSON.parse(content);
|
|
18569
18558
|
if (statusFilter === "completed" && job.status !== "completed") continue;
|
|
18570
18559
|
if (statusFilter === "failed" && job.status !== "failed" && job.status !== "timeout") continue;
|