mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-24 19:35:28 -06:00
12d0fd2ef8
* refactor(anthropic): explore official Claude Agent SDK runtime * refactor(anthropic): replace handwritten Claude sessions with SDK * refactor(anthropic): collapse SDK live-session ownership * refactor(anthropic): simplify SDK ownership and preserve live skills * fix(anthropic): fence cancelled SDK runs before process startup * fix(anthropic): harden SDK approvals, lifecycle, and packaging * refactor(anthropic): own SDK process trees and streamline runtime * fix(anthropic): repair rebased packaging and legacy test fixtures
24 lines
726 B
JavaScript
24 lines
726 B
JavaScript
import fs from "node:fs";
|
|
import path from "node:path";
|
|
|
|
/** Collect bundled plugin directories excluded from the root package artifact. */
|
|
export function collectRootPackageExcludedExtensionDirs(params = {}) {
|
|
const packageJsonPath = path.join(params.cwd ?? process.cwd(), "package.json");
|
|
const excluded = new Set();
|
|
if (!fs.existsSync(packageJsonPath)) {
|
|
return excluded;
|
|
}
|
|
|
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
|
|
for (const entry of packageJson.files ?? []) {
|
|
if (typeof entry !== "string") {
|
|
continue;
|
|
}
|
|
const match = /^!dist\/extensions\/([^/]+)\/\*\*$/u.exec(entry);
|
|
if (match?.[1]) {
|
|
excluded.add(match[1]);
|
|
}
|
|
}
|
|
return excluded;
|
|
}
|