File size: 869 Bytes
908562b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// ─── Runtime Factory ─────────────────────────────────────────────────────────
import { EventBus } from '../../core/events/index.js';
import type { ProviderAdapter } from '../../core/provider/index.js';
import { resolveProvider } from './provider-resolver.js';

export interface CreateRuntimeOpts {
  provider: string;
  model?: string;
  skills: string[];
  verbose?: boolean;
  compact?: boolean;
}

export async function createRuntime(opts: CreateRuntimeOpts) {
  const eventBus = new EventBus();
  const provider = resolveProvider(opts.provider);
  const model = opts.model ?? (await provider.listModels())[0]?.id ?? 'unknown';

  return {
    runtime: null, // Chat mode doesn't use full runtime
    eventBus,
    provider,
    model,
  };
}