@aexol/opencode-wizard 0.3.4 → 0.3.6
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/README.md +11 -7
- package/dist/graphql-operations.d.ts +6 -2
- package/dist/graphql-operations.js +173 -156
- package/dist/graphql-operations.js.map +1 -1
- package/dist/plugin-tools.d.ts +37 -0
- package/dist/plugin-tools.js +58 -7
- package/dist/plugin-tools.js.map +1 -1
- package/dist/published-skills-system-note.js +3 -7
- package/dist/published-skills-system-note.js.map +1 -1
- package/dist/published-skills-terminology.d.ts +21 -0
- package/dist/published-skills-terminology.js +38 -0
- package/dist/published-skills-terminology.js.map +1 -0
- package/dist/published-skills-transform.d.ts +99 -2
- package/dist/published-skills-transform.js +91 -19
- package/dist/published-skills-transform.js.map +1 -1
- package/dist/server/auth-bootstrap.d.ts +7 -0
- package/dist/server/auth-bootstrap.js +89 -0
- package/dist/server/auth-bootstrap.js.map +1 -0
- package/dist/server/client.d.ts +30 -1
- package/dist/server/client.js +81 -1
- package/dist/server/client.js.map +1 -1
- package/dist/server/import-sources.d.ts +27 -0
- package/dist/server/import-sources.js +115 -0
- package/dist/server/import-sources.js.map +1 -0
- package/dist/server/preferences.d.ts +22 -0
- package/dist/server/preferences.js +121 -0
- package/dist/server/preferences.js.map +1 -0
- package/dist/server/runtime.d.ts +3 -22
- package/dist/server/runtime.js +567 -242
- package/dist/server/runtime.js.map +1 -1
- package/dist/server/types.d.ts +87 -0
- package/dist/server/types.js.map +1 -1
- package/dist/server.d.ts +1 -0
- package/dist/server.js +1 -0
- package/dist/server.js.map +1 -1
- package/dist/smoke-published-skills.js +4 -4
- package/dist/smoke-published-skills.js.map +1 -1
- package/dist/tui/components/common.d.ts +0 -1
- package/dist/tui/components/common.js +6 -29
- package/dist/tui/components/common.js.map +1 -1
- package/dist/tui/components/status-content.js +1 -1
- package/dist/tui/components/status-content.js.map +1 -1
- package/dist/tui/constants.d.ts +0 -5
- package/dist/tui/constants.js +0 -5
- package/dist/tui/constants.js.map +1 -1
- package/dist/tui/formatting.d.ts +0 -3
- package/dist/tui/formatting.js +1 -13
- package/dist/tui/formatting.js.map +1 -1
- package/dist/tui/skill-helpers.d.ts +1 -11
- package/dist/tui/skill-helpers.js +0 -41
- package/dist/tui/skill-helpers.js.map +1 -1
- package/dist/tui/slots.d.ts +1 -1
- package/dist/tui/slots.js +1 -24
- package/dist/tui/slots.js.map +1 -1
- package/dist/tui/status.js +2 -2
- package/dist/tui/status.js.map +1 -1
- package/dist/tui/types.d.ts +0 -19
- package/dist/tui/types.js.map +1 -1
- package/package.json +1 -1
- package/dist/tui/components/preference-action-notice-row.d.ts +0 -5
- package/dist/tui/components/preference-action-notice-row.js +0 -17
- package/dist/tui/components/preference-action-notice-row.js.map +0 -1
- package/dist/tui/components/skill-catalog-row.d.ts +0 -8
- package/dist/tui/components/skill-catalog-row.js +0 -124
- package/dist/tui/components/skill-catalog-row.js.map +0 -1
- package/dist/tui/components/wizard-skills-dialog-content.d.ts +0 -9
- package/dist/tui/components/wizard-skills-dialog-content.js +0 -219
- package/dist/tui/components/wizard-skills-dialog-content.js.map +0 -1
- package/dist/tui/components/wizard-skills-dialog.d.ts +0 -7
- package/dist/tui/components/wizard-skills-dialog.js +0 -156
- package/dist/tui/components/wizard-skills-dialog.js.map +0 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
const GETDESIGN_RAW_BASE = 'https://raw.githubusercontent.com/VoltAgent/awesome-design-md/main/design-md';
|
|
2
|
+
const tokenizeCommandLikeInput = input => {
|
|
3
|
+
const tokens = input.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g) ?? [];
|
|
4
|
+
return tokens.map(token => token.replace(/^("|')|("|')$/g, ''));
|
|
5
|
+
};
|
|
6
|
+
const normalizeSlug = value => {
|
|
7
|
+
return value.trim().toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');
|
|
8
|
+
};
|
|
9
|
+
const parseOptionValue = (tokens, optionName) => {
|
|
10
|
+
const inlinePrefix = `${optionName}=`;
|
|
11
|
+
const inlineToken = tokens.find(token => token.startsWith(inlinePrefix));
|
|
12
|
+
if (inlineToken) return inlineToken.slice(inlinePrefix.length) || null;
|
|
13
|
+
const optionIndex = tokens.indexOf(optionName);
|
|
14
|
+
if (optionIndex < 0) return null;
|
|
15
|
+
return tokens[optionIndex + 1] ?? null;
|
|
16
|
+
};
|
|
17
|
+
const toWizardArtifactKind = value => {
|
|
18
|
+
const normalized = value.trim().toUpperCase();
|
|
19
|
+
if (normalized === 'SKILL' || normalized === 'DESIGN_DOC') return normalized;
|
|
20
|
+
throw new Error('artifactKind must be SKILL or DESIGN_DOC.');
|
|
21
|
+
};
|
|
22
|
+
const firstUrlToken = tokens => {
|
|
23
|
+
return tokens.find(token => /^https?:\/\//i.test(token)) ?? null;
|
|
24
|
+
};
|
|
25
|
+
const toRawGithubUrl = inputUrl => {
|
|
26
|
+
const parsedUrl = new URL(inputUrl);
|
|
27
|
+
if (parsedUrl.hostname === 'raw.githubusercontent.com') return parsedUrl.toString();
|
|
28
|
+
if (parsedUrl.hostname !== 'github.com') return null;
|
|
29
|
+
const parts = parsedUrl.pathname.split('/').filter(Boolean);
|
|
30
|
+
if (parts.length < 2) return null;
|
|
31
|
+
const [owner, repo, marker, branch, ...rest] = parts;
|
|
32
|
+
if (marker === 'blob' || marker === 'tree') {
|
|
33
|
+
return `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${rest.join('/')}`;
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
};
|
|
37
|
+
const buildGithubSkillCandidateUrls = (sourceUrl, skill) => {
|
|
38
|
+
const parsedUrl = new URL(sourceUrl);
|
|
39
|
+
if (parsedUrl.hostname === 'raw.githubusercontent.com') return [parsedUrl.toString()];
|
|
40
|
+
if (parsedUrl.hostname !== 'github.com') return [sourceUrl];
|
|
41
|
+
const rawUrl = toRawGithubUrl(sourceUrl);
|
|
42
|
+
if (rawUrl?.endsWith('/SKILL.md')) return [rawUrl];
|
|
43
|
+
const parts = parsedUrl.pathname.split('/').filter(Boolean);
|
|
44
|
+
const [owner, repo, marker, branch, ...treePathParts] = parts;
|
|
45
|
+
const branches = marker === 'tree' && branch ? [branch] : ['main', 'master'];
|
|
46
|
+
const treePath = marker === 'tree' ? treePathParts.join('/') : '';
|
|
47
|
+
const skillSlug = skill ? normalizeSlug(skill) : null;
|
|
48
|
+
const paths = new Set();
|
|
49
|
+
if (treePath) paths.add(`${treePath}/SKILL.md`);
|
|
50
|
+
if (!treePath) paths.add('SKILL.md');
|
|
51
|
+
if (skillSlug) {
|
|
52
|
+
paths.add(`skills/${skillSlug}/SKILL.md`);
|
|
53
|
+
paths.add(`.agents/skills/${skillSlug}/SKILL.md`);
|
|
54
|
+
if (treePath) paths.add(`${treePath}/skills/${skillSlug}/SKILL.md`);
|
|
55
|
+
if (treePath) paths.add(`${treePath}/.agents/skills/${skillSlug}/SKILL.md`);
|
|
56
|
+
}
|
|
57
|
+
return branches.flatMap(candidateBranch => [...paths].map(candidatePath => `https://raw.githubusercontent.com/${owner}/${repo}/${candidateBranch}/${candidatePath}`));
|
|
58
|
+
};
|
|
59
|
+
export const planWizardArtifactImport = input => {
|
|
60
|
+
const source = input.source.trim();
|
|
61
|
+
const tokens = tokenizeCommandLikeInput(source);
|
|
62
|
+
const optionSkill = parseOptionValue(tokens, '--skill');
|
|
63
|
+
const skill = input.skill?.trim() || optionSkill || null;
|
|
64
|
+
const getdesignSlug = tokens.find((token, index) => tokens[index - 1] === 'add' && !token.startsWith('-')) ?? null;
|
|
65
|
+
const inferredKind = source.includes('getdesign') ? 'DESIGN_DOC' : 'SKILL';
|
|
66
|
+
const artifactKind = input.artifactKind ? toWizardArtifactKind(input.artifactKind) : inferredKind;
|
|
67
|
+
if (artifactKind === 'DESIGN_DOC') {
|
|
68
|
+
const rawSlug = input.slug?.trim() || getdesignSlug;
|
|
69
|
+
if (!rawSlug) throw new Error('DESIGN_DOC import requires a slug or a getdesign `add <slug>` input.');
|
|
70
|
+
const slug = normalizeSlug(rawSlug);
|
|
71
|
+
const directUrl = firstUrlToken(tokens);
|
|
72
|
+
const candidateUrls = directUrl ? [toRawGithubUrl(directUrl) ?? directUrl] : [`${GETDESIGN_RAW_BASE}/${slug}/DESIGN.md`];
|
|
73
|
+
return {
|
|
74
|
+
artifactKind,
|
|
75
|
+
slug,
|
|
76
|
+
skill: null,
|
|
77
|
+
source,
|
|
78
|
+
sourceRef: directUrl ?? `getdesign:${slug}`,
|
|
79
|
+
candidateUrls
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const sourceUrl = firstUrlToken(tokens) ?? source;
|
|
83
|
+
return {
|
|
84
|
+
artifactKind: 'SKILL',
|
|
85
|
+
slug: input.slug ? normalizeSlug(input.slug) : null,
|
|
86
|
+
skill,
|
|
87
|
+
source,
|
|
88
|
+
sourceRef: skill ? `${sourceUrl}#skill=${skill}` : sourceUrl,
|
|
89
|
+
candidateUrls: buildGithubSkillCandidateUrls(sourceUrl, skill)
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
export const fetchWizardArtifactImportSource = async input => {
|
|
93
|
+
const plan = planWizardArtifactImport(input);
|
|
94
|
+
const errors = [];
|
|
95
|
+
for (const candidateUrl of plan.candidateUrls) {
|
|
96
|
+
try {
|
|
97
|
+
const response = await fetch(candidateUrl, {
|
|
98
|
+
signal: input.signal
|
|
99
|
+
});
|
|
100
|
+
if (!response.ok) {
|
|
101
|
+
errors.push(`${candidateUrl}: HTTP ${response.status}`);
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
...plan,
|
|
106
|
+
markdownContent: await response.text(),
|
|
107
|
+
fetchedUrl: candidateUrl
|
|
108
|
+
};
|
|
109
|
+
} catch (error) {
|
|
110
|
+
errors.push(`${candidateUrl}: ${error instanceof Error ? error.message : 'Unknown fetch error'}`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
throw new Error(`Could not fetch import source. Tried: ${errors.join('; ')}`);
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=import-sources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["GETDESIGN_RAW_BASE","tokenizeCommandLikeInput","input","tokens","match","map","token","replace","normalizeSlug","value","trim","toLowerCase","parseOptionValue","optionName","inlinePrefix","inlineToken","find","startsWith","slice","length","optionIndex","indexOf","toWizardArtifactKind","normalized","toUpperCase","Error","firstUrlToken","test","toRawGithubUrl","inputUrl","parsedUrl","URL","hostname","toString","parts","pathname","split","filter","Boolean","owner","repo","marker","branch","rest","join","buildGithubSkillCandidateUrls","sourceUrl","skill","rawUrl","endsWith","treePathParts","branches","treePath","skillSlug","paths","Set","add","flatMap","candidateBranch","candidatePath","planWizardArtifactImport","source","optionSkill","getdesignSlug","index","inferredKind","includes","artifactKind","rawSlug","slug","directUrl","candidateUrls","sourceRef","fetchWizardArtifactImportSource","plan","errors","candidateUrl","response","fetch","signal","ok","push","status","markdownContent","text","fetchedUrl","error","message"],"sources":["../../src/server/import-sources.ts"],"sourcesContent":["import type { WizardArtifactKind } from './types.js';\n\ntype ImportSourcePlan = {\n artifactKind: WizardArtifactKind;\n slug: string | null;\n skill: string | null;\n source: string;\n sourceRef: string;\n candidateUrls: string[];\n};\n\nexport type ResolvedImportSource = ImportSourcePlan & {\n markdownContent: string;\n fetchedUrl: string;\n};\n\nconst GETDESIGN_RAW_BASE = 'https://raw.githubusercontent.com/VoltAgent/awesome-design-md/main/design-md';\n\nconst tokenizeCommandLikeInput = (input: string): string[] => {\n const tokens = input.match(/(?:[^\\s\"']+|\"[^\"]*\"|'[^']*')+/g) ?? [];\n return tokens.map((token) => token.replace(/^(\"|')|(\"|')$/g, ''));\n};\n\nconst normalizeSlug = (value: string): string => {\n return value\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '');\n};\n\nconst parseOptionValue = (tokens: string[], optionName: string): string | null => {\n const inlinePrefix = `${optionName}=`;\n const inlineToken = tokens.find((token) => token.startsWith(inlinePrefix));\n if (inlineToken) return inlineToken.slice(inlinePrefix.length) || null;\n\n const optionIndex = tokens.indexOf(optionName);\n if (optionIndex < 0) return null;\n return tokens[optionIndex + 1] ?? null;\n};\n\nconst toWizardArtifactKind = (value: string): WizardArtifactKind => {\n const normalized = value.trim().toUpperCase();\n if (normalized === 'SKILL' || normalized === 'DESIGN_DOC') return normalized;\n throw new Error('artifactKind must be SKILL or DESIGN_DOC.');\n};\n\nconst firstUrlToken = (tokens: string[]): string | null => {\n return tokens.find((token) => /^https?:\\/\\//i.test(token)) ?? null;\n};\n\nconst toRawGithubUrl = (inputUrl: string): string | null => {\n const parsedUrl = new URL(inputUrl);\n if (parsedUrl.hostname === 'raw.githubusercontent.com') return parsedUrl.toString();\n if (parsedUrl.hostname !== 'github.com') return null;\n\n const parts = parsedUrl.pathname.split('/').filter(Boolean);\n if (parts.length < 2) return null;\n\n const [owner, repo, marker, branch, ...rest] = parts;\n if (marker === 'blob' || marker === 'tree') {\n return `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${rest.join('/')}`;\n }\n\n return null;\n};\n\nconst buildGithubSkillCandidateUrls = (sourceUrl: string, skill: string | null): string[] => {\n const parsedUrl = new URL(sourceUrl);\n if (parsedUrl.hostname === 'raw.githubusercontent.com') return [parsedUrl.toString()];\n if (parsedUrl.hostname !== 'github.com') return [sourceUrl];\n\n const rawUrl = toRawGithubUrl(sourceUrl);\n if (rawUrl?.endsWith('/SKILL.md')) return [rawUrl];\n\n const parts = parsedUrl.pathname.split('/').filter(Boolean);\n const [owner, repo, marker, branch, ...treePathParts] = parts;\n const branches = marker === 'tree' && branch ? [branch] : ['main', 'master'];\n const treePath = marker === 'tree' ? treePathParts.join('/') : '';\n const skillSlug = skill ? normalizeSlug(skill) : null;\n const paths = new Set<string>();\n\n if (treePath) paths.add(`${treePath}/SKILL.md`);\n if (!treePath) paths.add('SKILL.md');\n if (skillSlug) {\n paths.add(`skills/${skillSlug}/SKILL.md`);\n paths.add(`.agents/skills/${skillSlug}/SKILL.md`);\n if (treePath) paths.add(`${treePath}/skills/${skillSlug}/SKILL.md`);\n if (treePath) paths.add(`${treePath}/.agents/skills/${skillSlug}/SKILL.md`);\n }\n\n return branches.flatMap((candidateBranch) =>\n [...paths].map((candidatePath) => `https://raw.githubusercontent.com/${owner}/${repo}/${candidateBranch}/${candidatePath}`),\n );\n};\n\nexport const planWizardArtifactImport = (input: {\n artifactKind?: string;\n source: string;\n slug?: string;\n skill?: string;\n}): ImportSourcePlan => {\n const source = input.source.trim();\n const tokens = tokenizeCommandLikeInput(source);\n const optionSkill = parseOptionValue(tokens, '--skill');\n const skill = input.skill?.trim() || optionSkill || null;\n const getdesignSlug = tokens.find((token, index) => tokens[index - 1] === 'add' && !token.startsWith('-')) ?? null;\n const inferredKind: WizardArtifactKind = source.includes('getdesign') ? 'DESIGN_DOC' : 'SKILL';\n const artifactKind = input.artifactKind ? toWizardArtifactKind(input.artifactKind) : inferredKind;\n\n if (artifactKind === 'DESIGN_DOC') {\n const rawSlug = input.slug?.trim() || getdesignSlug;\n if (!rawSlug) throw new Error('DESIGN_DOC import requires a slug or a getdesign `add <slug>` input.');\n const slug = normalizeSlug(rawSlug);\n const directUrl = firstUrlToken(tokens);\n const candidateUrls = directUrl ? [toRawGithubUrl(directUrl) ?? directUrl] : [`${GETDESIGN_RAW_BASE}/${slug}/DESIGN.md`];\n return { artifactKind, slug, skill: null, source, sourceRef: directUrl ?? `getdesign:${slug}`, candidateUrls };\n }\n\n const sourceUrl = firstUrlToken(tokens) ?? source;\n return {\n artifactKind: 'SKILL',\n slug: input.slug ? normalizeSlug(input.slug) : null,\n skill,\n source,\n sourceRef: skill ? `${sourceUrl}#skill=${skill}` : sourceUrl,\n candidateUrls: buildGithubSkillCandidateUrls(sourceUrl, skill),\n };\n};\n\nexport const fetchWizardArtifactImportSource = async (input: {\n artifactKind?: string;\n source: string;\n slug?: string;\n skill?: string;\n signal: AbortSignal;\n}): Promise<ResolvedImportSource> => {\n const plan = planWizardArtifactImport(input);\n const errors: string[] = [];\n\n for (const candidateUrl of plan.candidateUrls) {\n try {\n const response = await fetch(candidateUrl, { signal: input.signal });\n if (!response.ok) {\n errors.push(`${candidateUrl}: HTTP ${response.status}`);\n continue;\n }\n\n return { ...plan, markdownContent: await response.text(), fetchedUrl: candidateUrl };\n } catch (error) {\n errors.push(`${candidateUrl}: ${error instanceof Error ? error.message : 'Unknown fetch error'}`);\n }\n }\n\n throw new Error(`Could not fetch import source. Tried: ${errors.join('; ')}`);\n};\n"],"mappings":"AAgBA,MAAMA,kBAAkB,GAAG,8EAA8E;AAEzG,MAAMC,wBAAwB,GAAIC,KAAa,IAAe;EAC5D,MAAMC,MAAM,GAAGD,KAAK,CAACE,KAAK,CAAC,gCAAgC,CAAC,IAAI,EAAE;EAClE,OAAOD,MAAM,CAACE,GAAG,CAAEC,KAAK,IAAKA,KAAK,CAACC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;AACnE,CAAC;AAED,MAAMC,aAAa,GAAIC,KAAa,IAAa;EAC/C,OAAOA,KAAK,CACTC,IAAI,CAAC,CAAC,CACNC,WAAW,CAAC,CAAC,CACbJ,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAC3BA,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;AAC5B,CAAC;AAED,MAAMK,gBAAgB,GAAGA,CAACT,MAAgB,EAAEU,UAAkB,KAAoB;EAChF,MAAMC,YAAY,GAAG,GAAGD,UAAU,GAAG;EACrC,MAAME,WAAW,GAAGZ,MAAM,CAACa,IAAI,CAAEV,KAAK,IAAKA,KAAK,CAACW,UAAU,CAACH,YAAY,CAAC,CAAC;EAC1E,IAAIC,WAAW,EAAE,OAAOA,WAAW,CAACG,KAAK,CAACJ,YAAY,CAACK,MAAM,CAAC,IAAI,IAAI;EAEtE,MAAMC,WAAW,GAAGjB,MAAM,CAACkB,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aAAa,EAAE;IAC7C,IAAI;MACF,MAAMM,QAAQ,GAAG,MAAMC,KAAK,CAACF,YAAY,EAAE;QAAEG,MAAM,EAAE7E,KAAK,CAAC6E;MAAO,CAAC,CAAC;MACpE,IAAI,CAACF,QAAQ,CAACG,EAAE,EAAE;QAChBL,MAAM,CAACM,IAAI,CAAC,GAAGL,YAAY,UAAUC,QAAQ,CAACK,MAAM,EAAE,CAAC;QACvD;MACF;MAEA,OAAO;QAAE,GAAGR,IAAI;QAAES,eAAe,EAAE,MAAMN,QAAQ,CAACO,IAAI,CAAC,CAAC;QAAEC,UAAU,EAAET;MAAa,CAAC;IACtF,CAAC,CAAC,OAAOU,KAAK,EAAE;MACdX,MAAM,CAACM,IAAI,CAAC,GAAGL,YAAY,KAAKU,KAAK,YAAY7D,KAAK,GAAG6D,KAAK,CAACC,OAAO,GAAG,qBAAqB,EAAE,CAAC;IACnG;EACF;EAEA,MAAM,IAAI9D,KAAK,CAAC,yCAAyCkD,MAAM,CAAC/B,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AAC/E,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PublishedSkillPreferenceAction, PublishedSkillPreferenceCacheContext, PublishedSkillsIgnoreState, ResolvedConfig, WorkspaceResolution } from './types.js';
|
|
2
|
+
export declare const toIgnoredSkillSlug: (value: string) => string | null;
|
|
3
|
+
export declare const toPublishedSkillPreferenceAction: (value: string) => PublishedSkillPreferenceAction;
|
|
4
|
+
export declare const toPublishedSkillPreferenceScope: (value: string | undefined, defaultScope: "global" | "project") => "global" | "project";
|
|
5
|
+
export declare const resolvePublishedSkillPreferenceCacheContext: (config: ResolvedConfig) => Promise<PublishedSkillPreferenceCacheContext>;
|
|
6
|
+
export declare const getCatalogCacheKey: (workspaceResolution: WorkspaceResolution, preferenceContext: PublishedSkillPreferenceCacheContext) => string;
|
|
7
|
+
export declare const setPublishedSkillIgnored: ({ worktree, directory, skillSlug, ignored, preferenceScope, }: {
|
|
8
|
+
worktree: string;
|
|
9
|
+
directory: string;
|
|
10
|
+
scopeKey?: string;
|
|
11
|
+
skillSlug: string;
|
|
12
|
+
ignored: boolean;
|
|
13
|
+
preferenceScope?: "global" | "project";
|
|
14
|
+
}) => Promise<PublishedSkillsIgnoreState>;
|
|
15
|
+
export declare const setPublishedSkillInstalled: ({ worktree, directory, skillSlug, installed, preferenceScope, }: {
|
|
16
|
+
worktree: string;
|
|
17
|
+
directory: string;
|
|
18
|
+
scopeKey?: string;
|
|
19
|
+
skillSlug: string;
|
|
20
|
+
installed: boolean;
|
|
21
|
+
preferenceScope: "global" | "project";
|
|
22
|
+
}) => Promise<PublishedSkillsIgnoreState>;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { SET_PUBLISHED_SKILL_PREFERENCE_MUTATION } from '../graphql-operations.js';
|
|
2
|
+
import { readGlobalAuthState, toStoredUserKey } from './auth-store.js';
|
|
3
|
+
import { fetchPublishedSkillsGraphQl } from './client.js';
|
|
4
|
+
import { PRESENCE_EVENT_TIMEOUT_MS } from './constants.js';
|
|
5
|
+
import { resolveConfig } from './config.js';
|
|
6
|
+
import { resolveWorkspace, toDeliveryInput } from './workspace.js';
|
|
7
|
+
let publishedSkillPreferenceCacheVersion = 0;
|
|
8
|
+
export const toIgnoredSkillSlug = value => {
|
|
9
|
+
const normalized = value.trim().toLowerCase();
|
|
10
|
+
if (!normalized) return null;
|
|
11
|
+
return normalized;
|
|
12
|
+
};
|
|
13
|
+
export const toPublishedSkillPreferenceAction = value => {
|
|
14
|
+
const normalized = value.trim().toLowerCase();
|
|
15
|
+
if (normalized === 'install' || normalized === 'uninstall' || normalized === 'ignore' || normalized === 'unignore') {
|
|
16
|
+
return normalized;
|
|
17
|
+
}
|
|
18
|
+
throw new Error('Published skill preference action must be one of: install, uninstall, ignore, unignore.');
|
|
19
|
+
};
|
|
20
|
+
export const toPublishedSkillPreferenceScope = (value, defaultScope) => {
|
|
21
|
+
if (!value) return defaultScope;
|
|
22
|
+
const normalized = value.trim().toLowerCase();
|
|
23
|
+
if (normalized === 'global' || normalized === 'project') return normalized;
|
|
24
|
+
throw new Error('Published skill preferenceScope must be either global or project.');
|
|
25
|
+
};
|
|
26
|
+
export const resolvePublishedSkillPreferenceCacheContext = async config => {
|
|
27
|
+
const authState = await readGlobalAuthState(config.authStatePath);
|
|
28
|
+
return {
|
|
29
|
+
userKey: toStoredUserKey(authState),
|
|
30
|
+
preferenceVersion: publishedSkillPreferenceCacheVersion
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export const getCatalogCacheKey = (workspaceResolution, preferenceContext) => JSON.stringify([workspaceResolution.cacheKey, preferenceContext.userKey, preferenceContext.preferenceVersion]);
|
|
34
|
+
const toBackendPreferenceScope = preferenceScope => {
|
|
35
|
+
if (preferenceScope === 'global') return 'GLOBAL';
|
|
36
|
+
return 'WORKSPACE';
|
|
37
|
+
};
|
|
38
|
+
const setPublishedSkillPreference = async ({
|
|
39
|
+
worktree,
|
|
40
|
+
directory,
|
|
41
|
+
config,
|
|
42
|
+
skillSlug,
|
|
43
|
+
preferenceScope,
|
|
44
|
+
installed,
|
|
45
|
+
ignored
|
|
46
|
+
}) => {
|
|
47
|
+
const workspaceResolution = await resolveWorkspace({
|
|
48
|
+
config,
|
|
49
|
+
directory
|
|
50
|
+
});
|
|
51
|
+
const response = await fetchPublishedSkillsGraphQl({
|
|
52
|
+
worktree,
|
|
53
|
+
config,
|
|
54
|
+
query: SET_PUBLISHED_SKILL_PREFERENCE_MUTATION,
|
|
55
|
+
variables: {
|
|
56
|
+
input: {
|
|
57
|
+
...toDeliveryInput(workspaceResolution),
|
|
58
|
+
skillSlug,
|
|
59
|
+
preferenceScope: toBackendPreferenceScope(preferenceScope),
|
|
60
|
+
installed,
|
|
61
|
+
ignored
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
signal: AbortSignal.timeout(PRESENCE_EVENT_TIMEOUT_MS)
|
|
65
|
+
});
|
|
66
|
+
if (!response.ok) {
|
|
67
|
+
throw new Error(response.result.message);
|
|
68
|
+
}
|
|
69
|
+
const preferences = response.data.setPublishedSkillPreference;
|
|
70
|
+
publishedSkillPreferenceCacheVersion += 1;
|
|
71
|
+
return {
|
|
72
|
+
scopeKey: preferences.scopeKey,
|
|
73
|
+
userKey: preferences.userKey,
|
|
74
|
+
ignoredSkillSlugs: preferences.ignoredSkills.map(item => item.skill.slug),
|
|
75
|
+
installedGlobalSkillSlugs: [],
|
|
76
|
+
installedWorkspaceSkillSlugs: []
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
export const setPublishedSkillIgnored = async ({
|
|
80
|
+
worktree,
|
|
81
|
+
directory,
|
|
82
|
+
skillSlug,
|
|
83
|
+
ignored,
|
|
84
|
+
preferenceScope
|
|
85
|
+
}) => {
|
|
86
|
+
const config = await resolveConfig(worktree);
|
|
87
|
+
const normalizedSkillSlug = toIgnoredSkillSlug(skillSlug);
|
|
88
|
+
if (!normalizedSkillSlug) {
|
|
89
|
+
throw new Error('Cannot toggle an empty published skill slug.');
|
|
90
|
+
}
|
|
91
|
+
return setPublishedSkillPreference({
|
|
92
|
+
worktree,
|
|
93
|
+
directory,
|
|
94
|
+
config,
|
|
95
|
+
skillSlug: normalizedSkillSlug,
|
|
96
|
+
preferenceScope: preferenceScope ?? 'project',
|
|
97
|
+
ignored
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
export const setPublishedSkillInstalled = async ({
|
|
101
|
+
worktree,
|
|
102
|
+
directory,
|
|
103
|
+
skillSlug,
|
|
104
|
+
installed,
|
|
105
|
+
preferenceScope
|
|
106
|
+
}) => {
|
|
107
|
+
const config = await resolveConfig(worktree);
|
|
108
|
+
const normalizedSkillSlug = toIgnoredSkillSlug(skillSlug);
|
|
109
|
+
if (!normalizedSkillSlug) {
|
|
110
|
+
throw new Error('Cannot toggle an empty published skill slug.');
|
|
111
|
+
}
|
|
112
|
+
return setPublishedSkillPreference({
|
|
113
|
+
worktree,
|
|
114
|
+
directory,
|
|
115
|
+
config,
|
|
116
|
+
skillSlug: normalizedSkillSlug,
|
|
117
|
+
preferenceScope,
|
|
118
|
+
installed
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=preferences.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SET_PUBLISHED_SKILL_PREFERENCE_MUTATION","readGlobalAuthState","toStoredUserKey","fetchPublishedSkillsGraphQl","PRESENCE_EVENT_TIMEOUT_MS","resolveConfig","resolveWorkspace","toDeliveryInput","publishedSkillPreferenceCacheVersion","toIgnoredSkillSlug","value","normalized","trim","toLowerCase","toPublishedSkillPreferenceAction","Error","toPublishedSkillPreferenceScope","defaultScope","resolvePublishedSkillPreferenceCacheContext","config","authState","authStatePath","userKey","preferenceVersion","getCatalogCacheKey","workspaceResolution","preferenceContext","JSON","stringify","cacheKey","toBackendPreferenceScope","preferenceScope","setPublishedSkillPreference","worktree","directory","skillSlug","installed","ignored","response","query","variables","input","signal","AbortSignal","timeout","ok","result","message","preferences","data","scopeKey","ignoredSkillSlugs","ignoredSkills","map","item","skill","slug","installedGlobalSkillSlugs","installedWorkspaceSkillSlugs","setPublishedSkillIgnored","normalizedSkillSlug","setPublishedSkillInstalled"],"sources":["../../src/server/preferences.ts"],"sourcesContent":["import { SET_PUBLISHED_SKILL_PREFERENCE_MUTATION } from '../graphql-operations.js';\nimport { readGlobalAuthState, toStoredUserKey } from './auth-store.js';\nimport { fetchPublishedSkillsGraphQl } from './client.js';\nimport { PRESENCE_EVENT_TIMEOUT_MS } from './constants.js';\nimport { resolveConfig } from './config.js';\nimport { resolveWorkspace, toDeliveryInput } from './workspace.js';\nimport type {\n PublishedSkillPreferenceAction,\n PublishedSkillPreferenceCacheContext,\n PublishedSkillPreferenceScope,\n PublishedSkillsIgnoreState,\n ResolvedConfig,\n SetPublishedSkillPreferenceResponse,\n WorkspaceResolution,\n} from './types.js';\n\nlet publishedSkillPreferenceCacheVersion = 0;\n\nexport const toIgnoredSkillSlug = (value: string): string | null => {\n const normalized = value.trim().toLowerCase();\n if (!normalized) return null;\n return normalized;\n};\n\nexport const toPublishedSkillPreferenceAction = (value: string): PublishedSkillPreferenceAction => {\n const normalized = value.trim().toLowerCase();\n if (\n normalized === 'install' ||\n normalized === 'uninstall' ||\n normalized === 'ignore' ||\n normalized === 'unignore'\n ) {\n return normalized;\n }\n\n throw new Error('Published skill preference action must be one of: install, uninstall, ignore, unignore.');\n};\n\nexport const toPublishedSkillPreferenceScope = (\n value: string | undefined,\n defaultScope: 'global' | 'project',\n): 'global' | 'project' => {\n if (!value) return defaultScope;\n\n const normalized = value.trim().toLowerCase();\n if (normalized === 'global' || normalized === 'project') return normalized;\n\n throw new Error('Published skill preferenceScope must be either global or project.');\n};\n\nexport const resolvePublishedSkillPreferenceCacheContext = async (\n config: ResolvedConfig,\n): Promise<PublishedSkillPreferenceCacheContext> => {\n const authState = await readGlobalAuthState(config.authStatePath);\n\n return {\n userKey: toStoredUserKey(authState),\n preferenceVersion: publishedSkillPreferenceCacheVersion,\n };\n};\n\nexport const getCatalogCacheKey = (\n workspaceResolution: WorkspaceResolution,\n preferenceContext: PublishedSkillPreferenceCacheContext,\n): string => JSON.stringify([workspaceResolution.cacheKey, preferenceContext.userKey, preferenceContext.preferenceVersion]);\n\nconst toBackendPreferenceScope = (preferenceScope: 'global' | 'project'): PublishedSkillPreferenceScope => {\n if (preferenceScope === 'global') return 'GLOBAL';\n return 'WORKSPACE';\n};\n\nconst setPublishedSkillPreference = async ({\n worktree,\n directory,\n config,\n skillSlug,\n preferenceScope,\n installed,\n ignored,\n}: {\n worktree: string;\n directory: string;\n config: ResolvedConfig;\n skillSlug: string;\n preferenceScope: 'global' | 'project';\n installed?: boolean;\n ignored?: boolean;\n}): Promise<PublishedSkillsIgnoreState> => {\n const workspaceResolution = await resolveWorkspace({ config, directory });\n const response = await fetchPublishedSkillsGraphQl<SetPublishedSkillPreferenceResponse>({\n worktree,\n config,\n query: SET_PUBLISHED_SKILL_PREFERENCE_MUTATION,\n variables: {\n input: {\n ...toDeliveryInput(workspaceResolution),\n skillSlug,\n preferenceScope: toBackendPreferenceScope(preferenceScope),\n installed,\n ignored,\n },\n },\n signal: AbortSignal.timeout(PRESENCE_EVENT_TIMEOUT_MS),\n });\n\n if (!response.ok) {\n throw new Error(response.result.message);\n }\n\n const preferences = response.data.setPublishedSkillPreference;\n publishedSkillPreferenceCacheVersion += 1;\n\n return {\n scopeKey: preferences.scopeKey,\n userKey: preferences.userKey,\n ignoredSkillSlugs: preferences.ignoredSkills.map((item) => item.skill.slug),\n installedGlobalSkillSlugs: [],\n installedWorkspaceSkillSlugs: [],\n };\n};\n\nexport const setPublishedSkillIgnored = async ({\n worktree,\n directory,\n skillSlug,\n ignored,\n preferenceScope,\n}: {\n worktree: string;\n directory: string;\n scopeKey?: string;\n skillSlug: string;\n ignored: boolean;\n preferenceScope?: 'global' | 'project';\n}): Promise<PublishedSkillsIgnoreState> => {\n const config = await resolveConfig(worktree);\n const normalizedSkillSlug = toIgnoredSkillSlug(skillSlug);\n\n if (!normalizedSkillSlug) {\n throw new Error('Cannot toggle an empty published skill slug.');\n }\n\n return setPublishedSkillPreference({\n worktree,\n directory,\n config,\n skillSlug: normalizedSkillSlug,\n preferenceScope: preferenceScope ?? 'project',\n ignored,\n });\n};\n\nexport const setPublishedSkillInstalled = async ({\n worktree,\n directory,\n skillSlug,\n installed,\n preferenceScope,\n}: {\n worktree: string;\n directory: string;\n scopeKey?: string;\n skillSlug: string;\n installed: boolean;\n preferenceScope: 'global' | 'project';\n}): Promise<PublishedSkillsIgnoreState> => {\n const config = await resolveConfig(worktree);\n const normalizedSkillSlug = toIgnoredSkillSlug(skillSlug);\n\n if (!normalizedSkillSlug) {\n throw new Error('Cannot toggle an empty published skill slug.');\n }\n\n return setPublishedSkillPreference({\n worktree,\n directory,\n config,\n skillSlug: normalizedSkillSlug,\n preferenceScope,\n installed,\n });\n};\n"],"mappings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gB,SAAS,EAAEyB,mBAAmB;IAC9B7B,eAAe;IACfK;EACF,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
package/dist/server/runtime.d.ts
CHANGED
|
@@ -1,29 +1,10 @@
|
|
|
1
1
|
export { resolveConfig } from './config.js';
|
|
2
2
|
export { PLUGIN_ID, NATIVE_SKILLS_URL_COMPATIBILITY, type NativeSkillsUrlCompatibility } from './constants.js';
|
|
3
3
|
export { buildSystemNote, resolvePluginStatusSnapshot, toPluginAuthStateSummary, toPublishedSkillCatalog, } from './status.js';
|
|
4
|
-
import type { OpencodePluginServer
|
|
4
|
+
import type { OpencodePluginServer } from './types.js';
|
|
5
5
|
export type { PluginAuthStateSummary, PluginStatusSnapshot, PublishedSkillCatalogItem, PublishedSkillCatalogPayload, PublishedSkillDetailItem, PublishedSkillInstallableCatalogItem, } from './types.js';
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
directory: string;
|
|
9
|
-
signal: AbortSignal;
|
|
10
|
-
}) => Promise<PluginStatusSnapshot>;
|
|
11
|
-
export declare const setPublishedSkillIgnored: ({ worktree, directory, skillSlug, ignored, preferenceScope, }: {
|
|
12
|
-
worktree: string;
|
|
13
|
-
directory: string;
|
|
14
|
-
scopeKey?: string;
|
|
15
|
-
skillSlug: string;
|
|
16
|
-
ignored: boolean;
|
|
17
|
-
preferenceScope?: "global" | "project";
|
|
18
|
-
}) => Promise<PublishedSkillsIgnoreState>;
|
|
19
|
-
export declare const setPublishedSkillInstalled: ({ worktree, directory, skillSlug, installed, preferenceScope, }: {
|
|
20
|
-
worktree: string;
|
|
21
|
-
directory: string;
|
|
22
|
-
scopeKey?: string;
|
|
23
|
-
skillSlug: string;
|
|
24
|
-
installed: boolean;
|
|
25
|
-
preferenceScope: "global" | "project";
|
|
26
|
-
}) => Promise<PublishedSkillsIgnoreState>;
|
|
6
|
+
export { resolvePluginStatusSnapshotWithAuthBootstrap } from './auth-bootstrap.js';
|
|
7
|
+
export { setPublishedSkillIgnored, setPublishedSkillInstalled } from './preferences.js';
|
|
27
8
|
export declare const OpencodeWizardSkillsPlugin: OpencodePluginServer;
|
|
28
9
|
declare const _default: {
|
|
29
10
|
id: string;
|