openkitt 0.3.11 → 0.3.13

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 +44 -25
  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,19 +2910,24 @@ 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
2924
  "o4-mini": "gpt-4.1"
2919
2925
  };
2926
+ COPILOT_MODEL_MIGRATIONS = {
2927
+ "claude-sonnet-4-5": "claude-sonnet-4.5",
2928
+ "claude-haiku-4-5": "claude-haiku-4.5",
2929
+ "claude-opus-4-5": "claude-opus-4.5"
2930
+ };
2920
2931
  });
2921
2932
 
2922
2933
  // node_modules/@anthropic-ai/sdk/internal/tslib.mjs
@@ -257389,7 +257400,7 @@ function registerCleanupHandlers() {
257389
257400
  }
257390
257401
 
257391
257402
  // src/commands/init.ts
257392
- import { chmodSync as chmodSync4, existsSync as existsSync10, mkdirSync as mkdirSync7, readdirSync as readdirSync2, readFileSync as readFileSync7, writeFileSync as writeFileSync8 } from "node:fs";
257403
+ import { existsSync as existsSync10, mkdirSync as mkdirSync7, readdirSync as readdirSync2, readFileSync as readFileSync7, writeFileSync as writeFileSync8 } from "node:fs";
257393
257404
  import { homedir as homedir3, platform as platform5 } from "node:os";
257394
257405
  import { basename, join as join11, resolve as resolve2 } from "node:path";
257395
257406
  var import_picocolors5 = __toESM(require_picocolors(), 1);
@@ -259099,10 +259110,12 @@ async function initCommand(context, _args) {
259099
259110
  const stagingDir = join11(kittDir, "staging");
259100
259111
  mkdirSync7(appsDir, { recursive: true });
259101
259112
  mkdirSync7(packagesDir, { recursive: true });
259102
- mkdirSync7(stagingDir, { recursive: true });
259103
259113
  if (platform5() !== "win32") {
259104
- chmodSync4(kittDir, KITT_DIR_MODE);
259114
+ mkdirSync7(kittDir, { recursive: true, mode: KITT_DIR_MODE });
259115
+ } else {
259116
+ mkdirSync7(kittDir, { recursive: true });
259105
259117
  }
259118
+ mkdirSync7(stagingDir, { recursive: true });
259106
259119
  scaffoldDefaultPackages(packagesDir);
259107
259120
  const defaultVersions = getDefaultVersions();
259108
259121
  const versionsMarkdown = generateVersionsMarkdown(defaultVersions);
@@ -259149,25 +259162,31 @@ async function initCommand(context, _args) {
259149
259162
  const server2 = await spawnMcpServer();
259150
259163
  mcpClient = await createMcpClient(server2);
259151
259164
  await mcpClient.initialize();
259152
- const operationsContext = buildOperationsContext("init", [workspaceName], manifest);
259165
+ const operationsContext = buildOperationsContext("init", [], manifest);
259153
259166
  const operationsResult = await executeOperations({ llmClient, mcpClient, context: operationsContext });
259154
259167
  const projectId = extractRailwayProjectId(operationsResult);
259155
259168
  if (projectId) {
259156
- const railwayManifest = createInitialManifest(workspaceName, packageManager, {
259157
- projectId,
259158
- linkedAt: new Date().toISOString()
259159
- });
259169
+ const railwayManifest = {
259170
+ ...manifest,
259171
+ workspace: {
259172
+ ...manifest.workspace,
259173
+ railway: {
259174
+ projectId,
259175
+ linkedAt: new Date().toISOString()
259176
+ }
259177
+ }
259178
+ };
259160
259179
  writeManifest(workspaceDir, railwayManifest);
259161
- success(`Railway project linked: ${projectId}`);
259180
+ success("Railway project created and linked.");
259162
259181
  } else {
259163
259182
  warn("Could not extract Railway project ID. Link manually with /link.");
259164
259183
  }
259165
259184
  } catch (initError) {
259166
259185
  const detail = initError instanceof Error ? initError.message : String(initError);
259167
259186
  if (isModelNotSupportedError(initError)) {
259168
- warn(`LLM model not supported. Run /login model to switch to a valid model.`);
259187
+ warn("LLM model not supported. Run /login model to switch to a valid model.");
259169
259188
  } else {
259170
- warn(`Railway project creation failed: ${detail}. You can link manually later.`);
259189
+ warn("Railway project creation failed. You can set it up later.");
259171
259190
  }
259172
259191
  logger.cmd("/init", "FAILED", detail);
259173
259192
  } finally {
@@ -259175,7 +259194,7 @@ async function initCommand(context, _args) {
259175
259194
  await shutdownMcpServer();
259176
259195
  }
259177
259196
  } else {
259178
- warn("LLM not configured. Skipping Railway project creation. Run /login to set up.");
259197
+ info("Railway project creation skipped. Run /login llm to configure LLM credentials.");
259179
259198
  }
259180
259199
  logger.cmd("/init", "SUCCESS");
259181
259200
  console.log("");
@@ -263659,7 +263678,7 @@ var import_picocolors6 = __toESM(require_picocolors(), 1);
263659
263678
 
263660
263679
  // src/commands/settings.ts
263661
263680
  import { execSync as execSync6 } from "node:child_process";
263662
- 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";
263681
+ 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";
263663
263682
  import { homedir as homedir4, platform as platform6 } from "node:os";
263664
263683
  import { join as join16 } from "node:path";
263665
263684
  var SUPPORTED_PACKAGE_MANAGERS = ["bun", "npm", "pnpm", "yarn"];
@@ -263681,7 +263700,7 @@ function ensureConfigDir2() {
263681
263700
  mkdirSync9(CONFIG_DIR2, { recursive: true, mode: DIR_MODE3 });
263682
263701
  }
263683
263702
  if (!isWindows4()) {
263684
- chmodSync5(CONFIG_DIR2, DIR_MODE3);
263703
+ chmodSync4(CONFIG_DIR2, DIR_MODE3);
263685
263704
  }
263686
263705
  }
263687
263706
  function isPackageManager(value) {
@@ -263714,11 +263733,11 @@ function writeGlobalConfig2(config) {
263714
263733
  try {
263715
263734
  writeFileSync11(tempFile, payload, { encoding: "utf-8", mode: FILE_MODE4 });
263716
263735
  if (!isWindows4()) {
263717
- chmodSync5(tempFile, FILE_MODE4);
263736
+ chmodSync4(tempFile, FILE_MODE4);
263718
263737
  }
263719
263738
  renameSync5(tempFile, CONFIG_FILE2);
263720
263739
  if (!isWindows4()) {
263721
- chmodSync5(CONFIG_FILE2, FILE_MODE4);
263740
+ chmodSync4(CONFIG_FILE2, FILE_MODE4);
263722
263741
  }
263723
263742
  } catch (writeError) {
263724
263743
  if (existsSync14(tempFile)) {
@@ -265178,10 +265197,10 @@ var MODEL_OPTIONS = {
265178
265197
  ]
265179
265198
  };
265180
265199
  var COPILOT_MODEL_OPTIONS = [
265181
- { value: "claude-sonnet-4-5", label: "claude-sonnet-4-5 (recommended — Claude via Copilot)" },
265200
+ { value: "claude-sonnet-4.5", label: "claude-sonnet-4.5 (recommended — Claude via Copilot)" },
265182
265201
  { value: "claude-sonnet-4", label: "claude-sonnet-4 (Claude Sonnet 4 via Copilot)" },
265183
- { value: "claude-haiku-4-5", label: "claude-haiku-4-5 (fast & cheap — Claude via Copilot)" },
265184
- { value: "claude-opus-4-5", label: "claude-opus-4-5 (most capable — Claude via Copilot)" },
265202
+ { value: "claude-haiku-4.5", label: "claude-haiku-4.5 (fast & cheap — Claude via Copilot)" },
265203
+ { value: "claude-opus-4.5", label: "claude-opus-4.5 (most capable — Claude via Copilot)" },
265185
265204
  { value: "gpt-4.1", label: "gpt-4.1 (GPT-4.1 via Copilot)" },
265186
265205
  { value: "gemini-2.5-pro", label: "gemini-2.5-pro (Gemini 2.5 Pro via Copilot)" }
265187
265206
  ];
@@ -266094,7 +266113,7 @@ async function helpCommand(_context, _args) {
266094
266113
  // package.json
266095
266114
  var package_default = {
266096
266115
  name: "openkitt",
266097
- version: "0.3.11",
266116
+ version: "0.3.13",
266098
266117
  description: "AI-powered monorepo scaffolding CLI",
266099
266118
  keywords: [
266100
266119
  "cli",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openkitt",
3
- "version": "0.3.11",
3
+ "version": "0.3.13",
4
4
  "description": "AI-powered monorepo scaffolding CLI",
5
5
  "keywords": [
6
6
  "cli",