openhorizon-cli 1.0.10 → 1.0.12

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/index.js +6 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -234,7 +234,7 @@ async function* streamCompletion(baseUrl, apiKey, model, messages) {
234
234
  Authorization: `Bearer ${apiKey}`,
235
235
  "x-api-key": apiKey,
236
236
  "x-client": "openhorizon-cli",
237
- "x-client-version": "1.0.10"
237
+ "x-client-version": "1.0.12"
238
238
  },
239
239
  body: JSON.stringify({
240
240
  model,
@@ -247,13 +247,8 @@ async function* streamCompletion(baseUrl, apiKey, model, messages) {
247
247
  let errorMessage = res.statusText || String(res.status);
248
248
  try {
249
249
  const json = JSON.parse(bodyText);
250
- if (json.details) {
251
- errorMessage = json.details;
252
- } else if (json.error) {
253
- errorMessage = json.error;
254
- } else {
255
- errorMessage = bodyText;
256
- }
250
+ let rawMsg = json.details || json.error || bodyText;
251
+ errorMessage = rawMsg.replace(/^(error:?\s*)+/i, "");
257
252
  } catch {
258
253
  errorMessage = bodyText || res.statusText || String(res.status);
259
254
  }
@@ -335,12 +330,12 @@ async function runChatLoop(options) {
335
330
  }
336
331
  if (trimmed === "/version") {
337
332
  console.log(chalk3.blue(`
338
- OpenHorizon CLI version: ${chalk3.bold("1.0.10")}
333
+ OpenHorizon CLI version: ${chalk3.bold("1.0.12")}
339
334
  `));
340
335
  continue;
341
336
  }
342
337
  if (trimmed === "/update") {
343
- await runUpdate("1.0.10");
338
+ await runUpdate("1.0.12");
344
339
  continue;
345
340
  }
346
341
  if (trimmed.startsWith("/history")) {
@@ -432,7 +427,7 @@ async function runChatLoop(options) {
432
427
  // src/index.ts
433
428
  dotenv.config();
434
429
  var program = new Command();
435
- var version = "1.0.10";
430
+ var version = "1.0.12";
436
431
  program.name("openhorizon").description("CLI to interact with OpenHorizon AI Models").version(version, "-v, --version", "Output the current version");
437
432
  program.command("version").description("Show the current CLI version").action(() => {
438
433
  console.log(chalk4.blue(`OpenHorizon CLI version: ${chalk4.bold(version)}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openhorizon-cli",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "Official CLI for OpenHorizon — chat with AI models directly from your terminal",
5
5
  "type": "module",
6
6
  "bin": {