@liangjie559567/ultrapower 5.5.31 → 5.5.32
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 +36 -13
- package/bridge/gemini-server.cjs +36 -13
- package/bridge/mcp-server.cjs +124 -143
- package/bridge/team-bridge.cjs +7 -6
- package/dist/agents/utils.d.ts.map +1 -1
- package/dist/agents/utils.js +26 -4
- package/dist/agents/utils.js.map +1 -1
- package/dist/analytics/token-tracker.d.ts.map +1 -1
- package/dist/analytics/token-tracker.js +439 -0
- package/dist/analytics/token-tracker.js.map +1 -0
- package/dist/audit/logger.d.ts.map +1 -1
- package/dist/audit/logger.js +15 -10
- package/dist/audit/logger.js.map +1 -1
- package/dist/features/token-tracker/index.d.ts +21 -0
- package/dist/features/token-tracker/index.d.ts.map +1 -0
- package/dist/features/token-tracker/index.js +81 -0
- package/dist/features/token-tracker/index.js.map +1 -0
- package/dist/hooks/autopilot/state.d.ts.map +1 -1
- package/dist/hooks/autopilot/state.js +10 -85
- package/dist/hooks/autopilot/state.js.map +1 -1
- package/dist/hooks/learner/index.d.ts +65 -0
- package/dist/hooks/learner/index.d.ts.map +1 -0
- package/dist/hooks/learner/promotion.d.ts +39 -0
- package/dist/hooks/learner/promotion.d.ts.map +1 -0
- package/dist/hooks/persistent-mode/event-bus.d.ts +12 -0
- package/dist/hooks/persistent-mode/event-bus.d.ts.map +1 -0
- package/dist/hooks/persistent-mode/event-bus.js +18 -0
- package/dist/hooks/persistent-mode/event-bus.js.map +1 -0
- package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/index.js +95 -48
- package/dist/hooks/persistent-mode/index.js.map +1 -1
- package/dist/hooks/ralph/index.d.ts +11 -0
- package/dist/hooks/ralph/index.d.ts.map +1 -0
- package/dist/hooks/ralph/loop.d.ts +118 -0
- package/dist/hooks/ralph/loop.d.ts.map +1 -0
- package/dist/hooks/ralph/loop.js +330 -0
- package/dist/hooks/ralph/loop.js.map +1 -0
- package/dist/hooks/ultraqa/index.d.ts +96 -0
- package/dist/hooks/ultraqa/index.d.ts.map +1 -0
- package/dist/hooks/ultrawork/index.d.ts +66 -0
- package/dist/hooks/ultrawork/index.d.ts.map +1 -0
- package/dist/hooks/ultrawork/index.js +127 -0
- package/dist/hooks/ultrawork/index.js.map +1 -0
- package/dist/lib/file-lock.d.ts.map +1 -1
- package/dist/lib/file-lock.js +10 -9
- package/dist/lib/file-lock.js.map +1 -1
- package/dist/lib/git-utils.d.ts +55 -0
- package/dist/lib/git-utils.d.ts.map +1 -0
- package/dist/lib/git-utils.js +140 -0
- package/dist/lib/git-utils.js.map +1 -0
- package/dist/lib/state-adapter.d.ts +77 -0
- package/dist/lib/state-adapter.d.ts.map +1 -0
- package/dist/lib/state-adapter.js +166 -0
- package/dist/lib/state-adapter.js.map +1 -0
- package/dist/lib/state-cache.d.ts +26 -0
- package/dist/lib/state-cache.d.ts.map +1 -0
- package/dist/lib/state-cache.js +48 -0
- package/dist/lib/state-cache.js.map +1 -0
- package/dist/lib/validateMode.d.ts +3 -2
- package/dist/lib/validateMode.d.ts.map +1 -1
- package/dist/lib/validateMode.js +6 -1
- package/dist/lib/validateMode.js.map +1 -1
- package/dist/mcp/adapters/state-adapter.d.ts +3 -3
- package/dist/mcp/adapters/state-adapter.js +82 -0
- package/dist/mcp/adapters/state-adapter.js.map +1 -0
- package/dist/mcp/cli-detection.d.ts +26 -0
- package/dist/mcp/cli-detection.d.ts.map +1 -0
- package/dist/mcp/cli-detection.js +90 -0
- package/dist/mcp/cli-detection.js.map +1 -0
- package/dist/mcp/omc-tools-server.js +136 -0
- package/dist/mcp/omc-tools-server.js.map +1 -0
- package/dist/tools/index.js +166 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/state-tools.d.ts +0 -6
- package/dist/tools/state-tools.d.ts.map +1 -1
- package/dist/tools/state-tools.js +14 -56
- package/dist/tools/state-tools.js.map +1 -1
- package/docs/CLAUDE.md +1 -1
- package/package.json +1 -2
- package/scripts/build-bridge-entry.mjs +2 -1
- package/scripts/build-codex-server.mjs +2 -1
- package/scripts/build-gemini-server.mjs +2 -1
- package/scripts/build-mcp-server.mjs +2 -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.32",
|
|
12
12
|
"source": {
|
|
13
13
|
"source": "npm",
|
|
14
14
|
"package": "@liangjie559567/ultrapower",
|
|
15
|
-
"version": "5.5.
|
|
15
|
+
"version": "5.5.32"
|
|
16
16
|
},
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "liangjie559567"
|
package/bridge/codex-server.cjs
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
try {
|
|
4
4
|
var _cp = require('child_process');
|
|
5
5
|
var _Module = require('module');
|
|
6
|
-
var
|
|
6
|
+
var _result = _cp.spawnSync('npm', ['root', '-g'], { encoding: 'utf8', timeout: 5000 });
|
|
7
|
+
var _globalRoot = _result.status === 0 ? _result.stdout.trim() : '';
|
|
7
8
|
if (_globalRoot) {
|
|
8
9
|
var _sep = process.platform === 'win32' ? ';' : ':';
|
|
9
10
|
process.env.NODE_PATH = _globalRoot + (process.env.NODE_PATH ? _sep + process.env.NODE_PATH : '');
|
|
@@ -14503,11 +14504,14 @@ function detectCodexCli(useCache = true) {
|
|
|
14503
14504
|
if (useCache && codexCache) return codexCache;
|
|
14504
14505
|
const installHint = "Install Codex CLI: npm install -g @openai/codex";
|
|
14505
14506
|
try {
|
|
14506
|
-
const
|
|
14507
|
-
const
|
|
14507
|
+
const cmd = process.platform === "win32" ? "where" : "which";
|
|
14508
|
+
const pathResult = (0, import_child_process.spawnSync)(cmd, ["codex"], { encoding: "utf-8", timeout: 5e3 });
|
|
14509
|
+
if (pathResult.status !== 0) throw new Error("codex not found");
|
|
14510
|
+
const path = pathResult.stdout.trim();
|
|
14508
14511
|
let version2;
|
|
14509
14512
|
try {
|
|
14510
|
-
|
|
14513
|
+
const versionResult = (0, import_child_process.spawnSync)("codex", ["--version"], { encoding: "utf-8", timeout: 5e3 });
|
|
14514
|
+
if (versionResult.status === 0) version2 = versionResult.stdout.trim();
|
|
14511
14515
|
} catch {
|
|
14512
14516
|
}
|
|
14513
14517
|
const result = { available: true, path, version: version2, installHint };
|
|
@@ -14553,13 +14557,13 @@ function setCache(key, value) {
|
|
|
14553
14557
|
}
|
|
14554
14558
|
function execGit(command, cwd) {
|
|
14555
14559
|
try {
|
|
14556
|
-
|
|
14560
|
+
const args = ["--no-pager", ...command.split(/\s+/)];
|
|
14561
|
+
const result = (0, import_child_process2.spawnSync)("git", args, {
|
|
14557
14562
|
cwd,
|
|
14558
14563
|
encoding: "utf-8",
|
|
14559
|
-
timeout: GIT_TIMEOUT
|
|
14560
|
-
|
|
14561
|
-
|
|
14562
|
-
}).trim();
|
|
14564
|
+
timeout: GIT_TIMEOUT
|
|
14565
|
+
});
|
|
14566
|
+
return result.status === 0 ? result.stdout.trim() : "";
|
|
14563
14567
|
} catch {
|
|
14564
14568
|
return "";
|
|
14565
14569
|
}
|
|
@@ -14614,6 +14618,7 @@ function getPackageDir() {
|
|
|
14614
14618
|
}
|
|
14615
14619
|
return process.cwd();
|
|
14616
14620
|
}
|
|
14621
|
+
var promptCache = /* @__PURE__ */ new Map();
|
|
14617
14622
|
function stripFrontmatter(content) {
|
|
14618
14623
|
const match = content.match(/^---[\s\S]*?---\s*([\s\S]*)$/);
|
|
14619
14624
|
return match ? match[1].trim() : content.trim();
|
|
@@ -14623,10 +14628,17 @@ function loadAgentPrompt(agentName, provider) {
|
|
|
14623
14628
|
throw new Error(`Invalid agent name: contains disallowed characters`);
|
|
14624
14629
|
}
|
|
14625
14630
|
if (provider) {
|
|
14631
|
+
const cacheKey2 = `${provider}:${agentName}`;
|
|
14632
|
+
if (promptCache.has(cacheKey2)) {
|
|
14633
|
+
return promptCache.get(cacheKey2);
|
|
14634
|
+
}
|
|
14626
14635
|
try {
|
|
14627
14636
|
if (provider === "codex" && typeof define_AGENT_PROMPTS_CODEX_default !== "undefined" && define_AGENT_PROMPTS_CODEX_default !== null) {
|
|
14628
14637
|
const prompt = define_AGENT_PROMPTS_CODEX_default[agentName];
|
|
14629
|
-
if (prompt)
|
|
14638
|
+
if (prompt) {
|
|
14639
|
+
promptCache.set(cacheKey2, prompt);
|
|
14640
|
+
return prompt;
|
|
14641
|
+
}
|
|
14630
14642
|
}
|
|
14631
14643
|
} catch {
|
|
14632
14644
|
}
|
|
@@ -14638,15 +14650,24 @@ function loadAgentPrompt(agentName, provider) {
|
|
|
14638
14650
|
const rel = (0, import_path3.relative)(resolvedProviderDir, resolvedPath);
|
|
14639
14651
|
if (!rel.startsWith("..") && !(0, import_path3.isAbsolute)(rel)) {
|
|
14640
14652
|
const content = (0, import_fs3.readFileSync)(providerPath, "utf-8");
|
|
14641
|
-
|
|
14653
|
+
const prompt = stripFrontmatter(content);
|
|
14654
|
+
promptCache.set(cacheKey2, prompt);
|
|
14655
|
+
return prompt;
|
|
14642
14656
|
}
|
|
14643
14657
|
} catch {
|
|
14644
14658
|
}
|
|
14645
14659
|
}
|
|
14660
|
+
const cacheKey = agentName;
|
|
14661
|
+
if (promptCache.has(cacheKey)) {
|
|
14662
|
+
return promptCache.get(cacheKey);
|
|
14663
|
+
}
|
|
14646
14664
|
try {
|
|
14647
14665
|
if (typeof define_AGENT_PROMPTS_default !== "undefined" && define_AGENT_PROMPTS_default !== null) {
|
|
14648
14666
|
const prompt = define_AGENT_PROMPTS_default[agentName];
|
|
14649
|
-
if (prompt)
|
|
14667
|
+
if (prompt) {
|
|
14668
|
+
promptCache.set(cacheKey, prompt);
|
|
14669
|
+
return prompt;
|
|
14670
|
+
}
|
|
14650
14671
|
}
|
|
14651
14672
|
} catch {
|
|
14652
14673
|
}
|
|
@@ -14660,7 +14681,9 @@ function loadAgentPrompt(agentName, provider) {
|
|
|
14660
14681
|
throw new Error(`Invalid agent name: path traversal detected`);
|
|
14661
14682
|
}
|
|
14662
14683
|
const content = (0, import_fs3.readFileSync)(agentPath, "utf-8");
|
|
14663
|
-
|
|
14684
|
+
const prompt = stripFrontmatter(content);
|
|
14685
|
+
promptCache.set(cacheKey, prompt);
|
|
14686
|
+
return prompt;
|
|
14664
14687
|
} catch (error2) {
|
|
14665
14688
|
const message = error2 instanceof Error && error2.message.includes("Invalid agent name") ? error2.message : "Agent prompt file not found";
|
|
14666
14689
|
console.warn(`[loadAgentPrompt] ${message}`);
|
package/bridge/gemini-server.cjs
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
try {
|
|
4
4
|
var _cp = require('child_process');
|
|
5
5
|
var _Module = require('module');
|
|
6
|
-
var
|
|
6
|
+
var _result = _cp.spawnSync('npm', ['root', '-g'], { encoding: 'utf8', timeout: 5000 });
|
|
7
|
+
var _globalRoot = _result.status === 0 ? _result.stdout.trim() : '';
|
|
7
8
|
if (_globalRoot) {
|
|
8
9
|
var _sep = process.platform === 'win32' ? ';' : ':';
|
|
9
10
|
process.env.NODE_PATH = _globalRoot + (process.env.NODE_PATH ? _sep + process.env.NODE_PATH : '');
|
|
@@ -14351,11 +14352,14 @@ function detectGeminiCli(useCache = true) {
|
|
|
14351
14352
|
if (useCache && geminiCache) return geminiCache;
|
|
14352
14353
|
const installHint = "Install Gemini CLI: npm install -g @google/gemini-cli (see https://github.com/google-gemini/gemini-cli)";
|
|
14353
14354
|
try {
|
|
14354
|
-
const
|
|
14355
|
-
const
|
|
14355
|
+
const cmd = process.platform === "win32" ? "where" : "which";
|
|
14356
|
+
const pathResult = (0, import_child_process.spawnSync)(cmd, ["gemini"], { encoding: "utf-8", timeout: 5e3 });
|
|
14357
|
+
if (pathResult.status !== 0) throw new Error("gemini not found");
|
|
14358
|
+
const path = pathResult.stdout.trim();
|
|
14356
14359
|
let version2;
|
|
14357
14360
|
try {
|
|
14358
|
-
|
|
14361
|
+
const versionResult = (0, import_child_process.spawnSync)("gemini", ["--version"], { encoding: "utf-8", timeout: 5e3 });
|
|
14362
|
+
if (versionResult.status === 0) version2 = versionResult.stdout.trim();
|
|
14359
14363
|
} catch {
|
|
14360
14364
|
}
|
|
14361
14365
|
const result = { available: true, path, version: version2, installHint };
|
|
@@ -14399,13 +14403,13 @@ function setCache(key, value) {
|
|
|
14399
14403
|
}
|
|
14400
14404
|
function execGit(command, cwd) {
|
|
14401
14405
|
try {
|
|
14402
|
-
|
|
14406
|
+
const args = ["--no-pager", ...command.split(/\s+/)];
|
|
14407
|
+
const result = (0, import_child_process2.spawnSync)("git", args, {
|
|
14403
14408
|
cwd,
|
|
14404
14409
|
encoding: "utf-8",
|
|
14405
|
-
timeout: GIT_TIMEOUT
|
|
14406
|
-
|
|
14407
|
-
|
|
14408
|
-
}).trim();
|
|
14410
|
+
timeout: GIT_TIMEOUT
|
|
14411
|
+
});
|
|
14412
|
+
return result.status === 0 ? result.stdout.trim() : "";
|
|
14409
14413
|
} catch {
|
|
14410
14414
|
return "";
|
|
14411
14415
|
}
|
|
@@ -14458,6 +14462,7 @@ function getPackageDir() {
|
|
|
14458
14462
|
}
|
|
14459
14463
|
return process.cwd();
|
|
14460
14464
|
}
|
|
14465
|
+
var promptCache = /* @__PURE__ */ new Map();
|
|
14461
14466
|
function stripFrontmatter(content) {
|
|
14462
14467
|
const match = content.match(/^---[\s\S]*?---\s*([\s\S]*)$/);
|
|
14463
14468
|
return match ? match[1].trim() : content.trim();
|
|
@@ -14467,10 +14472,17 @@ function loadAgentPrompt(agentName, provider) {
|
|
|
14467
14472
|
throw new Error(`Invalid agent name: contains disallowed characters`);
|
|
14468
14473
|
}
|
|
14469
14474
|
if (provider) {
|
|
14475
|
+
const cacheKey2 = `${provider}:${agentName}`;
|
|
14476
|
+
if (promptCache.has(cacheKey2)) {
|
|
14477
|
+
return promptCache.get(cacheKey2);
|
|
14478
|
+
}
|
|
14470
14479
|
try {
|
|
14471
14480
|
if (provider === "codex" && typeof __AGENT_PROMPTS_CODEX__ !== "undefined" && __AGENT_PROMPTS_CODEX__ !== null) {
|
|
14472
14481
|
const prompt = __AGENT_PROMPTS_CODEX__[agentName];
|
|
14473
|
-
if (prompt)
|
|
14482
|
+
if (prompt) {
|
|
14483
|
+
promptCache.set(cacheKey2, prompt);
|
|
14484
|
+
return prompt;
|
|
14485
|
+
}
|
|
14474
14486
|
}
|
|
14475
14487
|
} catch {
|
|
14476
14488
|
}
|
|
@@ -14482,15 +14494,24 @@ function loadAgentPrompt(agentName, provider) {
|
|
|
14482
14494
|
const rel = (0, import_path3.relative)(resolvedProviderDir, resolvedPath);
|
|
14483
14495
|
if (!rel.startsWith("..") && !(0, import_path3.isAbsolute)(rel)) {
|
|
14484
14496
|
const content = (0, import_fs3.readFileSync)(providerPath, "utf-8");
|
|
14485
|
-
|
|
14497
|
+
const prompt = stripFrontmatter(content);
|
|
14498
|
+
promptCache.set(cacheKey2, prompt);
|
|
14499
|
+
return prompt;
|
|
14486
14500
|
}
|
|
14487
14501
|
} catch {
|
|
14488
14502
|
}
|
|
14489
14503
|
}
|
|
14504
|
+
const cacheKey = agentName;
|
|
14505
|
+
if (promptCache.has(cacheKey)) {
|
|
14506
|
+
return promptCache.get(cacheKey);
|
|
14507
|
+
}
|
|
14490
14508
|
try {
|
|
14491
14509
|
if (typeof define_AGENT_PROMPTS_default !== "undefined" && define_AGENT_PROMPTS_default !== null) {
|
|
14492
14510
|
const prompt = define_AGENT_PROMPTS_default[agentName];
|
|
14493
|
-
if (prompt)
|
|
14511
|
+
if (prompt) {
|
|
14512
|
+
promptCache.set(cacheKey, prompt);
|
|
14513
|
+
return prompt;
|
|
14514
|
+
}
|
|
14494
14515
|
}
|
|
14495
14516
|
} catch {
|
|
14496
14517
|
}
|
|
@@ -14504,7 +14525,9 @@ function loadAgentPrompt(agentName, provider) {
|
|
|
14504
14525
|
throw new Error(`Invalid agent name: path traversal detected`);
|
|
14505
14526
|
}
|
|
14506
14527
|
const content = (0, import_fs3.readFileSync)(agentPath, "utf-8");
|
|
14507
|
-
|
|
14528
|
+
const prompt = stripFrontmatter(content);
|
|
14529
|
+
promptCache.set(cacheKey, prompt);
|
|
14530
|
+
return prompt;
|
|
14508
14531
|
} catch (error2) {
|
|
14509
14532
|
const message = error2 instanceof Error && error2.message.includes("Invalid agent name") ? error2.message : "Agent prompt file not found";
|
|
14510
14533
|
console.warn(`[loadAgentPrompt] ${message}`);
|