🚀. Socket Launch Week Day 2:Introducing Manifest Alerts.Learn more
Sign In

heymax

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heymax - npm Package Compare versions

Comparing version
1.2.1
to
1.2.2
+3
-3
dist/copilot/router.js

@@ -7,3 +7,3 @@ import { getState, setState } from "../store/db.js";

const DEFAULT_CONFIG = {
enabled: true,
enabled: false,
tierModels: {

@@ -29,3 +29,3 @@ fast: "gpt-4.1",

// ---------------------------------------------------------------------------
let messagesSinceSwitch = 0;
let messagesSinceSwitch = Infinity;
// Short replies that should inherit the previous turn's tier

@@ -119,3 +119,3 @@ const FOLLOW_UP_PATTERNS = [

if (!config.enabled) {
messagesSinceSwitch = 0;
messagesSinceSwitch = Infinity;
return { model: currentModel, tier: null, switched: false, routerMode: "manual" };

@@ -122,0 +122,0 @@ }

@@ -8,2 +8,3 @@ import { Bot } from "grammy";

import { restartDaemon } from "../daemon.js";
import { getRouterConfig, updateRouterConfig } from "../copilot/router.js";
let bot;

@@ -33,2 +34,3 @@ export function createBot() {

"/model <name> — Switch model\n" +
"/auto — Toggle auto model routing\n" +
"/memory — Show stored memories\n" +

@@ -111,2 +113,11 @@ "/skills — List installed skills\n" +

});
bot.command("auto", async (ctx) => {
const current = getRouterConfig();
const newState = !current.enabled;
updateRouterConfig({ enabled: newState });
const label = newState
? "⚡ Auto mode on"
: `Auto mode off · using ${config.copilotModel}`;
await ctx.reply(label);
});
// Handle all text messages

@@ -140,13 +151,9 @@ bot.on("message:text", async (ctx) => {

let indicatorSuffix = "";
if (routeResult) {
indicatorSuffix = routeResult.routerMode === "auto"
? `\n\n_⚡ auto · ${routeResult.model}_`
: `\n\n_${routeResult.model}_`;
if (routeResult && routeResult.routerMode === "auto") {
indicatorSuffix = `\n\n_⚡ auto · ${routeResult.model}_`;
}
const formatted = toTelegramMarkdown(text) + indicatorSuffix;
const chunks = chunkMessage(formatted);
const fallbackText = routeResult
? text + (routeResult.routerMode === "auto"
? `\n\n⚡ auto · ${routeResult.model}`
: `\n\n${routeResult.model}`)
const fallbackText = routeResult && routeResult.routerMode === "auto"
? text + `\n\n⚡ auto · ${routeResult.model}`
: text;

@@ -153,0 +160,0 @@ const fallbackChunks = chunkMessage(fallbackText);

@@ -838,3 +838,5 @@ import * as readline from "readline";

apiPost("/auto", { enabled: newState }, () => {
const label = newState ? `${C.green("⚡")} auto on` : `auto off`;
const label = newState
? `${C.green("⚡")} auto on`
: `auto off · using ${C.cyan(data.currentModel)}`;
console.log(` ${label}\n`);

@@ -841,0 +843,0 @@ });

{
"name": "heymax",
"version": "1.2.1",
"version": "1.2.2",
"description": "Max — a personal AI assistant for developers, built on the GitHub Copilot SDK",

@@ -5,0 +5,0 @@ "bin": {