agentwheel 0.22.0 → 0.22.1
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 +19 -0
- package/dist/index.js +24 -10
- 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
|
@@ -139,6 +139,25 @@ refused unless `--carry-drift` is passed: the dry-run prints the runtime hash, t
|
|
|
139
139
|
`--expected-runtime-hash <sha256>`, and the manifest keeps the recorded hash so the next install
|
|
140
140
|
still reports the drift. Merge and managed-block entries never carry drift.
|
|
141
141
|
|
|
142
|
+
Qualify a Fleet-owned source with `--from-fleet <id>` together with its exact
|
|
143
|
+
`--from-workspace-root`; use `--to-fleet <id>` for a Fleet-owned destination. Both IDs must
|
|
144
|
+
be registered at the specified roots. These options qualify ownership, whereas `--fleet`
|
|
145
|
+
selects the governing workspace. `--from-fleet` cannot be combined with
|
|
146
|
+
`--from-unknown-owner`. For example, preview returning one entry to its original plain owner:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
agentwheel ownership handoff skills/example-skill --local --agent local-codex --installation-type user \
|
|
150
|
+
--source-state-key codex.user.existing-state \
|
|
151
|
+
--from-workspace-root /fleet/control --from-fleet example-fleet \
|
|
152
|
+
--to-workspace-root /original/workspace --dry-run
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Reverse handoffs require a fresh reviewed plan against the post-handoff state; they do not
|
|
156
|
+
reuse old manifest revisions or erase audit history. For run-as targets, also pass the reviewed
|
|
157
|
+
`--plan-digest` and `--expected-inventory-revision` when applying. The qualified old/new owner
|
|
158
|
+
identities are included in the native plan, its digest and the audit. Each handoff changes the
|
|
159
|
+
inventory revision, so review subsequent operations against their exact intermediate states.
|
|
160
|
+
|
|
142
161
|
Use `--source-state-key <exact-key>` when an existing source manifest must be selected explicitly.
|
|
143
162
|
This is a command-local equivalent of a named agent's `stateKey`; it does not edit agent configuration,
|
|
144
163
|
move state files, or reconstruct graph locks. The key must be canonical and match the selected adapter
|
package/dist/index.js
CHANGED
|
@@ -32400,6 +32400,7 @@ init_adapter();
|
|
|
32400
32400
|
init_transaction();
|
|
32401
32401
|
init_transport();
|
|
32402
32402
|
import { resolve as resolve40 } from "path";
|
|
32403
|
+
init_workspace();
|
|
32403
32404
|
var unknownWorkspaceOwner = "workspace:unknown";
|
|
32404
32405
|
async function planArtifactOwnershipHandoff(request) {
|
|
32405
32406
|
return validateOwnershipHandoff(request, request.transport ?? localTransport);
|
|
@@ -32461,6 +32462,11 @@ async function applyArtifactOwnershipHandoff(request) {
|
|
|
32461
32462
|
}
|
|
32462
32463
|
}
|
|
32463
32464
|
async function validateOwnershipHandoff(request, transport) {
|
|
32465
|
+
if (request.fromFleetId !== void 0 && (request.fromWorkspaceRoot === void 0 || request.fromUnknownOwner === true)) {
|
|
32466
|
+
throw new Error("A source fleet requires fromWorkspaceRoot and cannot be combined with fromUnknownOwner.");
|
|
32467
|
+
}
|
|
32468
|
+
if (request.fromFleetId !== void 0) fleetIdSchema.parse(request.fromFleetId);
|
|
32469
|
+
if (request.toFleetId !== void 0) fleetIdSchema.parse(request.toFleetId);
|
|
32464
32470
|
const endpoint = ownershipRunAsEndpoint(transport, request.targetRoot);
|
|
32465
32471
|
if (request.expectedHash) assertSha256(request.expectedHash, "expected artifact hash");
|
|
32466
32472
|
if (request.expectedRevision) assertSha256(request.expectedRevision, "expected manifest revision");
|
|
@@ -32488,7 +32494,7 @@ async function validateOwnershipHandoff(request, transport) {
|
|
|
32488
32494
|
);
|
|
32489
32495
|
}
|
|
32490
32496
|
const entry = matches[0];
|
|
32491
|
-
const fromOwner = request.fromUnknownOwner === true ? unknownWorkspaceOwner : workspaceOwnerForRoot(request.fromWorkspaceRoot);
|
|
32497
|
+
const fromOwner = request.fromUnknownOwner === true ? unknownWorkspaceOwner : workspaceOwnerForRoot(request.fromWorkspaceRoot, request.fromFleetId);
|
|
32492
32498
|
const toOwner = workspaceOwnerForRoot(request.toWorkspaceRoot, request.toFleetId);
|
|
32493
32499
|
if (fromOwner === toOwner) throw new Error("Ownership handoff requires different workspace roots.");
|
|
32494
32500
|
if (entry.workspaceOwner !== fromOwner) {
|
|
@@ -37371,13 +37377,28 @@ ownershipCommand.command("release-claim").description("release one exact plain o
|
|
|
37371
37377
|
console.log(`Plan digest: ${result.planDigest}`);
|
|
37372
37378
|
if (!options.apply) console.log("Apply with this same scope and reason plus --apply --plan-digest, --expected-source-revision and --expected-inventory-revision from this plan.");
|
|
37373
37379
|
});
|
|
37374
|
-
ownershipCommand.command("handoff").description("transfer one managed artifact between Agentwheel workspace roots").argument("<selector>", "exact artifact selector in type/name form").option("--from-workspace-root <path>", "current owning workspace root").option("--from-unknown-owner", "hand off an artifact recorded as workspace:unknown", false).requiredOption("--to-workspace-root <path>", "new owning workspace root").option("--source-state-key <key>", "explicit source install-manifest state key for this handoff only").option("--to-fleet <id>", "qualify the new owner with a registered fleet id").option("--expected-hash <sha256>", "expected recorded artifact hash; required when applying").option("--expected-revision <sha256>", "expected install manifest revision; required when applying").option("--plan-digest <sha256>", "reviewed plan digest; required for run-as handoff").option("--expected-inventory-revision <sha256>", "reviewed full inventory revision; required for run-as handoff").option("--carry-drift", "accept a file or directory whose runtime differs from the recorded hash; the recorded hash is kept", false).option("--expected-runtime-hash <sha256>", "expected drifted runtime hash; required when applying with --carry-drift").option("--adapter <adapter>", "built-in adapter").option("-i, --installation-type <type>", "installation type (for example local or user)").option("--user", "use the user workspace", false).option("--local", "use the nearest local workspace", false).option("--fleet <id>", "use one registered named fleet").option("--adapter-config <path>", "adapter JSON/JSONC file").option("--adapter-module <path>", "local programmatic adapter module").option("--allow-adapter-code", "allow loading local adapter code", false).option("-t, --target-root <path>", "runtime/project root").option("--agent <name>", "named agent from merged config").option("--profile <name>", "workspace runtime profile (must resolve to one target)").option("--dry-run", "validate all preconditions without writing the manifest", false).option("--json", "print the complete deterministic ownership handoff plan", false).action(async (selector, options) => {
|
|
37380
|
+
ownershipCommand.command("handoff").description("transfer one managed artifact between Agentwheel workspace roots").argument("<selector>", "exact artifact selector in type/name form").option("--from-workspace-root <path>", "current owning workspace root").option("--from-fleet <id>", "qualify the current owner with a registered fleet id").option("--from-unknown-owner", "hand off an artifact recorded as workspace:unknown", false).requiredOption("--to-workspace-root <path>", "new owning workspace root").option("--source-state-key <key>", "explicit source install-manifest state key for this handoff only").option("--to-fleet <id>", "qualify the new owner with a registered fleet id").option("--expected-hash <sha256>", "expected recorded artifact hash; required when applying").option("--expected-revision <sha256>", "expected install manifest revision; required when applying").option("--plan-digest <sha256>", "reviewed plan digest; required for run-as handoff").option("--expected-inventory-revision <sha256>", "reviewed full inventory revision; required for run-as handoff").option("--carry-drift", "accept a file or directory whose runtime differs from the recorded hash; the recorded hash is kept", false).option("--expected-runtime-hash <sha256>", "expected drifted runtime hash; required when applying with --carry-drift").option("--adapter <adapter>", "built-in adapter").option("-i, --installation-type <type>", "installation type (for example local or user)").option("--user", "use the user workspace", false).option("--local", "use the nearest local workspace", false).option("--fleet <id>", "use one registered named fleet").option("--adapter-config <path>", "adapter JSON/JSONC file").option("--adapter-module <path>", "local programmatic adapter module").option("--allow-adapter-code", "allow loading local adapter code", false).option("-t, --target-root <path>", "runtime/project root").option("--agent <name>", "named agent from merged config").option("--profile <name>", "workspace runtime profile (must resolve to one target)").option("--dry-run", "validate all preconditions without writing the manifest", false).option("--json", "print the complete deterministic ownership handoff plan", false).action(async (selector, options) => {
|
|
37375
37381
|
if (!options.dryRun && (!options.expectedHash || !options.expectedRevision)) {
|
|
37376
37382
|
throw new Error("Applying an ownership handoff requires --expected-hash and --expected-revision from a reviewed --dry-run.");
|
|
37377
37383
|
}
|
|
37378
37384
|
if (Boolean(options.fromWorkspaceRoot) === (options.fromUnknownOwner === true)) {
|
|
37379
37385
|
throw new Error("Ownership handoff requires exactly one of --from-workspace-root or --from-unknown-owner.");
|
|
37380
37386
|
}
|
|
37387
|
+
if (options.fromFleet !== void 0 && (!options.fromWorkspaceRoot || options.fromUnknownOwner)) {
|
|
37388
|
+
throw new Error("--from-fleet requires --from-workspace-root and cannot be combined with --from-unknown-owner.");
|
|
37389
|
+
}
|
|
37390
|
+
const fromWorkspaceRoot = options.fromWorkspaceRoot === void 0 ? void 0 : normalizeCliPath(options.fromWorkspaceRoot);
|
|
37391
|
+
const toWorkspaceRoot = normalizeCliPath(options.toWorkspaceRoot);
|
|
37392
|
+
for (const [id, root, label] of [
|
|
37393
|
+
[options.fromFleet, fromWorkspaceRoot, "Source"],
|
|
37394
|
+
[options.toFleet, toWorkspaceRoot, "Destination"]
|
|
37395
|
+
]) {
|
|
37396
|
+
if (id === void 0) continue;
|
|
37397
|
+
const fleet = await showRegisteredFleet(id);
|
|
37398
|
+
if (resolve48(fleet.root) !== resolve48(root)) {
|
|
37399
|
+
throw new Error(`${label} fleet '${id}' is registered at ${fleet.root}, not ${root}.`);
|
|
37400
|
+
}
|
|
37401
|
+
}
|
|
37381
37402
|
const normalizedOptions = normalizeRuntimeScopeOptions(options);
|
|
37382
37403
|
const targets = await resolveCliTargets(normalizedOptions);
|
|
37383
37404
|
if (targets.length !== 1) {
|
|
@@ -37401,13 +37422,6 @@ ownershipCommand.command("handoff").description("transfer one managed artifact b
|
|
|
37401
37422
|
"Migrate the target state before ownership handoff by running a full agentwheel install for this target."
|
|
37402
37423
|
);
|
|
37403
37424
|
}
|
|
37404
|
-
const toWorkspaceRoot = normalizeCliPath(options.toWorkspaceRoot);
|
|
37405
|
-
if (options.toFleet) {
|
|
37406
|
-
const fleet = await showRegisteredFleet(options.toFleet);
|
|
37407
|
-
if (resolve48(fleet.root) !== resolve48(toWorkspaceRoot)) {
|
|
37408
|
-
throw new Error(`Destination fleet '${options.toFleet}' is registered at ${fleet.root}, not ${toWorkspaceRoot}.`);
|
|
37409
|
-
}
|
|
37410
|
-
}
|
|
37411
37425
|
const request = {
|
|
37412
37426
|
workspaceRoot: await workspaceRootFromOptions(normalizedOptions),
|
|
37413
37427
|
reason: options.reason,
|
|
@@ -37419,7 +37433,7 @@ ownershipCommand.command("handoff").description("transfer one managed artifact b
|
|
|
37419
37433
|
adapter: adapter.name,
|
|
37420
37434
|
artifactType,
|
|
37421
37435
|
artifactName,
|
|
37422
|
-
...options.fromUnknownOwner === true ? { fromUnknownOwner: true } : { fromWorkspaceRoot:
|
|
37436
|
+
...options.fromUnknownOwner === true ? { fromUnknownOwner: true } : { fromWorkspaceRoot, fromFleetId: options.fromFleet },
|
|
37423
37437
|
toWorkspaceRoot,
|
|
37424
37438
|
toFleetId: options.toFleet,
|
|
37425
37439
|
expectedHash: options.expectedHash,
|
package/openpack.json
CHANGED
package/package.json
CHANGED