agentwheel 0.16.0 → 0.16.2
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/dist/index.js +56 -8
- package/openpack.json +1 -1
- package/package.json +1 -1
- package/skills/agentwheel/SKILL.md +1 -1
package/dist/index.js
CHANGED
|
@@ -941,6 +941,9 @@ function mergeOpenClawJson(base, incoming, path = []) {
|
|
|
941
941
|
if (path.join(".") === "agents.list" && Array.isArray(base) && Array.isArray(incoming)) {
|
|
942
942
|
return mergeOpenClawAgentsById(base, incoming);
|
|
943
943
|
}
|
|
944
|
+
if (isAgentwheelSkillRouterRepositoriesPath(path) && Array.isArray(base) && Array.isArray(incoming)) {
|
|
945
|
+
return mergeOpenClawRecordsByKey(base, incoming, "name");
|
|
946
|
+
}
|
|
944
947
|
if (Array.isArray(base) && Array.isArray(incoming)) {
|
|
945
948
|
return deepMerge(base, incoming);
|
|
946
949
|
}
|
|
@@ -956,6 +959,9 @@ function mergeOpenClawJson(base, incoming, path = []) {
|
|
|
956
959
|
function isMcpServerCodexAgentsPath(path) {
|
|
957
960
|
return path.length === 5 && path[0] === "mcp" && path[1] === "servers" && path[3] === "codex" && path[4] === "agents";
|
|
958
961
|
}
|
|
962
|
+
function isAgentwheelSkillRouterRepositoriesPath(path) {
|
|
963
|
+
return path.join(".") === "plugins.entries.agentwheel-skill-router.config.repositories";
|
|
964
|
+
}
|
|
959
965
|
function expandEnvPlaceholders(value, sourcePath) {
|
|
960
966
|
if (typeof value === "string") {
|
|
961
967
|
return value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_match, name) => {
|
|
@@ -1011,6 +1017,35 @@ function mergeOpenClawAgentsById(base, incoming) {
|
|
|
1011
1017
|
}
|
|
1012
1018
|
return out;
|
|
1013
1019
|
}
|
|
1020
|
+
function mergeOpenClawRecordsByKey(base, incoming, key) {
|
|
1021
|
+
const replacements = /* @__PURE__ */ new Map();
|
|
1022
|
+
for (const value of incoming) {
|
|
1023
|
+
const recordKey = isRecord(value) && typeof value[key] === "string" ? value[key] : void 0;
|
|
1024
|
+
if (recordKey) replacements.set(recordKey, value);
|
|
1025
|
+
}
|
|
1026
|
+
const out = [];
|
|
1027
|
+
const emitted = /* @__PURE__ */ new Set();
|
|
1028
|
+
for (const value of base) {
|
|
1029
|
+
const recordKey = isRecord(value) && typeof value[key] === "string" ? value[key] : void 0;
|
|
1030
|
+
const replacement = recordKey ? replacements.get(recordKey) : void 0;
|
|
1031
|
+
if (!recordKey || !replacement) {
|
|
1032
|
+
out.push(value);
|
|
1033
|
+
continue;
|
|
1034
|
+
}
|
|
1035
|
+
if (!emitted.has(recordKey)) {
|
|
1036
|
+
out.push(replacement);
|
|
1037
|
+
emitted.add(recordKey);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
for (const value of incoming) {
|
|
1041
|
+
const recordKey = isRecord(value) && typeof value[key] === "string" ? value[key] : void 0;
|
|
1042
|
+
if (!recordKey || !emitted.has(recordKey)) {
|
|
1043
|
+
out.push(value);
|
|
1044
|
+
if (recordKey) emitted.add(recordKey);
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
return out;
|
|
1048
|
+
}
|
|
1014
1049
|
|
|
1015
1050
|
// src/install/manifest.ts
|
|
1016
1051
|
import { createHash as createHash2 } from "crypto";
|
|
@@ -4623,9 +4658,10 @@ function formatPlan(plan) {
|
|
|
4623
4658
|
);
|
|
4624
4659
|
return lines.join("\n");
|
|
4625
4660
|
}
|
|
4626
|
-
function planReport(targets, warnings = []) {
|
|
4661
|
+
function planReport(targets, warnings = [], applied = false) {
|
|
4627
4662
|
return {
|
|
4628
4663
|
schemaVersion: 1,
|
|
4664
|
+
applied,
|
|
4629
4665
|
targets: [...targets].sort(comparePlanReportTargets),
|
|
4630
4666
|
warnings: [...warnings].sort((a, b) => a.localeCompare(b))
|
|
4631
4667
|
};
|
|
@@ -12348,6 +12384,14 @@ async function runInstallCommand(nameOrSource, options, behavior) {
|
|
|
12348
12384
|
if (outputFormat !== "human") {
|
|
12349
12385
|
const report = await buildPlanReport(nameOrSource, normalizedOptions);
|
|
12350
12386
|
if (report.targets.some((target) => target.hasBlockingChanges)) process.exitCode = 1;
|
|
12387
|
+
if (behavior.apply) {
|
|
12388
|
+
await runInstallCommand(
|
|
12389
|
+
nameOrSource,
|
|
12390
|
+
{ ...normalizedOptions, format: "human", json: false },
|
|
12391
|
+
{ apply: true, quiet: true }
|
|
12392
|
+
);
|
|
12393
|
+
report.applied = true;
|
|
12394
|
+
}
|
|
12351
12395
|
process.stdout.write(`${renderReport(report, outputFormat)}
|
|
12352
12396
|
`);
|
|
12353
12397
|
return;
|
|
@@ -12387,12 +12431,14 @@ async function runInstallCommand(nameOrSource, options, behavior) {
|
|
|
12387
12431
|
warn: (message) => console.warn(message)
|
|
12388
12432
|
});
|
|
12389
12433
|
for (const result of results) {
|
|
12390
|
-
|
|
12391
|
-
|
|
12392
|
-
|
|
12434
|
+
if (!behavior.quiet) {
|
|
12435
|
+
console.log(`Profile ${normalizedOptions.profile} / ${result.runtime} / ${result.packageName} at ${result.targetRoot} (${result.transport}):`);
|
|
12436
|
+
console.log(formatPlan(result.plan));
|
|
12437
|
+
if (result.reloaded) console.log(`Reloaded runtime via ${result.reloadCommandSummary}.`);
|
|
12438
|
+
}
|
|
12393
12439
|
if (result.plan.hasBlockingChanges) process.exitCode = 1;
|
|
12394
12440
|
}
|
|
12395
|
-
if (behavior.apply) {
|
|
12441
|
+
if (behavior.apply && !behavior.quiet) {
|
|
12396
12442
|
console.log("Applied.");
|
|
12397
12443
|
}
|
|
12398
12444
|
return;
|
|
@@ -12419,7 +12465,7 @@ async function runInstallCommand(nameOrSource, options, behavior) {
|
|
|
12419
12465
|
}
|
|
12420
12466
|
}
|
|
12421
12467
|
for (const result of await buildGraphPlansForTarget(target, source, { ...targetOptions, scope, extraPackage, reportFormat: outputFormat }, { mode: "install" })) {
|
|
12422
|
-
console.log(formatGraphPlan(result));
|
|
12468
|
+
if (!behavior.quiet) console.log(formatGraphPlan(result));
|
|
12423
12469
|
if (behavior.apply) {
|
|
12424
12470
|
const transport = transportForTarget(target);
|
|
12425
12471
|
const executePlugins = target.executePlugins ?? targetOptions.executePlugins;
|
|
@@ -12433,8 +12479,10 @@ async function runInstallCommand(nameOrSource, options, behavior) {
|
|
|
12433
12479
|
enabled: target.reloadRuntimes ?? shouldReloadRuntimes(targetOptions),
|
|
12434
12480
|
executePlugins
|
|
12435
12481
|
});
|
|
12436
|
-
|
|
12437
|
-
|
|
12482
|
+
if (!behavior.quiet) {
|
|
12483
|
+
console.log(`Applied ${result.plan.adapter} at ${result.plan.targetRoot}.`);
|
|
12484
|
+
if (reloaded) console.log(`Reloaded runtime via ${formatReloadCommands(target.reloadCommands)}.`);
|
|
12485
|
+
}
|
|
12438
12486
|
}
|
|
12439
12487
|
await rm12(result.bundle.root, { recursive: true, force: true });
|
|
12440
12488
|
if (result.plan.hasBlockingChanges) process.exitCode = 1;
|
package/openpack.json
CHANGED
package/package.json
CHANGED