agentwheel 0.19.4 → 0.19.6
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 +88 -68
- 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/dist/index.js
CHANGED
|
@@ -1712,7 +1712,7 @@ function hasMergeRemovalContent(removal) {
|
|
|
1712
1712
|
async function mergeRemovalForInstall(sourcePath, strategy, currentContent, options = {}) {
|
|
1713
1713
|
const source = await readMergeSource(sourcePath, strategy);
|
|
1714
1714
|
if (currentContent === void 0) return source;
|
|
1715
|
-
if (options.
|
|
1715
|
+
if (options.adoptExisting) {
|
|
1716
1716
|
if (strategy === "codex-toml-mcp") {
|
|
1717
1717
|
const mismatched = mismatchedCodexTomlMcpServers(source, currentContent);
|
|
1718
1718
|
if (mismatched.length > 0) {
|
|
@@ -1720,10 +1720,8 @@ async function mergeRemovalForInstall(sourcePath, strategy, currentContent, opti
|
|
|
1720
1720
|
}
|
|
1721
1721
|
return source;
|
|
1722
1722
|
}
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
}
|
|
1726
|
-
const mismatch = firstMcpContributionMismatch(parseMergeDestination(currentContent, strategy), source);
|
|
1723
|
+
const current = parseMergeDestination(currentContent, strategy);
|
|
1724
|
+
const mismatch = options.adoptExisting === "mcp" ? firstMcpContributionMismatch(current, source) : firstMergeContributionMismatch(current, source);
|
|
1727
1725
|
if (mismatch) {
|
|
1728
1726
|
throw new MergeAdoptionMismatchError(`cannot adopt merged contribution: destination differs or is missing at ${mismatch}`);
|
|
1729
1727
|
}
|
|
@@ -4015,10 +4013,12 @@ async function createPlanFromOperations(desiredOps, adapter, targetRoot, manifes
|
|
|
4015
4013
|
}
|
|
4016
4014
|
}
|
|
4017
4015
|
const incompleteMergeOwnership = existing2 && existing2.mergeStrategy && !("mergeCreatedDestination" in existing2 && existing2.mergeCreatedDestination === true) && !("mergeRemoval" in existing2 && hasMergeRemovalContent(existing2.mergeRemoval));
|
|
4018
|
-
const adoptExisting = exists2 && (!existing2 || incompleteMergeOwnership) && options.forceConflict === true
|
|
4016
|
+
const adoptExisting = exists2 && (!existing2 || incompleteMergeOwnership) && options.forceConflict === true;
|
|
4019
4017
|
let mergeRemoval;
|
|
4020
4018
|
try {
|
|
4021
|
-
mergeRemoval = await mergeRemovalForInstall(op.sourcePath, op.mergeStrategy, currentContent, {
|
|
4019
|
+
mergeRemoval = await mergeRemovalForInstall(op.sourcePath, op.mergeStrategy, currentContent, {
|
|
4020
|
+
adoptExisting: adoptExisting ? op.artifactType === "mcp" ? "mcp" : "generic" : void 0
|
|
4021
|
+
});
|
|
4022
4022
|
} catch (error) {
|
|
4023
4023
|
if (!(error instanceof MergeAdoptionMismatchError)) throw error;
|
|
4024
4024
|
operations.push({
|
|
@@ -6259,9 +6259,9 @@ function cachePathFor(packageName, cacheRoot) {
|
|
|
6259
6259
|
|
|
6260
6260
|
// src/source/git.ts
|
|
6261
6261
|
import { execFile as execFile4 } from "child_process";
|
|
6262
|
-
import {
|
|
6262
|
+
import { mkdir as mkdir14, rename as rename3, rm as rm7, stat as stat5 } from "fs/promises";
|
|
6263
6263
|
import { homedir as homedir3 } from "os";
|
|
6264
|
-
import { basename as basename11, dirname as dirname17, join as join24, resolve as resolve7 } from "path";
|
|
6264
|
+
import { basename as basename11, dirname as dirname17, join as join24, resolve as resolve7, sep } from "path";
|
|
6265
6265
|
import { promisify as promisify4 } from "util";
|
|
6266
6266
|
|
|
6267
6267
|
// src/source/auth.ts
|
|
@@ -6558,13 +6558,17 @@ var GitSourceDriver = class {
|
|
|
6558
6558
|
async fetch(resolved) {
|
|
6559
6559
|
return withFilesystemLock(`${resolved.resolvedPath}.lock`, resolved.cacheLockTimeoutMs ?? 3e4, async () => {
|
|
6560
6560
|
const parsed = parseGitSource(resolved.source);
|
|
6561
|
-
|
|
6561
|
+
const cacheRoot = dirname17(resolved.resolvedPath);
|
|
6562
|
+
await mkdir14(cacheRoot, { recursive: true });
|
|
6563
|
+
await assertOwnedByCurrentUser(cacheRoot);
|
|
6564
|
+
if (await pathExists(resolved.resolvedPath)) await assertOwnedByCurrentUser(resolved.resolvedPath);
|
|
6562
6565
|
if (!await pathExists(join24(resolved.resolvedPath, ".git"))) {
|
|
6563
6566
|
if (resolved.frozenLock) {
|
|
6564
6567
|
throw new Error(`Frozen lock requires cached git checkout at ${resolved.resolvedPath}`);
|
|
6565
6568
|
}
|
|
6566
6569
|
await rm7(resolved.resolvedPath, { recursive: true, force: true });
|
|
6567
|
-
await git([...await gitAuthArguments(parsed.url), "clone", parsed.url, resolved.resolvedPath]);
|
|
6570
|
+
await git([...await gitAuthArguments(parsed.url), "clone", "--no-checkout", parsed.url, resolved.resolvedPath]);
|
|
6571
|
+
await assertOwnedByCurrentUser(resolved.resolvedPath);
|
|
6568
6572
|
} else if (!resolved.frozenLock) {
|
|
6569
6573
|
await git([
|
|
6570
6574
|
...await gitAuthArguments(parsed.url),
|
|
@@ -6577,27 +6581,12 @@ var GitSourceDriver = class {
|
|
|
6577
6581
|
]);
|
|
6578
6582
|
}
|
|
6579
6583
|
const ref = resolved.requestedRef ?? parsed.ref ?? "HEAD";
|
|
6580
|
-
|
|
6581
|
-
await git(["-C", resolved.resolvedPath, "checkout", "--detach", "origin/HEAD"]);
|
|
6582
|
-
} else if (/^[0-9a-f]{7,40}$/i.test(ref)) {
|
|
6583
|
-
await git(["-C", resolved.resolvedPath, "checkout", "--detach", ref]);
|
|
6584
|
-
} else {
|
|
6585
|
-
try {
|
|
6586
|
-
await git(["-C", resolved.resolvedPath, "checkout", ref]);
|
|
6587
|
-
await git(["-C", resolved.resolvedPath, "reset", "--hard", `origin/${ref}`]);
|
|
6588
|
-
} catch {
|
|
6589
|
-
await git(["-C", resolved.resolvedPath, "checkout", "--detach", ref]);
|
|
6590
|
-
}
|
|
6591
|
-
}
|
|
6592
|
-
await removeGeneratedEntries(resolved.resolvedPath, true);
|
|
6593
|
-
const { stdout } = await git(["-C", resolved.resolvedPath, "rev-parse", "HEAD"]);
|
|
6594
|
-
const resolvedCommit = stdout.trim();
|
|
6595
|
-
const cacheRoot = dirname17(resolved.resolvedPath);
|
|
6584
|
+
const resolvedCommit = await resolveCommit(resolved.resolvedPath, ref);
|
|
6596
6585
|
const snapshot = await withGitCacheMaintenanceLock(
|
|
6597
6586
|
cacheRoot,
|
|
6598
6587
|
resolved.cacheLockTimeoutMs ?? 3e4,
|
|
6599
6588
|
async () => {
|
|
6600
|
-
const path = await
|
|
6589
|
+
const path = await snapshotCommit(resolved.resolvedPath, resolvedCommit);
|
|
6601
6590
|
const leasePath = await createGitSnapshotLease(path);
|
|
6602
6591
|
await pruneGitCache(cacheRoot, {
|
|
6603
6592
|
currentSnapshot: path,
|
|
@@ -6654,20 +6643,41 @@ function cachePathFor2(url, cacheRoot) {
|
|
|
6654
6643
|
const slug2 = url.replace(/^[a-z]+:\/\//i, "").replace(/\.git$/i, "").replace(/[^a-z0-9._-]+/gi, "-").replace(/^-+|-+$/g, "");
|
|
6655
6644
|
return join24(root, slug2 || basename11(url));
|
|
6656
6645
|
}
|
|
6657
|
-
async function git(args) {
|
|
6658
|
-
return execFileAsync4("git", args, { maxBuffer: 1024 * 1024 * 10 });
|
|
6646
|
+
async function git(args, env2) {
|
|
6647
|
+
return execFileAsync4("git", args, { env: env2, maxBuffer: 1024 * 1024 * 10 });
|
|
6648
|
+
}
|
|
6649
|
+
async function resolveCommit(checkoutPath, ref) {
|
|
6650
|
+
const candidates = ref === "HEAD" ? ["origin/HEAD"] : /^[0-9a-f]{7,40}$/i.test(ref) ? [ref] : [`origin/${ref}`, ref];
|
|
6651
|
+
let lastError;
|
|
6652
|
+
for (const candidate of candidates) {
|
|
6653
|
+
try {
|
|
6654
|
+
const { stdout } = await git(["-C", checkoutPath, "rev-parse", "--verify", `${candidate}^{commit}`]);
|
|
6655
|
+
return stdout.trim();
|
|
6656
|
+
} catch (error) {
|
|
6657
|
+
lastError = error;
|
|
6658
|
+
}
|
|
6659
|
+
}
|
|
6660
|
+
throw lastError;
|
|
6659
6661
|
}
|
|
6660
|
-
async function
|
|
6662
|
+
async function snapshotCommit(checkoutPath, commit) {
|
|
6661
6663
|
const snapshotPath = join24(dirname17(checkoutPath), `${basename11(checkoutPath)}-${commit.slice(0, 12)}`);
|
|
6662
6664
|
if (await pathExists(snapshotPath)) return snapshotPath;
|
|
6663
6665
|
const tempPath = join24(dirname17(checkoutPath), `${basename11(snapshotPath)}.tmp-${process.pid}-${Date.now()}`);
|
|
6666
|
+
const tempIndexPath = `${tempPath}.index`;
|
|
6664
6667
|
await rm7(tempPath, { recursive: true, force: true });
|
|
6665
|
-
await
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6668
|
+
await rm7(tempIndexPath, { force: true });
|
|
6669
|
+
await mkdir14(tempPath, { recursive: true });
|
|
6670
|
+
const env2 = { ...process.env, GIT_INDEX_FILE: tempIndexPath };
|
|
6671
|
+
try {
|
|
6672
|
+
await git(["-C", checkoutPath, "read-tree", commit], env2);
|
|
6673
|
+
await git(["-C", checkoutPath, "checkout-index", "--all", `--prefix=${resolve7(tempPath)}${sep}`], env2);
|
|
6674
|
+
await removeGeneratedEntries(tempPath, false);
|
|
6675
|
+
} catch (error) {
|
|
6676
|
+
await rm7(tempPath, { recursive: true, force: true });
|
|
6677
|
+
throw error;
|
|
6678
|
+
} finally {
|
|
6679
|
+
await rm7(tempIndexPath, { force: true });
|
|
6680
|
+
}
|
|
6671
6681
|
try {
|
|
6672
6682
|
await rename3(tempPath, snapshotPath);
|
|
6673
6683
|
} catch (error) {
|
|
@@ -6677,6 +6687,16 @@ async function snapshotCheckout(checkoutPath, commit) {
|
|
|
6677
6687
|
}
|
|
6678
6688
|
return snapshotPath;
|
|
6679
6689
|
}
|
|
6690
|
+
async function assertOwnedByCurrentUser(path) {
|
|
6691
|
+
const currentUid = process.getuid?.();
|
|
6692
|
+
if (currentUid === void 0) return;
|
|
6693
|
+
const ownerUid = (await stat5(path)).uid;
|
|
6694
|
+
if (ownerUid !== currentUid) {
|
|
6695
|
+
throw new Error(
|
|
6696
|
+
`Git cache path ${path} is owned by uid ${ownerUid}, but Agentwheel is running as uid ${currentUid}. Run Agentwheel as the cache owner or use a separate cache root.`
|
|
6697
|
+
);
|
|
6698
|
+
}
|
|
6699
|
+
}
|
|
6680
6700
|
|
|
6681
6701
|
// src/source/mcp-registry.ts
|
|
6682
6702
|
import { mkdir as mkdir15, writeFile as writeFile16 } from "fs/promises";
|
|
@@ -6817,14 +6837,14 @@ function cachePathFor3(serverName, cacheRoot) {
|
|
|
6817
6837
|
// src/source/skillkit.ts
|
|
6818
6838
|
import { createHash as createHash6, randomUUID as randomUUID2 } from "crypto";
|
|
6819
6839
|
import { execFile as execFile5 } from "child_process";
|
|
6820
|
-
import { cp as
|
|
6840
|
+
import { cp as cp2, mkdir as mkdir16, readFile as readFile20, rename as rename4, rm as rm8 } from "fs/promises";
|
|
6821
6841
|
import { homedir as homedir4 } from "os";
|
|
6822
6842
|
import { basename as basename14, dirname as dirname20, join as join27, resolve as resolve9 } from "path";
|
|
6823
6843
|
import { promisify as promisify5 } from "util";
|
|
6824
6844
|
import * as defaultSkillKit from "@skillkit/core";
|
|
6825
6845
|
|
|
6826
6846
|
// src/source/skill-artifacts.ts
|
|
6827
|
-
import { readdir as readdir4, stat as
|
|
6847
|
+
import { readdir as readdir4, stat as stat6 } from "fs/promises";
|
|
6828
6848
|
import { basename as basename13, dirname as dirname19, extname as extname2, join as join26 } from "path";
|
|
6829
6849
|
async function artifactsFromSkillPaths(paths, packageName) {
|
|
6830
6850
|
const artifacts = [];
|
|
@@ -6845,7 +6865,7 @@ async function discoverSkillPaths(root) {
|
|
|
6845
6865
|
return paths;
|
|
6846
6866
|
}
|
|
6847
6867
|
async function artifactFromSkillPath(item, packageName) {
|
|
6848
|
-
const stats = await
|
|
6868
|
+
const stats = await stat6(item.path);
|
|
6849
6869
|
if (stats.isDirectory()) {
|
|
6850
6870
|
const skillMd = join26(item.path, "SKILL.md");
|
|
6851
6871
|
if (!await pathExists(skillMd)) return void 0;
|
|
@@ -7022,7 +7042,7 @@ var SkillKitSourceDriver = class {
|
|
|
7022
7042
|
return { path: cachePath, commit: resolvedIdentity.commit, cacheIdentity: resolvedIdentity.cacheKey };
|
|
7023
7043
|
}
|
|
7024
7044
|
const publishCandidate = resolve9(result.path) === resolve9(candidatePath) ? candidatePath : publishPath;
|
|
7025
|
-
if (publishCandidate === publishPath) await
|
|
7045
|
+
if (publishCandidate === publishPath) await cp2(result.path, publishPath, { recursive: true, dereference: true });
|
|
7026
7046
|
try {
|
|
7027
7047
|
await rename4(publishCandidate, cachePath);
|
|
7028
7048
|
} catch (error) {
|
|
@@ -7149,7 +7169,7 @@ async function checkoutCommit(root, commit) {
|
|
|
7149
7169
|
}
|
|
7150
7170
|
|
|
7151
7171
|
// src/source/vercel-skills.ts
|
|
7152
|
-
import { stat as
|
|
7172
|
+
import { stat as stat7 } from "fs/promises";
|
|
7153
7173
|
import { basename as basename15, join as join28, relative as relative5, resolve as resolve10 } from "path";
|
|
7154
7174
|
var VercelSkillsSourceDriver = class {
|
|
7155
7175
|
name = "vercel-skills";
|
|
@@ -7158,7 +7178,7 @@ var VercelSkillsSourceDriver = class {
|
|
|
7158
7178
|
const parsed = parseVercelSource(source);
|
|
7159
7179
|
if (parsed.kind === "local") {
|
|
7160
7180
|
const resolvedPath = resolve10(parsed.path);
|
|
7161
|
-
if (!await pathExists(resolvedPath) || !(await
|
|
7181
|
+
if (!await pathExists(resolvedPath) || !(await stat7(resolvedPath)).isDirectory()) {
|
|
7162
7182
|
throw new Error(`Vercel skills local source not found: ${resolvedPath}`);
|
|
7163
7183
|
}
|
|
7164
7184
|
return {
|
|
@@ -7283,14 +7303,14 @@ function getSourceDriver(name = "local") {
|
|
|
7283
7303
|
}
|
|
7284
7304
|
|
|
7285
7305
|
// src/staging/staging.ts
|
|
7286
|
-
import { chmod, cp as
|
|
7287
|
-
import { basename as basename19, dirname as dirname24, join as join32, relative as relative7, resolve as resolve12, sep as
|
|
7306
|
+
import { chmod, cp as cp4, mkdir as mkdir19, mkdtemp as mkdtemp3, readdir as readdir7, stat as stat10 } from "fs/promises";
|
|
7307
|
+
import { basename as basename19, dirname as dirname24, join as join32, relative as relative7, resolve as resolve12, sep as sep3 } from "path";
|
|
7288
7308
|
import { tmpdir as tmpdir4 } from "os";
|
|
7289
7309
|
|
|
7290
7310
|
// src/compose/markdown.ts
|
|
7291
7311
|
import { createHash as createHash7 } from "crypto";
|
|
7292
|
-
import { readdir as readdir5, readFile as readFile21, stat as
|
|
7293
|
-
import { basename as basename16, dirname as dirname21, extname as extname3, join as join29, relative as relative6, resolve as resolve11, sep } from "path";
|
|
7312
|
+
import { readdir as readdir5, readFile as readFile21, stat as stat8, writeFile as writeFile17 } from "fs/promises";
|
|
7313
|
+
import { basename as basename16, dirname as dirname21, extname as extname3, join as join29, relative as relative6, resolve as resolve11, sep as sep2 } from "path";
|
|
7294
7314
|
var includePattern = /<!--\s*openpack:include(\?)?\s+([^>]+?)\s*-->/g;
|
|
7295
7315
|
var escapedIncludePattern = /<!--\s*openpack\\:include(\?)?\s+([^>]+?)\s*-->/g;
|
|
7296
7316
|
var generatedPattern = /<!--\s*(?:BEGIN|END)\s+openpack:include\b/;
|
|
@@ -7427,7 +7447,7 @@ async function expandInclude(selector, packageRoot, artifactPaths, options) {
|
|
|
7427
7447
|
if (options.optional) return void 0;
|
|
7428
7448
|
throw new Error(`OpenPack include not found: ${displaySelector}`);
|
|
7429
7449
|
}
|
|
7430
|
-
const stats = await
|
|
7450
|
+
const stats = await stat8(sourcePath);
|
|
7431
7451
|
if (!stats.isFile()) {
|
|
7432
7452
|
throw new Error(`OpenPack include is not a file: ${displaySelector}`);
|
|
7433
7453
|
}
|
|
@@ -7491,14 +7511,14 @@ function extractOpenPackIncludeSelectors(content) {
|
|
|
7491
7511
|
function resolvePackageSelector(packageRoot, selector) {
|
|
7492
7512
|
const root = resolve11(packageRoot);
|
|
7493
7513
|
const resolved = resolve11(root, selector);
|
|
7494
|
-
if (resolved !== root && !resolved.startsWith(`${root}${
|
|
7514
|
+
if (resolved !== root && !resolved.startsWith(`${root}${sep2}`)) {
|
|
7495
7515
|
throw new Error(`OpenPack include escapes package root: ${selector}`);
|
|
7496
7516
|
}
|
|
7497
7517
|
return resolved;
|
|
7498
7518
|
}
|
|
7499
7519
|
async function markdownFilesForArtifact(artifact) {
|
|
7500
7520
|
const root = artifact.stagedPath ?? artifact.sourcePath;
|
|
7501
|
-
const stats = await
|
|
7521
|
+
const stats = await stat8(root);
|
|
7502
7522
|
if (stats.isFile()) return extname3(root).toLowerCase() === ".md" ? [root] : [];
|
|
7503
7523
|
if (!stats.isDirectory()) return [];
|
|
7504
7524
|
return listMarkdownFiles(root);
|
|
@@ -7571,7 +7591,7 @@ function artifactPathMap(artifacts) {
|
|
|
7571
7591
|
}
|
|
7572
7592
|
|
|
7573
7593
|
// src/staging/customize.ts
|
|
7574
|
-
import { cp as
|
|
7594
|
+
import { cp as cp3, mkdir as mkdir17, readdir as readdir6, readFile as readFile22, writeFile as writeFile18 } from "fs/promises";
|
|
7575
7595
|
import { dirname as dirname22, join as join30 } from "path";
|
|
7576
7596
|
async function applyCustomizations(artifacts, options) {
|
|
7577
7597
|
let next = [...artifacts];
|
|
@@ -7670,7 +7690,7 @@ async function applyReplacements2(artifacts, options, channel, artifactTypes) {
|
|
|
7670
7690
|
const existing = byKey.get(artifactMapKey);
|
|
7671
7691
|
const stagedPath = join30(options.stageRoot, ".agentwheel-composed", channel, type, entry.name);
|
|
7672
7692
|
await mkdir17(dirname22(stagedPath), { recursive: true });
|
|
7673
|
-
await
|
|
7693
|
+
await cp3(full, stagedPath, { recursive: artifactKind === "dir", dereference: true });
|
|
7674
7694
|
byKey.set(artifactMapKey, {
|
|
7675
7695
|
...existing,
|
|
7676
7696
|
type,
|
|
@@ -7786,7 +7806,7 @@ async function stageResolvedArtifactsRaw(resolved, artifacts) {
|
|
|
7786
7806
|
for (const artifact of artifacts) {
|
|
7787
7807
|
const stagedPath = join32(root, artifact.relativePath);
|
|
7788
7808
|
await mkdir19(dirname24(stagedPath), { recursive: true });
|
|
7789
|
-
await
|
|
7809
|
+
await cp4(artifact.sourcePath, stagedPath, {
|
|
7790
7810
|
recursive: artifact.kind === "dir",
|
|
7791
7811
|
dereference: true,
|
|
7792
7812
|
filter: (path) => !isIgnoredGeneratedEntry(basename19(path))
|
|
@@ -7878,7 +7898,7 @@ async function composeAssets(artifact, packageRoot, stagedPath) {
|
|
|
7878
7898
|
}
|
|
7879
7899
|
}
|
|
7880
7900
|
async function copyAsset(asset, source, dest) {
|
|
7881
|
-
const sourceStats = await
|
|
7901
|
+
const sourceStats = await stat10(source);
|
|
7882
7902
|
if (sourceStats.isFile()) {
|
|
7883
7903
|
if (matchesAny(basename19(source), asset.include)) {
|
|
7884
7904
|
await mkdir19(dest, { recursive: true });
|
|
@@ -7891,7 +7911,7 @@ async function copyAsset(asset, source, dest) {
|
|
|
7891
7911
|
}
|
|
7892
7912
|
if (!asset.include?.length) {
|
|
7893
7913
|
await mkdir19(dirname24(dest), { recursive: true });
|
|
7894
|
-
await
|
|
7914
|
+
await cp4(source, dest, { recursive: true, dereference: true });
|
|
7895
7915
|
if (asset.mode === "copy") await normalizeCopiedModes(dest);
|
|
7896
7916
|
return;
|
|
7897
7917
|
}
|
|
@@ -7903,13 +7923,13 @@ async function copyAsset(asset, source, dest) {
|
|
|
7903
7923
|
}
|
|
7904
7924
|
async function copyAssetFile(source, dest, asset) {
|
|
7905
7925
|
await mkdir19(dirname24(dest), { recursive: true });
|
|
7906
|
-
await
|
|
7926
|
+
await cp4(source, dest, { dereference: true });
|
|
7907
7927
|
if (asset.mode === "copy") await chmod(dest, 420);
|
|
7908
7928
|
}
|
|
7909
7929
|
function resolvePackagePath(packageRoot, path) {
|
|
7910
7930
|
const resolved = resolve12(packageRoot, path);
|
|
7911
7931
|
const root = resolve12(packageRoot);
|
|
7912
|
-
if (resolved !== root && !resolved.startsWith(`${root}${
|
|
7932
|
+
if (resolved !== root && !resolved.startsWith(`${root}${sep3}`)) {
|
|
7913
7933
|
throw new Error(`Asset include escapes package root: ${path}`);
|
|
7914
7934
|
}
|
|
7915
7935
|
return resolved;
|
|
@@ -7930,7 +7950,7 @@ async function listFiles2(root) {
|
|
|
7930
7950
|
return out;
|
|
7931
7951
|
}
|
|
7932
7952
|
async function normalizeCopiedModes(path) {
|
|
7933
|
-
const stats = await
|
|
7953
|
+
const stats = await stat10(path);
|
|
7934
7954
|
if (stats.isFile()) {
|
|
7935
7955
|
await chmod(path, 420);
|
|
7936
7956
|
return;
|
|
@@ -8335,12 +8355,12 @@ function sortedUnique2(values) {
|
|
|
8335
8355
|
}
|
|
8336
8356
|
|
|
8337
8357
|
// src/lifecycle/customization.ts
|
|
8338
|
-
import { appendFile, cp as
|
|
8358
|
+
import { appendFile, cp as cp5, mkdir as mkdir20, rm as rm10 } from "fs/promises";
|
|
8339
8359
|
import { dirname as dirname27, join as join36 } from "path";
|
|
8340
8360
|
|
|
8341
8361
|
// src/resolve/graph.ts
|
|
8342
8362
|
import { createHash as createHash9 } from "crypto";
|
|
8343
|
-
import { mkdtemp as mkdtemp4, readdir as readdir8, readFile as readFile27, stat as
|
|
8363
|
+
import { mkdtemp as mkdtemp4, readdir as readdir8, readFile as readFile27, stat as stat12 } from "fs/promises";
|
|
8344
8364
|
import { tmpdir as tmpdir5 } from "os";
|
|
8345
8365
|
import { basename as basename20, extname as extname4, join as join35 } from "path";
|
|
8346
8366
|
|
|
@@ -8467,7 +8487,7 @@ import { homedir as homedir7 } from "os";
|
|
|
8467
8487
|
import { resolve as resolve15 } from "path";
|
|
8468
8488
|
|
|
8469
8489
|
// src/registry/client.ts
|
|
8470
|
-
import { readFile as readFile26, rm as rm9, stat as
|
|
8490
|
+
import { readFile as readFile26, rm as rm9, stat as stat11 } from "fs/promises";
|
|
8471
8491
|
import { homedir as homedir6 } from "os";
|
|
8472
8492
|
import { dirname as dirname26, join as join34, resolve as resolve14 } from "path";
|
|
8473
8493
|
import { fileURLToPath } from "url";
|
|
@@ -8584,7 +8604,7 @@ var RegistryClient = class {
|
|
|
8584
8604
|
const filePath = source.startsWith("file:") ? fileURLToPath(source) : source;
|
|
8585
8605
|
if (await pathExists(filePath)) {
|
|
8586
8606
|
const fullPath = resolve14(filePath);
|
|
8587
|
-
const stats = await
|
|
8607
|
+
const stats = await stat11(fullPath);
|
|
8588
8608
|
return readFile26(stats.isDirectory() ? join34(fullPath, "index.json") : fullPath, "utf8");
|
|
8589
8609
|
}
|
|
8590
8610
|
const resolved = await this.git.fetch(await this.git.resolve(source, { cacheRoot: join34(dirname26(this.cachePath), "registry-repos") }));
|
|
@@ -9346,7 +9366,7 @@ function requirementTargetsRuntime(runtimes, runtime, label, warn) {
|
|
|
9346
9366
|
}
|
|
9347
9367
|
async function markdownFilesForArtifact2(artifact) {
|
|
9348
9368
|
const root = artifact.sourcePath;
|
|
9349
|
-
const stats = await
|
|
9369
|
+
const stats = await stat12(root);
|
|
9350
9370
|
if (stats.isFile()) return extname4(root).toLowerCase() === ".md" ? [root] : [];
|
|
9351
9371
|
if (!stats.isDirectory()) return [];
|
|
9352
9372
|
return listMarkdownFiles2(root);
|
|
@@ -9639,7 +9659,7 @@ async function ejectArtifact(workspaceRoot, item) {
|
|
|
9639
9659
|
const ejectedPath = join36(workspaceRoot, ".agentwheel", "ejected", ...ejectedIdentity.split("/"), parsed.type, parsed.name);
|
|
9640
9660
|
await mkdir20(dirname27(ejectedPath), { recursive: true });
|
|
9641
9661
|
await rm10(ejectedPath, { recursive: true, force: true });
|
|
9642
|
-
await
|
|
9662
|
+
await cp5(artifact.stagedPath ?? artifact.sourcePath, ejectedPath, { recursive: artifact.kind === "dir", dereference: true });
|
|
9643
9663
|
return {
|
|
9644
9664
|
...parsed,
|
|
9645
9665
|
packageName: candidate.packageName,
|
|
@@ -11473,7 +11493,7 @@ function normalizeVersion(version) {
|
|
|
11473
11493
|
}
|
|
11474
11494
|
|
|
11475
11495
|
// src/model/package-validate.ts
|
|
11476
|
-
import { stat as
|
|
11496
|
+
import { stat as stat13 } from "fs/promises";
|
|
11477
11497
|
import { resolve as resolve19 } from "path";
|
|
11478
11498
|
async function validatePackage(root) {
|
|
11479
11499
|
const packageRoot = resolve19(root);
|
|
@@ -11582,7 +11602,7 @@ async function validateManifestComposeInclude(packageRoot, selector, optional, f
|
|
|
11582
11602
|
findings.push({ level: "error", message: `Compose include escapes package root: ${selector}`, path: manifestPath });
|
|
11583
11603
|
return;
|
|
11584
11604
|
}
|
|
11585
|
-
if (!optional) await
|
|
11605
|
+
if (!optional) await stat13(full);
|
|
11586
11606
|
} catch (error) {
|
|
11587
11607
|
if (!optional) {
|
|
11588
11608
|
findings.push({ level: "error", message: error instanceof Error ? error.message : String(error), path: manifestPath });
|
|
@@ -13262,7 +13282,7 @@ function ensureTrailingSlash(value) {
|
|
|
13262
13282
|
|
|
13263
13283
|
// src/trial/skill.ts
|
|
13264
13284
|
import { createHash as createHash14 } from "crypto";
|
|
13265
|
-
import { readFile as readFile35, stat as
|
|
13285
|
+
import { readFile as readFile35, stat as stat14 } from "fs/promises";
|
|
13266
13286
|
import { join as join49 } from "path";
|
|
13267
13287
|
import { parse as parseYaml2 } from "yaml";
|
|
13268
13288
|
var MAX_TRIAL_SKILL_BYTES = 512 * 1024;
|
|
@@ -13276,7 +13296,7 @@ async function createSkillTrial(driver, resolved, selectors) {
|
|
|
13276
13296
|
}
|
|
13277
13297
|
const artifact = skills[0];
|
|
13278
13298
|
const path = artifact.kind === "dir" ? join49(artifact.sourcePath, "SKILL.md") : artifact.sourcePath;
|
|
13279
|
-
const info = await
|
|
13299
|
+
const info = await stat14(path);
|
|
13280
13300
|
if (info.size > MAX_TRIAL_SKILL_BYTES) {
|
|
13281
13301
|
throw new Error(`Skill trial exceeds the ${MAX_TRIAL_SKILL_BYTES / 1024} KiB content limit.`);
|
|
13282
13302
|
}
|
package/openpack.json
CHANGED
package/package.json
CHANGED