@detergent-software/atk 8.8.1 → 8.9.0-dev.10

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 (99) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/build/cli.js +0 -0
  3. package/build/commands/publish.d.ts.map +1 -1
  4. package/build/commands/publish.js +19 -23
  5. package/build/commands/publish.js.map +1 -1
  6. package/build/hooks/usePublishState.d.ts +38 -207
  7. package/build/hooks/usePublishState.d.ts.map +1 -1
  8. package/build/hooks/usePublishState.js +83 -1501
  9. package/build/hooks/usePublishState.js.map +1 -1
  10. package/build/lib/adapter.d.ts.map +1 -1
  11. package/build/lib/adapter.js +29 -4
  12. package/build/lib/adapter.js.map +1 -1
  13. package/build/lib/atk-api/errors.d.ts +5 -2
  14. package/build/lib/atk-api/errors.d.ts.map +1 -1
  15. package/build/lib/atk-api/errors.js +1 -0
  16. package/build/lib/atk-api/errors.js.map +1 -1
  17. package/build/lib/atk-api/generated/types.gen.d.ts +12 -12
  18. package/build/lib/atk-api/index.d.ts +2 -2
  19. package/build/lib/atk-api/index.d.ts.map +1 -1
  20. package/build/lib/atk-api/index.js +1 -1
  21. package/build/lib/atk-api/index.js.map +1 -1
  22. package/build/lib/atk-api/web-routes.d.ts +25 -6
  23. package/build/lib/atk-api/web-routes.d.ts.map +1 -1
  24. package/build/lib/atk-api/web-routes.js +27 -8
  25. package/build/lib/atk-api/web-routes.js.map +1 -1
  26. package/build/lib/checksum.d.ts +30 -14
  27. package/build/lib/checksum.d.ts.map +1 -1
  28. package/build/lib/checksum.js +93 -57
  29. package/build/lib/checksum.js.map +1 -1
  30. package/build/lib/config-entries.d.ts +5 -1
  31. package/build/lib/config-entries.d.ts.map +1 -1
  32. package/build/lib/config-entries.js +7 -3
  33. package/build/lib/config-entries.js.map +1 -1
  34. package/build/lib/hook-config.d.ts +11 -1
  35. package/build/lib/hook-config.d.ts.map +1 -1
  36. package/build/lib/hook-config.js +22 -3
  37. package/build/lib/hook-config.js.map +1 -1
  38. package/build/lib/hook-script.d.ts +4 -0
  39. package/build/lib/hook-script.d.ts.map +1 -1
  40. package/build/lib/hook-script.js +4 -0
  41. package/build/lib/hook-script.js.map +1 -1
  42. package/build/lib/init.d.ts.map +1 -1
  43. package/build/lib/init.js +7 -1
  44. package/build/lib/init.js.map +1 -1
  45. package/build/lib/installer.d.ts +2 -7
  46. package/build/lib/installer.d.ts.map +1 -1
  47. package/build/lib/installer.js +49 -13
  48. package/build/lib/installer.js.map +1 -1
  49. package/build/lib/lockfile.d.ts +10 -6
  50. package/build/lib/lockfile.d.ts.map +1 -1
  51. package/build/lib/lockfile.js +191 -50
  52. package/build/lib/lockfile.js.map +1 -1
  53. package/build/lib/owned-paths.d.ts +4 -2
  54. package/build/lib/owned-paths.d.ts.map +1 -1
  55. package/build/lib/owned-paths.js +19 -6
  56. package/build/lib/owned-paths.js.map +1 -1
  57. package/build/lib/publish-flow.d.ts +227 -0
  58. package/build/lib/publish-flow.d.ts.map +1 -0
  59. package/build/lib/publish-flow.js +1316 -0
  60. package/build/lib/publish-flow.js.map +1 -0
  61. package/build/lib/publish-run.d.ts +55 -0
  62. package/build/lib/publish-run.d.ts.map +1 -0
  63. package/build/lib/publish-run.js +164 -0
  64. package/build/lib/publish-run.js.map +1 -0
  65. package/build/lib/publisher.d.ts +2 -1
  66. package/build/lib/publisher.d.ts.map +1 -1
  67. package/build/lib/publisher.js +20 -18
  68. package/build/lib/publisher.js.map +1 -1
  69. package/build/lib/registry.d.ts +2 -1
  70. package/build/lib/registry.d.ts.map +1 -1
  71. package/build/lib/registry.js +2 -1
  72. package/build/lib/registry.js.map +1 -1
  73. package/build/lib/root-path.d.ts +11 -0
  74. package/build/lib/root-path.d.ts.map +1 -1
  75. package/build/lib/root-path.js +15 -1
  76. package/build/lib/root-path.js.map +1 -1
  77. package/build/lib/schemas/adapter.d.ts +12 -0
  78. package/build/lib/schemas/adapter.d.ts.map +1 -1
  79. package/build/lib/schemas/adapter.js +10 -1
  80. package/build/lib/schemas/adapter.js.map +1 -1
  81. package/build/lib/schemas/lockfile.d.ts +156 -23
  82. package/build/lib/schemas/lockfile.d.ts.map +1 -1
  83. package/build/lib/schemas/lockfile.js +100 -79
  84. package/build/lib/schemas/lockfile.js.map +1 -1
  85. package/build/lib/staging.d.ts +15 -0
  86. package/build/lib/staging.d.ts.map +1 -0
  87. package/build/lib/staging.js +33 -0
  88. package/build/lib/staging.js.map +1 -0
  89. package/build/lib/sync.d.ts.map +1 -1
  90. package/build/lib/sync.js +28 -0
  91. package/build/lib/sync.js.map +1 -1
  92. package/build/lib/uninstaller.js +2 -2
  93. package/build/lib/uninstaller.js.map +1 -1
  94. package/build/lib/write-file.d.ts +5 -0
  95. package/build/lib/write-file.d.ts.map +1 -1
  96. package/build/lib/write-file.js +10 -7
  97. package/build/lib/write-file.js.map +1 -1
  98. package/package.json +81 -81
  99. package/tool-adapters/claude-code.json +10 -2
@@ -1,31 +1,157 @@
1
1
  import { z } from 'zod';
2
- export declare const InstalledFile: z.ZodObject<{
3
- checksum: z.ZodString;
4
- installedPath: z.ZodOptional<z.ZodString>;
5
- sourcePath: z.ZodString;
6
- }, z.core.$strip>;
7
- export type InstalledFile = z.infer<typeof InstalledFile>;
2
+ /** The schemas built with `z.object`, for the exported types: a misspelt key in an `InstalledAsset` literal fails to compile. */
3
+ type Known = ReturnType<typeof lockfileSchemas<z.core.$strip>>;
4
+ /** `z.object` (drops keys it doesn't know) or `z.looseObject` (keeps them), for {@link lockfileSchemas}. */
5
+ type ObjectOf<Config extends z.core.$ZodObjectConfig> = <Shape extends z.core.$ZodLooseShape>(shape: Shape) => z.ZodObject<Shape, Config>;
6
+ declare function lockfileSchemas<Config extends z.core.$ZodObjectConfig>(object: ObjectOf<Config>): {
7
+ ConfigEntry: z.ZodObject<{
8
+ checksum: z.ZodString;
9
+ checksumVersion: z.ZodOptional<z.ZodLiteral<2>>;
10
+ command: z.ZodOptional<z.ZodString>;
11
+ file: z.ZodString;
12
+ key: z.ZodString;
13
+ tool: z.ZodOptional<z.ZodString>;
14
+ }, Config>;
15
+ InstalledAsset: z.ZodObject<{
16
+ bundleOrigin: z.ZodOptional<z.ZodObject<{
17
+ name: z.ZodString;
18
+ org: z.ZodOptional<z.ZodString>;
19
+ version: z.ZodString;
20
+ }, Config>>;
21
+ configEntries: z.ZodOptional<z.ZodArray<z.ZodObject<{
22
+ checksum: z.ZodString;
23
+ checksumVersion: z.ZodOptional<z.ZodLiteral<2>>;
24
+ command: z.ZodOptional<z.ZodString>;
25
+ file: z.ZodString;
26
+ key: z.ZodString;
27
+ tool: z.ZodOptional<z.ZodString>;
28
+ }, Config>>>;
29
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
30
+ name: z.ZodString;
31
+ org: z.ZodOptional<z.ZodString>;
32
+ type: z.ZodEnum<{
33
+ skill: "skill";
34
+ agent: "agent";
35
+ rule: "rule";
36
+ hook: "hook";
37
+ "memory-template": "memory-template";
38
+ "mcp-config": "mcp-config";
39
+ }>;
40
+ version: z.ZodOptional<z.ZodString>;
41
+ }, Config>>>;
42
+ description: z.ZodOptional<z.ZodString>;
43
+ entrypoint: z.ZodOptional<z.ZodString>;
44
+ excludedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
45
+ files: z.ZodArray<z.ZodObject<{
46
+ checksum: z.ZodString;
47
+ installedPath: z.ZodOptional<z.ZodString>;
48
+ sourcePath: z.ZodString;
49
+ }, Config>>;
50
+ installReason: z.ZodOptional<z.ZodEnum<{
51
+ direct: "direct";
52
+ dependency: "dependency";
53
+ }>>;
54
+ name: z.ZodString;
55
+ org: z.ZodOptional<z.ZodString>;
56
+ pinnedVersion: z.ZodOptional<z.ZodString>;
57
+ type: z.ZodEnum<{
58
+ skill: "skill";
59
+ agent: "agent";
60
+ rule: "rule";
61
+ hook: "hook";
62
+ "memory-template": "memory-template";
63
+ "mcp-config": "mcp-config";
64
+ }>;
65
+ undeclaredTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
66
+ userConfigDirs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
67
+ version: z.ZodString;
68
+ }, Config>;
69
+ InstalledFile: z.ZodObject<{
70
+ checksum: z.ZodString;
71
+ installedPath: z.ZodOptional<z.ZodString>;
72
+ sourcePath: z.ZodString;
73
+ }, Config>;
74
+ LockfileSchema: z.ZodObject<{
75
+ assets: z.ZodOptional<z.ZodArray<z.ZodObject<{
76
+ bundleOrigin: z.ZodOptional<z.ZodObject<{
77
+ name: z.ZodString;
78
+ org: z.ZodOptional<z.ZodString>;
79
+ version: z.ZodString;
80
+ }, Config>>;
81
+ configEntries: z.ZodOptional<z.ZodArray<z.ZodObject<{
82
+ checksum: z.ZodString;
83
+ checksumVersion: z.ZodOptional<z.ZodLiteral<2>>;
84
+ command: z.ZodOptional<z.ZodString>;
85
+ file: z.ZodString;
86
+ key: z.ZodString;
87
+ tool: z.ZodOptional<z.ZodString>;
88
+ }, Config>>>;
89
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
90
+ name: z.ZodString;
91
+ org: z.ZodOptional<z.ZodString>;
92
+ type: z.ZodEnum<{
93
+ skill: "skill";
94
+ agent: "agent";
95
+ rule: "rule";
96
+ hook: "hook";
97
+ "memory-template": "memory-template";
98
+ "mcp-config": "mcp-config";
99
+ }>;
100
+ version: z.ZodOptional<z.ZodString>;
101
+ }, Config>>>;
102
+ description: z.ZodOptional<z.ZodString>;
103
+ entrypoint: z.ZodOptional<z.ZodString>;
104
+ excludedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
105
+ files: z.ZodArray<z.ZodObject<{
106
+ checksum: z.ZodString;
107
+ installedPath: z.ZodOptional<z.ZodString>;
108
+ sourcePath: z.ZodString;
109
+ }, Config>>;
110
+ installReason: z.ZodOptional<z.ZodEnum<{
111
+ direct: "direct";
112
+ dependency: "dependency";
113
+ }>>;
114
+ name: z.ZodString;
115
+ org: z.ZodOptional<z.ZodString>;
116
+ pinnedVersion: z.ZodOptional<z.ZodString>;
117
+ type: z.ZodEnum<{
118
+ skill: "skill";
119
+ agent: "agent";
120
+ rule: "rule";
121
+ hook: "hook";
122
+ "memory-template": "memory-template";
123
+ "mcp-config": "mcp-config";
124
+ }>;
125
+ undeclaredTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
126
+ userConfigDirs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
127
+ version: z.ZodString;
128
+ }, Config>>>;
129
+ lockVersion: z.ZodLiteral<1>;
130
+ org: z.ZodOptional<z.ZodString>;
131
+ orgReviewers: z.ZodOptional<z.ZodArray<z.ZodString>>;
132
+ }, Config>;
133
+ };
8
134
  export declare const ConfigEntry: z.ZodObject<{
9
135
  checksum: z.ZodString;
136
+ checksumVersion: z.ZodOptional<z.ZodLiteral<2>>;
10
137
  command: z.ZodOptional<z.ZodString>;
11
138
  file: z.ZodString;
12
139
  key: z.ZodString;
13
140
  tool: z.ZodOptional<z.ZodString>;
14
- }, z.core.$strip>;
15
- export type ConfigEntry = z.infer<typeof ConfigEntry>;
16
- export declare const InstalledAsset: z.ZodObject<{
141
+ }, z.core.$loose>, InstalledAsset: z.ZodObject<{
17
142
  bundleOrigin: z.ZodOptional<z.ZodObject<{
18
143
  name: z.ZodString;
19
144
  org: z.ZodOptional<z.ZodString>;
20
145
  version: z.ZodString;
21
- }, z.core.$strip>>;
146
+ }, z.core.$loose>>;
22
147
  configEntries: z.ZodOptional<z.ZodArray<z.ZodObject<{
23
148
  checksum: z.ZodString;
149
+ checksumVersion: z.ZodOptional<z.ZodLiteral<2>>;
24
150
  command: z.ZodOptional<z.ZodString>;
25
151
  file: z.ZodString;
26
152
  key: z.ZodString;
27
153
  tool: z.ZodOptional<z.ZodString>;
28
- }, z.core.$strip>>>;
154
+ }, z.core.$loose>>>;
29
155
  dependencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
30
156
  name: z.ZodString;
31
157
  org: z.ZodOptional<z.ZodString>;
@@ -38,7 +164,7 @@ export declare const InstalledAsset: z.ZodObject<{
38
164
  "mcp-config": "mcp-config";
39
165
  }>;
40
166
  version: z.ZodOptional<z.ZodString>;
41
- }, z.core.$strip>>>;
167
+ }, z.core.$loose>>>;
42
168
  description: z.ZodOptional<z.ZodString>;
43
169
  entrypoint: z.ZodOptional<z.ZodString>;
44
170
  excludedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -46,7 +172,7 @@ export declare const InstalledAsset: z.ZodObject<{
46
172
  checksum: z.ZodString;
47
173
  installedPath: z.ZodOptional<z.ZodString>;
48
174
  sourcePath: z.ZodString;
49
- }, z.core.$strip>>;
175
+ }, z.core.$loose>>;
50
176
  installReason: z.ZodOptional<z.ZodEnum<{
51
177
  direct: "direct";
52
178
  dependency: "dependency";
@@ -65,22 +191,25 @@ export declare const InstalledAsset: z.ZodObject<{
65
191
  undeclaredTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
66
192
  userConfigDirs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
67
193
  version: z.ZodString;
68
- }, z.core.$strip>;
69
- export type InstalledAsset = z.infer<typeof InstalledAsset>;
70
- export declare const LockfileSchema: z.ZodObject<{
194
+ }, z.core.$loose>, InstalledFile: z.ZodObject<{
195
+ checksum: z.ZodString;
196
+ installedPath: z.ZodOptional<z.ZodString>;
197
+ sourcePath: z.ZodString;
198
+ }, z.core.$loose>, LockfileSchema: z.ZodObject<{
71
199
  assets: z.ZodOptional<z.ZodArray<z.ZodObject<{
72
200
  bundleOrigin: z.ZodOptional<z.ZodObject<{
73
201
  name: z.ZodString;
74
202
  org: z.ZodOptional<z.ZodString>;
75
203
  version: z.ZodString;
76
- }, z.core.$strip>>;
204
+ }, z.core.$loose>>;
77
205
  configEntries: z.ZodOptional<z.ZodArray<z.ZodObject<{
78
206
  checksum: z.ZodString;
207
+ checksumVersion: z.ZodOptional<z.ZodLiteral<2>>;
79
208
  command: z.ZodOptional<z.ZodString>;
80
209
  file: z.ZodString;
81
210
  key: z.ZodString;
82
211
  tool: z.ZodOptional<z.ZodString>;
83
- }, z.core.$strip>>>;
212
+ }, z.core.$loose>>>;
84
213
  dependencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
85
214
  name: z.ZodString;
86
215
  org: z.ZodOptional<z.ZodString>;
@@ -93,7 +222,7 @@ export declare const LockfileSchema: z.ZodObject<{
93
222
  "mcp-config": "mcp-config";
94
223
  }>;
95
224
  version: z.ZodOptional<z.ZodString>;
96
- }, z.core.$strip>>>;
225
+ }, z.core.$loose>>>;
97
226
  description: z.ZodOptional<z.ZodString>;
98
227
  entrypoint: z.ZodOptional<z.ZodString>;
99
228
  excludedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -101,7 +230,7 @@ export declare const LockfileSchema: z.ZodObject<{
101
230
  checksum: z.ZodString;
102
231
  installedPath: z.ZodOptional<z.ZodString>;
103
232
  sourcePath: z.ZodString;
104
- }, z.core.$strip>>;
233
+ }, z.core.$loose>>;
105
234
  installReason: z.ZodOptional<z.ZodEnum<{
106
235
  direct: "direct";
107
236
  dependency: "dependency";
@@ -120,10 +249,14 @@ export declare const LockfileSchema: z.ZodObject<{
120
249
  undeclaredTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
121
250
  userConfigDirs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
122
251
  version: z.ZodString;
123
- }, z.core.$strip>>>;
252
+ }, z.core.$loose>>>;
124
253
  lockVersion: z.ZodLiteral<1>;
125
254
  org: z.ZodOptional<z.ZodString>;
126
255
  orgReviewers: z.ZodOptional<z.ZodArray<z.ZodString>>;
127
- }, z.core.$strip>;
128
- export type Lockfile = z.infer<typeof LockfileSchema>;
256
+ }, z.core.$loose>;
257
+ export type ConfigEntry = z.infer<Known['ConfigEntry']>;
258
+ export type InstalledAsset = z.infer<Known['InstalledAsset']>;
259
+ export type InstalledFile = z.infer<Known['InstalledFile']>;
260
+ export type Lockfile = z.infer<Known['LockfileSchema']>;
261
+ export {};
129
262
  //# sourceMappingURL=lockfile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lockfile.d.ts","sourceRoot":"","sources":["../../../src/lib/schemas/lockfile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,aAAa;;;;iBASxB,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,eAAO,MAAM,WAAW;;;;;;iBAoBtB,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwDzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQzB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"lockfile.d.ts","sourceRoot":"","sources":["../../../src/lib/schemas/lockfile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,iIAAiI;AACjI,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAE/D,4GAA4G;AAC5G,KAAK,QAAQ,CAAC,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,gBAAgB,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC,IAAI,CAAC,cAAc,EAC1F,KAAK,EAAE,KAAK,KACT,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAEhC,iBAAS,eAAe,CAAC,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,gBAAgB,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyHxF;AAID,eAAO,MAAQ,WAAW;;;;;;;mBAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAE,aAAa;;;;mBAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAExE,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;AACxD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;AAC5D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC"}
@@ -1,82 +1,103 @@
1
1
  import { z } from 'zod';
2
2
  import { AssetTypeSchema as AssetType } from '../atk-schemas/index.js';
3
- export const InstalledFile = z.object({
4
- checksum: z.string().describe('SHA-256 checksum of the file contents'),
5
- installedPath: z
6
- .string()
7
- .optional()
8
- .describe('Project-relative POSIX path to where the file was installed (computed via adapter for legacy entries); absolute at the user scope when the tool’s config directory is on another drive than the user root'),
9
- sourcePath: z.string().describe('Original path within the asset directory'),
10
- });
11
- export const ConfigEntry = z.object({
12
- checksum: z.string().describe('SHA-256 hex digest of the config entry value'),
13
- command: z
14
- .string()
15
- .optional()
16
- .describe('For array-valued config sections (e.g. hooks.<Event>): identifies the array element this asset owns by its nested hooks[].command value'),
17
- file: z
18
- .string()
19
- .describe('Project-relative POSIX path to the config file; absolute at the user scope when the tool’s config directory is on another drive than the user root'),
20
- key: z.string().describe('Dot-path key within the config file (e.g. hooks.Stop)'),
21
- tool: z
22
- .string()
23
- .optional()
24
- .describe('Tool adapter id (e.g. claude-code) that registered this entry. Absent on entries written by older CLI versions; ownership is then inferred from the config file path'),
25
- });
26
- export const InstalledAsset = z.object({
27
- bundleOrigin: z
28
- .object({
29
- name: z.string().describe('Bundle name that sourced this asset'),
30
- org: z.string().optional().describe('Organization scope of the bundle (absent for global bundles)'),
31
- version: z.string().describe('Bundle version at install time'),
32
- })
33
- .optional()
34
- .describe('Bundle that triggered this asset installation'),
35
- configEntries: z.array(ConfigEntry).optional().describe('Config file entries registered by this asset'),
36
- dependencies: z
37
- .array(z.object({
38
- name: z.string().describe('Dependency asset name'),
39
- org: z.string().optional().describe('Organization scope of the dependency'),
40
- type: AssetType.describe('Dependency asset type'),
41
- version: z.string().optional().describe('Dependency version constraint at install time'),
42
- }))
43
- .optional()
44
- .describe('Assets this asset depends on'),
45
- description: z.string().optional().describe('Short description of the asset'),
46
- entrypoint: z
47
- .string()
48
- .optional()
49
- .describe('Primary file for this asset (relative to the asset directory), from the manifest — used to resolve adapter placement paths'),
50
- excludedTools: z
51
- .array(z.string())
52
- .optional()
53
- .describe('Tool adapter ids (e.g. codex-cli) this asset was explicitly uninstalled for, or that a hook was skipped for because its manifest does not declare them (those are also in undeclaredTools). Sync, audit and update skip the asset for these tools; installing it for a tool removes that tool again. Absent means the asset is wanted for every tool'),
54
- files: z.array(InstalledFile).describe('Files placed by this asset'),
55
- installReason: z
56
- .enum(['direct', 'dependency'])
57
- .optional()
58
- .describe('Whether the user explicitly installed this or it was pulled in as a dependency'),
59
- name: z.string().describe('Asset name'),
60
- org: z.string().optional().describe('Organization scope for this asset'),
61
- pinnedVersion: z.string().optional().describe('Pinned version constraint, if the asset is version-pinned'),
62
- type: AssetType.describe('Asset type'),
63
- undeclaredTools: z
64
- .array(z.string())
65
- .optional()
66
- .describe('The tools in excludedTools that a hook was skipped for because its manifest does not declare them, not uninstalled for. Sync and update place the hook for such a tool once its version declares it'),
67
- userConfigDirs: z
68
- .record(z.string(), z.string())
69
- .optional()
70
- .describe('User scope only: per tool adapter id, the directory its `userConfigDir.env` (e.g. CLAUDE_CONFIG_DIR) had moved the tool’s user config to when ATK placed this asset, relative to the user root (e.g. { "claude-code": "../cc" }), or absolute when it is on another drive (e.g. "D:/cc"). A tool missing here placed it in its default directory. Uninstall, sync and audit find the tool’s copy there'),
71
- version: z.string().describe('Installed version'),
72
- });
73
- export const LockfileSchema = z.object({
74
- assets: z.array(InstalledAsset).optional().describe('Currently installed assets'),
75
- lockVersion: z.literal(1).describe('Lock file format version'),
76
- org: z.string().optional().describe('Organization scope for this lockfile'),
77
- orgReviewers: z
78
- .array(z.string())
79
- .optional()
80
- .describe('GitHub usernames auto-requested as PR reviewers for org-scoped asset publishes'),
81
- });
3
+ import { ASSET_FILE_PATH, PATH_SEGMENT } from '../root-path.js';
4
+ function lockfileSchemas(object) {
5
+ const InstalledFile = object({
6
+ checksum: z.string().describe('SHA-256 checksum of the file contents'),
7
+ installedPath: z
8
+ .string()
9
+ .optional()
10
+ .describe('Project-relative POSIX path to where the file was installed (computed via adapter for legacy entries); absolute at the user scope when the tool’s config directory is on another drive than the user root'),
11
+ sourcePath: z
12
+ .string()
13
+ .regex(ASSET_FILE_PATH, 'must be a relative path inside the asset directory, with no ".." segment')
14
+ .describe('Original path within the asset directory'),
15
+ });
16
+ const ConfigEntry = object({
17
+ checksum: z.string().describe('SHA-256 hex digest of the config entry value'),
18
+ checksumVersion: z
19
+ .literal(2)
20
+ .optional()
21
+ .describe('How the checksum was computed: 2 hashes the value with keys sorted at every depth. Absent on entries written by older CLI versions, whose digest ignores nested keys; the next sync records them again as 2. Hook groups (entries with a command) always hash every depth and ignore it'),
22
+ command: z
23
+ .string()
24
+ .optional()
25
+ .describe('For array-valued config sections (e.g. hooks.<Event>): identifies the array element this asset owns by its nested hooks[].command value'),
26
+ file: z
27
+ .string()
28
+ .describe('Project-relative POSIX path to the config file; absolute at the user scope when the tool’s config directory is on another drive than the user root'),
29
+ key: z.string().describe('Dot-path key within the config file (e.g. hooks.Stop)'),
30
+ tool: z
31
+ .string()
32
+ .optional()
33
+ .describe('Tool adapter id (e.g. claude-code) that registered this entry. Absent on entries written by older CLI versions; ownership is then inferred from the config file path'),
34
+ });
35
+ const InstalledAsset = object({
36
+ bundleOrigin: object({
37
+ name: z.string().describe('Bundle name that sourced this asset'),
38
+ org: z.string().optional().describe('Organization scope of the bundle (absent for global bundles)'),
39
+ version: z.string().describe('Bundle version at install time'),
40
+ })
41
+ .optional()
42
+ .describe('Bundle that triggered this asset installation'),
43
+ configEntries: z.array(ConfigEntry).optional().describe('Config file entries registered by this asset'),
44
+ dependencies: z
45
+ .array(object({
46
+ name: z.string().describe('Dependency asset name'),
47
+ org: z.string().optional().describe('Organization scope of the dependency'),
48
+ type: AssetType.describe('Dependency asset type'),
49
+ version: z.string().optional().describe('Dependency version constraint at install time'),
50
+ }))
51
+ .optional()
52
+ .describe('Assets this asset depends on'),
53
+ description: z.string().optional().describe('Short description of the asset'),
54
+ entrypoint: z
55
+ .string()
56
+ .optional()
57
+ .describe('Primary file for this asset (relative to the asset directory), from the manifest — used to resolve adapter placement paths'),
58
+ excludedTools: z
59
+ .array(z.string())
60
+ .optional()
61
+ .describe('Tool adapter ids (e.g. codex-cli) this asset was explicitly uninstalled for, or that a hook was skipped for because its manifest does not declare them (those are also in undeclaredTools). Sync, audit and update skip the asset for these tools; installing it for a tool removes that tool again. Absent means the asset is wanted for every tool'),
62
+ files: z.array(InstalledFile).describe('Files placed by this asset'),
63
+ installReason: z
64
+ .enum(['direct', 'dependency'])
65
+ .optional()
66
+ .describe('Whether the user explicitly installed this or it was pulled in as a dependency'),
67
+ name: z
68
+ .string()
69
+ .regex(PATH_SEGMENT, 'must be one path segment: no "/" or "\\", and not "." or ".."')
70
+ .describe('Asset name'),
71
+ org: z.string().optional().describe('Organization scope for this asset'),
72
+ pinnedVersion: z.string().optional().describe('Pinned version constraint, if the asset is version-pinned'),
73
+ type: AssetType.describe('Asset type'),
74
+ undeclaredTools: z
75
+ .array(z.string())
76
+ .optional()
77
+ .describe('The tools in excludedTools that a hook was skipped for because its manifest does not declare them, not uninstalled for. Sync and update place the hook for such a tool once its version declares it'),
78
+ userConfigDirs: z
79
+ .record(z.string(), z.string())
80
+ .optional()
81
+ .describe('User scope only: per tool adapter id, the directory its `userConfigDir.env` (e.g. CLAUDE_CONFIG_DIR) had moved the tool’s user config to when ATK placed this asset, relative to the user root (e.g. { "claude-code": "../cc" }), or absolute when it is on another drive (e.g. "D:/cc"). A tool missing here placed it in its default directory. Uninstall, sync and audit find the tool’s copy there'),
82
+ version: z.string().describe('Installed version'),
83
+ });
84
+ const LockfileSchema = object({
85
+ assets: z.array(InstalledAsset).optional().describe('Currently installed assets'),
86
+ // A new field doesn't bump this: since ATK-587 a CLI keeps the keys it doesn't know, so an older
87
+ // one writing the lockfile leaves a newer one's fields alone. Bump it only for a change an older
88
+ // CLI can't read safely: every released CLI refuses anything but 1 (readLockfile names the upgrade).
89
+ lockVersion: z
90
+ .literal(1)
91
+ .describe('Lock file format version. Added fields keep it at 1: a CLI keeps the keys it does not know when it writes the lockfile'),
92
+ org: z.string().optional().describe('Organization scope for this lockfile'),
93
+ orgReviewers: z
94
+ .array(z.string())
95
+ .optional()
96
+ .describe('GitHub usernames auto-requested as PR reviewers for org-scoped asset publishes'),
97
+ });
98
+ return { ConfigEntry, InstalledAsset, InstalledFile, LockfileSchema };
99
+ }
100
+ // The schemas keep keys this CLI doesn't know, so a teammate on an older CLI doesn't erase a newer
101
+ // one's fields when they write the lockfile (ATK-587). The types come from `Known`, without them.
102
+ export const { ConfigEntry, InstalledAsset, InstalledFile, LockfileSchema } = lockfileSchemas(z.looseObject);
82
103
  //# sourceMappingURL=lockfile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lockfile.js","sourceRoot":"","sources":["../../../src/lib/schemas/lockfile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,IAAI,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEvE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;IACtE,aAAa,EAAE,CAAC;SACb,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,2MAA2M,CAC5M;IACH,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;CAC5E,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;IAC7E,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,yIAAyI,CAC1I;IACH,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,CACP,oJAAoJ,CACrJ;IACH,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;IACjF,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,sKAAsK,CACvK;CACJ,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,YAAY,EAAE,CAAC;SACZ,MAAM,CAAC;QACN,IAAI,EAAE,CAAC,CAAC,MAAM,EA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CAAC,CAAC;aACV,QAAQ,CACP,wHAAwH,CACzH;QACH,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;QAC3E,YAAY,EAAE,CAAC;aACZ,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;aACjB,QAAQ,EAAE;aACV,QAAQ,CAAC,gFAAgF,CAAC;KAC9F,CAAC,CAAC;IAEH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC;AACxE,CAAC;AAED,mGAAmG;AACnG,kGAAkG;AAClG,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,GAAG,eAAe,CAC3F,CAAC,CAAC,WAAW,CACd,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { Adapter } from './schemas/adapter.js';
2
+ import type { InstalledAsset } from './schemas/index.js';
3
+ /** Copy each file into the staging directory `dir` at its relative path `to`, creating folders as needed. */
4
+ export declare function copyIntoStaging(dir: string, files: readonly {
5
+ from: string;
6
+ to: string;
7
+ }[]): Promise<void>;
8
+ /** A new, empty `atk-publish-*` directory in the OS temp folder, for a publish to stage its files in. The caller removes it. */
9
+ export declare function createStagingDir(): Promise<string>;
10
+ /**
11
+ * Copy an installed asset's files from the project into a new staging directory, at
12
+ * their source paths. The directory is removed again if a copy fails.
13
+ */
14
+ export declare function stageInstalledFiles(installed: InstalledAsset, adapter: Adapter, projectRoot: string): Promise<string>;
15
+ //# sourceMappingURL=staging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staging.d.ts","sourceRoot":"","sources":["../../src/lib/staging.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIzD,6GAA6G;AAC7G,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAMhH;AAED,gIAAgI;AAChI,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CAExD;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,cAAc,EACzB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,CAajB"}
@@ -0,0 +1,33 @@
1
+ import { cp, mkdir, mkdtemp, rm } from 'node:fs/promises';
2
+ import { tmpdir } from 'node:os';
3
+ import { dirname, join } from 'node:path';
4
+ import { resolveInstalledPaths } from './adapter.js';
5
+ /** Copy each file into the staging directory `dir` at its relative path `to`, creating folders as needed. */
6
+ export async function copyIntoStaging(dir, files) {
7
+ for (const file of files) {
8
+ const destPath = join(dir, file.to);
9
+ await mkdir(dirname(destPath), { recursive: true });
10
+ await cp(file.from, destPath);
11
+ }
12
+ }
13
+ /** A new, empty `atk-publish-*` directory in the OS temp folder, for a publish to stage its files in. The caller removes it. */
14
+ export async function createStagingDir() {
15
+ return mkdtemp(join(tmpdir(), 'atk-publish-'));
16
+ }
17
+ /**
18
+ * Copy an installed asset's files from the project into a new staging directory, at
19
+ * their source paths. The directory is removed again if a copy fails.
20
+ */
21
+ export async function stageInstalledFiles(installed, adapter, projectRoot) {
22
+ const dir = await createStagingDir();
23
+ try {
24
+ const resolved = resolveInstalledPaths(installed, adapter, projectRoot);
25
+ await copyIntoStaging(dir, resolved.files.map((file) => ({ from: join(projectRoot, file.installedPath), to: file.sourcePath })));
26
+ }
27
+ catch (err) {
28
+ await rm(dir, { force: true, recursive: true });
29
+ throw err;
30
+ }
31
+ return dir;
32
+ }
33
+ //# sourceMappingURL=staging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staging.js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B,sGAAsG;IACtG,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,SAAU,SAAQ,WAAW;IAC/B,IAAI,SAAe;CAC7B;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAoIjH;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAoExF;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAgNtF"}
package/build/lib/sync.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { configDirMove, resolveInstalledPaths } from './adapter.js';
2
2
  import { declarationAllows, excludeToolFromAsset, isExcludedAtVersion, isExcludedForTool, supportsType, withToolExcluded, } from './asset-tools.js';
3
3
  import { getCredential } from './auth.js';
4
+ import { upgradeConfigEntryChecksums } from './checksum.js';
4
5
  import { getConfigEntriesForTool, needsConfigRegistration, staleHookCommandEntries } from './config-entries.js';
5
6
  import { isFrozenInConfig } from './config.js';
6
7
  import { asSentence, errorGuidance, errorMessage, GuidedError, isRunWideFailure, } from './errors.js';
@@ -405,6 +406,7 @@ export async function syncAssets(options) {
405
406
  if (notAttempted)
406
407
  break;
407
408
  }
409
+ lockfile = await upgradeLegacyConfigChecksums(lockfile, projectDir, onProgress);
408
410
  // Write the lockfile once at the end to persist any in-memory mutations
409
411
  // (e.g., restored entries from failed reinstalls)
410
412
  await writeLockfile(projectDir, lockfile);
@@ -434,4 +436,30 @@ function scopeSwitchError(registry, entry, scope) {
434
436
  function toSyncRemoval({ name, org, type }) {
435
437
  return { name, ...(org ? { org } : {}), type };
436
438
  }
439
+ /**
440
+ * Record each config entry an older CLI checksummed without its nested keys again with a deep
441
+ * checksum (see {@link upgradeConfigEntryChecksums}), for every asset and tool, so audit and sync
442
+ * see later edits to an MCP server's `env` or `headers`. An entry whose value no longer matches
443
+ * its legacy digest is left as it is: it was edited, and audit still reports it.
444
+ */
445
+ async function upgradeLegacyConfigChecksums(lockfile, projectDir, onProgress) {
446
+ if (!lockfile.assets)
447
+ return lockfile;
448
+ let upgraded = 0;
449
+ const assets = [];
450
+ for (const asset of lockfile.assets) {
451
+ const recorded = asset.configEntries;
452
+ if (!recorded) {
453
+ assets.push(asset);
454
+ continue;
455
+ }
456
+ const configEntries = await upgradeConfigEntryChecksums(recorded, projectDir);
457
+ upgraded += configEntries.filter((entry, index) => entry !== recorded[index]).length;
458
+ assets.push({ ...asset, configEntries });
459
+ }
460
+ if (upgraded === 0)
461
+ return lockfile;
462
+ onProgress?.(`Recorded deep checksums for ${upgraded} config ${upgraded === 1 ? 'entry' : 'entries'}`);
463
+ return { ...lockfile, assets };
464
+ }
437
465
  //# sourceMappingURL=sync.js.map