mewkit 1.11.1 → 1.11.2

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 (42) hide show
  1. package/dist/commands/build-plugin.d.ts +8 -0
  2. package/dist/commands/build-plugin.d.ts.map +1 -0
  3. package/dist/commands/build-plugin.js +48 -0
  4. package/dist/commands/build-plugin.js.map +1 -0
  5. package/dist/commands/doctor-checks.d.ts +9 -0
  6. package/dist/commands/doctor-checks.d.ts.map +1 -1
  7. package/dist/commands/doctor-checks.js +42 -0
  8. package/dist/commands/doctor-checks.js.map +1 -1
  9. package/dist/commands/doctor.d.ts.map +1 -1
  10. package/dist/commands/doctor.js +2 -1
  11. package/dist/commands/doctor.js.map +1 -1
  12. package/dist/commands/validate.d.ts +3 -1
  13. package/dist/commands/validate.d.ts.map +1 -1
  14. package/dist/commands/validate.js +9 -0
  15. package/dist/commands/validate.js.map +1 -1
  16. package/dist/core/check-plugin-manifests.d.ts +10 -0
  17. package/dist/core/check-plugin-manifests.d.ts.map +1 -0
  18. package/dist/core/check-plugin-manifests.js +150 -0
  19. package/dist/core/check-plugin-manifests.js.map +1 -0
  20. package/dist/core/index.d.ts +5 -0
  21. package/dist/core/index.d.ts.map +1 -1
  22. package/dist/core/index.js +5 -0
  23. package/dist/core/index.js.map +1 -1
  24. package/dist/core/plugin-agent-refs.d.ts +22 -0
  25. package/dist/core/plugin-agent-refs.d.ts.map +1 -0
  26. package/dist/core/plugin-agent-refs.js +87 -0
  27. package/dist/core/plugin-agent-refs.js.map +1 -0
  28. package/dist/core/plugin-hooks.d.ts +15 -0
  29. package/dist/core/plugin-hooks.d.ts.map +1 -0
  30. package/dist/core/plugin-hooks.js +58 -0
  31. package/dist/core/plugin-hooks.js.map +1 -0
  32. package/dist/core/plugin-manifest.d.ts +289 -0
  33. package/dist/core/plugin-manifest.d.ts.map +1 -0
  34. package/dist/core/plugin-manifest.js +125 -0
  35. package/dist/core/plugin-manifest.js.map +1 -0
  36. package/dist/core/plugin-payload.d.ts +26 -0
  37. package/dist/core/plugin-payload.d.ts.map +1 -0
  38. package/dist/core/plugin-payload.js +138 -0
  39. package/dist/core/plugin-payload.js.map +1 -0
  40. package/dist/index.js +8 -0
  41. package/dist/index.js.map +1 -1
  42. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Built-in agent types the host runtime provides. References to these are left
3
+ * bare in the plugin payload — they are not kit agents and are never prefixed.
4
+ */
5
+ export declare const BUILTIN_AGENT_TYPES: Set<string>;
6
+ /** Read the bare `name:` frontmatter value from each agent file in a dir. */
7
+ export declare function collectAgentNames(agentsDir: string): Set<string>;
8
+ export interface RewriteResult {
9
+ content: string;
10
+ /** Number of references rewritten. */
11
+ count: number;
12
+ }
13
+ /**
14
+ * Rewrite bare `subagent_type` references to kit agents into the namespaced
15
+ * `<plugin>:<agent>` form. Only values that exactly match a name in `agentNames`
16
+ * are touched; built-ins, template placeholders (`[type]`), and already-prefixed
17
+ * values are left untouched. The match anchors immediately after the
18
+ * `subagent_type` assignment, so `subagent_type="mk:developer"` is never
19
+ * double-prefixed.
20
+ */
21
+ export declare function rewriteAgentRefs(content: string, agentNames: Set<string>, pluginName?: string): RewriteResult;
22
+ //# sourceMappingURL=plugin-agent-refs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-agent-refs.d.ts","sourceRoot":"","sources":["../../src/core/plugin-agent-refs.ts"],"names":[],"mappings":"AAcA;;;GAGG;AACH,eAAO,MAAM,mBAAmB,aAK9B,CAAC;AAEH,6EAA6E;AAC7E,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAchE;AAmBD,MAAM,WAAW,aAAa;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC/B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,EACvB,UAAU,SAAO,GACf,aAAa,CAwBf"}
@@ -0,0 +1,87 @@
1
+ // Agent-reference rewriting for the generated plugin payload.
2
+ //
3
+ // Why this exists: the flat-copy install resolves an agent by its `name:`
4
+ // frontmatter verbatim, so the shipped source keeps BARE agent names and BARE
5
+ // `subagent_type` references (e.g. `developer`). A Claude Code / Codex plugin,
6
+ // however, auto-prefixes the plugin name onto each agent's bare `name:` — a bare
7
+ // `subagent_type` is then rejected and only `<plugin>:<agent>` resolves
8
+ // (verified against the live `claude plugin` registry). To support BOTH installs
9
+ // from one source tree, the plugin payload is generated: agent `name:` stays
10
+ // bare (the runtime adds the prefix) and every reference to a kit agent is
11
+ // rewritten to `<plugin>:<agent>` here.
12
+ import { readdirSync, readFileSync } from "node:fs";
13
+ import { join } from "node:path";
14
+ /**
15
+ * Built-in agent types the host runtime provides. References to these are left
16
+ * bare in the plugin payload — they are not kit agents and are never prefixed.
17
+ */
18
+ export const BUILTIN_AGENT_TYPES = new Set([
19
+ "Explore",
20
+ "Bash",
21
+ "general-purpose",
22
+ "Plan",
23
+ ]);
24
+ /** Read the bare `name:` frontmatter value from each agent file in a dir. */
25
+ export function collectAgentNames(agentsDir) {
26
+ const names = new Set();
27
+ let entries;
28
+ try {
29
+ entries = readdirSync(agentsDir);
30
+ }
31
+ catch {
32
+ return names;
33
+ }
34
+ for (const entry of entries) {
35
+ if (!entry.endsWith(".md"))
36
+ continue;
37
+ const name = readFrontmatterName(join(agentsDir, entry));
38
+ if (name)
39
+ names.add(name);
40
+ }
41
+ return names;
42
+ }
43
+ /** First `name:` value in a markdown file's YAML frontmatter, or null. */
44
+ function readFrontmatterName(filePath) {
45
+ let text;
46
+ try {
47
+ text = readFileSync(filePath, "utf-8");
48
+ }
49
+ catch {
50
+ return null;
51
+ }
52
+ const match = text.match(/^name:\s*["']?([^"'\r\n]+)["']?\s*$/m);
53
+ return match ? match[1].trim() : null;
54
+ }
55
+ /** Escape a string for safe inclusion in a RegExp. */
56
+ function escapeRegExp(value) {
57
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
58
+ }
59
+ /**
60
+ * Rewrite bare `subagent_type` references to kit agents into the namespaced
61
+ * `<plugin>:<agent>` form. Only values that exactly match a name in `agentNames`
62
+ * are touched; built-ins, template placeholders (`[type]`), and already-prefixed
63
+ * values are left untouched. The match anchors immediately after the
64
+ * `subagent_type` assignment, so `subagent_type="mk:developer"` is never
65
+ * double-prefixed.
66
+ */
67
+ export function rewriteAgentRefs(content, agentNames, pluginName = "mk") {
68
+ const targets = [...agentNames].filter((n) => !BUILTIN_AGENT_TYPES.has(n));
69
+ if (targets.length === 0)
70
+ return { content, count: 0 };
71
+ // Longest names first so e.g. `jira-evaluator` wins over `evaluator`.
72
+ const alternation = targets
73
+ .sort((a, b) => b.length - a.length)
74
+ .map(escapeRegExp)
75
+ .join("|");
76
+ // group1: the `subagent_type` assignment up to an optional opening quote.
77
+ // group2: the bare agent name, bounded by a quote/space/comma/paren/EOL so
78
+ // it cannot be a fragment of a longer identifier.
79
+ const re = new RegExp(`(subagent_type\\s*[:=]\\s*["']?)(${alternation})(?=["'\\s),]|$)`, "g");
80
+ let count = 0;
81
+ const rewritten = content.replace(re, (_match, prefix, name) => {
82
+ count += 1;
83
+ return `${prefix}${pluginName}:${name}`;
84
+ });
85
+ return { content: rewritten, count };
86
+ }
87
+ //# sourceMappingURL=plugin-agent-refs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-agent-refs.js","sourceRoot":"","sources":["../../src/core/plugin-agent-refs.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,EAAE;AACF,0EAA0E;AAC1E,8EAA8E;AAC9E,+EAA+E;AAC/E,iFAAiF;AACjF,wEAAwE;AACxE,iFAAiF;AACjF,6EAA6E;AAC7E,2EAA2E;AAC3E,wCAAwC;AACxC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,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EAAE,MAAM,CAAC,CAAC;AACrD,CAAC;AAQD;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAC/B,OAAe,EACf,UAAuB,EACvB,UAAU,GAAG,IAAI;IAEjB,MAAM,OAAO,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3E,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAEvD,sEAAsE;IACtE,MAAM,WAAW,GAAG,OAAO;SACzB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;SACnC,GAAG,CAAC,YAAY,CAAC;SACjB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEZ,0EAA0E;IAC1E,2EAA2E;IAC3E,kDAAkD;IAClD,MAAM,EAAE,GAAG,IAAI,MAAM,CACpB,oCAAoC,WAAW,kBAAkB,EACjE,GAAG,CACH,CAAC;IAEF,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,MAAM,EAAE,MAAc,EAAE,IAAY,EAAE,EAAE;QAC9E,KAAK,IAAI,CAAC,CAAC;QACX,OAAO,GAAG,MAAM,GAAG,UAAU,IAAI,IAAI,EAAE,CAAC;IACzC,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AACtC,CAAC"}
@@ -0,0 +1,15 @@
1
+ /** Rewrite one hook command string from flat-copy roots to plugin roots. */
2
+ export declare function rewriteHookCommand(command: string): string;
3
+ /** The `hooks` object from a parsed settings.json (event → matcher groups). */
4
+ export type HookConfig = Record<string, unknown>;
5
+ /** Read the `hooks` object from a settings.json file, or null if absent. */
6
+ export declare function readSettingsHooks(settingsPath: string): HookConfig | null;
7
+ /**
8
+ * Build the plugin `hooks/hooks.json` payload from a settings.json hooks object.
9
+ * Deep-clones the structure and rewrites every `command` string to plugin roots,
10
+ * preserving matchers, timeouts, and status messages.
11
+ */
12
+ export declare function buildPluginHooks(settingsHooks: HookConfig): {
13
+ hooks: HookConfig;
14
+ };
15
+ //# sourceMappingURL=plugin-hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-hooks.d.ts","sourceRoot":"","sources":["../../src/core/plugin-hooks.ts"],"names":[],"mappings":"AAgBA,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,+EAA+E;AAC/E,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD,4EAA4E;AAC5E,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CASzE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,UAAU,GAAG;IAAE,KAAK,EAAE,UAAU,CAAA;CAAE,CAIjF"}
@@ -0,0 +1,58 @@
1
+ // Translate the kit's flat-copy hook wiring into a plugin `hooks/hooks.json`.
2
+ //
3
+ // Flat-copy installs read hooks from `.claude/settings.json`, whose command
4
+ // paths are rooted at `$CLAUDE_PROJECT_DIR/.claude/`. A plugin install reads
5
+ // `hooks/hooks.json` from the plugin root and exposes that root as
6
+ // `${CLAUDE_PLUGIN_ROOT}`. Because the plugin payload is a copy of `.claude` at
7
+ // its root, the only transform needed is the command-path prefix swap — the hook
8
+ // scripts, the `handlers.json` dispatch manifest, and its relative handler paths
9
+ // all travel unchanged inside `hooks/`.
10
+ import { existsSync, readFileSync } from "node:fs";
11
+ /** Path prefix used by flat-copy hook commands (both quoted and bare forms). */
12
+ const SOURCE_PREFIX = "$CLAUDE_PROJECT_DIR/.claude/";
13
+ /** Plugin-root env var the host sets when running plugin hooks. */
14
+ const PLUGIN_PREFIX = "${CLAUDE_PLUGIN_ROOT}/";
15
+ /** Rewrite one hook command string from flat-copy roots to plugin roots. */
16
+ export function rewriteHookCommand(command) {
17
+ return command.split(SOURCE_PREFIX).join(PLUGIN_PREFIX);
18
+ }
19
+ /** Read the `hooks` object from a settings.json file, or null if absent. */
20
+ export function readSettingsHooks(settingsPath) {
21
+ if (!existsSync(settingsPath))
22
+ return null;
23
+ let parsed;
24
+ try {
25
+ parsed = JSON.parse(readFileSync(settingsPath, "utf-8"));
26
+ }
27
+ catch {
28
+ return null;
29
+ }
30
+ return parsed.hooks ?? null;
31
+ }
32
+ /**
33
+ * Build the plugin `hooks/hooks.json` payload from a settings.json hooks object.
34
+ * Deep-clones the structure and rewrites every `command` string to plugin roots,
35
+ * preserving matchers, timeouts, and status messages.
36
+ */
37
+ export function buildPluginHooks(settingsHooks) {
38
+ const cloned = JSON.parse(JSON.stringify(settingsHooks));
39
+ rewriteCommands(cloned);
40
+ return { hooks: cloned };
41
+ }
42
+ /** Recursively rewrite every `command` field found in the structure. */
43
+ function rewriteCommands(node) {
44
+ if (Array.isArray(node)) {
45
+ for (const item of node)
46
+ rewriteCommands(item);
47
+ return;
48
+ }
49
+ if (node && typeof node === "object") {
50
+ const record = node;
51
+ if (typeof record.command === "string") {
52
+ record.command = rewriteHookCommand(record.command);
53
+ }
54
+ for (const value of Object.values(record))
55
+ rewriteCommands(value);
56
+ }
57
+ }
58
+ //# sourceMappingURL=plugin-hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-hooks.js","sourceRoot":"","sources":["../../src/core/plugin-hooks.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,EAAE;AACF,4EAA4E;AAC5E,6EAA6E;AAC7E,mEAAmE;AACnE,gFAAgF;AAChF,iFAAiF;AACjF,iFAAiF;AACjF,wCAAwC;AACxC,OAAO,EA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C/C,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YACxC,MAAM,CAAC,OAAO,GAAG,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACrD,CAAC;QACD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;YAAE,eAAe,CAAC,KAAK,CAAC,CAAC;IACnE,CAAC;AACF,CAAC"}
@@ -0,0 +1,289 @@
1
+ import { z } from "zod";
2
+ /** Plugin identity shared by every manifest. */
3
+ export declare const PLUGIN_NAME = "mk";
4
+ export interface PluginIdentity {
5
+ /** Plugin name; defaults to `mk`. The runtime prefixes agents/skills with it. */
6
+ name?: string;
7
+ /** Release version (root package.json version at release time). */
8
+ version: string;
9
+ description: string;
10
+ author?: {
11
+ name: string;
12
+ email?: string;
13
+ };
14
+ }
15
+ export declare const ClaudePluginJsonSchema: z.ZodObject<{
16
+ $schema: z.ZodOptional<z.ZodString>;
17
+ name: z.ZodString;
18
+ version: z.ZodString;
19
+ description: z.ZodString;
20
+ author: z.ZodOptional<z.ZodObject<{
21
+ name: z.ZodString;
22
+ email: z.ZodOptional<z.ZodString>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ name: string;
25
+ email?: string | undefined;
26
+ }, {
27
+ name: string;
28
+ email?: string | undefined;
29
+ }>>;
30
+ skills: z.ZodArray<z.ZodString, "many">;
31
+ }, "strip", z.ZodTypeAny, {
32
+ skills: string[];
33
+ version: string;
34
+ name: string;
35
+ description: string;
36
+ $schema?: string | undefined;
37
+ author?: {
38
+ name: string;
39
+ email?: string | undefined;
40
+ } | undefined;
41
+ }, {
42
+ skills: string[];
43
+ version: string;
44
+ name: string;
45
+ description: string;
46
+ $schema?: string | undefined;
47
+ author?: {
48
+ name: string;
49
+ email?: string | undefined;
50
+ } | undefined;
51
+ }>;
52
+ export type ClaudePluginJson = z.infer<typeof ClaudePluginJsonSchema>;
53
+ export declare function buildClaudePluginJson(id: PluginIdentity): ClaudePluginJson;
54
+ export interface ClaudeMarketplaceOptions extends PluginIdentity {
55
+ marketplaceName: string;
56
+ owner: {
57
+ name: string;
58
+ email?: string;
59
+ url?: string;
60
+ };
61
+ /** Plugin source path relative to the marketplace root (e.g. `./` or `./mk`). */
62
+ source: string;
63
+ }
64
+ export declare const ClaudeMarketplaceJsonSchema: z.ZodObject<{
65
+ $schema: z.ZodOptional<z.ZodString>;
66
+ name: z.ZodString;
67
+ owner: z.ZodObject<{
68
+ name: z.ZodString;
69
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
70
+ name: z.ZodString;
71
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
72
+ name: z.ZodString;
73
+ }, z.ZodTypeAny, "passthrough">>;
74
+ plugins: z.ZodArray<z.ZodObject<{
75
+ name: z.ZodString;
76
+ source: z.ZodString;
77
+ description: z.ZodOptional<z.ZodString>;
78
+ }, "strip", z.ZodTypeAny, {
79
+ name: string;
80
+ source: string;
81
+ description?: string | undefined;
82
+ }, {
83
+ name: string;
84
+ source: string;
85
+ description?: string | undefined;
86
+ }>, "many">;
87
+ }, "strip", z.ZodTypeAny, {
88
+ owner: {
89
+ name: string;
90
+ } & {
91
+ [k: string]: unknown;
92
+ };
93
+ name: string;
94
+ plugins: {
95
+ name: string;
96
+ source: string;
97
+ description?: string | undefined;
98
+ }[];
99
+ $schema?: string | undefined;
100
+ }, {
101
+ owner: {
102
+ name: string;
103
+ } & {
104
+ [k: string]: unknown;
105
+ };
106
+ name: string;
107
+ plugins: {
108
+ name: string;
109
+ source: string;
110
+ description?: string | undefined;
111
+ }[];
112
+ $schema?: string | undefined;
113
+ }>;
114
+ export type ClaudeMarketplaceJson = z.infer<typeof ClaudeMarketplaceJsonSchema>;
115
+ export declare function buildClaudeMarketplaceJson(opts: ClaudeMarketplaceOptions): ClaudeMarketplaceJson;
116
+ export declare const CodexPluginJsonSchema: z.ZodObject<{
117
+ name: z.ZodString;
118
+ version: z.ZodString;
119
+ description: z.ZodString;
120
+ author: z.ZodOptional<z.ZodObject<{
121
+ name: z.ZodString;
122
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
123
+ name: z.ZodString;
124
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
125
+ name: z.ZodString;
126
+ }, z.ZodTypeAny, "passthrough">>>;
127
+ skills: z.ZodString;
128
+ interface: z.ZodObject<{
129
+ displayName: z.ZodString;
130
+ shortDescription: z.ZodString;
131
+ longDescription: z.ZodString;
132
+ developerName: z.ZodString;
133
+ category: z.ZodString;
134
+ capabilities: z.ZodArray<z.ZodString, "many">;
135
+ defaultPrompt: z.ZodString;
136
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
137
+ displayName: z.ZodString;
138
+ shortDescription: z.ZodString;
139
+ longDescription: z.ZodString;
140
+ developerName: z.ZodString;
141
+ category: z.ZodString;
142
+ capabilities: z.ZodArray<z.ZodString, "many">;
143
+ defaultPrompt: z.ZodString;
144
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
145
+ displayName: z.ZodString;
146
+ shortDescription: z.ZodString;
147
+ longDescription: z.ZodString;
148
+ developerName: z.ZodString;
149
+ category: z.ZodString;
150
+ capabilities: z.ZodArray<z.ZodString, "many">;
151
+ defaultPrompt: z.ZodString;
152
+ }, z.ZodTypeAny, "passthrough">>;
153
+ }, "strip", z.ZodTypeAny, {
154
+ skills: string;
155
+ version: string;
156
+ name: string;
157
+ description: string;
158
+ interface: {
159
+ displayName: string;
160
+ shortDescription: string;
161
+ longDescription: string;
162
+ developerName: string;
163
+ category: string;
164
+ capabilities: string[];
165
+ defaultPrompt: string;
166
+ } & {
167
+ [k: string]: unknown;
168
+ };
169
+ author?: z.objectOutputType<{
170
+ name: z.ZodString;
171
+ }, z.ZodTypeAny, "passthrough"> | undefined;
172
+ }, {
173
+ skills: string;
174
+ version: string;
175
+ name: string;
176
+ description: string;
177
+ interface: {
178
+ displayName: string;
179
+ shortDescription: string;
180
+ longDescription: string;
181
+ developerName: string;
182
+ category: string;
183
+ capabilities: string[];
184
+ defaultPrompt: string;
185
+ } & {
186
+ [k: string]: unknown;
187
+ };
188
+ author?: z.objectInputType<{
189
+ name: z.ZodString;
190
+ }, z.ZodTypeAny, "passthrough"> | undefined;
191
+ }>;
192
+ export type CodexPluginJson = z.infer<typeof CodexPluginJsonSchema>;
193
+ export interface CodexPluginOptions extends PluginIdentity {
194
+ displayName?: string;
195
+ category?: string;
196
+ }
197
+ export declare function buildCodexPluginJson(opts: CodexPluginOptions): CodexPluginJson;
198
+ export declare const CodexMarketplaceJsonSchema: z.ZodObject<{
199
+ name: z.ZodString;
200
+ interface: z.ZodObject<{
201
+ displayName: z.ZodString;
202
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
203
+ displayName: z.ZodString;
204
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
205
+ displayName: z.ZodString;
206
+ }, z.ZodTypeAny, "passthrough">>;
207
+ plugins: z.ZodArray<z.ZodObject<{
208
+ name: z.ZodString;
209
+ source: z.ZodObject<{
210
+ source: z.ZodString;
211
+ path: z.ZodOptional<z.ZodString>;
212
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
213
+ source: z.ZodString;
214
+ path: z.ZodOptional<z.ZodString>;
215
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
216
+ source: z.ZodString;
217
+ path: z.ZodOptional<z.ZodString>;
218
+ }, z.ZodTypeAny, "passthrough">>;
219
+ policy: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
220
+ category: z.ZodOptional<z.ZodString>;
221
+ }, "strip", z.ZodTypeAny, {
222
+ name: string;
223
+ source: {
224
+ source: string;
225
+ path?: string | undefined;
226
+ } & {
227
+ [k: string]: unknown;
228
+ };
229
+ category?: string | undefined;
230
+ policy?: Record<string, string> | undefined;
231
+ }, {
232
+ name: string;
233
+ source: {
234
+ source: string;
235
+ path?: string | undefined;
236
+ } & {
237
+ [k: string]: unknown;
238
+ };
239
+ category?: string | undefined;
240
+ policy?: Record<string, string> | undefined;
241
+ }>, "many">;
242
+ }, "strip", z.ZodTypeAny, {
243
+ name: string;
244
+ plugins: {
245
+ name: string;
246
+ source: {
247
+ source: string;
248
+ path?: string | undefined;
249
+ } & {
250
+ [k: string]: unknown;
251
+ };
252
+ category?: string | undefined;
253
+ policy?: Record<string, string> | undefined;
254
+ }[];
255
+ interface: {
256
+ displayName: string;
257
+ } & {
258
+ [k: string]: unknown;
259
+ };
260
+ }, {
261
+ name: string;
262
+ plugins: {
263
+ name: string;
264
+ source: {
265
+ source: string;
266
+ path?: string | undefined;
267
+ } & {
268
+ [k: string]: unknown;
269
+ };
270
+ category?: string | undefined;
271
+ policy?: Record<string, string> | undefined;
272
+ }[];
273
+ interface: {
274
+ displayName: string;
275
+ } & {
276
+ [k: string]: unknown;
277
+ };
278
+ }>;
279
+ export type CodexMarketplaceJson = z.infer<typeof CodexMarketplaceJsonSchema>;
280
+ export interface CodexMarketplaceOptions {
281
+ name?: string;
282
+ marketplaceName: string;
283
+ marketplaceDisplayName?: string;
284
+ /** Plugin source path relative to the marketplace/repo root. */
285
+ sourcePath: string;
286
+ category?: string;
287
+ }
288
+ export declare function buildCodexMarketplaceJson(opts: CodexMarketplaceOptions): CodexMarketplaceJson;
289
+ //# sourceMappingURL=plugin-manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-manifest.d.ts","sourceRoot":"","sources":["../../src/core/plugin-manifest.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gDAAgD;AAChD,eAAO,MAAM,WAAW,OAAO,CAAC;AAEhC,MAAM,WAAW,cAAc;IAC9B,iFAAiF;IACjF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAarC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,MAAM,WAAW,uBAAuB;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,gEAAgE;IAChE,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,uBAAuB,GAAG,oBAAoB,CAa7F"}
@@ -0,0 +1,125 @@
1
+ // Pure builders + schemas for the generated plugin manifests.
2
+ //
3
+ // Two runtimes, two manifest shapes — both verified against the live CLIs
4
+ // (`claude plugin init` and the Codex `plugin-creator` scaffold):
5
+ // - Claude Code: `.claude-plugin/plugin.json` + `.claude-plugin/marketplace.json`
6
+ // - Codex: `.codex-plugin/plugin.json` + `.agents/plugins/marketplace.json`
7
+ // The version is the SINGLE source of truth (root package version at release),
8
+ // staged into the release commit so the manifest version never lags the release.
9
+ import { z } from "zod";
10
+ /** Plugin identity shared by every manifest. */
11
+ export const PLUGIN_NAME = "mk";
12
+ // ---------------------------------------------------------------------------
13
+ // Claude Code
14
+ // ---------------------------------------------------------------------------
15
+ export const ClaudePluginJsonSchema = z.object({
16
+ $schema: z.string().optional(),
17
+ name: z.string(),
18
+ version: z.string(),
19
+ description: z.string(),
20
+ author: z.object({ name: z.string(), email: z.string().optional() }).optional(),
21
+ skills: z.array(z.string()),
22
+ });
23
+ export function buildClaudePluginJson(id) {
24
+ return {
25
+ $schema: "https://anthropic.com/claude-code/plugin.schema.json",
26
+ name: id.name ?? PLUGIN_NAME,
27
+ version: id.version,
28
+ description: id.description,
29
+ ...(id.author ? { author: id.author } : {}),
30
+ // Plugin root holds the transformed `.claude` payload; skills auto-discover
31
+ // from the `skills/` subtree, agents from `agents/`.
32
+ skills: ["./skills"],
33
+ };
34
+ }
35
+ export const ClaudeMarketplaceJsonSchema = z.object({
36
+ $schema: z.string().optional(),
37
+ name: z.string(),
38
+ owner: z.object({ name: z.string() }).passthrough(),
39
+ plugins: z
40
+ .array(z.object({
41
+ name: z.string(),
42
+ source: z.string(),
43
+ description: z.string().optional(),
44
+ }))
45
+ .min(1),
46
+ });
47
+ export function buildClaudeMarketplaceJson(opts) {
48
+ return {
49
+ $schema: "https://anthropic.com/claude-code/marketplace.schema.json",
50
+ name: opts.marketplaceName,
51
+ owner: opts.owner,
52
+ plugins: [
53
+ { name: opts.name ?? PLUGIN_NAME, source: opts.source, description: opts.description },
54
+ ],
55
+ };
56
+ }
57
+ // ---------------------------------------------------------------------------
58
+ // Codex
59
+ // ---------------------------------------------------------------------------
60
+ export const CodexPluginJsonSchema = z.object({
61
+ name: z.string(),
62
+ version: z.string(),
63
+ description: z.string(),
64
+ author: z.object({ name: z.string() }).passthrough().optional(),
65
+ // Codex `skills` is a STRING path (not an array, unlike Claude).
66
+ skills: z.string(),
67
+ interface: z
68
+ .object({
69
+ displayName: z.string(),
70
+ shortDescription: z.string(),
71
+ longDescription: z.string(),
72
+ developerName: z.string(),
73
+ category: z.string(),
74
+ capabilities: z.array(z.string()),
75
+ defaultPrompt: z.string(),
76
+ })
77
+ .passthrough(),
78
+ });
79
+ export function buildCodexPluginJson(opts) {
80
+ const name = opts.name ?? PLUGIN_NAME;
81
+ const display = opts.displayName ?? "MeowKit";
82
+ return {
83
+ name,
84
+ version: opts.version,
85
+ description: opts.description,
86
+ ...(opts.author ? { author: { name: opts.author.name } } : {}),
87
+ skills: "./skills/",
88
+ interface: {
89
+ displayName: display,
90
+ shortDescription: `Use ${display} in Codex.`,
91
+ longDescription: opts.description,
92
+ developerName: opts.author?.name ?? "MeowKit",
93
+ category: opts.category ?? "Productivity",
94
+ capabilities: [],
95
+ defaultPrompt: `Help me use ${display}.`,
96
+ },
97
+ };
98
+ }
99
+ export const CodexMarketplaceJsonSchema = z.object({
100
+ name: z.string(),
101
+ interface: z.object({ displayName: z.string() }).passthrough(),
102
+ plugins: z
103
+ .array(z.object({
104
+ name: z.string(),
105
+ source: z.object({ source: z.string(), path: z.string().optional() }).passthrough(),
106
+ policy: z.record(z.string()).optional(),
107
+ category: z.string().optional(),
108
+ }))
109
+ .min(1),
110
+ });
111
+ export function buildCodexMarketplaceJson(opts) {
112
+ return {
113
+ name: opts.marketplaceName,
114
+ interface: { displayName: opts.marketplaceDisplayName ?? opts.marketplaceName },
115
+ plugins: [
116
+ {
117
+ name: opts.name ?? PLUGIN_NAME,
118
+ source: { source: "local", path: opts.sourcePath },
119
+ policy: { installation: "AVAILABLE", authentication: "ON_INSTALL" },
120
+ category: opts.category ?? "Productivity",
121
+ },
122
+ ],
123
+ };
124
+ }
125
+ //# sourceMappingURL=plugin-manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-manifest.js","sourceRoot":"","sources":["../../src/core/plugin-manifest.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,EAAE;AACF,0EAA0E;AAC1E,kEAAkE;AAClE,oFAAoF;AACpF,qFAAqF;AACrF,+EAA+E;AAC/E,iFAAiF;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gDAAgD;AAChD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC;AAWhC,8EAA8E;AAC9E,cAAc;AACd,8EAA8E;AAE9E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,MAAM,EAAE,CAAC,CAAC,MAAM,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,CAAC,CAAC,QAAQ,EAAE;QACvC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC/B,CAAC,CACF;SACA,GAAG,CAAC,CAAC,CAAC;CACR,CAAC,CAAC;AAYH,MAAM,UAAU,yBAAyB,CAAC,IAA6B;IACtE,OAAO;QACN,IAAI,EAAE,IAAI,CAAC,eAAe;QAC1B,SAAS,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,eAAe,EAAE;QAC/E,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,WAAW;gBAC9B,MAAM,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE;gBAClD,MAAM,EAAE,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE;gBACnE,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,cAAc;aACzC;SACD;KACD,CAAC;AACH,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { type PluginIdentity } from "./plugin-manifest.js";
2
+ export interface GeneratePayloadOptions extends PluginIdentity {
3
+ /** Path to the canonical `.claude` source directory. */
4
+ sourceDir: string;
5
+ /** Path to the plugin root to (re)generate. */
6
+ outDir: string;
7
+ /** Agent names to namespace; defaults to the names found in `sourceDir/agents`. */
8
+ agentNames?: Set<string>;
9
+ }
10
+ export interface GeneratePayloadResult {
11
+ filesScanned: number;
12
+ refsRewritten: number;
13
+ loopDirRenamed: boolean;
14
+ /** Non-agent `.md` files dropped from `agents/` (e.g. index files). */
15
+ nonAgentsPruned: number;
16
+ /** True when a plugin `hooks/hooks.json` was generated from settings.json. */
17
+ hooksGenerated: boolean;
18
+ }
19
+ /**
20
+ * Build the plugin payload at `outDir`. Idempotent: clears and regenerates.
21
+ * Returns counts for verification.
22
+ */
23
+ export declare function generatePluginPayload(opts: GeneratePayloadOptions): GeneratePayloadResult;
24
+ /** Relative payload paths of the two generated plugin manifests (for callers). */
25
+ export declare function pluginManifestPaths(outDir: string): string[];
26
+ //# sourceMappingURL=plugin-payload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-payload.d.ts","sourceRoot":"","sources":["../../src/core/plugin-payload.ts"],"names":[],"mappings":"AAqBA,OAAO,EAIN,KAAK,cAAc,EACnB,MAAM,sBAAsB,CAAC;AAuB9B,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC7D,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,UAAU,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACzB;AAED,MAAM,WAAW,qBAAqB;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,uEAAuE;IACvE,eAAe,EAAE,MAAM,CAAC;IACxB,8EAA8E;IAC9E,cAAc,EAAE,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,sBAAsB,GAAG,qBAAqB,CAyDzF;AA4CD,kFAAkF;AAClF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAK5D"}