@cjhyy/code-shell 0.1.0-alpha.2 → 0.1.0-alpha.3

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.
@@ -7,7 +7,7 @@ _chunkIJSHQGMPcjs.init_cjs_shims.call(void 0, );
7
7
 
8
8
  // src/data/openrouter-models.json
9
9
  var openrouter_models_default = {
10
- fetchedAt: "2026-05-09T09:11:43.732Z",
10
+ fetchedAt: "2026-05-09T09:43:15.310Z",
11
11
  source: "https://openrouter.ai/api/v1/models",
12
12
  count: 367,
13
13
  models: [
@@ -7,7 +7,7 @@ init_esm_shims();
7
7
 
8
8
  // src/data/openrouter-models.json
9
9
  var openrouter_models_default = {
10
- fetchedAt: "2026-05-09T09:11:43.732Z",
10
+ fetchedAt: "2026-05-09T09:43:15.310Z",
11
11
  source: "https://openrouter.ai/api/v1/models",
12
12
  count: 367,
13
13
  models: [
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  setOpenRouterSnapshot
3
- } from "./chunk-OMRGA6TI.js";
3
+ } from "./chunk-FPFTIKEJ.js";
4
4
  import {
5
5
  init_esm_shims
6
6
  } from "./chunk-DI7RDLOS.js";
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkTATCTZSBcjs = require('./chunk-TATCTZSB.cjs');
3
+ var _chunkBF4LXLQVcjs = require('./chunk-BF4LXLQV.cjs');
4
4
 
5
5
 
6
6
  var _chunkIJSHQGMPcjs = require('./chunk-IJSHQGMP.cjs');
@@ -37,7 +37,7 @@ async function syncOpenRouterCatalog(timeoutMs = 15e3) {
37
37
  const payload = await res.json();
38
38
  const raw = _nullishCoalesce(payload.data, () => ( []));
39
39
  const models = raw.map(slim).sort((a, b) => b.created - a.created);
40
- _chunkTATCTZSBcjs.setOpenRouterSnapshot.call(void 0, {
40
+ _chunkBF4LXLQVcjs.setOpenRouterSnapshot.call(void 0, {
41
41
  fetchedAt: (/* @__PURE__ */ new Date()).toISOString(),
42
42
  source: ENDPOINT,
43
43
  count: models.length,
package/dist/cli/main.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict"; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12; var _class13; var _class14; var _class15; var _class16; var _class17; var _class18; var _class19; var _class20; var _class21; var _class22;
3
3
 
4
- var _chunkG76E5FOBcjs = require('../chunk-G76E5FOB.cjs');
4
+ var _chunkVIPLU4RYcjs = require('../chunk-VIPLU4RY.cjs');
5
5
 
6
6
 
7
7
 
8
8
 
9
- var _chunkTATCTZSBcjs = require('../chunk-TATCTZSB.cjs');
9
+ var _chunkBF4LXLQVcjs = require('../chunk-BF4LXLQV.cjs');
10
10
 
11
11
 
12
12
 
@@ -774,7 +774,7 @@ var MODEL_PRICING = {
774
774
  var DEFAULT_PRICING = pricing(3, 15);
775
775
  function lookupPricing(model) {
776
776
  if (model.includes("/")) {
777
- const hit2 = _chunkTATCTZSBcjs.findOpenRouterModel.call(void 0, model);
777
+ const hit2 = _chunkBF4LXLQVcjs.findOpenRouterModel.call(void 0, model);
778
778
  if (hit2 && (hit2.inputPricePerMillion > 0 || hit2.outputPricePerMillion > 0)) {
779
779
  const input = hit2.inputPricePerMillion;
780
780
  const output = hit2.outputPricePerMillion;
@@ -16033,7 +16033,7 @@ var OPENROUTER_VENDORS = [
16033
16033
  { prefix: "mistralai/", take: 1 }
16034
16034
  ];
16035
16035
  function buildOpenRouterModelList(fallback) {
16036
- const all = _chunkTATCTZSBcjs.getOpenRouterModels.call(void 0, );
16036
+ const all = _chunkBF4LXLQVcjs.getOpenRouterModels.call(void 0, );
16037
16037
  if (all.length === 0) return fallback;
16038
16038
  const skip = /(?:-guard|-embedding|-rerank|-vision-only|:free)/i;
16039
16039
  const out = [];
@@ -16119,7 +16119,7 @@ var KNOWN_MAX_OUTPUT = {
16119
16119
  function resolveMaxOutput(model) {
16120
16120
  if (KNOWN_MAX_OUTPUT[model]) return KNOWN_MAX_OUTPUT[model];
16121
16121
  if (model.includes("/")) {
16122
- const hit = _chunkTATCTZSBcjs.getOpenRouterModels.call(void 0, ).find((m) => m.id === model);
16122
+ const hit = _chunkBF4LXLQVcjs.getOpenRouterModels.call(void 0, ).find((m) => m.id === model);
16123
16123
  if (hit && hit.maxOutputTokens > 0) return hit.maxOutputTokens;
16124
16124
  }
16125
16125
  return void 0;
@@ -18495,7 +18495,7 @@ var utilityCommands = [
18495
18495
  description: "Check for and install updates",
18496
18496
  execute: async (_arg, ctx) => {
18497
18497
  try {
18498
- const { getCurrentVersion, getUpdateAvailable } = await Promise.resolve().then(() => _interopRequireWildcard(require("../updater-M7L42ASZ.cjs")));
18498
+ const { getCurrentVersion, getUpdateAvailable } = await Promise.resolve().then(() => _interopRequireWildcard(require("../updater-J7L7R6BY.cjs")));
18499
18499
  const current = getCurrentVersion();
18500
18500
  const available = getUpdateAvailable();
18501
18501
  if (available) {
@@ -18574,21 +18574,44 @@ var extraCommands = [
18574
18574
  }
18575
18575
  try {
18576
18576
  const settings = JSON.parse(_fs.readFileSync.call(void 0, settingsFile, "utf-8"));
18577
- let removed = false;
18577
+ const cleared = [];
18578
18578
  if (_optionalChain([settings, 'access', _201 => _201.model, 'optionalAccess', _202 => _202.apiKey])) {
18579
18579
  delete settings.model.apiKey;
18580
- removed = true;
18580
+ cleared.push("model.apiKey");
18581
+ }
18582
+ if (Array.isArray(settings.models)) {
18583
+ let n = 0;
18584
+ for (const m of settings.models) {
18585
+ if (m && typeof m === "object" && m.apiKey) {
18586
+ delete m.apiKey;
18587
+ n++;
18588
+ }
18589
+ }
18590
+ if (n > 0) cleared.push(`models[].apiKey (${n})`);
18581
18591
  }
18582
18592
  if (settings.arena) {
18583
18593
  delete settings.arena;
18584
- removed = true;
18594
+ cleared.push("arena");
18585
18595
  }
18586
- if (removed) {
18587
- _fs.writeFileSync.call(void 0, settingsFile, JSON.stringify(settings, null, 2), "utf-8");
18588
- ctx.addStatus("\u2713 API key and Arena config cleared. Restart to re-enter onboarding.");
18589
- } else {
18590
- ctx.addStatus("No saved API key.");
18596
+ const ENV_KEYS = [
18597
+ "ANTHROPIC_API_KEY",
18598
+ "OPENAI_API_KEY",
18599
+ "OPENROUTER_API_KEY",
18600
+ "DEEPSEEK_API_KEY"
18601
+ ];
18602
+ const activeEnv = ENV_KEYS.filter((k) => process.env[k]);
18603
+ if (cleared.length === 0) {
18604
+ const envNote2 = activeEnv.length ? `
18605
+ Note: env var(s) still set: ${activeEnv.join(", ")} \u2014 unset to fully log out.` : "";
18606
+ ctx.addStatus(`No saved API key.${envNote2}`);
18607
+ return;
18591
18608
  }
18609
+ _fs.writeFileSync.call(void 0, settingsFile, JSON.stringify(settings, null, 2), "utf-8");
18610
+ const envNote = activeEnv.length ? `
18611
+ \u26A0 Env var(s) still set: ${activeEnv.join(", ")} \u2014 unset to fully log out.` : "";
18612
+ ctx.addStatus(
18613
+ `\u2713 Cleared: ${cleared.join(", ")}. Restart to re-enter onboarding.${envNote}`
18614
+ );
18592
18615
  } catch (err) {
18593
18616
  ctx.addStatus(`Failed: ${err.message}`);
18594
18617
  }
@@ -19327,7 +19350,7 @@ function App2({
19327
19350
  const [modelsRes, arenaRes, snapMod] = await Promise.all([
19328
19351
  client.query("models"),
19329
19352
  client.query("config_get", "arena.participants"),
19330
- Promise.resolve().then(() => _interopRequireWildcard(require("../openrouter-models-UM3AOGZ4.cjs")))
19353
+ Promise.resolve().then(() => _interopRequireWildcard(require("../openrouter-models-PLCWZZYE.cjs")))
19331
19354
  ]);
19332
19355
  const entries = _nullishCoalesce(modelsRes.data, () => ( []));
19333
19356
  const snap = snapMod.getOpenRouterSnapshot();
@@ -19764,9 +19787,9 @@ ${trimmed}`;
19764
19787
  );
19765
19788
  },
19766
19789
  onSync: async () => {
19767
- const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("../openrouter-sync-HYZZC6RX.cjs")));
19790
+ const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("../openrouter-sync-K2WK3A2A.cjs")));
19768
19791
  const r = await mod.syncOpenRouterCatalog();
19769
- const snapMod = await Promise.resolve().then(() => _interopRequireWildcard(require("../openrouter-models-UM3AOGZ4.cjs")));
19792
+ const snapMod = await Promise.resolve().then(() => _interopRequireWildcard(require("../openrouter-models-PLCWZZYE.cjs")));
19770
19793
  const snap = snapMod.getOpenRouterSnapshot();
19771
19794
  setModelManager(
19772
19795
  (prev) => prev ? { ...prev, snapshot: { count: snap.count, fetchedAt: snap.fetchedAt } } : prev
@@ -20689,10 +20712,10 @@ async function startInkRepl(options) {
20689
20712
  initHistory(sessionId, options.cwd);
20690
20713
  _chunkJHNCK7JPcjs.logger.setSid(sessionId);
20691
20714
  if (process.env.CODESHELL_NO_MODEL_SYNC !== "1") {
20692
- const snap = _chunkTATCTZSBcjs.getOpenRouterSnapshot.call(void 0, );
20715
+ const snap = _chunkBF4LXLQVcjs.getOpenRouterSnapshot.call(void 0, );
20693
20716
  const ageMs = snap.fetchedAt ? Date.now() - new Date(snap.fetchedAt).getTime() : Infinity;
20694
20717
  if (ageMs > 24 * 60 * 60 * 1e3) {
20695
- void _chunkG76E5FOBcjs.syncOpenRouterCatalog.call(void 0, ).catch(() => {
20718
+ void _chunkVIPLU4RYcjs.syncOpenRouterCatalog.call(void 0, ).catch(() => {
20696
20719
  });
20697
20720
  }
20698
20721
  }
package/dist/cli/main.js CHANGED
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  syncOpenRouterCatalog
4
- } from "../chunk-FA5KD34T.js";
4
+ } from "../chunk-TDXBHD24.js";
5
5
  import {
6
6
  findOpenRouterModel,
7
7
  getOpenRouterModels,
8
8
  getOpenRouterSnapshot
9
- } from "../chunk-OMRGA6TI.js";
9
+ } from "../chunk-FPFTIKEJ.js";
10
10
  import {
11
11
  Engine,
12
12
  FileRunStore,
@@ -18495,7 +18495,7 @@ var utilityCommands = [
18495
18495
  description: "Check for and install updates",
18496
18496
  execute: async (_arg, ctx) => {
18497
18497
  try {
18498
- const { getCurrentVersion, getUpdateAvailable } = await import("../updater-ZRTONIR4.js");
18498
+ const { getCurrentVersion, getUpdateAvailable } = await import("../updater-LDBNYCAO.js");
18499
18499
  const current = getCurrentVersion();
18500
18500
  const available = getUpdateAvailable();
18501
18501
  if (available) {
@@ -18574,21 +18574,44 @@ var extraCommands = [
18574
18574
  }
18575
18575
  try {
18576
18576
  const settings = JSON.parse(readFileSync4(settingsFile, "utf-8"));
18577
- let removed = false;
18577
+ const cleared = [];
18578
18578
  if (settings.model?.apiKey) {
18579
18579
  delete settings.model.apiKey;
18580
- removed = true;
18580
+ cleared.push("model.apiKey");
18581
+ }
18582
+ if (Array.isArray(settings.models)) {
18583
+ let n = 0;
18584
+ for (const m of settings.models) {
18585
+ if (m && typeof m === "object" && m.apiKey) {
18586
+ delete m.apiKey;
18587
+ n++;
18588
+ }
18589
+ }
18590
+ if (n > 0) cleared.push(`models[].apiKey (${n})`);
18581
18591
  }
18582
18592
  if (settings.arena) {
18583
18593
  delete settings.arena;
18584
- removed = true;
18594
+ cleared.push("arena");
18585
18595
  }
18586
- if (removed) {
18587
- writeFileSync4(settingsFile, JSON.stringify(settings, null, 2), "utf-8");
18588
- ctx.addStatus("\u2713 API key and Arena config cleared. Restart to re-enter onboarding.");
18589
- } else {
18590
- ctx.addStatus("No saved API key.");
18596
+ const ENV_KEYS = [
18597
+ "ANTHROPIC_API_KEY",
18598
+ "OPENAI_API_KEY",
18599
+ "OPENROUTER_API_KEY",
18600
+ "DEEPSEEK_API_KEY"
18601
+ ];
18602
+ const activeEnv = ENV_KEYS.filter((k) => process.env[k]);
18603
+ if (cleared.length === 0) {
18604
+ const envNote2 = activeEnv.length ? `
18605
+ Note: env var(s) still set: ${activeEnv.join(", ")} \u2014 unset to fully log out.` : "";
18606
+ ctx.addStatus(`No saved API key.${envNote2}`);
18607
+ return;
18591
18608
  }
18609
+ writeFileSync4(settingsFile, JSON.stringify(settings, null, 2), "utf-8");
18610
+ const envNote = activeEnv.length ? `
18611
+ \u26A0 Env var(s) still set: ${activeEnv.join(", ")} \u2014 unset to fully log out.` : "";
18612
+ ctx.addStatus(
18613
+ `\u2713 Cleared: ${cleared.join(", ")}. Restart to re-enter onboarding.${envNote}`
18614
+ );
18592
18615
  } catch (err) {
18593
18616
  ctx.addStatus(`Failed: ${err.message}`);
18594
18617
  }
@@ -19327,7 +19350,7 @@ function App2({
19327
19350
  const [modelsRes, arenaRes, snapMod] = await Promise.all([
19328
19351
  client.query("models"),
19329
19352
  client.query("config_get", "arena.participants"),
19330
- import("../openrouter-models-OL725CL6.js")
19353
+ import("../openrouter-models-2FM3H4SQ.js")
19331
19354
  ]);
19332
19355
  const entries = modelsRes.data ?? [];
19333
19356
  const snap = snapMod.getOpenRouterSnapshot();
@@ -19764,9 +19787,9 @@ ${trimmed}`;
19764
19787
  );
19765
19788
  },
19766
19789
  onSync: async () => {
19767
- const mod = await import("../openrouter-sync-CWD5VNW2.js");
19790
+ const mod = await import("../openrouter-sync-SO3AWEAM.js");
19768
19791
  const r = await mod.syncOpenRouterCatalog();
19769
- const snapMod = await import("../openrouter-models-OL725CL6.js");
19792
+ const snapMod = await import("../openrouter-models-2FM3H4SQ.js");
19770
19793
  const snap = snapMod.getOpenRouterSnapshot();
19771
19794
  setModelManager(
19772
19795
  (prev) => prev ? { ...prev, snapshot: { count: snap.count, fetchedAt: snap.fetchedAt } } : prev
@@ -4,7 +4,7 @@ import {
4
4
  getOpenRouterSnapshot,
5
5
  listOpenRouterModelsByVendor,
6
6
  setOpenRouterSnapshot
7
- } from "./chunk-OMRGA6TI.js";
7
+ } from "./chunk-FPFTIKEJ.js";
8
8
  import "./chunk-DI7RDLOS.js";
9
9
  export {
10
10
  findOpenRouterModel,
@@ -0,0 +1,15 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+ var _chunkBF4LXLQVcjs = require('./chunk-BF4LXLQV.cjs');
8
+ require('./chunk-IJSHQGMP.cjs');
9
+
10
+
11
+
12
+
13
+
14
+
15
+ exports.findOpenRouterModel = _chunkBF4LXLQVcjs.findOpenRouterModel; exports.getOpenRouterModels = _chunkBF4LXLQVcjs.getOpenRouterModels; exports.getOpenRouterSnapshot = _chunkBF4LXLQVcjs.getOpenRouterSnapshot; exports.listOpenRouterModelsByVendor = _chunkBF4LXLQVcjs.listOpenRouterModelsByVendor; exports.setOpenRouterSnapshot = _chunkBF4LXLQVcjs.setOpenRouterSnapshot;
@@ -0,0 +1,11 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkVIPLU4RYcjs = require('./chunk-VIPLU4RY.cjs');
4
+
5
+
6
+ var _chunkBF4LXLQVcjs = require('./chunk-BF4LXLQV.cjs');
7
+ require('./chunk-IJSHQGMP.cjs');
8
+
9
+
10
+
11
+ exports.getOpenRouterSnapshot = _chunkBF4LXLQVcjs.getOpenRouterSnapshot; exports.syncOpenRouterCatalog = _chunkVIPLU4RYcjs.syncOpenRouterCatalog;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  syncOpenRouterCatalog
3
- } from "./chunk-FA5KD34T.js";
3
+ } from "./chunk-TDXBHD24.js";
4
4
  import {
5
5
  getOpenRouterSnapshot
6
- } from "./chunk-OMRGA6TI.js";
6
+ } from "./chunk-FPFTIKEJ.js";
7
7
  import "./chunk-DI7RDLOS.js";
8
8
  export {
9
9
  getOpenRouterSnapshot,
@@ -8,7 +8,7 @@ var require_package = _chunkIJSHQGMPcjs.__commonJS.call(void 0, {
8
8
  "package.json"(exports, module) {
9
9
  module.exports = {
10
10
  name: "@cjhyy/code-shell",
11
- version: "0.1.0-alpha.2",
11
+ version: "0.1.0-alpha.3",
12
12
  description: "Code Shell \u2014 general-purpose agent orchestration framework with a terminal coding preset",
13
13
  type: "module",
14
14
  main: "./dist/index.cjs",
@@ -52,6 +52,7 @@ var require_package = _chunkIJSHQGMPcjs.__commonJS.call(void 0, {
52
52
  access: "public"
53
53
  },
54
54
  scripts: {
55
+ preinstall: "node scripts/check-node.cjs",
55
56
  build: "bun run sync-models && bun run tsup && bun run build:dts",
56
57
  "build:dts": "tsc --emitDeclarationOnly --declaration --outDir dist || true",
57
58
  "sync-models": "bun run scripts/sync-models.ts",
@@ -64,10 +65,11 @@ var require_package = _chunkIJSHQGMPcjs.__commonJS.call(void 0, {
64
65
  prepublishOnly: "bun run build"
65
66
  },
66
67
  engines: {
67
- node: ">=20"
68
+ node: ">=20.10"
68
69
  },
69
70
  files: [
70
71
  "dist",
72
+ "scripts/check-node.cjs",
71
73
  "README.md",
72
74
  "LICENSE",
73
75
  "CHANGELOG.md"
@@ -8,7 +8,7 @@ var require_package = __commonJS({
8
8
  "package.json"(exports, module) {
9
9
  module.exports = {
10
10
  name: "@cjhyy/code-shell",
11
- version: "0.1.0-alpha.2",
11
+ version: "0.1.0-alpha.3",
12
12
  description: "Code Shell \u2014 general-purpose agent orchestration framework with a terminal coding preset",
13
13
  type: "module",
14
14
  main: "./dist/index.cjs",
@@ -52,6 +52,7 @@ var require_package = __commonJS({
52
52
  access: "public"
53
53
  },
54
54
  scripts: {
55
+ preinstall: "node scripts/check-node.cjs",
55
56
  build: "bun run sync-models && bun run tsup && bun run build:dts",
56
57
  "build:dts": "tsc --emitDeclarationOnly --declaration --outDir dist || true",
57
58
  "sync-models": "bun run scripts/sync-models.ts",
@@ -64,10 +65,11 @@ var require_package = __commonJS({
64
65
  prepublishOnly: "bun run build"
65
66
  },
66
67
  engines: {
67
- node: ">=20"
68
+ node: ">=20.10"
68
69
  },
69
70
  files: [
70
71
  "dist",
72
+ "scripts/check-node.cjs",
71
73
  "README.md",
72
74
  "LICENSE",
73
75
  "CHANGELOG.md"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cjhyy/code-shell",
3
- "version": "0.1.0-alpha.2",
3
+ "version": "0.1.0-alpha.3",
4
4
  "description": "Code Shell — general-purpose agent orchestration framework with a terminal coding preset",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -44,6 +44,7 @@
44
44
  "access": "public"
45
45
  },
46
46
  "scripts": {
47
+ "preinstall": "node scripts/check-node.cjs",
47
48
  "build": "bun run sync-models && bun run tsup && bun run build:dts",
48
49
  "build:dts": "tsc --emitDeclarationOnly --declaration --outDir dist || true",
49
50
  "sync-models": "bun run scripts/sync-models.ts",
@@ -56,10 +57,11 @@
56
57
  "prepublishOnly": "bun run build"
57
58
  },
58
59
  "engines": {
59
- "node": ">=20"
60
+ "node": ">=20.10"
60
61
  },
61
62
  "files": [
62
63
  "dist",
64
+ "scripts/check-node.cjs",
63
65
  "README.md",
64
66
  "LICENSE",
65
67
  "CHANGELOG.md"
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ const REQUIRED_MAJOR = 20;
3
+ const REQUIRED_MINOR = 10;
4
+
5
+ const [major, minor] = process.versions.node.split('.').map(Number);
6
+
7
+ if (major < REQUIRED_MAJOR || (major === REQUIRED_MAJOR && minor < REQUIRED_MINOR)) {
8
+ const red = (s) => `\x1b[31m${s}\x1b[0m`;
9
+ const bold = (s) => `\x1b[1m${s}\x1b[0m`;
10
+ console.error('');
11
+ console.error(red(bold('✖ @cjhyy/code-shell requires Node.js >= 20.10')));
12
+ console.error(` current: ${process.versions.node}`);
13
+ console.error('');
14
+ console.error(' Some dependencies use ESM import attributes (`with { type: "json" }`),');
15
+ console.error(' which Node 16/18 do not support.');
16
+ console.error('');
17
+ console.error(' Fix: install Node 20.10+ (or 22 LTS) via nvm:');
18
+ console.error(' nvm install 22 && nvm use 22');
19
+ console.error('');
20
+ process.exit(1);
21
+ }
@@ -1,15 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
-
6
-
7
- var _chunkTATCTZSBcjs = require('./chunk-TATCTZSB.cjs');
8
- require('./chunk-IJSHQGMP.cjs');
9
-
10
-
11
-
12
-
13
-
14
-
15
- exports.findOpenRouterModel = _chunkTATCTZSBcjs.findOpenRouterModel; exports.getOpenRouterModels = _chunkTATCTZSBcjs.getOpenRouterModels; exports.getOpenRouterSnapshot = _chunkTATCTZSBcjs.getOpenRouterSnapshot; exports.listOpenRouterModelsByVendor = _chunkTATCTZSBcjs.listOpenRouterModelsByVendor; exports.setOpenRouterSnapshot = _chunkTATCTZSBcjs.setOpenRouterSnapshot;
@@ -1,11 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkG76E5FOBcjs = require('./chunk-G76E5FOB.cjs');
4
-
5
-
6
- var _chunkTATCTZSBcjs = require('./chunk-TATCTZSB.cjs');
7
- require('./chunk-IJSHQGMP.cjs');
8
-
9
-
10
-
11
- exports.getOpenRouterSnapshot = _chunkTATCTZSBcjs.getOpenRouterSnapshot; exports.syncOpenRouterCatalog = _chunkG76E5FOBcjs.syncOpenRouterCatalog;