@ai-plugin-marketplace/core 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +67 -0
- package/dist/config.d.ts +47 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +38 -0
- package/dist/config.js.map +1 -0
- package/dist/core.d.ts +291 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/pipeline/build.d.ts +90 -0
- package/dist/pipeline/build.d.ts.map +1 -0
- package/dist/pipeline/build.js +224 -0
- package/dist/pipeline/build.js.map +1 -0
- package/dist/pipeline/discover.d.ts +37 -0
- package/dist/pipeline/discover.d.ts.map +1 -0
- package/dist/pipeline/discover.js +71 -0
- package/dist/pipeline/discover.js.map +1 -0
- package/dist/pipeline/init-template.d.ts +33 -0
- package/dist/pipeline/init-template.d.ts.map +1 -0
- package/dist/pipeline/init-template.js +142 -0
- package/dist/pipeline/init-template.js.map +1 -0
- package/dist/pipeline/init.d.ts +39 -0
- package/dist/pipeline/init.d.ts.map +1 -0
- package/dist/pipeline/init.js +84 -0
- package/dist/pipeline/init.js.map +1 -0
- package/dist/pipeline/load-config.d.ts +47 -0
- package/dist/pipeline/load-config.d.ts.map +1 -0
- package/dist/pipeline/load-config.js +106 -0
- package/dist/pipeline/load-config.js.map +1 -0
- package/dist/pipeline/operations.d.ts +70 -0
- package/dist/pipeline/operations.d.ts.map +1 -0
- package/dist/pipeline/operations.js +100 -0
- package/dist/pipeline/operations.js.map +1 -0
- package/dist/pipeline/scaffold.d.ts +105 -0
- package/dist/pipeline/scaffold.d.ts.map +1 -0
- package/dist/pipeline/scaffold.js +422 -0
- package/dist/pipeline/scaffold.js.map +1 -0
- package/dist/pipeline/sentinel.d.ts +127 -0
- package/dist/pipeline/sentinel.d.ts.map +1 -0
- package/dist/pipeline/sentinel.js +263 -0
- package/dist/pipeline/sentinel.js.map +1 -0
- package/dist/pipeline/types.d.ts +178 -0
- package/dist/pipeline/types.d.ts.map +1 -0
- package/dist/pipeline/types.js +26 -0
- package/dist/pipeline/types.js.map +1 -0
- package/dist/pipeline/validate.d.ts +90 -0
- package/dist/pipeline/validate.d.ts.map +1 -0
- package/dist/pipeline/validate.js +617 -0
- package/dist/pipeline/validate.js.map +1 -0
- package/dist/targets/claude/scaffold.d.ts +32 -0
- package/dist/targets/claude/scaffold.d.ts.map +1 -0
- package/dist/targets/claude/scaffold.js +48 -0
- package/dist/targets/claude/scaffold.js.map +1 -0
- package/dist/targets/claude/schemas.d.ts +119 -0
- package/dist/targets/claude/schemas.d.ts.map +1 -0
- package/dist/targets/claude/schemas.js +204 -0
- package/dist/targets/claude/schemas.js.map +1 -0
- package/dist/targets/claude/transform.d.ts +40 -0
- package/dist/targets/claude/transform.d.ts.map +1 -0
- package/dist/targets/claude/transform.js +48 -0
- package/dist/targets/claude/transform.js.map +1 -0
- package/dist/targets/claude/validate.d.ts +25 -0
- package/dist/targets/claude/validate.d.ts.map +1 -0
- package/dist/targets/claude/validate.js +263 -0
- package/dist/targets/claude/validate.js.map +1 -0
- package/dist/targets/cursor/scaffold.d.ts +29 -0
- package/dist/targets/cursor/scaffold.d.ts.map +1 -0
- package/dist/targets/cursor/scaffold.js +45 -0
- package/dist/targets/cursor/scaffold.js.map +1 -0
- package/dist/targets/cursor/schemas.d.ts +49 -0
- package/dist/targets/cursor/schemas.d.ts.map +1 -0
- package/dist/targets/cursor/schemas.js +125 -0
- package/dist/targets/cursor/schemas.js.map +1 -0
- package/dist/targets/cursor/validate.d.ts +28 -0
- package/dist/targets/cursor/validate.d.ts.map +1 -0
- package/dist/targets/cursor/validate.js +181 -0
- package/dist/targets/cursor/validate.js.map +1 -0
- package/dist/targets/gemini/bundle.d.ts +25 -0
- package/dist/targets/gemini/bundle.d.ts.map +1 -0
- package/dist/targets/gemini/bundle.js +149 -0
- package/dist/targets/gemini/bundle.js.map +1 -0
- package/dist/targets/gemini/scaffold.d.ts +28 -0
- package/dist/targets/gemini/scaffold.d.ts.map +1 -0
- package/dist/targets/gemini/scaffold.js +57 -0
- package/dist/targets/gemini/scaffold.js.map +1 -0
- package/dist/targets/gemini/schemas.d.ts +53 -0
- package/dist/targets/gemini/schemas.d.ts.map +1 -0
- package/dist/targets/gemini/schemas.js +72 -0
- package/dist/targets/gemini/schemas.js.map +1 -0
- package/dist/targets/gemini/transform.d.ts +106 -0
- package/dist/targets/gemini/transform.d.ts.map +1 -0
- package/dist/targets/gemini/transform.js +137 -0
- package/dist/targets/gemini/transform.js.map +1 -0
- package/dist/targets/gemini/validate.d.ts +26 -0
- package/dist/targets/gemini/validate.d.ts.map +1 -0
- package/dist/targets/gemini/validate.js +146 -0
- package/dist/targets/gemini/validate.js.map +1 -0
- package/dist/targets/kiro/bundle.d.ts +32 -0
- package/dist/targets/kiro/bundle.d.ts.map +1 -0
- package/dist/targets/kiro/bundle.js +106 -0
- package/dist/targets/kiro/bundle.js.map +1 -0
- package/dist/targets/kiro/scaffold.d.ts +28 -0
- package/dist/targets/kiro/scaffold.d.ts.map +1 -0
- package/dist/targets/kiro/scaffold.js +55 -0
- package/dist/targets/kiro/scaffold.js.map +1 -0
- package/dist/targets/kiro/schemas.d.ts +100 -0
- package/dist/targets/kiro/schemas.d.ts.map +1 -0
- package/dist/targets/kiro/schemas.js +147 -0
- package/dist/targets/kiro/schemas.js.map +1 -0
- package/dist/targets/kiro/transform.d.ts +53 -0
- package/dist/targets/kiro/transform.d.ts.map +1 -0
- package/dist/targets/kiro/transform.js +113 -0
- package/dist/targets/kiro/transform.js.map +1 -0
- package/dist/targets/kiro/validate.d.ts +36 -0
- package/dist/targets/kiro/validate.d.ts.map +1 -0
- package/dist/targets/kiro/validate.js +232 -0
- package/dist/targets/kiro/validate.js.map +1 -0
- package/dist/targets/scaffold-kit.d.ts +56 -0
- package/dist/targets/scaffold-kit.d.ts.map +1 -0
- package/dist/targets/scaffold-kit.js +33 -0
- package/dist/targets/scaffold-kit.js.map +1 -0
- package/dist/targets/vercel/scaffold.d.ts +34 -0
- package/dist/targets/vercel/scaffold.d.ts.map +1 -0
- package/dist/targets/vercel/scaffold.js +58 -0
- package/dist/targets/vercel/scaffold.js.map +1 -0
- package/dist/targets/vercel/schemas.d.ts +42 -0
- package/dist/targets/vercel/schemas.d.ts.map +1 -0
- package/dist/targets/vercel/schemas.js +69 -0
- package/dist/targets/vercel/schemas.js.map +1 -0
- package/dist/targets/vercel/validate.d.ts +28 -0
- package/dist/targets/vercel/validate.d.ts.map +1 -0
- package/dist/targets/vercel/validate.js +180 -0
- package/dist/targets/vercel/validate.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scaffold templates for the Kiro target.
|
|
3
|
+
*
|
|
4
|
+
* `scaffoldKiroFiles` is a pure function returning the skeleton files this target contributes to
|
|
5
|
+
* a new plugin: `POWER.md`, a Markdown file whose YAML frontmatter is Kiro's plugin manifest.
|
|
6
|
+
* The frontmatter carries `schemaVersion: "0.1.0"` (§12.2). No generated-file sentinels — this is
|
|
7
|
+
* an author-authored skeleton file (§4.3).
|
|
8
|
+
*
|
|
9
|
+
* This module must not import from any sibling targets/<other>/ folder (§3.4).
|
|
10
|
+
*
|
|
11
|
+
* @see docs/specs/architecture.md §4 (plugin source layout)
|
|
12
|
+
* @see docs/specs/architecture.md §6.4 (compatibility-assist)
|
|
13
|
+
* @see docs/specs/architecture.md §12.2 (schemaVersion on every manifest)
|
|
14
|
+
* @see docs/specs/architecture.md §12.5 (per-target scaffold.ts)
|
|
15
|
+
*/
|
|
16
|
+
import { resolveDescription, SCHEMA_VERSION, } from '../scaffold-kit.js';
|
|
17
|
+
/** Identity tag enabling editor highlighting of the embedded Markdown body. */
|
|
18
|
+
const md = String.raw;
|
|
19
|
+
/**
|
|
20
|
+
* Produce the Kiro skeleton files for a plugin.
|
|
21
|
+
*
|
|
22
|
+
* The minimum required artifact (`TARGET_MIN_REQUIRED.kiro`) is `POWER.md`. Its frontmatter
|
|
23
|
+
* satisfies `kiroPowerMdFrontmatterSchema` (`name`, `description`, `version` all required).
|
|
24
|
+
*
|
|
25
|
+
* @param pluginName - Plugin identity; written verbatim as the frontmatter `name`.
|
|
26
|
+
* @param opts - Optional description and add-target placeholder behaviour.
|
|
27
|
+
* @returns Files contributed by this target, with paths relative to the plugin directory.
|
|
28
|
+
*/
|
|
29
|
+
export function scaffoldKiroFiles(pluginName, opts = {}) {
|
|
30
|
+
const description = resolveDescription(pluginName, opts);
|
|
31
|
+
// Frontmatter requires `description` to be present (not optional). In placeholder mode we emit
|
|
32
|
+
// an empty value, leaving the field for the author per §6.4. JSON.stringify on the value keeps
|
|
33
|
+
// the YAML scalar correctly quoted/escaped regardless of content.
|
|
34
|
+
const content = md `---
|
|
35
|
+
schemaVersion: ${SCHEMA_VERSION}
|
|
36
|
+
name: ${pluginName}
|
|
37
|
+
description: ${JSON.stringify(description)}
|
|
38
|
+
version: 0.0.1
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
# ${pluginName}
|
|
42
|
+
|
|
43
|
+
${description}
|
|
44
|
+
|
|
45
|
+
## Capabilities
|
|
46
|
+
|
|
47
|
+
- **[Capability name]**: [Description of what this capability does]
|
|
48
|
+
|
|
49
|
+
## Related Files
|
|
50
|
+
|
|
51
|
+
- \`steering/\` — Steering files for Kiro
|
|
52
|
+
`;
|
|
53
|
+
return [{ path: 'POWER.md', content }];
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=scaffold.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../../src/targets/kiro/scaffold.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,kBAAkB,EAClB,cAAc,GAGf,MAAM,oBAAoB,CAAC;AAE5B,+EAA+E;AAC/E,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC;AAEtB;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAC/B,UAAkB,EAClB,OAA8B,EAAE;IAEhC,MAAM,WAAW,GAAG,kBAAkB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAEzD,+FAA+F;IAC/F,+FAA+F;IAC/F,kEAAkE;IAClE,MAAM,OAAO,GAAG,EAAE,CAAA;iBACH,cAAc;QACvB,UAAU;eACH,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;;;;IAItC,UAAU;;EAEZ,WAAW;;;;;;;;;CASZ,CAAC;IAEA,OAAO,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for the Kiro target.
|
|
3
|
+
*
|
|
4
|
+
* These are faithful, non-breaking ports of the JSON Schema contracts that the template
|
|
5
|
+
* repository has used in practice. Per §13 Phase A of the architecture spec, no schema
|
|
6
|
+
* breaking changes are introduced here — this is a mechanical port only.
|
|
7
|
+
*
|
|
8
|
+
* Strictness policy:
|
|
9
|
+
* - `.loose()` is used on `kiroPowerMdFrontmatterSchema` because POWER.md frontmatter is
|
|
10
|
+
* free-form markdown context where authors may add platform-specific keys.
|
|
11
|
+
* - `.strict()` is used on `kiroAgentConfigSchema` because it is a generated file — unknown
|
|
12
|
+
* fields indicate a bug in the generator.
|
|
13
|
+
* - `kiroMcpConfigSchema` is strict at the top level; server entries are strict.
|
|
14
|
+
*
|
|
15
|
+
* schemaVersion: every top-level manifest schema accepts `schemaVersion` as an optional
|
|
16
|
+
* unvalidated string per §9.4 and §12.2. Validators do not check it in v0.1.0; it is reserved
|
|
17
|
+
* for future migrex adoption.
|
|
18
|
+
*
|
|
19
|
+
* @see docs/specs/architecture.md §3.4, §7.2, §9.4, §12.2, §13 Phase A
|
|
20
|
+
*/
|
|
21
|
+
import { z } from 'zod';
|
|
22
|
+
/**
|
|
23
|
+
* The canonical set of Kiro CLI tool names, derived from the CLAUDE_TO_KIRO_TOOLS mapping
|
|
24
|
+
* in build-standalone.ts of the template repository.
|
|
25
|
+
*
|
|
26
|
+
* Stage 3's transform layer consumes this for tool-name validation. Exporting from the
|
|
27
|
+
* schema module keeps the data colocated with the authoritative type definitions.
|
|
28
|
+
*/
|
|
29
|
+
export declare const KIRO_TOOL_NAMES: readonly ["read", "write", "grep", "glob", "shell", "delegate"];
|
|
30
|
+
/** Union type of all valid Kiro CLI tool names. */
|
|
31
|
+
export type KiroToolName = (typeof KIRO_TOOL_NAMES)[number];
|
|
32
|
+
/**
|
|
33
|
+
* Schema for the YAML frontmatter of `POWER.md` — Kiro's plugin-level context file.
|
|
34
|
+
*
|
|
35
|
+
* Required fields are `name`, `description`, and `version`, mirroring the checks in
|
|
36
|
+
* `validatePowerMdFrontmatter` in validate.ts of the template repository.
|
|
37
|
+
*
|
|
38
|
+
* NOTE: `.loose()` is intentional here — frontmatter is free-form Markdown context and
|
|
39
|
+
* authors may add platform-specific keys (e.g. `tags`, `homepage`). The schema validates
|
|
40
|
+
* the required minimum; unknown keys pass through.
|
|
41
|
+
*/
|
|
42
|
+
export declare const kiroPowerMdFrontmatterSchema: z.ZodObject<{
|
|
43
|
+
schemaVersion: z.ZodOptional<z.ZodString>;
|
|
44
|
+
name: z.ZodString;
|
|
45
|
+
description: z.ZodString;
|
|
46
|
+
version: z.ZodString;
|
|
47
|
+
}, z.core.$loose>;
|
|
48
|
+
/**
|
|
49
|
+
* Schema for Kiro's `mcp.json`.
|
|
50
|
+
*
|
|
51
|
+
* Top-level `{ mcpServers: Record<string, KiroMcpServer> }`. Strict at the top level.
|
|
52
|
+
* `schemaVersion` accepted but not validated per §9.4 / §12.2.
|
|
53
|
+
*/
|
|
54
|
+
export declare const kiroMcpConfigSchema: z.ZodObject<{
|
|
55
|
+
schemaVersion: z.ZodOptional<z.ZodString>;
|
|
56
|
+
mcpServers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
57
|
+
command: z.ZodString;
|
|
58
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
59
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
60
|
+
}, z.core.$strict>>;
|
|
61
|
+
}, z.core.$strict>;
|
|
62
|
+
/**
|
|
63
|
+
* Schema for `.kiro/agents/<name>.json` — the Kiro agent configuration file produced by
|
|
64
|
+
* `buildKiroAgentJson` in build-standalone.ts of the template repository.
|
|
65
|
+
*
|
|
66
|
+
* NOTE: `.strict()` is intentional — this is a generated file and unexpected fields indicate
|
|
67
|
+
* a bug in the generator. Tool-name validation (`tools`, `allowedTools`) is intentionally
|
|
68
|
+
* deferred to Stage 3's transform layer; the schema accepts any `string[]` here.
|
|
69
|
+
*
|
|
70
|
+
* Field sources (from buildKiroAgentJson):
|
|
71
|
+
* name — string from frontmatter or filename
|
|
72
|
+
* description — string from frontmatter or ""
|
|
73
|
+
* prompt — trimmed body content
|
|
74
|
+
* mcpServers — always {} at generation time
|
|
75
|
+
* tools — translated Kiro tool names (string[])
|
|
76
|
+
* toolAliases — always {}
|
|
77
|
+
* allowedTools — always []
|
|
78
|
+
* resources — always []
|
|
79
|
+
* hooks — always {}
|
|
80
|
+
* toolsSettings — always {}
|
|
81
|
+
* includeMcpJson — always true
|
|
82
|
+
* model — null or string from frontmatter
|
|
83
|
+
*/
|
|
84
|
+
export declare const kiroAgentConfigSchema: z.ZodObject<{
|
|
85
|
+
schemaVersion: z.ZodOptional<z.ZodString>;
|
|
86
|
+
name: z.ZodString;
|
|
87
|
+
description: z.ZodString;
|
|
88
|
+
prompt: z.ZodString;
|
|
89
|
+
mcpServers: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
90
|
+
tools: z.ZodArray<z.ZodString>;
|
|
91
|
+
toolAliases: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
92
|
+
allowedTools: z.ZodArray<z.ZodString>;
|
|
93
|
+
resources: z.ZodArray<z.ZodUnknown>;
|
|
94
|
+
hooks: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
95
|
+
toolsSettings: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
96
|
+
includeMcpJson: z.ZodBoolean;
|
|
97
|
+
model: z.ZodNullable<z.ZodString>;
|
|
98
|
+
}, z.core.$strict>;
|
|
99
|
+
export type KiroAgentConfig = z.infer<typeof kiroAgentConfigSchema>;
|
|
100
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/targets/kiro/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,iEAAkE,CAAC;AAE/F,mDAAmD;AACnD,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAM5D;;;;;;;;;GASG;AACH,eAAO,MAAM,4BAA4B;;;;;iBAc/B,CAAC;AAoBX;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;;;kBAOrB,CAAC;AAMZ;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;kBA8CvB,CAAC;AAEZ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for the Kiro target.
|
|
3
|
+
*
|
|
4
|
+
* These are faithful, non-breaking ports of the JSON Schema contracts that the template
|
|
5
|
+
* repository has used in practice. Per §13 Phase A of the architecture spec, no schema
|
|
6
|
+
* breaking changes are introduced here — this is a mechanical port only.
|
|
7
|
+
*
|
|
8
|
+
* Strictness policy:
|
|
9
|
+
* - `.loose()` is used on `kiroPowerMdFrontmatterSchema` because POWER.md frontmatter is
|
|
10
|
+
* free-form markdown context where authors may add platform-specific keys.
|
|
11
|
+
* - `.strict()` is used on `kiroAgentConfigSchema` because it is a generated file — unknown
|
|
12
|
+
* fields indicate a bug in the generator.
|
|
13
|
+
* - `kiroMcpConfigSchema` is strict at the top level; server entries are strict.
|
|
14
|
+
*
|
|
15
|
+
* schemaVersion: every top-level manifest schema accepts `schemaVersion` as an optional
|
|
16
|
+
* unvalidated string per §9.4 and §12.2. Validators do not check it in v0.1.0; it is reserved
|
|
17
|
+
* for future migrex adoption.
|
|
18
|
+
*
|
|
19
|
+
* @see docs/specs/architecture.md §3.4, §7.2, §9.4, §12.2, §13 Phase A
|
|
20
|
+
*/
|
|
21
|
+
import { z } from 'zod';
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
// Canonical Kiro tool names
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
/**
|
|
26
|
+
* The canonical set of Kiro CLI tool names, derived from the CLAUDE_TO_KIRO_TOOLS mapping
|
|
27
|
+
* in build-standalone.ts of the template repository.
|
|
28
|
+
*
|
|
29
|
+
* Stage 3's transform layer consumes this for tool-name validation. Exporting from the
|
|
30
|
+
* schema module keeps the data colocated with the authoritative type definitions.
|
|
31
|
+
*/
|
|
32
|
+
export const KIRO_TOOL_NAMES = ['read', 'write', 'grep', 'glob', 'shell', 'delegate'];
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
// kiroPowerMdFrontmatterSchema
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
/**
|
|
37
|
+
* Schema for the YAML frontmatter of `POWER.md` — Kiro's plugin-level context file.
|
|
38
|
+
*
|
|
39
|
+
* Required fields are `name`, `description`, and `version`, mirroring the checks in
|
|
40
|
+
* `validatePowerMdFrontmatter` in validate.ts of the template repository.
|
|
41
|
+
*
|
|
42
|
+
* NOTE: `.loose()` is intentional here — frontmatter is free-form Markdown context and
|
|
43
|
+
* authors may add platform-specific keys (e.g. `tags`, `homepage`). The schema validates
|
|
44
|
+
* the required minimum; unknown keys pass through.
|
|
45
|
+
*/
|
|
46
|
+
export const kiroPowerMdFrontmatterSchema = z
|
|
47
|
+
.object({
|
|
48
|
+
/** Reserved for future migrex adoption. Accepted but not validated in v0.1.0. */
|
|
49
|
+
schemaVersion: z.string().optional(),
|
|
50
|
+
/** Plugin name — must match the directory name. */
|
|
51
|
+
name: z.string(),
|
|
52
|
+
/** What this plugin does. */
|
|
53
|
+
description: z.string(),
|
|
54
|
+
/** Semantic version string. */
|
|
55
|
+
version: z.string(),
|
|
56
|
+
})
|
|
57
|
+
.loose();
|
|
58
|
+
// ---------------------------------------------------------------------------
|
|
59
|
+
// kiroMcpConfigSchema
|
|
60
|
+
// ---------------------------------------------------------------------------
|
|
61
|
+
/**
|
|
62
|
+
* Schema for a single Kiro MCP server entry.
|
|
63
|
+
*
|
|
64
|
+
* Same shape as the Claude `.mcp.json` server entry but modelled independently per the spec —
|
|
65
|
+
* Kiro's `mcp.json` is a separate file from Claude's `.mcp.json`.
|
|
66
|
+
*/
|
|
67
|
+
const kiroMcpServerSchema = z
|
|
68
|
+
.object({
|
|
69
|
+
command: z.string(),
|
|
70
|
+
args: z.array(z.string()).optional(),
|
|
71
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
72
|
+
})
|
|
73
|
+
.strict();
|
|
74
|
+
/**
|
|
75
|
+
* Schema for Kiro's `mcp.json`.
|
|
76
|
+
*
|
|
77
|
+
* Top-level `{ mcpServers: Record<string, KiroMcpServer> }`. Strict at the top level.
|
|
78
|
+
* `schemaVersion` accepted but not validated per §9.4 / §12.2.
|
|
79
|
+
*/
|
|
80
|
+
export const kiroMcpConfigSchema = z
|
|
81
|
+
.object({
|
|
82
|
+
/** Reserved for future migrex adoption. Accepted but not validated in v0.1.0. */
|
|
83
|
+
schemaVersion: z.string().optional(),
|
|
84
|
+
mcpServers: z.record(z.string(), kiroMcpServerSchema),
|
|
85
|
+
})
|
|
86
|
+
.strict();
|
|
87
|
+
// ---------------------------------------------------------------------------
|
|
88
|
+
// kiroAgentConfigSchema
|
|
89
|
+
// ---------------------------------------------------------------------------
|
|
90
|
+
/**
|
|
91
|
+
* Schema for `.kiro/agents/<name>.json` — the Kiro agent configuration file produced by
|
|
92
|
+
* `buildKiroAgentJson` in build-standalone.ts of the template repository.
|
|
93
|
+
*
|
|
94
|
+
* NOTE: `.strict()` is intentional — this is a generated file and unexpected fields indicate
|
|
95
|
+
* a bug in the generator. Tool-name validation (`tools`, `allowedTools`) is intentionally
|
|
96
|
+
* deferred to Stage 3's transform layer; the schema accepts any `string[]` here.
|
|
97
|
+
*
|
|
98
|
+
* Field sources (from buildKiroAgentJson):
|
|
99
|
+
* name — string from frontmatter or filename
|
|
100
|
+
* description — string from frontmatter or ""
|
|
101
|
+
* prompt — trimmed body content
|
|
102
|
+
* mcpServers — always {} at generation time
|
|
103
|
+
* tools — translated Kiro tool names (string[])
|
|
104
|
+
* toolAliases — always {}
|
|
105
|
+
* allowedTools — always []
|
|
106
|
+
* resources — always []
|
|
107
|
+
* hooks — always {}
|
|
108
|
+
* toolsSettings — always {}
|
|
109
|
+
* includeMcpJson — always true
|
|
110
|
+
* model — null or string from frontmatter
|
|
111
|
+
*/
|
|
112
|
+
export const kiroAgentConfigSchema = z
|
|
113
|
+
.object({
|
|
114
|
+
/** Reserved for future migrex adoption. Accepted but not validated in v0.1.0. */
|
|
115
|
+
schemaVersion: z.string().optional(),
|
|
116
|
+
/** Agent display name. */
|
|
117
|
+
name: z.string(),
|
|
118
|
+
/** What this agent does. */
|
|
119
|
+
description: z.string(),
|
|
120
|
+
/** The agent's system prompt (from the .md body). */
|
|
121
|
+
prompt: z.string(),
|
|
122
|
+
/** MCP server configuration. Opaque at this layer. */
|
|
123
|
+
mcpServers: z.record(z.string(), z.unknown()),
|
|
124
|
+
/**
|
|
125
|
+
* Kiro tool names the agent may use. Accepted as unvalidated strings — the Kiro tool
|
|
126
|
+
* enum is enforced in Stage 3's transform layer, not here.
|
|
127
|
+
*/
|
|
128
|
+
tools: z.array(z.string()),
|
|
129
|
+
/** Tool aliases. Opaque at this layer. */
|
|
130
|
+
toolAliases: z.record(z.string(), z.unknown()),
|
|
131
|
+
/**
|
|
132
|
+
* Allowed tools list. Unvalidated strings per the same rationale as `tools`.
|
|
133
|
+
*/
|
|
134
|
+
allowedTools: z.array(z.string()),
|
|
135
|
+
/** Resource references. Opaque at this layer. */
|
|
136
|
+
resources: z.array(z.unknown()),
|
|
137
|
+
/** Hook configuration. Opaque at this layer. */
|
|
138
|
+
hooks: z.record(z.string(), z.unknown()),
|
|
139
|
+
/** Per-tool settings. Opaque at this layer. */
|
|
140
|
+
toolsSettings: z.record(z.string(), z.unknown()),
|
|
141
|
+
/** Whether to include the adjacent mcp.json file. */
|
|
142
|
+
includeMcpJson: z.boolean(),
|
|
143
|
+
/** Model hint, or null if not specified. */
|
|
144
|
+
model: z.string().nullable(),
|
|
145
|
+
})
|
|
146
|
+
.strict();
|
|
147
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/targets/kiro/schemas.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mechanical transformations for the Kiro target.
|
|
3
|
+
*
|
|
4
|
+
* Per spec §7.1, this module is a pure function driven by a committed lookup
|
|
5
|
+
* table, bounded to a single target. No I/O occurs here.
|
|
6
|
+
*
|
|
7
|
+
* @see docs/specs/architecture.md §7, §7.1, §12.4, §12.5
|
|
8
|
+
*/
|
|
9
|
+
import type { KiroAgentConfig, KiroToolName } from './schemas.js';
|
|
10
|
+
/**
|
|
11
|
+
* Committed lookup table mapping Claude Code tool names (PascalCase) to Kiro
|
|
12
|
+
* tool names (lowercase). Per spec §7.1, the mechanical-transformation definition
|
|
13
|
+
* requires the table be committed in source.
|
|
14
|
+
*
|
|
15
|
+
* Ported byte-for-byte from `CLAUDE_TO_KIRO_TOOLS` in build-standalone.ts of the
|
|
16
|
+
* template repository.
|
|
17
|
+
*
|
|
18
|
+
* @see /Users/mnorth/Development/ai-plugin-marketplace-template/src/build-standalone.ts
|
|
19
|
+
*/
|
|
20
|
+
export declare const CLAUDE_TO_KIRO_TOOLS: Readonly<Record<string, KiroToolName>>;
|
|
21
|
+
/**
|
|
22
|
+
* Translate a single Claude tool name to a Kiro tool name. Returns `undefined`
|
|
23
|
+
* for unknown names (not in the committed lookup table).
|
|
24
|
+
*/
|
|
25
|
+
export declare function translateToolName(claudeToolName: string): KiroToolName | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Translate a list of Claude tool names to Kiro tool names. Unknown tool names
|
|
28
|
+
* are silently dropped. The result is deduplicated (preserving first-seen order).
|
|
29
|
+
*/
|
|
30
|
+
export declare function translateAgentTools(claudeTools: readonly string[]): KiroToolName[];
|
|
31
|
+
/**
|
|
32
|
+
* Build a Kiro agent JSON config from the content of a Claude agent `.md` file.
|
|
33
|
+
*
|
|
34
|
+
* Parses the YAML frontmatter and body, then returns a fully-populated
|
|
35
|
+
* `KiroAgentConfig` object. Matches the output of `buildKiroAgentJson` in
|
|
36
|
+
* build-standalone.ts of the template repository.
|
|
37
|
+
*
|
|
38
|
+
* Pure — takes the raw file content string and a fallback name (typically
|
|
39
|
+
* derived from the filename without extension). Returns `null` if the content
|
|
40
|
+
* has no recognisable YAML frontmatter.
|
|
41
|
+
*
|
|
42
|
+
* Default values match the template reference implementation:
|
|
43
|
+
* - `mcpServers`: `{}`
|
|
44
|
+
* - `toolAliases`: `{}`
|
|
45
|
+
* - `allowedTools`: `[]`
|
|
46
|
+
* - `resources`: `[]`
|
|
47
|
+
* - `hooks`: `{}`
|
|
48
|
+
* - `toolsSettings`: `{}`
|
|
49
|
+
* - `includeMcpJson`: `true`
|
|
50
|
+
* - `model`: `null`
|
|
51
|
+
*/
|
|
52
|
+
export declare function buildKiroAgentConfig(agentMdContent: string, fallbackName: string): KiroAgentConfig | null;
|
|
53
|
+
//# sourceMappingURL=transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/targets/kiro/transform.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAMlE;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAQvE,CAAC;AAMF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAElF;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,YAAY,EAAE,CAWlF;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,oBAAoB,CAClC,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,GACnB,eAAe,GAAG,IAAI,CAsCxB"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mechanical transformations for the Kiro target.
|
|
3
|
+
*
|
|
4
|
+
* Per spec §7.1, this module is a pure function driven by a committed lookup
|
|
5
|
+
* table, bounded to a single target. No I/O occurs here.
|
|
6
|
+
*
|
|
7
|
+
* @see docs/specs/architecture.md §7, §7.1, §12.4, §12.5
|
|
8
|
+
*/
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
// Tool-name lookup table
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
/**
|
|
13
|
+
* Committed lookup table mapping Claude Code tool names (PascalCase) to Kiro
|
|
14
|
+
* tool names (lowercase). Per spec §7.1, the mechanical-transformation definition
|
|
15
|
+
* requires the table be committed in source.
|
|
16
|
+
*
|
|
17
|
+
* Ported byte-for-byte from `CLAUDE_TO_KIRO_TOOLS` in build-standalone.ts of the
|
|
18
|
+
* template repository.
|
|
19
|
+
*
|
|
20
|
+
* @see /Users/mnorth/Development/ai-plugin-marketplace-template/src/build-standalone.ts
|
|
21
|
+
*/
|
|
22
|
+
export const CLAUDE_TO_KIRO_TOOLS = {
|
|
23
|
+
Read: 'read',
|
|
24
|
+
Write: 'write',
|
|
25
|
+
Edit: 'write',
|
|
26
|
+
Glob: 'glob',
|
|
27
|
+
Grep: 'grep',
|
|
28
|
+
Bash: 'shell',
|
|
29
|
+
Agent: 'delegate',
|
|
30
|
+
};
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
// Pure transformation functions
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
/**
|
|
35
|
+
* Translate a single Claude tool name to a Kiro tool name. Returns `undefined`
|
|
36
|
+
* for unknown names (not in the committed lookup table).
|
|
37
|
+
*/
|
|
38
|
+
export function translateToolName(claudeToolName) {
|
|
39
|
+
return CLAUDE_TO_KIRO_TOOLS[claudeToolName];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Translate a list of Claude tool names to Kiro tool names. Unknown tool names
|
|
43
|
+
* are silently dropped. The result is deduplicated (preserving first-seen order).
|
|
44
|
+
*/
|
|
45
|
+
export function translateAgentTools(claudeTools) {
|
|
46
|
+
const seen = new Set();
|
|
47
|
+
const result = [];
|
|
48
|
+
for (const tool of claudeTools) {
|
|
49
|
+
const kiroTool = CLAUDE_TO_KIRO_TOOLS[tool];
|
|
50
|
+
if (kiroTool !== undefined && !seen.has(kiroTool)) {
|
|
51
|
+
seen.add(kiroTool);
|
|
52
|
+
result.push(kiroTool);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Build a Kiro agent JSON config from the content of a Claude agent `.md` file.
|
|
59
|
+
*
|
|
60
|
+
* Parses the YAML frontmatter and body, then returns a fully-populated
|
|
61
|
+
* `KiroAgentConfig` object. Matches the output of `buildKiroAgentJson` in
|
|
62
|
+
* build-standalone.ts of the template repository.
|
|
63
|
+
*
|
|
64
|
+
* Pure — takes the raw file content string and a fallback name (typically
|
|
65
|
+
* derived from the filename without extension). Returns `null` if the content
|
|
66
|
+
* has no recognisable YAML frontmatter.
|
|
67
|
+
*
|
|
68
|
+
* Default values match the template reference implementation:
|
|
69
|
+
* - `mcpServers`: `{}`
|
|
70
|
+
* - `toolAliases`: `{}`
|
|
71
|
+
* - `allowedTools`: `[]`
|
|
72
|
+
* - `resources`: `[]`
|
|
73
|
+
* - `hooks`: `{}`
|
|
74
|
+
* - `toolsSettings`: `{}`
|
|
75
|
+
* - `includeMcpJson`: `true`
|
|
76
|
+
* - `model`: `null`
|
|
77
|
+
*/
|
|
78
|
+
export function buildKiroAgentConfig(agentMdContent, fallbackName) {
|
|
79
|
+
// Same regex as build-standalone.ts for parity.
|
|
80
|
+
const fmMatch = /^---\n([\s\S]*?)\n---\n([\s\S]*)$/.exec(agentMdContent);
|
|
81
|
+
if (!fmMatch)
|
|
82
|
+
return null;
|
|
83
|
+
const frontmatter = fmMatch[1] ?? '';
|
|
84
|
+
const body = fmMatch[2] ?? '';
|
|
85
|
+
const nameMatch = /^name:\s*(.+)$/m.exec(frontmatter);
|
|
86
|
+
const descMatch = /^description:\s*(.+)$/m.exec(frontmatter);
|
|
87
|
+
const claudeTools = [];
|
|
88
|
+
const toolsBlockMatch = /^tools:\n((?:\s+-\s+\S+\n?)+)/m.exec(frontmatter);
|
|
89
|
+
if (toolsBlockMatch?.[1]) {
|
|
90
|
+
for (const line of toolsBlockMatch[1].split('\n')) {
|
|
91
|
+
const toolMatch = /^\s+-\s+(\S+)/.exec(line);
|
|
92
|
+
if (toolMatch?.[1]) {
|
|
93
|
+
claudeTools.push(toolMatch[1]);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const tools = translateAgentTools(claudeTools);
|
|
98
|
+
return {
|
|
99
|
+
name: nameMatch?.[1] ?? fallbackName,
|
|
100
|
+
description: descMatch?.[1] ?? '',
|
|
101
|
+
prompt: body.trim(),
|
|
102
|
+
mcpServers: {},
|
|
103
|
+
tools,
|
|
104
|
+
toolAliases: {},
|
|
105
|
+
allowedTools: [],
|
|
106
|
+
resources: [],
|
|
107
|
+
hooks: {},
|
|
108
|
+
toolsSettings: {},
|
|
109
|
+
includeMcpJson: true,
|
|
110
|
+
model: null,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=transform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../src/targets/kiro/transform.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,8EAA8E;AAC9E,yBAAyB;AACzB,8EAA8E;AAE9E;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAA2C;IAC1E,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,UAAU;CAClB,CAAC;AAEF,8EAA8E;AAC9E,gCAAgC;AAChC,8EAA8E;AAE9E;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,cAAsB;IACtD,OAAO,oBAAoB,CAAC,cAAc,CAAC,CAAC;AAC9C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,WAA8B;IAChE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAgB,CAAC;IACrC,MAAM,MAAM,GAAmB,EAAE,CAAC;IAClC,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;QAC/B,MAAM,QAAQ,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,QAAQ,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YAClD,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YACnB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACxB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,oBAAoB,CAClC,cAAsB,EACtB,YAAoB;IAEpB,gDAAgD;IAChD,MAAM,OAAO,GAAG,mCAAmC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACzE,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAE1B,MAAM,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACrC,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAE9B,MAAM,SAAS,GAAG,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,wBAAwB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAE7D,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,MAAM,eAAe,GAAG,gCAAgC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC3E,IAAI,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzB,KAAK,MAAM,IAAI,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAClD,MAAM,SAAS,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC7C,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACnB,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,KAAK,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAE/C,OAAO;QACL,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,YAAY;QACpC,WAAW,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE;QACjC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE;QACnB,UAAU,EAAE,EAAE;QACd,KAAK;QACL,WAAW,EAAE,EAAE;QACf,YAAY,EAAE,EAAE;QAChB,SAAS,EAAE,EAAE;QACb,KAAK,EAAE,EAAE;QACT,aAAa,EAAE,EAAE;QACjB,cAAc,EAAE,IAAI;QACpB,KAAK,EAAE,IAAI;KACZ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-target validators for the Kiro target.
|
|
3
|
+
*
|
|
4
|
+
* Responsibilities (v0.1.0):
|
|
5
|
+
* 1. POWER.md frontmatter — parse YAML and validate against
|
|
6
|
+
* `kiroPowerMdFrontmatterSchema`. Missing block or missing required fields
|
|
7
|
+
* → hard `schema-invalid`.
|
|
8
|
+
* 2. POWER.md name-consistency — frontmatter `name` must match
|
|
9
|
+
* `path.basename(pluginDir)` → hard `name-consistency`.
|
|
10
|
+
* 3. mcp.json schema — parse JSON and validate against `kiroMcpConfigSchema`
|
|
11
|
+
* → hard `schema-invalid`.
|
|
12
|
+
* 4. Agent tool-name warnings — for each `.md` under `agents/` (one level),
|
|
13
|
+
* each tool not in `CLAUDE_TO_KIRO_TOOLS` → soft `schema-invalid`.
|
|
14
|
+
*
|
|
15
|
+
* What NOT validated here:
|
|
16
|
+
* - `.kiro/agents/<name>.json` (generated output — validated at bundle time)
|
|
17
|
+
* - Envelope adherence, marketplace registration, cross-target consistency
|
|
18
|
+
* - Shared agent .md shape beyond tool names (Claude validator owns frontmatter)
|
|
19
|
+
*
|
|
20
|
+
* Cross-target imports are forbidden per §3.4 of the architecture spec.
|
|
21
|
+
*
|
|
22
|
+
* @see docs/specs/architecture.md §10 (validation contract), §8.1 (Finding types)
|
|
23
|
+
* @see docs/specs/architecture.md §12.5 (internal module shape), §3.4 (target isolation)
|
|
24
|
+
*/
|
|
25
|
+
import type { Finding } from '../../pipeline/types.js';
|
|
26
|
+
/**
|
|
27
|
+
* Run Kiro-specific validators against a plugin directory.
|
|
28
|
+
*
|
|
29
|
+
* `pluginDir` is the absolute path to a `plugins/<name>/` directory.
|
|
30
|
+
* All findings use `plugin: path.basename(pluginDir)`.
|
|
31
|
+
*
|
|
32
|
+
* Returns zero or more Findings. Callers combine these with other targets'
|
|
33
|
+
* findings and the cross-target findings in the pipeline validator.
|
|
34
|
+
*/
|
|
35
|
+
export declare function validateKiroPlugin(pluginDir: string): Finding[];
|
|
36
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/targets/kiro/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAOH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAkPvD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,EAAE,CAQ/D"}
|