agency-orchestrator 0.6.0 → 0.6.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.
Files changed (2) hide show
  1. package/dist/cli.js +32 -4
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -9,7 +9,7 @@
9
9
  * ao roles --agents-dir ./agents
10
10
  */
11
11
  import { readFileSync, existsSync } from 'node:fs';
12
- import { resolve } from 'node:path';
12
+ import { resolve, join, dirname } from 'node:path';
13
13
  import { execSync } from 'node:child_process';
14
14
  import { parseWorkflow, validateWorkflow } from './core/parser.js';
15
15
  import { buildDAG, formatDAG } from './core/dag.js';
@@ -234,9 +234,9 @@ async function handleCompose() {
234
234
  console.error(' --lang <zh|en> 语言 (默认自动检测 / auto-detect)');
235
235
  process.exit(1);
236
236
  }
237
- const provider = (getArgValue('--provider') || 'deepseek');
237
+ const provider = (getArgValue('--provider') || process.env.AO_PROVIDER || 'deepseek');
238
238
  const cliProviders = ['claude-code', 'gemini-cli', 'copilot-cli', 'codex-cli', 'openclaw-cli', 'hermes-cli'];
239
- const model = getArgValue('--model') || (cliProviders.includes(provider) ? '' :
239
+ const model = getArgValue('--model') || process.env.AO_MODEL || (cliProviders.includes(provider) ? '' :
240
240
  provider === 'deepseek' ? 'deepseek-chat' :
241
241
  provider === 'claude' ? 'claude-sonnet-4-20250514' :
242
242
  'gpt-4o');
@@ -526,16 +526,32 @@ function parseInputArgs() {
526
526
  * 2. ./agency-agents (英文角色,ao init --lang en 下载的)
527
527
  * 3. ../agency-agents-zh 或 ../agency-agents (同级目录)
528
528
  * 4. ./agents (自定义)
529
+ * 5. node_modules/agency-agents-zh (npm 依赖,全局安装时)
530
+ * 6. 包内置 agency-agents/ (随 npm 包分发,与 dist/ 同级)
529
531
  *
530
532
  * @param preferLang 优先语言,影响搜索顺序
531
533
  */
532
534
  function resolveAgentsDir(preferLang) {
535
+ // scriptDir = dist/ inside the installed package
536
+ const scriptDir = dirname(new URL(import.meta.url).pathname);
533
537
  const zhFirst = [
534
538
  './agency-agents-zh',
535
539
  './agency-agents',
536
540
  '../agency-agents-zh',
537
541
  '../agency-agents',
538
542
  './agents',
543
+ // npm 依赖 (cwd/node_modules)
544
+ './node_modules/agency-agents-zh',
545
+ './node_modules/agency-agents',
546
+ // npm 依赖 (包自身的 node_modules,全局安装时)
547
+ join(scriptDir, '..', 'node_modules', 'agency-agents-zh'),
548
+ join(scriptDir, '..', 'node_modules', 'agency-agents'),
549
+ // hoisted node_modules (npm 有时会提升依赖)
550
+ join(scriptDir, '..', '..', 'node_modules', 'agency-agents-zh'),
551
+ join(scriptDir, '..', '..', 'node_modules', 'agency-agents'),
552
+ // 包内置 agency-agents/ (与 dist/ 同级)
553
+ join(scriptDir, '..', 'agency-agents-zh'),
554
+ join(scriptDir, '..', 'agency-agents'),
539
555
  ];
540
556
  const enFirst = [
541
557
  './agency-agents',
@@ -543,12 +559,24 @@ function resolveAgentsDir(preferLang) {
543
559
  '../agency-agents',
544
560
  '../agency-agents-zh',
545
561
  './agents',
562
+ // npm 依赖 (cwd/node_modules)
563
+ './node_modules/agency-agents',
564
+ './node_modules/agency-agents-zh',
565
+ // npm 依赖 (包自身的 node_modules,全局安装时)
566
+ join(scriptDir, '..', 'node_modules', 'agency-agents'),
567
+ join(scriptDir, '..', 'node_modules', 'agency-agents-zh'),
568
+ // hoisted node_modules
569
+ join(scriptDir, '..', '..', 'node_modules', 'agency-agents'),
570
+ join(scriptDir, '..', '..', 'node_modules', 'agency-agents-zh'),
571
+ // 包内置
572
+ join(scriptDir, '..', 'agency-agents'),
573
+ join(scriptDir, '..', 'agency-agents-zh'),
546
574
  ];
547
575
  const candidates = preferLang === 'en' ? enFirst : zhFirst;
548
576
  for (const dir of candidates) {
549
577
  const full = resolve(dir);
550
578
  if (existsSync(full))
551
- return dir;
579
+ return full;
552
580
  }
553
581
  return preferLang === 'en' ? './agency-agents' : './agency-agents-zh';
554
582
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agency-orchestrator",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
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",