agentwheel 0.14.7 → 0.14.8
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 +72 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -143,6 +143,20 @@ function supportedInstallationTypes(adapter, artifactType) {
|
|
|
143
143
|
}
|
|
144
144
|
return [...types].sort((a, b) => a.localeCompare(b));
|
|
145
145
|
}
|
|
146
|
+
function adapterTargetSupport(adapter, artifactType, installationType) {
|
|
147
|
+
if (artifactType === "fragments") return { ok: true };
|
|
148
|
+
const registry = adapter.targets[artifactType];
|
|
149
|
+
const supported = supportedInstallationTypes(adapter, artifactType);
|
|
150
|
+
if (!registry) {
|
|
151
|
+
return { ok: false, reason: "adapter-target-unsupported", supportedInstallationTypes: supported };
|
|
152
|
+
}
|
|
153
|
+
const target = registry[installationType];
|
|
154
|
+
if (target?.enabled) return { ok: true };
|
|
155
|
+
if (target && !target.enabled) {
|
|
156
|
+
return { ok: false, reason: "adapter-target-disabled", supportedInstallationTypes: supported };
|
|
157
|
+
}
|
|
158
|
+
return { ok: false, reason: "adapter-target-unsupported", supportedInstallationTypes: supported };
|
|
159
|
+
}
|
|
146
160
|
function resolveInstallationTypeForArtifacts(adapter, artifactTypes, requested) {
|
|
147
161
|
const installableTypes = [...new Set(artifactTypes.filter((type) => type !== "fragments"))];
|
|
148
162
|
if (installableTypes.length === 0) {
|
|
@@ -2867,11 +2881,6 @@ async function semanticPluginSpecForArtifact(request) {
|
|
|
2867
2881
|
return void 0;
|
|
2868
2882
|
}
|
|
2869
2883
|
|
|
2870
|
-
// src/validation/artifacts.ts
|
|
2871
|
-
import { readFile as readFile15 } from "fs/promises";
|
|
2872
|
-
import { basename as basename7, join as join15 } from "path";
|
|
2873
|
-
import { parseDocument as parseDocument2 } from "yaml";
|
|
2874
|
-
|
|
2875
2884
|
// src/model/selection.ts
|
|
2876
2885
|
function artifactSelectorKey(artifact) {
|
|
2877
2886
|
return `${artifact.type}/${artifact.name}`;
|
|
@@ -2922,7 +2931,51 @@ function subagentBaseName(name) {
|
|
|
2922
2931
|
return name.replace(/\.agent\.md$/i, "").replace(/\.toml$/i, "").replace(/\.md$/i, "");
|
|
2923
2932
|
}
|
|
2924
2933
|
|
|
2934
|
+
// src/validation/adapter-targets.ts
|
|
2935
|
+
function filterArtifactsByAdapterTargets(artifacts, adapter, installationType, options = {}) {
|
|
2936
|
+
const skipped = [];
|
|
2937
|
+
const installable = artifacts.filter((artifact) => {
|
|
2938
|
+
if (artifact.type === "fragments") return true;
|
|
2939
|
+
const support = adapterTargetSupport(adapter, artifact.type, installationType);
|
|
2940
|
+
if (support.ok) return true;
|
|
2941
|
+
const selector = artifactSelectorKey(artifact);
|
|
2942
|
+
skipped.push({ selector, artifactType: artifact.type, support });
|
|
2943
|
+
options.warn?.(skipWarning(selector, adapter, installationType, artifact.type, support));
|
|
2944
|
+
return false;
|
|
2945
|
+
});
|
|
2946
|
+
const before = artifacts.filter((artifact) => artifact.type !== "fragments");
|
|
2947
|
+
const after = installable.filter((artifact) => artifact.type !== "fragments");
|
|
2948
|
+
if (before.length > 0 && after.length === 0) {
|
|
2949
|
+
throw new Error(
|
|
2950
|
+
`${unsupportedSummary(adapter, installationType, skipped)} No installable artifacts remain for adapter ${adapter.name}/${installationType} after skipping unsupported targets: ${skipped.map((item) => item.selector).join(", ")}`
|
|
2951
|
+
);
|
|
2952
|
+
}
|
|
2953
|
+
return installable;
|
|
2954
|
+
}
|
|
2955
|
+
function unsupportedSummary(adapter, installationType, skipped) {
|
|
2956
|
+
const types = [...new Set(skipped.map((item) => item.artifactType))].sort((a, b) => a.localeCompare(b));
|
|
2957
|
+
if (types.length !== 1) {
|
|
2958
|
+
return `Adapter ${adapter.name} does not support selected artifact targets for installation type '${installationType}'.`;
|
|
2959
|
+
}
|
|
2960
|
+
const type = types[0];
|
|
2961
|
+
const supported = [...new Set(skipped.flatMap((item) => item.support.supportedInstallationTypes))].sort((a, b) => a.localeCompare(b));
|
|
2962
|
+
if (supported.length > 0) {
|
|
2963
|
+
return `Adapter ${adapter.name} does not support ${type} artifacts for installation type '${installationType}'. Supported: ${supported.join(", ")}.`;
|
|
2964
|
+
}
|
|
2965
|
+
return `Adapter ${adapter.name} does not support ${type} artifacts for any installation type.`;
|
|
2966
|
+
}
|
|
2967
|
+
function skipWarning(selector, adapter, installationType, artifactType, support) {
|
|
2968
|
+
if (support.reason === "adapter-target-disabled") {
|
|
2969
|
+
return `skip ${selector} (selected but adapter-target-disabled: ${adapter.name}/${installationType} disables ${artifactType})`;
|
|
2970
|
+
}
|
|
2971
|
+
const suffix = support.supportedInstallationTypes.length > 0 ? `; supported installation types: ${support.supportedInstallationTypes.join(", ")}` : "";
|
|
2972
|
+
return `skip ${selector} (selected but adapter-target-unsupported: ${adapter.name}/${installationType} has no enabled target for ${artifactType}${suffix})`;
|
|
2973
|
+
}
|
|
2974
|
+
|
|
2925
2975
|
// src/validation/artifacts.ts
|
|
2976
|
+
import { readFile as readFile15 } from "fs/promises";
|
|
2977
|
+
import { basename as basename7, join as join15 } from "path";
|
|
2978
|
+
import { parseDocument as parseDocument2 } from "yaml";
|
|
2926
2979
|
var behavioralRuleFormats = ["markdown-rule", "claude-markdown-rule", "copilot-instruction-rule"];
|
|
2927
2980
|
var pluginFormats = ["claude-plugin", "codex-plugin", "hermes-plugin", "copilot-plugin", "openclaw-plugin", "openclaw-clawhub-plugin"];
|
|
2928
2981
|
async function filterArtifactsByInstallFormat(artifacts, adapter, installationType, options = {}) {
|
|
@@ -3380,7 +3433,10 @@ function errorMessage(error) {
|
|
|
3380
3433
|
// src/install/plan.ts
|
|
3381
3434
|
async function createCombinedInstallPlan(desiredArtifacts, adapter, targetRoot, manifest, transport = localTransport, options = {}) {
|
|
3382
3435
|
const requestedInstallationType = options.installationType ?? defaultInstallationType;
|
|
3383
|
-
const
|
|
3436
|
+
const formatCompatibleArtifacts = await filterArtifactsByInstallFormat(desiredArtifacts, adapter, requestedInstallationType, { warn: options.warn });
|
|
3437
|
+
const installableArtifacts = filterArtifactsByAdapterTargets(formatCompatibleArtifacts, adapter, requestedInstallationType, {
|
|
3438
|
+
warn: options.suppressAdapterTargetWarnings ? void 0 : options.warn
|
|
3439
|
+
});
|
|
3384
3440
|
const installationType = resolveInstallationTypeForArtifacts(adapter, installableArtifacts.map((artifact) => artifact.type), requestedInstallationType);
|
|
3385
3441
|
const installRoot = installRootForArtifacts(adapter, targetRoot, installationType, installableArtifacts.map((artifact) => artifact.type), transport.kind === "ssh");
|
|
3386
3442
|
await validateArtifactsForInstall(installableArtifacts, adapter, installationType);
|
|
@@ -6299,6 +6355,8 @@ var workspaceTrustSchema = z6.object({
|
|
|
6299
6355
|
}).default({});
|
|
6300
6356
|
var workspaceAgentSchema = z6.object({
|
|
6301
6357
|
adapter: z6.string().min(1),
|
|
6358
|
+
adapterConfig: z6.string().min(1).optional(),
|
|
6359
|
+
adapterModule: z6.string().min(1).optional(),
|
|
6302
6360
|
root: z6.string().min(1),
|
|
6303
6361
|
installationType: installationTypeSchema.optional(),
|
|
6304
6362
|
transport: z6.enum(["local", "ssh"]).default("local"),
|
|
@@ -8354,7 +8412,12 @@ async function createGraphSourcePlan(options) {
|
|
|
8354
8412
|
targetFingerprint,
|
|
8355
8413
|
warn
|
|
8356
8414
|
});
|
|
8357
|
-
const desiredArtifacts =
|
|
8415
|
+
const desiredArtifacts = filterArtifactsByAdapterTargets(
|
|
8416
|
+
desiredArtifactsFromGraphBundle(bundle),
|
|
8417
|
+
options.adapter,
|
|
8418
|
+
installationType,
|
|
8419
|
+
{ warn }
|
|
8420
|
+
);
|
|
8358
8421
|
const resolvedInstallationType = resolveInstallationTypeForArtifacts(options.adapter, desiredArtifacts.map((artifact) => artifact.type), installationType);
|
|
8359
8422
|
const resolvedInstallRoot = installRootForArtifacts(options.adapter, options.targetRoot, resolvedInstallationType, desiredArtifacts.map((artifact) => artifact.type), transport.kind === "ssh");
|
|
8360
8423
|
const graphLockDigest = digestGraphLock(bundle.graphLock);
|
|
@@ -8622,6 +8685,8 @@ function targetFromAgent(name, config, workspaceRoot, installationType) {
|
|
|
8622
8685
|
agentName: name,
|
|
8623
8686
|
targetKey: name,
|
|
8624
8687
|
adapter: agent.adapter,
|
|
8688
|
+
adapterConfig: agent.adapterConfig,
|
|
8689
|
+
adapterModule: agent.adapterModule,
|
|
8625
8690
|
installationType: installationType ?? agent.installationType,
|
|
8626
8691
|
targetRoot: agent.transport === "ssh" ? agent.root : resolveConfigPath(agent.root, workspaceRoot),
|
|
8627
8692
|
workspaceRoot,
|