vskill 1.0.19 → 1.0.20

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.
Files changed (30) hide show
  1. package/README.md +58 -7
  2. package/agents.json +1 -1
  3. package/dist/bin.js +0 -0
  4. package/dist/commands/add-lockfile.d.ts +6 -0
  5. package/dist/commands/add-lockfile.js +10 -0
  6. package/dist/commands/add-lockfile.js.map +1 -1
  7. package/dist/commands/add.js +16 -1
  8. package/dist/commands/add.js.map +1 -1
  9. package/dist/discovery/github-tree.d.ts +23 -3
  10. package/dist/discovery/github-tree.js +172 -24
  11. package/dist/discovery/github-tree.js.map +1 -1
  12. package/dist/eval-ui/assets/{CreateSkillPage-Cv93Croj.js → CreateSkillPage-gG-MYioa.js} +5 -5
  13. package/dist/eval-ui/assets/{FindSkillsPalette-BY9DAhHh.js → FindSkillsPalette-DgVp_buC.js} +2 -2
  14. package/dist/eval-ui/assets/{SearchPaletteCore-DMVcq7UB.js → SearchPaletteCore-D2gKxOTT.js} +1 -1
  15. package/dist/eval-ui/assets/{SkillDetailPanel-B_lbhK6q.js → SkillDetailPanel-Ioc5XaDA.js} +1 -1
  16. package/dist/eval-ui/assets/{UpdateDropdown-4AbjZLpq.js → UpdateDropdown-B9rCyfnR.js} +1 -1
  17. package/dist/eval-ui/assets/{main-tpOyw9SC.js → main-sUAgJ9SV.js} +34 -34
  18. package/dist/eval-ui/index.html +1 -1
  19. package/dist/lib/github-fetch.d.ts +1 -0
  20. package/dist/lib/github-fetch.js +11 -1
  21. package/dist/lib/github-fetch.js.map +1 -1
  22. package/dist/lockfile/types.d.ts +8 -0
  23. package/dist/sidecar/eval-ui-manifest.json +1 -0
  24. package/dist/sidecar/sea-config.json +57 -0
  25. package/dist/sidecar/sea-prep.blob +0 -0
  26. package/dist/sidecar/server.cjs +141627 -0
  27. package/dist/sidecar/vskill-version.txt +1 -0
  28. package/dist/updater/source-fetcher.js +2 -2
  29. package/dist/updater/source-fetcher.js.map +1 -1
  30. package/package.json +1 -1
package/README.md CHANGED
@@ -173,7 +173,8 @@ private catalog.
173
173
  ```bash
174
174
  npx vskill@latest auth login # interactive Device Flow — copy code, visit URL
175
175
  npx vskill@latest auth status # show the current GitHub identity
176
- npx vskill@latest auth logout # forget the GitHub token
176
+ npx vskill@latest auth logout # forget all stored tokens
177
+ npx vskill@latest whoami # combined identity + active tenant snapshot
177
178
  ```
178
179
 
179
180
  How it works:
@@ -181,31 +182,81 @@ How it works:
181
182
  1. `vskill auth login` requests a device + user code from `github.com/login/device/code`.
182
183
  2. You visit `https://github.com/login/device` and enter the 8-character code (rendered as `XXXX-XXXX`).
183
184
  3. The CLI polls `github.com/login/oauth/access_token` until you authorize, then validates against `api.github.com/user`.
184
- 4. The resulting token is stored in your **OS keychain** (macOS Keychain / Windows DPAPI / libsecret).
185
- On systems without a keyring daemon, the token falls back to `~/.vskill/keys.env` with mode `0600` and a startup warning.
185
+ 4. The CLI calls `POST /api/v1/auth/github/exchange-for-vsk-token` to mint a verified-skill API token (`vsk_…`) scoped to the same identity.
186
+ 5. **Both** tokens are stored in your **OS keychain** (macOS Keychain / Windows DPAPI / libsecret) under distinct service names:
187
+ - `com.verifiedskill.desktop` / `github-oauth-token` → `gho_…` (raw GitHub OAuth)
188
+ - `com.verifiedskill.desktop` / `vskill-token` → `vsk_…` (verified-skill API token)
186
189
 
187
- Where the token is used:
190
+ On systems without a keyring daemon, both fall back to `~/.vskill/keys.env` with mode `0600` and a startup warning.
188
191
 
192
+ If the exchange step fails (network error, 5xx), login still succeeds with just the `gho_…` token and the CLI prints `Logged in (legacy mode — some features unavailable)`. Re-run `vskill auth login` later to mint the `vsk_…` token without losing your session.
193
+
194
+ Where the tokens are used:
195
+
196
+ - **`vskill add <skill>`, `vskill list`, `vskill marketplace`** — every request to `verified-skill.com` carries `Authorization: Bearer <vsk_… or gho_…>` (preferring `vsk_` when present). Anonymous requests for public skills still work when no token is stored.
189
197
  - **`vskill install <github-url>`** — added as `Authorization: Bearer …` on every fetch to `api.github.com` and `raw.githubusercontent.com`. Public skills still install anonymously.
190
198
  - **`vskill studio`** — the local eval-server proxies private routes (`/api/v1/private/*`, `/api/v1/tenants/*`) to verified-skill.com with the bearer header injected at the proxy boundary. Your browser never holds the token.
191
199
 
192
200
  Configuration:
193
201
 
194
202
  - `VSKILL_GITHUB_CLIENT_ID` — the OAuth/App `client_id` used during Device Flow. Defaults are baked in for the public Skill Studio App; set this only if you are running a self-hosted variant.
203
+ - `VSKILL_TENANT` — overrides the active tenant for a single invocation (CI / scripted use). See "Tenant resolution priority" below.
195
204
 
196
205
  Inspect status of all credentials in one place:
197
206
 
198
207
  ```bash
199
208
  npx vskill@latest keys list # shows AI provider keys + the github slot
209
+ npx vskill@latest whoami # email, token prefix, active tenant, all tenants
200
210
  ```
201
211
 
212
+ ### Tenants and `vskill orgs`
213
+
214
+ When your GitHub identity belongs to multiple organizations that have the Skill Studio App installed, each org is a **tenant** in verified-skill.com. The CLI calls them "orgs" for symmetry with `gh org`, `gcloud config configurations`, and `kubectl config use-context`.
215
+
216
+ ```bash
217
+ npx vskill@latest orgs list # table: slug | name | role | active (* marks the active tenant)
218
+ npx vskill@latest orgs use <slug> # write currentTenant to ~/.vskill/config.json
219
+ npx vskill@latest orgs current # print the active tenant slug, or `(none)`
220
+ ```
221
+
222
+ `orgs` and `whoami` are anonymous-safe — running them without a stored token prints `Not logged in. Run \`vskill auth login\`.` and exits non-zero (orgs returns 0; whoami returns 1) without crashing.
223
+
224
+ #### Tenant resolution priority
225
+
226
+ When a tenant-scoped command (`vskill add`, `vskill install` for a private skill, etc.) needs to pick an active tenant, it walks this list in order — first match wins:
227
+
228
+ 1. **`--tenant <slug>` flag** — per-command override (highest precedence).
229
+ 2. **`VSKILL_TENANT` env var** — non-interactive / CI use.
230
+ 3. **`currentTenant` in `~/.vskill/config.json`** — the persistent active tenant set by `vskill orgs use` or the Studio sidebar picker.
231
+ 4. **Auto-pick when N=1** — if you belong to exactly one tenant, that one is used silently.
232
+ 5. **Error** — if you belong to N>1 tenants and none of (1)–(3) is set, the CLI prints `Multiple tenants available — set one with \`vskill orgs use <slug>\`.` and exits non-zero. The CLI never silently picks one of N>1.
233
+
234
+ The same `~/.vskill/config.json` is shared with Skill Studio — switching tenants in Studio's sidebar picker updates the same file the CLI reads, so the two surfaces stay in sync.
235
+
236
+ #### `vskill add` resolution order (private skills)
237
+
238
+ When you run `vskill add <skill>`, the resolver tries:
239
+
240
+ 1. The public registry.
241
+ 2. The active tenant's scoped registry (resolved via the priority above).
242
+ 3. Other tenants you belong to, in parallel HEAD requests — first match wins.
243
+
244
+ If a `--tenant <slug>` flag is set, only the public registry and that tenant are tried.
245
+
246
+ Common error messages:
247
+
248
+ - `Skill found in multiple tenants: acme, contoso. Re-run with --tenant <slug> or set an active tenant: vskill orgs use <slug>.` — ambiguity guard for N>1 with no active tenant.
249
+ - `Authentication failed. Run \`vskill auth login\` to re-authenticate.` — the registry returned 401. The keychain is **not** auto-cleared (you might be on a flaky network).
250
+ - `Upgrade required: <message> (<upgradeUrl>)` — the registry returned 402: skill exists in this tenant but you lack entitlement.
251
+
202
252
  ### Private skill workflow
203
253
 
204
- Once authenticated, installing a private org skill is identical to a public one — the CLI silently attaches the keychain token to every `api.github.com` and `raw.githubusercontent.com` request:
254
+ Once authenticated, installing a private org skill is identical to a public one — the CLI silently attaches the keychain token to every request:
205
255
 
206
256
  ```bash
207
- npx vskill@latest auth login # one-time setup
208
- npx vskill@latest add https://github.com/<org>/<repo> # private skill installs same as public
257
+ npx vskill@latest auth login # one-time setup (mints gho_ + vsk_)
258
+ npx vskill@latest orgs use acme # pick a tenant if you belong to multiple
259
+ npx vskill@latest add private-skill # private skill installs same as public
209
260
  ```
210
261
 
211
262
  The local skill bundle on disk **never contains** your GitHub token — the token is used only at fetch time. Your project's `vskill.lock` records `source: "private"` and the org name so future updates re-authenticate correctly.
package/agents.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 1,
3
- "generatedAt": "2026-06-01T16:04:52.080Z",
3
+ "generatedAt": "2026-06-02T13:48:25.738Z",
4
4
  "agentPrefixes": [
5
5
  ".adal",
6
6
  ".agent",
package/dist/bin.js CHANGED
File without changes
@@ -17,6 +17,12 @@ export interface BuildGitHubInstallLockEntryArgs {
17
17
  * (likely-wrong) GitHub blob URL.
18
18
  */
19
19
  sourceSkillPath: string | null;
20
+ /** Branch/ref used when installing from GitHub. */
21
+ branch?: string | null;
22
+ /** Commit SHA at install time. */
23
+ commitSha?: string | null;
24
+ /** Plugin namespace that owns this skill, if discovered from plugins/<name>/skills/. */
25
+ pluginName?: string | null;
20
26
  /** Whether this is a user-global install (`--global`) vs project-local. */
21
27
  global: boolean;
22
28
  /** ISO timestamp; injected for deterministic tests, defaults to `now`. */
@@ -7,11 +7,21 @@ export function buildGitHubInstallLockEntry(args) {
7
7
  source: `github:${args.owner}/${args.repo}`,
8
8
  scope: args.global ? "user" : "project",
9
9
  files: ["SKILL.md"],
10
+ sourceType: "github",
10
11
  sourceRepoUrl: `https://github.com/${args.owner}/${args.repo}`,
11
12
  };
12
13
  if (args.sourceSkillPath) {
13
14
  entry.sourceSkillPath = args.sourceSkillPath;
14
15
  }
16
+ if (args.branch) {
17
+ entry.sourceBranch = args.branch;
18
+ }
19
+ if (args.commitSha) {
20
+ entry.sourceCommitSha = args.commitSha;
21
+ }
22
+ if (args.pluginName) {
23
+ entry.sourcePluginName = args.pluginName;
24
+ }
15
25
  return entry;
16
26
  }
17
27
  //# sourceMappingURL=add-lockfile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-lockfile.js","sourceRoot":"","sources":["../../src/commands/add-lockfile.ts"],"names":[],"mappings":"AAmCA,MAAM,UAAU,2BAA2B,CACzC,IAAqC;IAErC,MAAM,KAAK,GAAmB;QAC5B,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,IAAI,CA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C,MAAM,EAAE,CAAC;QAChB,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC;IACnC,CAAC;IACD,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;QACnB,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC;IACzC,CAAC;IACD,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC;IAC3C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -16,7 +16,7 @@ import { getAvailablePlugins, getPluginSource, getPluginVersion, hasPlugin, disc
16
16
  import { checkInstallSafety } from "../blocklist/blocklist.js";
17
17
  import { getSkill, searchSkills } from "../api/client.js";
18
18
  import { checkPlatformSecurity } from "../security/index.js";
19
- import { discoverSkills, getDefaultBranch, checkRepoExists, warnRateLimitOnce } from "../discovery/github-tree.js";
19
+ import { discoverSkills, getDefaultBranch, getBranchHeadSha, checkRepoExists, warnRateLimitOnce } from "../discovery/github-tree.js";
20
20
  import { githubFetch } from "../lib/github-fetch.js";
21
21
  import { parseGitHubSource } from "../utils/validation.js";
22
22
  import { parseSkillsShUrl, isCompleteParsed, isIncompleteParsed, } from "../resolvers/url-resolver.js";
@@ -46,6 +46,12 @@ function isGitHubDownloadUrl(url) {
46
46
  return false;
47
47
  }
48
48
  }
49
+ function pluginNameFromSkillPath(path) {
50
+ if (!path)
51
+ return null;
52
+ const match = path.match(/^plugins\/([^/]+)\/skills\/[^/]+\/SKILL\.md$/);
53
+ return match?.[1] ?? null;
54
+ }
49
55
  async function parseManifestFromContentsApi(data) {
50
56
  // Prefer download_url for raw content — validate URL before fetching (SSRF prevention)
51
57
  if (data.download_url && isGitHubDownloadUrl(data.download_url)) {
@@ -1865,6 +1871,8 @@ async function addCommandInner(source, opts) {
1865
1871
  // `sourceSkillPath` are persisted alongside the legacy `source` string.
1866
1872
  const lockDir = lockfileRoot(opts);
1867
1873
  const lock = ensureLockfile(lockDir);
1874
+ const sourceBranch = await getDefaultBranch(owner, repo);
1875
+ const sourceCommitSha = await getBranchHeadSha(owner, repo, sourceBranch);
1868
1876
  for (const r of results) {
1869
1877
  if (r.installed && r.sha) {
1870
1878
  lock.skills[r.skillName] = buildGitHubInstallLockEntry({
@@ -1873,6 +1881,9 @@ async function addCommandInner(source, opts) {
1873
1881
  owner,
1874
1882
  repo,
1875
1883
  sourceSkillPath: r.sourceSkillPath ?? null,
1884
+ branch: sourceBranch,
1885
+ commitSha: sourceCommitSha,
1886
+ pluginName: pluginNameFromSkillPath(r.sourceSkillPath),
1876
1887
  global: !!opts.global,
1877
1888
  });
1878
1889
  }
@@ -2302,6 +2313,7 @@ async function installSingleSkillLegacy(owner, repo, skill, opts, skillSubpathOv
2302
2313
  return process.exit(1);
2303
2314
  }
2304
2315
  const branch = await getDefaultBranch(owner, repo);
2316
+ const sourceCommitSha = await getBranchHeadSha(owner, repo, branch);
2305
2317
  const skillSubpath = skillSubpathOverride || (skill ? `skills/${skill}/SKILL.md` : "SKILL.md");
2306
2318
  const url = `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${skillSubpath}`;
2307
2319
  // Fetch SKILL.md
@@ -2443,6 +2455,9 @@ async function installSingleSkillLegacy(owner, repo, skill, opts, skillSubpathOv
2443
2455
  owner,
2444
2456
  repo,
2445
2457
  sourceSkillPath: skillSubpath,
2458
+ branch,
2459
+ commitSha: sourceCommitSha,
2460
+ pluginName: pluginNamespace ?? pluginNameFromSkillPath(skillSubpath),
2446
2461
  global: !!opts.global,
2447
2462
  });
2448
2463
  lock.agents = [...new Set([...(lock.agents || []), ...selectedAgents.map((a) => a.id)])];