openkitt 0.3.12 → 0.3.14

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 +51 -33
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -2694,8 +2694,14 @@ function getStoredLlm(config) {
2694
2694
  }
2695
2695
  return llm;
2696
2696
  }
2697
- function migrateModelId(model) {
2698
- return MODEL_MIGRATIONS[model] ?? model;
2697
+ function migrateModelId(model, authType) {
2698
+ const shared = SHARED_MODEL_MIGRATIONS[model];
2699
+ if (shared)
2700
+ return shared;
2701
+ if (authType === "github-copilot") {
2702
+ return COPILOT_MODEL_MIGRATIONS[model] ?? model;
2703
+ }
2704
+ return model;
2699
2705
  }
2700
2706
  async function storeLlmCredentials(provider, model, apiKey) {
2701
2707
  const validatedAt = new Date().toISOString();
@@ -2858,7 +2864,7 @@ async function getLlmConfig() {
2858
2864
  if (!llm) {
2859
2865
  return null;
2860
2866
  }
2861
- const migratedModel = migrateModelId(llm.model);
2867
+ const migratedModel = migrateModelId(llm.model, llm.authType ?? "api-key");
2862
2868
  if (migratedModel !== llm.model) {
2863
2869
  writeConfig({ ...config, llm: { ...llm, model: migratedModel } });
2864
2870
  }
@@ -2904,21 +2910,27 @@ async function isLlmConfigured() {
2904
2910
  const apiKey = await getLlmApiKey();
2905
2911
  return apiKey !== null;
2906
2912
  }
2907
- var CONFIG_DIR, CONFIG_FILE, KEYCHAIN_API_KEY = "llm-api-key", DIR_MODE = 448, FILE_MODE = 384, MODEL_MIGRATIONS, COPILOT_TOKEN_URL = "https://api.github.com/copilot_internal/v2/token";
2913
+ var CONFIG_DIR, CONFIG_FILE, KEYCHAIN_API_KEY = "llm-api-key", DIR_MODE = 448, FILE_MODE = 384, SHARED_MODEL_MIGRATIONS, COPILOT_MODEL_MIGRATIONS, COPILOT_TOKEN_URL = "https://api.github.com/copilot_internal/v2/token";
2908
2914
  var init_config = __esm(() => {
2909
2915
  init_encryption();
2910
2916
  init_keychain();
2911
2917
  CONFIG_DIR = join3(homedir(), ".kitt");
2912
2918
  CONFIG_FILE = join3(CONFIG_DIR, "config.json");
2913
- MODEL_MIGRATIONS = {
2919
+ SHARED_MODEL_MIGRATIONS = {
2914
2920
  "claude-sonnet-4-20250514": "claude-sonnet-4-5",
2915
2921
  "claude-opus-4-20250514": "claude-opus-4-5",
2916
2922
  "claude-haiku-4-20250514": "claude-3-5-haiku-20241022",
2917
2923
  "gpt-4o": "gpt-4.1",
2918
- "o4-mini": "gpt-4.1",
2919
- "claude-sonnet-4-5": "claude-sonnet-4.5",
2924
+ "o4-mini": "gpt-4.1"
2925
+ };
2926
+ COPILOT_MODEL_MIGRATIONS = {
2927
+ "claude-sonnet-4-5": "claude-sonnet-4.6",
2920
2928
  "claude-haiku-4-5": "claude-haiku-4.5",
2921
- "claude-opus-4-5": "claude-opus-4.5"
2929
+ "claude-opus-4-5": "claude-opus-4.6",
2930
+ "claude-sonnet-4": "claude-sonnet-4.6",
2931
+ "claude-sonnet-4.5": "claude-sonnet-4.6",
2932
+ "claude-opus-4.5": "claude-opus-4.6",
2933
+ "gemini-2.5-pro": "gpt-4.1"
2922
2934
  };
2923
2935
  });
2924
2936
 
@@ -257392,7 +257404,7 @@ function registerCleanupHandlers() {
257392
257404
  }
257393
257405
 
257394
257406
  // src/commands/init.ts
257395
- import { chmodSync as chmodSync4, existsSync as existsSync10, mkdirSync as mkdirSync7, readdirSync as readdirSync2, readFileSync as readFileSync7, writeFileSync as writeFileSync8 } from "node:fs";
257407
+ import { existsSync as existsSync10, mkdirSync as mkdirSync7, readdirSync as readdirSync2, readFileSync as readFileSync7, writeFileSync as writeFileSync8 } from "node:fs";
257396
257408
  import { homedir as homedir3, platform as platform5 } from "node:os";
257397
257409
  import { basename, join as join11, resolve as resolve2 } from "node:path";
257398
257410
  var import_picocolors5 = __toESM(require_picocolors(), 1);
@@ -257691,9 +257703,9 @@ function createAnthropicClient(Provider, apiKey, model, rateLimiter) {
257691
257703
  }
257692
257704
  };
257693
257705
  }
257694
- function createOpenAiClient(Provider, apiKey, model, rateLimiter) {
257706
+ function createOpenAiClient(Provider, apiKey, model, rateLimiter, providerOverride) {
257695
257707
  const client = new Provider({ apiKey });
257696
- const provider = "openai";
257708
+ const provider = providerOverride ?? "openai";
257697
257709
  return {
257698
257710
  getProvider() {
257699
257711
  return provider;
@@ -257949,7 +257961,7 @@ async function createCopilotClient(bearerToken, model, rateLimiter) {
257949
257961
  defaultHeaders: COPILOT_HEADERS
257950
257962
  });
257951
257963
  };
257952
- return createOpenAiClient(CopilotProvider, bearerToken, model, rateLimiter);
257964
+ return createOpenAiClient(CopilotProvider, bearerToken, model, rateLimiter, "github-copilot");
257953
257965
  }
257954
257966
  async function createLlmClient(rateLimiter) {
257955
257967
  const llmConfig = await getLlmConfig();
@@ -259102,10 +259114,12 @@ async function initCommand(context, _args) {
259102
259114
  const stagingDir = join11(kittDir, "staging");
259103
259115
  mkdirSync7(appsDir, { recursive: true });
259104
259116
  mkdirSync7(packagesDir, { recursive: true });
259105
- mkdirSync7(stagingDir, { recursive: true });
259106
259117
  if (platform5() !== "win32") {
259107
- chmodSync4(kittDir, KITT_DIR_MODE);
259118
+ mkdirSync7(kittDir, { recursive: true, mode: KITT_DIR_MODE });
259119
+ } else {
259120
+ mkdirSync7(kittDir, { recursive: true });
259108
259121
  }
259122
+ mkdirSync7(stagingDir, { recursive: true });
259109
259123
  scaffoldDefaultPackages(packagesDir);
259110
259124
  const defaultVersions = getDefaultVersions();
259111
259125
  const versionsMarkdown = generateVersionsMarkdown(defaultVersions);
@@ -259152,25 +259166,31 @@ async function initCommand(context, _args) {
259152
259166
  const server2 = await spawnMcpServer();
259153
259167
  mcpClient = await createMcpClient(server2);
259154
259168
  await mcpClient.initialize();
259155
- const operationsContext = buildOperationsContext("init", [workspaceName], manifest);
259169
+ const operationsContext = buildOperationsContext("init", [], manifest);
259156
259170
  const operationsResult = await executeOperations({ llmClient, mcpClient, context: operationsContext });
259157
259171
  const projectId = extractRailwayProjectId(operationsResult);
259158
259172
  if (projectId) {
259159
- const railwayManifest = createInitialManifest(workspaceName, packageManager, {
259160
- projectId,
259161
- linkedAt: new Date().toISOString()
259162
- });
259173
+ const railwayManifest = {
259174
+ ...manifest,
259175
+ workspace: {
259176
+ ...manifest.workspace,
259177
+ railway: {
259178
+ projectId,
259179
+ linkedAt: new Date().toISOString()
259180
+ }
259181
+ }
259182
+ };
259163
259183
  writeManifest(workspaceDir, railwayManifest);
259164
- success(`Railway project linked: ${projectId}`);
259184
+ success("Railway project created and linked.");
259165
259185
  } else {
259166
259186
  warn("Could not extract Railway project ID. Link manually with /link.");
259167
259187
  }
259168
259188
  } catch (initError) {
259169
259189
  const detail = initError instanceof Error ? initError.message : String(initError);
259170
259190
  if (isModelNotSupportedError(initError)) {
259171
- warn(`LLM model not supported. Run /login model to switch to a valid model.`);
259191
+ warn("LLM model not supported. Run /login model to switch to a valid model.");
259172
259192
  } else {
259173
- warn(`Railway project creation failed: ${detail}. You can link manually later.`);
259193
+ warn("Railway project creation failed. You can set it up later.");
259174
259194
  }
259175
259195
  logger.cmd("/init", "FAILED", detail);
259176
259196
  } finally {
@@ -259178,7 +259198,7 @@ async function initCommand(context, _args) {
259178
259198
  await shutdownMcpServer();
259179
259199
  }
259180
259200
  } else {
259181
- warn("LLM not configured. Skipping Railway project creation. Run /login to set up.");
259201
+ info("Railway project creation skipped. Run /login llm to configure LLM credentials.");
259182
259202
  }
259183
259203
  logger.cmd("/init", "SUCCESS");
259184
259204
  console.log("");
@@ -263662,7 +263682,7 @@ var import_picocolors6 = __toESM(require_picocolors(), 1);
263662
263682
 
263663
263683
  // src/commands/settings.ts
263664
263684
  import { execSync as execSync6 } from "node:child_process";
263665
- import { chmodSync as chmodSync5, existsSync as existsSync14, mkdirSync as mkdirSync9, readFileSync as readFileSync10, renameSync as renameSync5, rmSync as rmSync3, unlinkSync as unlinkSync4, writeFileSync as writeFileSync11 } from "node:fs";
263685
+ import { chmodSync as chmodSync4, existsSync as existsSync14, mkdirSync as mkdirSync9, readFileSync as readFileSync10, renameSync as renameSync5, rmSync as rmSync3, unlinkSync as unlinkSync4, writeFileSync as writeFileSync11 } from "node:fs";
263666
263686
  import { homedir as homedir4, platform as platform6 } from "node:os";
263667
263687
  import { join as join16 } from "node:path";
263668
263688
  var SUPPORTED_PACKAGE_MANAGERS = ["bun", "npm", "pnpm", "yarn"];
@@ -263684,7 +263704,7 @@ function ensureConfigDir2() {
263684
263704
  mkdirSync9(CONFIG_DIR2, { recursive: true, mode: DIR_MODE3 });
263685
263705
  }
263686
263706
  if (!isWindows4()) {
263687
- chmodSync5(CONFIG_DIR2, DIR_MODE3);
263707
+ chmodSync4(CONFIG_DIR2, DIR_MODE3);
263688
263708
  }
263689
263709
  }
263690
263710
  function isPackageManager(value) {
@@ -263717,11 +263737,11 @@ function writeGlobalConfig2(config) {
263717
263737
  try {
263718
263738
  writeFileSync11(tempFile, payload, { encoding: "utf-8", mode: FILE_MODE4 });
263719
263739
  if (!isWindows4()) {
263720
- chmodSync5(tempFile, FILE_MODE4);
263740
+ chmodSync4(tempFile, FILE_MODE4);
263721
263741
  }
263722
263742
  renameSync5(tempFile, CONFIG_FILE2);
263723
263743
  if (!isWindows4()) {
263724
- chmodSync5(CONFIG_FILE2, FILE_MODE4);
263744
+ chmodSync4(CONFIG_FILE2, FILE_MODE4);
263725
263745
  }
263726
263746
  } catch (writeError) {
263727
263747
  if (existsSync14(tempFile)) {
@@ -265181,12 +265201,10 @@ var MODEL_OPTIONS = {
265181
265201
  ]
265182
265202
  };
265183
265203
  var COPILOT_MODEL_OPTIONS = [
265184
- { value: "claude-sonnet-4.5", label: "claude-sonnet-4.5 (recommended — Claude via Copilot)" },
265185
- { value: "claude-sonnet-4", label: "claude-sonnet-4 (Claude Sonnet 4 via Copilot)" },
265204
+ { value: "claude-sonnet-4.6", label: "claude-sonnet-4.6 (recommended — Claude Sonnet via Copilot)" },
265186
265205
  { value: "claude-haiku-4.5", label: "claude-haiku-4.5 (fast & cheap — Claude via Copilot)" },
265187
- { value: "claude-opus-4.5", label: "claude-opus-4.5 (most capable — Claude via Copilot)" },
265188
- { value: "gpt-4.1", label: "gpt-4.1 (GPT-4.1 via Copilot)" },
265189
- { value: "gemini-2.5-pro", label: "gemini-2.5-pro (Gemini 2.5 Pro via Copilot)" }
265206
+ { value: "claude-opus-4.6", label: "claude-opus-4.6 (most capable — Claude via Copilot)" },
265207
+ { value: "gpt-4.1", label: "gpt-4.1 (GPT-4.1 via Copilot)" }
265190
265208
  ];
265191
265209
  var GITHUB_DEVICE_CLIENT_ID = "Iv1.b507a08c87ecfe98";
265192
265210
  function cancelled() {
@@ -266097,7 +266115,7 @@ async function helpCommand(_context, _args) {
266097
266115
  // package.json
266098
266116
  var package_default = {
266099
266117
  name: "openkitt",
266100
- version: "0.3.12",
266118
+ version: "0.3.14",
266101
266119
  description: "AI-powered monorepo scaffolding CLI",
266102
266120
  keywords: [
266103
266121
  "cli",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openkitt",
3
- "version": "0.3.12",
3
+ "version": "0.3.14",
4
4
  "description": "AI-powered monorepo scaffolding CLI",
5
5
  "keywords": [
6
6
  "cli",