@cmodjs/core 5.3.0 → 5.4.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 +24 -0
- package/docs/dependencies.md +27 -0
- package/docs/mod.md +9 -0
- package/docs/options.md +2 -0
- package/docs/testing.md +1 -1
- package/mod.d.ts +4 -0
- package/mod.d.ts.map +1 -1
- package/mod.js +3 -0
- package/options.d.ts +5 -0
- package/options.d.ts.map +1 -1
- package/options.js +52 -0
- package/package.json +1 -1
- package/records.d.ts +2 -2
- package/records.js +2 -2
- package/runtime/dependencies.d.ts +1 -0
- package/runtime/dependencies.d.ts.map +1 -1
- package/runtime/dependencies.js +1 -0
- package/runtime/device.d.ts +13 -2
- package/runtime/device.d.ts.map +1 -1
- package/runtime/lifecycle.js +4 -1
- package/runtime/options.d.ts.map +1 -1
- package/runtime/options.js +5 -30
- package/src/mod.ts +5 -0
- package/src/options.ts +51 -0
- package/src/records.ts +2 -2
- package/src/runtime/dependencies.ts +2 -0
- package/src/runtime/device.ts +7 -3
- package/src/runtime/lifecycle.ts +4 -1
- package/src/runtime/options.ts +4 -25
- package/src/testing.ts +2 -2
- package/testing.js +2 -2
package/docs/commands.md
CHANGED
|
@@ -241,6 +241,30 @@ cmod download <program> <machine> <url> <sha256> [<machine> <url> <sha256> …]
|
|
|
241
241
|
|
|
242
242
|
Downloads a program for an install script: fetches the download for this machine, checks its SHA-256, unpacks it, and moves `<program>` to `$CMOD_DATA/bin/<program>`. [install-steps.md](install-steps.md) explains it.
|
|
243
243
|
|
|
244
|
+
## Run from a mod's program
|
|
245
|
+
|
|
246
|
+
A mod's own program runs outside any session, as one copy per computer or over `ssh` on a computer with no Claude Code open. These give it what a mod reads in a session.
|
|
247
|
+
|
|
248
|
+
### cmod options
|
|
249
|
+
|
|
250
|
+
```text
|
|
251
|
+
cmod options <mod> [--project <folder>]... [--json]
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Prints a mod's option values in two levels. `person` holds the values the person set in `/config`. `projects` holds the values each project's committed `.claude/cmods/<mod>/options.json` sets, keyed by the project's git root as `git rev-parse --show-toplevel` prints it, or by the project's own folder outside git. With no `--project`, it reads every project cmod's conversation index holds a session of, and lists only those whose `options.json` exists. It leaves out secrets, and the entries a session would ignore, and names each of those on stderr. A session uses a project's value over the person's, and a value the person's organization locks over both, which this command cannot read outside Claude Code. `--json` prints `{ person, projects }`:
|
|
255
|
+
|
|
256
|
+
```json
|
|
257
|
+
{ "person": { "folders": ["~/notes"] }, "projects": { "/Users/ana/work/app": { "folders": ["plans"] } } }
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### cmod device
|
|
261
|
+
|
|
262
|
+
```text
|
|
263
|
+
cmod device [--json]
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Prints the computer as a mod's `device.read()` gives it: its id, name, operating system, and architecture ([mod.md](mod.md#device-the-computer-the-session-runs-on)). It runs the same reader, so a program names each computer by the id its mod sees. `--json` prints `{ id, name, os, arch }`. On a computer with no machine id, it exits 1 and says so.
|
|
267
|
+
|
|
244
268
|
## Run by cmod
|
|
245
269
|
|
|
246
270
|
cmod runs these itself. A person runs them to see a step's whole log, or to finish a step.
|
package/docs/dependencies.md
CHANGED
|
@@ -92,6 +92,33 @@ export const outline = defineMod({
|
|
|
92
92
|
})
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
+
## Call a mod only when it runs: mods.isLoaded
|
|
96
|
+
|
|
97
|
+
A mod that works without another mod, and only uses it when the person has it, does not list it, because Claude Code installs every listed dependency for everyone who installs your mod. Ask whether it runs first, then call it through `mod.dependencies` as usual:
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
import { defineMod, mods } from '../node_modules/@cmodjs/core/mod.js'
|
|
101
|
+
|
|
102
|
+
export const inbox = defineMod({
|
|
103
|
+
name: 'inbox',
|
|
104
|
+
setup(mod) {
|
|
105
|
+
return {
|
|
106
|
+
save: async () => {
|
|
107
|
+
if (await mods.isLoaded('anyhost')) await mod.dependencies.anyhost.sync({ folder: mod.dataFolder })
|
|
108
|
+
},
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
})
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
```ts
|
|
115
|
+
isLoaded(name: string): Promise<boolean>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
- `isLoaded` answers true when the mod runs in this Claude Code process, as one Claude Code loaded or one run from its checkout with `--plugin-dir`. A mod the person installed but turned off answers false.
|
|
119
|
+
- Claude Code lays a provider's types file beside your mod's only for a listed dependency, so type the methods you call in your own `types/index.d.ts`, with the shape the provider's types file exports, such as `interface CmodDependencies { anyhost: Anyhost }`.
|
|
120
|
+
- A mod that calls `mods.isLoaded` runs on cmod 5.4.0 or later, which the `cmod` range `cmod check` writes says.
|
|
121
|
+
|
|
95
122
|
## When a call fails
|
|
96
123
|
|
|
97
124
|
A call that cannot answer rejects with one of these reasons:
|
package/docs/mod.md
CHANGED
|
@@ -540,6 +540,7 @@ type Device = { id: string; name: string; os: 'darwin' | 'linux'; arch: 'arm64'
|
|
|
540
540
|
- `name` is the name the computer goes by on its network: its LocalHostName on macOS, such as `Jordans-Mac-mini`, and its hostname on Linux.
|
|
541
541
|
- `os` and `arch` are the names cmod's builds use, such as `darwin` and `arm64`.
|
|
542
542
|
- `read` reads the computer the first time the mod calls it, and answers the same device after that. It rejects on a computer other than macOS or Linux on arm64 or x64. It also rejects on a Linux computer where neither `/etc/machine-id` nor `/var/lib/dbus/machine-id` holds a machine id, as in many containers, with a sentence that names both files.
|
|
543
|
+
- A mod's program that runs with no session, such as over `ssh`, reads the same device with `cmod device --json` ([commands.md](commands.md#cmod-device)).
|
|
543
544
|
- Each turn names the device it ran on, as `turn.device` ([session.md](session.md#turn-context-goal-and-task)), so a mod tells which computer ran each turn of a session that moved between computers. A start on a computer without a machine id names no device, so the turns after it keep the device of the start before, or have none.
|
|
544
545
|
|
|
545
546
|
```ts
|
|
@@ -547,6 +548,14 @@ const here = await device.read()
|
|
|
547
548
|
const elsewhere = (await sessions.current.turns()).filter((turn) => turn.device !== undefined && turn.device.id !== here.id)
|
|
548
549
|
```
|
|
549
550
|
|
|
551
|
+
## mods: the other mods that run
|
|
552
|
+
|
|
553
|
+
```ts
|
|
554
|
+
mods.isLoaded(name: string): Promise<boolean>
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
Answers whether a mod runs in this Claude Code process, so a mod calls another mod it does not list only when the person has it ([dependencies.md](dependencies.md#call-a-mod-only-when-it-runs-modsisloaded)).
|
|
558
|
+
|
|
550
559
|
## messageOf
|
|
551
560
|
|
|
552
561
|
```ts
|
package/docs/options.md
CHANGED
|
@@ -55,6 +55,8 @@ An option with no default and no value is asked before `setup` runs, on the mod'
|
|
|
55
55
|
|
|
56
56
|
`mod.options` follows the values while the session runs. Read an option where you use it, as in `mod.options.branch`, so a change applies at once. A change in `/config` reloads the mod, and a `/cd` reads the new project's `options.json`.
|
|
57
57
|
|
|
58
|
+
A mod that needs both levels at once, such as one that syncs the person's folders and every project's, reads them with `cmod options <mod> --json`. It prints the person's values and each project's, for every project the computer has had sessions in ([commands.md](commands.md#cmod-options)).
|
|
59
|
+
|
|
58
60
|
## Set options for a team
|
|
59
61
|
|
|
60
62
|
A project sets options for everyone who works in it with an `options.json` in its config folder, committed with the repository:
|
package/docs/testing.md
CHANGED
|
@@ -45,7 +45,7 @@ type TestOptions<State, Options> = {
|
|
|
45
45
|
| `scope` | `'project'` makes the mod a project plugin, in `<projectRoot>/.claude/skills/<name>` | `'user'` |
|
|
46
46
|
| `projectRoot` | `sessions.current.project` | `/test/plugins/<name>`, or `/test/project` for a project plugin |
|
|
47
47
|
| `cwd` | `sessions.current.cwd` | `projectRoot` |
|
|
48
|
-
| `dependencies` | The methods other mods answer with | none: every call fails with `<name> is not installed. Install it in Plugins
|
|
48
|
+
| `dependencies` | The methods other mods answer with, and the mods `mods.isLoaded` answers true for | none: every call fails with `<name> is not installed. Install it in Plugins.`, and `mods.isLoaded` answers true only for the tested mod and cmod |
|
|
49
49
|
| `files` | The fake file system, absolute path to text | no files |
|
|
50
50
|
| `links` | Symbolic links in the fake file system, absolute link path to its target | no links |
|
|
51
51
|
| `secrets` | The mod's secrets `mod.secrets` starts with, key to value. The fake keeps what the mod stores in memory, and `tested.calls` never holds a value | no secrets |
|
package/mod.d.ts
CHANGED
|
@@ -144,6 +144,9 @@ export type Imports = {
|
|
|
144
144
|
readonly clipboard: {
|
|
145
145
|
write(text: string): Promise<void>;
|
|
146
146
|
};
|
|
147
|
+
readonly mods: {
|
|
148
|
+
isLoaded(name: string): Promise<boolean>;
|
|
149
|
+
};
|
|
147
150
|
};
|
|
148
151
|
export declare const sessions: Imports['sessions'];
|
|
149
152
|
export declare const settings: Imports['settings'];
|
|
@@ -156,6 +159,7 @@ export declare const process: Imports['process'];
|
|
|
156
159
|
export declare const http: Imports['http'];
|
|
157
160
|
export declare const device: Imports['device'];
|
|
158
161
|
export declare const clipboard: Imports['clipboard'];
|
|
162
|
+
export declare const mods: Imports['mods'];
|
|
159
163
|
export type Mod<State extends object = Record<never, never>, Declared extends Options = Options, Keys extends Hotkeys = Hotkeys> = {
|
|
160
164
|
readonly name: string;
|
|
161
165
|
readonly folder: string;
|
package/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,SAAS,IAAI,eAAe,EAC5B,aAAa,EACb,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,QAAQ,EACT,MAAM,aAAa,CAAA;AACpB,OAAO,EAAgB,KAAK,MAAM,EAAE,KAAK,UAAU,EAAE,KAAK,OAAO,E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HANGED
|
@@ -56,6 +56,9 @@ export const device = {
|
|
|
56
56
|
export const clipboard = {
|
|
57
57
|
write: (text) => bound().clipboard.write(text),
|
|
58
58
|
};
|
|
59
|
+
export const mods = {
|
|
60
|
+
isLoaded: (name) => bound().mods.isLoaded(name),
|
|
61
|
+
};
|
|
59
62
|
export const Mod = modSender;
|
|
60
63
|
export function defineMod(definition) {
|
|
61
64
|
if (definition.name.trim() === '')
|
package/options.d.ts
CHANGED
|
@@ -52,6 +52,11 @@ export declare const option: {
|
|
|
52
52
|
};
|
|
53
53
|
export declare function checkOptions(name: string, options: Options): Options;
|
|
54
54
|
export declare function userConfigOf(options: Options): Record<string, UserConfigField>;
|
|
55
|
+
export declare function optionsOf(userConfig: Readonly<Record<string, unknown>>): Options;
|
|
56
|
+
export declare function projectOptionsOf(name: string, declared: Options, text: string): {
|
|
57
|
+
readonly values: Record<string, unknown>;
|
|
58
|
+
readonly ignored: readonly string[];
|
|
59
|
+
};
|
|
55
60
|
export declare function isUnset(value: unknown): boolean;
|
|
56
61
|
export declare function fitsOption(declared: Option, value: unknown): string | undefined;
|
|
57
62
|
export {};
|
package/options.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["src/options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["src/options.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAA;AAExG,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,MAAM,EAAE,CAAA;AAEvE,KAAK,SAAS,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAA;A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AAO,CAqBhF;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAqBjK;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE/C;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAa/E"}
|
package/options.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { isObject, secretFix } from './records.js';
|
|
2
|
+
import { messageOf } from './utils/text.js';
|
|
1
3
|
export const option = {
|
|
2
4
|
text: (field) => ({ ...field, type: 'text' }),
|
|
3
5
|
secret: (field) => ({ ...field, type: 'secret' }),
|
|
@@ -40,6 +42,56 @@ export function userConfigOf(options) {
|
|
|
40
42
|
},
|
|
41
43
|
]));
|
|
42
44
|
}
|
|
45
|
+
const optionTypes = { string: 'text', number: 'number', boolean: 'toggle', directory: 'folder', file: 'file' };
|
|
46
|
+
export function optionsOf(userConfig) {
|
|
47
|
+
return Object.fromEntries(Object.entries(userConfig).flatMap(([key, field]) => {
|
|
48
|
+
if (!isObject(field) || typeof field['type'] !== 'string' || !Object.hasOwn(optionTypes, field['type']))
|
|
49
|
+
return [];
|
|
50
|
+
const choices = Array.isArray(field['options']) ? field['options'].filter((choice) => typeof choice === 'string') : undefined;
|
|
51
|
+
const type = field['sensitive'] === true ? 'secret' : field['multiple'] === true ? 'list' : choices !== undefined ? 'choice' : optionTypes[field['type']];
|
|
52
|
+
return [
|
|
53
|
+
[
|
|
54
|
+
key,
|
|
55
|
+
{
|
|
56
|
+
type,
|
|
57
|
+
title: typeof field['title'] === 'string' ? field['title'] : key,
|
|
58
|
+
description: typeof field['description'] === 'string' ? field['description'] : '',
|
|
59
|
+
...(typeof field['min'] === 'number' ? { min: field['min'] } : {}),
|
|
60
|
+
...(typeof field['max'] === 'number' ? { max: field['max'] } : {}),
|
|
61
|
+
...(choices === undefined ? {} : { choices }),
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
];
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
export function projectOptionsOf(name, declared, text) {
|
|
68
|
+
let file;
|
|
69
|
+
try {
|
|
70
|
+
file = JSON.parse(text);
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
return { values: {}, ignored: [`is not JSON (${messageOf(error)}). Fix the file; ${name} uses its other options until then.`] };
|
|
74
|
+
}
|
|
75
|
+
if (!isObject(file))
|
|
76
|
+
return { values: {}, ignored: ['is not a JSON object. Write one, such as { "branch": "main" }.'] };
|
|
77
|
+
const values = {};
|
|
78
|
+
const ignored = [];
|
|
79
|
+
for (const [key, value] of Object.entries(file)) {
|
|
80
|
+
const option = declared[key];
|
|
81
|
+
if (option === undefined)
|
|
82
|
+
ignored.push(`sets ${key}, which ${name} does not declare. ${Object.keys(declared).length === 0 ? 'Remove it.' : `Remove it, or use one of: ${Object.keys(declared).join(', ')}.`}`);
|
|
83
|
+
else if (option.type === 'secret')
|
|
84
|
+
ignored.push(`sets ${key}, a secret, and a project file is committed for everyone to read. Remove it. ${secretFix}`);
|
|
85
|
+
else {
|
|
86
|
+
const misfit = fitsOption(option, value);
|
|
87
|
+
if (misfit === undefined)
|
|
88
|
+
values[key] = value;
|
|
89
|
+
else
|
|
90
|
+
ignored.push(`sets ${key} to ${JSON.stringify(value)}, and ${option.title} ${misfit}.`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return { values, ignored };
|
|
94
|
+
}
|
|
43
95
|
export function isUnset(value) {
|
|
44
96
|
return value === undefined || value === '' || (Array.isArray(value) && value.length === 0);
|
|
45
97
|
}
|
package/package.json
CHANGED
package/records.d.ts
CHANGED
|
@@ -96,8 +96,8 @@ export type Preferences = {
|
|
|
96
96
|
};
|
|
97
97
|
export declare function parsePreferences(value: unknown, path: string): Preferences;
|
|
98
98
|
export declare function parseConsent(value: unknown, path: string): Record<string, string[]>;
|
|
99
|
-
export declare const coreVersion = "5.
|
|
100
|
-
export declare const oldestCmodVersion = "5.
|
|
99
|
+
export declare const coreVersion = "5.4.0";
|
|
100
|
+
export declare const oldestCmodVersion = "5.4.0";
|
|
101
101
|
export declare function hotkeyCommand(mod: string, hotkey: string): string;
|
|
102
102
|
export declare function hotkeyBindings(mod: string, hotkeys: Hotkeys | undefined): Record<string, string>;
|
|
103
103
|
export declare function boundCombos(keybindings: unknown): Map<string, string>;
|
package/records.js
CHANGED
|
@@ -266,8 +266,8 @@ function readHotkeys(hotkeys) {
|
|
|
266
266
|
throw new Error(`package.json "cmod.hotkeys" is not a map of hotkeys to their title and optional default combo. ${fix}`);
|
|
267
267
|
return { hotkeys: checkHotkeys('package.json "cmod"', hotkeys) };
|
|
268
268
|
}
|
|
269
|
-
export const coreVersion = '5.
|
|
270
|
-
export const oldestCmodVersion = '5.
|
|
269
|
+
export const coreVersion = '5.4.0';
|
|
270
|
+
export const oldestCmodVersion = '5.4.0';
|
|
271
271
|
export function hotkeyCommand(mod, hotkey) {
|
|
272
272
|
return `${mod}--${hotkey}`;
|
|
273
273
|
}
|
|
@@ -2,6 +2,7 @@ import type { Args, CmodDependencies, EventResult, Frozen } from 'claude-code';
|
|
|
2
2
|
import type { Claude } from './claude.js';
|
|
3
3
|
import type { Router } from './router.js';
|
|
4
4
|
export declare const cmodPluginName = "cmod";
|
|
5
|
+
export declare const loadedMethod = "cmod:isLoaded";
|
|
5
6
|
export declare function answerCall(name: string, api: {
|
|
6
7
|
readonly [method: string]: (input: never) => unknown;
|
|
7
8
|
}, e: Frozen<Args<'cmod.call'>>): Promise<EventResult<'cmod.call'>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../src/runtime/dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAG9E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,eAAO,MAAM,cAAc,SAAS,CAAA;AAEpC,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE;IAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAA;CAAE,EAAE,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAQ7K;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,gBAAgB,CAOpI;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAQvD;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CASxE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD"}
|
|
1
|
+
{"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../src/runtime/dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAG9E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,eAAO,MAAM,cAAc,SAAS,CAAA;AAEpC,eAAO,MAAM,YAAY,kBAAkB,CAAA;AAE3C,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE;IAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAA;CAAE,EAAE,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAQ7K;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,gBAAgB,CAOpI;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAQvD;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CASxE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD"}
|
package/runtime/dependencies.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { installFix } from '../records.js';
|
|
2
2
|
import { messageOf } from '../utils/text.js';
|
|
3
3
|
export const cmodPluginName = 'cmod';
|
|
4
|
+
export const loadedMethod = 'cmod:isLoaded';
|
|
4
5
|
export async function answerCall(name, api, e) {
|
|
5
6
|
const method = Object.hasOwn(api, e.method) ? api[e.method] : undefined;
|
|
6
7
|
if (method === undefined)
|
package/runtime/device.d.ts
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import type { Device } from '../session/context/turn/device.js';
|
|
2
|
-
import type { Claude } from './claude.js';
|
|
3
2
|
export declare class MissingMachineId extends Error {
|
|
4
3
|
}
|
|
5
|
-
export
|
|
4
|
+
export type DeviceSources = {
|
|
5
|
+
readonly process: {
|
|
6
|
+
run(argv: readonly string[]): Promise<{
|
|
7
|
+
readonly exitCode: number;
|
|
8
|
+
readonly stdout: string;
|
|
9
|
+
readonly stderr: string;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
readonly fs: {
|
|
13
|
+
read(path: string): Promise<string>;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare function readDevice(claude: DeviceSources): Promise<Device>;
|
|
6
17
|
//# sourceMappingURL=device.d.ts.map
|
package/runtime/device.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../src/runtime/device.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;
|
|
1
|
+
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../src/runtime/device.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAkB/D,qBAAa,gBAAiB,SAAQ,KAAK;CAAG;AAE9C,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,OAAO,EAAE;QAAE,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC;YAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAA;IAC5I,QAAQ,CAAC,EAAE,EAAE;QAAE,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;KAAE,CAAA;CACrD,CAAA;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBvE"}
|
package/runtime/lifecycle.js
CHANGED
|
@@ -5,7 +5,7 @@ import { beforeDeadline, settledAfterAbort } from './deadline.js';
|
|
|
5
5
|
import { announcementMs, announcementOf } from './announce.js';
|
|
6
6
|
import { bind } from './bound.js';
|
|
7
7
|
import { serveConversations } from './conversations.js';
|
|
8
|
-
import { answerCall, answeringOwnCalls, cmodPluginName, dependencyCalls, withBareRefusals } from './dependencies.js';
|
|
8
|
+
import { answerCall, answeringOwnCalls, cmodPluginName, dependencyCalls, loadedMethod, withBareRefusals } from './dependencies.js';
|
|
9
9
|
import { keepEngine } from './engine.js';
|
|
10
10
|
import { classicFailure, classicHook, userSkillHook } from './hooks.js';
|
|
11
11
|
import { cmodError, locatingPrograms, readLines, spawnCmod } from './programs.js';
|
|
@@ -799,6 +799,9 @@ async function createMod(definition, runtime) {
|
|
|
799
799
|
await toaster.copy(text);
|
|
800
800
|
},
|
|
801
801
|
},
|
|
802
|
+
mods: {
|
|
803
|
+
isLoaded: async (name) => (await claude.cmod.call({ to: cmodPluginName, method: loadedMethod, input: { name } })) === true,
|
|
804
|
+
},
|
|
802
805
|
};
|
|
803
806
|
const timer = (ms, subject, repeats, listener) => {
|
|
804
807
|
let isFiring = false;
|
package/runtime/options.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/runtime/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/runtime/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAsD,KAAK,OAAO,EAAE,MAAM,eAAe,CAAA;AAGhG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;IAChC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;IAElC,YAAY,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,EAI7D;CACF;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IAClD,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAClC,CAAA;AAED,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,MAAM,EACN,MAAM,EACN,OAAO,GACR,EAAE;IACD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAA;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IAC3C,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAC7B,GAAG,UAAU,CA8Cb"}
|
package/runtime/options.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { fitsOption, isUnset } from '../options.js';
|
|
2
|
-
import { configFolders
|
|
1
|
+
import { fitsOption, isUnset, projectOptionsOf } from '../options.js';
|
|
2
|
+
import { configFolders } from '../records.js';
|
|
3
3
|
import { listed, messageOf } from '../utils/text.js';
|
|
4
4
|
export class MissingOptions extends Error {
|
|
5
5
|
keys;
|
|
@@ -31,34 +31,9 @@ export function createOptions({ name, declared, fromClaude, claude, report, chan
|
|
|
31
31
|
const path = `${project.folder}/options.json`;
|
|
32
32
|
if (!(await claude.fs.exists(path)))
|
|
33
33
|
return {};
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
file = JSON.parse(await claude.fs.read(path));
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
ignore(`is not JSON (${messageOf(error)}). Fix the file; ${name} uses its other options until then.`);
|
|
41
|
-
return {};
|
|
42
|
-
}
|
|
43
|
-
if (typeof file !== 'object' || file === null || Array.isArray(file)) {
|
|
44
|
-
ignore('is not a JSON object. Write one, such as { "branch": "main" }.');
|
|
45
|
-
return {};
|
|
46
|
-
}
|
|
47
|
-
const kept = {};
|
|
48
|
-
for (const [key, value] of Object.entries(file)) {
|
|
49
|
-
const option = declared[key];
|
|
50
|
-
if (option === undefined)
|
|
51
|
-
ignore(`sets ${key}, which ${name} does not declare. ${Object.keys(declared).length === 0 ? 'Remove it.' : `Remove it, or use one of: ${Object.keys(declared).join(', ')}.`}`);
|
|
52
|
-
else if (option.type === 'secret')
|
|
53
|
-
ignore(`sets ${key}, a secret, and a project file is committed for everyone to read. Remove it. ${secretFix}`);
|
|
54
|
-
else {
|
|
55
|
-
const misfit = fitsOption(option, value);
|
|
56
|
-
if (misfit === undefined)
|
|
57
|
-
kept[key] = value;
|
|
58
|
-
else
|
|
59
|
-
ignore(`sets ${key} to ${JSON.stringify(value)}, and ${option.title} ${misfit}.`);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
34
|
+
const { values: kept, ignored } = projectOptionsOf(name, declared, await claude.fs.read(path));
|
|
35
|
+
for (const reason of ignored)
|
|
36
|
+
report({ id: `options:${path} ${reason}`, message: `Ignores part of ${path}`, description: `${path} ${reason}` });
|
|
62
37
|
return kept;
|
|
63
38
|
};
|
|
64
39
|
return {
|
package/src/mod.ts
CHANGED
|
@@ -140,6 +140,7 @@ export type Imports = {
|
|
|
140
140
|
readonly http: { fetch(url: string, init?: HttpInit): Promise<HttpResponse> }
|
|
141
141
|
readonly device: { read(): Promise<Device> }
|
|
142
142
|
readonly clipboard: { write(text: string): Promise<void> }
|
|
143
|
+
readonly mods: { isLoaded(name: string): Promise<boolean> }
|
|
143
144
|
}
|
|
144
145
|
|
|
145
146
|
export const sessions: Imports['sessions'] = {
|
|
@@ -205,6 +206,10 @@ export const clipboard: Imports['clipboard'] = {
|
|
|
205
206
|
write: (text) => bound().clipboard.write(text),
|
|
206
207
|
}
|
|
207
208
|
|
|
209
|
+
export const mods: Imports['mods'] = {
|
|
210
|
+
isLoaded: (name) => bound().mods.isLoaded(name),
|
|
211
|
+
}
|
|
212
|
+
|
|
208
213
|
export type Mod<State extends object = Record<never, never>, Declared extends Options = Options, Keys extends Hotkeys = Hotkeys> = {
|
|
209
214
|
readonly name: string
|
|
210
215
|
readonly folder: string
|
package/src/options.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { isObject, secretFix } from './records.js'
|
|
2
|
+
import { messageOf } from './utils/text.js'
|
|
3
|
+
|
|
1
4
|
export type OptionType = 'text' | 'secret' | 'number' | 'toggle' | 'choice' | 'folder' | 'file' | 'list'
|
|
2
5
|
|
|
3
6
|
export type OptionValue = string | number | boolean | readonly string[]
|
|
@@ -71,6 +74,54 @@ export function userConfigOf(options: Options): Record<string, UserConfigField>
|
|
|
71
74
|
)
|
|
72
75
|
}
|
|
73
76
|
|
|
77
|
+
const optionTypes: Readonly<Record<UserConfigField['type'], OptionType>> = { string: 'text', number: 'number', boolean: 'toggle', directory: 'folder', file: 'file' }
|
|
78
|
+
|
|
79
|
+
export function optionsOf(userConfig: Readonly<Record<string, unknown>>): Options {
|
|
80
|
+
return Object.fromEntries(
|
|
81
|
+
Object.entries(userConfig).flatMap(([key, field]): [string, Option][] => {
|
|
82
|
+
if (!isObject(field) || typeof field['type'] !== 'string' || !Object.hasOwn(optionTypes, field['type'])) return []
|
|
83
|
+
const choices = Array.isArray(field['options']) ? field['options'].filter((choice): choice is string => typeof choice === 'string') : undefined
|
|
84
|
+
const type: OptionType = field['sensitive'] === true ? 'secret' : field['multiple'] === true ? 'list' : choices !== undefined ? 'choice' : optionTypes[field['type'] as UserConfigField['type']]
|
|
85
|
+
return [
|
|
86
|
+
[
|
|
87
|
+
key,
|
|
88
|
+
{
|
|
89
|
+
type,
|
|
90
|
+
title: typeof field['title'] === 'string' ? field['title'] : key,
|
|
91
|
+
description: typeof field['description'] === 'string' ? field['description'] : '',
|
|
92
|
+
...(typeof field['min'] === 'number' ? { min: field['min'] } : {}),
|
|
93
|
+
...(typeof field['max'] === 'number' ? { max: field['max'] } : {}),
|
|
94
|
+
...(choices === undefined ? {} : { choices }),
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
]
|
|
98
|
+
}),
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function projectOptionsOf(name: string, declared: Options, text: string): { readonly values: Record<string, unknown>; readonly ignored: readonly string[] } {
|
|
103
|
+
let file: unknown
|
|
104
|
+
try {
|
|
105
|
+
file = JSON.parse(text)
|
|
106
|
+
} catch (error) {
|
|
107
|
+
return { values: {}, ignored: [`is not JSON (${messageOf(error)}). Fix the file; ${name} uses its other options until then.`] }
|
|
108
|
+
}
|
|
109
|
+
if (!isObject(file)) return { values: {}, ignored: ['is not a JSON object. Write one, such as { "branch": "main" }.'] }
|
|
110
|
+
const values: Record<string, unknown> = {}
|
|
111
|
+
const ignored: string[] = []
|
|
112
|
+
for (const [key, value] of Object.entries(file)) {
|
|
113
|
+
const option = declared[key]
|
|
114
|
+
if (option === undefined) ignored.push(`sets ${key}, which ${name} does not declare. ${Object.keys(declared).length === 0 ? 'Remove it.' : `Remove it, or use one of: ${Object.keys(declared).join(', ')}.`}`)
|
|
115
|
+
else if (option.type === 'secret') ignored.push(`sets ${key}, a secret, and a project file is committed for everyone to read. Remove it. ${secretFix}`)
|
|
116
|
+
else {
|
|
117
|
+
const misfit = fitsOption(option, value)
|
|
118
|
+
if (misfit === undefined) values[key] = value
|
|
119
|
+
else ignored.push(`sets ${key} to ${JSON.stringify(value)}, and ${option.title} ${misfit}.`)
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return { values, ignored }
|
|
123
|
+
}
|
|
124
|
+
|
|
74
125
|
export function isUnset(value: unknown): boolean {
|
|
75
126
|
return value === undefined || value === '' || (Array.isArray(value) && value.length === 0)
|
|
76
127
|
}
|
package/src/records.ts
CHANGED
|
@@ -307,9 +307,9 @@ function readHotkeys(hotkeys: unknown): Steps {
|
|
|
307
307
|
return { hotkeys: checkHotkeys('package.json "cmod"', hotkeys as Record<string, HotkeyInit>) }
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
-
export const coreVersion = '5.
|
|
310
|
+
export const coreVersion = '5.4.0'
|
|
311
311
|
|
|
312
|
-
export const oldestCmodVersion = '5.
|
|
312
|
+
export const oldestCmodVersion = '5.4.0'
|
|
313
313
|
|
|
314
314
|
export function hotkeyCommand(mod: string, hotkey: string): string {
|
|
315
315
|
return `${mod}--${hotkey}`
|
|
@@ -6,6 +6,8 @@ import type { Router } from './router.js'
|
|
|
6
6
|
|
|
7
7
|
export const cmodPluginName = 'cmod'
|
|
8
8
|
|
|
9
|
+
export const loadedMethod = 'cmod:isLoaded'
|
|
10
|
+
|
|
9
11
|
export async function answerCall(name: string, api: { readonly [method: string]: (input: never) => unknown }, e: Frozen<Args<'cmod.call'>>): Promise<EventResult<'cmod.call'>> {
|
|
10
12
|
const method = Object.hasOwn(api, e.method) ? api[e.method] : undefined
|
|
11
13
|
if (method === undefined) return { deny: `${name} has no method ${e.method}.` }
|
package/src/runtime/device.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Device } from '../session/context/turn/device.js'
|
|
2
2
|
import { ifMissing } from '../utils/paths.js'
|
|
3
3
|
import { formatExit } from '../utils/text.js'
|
|
4
|
-
import type { Claude } from './claude.js'
|
|
5
4
|
|
|
6
5
|
const cmodAppId = '1fd8a8ee972047c4a89640fd51048522'
|
|
7
6
|
|
|
@@ -19,7 +18,12 @@ const machineIdFiles = ['/etc/machine-id', '/var/lib/dbus/machine-id'] as const
|
|
|
19
18
|
|
|
20
19
|
export class MissingMachineId extends Error {}
|
|
21
20
|
|
|
22
|
-
export
|
|
21
|
+
export type DeviceSources = {
|
|
22
|
+
readonly process: { run(argv: readonly string[]): Promise<{ readonly exitCode: number; readonly stdout: string; readonly stderr: string }> }
|
|
23
|
+
readonly fs: { read(path: string): Promise<string> }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function readDevice(claude: DeviceSources): Promise<Device> {
|
|
23
27
|
const output = async (argv: readonly string[]) => {
|
|
24
28
|
const { exitCode, stdout, stderr } = await claude.process.run(argv)
|
|
25
29
|
if (exitCode !== 0) throw new Error(`cmod could not read this computer: ${argv.join(' ')} ${formatExit(exitCode, stderr)}`)
|
|
@@ -37,7 +41,7 @@ export async function readDevice(claude: Pick<Claude, 'process' | 'fs'>): Promis
|
|
|
37
41
|
return { id: await appSpecific(uuid.replaceAll('-', '').toLowerCase()), name, os, arch }
|
|
38
42
|
}
|
|
39
43
|
|
|
40
|
-
async function linuxMachineId(fs:
|
|
44
|
+
async function linuxMachineId(fs: DeviceSources['fs']): Promise<string> {
|
|
41
45
|
for (const path of machineIdFiles) {
|
|
42
46
|
const id = (await fs.read(path).catch(ifMissing(''))).trim()
|
|
43
47
|
if (machineId.test(id)) return id
|
package/src/runtime/lifecycle.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { beforeDeadline, settledAfterAbort } from './deadline.js'
|
|
|
11
11
|
import { announcementMs, announcementOf } from './announce.js'
|
|
12
12
|
import { bind } from './bound.js'
|
|
13
13
|
import { serveConversations } from './conversations.js'
|
|
14
|
-
import { answerCall, answeringOwnCalls, cmodPluginName, dependencyCalls, withBareRefusals } from './dependencies.js'
|
|
14
|
+
import { answerCall, answeringOwnCalls, cmodPluginName, dependencyCalls, loadedMethod, withBareRefusals } from './dependencies.js'
|
|
15
15
|
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'
|
|
@@ -857,6 +857,9 @@ async function createMod<State extends object, Declared extends Options>(definit
|
|
|
857
857
|
await toaster.copy(text)
|
|
858
858
|
},
|
|
859
859
|
},
|
|
860
|
+
mods: {
|
|
861
|
+
isLoaded: async (name) => (await claude.cmod.call({ to: cmodPluginName, method: loadedMethod, input: { name } })) === true,
|
|
862
|
+
},
|
|
860
863
|
}
|
|
861
864
|
const timer = (ms: number, subject: string, repeats: boolean, listener: () => unknown): ModTimer => {
|
|
862
865
|
let isFiring = false
|
package/src/runtime/options.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PluginOptions } from 'claude-code'
|
|
2
|
-
import { fitsOption, isUnset, type Option, type Options } from '../options.js'
|
|
3
|
-
import { configFolders
|
|
2
|
+
import { fitsOption, isUnset, projectOptionsOf, type Option, type Options } from '../options.js'
|
|
3
|
+
import { configFolders } from '../records.js'
|
|
4
4
|
import { listed, messageOf } from '../utils/text.js'
|
|
5
5
|
import type { Claude } from './claude.js'
|
|
6
6
|
import type { Failure } from './toaster.js'
|
|
@@ -56,29 +56,8 @@ export function createOptions({
|
|
|
56
56
|
if (project === undefined) return {}
|
|
57
57
|
const path = `${project.folder}/options.json`
|
|
58
58
|
if (!(await claude.fs.exists(path))) return {}
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
try {
|
|
62
|
-
file = JSON.parse(await claude.fs.read(path))
|
|
63
|
-
} catch (error) {
|
|
64
|
-
ignore(`is not JSON (${messageOf(error)}). Fix the file; ${name} uses its other options until then.`)
|
|
65
|
-
return {}
|
|
66
|
-
}
|
|
67
|
-
if (typeof file !== 'object' || file === null || Array.isArray(file)) {
|
|
68
|
-
ignore('is not a JSON object. Write one, such as { "branch": "main" }.')
|
|
69
|
-
return {}
|
|
70
|
-
}
|
|
71
|
-
const kept: Record<string, unknown> = {}
|
|
72
|
-
for (const [key, value] of Object.entries(file)) {
|
|
73
|
-
const option = declared[key]
|
|
74
|
-
if (option === undefined) ignore(`sets ${key}, which ${name} does not declare. ${Object.keys(declared).length === 0 ? 'Remove it.' : `Remove it, or use one of: ${Object.keys(declared).join(', ')}.`}`)
|
|
75
|
-
else if (option.type === 'secret') ignore(`sets ${key}, a secret, and a project file is committed for everyone to read. Remove it. ${secretFix}`)
|
|
76
|
-
else {
|
|
77
|
-
const misfit = fitsOption(option, value)
|
|
78
|
-
if (misfit === undefined) kept[key] = value
|
|
79
|
-
else ignore(`sets ${key} to ${JSON.stringify(value)}, and ${option.title} ${misfit}.`)
|
|
80
|
-
}
|
|
81
|
-
}
|
|
59
|
+
const { values: kept, ignored } = projectOptionsOf(name, declared, await claude.fs.read(path))
|
|
60
|
+
for (const reason of ignored) report({ id: `options:${path} ${reason}`, message: `Ignores part of ${path}`, description: `${path} ${reason}` })
|
|
82
61
|
return kept
|
|
83
62
|
}
|
|
84
63
|
|
package/src/testing.ts
CHANGED
|
@@ -24,7 +24,7 @@ import type { ModDefinition } from './mod.js'
|
|
|
24
24
|
import type { Options, OptionValues } from './options.js'
|
|
25
25
|
import { hotkeyCommand, readSteps, storeFolder, type Steps } from './records.js'
|
|
26
26
|
import type { Claude } from './runtime/claude.js'
|
|
27
|
-
import { answerCall, cmodPluginName, notInstalled } from './runtime/dependencies.js'
|
|
27
|
+
import { answerCall, cmodPluginName, loadedMethod, notInstalled } from './runtime/dependencies.js'
|
|
28
28
|
import { closingContext, foldBefore, installBefore, withAnswer, type Answers, type Decide } from './runtime/before.js'
|
|
29
29
|
import { permissionRoutes } from './runtime/permission-check.js'
|
|
30
30
|
import type { RoutedEvent } from './runtime/hooks.js'
|
|
@@ -742,7 +742,7 @@ export function testMod<State extends object, Declared extends Options = Options
|
|
|
742
742
|
}
|
|
743
743
|
|
|
744
744
|
function fakeDependencies(caller: string, dependencies: NonNullable<TestOptions<object>['dependencies']>, conversations: FakeSessions): Claude['cmod']['call'] {
|
|
745
|
-
const cmod = { forkParent: () => null, updateSettings: () => null }
|
|
745
|
+
const cmod = { forkParent: () => null, updateSettings: () => null, [loadedMethod]: ({ name }: { readonly name: string }) => name === caller || name === cmodPluginName || Object.hasOwn(dependencies, name) }
|
|
746
746
|
const apis = { [cmodPluginName]: cmod, ...dependencies } as Readonly<Record<string, Parameters<typeof answerCall>[1] | undefined>>
|
|
747
747
|
return async (call) => {
|
|
748
748
|
const served = call.to === cmodPluginName ? conversations.answer(caller, call.method, call.input) : undefined
|
package/testing.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { hotkeyCommand, readSteps, storeFolder } from './records.js';
|
|
2
|
-
import { answerCall, cmodPluginName, notInstalled } from './runtime/dependencies.js';
|
|
2
|
+
import { answerCall, cmodPluginName, loadedMethod, notInstalled } from './runtime/dependencies.js';
|
|
3
3
|
import { closingContext, foldBefore, installBefore, withAnswer } from './runtime/before.js';
|
|
4
4
|
import { permissionRoutes } from './runtime/permission-check.js';
|
|
5
5
|
import { keepClaudeCode } from './testing/claude-code.js';
|
|
@@ -667,7 +667,7 @@ export function testMod(definition, options = {}) {
|
|
|
667
667
|
return tested;
|
|
668
668
|
}
|
|
669
669
|
function fakeDependencies(caller, dependencies, conversations) {
|
|
670
|
-
const cmod = { forkParent: () => null, updateSettings: () => null };
|
|
670
|
+
const cmod = { forkParent: () => null, updateSettings: () => null, [loadedMethod]: ({ name }) => name === caller || name === cmodPluginName || Object.hasOwn(dependencies, name) };
|
|
671
671
|
const apis = { [cmodPluginName]: cmod, ...dependencies };
|
|
672
672
|
return async (call) => {
|
|
673
673
|
const served = call.to === cmodPluginName ? conversations.answer(caller, call.method, call.input) : undefined;
|