@skild/core 0.2.7 → 0.2.9

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';
@@ -140,6 +140,10 @@ declare function initSkill(name: string, options?: InitOptions): string;
140
140
 
141
141
  declare function fetchWithTimeout(input: RequestInfo | URL, init?: RequestInit, timeoutMs?: number): Promise<Response>;
142
142
 
143
+ declare function normalizeAlias(input: unknown): string | null;
144
+ declare function isValidAlias(input: string): boolean;
145
+ declare function assertValidAlias(input: string): void;
146
+
143
147
  declare const DEFAULT_REGISTRY_URL = "https://registry.skild.sh";
144
148
  interface RegistrySpecifier {
145
149
  canonicalName: string;
@@ -211,4 +215,4 @@ declare function uninstallSkill(name: string, options?: InstallOptions & {
211
215
  }): void;
212
216
  declare function updateSkill(name?: string, options?: UpdateOptions): Promise<InstallRecord[]>;
213
217
 
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 };
218
+ 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, assertValidAlias, canonicalNameToInstallDirName, clearRegistryAuth, downloadAndExtractTarball, fetchWithTimeout, getSkillInfo, getSkillInstallDir, getSkillsDir, initSkill, installRegistrySkill, installSkill, isValidAlias, listAllSkills, listSkills, loadOrCreateGlobalConfig, loadRegistryAuth, normalizeAlias, 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() {
@@ -260,6 +262,33 @@ async function fetchWithTimeout(input, init = {}, timeoutMs = 1e4) {
260
262
  }
261
263
  }
262
264
 
265
+ // src/alias.ts
266
+ function normalizeAlias(input) {
267
+ if (typeof input !== "string") return null;
268
+ const v = input.trim();
269
+ return v ? v : null;
270
+ }
271
+ function isValidAlias(input) {
272
+ const alias = input.trim();
273
+ if (!alias) return false;
274
+ if (alias.length < 3 || alias.length > 64) return false;
275
+ if (alias.includes("--")) return false;
276
+ return /^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(alias);
277
+ }
278
+ function assertValidAlias(input) {
279
+ const alias = input.trim();
280
+ if (!alias) throw new SkildError("INVALID_SOURCE", "Missing alias.");
281
+ if (alias.length < 3 || alias.length > 64) {
282
+ throw new SkildError("INVALID_SOURCE", "Alias length must be between 3 and 64.");
283
+ }
284
+ if (alias.includes("--")) {
285
+ throw new SkildError("INVALID_SOURCE", "Invalid alias format: consecutive hyphens are not allowed.");
286
+ }
287
+ if (!/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(alias)) {
288
+ throw new SkildError("INVALID_SOURCE", "Invalid alias format. Use lowercase letters, numbers, and hyphens.");
289
+ }
290
+ }
291
+
263
292
  // src/registry.ts
264
293
  import fs5 from "fs";
265
294
  import path5 from "path";
@@ -1082,6 +1111,7 @@ export {
1082
1111
  DEFAULT_REGISTRY_URL,
1083
1112
  PLATFORMS,
1084
1113
  SkildError,
1114
+ assertValidAlias,
1085
1115
  canonicalNameToInstallDirName,
1086
1116
  clearRegistryAuth,
1087
1117
  downloadAndExtractTarball,
@@ -1092,10 +1122,12 @@ export {
1092
1122
  initSkill,
1093
1123
  installRegistrySkill,
1094
1124
  installSkill,
1125
+ isValidAlias,
1095
1126
  listAllSkills,
1096
1127
  listSkills,
1097
1128
  loadOrCreateGlobalConfig,
1098
1129
  loadRegistryAuth,
1130
+ normalizeAlias,
1099
1131
  parseRegistrySpecifier,
1100
1132
  resolveRegistryAlias,
1101
1133
  resolveRegistryUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skild/core",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
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",