routstrd 0.1.0 → 0.1.1

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/index.js CHANGED
@@ -13699,7 +13699,7 @@ function alphabet(alphabet2) {
13699
13699
  }
13700
13700
  };
13701
13701
  }
13702
- function join6(separator = "") {
13702
+ function join5(separator = "") {
13703
13703
  if (typeof separator !== "string")
13704
13704
  throw new Error("join separator should be string");
13705
13705
  return {
@@ -13952,15 +13952,15 @@ function genBech32(encoding) {
13952
13952
  }
13953
13953
  return { encode, decode, decodeToBytes, decodeUnsafe, fromWords, fromWordsUnsafe, toWords };
13954
13954
  }
13955
- var gcd = (a, b) => !b ? a : gcd(b, a % b), radix2carry = (from, to) => from + (to - gcd(from, to)), base16, base32, base32hex, base32crockford, base64, base64url, genBase58 = (abc) => chain(radix(58), alphabet(abc), join6("")), base58, base58flickr, base58xrp, XMR_BLOCK_LEN, base58xmr, BECH_ALPHABET, POLYMOD_GENERATORS, bech32, bech32m, utf8, hex, CODERS, coderTypeError;
13955
+ var gcd = (a, b) => !b ? a : gcd(b, a % b), radix2carry = (from, to) => from + (to - gcd(from, to)), base16, base32, base32hex, base32crockford, base64, base64url, genBase58 = (abc) => chain(radix(58), alphabet(abc), join5("")), base58, base58flickr, base58xrp, XMR_BLOCK_LEN, base58xmr, BECH_ALPHABET, POLYMOD_GENERATORS, bech32, bech32m, utf8, hex, CODERS, coderTypeError;
13956
13956
  var init_esm2 = __esm(() => {
13957
13957
  /*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
13958
- base16 = chain(radix2(4), alphabet("0123456789ABCDEF"), join6(""));
13959
- base32 = chain(radix2(5), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"), padding(5), join6(""));
13960
- base32hex = chain(radix2(5), alphabet("0123456789ABCDEFGHIJKLMNOPQRSTUV"), padding(5), join6(""));
13961
- base32crockford = chain(radix2(5), alphabet("0123456789ABCDEFGHJKMNPQRSTVWXYZ"), join6(""), normalize((s) => s.toUpperCase().replace(/O/g, "0").replace(/[IL]/g, "1")));
13962
- base64 = chain(radix2(6), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"), padding(6), join6(""));
13963
- base64url = chain(radix2(6), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"), padding(6), join6(""));
13958
+ base16 = chain(radix2(4), alphabet("0123456789ABCDEF"), join5(""));
13959
+ base32 = chain(radix2(5), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"), padding(5), join5(""));
13960
+ base32hex = chain(radix2(5), alphabet("0123456789ABCDEFGHIJKLMNOPQRSTUV"), padding(5), join5(""));
13961
+ base32crockford = chain(radix2(5), alphabet("0123456789ABCDEFGHJKMNPQRSTVWXYZ"), join5(""), normalize((s) => s.toUpperCase().replace(/O/g, "0").replace(/[IL]/g, "1")));
13962
+ base64 = chain(radix2(6), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"), padding(6), join5(""));
13963
+ base64url = chain(radix2(6), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"), padding(6), join5(""));
13964
13964
  base58 = genBase58("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");
13965
13965
  base58flickr = genBase58("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ");
13966
13966
  base58xrp = genBase58("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");
@@ -13989,7 +13989,7 @@ var init_esm2 = __esm(() => {
13989
13989
  return Uint8Array.from(res);
13990
13990
  }
13991
13991
  };
13992
- BECH_ALPHABET = chain(alphabet("qpzry9x8gf2tvdw0s3jn54khce6mua7l"), join6(""));
13992
+ BECH_ALPHABET = chain(alphabet("qpzry9x8gf2tvdw0s3jn54khce6mua7l"), join5(""));
13993
13993
  POLYMOD_GENERATORS = [996825010, 642813549, 513874426, 1027748829, 705979059];
13994
13994
  bech32 = genBech32("bech32");
13995
13995
  bech32m = genBech32("bech32m");
@@ -13997,7 +13997,7 @@ var init_esm2 = __esm(() => {
13997
13997
  encode: (data) => new TextDecoder().decode(data),
13998
13998
  decode: (str) => new TextEncoder().encode(str)
13999
13999
  };
14000
- hex = chain(radix2(4), alphabet("0123456789abcdef"), join6(""), normalize((s) => {
14000
+ hex = chain(radix2(4), alphabet("0123456789abcdef"), join5(""), normalize((s) => {
14001
14001
  if (typeof s !== "string" || s.length % 2)
14002
14002
  throw new TypeError(`hex.decode: expected string, got ${typeof s} with length ${s.length}`);
14003
14003
  return s.toLowerCase();
@@ -24554,7 +24554,7 @@ async function startDaemon(options = {}) {
24554
24554
  if (!existsSync2(logDir)) {
24555
24555
  mkdirSync(logDir, { recursive: true });
24556
24556
  }
24557
- const daemonScript = `${import.meta.dir}/daemon/index.ts`;
24557
+ const daemonScript = new URL("./daemon/index.js", import.meta.url).pathname;
24558
24558
  const shellCmd = `bun run "${daemonScript}" ${args.map((a) => `'${a}'`).join(" ")} >> "${LOG_FILE}" 2>&1`;
24559
24559
  const proc = Bun.spawn(["sh", "-c", shellCmd], {
24560
24560
  stdout: "inherit",
@@ -24598,8 +24598,8 @@ import { existsSync as existsSync7, mkdirSync as mkdirSync5 } from "fs";
24598
24598
  import { randomBytes } from "crypto";
24599
24599
  import { existsSync as existsSync4, mkdirSync as mkdirSync2 } from "fs";
24600
24600
  import { readFile, writeFile } from "fs/promises";
24601
- import { dirname as dirname2, join as join3 } from "path";
24602
- var OPENCODE_CONFIG_PATH = join3(process.env.HOME || "", ".config/opencode/opencode.json");
24601
+ import { dirname as dirname2, join as join2 } from "path";
24602
+ var OPENCODE_CONFIG_PATH = join2(process.env.HOME || "", ".config/opencode/opencode.json");
24603
24603
  var OPENCODE_SMALL_MODEL = "routstr/minimax-m2.5";
24604
24604
  var OPENCODE_CLIENT_ID = "opencode";
24605
24605
  var OPENCODE_NAME = "OpenCode";
@@ -24679,8 +24679,8 @@ Installing routstr models in opencode.json...`);
24679
24679
  import { randomBytes as randomBytes2 } from "crypto";
24680
24680
  import { existsSync as existsSync5, mkdirSync as mkdirSync3 } from "fs";
24681
24681
  import { readFile as readFile2, writeFile as writeFile2 } from "fs/promises";
24682
- import { dirname as dirname3, join as join4 } from "path";
24683
- var OPENCLAW_CONFIG_PATH = join4(process.env.HOME || "", ".openclaw/openclaw.json");
24682
+ import { dirname as dirname3, join as join3 } from "path";
24683
+ var OPENCLAW_CONFIG_PATH = join3(process.env.HOME || "", ".openclaw/openclaw.json");
24684
24684
  var OPENCLAW_PROVIDER_ID = "routstr";
24685
24685
  var OPENCLAW_API_BASE = "http://localhost:8008/v1";
24686
24686
  var OPENCLAW_DEFAULT_PRIMARY_MODEL = "routstr/minimax-m2.5";
@@ -24780,8 +24780,8 @@ Installing routstr models in openclaw.json...`);
24780
24780
  import { randomBytes as randomBytes3 } from "crypto";
24781
24781
  import { existsSync as existsSync6, mkdirSync as mkdirSync4 } from "fs";
24782
24782
  import { readFile as readFile3, writeFile as writeFile3 } from "fs/promises";
24783
- import { dirname as dirname4, join as join5 } from "path";
24784
- var PI_CONFIG_PATH = join5(process.env.HOME || "", ".pi/agent/models.json");
24783
+ import { dirname as dirname4, join as join4 } from "path";
24784
+ var PI_CONFIG_PATH = join4(process.env.HOME || "", ".pi/agent/models.json");
24785
24785
  var PI_CLIENT_ID = "pi-agent";
24786
24786
  var PI_NAME = "Pi Agent";
24787
24787
  function generateApiKey3() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "routstrd",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "module": "src/index.ts",
5
5
  "type": "module",
6
6
  "private": false,
@@ -12,7 +12,7 @@
12
12
  "monitor": "bun src/index.ts monitor",
13
13
  "lint": "tsc --noEmit",
14
14
  "test": "bun test",
15
- "build": "bun build src/index.ts --target=bun --outfile=dist/index.js",
15
+ "build": "mkdir -p dist/daemon && bun build src/index.ts --target=bun --outfile=dist/index.js && bun build src/daemon/index.ts --target=bun --outfile=dist/daemon/index.js",
16
16
  "prepublishOnly": "bun run build"
17
17
  },
18
18
  "devDependencies": {
@@ -1,7 +1,7 @@
1
1
  import { LOG_FILE } from "./utils/config";
2
2
  import { logger } from "./utils/logger";
3
3
  import { existsSync, mkdirSync } from "fs";
4
- import { dirname, join } from "path";
4
+ import { dirname } from "path";
5
5
 
6
6
  export async function startDaemon(
7
7
  options: { port?: string; provider?: string } = {},
@@ -41,7 +41,7 @@ export async function startDaemon(
41
41
 
42
42
  // Use shell redirection to append stdout/stderr to log file
43
43
  // Bun.file() overwrites, so we need shell >> for appending
44
- const daemonScript = `${import.meta.dir}/daemon/index.ts`;
44
+ const daemonScript = new URL("./daemon/index.js", import.meta.url).pathname;
45
45
  const shellCmd = `bun run "${daemonScript}" ${args.map(a => `'${a}'`).join(" ")} >> "${LOG_FILE}" 2>&1`;
46
46
 
47
47
  const proc = Bun.spawn(["sh", "-c", shellCmd], {