@rbbtsn0w/adg 0.4.0-beta.7 → 0.4.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,449 @@
1
+ import { randomUUID } from "node:crypto";
2
+ import { cpSync, existsSync, readFileSync, renameSync, rmSync, statSync } from "node:fs";
3
+ import { basename, join, resolve } from "node:path";
4
+ import { isExposed } from "../components.js";
5
+ import { writeJson, writeText } from "../fsutil.js";
6
+ const TARGET_FILE = "hooks.json";
7
+ const PROJECTION_DIR = ".antigravity-plugin";
8
+ const RUNNER_FILE = "hook-runner.mjs";
9
+ const NATIVE_OVERRIDE = "hooks-antigravity.json";
10
+ const EVENT_MAP = {
11
+ SessionStart: "PreInvocation",
12
+ PreToolUse: "PreToolUse",
13
+ PostToolUse: "PostToolUse",
14
+ Stop: "Stop",
15
+ };
16
+ const TOOL_ALIASES = {
17
+ Bash: "run_command",
18
+ Read: "view_file",
19
+ Write: "write_to_file",
20
+ Edit: "replace_file_content|multi_replace_file_content",
21
+ Glob: "find_by_name",
22
+ Grep: "grep_search",
23
+ WebSearch: "search_web",
24
+ WebFetch: "read_url_content",
25
+ Agent: "invoke_subagent",
26
+ AskUserQuestion: "ask_question",
27
+ };
28
+ const ANTIGRAVITY_TOOL_NAMES = new Set(Object.values(TOOL_ALIASES).flatMap((name) => name.split("|")));
29
+ const ANTIGRAVITY_TOOL_EVENTS = new Set(["PreToolUse", "PostToolUse"]);
30
+ const ANTIGRAVITY_DIRECT_EVENTS = new Set(["PreInvocation", "PostInvocation", "Stop"]);
31
+ function hookSources(pluginDir, manifest) {
32
+ if (!manifest.hooks)
33
+ return {};
34
+ const declared = resolve(pluginDir, manifest.hooks);
35
+ if (existsSync(declared) && statSync(declared).isDirectory()) {
36
+ const native = join(declared, NATIVE_OVERRIDE);
37
+ const canonical = join(declared, TARGET_FILE);
38
+ return {
39
+ ...(existsSync(canonical) ? { canonical } : {}),
40
+ ...(existsSync(native) ? { native } : {}),
41
+ };
42
+ }
43
+ if (basename(declared) === NATIVE_OVERRIDE)
44
+ return { native: declared };
45
+ return { canonical: declared };
46
+ }
47
+ function cleanupGenerated(pluginDir, preserveTarget = false) {
48
+ if (!preserveTarget)
49
+ rmSync(join(pluginDir, TARGET_FILE), { force: true });
50
+ rmSync(join(pluginDir, PROJECTION_DIR, RUNNER_FILE), { force: true });
51
+ }
52
+ function parseJsonFile(file, label) {
53
+ try {
54
+ return JSON.parse(readFileSync(file, "utf8"));
55
+ }
56
+ catch (error) {
57
+ throw new Error(`invalid ${label} JSON in ${file}: ${String(error)}`, { cause: error });
58
+ }
59
+ }
60
+ function isRecord(value) {
61
+ return typeof value === "object" && value !== null && !Array.isArray(value);
62
+ }
63
+ function validateNativeHandler(value, path) {
64
+ if (!isRecord(value))
65
+ throw new Error(`invalid native Antigravity hooks schema: ${path} must be an object`);
66
+ if ((value.type ?? "command") !== "command") {
67
+ throw new Error(`invalid native Antigravity hooks schema: ${path}.type must be "command"`);
68
+ }
69
+ if (typeof value.command !== "string" || !value.command.trim()) {
70
+ throw new Error(`invalid native Antigravity hooks schema: ${path}.command must be a non-empty string`);
71
+ }
72
+ if (value.timeout !== undefined && (!Number.isInteger(value.timeout) || value.timeout <= 0)) {
73
+ throw new Error(`invalid native Antigravity hooks schema: ${path}.timeout must be a positive integer`);
74
+ }
75
+ }
76
+ function validateNativeHandlers(value, path) {
77
+ if (!Array.isArray(value) || value.length === 0) {
78
+ throw new Error(`invalid native Antigravity hooks schema: ${path} must be a non-empty array`);
79
+ }
80
+ value.forEach((handler, index) => validateNativeHandler(handler, `${path}[${index}]`));
81
+ }
82
+ function validateNativeDocument(value) {
83
+ if (!isRecord(value) || Object.keys(value).length === 0) {
84
+ throw new Error("invalid native Antigravity hooks schema: root must be a non-empty object");
85
+ }
86
+ for (const [hookName, rawDefinition] of Object.entries(value)) {
87
+ if (!isRecord(rawDefinition)) {
88
+ throw new Error(`invalid native Antigravity hooks schema: hook "${hookName}" must be an object`);
89
+ }
90
+ let eventCount = 0;
91
+ for (const [field, eventValue] of Object.entries(rawDefinition)) {
92
+ if (field === "enabled") {
93
+ if (typeof eventValue !== "boolean") {
94
+ throw new Error(`invalid native Antigravity hooks schema: ${hookName}.enabled must be boolean`);
95
+ }
96
+ continue;
97
+ }
98
+ if (ANTIGRAVITY_DIRECT_EVENTS.has(field)) {
99
+ validateNativeHandlers(eventValue, `${hookName}.${field}`);
100
+ eventCount += 1;
101
+ continue;
102
+ }
103
+ if (ANTIGRAVITY_TOOL_EVENTS.has(field)) {
104
+ if (!Array.isArray(eventValue) || eventValue.length === 0) {
105
+ throw new Error(`invalid native Antigravity hooks schema: ${hookName}.${field} must be a non-empty array`);
106
+ }
107
+ eventValue.forEach((rawGroup, groupIndex) => {
108
+ const path = `${hookName}.${field}[${groupIndex}]`;
109
+ if (!isRecord(rawGroup))
110
+ throw new Error(`invalid native Antigravity hooks schema: ${path} must be an object`);
111
+ if (rawGroup.matcher !== undefined && typeof rawGroup.matcher !== "string") {
112
+ throw new Error(`invalid native Antigravity hooks schema: ${path}.matcher must be a string`);
113
+ }
114
+ validateNativeHandlers(rawGroup.hooks, `${path}.hooks`);
115
+ });
116
+ eventCount += 1;
117
+ continue;
118
+ }
119
+ throw new Error(`invalid native Antigravity hooks schema: unknown field ${hookName}.${field}`);
120
+ }
121
+ if (eventCount === 0) {
122
+ throw new Error(`invalid native Antigravity hooks schema: hook "${hookName}" declares no events`);
123
+ }
124
+ }
125
+ }
126
+ function replaceJson(file, value) {
127
+ const temporary = `${file}.${process.pid}.${randomUUID()}.tmp`;
128
+ try {
129
+ writeJson(temporary, value);
130
+ renameSync(temporary, file);
131
+ }
132
+ finally {
133
+ rmSync(temporary, { force: true });
134
+ }
135
+ }
136
+ function replaceText(file, value) {
137
+ const temporary = `${file}.${process.pid}.${randomUUID()}.tmp`;
138
+ try {
139
+ writeText(temporary, value);
140
+ renameSync(temporary, file);
141
+ }
142
+ finally {
143
+ rmSync(temporary, { force: true });
144
+ }
145
+ }
146
+ function replaceFile(file, source) {
147
+ const temporary = `${file}.${process.pid}.${randomUUID()}.tmp`;
148
+ try {
149
+ cpSync(source, temporary);
150
+ renameSync(temporary, file);
151
+ }
152
+ finally {
153
+ rmSync(temporary, { force: true });
154
+ }
155
+ }
156
+ function parseGroups(value) {
157
+ return Array.isArray(value) ? value.filter((group) => typeof group === "object" && group !== null) : [];
158
+ }
159
+ function matcherIncludesStartup(matcher) {
160
+ if (matcher === undefined || matcher === "")
161
+ return true;
162
+ if (typeof matcher !== "string")
163
+ return false;
164
+ try {
165
+ return new RegExp(`^(?:${matcher})$`).test("startup");
166
+ }
167
+ catch {
168
+ return false;
169
+ }
170
+ }
171
+ function translateToolMatcher(matcher) {
172
+ if (matcher === undefined || matcher === "" || matcher === "*")
173
+ return typeof matcher === "string" ? matcher : "";
174
+ if (typeof matcher !== "string")
175
+ return undefined;
176
+ const tokens = matcher.split("|");
177
+ if (tokens.some((token) => !/^[A-Za-z0-9_]+$/.test(token)))
178
+ return undefined;
179
+ const translated = [];
180
+ for (const token of tokens) {
181
+ const alias = TOOL_ALIASES[token];
182
+ if (alias)
183
+ translated.push(alias);
184
+ else if (ANTIGRAVITY_TOOL_NAMES.has(token))
185
+ translated.push(token);
186
+ else
187
+ return undefined;
188
+ }
189
+ return translated.join("|");
190
+ }
191
+ function runnerCommand(pluginDir, event, command) {
192
+ const encoded = Buffer.from(command, "utf8").toString("base64url");
193
+ const runner = join(resolve(pluginDir), PROJECTION_DIR, RUNNER_FILE);
194
+ const quotedRunner = process.platform === "win32"
195
+ ? `"${runner.replaceAll("/", "\\")}"`
196
+ : `'${runner.replaceAll("'", `'"'"'`)}'`;
197
+ return `node ${quotedRunner} ${event} ${encoded}`;
198
+ }
199
+ function translateHandlers(pluginDir, pluginName, event, value, warnings) {
200
+ if (!Array.isArray(value))
201
+ return [];
202
+ const translated = [];
203
+ for (const raw of value) {
204
+ if (typeof raw !== "object" || raw === null)
205
+ continue;
206
+ const handler = raw;
207
+ if ((handler.type ?? "command") !== "command") {
208
+ warnings.push(`${pluginName}: ${event} handler type "${String(handler.type)}" is not supported by antigravity`);
209
+ continue;
210
+ }
211
+ if (handler.async === true) {
212
+ warnings.push(`${pluginName}: async ${event} command handlers are not supported by antigravity`);
213
+ continue;
214
+ }
215
+ if (typeof handler.command !== "string" || !handler.command.trim()) {
216
+ warnings.push(`${pluginName}: ${event} command handler has no command`);
217
+ continue;
218
+ }
219
+ const timeout = typeof handler.timeout === "number" && Number.isInteger(handler.timeout) && handler.timeout > 0
220
+ ? handler.timeout
221
+ : 30;
222
+ translated.push({ type: "command", command: runnerCommand(pluginDir, event, handler.command), timeout });
223
+ }
224
+ return translated;
225
+ }
226
+ function translateDirectEvent(pluginDir, pluginName, event, groups, warnings) {
227
+ const handlers = [];
228
+ for (const group of groups) {
229
+ if (event === "SessionStart" && !matcherIncludesStartup(group.matcher)) {
230
+ warnings.push(`${pluginName}: SessionStart matcher "${String(group.matcher)}" has no Antigravity startup mapping`);
231
+ continue;
232
+ }
233
+ handlers.push(...translateHandlers(pluginDir, pluginName, event, group.hooks, warnings));
234
+ }
235
+ return handlers;
236
+ }
237
+ function translateToolEvent(pluginDir, pluginName, event, groups, warnings) {
238
+ const translated = [];
239
+ for (const group of groups) {
240
+ const matcher = translateToolMatcher(group.matcher);
241
+ if (matcher === undefined) {
242
+ warnings.push(`${pluginName}: ${event} matcher "${String(group.matcher)}" cannot be safely mapped to antigravity`);
243
+ continue;
244
+ }
245
+ const hooks = translateHandlers(pluginDir, pluginName, event, group.hooks, warnings);
246
+ if (hooks.length)
247
+ translated.push({ matcher, hooks });
248
+ }
249
+ return translated;
250
+ }
251
+ function translateDocument(pluginDir, pluginName, document) {
252
+ const warnings = [];
253
+ const definition = {};
254
+ const hooks = typeof document.hooks === "object" && document.hooks !== null
255
+ ? document.hooks
256
+ : {};
257
+ for (const event of Object.keys(hooks)) {
258
+ if (!(event in EVENT_MAP)) {
259
+ warnings.push(`hook event "${event}" is not a supported antigravity hook mapping — antigravity will not fire it`);
260
+ }
261
+ }
262
+ const sessionStart = translateDirectEvent(pluginDir, pluginName, "SessionStart", parseGroups(hooks.SessionStart), warnings);
263
+ if (sessionStart.length)
264
+ definition.PreInvocation = sessionStart;
265
+ const preToolUse = translateToolEvent(pluginDir, pluginName, "PreToolUse", parseGroups(hooks.PreToolUse), warnings);
266
+ if (preToolUse.length)
267
+ definition.PreToolUse = preToolUse;
268
+ const postToolUse = translateToolEvent(pluginDir, pluginName, "PostToolUse", parseGroups(hooks.PostToolUse), warnings);
269
+ if (postToolUse.length)
270
+ definition.PostToolUse = postToolUse;
271
+ const stop = translateDirectEvent(pluginDir, pluginName, "Stop", parseGroups(hooks.Stop), warnings);
272
+ if (stop.length)
273
+ definition.Stop = stop;
274
+ return { definition, warnings };
275
+ }
276
+ /** Materialize a plugin's hooks under Antigravity's required root filename and native schema. */
277
+ export function writeAntigravityHooks(pluginDir, manifest, selection) {
278
+ const target = join(pluginDir, TARGET_FILE);
279
+ const sources = hookSources(pluginDir, manifest);
280
+ const sourceIsTarget = sources.canonical !== undefined && resolve(sources.canonical) === resolve(target);
281
+ if (!isExposed(selection, "hooks") || (!sources.native && !sources.canonical)) {
282
+ cleanupGenerated(pluginDir, sourceIsTarget);
283
+ return [];
284
+ }
285
+ if (sourceIsTarget) {
286
+ rmSync(join(pluginDir, PROJECTION_DIR, RUNNER_FILE), { force: true });
287
+ return [];
288
+ }
289
+ if (sources.native) {
290
+ const document = parseJsonFile(sources.native, "native Antigravity hooks");
291
+ validateNativeDocument(document);
292
+ replaceFile(target, sources.native);
293
+ rmSync(join(pluginDir, PROJECTION_DIR, RUNNER_FILE), { force: true });
294
+ return [];
295
+ }
296
+ const document = parseJsonFile(sources.canonical, "canonical hooks");
297
+ const { definition, warnings } = translateDocument(pluginDir, manifest.name, document);
298
+ if (Object.keys(definition).length) {
299
+ const projected = { [manifest.name]: definition };
300
+ validateNativeDocument(projected);
301
+ replaceText(join(pluginDir, PROJECTION_DIR, RUNNER_FILE), HOOK_RUNNER);
302
+ replaceJson(target, projected);
303
+ }
304
+ else {
305
+ cleanupGenerated(pluginDir);
306
+ }
307
+ return warnings;
308
+ }
309
+ const HOOK_RUNNER = String.raw `import { spawnSync } from "node:child_process";
310
+ import { readFileSync } from "node:fs";
311
+ import { dirname, resolve } from "node:path";
312
+ import { fileURLToPath } from "node:url";
313
+
314
+ const [event, encodedCommand] = process.argv.slice(2);
315
+ const rawInput = readFileSync(0, "utf8");
316
+ let input;
317
+ try {
318
+ input = rawInput.trim() ? JSON.parse(rawInput) : {};
319
+ } catch (error) {
320
+ fail("invalid Antigravity hook input", error);
321
+ }
322
+
323
+ if (event === "SessionStart" && input.invocationNum !== 0) {
324
+ emit({});
325
+ process.exit(0);
326
+ }
327
+
328
+ const pluginRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
329
+ const command = Buffer.from(encodedCommand, "base64url").toString("utf8")
330
+ .replaceAll("$" + "{CLAUDE_PLUGIN_ROOT}", pluginRoot)
331
+ .replaceAll("$" + "{PLUGIN_ROOT}", pluginRoot);
332
+ const childInput = claudeInput(event, input);
333
+ const child = spawnSync(command, {
334
+ cwd: pluginRoot,
335
+ env: { ...process.env, CLAUDE_PLUGIN_ROOT: pluginRoot, PLUGIN_ROOT: pluginRoot },
336
+ input: JSON.stringify(childInput),
337
+ encoding: "utf8",
338
+ shell: true,
339
+ maxBuffer: 10 * 1024 * 1024,
340
+ });
341
+ if (child.stderr) process.stderr.write(child.stderr);
342
+ if (child.error) fail("failed to launch hook command", child.error);
343
+ if (child.status !== 0) process.exit(child.status ?? 1);
344
+
345
+ const output = parseOutput(event, child.stdout);
346
+ emit(antigravityOutput(event, output));
347
+
348
+ function claudeInput(hookEvent, source) {
349
+ const common = {
350
+ ...source,
351
+ session_id: source.conversationId,
352
+ transcript_path: source.transcriptPath,
353
+ cwd: source.workspacePaths?.[0] ?? pluginRoot,
354
+ hook_event_name: hookEvent,
355
+ };
356
+ if (hookEvent === "SessionStart") return { ...common, source: "startup" };
357
+ if (hookEvent === "PreToolUse" || hookEvent === "PostToolUse") {
358
+ return {
359
+ ...common,
360
+ tool_name: claudeToolName(source.toolCall?.name),
361
+ tool_input: source.toolCall?.args ?? {},
362
+ tool_response: source.toolCall?.result,
363
+ };
364
+ }
365
+ if (hookEvent === "Stop") return { ...common, stop_hook_active: false };
366
+ return common;
367
+ }
368
+
369
+ function claudeToolName(name) {
370
+ return ({
371
+ run_command: "Bash",
372
+ view_file: "Read",
373
+ write_to_file: "Write",
374
+ replace_file_content: "Edit",
375
+ multi_replace_file_content: "Edit",
376
+ find_by_name: "Glob",
377
+ grep_search: "Grep",
378
+ search_web: "WebSearch",
379
+ read_url_content: "WebFetch",
380
+ invoke_subagent: "Agent",
381
+ ask_question: "AskUserQuestion",
382
+ })[name] ?? name;
383
+ }
384
+
385
+ function parseOutput(hookEvent, stdout) {
386
+ const text = stdout.trim();
387
+ if (!text) return {};
388
+ try {
389
+ return JSON.parse(text);
390
+ } catch (error) {
391
+ if (hookEvent === "SessionStart") return { additionalContext: text };
392
+ fail("hook command returned invalid JSON", error);
393
+ }
394
+ }
395
+
396
+ function antigravityOutput(hookEvent, output) {
397
+ if (output.continue === false) {
398
+ const reason = output.stopReason ?? output.reason ?? "Claude hook stopped processing";
399
+ if (hookEvent === "PreToolUse") return { decision: "deny", reason };
400
+ if (hookEvent === "Stop") return { decision: "stop" };
401
+ fail(hookEvent + " continue:false output has no safe Antigravity mapping", reason);
402
+ }
403
+ if (hookEvent === "SessionStart") {
404
+ if (Array.isArray(output.injectSteps)) return output;
405
+ const context = output.hookSpecificOutput?.additionalContext
406
+ ?? output.additionalContext
407
+ ?? output.additional_context;
408
+ return typeof context === "string" && context ? { injectSteps: [{ ephemeralMessage: context }] } : {};
409
+ }
410
+ if (hookEvent === "PreToolUse") {
411
+ const specific = output.hookSpecificOutput ?? {};
412
+ const decision = specific.permissionDecision ?? output.permissionDecision ?? output.decision;
413
+ const reason = specific.permissionDecisionReason ?? output.reason;
414
+ if (specific.updatedInput !== undefined) {
415
+ process.stderr.write("antigravity hook bridge: Claude updatedInput is unsupported; requesting confirmation\n");
416
+ return { decision: "ask", reason: reason ?? "Hook requested a tool-input change that Antigravity cannot apply" };
417
+ }
418
+ if (decision === "deny" || decision === "block") return { decision: "deny", ...(reason ? { reason } : {}) };
419
+ if (decision === "allow" || decision === "approve") return { decision: "allow", ...(reason ? { reason } : {}) };
420
+ if (decision === "ask") return { decision: "ask", ...(reason ? { reason } : {}) };
421
+ if (decision === "defer") {
422
+ process.stderr.write("antigravity hook bridge: Claude defer is unsupported; requesting confirmation\n");
423
+ return { decision: "ask", reason: reason ?? "Hook deferred to Antigravity's permission flow" };
424
+ }
425
+ return { decision: "allow", ...(reason ? { reason } : {}) };
426
+ }
427
+ if (hookEvent === "PostToolUse") {
428
+ if (output.decision === "block") {
429
+ fail("PostToolUse block output has no safe Antigravity mapping", output.reason ?? "block");
430
+ }
431
+ return {};
432
+ }
433
+ if (hookEvent === "Stop") {
434
+ return output.decision === "block"
435
+ ? { decision: "continue", ...(output.reason ? { reason: output.reason } : {}) }
436
+ : { decision: "stop" };
437
+ }
438
+ return {};
439
+ }
440
+
441
+ function emit(value) {
442
+ process.stdout.write(JSON.stringify(value) + "\n");
443
+ }
444
+
445
+ function fail(message, error) {
446
+ process.stderr.write("antigravity hook bridge: " + message + ": " + String(error) + "\n");
447
+ process.exit(1);
448
+ }
449
+ `;
@@ -1,20 +1,29 @@
1
- import { join } from "node:path";
1
+ import { cpSync, existsSync, rmSync } from "node:fs";
2
+ import { join, resolve } from "node:path";
2
3
  import { isExposed } from "../components.js";
3
4
  import { mcpConfigPath } from "../mcp.js";
4
- /** Projection subdirectory that holds the self-contained agy plugin root. */
5
- export const ANTIGRAVITY_PROJECTION_DIR = ".antigravity-plugin";
5
+ export const ANTIGRAVITY_MCP_CONFIG = "mcp_config.json";
6
6
  /**
7
7
  * Generate an Antigravity (`agy`) plugin.json from an ADG manifest.
8
8
  *
9
- * Antigravity reads the same plugin.json MCP pointer shape as the other plugin
10
- * runtimes (`mcpServers`). The agent-side projection still materializes a
11
- * self-contained root for partial installs by copying the referenced file next
12
- * to plugin.json and linking selected component dirs.
9
+ * Antigravity discovers a plugin by scanning a directory for a root `plugin.json`
10
+ * plus sibling component dirs and `mcp_config.json`, so the manifest is emitted
11
+ * at the plugin folder root and contains only the plugin name.
13
12
  */
14
- export function toAntigravityManifest(_pluginDir, manifest, selection) {
15
- const out = { name: manifest.name };
13
+ export function toAntigravityManifest(_pluginDir, manifest, _selection) {
14
+ return { defaultPath: "plugin.json", manifest: { name: manifest.name } };
15
+ }
16
+ /** Materialize ADG's MCP pointer under Antigravity's required conventional name. */
17
+ export function writeAntigravityMcpConfig(pluginDir, manifest, selection) {
18
+ const target = join(pluginDir, ANTIGRAVITY_MCP_CONFIG);
16
19
  const mcp = mcpConfigPath(manifest);
17
- if (mcp && isExposed(selection, "mcp"))
18
- out.mcpServers = mcp;
19
- return { defaultPath: join(ANTIGRAVITY_PROJECTION_DIR, "plugin.json"), manifest: out };
20
+ const source = mcp ? resolve(pluginDir, mcp) : undefined;
21
+ // An authored mcp_config.json is already the canonical payload, not a
22
+ // generated projection. Never remove or copy it onto itself.
23
+ if (source === resolve(target))
24
+ return;
25
+ rmSync(target, { force: true });
26
+ if (source && isExposed(selection, "mcp") && existsSync(source)) {
27
+ cpSync(source, target);
28
+ }
20
29
  }
@@ -18,7 +18,7 @@ export const ADAPTER_TARGETS = ["claude", "codex", "antigravity"];
18
18
  * the adapters emit: the Claude manifest carries skills/agents/commands/hooks/mcp
19
19
  * plus apps (`toAnthropicManifest`), while Codex consumes skills/hooks/mcp
20
20
  * (`toCodexManifest`). Antigravity (`agy`) discovers components by convention
21
- * (skills/agents/commands/hooks dirs + plugin.json pointers) and does not surface
21
+ * (skills/agents/commands/hooks dirs + `mcp_config.json`) and does not surface
22
22
  * apps, so apps maps only to the Claude target. Used to derive which agents a
23
23
  * plugin is adaptable to from its exposed component types.
24
24
  */