allagents 1.11.0 → 1.11.1-next.1

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 (2) hide show
  1. package/dist/index.js +20 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -34744,6 +34744,9 @@ function buildSearchQueries(query, owner) {
34744
34744
  }
34745
34745
  function classifyApiError(status, body) {
34746
34746
  const msg = typeof body === "object" && body !== null && "message" in body ? String(body.message ?? "") : "";
34747
+ if (status === 401) {
34748
+ return new SkillSearchError("GitHub Code Search requires authentication. Run `gh auth login` or set GITHUB_TOKEN.", "api");
34749
+ }
34747
34750
  if (status === 403 && /rate limit/i.test(msg)) {
34748
34751
  return new SkillSearchError("GitHub Code Search rate limit exceeded. Authenticate with `gh auth login` or set GITHUB_TOKEN to raise the quota.", "rate-limit");
34749
34752
  }
@@ -34752,6 +34755,21 @@ function classifyApiError(status, body) {
34752
34755
  }
34753
34756
  return new SkillSearchError(`GitHub Code Search returned ${status}${msg ? `: ${msg}` : ""}.`, "api");
34754
34757
  }
34758
+ async function resolveGhToken() {
34759
+ const env2 = process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
34760
+ if (env2)
34761
+ return env2;
34762
+ try {
34763
+ const { execFile } = await import("node:child_process");
34764
+ return await new Promise((resolve15) => {
34765
+ execFile("gh", ["auth", "token"], { timeout: 3000 }, (err, stdout) => {
34766
+ resolve15(err ? undefined : stdout.trim() || undefined);
34767
+ });
34768
+ });
34769
+ } catch {
34770
+ return;
34771
+ }
34772
+ }
34755
34773
  function qualifiedName(item) {
34756
34774
  return item.namespace ? `${item.namespace}/${item.name}` : item.name;
34757
34775
  }
@@ -34826,7 +34844,7 @@ async function searchSkills(query, options2 = {}, deps = {}) {
34826
34844
  `));
34827
34845
  const page = options2.page ?? 1;
34828
34846
  const limit = options2.limit ?? 30;
34829
- const token = process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
34847
+ const token = await (deps.tokenResolver ?? resolveGhToken)();
34830
34848
  const queries = buildSearchQueries(query, options2.owner);
34831
34849
  const settled = await Promise.allSettled(queries.map((entry) => runOneQuery(entry.q, page, limit, token, fetchFn)));
34832
34850
  const primaryIdx = queries.findIndex((q3) => q3.priority === 4);
@@ -41853,7 +41871,7 @@ var package_default;
41853
41871
  var init_package = __esm(() => {
41854
41872
  package_default = {
41855
41873
  name: "allagents",
41856
- version: "1.11.0",
41874
+ version: "1.11.1-next.1",
41857
41875
  packageManager: "bun@1.3.12",
41858
41876
  description: "CLI tool for managing multi-repo AI agent workspaces with plugin synchronization",
41859
41877
  type: "module",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allagents",
3
- "version": "1.11.0",
3
+ "version": "1.11.1-next.1",
4
4
  "packageManager": "bun@1.3.12",
5
5
  "description": "CLI tool for managing multi-repo AI agent workspaces with plugin synchronization",
6
6
  "type": "module",