@bendyline/gezel 0.1.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.
@@ -0,0 +1,578 @@
1
+ /**
2
+ * Marker written by the privileged installer after a legacy machine-home
3
+ * migration has completed. Merely finding a writable-looking directory is
4
+ * not enough to mount it: the marker is the installer's assertion that the
5
+ * root has the intended cross-account ACL and contains migrated product data.
6
+ */
7
+ declare const MACHINE_SHARED_MARKER = ".gezel-machine-shared-v1.json";
8
+ /**
9
+ * Canonical root for explicit machine-shared product data. This is separate
10
+ * from the machine engine broker's private home: user daemons perform every
11
+ * project/gezel filesystem operation with the logged-in user's permissions.
12
+ *
13
+ * GEZEL_MACHINE_SHARED_HOME is primarily an operator/test override. A root is
14
+ * mounted only when {@link MACHINE_SHARED_MARKER} exists beneath it.
15
+ */
16
+ declare function machineSharedHome(platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv): string | null;
17
+ declare function machineSharedMarkerFile(platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv): string | null;
18
+ /** A shared root is trusted only after the installer publishes its marker. */
19
+ declare function activeMachineSharedHome(env?: NodeJS.ProcessEnv): string | null;
20
+ type MachineStorageScope = 'user' | 'machine-shared';
21
+ /** Explicit user-home entity locations, bypassing shared-root resolution. */
22
+ declare function userGezelDir(root: string, gezelId: string, external?: ExternalFolders): string;
23
+ declare function userProjectDir(root: string, projectId: string): string;
24
+ /**
25
+ * Per-account sidecar for project runtime state.
26
+ *
27
+ * Unlike {@link projectStorageDir}, this NEVER follows a machine-shared project
28
+ * into the installer-managed shared root. It is the only appropriate home for
29
+ * approvals, questions, histories, terminals, executable installs, and
30
+ * derived databases that belong to the logged-in user's daemon.
31
+ *
32
+ * A sidecar deliberately has no `project.json`; projectStorageScope therefore
33
+ * continues to resolve the canonical definition from the machine-shared root.
34
+ */
35
+ declare function projectPrivateDir(root: string, projectId: string): string;
36
+ declare function machineSharedGezelDir(gezelId: string): string | null;
37
+ declare function machineSharedProjectDir(projectId: string): string | null;
38
+ /**
39
+ * Local definition wins on id collision. Sidecar-only user directories (for
40
+ * private sessions/memories belonging to a shared gezel) deliberately do not:
41
+ * `gezel.md` is the definition/ownership signal.
42
+ */
43
+ declare function gezelStorageScope(root: string, gezelId: string, external?: ExternalFolders): MachineStorageScope;
44
+ /** `project.json` is the project definition/ownership signal. */
45
+ declare function projectStorageScope(root: string, projectId: string): MachineStorageScope;
46
+ /**
47
+ * Resolve the root of the Gezel user directory. Defaults to `~/.gezel`
48
+ * but can be overridden with the `GEZEL_HOME` environment variable (used
49
+ * heavily by the integration tests).
50
+ */
51
+ declare function gezelHome(env?: NodeJS.ProcessEnv): string;
52
+ /**
53
+ * Per-scope external roots. When a field is set, that scope's content
54
+ * lives outside `~/.gezel/` (e.g. on a OneDrive folder). Configured via
55
+ * Settings → Folders; persisted on `GezelConfig.externalFolders`. The
56
+ * helpers below take this struct as an optional trailing argument and
57
+ * route to the external location when present, otherwise fall back to
58
+ * the local layout.
59
+ *
60
+ * Some subdirectories deliberately stay local even when their parent
61
+ * scope is externalized (gezel `toolsets/`, project `workspace/`, `gh/`,
62
+ * `scripts/`, `project.json`, `history.jsonl`, `questions.json`). Those
63
+ * paths use the `*LocalDir` helpers, which never consult `external`.
64
+ */
65
+ interface ExternalFolders {
66
+ documents?: string;
67
+ gezels?: string;
68
+ projects?: string;
69
+ }
70
+ interface GezelPaths {
71
+ root: string;
72
+ config: string;
73
+ runtime: {
74
+ dir: string;
75
+ pid: string;
76
+ port: string;
77
+ /**
78
+ * Per-launch first-party client credential used for service discovery.
79
+ * It carries the reserved `ui` plus local-facade `openai` scopes; the
80
+ * daemon root credential is process-local and must never be written here.
81
+ */
82
+ token: string;
83
+ /**
84
+ * PEM-encoded loopback TLS cert. Public material; chmod 0644 so
85
+ * external clients (CLI, ad-hoc curl) can read it. Rotated on every
86
+ * daemon start, same as `token`. Only present when the daemon is
87
+ * serving HTTPS — absent under `GEZEL_INSECURE_TRANSPORT=1`.
88
+ */
89
+ cert: string;
90
+ /**
91
+ * Hex SHA-256 of the cert's DER bytes — what the Electron renderer
92
+ * pins via `session.setCertificateVerifyProc`. Stored as a separate
93
+ * file so the supervisor can read the fingerprint without parsing
94
+ * the PEM.
95
+ */
96
+ fingerprint: string;
97
+ /**
98
+ * Per-launch ephemeral token for the browser web-UI mode (`gezel
99
+ * start --web`). Written only when web mode is on; the CLI reads it
100
+ * to compose the one-time `?token=` URL it prints, so the root token
101
+ * never lands in a URL / shell history. Same lifecycle as `token` —
102
+ * rotates every boot, not persisted to `tokens.json`.
103
+ */
104
+ webUiToken: string;
105
+ };
106
+ /**
107
+ * Directory where Electron extracts the `service-bundle/` tree on first
108
+ * launch. This is the stable path users can `cd` into to run local dev
109
+ * commands against the bundled CLI (e.g. `npx @github/copilot login`).
110
+ */
111
+ install: string;
112
+ gezels: string;
113
+ projects: string;
114
+ documents: string;
115
+ logs: string;
116
+ }
117
+ declare function gezelPaths(root?: string, external?: ExternalFolders): GezelPaths;
118
+ /**
119
+ * Always-local private transaction state. Unlike `runtime/`, this directory
120
+ * contains daemon-internal recovery metadata and must never be exposed as
121
+ * desktop-client discovery material on a machine-wide install.
122
+ */
123
+ declare function daemonTransactionsRoot(root: string): string;
124
+ /** Durable journals + isolated staging homes for atomic typed-project creation. */
125
+ declare function projectCreateTransactionsRoot(root: string): string;
126
+ /**
127
+ * Per-gezel directory holding `gezel.md`, `about.md`, `icon.svg`,
128
+ * `icons/`, `sessions/`, `memories/`, `resources/`. Routes to the
129
+ * external location when `external.gezels` is set.
130
+ *
131
+ * Note: `toolsets/` and `toolsets.json` are deliberately NOT under this
132
+ * dir when externalized — they stay local (see {@link gezelLocalDir}).
133
+ */
134
+ declare function gezelDir(root: string, gezelId: string, external?: ExternalFolders): string;
135
+ /**
136
+ * Always-local per-gezel directory. Holds installed toolsets (npm
137
+ * package extracts) — kept out of cloud-synced folders because
138
+ * node_modules churn is hostile to OneDrive/Dropbox-style sync.
139
+ */
140
+ declare function gezelLocalDir(root: string, gezelId: string): string;
141
+ declare function gezelSessionsDir(root: string, gezelId: string, external?: ExternalFolders): string;
142
+ declare function gezelSessionFile(root: string, gezelId: string, sessionId: string, external?: ExternalFolders): string;
143
+ /**
144
+ * Per-gezel memories directory (daily markdown + summary + vectra index).
145
+ * Moves with the gezel when externalized.
146
+ */
147
+ declare function gezelMemoriesDir(root: string, gezelId: string, external?: ExternalFolders): string;
148
+ /**
149
+ * Per-gezel growth.json — level / XP / pending level-up state. Travels
150
+ * with the gezel when externalized, like the memories dir.
151
+ */
152
+ declare function gezelGrowthPath(root: string, gezelId: string, external?: ExternalFolders): string;
153
+ /** JSON file of installed toolsets for a gezel. Always local. */
154
+ declare function gezelToolsetsFile(root: string, gezelId: string): string;
155
+ /**
156
+ * Optional per-gezel `tools.md` — power-user override that fully
157
+ * replaces the auto-injected `## Tools available this turn` block in
158
+ * the system prompt. When present, the gezel's owner takes
159
+ * responsibility for keeping the listing accurate as the install's
160
+ * registered tools evolve. When absent (the default), the runtime
161
+ * computes the listing from the live MCP bridge's
162
+ * `getOpenAITools()` post-allowlist set.
163
+ *
164
+ * Lives in the externalizable per-gezel directory alongside `gezel.md`
165
+ * and `icon.svg` (NOT in the always-local `gezelLocalDir`) — it
166
+ * describes how the gezel uses tools, which is character-shaped, so
167
+ * it should travel with the gezel when externalized.
168
+ */
169
+ declare function gezelToolsPath(root: string, gezelId: string, external?: ExternalFolders): string;
170
+ /** Root for on-disk toolset installs, e.g. npm-package extracts. Always local. */
171
+ declare function gezelToolsetsInstallDir(root: string, gezelId: string): string;
172
+ /**
173
+ * Per-gezel `poppetje.json` — the resolved Poppetje struct (body shape,
174
+ * skin, hair, hat, etc.) that drives the parametric SVG renderer in the
175
+ * UI. Persisted explicitly so adding new catalog entries or tuning slot
176
+ * odds later never drifts existing characters. Travels with the gezel
177
+ * when externalized.
178
+ */
179
+ declare function gezelPoppetjePath(root: string, gezelId: string, external?: ExternalFolders): string;
180
+ /**
181
+ * Per-project directory holding the project's content. Routes to the
182
+ * external location when `external.projects` is set.
183
+ *
184
+ * The canonical `project.json` plus an internal `workspace/` / legacy `gh/`
185
+ * checkout follow this directory. Account-private runtime state does not: it
186
+ * stays under {@link projectPrivateDir}, even when this project is
187
+ * machine-shared.
188
+ */
189
+ declare function projectDir(root: string, projectId: string, external?: ExternalFolders): string;
190
+ /**
191
+ * Canonical on-machine project directory. For a machine-shared project this
192
+ * follows the project into the installer-managed shared root; otherwise it is
193
+ * the user's project directory.
194
+ *
195
+ * This helper is for the project definition and intentionally shared project
196
+ * content such as its internal workspace. Per-account runtime state must use
197
+ * {@link projectPrivateDir} instead.
198
+ */
199
+ declare function projectStorageDir(root: string, projectId: string): string;
200
+ /**
201
+ * @deprecated The old name blurred canonical project storage with private
202
+ * daemon state. Use {@link projectStorageDir} for shared project content or
203
+ * {@link projectPrivateDir} for per-account state.
204
+ */
205
+ declare function projectLocalDir(root: string, projectId: string): string;
206
+ /** Per-project `project.json` metadata file. Always local. */
207
+ declare function projectMetaFile(root: string, projectId: string): string;
208
+ /** Durable user/worker lifecycle for indexed code findings. Account-private. */
209
+ declare function projectFindingLifecycleFile(root: string, projectId: string): string;
210
+ /** Durable per-project code-review records for this account. */
211
+ declare function projectCodeReviewsFile(root: string, projectId: string): string;
212
+ /** Durable per-account report-action lifecycle records. */
213
+ declare function projectReportActionsFile(root: string, projectId: string): string;
214
+ /** Per-project documents folder — holds about.md, missionObjectives.md, etc. */
215
+ declare function projectDocsDir(root: string, projectId: string, external?: ExternalFolders): string;
216
+ /** Per-project artifacts folder — agent-generated outputs. */
217
+ declare function projectArtifactsDir(root: string, projectId: string, external?: ExternalFolders): string;
218
+ /** Per-project memories folder (daily markdown + summary + vectra index). */
219
+ declare function projectMemoriesDir(root: string, projectId: string, external?: ExternalFolders): string;
220
+ /**
221
+ * Per-account derived vector index for project memories. The canonical memory
222
+ * markdown follows the project via {@link projectMemoriesDir}; mutable SQLite
223
+ * never does.
224
+ */
225
+ declare function projectMemoryIndexDir(root: string, projectId: string): string;
226
+ /**
227
+ * Default location for the cloned GitHub repo when neither (a) the project
228
+ * has a workingDir nor (b) the existing workingDir already holds the repo.
229
+ * Internal-only checkout: lives under the project folder. Always local.
230
+ *
231
+ * Pre-Phase-2: this was where every github-linked project's clone landed.
232
+ * Post-Phase-2: new projects clone into the workspace directly; this path
233
+ * is kept around to (a) adopt legacy clones in `GitManager.resolveCheckout`
234
+ * and (b) feed the one-shot `Store.migrateLegacyGhCheckouts` migration that
235
+ * moves legacy `gh/` clones into `workspace/`. New code should not assume
236
+ * a clone lives here.
237
+ */
238
+ declare function projectInternalGithubDir(root: string, projectId: string): string;
239
+ /**
240
+ * Root for shared bare clones (Phase 3). Multiple projects pointing at
241
+ * the same github URL share a single bare clone here; each project's
242
+ * workspace is created via `git worktree add` off the bare clone. Saves
243
+ * disk space (no duplicate `.git/objects` per project) and unlocks the
244
+ * "PR review + main branch in parallel" workflow without re-fetching.
245
+ *
246
+ * Lives at `<root>/git-clones/`. Always local — the bare clones are
247
+ * host-specific (worktree paths, packed refs, hooks) and shouldn't
248
+ * cloud-sync.
249
+ */
250
+ declare function sharedClonesRoot(root: string): string;
251
+ /**
252
+ * Path to the bare clone for a specific github URL. The `key` is the
253
+ * caller-derived stable identifier (typically `<owner>-<repo>-<hash>`)
254
+ * so two URL strings that normalize to the same repo share one clone.
255
+ */
256
+ declare function sharedCloneDir(root: string, key: string): string;
257
+ /**
258
+ * Per-project background-index folder. Holds `commands.json`,
259
+ * `files.json`, `tokens.json`, `index.meta.json` — produced by the
260
+ * workspace indexer. Always local: the index is host-machine-specific
261
+ * (paths, mtimes, installed CLIs) and shouldn't sync across machines.
262
+ */
263
+ declare function projectIndexDir(root: string, projectId: string): string;
264
+ /**
265
+ * Per-project terminal-threads folder. Holds `{threadId}.json` files,
266
+ * one per (project, workingDir) pair. Always local: terminal output
267
+ * is host-machine-specific and not interesting to sync across
268
+ * machines.
269
+ */
270
+ declare function projectTerminalsDir(root: string, projectId: string): string;
271
+ declare function projectTerminalFile(root: string, projectId: string, threadId: string): string;
272
+ /** JSONL file holding events that aren't scoped to any project. */
273
+ declare function globalHistoryFile(root: string): string;
274
+ /**
275
+ * Home-scoped index directory for cross-project derived caches (session
276
+ * transcripts, history mirror, documents library). Always local: it's a
277
+ * rebuildable sqlite cache, never user data, so it stays out of
278
+ * `ExternalFolders` on purpose.
279
+ */
280
+ declare function globalIndexDir(root: string): string;
281
+ declare function globalIndexDbFile(root: string): string;
282
+ /** Per-project JSONL holding events scoped to that project. Always local. */
283
+ declare function projectHistoryFile(root: string, projectId: string): string;
284
+ /**
285
+ * Single per-project file holding the array of structured Q&A
286
+ * (`Question` records) created by the `ask_user_question` MCP tool.
287
+ * One file rather than per-id because volume is low and the panels
288
+ * always want the full list. Always local.
289
+ */
290
+ declare function projectQuestionsFile(root: string, projectId: string): string;
291
+ /**
292
+ * Per-project last-activity stamp maintained by the ActivityTracker.
293
+ * Separate from `project.json` so ambient stamping never contends with
294
+ * (or bumps `updatedAt` on) the metadata file. Always local.
295
+ */
296
+ declare function projectActivityFile(root: string, projectId: string): string;
297
+ /**
298
+ * Home for the meester's status report — the dynamic Home greeting
299
+ * headline + dashboard markdown (`status.json`) and the generator's
300
+ * run budget / idempotency state (`state.json`). Store-managed.
301
+ */
302
+ declare function meesterStatusDir(root: string): string;
303
+ declare function meesterStatusFile(root: string): string;
304
+ declare function meesterStatusStateFile(root: string): string;
305
+ declare function projectTasksDir(root: string, projectId: string, external?: ExternalFolders): string;
306
+ declare function projectTaskNextIdFile(root: string, projectId: string, external?: ExternalFolders): string;
307
+ declare function projectTaskDir(root: string, projectId: string, num: number, external?: ExternalFolders): string;
308
+ declare function projectTaskFile(root: string, projectId: string, num: number, external?: ExternalFolders): string;
309
+ declare function projectTaskNotesFile(root: string, projectId: string, num: number, external?: ExternalFolders): string;
310
+ /**
311
+ * Free-form prose `about.md` at the root of a task folder. Stores the
312
+ * task's `description` body — the long "what we're solving and what
313
+ * success looks like" prose that's injected into task-scoped chat
314
+ * sessions. Kept out of `task.json` so the JSON stays compact and
315
+ * the prose can be edited as a real markdown file.
316
+ */
317
+ declare function projectTaskAboutFile(root: string, projectId: string, num: number, external?: ExternalFolders): string;
318
+ /**
319
+ * Account-private project-scoped scripts directory. Holds `.ts` files with a mandatory
320
+ * `export const meta` block; see `schemas/script.ts`. Not recursive —
321
+ * one script per file, resolved by `meta.name`. Always local.
322
+ */
323
+ declare function projectScriptsDir(root: string, projectId: string): string;
324
+ declare function projectScriptFile(root: string, projectId: string, name: string): string;
325
+ /**
326
+ * The user's machine-wide script library (`scope: 'user'` refs) —
327
+ * scripts shared across every project on this device. Same file
328
+ * conventions as project scripts. Always local.
329
+ */
330
+ declare function userScriptsDir(root: string): string;
331
+ declare function userScriptFile(root: string, name: string): string;
332
+ /**
333
+ * Per-project directory holding persisted `ScriptRun` records, sharded
334
+ * by UTC date so a long-lived project doesn't accumulate a single
335
+ * giant directory. Always local.
336
+ */
337
+ declare function projectScriptRunsDir(root: string, projectId: string): string;
338
+ declare function projectScriptRunFile(root: string, projectId: string, isoDate: string, runId: string): string;
339
+ /**
340
+ * Local catalog source for user-authored craftbook templates. Mirrors
341
+ * the bundled catalog layout under
342
+ * `~/.gezel/craftbook-templates/{prefix}/{id}/versions/{version}/`. The
343
+ * `CatalogService` picks this up alongside the bundled source so user
344
+ * craftbooks browse next to shipped ones.
345
+ */
346
+ declare function craftbookTemplatesRoot(root: string): string;
347
+ declare function craftbookTemplateDir(root: string, prefix: string, id: string): string;
348
+ declare function craftbookTemplateManifestFile(root: string, prefix: string, id: string): string;
349
+ declare function craftbookTemplateVersionDir(root: string, prefix: string, id: string, version: string): string;
350
+ declare function craftbookTemplateVersionManifestFile(root: string, prefix: string, id: string, version: string): string;
351
+ /** Directory holding a craftbook version's bundled `*.ts` scripts. */
352
+ declare function craftbookTemplateScriptsDir(root: string, prefix: string, id: string, version: string): string;
353
+ /** A single bundled script file inside a craftbook version. */
354
+ declare function craftbookTemplateScriptFile(root: string, prefix: string, id: string, version: string, name: string): string;
355
+ /** First two lowercased chars of a craftbook id — the catalog's shard prefix. */
356
+ declare function craftbookShardPrefix(id: string): string;
357
+ /**
358
+ * Local catalog source for user-installed / imported project types. Mirrors
359
+ * the bundled catalog layout under
360
+ * `~/.gezel/project-types/{prefix}/{id}/versions/{version}/`. A `.gzl`
361
+ * import or a "install from gilde" action copies items here so they browse
362
+ * next to the bundled ones. See docs/project-types.md.
363
+ */
364
+ declare function projectTypesRoot(root: string): string;
365
+ declare function projectTypeDir(root: string, prefix: string, id: string): string;
366
+ declare function projectTypeManifestFile(root: string, prefix: string, id: string): string;
367
+ declare function projectTypeVersionDir(root: string, prefix: string, id: string, version: string): string;
368
+ declare function projectTypeVersionManifestFile(root: string, prefix: string, id: string, version: string): string;
369
+ /** First two lowercased chars of a project-type id — the catalog's shard prefix. */
370
+ declare function projectTypeShardPrefix(id: string): string;
371
+ /**
372
+ * Per-project authored definitions that travel WITH the repo. They live
373
+ * in a `.gezel/` folder inside the project's resolved WORKSPACE directory
374
+ * (workingDir > github checkout > internal workspace), NOT under
375
+ * `~/.gezel`. Holds the `@project` gezel + any other project-local
376
+ * gezels, project-local craftbooks, and import provenance.
377
+ *
378
+ * IMPORTANT: these helpers take a `workspaceDir` (resolved via
379
+ * `Store.projectWorkspaceDir`), not the gezel `root`. Runtime/derived
380
+ * state for a project-local gezel (poppetje, sessions, memories)
381
+ * deliberately stays in app-data under `~/.gezel/gezels/<encoded-id>/`
382
+ * keyed by the encoded id — the workspace `.gezel/` carries only the
383
+ * authored definition, so chat history never lands in the user's repo.
384
+ */
385
+ declare function projectLocalRoot(workspaceDir: string): string;
386
+ /**
387
+ * Workspace content-index store (code/doc intelligence — the boekwachter
388
+ * index). Lives under the project-local `.gezel/index/` so it travels with the
389
+ * repo *folder*, but gezel writes a `.gitignore` inside it so the binary sqlite
390
+ * DB + regenerable artifacts are never committed. Distinct from the host-local
391
+ * `_index/` (commands/files/tokens) under `~/.gezel`: that one is machine-
392
+ * specific (mtimes, installed CLIs); this one is content-derived.
393
+ */
394
+ declare function projectLocalIndexDir(workspaceDir: string): string;
395
+ declare function projectLocalIndexDbFile(workspaceDir: string): string;
396
+ /**
397
+ * Converted-document artifacts (squisq-flavored markdown + media + CSV),
398
+ * mirroring the source tree under `.gezel/files/<mirror>/<name>_files/`.
399
+ */
400
+ declare function projectLocalFilesDir(workspaceDir: string): string;
401
+ /**
402
+ * Quarantine for untrusted content the safety scanner refused to index
403
+ * (prompt-injection payloads, attachments that failed parser-safety checks).
404
+ * Lives under `.gezel/quarantine/` — inside the project-local root the content
405
+ * indexer skips, so quarantined material is structurally unreachable by search
406
+ * + embeddings. Operators can inspect the raw artifacts here manually.
407
+ */
408
+ declare function projectLocalQuarantineDir(workspaceDir: string): string;
409
+ /**
410
+ * Home-local fallback for the content index when the workspace `.gezel/` isn't
411
+ * writable (external read-only repos). Mirrors the `_index` placement but for
412
+ * the content-derived DB.
413
+ */
414
+ declare function fallbackProjectIndexDir(root: string, projectId: string): string;
415
+ /**
416
+ * Mutable content-index database for a project. Ordinary writable workspaces
417
+ * retain the historical `.gezel/index/` placement; machine-shared workspaces
418
+ * always use the account-private fallback to prevent cross-daemon SQLite use.
419
+ */
420
+ declare function projectContentIndexDbFile(root: string, projectId: string, workspaceDir: string): string;
421
+ /**
422
+ * The committable code-map "city file": placement anchors, user overrides, and
423
+ * the layout journal. Deliberately OUTSIDE the self-gitignored `.gezel/index/`
424
+ * subtree — committing it keeps the city stable across machines and index
425
+ * rebuilds.
426
+ */
427
+ declare function projectLocalVillageFile(workspaceDir: string): string;
428
+ /** Home-local village-file fallback (no external workingDir, or read-only repo). */
429
+ declare function fallbackProjectVillageFile(root: string, projectId: string): string;
430
+ /** `@project` about-source mapping (which instruction file feeds the prompt). */
431
+ declare function projectLocalConfigFile(workspaceDir: string): string;
432
+ /** Import provenance — hashes, ids, userEdited flags. */
433
+ declare function projectLocalImportsFile(workspaceDir: string): string;
434
+ /** Review-before-save proposals for generated JS scripts. */
435
+ declare function projectLocalPendingImportsFile(workspaceDir: string): string;
436
+ declare function projectLocalGezelsRoot(workspaceDir: string): string;
437
+ declare function projectLocalGezelDir(workspaceDir: string, localId: string): string;
438
+ declare function projectLocalCraftbooksRoot(workspaceDir: string): string;
439
+ declare function projectLocalCraftbookDir(workspaceDir: string, id: string): string;
440
+ /** JSON file of the shared toolsets — toolsets every gezel inherits. */
441
+ declare function sharedToolsetsFile(root: string): string;
442
+ /** Install root for the shared toolsets' on-disk extracts. */
443
+ declare function sharedToolsetsInstallDir(root: string): string;
444
+ /**
445
+ * JSON file of this account's project toolsets — installed by a custom project
446
+ * type and seen by this account's sessions scoped to that project. Kept in the
447
+ * private project sidecar so executable selection never crosses accounts.
448
+ * See docs/project-types.md.
449
+ */
450
+ declare function projectToolsetsFile(root: string, projectId: string): string;
451
+ /** Install root for a project's toolsets' on-disk extracts. */
452
+ declare function projectToolsetsInstallDir(root: string, projectId: string): string;
453
+ /**
454
+ * JSON tracking file for system-scope toolsets — records exactly what's on
455
+ * disk (id, version, integrity, installedAt) plus top-level `pnpmVersion`
456
+ * + `chromiumRevision`. Compared to the shipped `SYSTEM_TOOLSETS` manifest
457
+ * on boot; mismatch triggers a re-install for the affected entries.
458
+ */
459
+ declare function systemToolsetsFile(root: string): string;
460
+ /**
461
+ * Store-level `InstalledToolset[]` list for system-scope toolsets. Kept
462
+ * **separate** from {@link systemToolsetsFile}: that file carries the
463
+ * bootstrap's `SystemTrackingRecord` (object schema with `toolsets` map
464
+ * + `chromiumRevision`), while this one carries the Store's runtime list
465
+ * (array schema with `installPath` + full `runtime` snapshot). Previously,
466
+ * they shared the same path and silently overwrote each other
467
+ * — a bootstrap followed by a Store write would leave `systemToolsetsFile`
468
+ * unreadable as a `SystemTrackingRecord`, and the next boot would report
469
+ * "not installed" for everything.
470
+ */
471
+ declare function systemInstalledToolsetsFile(root: string): string;
472
+ /** Install root for system-scope toolset extracts (Playwright, etc.). */
473
+ declare function systemToolsetsInstallDir(root: string): string;
474
+ /**
475
+ * Opt-in live gilde content cache — newer `@bendyline/gilde` patch releases
476
+ * fetched at runtime by the GildeUpdateManager. Holds `versions/<v>/` (the
477
+ * extracted npm package) plus `state.json`. Rebuildable: the bundled pin is
478
+ * the permanent fallback, so deleting this tree only reverts content.
479
+ */
480
+ declare function gildeLiveRoot(root: string): string;
481
+ /** Version-named extracted `@bendyline/gilde` packages, `<version>/package/`. */
482
+ declare function gildeLiveVersionsDir(root: string): string;
483
+ /** One extracted live gilde version (contains the npm `package/` dir). */
484
+ declare function gildeLiveVersionDir(root: string, version: string): string;
485
+ /** Active-version + last-check tracking state for live gilde updates. */
486
+ declare function gildeLiveStateFile(root: string): string;
487
+ /**
488
+ * Directory where Playwright's own CLI drops browser binaries. Exported
489
+ * to both the service (sets `PLAYWRIGHT_BROWSERS_PATH` when spawning
490
+ * Playwright) and the bootstrap (verifies Chromium installed).
491
+ */
492
+ declare function playwrightBrowsersDir(root: string): string;
493
+ /** Directory holding one subfolder per toolset for its global config. */
494
+ declare function toolsetConfigsDir(root: string): string;
495
+ /** Per-toolset global config file (non-secret values only). */
496
+ declare function toolsetConfigFile(root: string, toolsetId: string): string;
497
+ /** AES-GCM encrypted blob file for the fallback FileSecretStore. */
498
+ declare function secretsFile(root: string): string;
499
+ /** Key material file for the fallback FileSecretStore (POSIX 0600). */
500
+ declare function secretsKeyFile(root: string): string;
501
+ /**
502
+ * Persisted per-app bearer tokens issued to third-party local apps via the
503
+ * `/v1/apps/register` consent flow. The ephemeral root token (rotated every
504
+ * launch) is **not** persisted here and never leaves process memory.
505
+ * `runtime/auth-token` contains a separate, scoped first-party client
506
+ * credential. POSIX 0600 on this file keeps third-party app bearer secrets
507
+ * private. Always local.
508
+ */
509
+ declare function tokensFile(root: string): string;
510
+ /**
511
+ * Persisted `/v1/apps/register` consent requests — both pending grants
512
+ * (waiting for the user to approve/deny in the Connected Apps UI) and
513
+ * decided grants (kept so a polling app can still observe the verdict
514
+ * after a daemon restart). The file is small; no rotation.
515
+ *
516
+ * Headless-Electron fallback: when the daemon runs without a UI attached,
517
+ * pending grants accumulate here. The next time the Electron app starts,
518
+ * it reads this file and surfaces them as notifications. Always local.
519
+ */
520
+ declare function pendingGrantsFile(root: string): string;
521
+ /**
522
+ * Public half of this device's stable identity keypair (Ed25519) plus its
523
+ * `deviceId` and fingerprint. Used by the remote-model-execution pairing
524
+ * flow: a paired client pins this device's identity fingerprint (TOFU), and
525
+ * the private half (held in the SecretStore) signs the rotating TLS cert so
526
+ * trust survives reboots even though the loopback/LAN cert rotates. Public
527
+ * material; POSIX 0600 anyway so the deviceId isn't world-readable. Always
528
+ * local.
529
+ */
530
+ declare function deviceIdentityFile(root: string): string;
531
+ /**
532
+ * Servers this device has paired with for remote model execution (Device A's
533
+ * view): per-remote `{baseUrl, token, pinnedIdentityKey, ...}`. Holds bearer
534
+ * secrets, so POSIX 0600, same posture as `tokens.json`. Always local.
535
+ */
536
+ declare function remotesFile(root: string): string;
537
+ /** Root for all communication-channel per-channel state (future channels). */
538
+ declare function channelsDir(root: string): string;
539
+ /**
540
+ * Backups produced by the folder-externalization move worker. Each
541
+ * successful move snapshots the source tree under
542
+ * `~/.gezel/backup/<ISO-timestamp>/<scope>/` before swapping the config.
543
+ * Always local.
544
+ */
545
+ declare function backupsDir(root: string): string;
546
+ /**
547
+ * Sentinel + queue directory for the folder-externalization worker.
548
+ * Holds `active-move.json` while a move is in flight so the next boot
549
+ * can detect a crashed mid-move. Always local.
550
+ */
551
+ declare function foldersStateDir(root: string): string;
552
+ /**
553
+ * Keurmeester supervision state: append-only case records plus generated
554
+ * digest reports. A deliberate Store carve-out owned by KeurmeesterManager
555
+ * (packages/service/src/keurmeester/) — same posture as `history.jsonl`.
556
+ * Always local.
557
+ */
558
+ declare function keurmeesterDir(root: string): string;
559
+ /** Monthly-sharded JSONL case records: `cases/YYYY-MM.jsonl`. */
560
+ declare function keurmeesterCasesDir(root: string): string;
561
+ /** Generated digest reports: `digests/YYYY-MM-DD.md`. */
562
+ declare function keurmeesterDigestsDir(root: string): string;
563
+ /** Digest idempotency state (last generated date, last case offset). */
564
+ declare function keurmeesterDigestStatePath(root: string): string;
565
+ /**
566
+ * Read the on-disk `config.json` without instantiating a Store. Used at
567
+ * boot to discover `externalFolders` before the Store is constructed
568
+ * (the Store needs `external` to resolve every other path correctly,
569
+ * but the config file itself always lives at `<root>/config.json`).
570
+ *
571
+ * Returns an empty object if the file is missing or unreadable; callers
572
+ * fall back to defaults. Intentionally typed loosely (`unknown`-ish) —
573
+ * no Zod parse here so schema additions don't tie the boot path to
574
+ * regenerating types.
575
+ */
576
+ declare function readConfigRaw(root: string): Promise<Record<string, unknown>>;
577
+
578
+ export { type ExternalFolders, type GezelPaths, MACHINE_SHARED_MARKER, type MachineStorageScope, activeMachineSharedHome, backupsDir, channelsDir, craftbookShardPrefix, craftbookTemplateDir, craftbookTemplateManifestFile, craftbookTemplateScriptFile, craftbookTemplateScriptsDir, craftbookTemplateVersionDir, craftbookTemplateVersionManifestFile, craftbookTemplatesRoot, daemonTransactionsRoot, deviceIdentityFile, fallbackProjectIndexDir, fallbackProjectVillageFile, foldersStateDir, gezelDir, gezelGrowthPath, gezelHome, gezelLocalDir, gezelMemoriesDir, gezelPaths, gezelPoppetjePath, gezelSessionFile, gezelSessionsDir, gezelStorageScope, gezelToolsPath, gezelToolsetsFile, gezelToolsetsInstallDir, gildeLiveRoot, gildeLiveStateFile, gildeLiveVersionDir, gildeLiveVersionsDir, globalHistoryFile, globalIndexDbFile, globalIndexDir, keurmeesterCasesDir, keurmeesterDigestStatePath, keurmeesterDigestsDir, keurmeesterDir, machineSharedGezelDir, machineSharedHome, machineSharedMarkerFile, machineSharedProjectDir, meesterStatusDir, meesterStatusFile, meesterStatusStateFile, pendingGrantsFile, playwrightBrowsersDir, projectActivityFile, projectArtifactsDir, projectCodeReviewsFile, projectContentIndexDbFile, projectCreateTransactionsRoot, projectDir, projectDocsDir, projectFindingLifecycleFile, projectHistoryFile, projectIndexDir, projectInternalGithubDir, projectLocalConfigFile, projectLocalCraftbookDir, projectLocalCraftbooksRoot, projectLocalDir, projectLocalFilesDir, projectLocalGezelDir, projectLocalGezelsRoot, projectLocalImportsFile, projectLocalIndexDbFile, projectLocalIndexDir, projectLocalPendingImportsFile, projectLocalQuarantineDir, projectLocalRoot, projectLocalVillageFile, projectMemoriesDir, projectMemoryIndexDir, projectMetaFile, projectPrivateDir, projectQuestionsFile, projectReportActionsFile, projectScriptFile, projectScriptRunFile, projectScriptRunsDir, projectScriptsDir, projectStorageDir, projectStorageScope, projectTaskAboutFile, projectTaskDir, projectTaskFile, projectTaskNextIdFile, projectTaskNotesFile, projectTasksDir, projectTerminalFile, projectTerminalsDir, projectToolsetsFile, projectToolsetsInstallDir, projectTypeDir, projectTypeManifestFile, projectTypeShardPrefix, projectTypeVersionDir, projectTypeVersionManifestFile, projectTypesRoot, readConfigRaw, remotesFile, secretsFile, secretsKeyFile, sharedCloneDir, sharedClonesRoot, sharedToolsetsFile, sharedToolsetsInstallDir, systemInstalledToolsetsFile, systemToolsetsFile, systemToolsetsInstallDir, tokensFile, toolsetConfigFile, toolsetConfigsDir, userGezelDir, userProjectDir, userScriptFile, userScriptsDir };