agency-orchestrator 0.6.13 → 0.6.15
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/dist/cli.js
CHANGED
|
@@ -433,10 +433,12 @@ async function handleInit() {
|
|
|
433
433
|
if (cfgModel)
|
|
434
434
|
updates.AO_MODEL = cfgModel;
|
|
435
435
|
if (cfgBaseUrl) {
|
|
436
|
-
// Route to the env var the matching connector already reads
|
|
436
|
+
// Route to the env var the matching connector already reads.
|
|
437
|
+
// 每个 provider 写到自己专属的 BASE_URL env,避免 issue #16 的跨污染
|
|
437
438
|
const p = (cfgProvider || '').toLowerCase();
|
|
438
439
|
const urlVar = p === 'ollama' ? 'OLLAMA_BASE_URL' :
|
|
439
|
-
'
|
|
440
|
+
p === 'deepseek' ? 'DEEPSEEK_BASE_URL' :
|
|
441
|
+
'OPENAI_BASE_URL';
|
|
440
442
|
updates[urlVar] = cfgBaseUrl;
|
|
441
443
|
}
|
|
442
444
|
if (cfgApiKey) {
|
|
@@ -102,8 +102,14 @@ export class CLIBaseConnector {
|
|
|
102
102
|
const content = this.cfg.parseOutput
|
|
103
103
|
? this.cfg.parseOutput(stdout)
|
|
104
104
|
: stdout.trim();
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
// 空内容是严重错误(LLM 应当返回内容)。区分两类原因给具体 hint,避免上层
|
|
106
|
+
// 拿到空字符串后报出迷惑性的"无效 YAML"错误。
|
|
107
|
+
if (!content) {
|
|
108
|
+
const stderrSnippet = stderr.trim().slice(0, 400);
|
|
109
|
+
const hint = stderrSnippet
|
|
110
|
+
? `stderr: ${stderrSnippet}`
|
|
111
|
+
: `进程退出码 ${code} 但 stdout/stderr 都为空。可能原因: CLI 命令格式已变(参考 issue #14 hermes 的 chat -q → -z)/ agent 或 model 配置不对 / CLI 需要先认证。建议在终端直接跑一次:\n ${this.cfg.command} ${args.slice(0, 4).join(' ')}${args.length > 4 ? ' ...' : ''}\n 看真实输出再调整 ao 配置`;
|
|
112
|
+
reject(new Error(`${this.cfg.displayName} 返回空内容。${hint}`));
|
|
107
113
|
return;
|
|
108
114
|
}
|
|
109
115
|
// 检测 CLI 输出中的 API 错误(进程 exit 0 但内容是错误信息)
|
|
@@ -28,9 +28,11 @@ export function createConnector(config) {
|
|
|
28
28
|
case 'claude':
|
|
29
29
|
return new ClaudeConnector(config.api_key);
|
|
30
30
|
case 'deepseek':
|
|
31
|
+
// 不 fallback OPENAI_BASE_URL — issue #16: 用户设了 OPENAI_BASE_URL=openai.com 后切到
|
|
32
|
+
// deepseek 会用 OpenAI endpoint + DeepSeek key 调,得到 405。每个 provider 用自己专属 env
|
|
31
33
|
return new OpenAICompatibleConnector({
|
|
32
34
|
apiKey: config.api_key || process.env.DEEPSEEK_API_KEY,
|
|
33
|
-
baseUrl: config.base_url || process.env.
|
|
35
|
+
baseUrl: config.base_url || process.env.DEEPSEEK_BASE_URL || 'https://api.deepseek.com/v1',
|
|
34
36
|
});
|
|
35
37
|
case 'openai':
|
|
36
38
|
return new OpenAICompatibleConnector({
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
import type { LLMConnector, LLMResult, LLMConfig } from '../types.js';
|
|
8
8
|
export declare class OpenAICompatibleConnector implements LLMConnector {
|
|
9
9
|
private apiKey;
|
|
10
|
-
|
|
10
|
+
/** 只读暴露给外部 debug / 测试用,运行时不可变 */
|
|
11
|
+
readonly baseUrl: string;
|
|
11
12
|
constructor(options?: {
|
|
12
13
|
apiKey?: string;
|
|
13
14
|
baseUrl?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agency-orchestrator",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.15",
|
|
4
4
|
"description": "Multi-agent YAML workflow engine — 211 AI roles, auto DAG parallelism, zero code. One sentence → multiple AI roles collaborate → complete plan in minutes. 10 LLM providers, 7 need no API key.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"multi-agent",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"scripts": {
|
|
65
65
|
"build": "tsc",
|
|
66
66
|
"dev": "tsc --watch",
|
|
67
|
-
"test": "npx tsx test/run.ts && npx tsx test/condition.ts && npx tsx test/cli.ts && npx tsx test/compose.ts && npx tsx test/demo.ts && npx tsx test/e2e.ts && npx tsx test/e2e-condition.ts && npx tsx test/e2e-loop.ts && npx tsx test/mcp.ts",
|
|
67
|
+
"test": "npx tsx test/run.ts && npx tsx test/condition.ts && npx tsx test/cli.ts && npx tsx test/cli-base.ts && npx tsx test/compose.ts && npx tsx test/demo.ts && npx tsx test/factory-custom.ts && npx tsx test/step-llm.ts && npx tsx test/step-llm-yaml.ts && npx tsx test/stdin-limit.ts && npx tsx test/compose-name.ts && npx tsx test/e2e.ts && npx tsx test/e2e-condition.ts && npx tsx test/e2e-loop.ts && npx tsx test/mcp.ts",
|
|
68
68
|
"prepublishOnly": "npm run build"
|
|
69
69
|
},
|
|
70
70
|
"files": [
|