personal-bot 0.3.7 → 0.4.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/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +2 -2
- package/README.md +5 -8
- package/README.zh-CN.md +5 -8
- package/bin/pbot-pi-acp.mjs +1 -1
- package/docs/architecture/design.md +2 -2
- package/docs/architecture/extensibility.md +4 -4
- package/docs/architecture/model-context.md +6 -3
- package/docs/guides/cross-harness-workers.md +5 -5
- package/docs/guides/history.md +1 -3
- package/docs/guides/workspace-configuration.md +5 -5
- package/docs/hosts/claude-code.md +3 -3
- package/docs/hosts/codex-qoder.md +4 -2
- package/hooks/hooks.json +3 -0
- package/lib/antigravity-plugin/bin/pbot-pi-acp.mjs +1 -1
- package/lib/antigravity-plugin/lib/extension/acp/member.d.ts +1 -1
- package/lib/antigravity-plugin/lib/extension/acp/member.js +11 -10
- package/lib/antigravity-plugin/lib/extension/acp-worker.js +349 -204
- package/lib/antigravity-plugin/lib/extension/cli.js +596 -572
- package/lib/antigravity-plugin/lib/extension/hosts/dsh/acp-member.js +1 -1
- package/lib/antigravity-plugin/lib/extension/hosts/pi/acp-member.js +3 -4
- package/lib/antigravity-plugin/lib/extension/hosts/plugin-runtime.js +1 -12
- package/lib/antigravity-plugin/lib/extension/mcp.js +463 -379
- package/lib/antigravity-plugin/lib/integrations/agent-resources.d.ts +2 -2
- package/lib/antigravity-plugin/lib/integrations/agent-resources.js +3 -3
- package/lib/antigravity-plugin/lib/integrations/hosts/antigravity/adapter.js +0 -1
- package/lib/antigravity-plugin/lib/integrations/hosts/claude/adapter.js +1 -2
- package/lib/antigravity-plugin/lib/integrations/hosts/dsh/resources.d.ts +1 -1
- package/lib/antigravity-plugin/lib/integrations/hosts/prompt-hooks.js +4 -7
- package/lib/antigravity-plugin/lib/model/acp.d.ts +29 -35
- package/lib/antigravity-plugin/lib/model/agent.d.ts +33 -17
- package/lib/antigravity-plugin/lib/model/agent.js +0 -1
- package/lib/antigravity-plugin/lib/services/history/summary-dimensions/monthly.js +1 -1
- package/lib/antigravity-plugin/lib/services/history/summary-dimensions/session.js +6 -3
- package/lib/antigravity-plugin/lib/services/history/summary-runner.js +3 -3
- package/lib/antigravity-plugin/lib/storage/acp-files.d.ts +5 -8
- package/lib/antigravity-plugin/lib/storage/acp-files.js +34 -40
- package/lib/antigravity-plugin/lib/storage/agent-files.d.ts +19 -10
- package/lib/antigravity-plugin/lib/storage/agent-files.js +147 -43
- package/lib/antigravity-plugin/lib/storage/history-files.js +3 -2
- package/lib/antigravity-plugin/package.json +1 -1
- package/lib/antigravity-plugin/plugin.json +2 -2
- package/lib/antigravity-plugin/resources/agents/coordinator.md +2 -4
- package/lib/antigravity-plugin/resources/agents/general-purpose.md +2 -4
- package/lib/antigravity-plugin/resources/prompts/history-monthly-summary.md +6 -11
- package/lib/antigravity-plugin/resources/prompts/history-summary.md +6 -11
- package/lib/antigravity-plugin/resources/prompts/plugin-coordinator.md +1 -1
- package/lib/antigravity-plugin/resources/prompts/workspace.md +16 -23
- package/lib/antigravity-plugin/resources/skills/project-maintenance/SKILL.md +14 -21
- package/lib/antigravity-plugin/resources/skills/provider-connections/SKILL.md +23 -36
- package/lib/antigravity-plugin/resources/templates/workspace-agents.md +5 -13
- package/lib/antigravity-plugin/skills/pbot/SKILL.md +6 -23
- package/lib/antigravity-plugin/skills/project-maintenance/SKILL.md +14 -21
- package/lib/antigravity-plugin/skills/provider-connections/SKILL.md +23 -36
- package/lib/codex-marketplace/plugins/personal-bot/.codex-plugin/plugin.json +2 -2
- package/lib/codex-marketplace/plugins/personal-bot/.mcp.json +2 -2
- package/lib/codex-marketplace/plugins/personal-bot/hooks/hooks.json +3 -3
- package/lib/codex-marketplace/plugins/personal-bot/skills/pbot/SKILL.md +11 -3
- package/lib/extension/acp/member.d.ts +1 -1
- package/lib/extension/acp/member.js +11 -10
- package/lib/extension/acp/worker.js +34 -33
- package/lib/extension/acp-worker.js +349 -204
- package/lib/extension/cli.js +596 -572
- package/lib/extension/hosts/dsh/acp-member.js +1 -1
- package/lib/extension/hosts/dsh/command.js +2 -2
- package/lib/extension/hosts/dsh/workspace.js +5 -5
- package/lib/extension/hosts/pi/acp-member.js +3 -4
- package/lib/extension/hosts/plugin-runtime.js +1 -12
- package/lib/extension/mcp/tool-contract.d.ts +8 -50
- package/lib/extension/mcp/tool-contract.js +61 -107
- package/lib/extension/mcp/workers.d.ts +7 -27
- package/lib/extension/mcp/workers.js +40 -24
- package/lib/extension/mcp.js +463 -379
- package/lib/integrations/acp/agents.d.ts +2 -3
- package/lib/integrations/acp/agents.js +22 -22
- package/lib/integrations/acp/harnesses/claude.js +1 -1
- package/lib/integrations/agent-resources.d.ts +2 -2
- package/lib/integrations/agent-resources.js +3 -3
- package/lib/integrations/hosts/antigravity/adapter.js +0 -1
- package/lib/integrations/hosts/claude/adapter.js +1 -2
- package/lib/integrations/hosts/dsh/resources.d.ts +1 -1
- package/lib/integrations/hosts/prompt-hooks.js +4 -7
- package/lib/model/acp.d.ts +29 -35
- package/lib/model/agent.d.ts +33 -17
- package/lib/model/agent.js +0 -1
- package/lib/qoder-plugin/.mcp.json +2 -2
- package/lib/qoder-plugin/.qoder-plugin/plugin.json +2 -2
- package/lib/qoder-plugin/hooks/hooks.json +3 -3
- package/lib/qoder-plugin/skills/pbot/SKILL.md +11 -3
- package/lib/services/agents/acp-run.d.ts +6 -4
- package/lib/services/agents/acp-run.js +62 -43
- package/lib/services/agents/agent-run.d.ts +10 -6
- package/lib/services/agents/agent-run.js +142 -65
- package/lib/services/agents/agent-service.d.ts +3 -21
- package/lib/services/agents/agent-service.js +182 -128
- package/lib/services/history/summary-dimensions/monthly.js +1 -1
- package/lib/services/history/summary-dimensions/session.js +6 -3
- package/lib/services/history/summary-runner.js +3 -3
- package/lib/storage/acp-files.d.ts +5 -8
- package/lib/storage/acp-files.js +34 -40
- package/lib/storage/agent-files.d.ts +19 -10
- package/lib/storage/agent-files.js +147 -43
- package/lib/storage/history-files.js +3 -2
- package/lib/tools/history/contract.d.ts +1 -1
- package/lib/tools/history/contract.js +14 -16
- package/package.json +2 -2
- package/resources/agents/coordinator.md +2 -4
- package/resources/agents/general-purpose.md +2 -4
- package/resources/antigravity/skills/pbot/SKILL.md +6 -23
- package/resources/claude/skills/pbot/SKILL.md +6 -23
- package/resources/plugin/skills/pbot/SKILL.md +11 -3
- package/resources/prompts/history-coordinator.md +1 -1
- package/resources/prompts/history-monthly-summary.md +6 -11
- package/resources/prompts/history-summary.md +6 -11
- package/resources/prompts/plugin-coordinator.md +1 -1
- package/resources/prompts/workspace.md +16 -23
- package/resources/skills/project-maintenance/SKILL.md +14 -21
- package/resources/skills/provider-connections/SKILL.md +23 -36
- package/resources/templates/workspace-agents.md +5 -13
- package/src/extension/acp/member.ts +14 -11
- package/src/extension/acp/worker.ts +31 -28
- package/src/extension/cli/commands/mcp.ts +1 -1
- package/src/extension/cli/commands/upgrade.ts +8 -36
- package/src/extension/cli/commands/workspace.ts +3 -8
- package/src/extension/cli/index.ts +1 -2
- package/src/extension/hosts/dsh/acp-member.ts +1 -1
- package/src/extension/hosts/dsh/command.ts +2 -2
- package/src/extension/hosts/dsh/workspace.ts +5 -4
- package/src/extension/hosts/pi/acp-member.ts +3 -4
- package/src/extension/hosts/pi/command.ts +2 -2
- package/src/extension/hosts/pi/events.ts +1 -1
- package/src/extension/hosts/pi/lifecycle.ts +0 -2
- package/src/extension/hosts/plugin-runtime.ts +1 -11
- package/src/extension/mcp/tool-contract.ts +61 -108
- package/src/extension/mcp/workers.ts +39 -24
- package/src/integrations/acp/agents.ts +28 -27
- package/src/integrations/acp/harnesses/claude.ts +1 -1
- package/src/integrations/agent-resources.ts +5 -5
- package/src/integrations/hosts/antigravity/adapter.ts +0 -1
- package/src/integrations/hosts/claude/adapter.ts +1 -2
- package/src/integrations/hosts/dsh/resources.ts +1 -1
- package/src/integrations/hosts/dsh/session.ts +2 -2
- package/src/integrations/hosts/prompt-hooks.ts +3 -6
- package/src/integrations/installation/cli-update.ts +2 -2
- package/src/integrations/installation/installers/claude.ts +4 -4
- package/src/integrations/installation/installers/qoder.ts +5 -5
- package/src/integrations/installation/upgraders/antigravity.ts +57 -15
- package/src/integrations/installation/upgraders/claude.ts +1 -4
- package/src/integrations/installation/upgraders/codex.ts +85 -15
- package/src/integrations/installation/upgraders/dsh.ts +46 -24
- package/src/integrations/installation/upgraders/pi.ts +18 -11
- package/src/integrations/installation/upgraders/qoder.ts +95 -20
- package/src/model/acp.ts +27 -29
- package/src/model/agent.ts +80 -16
- package/src/model/installation.ts +0 -2
- package/src/pbot.ts +3 -3
- package/src/services/agents/acp-run.ts +81 -49
- package/src/services/agents/agent-run.ts +154 -56
- package/src/services/agents/agent-service.ts +206 -135
- package/src/services/history/summary-dimensions/monthly.ts +1 -1
- package/src/services/history/summary-dimensions/session.ts +6 -3
- package/src/services/history/summary-runner.ts +3 -3
- package/src/services/installation/upgrade-service.ts +1 -5
- package/src/storage/acp-files.ts +50 -45
- package/src/storage/agent-files.ts +159 -46
- package/src/storage/history-files.ts +3 -2
- package/src/tools/history/contract.ts +14 -16
- package/lib/antigravity-plugin/lib/services/workspace/plugin-releases.d.ts +0 -15
- package/lib/antigravity-plugin/lib/services/workspace/plugin-releases.js +0 -126
- package/lib/services/workspace/plugin-releases.d.ts +0 -15
- package/lib/services/workspace/plugin-releases.js +0 -126
- package/src/services/workspace/plugin-releases.ts +0 -121
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
|
-
import { mkdirSync, readdirSync, readFileSync } from "node:fs";
|
|
3
|
-
import { homedir } from "node:os";
|
|
4
|
-
import { isAbsolute, join, resolve } from "node:path";
|
|
5
|
-
import { object } from "../../common/json.js";
|
|
6
|
-
import { resourceRoot } from "../../common/paths.js";
|
|
7
|
-
import { requireThat } from "../../common/validation.js";
|
|
8
|
-
import { releaseLine } from "../../common/version.js";
|
|
9
|
-
import { readJsonFile, writeJsonFile } from "../../storage/atomic-json.js";
|
|
10
|
-
function compareSemver(a, b) {
|
|
11
|
-
const parse = (value) => {
|
|
12
|
-
const match = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z.-]+))?/.exec(value);
|
|
13
|
-
return match
|
|
14
|
-
? { major: Number(match[1]), minor: Number(match[2]), patch: Number(match[3]), pre: match[4] ?? "" }
|
|
15
|
-
: undefined;
|
|
16
|
-
};
|
|
17
|
-
const left = parse(a);
|
|
18
|
-
const right = parse(b);
|
|
19
|
-
if (!left || !right)
|
|
20
|
-
return a.localeCompare(b);
|
|
21
|
-
if (left.major !== right.major)
|
|
22
|
-
return left.major - right.major;
|
|
23
|
-
if (left.minor !== right.minor)
|
|
24
|
-
return left.minor - right.minor;
|
|
25
|
-
if (left.patch !== right.patch)
|
|
26
|
-
return left.patch - right.patch;
|
|
27
|
-
if (left.pre === right.pre)
|
|
28
|
-
return 0;
|
|
29
|
-
if (!left.pre)
|
|
30
|
-
return 1;
|
|
31
|
-
if (!right.pre)
|
|
32
|
-
return -1;
|
|
33
|
-
return left.pre.localeCompare(right.pre);
|
|
34
|
-
}
|
|
35
|
-
function bindingDirectory(root) {
|
|
36
|
-
const key = createHash("sha256").update(root).digest("hex");
|
|
37
|
-
return join(homedir(), ".pbot", "workspaces", key);
|
|
38
|
-
}
|
|
39
|
-
// Full plugins own a local manifest. Thin clients can supply the release stamped into their cached hooks.
|
|
40
|
-
function pluginBinding(value) {
|
|
41
|
-
requireThat(typeof value === "string", "无效的插件安装记录。");
|
|
42
|
-
if (!isAbsolute(value))
|
|
43
|
-
releaseLine(value);
|
|
44
|
-
return value;
|
|
45
|
-
}
|
|
46
|
-
function permissionDenied(error) {
|
|
47
|
-
return ["EACCES", "EPERM", "EROFS"].includes(error.code ?? "");
|
|
48
|
-
}
|
|
49
|
-
/** Each host owns its file, including when two hosts activate the same canonical workspace concurrently. */
|
|
50
|
-
export function bindWorkspacePlugin(root, host, binding = resolve(resourceRoot, "../package.json")) {
|
|
51
|
-
const directory = bindingDirectory(root);
|
|
52
|
-
const file = encodeURIComponent(host) + ".json";
|
|
53
|
-
try {
|
|
54
|
-
if (readJsonFile(directory, file, pluginBinding) === binding)
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
catch (error) {
|
|
58
|
-
if (permissionDenied(error))
|
|
59
|
-
return;
|
|
60
|
-
if (error.code !== "ENOENT")
|
|
61
|
-
throw error;
|
|
62
|
-
}
|
|
63
|
-
try {
|
|
64
|
-
mkdirSync(directory, { recursive: true, mode: 0o700 });
|
|
65
|
-
writeJsonFile(directory, file, binding, pluginBinding);
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
if (!permissionDenied(error))
|
|
69
|
-
throw error;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
export function workspacePluginBindings(root) {
|
|
73
|
-
const directory = bindingDirectory(root);
|
|
74
|
-
let files;
|
|
75
|
-
try {
|
|
76
|
-
files = readdirSync(directory);
|
|
77
|
-
}
|
|
78
|
-
catch (error) {
|
|
79
|
-
if (error.code === "ENOENT" || permissionDenied(error))
|
|
80
|
-
return {};
|
|
81
|
-
throw error;
|
|
82
|
-
}
|
|
83
|
-
const bindings = Object.create(null);
|
|
84
|
-
for (const file of files.filter(name => name.endsWith(".json"))) {
|
|
85
|
-
const host = decodeURIComponent(file.slice(0, -5));
|
|
86
|
-
try {
|
|
87
|
-
const binding = readJsonFile(directory, file, pluginBinding);
|
|
88
|
-
if (!isAbsolute(binding)) {
|
|
89
|
-
bindings[host] = { version: binding };
|
|
90
|
-
continue;
|
|
91
|
-
}
|
|
92
|
-
const manifest = JSON.parse(readFileSync(binding, "utf8"));
|
|
93
|
-
requireThat(object(manifest) && typeof manifest.version === "string", "无效的插件安装清单:" + binding);
|
|
94
|
-
releaseLine(manifest.version);
|
|
95
|
-
bindings[host] = { version: manifest.version, bindingPath: binding };
|
|
96
|
-
}
|
|
97
|
-
catch (error) {
|
|
98
|
-
if (error.code !== "ENOENT" && !permissionDenied(error))
|
|
99
|
-
throw error;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return bindings;
|
|
103
|
-
}
|
|
104
|
-
export function workspacePluginReleases(root) {
|
|
105
|
-
const bindings = workspacePluginBindings(root);
|
|
106
|
-
const releases = Object.create(null);
|
|
107
|
-
for (const [host, entry] of Object.entries(bindings))
|
|
108
|
-
releases[host] = entry.version;
|
|
109
|
-
return releases;
|
|
110
|
-
}
|
|
111
|
-
export function workspacePluginDrift(releases) {
|
|
112
|
-
let highest;
|
|
113
|
-
let lowest;
|
|
114
|
-
for (const version of Object.values(releases)) {
|
|
115
|
-
if (!highest || compareSemver(version, highest) > 0)
|
|
116
|
-
highest = version;
|
|
117
|
-
if (!lowest || compareSemver(version, lowest) < 0)
|
|
118
|
-
lowest = version;
|
|
119
|
-
}
|
|
120
|
-
return {
|
|
121
|
-
outOfSync: Boolean(highest && lowest && highest !== lowest),
|
|
122
|
-
...(highest ? { highest } : {}),
|
|
123
|
-
...(lowest ? { lowest } : {}),
|
|
124
|
-
versions: releases,
|
|
125
|
-
};
|
|
126
|
-
}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
|
-
import { mkdirSync, readdirSync, readFileSync } from "node:fs";
|
|
3
|
-
import { homedir } from "node:os";
|
|
4
|
-
import { isAbsolute, join, resolve } from "node:path";
|
|
5
|
-
import { object } from "../../common/json.js";
|
|
6
|
-
import { resourceRoot } from "../../common/paths.js";
|
|
7
|
-
import { requireThat } from "../../common/validation.js";
|
|
8
|
-
import { releaseLine } from "../../common/version.js";
|
|
9
|
-
import { readJsonFile, writeJsonFile } from "../../storage/atomic-json.js";
|
|
10
|
-
|
|
11
|
-
function compareSemver(a: string, b: string): number {
|
|
12
|
-
const parse = (value: string) => {
|
|
13
|
-
const match = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z.-]+))?/.exec(value);
|
|
14
|
-
return match
|
|
15
|
-
? { major: Number(match[1]), minor: Number(match[2]), patch: Number(match[3]), pre: match[4] ?? "" }
|
|
16
|
-
: undefined;
|
|
17
|
-
};
|
|
18
|
-
const left = parse(a);
|
|
19
|
-
const right = parse(b);
|
|
20
|
-
if (!left || !right) return a.localeCompare(b);
|
|
21
|
-
if (left.major !== right.major) return left.major - right.major;
|
|
22
|
-
if (left.minor !== right.minor) return left.minor - right.minor;
|
|
23
|
-
if (left.patch !== right.patch) return left.patch - right.patch;
|
|
24
|
-
if (left.pre === right.pre) return 0;
|
|
25
|
-
if (!left.pre) return 1;
|
|
26
|
-
if (!right.pre) return -1;
|
|
27
|
-
return left.pre.localeCompare(right.pre);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function bindingDirectory(root: string) {
|
|
31
|
-
const key = createHash("sha256").update(root).digest("hex");
|
|
32
|
-
return join(homedir(), ".pbot", "workspaces", key);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Full plugins own a local manifest. Thin clients can supply the release stamped into their cached hooks.
|
|
36
|
-
function pluginBinding(value: unknown): string {
|
|
37
|
-
requireThat(typeof value === "string", "无效的插件安装记录。");
|
|
38
|
-
if (!isAbsolute(value)) releaseLine(value);
|
|
39
|
-
return value;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function permissionDenied(error: unknown): boolean {
|
|
43
|
-
return ["EACCES", "EPERM", "EROFS"].includes((error as NodeJS.ErrnoException).code ?? "");
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/** Each host owns its file, including when two hosts activate the same canonical workspace concurrently. */
|
|
47
|
-
export function bindWorkspacePlugin(root: string, host: string, binding = resolve(resourceRoot, "../package.json")): void {
|
|
48
|
-
const directory = bindingDirectory(root);
|
|
49
|
-
const file = encodeURIComponent(host) + ".json";
|
|
50
|
-
try {
|
|
51
|
-
if (readJsonFile(directory, file, pluginBinding) === binding) return;
|
|
52
|
-
} catch (error) {
|
|
53
|
-
if (permissionDenied(error)) return;
|
|
54
|
-
if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
|
|
55
|
-
}
|
|
56
|
-
try {
|
|
57
|
-
mkdirSync(directory, { recursive: true, mode: 0o700 });
|
|
58
|
-
writeJsonFile(directory, file, binding, pluginBinding);
|
|
59
|
-
} catch (error) {
|
|
60
|
-
if (!permissionDenied(error)) throw error;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface WorkspacePluginBinding {
|
|
65
|
-
version: string;
|
|
66
|
-
bindingPath?: string;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface WorkspacePluginDrift {
|
|
70
|
-
outOfSync: boolean;
|
|
71
|
-
highest?: string;
|
|
72
|
-
lowest?: string;
|
|
73
|
-
versions: Record<string, string>;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export function workspacePluginBindings(root: string): Record<string, WorkspacePluginBinding> {
|
|
77
|
-
const directory = bindingDirectory(root);
|
|
78
|
-
let files: string[];
|
|
79
|
-
try { files = readdirSync(directory); }
|
|
80
|
-
catch (error) {
|
|
81
|
-
if ((error as NodeJS.ErrnoException).code === "ENOENT" || permissionDenied(error)) return {};
|
|
82
|
-
throw error;
|
|
83
|
-
}
|
|
84
|
-
const bindings: Record<string, WorkspacePluginBinding> = Object.create(null);
|
|
85
|
-
for (const file of files.filter(name => name.endsWith(".json"))) {
|
|
86
|
-
const host = decodeURIComponent(file.slice(0, -5));
|
|
87
|
-
try {
|
|
88
|
-
const binding = readJsonFile(directory, file, pluginBinding);
|
|
89
|
-
if (!isAbsolute(binding)) { bindings[host] = { version: binding }; continue; }
|
|
90
|
-
const manifest: unknown = JSON.parse(readFileSync(binding, "utf8"));
|
|
91
|
-
requireThat(object(manifest) && typeof manifest.version === "string", "无效的插件安装清单:" + binding);
|
|
92
|
-
releaseLine(manifest.version);
|
|
93
|
-
bindings[host] = { version: manifest.version, bindingPath: binding };
|
|
94
|
-
} catch (error) {
|
|
95
|
-
if ((error as NodeJS.ErrnoException).code !== "ENOENT" && !permissionDenied(error)) throw error;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return bindings;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export function workspacePluginReleases(root: string): Record<string, string> {
|
|
102
|
-
const bindings = workspacePluginBindings(root);
|
|
103
|
-
const releases: Record<string, string> = Object.create(null);
|
|
104
|
-
for (const [host, entry] of Object.entries(bindings)) releases[host] = entry.version;
|
|
105
|
-
return releases;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export function workspacePluginDrift(releases: Record<string, string>): WorkspacePluginDrift {
|
|
109
|
-
let highest: string | undefined;
|
|
110
|
-
let lowest: string | undefined;
|
|
111
|
-
for (const version of Object.values(releases)) {
|
|
112
|
-
if (!highest || compareSemver(version, highest) > 0) highest = version;
|
|
113
|
-
if (!lowest || compareSemver(version, lowest) < 0) lowest = version;
|
|
114
|
-
}
|
|
115
|
-
return {
|
|
116
|
-
outOfSync: Boolean(highest && lowest && highest !== lowest),
|
|
117
|
-
...(highest ? { highest } : {}),
|
|
118
|
-
...(lowest ? { lowest } : {}),
|
|
119
|
-
versions: releases,
|
|
120
|
-
};
|
|
121
|
-
}
|