@cmodjs/core 5.9.0 → 5.10.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/docs/commands.md CHANGED
@@ -342,13 +342,15 @@ Starts a task in a new background Claude Code session, for a mod's `startTask` w
342
342
  ### cmod program
343
343
 
344
344
  ```text
345
- cmod program <mod> [--no-wait | --service [--env <name>]...] -- <command…>
345
+ cmod program <mod> [--no-wait | --service [--env <name>]... | --remove-service] -- <command…>
346
346
  ```
347
347
 
348
348
  Runs one copy of a mod's program for the whole computer, for a `program` job with `singleInstance` ([jobs.md](jobs.md#program)). The first one takes `instances/<mod>/<program>.json.lock` in the cmod store, runs the command without `CLAUDE_CODE_SESSION_ID`, because the copy serves every session, writes its first line on standard output, its address, with the copy's process to `instances/<mod>/<program>.json`, and prints it. It touches its file in the lock every 5 seconds. With `--no-wait`, which a mod's session passes, another one touches the holder's file, prints `held`, and exits 0, and the session reads the address from `instances/<mod>/<program>.json` and runs `cmod program` again once that file is gone or the holder's file is 15 seconds old. Without it, as a mod built on `@cmodjs/core` before 5.3.0 runs it, another one prints the address in that file, then each new one as it changes, and tries the lock again whenever that folder changes and every 5 seconds, so it takes over once the holder exits. A lock whose process is gone counts as free. The holder stops its copy and gives up the lock on SIGTERM, SIGINT, or SIGHUP, and when the session that started it exits, which it checks every 5 seconds. When the copy exits on its own, the holder exits with the copy's exit code, and the copy's standard error passes through. A new holder that finds a copy an earlier holder left running sends it SIGTERM, then SIGKILL after 5 seconds, and starts its own copy only once that one is gone, so two copies never run at once.
349
349
 
350
350
  With `--service`, which a session passes for a `program` job with `isService`, it makes the holder a service of the computer named `com.claudemodmanager.<mod>.<program>`: a launchd agent in `~/Library/LaunchAgents` on macOS, loaded into the person's login session, and a systemd user service in `~/.config/systemd/user` on Linux, enabled for `default.target`. Its file is mode 600, because it holds the program's environment. The service runs `cmod program <mod> -- <command…>` through the cmod store's `programs/cmod` at login and again whenever it exits, launchd at most once every 10 seconds and systemd 10 seconds after the exit, with `HOME`, `XDG_DATA_HOME`, and `CLAUDE_CONFIG_DIR` as the session has them, a `PATH` of the cmod store's `programs` folder, `/usr/local/bin`, `/opt/homebrew/bin`, `/usr/bin`, `/bin`, `/usr/sbin`, and `/sbin`, and each `--env` variable, which the job passes for each key of its `environment`, `PATH` included. The `PATH` is fixed, because sessions started from different shells hold different ones, and a service rewritten for each would restart at every session start. cmod records it in `services/<mod>/<program>.json` in the cmod store. It loads the service when it is new, changed, or not loaded, waits up to 15 seconds for a holder of `instances/<mod>/<program>.json.lock`, prints `held`, and exits 0, so the session follows the instance file as with `--no-wait`. A service that holds nothing after 15 seconds fails with the command that shows why, `launchctl print gui/<uid>/<label>` or `journalctl --user -u <label>.service`. When the computer does not take the service, such as a Linux machine without a systemd user session, it deletes what it wrote, says why on standard error, and runs as `--no-wait` does. `cmod setup` restarts each service of a mod it sets up, so the service runs the new program, and `cmod teardown` stops and deletes each one.
351
351
 
352
+ With `--remove-service`, it stops the program's service, deletes its file and its record in `services/<mod>/<program>.json`, and exits 0, holding the mod's lock in the cmod store so it never runs beside `cmod setup` or `cmod teardown` of the mod. A program with no service changes nothing. A session that starts a mod runs it for each record in `services/<mod>/` whose program the mod's setup no longer adds as an `isService` program, so a new version that dropped `isService` or renamed the program leaves no service of the old one. A session reads that folder without a process, so a mod with no `services/<mod>/` folder runs nothing for it.
353
+
352
354
  ### cmod option
353
355
 
354
356
  ```text
package/docs/jobs.md CHANGED
@@ -333,7 +333,7 @@ type Program = {
333
333
  - In an interactive session the program starts with the mod. Otherwise it starts at the first `ready()`.
334
334
  - When the program exits, cmod starts it again after 1, 2, 4, 8, and 16 seconds. After 5 failed tries, or a first line that is not an address, the state is `fatal`, `ready()` rejects, and cmod logs `<mod>: the <program> program stopped: <reason>`.
335
335
  - `singleInstance: true` runs one copy on the computer, however many sessions load the mod, such as a server that is the only writer of its data. The first session starts the copy through [`cmod program`](commands.md#cmod-program), every other session reads the copy's address from the cmod store and runs no process of its own, and every session's `ready()` resolves that copy's address. When the session running the copy ends, another open session starts a new copy within a few seconds, or within 20 seconds when the copy's session was killed with its `cmod program`, and from then on `ready()` resolves the new address in every session, so ask `ready()` before each use rather than keeping its answer. A copy a killed session left running is stopped before the new one starts. Two `singleInstance` programs with the same program name in one mod throw at `mod.use`.
336
- - `isService: true` makes the program a service of the computer, so it runs whenever the person is logged in, with no Claude Code open, such as a program that records sessions Claude Code never sees. The first session that starts the mod has [`cmod program`](commands.md#cmod-program) write a launchd agent on macOS, or a systemd user service on Linux, which starts the program at login and again whenever it exits, with `environment`. The service's `PATH` is cmod's programs folder, `/usr/local/bin`, `/opt/homebrew/bin`, and the system folders, unless `environment` sets `PATH`. Every session reads the service's address from the cmod store, as a `singleInstance` program's sessions do, and `ready()` resolves it. The service runs one copy, so `isService` needs no `singleInstance` beside it. The mod writes no service file: cmod restarts the service when it sets up a new version of the mod, and stops and deletes it when the mod is removed. Settings shows `Runs as a service of this computer` on the mod's page, and [`cmod list`](commands.md#cmod-list) names the program. On a computer that does not take the service, such as a Linux machine without a systemd user session, the program runs as a `singleInstance` program does. Two `isService` programs with the same program name in one mod throw at `mod.use`.
336
+ - `isService: true` makes the program a service of the computer, so it runs whenever the person is logged in, with no Claude Code open, such as a program that records sessions Claude Code never sees. The first session that starts the mod has [`cmod program`](commands.md#cmod-program) write a launchd agent on macOS, or a systemd user service on Linux, which starts the program at login and again whenever it exits, with `environment`. The service's `PATH` is cmod's programs folder, `/usr/local/bin`, `/opt/homebrew/bin`, and the system folders, unless `environment` sets `PATH`. Every session reads the service's address from the cmod store, as a `singleInstance` program's sessions do, and `ready()` resolves it. The service runs one copy, so `isService` needs no `singleInstance` beside it. The mod writes no service file: cmod restarts the service when it sets up a new version of the mod, and stops and deletes it when the mod is removed. When a new version's setup no longer adds the `isService` program, because it dropped `isService` or renamed the program, the first session that starts that version stops and deletes the old service, so the computer stops running a program the mod no longer ships. Settings shows `Runs as a service of this computer` on the mod's page, and [`cmod list`](commands.md#cmod-list) names the program. On a computer that does not take the service, such as a Linux machine without a systemd user session, the program runs as a `singleInstance` program does. Two `isService` programs with the same program name in one mod throw at `mod.use`.
337
337
  - A program that ships with the mod gets onto `PATH` through the `program` key of the mod's `package.json` ([install-steps.md](install-steps.md)). A program an install step fetched with `cmod download` is not on `PATH`, so `command` names it by its full path, `${mod.dataFolder}/bin/<program>`.
338
338
 
339
339
  ```ts
package/docs/testing.md CHANGED
@@ -319,7 +319,7 @@ Set a fake to answer a call:
319
319
  - A call with no fake throws `<call>(<args>) has no fake answer. Set fakes.<call> on the tested mod.` So set `fakes.process.run` before a test runs a program, and `fakes.ui.ask` before the mod asks a question.
320
320
  - A `program` job is the exception: it catches the `process.spawn` error and retries after 1, 2, 4, 8 and 16 seconds on real timers, so its `ready()` waits past `bun test`'s 5-second timeout. Set `fakes.process.spawn` before a test starts a `program` job.
321
321
  - A `program` job with `singleInstance` spawns `/test/home/.local/share/cmod/programs/cmod program <mod> --no-wait -- <command…>`, so `fakes.process.spawn` gets that `argv`, and the first line the fake writes to standard output is the address of the copy this session runs. A fake that writes `held` and ends tests a session another session runs the copy for: `ready()` resolves the address in `/test/home/.local/share/cmod/instances/<mod>/<program>.json`, which the test gives as `{"address":"unix:/tmp/x.sock"}` in `files`.
322
- - A `program` job with `isService` spawns `/test/home/.local/share/cmod/programs/cmod program <mod> --service --env <name> -- <command…>`, with one `--env` for each key of its `environment`, every time it starts, and a fake that writes `held` and ends stands for the service: `ready()` resolves the address in the instance file, as above.
322
+ - A `program` job with `isService` spawns `/test/home/.local/share/cmod/programs/cmod program <mod> --service --env <name> -- <command…>`, with one `--env` for each key of its `environment`, every time it starts, and a fake that writes `held` and ends stands for the service: `ready()` resolves the address in the instance file, as above. A file `/test/home/.local/share/cmod/services/<mod>/<program>.json` in `files` stands for a service an earlier version of the mod wrote: when the mod's setup adds no `isService` program of that name, its start spawns `/test/home/.local/share/cmod/programs/cmod program <mod> --remove-service -- <program>`.
323
323
  - `files` already fills the `fs` fakes: a write is read back, and `list` lists the given files. The fake file system resolves a relative path against `/`, not against the session's working folder, so a mod under test reads `${sessions.current.project}/<file>` rather than a relative path. `fs.list()` with no path rejects.
324
324
  - `ui.open` places every pane by default. A fake that answers `{ isPlaced: false }` holds a pane back.
325
325
  - `ui.scroll` answers `{}` by default, as when the window moved. A fake that answers `{ deny }` refuses the scroll.
package/jobs/program.js CHANGED
@@ -16,7 +16,8 @@ export function program(options) {
16
16
  if (executable === undefined)
17
17
  throw new Error(`${mod.name}: the program has no command. Name the program on PATH and its arguments, such as ['preview-server', '--port', '0'].`);
18
18
  if (isService)
19
- reserveName('program', basename(executable), `${mod.name}: the service ${executable} is already added. Give each isService program its own executable.`);
19
+ for (const type of ['program', 'service'])
20
+ reserveName(type, basename(executable), `${mod.name}: the service ${executable} is already added. Give each isService program its own executable.`);
20
21
  else if (singleInstance)
21
22
  reserveName('program', basename(executable), `${mod.name}: the single instance of ${executable} is already added. Give each singleInstance program its own executable.`);
22
23
  const isElected = singleInstance || isService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmodjs/core",
3
- "version": "5.9.0",
3
+ "version": "5.10.0",
4
4
  "description": "Build Claude Code mods: hooks, panes, checks, and an install that just works.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/records.d.ts CHANGED
@@ -135,8 +135,8 @@ export declare function newestLog(entries: readonly LogEntry[]): LogEntry[];
135
135
  export declare function versionsLine({ mod, core, cmod, program, claudeCode }: LogVersions): string;
136
136
  export declare function logReport(entry: LogEntry): string;
137
137
  export declare function parseConsent(value: unknown, path: string): Record<string, string[]>;
138
- export declare const coreVersion = "5.9.0";
139
- export declare const oldestCmodVersion = "5.9.0";
138
+ export declare const coreVersion = "5.10.0";
139
+ export declare const oldestCmodVersion = "5.10.0";
140
140
  export declare function hotkeyCommand(mod: string, hotkey: string): string;
141
141
  export declare function hotkeyBindings(mod: string, hotkeys: Hotkeys | undefined): Record<string, string>;
142
142
  export declare function boundCombos(keybindings: unknown): Map<string, string>;
package/records.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"records.d.ts","sourceRoot":"","sources":["src/records.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,OAAO,EAAE,MAAM,cAAc,CAAA;AAG1E,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IACtC,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAA;IACrC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,KAAK,GAAG;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAChC,CAAA;AAiBD,MAAM,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;AAEpE,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAChE;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC7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CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE"}
package/records.js CHANGED
@@ -308,8 +308,8 @@ function readHotkeys(hotkeys) {
308
308
  throw new Error(`package.json "cmod.hotkeys" is not a map of hotkeys to their title and optional default combo. ${fix}`);
309
309
  return { hotkeys: checkHotkeys('package.json "cmod"', hotkeys) };
310
310
  }
311
- export const coreVersion = '5.9.0';
312
- export const oldestCmodVersion = '5.9.0';
311
+ export const coreVersion = '5.10.0';
312
+ export const oldestCmodVersion = '5.10.0';
313
313
  export function hotkeyCommand(mod, hotkey) {
314
314
  return `${mod}--${hotkey}`;
315
315
  }
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../src/runtime/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAqB,WAAW,EAAE,MAAM,EAAc,aAAa,EAAwB,MAAM,aAAa,CAAA;AAGxI,OAAO,KAAK,EAAW,GAAG,EAAE,aAAa,EAA8G,MAAM,WAAW,CAAA;AACxK,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,eAAe,CAAA;AAC1D,OAAO,EAA4N,KAAK,KAAK,EAAE,MAAM,eAAe,CAAA;AAGpQ,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAIzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAIvD,OAAO,EAA6F,KAAK,WAAW,EAAE,MAAM,YAAY,CAAA;AACxI,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAM7D,OAAO,EAA2B,KAAK,MAAM,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAA;AAMnF,OAAO,EAA+B,KAAK,UAAU,EAAgB,MAAM,cAAc,CAAA;AAGzF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,YAAY,CAAA;AAEx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AAU,CAAA;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAA;IACjD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAA;CACjD,KAAK,UAAU,CAAA;AAyDhB,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAyBhE;AAwBD,wBAAgB,eAAe,CAAC,KAAK,SAAS,MAAM,EAAE,QAAQ,SAAS,OAAO,GAAG,OAAO,EACtF,UAAU,EAAE,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAClD,gBAAgB,GAAE,MAAM,gBAAgB,GAAG,SAA2B,EACtE,OAAO,GAAE,aAAkB,EAC3B,UAAU,UAAO,EACjB,eAAe,CAAC,EAAE,eAAe,GAChC,SAAS,CAAC,KAAK,CAAC,CA4hBlB"}
@@ -1,4 +1,4 @@
1
- import { dataFolder, finishStepsMethod, isAtLeast, isProgramNewer, oldestCmodVersion, pendingStepsMethod, parseEvent, programPath, readRecord, readSteps, recordPath, scriptsSha256, storeFolder } from '../records.js';
1
+ import { dataFolder, finishStepsMethod, isAtLeast, isProgramNewer, oldestCmodVersion, pendingStepsMethod, parseEvent, programPath, readRecord, readSteps, recordPath, scriptsSha256, serviceFolder, storeFolder } from '../records.js';
2
2
  import { homePrefix, ifMissing, relativePath } from '../utils/paths.js';
3
3
  import { firstLine, formatExit, messageOf } from '../utils/text.js';
4
4
  import { beforeDeadline, settledAfterAbort } from './deadline.js';
@@ -7,7 +7,7 @@ import { bind } from './bound.js';
7
7
  import { answerCall, answeringOwnCalls, cmodPluginName, dependencyCalls, loadedMethod, withBareRefusals } from './dependencies.js';
8
8
  import { keepEngine } from './engine.js';
9
9
  import { classicFailure, classicHook, userSkillHook } from './hooks.js';
10
- import { cmodError, locatingPrograms, newestCmodVersion, readLines, spawnCmod } from './programs.js';
10
+ import { cmodError, locatingPrograms, newestCmodVersion, readLines, runCmod, spawnCmod } from './programs.js';
11
11
  import { createModFiles, resolvedPath } from './metadata.js';
12
12
  import { fitsOption } from '../options.js';
13
13
  import { createInstaller } from './installer.js';
@@ -1047,6 +1047,13 @@ async function createMod(definition, runtime) {
1047
1047
  names.add(key);
1048
1048
  return { remove: () => void names.delete(key) };
1049
1049
  };
1050
+ const removeUndeclaredServices = async () => {
1051
+ for (const { name } of await claude.fs.list(serviceFolder(runtime.store, definition.name)).catch(ifMissing([]))) {
1052
+ const program = name.endsWith('.json') ? name.slice(0, -'.json'.length) : undefined;
1053
+ if (program !== undefined && !names.has(`service:${program}`))
1054
+ await runCmod(claude, ['program', definition.name, '--remove-service', '--', program], session);
1055
+ }
1056
+ };
1050
1057
  await failsAs('its state did not load', () => modState.load());
1051
1058
  await failsAs('its options did not load', () => modOptions.load(root));
1052
1059
  const missing = modOptions.missing;
@@ -1057,6 +1064,7 @@ async function createMod(definition, runtime) {
1057
1064
  api = apiOf(definition.name, returned);
1058
1065
  await failsAs('its open panes did not load', () => area.restorePanes());
1059
1066
  area.started();
1067
+ void removeUndeclaredServices().catch((error) => report({ id: 'program:services', message: 'Could not stop a service it no longer runs', error }));
1060
1068
  return { mod, added, imports, raise: client.raise, area };
1061
1069
  }
1062
1070
  function apiOf(name, returned) {
@@ -27,7 +27,7 @@ export function program(options: { readonly command: readonly string[]; readonly
27
27
  const { claude, report, spawnCmod, watches } = engineOf(mod)
28
28
  const [executable] = command
29
29
  if (executable === undefined) throw new Error(`${mod.name}: the program has no command. Name the program on PATH and its arguments, such as ['preview-server', '--port', '0'].`)
30
- if (isService) reserveName('program', basename(executable), `${mod.name}: the service ${executable} is already added. Give each isService program its own executable.`)
30
+ if (isService) for (const type of ['program', 'service']) reserveName(type, basename(executable), `${mod.name}: the service ${executable} is already added. Give each isService program its own executable.`)
31
31
  else if (singleInstance) reserveName('program', basename(executable), `${mod.name}: the single instance of ${executable} is already added. Give each singleInstance program its own executable.`)
32
32
  const isElected = singleInstance || isService
33
33
  const request = { argv: command, ...(environment === undefined ? {} : { env: environment }) }
package/src/records.ts CHANGED
@@ -377,9 +377,9 @@ function readHotkeys(hotkeys: unknown): Steps {
377
377
  return { hotkeys: checkHotkeys('package.json "cmod"', hotkeys as Record<string, HotkeyInit>) }
378
378
  }
379
379
 
380
- export const coreVersion = '5.9.0'
380
+ export const coreVersion = '5.10.0'
381
381
 
382
- export const oldestCmodVersion = '5.9.0'
382
+ export const oldestCmodVersion = '5.10.0'
383
383
 
384
384
  export function hotkeyCommand(mod: string, hotkey: string): string {
385
385
  return `${mod}--${hotkey}`
@@ -3,7 +3,7 @@ import type { Step } from '../installer.js'
3
3
 
4
4
  import type { Imports, Mod, ModDefinition, Reservation, SettingsFile, SettingsFileChange, SettingsFileChangeListener, Subscription, Timer as ModTimer } from '../mod.js'
5
5
  import type { Options, OptionValues } from '../options.js'
6
- import { dataFolder, finishStepsMethod, isAtLeast, isProgramNewer, oldestCmodVersion, pendingStepsMethod, parseEvent, programPath, readRecord, readSteps, recordPath, scriptsSha256, storeFolder, type ReadFile, type RunnerEvent, type Steps } from '../records.js'
6
+ import { dataFolder, finishStepsMethod, isAtLeast, isProgramNewer, oldestCmodVersion, pendingStepsMethod, parseEvent, programPath, readRecord, readSteps, recordPath, scriptsSha256, serviceFolder, storeFolder, type ReadFile, type RunnerEvent, type Steps } from '../records.js'
7
7
  import { homePrefix, ifMissing, relativePath } from '../utils/paths.js'
8
8
  import { firstLine, formatExit, messageOf } from '../utils/text.js'
9
9
  import type { Claude } from './claude.js'
@@ -16,7 +16,7 @@ import type { Device } from '../session/context/turn/device.js'
16
16
  import { keepEngine } from './engine.js'
17
17
  import { classicFailure, classicHook, userSkillHook, type Hook, type HookFields, type HookListener, type RoutedEvent } from './hooks.js'
18
18
  import type { PermissionRoutes } from './permission-check.js'
19
- import { cmodError, locatingPrograms, newestCmodVersion, readLines, spawnCmod, type Programs } from './programs.js'
19
+ import { cmodError, locatingPrograms, newestCmodVersion, readLines, runCmod, spawnCmod, type Programs } from './programs.js'
20
20
  import { createModFiles, resolvedPath, type Places } from './metadata.js'
21
21
  import { fitsOption } from '../options.js'
22
22
  import { createInstaller } from './installer.js'
@@ -1100,6 +1100,12 @@ async function createMod<State extends object, Declared extends Options>(definit
1100
1100
  names.add(key)
1101
1101
  return { remove: () => void names.delete(key) }
1102
1102
  }
1103
+ const removeUndeclaredServices = async () => {
1104
+ for (const { name } of await claude.fs.list(serviceFolder(runtime.store, definition.name)).catch(ifMissing([]))) {
1105
+ const program = name.endsWith('.json') ? name.slice(0, -'.json'.length) : undefined
1106
+ if (program !== undefined && !names.has(`service:${program}`)) await runCmod(claude, ['program', definition.name, '--remove-service', '--', program], session)
1107
+ }
1108
+ }
1103
1109
  await failsAs('its state did not load', () => modState.load())
1104
1110
  await failsAs('its options did not load', () => modOptions.load(root))
1105
1111
  const missing = modOptions.missing
@@ -1109,6 +1115,7 @@ async function createMod<State extends object, Declared extends Options>(definit
1109
1115
  api = apiOf(definition.name, returned)
1110
1116
  await failsAs('its open panes did not load', () => area.restorePanes())
1111
1117
  area.started()
1118
+ void removeUndeclaredServices().catch((error: unknown) => report({ id: 'program:services', message: 'Could not stop a service it no longer runs', error }))
1112
1119
  return { mod, added, imports, raise: client.raise, area }
1113
1120
  }
1114
1121