@offworld/sdk 0.3.3 → 0.3.5

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.
@@ -196,7 +196,7 @@ const SPARSE_CHECKOUT_DIRS = [
196
196
  * Clone a remote repository to the local repo root.
197
197
  *
198
198
  * @param source - Remote repo source from parseRepoInput()
199
- * @param options - Clone options (shallow, branch, config)
199
+ * @param options - Clone options (branch, config)
200
200
  * @returns The local path where the repo was cloned
201
201
  * @throws RepoExistsError if repo already exists (unless force is true)
202
202
  * @throws GitError if clone fails
@@ -236,7 +236,7 @@ function cleanupEmptyParentDirs(repoPath) {
236
236
  }
237
237
  async function cloneStandard(cloneUrl, repoPath, options) {
238
238
  const args = ["clone"];
239
- if (options.shallow) args.push("--depth", "1");
239
+ if (options.shallow) throw new CloneError("Shallow clones are no longer supported. Use a full clone.");
240
240
  if (options.branch) args.push("--branch", options.branch);
241
241
  args.push(cloneUrl, repoPath);
242
242
  await execGitAsync(args);
@@ -248,7 +248,7 @@ async function cloneSparse(cloneUrl, repoPath, options) {
248
248
  "--no-checkout",
249
249
  "--sparse"
250
250
  ];
251
- if (options.shallow) args.push("--depth", "1");
251
+ if (options.shallow) throw new CloneError("Shallow clones are no longer supported. Use a full clone.");
252
252
  if (options.branch) args.push("--branch", options.branch);
253
253
  args.push(cloneUrl, repoPath);
254
254
  await execGitAsync(args);
@@ -259,18 +259,6 @@ async function cloneSparse(cloneUrl, repoPath, options) {
259
259
  ], repoPath);
260
260
  await execGitAsync(["checkout"], repoPath);
261
261
  }
262
- function isShallowClone(repoPath) {
263
- try {
264
- return execGit(["rev-parse", "--is-shallow-repository"], repoPath) === "true";
265
- } catch {
266
- return false;
267
- }
268
- }
269
- async function unshallowRepo(repoPath) {
270
- if (!isShallowClone(repoPath)) return false;
271
- await execGitAsync(["fetch", "--unshallow"], repoPath);
272
- return true;
273
- }
274
262
  /**
275
263
  * Update a cloned repository by running git fetch and pull.
276
264
  *
@@ -286,11 +274,11 @@ async function updateRepo(qualifiedName, options = {}) {
286
274
  const repoPath = entry.localPath;
287
275
  if (!existsSync(repoPath)) throw new RepoNotFoundError(qualifiedName);
288
276
  const previousSha = getCommitSha(repoPath);
289
- let unshallowed = false;
290
- if (options.unshallow) unshallowed = await unshallowRepo(repoPath);
291
- await execGitAsync(["fetch"], repoPath);
292
- await execGitAsync(["pull", "--ff-only"], repoPath);
293
- const currentSha = getCommitSha(repoPath);
277
+ if (!options.skipFetch) {
278
+ await execGitAsync(["fetch"], repoPath);
279
+ await execGitAsync(["pull", "--ff-only"], repoPath);
280
+ }
281
+ const currentSha = options.skipFetch ? previousSha : getCommitSha(repoPath);
294
282
  upsertGlobalMapEntry(qualifiedName, {
295
283
  ...entry,
296
284
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
@@ -298,8 +286,7 @@ async function updateRepo(qualifiedName, options = {}) {
298
286
  return {
299
287
  updated: previousSha !== currentSha,
300
288
  previousSha,
301
- currentSha,
302
- unshallowed
289
+ currentSha
303
290
  };
304
291
  }
305
292
  async function removeRepo(qualifiedName, options = {}) {
@@ -360,5 +347,5 @@ function getClonedRepoPath(qualifiedName) {
360
347
  }
361
348
 
362
349
  //#endregion
363
- export { upsertGlobalMapEntry as _, cloneRepo as a, getCommitSha as c, listRepos as d, removeRepo as f, removeGlobalMapEntry as g, readGlobalMap as h, RepoNotFoundError as i, isRepoCloned as l, updateRepo as m, GitError as n, getClonedRepoPath as o, unshallowRepo as p, RepoExistsError as r, getCommitDistance as s, CloneError as t, isShallowClone as u, writeGlobalMap as v, writeProjectMap as y };
364
- //# sourceMappingURL=clone-DyLvmbJZ.mjs.map
350
+ export { writeProjectMap as _, cloneRepo as a, getCommitSha as c, removeRepo as d, updateRepo as f, writeGlobalMap as g, upsertGlobalMapEntry as h, RepoNotFoundError as i, isRepoCloned as l, removeGlobalMapEntry as m, GitError as n, getClonedRepoPath as o, readGlobalMap as p, RepoExistsError as r, getCommitDistance as s, CloneError as t, listRepos as u };
351
+ //# sourceMappingURL=clone-Z5ELU2fW.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clone-Z5ELU2fW.mjs","names":[],"sources":["../src/index-manager.ts","../src/clone.ts"],"sourcesContent":["/**\n * Map manager for global and project maps\n *\n * Manages:\n * - Global map: ~/.local/share/offworld/skill/offworld/assets/map.json\n * - Project map: ./.offworld/map.json\n */\n\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport {\n\tGlobalMapSchema,\n\tProjectMapSchema,\n\ttype GlobalMap,\n\ttype GlobalMapRepoEntry,\n\ttype ProjectMap,\n\ttype ProjectMapRepoEntry,\n} from \"@offworld/types\";\nimport { Paths } from \"./paths.js\";\n\n/**\n * Reads the global map from ~/.local/share/offworld/skill/offworld/assets/map.json\n * Returns empty map if file doesn't exist or is invalid\n */\nexport function readGlobalMap(): GlobalMap {\n\tconst mapPath = Paths.offworldGlobalMapPath;\n\n\tif (!existsSync(mapPath)) {\n\t\treturn { repos: {} };\n\t}\n\n\ttry {\n\t\tconst content = readFileSync(mapPath, \"utf-8\");\n\t\tconst data = JSON.parse(content);\n\t\treturn GlobalMapSchema.parse(data);\n\t} catch {\n\t\treturn { repos: {} };\n\t}\n}\n\n/**\n * Writes the global map to ~/.local/share/offworld/skill/offworld/assets/map.json\n * Creates directory if it doesn't exist\n */\nexport function writeGlobalMap(map: GlobalMap): void {\n\tconst mapPath = Paths.offworldGlobalMapPath;\n\tconst mapDir = dirname(mapPath);\n\n\tif (!existsSync(mapDir)) {\n\t\tmkdirSync(mapDir, { recursive: true });\n\t}\n\n\tconst validated = GlobalMapSchema.parse(map);\n\twriteFileSync(mapPath, JSON.stringify(validated, null, 2), \"utf-8\");\n}\n\n/**\n * Adds or updates a repo entry in the global map\n *\n * @param qualifiedName - The qualified repo name (owner/repo)\n * @param entry - The map entry to add/update\n */\nexport function upsertGlobalMapEntry(qualifiedName: string, entry: GlobalMapRepoEntry): void {\n\tconst map = readGlobalMap();\n\tmap.repos[qualifiedName] = entry;\n\twriteGlobalMap(map);\n}\n\n/**\n * Removes a repo entry from the global map\n *\n * @param qualifiedName - The qualified repo name (owner/repo)\n * @returns true if repo was removed, false if not found\n */\nexport function removeGlobalMapEntry(qualifiedName: string): boolean {\n\tconst map = readGlobalMap();\n\n\tif (!(qualifiedName in map.repos)) {\n\t\treturn false;\n\t}\n\n\tdelete map.repos[qualifiedName];\n\twriteGlobalMap(map);\n\treturn true;\n}\n\n/**\n * Writes a project map to ./.offworld/map.json\n *\n * @param projectRoot - Absolute path to project root\n * @param entries - Map of qualified repo names to project map entries\n */\nexport function writeProjectMap(\n\tprojectRoot: string,\n\tentries: Record<string, ProjectMapRepoEntry>,\n): void {\n\tconst mapPath = join(projectRoot, \".offworld\", \"map.json\");\n\tconst mapDir = dirname(mapPath);\n\n\tif (!existsSync(mapDir)) {\n\t\tmkdirSync(mapDir, { recursive: true });\n\t}\n\n\tconst projectMap: ProjectMap = {\n\t\tversion: 1,\n\t\tscope: \"project\",\n\t\tglobalMapPath: Paths.offworldGlobalMapPath,\n\t\trepos: entries,\n\t};\n\n\tconst validated = ProjectMapSchema.parse(projectMap);\n\twriteFileSync(mapPath, JSON.stringify(validated, null, 2), \"utf-8\");\n}\n","/**\n * Git clone and repository management utilities\n */\n\nimport { existsSync, readdirSync, rmSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { execFileSync, spawn } from \"node:child_process\";\nimport type { Config, RemoteRepoSource } from \"@offworld/types\";\nimport { getRepoPath, loadConfig, toReferenceFileName } from \"./config.js\";\nimport { readGlobalMap, upsertGlobalMapEntry, removeGlobalMapEntry } from \"./index-manager.js\";\nimport { Paths } from \"./paths.js\";\n\nexport class CloneError extends Error {\n\tconstructor(message: string) {\n\t\tsuper(message);\n\t\tthis.name = \"CloneError\";\n\t}\n}\n\nexport class RepoExistsError extends CloneError {\n\tconstructor(path: string) {\n\t\tsuper(`Repository already exists at: ${path}`);\n\t\tthis.name = \"RepoExistsError\";\n\t}\n}\n\nexport class RepoNotFoundError extends CloneError {\n\tconstructor(qualifiedName: string) {\n\t\tsuper(`Repository not found in index: ${qualifiedName}`);\n\t\tthis.name = \"RepoNotFoundError\";\n\t}\n}\n\nexport class GitError extends CloneError {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic readonly command: string,\n\t\tpublic readonly exitCode: number | null,\n\t) {\n\t\tsuper(`Git command failed: ${message}`);\n\t\tthis.name = \"GitError\";\n\t}\n}\n\nexport interface CloneOptions {\n\t/** Deprecated: shallow clones are no longer supported */\n\tshallow?: boolean;\n\t/** Clone specific branch */\n\tbranch?: string;\n\t/** Custom config for repo root path */\n\tconfig?: Config;\n\t/** Force clone even if directory exists (removes existing) */\n\tforce?: boolean;\n\t/** Use sparse checkout for large repos (only src/, lib/, packages/, docs/) */\n\tsparse?: boolean;\n}\n\nfunction execGit(args: string[], cwd?: string): string {\n\ttry {\n\t\tconst result = execFileSync(\"git\", args, {\n\t\t\tcwd,\n\t\t\tencoding: \"utf-8\",\n\t\t\tstdio: [\"pipe\", \"pipe\", \"pipe\"],\n\t\t});\n\t\treturn result.trim();\n\t} catch (error) {\n\t\tconst err = error as { status?: number; stderr?: Buffer | string; message?: string };\n\t\tconst stderr = err.stderr\n\t\t\t? typeof err.stderr === \"string\"\n\t\t\t\t? err.stderr\n\t\t\t\t: err.stderr.toString()\n\t\t\t: err.message || \"Unknown error\";\n\t\tthrow new GitError(stderr.trim(), `git ${args.join(\" \")}`, err.status ?? null);\n\t}\n}\n\nfunction execGitAsync(args: string[], cwd?: string): Promise<string> {\n\treturn new Promise((resolve, reject) => {\n\t\tconst proc = spawn(\"git\", args, {\n\t\t\tcwd,\n\t\t\tstdio: [\"ignore\", \"pipe\", \"pipe\"],\n\t\t\tenv: { ...process.env, GIT_TERMINAL_PROMPT: \"0\" },\n\t\t});\n\n\t\tlet stdout = \"\";\n\t\tlet stderr = \"\";\n\n\t\tproc.stdout.on(\"data\", (data: Buffer) => {\n\t\t\tstdout += data.toString();\n\t\t});\n\t\tproc.stderr.on(\"data\", (data: Buffer) => {\n\t\t\tstderr += data.toString();\n\t\t});\n\n\t\tproc.on(\"close\", (code) => {\n\t\t\tif (code === 0) {\n\t\t\t\tresolve(stdout.trim());\n\t\t\t} else {\n\t\t\t\treject(new GitError(stderr.trim() || \"Unknown error\", `git ${args.join(\" \")}`, code));\n\t\t\t}\n\t\t});\n\n\t\tproc.on(\"error\", (err) => {\n\t\t\treject(new GitError(err.message, `git ${args.join(\" \")}`, null));\n\t\t});\n\t});\n}\n\nexport function getCommitSha(repoPath: string): string {\n\treturn execGit([\"rev-parse\", \"HEAD\"], repoPath);\n}\n\nexport function getCommitDistance(\n\trepoPath: string,\n\tolderSha: string,\n\tnewerSha = \"HEAD\",\n): number | null {\n\ttry {\n\t\ttry {\n\t\t\texecGit([\"cat-file\", \"-e\", olderSha], repoPath);\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t\tconst count = execGit([\"rev-list\", \"--count\", `${olderSha}..${newerSha}`], repoPath);\n\t\treturn Number.parseInt(count, 10);\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nconst SPARSE_CHECKOUT_DIRS = [\"src\", \"lib\", \"packages\", \"docs\", \"README.md\", \"package.json\"];\n\n/**\n * Clone a remote repository to the local repo root.\n *\n * @param source - Remote repo source from parseRepoInput()\n * @param options - Clone options (branch, config)\n * @returns The local path where the repo was cloned\n * @throws RepoExistsError if repo already exists (unless force is true)\n * @throws GitError if clone fails\n */\nexport async function cloneRepo(\n\tsource: RemoteRepoSource,\n\toptions: CloneOptions = {},\n): Promise<string> {\n\tconst config = options.config ?? loadConfig();\n\tconst repoPath = getRepoPath(source.fullName, source.provider, config);\n\n\tif (existsSync(repoPath)) {\n\t\tif (options.force) {\n\t\t\trmSync(repoPath, { recursive: true, force: true });\n\t\t} else {\n\t\t\tthrow new RepoExistsError(repoPath);\n\t\t}\n\t}\n\n\ttry {\n\t\tif (options.sparse) {\n\t\t\tawait cloneSparse(source.cloneUrl, repoPath, options);\n\t\t} else {\n\t\t\tawait cloneStandard(source.cloneUrl, repoPath, options);\n\t\t}\n\t} catch (err) {\n\t\tcleanupEmptyParentDirs(repoPath);\n\t\tthrow err;\n\t}\n\n\tconst referenceFileName = toReferenceFileName(source.fullName);\n\tconst referencePath = join(Paths.offworldReferencesDir, referenceFileName);\n\tconst hasReference = existsSync(referencePath);\n\n\tupsertGlobalMapEntry(source.qualifiedName, {\n\t\tlocalPath: repoPath,\n\t\treferences: hasReference ? [referenceFileName] : [],\n\t\tprimary: hasReference ? referenceFileName : \"\",\n\t\tkeywords: [],\n\t\tupdatedAt: new Date().toISOString(),\n\t});\n\n\treturn repoPath;\n}\n\nfunction cleanupEmptyParentDirs(repoPath: string): void {\n\tconst ownerDir = dirname(repoPath);\n\tif (existsSync(ownerDir) && readdirSync(ownerDir).length === 0) {\n\t\trmSync(ownerDir, { recursive: true, force: true });\n\t}\n}\n\nasync function cloneStandard(\n\tcloneUrl: string,\n\trepoPath: string,\n\toptions: CloneOptions,\n): Promise<void> {\n\tconst args = [\"clone\"];\n\n\tif (options.shallow) {\n\t\tthrow new CloneError(\"Shallow clones are no longer supported. Use a full clone.\");\n\t}\n\n\tif (options.branch) {\n\t\targs.push(\"--branch\", options.branch);\n\t}\n\n\targs.push(cloneUrl, repoPath);\n\tawait execGitAsync(args);\n}\n\nasync function cloneSparse(\n\tcloneUrl: string,\n\trepoPath: string,\n\toptions: CloneOptions,\n): Promise<void> {\n\tconst args = [\"clone\", \"--filter=blob:none\", \"--no-checkout\", \"--sparse\"];\n\n\tif (options.shallow) {\n\t\tthrow new CloneError(\"Shallow clones are no longer supported. Use a full clone.\");\n\t}\n\n\tif (options.branch) {\n\t\targs.push(\"--branch\", options.branch);\n\t}\n\n\targs.push(cloneUrl, repoPath);\n\tawait execGitAsync(args);\n\n\tawait execGitAsync([\"sparse-checkout\", \"set\", ...SPARSE_CHECKOUT_DIRS], repoPath);\n\tawait execGitAsync([\"checkout\"], repoPath);\n}\n\nexport interface UpdateResult {\n\t/** Whether any updates were fetched */\n\tupdated: boolean;\n\t/** Previous commit SHA before update */\n\tpreviousSha: string;\n\t/** Current commit SHA after update */\n\tcurrentSha: string;\n}\n\nexport interface UpdateOptions {\n\t/** Skip fetching/pulling updates (useful when cache is valid). */\n\tskipFetch?: boolean;\n}\n\n/**\n * Update a cloned repository by running git fetch and pull.\n *\n * @param qualifiedName - The qualified name of the repo (e.g., \"github.com:owner/repo\")\n * @param options - Update options\n * @returns Update result with commit SHAs\n * @throws RepoNotFoundError if repo not in index\n * @throws GitError if fetch/pull fails\n */\nexport async function updateRepo(\n\tqualifiedName: string,\n\toptions: UpdateOptions = {},\n): Promise<UpdateResult> {\n\tconst map = readGlobalMap();\n\tconst entry = map.repos[qualifiedName];\n\tif (!entry) {\n\t\tthrow new RepoNotFoundError(qualifiedName);\n\t}\n\n\tconst repoPath = entry.localPath;\n\n\tif (!existsSync(repoPath)) {\n\t\tthrow new RepoNotFoundError(qualifiedName);\n\t}\n\n\tconst previousSha = getCommitSha(repoPath);\n\tif (!options.skipFetch) {\n\t\tawait execGitAsync([\"fetch\"], repoPath);\n\t\tawait execGitAsync([\"pull\", \"--ff-only\"], repoPath);\n\t}\n\n\tconst currentSha = options.skipFetch ? previousSha : getCommitSha(repoPath);\n\tupsertGlobalMapEntry(qualifiedName, {\n\t\t...entry,\n\t\tupdatedAt: new Date().toISOString(),\n\t});\n\n\treturn {\n\t\tupdated: previousSha !== currentSha,\n\t\tpreviousSha,\n\t\tcurrentSha,\n\t};\n}\n\nexport interface RemoveOptions {\n\treferenceOnly?: boolean;\n\trepoOnly?: boolean;\n}\n\nexport async function removeRepo(\n\tqualifiedName: string,\n\toptions: RemoveOptions = {},\n): Promise<boolean> {\n\tconst map = readGlobalMap();\n\tconst entry = map.repos[qualifiedName];\n\tif (!entry) {\n\t\treturn false;\n\t}\n\n\tconst { referenceOnly = false, repoOnly = false } = options;\n\tconst removeRepoFiles = !referenceOnly;\n\tconst removeReferenceFiles = !repoOnly;\n\n\tif (removeRepoFiles && existsSync(entry.localPath)) {\n\t\trmSync(entry.localPath, { recursive: true, force: true });\n\t\tcleanupEmptyParentDirs(entry.localPath);\n\t}\n\n\tif (removeReferenceFiles) {\n\t\tfor (const referenceFileName of entry.references) {\n\t\t\tconst referencePath = join(Paths.offworldReferencesDir, referenceFileName);\n\t\t\tif (existsSync(referencePath)) {\n\t\t\t\trmSync(referencePath, { force: true });\n\t\t\t}\n\t\t}\n\n\t\tif (entry.primary) {\n\t\t\tconst metaDirName = entry.primary.replace(/\\.md$/, \"\");\n\t\t\tconst metaPath = join(Paths.metaDir, metaDirName);\n\t\t\tif (existsSync(metaPath)) {\n\t\t\t\trmSync(metaPath, { recursive: true, force: true });\n\t\t\t}\n\t\t}\n\t}\n\n\tif (removeRepoFiles) {\n\t\tremoveGlobalMapEntry(qualifiedName);\n\t} else if (removeReferenceFiles) {\n\t\tupsertGlobalMapEntry(qualifiedName, {\n\t\t\t...entry,\n\t\t\treferences: [],\n\t\t\tprimary: \"\",\n\t\t});\n\t}\n\n\treturn true;\n}\n\nexport function listRepos(): string[] {\n\tconst map = readGlobalMap();\n\treturn Object.keys(map.repos);\n}\n\nexport function isRepoCloned(qualifiedName: string): boolean {\n\tconst map = readGlobalMap();\n\tconst entry = map.repos[qualifiedName];\n\tif (!entry) return false;\n\treturn existsSync(entry.localPath);\n}\n\n/**\n * Get the local path for a cloned repository.\n *\n * @param qualifiedName - The qualified name of the repo\n * @returns The local path or undefined if not cloned\n */\nexport function getClonedRepoPath(qualifiedName: string): string | undefined {\n\tconst map = readGlobalMap();\n\tconst entry = map.repos[qualifiedName];\n\tif (!entry) return undefined;\n\tif (!existsSync(entry.localPath)) return undefined;\n\treturn entry.localPath;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAwBA,SAAgB,gBAA2B;CAC1C,MAAM,UAAU,MAAM;AAEtB,KAAI,CAAC,WAAW,QAAQ,CACvB,QAAO,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AAI,CAAC,MAAO,QAAO;AACnB,KAAI,CAAC,WAAW,MAAM,UAAU,CAAE,QAAO;AACzC,QAAO,MAAM"}
package/dist/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as installReference, $t as getConfigPath, A as pruneRepos, At as removeRepo, B as resolveDependencyRepo, Bt as searchMap, C as RepoStatusOptions, Ct as cloneRepo, D as discoverRepos, Dt as isRepoCloned, E as UpdateAllResult, Et as getCommitSha, F as matchDependenciesToReferences, Ft as SearchMapOptions, G as parseDependencies, Gt as writeProjectMap, H as Dependency, Ht as removeGlobalMapEntry, I as matchDependenciesToReferencesWithRemoteCheck, It as SearchResult, J as detectInstalledAgents, Jt as RepoSourceError, K as AgentConfig, Kt as NotGitRepoError, L as FALLBACK_MAPPINGS, Lt as getMapEntry, M as ReferenceMatch, Mt as updateRepo, N as ReferenceStatus, Nt as GetMapEntryOptions, O as gcRepos, Ot as isShallowClone, P as isReferenceInstalled, Pt as MapEntry, Q as installGlobalSkill, Qt as expandTilde, R as ResolvedDep, Rt as getProjectMapPath, S as PruneResult, St as UpdateResult, T as UpdateAllOptions, Tt as getCommitDistance, U as ManifestType, Ut as upsertGlobalMapEntry, V as resolveFromNpm, Vt as readGlobalMap, W as detectManifestType, Wt as writeGlobalMap, X as getAllAgentConfigs, Xt as parseRepoInput, Y as getAgentConfig, Yt as getReferenceFileNameForSource, Z as InstallReferenceMeta, Zt as Paths, _ as DiscoverOptions, _t as GitError, a as GlobalMap, an as loadConfig, at as TokenExpiredError, b as GcResult, bt as RepoNotFoundError, c as ProjectMapRepoEntry, cn as toReferenceFileName, ct as getAuthStatus, d as ProviderInfo, dn as VERSION, dt as isLoggedIn, en as getMetaPath, et as resolveReferenceKeywords, f as ProviderWithModels, ft as loadAuthData, g as validateProviderModel, gt as CloneOptions, h as listProvidersWithModels, ht as CloneError, i as FileRole, in as getRepoRoot, it as NotLoggedInError, j as updateAllRepos, jt as unshallowRepo, k as getRepoStatus, kt as listRepos, l as RepoSource, ln as toReferenceName, lt as getToken, m as listProviders, mt as saveAuthData, n as FileIndex, nn as getReferencePath, nt as AuthError, o as GlobalMapRepoEntry, on as saveConfig, ot as clearAuthData, p as getProvider, pt as refreshAccessToken, q as agents, qt as PathNotFoundError, r as FileIndexEntry, rn as getRepoPath, rt as AuthStatus, s as ProjectMap, sn as toMetaDirName, st as getAuthPath, t as Config, tn as getMetaRoot, tt as AuthData, u as ModelInfo, un as DEFAULT_IGNORE_PATTERNS, ut as getTokenOrNull, v as DiscoverResult, vt as RemoveOptions, w as RepoStatusSummary, wt as getClonedRepoPath, x as PruneOptions, xt as UpdateOptions, y as GcOptions, yt as RepoExistsError, z as getNpmKeywords, zt as resolveRepoKey } from "./public-FJCckYtX.mjs";
2
- export { AgentConfig, AuthData, AuthError, AuthStatus, CloneError, CloneOptions, Config, DEFAULT_IGNORE_PATTERNS, Dependency, DiscoverOptions, DiscoverResult, FALLBACK_MAPPINGS, FileIndex, FileIndexEntry, FileRole, GcOptions, GcResult, GetMapEntryOptions, GitError, GlobalMap, GlobalMapRepoEntry, InstallReferenceMeta, ManifestType, MapEntry, ModelInfo, NotGitRepoError, NotLoggedInError, PathNotFoundError, Paths, ProjectMap, ProjectMapRepoEntry, ProviderInfo, ProviderWithModels, PruneOptions, PruneResult, ReferenceMatch, ReferenceStatus, RemoveOptions, RepoExistsError, RepoNotFoundError, RepoSource, RepoSourceError, RepoStatusOptions, RepoStatusSummary, ResolvedDep, SearchMapOptions, SearchResult, TokenExpiredError, UpdateAllOptions, UpdateAllResult, UpdateOptions, UpdateResult, VERSION, agents, clearAuthData, cloneRepo, detectInstalledAgents, detectManifestType, discoverRepos, expandTilde, gcRepos, getAgentConfig, getAllAgentConfigs, getAuthPath, getAuthStatus, getClonedRepoPath, getCommitDistance, getCommitSha, getConfigPath, getMapEntry, getMetaPath, getMetaRoot, getNpmKeywords, getProjectMapPath, getProvider, getReferenceFileNameForSource, getReferencePath, getRepoPath, getRepoRoot, getRepoStatus, getToken, getTokenOrNull, installGlobalSkill, installReference, isLoggedIn, isReferenceInstalled, isRepoCloned, isShallowClone, listProviders, listProvidersWithModels, listRepos, loadAuthData, loadConfig, matchDependenciesToReferences, matchDependenciesToReferencesWithRemoteCheck, parseDependencies, parseRepoInput, pruneRepos, readGlobalMap, refreshAccessToken, removeGlobalMapEntry, removeRepo, resolveDependencyRepo, resolveFromNpm, resolveReferenceKeywords, resolveRepoKey, saveAuthData, saveConfig, searchMap, toMetaDirName, toReferenceFileName, toReferenceName, unshallowRepo, updateAllRepos, updateRepo, upsertGlobalMapEntry, validateProviderModel, writeGlobalMap, writeProjectMap };
1
+ import { $ as installGlobalSkill, $t as getMetaPath, A as pruneRepos, At as removeRepo, B as getNpmKeywords, Bt as readGlobalMap, C as RepoStatusOptions, Ct as UpdateResult, D as discoverRepos, Dt as getCommitSha, E as UpdateAllResult, Et as getCommitDistance, F as matchDependenciesToReferences, Ft as SearchResult, G as detectManifestType, Gt as NotGitRepoError, H as resolveFromNpm, Ht as upsertGlobalMapEntry, I as matchDependenciesToReferencesWithRemoteCheck, It as getMapEntry, J as agents, Jt as getReferenceFileNameForSource, K as parseDependencies, Kt as PathNotFoundError, L as FALLBACK_MAPPINGS, Lt as getProjectMapPath, M as ReferenceMatch, Mt as GetMapEntryOptions, N as ReferenceStatus, Nt as MapEntry, O as gcRepos, Ot as isRepoCloned, P as isReferenceInstalled, Pt as SearchMapOptions, Q as InstallReferenceMeta, Qt as getConfigPath, R as ResolveDependencyRepoOptions, Rt as resolveRepoKey, S as PruneResult, St as UpdateOptions, T as UpdateAllOptions, Tt as getClonedRepoPath, U as Dependency, Ut as writeGlobalMap, V as resolveDependencyRepo, Vt as removeGlobalMapEntry, W as ManifestType, Wt as writeProjectMap, X as getAgentConfig, Xt as Paths, Y as detectInstalledAgents, Yt as parseRepoInput, Z as getAllAgentConfigs, Zt as expandTilde, _ as DiscoverOptions, _t as CloneOptions, a as GlobalMap, an as saveConfig, at as NotLoggedInError, b as GcResult, bt as RepoExistsError, c as ProjectMapRepoEntry, cn as toReferenceName, ct as getAuthPath, d as ProviderInfo, dt as getTokenOrNull, en as getMetaRoot, et as installReference, f as ProviderWithModels, ft as isLoggedIn, g as validateProviderModel, gt as CloneError, h as listProvidersWithModels, ht as saveAuthData, i as FileRole, in as loadConfig, it as AuthStatus, j as updateAllRepos, jt as updateRepo, k as getRepoStatus, kt as listRepos, l as RepoSource, ln as DEFAULT_IGNORE_PATTERNS, lt as getAuthStatus, m as listProviders, mt as refreshAccessToken, n as FileIndex, nn as getRepoPath, nt as AuthData, o as GlobalMapRepoEntry, on as toMetaDirName, ot as TokenExpiredError, p as getProvider, pt as loadAuthData, q as AgentConfig, qt as RepoSourceError, r as FileIndexEntry, rn as getRepoRoot, rt as AuthError, s as ProjectMap, sn as toReferenceFileName, st as clearAuthData, t as Config, tn as getReferencePath, tt as resolveReferenceKeywords, u as ModelInfo, un as VERSION, ut as getToken, v as DiscoverResult, vt as GitError, w as RepoStatusSummary, wt as cloneRepo, x as PruneOptions, xt as RepoNotFoundError, y as GcOptions, yt as RemoveOptions, z as ResolvedDep, zt as searchMap } from "./public-DZZG1NQL.mjs";
2
+ export { AgentConfig, AuthData, AuthError, AuthStatus, CloneError, CloneOptions, Config, DEFAULT_IGNORE_PATTERNS, Dependency, DiscoverOptions, DiscoverResult, FALLBACK_MAPPINGS, FileIndex, FileIndexEntry, FileRole, GcOptions, GcResult, GetMapEntryOptions, GitError, GlobalMap, GlobalMapRepoEntry, InstallReferenceMeta, ManifestType, MapEntry, ModelInfo, NotGitRepoError, NotLoggedInError, PathNotFoundError, Paths, ProjectMap, ProjectMapRepoEntry, ProviderInfo, ProviderWithModels, PruneOptions, PruneResult, ReferenceMatch, ReferenceStatus, RemoveOptions, RepoExistsError, RepoNotFoundError, RepoSource, RepoSourceError, RepoStatusOptions, RepoStatusSummary, ResolveDependencyRepoOptions, ResolvedDep, SearchMapOptions, SearchResult, TokenExpiredError, UpdateAllOptions, UpdateAllResult, UpdateOptions, UpdateResult, VERSION, agents, clearAuthData, cloneRepo, detectInstalledAgents, detectManifestType, discoverRepos, expandTilde, gcRepos, getAgentConfig, getAllAgentConfigs, getAuthPath, getAuthStatus, getClonedRepoPath, getCommitDistance, getCommitSha, getConfigPath, getMapEntry, getMetaPath, getMetaRoot, getNpmKeywords, getProjectMapPath, getProvider, getReferenceFileNameForSource, getReferencePath, getRepoPath, getRepoRoot, getRepoStatus, getToken, getTokenOrNull, installGlobalSkill, installReference, isLoggedIn, isReferenceInstalled, isRepoCloned, listProviders, listProvidersWithModels, listRepos, loadAuthData, loadConfig, matchDependenciesToReferences, matchDependenciesToReferencesWithRemoteCheck, parseDependencies, parseRepoInput, pruneRepos, readGlobalMap, refreshAccessToken, removeGlobalMapEntry, removeRepo, resolveDependencyRepo, resolveFromNpm, resolveReferenceKeywords, resolveRepoKey, saveAuthData, saveConfig, searchMap, toMetaDirName, toReferenceFileName, toReferenceName, updateAllRepos, updateRepo, upsertGlobalMapEntry, validateProviderModel, writeGlobalMap, writeProjectMap };
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { A as getAuthPath, B as resolveRepoKey, C as detectInstalledAgents, D as NotLoggedInError, E as AuthError, F as loadAuthData, G as getReferenceFileNameForSource, H as NotGitRepoError, I as refreshAccessToken, J as VERSION, K as parseRepoInput, L as saveAuthData, M as getToken, N as getTokenOrNull, O as TokenExpiredError, P as isLoggedIn, R as getMapEntry, S as agents, T as getAllAgentConfigs, U as PathNotFoundError, V as searchMap, W as RepoSourceError, _ as resolveReferenceKeywords, a as discoverRepos, b as resolveDependencyRepo, c as pruneRepos, d as matchDependenciesToReferences, f as matchDependenciesToReferencesWithRemoteCheck, g as installReference, h as installGlobalSkill, i as validateProviderModel, j as getAuthStatus, k as clearAuthData, l as updateAllRepos, m as parseDependencies, n as listProviders, o as gcRepos, p as detectManifestType, q as DEFAULT_IGNORE_PATTERNS, r as listProvidersWithModels, s as getRepoStatus, t as getProvider, u as isReferenceInstalled, v as FALLBACK_MAPPINGS, w as getAgentConfig, x as resolveFromNpm, y as getNpmKeywords, z as getProjectMapPath } from "./public-0579sBs9.mjs";
1
+ import { A as getAuthPath, B as resolveRepoKey, C as detectInstalledAgents, D as NotLoggedInError, E as AuthError, F as loadAuthData, G as getReferenceFileNameForSource, H as NotGitRepoError, I as refreshAccessToken, J as VERSION, K as parseRepoInput, L as saveAuthData, M as getToken, N as getTokenOrNull, O as TokenExpiredError, P as isLoggedIn, R as getMapEntry, S as agents, T as getAllAgentConfigs, U as PathNotFoundError, V as searchMap, W as RepoSourceError, _ as resolveReferenceKeywords, a as discoverRepos, b as resolveDependencyRepo, c as pruneRepos, d as matchDependenciesToReferences, f as matchDependenciesToReferencesWithRemoteCheck, g as installReference, h as installGlobalSkill, i as validateProviderModel, j as getAuthStatus, k as clearAuthData, l as updateAllRepos, m as parseDependencies, n as listProviders, o as gcRepos, p as detectManifestType, q as DEFAULT_IGNORE_PATTERNS, r as listProvidersWithModels, s as getRepoStatus, t as getProvider, u as isReferenceInstalled, v as FALLBACK_MAPPINGS, w as getAgentConfig, x as resolveFromNpm, y as getNpmKeywords, z as getProjectMapPath } from "./public-CWnhJJ9J.mjs";
2
2
  import { a as getRepoPath, c as saveConfig, d as toReferenceName, f as Paths, i as getReferencePath, l as toMetaDirName, n as getMetaPath, o as getRepoRoot, p as expandTilde, r as getMetaRoot, s as loadConfig, t as getConfigPath, u as toReferenceFileName } from "./config-DW8J4gl5.mjs";
3
- import { _ as upsertGlobalMapEntry, a as cloneRepo, c as getCommitSha, d as listRepos, f as removeRepo, g as removeGlobalMapEntry, h as readGlobalMap, i as RepoNotFoundError, l as isRepoCloned, m as updateRepo, n as GitError, o as getClonedRepoPath, p as unshallowRepo, r as RepoExistsError, s as getCommitDistance, t as CloneError, u as isShallowClone, v as writeGlobalMap, y as writeProjectMap } from "./clone-DyLvmbJZ.mjs";
3
+ import { _ as writeProjectMap, a as cloneRepo, c as getCommitSha, d as removeRepo, f as updateRepo, g as writeGlobalMap, h as upsertGlobalMapEntry, i as RepoNotFoundError, l as isRepoCloned, m as removeGlobalMapEntry, n as GitError, o as getClonedRepoPath, p as readGlobalMap, r as RepoExistsError, s as getCommitDistance, t as CloneError, u as listRepos } from "./clone-Z5ELU2fW.mjs";
4
4
 
5
- export { AuthError, CloneError, DEFAULT_IGNORE_PATTERNS, FALLBACK_MAPPINGS, GitError, NotGitRepoError, NotLoggedInError, PathNotFoundError, Paths, RepoExistsError, RepoNotFoundError, RepoSourceError, TokenExpiredError, VERSION, agents, clearAuthData, cloneRepo, detectInstalledAgents, detectManifestType, discoverRepos, expandTilde, gcRepos, getAgentConfig, getAllAgentConfigs, getAuthPath, getAuthStatus, getClonedRepoPath, getCommitDistance, getCommitSha, getConfigPath, getMapEntry, getMetaPath, getMetaRoot, getNpmKeywords, getProjectMapPath, getProvider, getReferenceFileNameForSource, getReferencePath, getRepoPath, getRepoRoot, getRepoStatus, getToken, getTokenOrNull, installGlobalSkill, installReference, isLoggedIn, isReferenceInstalled, isRepoCloned, isShallowClone, listProviders, listProvidersWithModels, listRepos, loadAuthData, loadConfig, matchDependenciesToReferences, matchDependenciesToReferencesWithRemoteCheck, parseDependencies, parseRepoInput, pruneRepos, readGlobalMap, refreshAccessToken, removeGlobalMapEntry, removeRepo, resolveDependencyRepo, resolveFromNpm, resolveReferenceKeywords, resolveRepoKey, saveAuthData, saveConfig, searchMap, toMetaDirName, toReferenceFileName, toReferenceName, unshallowRepo, updateAllRepos, updateRepo, upsertGlobalMapEntry, validateProviderModel, writeGlobalMap, writeProjectMap };
5
+ export { AuthError, CloneError, DEFAULT_IGNORE_PATTERNS, FALLBACK_MAPPINGS, GitError, NotGitRepoError, NotLoggedInError, PathNotFoundError, Paths, RepoExistsError, RepoNotFoundError, RepoSourceError, TokenExpiredError, VERSION, agents, clearAuthData, cloneRepo, detectInstalledAgents, detectManifestType, discoverRepos, expandTilde, gcRepos, getAgentConfig, getAllAgentConfigs, getAuthPath, getAuthStatus, getClonedRepoPath, getCommitDistance, getCommitSha, getConfigPath, getMapEntry, getMetaPath, getMetaRoot, getNpmKeywords, getProjectMapPath, getProvider, getReferenceFileNameForSource, getReferencePath, getRepoPath, getRepoRoot, getRepoStatus, getToken, getTokenOrNull, installGlobalSkill, installReference, isLoggedIn, isReferenceInstalled, isRepoCloned, listProviders, listProvidersWithModels, listRepos, loadAuthData, loadConfig, matchDependenciesToReferences, matchDependenciesToReferencesWithRemoteCheck, parseDependencies, parseRepoInput, pruneRepos, readGlobalMap, refreshAccessToken, removeGlobalMapEntry, removeRepo, resolveDependencyRepo, resolveFromNpm, resolveReferenceKeywords, resolveRepoKey, saveAuthData, saveConfig, searchMap, toMetaDirName, toReferenceFileName, toReferenceName, updateAllRepos, updateRepo, upsertGlobalMapEntry, validateProviderModel, writeGlobalMap, writeProjectMap };
@@ -1,4 +1,4 @@
1
- import { $ as installReference, $t as getConfigPath, A as pruneRepos, At as removeRepo, B as resolveDependencyRepo, Bt as searchMap, C as RepoStatusOptions, Ct as cloneRepo, D as discoverRepos, Dt as isRepoCloned, E as UpdateAllResult, Et as getCommitSha, F as matchDependenciesToReferences, Ft as SearchMapOptions, G as parseDependencies, Gt as writeProjectMap, H as Dependency, Ht as removeGlobalMapEntry, I as matchDependenciesToReferencesWithRemoteCheck, It as SearchResult, J as detectInstalledAgents, Jt as RepoSourceError, K as AgentConfig, Kt as NotGitRepoError, L as FALLBACK_MAPPINGS, Lt as getMapEntry, M as ReferenceMatch, Mt as updateRepo, N as ReferenceStatus, Nt as GetMapEntryOptions, O as gcRepos, Ot as isShallowClone, P as isReferenceInstalled, Pt as MapEntry, Q as installGlobalSkill, Qt as expandTilde, R as ResolvedDep, Rt as getProjectMapPath, S as PruneResult, St as UpdateResult, T as UpdateAllOptions, Tt as getCommitDistance, U as ManifestType, Ut as upsertGlobalMapEntry, V as resolveFromNpm, Vt as readGlobalMap, W as detectManifestType, Wt as writeGlobalMap, X as getAllAgentConfigs, Xt as parseRepoInput, Y as getAgentConfig, Yt as getReferenceFileNameForSource, Z as InstallReferenceMeta, Zt as Paths, _ as DiscoverOptions, _t as GitError, a as GlobalMap, an as loadConfig, at as TokenExpiredError, b as GcResult, bt as RepoNotFoundError, c as ProjectMapRepoEntry, cn as toReferenceFileName, ct as getAuthStatus, d as ProviderInfo, dn as VERSION, dt as isLoggedIn, en as getMetaPath, et as resolveReferenceKeywords, f as ProviderWithModels, ft as loadAuthData, g as validateProviderModel, gt as CloneOptions, h as listProvidersWithModels, ht as CloneError, i as FileRole, in as getRepoRoot, it as NotLoggedInError, j as updateAllRepos, jt as unshallowRepo, k as getRepoStatus, kt as listRepos, l as RepoSource, ln as toReferenceName, lt as getToken, m as listProviders, mt as saveAuthData, n as FileIndex, nn as getReferencePath, nt as AuthError, o as GlobalMapRepoEntry, on as saveConfig, ot as clearAuthData, p as getProvider, pt as refreshAccessToken, q as agents, qt as PathNotFoundError, r as FileIndexEntry, rn as getRepoPath, rt as AuthStatus, s as ProjectMap, sn as toMetaDirName, st as getAuthPath, t as Config, tn as getMetaRoot, tt as AuthData, u as ModelInfo, un as DEFAULT_IGNORE_PATTERNS, ut as getTokenOrNull, v as DiscoverResult, vt as RemoveOptions, w as RepoStatusSummary, wt as getClonedRepoPath, x as PruneOptions, xt as UpdateOptions, y as GcOptions, yt as RepoExistsError, z as getNpmKeywords, zt as resolveRepoKey } from "./public-FJCckYtX.mjs";
1
+ import { $ as installGlobalSkill, $t as getMetaPath, A as pruneRepos, At as removeRepo, B as getNpmKeywords, Bt as readGlobalMap, C as RepoStatusOptions, Ct as UpdateResult, D as discoverRepos, Dt as getCommitSha, E as UpdateAllResult, Et as getCommitDistance, F as matchDependenciesToReferences, Ft as SearchResult, G as detectManifestType, Gt as NotGitRepoError, H as resolveFromNpm, Ht as upsertGlobalMapEntry, I as matchDependenciesToReferencesWithRemoteCheck, It as getMapEntry, J as agents, Jt as getReferenceFileNameForSource, K as parseDependencies, Kt as PathNotFoundError, L as FALLBACK_MAPPINGS, Lt as getProjectMapPath, M as ReferenceMatch, Mt as GetMapEntryOptions, N as ReferenceStatus, Nt as MapEntry, O as gcRepos, Ot as isRepoCloned, P as isReferenceInstalled, Pt as SearchMapOptions, Q as InstallReferenceMeta, Qt as getConfigPath, R as ResolveDependencyRepoOptions, Rt as resolveRepoKey, S as PruneResult, St as UpdateOptions, T as UpdateAllOptions, Tt as getClonedRepoPath, U as Dependency, Ut as writeGlobalMap, V as resolveDependencyRepo, Vt as removeGlobalMapEntry, W as ManifestType, Wt as writeProjectMap, X as getAgentConfig, Xt as Paths, Y as detectInstalledAgents, Yt as parseRepoInput, Z as getAllAgentConfigs, Zt as expandTilde, _ as DiscoverOptions, _t as CloneOptions, a as GlobalMap, an as saveConfig, at as NotLoggedInError, b as GcResult, bt as RepoExistsError, c as ProjectMapRepoEntry, cn as toReferenceName, ct as getAuthPath, d as ProviderInfo, dt as getTokenOrNull, en as getMetaRoot, et as installReference, f as ProviderWithModels, ft as isLoggedIn, g as validateProviderModel, gt as CloneError, h as listProvidersWithModels, ht as saveAuthData, i as FileRole, in as loadConfig, it as AuthStatus, j as updateAllRepos, jt as updateRepo, k as getRepoStatus, kt as listRepos, l as RepoSource, ln as DEFAULT_IGNORE_PATTERNS, lt as getAuthStatus, m as listProviders, mt as refreshAccessToken, n as FileIndex, nn as getRepoPath, nt as AuthData, o as GlobalMapRepoEntry, on as toMetaDirName, ot as TokenExpiredError, p as getProvider, pt as loadAuthData, q as AgentConfig, qt as RepoSourceError, r as FileIndexEntry, rn as getRepoRoot, rt as AuthError, s as ProjectMap, sn as toReferenceFileName, st as clearAuthData, t as Config, tn as getReferencePath, tt as resolveReferenceKeywords, u as ModelInfo, un as VERSION, ut as getToken, v as DiscoverResult, vt as GitError, w as RepoStatusSummary, wt as cloneRepo, x as PruneOptions, xt as RepoNotFoundError, y as GcOptions, yt as RemoveOptions, z as ResolvedDep, zt as searchMap } from "./public-DZZG1NQL.mjs";
2
2
 
3
3
  //#region src/agents-md.d.ts
4
4
  /**
@@ -65,5 +65,5 @@ declare function getShellConfigFiles(): string[];
65
65
  */
66
66
  declare function cleanShellConfig(filePath: string): boolean;
67
67
  //#endregion
68
- export { AgentConfig, AuthData, AuthError, AuthStatus, CloneError, CloneOptions, Config, DEFAULT_IGNORE_PATTERNS, Dependency, DiscoverOptions, DiscoverResult, FALLBACK_MAPPINGS, FileIndex, FileIndexEntry, FileRole, GcOptions, GcResult, GetMapEntryOptions, GitError, GlobalMap, GlobalMapRepoEntry, type InstallMethod, InstallReferenceMeta, type InstalledReference, ManifestType, MapEntry, ModelInfo, NotGitRepoError, NotLoggedInError, PathNotFoundError, Paths, ProjectMap, ProjectMapRepoEntry, ProviderInfo, ProviderWithModels, PruneOptions, PruneResult, ReferenceMatch, ReferenceStatus, RemoveOptions, RepoExistsError, RepoNotFoundError, RepoSource, RepoSourceError, RepoStatusOptions, RepoStatusSummary, ResolvedDep, SearchMapOptions, SearchResult, TokenExpiredError, UpdateAllOptions, UpdateAllResult, UpdateOptions, UpdateResult, VERSION, agents, appendReferencesSection, cleanShellConfig, clearAuthData, cloneRepo, detectInstallMethod, detectInstalledAgents, detectManifestType, discoverRepos, executeUninstall, executeUpgrade, expandTilde, fetchLatestVersion, gcRepos, getAgentConfig, getAllAgentConfigs, getAuthPath, getAuthStatus, getClonedRepoPath, getCommitDistance, getCommitSha, getConfigPath, getCurrentVersion, getMapEntry, getMetaPath, getMetaRoot, getNpmKeywords, getProjectMapPath, getProvider, getReferenceFileNameForSource, getReferencePath, getRepoPath, getRepoRoot, getRepoStatus, getShellConfigFiles, getToken, getTokenOrNull, installGlobalSkill, installReference, isLoggedIn, isReferenceInstalled, isRepoCloned, isShallowClone, listProviders, listProvidersWithModels, listRepos, loadAuthData, loadConfig, matchDependenciesToReferences, matchDependenciesToReferencesWithRemoteCheck, parseDependencies, parseRepoInput, pruneRepos, readGlobalMap, refreshAccessToken, removeGlobalMapEntry, removeRepo, resolveDependencyRepo, resolveFromNpm, resolveReferenceKeywords, resolveRepoKey, saveAuthData, saveConfig, searchMap, toMetaDirName, toReferenceFileName, toReferenceName, unshallowRepo, updateAgentFiles, updateAllRepos, updateRepo, upsertGlobalMapEntry, validateProviderModel, writeGlobalMap, writeProjectMap };
68
+ export { AgentConfig, AuthData, AuthError, AuthStatus, CloneError, CloneOptions, Config, DEFAULT_IGNORE_PATTERNS, Dependency, DiscoverOptions, DiscoverResult, FALLBACK_MAPPINGS, FileIndex, FileIndexEntry, FileRole, GcOptions, GcResult, GetMapEntryOptions, GitError, GlobalMap, GlobalMapRepoEntry, type InstallMethod, InstallReferenceMeta, type InstalledReference, ManifestType, MapEntry, ModelInfo, NotGitRepoError, NotLoggedInError, PathNotFoundError, Paths, ProjectMap, ProjectMapRepoEntry, ProviderInfo, ProviderWithModels, PruneOptions, PruneResult, ReferenceMatch, ReferenceStatus, RemoveOptions, RepoExistsError, RepoNotFoundError, RepoSource, RepoSourceError, RepoStatusOptions, RepoStatusSummary, ResolveDependencyRepoOptions, ResolvedDep, SearchMapOptions, SearchResult, TokenExpiredError, UpdateAllOptions, UpdateAllResult, UpdateOptions, UpdateResult, VERSION, agents, appendReferencesSection, cleanShellConfig, clearAuthData, cloneRepo, detectInstallMethod, detectInstalledAgents, detectManifestType, discoverRepos, executeUninstall, executeUpgrade, expandTilde, fetchLatestVersion, gcRepos, getAgentConfig, getAllAgentConfigs, getAuthPath, getAuthStatus, getClonedRepoPath, getCommitDistance, getCommitSha, getConfigPath, getCurrentVersion, getMapEntry, getMetaPath, getMetaRoot, getNpmKeywords, getProjectMapPath, getProvider, getReferenceFileNameForSource, getReferencePath, getRepoPath, getRepoRoot, getRepoStatus, getShellConfigFiles, getToken, getTokenOrNull, installGlobalSkill, installReference, isLoggedIn, isReferenceInstalled, isRepoCloned, listProviders, listProvidersWithModels, listRepos, loadAuthData, loadConfig, matchDependenciesToReferences, matchDependenciesToReferencesWithRemoteCheck, parseDependencies, parseRepoInput, pruneRepos, readGlobalMap, refreshAccessToken, removeGlobalMapEntry, removeRepo, resolveDependencyRepo, resolveFromNpm, resolveReferenceKeywords, resolveRepoKey, saveAuthData, saveConfig, searchMap, toMetaDirName, toReferenceFileName, toReferenceName, updateAgentFiles, updateAllRepos, updateRepo, upsertGlobalMapEntry, validateProviderModel, writeGlobalMap, writeProjectMap };
69
69
  //# sourceMappingURL=internal.d.mts.map
package/dist/internal.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { A as getAuthPath, B as resolveRepoKey, C as detectInstalledAgents, D as NotLoggedInError, E as AuthError, F as loadAuthData, G as getReferenceFileNameForSource, H as NotGitRepoError, I as refreshAccessToken, J as VERSION, K as parseRepoInput, L as saveAuthData, M as getToken, N as getTokenOrNull, O as TokenExpiredError, P as isLoggedIn, R as getMapEntry, S as agents, T as getAllAgentConfigs, U as PathNotFoundError, V as searchMap, W as RepoSourceError, _ as resolveReferenceKeywords, a as discoverRepos, b as resolveDependencyRepo, c as pruneRepos, d as matchDependenciesToReferences, f as matchDependenciesToReferencesWithRemoteCheck, g as installReference, h as installGlobalSkill, i as validateProviderModel, j as getAuthStatus, k as clearAuthData, l as updateAllRepos, m as parseDependencies, n as listProviders, o as gcRepos, p as detectManifestType, q as DEFAULT_IGNORE_PATTERNS, r as listProvidersWithModels, s as getRepoStatus, t as getProvider, u as isReferenceInstalled, v as FALLBACK_MAPPINGS, w as getAgentConfig, x as resolveFromNpm, y as getNpmKeywords, z as getProjectMapPath } from "./public-0579sBs9.mjs";
1
+ import { A as getAuthPath, B as resolveRepoKey, C as detectInstalledAgents, D as NotLoggedInError, E as AuthError, F as loadAuthData, G as getReferenceFileNameForSource, H as NotGitRepoError, I as refreshAccessToken, J as VERSION, K as parseRepoInput, L as saveAuthData, M as getToken, N as getTokenOrNull, O as TokenExpiredError, P as isLoggedIn, R as getMapEntry, S as agents, T as getAllAgentConfigs, U as PathNotFoundError, V as searchMap, W as RepoSourceError, _ as resolveReferenceKeywords, a as discoverRepos, b as resolveDependencyRepo, c as pruneRepos, d as matchDependenciesToReferences, f as matchDependenciesToReferencesWithRemoteCheck, g as installReference, h as installGlobalSkill, i as validateProviderModel, j as getAuthStatus, k as clearAuthData, l as updateAllRepos, m as parseDependencies, n as listProviders, o as gcRepos, p as detectManifestType, q as DEFAULT_IGNORE_PATTERNS, r as listProvidersWithModels, s as getRepoStatus, t as getProvider, u as isReferenceInstalled, v as FALLBACK_MAPPINGS, w as getAgentConfig, x as resolveFromNpm, y as getNpmKeywords, z as getProjectMapPath } from "./public-CWnhJJ9J.mjs";
2
2
  import { a as getRepoPath, c as saveConfig, d as toReferenceName, f as Paths, i as getReferencePath, l as toMetaDirName, n as getMetaPath, o as getRepoRoot, p as expandTilde, r as getMetaRoot, s as loadConfig, t as getConfigPath, u as toReferenceFileName } from "./config-DW8J4gl5.mjs";
3
- import { _ as upsertGlobalMapEntry, a as cloneRepo, c as getCommitSha, d as listRepos, f as removeRepo, g as removeGlobalMapEntry, h as readGlobalMap, i as RepoNotFoundError, l as isRepoCloned, m as updateRepo, n as GitError, o as getClonedRepoPath, p as unshallowRepo, r as RepoExistsError, s as getCommitDistance, t as CloneError, u as isShallowClone, v as writeGlobalMap, y as writeProjectMap } from "./clone-DyLvmbJZ.mjs";
3
+ import { _ as writeProjectMap, a as cloneRepo, c as getCommitSha, d as removeRepo, f as updateRepo, g as writeGlobalMap, h as upsertGlobalMapEntry, i as RepoNotFoundError, l as isRepoCloned, m as removeGlobalMapEntry, n as GitError, o as getClonedRepoPath, p as readGlobalMap, r as RepoExistsError, s as getCommitDistance, t as CloneError, u as listRepos } from "./clone-Z5ELU2fW.mjs";
4
4
  import { existsSync, readFileSync, writeFileSync } from "node:fs";
5
5
  import { join } from "node:path";
6
6
  import { NpmPackageResponseSchema } from "@offworld/types";
@@ -314,5 +314,5 @@ function cleanShellConfig(filePath) {
314
314
  }
315
315
 
316
316
  //#endregion
317
- export { AuthError, CloneError, DEFAULT_IGNORE_PATTERNS, FALLBACK_MAPPINGS, GitError, NotGitRepoError, NotLoggedInError, PathNotFoundError, Paths, RepoExistsError, RepoNotFoundError, RepoSourceError, TokenExpiredError, VERSION, agents, appendReferencesSection, cleanShellConfig, clearAuthData, cloneRepo, detectInstallMethod, detectInstalledAgents, detectManifestType, discoverRepos, executeUninstall, executeUpgrade, expandTilde, fetchLatestVersion, gcRepos, getAgentConfig, getAllAgentConfigs, getAuthPath, getAuthStatus, getClonedRepoPath, getCommitDistance, getCommitSha, getConfigPath, getCurrentVersion, getMapEntry, getMetaPath, getMetaRoot, getNpmKeywords, getProjectMapPath, getProvider, getReferenceFileNameForSource, getReferencePath, getRepoPath, getRepoRoot, getRepoStatus, getShellConfigFiles, getToken, getTokenOrNull, installGlobalSkill, installReference, isLoggedIn, isReferenceInstalled, isRepoCloned, isShallowClone, listProviders, listProvidersWithModels, listRepos, loadAuthData, loadConfig, matchDependenciesToReferences, matchDependenciesToReferencesWithRemoteCheck, parseDependencies, parseRepoInput, pruneRepos, readGlobalMap, refreshAccessToken, removeGlobalMapEntry, removeRepo, resolveDependencyRepo, resolveFromNpm, resolveReferenceKeywords, resolveRepoKey, saveAuthData, saveConfig, searchMap, toMetaDirName, toReferenceFileName, toReferenceName, unshallowRepo, updateAgentFiles, updateAllRepos, updateRepo, upsertGlobalMapEntry, validateProviderModel, writeGlobalMap, writeProjectMap };
317
+ export { AuthError, CloneError, DEFAULT_IGNORE_PATTERNS, FALLBACK_MAPPINGS, GitError, NotGitRepoError, NotLoggedInError, PathNotFoundError, Paths, RepoExistsError, RepoNotFoundError, RepoSourceError, TokenExpiredError, VERSION, agents, appendReferencesSection, cleanShellConfig, clearAuthData, cloneRepo, detectInstallMethod, detectInstalledAgents, detectManifestType, discoverRepos, executeUninstall, executeUpgrade, expandTilde, fetchLatestVersion, gcRepos, getAgentConfig, getAllAgentConfigs, getAuthPath, getAuthStatus, getClonedRepoPath, getCommitDistance, getCommitSha, getConfigPath, getCurrentVersion, getMapEntry, getMetaPath, getMetaRoot, getNpmKeywords, getProjectMapPath, getProvider, getReferenceFileNameForSource, getReferencePath, getRepoPath, getRepoRoot, getRepoStatus, getShellConfigFiles, getToken, getTokenOrNull, installGlobalSkill, installReference, isLoggedIn, isReferenceInstalled, isRepoCloned, listProviders, listProvidersWithModels, listRepos, loadAuthData, loadConfig, matchDependenciesToReferences, matchDependenciesToReferencesWithRemoteCheck, parseDependencies, parseRepoInput, pruneRepos, readGlobalMap, refreshAccessToken, removeGlobalMapEntry, removeRepo, resolveDependencyRepo, resolveFromNpm, resolveReferenceKeywords, resolveRepoKey, saveAuthData, saveConfig, searchMap, toMetaDirName, toReferenceFileName, toReferenceName, updateAgentFiles, updateAllRepos, updateRepo, upsertGlobalMapEntry, validateProviderModel, writeGlobalMap, writeProjectMap };
318
318
  //# sourceMappingURL=internal.mjs.map
@@ -1,5 +1,5 @@
1
1
  import { f as Paths, l as toMetaDirName, o as getRepoRoot, p as expandTilde, s as loadConfig, u as toReferenceFileName } from "./config-DW8J4gl5.mjs";
2
- import { _ as upsertGlobalMapEntry, g as removeGlobalMapEntry, h as readGlobalMap, m as updateRepo, n as GitError, v as writeGlobalMap } from "./clone-DyLvmbJZ.mjs";
2
+ import { f as updateRepo, g as writeGlobalMap, h as upsertGlobalMapEntry, m as removeGlobalMapEntry, n as GitError, p as readGlobalMap } from "./clone-Z5ELU2fW.mjs";
3
3
  import { chmodSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
4
4
  import { basename, dirname, join, resolve } from "node:path";
5
5
  import { ModelsDevDataSchema, NpmPackageResponseSchema, WorkOSTokenResponseSchema } from "@offworld/types";
@@ -12,7 +12,7 @@ import { z } from "zod";
12
12
  * SDK Constants
13
13
  */
14
14
  /** SDK version - must match package.json */
15
- const VERSION = "0.3.3";
15
+ const VERSION = "0.3.5";
16
16
  /**
17
17
  * Default patterns to ignore when scanning repositories.
18
18
  * Includes directories, binary files, IDE configs, and build outputs.
@@ -745,10 +745,12 @@ function getAllAgentConfigs() {
745
745
  //#region src/dep-mappings.ts
746
746
  /**
747
747
  * Dependency name to GitHub repo resolution:
748
- * 1. Query npm registry for repository.url
749
- * 2. Fall back to FALLBACK_MAPPINGS for packages missing repository field
750
- * 3. Return unknown (caller handles)
748
+ * 1. Parse repo from dependency spec (git/https/github shorthand)
749
+ * 2. Query npm registry for repository.url
750
+ * 3. Fall back to FALLBACK_MAPPINGS for packages missing repository field
751
+ * 4. Return unknown (caller handles)
751
752
  */
753
+ const DEFAULT_NPM_FETCH_TIMEOUT_MS = 5e3;
752
754
  /**
753
755
  * Fallback mappings for packages where npm registry doesn't have repository.url.
754
756
  * Only add packages here that genuinely don't have the field set.
@@ -763,18 +765,36 @@ const FALLBACK_MAPPINGS = {
763
765
  * - git+https://github.com/owner/repo.git
764
766
  * - https://github.com/owner/repo
765
767
  * - git://github.com/owner/repo.git
768
+ * - https://github.com/owner/repo/tree/main
769
+ * - git@github.com:owner/repo.git
766
770
  * - github:owner/repo
767
771
  */
768
772
  function parseGitHubUrl(url) {
769
- for (const pattern of [/github\.com[/:]([\w-]+)\/([\w.-]+?)(?:\.git)?$/, /^github:([\w-]+)\/([\w.-]+)$/]) {
770
- const match = url.match(pattern);
771
- if (match) return `${match[1]}/${match[2]}`;
773
+ const cleaned = url.trim().replace(/^git\+/, "").split("#")[0]?.split("?")[0]?.trim();
774
+ if (!cleaned) return null;
775
+ for (const pattern of [/github\.com[/:]([\w.-]+)\/([\w.-]+)(?:\.git)?(?:[/?#].*)?$/, /^github:([\w.-]+)\/([\w.-]+)(?:[/?#].*)?$/]) {
776
+ const match = cleaned.match(pattern);
777
+ if (match) {
778
+ const owner = match[1];
779
+ const repo = match[2]?.replace(/\.git$/i, "");
780
+ if (!owner || !repo) return null;
781
+ return `${owner}/${repo}`;
782
+ }
772
783
  }
773
784
  return null;
774
785
  }
775
- async function fetchNpmPackage(packageName) {
786
+ function resolveFromSpec(spec) {
787
+ if (!spec) return null;
788
+ const trimmed = spec.trim();
789
+ if (!trimmed) return null;
790
+ if (!(trimmed.startsWith("github:") || trimmed.startsWith("git+") || trimmed.startsWith("git://") || trimmed.startsWith("https://") || trimmed.startsWith("http://") || trimmed.startsWith("ssh://") || trimmed.startsWith("git@"))) return null;
791
+ return parseGitHubUrl(trimmed);
792
+ }
793
+ async function fetchNpmPackage(packageName, timeoutMs = DEFAULT_NPM_FETCH_TIMEOUT_MS) {
794
+ const controller = new AbortController();
795
+ const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
776
796
  try {
777
- const res = await fetch(`https://registry.npmjs.org/${packageName}`);
797
+ const res = await fetch(`https://registry.npmjs.org/${packageName}`, { signal: controller.signal });
778
798
  if (!res.ok) return null;
779
799
  const json = await res.json();
780
800
  const result = NpmPackageResponseSchema.safeParse(json);
@@ -782,14 +802,16 @@ async function fetchNpmPackage(packageName) {
782
802
  return result.data;
783
803
  } catch {
784
804
  return null;
805
+ } finally {
806
+ clearTimeout(timeoutId);
785
807
  }
786
808
  }
787
809
  /**
788
810
  * Fallback to npm registry to extract repository.url.
789
811
  * Returns null if package not found, no repo field, or not a GitHub repo.
790
812
  */
791
- async function resolveFromNpm(packageName) {
792
- const pkg = await fetchNpmPackage(packageName);
813
+ async function resolveFromNpm(packageName, timeoutMs) {
814
+ const pkg = await fetchNpmPackage(packageName, timeoutMs);
793
815
  if (!pkg?.repository) return null;
794
816
  const repoUrl = typeof pkg.repository === "string" ? pkg.repository : pkg.repository.url;
795
817
  if (!repoUrl) return null;
@@ -808,22 +830,32 @@ async function getNpmKeywords(packageName) {
808
830
  }
809
831
  /**
810
832
  * Resolution order:
811
- * 1. Query npm registry for repository.url
812
- * 2. Check FALLBACK_MAPPINGS for packages missing repository field
813
- * 3. Return unknown
833
+ * 1. Parse repo from dependency spec (git/https/github shorthand)
834
+ * 2. Query npm registry for repository.url
835
+ * 3. Check FALLBACK_MAPPINGS for packages missing repository field
836
+ * 4. Return unknown
814
837
  */
815
- async function resolveDependencyRepo(dep) {
816
- const npmRepo = await resolveFromNpm(dep);
817
- if (npmRepo) return {
838
+ async function resolveDependencyRepo(dep, spec, options = {}) {
839
+ const { allowNpm = true, npmTimeoutMs } = options;
840
+ const specRepo = resolveFromSpec(spec);
841
+ if (specRepo) return {
818
842
  dep,
819
- repo: npmRepo,
820
- source: "npm"
821
- };
822
- if (dep in FALLBACK_MAPPINGS) return {
823
- dep,
824
- repo: FALLBACK_MAPPINGS[dep] ?? null,
825
- source: "fallback"
843
+ repo: specRepo,
844
+ source: "spec"
826
845
  };
846
+ if (allowNpm) {
847
+ const npmRepo = await resolveFromNpm(dep, npmTimeoutMs);
848
+ if (npmRepo) return {
849
+ dep,
850
+ repo: npmRepo,
851
+ source: "npm"
852
+ };
853
+ if (dep in FALLBACK_MAPPINGS) return {
854
+ dep,
855
+ repo: FALLBACK_MAPPINGS[dep] ?? null,
856
+ source: "fallback"
857
+ };
858
+ }
827
859
  return {
828
860
  dep,
829
861
  repo: null,
@@ -1460,34 +1492,37 @@ function matchDependenciesToReferences(resolvedDeps) {
1460
1492
  */
1461
1493
  async function matchDependenciesToReferencesWithRemoteCheck(resolvedDeps) {
1462
1494
  const { checkRemote } = await import("./sync-DuLJ5wla.mjs");
1463
- return await Promise.all(resolvedDeps.map(async (dep) => {
1495
+ const repoStatus = /* @__PURE__ */ new Map();
1496
+ const remoteChecks = [];
1497
+ for (const dep of resolvedDeps) {
1498
+ if (!dep.repo || repoStatus.has(dep.repo)) continue;
1499
+ if (isReferenceInstalled(dep.repo)) {
1500
+ repoStatus.set(dep.repo, "installed");
1501
+ continue;
1502
+ }
1503
+ repoStatus.set(dep.repo, "generate");
1504
+ remoteChecks.push((async () => {
1505
+ try {
1506
+ if ((await checkRemote(dep.repo)).exists) repoStatus.set(dep.repo, "remote");
1507
+ } catch {}
1508
+ })());
1509
+ }
1510
+ await Promise.all(remoteChecks);
1511
+ return resolvedDeps.map((dep) => {
1464
1512
  if (!dep.repo) return {
1465
1513
  dep: dep.dep,
1466
1514
  repo: null,
1467
1515
  status: "unknown",
1468
1516
  source: dep.source
1469
1517
  };
1470
- if (isReferenceInstalled(dep.repo)) return {
1471
- dep: dep.dep,
1472
- repo: dep.repo,
1473
- status: "installed",
1474
- source: dep.source
1475
- };
1476
- try {
1477
- if ((await checkRemote(dep.repo)).exists) return {
1478
- dep: dep.dep,
1479
- repo: dep.repo,
1480
- status: "remote",
1481
- source: dep.source
1482
- };
1483
- } catch {}
1518
+ const status = repoStatus.get(dep.repo) ?? "generate";
1484
1519
  return {
1485
1520
  dep: dep.dep,
1486
1521
  repo: dep.repo,
1487
- status: "generate",
1522
+ status,
1488
1523
  source: dep.source
1489
1524
  };
1490
- }));
1525
+ });
1491
1526
  }
1492
1527
 
1493
1528
  //#endregion
@@ -1553,12 +1588,11 @@ async function getRepoStatus(options = {}) {
1553
1588
  };
1554
1589
  }
1555
1590
  async function updateAllRepos(options = {}) {
1556
- const { pattern, dryRun = false, unshallow = false, onProgress } = options;
1591
+ const { pattern, dryRun = false, onProgress } = options;
1557
1592
  const map = readGlobalMap();
1558
1593
  const qualifiedNames = Object.keys(map.repos);
1559
1594
  const updated = [];
1560
1595
  const skipped = [];
1561
- const unshallowed = [];
1562
1596
  const errors = [];
1563
1597
  for (const qualifiedName of qualifiedNames) {
1564
1598
  const entry = map.repos[qualifiedName];
@@ -1575,15 +1609,11 @@ async function updateAllRepos(options = {}) {
1575
1609
  }
1576
1610
  onProgress?.(qualifiedName, "updating");
1577
1611
  try {
1578
- const result = await updateRepo(qualifiedName, { unshallow });
1579
- if (result.unshallowed) {
1580
- unshallowed.push(qualifiedName);
1581
- onProgress?.(qualifiedName, "unshallowed", "converted to full clone");
1582
- }
1612
+ const result = await updateRepo(qualifiedName);
1583
1613
  if (result.updated) {
1584
1614
  updated.push(qualifiedName);
1585
1615
  onProgress?.(qualifiedName, "updated", `${result.previousSha.slice(0, 7)} → ${result.currentSha.slice(0, 7)}`);
1586
- } else if (!result.unshallowed) {
1616
+ } else {
1587
1617
  skipped.push(qualifiedName);
1588
1618
  onProgress?.(qualifiedName, "skipped", "already up to date");
1589
1619
  }
@@ -1599,7 +1629,6 @@ async function updateAllRepos(options = {}) {
1599
1629
  return {
1600
1630
  updated,
1601
1631
  skipped,
1602
- unshallowed,
1603
1632
  errors
1604
1633
  };
1605
1634
  }
@@ -1861,4 +1890,4 @@ async function validateProviderModel(providerId, modelId) {
1861
1890
 
1862
1891
  //#endregion
1863
1892
  export { getAuthPath as A, resolveRepoKey as B, detectInstalledAgents as C, NotLoggedInError as D, AuthError as E, loadAuthData as F, getReferenceFileNameForSource as G, NotGitRepoError as H, refreshAccessToken as I, VERSION as J, parseRepoInput as K, saveAuthData as L, getToken as M, getTokenOrNull as N, TokenExpiredError as O, isLoggedIn as P, getMapEntry as R, agents as S, getAllAgentConfigs as T, PathNotFoundError as U, searchMap as V, RepoSourceError as W, resolveReferenceKeywords as _, discoverRepos as a, resolveDependencyRepo as b, pruneRepos as c, matchDependenciesToReferences as d, matchDependenciesToReferencesWithRemoteCheck as f, installReference as g, installGlobalSkill as h, validateProviderModel as i, getAuthStatus as j, clearAuthData as k, updateAllRepos as l, parseDependencies as m, listProviders as n, gcRepos as o, detectManifestType as p, DEFAULT_IGNORE_PATTERNS as q, listProvidersWithModels as r, getRepoStatus as s, getProvider as t, isReferenceInstalled as u, FALLBACK_MAPPINGS as v, getAgentConfig as w, resolveFromNpm as x, getNpmKeywords as y, getProjectMapPath as z };
1864
- //# sourceMappingURL=public-0579sBs9.mjs.map
1893
+ //# sourceMappingURL=public-CWnhJJ9J.mjs.map