macroclaw 0.13.0 → 0.14.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "macroclaw",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Telegram-to-Claude-Code bridge",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/cli.test.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { describe, expect, it, mock } from "bun:test";
2
2
  import { runCommand } from "citty";
3
3
  import { Cli, createReadlineIo, handleError } from "./cli";
4
- import type { SystemService } from "./service";
5
4
  import { SettingsManager } from "./settings";
6
5
  import type { SetupWizard } from "./setup";
6
+ import type { SystemServiceManager } from "./system-service";
7
7
 
8
8
  // Only mock ./index — safe since no other test imports it
9
9
  const mockStart = mock(async () => {});
@@ -109,7 +109,7 @@ describe("Cli.setup", () => {
109
109
  });
110
110
  });
111
111
 
112
- function mockService(overrides?: Partial<SystemService>): SystemService {
112
+ function mockService(overrides?: Record<string, unknown>): SystemServiceManager {
113
113
  return {
114
114
  install: mock(() => ""),
115
115
  uninstall: mock(() => {}),
@@ -119,7 +119,7 @@ function mockService(overrides?: Partial<SystemService>): SystemService {
119
119
  status: mock(() => ({ installed: false, running: false, platform: "systemd" as const })),
120
120
  logs: mock(() => "journalctl -u macroclaw -n 50 --no-pager"),
121
121
  ...overrides,
122
- };
122
+ } as unknown as SystemServiceManager;
123
123
  }
124
124
 
125
125
  describe("Cli.service", () => {
package/src/cli.ts CHANGED
@@ -2,20 +2,20 @@ import {execSync} from "node:child_process";
2
2
  import {createInterface} from "node:readline";
3
3
  import {defineCommand} from "citty";
4
4
  import pkg from "../package.json" with {type: "json"};
5
- import {ServiceManager, type SystemService} from "./service";
6
5
  import {loadSessions} from "./sessions";
7
6
  import {SettingsManager} from "./settings";
8
7
  import {type SetupIo, SetupWizard} from "./setup";
8
+ import {SystemServiceManager} from "./system-service";
9
9
 
10
10
  export class Cli {
11
11
  readonly #settingsManager: SettingsManager;
12
12
  readonly #setupWizard: SetupWizard;
13
- readonly #serviceManager: SystemService;
13
+ readonly #serviceManager: SystemServiceManager;
14
14
 
15
- constructor(opts?: { wizard?: SetupWizard; settings?: SettingsManager; systemService?: SystemService }) {
15
+ constructor(opts?: { wizard?: SetupWizard; settings?: SettingsManager; systemService?: SystemServiceManager }) {
16
16
  this.#settingsManager = opts?.settings ?? new SettingsManager();
17
17
  this.#setupWizard = opts?.wizard ?? new SetupWizard(createReadlineIo());
18
- this.#serviceManager = opts?.systemService ?? new ServiceManager();
18
+ this.#serviceManager = opts?.systemService ?? new SystemServiceManager();
19
19
  }
20
20
 
21
21
  async setup(): Promise<void> {
package/src/setup.ts CHANGED
@@ -128,7 +128,7 @@ export class SetupWizard {
128
128
  }
129
129
 
130
130
  try {
131
- const svc = this.#serviceInstaller ?? new (await import("./service")).ServiceManager();
131
+ const svc = this.#serviceInstaller ?? new (await import("./system-service")).SystemServiceManager();
132
132
  const logCmd = svc.install(oauthToken);
133
133
  this.#io.write(`Service installed and started. Check logs:\n ${logCmd}\n`);
134
134
  } catch (err) {