@rbbtsn0w/adg 0.8.0-beta.4 → 0.8.0-beta.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.
@@ -13,7 +13,8 @@ import { sanitizeName } from "./installer.js";
13
13
  import { getGitHubToken } from "./skill-lock.js";
14
14
  import { discoverSkills, filterSkills, getSkillDisplayName } from "./skills.js";
15
15
  import { getOwnerRepo, parseSource } from "./source-parser.js";
16
- import { wellKnownProvider, } from "./providers/wellknown.js";
16
+ import { downloadSource } from "./download-source.js";
17
+ import { wellKnownProvider, WellKnownScopeNotFoundError, } from "./providers/wellknown.js";
17
18
  export function agentCloseResult(code, signal) {
18
19
  return {
19
20
  status: code ?? (signal ? null : 1),
@@ -147,6 +148,8 @@ export async function runUse(sourceArgs, options = {}, parseErrors = []) {
147
148
  const parsed = parseSource(source);
148
149
  const ownerRepoRaw = getOwnerRepo(parsed);
149
150
  const sourceOwner = ownerRepoRaw?.split('/')[0]?.toLowerCase();
151
+ // ADG safety gate: `use` executes unverified instructions through an agent
152
+ // with full permissions, so OpenClaw sources require explicit opt-in.
150
153
  if (sourceOwner === 'openclaw' && !options.dangerouslyAcceptOpenclawRisks) {
151
154
  fail([
152
155
  'OpenClaw skills are unverified community submissions.',
@@ -158,13 +161,47 @@ export async function runUse(sourceArgs, options = {}, parseErrors = []) {
158
161
  const includeInternal = selector !== undefined;
159
162
  let selectedSkill;
160
163
  if (parsed.type === 'well-known') {
161
- const skills = await wellKnownProvider.fetchAllSkills(parsed.url);
162
- selectedSkill = selectWellKnownSkill(skills, selector, source);
164
+ const skills = await wellKnownProvider
165
+ .fetchAllSkills(parsed.url, {
166
+ includeInternal,
167
+ })
168
+ .catch((error) => {
169
+ if (error instanceof WellKnownScopeNotFoundError)
170
+ fail(error.message);
171
+ return [];
172
+ });
173
+ if (skills.length > 0) {
174
+ selectedSkill = selectWellKnownSkill(skills, selector, source);
175
+ }
176
+ else {
177
+ const downloaded = await downloadSource(parsed.url);
178
+ cloneTempDir = downloaded.tempDir;
179
+ const downloadedSkills = await discoverSkills(downloaded.rootDir, undefined, {
180
+ includeInternal,
181
+ fullDepth: options.fullDepth,
182
+ });
183
+ const selected = selectSkill(downloadedSkills, selector, source);
184
+ selectedSkill = {
185
+ kind: 'disk',
186
+ name: selected.name,
187
+ directoryName: selected.name,
188
+ rawContent: selected.rawContent,
189
+ path: selected.path,
190
+ };
191
+ }
163
192
  }
164
193
  else {
165
194
  let skills;
166
195
  let blobResult = null;
167
- if (parsed.type === 'local') {
196
+ if (parsed.type === 'download') {
197
+ const downloaded = await downloadSource(parsed.url);
198
+ cloneTempDir = downloaded.tempDir;
199
+ skills = await discoverSkills(downloaded.rootDir, undefined, {
200
+ includeInternal,
201
+ fullDepth: options.fullDepth,
202
+ });
203
+ }
204
+ else if (parsed.type === 'local') {
168
205
  if (!existsSync(parsed.localPath)) {
169
206
  fail(`Local path does not exist: ${parsed.localPath}`);
170
207
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbbtsn0w/adg",
3
- "version": "0.8.0-beta.4",
3
+ "version": "0.8.0-beta.6",
4
4
  "description": "Agent Directory Group (ADG) toolkit — two domains: plugins and skills.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -46,7 +46,7 @@
46
46
  ],
47
47
  "comment:dependencies": "Runtime deps below are required only by the vendored skills CLI (vendor/skills); ADG's own plugins code has zero runtime deps. Root is the single source of truth: each range MUST be >= the floor declared in vendor/skills/package.json, since that is the version the vendored source was authored against. `npm run check:vendor-deps` enforces this and fails on drift.",
48
48
  "dependencies": {
49
- "@clack/prompts": "^0.11.0",
49
+ "@clack/prompts": "^1.2.0",
50
50
  "@opentelemetry/api": "^1.9.0",
51
51
  "@opentelemetry/exporter-trace-otlp-http": "^0.219.0",
52
52
  "@opentelemetry/resources": "^2.8.0",
@@ -56,6 +56,7 @@
56
56
  "@vercel/detect-agent": "^1.2.3",
57
57
  "picocolors": "^1.1.1",
58
58
  "simple-git": "^3.36.0",
59
+ "tar": "^7.5.20",
59
60
  "xdg-basedir": "^5.1.0",
60
61
  "yaml": "^2.8.3"
61
62
  },
@@ -6,13 +6,23 @@ wrapped by `adg skills`.
6
6
  | Field | Value |
7
7
  |-------|-------|
8
8
  | Upstream repo | https://github.com/vercel-labs/skills |
9
- | npm package | `skills` (v1.5.14) |
10
- | Vendored commit | `2adcfe5a4cce0ce5f4d5547a997b2a161ec5d127` (tag `v1.5.14`) |
11
- | Vendored on | 2026-07-02 |
9
+ | npm package | `skills` (v1.5.23) |
10
+ | Vendored commit | `c1755dd49618b02a4181495ee7404eec3d744c81` (tag `v1.5.23`) |
11
+ | Vendored on | 2026-09-03 |
12
12
  | Previous vendoring | `be0dd25` (v1.5.11), 2026-06-11 |
13
13
  | What was copied | `src/` (excluding `*.test.ts`) and `ThirdPartyNoticeText.txt` |
14
14
 
15
- ## Re-sync notes (v1.5.11 → v1.5.14, 2026-07-02)
15
+ ## Re-sync notes (v1.5.14 → v1.5.23, 2026-09-03)
16
+
17
+ 3-way merge (base `2adcfe5`, ours = prior vendoring + ADG patches, theirs `c1755dd`).
18
+ The first pass accidentally retained old implementations in several overlapping
19
+ files. This re-sync restores the upstream archive/direct-download flow, well-known
20
+ digest/update flow, expanded discovery depth and agents, GitHub Enterprise auth
21
+ paths, Git transport hardening, and lock/update metadata. ADG-owned security and
22
+ runtime patches were then re-applied manually. The upstream package floors now
23
+ require `@clack/prompts` 1.2.0, `simple-git` 3.36.0, and `tar` 7.5.20.
24
+
25
+ The previous merge notes are retained below as the patch history.
16
26
 
17
27
  3-way merge (base `be0dd25`, ours = prior vendoring + ADG patches, theirs `2adcfe5`).
18
28
  Upstream dependencies were unchanged. Resolution map:
@@ -82,6 +92,10 @@ re-vendoring. Each is marked inline with an `ADG patch:` comment.
82
92
  | `src/update.ts` → both `spawnSync` self-CLI re-invokes (+ new `src/self-cli.ts`) | Forward `process.execArgv`, call `skills add` instead of `add`, and wrap in OpenTelemetry CLIENT spans | The child process runs `adg skills add` inside the spawned Node context, ensuring type-stripping flags inherit properly, and OTel spans capture subprocess execution metadata. |
83
93
  | `package.json` → `@vercel/detect-agent` dependency (not a vendored-source change) | `^0.1.0` → `^1.2.3` | `src/detect-agent.ts` (upstream, unpatched) imports `AgentResult` and expects `determineAgent(): Promise<AgentResult>` (object API). The stale `0.1.0` pin only exported `determineAgent(): Promise<string \| false>` and no `AgentResult`, which broke typecheck and left `cachedResult.isAgent` always `undefined` at runtime — agent auto-detection (non-interactive mode in `add`/`sync`/`remove`/`find`/`cli`) silently never fired. The `1.x` line restores the API the fork targets, so `detect-agent.ts` needs **no** local patch. Keep this dependency on `1.x` across re-vendoring. |
84
94
  | `src/git-tree.ts` (**new ADG file**) + `src/add.ts` clone-fallback branch | github source that falls back to a `git clone` now records the git **tree SHA** (`git rev-parse HEAD:<folder>`), not a sha256 content hash | Install and update must use ONE hash scheme per source. Update-check always uses the git tree SHA; the old clone fallback stored a sha256 content hash, so those skills were re-flagged on **every** update (a collection repo appeared to "fully update" each run). `git-tree.ts` is standalone (uses `child_process`, no simple-git) so it typechecks under ADG's strict tsconfig when a test imports it. |
95
+ | `src/add.ts` → direct-download and well-known fallback | Route `download` sources through `downloadSource()` and fall back from empty well-known discovery to raw `SKILL.md`/archive download | `source-parser.ts` already classified these URLs, but the installer previously fell through to `cloneRepo()`, making the new source type unusable. |
96
+ | `src/add.ts`, `src/skill-lock.ts`, `src/local-lock.ts`, `src/update.ts` → well-known metadata | Persist the canonical base URL and content digest, then use them for global/project update checks | Without the digest metadata, well-known skills could install but could not participate in the upstream update lifecycle. |
97
+ | `src/skills.ts` → discovery depth and agent containers | Restore upstream three-level known-container discovery and current agent directories while retaining ADG path/lock filtering | Prevents nested catalog skills and newly supported agent locations from disappearing during synchronization. |
98
+ | `src/cli.ts`, `src/add.ts` → help and argument errors | Restore side-effect-free subcommand help and explicit option parse errors; retain ADG-specific OpenClaw help/security behavior | Keeps CLI behavior predictable without reintroducing upstream's removed OpenClaw execution warning policy. |
85
99
  | `src/git-tree.ts` → `gitTreeShaForFolder` | Route the ADG-added `git rev-parse` subprocess through the root OTel CLIENT-span runner | Keeps the local fallback compliant with ADG's CLI semantic-convention policy without duplicating instrumentation inside the vendored fork. |
86
100
  | `src/skill-lock.ts`, `src/update.ts`, `src/use.ts` | Route GitHub auth, self-update, and interactive agent subprocesses through the root OTel CLIENT-span runner | Enforces required exit/error attributes and privacy-safe command arguments consistently across the vendored CLI. |
87
101
  | `src/skill-lock.ts` → `getGitHubToken` auth warning | Prefix the one-shot stderr warning with `\r\x1b[K` on a TTY | The warning lands on the same physical terminal line as `update.ts`'s transient stdout status line, which carries no trailing newline — without rewinding, the two are rendered concatenated. |