@madh-io/alfred-ai 0.1.1 → 0.1.2

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/bundle/index.js +7 -8
  2. package/package.json +1 -1
package/bundle/index.js CHANGED
@@ -995,7 +995,8 @@ var init_ollama = __esm({
995
995
  }
996
996
  apiKey = "";
997
997
  async initialize() {
998
- this.baseUrl = this.config.baseUrl ?? "http://localhost:11434";
998
+ const raw = this.config.baseUrl ?? "http://localhost:11434";
999
+ this.baseUrl = raw.replace(/\/v1\/?$/, "").replace(/\/+$/, "");
999
1000
  this.apiKey = this.config.apiKey ?? "";
1000
1001
  }
1001
1002
  getHeaders() {
@@ -2704,7 +2705,7 @@ var init_message_pipeline = __esm({
2704
2705
  this.logger.info({ duration, tokens: response.usage, stopReason: response.stopReason, toolIterations: iteration }, "Message processed");
2705
2706
  return responseText;
2706
2707
  } catch (error) {
2707
- this.logger.error({ error }, "Failed to process message");
2708
+ this.logger.error({ err: error }, "Failed to process message");
2708
2709
  throw error;
2709
2710
  }
2710
2711
  }
@@ -3358,16 +3359,16 @@ var init_alfred = __esm({
3358
3359
  const response = await this.pipeline.process(message);
3359
3360
  await adapter.sendMessage(message.chatId, response);
3360
3361
  } catch (error) {
3361
- this.logger.error({ platform, error, chatId: message.chatId }, "Failed to handle message");
3362
+ this.logger.error({ platform, err: error, chatId: message.chatId }, "Failed to handle message");
3362
3363
  try {
3363
3364
  await adapter.sendMessage(message.chatId, "Sorry, I encountered an error processing your message. Please try again.");
3364
3365
  } catch (sendError) {
3365
- this.logger.error({ error: sendError }, "Failed to send error message");
3366
+ this.logger.error({ err: sendError }, "Failed to send error message");
3366
3367
  }
3367
3368
  }
3368
3369
  });
3369
3370
  adapter.on("error", (error) => {
3370
- this.logger.error({ platform, error }, "Adapter error");
3371
+ this.logger.error({ platform, err: error }, "Adapter error");
3371
3372
  });
3372
3373
  adapter.on("connected", () => {
3373
3374
  this.logger.info({ platform }, "Adapter connected");
@@ -3511,9 +3512,7 @@ ${bold("Which LLM provider would you like to use?")}`);
3511
3512
  if (provider.name === "ollama") {
3512
3513
  console.log("");
3513
3514
  baseUrl = await askWithDefault(rl, "Ollama URL (use a remote address if Ollama runs on another machine)", "http://localhost:11434");
3514
- if (!baseUrl.endsWith("/v1")) {
3515
- baseUrl = baseUrl.replace(/\/+$/, "") + "/v1";
3516
- }
3515
+ baseUrl = baseUrl.replace(/\/+$/, "");
3517
3516
  console.log(` ${green(">")} Ollama URL: ${dim(baseUrl)}`);
3518
3517
  }
3519
3518
  console.log("");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madh-io/alfred-ai",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Alfred — Personal AI Assistant across Telegram, Discord, WhatsApp, Matrix & Signal",
5
5
  "type": "module",
6
6
  "bin": {