ccdesk 0.2.2 → 0.2.4

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 (131) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +7 -4
  3. package/dist/core/agent-edit.d.ts +6 -0
  4. package/dist/{server → core}/agent-edit.js +15 -21
  5. package/dist/core/backups.d.ts +19 -0
  6. package/dist/{server → core}/backups.js +64 -48
  7. package/dist/core/core.d.ts +96 -0
  8. package/dist/core/core.js +57 -0
  9. package/dist/core/index.d.ts +22 -0
  10. package/dist/core/index.js +38 -0
  11. package/dist/core/mcp-edit.d.ts +23 -0
  12. package/dist/{server → core}/mcp-edit.js +121 -100
  13. package/dist/core/mutations.d.ts +20 -0
  14. package/dist/{server → core}/mutations.js +8 -15
  15. package/dist/core/open.d.ts +28 -0
  16. package/dist/{server → core}/open.js +38 -13
  17. package/dist/core/parse-edit.d.ts +12 -0
  18. package/dist/core/parse-edit.js +64 -0
  19. package/dist/core/reference.d.ts +3 -0
  20. package/dist/core/reference.js +11 -0
  21. package/dist/core/scan/compare.d.ts +7 -0
  22. package/dist/{server → core}/scan/compare.js +2 -2
  23. package/dist/core/scan/context.d.ts +13 -0
  24. package/dist/{server → core}/scan/context.js +55 -32
  25. package/dist/core/scan/data.d.ts +14 -0
  26. package/dist/core/scan/data.js +26 -0
  27. package/dist/core/scan/env.d.ts +28 -0
  28. package/dist/{server → core}/scan/env.js +15 -4
  29. package/dist/core/scan/files.d.ts +68 -0
  30. package/dist/core/scan/files.js +270 -0
  31. package/dist/core/scan/git.d.ts +20 -0
  32. package/dist/core/scan/git.js +106 -0
  33. package/dist/core/scan/index.d.ts +5 -0
  34. package/dist/{server → core}/scan/index.js +119 -82
  35. package/dist/core/scan/instructions.d.ts +54 -0
  36. package/dist/{server → core}/scan/instructions.js +141 -73
  37. package/dist/core/scan/inventory.d.ts +38 -0
  38. package/dist/{server → core}/scan/inventory.js +134 -115
  39. package/dist/core/scan/mcp.d.ts +28 -0
  40. package/dist/{server → core}/scan/mcp.js +153 -95
  41. package/dist/core/scan/memory.d.ts +8 -0
  42. package/dist/{server → core}/scan/memory.js +8 -8
  43. package/dist/core/scan/path-test.d.ts +9 -0
  44. package/dist/core/scan/path-test.js +156 -0
  45. package/dist/core/scan/permissions.d.ts +31 -0
  46. package/dist/{server → core}/scan/permissions.js +5 -8
  47. package/dist/core/scan/plugins.d.ts +39 -0
  48. package/dist/{server → core}/scan/plugins.js +36 -27
  49. package/dist/core/scan/projects.d.ts +9 -0
  50. package/dist/{server → core}/scan/projects.js +7 -5
  51. package/dist/core/scan/sandbox.d.ts +14 -0
  52. package/dist/{server → core}/scan/sandbox.js +87 -59
  53. package/dist/core/scan/settings.d.ts +37 -0
  54. package/dist/{server → core}/scan/settings.js +98 -93
  55. package/dist/core/scan/tools.d.ts +10 -0
  56. package/dist/{server → core}/scan/tools.js +28 -20
  57. package/dist/core/scan/usage.d.ts +19 -0
  58. package/dist/{server → core}/scan/usage.js +122 -97
  59. package/dist/core/schema.d.ts +8 -0
  60. package/dist/core/schema.js +67 -0
  61. package/dist/core/secrets.d.ts +45 -0
  62. package/dist/core/secrets.js +207 -0
  63. package/dist/core/settings-edit.d.ts +9 -0
  64. package/dist/{server → core}/settings-edit.js +91 -112
  65. package/dist/core/watch.d.ts +45 -0
  66. package/dist/{server → core}/watch.js +54 -17
  67. package/dist/core/write.d.ts +117 -0
  68. package/dist/{server → core}/write.js +61 -8
  69. package/dist/server/args.d.ts +32 -0
  70. package/dist/server/args.js +106 -0
  71. package/dist/server/cli.d.ts +2 -0
  72. package/dist/server/cli.js +58 -83
  73. package/dist/server/commands.d.ts +8 -0
  74. package/dist/server/commands.js +39 -0
  75. package/dist/server/server.d.ts +12 -0
  76. package/dist/server/server.js +80 -195
  77. package/dist/server/start.d.ts +13 -0
  78. package/dist/server/start.js +21 -0
  79. package/dist/shared/compare.d.ts +25 -0
  80. package/dist/shared/memory.d.ts +6 -0
  81. package/dist/shared/memory.js +18 -2
  82. package/dist/shared/requests.d.ts +104 -0
  83. package/dist/shared/requests.js +73 -0
  84. package/dist/shared/scopes.d.ts +10 -0
  85. package/dist/shared/settings-catalog.json +2199 -0
  86. package/dist/shared/types.d.ts +535 -0
  87. package/dist/shared/types.js +11 -0
  88. package/dist/ui/assets/index-C9qqEI5Z.js +60 -0
  89. package/dist/ui/index.html +1 -1
  90. package/dist/view/diff.d.ts +16 -0
  91. package/dist/view/diff.js +85 -0
  92. package/dist/view/format.d.ts +17 -0
  93. package/dist/view/format.js +47 -0
  94. package/dist/view/index.d.ts +11 -0
  95. package/dist/view/index.js +13 -0
  96. package/dist/view/lines.d.ts +9 -0
  97. package/dist/view/lines.js +12 -0
  98. package/dist/view/path-test.d.ts +3 -0
  99. package/dist/view/path-test.js +7 -0
  100. package/dist/view/sections/catalog.d.ts +9 -0
  101. package/dist/view/sections/catalog.js +47 -0
  102. package/dist/view/sections/extensions.d.ts +1 -0
  103. package/dist/view/sections/extensions.js +48 -0
  104. package/dist/view/sections/hooks.d.ts +1 -0
  105. package/dist/view/sections/hooks.js +32 -0
  106. package/dist/view/sections/index.d.ts +6 -0
  107. package/dist/view/sections/index.js +27 -0
  108. package/dist/view/sections/instructions.d.ts +6 -0
  109. package/dist/view/sections/instructions.js +38 -0
  110. package/dist/view/sections/mcp.d.ts +3 -0
  111. package/dist/view/sections/mcp.js +38 -0
  112. package/dist/view/sections/memory.d.ts +1 -0
  113. package/dist/view/sections/memory.js +31 -0
  114. package/dist/view/sections/permissions.d.ts +17 -0
  115. package/dist/view/sections/permissions.js +87 -0
  116. package/dist/view/sections/settings.d.ts +1 -0
  117. package/dist/view/sections/settings.js +33 -0
  118. package/dist/view/sections/tools.d.ts +6 -0
  119. package/dist/view/sections/tools.js +57 -0
  120. package/dist/view/sections/types.d.ts +123 -0
  121. package/dist/view/sections/types.js +10 -0
  122. package/dist/view/settings.d.ts +12 -0
  123. package/dist/view/settings.js +31 -0
  124. package/dist/view/usage.d.ts +8 -0
  125. package/dist/view/usage.js +18 -0
  126. package/package.json +13 -2
  127. package/dist/server/scan/files.js +0 -480
  128. package/dist/server/scan/path-test.js +0 -136
  129. package/dist/server/schema.js +0 -15
  130. package/dist/server/secrets.js +0 -63
  131. package/dist/ui/assets/index-Dg9dxngR.js +0 -60
@@ -0,0 +1,535 @@
1
+ /** Where a piece of config comes from, in Claude Code's own terms. */
2
+ export type Scope = "managed" | "user" | "project" | "local";
3
+ /** Who can see a file: files tracked in git reach everyone who clones the repo. */
4
+ export type Visibility = "tracked" | "untracked" | "ignored" | "no-git";
5
+ interface FileRef {
6
+ path: string;
7
+ /** Where a symlinked file, or a rule in a linked folder outside the project, really is. */
8
+ realPath?: string;
9
+ mtime: string;
10
+ bytes: number;
11
+ lines: number;
12
+ visibility?: Visibility;
13
+ }
14
+ export interface TextFile extends FileRef {
15
+ text: string;
16
+ }
17
+ export type InstructionKind = "claude-md" | "claude-local-md" | "agents-md" | "rule";
18
+ export interface ImportRef {
19
+ raw: string;
20
+ resolved: string;
21
+ /** The file that imports it: the instruction file, or an import of it. */
22
+ via: string;
23
+ exists: boolean;
24
+ /** Resolves outside the working directory, so Claude Code asks once before loading it. */
25
+ external: boolean;
26
+ /** External import from a project file that waits for (or was refused) your approval. */
27
+ pending?: boolean;
28
+ /** Over 4 MiB, which Claude Code does not load. */
29
+ tooLarge?: boolean;
30
+ }
31
+ /** Whether a file loads at session start, once Claude works with matching files, or not at all. */
32
+ type InstructionStatus = "loaded" | "on-match" | "skipped";
33
+ export interface Instruction extends TextFile {
34
+ kind: InstructionKind;
35
+ scope: Scope;
36
+ /** Directory the file belongs to (the one Claude Code walked through). */
37
+ dir: string;
38
+ status: InstructionStatus;
39
+ /** Why the file loads or not, in plain words. */
40
+ reason: string;
41
+ imports: ImportRef[];
42
+ /** `paths:` globs on a rule; such rules load only when Claude touches matching files. */
43
+ paths?: string[];
44
+ /** Upkeep notes from ccdesk, such as a file longer than Claude Code's docs recommend. */
45
+ checks: string[];
46
+ }
47
+ export type AgentsMdMode = "claude-md-or-agents-md" | "claude-md-and-agents-md" | "claude-md" | "managed-only";
48
+ export type MemoryType = "user" | "feedback" | "project" | "reference" | "unknown";
49
+ export interface Memory {
50
+ file: string;
51
+ path: string;
52
+ name: string;
53
+ description: string;
54
+ type: MemoryType;
55
+ body: string;
56
+ mtime: string;
57
+ bytes: number;
58
+ /** Fingerprint of the file; deleting it requires it to be unchanged. */
59
+ revision: string;
60
+ inIndex: boolean;
61
+ /** Short content hash, used to spot the same memory in several directories. */
62
+ hash: string;
63
+ links: string[];
64
+ brokenLinks: string[];
65
+ /** Other memory names in this store that link here. */
66
+ linkedFrom: string[];
67
+ }
68
+ export interface MemoryIndex extends TextFile {
69
+ revision: string;
70
+ /** Claude Code loads only the first 200 lines or 25KB of MEMORY.md. */
71
+ truncated: boolean;
72
+ loadedLines: number;
73
+ /** Index lines pointing at a file that does not exist. */
74
+ missingFiles: string[];
75
+ }
76
+ export interface MemoryStore {
77
+ dir: string;
78
+ /** False when auto memory is turned off here; the files are still shown. */
79
+ loaded: boolean;
80
+ /** Why memory is off, or that it comes from autoMemoryDirectory. */
81
+ note?: string;
82
+ /** Set by autoMemoryDirectory; ccdesk only changes stores under ~/.claude/projects. */
83
+ custom?: boolean;
84
+ /** The directory the store is keyed by (git repository root or project root). */
85
+ projectPath: string | null;
86
+ index: MemoryIndex | null;
87
+ memories: Memory[];
88
+ }
89
+ export interface SettingsLayer {
90
+ scope: Scope;
91
+ path: string;
92
+ exists: boolean;
93
+ /** A local file an older Claude Code left in the start directory; the repository root's file wins. */
94
+ legacy?: boolean;
95
+ /** For managed settings: every file merged into this layer, managed-settings.d drop-ins included. */
96
+ sources?: string[];
97
+ visibility?: Visibility;
98
+ /** Parsed JSON with `env` and `headers` values redacted. */
99
+ data: Record<string, unknown> | null;
100
+ error?: string;
101
+ /** For managed settings: a file that is not a JSON object, so Claude Code refuses to start. */
102
+ blocksStart?: boolean;
103
+ /**
104
+ * For managed settings: managed sources that rank above these files and that ccdesk does not
105
+ * read, such as the server-managed settings cache or a macOS configuration profile.
106
+ */
107
+ higherSources?: string[];
108
+ }
109
+ export interface EffectiveSetting {
110
+ key: string;
111
+ value: unknown;
112
+ /** Scopes that contribute: one for a plain override, several for merged lists. */
113
+ from: Scope[];
114
+ merged: boolean;
115
+ /** Values from lower layers that lost to `from`. */
116
+ overridden: Array<{
117
+ scope: Scope;
118
+ value: unknown;
119
+ }>;
120
+ /** Values in files Claude Code does not read this key from. `from` is empty when all are. */
121
+ ignored: Array<{
122
+ scope: Scope;
123
+ value: unknown;
124
+ reason: string;
125
+ }>;
126
+ /** How this key resolves when that differs from plain precedence. */
127
+ note?: string;
128
+ }
129
+ /** The kinds of change ccdesk records, one per kind of file it changes. */
130
+ export declare const BACKUP_KINDS: readonly ["settings", "mcp", "agent", "memory-index", "memory-delete", "memory-restore", "mcp-claude"];
131
+ export type BackupKind = (typeof BACKUP_KINDS)[number];
132
+ /** One change ccdesk made, from its backup folder. */
133
+ export interface BackupSummary {
134
+ id: string;
135
+ kind: BackupKind;
136
+ /** The file that was changed (for a deleted memory: the memory file). */
137
+ target: string;
138
+ createdAt: string;
139
+ /** The change created the file, so restoring it removes the file. */
140
+ created: boolean;
141
+ /** The change was interrupted or failed halfway; the backup still holds the earlier text. */
142
+ incomplete?: boolean;
143
+ }
144
+ /** A change ccdesk made; Recent changes lists it under `id` and can undo it. */
145
+ export interface Change {
146
+ id: string;
147
+ target: string;
148
+ /** The file's revision right after the change, which an undo requires. */
149
+ revision: string;
150
+ /** The change created the file, so there is nothing to undo it to. */
151
+ created: boolean;
152
+ }
153
+ /** What ccdesk can change in auto memory: delete a memory, add one to MEMORY.md, or drop dead index lines. */
154
+ export type MemoryAction = "delete" | "add" | "remove-dead";
155
+ /** What a memory change would do to each file it touches, reviewed before anything is written. */
156
+ export interface MemoryChangePreview {
157
+ files: Array<{
158
+ path: string;
159
+ before: string | null;
160
+ /** null when the change deletes the file. */
161
+ after: string | null;
162
+ }>;
163
+ /** Fingerprint of everything the change was worked out from; saving requires it unchanged. */
164
+ revision: string;
165
+ }
166
+ /** What restoring a backup would change, shown as a diff before anything is written. */
167
+ export interface RestorePreview {
168
+ id: string;
169
+ kind: BackupKind;
170
+ target: string;
171
+ /** The file now; null when it does not exist. Settings are shown with secrets hidden. */
172
+ before: string | null;
173
+ /** The file as the backup holds it; empty when the restore removes the file. */
174
+ after: string;
175
+ /** Fingerprint of the file now (and of MEMORY.md, for a deleted memory); restoring requires it unchanged. */
176
+ revision: string;
177
+ /** The change created the file, so restoring removes it. */
178
+ removes?: boolean;
179
+ /** Why this backup cannot be restored right now. */
180
+ blocked?: string;
181
+ /** For a deleted memory: the lines put back into MEMORY.md. */
182
+ indexLines?: string[];
183
+ /**
184
+ * For a change made through `claude mcp`, which ccdesk cannot undo: the commands that put it
185
+ * back, values hidden. `before` and `after` are then the servers before and after the change.
186
+ */
187
+ undoCommands?: string[];
188
+ }
189
+ export interface Entry {
190
+ name: string;
191
+ description: string;
192
+ /** The file Claude Code reads (SKILL.md for a skill). */
193
+ path: string;
194
+ /** A skill's folder. */
195
+ folder?: string;
196
+ /** False for a skill Claude cannot invoke itself, which is left out of the skill listing. */
197
+ listed?: boolean;
198
+ /** The skillOverrides state set for this skill or command in settings, when not "on". */
199
+ override?: "name-only" | "user-invocable-only" | "off";
200
+ /** A subagent, skill or command whose name a definition Claude Code prefers also uses: that file. */
201
+ shadowedBy?: string;
202
+ /** Why Claude Code skips this subagent file, when its frontmatter falls short. */
203
+ skipped?: string;
204
+ /**
205
+ * The name Claude Code calls it by when that is not `name`: a plugin's entries are prefixed with
206
+ * the plugin, as in `my-plugin:review` or the subagent `my-plugin:review:security`.
207
+ */
208
+ id?: string;
209
+ /** A skill's `when_to_use`, appended to its description in the listing. */
210
+ whenToUse?: string;
211
+ /** A skill's `paths:` globs: Claude loads it on its own only for matching files. */
212
+ paths?: string[];
213
+ realPath?: string;
214
+ scope: Scope | "plugin";
215
+ plugin?: string;
216
+ model?: string;
217
+ text: string;
218
+ }
219
+ export interface Hook {
220
+ event: string;
221
+ matcher?: string;
222
+ type: string;
223
+ command: string;
224
+ source: Scope | "plugin";
225
+ sourcePath: string;
226
+ plugin?: string;
227
+ /** False when disableAllHooks or allowManagedHooksOnly turns it off, or it waits for workspace trust. */
228
+ active: boolean;
229
+ note?: string;
230
+ /** Where it is in its file: the matcher group under `event`, and the hook within the group. */
231
+ at: {
232
+ group: number;
233
+ index: number;
234
+ };
235
+ /** The hook as written, with header values hidden. */
236
+ definition: unknown;
237
+ }
238
+ export type McpStatus = "active" | "shadowed" | "disabled" | "rejected" | "pending" | "blocked" | "invalid";
239
+ /** A setting or saved answer that approves or rejects a .mcp.json server. */
240
+ export interface McpApproval {
241
+ key: "enableAllProjectMcpServers" | "enabledMcpjsonServers" | "disabledMcpjsonServers";
242
+ /** A settings file, or your answers to Claude Code's prompt in ~/.claude.json. */
243
+ source: Scope | "claude-json";
244
+ path: string;
245
+ /** False for an approval from repository settings that waits until the folder is trusted. */
246
+ counts: boolean;
247
+ }
248
+ export interface McpServer {
249
+ name: string;
250
+ scope: Scope | "plugin";
251
+ transport: string;
252
+ target: string;
253
+ sourcePath: string;
254
+ status: McpStatus;
255
+ plugin?: string;
256
+ /** Why the server is not started, in plain words. */
257
+ note?: string;
258
+ /** For a .mcp.json server, every setting or saved answer that names it, highest file first. */
259
+ approvals?: McpApproval[];
260
+ /** The server as written, with env, header and URL secrets hidden. */
261
+ definition: unknown;
262
+ }
263
+ export interface Plugin {
264
+ id: string;
265
+ version: string;
266
+ scope: string;
267
+ installPath: string;
268
+ updated: string | null;
269
+ enabled: boolean;
270
+ /** The settings file whose enabledPlugins entry decides it; unset when the default does. */
271
+ enabledIn?: Scope;
272
+ /** Where the enabled state comes from: a settings file or the plugin's default. */
273
+ note: string;
274
+ }
275
+ export interface ProjectSummary {
276
+ path: string;
277
+ exists: boolean;
278
+ sessions: number;
279
+ lastActive: string | null;
280
+ memories: number;
281
+ /** /tmp, test runs, scratch workspaces. */
282
+ ephemeral: boolean;
283
+ }
284
+ export interface Overview {
285
+ generatedAt: string;
286
+ home: string;
287
+ claudeDir: string;
288
+ launchDir: string;
289
+ platform: NodeJS.Platform;
290
+ projects: ProjectSummary[];
291
+ /** Memory names found in more than one store, with each store's content hash. */
292
+ sharedMemories: Array<{
293
+ name: string;
294
+ stores: Array<{
295
+ projectPath: string;
296
+ hash: string;
297
+ }>;
298
+ }>;
299
+ /** Every memory in every directory, for search. */
300
+ memoryCatalog: Array<{
301
+ projectPath: string;
302
+ path: string;
303
+ name: string;
304
+ description: string;
305
+ type: MemoryType;
306
+ }>;
307
+ }
308
+ export interface Inventory {
309
+ agents: Entry[];
310
+ skills: Entry[];
311
+ commands: Entry[];
312
+ outputStyles: Entry[];
313
+ hooks: Hook[];
314
+ mcpServers: McpServer[];
315
+ plugins: Plugin[];
316
+ }
317
+ /** One piece of what Claude Code puts in context at session start, in load order. */
318
+ export interface ContextBlock {
319
+ kind: "instruction" | "import" | "memory-index" | "output-style" | "skills" | "agents" | "not-counted";
320
+ /** A file, or a label for a listing ccdesk assembled. */
321
+ path: string;
322
+ scope: Scope | "memory" | "plugin";
323
+ /** For an import: the file that imports it. */
324
+ via?: string;
325
+ /** Null when ccdesk does not show or count this block; `note` says why. */
326
+ text: string | null;
327
+ lines: number;
328
+ bytes: number;
329
+ note?: string;
330
+ }
331
+ export type PermissionList = "allow" | "ask" | "deny";
332
+ /** One entry of a settings file's `permissions`, with whether Claude Code applies it here. */
333
+ export type Permission = {
334
+ kind: "rule";
335
+ list: PermissionList;
336
+ rule: string;
337
+ scope: Scope;
338
+ /** The settings file the rule is in. */
339
+ path: string;
340
+ inEffect: boolean;
341
+ /** Why the rule does not apply, or which identical rule decides it first. */
342
+ note?: string;
343
+ /** The same rule in a list checked first (deny, then ask), which decides it. */
344
+ decidedBy?: {
345
+ list: PermissionList;
346
+ scope: Scope;
347
+ };
348
+ } | {
349
+ kind: "defaultMode" | "additionalDirectories";
350
+ value: string;
351
+ scope: Scope;
352
+ inEffect: boolean;
353
+ note?: string;
354
+ };
355
+ /** A permission rule as it applies to one built-in tool. */
356
+ export interface ToolRule {
357
+ list: PermissionList;
358
+ rule: string;
359
+ scope: Scope;
360
+ /** A path rule on a tool Claude Code never checks paths for, such as Write(docs/**). */
361
+ unchecked?: true;
362
+ }
363
+ /** One of Claude Code's built-in tools and what the permission rules here make of it. */
364
+ export interface BuiltinTool {
365
+ name: string;
366
+ description: string;
367
+ /** Manual mode asks before using it (file tools: only outside the working directories). */
368
+ asks: boolean;
369
+ /**
370
+ * What happens when Claude wants it in Manual mode: a rule naming the whole tool decides, else
371
+ * the tool's default. A denied tool is removed from Claude's context.
372
+ */
373
+ verdict: "denied" | "asks" | "allowed" | "default";
374
+ decidedBy?: ToolRule;
375
+ /** Every deny rule in effect that removes the whole tool; all must go to turn it back on. */
376
+ removedBy?: ToolRule[];
377
+ /** Rules for some uses only, such as Bash(npm test *) or Edit(docs/**). */
378
+ scoped: ToolRule[];
379
+ /** Active PreToolUse hooks whose matcher covers this tool. */
380
+ hooks: number;
381
+ }
382
+ /**
383
+ * How Claude used tools in the sessions started in a directory, counted from Claude Code's
384
+ * transcripts. Only counts and rule patterns leave the server, never commands or text.
385
+ */
386
+ export interface Usage {
387
+ /** Sessions counted; their subagents' calls count too. */
388
+ sessions: number;
389
+ /** Counted across the repository and its worktrees, not only this folder. */
390
+ repository: boolean;
391
+ /** When the earliest call counted was made; Claude Code deletes old transcripts. */
392
+ since: string | null;
393
+ tools: ToolUsage[];
394
+ /** Calls you approved by hand, grouped by the allow rule that would cover them, most first. */
395
+ approvals: Approval[];
396
+ /** For each rule asked about, how many calls it covers; null when ccdesk cannot match its kind. */
397
+ matches: Record<string, number | null>;
398
+ }
399
+ export interface ToolUsage {
400
+ tool: string;
401
+ calls: number;
402
+ /** Calls Claude Code asked you about and you allowed. */
403
+ approved: number;
404
+ /** Calls you refused when asked. */
405
+ refused: number;
406
+ }
407
+ export interface Approval {
408
+ rule: string;
409
+ approved: number;
410
+ last: string;
411
+ }
412
+ /** What Claude Code records in ~/.claude.json about this project. */
413
+ export interface Trust {
414
+ /** The ~/.claude.json project key: the repository root, or the folder outside git. */
415
+ root: string;
416
+ /** You accepted the workspace trust dialog for it. */
417
+ trusted: boolean;
418
+ /** Outside git: a parent folder you trusted, which covers this one for some things but not grants. */
419
+ inheritedFrom?: string;
420
+ /** In your home directory Claude Code asks every session and saves no answer. */
421
+ sessionOnly: boolean;
422
+ /** Your answer to the dialog about imports from outside the project. */
423
+ externalImports: "approved" | "declined" | "not-asked";
424
+ }
425
+ export interface Problem {
426
+ path: string;
427
+ error: string;
428
+ /** Claude Code refuses to start until this file is fixed, rather than skipping it. */
429
+ blocksStart?: boolean;
430
+ }
431
+ /** Something Claude Code adds to context once Claude reads or edits a file. */
432
+ export interface PathMatch {
433
+ kind: "rule" | "skill" | "nested";
434
+ path: string;
435
+ scope: Scope | "plugin";
436
+ /** The `paths` glob that matched; absent for a nested file that loads for any file in its folder. */
437
+ glob?: string;
438
+ /** A skill's name. */
439
+ name?: string;
440
+ }
441
+ export interface PathTest {
442
+ file: string;
443
+ /** False when the file is outside the start directory, where nothing here applies. */
444
+ inside: boolean;
445
+ exists: boolean;
446
+ matches: PathMatch[];
447
+ }
448
+ /** Project files that shape Claude Code here, by who can see them. */
449
+ export interface Sharing {
450
+ tracked: string[];
451
+ untracked: string[];
452
+ ignored: string[];
453
+ }
454
+ /** Everything that applies when Claude Code starts in one directory. */
455
+ /**
456
+ * The kind of session ccdesk describes: an interactive `claude`, or `claude -p` and the Agent SDK,
457
+ * which never show the trust dialog.
458
+ */
459
+ export type SessionProfile = "interactive" | "print";
460
+ export declare const SESSION_PROFILES: SessionProfile[];
461
+ export interface DirectoryView {
462
+ path: string;
463
+ profile: SessionProfile;
464
+ exists: boolean;
465
+ gitRoot: string | null;
466
+ agentsMdMode: AgentsMdMode;
467
+ instructions: Instruction[];
468
+ settings: SettingsLayer[];
469
+ effective: EffectiveSetting[];
470
+ memory: MemoryStore;
471
+ inventory: Inventory;
472
+ context: ContextBlock[];
473
+ permissions: Permission[];
474
+ tools: BuiltinTool[];
475
+ trust: Trust;
476
+ /** Files ccdesk could not read or parse. */
477
+ problems: Problem[];
478
+ /** Null outside a git repository. */
479
+ sharing: Sharing | null;
480
+ /**
481
+ * Filled in by the UI once the transcripts are counted, which the scan does not wait for;
482
+ * null when counting failed.
483
+ */
484
+ usage?: Usage | null;
485
+ }
486
+ export type { AgentEdit, HookEdit, McpEdit, PermissionEdit, SettingsEdit, } from "./requests.ts";
487
+ export interface SettingsEditPreview {
488
+ path: string;
489
+ /** The file as JSON with env and header values hidden; null when the file does not exist yet. */
490
+ before: string | null;
491
+ /** The file after the edit, shown the same way. */
492
+ after: string;
493
+ /** Fingerprint of the file on disk; saving requires it to be unchanged. */
494
+ revision: string;
495
+ /** The file is not laid out as ccdesk writes it (2-space JSON), so saving reformats it. */
496
+ reformats: boolean;
497
+ /** Why the edit cannot be saved, such as schema errors; when present nothing can be saved. */
498
+ errors: string[];
499
+ /**
500
+ * For a file ccdesk does not write itself (~/.claude.json): the Claude Code commands it runs
501
+ * instead, with secrets hidden. Such a change is listed in Recent changes with the commands that
502
+ * reverse it, but is not backed up and cannot be undone from ccdesk.
503
+ */
504
+ commands?: string[];
505
+ }
506
+ /** A setting's entry in Claude Code's settings schema, as far as the editor reads it. */
507
+ export interface SettingSchema {
508
+ type?: string | string[];
509
+ enum?: unknown[];
510
+ items?: SettingSchema;
511
+ description?: string;
512
+ deprecated?: boolean;
513
+ }
514
+ /** A setting as Claude Code's settings reference documents it. */
515
+ export interface CatalogSetting {
516
+ key: string;
517
+ summary: string;
518
+ category: string;
519
+ /** The files Claude Code reads it from; none for a key kept in ~/.claude.json. */
520
+ scopes: Scope[];
521
+ about?: string;
522
+ type?: string;
523
+ default?: string;
524
+ docs: string;
525
+ }
526
+ /** The Claude Code data the page edits against, generated into src/shared and served once. */
527
+ export interface Reference {
528
+ /** Where the settings schema came from, such as the SDK version. */
529
+ schemaSource: string;
530
+ /** The settings schema's top-level keys. */
531
+ settings: Record<string, SettingSchema>;
532
+ /** Every documented setting, in the order the settings reference lists them. */
533
+ catalog: CatalogSetting[];
534
+ hookEvents: string[];
535
+ }
@@ -1,2 +1,13 @@
1
1
  // Shapes the server sends to the UI. Paths are absolute; the UI shortens them for display.
2
+ /** The kinds of change ccdesk records, one per kind of file it changes. */
3
+ export const BACKUP_KINDS = [
4
+ "settings",
5
+ "mcp",
6
+ "agent",
7
+ "memory-index",
8
+ "memory-delete",
9
+ "memory-restore",
10
+ // A user or local MCP server change made through `claude mcp`, which ccdesk cannot undo.
11
+ "mcp-claude",
12
+ ];
2
13
  export const SESSION_PROFILES = ["interactive", "print"];