@skild/core 0.2.6 → 0.2.8

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/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ declare class SkildError extends Error {
5
5
  constructor(code: SkildErrorCode, message: string, details?: Record<string, unknown>);
6
6
  }
7
7
 
8
- declare const PLATFORMS: readonly ["claude", "codex", "copilot"];
8
+ declare const PLATFORMS: readonly ["claude", "codex", "copilot", "antigravity"];
9
9
  type Platform = (typeof PLATFORMS)[number];
10
10
  type InstallScope = 'global' | 'project';
11
11
  type SourceType = 'local' | 'github-url' | 'degit-shorthand' | 'registry';
@@ -167,6 +167,13 @@ declare function searchRegistrySkills(registryUrl: string, query: string, limit?
167
167
  created_at?: string;
168
168
  updated_at?: string;
169
169
  }>>;
170
+ declare function resolveRegistryAlias(registryUrl: string, alias: string): Promise<{
171
+ type: 'registry';
172
+ spec: string;
173
+ } | {
174
+ type: 'linked';
175
+ spec: string;
176
+ }>;
170
177
  declare function downloadAndExtractTarball(resolved: RegistryResolvedVersion, tempRoot: string, stagingDir: string): Promise<void>;
171
178
 
172
179
  interface InstallInput {
@@ -204,4 +211,4 @@ declare function uninstallSkill(name: string, options?: InstallOptions & {
204
211
  }): void;
205
212
  declare function updateSkill(name?: string, options?: UpdateOptions): Promise<InstallRecord[]>;
206
213
 
207
- export { DEFAULT_REGISTRY_URL, type DependencySourceType, type GlobalConfig, type InstallOptions, type InstallRecord, type InstallScope, type InstalledDependency, type ListOptions, type Lockfile, PLATFORMS, type Platform, type RegistryAuth, SkildError, type SkillFrontmatter, type SkillValidationIssue, type SkillValidationResult, type UpdateOptions, canonicalNameToInstallDirName, clearRegistryAuth, downloadAndExtractTarball, fetchWithTimeout, getSkillInfo, getSkillInstallDir, getSkillsDir, initSkill, installRegistrySkill, installSkill, listAllSkills, listSkills, loadOrCreateGlobalConfig, loadRegistryAuth, parseRegistrySpecifier, resolveRegistryUrl, resolveRegistryVersion, saveRegistryAuth, searchRegistrySkills, splitCanonicalName, uninstallSkill, updateSkill, validateSkill, validateSkillDir };
214
+ export { DEFAULT_REGISTRY_URL, type DependencySourceType, type GlobalConfig, type InstallOptions, type InstallRecord, type InstallScope, type InstalledDependency, type ListOptions, type Lockfile, PLATFORMS, type Platform, type RegistryAuth, SkildError, type SkillFrontmatter, type SkillValidationIssue, type SkillValidationResult, type UpdateOptions, canonicalNameToInstallDirName, clearRegistryAuth, downloadAndExtractTarball, fetchWithTimeout, getSkillInfo, getSkillInstallDir, getSkillsDir, initSkill, installRegistrySkill, installSkill, listAllSkills, listSkills, loadOrCreateGlobalConfig, loadRegistryAuth, parseRegistrySpecifier, resolveRegistryAlias, resolveRegistryUrl, resolveRegistryVersion, saveRegistryAuth, searchRegistrySkills, splitCanonicalName, uninstallSkill, updateSkill, validateSkill, validateSkillDir };
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ var SkildError = class extends Error {
10
10
  };
11
11
 
12
12
  // src/types.ts
13
- var PLATFORMS = ["claude", "codex", "copilot"];
13
+ var PLATFORMS = ["claude", "codex", "copilot", "antigravity"];
14
14
 
15
15
  // src/storage.ts
16
16
  import fs2 from "fs";
@@ -43,6 +43,8 @@ function getSkillsDir(platform, scope) {
43
43
  return path.join(base, ".codex", "skills");
44
44
  case "copilot":
45
45
  return path.join(base, ".github", "skills");
46
+ case "antigravity":
47
+ return scope === "project" ? path.join(getProjectDir(), ".agent", "skills") : path.join(getHomeDir(), ".gemini", "antigravity", "skills");
46
48
  }
47
49
  }
48
50
  function getProjectSkildDir() {
@@ -360,6 +362,24 @@ async function searchRegistrySkills(registryUrl, query, limit = 50) {
360
362
  }
361
363
  return json.skills;
362
364
  }
365
+ async function resolveRegistryAlias(registryUrl, alias) {
366
+ const a = alias.trim();
367
+ if (!a) throw new SkildError("INVALID_SOURCE", "Missing alias.");
368
+ const url = new URL(`${registryUrl}/resolve`);
369
+ url.searchParams.set("alias", a);
370
+ const res = await fetchWithTimeout(url.toString(), { headers: { accept: "application/json" } }, 1e4);
371
+ if (!res.ok) {
372
+ const text = await res.text().catch(() => "");
373
+ throw new SkildError("REGISTRY_RESOLVE_FAILED", `Failed to resolve alias "${a}" (${res.status}). ${text}`.trim());
374
+ }
375
+ const json = await res.json();
376
+ if (!json?.ok || !json.type || typeof json.spec !== "string" || !json.spec.trim()) {
377
+ throw new SkildError("REGISTRY_RESOLVE_FAILED", `Invalid registry response for alias "${a}".`);
378
+ }
379
+ if (json.type === "registry") return { type: "registry", spec: json.spec.trim() };
380
+ if (json.type === "linked") return { type: "linked", spec: json.spec.trim() };
381
+ throw new SkildError("REGISTRY_RESOLVE_FAILED", `Unsupported alias target type "${json.type}".`);
382
+ }
363
383
  async function downloadAndExtractTarball(resolved, tempRoot, stagingDir) {
364
384
  const res = await fetchWithTimeout(resolved.tarballUrl, {}, 3e4);
365
385
  if (!res.ok) {
@@ -1079,6 +1099,7 @@ export {
1079
1099
  loadOrCreateGlobalConfig,
1080
1100
  loadRegistryAuth,
1081
1101
  parseRegistrySpecifier,
1102
+ resolveRegistryAlias,
1082
1103
  resolveRegistryUrl,
1083
1104
  resolveRegistryVersion,
1084
1105
  saveRegistryAuth,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skild/core",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "description": "Skild core library (headless) for installing, validating, and managing Agent Skills locally.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",