@a-company/paradigm 5.9.0 → 5.10.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 (29) hide show
  1. package/dist/{accept-orchestration-GX2YRWM4.js → accept-orchestration-UQLM7PTQ.js} +4 -4
  2. package/dist/{agent-loader-X7TDYLFL.js → agent-loader-TFIANSF4.js} +1 -1
  3. package/dist/agent-state-S5DAWPTF.js +24 -0
  4. package/dist/{chunk-3UCH56D5.js → chunk-4BLYIB7J.js} +270 -928
  5. package/dist/chunk-4L3UTYQX.js +677 -0
  6. package/dist/chunk-54LTTQBH.js +138 -0
  7. package/dist/chunk-5OUOLN6M.js +659 -0
  8. package/dist/{chunk-SDDCVUCV.js → chunk-CL7JSK52.js} +23 -0
  9. package/dist/{chunk-MA7G4CTI.js → chunk-RJE5G7WO.js} +27 -1
  10. package/dist/{chunk-EI32ZBE6.js → chunk-RTHA3XRE.js} +19 -672
  11. package/dist/{chunk-V7BZBBI6.js → chunk-VPPK3SY4.js} +1 -1
  12. package/dist/{chunk-WQITYKHM.js → chunk-YRZ5RPEB.js} +7 -7
  13. package/dist/{diff-RQLLNAFI.js → diff-D4X53HAC.js} +4 -4
  14. package/dist/{docs-AIY6VNF7.js → docs-QIYKO3BR.js} +1 -1
  15. package/dist/index.js +19 -19
  16. package/dist/mcp.js +140 -66
  17. package/dist/model-discovery-D2H3VBGC.js +8 -0
  18. package/dist/{nomination-engine-LLREC5BZ.js → nomination-engine-RV5CNO5B.js} +2 -2
  19. package/dist/{orchestrate-XZA33TJC.js → orchestrate-JLILBBJE.js} +4 -4
  20. package/dist/{reindex-U2HEB6GW.js → reindex-5LTD53ZC.js} +3 -2
  21. package/dist/{serve-QWWJP2EW.js → serve-CAH3PHE7.js} +1 -1
  22. package/dist/session-tracker-C4BMD5WG.js +13 -0
  23. package/dist/{session-work-log-KDOH4GER.js → session-work-log-MZ47OAPB.js} +1 -1
  24. package/dist/{shift-VJUGMADR.js → shift-D2JOHHBF.js} +33 -5
  25. package/dist/{spawn-AW6GDECS.js → spawn-RCHNXDHE.js} +4 -4
  26. package/dist/{team-7HG7XK5C.js → team-O5MIIFMA.js} +6 -5
  27. package/package.json +1 -1
  28. package/dist/{chunk-LSRABQIY.js → chunk-45MUDW6E.js} +3 -3
  29. /package/dist/{platform-server-U5L2G3EU.js → platform-server-H5YO3DQD.js} +0 -0
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  BackgroundOrchestrator
4
- } from "./chunk-WQITYKHM.js";
4
+ } from "./chunk-YRZ5RPEB.js";
5
5
  import {
6
6
  AGENT_MODEL_RECOMMENDATIONS,
7
7
  addActivity,
@@ -19,672 +19,19 @@ import {
19
19
  saveTeamState,
20
20
  setCurrentAgent
21
21
  } from "./chunk-PMXRGPRQ.js";
22
+ import {
23
+ ModelDiscovery
24
+ } from "./chunk-5OUOLN6M.js";
22
25
 
23
26
  // src/commands/team/index.ts
24
- import * as fs2 from "fs";
25
- import * as path3 from "path";
27
+ import * as fs from "fs";
28
+ import * as path2 from "path";
26
29
  import chalk2 from "chalk";
27
30
 
28
31
  // src/commands/team/configure-models.ts
29
32
  import prompts from "prompts";
30
33
  import chalk from "chalk";
31
-
32
- // src/core/model-discovery.ts
33
- import { exec } from "child_process";
34
- import { promisify } from "util";
35
- import * as fs from "fs";
36
34
  import * as path from "path";
37
- var execAsync = promisify(exec);
38
- var MANIFEST_URL = "https://raw.githubusercontent.com/ascend42/a-paradigm/main/models.json";
39
- var MANIFEST_CACHE_TTL = 7 * 24 * 60 * 60 * 1e3;
40
- var ModelDiscovery = class {
41
- cacheFile;
42
- manifestCacheFile;
43
- cacheTTL = 24 * 60 * 60 * 1e3;
44
- // 24 hours
45
- constructor(_rootDir) {
46
- this.cacheFile = path.join(_rootDir, ".paradigm", "model-cache.json");
47
- this.manifestCacheFile = path.join(_rootDir, ".paradigm", "model-manifest-cache.json");
48
- }
49
- /**
50
- * Fetch the remote model manifest (cached for 7 days).
51
- * Returns null on any failure — callers fall back to hardcoded presets.
52
- */
53
- async fetchManifest() {
54
- try {
55
- if (fs.existsSync(this.manifestCacheFile)) {
56
- const raw = fs.readFileSync(this.manifestCacheFile, "utf8");
57
- const cached = JSON.parse(raw);
58
- const age = Date.now() - new Date(cached._fetchedAt).getTime();
59
- if (age < MANIFEST_CACHE_TTL) {
60
- return cached;
61
- }
62
- }
63
- } catch {
64
- }
65
- try {
66
- const controller = new AbortController();
67
- const timeout = setTimeout(() => controller.abort(), 5e3);
68
- const response = await fetch(MANIFEST_URL, { signal: controller.signal });
69
- clearTimeout(timeout);
70
- if (!response.ok) return null;
71
- const manifest = await response.json();
72
- try {
73
- const dir = path.dirname(this.manifestCacheFile);
74
- if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
75
- fs.writeFileSync(this.manifestCacheFile, JSON.stringify({ ...manifest, _fetchedAt: (/* @__PURE__ */ new Date()).toISOString() }, null, 2));
76
- } catch {
77
- }
78
- return manifest;
79
- } catch {
80
- return null;
81
- }
82
- }
83
- /**
84
- * Get models for a provider from the remote manifest.
85
- * Returns null if manifest unavailable or provider not found.
86
- */
87
- async getManifestModels(provider) {
88
- const manifest = await this.fetchManifest();
89
- if (!manifest?.providers?.[provider]) return null;
90
- return manifest.providers[provider];
91
- }
92
- /**
93
- * Get environment-specific models from the remote manifest.
94
- * Returns null if manifest unavailable or environment not found.
95
- */
96
- async getManifestEnvironment(env) {
97
- const manifest = await this.fetchManifest();
98
- if (!manifest?.environments?.[env]) return null;
99
- const envConfig = manifest.environments[env];
100
- if (envConfig.models) {
101
- return envConfig.models;
102
- }
103
- if (envConfig.include) {
104
- const models = [];
105
- for (const providerName of envConfig.include) {
106
- const providerModels = manifest.providers?.[providerName];
107
- if (providerModels) {
108
- models.push(...providerModels);
109
- }
110
- }
111
- return models.length > 0 ? models : null;
112
- }
113
- return null;
114
- }
115
- /**
116
- * Discover available models
117
- */
118
- async discover() {
119
- const cached = this.loadCache();
120
- if (cached) return cached;
121
- const env = this.detectEnvironment();
122
- let result;
123
- switch (env) {
124
- case "cursor":
125
- result = await this.discoverCursorModels();
126
- break;
127
- case "claude-code":
128
- result = this.getClaudeCodeModels();
129
- break;
130
- case "vscode":
131
- result = await this.getVSCodeModels();
132
- break;
133
- case "multi-provider":
134
- result = await this.discoverMultiProviderModels();
135
- break;
136
- default:
137
- result = this.getFallbackModels();
138
- }
139
- this.saveCache(result);
140
- return result;
141
- }
142
- /**
143
- * Detect the current environment
144
- */
145
- detectEnvironment() {
146
- if (process.env.CLAUDE_CODE === "1" || process.env.TERM_PROGRAM === "claude") {
147
- return "claude-code";
148
- }
149
- if (process.env.TERM_PROGRAM === "cursor" || process.env.CURSOR_SESSION || process.env.CURSOR_TRACE_ID || // Cursor sets VSCODE_* vars but with cursor in the path
150
- process.env.VSCODE_CWD && process.env.VSCODE_CWD.toLowerCase().includes("cursor") || process.env.VSCODE_NLS_CONFIG && process.env.VSCODE_NLS_CONFIG.toLowerCase().includes("cursor") || // Check if running in Cursor's integrated terminal
151
- process.env.TERM_PROGRAM === "vscode" && process.env.VSCODE_GIT_ASKPASS_NODE?.toLowerCase().includes("cursor")) {
152
- return "cursor";
153
- }
154
- if (process.env.TERM_PROGRAM === "vscode" || process.env.VSCODE_PID) {
155
- return "vscode";
156
- }
157
- const providers = this.getAvailableProviders();
158
- if (providers.length > 0) {
159
- return "multi-provider";
160
- }
161
- return "fallback";
162
- }
163
- /**
164
- * Get list of providers with configured API keys
165
- */
166
- getAvailableProviders() {
167
- const providers = [];
168
- if (process.env.ANTHROPIC_API_KEY) providers.push("anthropic");
169
- if (process.env.OPENAI_API_KEY) providers.push("openai");
170
- if (process.env.GOOGLE_API_KEY || process.env.GOOGLE_GENERATIVE_AI_API_KEY) providers.push("google");
171
- if (process.env.XAI_API_KEY) providers.push("xai");
172
- if (process.env.MISTRAL_API_KEY) providers.push("mistral");
173
- if (process.env.DEEPSEEK_API_KEY) providers.push("deepseek");
174
- if (process.env.COHERE_API_KEY) providers.push("cohere");
175
- if (process.env.OPENROUTER_API_KEY) providers.push("openrouter");
176
- return providers;
177
- }
178
- /**
179
- * Discover models from all available providers
180
- */
181
- async discoverMultiProviderModels() {
182
- const providers = this.getAvailableProviders();
183
- const allModels = [];
184
- const discoveries = await Promise.allSettled(
185
- providers.map((provider) => this.discoverProviderModels(provider))
186
- );
187
- for (const result of discoveries) {
188
- if (result.status === "fulfilled" && result.value) {
189
- allModels.push(...result.value.models);
190
- }
191
- }
192
- if (allModels.length === 0) {
193
- return this.getFallbackModels();
194
- }
195
- return {
196
- source: "multi-provider",
197
- models: allModels,
198
- cached: false,
199
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
200
- };
201
- }
202
- /**
203
- * Discover models for a specific provider
204
- */
205
- async discoverProviderModels(provider) {
206
- switch (provider) {
207
- case "anthropic":
208
- return this.discoverAnthropicModels();
209
- case "openai":
210
- return this.discoverOpenAIModels();
211
- case "google":
212
- return this.discoverGoogleModels();
213
- case "xai":
214
- return this.discoverXAIModels();
215
- case "openrouter":
216
- return this.discoverOpenRouterModels();
217
- default:
218
- return null;
219
- }
220
- }
221
- /**
222
- * Discover Anthropic models via API
223
- */
224
- async discoverAnthropicModels() {
225
- try {
226
- const response = await fetch("https://api.anthropic.com/v1/models", {
227
- headers: {
228
- "x-api-key": process.env.ANTHROPIC_API_KEY,
229
- "anthropic-version": "2023-06-01"
230
- }
231
- });
232
- if (!response.ok) {
233
- return await this.getAnthropicPresets();
234
- }
235
- const data = await response.json();
236
- if (!data.data || data.data.length === 0) {
237
- return await this.getAnthropicPresets();
238
- }
239
- return {
240
- source: "anthropic-api",
241
- models: data.data.map((m) => ({
242
- id: m.id,
243
- name: m.display_name || this.formatModelName(m.id),
244
- provider: "anthropic",
245
- family: this.extractFamily(m.id, "claude")
246
- })),
247
- cached: false,
248
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
249
- };
250
- } catch {
251
- return await this.getAnthropicPresets();
252
- }
253
- }
254
- /**
255
- * Discover OpenAI models via API
256
- */
257
- async discoverOpenAIModels() {
258
- try {
259
- const response = await fetch("https://api.openai.com/v1/models", {
260
- headers: { "Authorization": `Bearer ${process.env.OPENAI_API_KEY}` }
261
- });
262
- if (!response.ok) {
263
- return await this.getOpenAIPresets();
264
- }
265
- const data = await response.json();
266
- if (!data.data) {
267
- return await this.getOpenAIPresets();
268
- }
269
- const chatModels = data.data.filter(
270
- (m) => m.id.includes("gpt-4") || m.id.includes("o1") || m.id.includes("o3") || m.id.includes("o4")
271
- );
272
- return {
273
- source: "openai",
274
- models: chatModels.map((m) => ({
275
- id: m.id,
276
- name: this.formatModelName(m.id),
277
- provider: "openai",
278
- family: this.extractFamily(m.id, "gpt")
279
- })),
280
- cached: false,
281
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
282
- };
283
- } catch {
284
- return await this.getOpenAIPresets();
285
- }
286
- }
287
- /**
288
- * Discover Google models via API
289
- */
290
- async discoverGoogleModels() {
291
- try {
292
- const apiKey = process.env.GOOGLE_API_KEY || process.env.GOOGLE_GENERATIVE_AI_API_KEY;
293
- const response = await fetch(
294
- `https://generativelanguage.googleapis.com/v1beta/models?key=${apiKey}`
295
- );
296
- if (!response.ok) {
297
- return await this.getGooglePresets();
298
- }
299
- const data = await response.json();
300
- if (!data.models) {
301
- return await this.getGooglePresets();
302
- }
303
- return {
304
- source: "google",
305
- models: data.models.filter((m) => m.name.includes("gemini")).map((m) => ({
306
- id: m.name.replace("models/", ""),
307
- name: m.displayName || this.formatModelName(m.name),
308
- provider: "google",
309
- family: "gemini"
310
- })),
311
- cached: false,
312
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
313
- };
314
- } catch {
315
- return await this.getGooglePresets();
316
- }
317
- }
318
- /**
319
- * Discover xAI/Grok models via API
320
- */
321
- async discoverXAIModels() {
322
- try {
323
- const response = await fetch("https://api.x.ai/v1/models", {
324
- headers: { "Authorization": `Bearer ${process.env.XAI_API_KEY}` }
325
- });
326
- if (!response.ok) {
327
- return await this.getXAIPresets();
328
- }
329
- const data = await response.json();
330
- if (!data.data) {
331
- return await this.getXAIPresets();
332
- }
333
- return {
334
- source: "xai",
335
- models: data.data.map((m) => ({
336
- id: m.id,
337
- name: m.id.includes("grok") ? `Grok ${m.id.split("-").pop()}` : m.id,
338
- provider: "xai",
339
- family: "grok"
340
- })),
341
- cached: false,
342
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
343
- };
344
- } catch {
345
- return await this.getXAIPresets();
346
- }
347
- }
348
- /**
349
- * Discover OpenRouter models via API
350
- */
351
- async discoverOpenRouterModels() {
352
- try {
353
- const response = await fetch("https://openrouter.ai/api/v1/models", {
354
- headers: { "Authorization": `Bearer ${process.env.OPENROUTER_API_KEY}` }
355
- });
356
- if (!response.ok) {
357
- return { source: "openrouter", models: [], cached: false, timestamp: (/* @__PURE__ */ new Date()).toISOString() };
358
- }
359
- const data = await response.json();
360
- if (!data.data) {
361
- return { source: "openrouter", models: [], cached: false, timestamp: (/* @__PURE__ */ new Date()).toISOString() };
362
- }
363
- return {
364
- source: "openrouter",
365
- models: data.data.slice(0, 30).map((m) => ({
366
- id: m.id,
367
- name: m.name || m.id,
368
- provider: m.id.split("/")[0] || "openrouter"
369
- })),
370
- cached: false,
371
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
372
- };
373
- } catch {
374
- return { source: "openrouter", models: [], cached: false, timestamp: (/* @__PURE__ */ new Date()).toISOString() };
375
- }
376
- }
377
- /**
378
- * Discover Cursor models
379
- */
380
- async discoverCursorModels() {
381
- try {
382
- const { stdout } = await execAsync("cursor agent models --json", { timeout: 5e3 });
383
- const models = JSON.parse(stdout);
384
- return {
385
- source: "cursor",
386
- models: models.map((m) => this.normalizeModel(m)),
387
- cached: false,
388
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
389
- };
390
- } catch {
391
- const manifest = await this.getManifestEnvironment("cursor");
392
- return {
393
- source: manifest ? "cursor-manifest" : "cursor",
394
- models: manifest || this.getCursorPresets(),
395
- cached: false,
396
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
397
- };
398
- }
399
- }
400
- /**
401
- * Get Claude Code models (fixed list)
402
- */
403
- getClaudeCodeModels() {
404
- return {
405
- source: "claude-code",
406
- models: [
407
- { id: "opus", name: "Claude Opus", provider: "anthropic", family: "claude" },
408
- { id: "sonnet", name: "Claude Sonnet", provider: "anthropic", family: "claude" },
409
- { id: "haiku", name: "Claude Haiku", provider: "anthropic", family: "claude" }
410
- ],
411
- cached: false,
412
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
413
- };
414
- }
415
- /**
416
- * Get VSCode/Copilot models
417
- */
418
- async getVSCodeModels() {
419
- const manifest = await this.getManifestEnvironment("vscode");
420
- if (manifest) {
421
- return { source: "vscode-manifest", models: manifest, cached: false, timestamp: (/* @__PURE__ */ new Date()).toISOString() };
422
- }
423
- return {
424
- source: "vscode",
425
- models: [
426
- { id: "gpt-4.1", name: "GPT-4.1", provider: "openai", family: "gpt-4.1" },
427
- { id: "gpt-4.1-mini", name: "GPT-4.1 Mini", provider: "openai", family: "gpt-4.1" },
428
- { id: "gpt-4.1-nano", name: "GPT-4.1 Nano", provider: "openai", family: "gpt-4.1" },
429
- { id: "o3", name: "OpenAI o3", provider: "openai", family: "o3" },
430
- { id: "o4-mini", name: "OpenAI o4 Mini", provider: "openai", family: "o4" },
431
- { id: "claude-sonnet-4-5-20250929", name: "Claude Sonnet 4.5", provider: "anthropic", family: "claude-4" }
432
- ],
433
- cached: false,
434
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
435
- };
436
- }
437
- /**
438
- * Get comprehensive preset models for Cursor
439
- */
440
- getCursorPresets() {
441
- return [
442
- // Anthropic Claude models
443
- { id: "claude-opus-4-6", name: "Claude Opus 4.6", provider: "anthropic", family: "claude-4" },
444
- { id: "claude-sonnet-4-5-20250929", name: "Claude Sonnet 4.5", provider: "anthropic", family: "claude-4" },
445
- { id: "claude-haiku-4-5-20251001", name: "Claude Haiku 4.5", provider: "anthropic", family: "claude-4" },
446
- // OpenAI GPT models
447
- { id: "gpt-4.1", name: "GPT-4.1", provider: "openai", family: "gpt-4.1" },
448
- { id: "gpt-4.1-mini", name: "GPT-4.1 Mini", provider: "openai", family: "gpt-4.1" },
449
- { id: "gpt-4.1-nano", name: "GPT-4.1 Nano", provider: "openai", family: "gpt-4.1" },
450
- { id: "o3", name: "OpenAI o3", provider: "openai", family: "o3" },
451
- { id: "o4-mini", name: "OpenAI o4 Mini", provider: "openai", family: "o4" },
452
- { id: "o3-mini", name: "OpenAI o3 Mini", provider: "openai", family: "o3" },
453
- // Google Gemini models
454
- { id: "gemini-2.5-pro", name: "Gemini 2.5 Pro", provider: "google", family: "gemini-2.5" },
455
- { id: "gemini-2.5-flash", name: "Gemini 2.5 Flash", provider: "google", family: "gemini-2.5" },
456
- { id: "gemini-2.0-flash", name: "Gemini 2.0 Flash", provider: "google", family: "gemini-2" },
457
- // xAI Grok models
458
- { id: "grok-3", name: "Grok 3", provider: "xai", family: "grok" },
459
- { id: "grok-3-mini", name: "Grok 3 Mini", provider: "xai", family: "grok" },
460
- // Meta Llama models
461
- { id: "llama-4-scout", name: "Llama 4 Scout", provider: "meta", family: "llama-4" },
462
- { id: "llama-4-maverick", name: "Llama 4 Maverick", provider: "meta", family: "llama-4" },
463
- // Mistral models
464
- { id: "mistral-large", name: "Mistral Large", provider: "mistral", family: "mistral" },
465
- { id: "codestral", name: "Codestral", provider: "mistral", family: "codestral" },
466
- // DeepSeek models
467
- { id: "deepseek-r1", name: "DeepSeek R1", provider: "deepseek", family: "deepseek" },
468
- { id: "deepseek-v3", name: "DeepSeek V3", provider: "deepseek", family: "deepseek" },
469
- // Cohere models
470
- { id: "command-r-plus", name: "Command R+", provider: "cohere", family: "command" },
471
- { id: "command-r", name: "Command R", provider: "cohere", family: "command" }
472
- ];
473
- }
474
- /**
475
- * Get Anthropic preset models (manifest → hardcoded)
476
- */
477
- async getAnthropicPresets() {
478
- const manifest = await this.getManifestModels("anthropic");
479
- if (manifest) {
480
- return { source: "anthropic-manifest", models: manifest, cached: false, timestamp: (/* @__PURE__ */ new Date()).toISOString() };
481
- }
482
- return {
483
- source: "anthropic-api",
484
- models: [
485
- { id: "claude-opus-4-6", name: "Claude Opus 4.6", provider: "anthropic", family: "claude-4" },
486
- { id: "claude-sonnet-4-5-20250929", name: "Claude Sonnet 4.5", provider: "anthropic", family: "claude-4" },
487
- { id: "claude-haiku-4-5-20251001", name: "Claude Haiku 4.5", provider: "anthropic", family: "claude-4" }
488
- ],
489
- cached: false,
490
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
491
- };
492
- }
493
- /**
494
- * Get OpenAI preset models (manifest → hardcoded)
495
- */
496
- async getOpenAIPresets() {
497
- const manifest = await this.getManifestModels("openai");
498
- if (manifest) {
499
- return { source: "openai-manifest", models: manifest, cached: false, timestamp: (/* @__PURE__ */ new Date()).toISOString() };
500
- }
501
- return {
502
- source: "openai",
503
- models: [
504
- { id: "gpt-4.1", name: "GPT-4.1", provider: "openai", family: "gpt-4.1" },
505
- { id: "gpt-4.1-mini", name: "GPT-4.1 Mini", provider: "openai", family: "gpt-4.1" },
506
- { id: "gpt-4.1-nano", name: "GPT-4.1 Nano", provider: "openai", family: "gpt-4.1" },
507
- { id: "o3", name: "OpenAI o3", provider: "openai", family: "o3" },
508
- { id: "o4-mini", name: "OpenAI o4 Mini", provider: "openai", family: "o4" },
509
- { id: "o3-mini", name: "OpenAI o3 Mini", provider: "openai", family: "o3" }
510
- ],
511
- cached: false,
512
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
513
- };
514
- }
515
- /**
516
- * Get Google preset models (manifest → hardcoded)
517
- */
518
- async getGooglePresets() {
519
- const manifest = await this.getManifestModels("google");
520
- if (manifest) {
521
- return { source: "google-manifest", models: manifest, cached: false, timestamp: (/* @__PURE__ */ new Date()).toISOString() };
522
- }
523
- return {
524
- source: "google",
525
- models: [
526
- { id: "gemini-2.5-pro", name: "Gemini 2.5 Pro", provider: "google", family: "gemini-2.5" },
527
- { id: "gemini-2.5-flash", name: "Gemini 2.5 Flash", provider: "google", family: "gemini-2.5" },
528
- { id: "gemini-2.0-flash", name: "Gemini 2.0 Flash", provider: "google", family: "gemini-2" }
529
- ],
530
- cached: false,
531
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
532
- };
533
- }
534
- /**
535
- * Get xAI preset models (manifest → hardcoded)
536
- */
537
- async getXAIPresets() {
538
- const manifest = await this.getManifestModels("xai");
539
- if (manifest) {
540
- return { source: "xai-manifest", models: manifest, cached: false, timestamp: (/* @__PURE__ */ new Date()).toISOString() };
541
- }
542
- return {
543
- source: "xai",
544
- models: [
545
- { id: "grok-3", name: "Grok 3", provider: "xai", family: "grok" },
546
- { id: "grok-3-mini", name: "Grok 3 Mini", provider: "xai", family: "grok" }
547
- ],
548
- cached: false,
549
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
550
- };
551
- }
552
- /**
553
- * Get fallback models (basic Claude models)
554
- */
555
- getFallbackModels() {
556
- return {
557
- source: "fallback",
558
- models: [
559
- { id: "opus", name: "Claude Opus", provider: "anthropic", family: "claude" },
560
- { id: "sonnet", name: "Claude Sonnet", provider: "anthropic", family: "claude" },
561
- { id: "haiku", name: "Claude Haiku", provider: "anthropic", family: "claude" }
562
- ],
563
- cached: false,
564
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
565
- };
566
- }
567
- /**
568
- * Normalize a model from external source
569
- */
570
- normalizeModel(model) {
571
- return {
572
- id: model.id,
573
- name: model.name || this.formatModelName(model.id),
574
- provider: model.provider || "unknown",
575
- family: model.family,
576
- capabilities: model.capabilities
577
- };
578
- }
579
- /**
580
- * Format a model ID into a human-readable name
581
- */
582
- formatModelName(id) {
583
- return id.replace(/-/g, " ").replace(/\b\w/g, (c) => c.toUpperCase()).replace(/(\d)([a-z])/gi, "$1 $2");
584
- }
585
- /**
586
- * Extract model family from ID
587
- */
588
- extractFamily(id, defaultFamily) {
589
- const patterns = [
590
- [/claude-4|claude-opus-4|claude-sonnet-4|claude-haiku-4/i, "claude-4"],
591
- [/claude-3\.5|claude-3-5/i, "claude-3.5"],
592
- [/claude-3/i, "claude-3"],
593
- [/gpt-4\.1/i, "gpt-4.1"],
594
- [/gpt-4o/i, "gpt-4o"],
595
- [/gpt-4/i, "gpt-4"],
596
- [/o4/i, "o4"],
597
- [/o3/i, "o3"],
598
- [/o1/i, "o1"],
599
- [/gemini-2\.5/i, "gemini-2.5"],
600
- [/gemini-2/i, "gemini-2"],
601
- [/gemini-1\.5/i, "gemini-1.5"],
602
- [/grok/i, "grok"],
603
- [/llama-4/i, "llama-4"],
604
- [/llama/i, "llama"],
605
- [/mistral/i, "mistral"]
606
- ];
607
- for (const [pattern, family] of patterns) {
608
- if (pattern.test(id)) {
609
- return family;
610
- }
611
- }
612
- return defaultFamily;
613
- }
614
- /**
615
- * Load cached models
616
- */
617
- loadCache() {
618
- try {
619
- if (!fs.existsSync(this.cacheFile)) {
620
- return null;
621
- }
622
- const content = fs.readFileSync(this.cacheFile, "utf8");
623
- const cached = JSON.parse(content);
624
- const cacheTime = new Date(cached.timestamp).getTime();
625
- if (Date.now() - cacheTime > this.cacheTTL) {
626
- return null;
627
- }
628
- return { ...cached, cached: true };
629
- } catch {
630
- return null;
631
- }
632
- }
633
- /**
634
- * Save models to cache
635
- */
636
- saveCache(result) {
637
- try {
638
- const dir = path.dirname(this.cacheFile);
639
- if (!fs.existsSync(dir)) {
640
- fs.mkdirSync(dir, { recursive: true });
641
- }
642
- fs.writeFileSync(this.cacheFile, JSON.stringify(result, null, 2));
643
- } catch {
644
- }
645
- }
646
- /**
647
- * Clear the cache
648
- */
649
- clearCache() {
650
- try {
651
- if (fs.existsSync(this.cacheFile)) {
652
- fs.unlinkSync(this.cacheFile);
653
- }
654
- } catch {
655
- }
656
- }
657
- /**
658
- * Get models grouped by tier (high/medium/low)
659
- */
660
- groupByTier(models) {
661
- const high = [];
662
- const medium = [];
663
- const low = [];
664
- const miniPattern = /\bmini\b/i;
665
- const flashPattern = /\bflash\b/i;
666
- const smallPattern = /\bsmall\b/i;
667
- for (const model of models) {
668
- const name = model.name.toLowerCase();
669
- const id = model.id.toLowerCase();
670
- const combined = `${name} ${id}`;
671
- const isLowTier = name.includes("haiku") || miniPattern.test(combined) || name.includes("nano") || flashPattern.test(combined) && !name.includes("flash-thinking") || smallPattern.test(combined) || name.includes("scout") || name.includes("instant");
672
- const isHighTier = name.includes("opus") || name.includes("gpt-4") && !miniPattern.test(combined) && !name.includes("nano") || id.includes("gpt-4.1") && !miniPattern.test(combined) && !id.includes("nano") || (id === "o3" || id.includes("o3") && !miniPattern.test(combined)) || (id === "o1" || id.includes("o1") && !miniPattern.test(combined) && !id.includes("o1-")) || // Pro models (Gemini Pro, etc.) but not mini variants
673
- id.includes("-pro") && !miniPattern.test(combined) || id.includes("grok-3") && !miniPattern.test(combined) || id.includes("grok-2") && !miniPattern.test(combined) || name.includes("large") || name.includes("maverick") || name.includes("command r+") || id.includes("deepseek-r1") || id.includes("deepseek-v3");
674
- if (isLowTier) {
675
- low.push(model);
676
- } else if (isHighTier) {
677
- high.push(model);
678
- } else {
679
- medium.push(model);
680
- }
681
- }
682
- return { high, medium, low };
683
- }
684
- };
685
-
686
- // src/commands/team/configure-models.ts
687
- import * as path2 from "path";
688
35
  function shouldPromptForModels() {
689
36
  if (process.env.CLAUDE_CODE === "1" || process.env.TERM_PROGRAM === "claude") {
690
37
  return false;
@@ -767,7 +114,7 @@ async function promptForAgentModels(rootDir) {
767
114
  return models;
768
115
  }
769
116
  async function teamModelsCommand(targetPath, options) {
770
- const rootDir = targetPath ? path2.resolve(targetPath) : process.cwd();
117
+ const rootDir = targetPath ? path.resolve(targetPath) : process.cwd();
771
118
  const manifest = loadAgentsManifest(rootDir);
772
119
  const discovery = new ModelDiscovery(rootDir);
773
120
  if (options.refresh) {
@@ -877,8 +224,8 @@ function mapToSimpleModel(modelId) {
877
224
 
878
225
  // src/commands/team/index.ts
879
226
  async function teamInitCommand(targetPath, options) {
880
- const rootDir = targetPath ? path3.resolve(targetPath) : process.cwd();
881
- const projectName = path3.basename(rootDir);
227
+ const rootDir = targetPath ? path2.resolve(targetPath) : process.cwd();
228
+ const projectName = path2.basename(rootDir);
882
229
  const agentsPath = getAgentsPath(rootDir);
883
230
  if (!options.json) {
884
231
  console.log(chalk2.blue("\n Initialize Paradigm Team\n"));
@@ -937,7 +284,7 @@ async function teamInitCommand(targetPath, options) {
937
284
  console.log(chalk2.gray(" 4. Use `paradigm team handoff --to <agent>` to hand off work\n"));
938
285
  }
939
286
  async function teamStatusCommand(targetPath, options) {
940
- const rootDir = targetPath ? path3.resolve(targetPath) : process.cwd();
287
+ const rootDir = targetPath ? path2.resolve(targetPath) : process.cwd();
941
288
  if (options.id) {
942
289
  return showOrchestrationStatus(rootDir, options.id, options);
943
290
  }
@@ -1150,7 +497,7 @@ Orchestration not found: ${id}
1150
497
  }
1151
498
  }
1152
499
  async function teamHandoffCommand(targetPath, options) {
1153
- const rootDir = targetPath ? path3.resolve(targetPath) : process.cwd();
500
+ const rootDir = targetPath ? path2.resolve(targetPath) : process.cwd();
1154
501
  const manifest = loadAgentsManifest(rootDir);
1155
502
  if (!manifest) {
1156
503
  if (options.json) {
@@ -1228,7 +575,7 @@ Unknown agent: ${options.to}`));
1228
575
  console.log();
1229
576
  }
1230
577
  async function teamAcceptCommand(handoffId, targetPath, options) {
1231
- const rootDir = targetPath ? path3.resolve(targetPath) : process.cwd();
578
+ const rootDir = targetPath ? path2.resolve(targetPath) : process.cwd();
1232
579
  const manifest = loadAgentsManifest(rootDir);
1233
580
  if (!manifest) {
1234
581
  if (options.json) {
@@ -1305,7 +652,7 @@ Handoff not found: ${handoffId}
1305
652
  console.log();
1306
653
  }
1307
654
  async function teamCheckCommand(targetPath, options) {
1308
- const rootDir = targetPath ? path3.resolve(targetPath) : process.cwd();
655
+ const rootDir = targetPath ? path2.resolve(targetPath) : process.cwd();
1309
656
  const manifest = loadAgentsManifest(rootDir);
1310
657
  if (!manifest) {
1311
658
  if (options.json) {
@@ -1386,7 +733,7 @@ async function teamCheckCommand(targetPath, options) {
1386
733
  console.log();
1387
734
  }
1388
735
  async function teamHistoryCommand(targetPath, options) {
1389
- const rootDir = targetPath ? path3.resolve(targetPath) : process.cwd();
736
+ const rootDir = targetPath ? path2.resolve(targetPath) : process.cwd();
1390
737
  const manifest = loadAgentsManifest(rootDir);
1391
738
  if (!manifest) {
1392
739
  if (options.json) {
@@ -1462,7 +809,7 @@ async function teamHistoryCommand(targetPath, options) {
1462
809
  }
1463
810
  }
1464
811
  async function teamResetCommand(targetPath, options) {
1465
- const rootDir = targetPath ? path3.resolve(targetPath) : process.cwd();
812
+ const rootDir = targetPath ? path2.resolve(targetPath) : process.cwd();
1466
813
  const manifest = loadAgentsManifest(rootDir);
1467
814
  if (!manifest) {
1468
815
  if (options.json) {
@@ -1500,11 +847,11 @@ async function teamResetCommand(targetPath, options) {
1500
847
  blocked: []
1501
848
  };
1502
849
  saveTeamState(rootDir, newState);
1503
- const handoffsDir = path3.join(getParadigmDir(rootDir), "handoffs");
1504
- if (options.force && fs2.existsSync(handoffsDir)) {
1505
- const files = fs2.readdirSync(handoffsDir);
850
+ const handoffsDir = path2.join(getParadigmDir(rootDir), "handoffs");
851
+ if (options.force && fs.existsSync(handoffsDir)) {
852
+ const files = fs.readdirSync(handoffsDir);
1506
853
  for (const file of files) {
1507
- fs2.unlinkSync(path3.join(handoffsDir, file));
854
+ fs.unlinkSync(path2.join(handoffsDir, file));
1508
855
  }
1509
856
  }
1510
857
  if (options.json) {