@nospt/plugin-dev-ai-hub-common 0.2.3 → 0.3.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/dist/index.cjs.js +33 -7
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +306 -163
- package/dist/index.esm.js +2 -2
- package/dist/resources.cjs.js +476 -0
- package/dist/resources.cjs.js.map +1 -0
- package/dist/resources.esm.js +446 -0
- package/dist/resources.esm.js.map +1 -0
- package/dist/telemetry.cjs.js +19 -0
- package/dist/telemetry.cjs.js.map +1 -0
- package/dist/telemetry.esm.js +16 -0
- package/dist/telemetry.esm.js.map +1 -0
- package/package.json +5 -2
- package/.eslintrc.js +0 -1
- package/dist/installPaths.cjs.js +0 -58
- package/dist/installPaths.cjs.js.map +0 -1
- package/dist/installPaths.esm.js +0 -55
- package/dist/installPaths.esm.js.map +0 -1
- package/dist/schemas.cjs.js +0 -43
- package/dist/schemas.cjs.js.map +0 -1
- package/dist/schemas.esm.js +0 -39
- package/dist/schemas.esm.js.map +0 -1
- package/package.json-prepack +0 -55
- package/src/index.ts +0 -3
- package/src/installPaths.test.ts +0 -154
- package/src/installPaths.ts +0 -91
- package/src/schemas.ts +0 -46
- package/src/types.ts +0 -101
- package/tsconfig.json +0 -8
package/dist/installPaths.cjs.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function toSlug(name) {
|
|
4
|
-
return name.toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, "");
|
|
5
|
-
}
|
|
6
|
-
const CONVENTIONS = {
|
|
7
|
-
instruction: {
|
|
8
|
-
"claude-code": (name) => `.claude/rules/${name}.md`,
|
|
9
|
-
"github-copilot": (name) => `.github/instructions/${name}.instructions.md`,
|
|
10
|
-
"google-gemini": (_) => `GEMINI.md`,
|
|
11
|
-
"cursor": (name) => `.cursor/rules/${name}.mdc`,
|
|
12
|
-
"all": (name) => `.ai/instructions/${name}.md`,
|
|
13
|
-
"default": (name) => `.ai/instructions/${name}.md`
|
|
14
|
-
},
|
|
15
|
-
agent: {
|
|
16
|
-
"claude-code": (name) => `.claude/agents/${name}.md`,
|
|
17
|
-
"github-copilot": (name) => `.github/agents/${name}.agent.md`,
|
|
18
|
-
"google-gemini": (_) => `GEMINI.md`,
|
|
19
|
-
"cursor": (name) => `.cursor/rules/${name}.mdc`,
|
|
20
|
-
"all": (name) => `.ai/agents/${name}.md`,
|
|
21
|
-
"default": (name) => `.ai/agents/${name}.md`
|
|
22
|
-
},
|
|
23
|
-
skill: {
|
|
24
|
-
"claude-code": (name) => `.claude/skills/${name}/SKILL.md`,
|
|
25
|
-
"github-copilot": (name) => `.claude/skills/${name}/SKILL.md`,
|
|
26
|
-
"google-gemini": (name) => `.claude/skills/${name}/SKILL.md`,
|
|
27
|
-
"cursor": (name) => `.cursor/skills/${name}/SKILL.md`,
|
|
28
|
-
"all": (name) => `.claude/skills/${name}/SKILL.md`,
|
|
29
|
-
"default": (name) => `.claude/skills/${name}/SKILL.md`
|
|
30
|
-
},
|
|
31
|
-
workflow: {
|
|
32
|
-
"claude-code": (name) => `.claude/workflows/${name}.md`,
|
|
33
|
-
"github-copilot": (name) => `.github/workflows/${name}.workflow.md`,
|
|
34
|
-
"google-gemini": (name) => `.gemini/workflows/${name}.md`,
|
|
35
|
-
"cursor": (name) => `.cursor/rules/${name}.mdc`,
|
|
36
|
-
"all": (name) => `.ai/workflows/${name}.md`,
|
|
37
|
-
"default": (name) => `.ai/workflows/${name}.md`
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
function getInstallPath(type, tool, name, overrides) {
|
|
41
|
-
if (overrides?.installPaths?.[tool]) return overrides.installPaths[tool];
|
|
42
|
-
if (overrides?.installPath) return overrides.installPath;
|
|
43
|
-
const slug = toSlug(name);
|
|
44
|
-
const toolConventions = CONVENTIONS[type];
|
|
45
|
-
const fn = toolConventions[tool] ?? toolConventions.default;
|
|
46
|
-
return fn(slug);
|
|
47
|
-
}
|
|
48
|
-
function getInstallPathsForAsset(type, tools, name, overrides) {
|
|
49
|
-
const ALL_TOOLS = ["claude-code", "github-copilot", "google-gemini", "cursor"];
|
|
50
|
-
const resolvedTools = tools.includes("all") ? ALL_TOOLS : tools;
|
|
51
|
-
return Object.fromEntries(
|
|
52
|
-
resolvedTools.map((tool) => [tool, getInstallPath(type, tool, name, overrides)])
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
exports.getInstallPath = getInstallPath;
|
|
57
|
-
exports.getInstallPathsForAsset = getInstallPathsForAsset;
|
|
58
|
-
//# sourceMappingURL=installPaths.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"installPaths.cjs.js","sources":["../src/installPaths.ts"],"sourcesContent":["import type { AssetType, AiTool } from './types';\n\n/** Sanitize asset name for use in file paths */\nfunction toSlug(name: string): string {\n return name.toLowerCase().replace(/\\s+/g, '-').replace(/[^a-z0-9-_]/g, '');\n}\n\n/**\n * Convention table: (type, tool) → install path template.\n * Returns the recommended filesystem path for an asset given the target tool.\n *\n * Priority: installPaths[tool] > installPath > convention below.\n */\nconst CONVENTIONS: Record<AssetType, Record<AiTool | 'default', (name: string) => string>> = {\n instruction: {\n 'claude-code': name => `.claude/rules/${name}.md`,\n 'github-copilot': name => `.github/instructions/${name}.instructions.md`,\n 'google-gemini': _ => `GEMINI.md`,\n 'cursor': name => `.cursor/rules/${name}.mdc`,\n 'all': name => `.ai/instructions/${name}.md`,\n 'default': name => `.ai/instructions/${name}.md`,\n },\n agent: {\n 'claude-code': name => `.claude/agents/${name}.md`,\n 'github-copilot': name => `.github/agents/${name}.agent.md`,\n 'google-gemini': _ => `GEMINI.md`,\n 'cursor': name => `.cursor/rules/${name}.mdc`,\n 'all': name => `.ai/agents/${name}.md`,\n 'default': name => `.ai/agents/${name}.md`,\n },\n skill: {\n 'claude-code': name => `.claude/skills/${name}/SKILL.md`,\n 'github-copilot': name => `.claude/skills/${name}/SKILL.md`,\n 'google-gemini': name => `.claude/skills/${name}/SKILL.md`,\n 'cursor': name => `.cursor/skills/${name}/SKILL.md`,\n 'all': name => `.claude/skills/${name}/SKILL.md`,\n 'default': name => `.claude/skills/${name}/SKILL.md`,\n },\n workflow: {\n 'claude-code': name => `.claude/workflows/${name}.md`,\n 'github-copilot': name => `.github/workflows/${name}.workflow.md`,\n 'google-gemini': name => `.gemini/workflows/${name}.md`,\n 'cursor': name => `.cursor/rules/${name}.mdc`,\n 'all': name => `.ai/workflows/${name}.md`,\n 'default': name => `.ai/workflows/${name}.md`,\n },\n};\n\nexport interface InstallPathOverrides {\n /** Single path override — applies to all tools when installPaths has no entry for the tool */\n installPath?: string;\n /** Per-tool path overrides — highest priority */\n installPaths?: Record<string, string>;\n}\n\n/**\n * Returns the recommended install path for an asset in a given tool's workspace.\n * Resolution order: installPaths[tool] > installPath > built-in convention.\n */\nexport function getInstallPath(\n type: AssetType,\n tool: AiTool | string,\n name: string,\n overrides?: InstallPathOverrides,\n): string {\n if (overrides?.installPaths?.[tool]) return overrides.installPaths[tool];\n if (overrides?.installPath) return overrides.installPath;\n\n const slug = toSlug(name);\n const toolConventions = CONVENTIONS[type];\n const fn = toolConventions[tool as AiTool] ?? toolConventions.default;\n return fn(slug);\n}\n\n/**\n * Returns install paths for all tools in the asset's tools list.\n * If tools contains 'all', returns paths for every known tool.\n */\nexport function getInstallPathsForAsset(\n type: AssetType,\n tools: (AiTool | string)[],\n name: string,\n overrides?: InstallPathOverrides,\n): Record<string, string> {\n const ALL_TOOLS: AiTool[] = ['claude-code', 'github-copilot', 'google-gemini', 'cursor'];\n const resolvedTools = tools.includes('all') ? ALL_TOOLS : tools;\n\n return Object.fromEntries(\n resolvedTools.map(tool => [tool, getInstallPath(type, tool, name, overrides)]),\n );\n}\n"],"names":[],"mappings":";;AAGA,SAAS,OAAO,IAAA,EAAsB;AACpC,EAAA,OAAO,IAAA,CAAK,aAAY,C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A,IAAI,SAAA,EAAW,WAAA,EAAa,OAAO,SAAA,CAAU,WAAA;AAE7C,EAAA,MAAM,IAAA,GAAO,OAAO,IAAI,CAAA;AACxB,EAAA,MAAM,eAAA,GAAkB,YAAY,IAAI,CAAA;AACxC,EAAA,MAAM,EAAA,GAAK,eAAA,CAAgB,IAAc,CAAA,IAAK,eAAA,CAAgB,OAAA;AAC9D,EAAA,OAAO,GAAG,IAAI,CAAA;AAChB;AAMO,SAAS,uBAAA,CACd,IAAA,EACA,KAAA,EACA,IAAA,EACA,SAAA,EACwB;AACxB,EAAA,MAAM,SAAA,GAAsB,CAAC,aAAA,EAAe,gBAAA,EAAkB,iBAAiB,QAAQ,CAAA;AACvF,EAAA,MAAM,aAAA,GAAgB,KAAA,CAAM,QAAA,CAAS,KAAK,IAAI,SAAA,GAAY,KAAA;AAE1D,EAAA,OAAO,MAAA,CAAO,WAAA;AAAA,IACZ,aAAA,CAAc,GAAA,CAAI,CAAA,IAAA,KAAQ,CAAC,IAAA,EAAM,cAAA,CAAe,IAAA,EAAM,IAAA,EAAM,IAAA,EAAM,SAAS,CAAC,CAAC;AAAA,GAC/E;AACF;;;;;"}
|
package/dist/installPaths.esm.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
function toSlug(name) {
|
|
2
|
-
return name.toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, "");
|
|
3
|
-
}
|
|
4
|
-
const CONVENTIONS = {
|
|
5
|
-
instruction: {
|
|
6
|
-
"claude-code": (name) => `.claude/rules/${name}.md`,
|
|
7
|
-
"github-copilot": (name) => `.github/instructions/${name}.instructions.md`,
|
|
8
|
-
"google-gemini": (_) => `GEMINI.md`,
|
|
9
|
-
"cursor": (name) => `.cursor/rules/${name}.mdc`,
|
|
10
|
-
"all": (name) => `.ai/instructions/${name}.md`,
|
|
11
|
-
"default": (name) => `.ai/instructions/${name}.md`
|
|
12
|
-
},
|
|
13
|
-
agent: {
|
|
14
|
-
"claude-code": (name) => `.claude/agents/${name}.md`,
|
|
15
|
-
"github-copilot": (name) => `.github/agents/${name}.agent.md`,
|
|
16
|
-
"google-gemini": (_) => `GEMINI.md`,
|
|
17
|
-
"cursor": (name) => `.cursor/rules/${name}.mdc`,
|
|
18
|
-
"all": (name) => `.ai/agents/${name}.md`,
|
|
19
|
-
"default": (name) => `.ai/agents/${name}.md`
|
|
20
|
-
},
|
|
21
|
-
skill: {
|
|
22
|
-
"claude-code": (name) => `.claude/skills/${name}/SKILL.md`,
|
|
23
|
-
"github-copilot": (name) => `.claude/skills/${name}/SKILL.md`,
|
|
24
|
-
"google-gemini": (name) => `.claude/skills/${name}/SKILL.md`,
|
|
25
|
-
"cursor": (name) => `.cursor/skills/${name}/SKILL.md`,
|
|
26
|
-
"all": (name) => `.claude/skills/${name}/SKILL.md`,
|
|
27
|
-
"default": (name) => `.claude/skills/${name}/SKILL.md`
|
|
28
|
-
},
|
|
29
|
-
workflow: {
|
|
30
|
-
"claude-code": (name) => `.claude/workflows/${name}.md`,
|
|
31
|
-
"github-copilot": (name) => `.github/workflows/${name}.workflow.md`,
|
|
32
|
-
"google-gemini": (name) => `.gemini/workflows/${name}.md`,
|
|
33
|
-
"cursor": (name) => `.cursor/rules/${name}.mdc`,
|
|
34
|
-
"all": (name) => `.ai/workflows/${name}.md`,
|
|
35
|
-
"default": (name) => `.ai/workflows/${name}.md`
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
function getInstallPath(type, tool, name, overrides) {
|
|
39
|
-
if (overrides?.installPaths?.[tool]) return overrides.installPaths[tool];
|
|
40
|
-
if (overrides?.installPath) return overrides.installPath;
|
|
41
|
-
const slug = toSlug(name);
|
|
42
|
-
const toolConventions = CONVENTIONS[type];
|
|
43
|
-
const fn = toolConventions[tool] ?? toolConventions.default;
|
|
44
|
-
return fn(slug);
|
|
45
|
-
}
|
|
46
|
-
function getInstallPathsForAsset(type, tools, name, overrides) {
|
|
47
|
-
const ALL_TOOLS = ["claude-code", "github-copilot", "google-gemini", "cursor"];
|
|
48
|
-
const resolvedTools = tools.includes("all") ? ALL_TOOLS : tools;
|
|
49
|
-
return Object.fromEntries(
|
|
50
|
-
resolvedTools.map((tool) => [tool, getInstallPath(type, tool, name, overrides)])
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export { getInstallPath, getInstallPathsForAsset };
|
|
55
|
-
//# sourceMappingURL=installPaths.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"installPaths.esm.js","sources":["../src/installPaths.ts"],"sourcesContent":["import type { AssetType, AiTool } from './types';\n\n/** Sanitize asset name for use in file paths */\nfunction toSlug(name: string): string {\n return name.toLowerCase().replace(/\\s+/g, '-').replace(/[^a-z0-9-_]/g, '');\n}\n\n/**\n * Convention table: (type, tool) → install path template.\n * Returns the recommended filesystem path for an asset given the target tool.\n *\n * Priority: installPaths[tool] > installPath > convention below.\n */\nconst CONVENTIONS: Record<AssetType, Record<AiTool | 'default', (name: string) => string>> = {\n instruction: {\n 'claude-code': name => `.claude/rules/${name}.md`,\n 'github-copilot': name => `.github/instructions/${name}.instructions.md`,\n 'google-gemini': _ => `GEMINI.md`,\n 'cursor': name => `.cursor/rules/${name}.mdc`,\n 'all': name => `.ai/instructions/${name}.md`,\n 'default': name => `.ai/instructions/${name}.md`,\n },\n agent: {\n 'claude-code': name => `.claude/agents/${name}.md`,\n 'github-copilot': name => `.github/agents/${name}.agent.md`,\n 'google-gemini': _ => `GEMINI.md`,\n 'cursor': name => `.cursor/rules/${name}.mdc`,\n 'all': name => `.ai/agents/${name}.md`,\n 'default': name => `.ai/agents/${name}.md`,\n },\n skill: {\n 'claude-code': name => `.claude/skills/${name}/SKILL.md`,\n 'github-copilot': name => `.claude/skills/${name}/SKILL.md`,\n 'google-gemini': name => `.claude/skills/${name}/SKILL.md`,\n 'cursor': name => `.cursor/skills/${name}/SKILL.md`,\n 'all': name => `.claude/skills/${name}/SKILL.md`,\n 'default': name => `.claude/skills/${name}/SKILL.md`,\n },\n workflow: {\n 'claude-code': name => `.claude/workflows/${name}.md`,\n 'github-copilot': name => `.github/workflows/${name}.workflow.md`,\n 'google-gemini': name => `.gemini/workflows/${name}.md`,\n 'cursor': name => `.cursor/rules/${name}.mdc`,\n 'all': name => `.ai/workflows/${name}.md`,\n 'default': name => `.ai/workflows/${name}.md`,\n },\n};\n\nexport interface InstallPathOverrides {\n /** Single path override — applies to all tools when installPaths has no entry for the tool */\n installPath?: string;\n /** Per-tool path overrides — highest priority */\n installPaths?: Record<string, string>;\n}\n\n/**\n * Returns the recommended install path for an asset in a given tool's workspace.\n * Resolution order: installPaths[tool] > installPath > built-in convention.\n */\nexport function getInstallPath(\n type: AssetType,\n tool: AiTool | string,\n name: string,\n overrides?: InstallPathOverrides,\n): string {\n if (overrides?.installPaths?.[tool]) return overrides.installPaths[tool];\n if (overrides?.installPath) return overrides.installPath;\n\n const slug = toSlug(name);\n const toolConventions = CONVENTIONS[type];\n const fn = toolConventions[tool as AiTool] ?? toolConventions.default;\n return fn(slug);\n}\n\n/**\n * Returns install paths for all tools in the asset's tools list.\n * If tools contains 'all', returns paths for every known tool.\n */\nexport function getInstallPathsForAsset(\n type: AssetType,\n tools: (AiTool | string)[],\n name: string,\n overrides?: InstallPathOverrides,\n): Record<string, string> {\n const ALL_TOOLS: AiTool[] = ['claude-code', 'github-copilot', 'google-gemini', 'cursor'];\n const resolvedTools = tools.includes('all') ? ALL_TOOLS : tools;\n\n return Object.fromEntries(\n resolvedTools.map(tool => [tool, getInstallPath(type, tool, name, overrides)]),\n );\n}\n"],"names":[],"mappings":"AAGA,SAAS,OAAO,IAAA,EAAsB;AACpC,EAAA,OAAO,IAAA,CAAK,aAAY,CAAE,OAAA,CAAQ,QAAQ,GAAG,CAAA,CAAE,OAAA,CAAQ,cAAA,EAAgB,EAAE,CAAA;AAC3E;AAQA,MAAM,WAAA,GAAuF;AAAA,EAC3F,WAAA,EAAa;AAAA,IACX,aAAA,EAAkB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AAA,MAAM,EAAA,GAAK,eAAA,CAAgB,IAAc,CAAA,IAAK,eAAA,CAAgB,OAAA;AAC9D,EAAA,OAAO,GAAG,IAAI,CAAA;AAChB;AAMO,SAAS,uBAAA,CACd,IAAA,EACA,KAAA,EACA,IAAA,EACA,SAAA,EACwB;AACxB,EAAA,MAAM,SAAA,GAAsB,CAAC,aAAA,EAAe,gBAAA,EAAkB,iBAAiB,QAAQ,CAAA;AACvF,EAAA,MAAM,aAAA,GAAgB,KAAA,CAAM,QAAA,CAAS,KAAK,IAAI,SAAA,GAAY,KAAA;AAE1D,EAAA,OAAO,MAAA,CAAO,WAAA;AAAA,IACZ,aAAA,CAAc,GAAA,CAAI,CAAA,IAAA,KAAQ,CAAC,IAAA,EAAM,cAAA,CAAe,IAAA,EAAM,IAAA,EAAM,IAAA,EAAM,SAAS,CAAC,CAAC;AAAA,GAC/E;AACF;;;;"}
|
package/dist/schemas.cjs.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var zod = require('zod');
|
|
4
|
-
|
|
5
|
-
const AiToolEnum = zod.z.enum([
|
|
6
|
-
"all",
|
|
7
|
-
"github-copilot",
|
|
8
|
-
"claude-code",
|
|
9
|
-
"google-gemini",
|
|
10
|
-
"cursor"
|
|
11
|
-
]);
|
|
12
|
-
const AssetTypeEnum = zod.z.enum([
|
|
13
|
-
"instruction",
|
|
14
|
-
"agent",
|
|
15
|
-
"skill",
|
|
16
|
-
"workflow"
|
|
17
|
-
]);
|
|
18
|
-
const AiAssetFrontmatterSchema = zod.z.object({
|
|
19
|
-
/** Path to the .md content file, relative to the .yaml file directory.
|
|
20
|
-
* If omitted, the parser falls back to <same-name>.md by convention. */
|
|
21
|
-
content: zod.z.string().optional(),
|
|
22
|
-
name: zod.z.string().min(1).max(200),
|
|
23
|
-
/** Human-readable display label shown in the UI. Falls back to `name` when omitted. */
|
|
24
|
-
label: zod.z.string().min(1).max(200).optional(),
|
|
25
|
-
description: zod.z.string().min(1).max(500),
|
|
26
|
-
type: AssetTypeEnum,
|
|
27
|
-
tools: zod.z.array(AiToolEnum).min(1),
|
|
28
|
-
tags: zod.z.array(zod.z.string()).optional().default([]),
|
|
29
|
-
author: zod.z.string().optional().default("Unknown"),
|
|
30
|
-
icon: zod.z.string().optional(),
|
|
31
|
-
version: zod.z.string().optional().default("1.0.0"),
|
|
32
|
-
updatedAt: zod.z.string().optional(),
|
|
33
|
-
// install path overrides
|
|
34
|
-
installPath: zod.z.string().optional(),
|
|
35
|
-
installPaths: zod.z.record(zod.z.string()).optional(),
|
|
36
|
-
// skill-specific
|
|
37
|
-
resources: zod.z.array(zod.z.string()).optional()
|
|
38
|
-
}).passthrough();
|
|
39
|
-
|
|
40
|
-
exports.AiAssetFrontmatterSchema = AiAssetFrontmatterSchema;
|
|
41
|
-
exports.AiToolEnum = AiToolEnum;
|
|
42
|
-
exports.AssetTypeEnum = AssetTypeEnum;
|
|
43
|
-
//# sourceMappingURL=schemas.cjs.js.map
|
package/dist/schemas.cjs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.cjs.js","sources":["../src/schemas.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport const AiToolEnum = z.enum([\n 'all',\n 'github-copilot',\n 'claude-code',\n 'google-gemini',\n 'cursor',\n]);\n\nexport const AssetTypeEnum = z.enum([\n 'instruction',\n 'agent',\n 'skill',\n 'workflow',\n]);\n\n/**\n * Schema for the YAML metadata file (.yaml) that acts as an envelope.\n * The actual asset content lives in the referenced .md file.\n */\nexport const AiAssetFrontmatterSchema = z\n .object({\n /** Path to the .md content file, relative to the .yaml file directory.\n * If omitted, the parser falls back to <same-name>.md by convention. */\n content: z.string().optional(),\n name: z.string().min(1).max(200),\n /** Human-readable display label shown in the UI. Falls back to `name` when omitted. */\n label: z.string().min(1).max(200).optional(),\n description: z.string().min(1).max(500),\n type: AssetTypeEnum,\n tools: z.array(AiToolEnum).min(1),\n tags: z.array(z.string()).optional().default([]),\n author: z.string().optional().default('Unknown'),\n icon: z.string().optional(),\n version: z.string().optional().default('1.0.0'),\n updatedAt: z.string().optional(),\n // install path overrides\n installPath: z.string().optional(),\n installPaths: z.record(z.string()).optional(),\n // skill-specific\n resources: z.array(z.string()).optional(),\n })\n .passthrough();\n\nexport type AiAssetFrontmatter = z.infer<typeof AiAssetFrontmatterSchema>;\n"],"names":["z"],"mappings":";;;;AAEO,MAAM,UAAA,GAAaA,MAAE,IAAA,CAAK;AAAA,EAC/B,KAAA;AAAA,EACA,gBAAA;AAAA,EACA,aAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAC;AAEM,MAAM,aAAA,GAAgBA,MAAE,IAAA,CAAK;AAAA,EAClC,aAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAC;AAMM,MAAM,wBAAA,GAA2BA,MACrC,MAAA,CAAO;AAAA;AAAA;AAAA,EAGN,OAAA,EAASA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EAC7B,IAAA,EAAMA,MAAE,MAAA,EAAO,CAAE,IAAI,CAAC,CAAA,CAAE,IAAI,GAAG,CAAA;AAAA;AAAA,EAE/B,KAAA,EAAOA,KAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,GAAG,CAAA,CAAE,QAAA,EAAS;AAAA,EAC3C,WAAA,EAAaA,MAAE,MAAA,EAAO,CAAE,IAAI,CAAC,CAAA,CAAE,IAAI,GAAG,CAAA;AAAA,EACtC,IAAA,EAAM,aAAA;AAAA,EACN,OAAOA,KAAA,CAAE,KAAA,CAAM,UAAU,CAAA,CAAE,IAAI,CAAC,CAAA;AAAA,EAChC,IAAA,EAAMA,KAAA,CAAE,KAAA,CAAMA,KAAA,CAAE,MAAA,EAAQ,CAAA,CAAE,QAAA,EAAS,CAAE,OAAA,CAAQ,EAAE,CAAA;AAAA,EAC/C,QAAQA,KAAA,CAAE,MAAA,GAAS,QAAA,EAAS,CAAE,QAAQ,SAAS,CAAA;AAAA,EAC/C,IAAA,EAAMA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EAC1B,SAASA,KAAA,CAAE,MAAA,GAAS,QAAA,EAAS,CAAE,QAAQ,OAAO,CAAA;AAAA,EAC9C,SAAA,EAAWA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA,EAE/B,WAAA,EAAaA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EACjC,cAAcA,KAAA,CAAE,MAAA,CAAOA,MAAE,MAAA,EAAQ,EAAE,QAAA,EAAS;AAAA;AAAA,EAE5C,WAAWA,KAAA,CAAE,KAAA,CAAMA,MAAE,MAAA,EAAQ,EAAE,QAAA;AACjC,CAAC,EACA,WAAA;;;;;;"}
|
package/dist/schemas.esm.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
const AiToolEnum = z.enum([
|
|
4
|
-
"all",
|
|
5
|
-
"github-copilot",
|
|
6
|
-
"claude-code",
|
|
7
|
-
"google-gemini",
|
|
8
|
-
"cursor"
|
|
9
|
-
]);
|
|
10
|
-
const AssetTypeEnum = z.enum([
|
|
11
|
-
"instruction",
|
|
12
|
-
"agent",
|
|
13
|
-
"skill",
|
|
14
|
-
"workflow"
|
|
15
|
-
]);
|
|
16
|
-
const AiAssetFrontmatterSchema = z.object({
|
|
17
|
-
/** Path to the .md content file, relative to the .yaml file directory.
|
|
18
|
-
* If omitted, the parser falls back to <same-name>.md by convention. */
|
|
19
|
-
content: z.string().optional(),
|
|
20
|
-
name: z.string().min(1).max(200),
|
|
21
|
-
/** Human-readable display label shown in the UI. Falls back to `name` when omitted. */
|
|
22
|
-
label: z.string().min(1).max(200).optional(),
|
|
23
|
-
description: z.string().min(1).max(500),
|
|
24
|
-
type: AssetTypeEnum,
|
|
25
|
-
tools: z.array(AiToolEnum).min(1),
|
|
26
|
-
tags: z.array(z.string()).optional().default([]),
|
|
27
|
-
author: z.string().optional().default("Unknown"),
|
|
28
|
-
icon: z.string().optional(),
|
|
29
|
-
version: z.string().optional().default("1.0.0"),
|
|
30
|
-
updatedAt: z.string().optional(),
|
|
31
|
-
// install path overrides
|
|
32
|
-
installPath: z.string().optional(),
|
|
33
|
-
installPaths: z.record(z.string()).optional(),
|
|
34
|
-
// skill-specific
|
|
35
|
-
resources: z.array(z.string()).optional()
|
|
36
|
-
}).passthrough();
|
|
37
|
-
|
|
38
|
-
export { AiAssetFrontmatterSchema, AiToolEnum, AssetTypeEnum };
|
|
39
|
-
//# sourceMappingURL=schemas.esm.js.map
|
package/dist/schemas.esm.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.esm.js","sources":["../src/schemas.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport const AiToolEnum = z.enum([\n 'all',\n 'github-copilot',\n 'claude-code',\n 'google-gemini',\n 'cursor',\n]);\n\nexport const AssetTypeEnum = z.enum([\n 'instruction',\n 'agent',\n 'skill',\n 'workflow',\n]);\n\n/**\n * Schema for the YAML metadata file (.yaml) that acts as an envelope.\n * The actual asset content lives in the referenced .md file.\n */\nexport const AiAssetFrontmatterSchema = z\n .object({\n /** Path to the .md content file, relative to the .yaml file directory.\n * If omitted, the parser falls back to <same-name>.md by convention. */\n content: z.string().optional(),\n name: z.string().min(1).max(200),\n /** Human-readable display label shown in the UI. Falls back to `name` when omitted. */\n label: z.string().min(1).max(200).optional(),\n description: z.string().min(1).max(500),\n type: AssetTypeEnum,\n tools: z.array(AiToolEnum).min(1),\n tags: z.array(z.string()).optional().default([]),\n author: z.string().optional().default('Unknown'),\n icon: z.string().optional(),\n version: z.string().optional().default('1.0.0'),\n updatedAt: z.string().optional(),\n // install path overrides\n installPath: z.string().optional(),\n installPaths: z.record(z.string()).optional(),\n // skill-specific\n resources: z.array(z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AAQ,OAAO,CAAA;AAAA,EAC9C,SAAA,EAAW,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA,EAE/B,WAAA,EAAa,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EACjC,cAAc,CAAA,CAAE,MAAA,CAAO,EAAE,MAAA,EAAQ,EAAE,QAAA,EAAS;AAAA;AAAA,EAE5C,WAAW,CAAA,CAAE,KAAA,CAAM,EAAE,MAAA,EAAQ,EAAE,QAAA;AACjC,CAAC,EACA,WAAA;;;;"}
|
package/package.json-prepack
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@nospt/plugin-dev-ai-hub-common",
|
|
3
|
-
"version": "0.2.3",
|
|
4
|
-
"description": "Common types and schemas for Dev AI Hub",
|
|
5
|
-
"license": "Apache-2.0",
|
|
6
|
-
"main": "src/index.ts",
|
|
7
|
-
"types": "src/index.ts",
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "https://github.com/nosportugal/backstage-plugin-dev-ai-hub"
|
|
11
|
-
},
|
|
12
|
-
"publishConfig": {
|
|
13
|
-
"access": "public"
|
|
14
|
-
},
|
|
15
|
-
"exports": {
|
|
16
|
-
".": "./src/index.ts",
|
|
17
|
-
"./package.json": "./package.json"
|
|
18
|
-
},
|
|
19
|
-
"typesVersions": {
|
|
20
|
-
"*": {
|
|
21
|
-
"package.json": [
|
|
22
|
-
"package.json"
|
|
23
|
-
]
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"backstage": {
|
|
27
|
-
"role": "common-library",
|
|
28
|
-
"pluginId": "dev-ai-hub",
|
|
29
|
-
"pluginPackages": [
|
|
30
|
-
"@nospt/plugin-dev-ai-hub",
|
|
31
|
-
"@nospt/plugin-dev-ai-hub-backend",
|
|
32
|
-
"@nospt/plugin-dev-ai-hub-common",
|
|
33
|
-
"@nospt/plugin-dev-ai-hub-node"
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
|
-
"sideEffects": false,
|
|
37
|
-
"scripts": {
|
|
38
|
-
"build": "backstage-cli package build",
|
|
39
|
-
"clean": "backstage-cli package clean",
|
|
40
|
-
"lint": "backstage-cli package lint",
|
|
41
|
-
"prepack": "backstage-cli package prepack",
|
|
42
|
-
"postpack": "backstage-cli package postpack",
|
|
43
|
-
"test": "backstage-cli package test --passWithNoTests --watchAll=false",
|
|
44
|
-
"tsc": "tsc --noEmit"
|
|
45
|
-
},
|
|
46
|
-
"dependencies": {
|
|
47
|
-
"zod": "^3.22.0"
|
|
48
|
-
},
|
|
49
|
-
"devDependencies": {
|
|
50
|
-
"@backstage/cli": "^0.36.1",
|
|
51
|
-
"@types/jest": "^29.0.0",
|
|
52
|
-
"jest": "^29.0.0",
|
|
53
|
-
"jest-environment-jsdom": "^29.0.0"
|
|
54
|
-
}
|
|
55
|
-
}
|
package/src/index.ts
DELETED
package/src/installPaths.test.ts
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { getInstallPath, getInstallPathsForAsset } from './installPaths';
|
|
2
|
-
|
|
3
|
-
describe('getInstallPath', () => {
|
|
4
|
-
describe('claude-code conventions', () => {
|
|
5
|
-
it('instruction → .claude/rules/', () => {
|
|
6
|
-
expect(getInstallPath('instruction', 'claude-code', 'My Rule')).toBe('.claude/rules/my-rule.md');
|
|
7
|
-
});
|
|
8
|
-
it('agent → .claude/agents/', () => {
|
|
9
|
-
expect(getInstallPath('agent', 'claude-code', 'My Agent')).toBe('.claude/agents/my-agent.md');
|
|
10
|
-
});
|
|
11
|
-
it('skill → .claude/skills/<name>/SKILL.md', () => {
|
|
12
|
-
expect(getInstallPath('skill', 'claude-code', 'My Skill')).toBe('.claude/skills/my-skill/SKILL.md');
|
|
13
|
-
});
|
|
14
|
-
it('workflow → .claude/workflows/', () => {
|
|
15
|
-
expect(getInstallPath('workflow', 'claude-code', 'My Workflow')).toBe('.claude/workflows/my-workflow.md');
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
describe('github-copilot conventions', () => {
|
|
20
|
-
it('instruction → .github/instructions/*.instructions.md', () => {
|
|
21
|
-
expect(getInstallPath('instruction', 'github-copilot', 'My Rule')).toBe(
|
|
22
|
-
'.github/instructions/my-rule.instructions.md',
|
|
23
|
-
);
|
|
24
|
-
});
|
|
25
|
-
it('agent → .github/agents/*.agent.md', () => {
|
|
26
|
-
expect(getInstallPath('agent', 'github-copilot', 'My Agent')).toBe('.github/agents/my-agent.agent.md');
|
|
27
|
-
});
|
|
28
|
-
it('workflow → .github/workflows/*.workflow.md', () => {
|
|
29
|
-
expect(getInstallPath('workflow', 'github-copilot', 'My Workflow')).toBe(
|
|
30
|
-
'.github/workflows/my-workflow.workflow.md',
|
|
31
|
-
);
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
describe('google-gemini conventions', () => {
|
|
36
|
-
it('instruction → GEMINI.md (ignores name)', () => {
|
|
37
|
-
expect(getInstallPath('instruction', 'google-gemini', 'Anything')).toBe('GEMINI.md');
|
|
38
|
-
});
|
|
39
|
-
it('agent → GEMINI.md (ignores name)', () => {
|
|
40
|
-
expect(getInstallPath('agent', 'google-gemini', 'My Agent')).toBe('GEMINI.md');
|
|
41
|
-
});
|
|
42
|
-
it('workflow → .gemini/workflows/', () => {
|
|
43
|
-
expect(getInstallPath('workflow', 'google-gemini', 'My Workflow')).toBe('.gemini/workflows/my-workflow.md');
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
describe('cursor conventions', () => {
|
|
48
|
-
it('instruction → .cursor/rules/*.mdc', () => {
|
|
49
|
-
expect(getInstallPath('instruction', 'cursor', 'My Rule')).toBe('.cursor/rules/my-rule.mdc');
|
|
50
|
-
});
|
|
51
|
-
it('skill → .cursor/skills/<name>/SKILL.md', () => {
|
|
52
|
-
expect(getInstallPath('skill', 'cursor', 'My Skill')).toBe('.cursor/skills/my-skill/SKILL.md');
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
describe('slug normalization', () => {
|
|
57
|
-
it('lowercases the name', () => {
|
|
58
|
-
expect(getInstallPath('instruction', 'claude-code', 'UPPERCASE')).toBe('.claude/rules/uppercase.md');
|
|
59
|
-
});
|
|
60
|
-
it('replaces spaces with hyphens', () => {
|
|
61
|
-
expect(getInstallPath('instruction', 'claude-code', 'My Fancy Rule')).toBe('.claude/rules/my-fancy-rule.md');
|
|
62
|
-
});
|
|
63
|
-
it('removes special characters', () => {
|
|
64
|
-
expect(getInstallPath('instruction', 'claude-code', 'Rule (v2)!')).toBe('.claude/rules/rule-v2.md');
|
|
65
|
-
});
|
|
66
|
-
it('preserves underscores', () => {
|
|
67
|
-
expect(getInstallPath('instruction', 'claude-code', 'my_rule')).toBe('.claude/rules/my_rule.md');
|
|
68
|
-
});
|
|
69
|
-
it('preserves hyphens', () => {
|
|
70
|
-
expect(getInstallPath('instruction', 'claude-code', 'my-rule')).toBe('.claude/rules/my-rule.md');
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
describe('overrides', () => {
|
|
75
|
-
it('installPaths[tool] has highest priority', () => {
|
|
76
|
-
expect(
|
|
77
|
-
getInstallPath('instruction', 'claude-code', 'My Rule', {
|
|
78
|
-
installPaths: { 'claude-code': 'custom/path.md' },
|
|
79
|
-
installPath: 'fallback.md',
|
|
80
|
-
}),
|
|
81
|
-
).toBe('custom/path.md');
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it('installPath overrides convention when no tool-specific override', () => {
|
|
85
|
-
expect(
|
|
86
|
-
getInstallPath('instruction', 'claude-code', 'My Rule', {
|
|
87
|
-
installPath: 'fallback.md',
|
|
88
|
-
}),
|
|
89
|
-
).toBe('fallback.md');
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
it('uses convention when override exists for a different tool', () => {
|
|
93
|
-
expect(
|
|
94
|
-
getInstallPath('instruction', 'github-copilot', 'My Rule', {
|
|
95
|
-
installPaths: { 'claude-code': 'custom/path.md' },
|
|
96
|
-
}),
|
|
97
|
-
).toBe('.github/instructions/my-rule.instructions.md');
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it('installPath covers when installPaths misses the tool', () => {
|
|
101
|
-
expect(
|
|
102
|
-
getInstallPath('instruction', 'github-copilot', 'My Rule', {
|
|
103
|
-
installPaths: { 'claude-code': 'custom/path.md' },
|
|
104
|
-
installPath: 'fallback.md',
|
|
105
|
-
}),
|
|
106
|
-
).toBe('fallback.md');
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
it('falls back to convention when no overrides are provided', () => {
|
|
110
|
-
expect(getInstallPath('instruction', 'claude-code', 'My Rule', {})).toBe('.claude/rules/my-rule.md');
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
describe('unknown tool', () => {
|
|
115
|
-
it('uses default convention for unrecognised tool identifier', () => {
|
|
116
|
-
expect(getInstallPath('instruction', 'unknown-tool', 'My Rule')).toBe('.ai/instructions/my-rule.md');
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
describe('getInstallPathsForAsset', () => {
|
|
122
|
-
it('returns paths only for the listed tools', () => {
|
|
123
|
-
const paths = getInstallPathsForAsset('instruction', ['claude-code', 'github-copilot'], 'My Rule');
|
|
124
|
-
expect(paths).toEqual({
|
|
125
|
-
'claude-code': '.claude/rules/my-rule.md',
|
|
126
|
-
'github-copilot': '.github/instructions/my-rule.instructions.md',
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
it('expands "all" to every known tool', () => {
|
|
131
|
-
const paths = getInstallPathsForAsset('instruction', ['all'], 'My Rule');
|
|
132
|
-
expect(Object.keys(paths).sort()).toEqual(['claude-code', 'cursor', 'github-copilot', 'google-gemini']);
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
it('applies per-tool overrides', () => {
|
|
136
|
-
const paths = getInstallPathsForAsset('agent', ['claude-code'], 'My Agent', {
|
|
137
|
-
installPaths: { 'claude-code': 'custom/agent.md' },
|
|
138
|
-
});
|
|
139
|
-
expect(paths['claude-code']).toBe('custom/agent.md');
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
it('applies installPath override for every tool', () => {
|
|
143
|
-
const paths = getInstallPathsForAsset('workflow', ['claude-code', 'github-copilot'], 'My Workflow', {
|
|
144
|
-
installPath: 'shared/workflow.md',
|
|
145
|
-
});
|
|
146
|
-
expect(paths['claude-code']).toBe('shared/workflow.md');
|
|
147
|
-
expect(paths['github-copilot']).toBe('shared/workflow.md');
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
it('returns an empty object for an empty tools array', () => {
|
|
151
|
-
const paths = getInstallPathsForAsset('instruction', [], 'My Rule');
|
|
152
|
-
expect(paths).toEqual({});
|
|
153
|
-
});
|
|
154
|
-
});
|
package/src/installPaths.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type { AssetType, AiTool } from './types';
|
|
2
|
-
|
|
3
|
-
/** Sanitize asset name for use in file paths */
|
|
4
|
-
function toSlug(name: string): string {
|
|
5
|
-
return name.toLowerCase().replace(/\s+/g, '-').replace(/[^a-z0-9-_]/g, '');
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Convention table: (type, tool) → install path template.
|
|
10
|
-
* Returns the recommended filesystem path for an asset given the target tool.
|
|
11
|
-
*
|
|
12
|
-
* Priority: installPaths[tool] > installPath > convention below.
|
|
13
|
-
*/
|
|
14
|
-
const CONVENTIONS: Record<AssetType, Record<AiTool | 'default', (name: string) => string>> = {
|
|
15
|
-
instruction: {
|
|
16
|
-
'claude-code': name => `.claude/rules/${name}.md`,
|
|
17
|
-
'github-copilot': name => `.github/instructions/${name}.instructions.md`,
|
|
18
|
-
'google-gemini': _ => `GEMINI.md`,
|
|
19
|
-
'cursor': name => `.cursor/rules/${name}.mdc`,
|
|
20
|
-
'all': name => `.ai/instructions/${name}.md`,
|
|
21
|
-
'default': name => `.ai/instructions/${name}.md`,
|
|
22
|
-
},
|
|
23
|
-
agent: {
|
|
24
|
-
'claude-code': name => `.claude/agents/${name}.md`,
|
|
25
|
-
'github-copilot': name => `.github/agents/${name}.agent.md`,
|
|
26
|
-
'google-gemini': _ => `GEMINI.md`,
|
|
27
|
-
'cursor': name => `.cursor/rules/${name}.mdc`,
|
|
28
|
-
'all': name => `.ai/agents/${name}.md`,
|
|
29
|
-
'default': name => `.ai/agents/${name}.md`,
|
|
30
|
-
},
|
|
31
|
-
skill: {
|
|
32
|
-
'claude-code': name => `.claude/skills/${name}/SKILL.md`,
|
|
33
|
-
'github-copilot': name => `.claude/skills/${name}/SKILL.md`,
|
|
34
|
-
'google-gemini': name => `.claude/skills/${name}/SKILL.md`,
|
|
35
|
-
'cursor': name => `.cursor/skills/${name}/SKILL.md`,
|
|
36
|
-
'all': name => `.claude/skills/${name}/SKILL.md`,
|
|
37
|
-
'default': name => `.claude/skills/${name}/SKILL.md`,
|
|
38
|
-
},
|
|
39
|
-
workflow: {
|
|
40
|
-
'claude-code': name => `.claude/workflows/${name}.md`,
|
|
41
|
-
'github-copilot': name => `.github/workflows/${name}.workflow.md`,
|
|
42
|
-
'google-gemini': name => `.gemini/workflows/${name}.md`,
|
|
43
|
-
'cursor': name => `.cursor/rules/${name}.mdc`,
|
|
44
|
-
'all': name => `.ai/workflows/${name}.md`,
|
|
45
|
-
'default': name => `.ai/workflows/${name}.md`,
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export interface InstallPathOverrides {
|
|
50
|
-
/** Single path override — applies to all tools when installPaths has no entry for the tool */
|
|
51
|
-
installPath?: string;
|
|
52
|
-
/** Per-tool path overrides — highest priority */
|
|
53
|
-
installPaths?: Record<string, string>;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Returns the recommended install path for an asset in a given tool's workspace.
|
|
58
|
-
* Resolution order: installPaths[tool] > installPath > built-in convention.
|
|
59
|
-
*/
|
|
60
|
-
export function getInstallPath(
|
|
61
|
-
type: AssetType,
|
|
62
|
-
tool: AiTool | string,
|
|
63
|
-
name: string,
|
|
64
|
-
overrides?: InstallPathOverrides,
|
|
65
|
-
): string {
|
|
66
|
-
if (overrides?.installPaths?.[tool]) return overrides.installPaths[tool];
|
|
67
|
-
if (overrides?.installPath) return overrides.installPath;
|
|
68
|
-
|
|
69
|
-
const slug = toSlug(name);
|
|
70
|
-
const toolConventions = CONVENTIONS[type];
|
|
71
|
-
const fn = toolConventions[tool as AiTool] ?? toolConventions.default;
|
|
72
|
-
return fn(slug);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Returns install paths for all tools in the asset's tools list.
|
|
77
|
-
* If tools contains 'all', returns paths for every known tool.
|
|
78
|
-
*/
|
|
79
|
-
export function getInstallPathsForAsset(
|
|
80
|
-
type: AssetType,
|
|
81
|
-
tools: (AiTool | string)[],
|
|
82
|
-
name: string,
|
|
83
|
-
overrides?: InstallPathOverrides,
|
|
84
|
-
): Record<string, string> {
|
|
85
|
-
const ALL_TOOLS: AiTool[] = ['claude-code', 'github-copilot', 'google-gemini', 'cursor'];
|
|
86
|
-
const resolvedTools = tools.includes('all') ? ALL_TOOLS : tools;
|
|
87
|
-
|
|
88
|
-
return Object.fromEntries(
|
|
89
|
-
resolvedTools.map(tool => [tool, getInstallPath(type, tool, name, overrides)]),
|
|
90
|
-
);
|
|
91
|
-
}
|
package/src/schemas.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
export const AiToolEnum = z.enum([
|
|
4
|
-
'all',
|
|
5
|
-
'github-copilot',
|
|
6
|
-
'claude-code',
|
|
7
|
-
'google-gemini',
|
|
8
|
-
'cursor',
|
|
9
|
-
]);
|
|
10
|
-
|
|
11
|
-
export const AssetTypeEnum = z.enum([
|
|
12
|
-
'instruction',
|
|
13
|
-
'agent',
|
|
14
|
-
'skill',
|
|
15
|
-
'workflow',
|
|
16
|
-
]);
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Schema for the YAML metadata file (.yaml) that acts as an envelope.
|
|
20
|
-
* The actual asset content lives in the referenced .md file.
|
|
21
|
-
*/
|
|
22
|
-
export const AiAssetFrontmatterSchema = z
|
|
23
|
-
.object({
|
|
24
|
-
/** Path to the .md content file, relative to the .yaml file directory.
|
|
25
|
-
* If omitted, the parser falls back to <same-name>.md by convention. */
|
|
26
|
-
content: z.string().optional(),
|
|
27
|
-
name: z.string().min(1).max(200),
|
|
28
|
-
/** Human-readable display label shown in the UI. Falls back to `name` when omitted. */
|
|
29
|
-
label: z.string().min(1).max(200).optional(),
|
|
30
|
-
description: z.string().min(1).max(500),
|
|
31
|
-
type: AssetTypeEnum,
|
|
32
|
-
tools: z.array(AiToolEnum).min(1),
|
|
33
|
-
tags: z.array(z.string()).optional().default([]),
|
|
34
|
-
author: z.string().optional().default('Unknown'),
|
|
35
|
-
icon: z.string().optional(),
|
|
36
|
-
version: z.string().optional().default('1.0.0'),
|
|
37
|
-
updatedAt: z.string().optional(),
|
|
38
|
-
// install path overrides
|
|
39
|
-
installPath: z.string().optional(),
|
|
40
|
-
installPaths: z.record(z.string()).optional(),
|
|
41
|
-
// skill-specific
|
|
42
|
-
resources: z.array(z.string()).optional(),
|
|
43
|
-
})
|
|
44
|
-
.passthrough();
|
|
45
|
-
|
|
46
|
-
export type AiAssetFrontmatter = z.infer<typeof AiAssetFrontmatterSchema>;
|