@soleri/cli 1.12.5 → 8.0.0

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 (38) hide show
  1. package/dist/commands/add-pack.d.ts +2 -0
  2. package/dist/commands/add-pack.js +154 -0
  3. package/dist/commands/add-pack.js.map +1 -0
  4. package/dist/commands/agent.js +151 -2
  5. package/dist/commands/agent.js.map +1 -1
  6. package/dist/commands/cognee.d.ts +10 -0
  7. package/dist/commands/cognee.js +364 -0
  8. package/dist/commands/cognee.js.map +1 -0
  9. package/dist/commands/create.js +63 -5
  10. package/dist/commands/create.js.map +1 -1
  11. package/dist/commands/dev.js +104 -17
  12. package/dist/commands/dev.js.map +1 -1
  13. package/dist/commands/install.js +70 -18
  14. package/dist/commands/install.js.map +1 -1
  15. package/dist/commands/telegram.d.ts +10 -0
  16. package/dist/commands/telegram.js +423 -0
  17. package/dist/commands/telegram.js.map +1 -0
  18. package/dist/commands/uninstall.js +35 -6
  19. package/dist/commands/uninstall.js.map +1 -1
  20. package/dist/main.js +6 -0
  21. package/dist/main.js.map +1 -1
  22. package/dist/prompts/create-wizard.js +87 -6
  23. package/dist/prompts/create-wizard.js.map +1 -1
  24. package/dist/utils/agent-context.d.ts +9 -2
  25. package/dist/utils/agent-context.js +32 -0
  26. package/dist/utils/agent-context.js.map +1 -1
  27. package/package.json +1 -1
  28. package/src/commands/add-pack.ts +170 -0
  29. package/src/commands/agent.ts +174 -3
  30. package/src/commands/cognee.ts +419 -0
  31. package/src/commands/create.ts +90 -6
  32. package/src/commands/dev.ts +114 -18
  33. package/src/commands/install.ts +136 -18
  34. package/src/commands/telegram.ts +488 -0
  35. package/src/commands/uninstall.ts +41 -7
  36. package/src/main.ts +6 -0
  37. package/src/prompts/create-wizard.ts +93 -7
  38. package/src/utils/agent-context.ts +39 -2
@@ -424,27 +424,112 @@ export async function runCreateWizard(initialName?: string): Promise<AgentConfig
424
424
  const setupTarget = await p.select({
425
425
  message: 'Setup target',
426
426
  options: [
427
+ {
428
+ value: 'opencode',
429
+ label: 'OpenCode',
430
+ hint: 'OpenCode with Claude Max subscription (default)',
431
+ },
427
432
  {
428
433
  value: 'claude',
429
434
  label: 'Claude Code',
430
- hint: 'Generate/setup Claude integrations (default)',
435
+ hint: 'Claude Code CLI integrations',
431
436
  },
432
437
  {
433
438
  value: 'codex',
434
439
  label: 'Codex',
435
- hint: 'Generate/setup Codex integrations',
440
+ hint: 'Codex integrations',
436
441
  },
437
442
  {
438
- value: 'both',
439
- label: 'Both',
440
- hint: 'Generate/setup for Claude Code and Codex',
443
+ value: 'all',
444
+ label: 'All',
445
+ hint: 'OpenCode + Claude Code + Codex',
441
446
  },
442
447
  ],
443
- initialValue: 'claude',
448
+ initialValue: 'opencode',
444
449
  });
445
450
 
446
451
  if (p.isCancel(setupTarget)) return null;
447
452
 
453
+ // ─── Step 13: Model selection ────────────────────────────
454
+ p.note(
455
+ [
456
+ 'Claude Max models are free with a Claude Max subscription.',
457
+ 'API models require provider keys in .opencode.json under "providers".',
458
+ 'You can switch models anytime in OpenCode with ctrl+o.',
459
+ ].join('\n'),
460
+ 'Model Selection',
461
+ );
462
+
463
+ const model = await p.select({
464
+ message: 'Primary model (can change anytime with ctrl+o)',
465
+ options: [
466
+ // ── Free with Claude Max ──
467
+ {
468
+ value: 'claude-code-sonnet-4',
469
+ label: 'Claude 4 Sonnet (Max)',
470
+ hint: 'Free — balanced speed + quality (default)',
471
+ },
472
+ {
473
+ value: 'claude-code-opus-4',
474
+ label: 'Claude 4 Opus (Max)',
475
+ hint: 'Free — most capable, slower',
476
+ },
477
+ {
478
+ value: 'claude-code-3.5-haiku',
479
+ label: 'Claude 3.5 Haiku (Max)',
480
+ hint: 'Free — fastest Claude model',
481
+ },
482
+ // ── Anthropic API ──
483
+ {
484
+ value: 'claude-4-sonnet',
485
+ label: 'Claude 4 Sonnet (API)',
486
+ hint: 'Anthropic API key required',
487
+ },
488
+ {
489
+ value: 'claude-4-opus',
490
+ label: 'Claude 4 Opus (API)',
491
+ hint: 'Anthropic API key required',
492
+ },
493
+ // ── OpenAI ──
494
+ {
495
+ value: 'gpt-4.1',
496
+ label: 'GPT 4.1',
497
+ hint: 'OpenAI API key required',
498
+ },
499
+ {
500
+ value: 'o4-mini',
501
+ label: 'o4-mini',
502
+ hint: 'OpenAI API key — reasoning model',
503
+ },
504
+ // ── Google ──
505
+ {
506
+ value: 'gemini-2.5',
507
+ label: 'Gemini 2.5 Pro',
508
+ hint: 'Google API key required',
509
+ },
510
+ {
511
+ value: 'gemini-2.5-flash',
512
+ label: 'Gemini 2.5 Flash',
513
+ hint: 'Google API key — fast + cheap',
514
+ },
515
+ // ── Groq ──
516
+ {
517
+ value: 'llama-3.3-70b-versatile',
518
+ label: 'Llama 3.3 70B (Groq)',
519
+ hint: 'Groq API key — open source, fast',
520
+ },
521
+ // ── xAI ──
522
+ {
523
+ value: 'grok-3-beta',
524
+ label: 'Grok 3',
525
+ hint: 'xAI API key required',
526
+ },
527
+ ],
528
+ initialValue: 'claude-code-sonnet-4',
529
+ });
530
+
531
+ if (p.isCancel(model)) return null;
532
+
448
533
  return {
449
534
  id,
450
535
  name,
@@ -456,6 +541,7 @@ export async function runCreateWizard(initialName?: string): Promise<AgentConfig
456
541
  greeting,
457
542
  outputDir,
458
543
  skills: selectedSkills,
459
- setupTarget: setupTarget as 'claude' | 'codex' | 'both',
544
+ model: model as string,
545
+ setupTarget: setupTarget as 'claude' | 'codex' | 'opencode' | 'all',
460
546
  };
461
547
  }
@@ -1,24 +1,52 @@
1
1
  /**
2
2
  * Detect and validate an agent project in the current working directory.
3
+ * Supports both file-tree agents (agent.yaml) and legacy TS agents (package.json).
3
4
  */
4
5
  import { existsSync, readFileSync } from 'node:fs';
5
6
  import { join, resolve } from 'node:path';
7
+ import { parse as parseYaml } from 'yaml';
6
8
 
7
- interface AgentContext {
9
+ export type AgentFormat = 'filetree' | 'typescript';
10
+
11
+ export interface AgentContext {
8
12
  agentPath: string;
9
13
  agentId: string;
10
14
  packageName: string;
11
15
  hasBrain: boolean;
16
+ /** Agent format: 'filetree' (v7+) or 'typescript' (legacy) */
17
+ format: AgentFormat;
12
18
  }
13
19
 
14
20
  /**
15
21
  * Detect an agent in the given directory.
22
+ * Checks for file-tree agent (agent.yaml) first, then legacy TS agent (package.json).
16
23
  * Returns null if the directory is not a valid agent project.
17
24
  */
18
25
  export function detectAgent(dir?: string): AgentContext | null {
19
26
  const agentPath = resolve(dir ?? process.cwd());
20
- const pkgPath = join(agentPath, 'package.json');
21
27
 
28
+ // v7: File-tree agent (agent.yaml)
29
+ const yamlPath = join(agentPath, 'agent.yaml');
30
+ if (existsSync(yamlPath)) {
31
+ try {
32
+ const yaml = parseYaml(readFileSync(yamlPath, 'utf-8'));
33
+ const id = yaml?.id;
34
+ if (typeof id === 'string' && id.length > 0) {
35
+ return {
36
+ agentPath,
37
+ agentId: id,
38
+ packageName: id,
39
+ hasBrain: true, // file-tree agents always have brain via engine
40
+ format: 'filetree',
41
+ };
42
+ }
43
+ } catch {
44
+ // Invalid YAML — fall through to legacy detection
45
+ }
46
+ }
47
+
48
+ // Legacy: TypeScript agent (package.json with -mcp suffix)
49
+ const pkgPath = join(agentPath, 'package.json');
22
50
  if (!existsSync(pkgPath)) return null;
23
51
 
24
52
  try {
@@ -31,8 +59,17 @@ export function detectAgent(dir?: string): AgentContext | null {
31
59
  agentId: name.replace(/-mcp$/, ''),
32
60
  packageName: name,
33
61
  hasBrain: existsSync(join(agentPath, 'src', 'brain')),
62
+ format: 'typescript',
34
63
  };
35
64
  } catch {
36
65
  return null;
37
66
  }
38
67
  }
68
+
69
+ /**
70
+ * Detect a file-tree agent specifically (agent.yaml only).
71
+ */
72
+ export function detectFileTreeAgent(dir?: string): AgentContext | null {
73
+ const ctx = detectAgent(dir);
74
+ return ctx?.format === 'filetree' ? ctx : null;
75
+ }