openkitt 0.3.12 → 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.
- package/dist/cli.js +39 -23
- 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
|
-
|
|
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,18 +2910,20 @@ 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,
|
|
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
|
-
|
|
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"
|
|
2924
|
+
"o4-mini": "gpt-4.1"
|
|
2925
|
+
};
|
|
2926
|
+
COPILOT_MODEL_MIGRATIONS = {
|
|
2919
2927
|
"claude-sonnet-4-5": "claude-sonnet-4.5",
|
|
2920
2928
|
"claude-haiku-4-5": "claude-haiku-4.5",
|
|
2921
2929
|
"claude-opus-4-5": "claude-opus-4.5"
|
|
@@ -257392,7 +257400,7 @@ function registerCleanupHandlers() {
|
|
|
257392
257400
|
}
|
|
257393
257401
|
|
|
257394
257402
|
// src/commands/init.ts
|
|
257395
|
-
import {
|
|
257403
|
+
import { existsSync as existsSync10, mkdirSync as mkdirSync7, readdirSync as readdirSync2, readFileSync as readFileSync7, writeFileSync as writeFileSync8 } from "node:fs";
|
|
257396
257404
|
import { homedir as homedir3, platform as platform5 } from "node:os";
|
|
257397
257405
|
import { basename, join as join11, resolve as resolve2 } from "node:path";
|
|
257398
257406
|
var import_picocolors5 = __toESM(require_picocolors(), 1);
|
|
@@ -259102,10 +259110,12 @@ async function initCommand(context, _args) {
|
|
|
259102
259110
|
const stagingDir = join11(kittDir, "staging");
|
|
259103
259111
|
mkdirSync7(appsDir, { recursive: true });
|
|
259104
259112
|
mkdirSync7(packagesDir, { recursive: true });
|
|
259105
|
-
mkdirSync7(stagingDir, { recursive: true });
|
|
259106
259113
|
if (platform5() !== "win32") {
|
|
259107
|
-
|
|
259114
|
+
mkdirSync7(kittDir, { recursive: true, mode: KITT_DIR_MODE });
|
|
259115
|
+
} else {
|
|
259116
|
+
mkdirSync7(kittDir, { recursive: true });
|
|
259108
259117
|
}
|
|
259118
|
+
mkdirSync7(stagingDir, { recursive: true });
|
|
259109
259119
|
scaffoldDefaultPackages(packagesDir);
|
|
259110
259120
|
const defaultVersions = getDefaultVersions();
|
|
259111
259121
|
const versionsMarkdown = generateVersionsMarkdown(defaultVersions);
|
|
@@ -259152,25 +259162,31 @@ async function initCommand(context, _args) {
|
|
|
259152
259162
|
const server2 = await spawnMcpServer();
|
|
259153
259163
|
mcpClient = await createMcpClient(server2);
|
|
259154
259164
|
await mcpClient.initialize();
|
|
259155
|
-
const operationsContext = buildOperationsContext("init", [
|
|
259165
|
+
const operationsContext = buildOperationsContext("init", [], manifest);
|
|
259156
259166
|
const operationsResult = await executeOperations({ llmClient, mcpClient, context: operationsContext });
|
|
259157
259167
|
const projectId = extractRailwayProjectId(operationsResult);
|
|
259158
259168
|
if (projectId) {
|
|
259159
|
-
const railwayManifest =
|
|
259160
|
-
|
|
259161
|
-
|
|
259162
|
-
|
|
259169
|
+
const railwayManifest = {
|
|
259170
|
+
...manifest,
|
|
259171
|
+
workspace: {
|
|
259172
|
+
...manifest.workspace,
|
|
259173
|
+
railway: {
|
|
259174
|
+
projectId,
|
|
259175
|
+
linkedAt: new Date().toISOString()
|
|
259176
|
+
}
|
|
259177
|
+
}
|
|
259178
|
+
};
|
|
259163
259179
|
writeManifest(workspaceDir, railwayManifest);
|
|
259164
|
-
success(
|
|
259180
|
+
success("Railway project created and linked.");
|
|
259165
259181
|
} else {
|
|
259166
259182
|
warn("Could not extract Railway project ID. Link manually with /link.");
|
|
259167
259183
|
}
|
|
259168
259184
|
} catch (initError) {
|
|
259169
259185
|
const detail = initError instanceof Error ? initError.message : String(initError);
|
|
259170
259186
|
if (isModelNotSupportedError(initError)) {
|
|
259171
|
-
warn(
|
|
259187
|
+
warn("LLM model not supported. Run /login model to switch to a valid model.");
|
|
259172
259188
|
} else {
|
|
259173
|
-
warn(
|
|
259189
|
+
warn("Railway project creation failed. You can set it up later.");
|
|
259174
259190
|
}
|
|
259175
259191
|
logger.cmd("/init", "FAILED", detail);
|
|
259176
259192
|
} finally {
|
|
@@ -259178,7 +259194,7 @@ async function initCommand(context, _args) {
|
|
|
259178
259194
|
await shutdownMcpServer();
|
|
259179
259195
|
}
|
|
259180
259196
|
} else {
|
|
259181
|
-
|
|
259197
|
+
info("Railway project creation skipped. Run /login llm to configure LLM credentials.");
|
|
259182
259198
|
}
|
|
259183
259199
|
logger.cmd("/init", "SUCCESS");
|
|
259184
259200
|
console.log("");
|
|
@@ -263662,7 +263678,7 @@ var import_picocolors6 = __toESM(require_picocolors(), 1);
|
|
|
263662
263678
|
|
|
263663
263679
|
// src/commands/settings.ts
|
|
263664
263680
|
import { execSync as execSync6 } from "node:child_process";
|
|
263665
|
-
import { chmodSync as
|
|
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";
|
|
263666
263682
|
import { homedir as homedir4, platform as platform6 } from "node:os";
|
|
263667
263683
|
import { join as join16 } from "node:path";
|
|
263668
263684
|
var SUPPORTED_PACKAGE_MANAGERS = ["bun", "npm", "pnpm", "yarn"];
|
|
@@ -263684,7 +263700,7 @@ function ensureConfigDir2() {
|
|
|
263684
263700
|
mkdirSync9(CONFIG_DIR2, { recursive: true, mode: DIR_MODE3 });
|
|
263685
263701
|
}
|
|
263686
263702
|
if (!isWindows4()) {
|
|
263687
|
-
|
|
263703
|
+
chmodSync4(CONFIG_DIR2, DIR_MODE3);
|
|
263688
263704
|
}
|
|
263689
263705
|
}
|
|
263690
263706
|
function isPackageManager(value) {
|
|
@@ -263717,11 +263733,11 @@ function writeGlobalConfig2(config) {
|
|
|
263717
263733
|
try {
|
|
263718
263734
|
writeFileSync11(tempFile, payload, { encoding: "utf-8", mode: FILE_MODE4 });
|
|
263719
263735
|
if (!isWindows4()) {
|
|
263720
|
-
|
|
263736
|
+
chmodSync4(tempFile, FILE_MODE4);
|
|
263721
263737
|
}
|
|
263722
263738
|
renameSync5(tempFile, CONFIG_FILE2);
|
|
263723
263739
|
if (!isWindows4()) {
|
|
263724
|
-
|
|
263740
|
+
chmodSync4(CONFIG_FILE2, FILE_MODE4);
|
|
263725
263741
|
}
|
|
263726
263742
|
} catch (writeError) {
|
|
263727
263743
|
if (existsSync14(tempFile)) {
|
|
@@ -266097,7 +266113,7 @@ async function helpCommand(_context, _args) {
|
|
|
266097
266113
|
// package.json
|
|
266098
266114
|
var package_default = {
|
|
266099
266115
|
name: "openkitt",
|
|
266100
|
-
version: "0.3.
|
|
266116
|
+
version: "0.3.13",
|
|
266101
266117
|
description: "AI-powered monorepo scaffolding CLI",
|
|
266102
266118
|
keywords: [
|
|
266103
266119
|
"cli",
|