agentwheel 0.21.3 → 0.21.5
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/README.md +12 -0
- package/dist/index.js +37 -12
- package/openpack.json +1 -1
- package/package.json +1 -1
- package/skills/agentwheel/SKILL.md +1 -1
- package/skills/agentwheel-discovery/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -617,6 +617,18 @@ containing only `alias`, `commit` and optional `select`:
|
|
|
617
617
|
]
|
|
618
618
|
```
|
|
619
619
|
|
|
620
|
+
To replace the complete package declaration list without resolving sources, use
|
|
621
|
+
`pin --packages-file reviewed-packages.json --fleet delivery --dry-run`. The file must be a JSON
|
|
622
|
+
array of workspace package entries with unique names; an empty array explicitly removes all
|
|
623
|
+
package declarations. The preview prints the complete proposed config as JSON and writes nothing.
|
|
624
|
+
Review it, then run the same command without `--dry-run` and with `--reason` to apply through the
|
|
625
|
+
normal mutation policy, durable receipt and revision provider. This changes only desired source
|
|
626
|
+
config; it does not install or remove runtime artifacts. Run normal runtime plans before installing.
|
|
627
|
+
All non-package fields are preserved, as are the supplied package order, omitted defaults, metadata
|
|
628
|
+
and extension fields. Package entries must pass the workspace schema. `--packages-file` cannot be
|
|
629
|
+
combined with positional pins, `--pins-file` or `--select`. Existing pin forms also accept
|
|
630
|
+
`--dry-run` for a non-mutating config preview.
|
|
631
|
+
|
|
620
632
|
The batch cannot be combined with positional pins or `--select`. Every entry is validated before
|
|
621
633
|
the config write; duplicate aliases and extra fields are refused. An omitted `select` preserves
|
|
622
634
|
that package's selection; an explicit list replaces only that package's complete selection. The
|
package/dist/index.js
CHANGED
|
@@ -2885,7 +2885,23 @@ async function writeWorkspaceConfig(workspaceRoot, config) {
|
|
|
2885
2885
|
declareMutationPath(path);
|
|
2886
2886
|
await writeJsonAtomic(path, workspaceConfigSchema.parse(config));
|
|
2887
2887
|
}
|
|
2888
|
-
async function pinConfiguredPackages(workspaceRoot, input) {
|
|
2888
|
+
async function pinConfiguredPackages(workspaceRoot, input, options = {}) {
|
|
2889
|
+
if (options.replacePackages) {
|
|
2890
|
+
const packages = z10.array(workspacePackageSchema).parse(input);
|
|
2891
|
+
if (new Set(packages.map((pkg) => pkg.name)).size !== packages.length) {
|
|
2892
|
+
throw new Error("Package declarations require unique aliases.");
|
|
2893
|
+
}
|
|
2894
|
+
const path2 = workspaceConfigPath(workspaceRoot);
|
|
2895
|
+
const config2 = JSON.parse(await readFile10(path2, "utf8"));
|
|
2896
|
+
workspaceConfigSchema.parse(config2);
|
|
2897
|
+
config2.packages = input;
|
|
2898
|
+
workspaceConfigSchema.parse(config2);
|
|
2899
|
+
if (!options.dryRun) {
|
|
2900
|
+
declareMutationPath(path2);
|
|
2901
|
+
await writeJsonAtomic(path2, config2);
|
|
2902
|
+
}
|
|
2903
|
+
return config2;
|
|
2904
|
+
}
|
|
2889
2905
|
const pins = z10.array(z10.object({
|
|
2890
2906
|
alias: z10.string().min(1),
|
|
2891
2907
|
commit: z10.string().regex(/^[a-f0-9]{40}$/i, "Pin requires an exact 40-hex commit SHA."),
|
|
@@ -2919,8 +2935,11 @@ async function pinConfiguredPackages(workspaceRoot, input) {
|
|
|
2919
2935
|
}
|
|
2920
2936
|
}
|
|
2921
2937
|
workspaceConfigSchema.parse(config);
|
|
2922
|
-
|
|
2923
|
-
|
|
2938
|
+
if (!options.dryRun) {
|
|
2939
|
+
declareMutationPath(path);
|
|
2940
|
+
await writeJsonAtomic(path, config);
|
|
2941
|
+
}
|
|
2942
|
+
return config;
|
|
2924
2943
|
}
|
|
2925
2944
|
function upsertPackage(config, entry) {
|
|
2926
2945
|
const parsed = workspaceConfigSchema.parse(config);
|
|
@@ -20013,7 +20032,7 @@ async function inspectInstalledState(source, destination, packageNames) {
|
|
|
20013
20032
|
if (!sourceGraphArtifacts.has(graphEntryIdentity(sourceEntry.entry))) {
|
|
20014
20033
|
throw new Error(`Source manifest entry is not covered by its graph lock: ${sourceEntry.renderedPath}`);
|
|
20015
20034
|
}
|
|
20016
|
-
if (sourceEntry.entry.owners.some((owner) => !
|
|
20035
|
+
if (sourceEntry.entry.owners.some((owner) => !ownerMatchesPackage(owner, selected))) {
|
|
20017
20036
|
throw new Error(`Partial ownership at ${sourceEntry.renderedPath} includes packages outside the normalization selection.`);
|
|
20018
20037
|
}
|
|
20019
20038
|
const destinationRenderedPath = renderedEntryPathForRoot(destinationState.installRoot, sourceEntry.entry.path);
|
|
@@ -21185,7 +21204,7 @@ var commandGovernance = {
|
|
|
21185
21204
|
"fleet normalize": "governed-apply-or-recover",
|
|
21186
21205
|
"cache prune": "governed-apply",
|
|
21187
21206
|
add: "governed-always",
|
|
21188
|
-
pin: "governed-
|
|
21207
|
+
pin: "governed-unless-dry-run",
|
|
21189
21208
|
list: "incidental-cache",
|
|
21190
21209
|
search: "incidental-cache",
|
|
21191
21210
|
try: "incidental-cache",
|
|
@@ -21329,14 +21348,20 @@ program.command("add").description("add a package to .agentwheel/config.json wit
|
|
|
21329
21348
|
await writeWorkspaceConfig(targetRoot, upsertPackage(await readWorkspaceConfig(targetRoot), entry));
|
|
21330
21349
|
console.log(`Added ${entry.name}. Preview: agentwheel plan - Apply: agentwheel install`);
|
|
21331
21350
|
});
|
|
21332
|
-
program.command("pin").description("pin configured
|
|
21351
|
+
program.command("pin").description("pin configured revisions or replace package declarations without touching runtimes").argument("[alias]", "exact configured package alias").argument("[commit]", "exact 40-hex commit SHA").option("--user", "use the user workspace", false).option("--local", "use the nearest local workspace", false).option("--fleet <id>", "use one registered named fleet").option("-t, --target-root <path>", "explicit workspace root").option("--pins-file <path>", "JSON array of {alias, commit, select?} pins in one mutation").option("--packages-file <path>", "JSON array replacing the complete configured packages list").option("--dry-run", "print the complete proposed config as JSON without writing", false).option("--select <type/name>", "replace the complete selection (repeatable or comma-separated)", collectSelectOption).action(async (alias, commit, options) => {
|
|
21333
21352
|
const workspaceRoot = await workspaceRootFromOptions(normalizeRuntimeScopeOptions(options));
|
|
21334
|
-
|
|
21335
|
-
|
|
21336
|
-
|
|
21337
|
-
|
|
21338
|
-
|
|
21339
|
-
|
|
21353
|
+
const positional = alias !== void 0 || commit !== void 0 || options.select !== void 0;
|
|
21354
|
+
if (options.packagesFile ? positional || options.pinsFile : options.pinsFile ? positional : !alias || !commit) {
|
|
21355
|
+
throw new Error("Choose pin <alias> <commit> [--select ...], --pins-file <path>, or --packages-file <path>, exclusively.");
|
|
21356
|
+
}
|
|
21357
|
+
const inputFile = options.packagesFile ?? options.pinsFile;
|
|
21358
|
+
const input = inputFile ? JSON.parse(await readFile45(resolve44(inputFile), "utf8")) : [{ alias, commit, ...options.select === void 0 ? {} : { select: options.select } }];
|
|
21359
|
+
const config = await pinConfiguredPackages(workspaceRoot, input, {
|
|
21360
|
+
dryRun: options.dryRun,
|
|
21361
|
+
replacePackages: options.packagesFile !== void 0
|
|
21362
|
+
});
|
|
21363
|
+
if (options.dryRun) console.log(JSON.stringify(config, null, 2));
|
|
21364
|
+
else console.log("Pinned configured packages. Preview: agentwheel plan - Apply: agentwheel install");
|
|
21340
21365
|
});
|
|
21341
21366
|
program.command("list").description("list artifacts exposed by a package source").argument("<source>", "package source").option("--driver <driver>", "source driver").option("--user", "use the user workspace", false).option("--local", "use the nearest local workspace", false).option("--fleet <id>", "use one registered named fleet").option("-t, --target-root <path>", "explicit workspace root").option("--select <type/name>", "select an artifact by type/name (repeatable or comma-separated)", collectSelectOption, []).option("--skill <name>", "select a skill by name (repeatable or comma-separated)", collectSkillOption, []).action(async (source, options) => {
|
|
21342
21367
|
const targetRoot = await workspaceContextRootFromOptions(normalizeRuntimeScopeOptions(options));
|
package/openpack.json
CHANGED
package/package.json
CHANGED