@love-moon/ai-sdk 0.7.1 → 0.7.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @love-moon/ai-sdk
2
2
 
3
+ ## 0.7.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 689fd07: Accept the current Copilot SDK token option spelling in quota helpers.
8
+
9
+ ## 0.7.2
10
+
3
11
  ## 0.7.1
4
12
 
5
13
  ## 0.7.0
@@ -30,6 +30,10 @@ interface CopilotClientLike {
30
30
  interface CopilotSdkModule {
31
31
  CopilotClient: new (options?: CopilotClientOptions) => CopilotClientLike;
32
32
  }
33
+ type CopilotClientOptionsWithLegacyToken = CopilotClientOptions & {
34
+ githubToken?: string;
35
+ gitHubToken?: string;
36
+ };
33
37
  interface ResolveBundledCopilotCliPathOptions {
34
38
  platform?: NodeJS.Platform | string;
35
39
  arch?: string;
@@ -47,7 +51,7 @@ export interface GetCopilotQuotaOptions {
47
51
  /** Explicit token to pass to the Copilot SDK; otherwise SDK auth discovery is used. */
48
52
  githubToken?: string;
49
53
  /** SDK client options. Useful for enterprise hosts or tests. */
50
- clientOptions?: CopilotClientOptions;
54
+ clientOptions?: CopilotClientOptionsWithLegacyToken;
51
55
  /** Override global fetch for GitHub login lookup tests. */
52
56
  fetcher?: typeof fetch;
53
57
  /** Override SDK module for tests. */
@@ -371,7 +371,10 @@ function resolveClientOptions(opts) {
371
371
  useLoggedInUser: explicitGithubToken
372
372
  ? opts.clientOptions?.useLoggedInUser
373
373
  : opts.clientOptions?.useLoggedInUser ?? true,
374
- ...(opts.githubToken ? { gitHubToken: opts.githubToken } : {}),
374
+ ...(explicitGithubToken ? {
375
+ githubToken: explicitGithubToken,
376
+ gitHubToken: explicitGithubToken,
377
+ } : {}),
375
378
  };
376
379
  if (options.cliPath === undefined &&
377
380
  options.cliUrl === undefined &&
@@ -384,7 +387,7 @@ function resolveClientOptions(opts) {
384
387
  return options;
385
388
  }
386
389
  function resolveExplicitGithubToken(opts) {
387
- return opts.githubToken ?? opts.clientOptions?.gitHubToken;
390
+ return opts.githubToken ?? opts.clientOptions?.githubToken ?? opts.clientOptions?.gitHubToken;
388
391
  }
389
392
  function hasExplicitCopilotCliPathEnv(env) {
390
393
  return Boolean(typeof env?.COPILOT_CLI_PATH === "string" && env.COPILOT_CLI_PATH.trim());
@@ -472,7 +475,10 @@ function resolveKnownGitHubHost(rawHost) {
472
475
  return host || envHost || undefined;
473
476
  }
474
477
  function resolveGitHubLoginToken(opts) {
475
- return opts.githubToken ?? opts.clientOptions?.gitHubToken ?? process.env.GITHUB_TOKEN;
478
+ return opts.githubToken
479
+ ?? opts.clientOptions?.githubToken
480
+ ?? opts.clientOptions?.gitHubToken
481
+ ?? process.env.GITHUB_TOKEN;
476
482
  }
477
483
  async function fetchCopilotUserQuota(authInfo, opts, doFetch, timeoutMs) {
478
484
  if (!timeoutMs || timeoutMs <= 0)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@love-moon/ai-sdk",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/lovemoon-ai/conductor.git"
@@ -32,12 +32,12 @@
32
32
  "zod": "^4.1.5"
33
33
  },
34
34
  "optionalDependencies": {
35
- "@love-moon/chat-web": "^0.7.1"
35
+ "@love-moon/chat-web": "^0.7.3"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/node": "^22.10.2",
39
39
  "tsx": "^4.20.6",
40
40
  "typescript": "^5.6.3"
41
41
  },
42
- "gitCommitId": "7e2be9c"
42
+ "gitCommitId": "8081263"
43
43
  }