@pruddiman/dispatch 1.5.0-beta.9d77ada → 1.5.0-beta.9ed214f

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.
@@ -1678,7 +1678,7 @@ async function checkCodexAuth() {
1678
1678
  return { status: "authenticated" };
1679
1679
  }
1680
1680
  try {
1681
- await exec3("codex", ["auth", "status"], { timeout: AUTH_PROBE_TIMEOUT_MS });
1681
+ await exec3("codex", ["login", "status"], { timeout: AUTH_PROBE_TIMEOUT_MS });
1682
1682
  return { status: "authenticated" };
1683
1683
  } catch {
1684
1684
  return {
@@ -1697,7 +1697,7 @@ async function checkOpencodeAuth() {
1697
1697
  };
1698
1698
  }
1699
1699
  try {
1700
- await exec3("opencode", ["auth", "status"], { timeout: AUTH_PROBE_TIMEOUT_MS });
1700
+ await exec3("opencode", ["auth", "list"], { timeout: AUTH_PROBE_TIMEOUT_MS });
1701
1701
  return { status: "authenticated" };
1702
1702
  } catch {
1703
1703
  return {
@@ -1853,7 +1853,7 @@ function input(opts) {
1853
1853
  }
1854
1854
 
1855
1855
  // src/config.ts
1856
- var CONFIG_KEYS = ["enabledProviders", "source", "planTimeout", "specTimeout", "specWarnTimeout", "specKillTimeout", "concurrency", "org", "project", "workItemType", "iteration", "area", "username"];
1856
+ var CONFIG_KEYS = ["enabledProviders", "providerModels", "source", "planTimeout", "specTimeout", "specWarnTimeout", "specKillTimeout", "concurrency", "org", "project", "workItemType", "iteration", "area", "username"];
1857
1857
  function getConfigPath(configDir) {
1858
1858
  const dir = configDir ?? join3(process.cwd(), ".dispatch");
1859
1859
  return join3(dir, "config.json");
@@ -1897,6 +1897,23 @@ function migrateConfig(raw) {
1897
1897
  (p) => PROVIDER_NAMES.includes(p)
1898
1898
  );
1899
1899
  }
1900
+ if (raw.providerModels !== void 0 && typeof raw.providerModels === "object" && raw.providerModels !== null) {
1901
+ const validated = {};
1902
+ for (const [providerName, modelCfg] of Object.entries(raw.providerModels)) {
1903
+ if (!PROVIDER_NAMES.includes(providerName)) continue;
1904
+ if (typeof modelCfg !== "object" || modelCfg === null) continue;
1905
+ const cfg = modelCfg;
1906
+ const entry = {};
1907
+ if (typeof cfg.strong === "string") entry.strong = cfg.strong;
1908
+ if (typeof cfg.fast === "string") entry.fast = cfg.fast;
1909
+ if (entry.strong !== void 0 || entry.fast !== void 0) {
1910
+ validated[providerName] = entry;
1911
+ }
1912
+ }
1913
+ if (Object.keys(validated).length > 0) {
1914
+ config.providerModels = validated;
1915
+ }
1916
+ }
1900
1917
  if (raw.source !== void 0) config.source = raw.source;
1901
1918
  if (raw.planTimeout !== void 0) config.planTimeout = raw.planTimeout;
1902
1919
  if (raw.specTimeout !== void 0) config.specTimeout = raw.specTimeout;
@@ -2485,6 +2502,7 @@ import { access } from "fs/promises";
2485
2502
  import { constants } from "fs";
2486
2503
  var CONFIG_TO_CLI = {
2487
2504
  enabledProviders: "enabledProviders",
2505
+ providerModels: "providerModels",
2488
2506
  source: "issueSource",
2489
2507
  planTimeout: "planTimeout",
2490
2508
  specTimeout: "specTimeout",
@@ -2555,15 +2573,20 @@ import { randomUUID as randomUUID3 } from "crypto";
2555
2573
  import { glob as glob2 } from "glob";
2556
2574
 
2557
2575
  // src/providers/router.ts
2576
+ function resolveModel(meta, isFast, overrides) {
2577
+ const override = overrides?.[meta.name];
2578
+ if (isFast) return override?.fast ?? meta.defaultFastModel;
2579
+ return override?.strong ?? meta.defaultStrongModel;
2580
+ }
2558
2581
  var FAST_ROLES = /* @__PURE__ */ new Set(["planner", "commit"]);
2559
- function routeSkill(role, authenticatedProviders, forceProvider) {
2582
+ function routeSkill(role, authenticatedProviders, forceProvider, modelOverrides) {
2560
2583
  if (forceProvider) {
2561
2584
  const meta = PROVIDER_REGISTRY[forceProvider];
2562
2585
  const isFast2 = FAST_ROLES.has(role);
2563
2586
  return [
2564
2587
  {
2565
2588
  provider: forceProvider,
2566
- model: isFast2 ? meta.defaultFastModel : meta.defaultStrongModel,
2589
+ model: resolveModel(meta, isFast2, modelOverrides),
2567
2590
  priority: 0
2568
2591
  }
2569
2592
  ];
@@ -2579,7 +2602,7 @@ function routeSkill(role, authenticatedProviders, forceProvider) {
2579
2602
  return [
2580
2603
  {
2581
2604
  provider: meta.name,
2582
- model: isFast2 ? meta.defaultFastModel : meta.defaultStrongModel,
2605
+ model: resolveModel(meta, isFast2, modelOverrides),
2583
2606
  priority: 0
2584
2607
  }
2585
2608
  ];
@@ -2598,15 +2621,15 @@ function routeSkill(role, authenticatedProviders, forceProvider) {
2598
2621
  });
2599
2622
  return scored.map(({ meta }, i) => ({
2600
2623
  provider: meta.name,
2601
- model: isFast ? meta.defaultFastModel : meta.defaultStrongModel,
2624
+ model: resolveModel(meta, isFast, modelOverrides),
2602
2625
  priority: i
2603
2626
  }));
2604
2627
  }
2605
- function routeAllSkills(authenticatedProviders, forceProvider) {
2628
+ function routeAllSkills(authenticatedProviders, forceProvider, modelOverrides) {
2606
2629
  return {
2607
- planner: routeSkill("planner", authenticatedProviders, forceProvider),
2608
- executor: routeSkill("executor", authenticatedProviders, forceProvider),
2609
- commit: routeSkill("commit", authenticatedProviders, forceProvider)
2630
+ planner: routeSkill("planner", authenticatedProviders, forceProvider, modelOverrides),
2631
+ executor: routeSkill("executor", authenticatedProviders, forceProvider, modelOverrides),
2632
+ commit: routeSkill("commit", authenticatedProviders, forceProvider, modelOverrides)
2610
2633
  };
2611
2634
  }
2612
2635
 
@@ -4376,6 +4399,7 @@ async function runSpecPipeline(opts) {
4376
4399
  issues,
4377
4400
  provider: forceProvider,
4378
4401
  enabledProviders,
4402
+ providerModels,
4379
4403
  serverUrl,
4380
4404
  cwd: specCwd,
4381
4405
  outputDir = join8(specCwd, ".dispatch", "specs"),
@@ -4431,7 +4455,7 @@ async function runSpecPipeline(opts) {
4431
4455
  if (available.length === 0) {
4432
4456
  throw new Error("No authenticated providers available. Run 'dispatch config' to set up providers.");
4433
4457
  }
4434
- const specRoute = routeSkill("spec", available, forceProvider);
4458
+ const specRoute = routeSkill("spec", available, forceProvider, providerModels);
4435
4459
  const resolvedProvider = specRoute[0].provider;
4436
4460
  const resolvedModel = specRoute[0].model;
4437
4461
  const { instance } = await bootPipeline(resolvedProvider, serverUrl, specCwd, resolvedModel, source);
@@ -5203,6 +5227,7 @@ async function runDispatchPipeline(opts, cwd) {
5203
5227
  feature,
5204
5228
  provider,
5205
5229
  enabledProviders,
5230
+ providerModels,
5206
5231
  source,
5207
5232
  org,
5208
5233
  project,
@@ -5220,7 +5245,7 @@ async function runDispatchPipeline(opts, cwd) {
5220
5245
  if (available.length === 0) {
5221
5246
  throw new Error("No authenticated providers available. Run 'dispatch config' to set up providers.");
5222
5247
  }
5223
- const agentRoutes = routeAllSkills(available, provider);
5248
+ const agentRoutes = routeAllSkills(available, provider, providerModels);
5224
5249
  function createPool(entries, bootCwd) {
5225
5250
  return new ProviderPool({ entries, bootOpts: { url: serverUrl, cwd: bootCwd } });
5226
5251
  }
@@ -6060,6 +6085,7 @@ async function boot5(opts) {
6060
6085
  issueSource: m.issueSource,
6061
6086
  provider: m.provider,
6062
6087
  enabledProviders: m.enabledProviders,
6088
+ providerModels: m.providerModels,
6063
6089
  serverUrl: m.serverUrl,
6064
6090
  cwd: m.cwd,
6065
6091
  outputDir: m.outputDir,
@@ -6106,6 +6132,7 @@ async function boot5(opts) {
6106
6132
  issueSource: m.issueSource,
6107
6133
  provider: m.provider,
6108
6134
  enabledProviders: m.enabledProviders,
6135
+ providerModels: m.providerModels,
6109
6136
  serverUrl: m.serverUrl,
6110
6137
  cwd: m.cwd,
6111
6138
  outputDir: m.outputDir,
@@ -6131,6 +6158,7 @@ async function boot5(opts) {
6131
6158
  noWorktree: m.noWorktree,
6132
6159
  provider: m.provider,
6133
6160
  enabledProviders: m.enabledProviders,
6161
+ providerModels: m.providerModels,
6134
6162
  serverUrl: m.serverUrl,
6135
6163
  source: m.issueSource,
6136
6164
  org: m.org,