ccdesk 0.2.1 → 0.2.3

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 +54 -0
  2. package/README.md +9 -5
  3. package/dist/core/agent-edit.d.ts +6 -0
  4. package/dist/{server → core}/agent-edit.js +21 -22
  5. package/dist/core/backups.d.ts +19 -0
  6. package/dist/{server → core}/backups.js +37 -45
  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 +25 -0
  12. package/dist/{server → core}/mcp-edit.js +116 -95
  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 +31 -0
  16. package/dist/{server → core}/open.js +39 -12
  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 +5 -3
  23. package/dist/core/scan/context.d.ts +13 -0
  24. package/dist/{server → core}/scan/context.js +58 -32
  25. package/dist/core/scan/data.d.ts +8 -0
  26. package/dist/core/scan/data.js +18 -0
  27. package/dist/core/scan/env.d.ts +26 -0
  28. package/dist/{server → core}/scan/env.js +10 -3
  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 +14 -0
  32. package/dist/core/scan/git.js +98 -0
  33. package/dist/core/scan/index.d.ts +5 -0
  34. package/dist/{server → core}/scan/index.js +115 -81
  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 +151 -94
  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 +6 -9
  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 +5 -4
  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 +35 -0
  54. package/dist/{server → core}/scan/settings.js +88 -92
  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 +25 -0
  58. package/dist/{server → core}/scan/usage.js +117 -92
  59. package/dist/core/schema.d.ts +8 -0
  60. package/dist/core/schema.js +67 -0
  61. package/dist/core/secrets.d.ts +44 -0
  62. package/dist/core/secrets.js +187 -0
  63. package/dist/core/settings-edit.d.ts +9 -0
  64. package/dist/core/settings-edit.js +216 -0
  65. package/dist/core/watch.d.ts +45 -0
  66. package/dist/{server → core}/watch.js +129 -20
  67. package/dist/core/write.d.ts +119 -0
  68. package/dist/{server → core}/write.js +63 -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 +2 -0
  81. package/dist/shared/requests.d.ts +104 -0
  82. package/dist/shared/requests.js +73 -0
  83. package/dist/shared/scopes.d.ts +10 -0
  84. package/dist/shared/settings-catalog.json +2199 -0
  85. package/dist/shared/types.d.ts +530 -0
  86. package/dist/shared/types.js +11 -0
  87. package/dist/ui/assets/index-CH1HoC38.js +60 -0
  88. package/dist/ui/index.html +1 -1
  89. package/dist/view/diff.d.ts +16 -0
  90. package/dist/view/diff.js +85 -0
  91. package/dist/view/format.d.ts +17 -0
  92. package/dist/view/format.js +47 -0
  93. package/dist/view/index.d.ts +11 -0
  94. package/dist/view/index.js +13 -0
  95. package/dist/view/lines.d.ts +9 -0
  96. package/dist/view/lines.js +12 -0
  97. package/dist/view/path-test.d.ts +3 -0
  98. package/dist/view/path-test.js +7 -0
  99. package/dist/view/sections/catalog.d.ts +9 -0
  100. package/dist/view/sections/catalog.js +47 -0
  101. package/dist/view/sections/extensions.d.ts +1 -0
  102. package/dist/view/sections/extensions.js +48 -0
  103. package/dist/view/sections/hooks.d.ts +1 -0
  104. package/dist/view/sections/hooks.js +32 -0
  105. package/dist/view/sections/index.d.ts +6 -0
  106. package/dist/view/sections/index.js +27 -0
  107. package/dist/view/sections/instructions.d.ts +6 -0
  108. package/dist/view/sections/instructions.js +38 -0
  109. package/dist/view/sections/mcp.d.ts +3 -0
  110. package/dist/view/sections/mcp.js +38 -0
  111. package/dist/view/sections/memory.d.ts +1 -0
  112. package/dist/view/sections/memory.js +31 -0
  113. package/dist/view/sections/permissions.d.ts +17 -0
  114. package/dist/view/sections/permissions.js +87 -0
  115. package/dist/view/sections/settings.d.ts +1 -0
  116. package/dist/view/sections/settings.js +33 -0
  117. package/dist/view/sections/tools.d.ts +6 -0
  118. package/dist/view/sections/tools.js +57 -0
  119. package/dist/view/sections/types.d.ts +123 -0
  120. package/dist/view/sections/types.js +10 -0
  121. package/dist/view/settings.d.ts +12 -0
  122. package/dist/view/settings.js +31 -0
  123. package/dist/view/usage.d.ts +8 -0
  124. package/dist/view/usage.js +18 -0
  125. package/package.json +13 -2
  126. package/dist/server/scan/files.js +0 -478
  127. package/dist/server/scan/path-test.js +0 -121
  128. package/dist/server/schema.js +0 -15
  129. package/dist/server/secrets.js +0 -63
  130. package/dist/server/settings-edit.js +0 -221
  131. package/dist/ui/assets/index-XqJwI3k9.js +0 -60
@@ -0,0 +1,25 @@
1
+ import { type Scope } from "./types.ts";
2
+ /** The value a key has in one directory, and the settings files it comes from. */
3
+ export interface ComparedValue {
4
+ /** As ccdesk shows it, with hidden values as •••. */
5
+ value: unknown;
6
+ /** The files that decide it, lowest precedence first; several when lists or objects are combined. */
7
+ sources: Array<{
8
+ scope: Scope;
9
+ path: string;
10
+ }>;
11
+ }
12
+ export interface ComparedSetting {
13
+ key: string;
14
+ /** Null where no settings file Claude Code reads there sets the key. */
15
+ a: ComparedValue | null;
16
+ b: ComparedValue | null;
17
+ /** Whether both have the same value as ccdesk shows it; two hidden values count as the same. */
18
+ same: boolean;
19
+ }
20
+ /** The effective settings of two directories, key by key. */
21
+ export interface SettingsComparison {
22
+ a: string;
23
+ b: string;
24
+ settings: ComparedSetting[];
25
+ }
@@ -0,0 +1,2 @@
1
+ /** Claude Code names a project's store after its path with every non-alphanumeric character as "-". */
2
+ export declare function storeDirName(projectPath: string): string;
@@ -0,0 +1,104 @@
1
+ import { type Static, Type } from "typebox";
2
+ /** Set one top-level key in one settings file; `value` undefined removes the key. */
3
+ export declare const SettingsEditBody: Type.TObject<{
4
+ dir: Type.TString;
5
+ scope: Type.TEnum<import("./types.ts").Scope[]>;
6
+ key: Type.TString;
7
+ value: Type.TOptional<Type.TUnknown>;
8
+ }>;
9
+ export type SettingsEdit = Static<typeof SettingsEditBody>;
10
+ /** Take one permission rule out of its list and/or add one, in one settings file. */
11
+ export declare const PermissionEditBody: Type.TObject<{
12
+ dir: Type.TString;
13
+ file: Type.TString;
14
+ remove: Type.TOptional<Type.TObject<{
15
+ list: Type.TEnum<import("./types.ts").PermissionList[]>;
16
+ rule: Type.TString;
17
+ }>>;
18
+ add: Type.TOptional<Type.TObject<{
19
+ list: Type.TEnum<import("./types.ts").PermissionList[]>;
20
+ rule: Type.TString;
21
+ }>>;
22
+ }>;
23
+ export type PermissionEdit = Static<typeof PermissionEditBody>;
24
+ /**
25
+ * One hook change to a settings file. With both, the hook is replaced in place when it stays in
26
+ * the same event and matcher, and moved otherwise.
27
+ */
28
+ export declare const HookEditBody: Type.TObject<{
29
+ dir: Type.TString;
30
+ file: Type.TString;
31
+ /** The hook to take out, as the scan showed it; refused when the file no longer has it there. */
32
+ remove: Type.TOptional<Type.TObject<{
33
+ event: Type.TString;
34
+ at: Type.TObject<{
35
+ group: Type.TInteger;
36
+ index: Type.TInteger;
37
+ }>;
38
+ definition: Type.TUnknown;
39
+ }>>;
40
+ /** The hook to write: the matcher group it goes in, and the hook itself. */
41
+ add: Type.TOptional<Type.TObject<{
42
+ event: Type.TString;
43
+ /** Empty or absent for a group without a matcher, which matches everything. */
44
+ matcher: Type.TOptional<Type.TString>;
45
+ definition: Type.TUnknown;
46
+ }>>;
47
+ }>;
48
+ export type HookEdit = Static<typeof HookEditBody>;
49
+ /** One subagent file change: a new agent, a changed one, or one deleted. */
50
+ export declare const AgentEditBody: Type.TObject<{
51
+ dir: Type.TString;
52
+ /** An agent the scan shows here; absent when creating one. */
53
+ path: Type.TOptional<Type.TString>;
54
+ /** Where a new agent goes, and its file name without .md. */
55
+ create: Type.TOptional<Type.TObject<{
56
+ scope: Type.TEnum<["user", "project"]>;
57
+ file: Type.TString;
58
+ }>>;
59
+ /** The whole file; null deletes the agent. */
60
+ text: Type.TUnion<[Type.TString, Type.TNull]>;
61
+ }>;
62
+ export type AgentEdit = Static<typeof AgentEditBody>;
63
+ /**
64
+ * One MCP server change. Project servers are changed in .mcp.json; user and local ones through
65
+ * `claude mcp`. With both, the server is replaced, keeping its place in .mcp.json.
66
+ */
67
+ export declare const McpEditBody: Type.TObject<{
68
+ dir: Type.TString;
69
+ scope: Type.TEnum<["user", "local", "project"]>;
70
+ /** The server to take out, as the scan showed it; refused when it changed since. */
71
+ remove: Type.TOptional<Type.TObject<{
72
+ name: Type.TString;
73
+ definition: Type.TUnknown;
74
+ }>>;
75
+ add: Type.TOptional<Type.TObject<{
76
+ name: Type.TString;
77
+ definition: Type.TUnknown;
78
+ }>>;
79
+ }>;
80
+ export type McpEdit = Static<typeof McpEditBody>;
81
+ /** A save's or restore's revision: the one its preview returned. */
82
+ export declare const RevisionBody: Type.TObject<{
83
+ revision: Type.TString;
84
+ }>;
85
+ /** Count which permission rules the transcripts under `path` used. */
86
+ export declare const UsageBody: Type.TObject<{
87
+ path: Type.TString;
88
+ rules: Type.TArray<Type.TObject<{
89
+ list: Type.TEnum<import("./types.ts").PermissionList[]>;
90
+ rule: Type.TString;
91
+ }>>;
92
+ }>;
93
+ /** Preview a memory change; changing it also sends the revision. */
94
+ export declare const MemoryBody: Type.TObject<{
95
+ action: Type.TString;
96
+ path: Type.TString;
97
+ }>;
98
+ export declare const OpenBody: Type.TObject<{
99
+ path: Type.TString;
100
+ }>;
101
+ /** Preview restoring a backup; restoring it also sends the revision. */
102
+ export declare const BackupBody: Type.TObject<{
103
+ id: Type.TString;
104
+ }>;
@@ -0,0 +1,73 @@
1
+ // What each API request sends, as JSON Schema. The server checks bodies against these, and each
2
+ // type is read from its schema. The page imports only the types, re-exported from types.ts, so
3
+ // TypeBox stays out of its bundle.
4
+ import { Type } from "typebox";
5
+ import { EVERY_FILE, PERMISSION_LISTS } from "./scopes.js";
6
+ /** Set one top-level key in one settings file; `value` undefined removes the key. */
7
+ export const SettingsEditBody = Type.Object({
8
+ dir: Type.String(),
9
+ scope: Type.Enum(EVERY_FILE),
10
+ key: Type.String(),
11
+ value: Type.Optional(Type.Unknown()),
12
+ });
13
+ /** One permission rule. */
14
+ const Rule = Type.Object({ list: Type.Enum(PERMISSION_LISTS), rule: Type.String() });
15
+ /** Take one permission rule out of its list and/or add one, in one settings file. */
16
+ export const PermissionEditBody = Type.Object({
17
+ dir: Type.String(),
18
+ file: Type.String(),
19
+ remove: Type.Optional(Rule),
20
+ add: Type.Optional(Rule),
21
+ });
22
+ const place = Type.Integer({ minimum: 0 });
23
+ /**
24
+ * One hook change to a settings file. With both, the hook is replaced in place when it stays in
25
+ * the same event and matcher, and moved otherwise.
26
+ */
27
+ export const HookEditBody = Type.Object({
28
+ dir: Type.String(),
29
+ file: Type.String(),
30
+ /** The hook to take out, as the scan showed it; refused when the file no longer has it there. */
31
+ remove: Type.Optional(Type.Object({
32
+ event: Type.String(),
33
+ at: Type.Object({ group: place, index: place }),
34
+ definition: Type.Unknown(),
35
+ })),
36
+ /** The hook to write: the matcher group it goes in, and the hook itself. */
37
+ add: Type.Optional(Type.Object({
38
+ event: Type.String(),
39
+ /** Empty or absent for a group without a matcher, which matches everything. */
40
+ matcher: Type.Optional(Type.String()),
41
+ definition: Type.Unknown(),
42
+ })),
43
+ });
44
+ /** One subagent file change: a new agent, a changed one, or one deleted. */
45
+ export const AgentEditBody = Type.Object({
46
+ dir: Type.String(),
47
+ /** An agent the scan shows here; absent when creating one. */
48
+ path: Type.Optional(Type.String()),
49
+ /** Where a new agent goes, and its file name without .md. */
50
+ create: Type.Optional(Type.Object({ scope: Type.Enum(["user", "project"]), file: Type.String() })),
51
+ /** The whole file; null deletes the agent. */
52
+ text: Type.Union([Type.String(), Type.Null()]),
53
+ });
54
+ /**
55
+ * One MCP server change. Project servers are changed in .mcp.json; user and local ones through
56
+ * `claude mcp`. With both, the server is replaced, keeping its place in .mcp.json.
57
+ */
58
+ export const McpEditBody = Type.Object({
59
+ dir: Type.String(),
60
+ scope: Type.Enum(["user", "local", "project"]),
61
+ /** The server to take out, as the scan showed it; refused when it changed since. */
62
+ remove: Type.Optional(Type.Object({ name: Type.String(), definition: Type.Unknown() })),
63
+ add: Type.Optional(Type.Object({ name: Type.String(), definition: Type.Unknown() })),
64
+ });
65
+ /** A save's or restore's revision: the one its preview returned. */
66
+ export const RevisionBody = Type.Object({ revision: Type.String() });
67
+ /** Count which permission rules the transcripts under `path` used. */
68
+ export const UsageBody = Type.Object({ path: Type.String(), rules: Type.Array(Rule) });
69
+ /** Preview a memory change; changing it also sends the revision. */
70
+ export const MemoryBody = Type.Object({ action: Type.String(), path: Type.String() });
71
+ export const OpenBody = Type.Object({ path: Type.String() });
72
+ /** Preview restoring a backup; restoring it also sends the revision. */
73
+ export const BackupBody = Type.Object({ id: Type.String() });
@@ -0,0 +1,10 @@
1
+ import { type PermissionList, type Scope } from "./types.ts";
2
+ export declare const EVERY_FILE: Scope[];
3
+ /** Settings files by precedence: managed beats local beats project beats user. */
4
+ export declare const HIGHEST_FIRST: Scope[];
5
+ /** The settings files ccdesk writes to; managed settings belong to your organisation. */
6
+ export declare const EDITABLE_SCOPES: Scope[];
7
+ /** The permission lists, in the order ccdesk shows them. */
8
+ export declare const PERMISSION_LISTS: PermissionList[];
9
+ export declare function allowedScopes(key: string): Scope[];
10
+ export declare function ignoredReason(key: string): string;