@a5c-ai/extensions-adapter 6.0.1-staging.f8aae93c2dbc → 6.0.1

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 (127) hide show
  1. package/dist/binTemplates.d.ts +7 -0
  2. package/dist/binTemplates.d.ts.map +1 -0
  3. package/dist/binTemplates.js +292 -0
  4. package/dist/cli.d.ts +8 -0
  5. package/dist/cli.d.ts.map +1 -0
  6. package/dist/cli.js +299 -0
  7. package/dist/compiler.d.ts +15 -0
  8. package/dist/compiler.d.ts.map +1 -0
  9. package/dist/compiler.js +118 -0
  10. package/dist/diff.d.ts +9 -0
  11. package/dist/diff.d.ts.map +1 -0
  12. package/dist/diff.js +183 -0
  13. package/dist/emit.d.ts +3 -0
  14. package/dist/emit.d.ts.map +1 -0
  15. package/dist/emit.js +42 -0
  16. package/dist/extension-adapter.d.ts +3 -0
  17. package/dist/extension-adapter.d.ts.map +1 -0
  18. package/dist/extension-adapter.js +4 -0
  19. package/dist/hookRegistration.d.ts +8 -0
  20. package/dist/hookRegistration.d.ts.map +1 -0
  21. package/dist/hookRegistration.js +9 -0
  22. package/dist/index.d.ts +13 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +13 -0
  25. package/dist/init.d.ts +17 -0
  26. package/dist/init.d.ts.map +1 -0
  27. package/dist/init.js +200 -0
  28. package/dist/installInstructions.d.ts +3 -0
  29. package/dist/installInstructions.d.ts.map +1 -0
  30. package/dist/installInstructions.js +150 -0
  31. package/dist/installSharedGenerator.d.ts +3 -0
  32. package/dist/installSharedGenerator.d.ts.map +1 -0
  33. package/dist/installSharedGenerator.js +229 -0
  34. package/dist/manifestGenerators.d.ts +10 -0
  35. package/dist/manifestGenerators.d.ts.map +1 -0
  36. package/dist/manifestGenerators.js +11 -0
  37. package/dist/marketplaceGenerator.d.ts +3 -0
  38. package/dist/marketplaceGenerator.d.ts.map +1 -0
  39. package/dist/marketplaceGenerator.js +47 -0
  40. package/dist/mcpConfig.d.ts +69 -0
  41. package/dist/mcpConfig.d.ts.map +1 -0
  42. package/dist/mcpConfig.js +115 -0
  43. package/dist/proxiedHookTemplates.d.ts +10 -0
  44. package/dist/proxiedHookTemplates.d.ts.map +1 -0
  45. package/dist/proxiedHookTemplates.js +123 -0
  46. package/dist/resolve.d.ts +3 -0
  47. package/dist/resolve.d.ts.map +1 -0
  48. package/dist/resolve.js +106 -0
  49. package/dist/schema.d.ts +231 -0
  50. package/dist/schema.d.ts.map +1 -0
  51. package/dist/schema.js +340 -0
  52. package/dist/sdkConfig.d.ts +20 -0
  53. package/dist/sdkConfig.d.ts.map +1 -0
  54. package/dist/sdkConfig.js +41 -0
  55. package/dist/targets/adapters/antigravity.d.ts +33 -0
  56. package/dist/targets/adapters/antigravity.d.ts.map +1 -0
  57. package/dist/targets/adapters/antigravity.js +173 -0
  58. package/dist/targets/adapters/base.d.ts +11 -0
  59. package/dist/targets/adapters/base.d.ts.map +1 -0
  60. package/dist/targets/adapters/base.js +19 -0
  61. package/dist/targets/adapters/claude-code.d.ts +10 -0
  62. package/dist/targets/adapters/claude-code.d.ts.map +1 -0
  63. package/dist/targets/adapters/claude-code.js +87 -0
  64. package/dist/targets/adapters/codex.d.ts +14 -0
  65. package/dist/targets/adapters/codex.d.ts.map +1 -0
  66. package/dist/targets/adapters/codex.js +136 -0
  67. package/dist/targets/adapters/cursor.d.ts +10 -0
  68. package/dist/targets/adapters/cursor.d.ts.map +1 -0
  69. package/dist/targets/adapters/cursor.js +63 -0
  70. package/dist/targets/adapters/gemini.d.ts +10 -0
  71. package/dist/targets/adapters/gemini.d.ts.map +1 -0
  72. package/dist/targets/adapters/gemini.js +103 -0
  73. package/dist/targets/adapters/genty.d.ts +12 -0
  74. package/dist/targets/adapters/genty.d.ts.map +1 -0
  75. package/dist/targets/adapters/genty.js +94 -0
  76. package/dist/targets/adapters/github-copilot.d.ts +10 -0
  77. package/dist/targets/adapters/github-copilot.d.ts.map +1 -0
  78. package/dist/targets/adapters/github-copilot.js +66 -0
  79. package/dist/targets/adapters/hermes.d.ts +13 -0
  80. package/dist/targets/adapters/hermes.d.ts.map +1 -0
  81. package/dist/targets/adapters/hermes.js +99 -0
  82. package/dist/targets/adapters/hooks-utils.d.ts +12 -0
  83. package/dist/targets/adapters/hooks-utils.d.ts.map +1 -0
  84. package/dist/targets/adapters/hooks-utils.js +60 -0
  85. package/dist/targets/adapters/index.d.ts +31 -0
  86. package/dist/targets/adapters/index.d.ts.map +1 -0
  87. package/dist/targets/adapters/index.js +75 -0
  88. package/dist/targets/adapters/interface.d.ts +9 -0
  89. package/dist/targets/adapters/interface.d.ts.map +1 -0
  90. package/dist/targets/adapters/interface.js +2 -0
  91. package/dist/targets/adapters/oh-my-pi.d.ts +12 -0
  92. package/dist/targets/adapters/oh-my-pi.d.ts.map +1 -0
  93. package/dist/targets/adapters/oh-my-pi.js +97 -0
  94. package/dist/targets/adapters/openclaw.d.ts +15 -0
  95. package/dist/targets/adapters/openclaw.d.ts.map +1 -0
  96. package/dist/targets/adapters/openclaw.js +170 -0
  97. package/dist/targets/adapters/opencode.d.ts +11 -0
  98. package/dist/targets/adapters/opencode.d.ts.map +1 -0
  99. package/dist/targets/adapters/opencode.js +101 -0
  100. package/dist/targets/adapters/pi.d.ts +12 -0
  101. package/dist/targets/adapters/pi.d.ts.map +1 -0
  102. package/dist/targets/adapters/pi.js +98 -0
  103. package/dist/targets/index.d.ts +7 -0
  104. package/dist/targets/index.d.ts.map +1 -0
  105. package/dist/targets/index.js +79 -0
  106. package/dist/transform.d.ts +4 -0
  107. package/dist/transform.d.ts.map +1 -0
  108. package/dist/transform.js +301 -0
  109. package/dist/transformEmitters.d.ts +8 -0
  110. package/dist/transformEmitters.d.ts.map +1 -0
  111. package/dist/transformEmitters.js +350 -0
  112. package/dist/transformHelpers.d.ts +15 -0
  113. package/dist/transformHelpers.d.ts.map +1 -0
  114. package/dist/transformHelpers.js +246 -0
  115. package/dist/types.d.ts +214 -0
  116. package/dist/types.d.ts.map +1 -0
  117. package/dist/types.js +2 -0
  118. package/dist/utils.d.ts +42 -0
  119. package/dist/utils.d.ts.map +1 -0
  120. package/dist/utils.js +187 -0
  121. package/dist/validate.d.ts +3 -0
  122. package/dist/validate.d.ts.map +1 -0
  123. package/dist/validate.js +188 -0
  124. package/dist/verify.d.ts +6 -0
  125. package/dist/verify.d.ts.map +1 -0
  126. package/dist/verify.js +294 -0
  127. package/package.json +2 -2
package/dist/schema.js ADDED
@@ -0,0 +1,340 @@
1
+ // JSON Schema for plugin.json validation
2
+ // Manual validation implementation to avoid external dependencies
3
+ export const A5C_PLUGIN_SCHEMA = {
4
+ $schema: 'https://json-schema.org/draft/2020-12/schema',
5
+ $id: 'https://extensions-adapter.dev/schemas/plugin.json',
6
+ title: 'Unified Plugin Format Manifest',
7
+ type: 'object',
8
+ required: ['name', 'version', 'description', 'author', 'license'],
9
+ properties: {
10
+ name: { type: 'string', pattern: '^[a-z0-9-]+$' },
11
+ version: { type: 'string' },
12
+ description: { type: 'string' },
13
+ author: {
14
+ oneOf: [
15
+ { type: 'string' },
16
+ {
17
+ type: 'object',
18
+ required: ['name'],
19
+ properties: {
20
+ name: { type: 'string' },
21
+ email: { type: 'string', format: 'email' },
22
+ },
23
+ },
24
+ ],
25
+ },
26
+ license: { type: 'string' },
27
+ repository: {
28
+ type: 'object',
29
+ properties: {
30
+ type: { type: 'string' },
31
+ url: { type: 'string', format: 'uri' },
32
+ },
33
+ },
34
+ homepage: { type: 'string', format: 'uri' },
35
+ keywords: { type: 'array', items: { type: 'string' } },
36
+ hooks: {
37
+ type: 'object',
38
+ additionalProperties: { type: ['string', 'boolean', 'null'] },
39
+ },
40
+ commands: {
41
+ oneOf: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }],
42
+ },
43
+ skills: {
44
+ type: 'array',
45
+ items: {
46
+ type: 'object',
47
+ required: ['name', 'file'],
48
+ properties: {
49
+ name: { type: 'string' },
50
+ file: { type: 'string' },
51
+ },
52
+ },
53
+ },
54
+ agents: {
55
+ oneOf: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }],
56
+ },
57
+ contextFiles: {
58
+ type: 'object',
59
+ additionalProperties: { type: 'string' },
60
+ },
61
+ extraFileSets: {
62
+ type: 'object',
63
+ additionalProperties: {
64
+ type: 'object',
65
+ additionalProperties: { type: 'string' },
66
+ },
67
+ },
68
+ harnessInstallSurfaceExportSets: {
69
+ type: 'object',
70
+ additionalProperties: {
71
+ type: 'array',
72
+ items: { type: 'string' },
73
+ },
74
+ },
75
+ targets: {
76
+ type: 'object',
77
+ additionalProperties: {
78
+ type: 'object',
79
+ properties: {
80
+ npmPackageName: { type: 'string' },
81
+ type: { type: 'string', enum: ['typescript-build'] },
82
+ skills: {
83
+ oneOf: [
84
+ { type: 'string', enum: ['derive-from-commands'] },
85
+ { type: 'array' },
86
+ ],
87
+ },
88
+ hooks: {
89
+ type: 'object',
90
+ additionalProperties: { type: ['string', 'null'] },
91
+ },
92
+ extraFileSets: {
93
+ type: 'array',
94
+ items: { type: 'string' },
95
+ },
96
+ extraFiles: {
97
+ type: 'object',
98
+ additionalProperties: { type: 'string' },
99
+ },
100
+ templateVars: {
101
+ type: 'object',
102
+ additionalProperties: { type: 'string' },
103
+ },
104
+ harnessInstallSurfaceExportSets: {
105
+ type: 'array',
106
+ items: { type: 'string' },
107
+ },
108
+ },
109
+ additionalProperties: true,
110
+ },
111
+ },
112
+ include: {
113
+ type: 'array',
114
+ items: { type: 'string' },
115
+ description: 'Extra files to copy to output (glob patterns relative to source dir)',
116
+ },
117
+ hookConfig: {
118
+ type: 'object',
119
+ properties: {
120
+ proxyAdapter: { type: 'boolean' },
121
+ matchers: {
122
+ type: 'object',
123
+ additionalProperties: { type: 'string' },
124
+ },
125
+ },
126
+ },
127
+ sdk: { type: 'object' },
128
+ hookFilePattern: { type: 'string' },
129
+ postInstall: { type: 'string' },
130
+ installSurface: { type: 'string' },
131
+ installSurfaceExports: { type: 'array', items: { type: 'string' } },
132
+ },
133
+ additionalProperties: false,
134
+ };
135
+ function isString(value) {
136
+ return typeof value === 'string';
137
+ }
138
+ function isObject(value) {
139
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
140
+ }
141
+ function isArray(value) {
142
+ return Array.isArray(value);
143
+ }
144
+ export function validate(data) {
145
+ const diagnostics = [];
146
+ if (!isObject(data)) {
147
+ diagnostics.push({
148
+ level: 'error',
149
+ category: 'validation',
150
+ message: 'Manifest must be a JSON object',
151
+ });
152
+ return { valid: false, diagnostics };
153
+ }
154
+ const manifest = data;
155
+ // Required fields
156
+ const required = ['name', 'version', 'description', 'author', 'license'];
157
+ for (const field of required) {
158
+ if (!(field in manifest)) {
159
+ diagnostics.push({
160
+ level: 'error',
161
+ category: 'validation',
162
+ message: `Required field '${field}' is missing`,
163
+ });
164
+ }
165
+ }
166
+ // name: string matching pattern
167
+ if ('name' in manifest) {
168
+ if (!isString(manifest.name)) {
169
+ diagnostics.push({
170
+ level: 'error',
171
+ category: 'validation',
172
+ message: "Field 'name' must be a string",
173
+ });
174
+ }
175
+ else if (!/^[a-z0-9-]+$/.test(manifest.name)) {
176
+ diagnostics.push({
177
+ level: 'error',
178
+ category: 'validation',
179
+ message: "Field 'name' must match pattern ^[a-z0-9-]+$",
180
+ });
181
+ }
182
+ }
183
+ // version, description, license: strings
184
+ for (const field of ['version', 'description', 'license']) {
185
+ if (field in manifest && !isString(manifest[field])) {
186
+ diagnostics.push({
187
+ level: 'error',
188
+ category: 'validation',
189
+ message: `Field '${field}' must be a string`,
190
+ });
191
+ }
192
+ }
193
+ // author: string or object with name
194
+ if ('author' in manifest) {
195
+ const author = manifest.author;
196
+ if (!isString(author) && !isObject(author)) {
197
+ diagnostics.push({
198
+ level: 'error',
199
+ category: 'validation',
200
+ message: "Field 'author' must be a string or object",
201
+ });
202
+ }
203
+ else if (isObject(author)) {
204
+ if (!('name' in author) || !isString(author.name)) {
205
+ diagnostics.push({
206
+ level: 'error',
207
+ category: 'validation',
208
+ message: "Field 'author.name' is required and must be a string",
209
+ });
210
+ }
211
+ if ('email' in author && !isString(author.email)) {
212
+ diagnostics.push({
213
+ level: 'error',
214
+ category: 'validation',
215
+ message: "Field 'author.email' must be a string",
216
+ });
217
+ }
218
+ }
219
+ }
220
+ // repository: object with type and url
221
+ if ('repository' in manifest) {
222
+ if (!isObject(manifest.repository)) {
223
+ diagnostics.push({
224
+ level: 'error',
225
+ category: 'validation',
226
+ message: "Field 'repository' must be an object",
227
+ });
228
+ }
229
+ else {
230
+ const repo = manifest.repository;
231
+ if ('type' in repo && !isString(repo.type)) {
232
+ diagnostics.push({
233
+ level: 'error',
234
+ category: 'validation',
235
+ message: "Field 'repository.type' must be a string",
236
+ });
237
+ }
238
+ if ('url' in repo && !isString(repo.url)) {
239
+ diagnostics.push({
240
+ level: 'error',
241
+ category: 'validation',
242
+ message: "Field 'repository.url' must be a string",
243
+ });
244
+ }
245
+ }
246
+ }
247
+ // hooks: object with string or null values
248
+ if ('hooks' in manifest) {
249
+ if (!isObject(manifest.hooks)) {
250
+ diagnostics.push({
251
+ level: 'error',
252
+ category: 'validation',
253
+ message: "Field 'hooks' must be an object",
254
+ });
255
+ }
256
+ else {
257
+ for (const [key, value] of Object.entries(manifest.hooks)) {
258
+ if (!isString(value) && typeof value !== 'boolean' && value !== null) {
259
+ diagnostics.push({
260
+ level: 'error',
261
+ category: 'validation',
262
+ message: `Hook '${key}' must be a string, boolean, or null`,
263
+ });
264
+ }
265
+ }
266
+ }
267
+ }
268
+ // commands: string or array of strings
269
+ if ('commands' in manifest) {
270
+ const commands = manifest.commands;
271
+ if (!isString(commands) && !isArray(commands)) {
272
+ diagnostics.push({
273
+ level: 'error',
274
+ category: 'validation',
275
+ message: "Field 'commands' must be a string or array",
276
+ });
277
+ }
278
+ else if (isArray(commands)) {
279
+ for (let i = 0; i < commands.length; i++) {
280
+ if (!isString(commands[i])) {
281
+ diagnostics.push({
282
+ level: 'error',
283
+ category: 'validation',
284
+ message: `commands[${i}] must be a string`,
285
+ });
286
+ }
287
+ }
288
+ }
289
+ }
290
+ // skills: array of objects with name and file
291
+ if ('skills' in manifest) {
292
+ if (!isArray(manifest.skills)) {
293
+ diagnostics.push({
294
+ level: 'error',
295
+ category: 'validation',
296
+ message: "Field 'skills' must be an array",
297
+ });
298
+ }
299
+ else {
300
+ for (let i = 0; i < manifest.skills.length; i++) {
301
+ const skill = manifest.skills[i];
302
+ if (!isObject(skill)) {
303
+ diagnostics.push({
304
+ level: 'error',
305
+ category: 'validation',
306
+ message: `skills[${i}] must be an object`,
307
+ });
308
+ }
309
+ else {
310
+ if (!('name' in skill) || !isString(skill.name)) {
311
+ diagnostics.push({
312
+ level: 'error',
313
+ category: 'validation',
314
+ message: `skills[${i}].name is required and must be a string`,
315
+ });
316
+ }
317
+ if (!('file' in skill) || !isString(skill.file)) {
318
+ diagnostics.push({
319
+ level: 'error',
320
+ category: 'validation',
321
+ message: `skills[${i}].file is required and must be a string`,
322
+ });
323
+ }
324
+ }
325
+ }
326
+ }
327
+ }
328
+ // targets: object with per-target overrides
329
+ if ('targets' in manifest && !isObject(manifest.targets)) {
330
+ diagnostics.push({
331
+ level: 'error',
332
+ category: 'validation',
333
+ message: "Field 'targets' must be an object",
334
+ });
335
+ }
336
+ return {
337
+ valid: diagnostics.filter((d) => d.level === 'error').length === 0,
338
+ diagnostics,
339
+ };
340
+ }
@@ -0,0 +1,20 @@
1
+ import type { A5cPluginManifest, TargetProfile } from './types.js';
2
+ export interface SdkConfig {
3
+ package: string;
4
+ cli: string;
5
+ proxyPackage: string;
6
+ proxyBinary: string;
7
+ scope: string;
8
+ envPrefix: string;
9
+ stateDir: string;
10
+ }
11
+ type PackageNamedManifest = A5cPluginManifest & {
12
+ npmPackageName?: string;
13
+ };
14
+ type TargetPackageProfile = Pick<TargetProfile, 'name' | 'npmPackageName'>;
15
+ export declare const BABYSITTER_DEFAULT_SDK_CONFIG: Readonly<SdkConfig>;
16
+ export declare function resolveSdkConfig(manifest: A5cPluginManifest): SdkConfig;
17
+ export declare function resolveTargetNpmPackageName(manifest: PackageNamedManifest, targetProfile: TargetPackageProfile): string;
18
+ export declare function resolveTargetCliName(manifest: PackageNamedManifest, targetProfile: TargetPackageProfile): string;
19
+ export {};
20
+ //# sourceMappingURL=sdkConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdkConfig.d.ts","sourceRoot":"","sources":["../src/sdkConfig.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEnE,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,KAAK,oBAAoB,GAAG,iBAAiB,GAAG;IAAE,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC5E,KAAK,oBAAoB,GAAG,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,gBAAgB,CAAC,CAAC;AAE3E,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,SAAS,CAQ7D,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,SAAS,CAWvE;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,oBAAoB,EAC9B,aAAa,EAAE,oBAAoB,GAClC,MAAM,CAgBR;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,oBAAoB,EAC9B,aAAa,EAAE,oBAAoB,GAClC,MAAM,CAGR"}
@@ -0,0 +1,41 @@
1
+ // SDK configuration resolver — omitted sdk config always falls back to the
2
+ // shared Babysitter SDK contract.
3
+ export const BABYSITTER_DEFAULT_SDK_CONFIG = {
4
+ package: '@a5c-ai/babysitter-sdk',
5
+ cli: 'babysitter',
6
+ proxyPackage: '@a5c-ai/hooks-adapter-cli',
7
+ proxyBinary: 'adapters-hooks',
8
+ scope: '@a5c-ai',
9
+ envPrefix: 'BABYSITTER',
10
+ stateDir: '.a5c',
11
+ };
12
+ export function resolveSdkConfig(manifest) {
13
+ const sdk = manifest.sdk ?? {};
14
+ return {
15
+ package: sdk.package || BABYSITTER_DEFAULT_SDK_CONFIG.package,
16
+ cli: sdk.cli || BABYSITTER_DEFAULT_SDK_CONFIG.cli,
17
+ proxyPackage: sdk.proxyPackage || BABYSITTER_DEFAULT_SDK_CONFIG.proxyPackage,
18
+ proxyBinary: sdk.proxyBinary || BABYSITTER_DEFAULT_SDK_CONFIG.proxyBinary,
19
+ scope: sdk.scope || BABYSITTER_DEFAULT_SDK_CONFIG.scope,
20
+ envPrefix: sdk.envPrefix || BABYSITTER_DEFAULT_SDK_CONFIG.envPrefix,
21
+ stateDir: sdk.stateDir || BABYSITTER_DEFAULT_SDK_CONFIG.stateDir,
22
+ };
23
+ }
24
+ export function resolveTargetNpmPackageName(manifest, targetProfile) {
25
+ if (typeof manifest.npmPackageName === 'string' && manifest.npmPackageName.length > 0) {
26
+ return manifest.npmPackageName;
27
+ }
28
+ const override = manifest.targets?.[targetProfile.name]?.npmPackageName;
29
+ if (typeof override === 'string' && override.length > 0) {
30
+ return override;
31
+ }
32
+ if (typeof targetProfile.npmPackageName === 'string' && targetProfile.npmPackageName.length > 0) {
33
+ return targetProfile.npmPackageName;
34
+ }
35
+ const sdk = resolveSdkConfig(manifest);
36
+ return `${sdk.scope}/${manifest.name}-${targetProfile.name}`;
37
+ }
38
+ export function resolveTargetCliName(manifest, targetProfile) {
39
+ return resolveTargetNpmPackageName(manifest, targetProfile).split('/').pop()
40
+ || `${manifest.name}-${targetProfile.name}`;
41
+ }
@@ -0,0 +1,33 @@
1
+ import type { A5cPluginManifest, TargetProfile, TransformedFile, Diagnostic } from '../../types.js';
2
+ import { BaseHarnessOutputAdapter } from './base.js';
3
+ export declare class AntigravityAdapter extends BaseHarnessOutputAdapter {
4
+ generateMcpConfig(manifest: A5cPluginManifest, _targetProfile: TargetProfile): TransformedFile | null;
5
+ generateHookRegistration(manifest: A5cPluginManifest, targetProfile: TargetProfile, _diagnostics: Diagnostic[]): TransformedFile | null;
6
+ generateManifestFiles(_sourceDir: string, manifest: A5cPluginManifest, targetProfile: TargetProfile, _diagnostics: Diagnostic[]): TransformedFile[];
7
+ generateExtraTargetFiles(_sourceDir: string, manifest: A5cPluginManifest, _targetProfile: TargetProfile, _diagnostics: Diagnostic[]): TransformedFile[];
8
+ }
9
+ export declare function generateAntigravityManifest(manifest: A5cPluginManifest, _targetName?: string): string;
10
+ /**
11
+ * Generate SKILL.md — the antigravity-native skill manifest.
12
+ *
13
+ * Antigravity CLI discovers plugins via SKILL.md files (not
14
+ * gemini-extension.json). The SKILL.md format uses YAML frontmatter
15
+ * for metadata and markdown body for the skill description.
16
+ */
17
+ export declare function generateAntigravitySkillMd(manifest: A5cPluginManifest): string;
18
+ /**
19
+ * Generate hooks.json for Antigravity CLI.
20
+ *
21
+ * While Antigravity is workflow-driven, it still supports a hooks.json
22
+ * registration file for compatibility with the hooks-adapter pipeline.
23
+ */
24
+ export declare function generateAntigravityHooksJson(manifest: A5cPluginManifest, targetProfile: TargetProfile): string;
25
+ /**
26
+ * Generate workflow.json — the workflow orchestration descriptor.
27
+ *
28
+ * Antigravity CLI uses workflow-driven orchestration. This file
29
+ * describes the execution graph for hooks rather than relying on
30
+ * individual shell scripts.
31
+ */
32
+ export declare function generateAntigravityWorkflow(manifest: A5cPluginManifest): string;
33
+ //# sourceMappingURL=antigravity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"antigravity.d.ts","sourceRoot":"","sources":["../../../src/targets/adapters/antigravity.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACpG,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAUrD,qBAAa,kBAAmB,SAAQ,wBAAwB;IAE9D,iBAAiB,CACf,QAAQ,EAAE,iBAAiB,EAC3B,cAAc,EAAE,aAAa,GAC5B,eAAe,GAAG,IAAI;IAIzB,wBAAwB,CACtB,QAAQ,EAAE,iBAAiB,EAC3B,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,UAAU,EAAE,GACzB,eAAe,GAAG,IAAI;IAKzB,qBAAqB,CACnB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,iBAAiB,EAC3B,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,UAAU,EAAE,GACzB,eAAe,EAAE;IAuBpB,wBAAwB,CACtB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,iBAAiB,EAC3B,cAAc,EAAE,aAAa,EAC7B,YAAY,EAAE,UAAU,EAAE,GACzB,eAAe,EAAE;CAYrB;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,iBAAiB,EAC3B,WAAW,SAAoB,GAC9B,MAAM,CAmCR;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CA4B9E;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,iBAAiB,EAC3B,aAAa,EAAE,aAAa,GAC3B,MAAM,CA0BR;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAwB/E"}
@@ -0,0 +1,173 @@
1
+ // Antigravity CLI harness output adapter
2
+ //
3
+ // Antigravity CLI is Google's successor to Gemini CLI. It uses a
4
+ // workflow-driven hook model (not shell-hook scripts) and a SKILL.md
5
+ // plugin system. It is model-agnostic (Gemini, Claude, GPT).
6
+ import { BaseHarnessOutputAdapter } from './base.js';
7
+ import { emitJsonMcpConfig } from '../../mcpConfig.js';
8
+ import { iterateHooks, slugify, resolveCmd, getPattern, resolveSdkConfig, } from './hooks-utils.js';
9
+ export class AntigravityAdapter extends BaseHarnessOutputAdapter {
10
+ generateMcpConfig(manifest, _targetProfile) {
11
+ return emitJsonMcpConfig(manifest, 'mcp.json');
12
+ }
13
+ generateHookRegistration(manifest, targetProfile, _diagnostics) {
14
+ const content = generateAntigravityHooksJson(manifest, targetProfile);
15
+ return { path: targetProfile.hookRegistrationOutputPath || 'hooks/hooks.json', content };
16
+ }
17
+ generateManifestFiles(_sourceDir, manifest, targetProfile, _diagnostics) {
18
+ const files = [];
19
+ // Universal plugin.json manifest
20
+ files.push({
21
+ path: 'plugin.json',
22
+ content: generateAntigravityManifest(manifest, this.targetName),
23
+ });
24
+ // SKILL.md — the antigravity-native skill manifest (replaces gemini-extension.json)
25
+ const skillMdPath = targetProfile.harnessManifestPath || 'SKILL.md';
26
+ files.push({
27
+ path: skillMdPath,
28
+ content: generateAntigravitySkillMd(manifest),
29
+ });
30
+ // NOTE: MCP config (mcp.json) is emitted by the global MCP emit step in
31
+ // transform() via generateMcpConfig(), not here, so it is only produced
32
+ // when manifest.mcpServers is declared.
33
+ return files;
34
+ }
35
+ generateExtraTargetFiles(_sourceDir, manifest, _targetProfile, _diagnostics) {
36
+ const files = [];
37
+ // Workflow orchestration descriptor — antigravity uses workflow-driven
38
+ // orchestration rather than shell hook scripts
39
+ files.push({
40
+ path: 'workflow.json',
41
+ content: generateAntigravityWorkflow(manifest),
42
+ });
43
+ return files;
44
+ }
45
+ }
46
+ export function generateAntigravityManifest(manifest, _targetName = 'antigravity-cli') {
47
+ const pluginJson = {
48
+ name: manifest.name,
49
+ version: manifest.version,
50
+ description: manifest.description,
51
+ author: manifest.author,
52
+ license: manifest.license,
53
+ harness: 'antigravity-cli',
54
+ hooks: {},
55
+ skills: 'skills/',
56
+ commands: 'commands/',
57
+ contextFileName: 'SKILL.md',
58
+ workflow: 'workflow.json',
59
+ mcpConfig: 'mcp.json',
60
+ };
61
+ if (manifest.hooks) {
62
+ const hooksObj = {};
63
+ for (const [canonicalHook, handlerValue] of Object.entries(manifest.hooks)) {
64
+ if (handlerValue) {
65
+ hooksObj[canonicalHook] = handlerValue;
66
+ }
67
+ }
68
+ pluginJson.hooks = hooksObj;
69
+ }
70
+ if (manifest.repository) {
71
+ pluginJson.repository = manifest.repository;
72
+ }
73
+ if (manifest.keywords) {
74
+ pluginJson.keywords = manifest.keywords;
75
+ }
76
+ return JSON.stringify(pluginJson, null, 2) + '\n';
77
+ }
78
+ /**
79
+ * Generate SKILL.md — the antigravity-native skill manifest.
80
+ *
81
+ * Antigravity CLI discovers plugins via SKILL.md files (not
82
+ * gemini-extension.json). The SKILL.md format uses YAML frontmatter
83
+ * for metadata and markdown body for the skill description.
84
+ */
85
+ export function generateAntigravitySkillMd(manifest) {
86
+ const lines = [];
87
+ lines.push('---');
88
+ lines.push(`name: ${manifest.name}`);
89
+ lines.push(`version: ${manifest.version}`);
90
+ lines.push(`description: ${manifest.description}`);
91
+ if (manifest.keywords && manifest.keywords.length > 0) {
92
+ lines.push(`tags: [${manifest.keywords.map((k) => `"${k}"`).join(', ')}]`);
93
+ }
94
+ lines.push('model_agnostic: true');
95
+ lines.push('orchestration: workflow');
96
+ lines.push('---');
97
+ lines.push('');
98
+ lines.push(`# ${manifest.name}`);
99
+ lines.push('');
100
+ lines.push(manifest.description);
101
+ lines.push('');
102
+ lines.push('## Hooks');
103
+ lines.push('');
104
+ if (manifest.hooks) {
105
+ for (const [canonical, handler] of Object.entries(manifest.hooks)) {
106
+ if (handler) {
107
+ lines.push(`- **${canonical}**: ${typeof handler === 'string' ? handler : 'enabled'}`);
108
+ }
109
+ }
110
+ }
111
+ lines.push('');
112
+ return lines.join('\n');
113
+ }
114
+ /**
115
+ * Generate hooks.json for Antigravity CLI.
116
+ *
117
+ * While Antigravity is workflow-driven, it still supports a hooks.json
118
+ * registration file for compatibility with the hooks-adapter pipeline.
119
+ */
120
+ export function generateAntigravityHooksJson(manifest, targetProfile) {
121
+ const hooks = {};
122
+ const rootRef = targetProfile.pluginRootEnvVar
123
+ ? `\${${targetProfile.pluginRootEnvVar}}`
124
+ : '${ANTIGRAVITY_SKILL_PATH}';
125
+ const pat = getPattern(manifest, targetProfile.name);
126
+ const sdk = resolveSdkConfig(manifest);
127
+ iterateHooks(manifest, targetProfile, (canonical, native, handler) => {
128
+ const slug = slugify(canonical);
129
+ const cmd = resolveCmd(handler, slug, targetProfile.adapterName, rootRef, manifest.name, native, sdk.proxyPackage, sdk.proxyBinary, pat);
130
+ hooks[native] = [{
131
+ hooks: [{
132
+ name: `${manifest.name}-${slug}`,
133
+ type: 'workflow',
134
+ command: cmd,
135
+ timeout: 30000,
136
+ description: `${manifest.name} ${canonical} hook (workflow-driven)`,
137
+ }],
138
+ }];
139
+ });
140
+ return JSON.stringify({
141
+ description: `${manifest.name} plugin hooks for Antigravity CLI`,
142
+ hooks,
143
+ }, null, 2) + '\n';
144
+ }
145
+ /**
146
+ * Generate workflow.json — the workflow orchestration descriptor.
147
+ *
148
+ * Antigravity CLI uses workflow-driven orchestration. This file
149
+ * describes the execution graph for hooks rather than relying on
150
+ * individual shell scripts.
151
+ */
152
+ export function generateAntigravityWorkflow(manifest) {
153
+ const steps = [];
154
+ if (manifest.hooks) {
155
+ for (const [canonical, handler] of Object.entries(manifest.hooks)) {
156
+ if (handler) {
157
+ steps.push({
158
+ id: slugify(canonical),
159
+ hook: canonical,
160
+ type: 'workflow',
161
+ handler: typeof handler === 'string' ? handler : 'default',
162
+ });
163
+ }
164
+ }
165
+ }
166
+ const workflow = {
167
+ name: manifest.name,
168
+ version: manifest.version,
169
+ orchestration: 'workflow-driven',
170
+ steps,
171
+ };
172
+ return JSON.stringify(workflow, null, 2) + '\n';
173
+ }
@@ -0,0 +1,11 @@
1
+ import type { A5cPluginManifest, TargetProfile, TransformedFile, Diagnostic } from '../../types.js';
2
+ import type { HarnessOutputAdapter } from './interface.js';
3
+ export declare class BaseHarnessOutputAdapter implements HarnessOutputAdapter {
4
+ readonly targetName: string;
5
+ constructor(targetName: string);
6
+ generateHookRegistration(_manifest: A5cPluginManifest, _targetProfile: TargetProfile, _diagnostics: Diagnostic[]): TransformedFile | null;
7
+ generateManifestFiles(_sourceDir: string, _manifest: A5cPluginManifest, _targetProfile: TargetProfile, _diagnostics: Diagnostic[], _rawManifest?: A5cPluginManifest): TransformedFile[];
8
+ generateExtraTargetFiles(_sourceDir: string, _manifest: A5cPluginManifest, _targetProfile: TargetProfile, _diagnostics: Diagnostic[]): TransformedFile[];
9
+ generateMcpConfig(_manifest: A5cPluginManifest, _targetProfile: TargetProfile): TransformedFile | null;
10
+ }
11
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/targets/adapters/base.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACpG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,qBAAa,wBAAyB,YAAW,oBAAoB;IACnE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;gBAEhB,UAAU,EAAE,MAAM;IAI9B,wBAAwB,CACtB,SAAS,EAAE,iBAAiB,EAC5B,cAAc,EAAE,aAAa,EAC7B,YAAY,EAAE,UAAU,EAAE,GACzB,eAAe,GAAG,IAAI;IAIzB,qBAAqB,CACnB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,iBAAiB,EAC5B,cAAc,EAAE,aAAa,EAC7B,YAAY,EAAE,UAAU,EAAE,EAC1B,YAAY,CAAC,EAAE,iBAAiB,GAC/B,eAAe,EAAE;IAIpB,wBAAwB,CACtB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,iBAAiB,EAC5B,cAAc,EAAE,aAAa,EAC7B,YAAY,EAAE,UAAU,EAAE,GACzB,eAAe,EAAE;IAIpB,iBAAiB,CACf,SAAS,EAAE,iBAAiB,EAC5B,cAAc,EAAE,aAAa,GAC5B,eAAe,GAAG,IAAI;CAG1B"}
@@ -0,0 +1,19 @@
1
+ // Base adapter class with default no-op implementations
2
+ export class BaseHarnessOutputAdapter {
3
+ targetName;
4
+ constructor(targetName) {
5
+ this.targetName = targetName;
6
+ }
7
+ generateHookRegistration(_manifest, _targetProfile, _diagnostics) {
8
+ return null;
9
+ }
10
+ generateManifestFiles(_sourceDir, _manifest, _targetProfile, _diagnostics, _rawManifest) {
11
+ return [];
12
+ }
13
+ generateExtraTargetFiles(_sourceDir, _manifest, _targetProfile, _diagnostics) {
14
+ return [];
15
+ }
16
+ generateMcpConfig(_manifest, _targetProfile) {
17
+ return null;
18
+ }
19
+ }
@@ -0,0 +1,10 @@
1
+ import type { A5cPluginManifest, TargetProfile, TransformedFile, Diagnostic } from '../../types.js';
2
+ import { BaseHarnessOutputAdapter } from './base.js';
3
+ export declare class ClaudeCodeAdapter extends BaseHarnessOutputAdapter {
4
+ generateMcpConfig(manifest: A5cPluginManifest, _targetProfile: TargetProfile): TransformedFile | null;
5
+ generateHookRegistration(manifest: A5cPluginManifest, targetProfile: TargetProfile, _diagnostics: Diagnostic[]): TransformedFile | null;
6
+ generateManifestFiles(_sourceDir: string, manifest: A5cPluginManifest, targetProfile: TargetProfile, _diagnostics: Diagnostic[]): TransformedFile[];
7
+ }
8
+ export declare function generateClaudeCodeManifest(manifest: A5cPluginManifest): string;
9
+ export declare function generateClaudeCodeHooksJson(manifest: A5cPluginManifest, targetProfile: TargetProfile): string;
10
+ //# sourceMappingURL=claude-code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../src/targets/adapters/claude-code.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACpG,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAUrD,qBAAa,iBAAkB,SAAQ,wBAAwB;IAE7D,iBAAiB,CACf,QAAQ,EAAE,iBAAiB,EAC3B,cAAc,EAAE,aAAa,GAC5B,eAAe,GAAG,IAAI;IAMzB,wBAAwB,CACtB,QAAQ,EAAE,iBAAiB,EAC3B,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,UAAU,EAAE,GACzB,eAAe,GAAG,IAAI;IAKzB,qBAAqB,CACnB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,iBAAiB,EAC3B,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,UAAU,EAAE,GACzB,eAAe,EAAE;CAgBrB;AAQD,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAuC9E;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,iBAAiB,EAC3B,aAAa,EAAE,aAAa,GAC3B,MAAM,CAqBR"}