@love-moon/ai-sdk 0.5.1 → 0.6.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.
- package/CHANGELOG.md +25 -0
- package/dist/providers/claude-agent-sdk-session.js +12 -1
- package/dist/shared.d.ts +1 -0
- package/dist/shared.js +35 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @love-moon/ai-sdk
|
|
2
2
|
|
|
3
|
+
## 0.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 650fc55: fix: upgrade @anthropic-ai/claude-agent-sdk and honor `--effort` from `allow_cli_list` commands
|
|
8
|
+
|
|
9
|
+
The bundled `cli.js` shipped by `@anthropic-ai/claude-agent-sdk@^0.2.72` was
|
|
10
|
+
based on Claude Code 2.1.72, which predates the `fable` model alias. Users
|
|
11
|
+
configuring `claude --model fable --effort low` in their `allow_cli_list` saw
|
|
12
|
+
runs fail with `There's an issue with the selected model (fable). It may not
|
|
13
|
+
exist or you may not have access to it.` even though their system-installed
|
|
14
|
+
`claude` accepted the alias.
|
|
15
|
+
|
|
16
|
+
- Bump `@anthropic-ai/claude-agent-sdk` to `^0.3.173`, whose platform-specific
|
|
17
|
+
binary packages ship Claude Code 2.1.173 and recognize the `fable` alias.
|
|
18
|
+
- `ClaudeAgentSdkSession` now lifts `--effort` out of the configured
|
|
19
|
+
`commandLine` when the caller did not pass an explicit `options.effort`, so
|
|
20
|
+
`claude --model fable --effort low` actually propagates the effort level to
|
|
21
|
+
the SDK. Explicit `options.effort` still wins.
|
|
22
|
+
- Add reusable `extractLongFlagFromCommandLine` helper in `shared.js` for other
|
|
23
|
+
providers that need to lift backend-specific flags out of their command
|
|
24
|
+
string.
|
|
25
|
+
|
|
26
|
+
## 0.6.0
|
|
27
|
+
|
|
3
28
|
## 0.5.1
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from "node:events";
|
|
2
2
|
import { CLAUDE_AGENT_SDK_VARIANT as CLAUDE_PROVIDER_VARIANT } from "../built-in-backends.js";
|
|
3
|
-
import { emitLog, getBoundedEnvInt, isGoalStatus, loadEnvConfig, normalizeLogger, proxyToEnv, sanitizeForLog, } from "../shared.js";
|
|
3
|
+
import { emitLog, extractLongFlagFromCommandLine, getBoundedEnvInt, isGoalStatus, loadEnvConfig, normalizeLogger, proxyToEnv, sanitizeForLog, } from "../shared.js";
|
|
4
4
|
const DEFAULT_TURN_DEADLINE_MS = 12 * 60 * 1000;
|
|
5
5
|
const MIN_TURN_DEADLINE_MS = 30 * 1000;
|
|
6
6
|
const MAX_TURN_DEADLINE_MS = 30 * 60 * 1000;
|
|
@@ -136,6 +136,17 @@ export class ClaudeAgentSdkSession extends EventEmitter {
|
|
|
136
136
|
constructor(backend, options = {}) {
|
|
137
137
|
super();
|
|
138
138
|
this.backend = normalizeClaudeBackend(backend);
|
|
139
|
+
// Lift `--effort` out of the configured allow_cli_list command string
|
|
140
|
+
// when the caller didn't pass it as a structured option. This keeps
|
|
141
|
+
// claude-specific flags out of the generic fire/serve-ai layer while
|
|
142
|
+
// still honoring user config like `claude --model fable --effort low`.
|
|
143
|
+
// An explicit `options.effort` always wins.
|
|
144
|
+
if (options.effort === undefined && typeof options.commandLine === "string") {
|
|
145
|
+
const effortFromCommandLine = extractLongFlagFromCommandLine(options.commandLine, "effort");
|
|
146
|
+
if (effortFromCommandLine) {
|
|
147
|
+
options = { ...options, effort: effortFromCommandLine };
|
|
148
|
+
}
|
|
149
|
+
}
|
|
139
150
|
this.options = options;
|
|
140
151
|
this.logger = normalizeLogger(options.logger);
|
|
141
152
|
this.cwd =
|
package/dist/shared.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export function parseCommandParts(commandLine: any): {
|
|
|
26
26
|
command: string;
|
|
27
27
|
args: string[];
|
|
28
28
|
};
|
|
29
|
+
export function extractLongFlagFromCommandLine(commandLine: any, flag: any): string;
|
|
29
30
|
export function resolveConductorConfigPath(configFilePath: any): any;
|
|
30
31
|
export function loadYamlConfig(configFilePath: any): any;
|
|
31
32
|
export function loadAllowCliList(configFilePath: any): any;
|
package/dist/shared.js
CHANGED
|
@@ -244,6 +244,41 @@ export function parseCommandParts(commandLine) {
|
|
|
244
244
|
args: parts.slice(1),
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
|
+
// Read a long-flag value (`--flag value` or `--flag=value`) out of an
|
|
248
|
+
// allow_cli_list command string. Returns "" if absent or empty. Provider
|
|
249
|
+
// session classes use this to lift backend-specific flags (e.g. claude's
|
|
250
|
+
// `--effort`, codex's `-c`) out of the configured command without having to
|
|
251
|
+
// bubble them up through the fire/serve-ai layers.
|
|
252
|
+
export function extractLongFlagFromCommandLine(commandLine, flag) {
|
|
253
|
+
const normalized = typeof flag === "string" ? flag.trim() : "";
|
|
254
|
+
if (!normalized) {
|
|
255
|
+
return "";
|
|
256
|
+
}
|
|
257
|
+
let parts;
|
|
258
|
+
try {
|
|
259
|
+
const { command, args } = parseCommandParts(commandLine);
|
|
260
|
+
parts = command ? [command, ...args] : [];
|
|
261
|
+
}
|
|
262
|
+
catch {
|
|
263
|
+
return "";
|
|
264
|
+
}
|
|
265
|
+
const longFlag = `--${normalized}`;
|
|
266
|
+
const longFlagEq = `${longFlag}=`;
|
|
267
|
+
for (let index = 0; index < parts.length; index += 1) {
|
|
268
|
+
const token = String(parts[index] || "").trim();
|
|
269
|
+
if (!token) {
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
if (token === longFlag) {
|
|
273
|
+
const next = String(parts[index + 1] || "").trim();
|
|
274
|
+
return next || "";
|
|
275
|
+
}
|
|
276
|
+
if (token.startsWith(longFlagEq)) {
|
|
277
|
+
return token.slice(longFlagEq.length).trim();
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
return "";
|
|
281
|
+
}
|
|
247
282
|
export function resolveConductorConfigPath(configFilePath) {
|
|
248
283
|
const home = os.homedir();
|
|
249
284
|
return configFilePath || process.env.CONDUCTOR_CONFIG || path.join(home, ".conductor", "config.yaml");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@love-moon/ai-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/lovemoon-ai/conductor.git"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"prepublishOnly": "npm run build"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@anthropic-ai/claude-agent-sdk": "^0.
|
|
27
|
+
"@anthropic-ai/claude-agent-sdk": "^0.3.173",
|
|
28
28
|
"@github/copilot-sdk": "^0.3.0",
|
|
29
29
|
"@opencode-ai/sdk": "^1.2.25",
|
|
30
30
|
"js-yaml": "^4.1.1",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"zod": "^4.1.5"
|
|
33
33
|
},
|
|
34
34
|
"optionalDependencies": {
|
|
35
|
-
"@love-moon/chat-web": "^0.
|
|
35
|
+
"@love-moon/chat-web": "^0.6.1"
|
|
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": "707fffe"
|
|
43
43
|
}
|