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