@rbbtsn0w/adg 0.5.0-beta.5 → 0.5.0-beta.7
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 +2 -2
- package/dist/src/agents/antigravity.js +4 -1
- package/dist/src/agents/base.js +7 -2
- package/dist/src/cli/handlers.js +45 -3
- package/dist/src/cli/index.js +17 -1
- package/dist/src/commands/cache.js +54 -0
- package/dist/src/commands/install.js +74 -52
- package/dist/src/commands/link.js +13 -9
- package/dist/src/commands/list.js +4 -1
- package/dist/src/commands/marketplace.js +8 -1
- package/dist/src/commands/migrate.js +73 -6
- package/dist/src/commands/projection.js +6 -0
- package/dist/src/commands/remove.js +11 -2
- package/dist/src/commands/select-components.js +2 -1
- package/dist/src/commands/state.js +18 -12
- package/dist/src/commands/sync.js +13 -9
- package/dist/src/commands/update.js +34 -36
- package/dist/src/fsutil.js +15 -2
- package/dist/src/lock.js +10 -6
- package/dist/src/manifest.js +52 -3
- package/dist/src/materialize.js +176 -0
- package/dist/src/paths.js +27 -1
- package/dist/src/render/json.js +2 -1
- package/dist/src/render/plugins.js +1 -1
- package/dist/src/telemetry.js +14 -1
- package/dist/src/types.js +51 -1
- package/dist/vendor/skills/src/remove.js +2 -1
- package/dist/vendor/skills/src/telemetry.js +5 -1
- package/docs/agents-spec.md +23 -12
- package/docs/cli-json.md +2 -1
- package/package.json +1 -1
- package/schemas/adg-plugin.schema.json +23 -0
- package/schemas/plugin-lock.schema.json +10 -5
- package/vendor/skills/src/remove.ts +2 -1
- package/vendor/skills/src/telemetry.ts +6 -1
package/dist/src/types.js
CHANGED
|
@@ -2,9 +2,59 @@
|
|
|
2
2
|
* ADG type definitions mirroring the JSON Schemas under ../schemas.
|
|
3
3
|
*/
|
|
4
4
|
export const ADG_SCHEMA_VERSION = "adg.plugin/v1";
|
|
5
|
-
export const LOCK_VERSION =
|
|
5
|
+
export const LOCK_VERSION = 3;
|
|
6
6
|
/** The component categories a plugin can expose. */
|
|
7
7
|
export const COMPONENT_TYPES = ["skills", "agents", "commands", "mcp", "hooks", "apps"];
|
|
8
|
+
/** Canonicalize user intent without adding derived component dependencies. */
|
|
9
|
+
export function normalizePluginSelection(selection) {
|
|
10
|
+
if (!selection)
|
|
11
|
+
return undefined;
|
|
12
|
+
const components = new Set(selection.components);
|
|
13
|
+
if (selection.skills !== undefined)
|
|
14
|
+
components.add("skills");
|
|
15
|
+
return {
|
|
16
|
+
components: COMPONENT_TYPES.filter((component) => components.has(component)),
|
|
17
|
+
...(selection.skills !== undefined ? { skills: [...new Set(selection.skills)].sort() } : {}),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/** Expand mandatory component/skill requirements to a stable closure. */
|
|
21
|
+
export function resolveSelectionDependencies(manifest, selection) {
|
|
22
|
+
const normalized = normalizePluginSelection(selection);
|
|
23
|
+
if (!normalized)
|
|
24
|
+
return undefined;
|
|
25
|
+
const components = new Set(normalized.components);
|
|
26
|
+
let skills = normalized.skills ? new Set(normalized.skills) : undefined;
|
|
27
|
+
let changed = true;
|
|
28
|
+
while (changed) {
|
|
29
|
+
changed = false;
|
|
30
|
+
for (const component of [...components]) {
|
|
31
|
+
const requirement = manifest.selectionDependencies?.[component];
|
|
32
|
+
for (const required of requirement?.components ?? []) {
|
|
33
|
+
if (!components.has(required)) {
|
|
34
|
+
components.add(required);
|
|
35
|
+
changed = true;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
for (const skill of requirement?.skills ?? []) {
|
|
39
|
+
if (!components.has("skills")) {
|
|
40
|
+
components.add("skills");
|
|
41
|
+
skills = new Set();
|
|
42
|
+
changed = true;
|
|
43
|
+
}
|
|
44
|
+
// `skills === undefined` means the user selected every skill, which
|
|
45
|
+
// already contains any required skill and must remain unrestricted.
|
|
46
|
+
if (skills && !skills.has(skill)) {
|
|
47
|
+
skills.add(skill);
|
|
48
|
+
changed = true;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
components: COMPONENT_TYPES.filter((component) => components.has(component)),
|
|
55
|
+
...(skills ? { skills: [...skills].sort() } : {}),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
8
58
|
export function pluginState(entry) {
|
|
9
59
|
return entry?.state ?? "enabled";
|
|
10
60
|
}
|
|
@@ -107,6 +107,7 @@ export async function removeCommand(skillNames, options) {
|
|
|
107
107
|
targetAgents = Object.keys(agents);
|
|
108
108
|
spinner.stop(`Targeting ${targetAgents.length} potential agent(s)`);
|
|
109
109
|
}
|
|
110
|
+
const eveSubagents = !isGlobal && targetAgents.includes('eve') ? getEveSubagents(cwd) : [];
|
|
110
111
|
if (!options.yes) {
|
|
111
112
|
console.log();
|
|
112
113
|
p.log.info('Skills to remove:');
|
|
@@ -142,7 +143,7 @@ export async function removeCommand(skillNames, options) {
|
|
|
142
143
|
pathsToCleanup.add(join(cwd, agent.skillsDir, sanitizedName));
|
|
143
144
|
// Eve skills may also live in subagent directories.
|
|
144
145
|
if (agentKey === 'eve') {
|
|
145
|
-
for (const subagent of
|
|
146
|
+
for (const subagent of eveSubagents) {
|
|
146
147
|
pathsToCleanup.add(join(getEveSubagentSkillsDir(subagent, cwd), sanitizedName));
|
|
147
148
|
}
|
|
148
149
|
}
|
|
@@ -9,9 +9,13 @@ import { readFileSync, existsSync } from "node:fs";
|
|
|
9
9
|
import { dirname, join } from "node:path";
|
|
10
10
|
import { fileURLToPath } from "node:url";
|
|
11
11
|
const baseEndpoint = process.env.OTEL_EXPORTER_OTLP_ENDPOINT;
|
|
12
|
+
function normalizeTraceEndpoint(endpoint) {
|
|
13
|
+
const normalized = endpoint.replace(/\/$/, "");
|
|
14
|
+
return normalized.endsWith("/v1/traces") ? normalized : `${normalized}/v1/traces`;
|
|
15
|
+
}
|
|
12
16
|
const TELEMETRY_URL = process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT ||
|
|
13
17
|
(baseEndpoint
|
|
14
|
-
?
|
|
18
|
+
? normalizeTraceEndpoint(baseEndpoint)
|
|
15
19
|
: "https://telemetry-gateway.hamiltonsnow.workers.dev/v1/traces");
|
|
16
20
|
const AUDIT_URL = "https://add-skill.vercel.sh/audit";
|
|
17
21
|
let provider = null;
|
package/docs/agents-spec.md
CHANGED
|
@@ -82,10 +82,12 @@ are ADG-internal conventions, not declared in the manifest.
|
|
|
82
82
|
|
|
83
83
|
## 3. Packaging — manifest-driven allowlist
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
ADG first stores the complete declared payload in an internal source cache, then
|
|
86
|
+
materializes an **effective installation** into the runtime-facing plugins
|
|
87
|
+
directory. The effective installation contains only the selected components and
|
|
88
|
+
skills; unselected conventional directories such as `hooks/` do not exist for an
|
|
89
|
+
agent to auto-load. Authoring files (`src/`, `test/`, docs, CI config, …) never
|
|
90
|
+
enter either packaged view.
|
|
89
91
|
|
|
90
92
|
The packaged file set (`src/package.ts:packagedRoots` / `packageFilter`) is:
|
|
91
93
|
|
|
@@ -93,13 +95,23 @@ The packaged file set (`src/package.ts:packagedRoots` / `packageFilter`) is:
|
|
|
93
95
|
- the top-level path segment of every declared component pointer
|
|
94
96
|
(`skills`/`commands`/`agents`/`mcpServers`/`hooks`/`apps`);
|
|
95
97
|
- canonical metadata at the root: `README*`, `LICENSE*`, `CHANGELOG*`, `NOTICE*`;
|
|
96
|
-
-
|
|
97
|
-
|
|
98
|
+
- runtime projections are never copied from the source cache; ADG regenerates
|
|
99
|
+
`.claude-plugin/`, `.codex-plugin/`, and Antigravity files in staging.
|
|
98
100
|
|
|
99
|
-
The
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
The lock records two hashes: `sourceHash` covers the complete cached payload and
|
|
102
|
+
`installedHash` covers the effective selection. Runtime projections are excluded
|
|
103
|
+
from both hashes so re-adapting does not churn content identity.
|
|
104
|
+
|
|
105
|
+
The cache is scoped by a stable store id under the store's sibling
|
|
106
|
+
`cache/plugins/` tree. `adg plugins cache status` reports its contents,
|
|
107
|
+
`cache prune` removes orphan snapshots, and `cache clean --force` removes all
|
|
108
|
+
snapshots. A missing remote snapshot must be restored with `plugins update` or
|
|
109
|
+
`plugins add`; a still-available local source is used directly as fallback.
|
|
110
|
+
|
|
111
|
+
When one selected component requires another component or a bootstrap skill, the
|
|
112
|
+
source manifest declares that closure with `selectionDependencies`. ADG expands
|
|
113
|
+
the selection before copying or hashing, so the lock, effective manifest, and
|
|
114
|
+
physical payload all describe the same installation.
|
|
103
115
|
|
|
104
116
|
A plugin needing finer exclusion *within* a component directory SHOULD use git's
|
|
105
117
|
native `.gitattributes export-ignore` rather than a bespoke ignore format.
|
|
@@ -125,7 +137,7 @@ a human or generated by an agent. Beyond JSON-schema validity it SHOULD enforce:
|
|
|
125
137
|
## 5. Migration from `.adg-plugin/`
|
|
126
138
|
|
|
127
139
|
1. Move `.adg-plugin/plugin.json` → `.agents/.plugin.json` (content unchanged).
|
|
128
|
-
2. Run `adg plugins update` so lock `
|
|
140
|
+
2. Run `adg plugins update` so lock `sourceHash` and `installedHash` values reflect the new layout.
|
|
129
141
|
3. `adg plugins validate` to confirm. (Re-run `adg plugins adapt` only if you
|
|
130
142
|
commit projections for a native registry.)
|
|
131
143
|
|
|
@@ -301,4 +313,3 @@ When support for a new agent runtime is needed:
|
|
|
301
313
|
4. **Update cross-agent matrices** (§8–§11) to include the new agent column.
|
|
302
314
|
5. **Add hook event support** in [`src/hooks.ts`](../src/hooks.ts) `SUPPORTED_EVENTS`.
|
|
303
315
|
6. **Test** via `adg plugins adapt --target <agent>` and `adg plugins validate`.
|
|
304
|
-
|
package/docs/cli-json.md
CHANGED
|
@@ -34,7 +34,8 @@ Shape:
|
|
|
34
34
|
"name": "apple-skills",
|
|
35
35
|
"version": "1.13.2",
|
|
36
36
|
"source": { "type": "github", "repo": "RbBtSn0w/apple-skills" },
|
|
37
|
-
"
|
|
37
|
+
"sourceHash": "sha256-...",
|
|
38
|
+
"installedHash": "sha256-...",
|
|
38
39
|
"installedAt": "2026-06-26T00:00:00.000Z",
|
|
39
40
|
"updatedAt": "2026-06-26T00:00:00.000Z",
|
|
40
41
|
"path": "/absolute/path/to/.agents/plugins/RbBtSn0w__apple-skills/apple-skills",
|
package/package.json
CHANGED
|
@@ -66,6 +66,29 @@
|
|
|
66
66
|
"additionalProperties": false
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
|
+
"selectionDependencies": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"description": "Mandatory payload closure for each selected component.",
|
|
72
|
+
"additionalProperties": false,
|
|
73
|
+
"patternProperties": {
|
|
74
|
+
"^(skills|agents|commands|mcp|hooks|apps)$": {
|
|
75
|
+
"type": "object",
|
|
76
|
+
"additionalProperties": false,
|
|
77
|
+
"properties": {
|
|
78
|
+
"components": {
|
|
79
|
+
"type": "array",
|
|
80
|
+
"items": { "enum": ["skills", "agents", "commands", "mcp", "hooks", "apps"] },
|
|
81
|
+
"uniqueItems": true
|
|
82
|
+
},
|
|
83
|
+
"skills": {
|
|
84
|
+
"type": "array",
|
|
85
|
+
"items": { "type": "string" },
|
|
86
|
+
"uniqueItems": true
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
69
92
|
"strict": {
|
|
70
93
|
"type": "boolean",
|
|
71
94
|
"description": "When true, only skills listed in the manifest are exposed; when false, the skills directory is auto-scanned.",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"required": ["version", "plugins"],
|
|
8
8
|
"additionalProperties": false,
|
|
9
9
|
"properties": {
|
|
10
|
-
"version": { "type": "integer", "description": "Lock file format version.", "const":
|
|
10
|
+
"version": { "type": "integer", "description": "Lock file format version.", "const": 3 },
|
|
11
11
|
"plugins": {
|
|
12
12
|
"type": "object",
|
|
13
13
|
"additionalProperties": { "$ref": "#/$defs/lockEntry" }
|
|
@@ -20,14 +20,19 @@
|
|
|
20
20
|
"$defs": {
|
|
21
21
|
"lockEntry": {
|
|
22
22
|
"type": "object",
|
|
23
|
-
"required": ["origin", "version", "
|
|
23
|
+
"required": ["origin", "version", "sourceHash", "installedHash", "installedAt", "updatedAt"],
|
|
24
24
|
"additionalProperties": false,
|
|
25
25
|
"properties": {
|
|
26
26
|
"origin": { "$ref": "#/$defs/source" },
|
|
27
27
|
"version": { "type": "string" },
|
|
28
|
-
"
|
|
28
|
+
"sourceHash": {
|
|
29
29
|
"type": "string",
|
|
30
|
-
"description": "
|
|
30
|
+
"description": "Digest of the complete cached source payload.",
|
|
31
|
+
"pattern": "^[a-z0-9]+-[0-9a-f]+$"
|
|
32
|
+
},
|
|
33
|
+
"installedHash": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "Digest of the effective runtime installation.",
|
|
31
36
|
"pattern": "^[a-z0-9]+-[0-9a-f]+$"
|
|
32
37
|
},
|
|
33
38
|
"installedAt": { "type": "string", "format": "date-time" },
|
|
@@ -42,7 +47,7 @@
|
|
|
42
47
|
},
|
|
43
48
|
"selection": {
|
|
44
49
|
"type": "object",
|
|
45
|
-
"description": "Partial-install selection: which components/skills
|
|
50
|
+
"description": "Partial-install selection: which components/skills are physically materialized and exposed. Absent = install everything.",
|
|
46
51
|
"required": ["components"],
|
|
47
52
|
"additionalProperties": false,
|
|
48
53
|
"properties": {
|
|
@@ -137,6 +137,7 @@ export async function removeCommand(skillNames: string[], options: RemoveOptions
|
|
|
137
137
|
targetAgents = Object.keys(agents) as AgentType[];
|
|
138
138
|
spinner.stop(`Targeting ${targetAgents.length} potential agent(s)`);
|
|
139
139
|
}
|
|
140
|
+
const eveSubagents = !isGlobal && targetAgents.includes('eve') ? getEveSubagents(cwd) : [];
|
|
140
141
|
|
|
141
142
|
if (!options.yes) {
|
|
142
143
|
console.log();
|
|
@@ -185,7 +186,7 @@ export async function removeCommand(skillNames: string[], options: RemoveOptions
|
|
|
185
186
|
pathsToCleanup.add(join(cwd, agent.skillsDir, sanitizedName));
|
|
186
187
|
// Eve skills may also live in subagent directories.
|
|
187
188
|
if (agentKey === 'eve') {
|
|
188
|
-
for (const subagent of
|
|
189
|
+
for (const subagent of eveSubagents) {
|
|
189
190
|
pathsToCleanup.add(join(getEveSubagentSkillsDir(subagent, cwd), sanitizedName));
|
|
190
191
|
}
|
|
191
192
|
}
|
|
@@ -10,10 +10,15 @@ import { dirname, join } from "node:path";
|
|
|
10
10
|
import { fileURLToPath } from "node:url";
|
|
11
11
|
|
|
12
12
|
const baseEndpoint = process.env.OTEL_EXPORTER_OTLP_ENDPOINT;
|
|
13
|
+
function normalizeTraceEndpoint(endpoint: string): string {
|
|
14
|
+
const normalized = endpoint.replace(/\/$/, "");
|
|
15
|
+
return normalized.endsWith("/v1/traces") ? normalized : `${normalized}/v1/traces`;
|
|
16
|
+
}
|
|
17
|
+
|
|
13
18
|
const TELEMETRY_URL =
|
|
14
19
|
process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT ||
|
|
15
20
|
(baseEndpoint
|
|
16
|
-
?
|
|
21
|
+
? normalizeTraceEndpoint(baseEndpoint)
|
|
17
22
|
: "https://telemetry-gateway.hamiltonsnow.workers.dev/v1/traces");
|
|
18
23
|
|
|
19
24
|
const AUDIT_URL = "https://add-skill.vercel.sh/audit";
|