gmc-openspec 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +207 -0
- package/bin/openspec.js +3 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +494 -0
- package/dist/commands/change.d.ts +35 -0
- package/dist/commands/change.js +277 -0
- package/dist/commands/completion.d.ts +72 -0
- package/dist/commands/completion.js +264 -0
- package/dist/commands/config.d.ts +36 -0
- package/dist/commands/config.js +611 -0
- package/dist/commands/feedback.d.ts +9 -0
- package/dist/commands/feedback.js +183 -0
- package/dist/commands/jira.d.ts +3 -0
- package/dist/commands/jira.js +249 -0
- package/dist/commands/schema.d.ts +6 -0
- package/dist/commands/schema.js +869 -0
- package/dist/commands/show.d.ts +14 -0
- package/dist/commands/show.js +132 -0
- package/dist/commands/spec.d.ts +15 -0
- package/dist/commands/spec.js +225 -0
- package/dist/commands/validate.d.ts +24 -0
- package/dist/commands/validate.js +294 -0
- package/dist/commands/workflow/index.d.ts +17 -0
- package/dist/commands/workflow/index.js +12 -0
- package/dist/commands/workflow/instructions.d.ts +29 -0
- package/dist/commands/workflow/instructions.js +336 -0
- package/dist/commands/workflow/new-change.d.ts +13 -0
- package/dist/commands/workflow/new-change.js +92 -0
- package/dist/commands/workflow/schemas.d.ts +10 -0
- package/dist/commands/workflow/schemas.js +34 -0
- package/dist/commands/workflow/shared.d.ts +57 -0
- package/dist/commands/workflow/shared.js +116 -0
- package/dist/commands/workflow/status.d.ts +14 -0
- package/dist/commands/workflow/status.js +87 -0
- package/dist/commands/workflow/templates.d.ts +16 -0
- package/dist/commands/workflow/templates.js +69 -0
- package/dist/commands/workspace/open.d.ts +29 -0
- package/dist/commands/workspace/open.js +84 -0
- package/dist/commands/workspace/operations.d.ts +23 -0
- package/dist/commands/workspace/operations.js +475 -0
- package/dist/commands/workspace/selection.d.ts +6 -0
- package/dist/commands/workspace/selection.js +113 -0
- package/dist/commands/workspace/types.d.ts +88 -0
- package/dist/commands/workspace/types.js +36 -0
- package/dist/commands/workspace.d.ts +6 -0
- package/dist/commands/workspace.js +868 -0
- package/dist/core/archive.d.ts +11 -0
- package/dist/core/archive.js +318 -0
- package/dist/core/artifact-graph/graph.d.ts +56 -0
- package/dist/core/artifact-graph/graph.js +141 -0
- package/dist/core/artifact-graph/index.d.ts +8 -0
- package/dist/core/artifact-graph/index.js +14 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts +196 -0
- package/dist/core/artifact-graph/instruction-loader.js +317 -0
- package/dist/core/artifact-graph/outputs.d.ts +14 -0
- package/dist/core/artifact-graph/outputs.js +39 -0
- package/dist/core/artifact-graph/resolver.d.ts +81 -0
- package/dist/core/artifact-graph/resolver.js +257 -0
- package/dist/core/artifact-graph/schema.d.ts +13 -0
- package/dist/core/artifact-graph/schema.js +108 -0
- package/dist/core/artifact-graph/state.d.ts +12 -0
- package/dist/core/artifact-graph/state.js +31 -0
- package/dist/core/artifact-graph/types.d.ts +47 -0
- package/dist/core/artifact-graph/types.js +48 -0
- package/dist/core/available-tools.d.ts +17 -0
- package/dist/core/available-tools.js +43 -0
- package/dist/core/command-generation/adapters/amazon-q.d.ts +13 -0
- package/dist/core/command-generation/adapters/amazon-q.js +26 -0
- package/dist/core/command-generation/adapters/antigravity.d.ts +13 -0
- package/dist/core/command-generation/adapters/antigravity.js +26 -0
- package/dist/core/command-generation/adapters/auggie.d.ts +13 -0
- package/dist/core/command-generation/adapters/auggie.js +27 -0
- package/dist/core/command-generation/adapters/bob.d.ts +14 -0
- package/dist/core/command-generation/adapters/bob.js +45 -0
- package/dist/core/command-generation/adapters/claude.d.ts +13 -0
- package/dist/core/command-generation/adapters/claude.js +50 -0
- package/dist/core/command-generation/adapters/cline.d.ts +14 -0
- package/dist/core/command-generation/adapters/cline.js +27 -0
- package/dist/core/command-generation/adapters/codebuddy.d.ts +13 -0
- package/dist/core/command-generation/adapters/codebuddy.js +28 -0
- package/dist/core/command-generation/adapters/codex.d.ts +16 -0
- package/dist/core/command-generation/adapters/codex.js +39 -0
- package/dist/core/command-generation/adapters/continue.d.ts +13 -0
- package/dist/core/command-generation/adapters/continue.js +28 -0
- package/dist/core/command-generation/adapters/costrict.d.ts +13 -0
- package/dist/core/command-generation/adapters/costrict.js +27 -0
- package/dist/core/command-generation/adapters/crush.d.ts +13 -0
- package/dist/core/command-generation/adapters/crush.js +30 -0
- package/dist/core/command-generation/adapters/cursor.d.ts +14 -0
- package/dist/core/command-generation/adapters/cursor.js +44 -0
- package/dist/core/command-generation/adapters/factory.d.ts +13 -0
- package/dist/core/command-generation/adapters/factory.js +27 -0
- package/dist/core/command-generation/adapters/gemini.d.ts +13 -0
- package/dist/core/command-generation/adapters/gemini.js +26 -0
- package/dist/core/command-generation/adapters/github-copilot.d.ts +13 -0
- package/dist/core/command-generation/adapters/github-copilot.js +26 -0
- package/dist/core/command-generation/adapters/iflow.d.ts +13 -0
- package/dist/core/command-generation/adapters/iflow.js +29 -0
- package/dist/core/command-generation/adapters/index.d.ts +32 -0
- package/dist/core/command-generation/adapters/index.js +32 -0
- package/dist/core/command-generation/adapters/junie.d.ts +13 -0
- package/dist/core/command-generation/adapters/junie.js +26 -0
- package/dist/core/command-generation/adapters/kilocode.d.ts +14 -0
- package/dist/core/command-generation/adapters/kilocode.js +23 -0
- package/dist/core/command-generation/adapters/kiro.d.ts +13 -0
- package/dist/core/command-generation/adapters/kiro.js +26 -0
- package/dist/core/command-generation/adapters/lingma.d.ts +13 -0
- package/dist/core/command-generation/adapters/lingma.js +30 -0
- package/dist/core/command-generation/adapters/opencode.d.ts +13 -0
- package/dist/core/command-generation/adapters/opencode.js +29 -0
- package/dist/core/command-generation/adapters/pi.d.ts +18 -0
- package/dist/core/command-generation/adapters/pi.js +55 -0
- package/dist/core/command-generation/adapters/qoder.d.ts +13 -0
- package/dist/core/command-generation/adapters/qoder.js +30 -0
- package/dist/core/command-generation/adapters/qwen.d.ts +13 -0
- package/dist/core/command-generation/adapters/qwen.js +26 -0
- package/dist/core/command-generation/adapters/roocode.d.ts +14 -0
- package/dist/core/command-generation/adapters/roocode.js +27 -0
- package/dist/core/command-generation/adapters/windsurf.d.ts +14 -0
- package/dist/core/command-generation/adapters/windsurf.js +51 -0
- package/dist/core/command-generation/generator.d.ts +21 -0
- package/dist/core/command-generation/generator.js +27 -0
- package/dist/core/command-generation/index.d.ts +22 -0
- package/dist/core/command-generation/index.js +24 -0
- package/dist/core/command-generation/registry.d.ts +36 -0
- package/dist/core/command-generation/registry.js +98 -0
- package/dist/core/command-generation/types.d.ts +56 -0
- package/dist/core/command-generation/types.js +8 -0
- package/dist/core/completions/command-registry.d.ts +7 -0
- package/dist/core/completions/command-registry.js +626 -0
- package/dist/core/completions/completion-provider.d.ts +71 -0
- package/dist/core/completions/completion-provider.js +129 -0
- package/dist/core/completions/factory.d.ts +64 -0
- package/dist/core/completions/factory.js +75 -0
- package/dist/core/completions/generators/bash-generator.d.ts +35 -0
- package/dist/core/completions/generators/bash-generator.js +230 -0
- package/dist/core/completions/generators/fish-generator.d.ts +32 -0
- package/dist/core/completions/generators/fish-generator.js +160 -0
- package/dist/core/completions/generators/powershell-generator.d.ts +36 -0
- package/dist/core/completions/generators/powershell-generator.js +266 -0
- package/dist/core/completions/generators/zsh-generator.d.ts +47 -0
- package/dist/core/completions/generators/zsh-generator.js +274 -0
- package/dist/core/completions/installers/bash-installer.d.ts +87 -0
- package/dist/core/completions/installers/bash-installer.js +318 -0
- package/dist/core/completions/installers/fish-installer.d.ts +43 -0
- package/dist/core/completions/installers/fish-installer.js +143 -0
- package/dist/core/completions/installers/powershell-installer.d.ts +102 -0
- package/dist/core/completions/installers/powershell-installer.js +387 -0
- package/dist/core/completions/installers/zsh-installer.d.ts +117 -0
- package/dist/core/completions/installers/zsh-installer.js +421 -0
- package/dist/core/completions/templates/bash-templates.d.ts +6 -0
- package/dist/core/completions/templates/bash-templates.js +30 -0
- package/dist/core/completions/templates/fish-templates.d.ts +7 -0
- package/dist/core/completions/templates/fish-templates.js +45 -0
- package/dist/core/completions/templates/powershell-templates.d.ts +6 -0
- package/dist/core/completions/templates/powershell-templates.js +34 -0
- package/dist/core/completions/templates/zsh-templates.d.ts +6 -0
- package/dist/core/completions/templates/zsh-templates.js +45 -0
- package/dist/core/completions/types.d.ts +101 -0
- package/dist/core/completions/types.js +2 -0
- package/dist/core/config-prompts.d.ts +9 -0
- package/dist/core/config-prompts.js +34 -0
- package/dist/core/config-schema.d.ts +86 -0
- package/dist/core/config-schema.js +213 -0
- package/dist/core/config.d.ts +18 -0
- package/dist/core/config.js +38 -0
- package/dist/core/converters/json-converter.d.ts +6 -0
- package/dist/core/converters/json-converter.js +51 -0
- package/dist/core/global-config.d.ts +49 -0
- package/dist/core/global-config.js +124 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/index.js +6 -0
- package/dist/core/init.d.ts +37 -0
- package/dist/core/init.js +593 -0
- package/dist/core/jira/config.d.ts +35 -0
- package/dist/core/jira/config.js +151 -0
- package/dist/core/jira/constants.d.ts +20 -0
- package/dist/core/jira/constants.js +49 -0
- package/dist/core/jira/doctor.d.ts +19 -0
- package/dist/core/jira/doctor.js +173 -0
- package/dist/core/jira/hash.d.ts +3 -0
- package/dist/core/jira/hash.js +9 -0
- package/dist/core/jira/index.d.ts +11 -0
- package/dist/core/jira/index.js +11 -0
- package/dist/core/jira/intake.d.ts +40 -0
- package/dist/core/jira/intake.js +54 -0
- package/dist/core/jira/mcp-config.d.ts +13 -0
- package/dist/core/jira/mcp-config.js +259 -0
- package/dist/core/jira/paths.d.ts +12 -0
- package/dist/core/jira/paths.js +66 -0
- package/dist/core/jira/setup.d.ts +30 -0
- package/dist/core/jira/setup.js +99 -0
- package/dist/core/jira/templates.d.ts +12 -0
- package/dist/core/jira/templates.js +204 -0
- package/dist/core/jira/validation.d.ts +17 -0
- package/dist/core/jira/validation.js +341 -0
- package/dist/core/legacy-cleanup.d.ts +162 -0
- package/dist/core/legacy-cleanup.js +514 -0
- package/dist/core/list.d.ts +9 -0
- package/dist/core/list.js +171 -0
- package/dist/core/migration.d.ts +23 -0
- package/dist/core/migration.js +108 -0
- package/dist/core/parsers/change-parser.d.ts +13 -0
- package/dist/core/parsers/change-parser.js +197 -0
- package/dist/core/parsers/markdown-parser.d.ts +26 -0
- package/dist/core/parsers/markdown-parser.js +227 -0
- package/dist/core/parsers/requirement-blocks.d.ts +37 -0
- package/dist/core/parsers/requirement-blocks.js +201 -0
- package/dist/core/parsers/spec-structure.d.ts +9 -0
- package/dist/core/parsers/spec-structure.js +88 -0
- package/dist/core/planning-home.d.ts +21 -0
- package/dist/core/planning-home.js +124 -0
- package/dist/core/profile-sync-drift.d.ts +38 -0
- package/dist/core/profile-sync-drift.js +200 -0
- package/dist/core/profiles.d.ts +26 -0
- package/dist/core/profiles.js +40 -0
- package/dist/core/project-config.d.ts +64 -0
- package/dist/core/project-config.js +223 -0
- package/dist/core/schemas/base.schema.d.ts +13 -0
- package/dist/core/schemas/base.schema.js +13 -0
- package/dist/core/schemas/change.schema.d.ts +73 -0
- package/dist/core/schemas/change.schema.js +31 -0
- package/dist/core/schemas/index.d.ts +4 -0
- package/dist/core/schemas/index.js +4 -0
- package/dist/core/schemas/spec.schema.d.ts +18 -0
- package/dist/core/schemas/spec.schema.js +15 -0
- package/dist/core/shared/index.d.ts +8 -0
- package/dist/core/shared/index.js +8 -0
- package/dist/core/shared/skill-generation.d.ts +49 -0
- package/dist/core/shared/skill-generation.js +96 -0
- package/dist/core/shared/tool-detection.d.ts +71 -0
- package/dist/core/shared/tool-detection.js +158 -0
- package/dist/core/specs-apply.d.ts +73 -0
- package/dist/core/specs-apply.js +392 -0
- package/dist/core/styles/palette.d.ts +7 -0
- package/dist/core/styles/palette.js +8 -0
- package/dist/core/templates/index.d.ts +8 -0
- package/dist/core/templates/index.js +9 -0
- package/dist/core/templates/skill-templates.d.ts +19 -0
- package/dist/core/templates/skill-templates.js +18 -0
- package/dist/core/templates/types.d.ts +19 -0
- package/dist/core/templates/types.js +5 -0
- package/dist/core/templates/workflows/apply-change.d.ts +10 -0
- package/dist/core/templates/workflows/apply-change.js +314 -0
- package/dist/core/templates/workflows/archive-change.d.ts +10 -0
- package/dist/core/templates/workflows/archive-change.js +277 -0
- package/dist/core/templates/workflows/bulk-archive-change.d.ts +10 -0
- package/dist/core/templates/workflows/bulk-archive-change.js +492 -0
- package/dist/core/templates/workflows/continue-change.d.ts +10 -0
- package/dist/core/templates/workflows/continue-change.js +234 -0
- package/dist/core/templates/workflows/explore.d.ts +10 -0
- package/dist/core/templates/workflows/explore.js +459 -0
- package/dist/core/templates/workflows/feedback.d.ts +9 -0
- package/dist/core/templates/workflows/feedback.js +108 -0
- package/dist/core/templates/workflows/ff-change.d.ts +10 -0
- package/dist/core/templates/workflows/ff-change.js +200 -0
- package/dist/core/templates/workflows/new-change.d.ts +10 -0
- package/dist/core/templates/workflows/new-change.js +143 -0
- package/dist/core/templates/workflows/onboard.d.ts +10 -0
- package/dist/core/templates/workflows/onboard.js +563 -0
- package/dist/core/templates/workflows/propose.d.ts +10 -0
- package/dist/core/templates/workflows/propose.js +218 -0
- package/dist/core/templates/workflows/sync-specs.d.ts +10 -0
- package/dist/core/templates/workflows/sync-specs.js +290 -0
- package/dist/core/templates/workflows/verify-change.d.ts +10 -0
- package/dist/core/templates/workflows/verify-change.js +338 -0
- package/dist/core/update.d.ts +83 -0
- package/dist/core/update.js +573 -0
- package/dist/core/validation/constants.d.ts +34 -0
- package/dist/core/validation/constants.js +40 -0
- package/dist/core/validation/types.d.ts +18 -0
- package/dist/core/validation/types.js +2 -0
- package/dist/core/validation/validator.d.ts +33 -0
- package/dist/core/validation/validator.js +418 -0
- package/dist/core/view.d.ts +8 -0
- package/dist/core/view.js +168 -0
- package/dist/core/workspace/foundation.d.ts +87 -0
- package/dist/core/workspace/foundation.js +379 -0
- package/dist/core/workspace/index.d.ts +6 -0
- package/dist/core/workspace/index.js +6 -0
- package/dist/core/workspace/link-input.d.ts +9 -0
- package/dist/core/workspace/link-input.js +32 -0
- package/dist/core/workspace/open-surface.d.ts +24 -0
- package/dist/core/workspace/open-surface.js +137 -0
- package/dist/core/workspace/openers.d.ts +21 -0
- package/dist/core/workspace/openers.js +119 -0
- package/dist/core/workspace/skills.d.ts +55 -0
- package/dist/core/workspace/skills.js +334 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/prompts/searchable-multi-select.d.ts +28 -0
- package/dist/prompts/searchable-multi-select.js +159 -0
- package/dist/telemetry/config.d.ts +38 -0
- package/dist/telemetry/config.js +136 -0
- package/dist/telemetry/index.d.ts +31 -0
- package/dist/telemetry/index.js +164 -0
- package/dist/ui/ascii-patterns.d.ts +16 -0
- package/dist/ui/ascii-patterns.js +133 -0
- package/dist/ui/welcome-screen.d.ts +10 -0
- package/dist/ui/welcome-screen.js +146 -0
- package/dist/utils/change-metadata.d.ts +51 -0
- package/dist/utils/change-metadata.js +147 -0
- package/dist/utils/change-utils.d.ts +71 -0
- package/dist/utils/change-utils.js +123 -0
- package/dist/utils/command-references.d.ts +18 -0
- package/dist/utils/command-references.js +20 -0
- package/dist/utils/file-system.d.ts +41 -0
- package/dist/utils/file-system.js +301 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/interactive.d.ts +18 -0
- package/dist/utils/interactive.js +21 -0
- package/dist/utils/item-discovery.d.ts +4 -0
- package/dist/utils/item-discovery.js +72 -0
- package/dist/utils/match.d.ts +3 -0
- package/dist/utils/match.js +22 -0
- package/dist/utils/shell-detection.d.ts +20 -0
- package/dist/utils/shell-detection.js +41 -0
- package/dist/utils/task-progress.d.ts +8 -0
- package/dist/utils/task-progress.js +36 -0
- package/package.json +79 -0
- package/schemas/spec-driven/schema.yaml +153 -0
- package/schemas/spec-driven/templates/design.md +19 -0
- package/schemas/spec-driven/templates/proposal.md +23 -0
- package/schemas/spec-driven/templates/spec.md +8 -0
- package/schemas/spec-driven/templates/tasks.md +9 -0
- package/schemas/workspace-planning/schema.yaml +72 -0
- package/schemas/workspace-planning/templates/design.md +33 -0
- package/schemas/workspace-planning/templates/proposal.md +28 -0
- package/schemas/workspace-planning/templates/spec.md +9 -0
- package/schemas/workspace-planning/templates/tasks.md +15 -0
- package/scripts/postinstall.js +83 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { WorkspacePreferredOpener, WorkspaceSupportedOpenerValue } from './foundation.js';
|
|
2
|
+
export interface WorkspaceOpenerChoice {
|
|
3
|
+
value: WorkspaceSupportedOpenerValue;
|
|
4
|
+
label: string;
|
|
5
|
+
opener: WorkspacePreferredOpener;
|
|
6
|
+
executable: string;
|
|
7
|
+
available: boolean;
|
|
8
|
+
unavailableNote: string | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function isWorkspaceExecutableAvailable(executable: string, options?: {
|
|
11
|
+
env?: NodeJS.ProcessEnv;
|
|
12
|
+
platform?: NodeJS.Platform;
|
|
13
|
+
}): boolean;
|
|
14
|
+
export declare function getWorkspaceOpenerExecutable(opener: WorkspacePreferredOpener): string;
|
|
15
|
+
export declare function getWorkspaceOpenerLabel(opener: WorkspacePreferredOpener): string;
|
|
16
|
+
export declare function listWorkspaceOpenerChoices(options?: {
|
|
17
|
+
env?: NodeJS.ProcessEnv;
|
|
18
|
+
platform?: NodeJS.Platform;
|
|
19
|
+
}): WorkspaceOpenerChoice[];
|
|
20
|
+
export declare function getDefaultWorkspaceOpenerChoiceValue(choices: WorkspaceOpenerChoice[]): WorkspaceSupportedOpenerValue;
|
|
21
|
+
//# sourceMappingURL=openers.d.ts.map
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import * as nodeFs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { parseWorkspacePreferredOpenerValue, } from './foundation.js';
|
|
4
|
+
const fs = nodeFs;
|
|
5
|
+
const WORKSPACE_OPENER_CHOICE_DEFINITIONS = [
|
|
6
|
+
{
|
|
7
|
+
value: 'editor',
|
|
8
|
+
label: 'VS Code editor',
|
|
9
|
+
executable: 'code',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
value: 'codex',
|
|
13
|
+
label: 'Codex',
|
|
14
|
+
executable: 'codex',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
value: 'claude',
|
|
18
|
+
label: 'Claude',
|
|
19
|
+
executable: 'claude',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
value: 'github-copilot',
|
|
23
|
+
label: 'GitHub Copilot in VS Code',
|
|
24
|
+
executable: 'code',
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
function getPathValue(env) {
|
|
28
|
+
return env.PATH ?? env.Path ?? env.path ?? '';
|
|
29
|
+
}
|
|
30
|
+
function getPathExts(env, platform) {
|
|
31
|
+
if (platform !== 'win32') {
|
|
32
|
+
return [''];
|
|
33
|
+
}
|
|
34
|
+
const pathExt = env.PATHEXT ?? '.COM;.EXE;.BAT;.CMD';
|
|
35
|
+
return pathExt
|
|
36
|
+
.split(';')
|
|
37
|
+
.map((extension) => extension.trim())
|
|
38
|
+
.filter((extension) => extension.length > 0);
|
|
39
|
+
}
|
|
40
|
+
function isExecutableFile(candidatePath, platform) {
|
|
41
|
+
try {
|
|
42
|
+
const stats = fs.statSync(candidatePath);
|
|
43
|
+
if (!stats.isFile()) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
if (platform === 'win32') {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
fs.accessSync(candidatePath, fs.constants.X_OK);
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export function isWorkspaceExecutableAvailable(executable, options = {}) {
|
|
57
|
+
const env = options.env ?? process.env;
|
|
58
|
+
const platform = options.platform ?? process.platform;
|
|
59
|
+
if (executable.includes('/') || executable.includes('\\')) {
|
|
60
|
+
return isExecutableFile(executable, platform);
|
|
61
|
+
}
|
|
62
|
+
const pathEntries = getPathValue(env)
|
|
63
|
+
.split(path.delimiter)
|
|
64
|
+
.filter((entry) => entry.length > 0);
|
|
65
|
+
const pathExts = getPathExts(env, platform);
|
|
66
|
+
for (const entry of pathEntries) {
|
|
67
|
+
for (const extension of pathExts) {
|
|
68
|
+
const candidate = path.join(entry, executable + extension);
|
|
69
|
+
if (isExecutableFile(candidate, platform)) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
export function getWorkspaceOpenerExecutable(opener) {
|
|
77
|
+
if (opener.kind === 'editor') {
|
|
78
|
+
return 'code';
|
|
79
|
+
}
|
|
80
|
+
if (opener.id === 'github-copilot') {
|
|
81
|
+
return 'code';
|
|
82
|
+
}
|
|
83
|
+
return opener.id;
|
|
84
|
+
}
|
|
85
|
+
export function getWorkspaceOpenerLabel(opener) {
|
|
86
|
+
if (opener.kind === 'editor') {
|
|
87
|
+
return 'VS Code editor';
|
|
88
|
+
}
|
|
89
|
+
if (opener.id === 'github-copilot') {
|
|
90
|
+
return 'GitHub Copilot in VS Code';
|
|
91
|
+
}
|
|
92
|
+
if (opener.id === 'codex') {
|
|
93
|
+
return 'Codex';
|
|
94
|
+
}
|
|
95
|
+
return 'Claude';
|
|
96
|
+
}
|
|
97
|
+
export function listWorkspaceOpenerChoices(options = {}) {
|
|
98
|
+
const choices = WORKSPACE_OPENER_CHOICE_DEFINITIONS.map((definition) => {
|
|
99
|
+
const available = isWorkspaceExecutableAvailable(definition.executable, options);
|
|
100
|
+
return {
|
|
101
|
+
value: definition.value,
|
|
102
|
+
label: definition.label,
|
|
103
|
+
opener: parseWorkspacePreferredOpenerValue(definition.value),
|
|
104
|
+
executable: definition.executable,
|
|
105
|
+
available,
|
|
106
|
+
unavailableNote: available ? null : `${definition.executable} not found on PATH`,
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
return choices.sort((a, b) => {
|
|
110
|
+
if (a.available !== b.available) {
|
|
111
|
+
return a.available ? -1 : 1;
|
|
112
|
+
}
|
|
113
|
+
return 0;
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
export function getDefaultWorkspaceOpenerChoiceValue(choices) {
|
|
117
|
+
return choices.find((choice) => choice.available)?.value ?? 'editor';
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=openers.js.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type AIToolOption } from '../config.js';
|
|
2
|
+
import { type Delivery, type Profile } from '../global-config.js';
|
|
3
|
+
import type { WorkspaceLocalState, WorkspaceSkillState } from './foundation.js';
|
|
4
|
+
export interface WorkspaceSkillAgentResult {
|
|
5
|
+
tool_id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
skills_path: string;
|
|
8
|
+
workflow_ids: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface WorkspaceSkillRemovedResult extends WorkspaceSkillAgentResult {
|
|
11
|
+
reason: 'agent_unselected' | 'workflow_unselected';
|
|
12
|
+
}
|
|
13
|
+
export interface WorkspaceSkillSkippedResult {
|
|
14
|
+
tool_id?: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
reason: string;
|
|
17
|
+
message: string;
|
|
18
|
+
}
|
|
19
|
+
export interface WorkspaceSkillFailedResult {
|
|
20
|
+
tool_id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
error: string;
|
|
23
|
+
}
|
|
24
|
+
export interface WorkspaceSkillInstallationReport {
|
|
25
|
+
profile: Profile;
|
|
26
|
+
delivery: Delivery;
|
|
27
|
+
workflow_ids: string[];
|
|
28
|
+
selected_agents: string[];
|
|
29
|
+
skills_only: true;
|
|
30
|
+
delivery_notice: string | null;
|
|
31
|
+
generated: WorkspaceSkillAgentResult[];
|
|
32
|
+
added: WorkspaceSkillAgentResult[];
|
|
33
|
+
refreshed: WorkspaceSkillAgentResult[];
|
|
34
|
+
removed: WorkspaceSkillRemovedResult[];
|
|
35
|
+
skipped: WorkspaceSkillSkippedResult[];
|
|
36
|
+
failed: WorkspaceSkillFailedResult[];
|
|
37
|
+
}
|
|
38
|
+
type WorkspaceSkillCapableTool = AIToolOption & {
|
|
39
|
+
skillsDir: string;
|
|
40
|
+
};
|
|
41
|
+
export declare function getCurrentWorkspaceSkillProfileSelection(): {
|
|
42
|
+
profile: Profile;
|
|
43
|
+
delivery: Delivery;
|
|
44
|
+
workflow_ids: string[];
|
|
45
|
+
};
|
|
46
|
+
export declare function hasWorkspaceSkillProfileDrift(localState: Pick<WorkspaceLocalState, 'workspace_skills'> | null | undefined): boolean;
|
|
47
|
+
export declare function getWorkspaceSkillCapableTools(): WorkspaceSkillCapableTool[];
|
|
48
|
+
export declare function getWorkspaceSkillToolIds(): string[];
|
|
49
|
+
export declare function parseWorkspaceSkillToolsValue(rawTools: string): string[];
|
|
50
|
+
export declare function createWorkspaceSkillSkippedReport(reason: string, message: string): WorkspaceSkillInstallationReport;
|
|
51
|
+
export declare function getWorkspaceSkillDirectory(workspaceRoot: string, toolId: string): string;
|
|
52
|
+
export declare function generateWorkspaceAgentSkills(workspaceRoot: string, selectedAgentIds: string[]): Promise<WorkspaceSkillInstallationReport>;
|
|
53
|
+
export declare function updateWorkspaceAgentSkills(workspaceRoot: string, selectedAgentIds: string[], previousSkillState?: WorkspaceSkillState): Promise<WorkspaceSkillInstallationReport>;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=skills.d.ts.map
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import * as nodeFs from 'node:fs';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { FileSystemUtils } from '../../utils/file-system.js';
|
|
4
|
+
import { transformToHyphenCommands } from '../../utils/command-references.js';
|
|
5
|
+
import { AI_TOOLS } from '../config.js';
|
|
6
|
+
import { getGlobalConfig } from '../global-config.js';
|
|
7
|
+
import { getProfileWorkflows } from '../profiles.js';
|
|
8
|
+
import { generateSkillContent, getSkillTemplates, getToolSkillStatus, getToolsWithSkillsDir, extractGeneratedByVersion, } from '../shared/index.js';
|
|
9
|
+
const require = createRequire(import.meta.url);
|
|
10
|
+
const { version: OPENSPEC_VERSION } = require('../../../package.json');
|
|
11
|
+
const fs = nodeFs.promises;
|
|
12
|
+
function resolveWorkspaceSkillProfileContext() {
|
|
13
|
+
const globalConfig = getGlobalConfig();
|
|
14
|
+
const profile = globalConfig.profile ?? 'core';
|
|
15
|
+
const delivery = globalConfig.delivery ?? 'both';
|
|
16
|
+
const workflowIds = [...getProfileWorkflows(profile, globalConfig.workflows)];
|
|
17
|
+
const deliveryNotice = delivery === 'skills'
|
|
18
|
+
? null
|
|
19
|
+
: 'Workspace setup installs skills only; workspace command generation is not part of this slice.';
|
|
20
|
+
return {
|
|
21
|
+
profile,
|
|
22
|
+
delivery,
|
|
23
|
+
workflowIds,
|
|
24
|
+
deliveryNotice,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export function getCurrentWorkspaceSkillProfileSelection() {
|
|
28
|
+
const profileContext = resolveWorkspaceSkillProfileContext();
|
|
29
|
+
return {
|
|
30
|
+
profile: profileContext.profile,
|
|
31
|
+
delivery: profileContext.delivery,
|
|
32
|
+
workflow_ids: profileContext.workflowIds,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function arraysEqual(left, right) {
|
|
36
|
+
const leftValues = left ?? [];
|
|
37
|
+
if (leftValues.length !== right.length) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
const leftSet = new Set(leftValues);
|
|
41
|
+
const rightSet = new Set(right);
|
|
42
|
+
if (leftSet.size !== rightSet.size) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
return [...leftSet].every((value) => rightSet.has(value));
|
|
46
|
+
}
|
|
47
|
+
export function hasWorkspaceSkillProfileDrift(localState) {
|
|
48
|
+
const workspaceSkills = localState?.workspace_skills;
|
|
49
|
+
if (!workspaceSkills) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
const current = getCurrentWorkspaceSkillProfileSelection();
|
|
53
|
+
return (workspaceSkills.last_applied_profile !== current.profile ||
|
|
54
|
+
workspaceSkills.last_applied_delivery !== current.delivery ||
|
|
55
|
+
!arraysEqual(workspaceSkills.last_applied_workflow_ids, current.workflow_ids));
|
|
56
|
+
}
|
|
57
|
+
function makeBaseWorkspaceSkillReport(selectedAgentIds, profileContext = resolveWorkspaceSkillProfileContext()) {
|
|
58
|
+
return {
|
|
59
|
+
profile: profileContext.profile,
|
|
60
|
+
delivery: profileContext.delivery,
|
|
61
|
+
workflow_ids: profileContext.workflowIds,
|
|
62
|
+
selected_agents: selectedAgentIds,
|
|
63
|
+
skills_only: true,
|
|
64
|
+
delivery_notice: profileContext.deliveryNotice,
|
|
65
|
+
generated: [],
|
|
66
|
+
added: [],
|
|
67
|
+
refreshed: [],
|
|
68
|
+
removed: [],
|
|
69
|
+
skipped: [],
|
|
70
|
+
failed: [],
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export function getWorkspaceSkillCapableTools() {
|
|
74
|
+
return AI_TOOLS.filter((tool) => Boolean(tool.skillsDir));
|
|
75
|
+
}
|
|
76
|
+
export function getWorkspaceSkillToolIds() {
|
|
77
|
+
return getToolsWithSkillsDir();
|
|
78
|
+
}
|
|
79
|
+
export function parseWorkspaceSkillToolsValue(rawTools) {
|
|
80
|
+
const raw = rawTools.trim();
|
|
81
|
+
if (raw.length === 0) {
|
|
82
|
+
throw new Error('The --tools option requires a value. Use "all", "none", or a comma-separated list of agent IDs.');
|
|
83
|
+
}
|
|
84
|
+
const availableTools = getWorkspaceSkillToolIds();
|
|
85
|
+
const availableSet = new Set(availableTools);
|
|
86
|
+
const availableList = ['all', 'none', ...availableTools].join(', ');
|
|
87
|
+
const lowerRaw = raw.toLowerCase();
|
|
88
|
+
if (lowerRaw === 'all') {
|
|
89
|
+
return availableTools;
|
|
90
|
+
}
|
|
91
|
+
if (lowerRaw === 'none') {
|
|
92
|
+
return [];
|
|
93
|
+
}
|
|
94
|
+
const tokens = raw
|
|
95
|
+
.split(',')
|
|
96
|
+
.map((token) => token.trim())
|
|
97
|
+
.filter((token) => token.length > 0);
|
|
98
|
+
if (tokens.length === 0) {
|
|
99
|
+
throw new Error('The --tools option requires at least one agent ID when not using "all" or "none".');
|
|
100
|
+
}
|
|
101
|
+
const normalizedTokens = tokens.map((token) => token.toLowerCase());
|
|
102
|
+
if (normalizedTokens.some((token) => token === 'all' || token === 'none')) {
|
|
103
|
+
throw new Error('Cannot combine reserved values "all" or "none" with specific agent IDs.');
|
|
104
|
+
}
|
|
105
|
+
const invalidTokens = tokens.filter((_token, index) => !availableSet.has(normalizedTokens[index]));
|
|
106
|
+
if (invalidTokens.length > 0) {
|
|
107
|
+
throw new Error(`Invalid agent(s): ${invalidTokens.join(', ')}. Available values: ${availableList}`);
|
|
108
|
+
}
|
|
109
|
+
const deduped = [];
|
|
110
|
+
for (const token of normalizedTokens) {
|
|
111
|
+
if (!deduped.includes(token)) {
|
|
112
|
+
deduped.push(token);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return deduped;
|
|
116
|
+
}
|
|
117
|
+
export function createWorkspaceSkillSkippedReport(reason, message) {
|
|
118
|
+
const report = makeBaseWorkspaceSkillReport([]);
|
|
119
|
+
report.skipped.push({
|
|
120
|
+
reason,
|
|
121
|
+
message,
|
|
122
|
+
});
|
|
123
|
+
return report;
|
|
124
|
+
}
|
|
125
|
+
function getWorkspaceSkillTool(toolId) {
|
|
126
|
+
const tool = getWorkspaceSkillCapableTools().find((candidate) => candidate.value === toolId);
|
|
127
|
+
if (!tool) {
|
|
128
|
+
throw new Error(`Unknown workspace skill agent '${toolId}'.`);
|
|
129
|
+
}
|
|
130
|
+
return tool;
|
|
131
|
+
}
|
|
132
|
+
function getWorkspaceSkillDirectoryForTool(workspaceRoot, tool) {
|
|
133
|
+
return FileSystemUtils.joinPath(workspaceRoot, tool.skillsDir, 'skills');
|
|
134
|
+
}
|
|
135
|
+
export function getWorkspaceSkillDirectory(workspaceRoot, toolId) {
|
|
136
|
+
return getWorkspaceSkillDirectoryForTool(workspaceRoot, getWorkspaceSkillTool(toolId));
|
|
137
|
+
}
|
|
138
|
+
function makeAgentResult(workspaceRoot, tool, workflowIds) {
|
|
139
|
+
return {
|
|
140
|
+
tool_id: tool.value,
|
|
141
|
+
name: tool.name,
|
|
142
|
+
skills_path: getWorkspaceSkillDirectoryForTool(workspaceRoot, tool),
|
|
143
|
+
workflow_ids: workflowIds,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function getManagedWorkspaceSkillEntries() {
|
|
147
|
+
return getSkillTemplates().map(({ workflowId, dirName }) => ({ workflowId, dirName }));
|
|
148
|
+
}
|
|
149
|
+
async function pathExists(targetPath) {
|
|
150
|
+
try {
|
|
151
|
+
await fs.access(targetPath);
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
function isOpenSpecManagedSkillDir(skillDir) {
|
|
159
|
+
const skillFile = FileSystemUtils.joinPath(skillDir, 'SKILL.md');
|
|
160
|
+
return extractGeneratedByVersion(skillFile) !== null;
|
|
161
|
+
}
|
|
162
|
+
async function removeManagedWorkflowSkillDirs(workspaceRoot, tool, desiredWorkflowIds, reason) {
|
|
163
|
+
const desiredSet = new Set(desiredWorkflowIds);
|
|
164
|
+
const skillsDir = getWorkspaceSkillDirectoryForTool(workspaceRoot, tool);
|
|
165
|
+
const removedWorkflowIds = [];
|
|
166
|
+
for (const { workflowId, dirName } of getManagedWorkspaceSkillEntries()) {
|
|
167
|
+
if (desiredSet.has(workflowId)) {
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
const skillDir = FileSystemUtils.joinPath(skillsDir, dirName);
|
|
171
|
+
if (!(await pathExists(skillDir))) {
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
if (!isOpenSpecManagedSkillDir(skillDir)) {
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
await fs.rm(skillDir, { recursive: true, force: true });
|
|
178
|
+
removedWorkflowIds.push(workflowId);
|
|
179
|
+
}
|
|
180
|
+
if (removedWorkflowIds.length === 0) {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
return {
|
|
184
|
+
...makeAgentResult(workspaceRoot, tool, removedWorkflowIds),
|
|
185
|
+
reason,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
export async function generateWorkspaceAgentSkills(workspaceRoot, selectedAgentIds) {
|
|
189
|
+
const profileContext = resolveWorkspaceSkillProfileContext();
|
|
190
|
+
const report = makeBaseWorkspaceSkillReport(selectedAgentIds, profileContext);
|
|
191
|
+
if (selectedAgentIds.length === 0) {
|
|
192
|
+
report.skipped.push({
|
|
193
|
+
reason: 'no_agents_selected',
|
|
194
|
+
message: 'No workspace agent skills were selected.',
|
|
195
|
+
});
|
|
196
|
+
return report;
|
|
197
|
+
}
|
|
198
|
+
const skillTemplates = getSkillTemplates(profileContext.workflowIds);
|
|
199
|
+
if (skillTemplates.length === 0) {
|
|
200
|
+
for (const toolId of selectedAgentIds) {
|
|
201
|
+
const tool = getWorkspaceSkillTool(toolId);
|
|
202
|
+
report.skipped.push({
|
|
203
|
+
tool_id: tool.value,
|
|
204
|
+
name: tool.name,
|
|
205
|
+
reason: 'no_profile_workflows',
|
|
206
|
+
message: 'The active global profile does not select any workflows.',
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
return report;
|
|
210
|
+
}
|
|
211
|
+
for (const toolId of selectedAgentIds) {
|
|
212
|
+
const tool = getWorkspaceSkillTool(toolId);
|
|
213
|
+
const wasConfigured = getToolSkillStatus(workspaceRoot, tool.value).configured;
|
|
214
|
+
try {
|
|
215
|
+
const skillsDir = getWorkspaceSkillDirectoryForTool(workspaceRoot, tool);
|
|
216
|
+
const transformer = tool.value === 'opencode' || tool.value === 'pi' ? transformToHyphenCommands : undefined;
|
|
217
|
+
for (const { template, dirName } of skillTemplates) {
|
|
218
|
+
const skillFile = FileSystemUtils.joinPath(skillsDir, dirName, 'SKILL.md');
|
|
219
|
+
const skillContent = generateSkillContent(template, OPENSPEC_VERSION, transformer);
|
|
220
|
+
await FileSystemUtils.writeFile(skillFile, skillContent);
|
|
221
|
+
}
|
|
222
|
+
const result = makeAgentResult(workspaceRoot, tool, profileContext.workflowIds);
|
|
223
|
+
if (wasConfigured) {
|
|
224
|
+
report.refreshed.push(result);
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
report.generated.push(result);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
catch (error) {
|
|
231
|
+
report.failed.push({
|
|
232
|
+
tool_id: tool.value,
|
|
233
|
+
name: tool.name,
|
|
234
|
+
error: error instanceof Error ? error.message : String(error),
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return report;
|
|
239
|
+
}
|
|
240
|
+
export async function updateWorkspaceAgentSkills(workspaceRoot, selectedAgentIds, previousSkillState) {
|
|
241
|
+
const profileContext = resolveWorkspaceSkillProfileContext();
|
|
242
|
+
const report = makeBaseWorkspaceSkillReport(selectedAgentIds, profileContext);
|
|
243
|
+
const previousSelectedAgentIds = previousSkillState?.selected_agents ?? [];
|
|
244
|
+
const previousSelectedSet = new Set(previousSelectedAgentIds);
|
|
245
|
+
const selectedSet = new Set(selectedAgentIds);
|
|
246
|
+
const skillTemplates = getSkillTemplates(profileContext.workflowIds);
|
|
247
|
+
for (const toolId of previousSelectedAgentIds) {
|
|
248
|
+
if (selectedSet.has(toolId)) {
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
const tool = getWorkspaceSkillTool(toolId);
|
|
252
|
+
try {
|
|
253
|
+
const removed = await removeManagedWorkflowSkillDirs(workspaceRoot, tool, [], 'agent_unselected');
|
|
254
|
+
if (removed) {
|
|
255
|
+
report.removed.push(removed);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
catch (error) {
|
|
259
|
+
report.failed.push({
|
|
260
|
+
tool_id: tool.value,
|
|
261
|
+
name: tool.name,
|
|
262
|
+
error: error instanceof Error ? error.message : String(error),
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if (selectedAgentIds.length === 0) {
|
|
267
|
+
if (report.removed.length === 0) {
|
|
268
|
+
report.skipped.push({
|
|
269
|
+
reason: previousSkillState ? 'no_agents_selected' : 'no_stored_agent_selection',
|
|
270
|
+
message: previousSkillState
|
|
271
|
+
? 'No workspace agent skills were selected.'
|
|
272
|
+
: 'No workspace agent skill selection is stored. Pass --tools <ids> to install skills.',
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
return report;
|
|
276
|
+
}
|
|
277
|
+
if (skillTemplates.length === 0) {
|
|
278
|
+
for (const toolId of selectedAgentIds) {
|
|
279
|
+
const tool = getWorkspaceSkillTool(toolId);
|
|
280
|
+
try {
|
|
281
|
+
const removed = await removeManagedWorkflowSkillDirs(workspaceRoot, tool, [], 'workflow_unselected');
|
|
282
|
+
if (removed) {
|
|
283
|
+
report.removed.push(removed);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
catch (error) {
|
|
287
|
+
report.failed.push({
|
|
288
|
+
tool_id: tool.value,
|
|
289
|
+
name: tool.name,
|
|
290
|
+
error: error instanceof Error ? error.message : String(error),
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
report.skipped.push({
|
|
294
|
+
tool_id: tool.value,
|
|
295
|
+
name: tool.name,
|
|
296
|
+
reason: 'no_profile_workflows',
|
|
297
|
+
message: 'The active global profile does not select any workflows.',
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
return report;
|
|
301
|
+
}
|
|
302
|
+
for (const toolId of selectedAgentIds) {
|
|
303
|
+
const tool = getWorkspaceSkillTool(toolId);
|
|
304
|
+
try {
|
|
305
|
+
const skillsDir = getWorkspaceSkillDirectoryForTool(workspaceRoot, tool);
|
|
306
|
+
const transformer = tool.value === 'opencode' || tool.value === 'pi' ? transformToHyphenCommands : undefined;
|
|
307
|
+
for (const { template, dirName } of skillTemplates) {
|
|
308
|
+
const skillFile = FileSystemUtils.joinPath(skillsDir, dirName, 'SKILL.md');
|
|
309
|
+
const skillContent = generateSkillContent(template, OPENSPEC_VERSION, transformer);
|
|
310
|
+
await FileSystemUtils.writeFile(skillFile, skillContent);
|
|
311
|
+
}
|
|
312
|
+
const removed = await removeManagedWorkflowSkillDirs(workspaceRoot, tool, profileContext.workflowIds, 'workflow_unselected');
|
|
313
|
+
if (removed) {
|
|
314
|
+
report.removed.push(removed);
|
|
315
|
+
}
|
|
316
|
+
const result = makeAgentResult(workspaceRoot, tool, profileContext.workflowIds);
|
|
317
|
+
if (previousSelectedSet.has(toolId)) {
|
|
318
|
+
report.refreshed.push(result);
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
report.added.push(result);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
catch (error) {
|
|
325
|
+
report.failed.push({
|
|
326
|
+
tool_id: tool.value,
|
|
327
|
+
name: tool.name,
|
|
328
|
+
error: error instanceof Error ? error.message : String(error),
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
return report;
|
|
333
|
+
}
|
|
334
|
+
//# sourceMappingURL=skills.js.map
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
interface Choice {
|
|
2
|
+
name: string;
|
|
3
|
+
value: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
configured?: boolean;
|
|
6
|
+
detected?: boolean;
|
|
7
|
+
configuredLabel?: string;
|
|
8
|
+
preSelected?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface Config {
|
|
11
|
+
message: string;
|
|
12
|
+
choices: Choice[];
|
|
13
|
+
pageSize?: number;
|
|
14
|
+
validate?: (selected: string[]) => boolean | string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A searchable multi-select prompt with visible search box,
|
|
18
|
+
* selected items display, and intuitive keyboard navigation.
|
|
19
|
+
*
|
|
20
|
+
* - Type to filter choices
|
|
21
|
+
* - ↑↓ to navigate
|
|
22
|
+
* - Space to toggle highlighted item selection
|
|
23
|
+
* - Backspace to remove last selected item (or delete search char)
|
|
24
|
+
* - Enter to confirm selections
|
|
25
|
+
*/
|
|
26
|
+
export declare function searchableMultiSelect(config: Config): Promise<string[]>;
|
|
27
|
+
export default searchableMultiSelect;
|
|
28
|
+
//# sourceMappingURL=searchable-multi-select.d.ts.map
|