@jive-sh/skill-sync 0.4.18 → 0.5.0-latest-darwin-arm64

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.
Files changed (55) hide show
  1. package/multi-call-binary +4 -0
  2. package/package.json +11 -39
  3. package/README.md +0 -127
  4. package/bin/package.json +0 -1
  5. package/bin/skill-sync +0 -576
  6. package/bin/skill-sync-daemon +0 -576
  7. package/dist/daemons/skill-sync-daemon.js +0 -491
  8. package/dist/daemons/skill-sync-daemon.js.map +0 -1
  9. package/dist/entrypoints/skill-sync.js +0 -153
  10. package/dist/entrypoints/skill-sync.js.map +0 -1
  11. package/dist/index.js +0 -10
  12. package/dist/index.js.map +0 -1
  13. package/dist/internal/agents/agent-tool.js +0 -83
  14. package/dist/internal/agents/agent-tool.js.map +0 -1
  15. package/dist/internal/agents/claude.js +0 -249
  16. package/dist/internal/agents/claude.js.map +0 -1
  17. package/dist/internal/agents/codex.js +0 -150
  18. package/dist/internal/agents/codex.js.map +0 -1
  19. package/dist/internal/agents/grok.js +0 -111
  20. package/dist/internal/agents/grok.js.map +0 -1
  21. package/dist/internal/agents/index.js +0 -31
  22. package/dist/internal/agents/index.js.map +0 -1
  23. package/dist/internal/config.js +0 -131
  24. package/dist/internal/config.js.map +0 -1
  25. package/dist/internal/control.js +0 -101
  26. package/dist/internal/control.js.map +0 -1
  27. package/dist/internal/folders.js +0 -47
  28. package/dist/internal/folders.js.map +0 -1
  29. package/dist/internal/path.js +0 -36
  30. package/dist/internal/path.js.map +0 -1
  31. package/dist/internal/server.js +0 -32
  32. package/dist/internal/server.js.map +0 -1
  33. package/dist/internal/skill-check.js +0 -83
  34. package/dist/internal/skill-check.js.map +0 -1
  35. package/dist/internal/sync.js +0 -183
  36. package/dist/internal/sync.js.map +0 -1
  37. package/dist/internal/wire.js +0 -24
  38. package/dist/internal/wire.js.map +0 -1
  39. package/install.cjs +0 -576
  40. package/src/daemons/skill-sync-daemon.ts +0 -483
  41. package/src/entrypoints/skill-sync.ts +0 -156
  42. package/src/index.ts +0 -15
  43. package/src/internal/agents/agent-tool.ts +0 -109
  44. package/src/internal/agents/claude.ts +0 -259
  45. package/src/internal/agents/codex.ts +0 -163
  46. package/src/internal/agents/grok.ts +0 -112
  47. package/src/internal/agents/index.ts +0 -34
  48. package/src/internal/config.ts +0 -172
  49. package/src/internal/control.ts +0 -140
  50. package/src/internal/folders.ts +0 -50
  51. package/src/internal/path.ts +0 -32
  52. package/src/internal/server.ts +0 -34
  53. package/src/internal/skill-check.ts +0 -97
  54. package/src/internal/sync.ts +0 -217
  55. package/src/internal/wire.ts +0 -252
@@ -1,217 +0,0 @@
1
- import { existsSync, mkdirSync, readdirSync, readFileSync, rmdirSync, rmSync, statSync, utimesSync, writeFileSync } from "node:fs";
2
- import { dirname, join } from "node:path";
3
- import { hashBytes, isLock, listLocalFiles, type Config, type State } from "./config";
4
- import { invalidPathReason } from "./path";
5
- import { fetchServer } from "./server";
6
- import { skillOf, type ListFilesResponse, type PutFileRequest } from "./wire";
7
-
8
- /**
9
- * One sync cycle: take every newer edit the server has, then send every newer edit this folder has.
10
- *
11
- * The latest edit wins, always. Every file carries the time it was last edited: here, the file's
12
- * modification time; on the server, the edit time of the version it holds. When this folder and the
13
- * server disagree about a file, whichever was edited later is kept, on both sides. Nothing is merged and
14
- * nothing is set aside, so every folder converges on the same bytes.
15
- *
16
- * A pulled file is given the server's edit time as its modification time, so the next cycle does not
17
- * mistake the pull for a local edit.
18
- */
19
-
20
- export interface Report {
21
- readonly pulled: string[];
22
- readonly pushed: string[];
23
- readonly deletedLocally: string[];
24
- /** Paths the server offered that this machine refused to write. */
25
- readonly rejected: string[];
26
- }
27
-
28
- /** True when a report has nothing in it worth telling anyone. */
29
- export function isQuiet(report: Report): boolean {
30
- return [report.pulled, report.pushed, report.deletedLocally, report.rejected].every((list) => list.length === 0);
31
- }
32
-
33
- /**
34
- * What a cycle changed, as the dashboard shows it under the folder: per direction, how many files in
35
- * which skills ("pulled 64 files: agentic-collaboration 52, senior-swe 12"), never the file paths, which
36
- * after a large pull fill the page. Empty when nothing changed.
37
- */
38
- export function describeActivity(report: Report): string {
39
- const direction = (verb: string, paths: ReadonlyArray<string>): string => {
40
- if (paths.length === 0) return "";
41
- const perSkill = new Map<string, number>();
42
- for (const path of paths) perSkill.set(skillOf(path), (perSkill.get(skillOf(path)) ?? 0) + 1);
43
- const skills = [...perSkill].sort(([a], [b]) => a.localeCompare(b)).map(([skill, files]) => `${skill} ${files}`);
44
- return `${verb} ${paths.length} ${paths.length === 1 ? "file" : "files"}: ${skills.join(", ")}`;
45
- };
46
- return [
47
- direction("pulled", report.pulled),
48
- direction("pushed", report.pushed),
49
- direction("deleted", report.deletedLocally),
50
- ].filter(Boolean).join("; ");
51
- }
52
-
53
- /**
54
- * `skills` is the synced list. Every other skill in the folder is local to it: never pushed, never
55
- * overwritten, never deleted by a sync.
56
- */
57
- export async function syncOnce(config: Config, folder: string, state: State, skills: ReadonlySet<string>): Promise<Report> {
58
- const report: Report = { pulled: [], pushed: [], deletedLocally: [], rejected: [] };
59
- mkdirSync(folder, { recursive: true });
60
-
61
- // A skill added to the list since last cycle may have server files older than the cursor; re-read from the start.
62
- if ([...skills].some((skill) => !(state.skills ?? []).includes(skill))) state.cursor = 0;
63
- state.skills = [...skills].sort();
64
- // A skill removed from the list stops being tracked here. Left in `known`, its files would look deleted
65
- // from this folder and the push would delete them on every machine.
66
- for (const path of Object.keys(state.known)) {
67
- if (!skills.has(skillOf(path)) || path.split("/").some(isLock)) delete state.known[path];
68
- }
69
-
70
- const present = new Set(listLocalFiles(folder, config.exclude).filter((path) => skills.has(skillOf(path))));
71
- // Files deleted here since the last cycle. When they were deleted is not recorded anywhere, so the
72
- // deletion counts as an edit made now: the pull leaves these paths alone and the push deletes them.
73
- const deletedHere = new Set(Object.keys(state.known).filter((path) => !present.has(path)));
74
-
75
- const ctx: Cycle = { config, folder, state, report, skills };
76
- await pull(ctx, deletedHere, present);
77
- await push(ctx, present);
78
- return report;
79
- }
80
-
81
- interface Cycle {
82
- readonly config: Config;
83
- readonly folder: string;
84
- readonly state: State;
85
- readonly report: Report;
86
- readonly skills: ReadonlySet<string>;
87
- }
88
-
89
- /** When this file was last edited here, to the millisecond the server stores. */
90
- const editedAt = (file: string): number => Math.floor(statSync(file).mtimeMs);
91
-
92
- async function pull(ctx: Cycle, deletedHere: ReadonlySet<string>, present: Set<string>): Promise<void> {
93
- const { config, folder, state, report } = ctx;
94
- const body = await (await call(config, `/files?since=${state.cursor}`)).json() as ListFilesResponse;
95
-
96
- for (const file of body.files) {
97
- // The server is not trusted to supply a path either: one bad row would otherwise write outside the
98
- // skills directory on every machine that syncs.
99
- const badPath = invalidPathReason(file.path);
100
- if (badPath) {
101
- report.rejected.push(`${file.path} (${badPath})`);
102
- continue;
103
- }
104
- if (!ctx.skills.has(skillOf(file.path))) continue;
105
- // Never written here: the file listing skips lock names, so a pulled one would read as deleted next cycle.
106
- if (file.path.split("/").some(isLock)) continue;
107
- // Deleted here, which is newer than anything the server has; the push sends the deletion.
108
- if (deletedHere.has(file.path)) continue;
109
-
110
- const local = join(folder, file.path);
111
- const exists = existsSync(local);
112
- const localHash = exists ? hashBytes(readFileSync(local)) : undefined;
113
- if (localHash === (file.hash ?? undefined)) {
114
- if (file.hash === null) delete state.known[file.path];
115
- else state.known[file.path] = file.hash;
116
- continue;
117
- }
118
- // Edited here since this folder last agreed with the server, and later than the server's version:
119
- // this folder's edit wins, and the push sends it.
120
- if (exists && localHash !== state.known[file.path] && editedAt(local) > file.editedAt) continue;
121
-
122
- await apply(ctx, file, present);
123
- }
124
-
125
- state.cursor = body.cursor;
126
- }
127
-
128
- async function push(ctx: Cycle, present: Set<string>): Promise<void> {
129
- const { config, folder, state, report } = ctx;
130
- for (const path of [...present]) {
131
- const file = join(folder, path);
132
- const bytes = readFileSync(file);
133
- const hash = hashBytes(bytes);
134
- if (state.known[path] === hash) continue;
135
- const later = await put(config, { path, hash, content: Buffer.from(bytes).toString("base64"), editedAt: editedAt(file) });
136
- if (later === undefined) {
137
- state.known[path] = hash;
138
- report.pushed.push(path);
139
- } else {
140
- await apply(ctx, { path, ...later }, present);
141
- }
142
- }
143
-
144
- // A path this folder agreed on that is no longer on disk was deleted here. The server keeps the
145
- // deletion, or the next machine to sync would upload the file again.
146
- for (const path of Object.keys(state.known)) {
147
- if (present.has(path)) continue;
148
- const later = await put(config, { path, hash: null, content: null, editedAt: Date.now() });
149
- if (later === undefined) {
150
- delete state.known[path];
151
- report.pushed.push(`${path} (deleted)`);
152
- } else {
153
- await apply(ctx, { path, ...later }, present);
154
- }
155
- }
156
- }
157
-
158
- /** The server's version of a file, as it answers a refused write. */
159
- interface ServerVersion {
160
- readonly hash: string | null;
161
- readonly editedAt: number;
162
- }
163
-
164
- /**
165
- * Writes the server's version of a file here: its bytes with its edit time, or a deletion. Used by the
166
- * pull, and by the push when the server refuses a write because it holds a later edit, so a refused write
167
- * settles at once rather than waiting for a pull that may never list the file again.
168
- */
169
- async function apply(ctx: Cycle, file: ServerVersion & { readonly path: string }, present: Set<string>): Promise<void> {
170
- const { config, folder, state, report } = ctx;
171
- const local = join(folder, file.path);
172
- if (file.hash === null) {
173
- rmSync(local, { force: true });
174
- removeEmptyParents(folder, local);
175
- present.delete(file.path);
176
- delete state.known[file.path];
177
- report.deletedLocally.push(file.path);
178
- return;
179
- }
180
- const content = new Uint8Array(await (await call(config, `/content/${file.hash}`)).arrayBuffer());
181
- mkdirSync(dirname(local), { recursive: true });
182
- writeFileSync(local, content);
183
- utimesSync(local, new Date(), new Date(file.editedAt));
184
- state.known[file.path] = file.hash;
185
- present.add(file.path);
186
- report.pulled.push(file.path);
187
- }
188
-
189
- /** A deleted skill leaves no empty directory behind, which would still show up as a skill. */
190
- function removeEmptyParents(folder: string, file: string): void {
191
- for (let dir = dirname(file); dir !== folder && dir.startsWith(folder); dir = dirname(dir)) {
192
- if (readdirSync(dir).length > 0) return;
193
- rmdirSync(dir);
194
- }
195
- }
196
-
197
- /** Undefined when the server took the write; otherwise the later version it holds instead. */
198
- async function put(config: Config, body: Omit<PutFileRequest, "machine">): Promise<ServerVersion | undefined> {
199
- const request: PutFileRequest = { ...body, machine: config.machine };
200
- const response = await fetchServer(config, "/files", {
201
- method: "PUT",
202
- headers: { "content-type": "application/json" },
203
- body: JSON.stringify(request),
204
- });
205
- if (response.status === 409) {
206
- const current = await response.json() as { currentHash: string | null; currentEditedAt: number };
207
- return { hash: current.currentHash, editedAt: current.currentEditedAt };
208
- }
209
- if (!response.ok) throw new Error(`PUT /files ${body.path}: ${response.status} ${await response.text()}`);
210
- return undefined;
211
- }
212
-
213
- async function call(config: Config, path: string): Promise<Response> {
214
- const response = await fetchServer(config, path);
215
- if (!response.ok) throw new Error(`GET ${path}: ${response.status} ${await response.text()}`);
216
- return response;
217
- }
@@ -1,252 +0,0 @@
1
- /**
2
- * The shapes the daemon and the service exchange.
3
- *
4
- * Declared in the library and imported by the service so there is one definition rather than two that
5
- * drift. The service depends on the library; nothing goes the other way.
6
- */
7
-
8
- export interface RemoteFile {
9
- readonly path: string;
10
- /** Null when the file is deleted; the row stays, so the deletion reaches every machine. */
11
- readonly hash: string | null;
12
- /** When this version was edited, in milliseconds since the epoch. The latest edit wins. */
13
- readonly editedAt: number;
14
- readonly updatedBy: string;
15
- }
16
-
17
- export interface ListFilesResponse {
18
- /** Highest sequence number in this page; the caller sends it back as `since`. */
19
- readonly cursor: number;
20
- readonly files: ReadonlyArray<RemoteFile>;
21
- }
22
-
23
- /** Taken only when `editedAt` is later than the edit the server holds; refused with 409 otherwise. */
24
- export interface PutFileRequest {
25
- readonly path: string;
26
- /** When the file was edited: its modification time, or for a deletion, when it was noticed. */
27
- readonly editedAt: number;
28
- /** Null to delete. */
29
- readonly hash: string | null;
30
- /** Base64, absent for a delete. */
31
- readonly content: string | null;
32
- readonly machine: string;
33
- }
34
-
35
- /** Where a folder's sync stands, as the dashboard shows it. `attention` means a cycle failed; `detail` says why. */
36
- export type FolderState = "idle" | "attention";
37
-
38
- /**
39
- * A skill is a top-level entry of a skills folder — usually a directory like `jive/` holding `SKILL.md`
40
- * and its files — and it is the unit of opting in: all of its files sync, or none do, so a skill never
41
- * arrives half-present on another machine.
42
- */
43
- export const skillOf = (path: string): string => path.split("/")[0]!;
44
-
45
- /** A file and the SHA-256 of its content — the same hash the server stores, so copies can be compared. */
46
- export interface FileHash {
47
- readonly path: string;
48
- readonly hash: string;
49
- }
50
-
51
- /** One skill as a folder holds it. */
52
- export interface LocalSkill {
53
- readonly name: string;
54
- readonly files: ReadonlyArray<FileHash>;
55
- }
56
-
57
- /**
58
- * `POST /folders`: every folder this machine found, with the skills in each, for the dashboard. Answered
59
- * with the enabled folders, each with the synced list: the daemon pushes and pulls exactly those skills,
60
- * and never touches any other.
61
- */
62
- export interface FoldersRequest {
63
- readonly folders: ReadonlyArray<{ readonly path: string; readonly skills: ReadonlyArray<LocalSkill> }>;
64
- }
65
- export interface FolderPrefs {
66
- readonly path: string;
67
- readonly skills: ReadonlyArray<string>;
68
- }
69
- export interface FoldersResponse {
70
- readonly folders: ReadonlyArray<FolderPrefs>;
71
- }
72
-
73
- /**
74
- * Whether a name can be a skill's: lowercase letters and digits in hyphen-joined words, at most 64
75
- * characters, which is what Claude, Codex and Grok accept as a skill name. The daemon checks it before
76
- * asking, and the service again before writing, so both judge a name by this one rule.
77
- */
78
- export const isSkillName = (name: string): boolean => name.length <= 64 && /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(name);
79
-
80
- /** `PUT /skills/<name>`: puts a skill on the synced list. `added` is false when it was already on it. */
81
- export interface AddSkillResponse {
82
- readonly added: boolean;
83
- }
84
-
85
- /** `GET /skills`: the synced list, as `skill-sync list` shows it. Deleted skills are not on it. */
86
- export interface ListSkillsResponse {
87
- readonly skills: ReadonlyArray<ListedSkill>;
88
- }
89
- export interface ListedSkill {
90
- readonly name: string;
91
- /** Live files on the server; zero for a skill ticked before any machine has pushed it. */
92
- readonly files: number;
93
- /** The latest edit of any of its files, and the display name of the machine it came from; null with no files. */
94
- readonly editedAt: number | null;
95
- readonly editedBy: string | null;
96
- }
97
-
98
- /**
99
- * The header a daemon names its own version in when it opens its WebSocket to the hub, so the dashboard
100
- * can show which version each machine runs. Daemons before 0.4.6 do not send it.
101
- */
102
- export const DAEMON_VERSION_HEADER = "x-skill-sync-version";
103
-
104
- /** One usage limit of an account: how much of it is used and when it starts over. */
105
- export interface UsageWindow {
106
- /** How long the window is, in minutes (300 for five hours, 10080 for a week); null when the tool does not say. */
107
- readonly minutes: number | null;
108
- /** Percent of the limit used, from 0 to 100, as the tool last recorded it. */
109
- readonly usedPercent: number;
110
- /** When the window starts over, in milliseconds since the epoch; null when no window is running. */
111
- readonly resetsAt: number | null;
112
- }
113
-
114
- /** Money as the tool records it: an amount in the currency's smallest unit, so 1234 with exponent 2 is 12.34. */
115
- export interface Money {
116
- readonly amountMinor: number;
117
- readonly currency: string;
118
- readonly exponent: number;
119
- }
120
-
121
- /** Tokens an account's sessions used over a period, as the tool counts them, cached input included. */
122
- export interface TokenSpend {
123
- readonly count: number;
124
- /** Sessions last active within this many days are counted. */
125
- readonly periodDays: number;
126
- readonly sessions: number;
127
- }
128
-
129
- /**
130
- * What a daemon knows about one Claude, Codex or Grok account on its machine, read from files and commands
131
- * the tool itself provides. Never a credential: only these numbers leave the machine.
132
- *
133
- * `reading`: the tool's latest record, with the time it was taken (`asOf`); every number is as of then.
134
- * `estimate`: what an account's recent sessions cost by the tool's own count: for a Claude account with
135
- * no plan limits (Amazon Bedrock, an API key), Claude Code's estimate at list price; for Grok, the cost
136
- * `grok usage` reports. `none`: the tool has not recorded usage for
137
- * this account yet. `unknown`: the record exists but is in a shape this version cannot read, as when a new
138
- * release of the tool changes it.
139
- */
140
- export type AccountUsage = {
141
- readonly tool: "claude" | "codex" | "grok";
142
- /** The account's folder in the home directory, such as `.claude-work` or `.codex`. */
143
- readonly home: string;
144
- } & (
145
- | {
146
- readonly state: "reading";
147
- readonly asOf: number;
148
- readonly windows: ReadonlyArray<UsageWindow>;
149
- /** Spent beyond the plan, when the account pays for usage past its limits; absent when it does not. */
150
- readonly spent?: { readonly used: Money; readonly limit: Money | null };
151
- /** Tokens used over a recent period, when the tool records them (Codex); absent otherwise. */
152
- readonly tokens?: TokenSpend;
153
- }
154
- | {
155
- readonly state: "estimate";
156
- /** When the newest session counted was last active; nothing later is in the sum. */
157
- readonly asOf: number;
158
- /** Sessions last active within this many days before the reading are counted. */
159
- readonly periodDays: number;
160
- /**
161
- * The sum of the tool's own cost figure for each session. Claude Code saves a session's estimate, at
162
- * list price, when the session ends, is cleared, resumed or forked, so a running session is not in it.
163
- */
164
- readonly spent: Money;
165
- readonly sessions: number;
166
- /** Claude Code could not price a model in at least one session, so the true cost is higher. */
167
- readonly partial: boolean;
168
- /** `bedrock` when the account's settings or the model IDs its sessions used say so; null when nothing says. */
169
- readonly provider: "bedrock" | null;
170
- }
171
- | { readonly state: "none" }
172
- | { readonly state: "unknown"; readonly reason: string }
173
- );
174
-
175
- /** Daemon → hub, over the daemon's WebSocket. */
176
- export type DaemonMessage =
177
- | {
178
- readonly type: "status";
179
- readonly folder: string;
180
- readonly state: FolderState;
181
- readonly detail?: string;
182
- /** A one-line summary of what the last cycle changed, when it changed anything. */
183
- readonly activity?: string;
184
- }
185
- /** Every account on the machine, sent on connecting and whenever a number changes. Daemons before 0.4.9 never send it. */
186
- | { readonly type: "usage"; readonly accounts: ReadonlyArray<AccountUsage> };
187
-
188
- /** Hub → daemon. `prefs` replaces what syncs; `changed` means another write landed on the server. */
189
- export type HubToDaemon =
190
- | { readonly type: "prefs"; readonly folders: ReadonlyArray<FolderPrefs> }
191
- | { readonly type: "changed" };
192
-
193
- export interface SkillView {
194
- readonly name: string;
195
- /** On the list of synced skills, which every enabled folder sends and receives. */
196
- readonly synced: boolean;
197
- /** The folder has a copy on disk. */
198
- readonly local: boolean;
199
- readonly files: ReadonlyArray<FileHash>;
200
- }
201
-
202
- export interface FolderView {
203
- readonly path: string;
204
- readonly enabled: boolean;
205
- readonly state: FolderState;
206
- readonly detail: string | null;
207
- readonly lastActivityAt: number | null;
208
- readonly lastActivity: string | null;
209
- readonly skills: ReadonlyArray<SkillView>;
210
- }
211
-
212
- export interface MachineView {
213
- /** The name the machine's daemon uses; it identifies the machine and never changes. */
214
- readonly machine: string;
215
- /** What the dashboard calls it: renamed there, or the machine name until then. */
216
- readonly name: string;
217
- /** True while this machine's daemon holds a connection to the hub. */
218
- readonly online: boolean;
219
- /** The version its connected daemon runs; null while offline, or when the daemon is too old to say. */
220
- readonly daemonVersion: string | null;
221
- /** Each account's usage as its connected daemon last sent it; empty while offline, or from a daemon before 0.4.9. */
222
- readonly accounts: ReadonlyArray<AccountUsage>;
223
- readonly lastSeen: number | null;
224
- readonly folders: ReadonlyArray<FolderView>;
225
- }
226
-
227
- /** A skill on the synced list, as the server holds it: the version every enabled folder converges on. */
228
- export interface SyncedSkill {
229
- readonly name: string;
230
- readonly files: ReadonlyArray<FileHash & { readonly updatedBy: string; readonly editedAt: number }>;
231
- }
232
-
233
- /** Hub → dashboard: the whole picture, resent on every change. It is small, and a diff protocol is not. */
234
- export interface Snapshot {
235
- readonly type: "snapshot";
236
- /** The deployed service version. A dashboard built by another version reloads itself. */
237
- readonly version: string;
238
- /** The `latest` version of this package on npm, which every daemon upgrades to; null if npm could not be reached. */
239
- readonly publishedVersion: string | null;
240
- /** Display name for every machine name that appears anywhere in the snapshot, including old log entries. */
241
- readonly names: Readonly<Record<string, string>>;
242
- readonly skills: ReadonlyArray<SyncedSkill>;
243
- readonly machines: ReadonlyArray<MachineView>;
244
- }
245
-
246
- /** Dashboard → hub. */
247
- export type DashboardMessage =
248
- | { readonly type: "setFolder"; readonly machine: string; readonly path: string; readonly enabled: boolean }
249
- /** Adds a skill to the synced list, or removes it: one list for every machine and folder. */
250
- | { readonly type: "setSkill"; readonly skill: string; readonly synced: boolean }
251
- /** An empty name restores the machine name. */
252
- | { readonly type: "renameMachine"; readonly machine: string; readonly name: string };