@love-moon/ai-sdk 0.4.1 → 0.4.2
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,11 @@
|
|
|
1
1
|
# @love-moon/ai-sdk
|
|
2
2
|
|
|
3
|
+
## 0.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e8936fb: Upgrade the GitHub Copilot SDK permission protocol so Copilot-backed tasks auto-approve tool calls with current Copilot CLI releases instead of failing with `unexpected user permission response`.
|
|
8
|
+
|
|
3
9
|
## 0.4.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -371,7 +371,7 @@ function resolveClientOptions(opts) {
|
|
|
371
371
|
useLoggedInUser: explicitGithubToken
|
|
372
372
|
? opts.clientOptions?.useLoggedInUser
|
|
373
373
|
: opts.clientOptions?.useLoggedInUser ?? true,
|
|
374
|
-
...(opts.githubToken ? {
|
|
374
|
+
...(opts.githubToken ? { gitHubToken: opts.githubToken } : {}),
|
|
375
375
|
};
|
|
376
376
|
if (options.cliPath === undefined &&
|
|
377
377
|
options.cliUrl === undefined &&
|
|
@@ -384,7 +384,7 @@ function resolveClientOptions(opts) {
|
|
|
384
384
|
return options;
|
|
385
385
|
}
|
|
386
386
|
function resolveExplicitGithubToken(opts) {
|
|
387
|
-
return opts.githubToken ?? opts.clientOptions?.
|
|
387
|
+
return opts.githubToken ?? opts.clientOptions?.gitHubToken;
|
|
388
388
|
}
|
|
389
389
|
function hasExplicitCopilotCliPathEnv(env) {
|
|
390
390
|
return Boolean(typeof env?.COPILOT_CLI_PATH === "string" && env.COPILOT_CLI_PATH.trim());
|
|
@@ -472,7 +472,7 @@ function resolveKnownGitHubHost(rawHost) {
|
|
|
472
472
|
return host || envHost || undefined;
|
|
473
473
|
}
|
|
474
474
|
function resolveGitHubLoginToken(opts) {
|
|
475
|
-
return opts.githubToken ?? opts.clientOptions?.
|
|
475
|
+
return opts.githubToken ?? opts.clientOptions?.gitHubToken ?? process.env.GITHUB_TOKEN;
|
|
476
476
|
}
|
|
477
477
|
async function fetchCopilotUserQuota(authInfo, opts, doFetch, timeoutMs) {
|
|
478
478
|
if (!timeoutMs || timeoutMs <= 0)
|
|
@@ -405,10 +405,10 @@ function buildCopilotClientOptions(options, cwd, env) {
|
|
|
405
405
|
const explicitGithubToken = typeof options.githubToken === "string" && options.githubToken.trim()
|
|
406
406
|
? options.githubToken.trim()
|
|
407
407
|
: "";
|
|
408
|
-
if (clientOptions.
|
|
409
|
-
clientOptions.
|
|
408
|
+
if (clientOptions.gitHubToken === undefined && explicitGithubToken) {
|
|
409
|
+
clientOptions.gitHubToken = explicitGithubToken;
|
|
410
410
|
}
|
|
411
|
-
const hasExplicitGithubToken = typeof clientOptions.
|
|
411
|
+
const hasExplicitGithubToken = typeof clientOptions.gitHubToken === "string" && clientOptions.gitHubToken.trim();
|
|
412
412
|
if (clientOptions.useLoggedInUser === undefined && typeof options.useLoggedInUser === "boolean") {
|
|
413
413
|
clientOptions.useLoggedInUser = options.useLoggedInUser;
|
|
414
414
|
}
|
|
@@ -908,7 +908,7 @@ export class CopilotSdkSession extends EventEmitter {
|
|
|
908
908
|
}
|
|
909
909
|
const permissionHandler = typeof sdkModule.approveAll === "function"
|
|
910
910
|
? sdkModule.approveAll
|
|
911
|
-
: () => ({ kind: "
|
|
911
|
+
: () => ({ kind: "approve-once" });
|
|
912
912
|
const clientOptions = buildCopilotClientOptions(this.options, this.cwd, this.env);
|
|
913
913
|
this.client = new sdkModule.CopilotClient(clientOptions);
|
|
914
914
|
const cleanupIfClosedDuringBoot = async (session = null) => {
|
package/dist/resume/copilot.js
CHANGED
|
@@ -116,13 +116,13 @@ async function buildCopilotClientOptions(options = {}) {
|
|
|
116
116
|
clientOptions.cliArgs = cliLaunch.cliArgs;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
const explicitGithubToken = typeof clientOptions.
|
|
120
|
-
? clientOptions.
|
|
119
|
+
const explicitGithubToken = typeof clientOptions.gitHubToken === "string" && clientOptions.gitHubToken.trim()
|
|
120
|
+
? clientOptions.gitHubToken.trim()
|
|
121
121
|
: typeof options.githubToken === "string" && options.githubToken.trim()
|
|
122
122
|
? options.githubToken.trim()
|
|
123
123
|
: "";
|
|
124
|
-
if (clientOptions.
|
|
125
|
-
clientOptions.
|
|
124
|
+
if (clientOptions.gitHubToken === undefined && explicitGithubToken) {
|
|
125
|
+
clientOptions.gitHubToken = explicitGithubToken;
|
|
126
126
|
}
|
|
127
127
|
if (clientOptions.useLoggedInUser === undefined && typeof options.useLoggedInUser === "boolean") {
|
|
128
128
|
clientOptions.useLoggedInUser = options.useLoggedInUser;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@love-moon/ai-sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/lovemoon-ai/conductor.git"
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@anthropic-ai/claude-agent-sdk": "^0.2.72",
|
|
28
|
-
"@github/copilot-sdk": "^0.
|
|
28
|
+
"@github/copilot-sdk": "^0.3.0",
|
|
29
29
|
"@opencode-ai/sdk": "^1.2.25",
|
|
30
30
|
"js-yaml": "^4.1.1",
|
|
31
31
|
"yaml": "^2.5.1",
|
|
32
32
|
"zod": "^4.1.5"
|
|
33
33
|
},
|
|
34
34
|
"optionalDependencies": {
|
|
35
|
-
"@love-moon/chat-web": "^0.4.
|
|
35
|
+
"@love-moon/chat-web": "^0.4.2"
|
|
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": "
|
|
42
|
+
"gitCommitId": "23fc1c2"
|
|
43
43
|
}
|