@niujiajie/freespec 0.0.0-stage → 1.15.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 +58 -2
- package/bin/freespec.js +5 -0
- package/dist/cli/index.d.ts +25 -0
- package/dist/cli/index.js +359 -0
- package/dist/commands/shared-output.d.ts +18 -0
- package/dist/commands/shared-output.js +61 -0
- package/dist/commands/workflow/default-schema.d.ts +2 -0
- package/dist/commands/workflow/default-schema.js +4 -0
- package/dist/commands/workflow/index.d.ts +13 -0
- package/dist/commands/workflow/index.js +10 -0
- package/dist/commands/workflow/instructions.d.ts +39 -0
- package/dist/commands/workflow/instructions.js +565 -0
- package/dist/commands/workflow/new-change.d.ts +19 -0
- package/dist/commands/workflow/new-change.js +135 -0
- package/dist/commands/workflow/shared.d.ts +94 -0
- package/dist/commands/workflow/shared.js +169 -0
- package/dist/commands/workflow/status.d.ts +18 -0
- package/dist/commands/workflow/status.js +201 -0
- package/dist/core/artifact-graph/graph.d.ts +72 -0
- package/dist/core/artifact-graph/graph.js +165 -0
- package/dist/core/artifact-graph/index.d.ts +9 -0
- package/dist/core/artifact-graph/index.js +14 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts +208 -0
- package/dist/core/artifact-graph/instruction-loader.js +268 -0
- package/dist/core/artifact-graph/outputs.d.ts +19 -0
- package/dist/core/artifact-graph/outputs.js +351 -0
- package/dist/core/artifact-graph/resolver.d.ts +89 -0
- package/dist/core/artifact-graph/resolver.js +342 -0
- package/dist/core/artifact-graph/schema.d.ts +27 -0
- package/dist/core/artifact-graph/schema.js +160 -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 +40 -0
- package/dist/core/artifact-graph/types.js +59 -0
- package/dist/core/available-tools.d.ts +18 -0
- package/dist/core/available-tools.js +49 -0
- package/dist/core/change-layout.d.ts +17 -0
- package/dist/core/change-layout.js +30 -0
- package/dist/core/change-metadata/index.d.ts +2 -0
- package/dist/core/change-metadata/index.js +2 -0
- package/dist/core/change-metadata/schema.d.ts +23 -0
- package/dist/core/change-metadata/schema.js +46 -0
- package/dist/core/change-status-policy.d.ts +49 -0
- package/dist/core/change-status-policy.js +50 -0
- package/dist/core/command-generation/adapters/amazon-q.d.ts +17 -0
- package/dist/core/command-generation/adapters/amazon-q.js +32 -0
- package/dist/core/command-generation/adapters/antigravity.d.ts +13 -0
- package/dist/core/command-generation/adapters/antigravity.js +27 -0
- package/dist/core/command-generation/adapters/atomcode.d.ts +24 -0
- package/dist/core/command-generation/adapters/atomcode.js +46 -0
- package/dist/core/command-generation/adapters/auggie.d.ts +13 -0
- package/dist/core/command-generation/adapters/auggie.js +28 -0
- package/dist/core/command-generation/adapters/bob.d.ts +18 -0
- package/dist/core/command-generation/adapters/bob.js +33 -0
- package/dist/core/command-generation/adapters/claude.d.ts +13 -0
- package/dist/core/command-generation/adapters/claude.js +32 -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/codeassistant.d.ts +15 -0
- package/dist/core/command-generation/adapters/codeassistant.js +29 -0
- package/dist/core/command-generation/adapters/codebuddy.d.ts +13 -0
- package/dist/core/command-generation/adapters/codebuddy.js +29 -0
- package/dist/core/command-generation/adapters/codestudio.d.ts +13 -0
- package/dist/core/command-generation/adapters/codestudio.js +27 -0
- package/dist/core/command-generation/adapters/command-code.d.ts +19 -0
- package/dist/core/command-generation/adapters/command-code.js +34 -0
- package/dist/core/command-generation/adapters/continue.d.ts +13 -0
- package/dist/core/command-generation/adapters/continue.js +33 -0
- package/dist/core/command-generation/adapters/costrict.d.ts +13 -0
- package/dist/core/command-generation/adapters/costrict.js +28 -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 +31 -0
- package/dist/core/command-generation/adapters/devin.d.ts +19 -0
- package/dist/core/command-generation/adapters/devin.js +36 -0
- package/dist/core/command-generation/adapters/easycode.d.ts +17 -0
- package/dist/core/command-generation/adapters/easycode.js +28 -0
- package/dist/core/command-generation/adapters/factory.d.ts +13 -0
- package/dist/core/command-generation/adapters/factory.js +28 -0
- package/dist/core/command-generation/adapters/gemini.d.ts +13 -0
- package/dist/core/command-generation/adapters/gemini.js +27 -0
- package/dist/core/command-generation/adapters/gigacode.d.ts +17 -0
- package/dist/core/command-generation/adapters/gigacode.js +31 -0
- package/dist/core/command-generation/adapters/github-copilot.d.ts +13 -0
- package/dist/core/command-generation/adapters/github-copilot.js +27 -0
- package/dist/core/command-generation/adapters/iflow.d.ts +13 -0
- package/dist/core/command-generation/adapters/iflow.js +30 -0
- package/dist/core/command-generation/adapters/index.d.ts +40 -0
- package/dist/core/command-generation/adapters/index.js +40 -0
- package/dist/core/command-generation/adapters/junie.d.ts +13 -0
- package/dist/core/command-generation/adapters/junie.js +27 -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 +27 -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/oh-my-pi.d.ts +21 -0
- package/dist/core/command-generation/adapters/oh-my-pi.js +42 -0
- package/dist/core/command-generation/adapters/opencode.d.ts +14 -0
- package/dist/core/command-generation/adapters/opencode.js +38 -0
- package/dist/core/command-generation/adapters/pi.d.ts +18 -0
- package/dist/core/command-generation/adapters/pi.js +39 -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 +17 -0
- package/dist/core/command-generation/adapters/qwen.js +31 -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/trae.d.ts +13 -0
- package/dist/core/command-generation/adapters/trae.js +28 -0
- package/dist/core/command-generation/adapters/zcode.d.ts +16 -0
- package/dist/core/command-generation/adapters/zcode.js +33 -0
- package/dist/core/command-generation/generator.d.ts +29 -0
- package/dist/core/command-generation/generator.js +43 -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/invocation.d.ts +73 -0
- package/dist/core/command-generation/invocation.js +77 -0
- package/dist/core/command-generation/registry.d.ts +36 -0
- package/dist/core/command-generation/registry.js +114 -0
- package/dist/core/command-generation/toml.d.ts +19 -0
- package/dist/core/command-generation/toml.js +39 -0
- package/dist/core/command-generation/types.d.ts +63 -0
- package/dist/core/command-generation/types.js +8 -0
- package/dist/core/command-generation/yaml.d.ts +36 -0
- package/dist/core/command-generation/yaml.js +48 -0
- package/dist/core/command-surface.d.ts +15 -0
- package/dist/core/command-surface.js +33 -0
- package/dist/core/config-prompts.d.ts +9 -0
- package/dist/core/config-prompts.js +56 -0
- package/dist/core/config-schema.d.ts +98 -0
- package/dist/core/config-schema.js +308 -0
- package/dist/core/config.d.ts +50 -0
- package/dist/core/config.js +122 -0
- package/dist/core/file-state.d.ts +36 -0
- package/dist/core/file-state.js +144 -0
- package/dist/core/file-view.d.ts +13 -0
- package/dist/core/file-view.js +14 -0
- package/dist/core/global-config.d.ts +101 -0
- package/dist/core/global-config.js +182 -0
- package/dist/core/id.d.ts +17 -0
- package/dist/core/id.js +30 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.js +7 -0
- package/dist/core/init.d.ts +57 -0
- package/dist/core/init.js +836 -0
- package/dist/core/list.d.ts +11 -0
- package/dist/core/list.js +197 -0
- package/dist/core/migration.d.ts +121 -0
- package/dist/core/migration.js +540 -0
- package/dist/core/onboarding-commands.d.ts +30 -0
- package/dist/core/onboarding-commands.js +38 -0
- package/dist/core/openspec-root.d.ts +47 -0
- package/dist/core/openspec-root.js +196 -0
- package/dist/core/planning-home.d.ts +16 -0
- package/dist/core/planning-home.js +67 -0
- package/dist/core/profile-sync-drift.d.ts +31 -0
- package/dist/core/profile-sync-drift.js +201 -0
- package/dist/core/profiles.d.ts +19 -0
- package/dist/core/profiles.js +33 -0
- package/dist/core/project-config.d.ts +132 -0
- package/dist/core/project-config.js +519 -0
- package/dist/core/references.d.ts +10 -0
- package/dist/core/references.js +46 -0
- package/dist/core/root-selection.d.ts +59 -0
- package/dist/core/root-selection.js +132 -0
- package/dist/core/shared/allowed-tools.d.ts +12 -0
- package/dist/core/shared/allowed-tools.js +12 -0
- package/dist/core/shared/ide-restart.d.ts +26 -0
- package/dist/core/shared/ide-restart.js +42 -0
- package/dist/core/shared/index.d.ts +11 -0
- package/dist/core/shared/index.js +11 -0
- package/dist/core/shared/skill-content-equivalence.d.ts +7 -0
- package/dist/core/shared/skill-content-equivalence.js +45 -0
- package/dist/core/shared/skill-files.d.ts +7 -0
- package/dist/core/shared/skill-files.js +43 -0
- package/dist/core/shared/skill-generation.d.ts +49 -0
- package/dist/core/shared/skill-generation.js +125 -0
- package/dist/core/shared/skill-paths.d.ts +13 -0
- package/dist/core/shared/skill-paths.js +23 -0
- package/dist/core/shared/tool-detection.d.ts +99 -0
- package/dist/core/shared/tool-detection.js +318 -0
- package/dist/core/shared-skill-target.d.ts +51 -0
- package/dist/core/shared-skill-target.js +239 -0
- package/dist/core/store/errors.d.ts +20 -0
- package/dist/core/store/errors.js +22 -0
- package/dist/core/store/index.d.ts +2 -0
- package/dist/core/store/index.js +2 -0
- package/dist/core/styles/palette.d.ts +7 -0
- package/dist/core/styles/palette.js +8 -0
- package/dist/core/templates/optional-workflow.d.ts +69 -0
- package/dist/core/templates/optional-workflow.js +140 -0
- package/dist/core/templates/types.d.ts +19 -0
- package/dist/core/templates/types.js +5 -0
- package/dist/core/templates/workflows/personal.d.ts +22 -0
- package/dist/core/templates/workflows/personal.js +225 -0
- package/dist/core/update-plan.d.ts +127 -0
- package/dist/core/update-plan.js +390 -0
- package/dist/core/update.d.ts +154 -0
- package/dist/core/update.js +723 -0
- package/dist/core/version-check.d.ts +188 -0
- package/dist/core/version-check.js +906 -0
- package/dist/core/zod-issues.d.ts +4 -0
- package/dist/core/zod-issues.js +10 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/prompts/searchable-multi-select.d.ts +35 -0
- package/dist/prompts/searchable-multi-select.js +188 -0
- package/dist/telemetry/config.d.ts +37 -0
- package/dist/telemetry/config.js +148 -0
- package/dist/telemetry/index.d.ts +39 -0
- package/dist/telemetry/index.js +217 -0
- package/dist/telemetry/opt-out.d.ts +17 -0
- package/dist/telemetry/opt-out.js +27 -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 +18 -0
- package/dist/ui/welcome-screen.js +199 -0
- package/dist/utils/change-metadata.d.ts +116 -0
- package/dist/utils/change-metadata.js +324 -0
- package/dist/utils/change-utils.d.ts +79 -0
- package/dist/utils/change-utils.js +121 -0
- package/dist/utils/ci.d.ts +12 -0
- package/dist/utils/ci.js +16 -0
- package/dist/utils/command-references.d.ts +104 -0
- package/dist/utils/command-references.js +190 -0
- package/dist/utils/date.d.ts +8 -0
- package/dist/utils/date.js +13 -0
- package/dist/utils/executable-path.d.ts +5 -0
- package/dist/utils/executable-path.js +44 -0
- package/dist/utils/file-system.d.ts +58 -0
- package/dist/utils/file-system.js +432 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/interactive.d.ts +85 -0
- package/dist/utils/interactive.js +174 -0
- package/dist/utils/item-discovery.d.ts +15 -0
- package/dist/utils/item-discovery.js +33 -0
- package/dist/utils/line-endings.d.ts +34 -0
- package/dist/utils/line-endings.js +46 -0
- package/dist/utils/match.d.ts +3 -0
- package/dist/utils/match.js +22 -0
- package/dist/utils/nested-change.d.ts +35 -0
- package/dist/utils/nested-change.js +185 -0
- package/dist/utils/shell-detection.d.ts +20 -0
- package/dist/utils/shell-detection.js +94 -0
- package/dist/utils/task-progress.d.ts +67 -0
- package/dist/utils/task-progress.js +184 -0
- package/package.json +74 -4
- package/schemas//351/273/230/350/256/244/schema.yaml +68 -0
- package/schemas//351/273/230/350/256/244/templates//344/273/273/345/212/241/346/270/205/345/215/225.md +25 -0
- package/schemas//351/273/230/350/256/244/templates//346/265/213/350/257/225/347/224/250/344/276/213.md +34 -0
- package/schemas//351/273/230/350/256/244/templates//350/256/276/350/256/241/346/226/207/346/241/243.md +172 -0
- package/schemas//351/273/230/350/256/244/templates//351/234/200/346/261/202/346/226/207/346/241/243.md +19 -0
- package/skill-files//344/273/273/345/212/241/references//346/212/244/346/240/217.md +43 -0
- package/skill-files//344/273/273/345/212/241/references//347/262/222/345/272/246.md +23 -0
- package/skill-files//344/273/273/345/212/241/references//347/272/246/346/235/237.md +8 -0
- package/skill-files//344/273/273/345/212/241/scripts/check-tasks.mjs +83 -0
- package/skill-files//345/206/231Java/references/Java/350/247/204/350/214/203.md +25 -0
- package/skill-files//345/206/231Java/references//345/215/261/351/231/251/345/206/231/346/263/225.md +27 -0
- package/skill-files//345/206/231Java/references//345/256/214/346/210/220/345/257/271/347/205/247.md +15 -0
- package/skill-files//345/206/231Java/references//346/212/244/346/240/217.md +35 -0
- package/skill-files//345/206/231Java/references//347/272/246/346/235/237.md +8 -0
- package/skill-files//345/206/231Java/references//350/270/251/345/235/221.md +17 -0
- package/skill-files//345/256/241Java/references//346/212/244/346/240/217.md +19 -0
- package/skill-files//345/256/241Java/references//347/244/272/344/276/213.md +23 -0
- package/skill-files//345/256/241Java/references//347/272/246/346/235/237.md +7 -0
- package/skill-files//345/256/241Java/references//350/247/204/345/210/231.md +23 -0
- package/skill-files//345/256/241Java/references//351/242/206/345/237/237/346/243/200/351/241/271.md +58 -0
- package/skill-files//345/256/241/346/226/207/346/241/243/references//346/212/244/346/240/217.md +18 -0
- package/skill-files//345/256/241/346/226/207/346/241/243/references//347/272/246/346/235/237.md +8 -0
- package/skill-files//345/256/241/346/226/207/346/241/243/references//347/273/264/345/272/246.md +17 -0
- package/skill-files//345/256/241/346/226/207/346/241/243/references//350/270/251/345/235/221.md +11 -0
- package/skill-files//346/226/260/345/273/272/references//344/272/244/346/216/245.md +11 -0
- package/skill-files//346/226/260/345/273/272/references//346/212/244/346/240/217.md +14 -0
- package/skill-files//346/226/260/345/273/272/references//347/272/246/346/235/237.md +7 -0
- package/skill-files//346/267/261/346/200/235/config/prompts.yaml +114 -0
- package/skill-files//346/267/261/346/200/235/references//344/270/211/346/226/271/346/240/270/345/257/271.md +72 -0
- package/skill-files//346/267/261/346/200/235/references//344/276/213/345/255/220.md +39 -0
- package/skill-files//346/267/261/346/200/235/references//346/200/216/344/271/210/346/203/263.md +61 -0
- package/skill-files//346/267/261/346/200/235/references//346/212/244/346/240/217.md +26 -0
- package/skill-files//346/267/261/346/200/235/references//347/202/271/351/200/211/346/217/220/351/227/256.md +66 -0
- package/skill-files//346/267/261/346/200/235/references//347/231/273/350/256/260.md +45 -0
- package/skill-files//346/267/261/346/200/235/references//347/272/246/346/235/237.md +9 -0
- package/skill-files//347/224/250/344/276/213/references//346/200/216/344/271/210/345/206/231.md +13 -0
- package/skill-files//347/224/250/344/276/213/references//346/212/244/346/240/217.md +42 -0
- package/skill-files//347/224/250/344/276/213/references//347/272/246/346/235/237.md +5 -0
- package/skill-files//347/224/250/344/276/213/scripts/check-cases.mjs +70 -0
- package/skill-files//350/256/276/350/256/241/references//345/207/206/345/244/207.md +25 -0
- package/skill-files//350/256/276/350/256/241/references//346/212/244/346/240/217.md +134 -0
- package/skill-files//350/256/276/350/256/241/references//346/226/207/351/243/216.md +17 -0
- package/skill-files//350/256/276/350/256/241/references//347/225/214/351/235/242.md +18 -0
- package/skill-files//350/256/276/350/256/241/references//347/261/273/345/236/213.md +19 -0
- package/skill-files//350/256/276/350/256/241/references//347/272/246/346/235/237.md +25 -0
- package/skill-files//350/256/276/350/256/241/scripts/_smoke.mjs +72 -0
- package/skill-files//350/256/276/350/256/241/scripts/check-design.mjs +331 -0
- package/skill-files//351/234/200/346/261/202/references//346/212/244/346/240/217.md +26 -0
- package/skill-files//351/234/200/346/261/202/references//346/226/207/351/243/216.md +23 -0
- package/skill-files//351/234/200/346/261/202/references//346/267/261/346/200/235/346/221/204/345/205/245.md +21 -0
- package/skill-files//351/234/200/346/261/202/references//347/272/246/346/235/237.md +8 -0
- package/skill-files//351/234/200/346/261/202/references//351/234/200/346/261/202/345/276/205/345/256/232.md +13 -0
- package/skill-files//351/234/200/346/261/202/scripts/check-requirements.mjs +60 -0
- package/skill-files//351/252/214/346/224/266/references//346/212/244/346/240/217.md +27 -0
- package/skill-files//351/252/214/346/224/266/references//346/240/270/345/257/271.md +17 -0
- package/skill-files//351/252/214/346/224/266/references//347/272/246/346/235/237.md +7 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zoo Code Command Adapter
|
|
3
|
+
*
|
|
4
|
+
* Formats commands for Zoo Code following its workflow specification.
|
|
5
|
+
* Zoo Code uses markdown headers instead of YAML frontmatter.
|
|
6
|
+
*/
|
|
7
|
+
import type { ToolCommandAdapter } from '../types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Zoo Code adapter for command generation.
|
|
10
|
+
* File path: .roo/commands/freespec-<id>.md
|
|
11
|
+
* Format: Markdown header with description
|
|
12
|
+
*/
|
|
13
|
+
export declare const roocodeAdapter: ToolCommandAdapter;
|
|
14
|
+
//# sourceMappingURL=roocode.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zoo Code Command Adapter
|
|
3
|
+
*
|
|
4
|
+
* Formats commands for Zoo Code following its workflow specification.
|
|
5
|
+
* Zoo Code uses markdown headers instead of YAML frontmatter.
|
|
6
|
+
*/
|
|
7
|
+
import path from 'path';
|
|
8
|
+
/**
|
|
9
|
+
* Zoo Code adapter for command generation.
|
|
10
|
+
* File path: .roo/commands/freespec-<id>.md
|
|
11
|
+
* Format: Markdown header with description
|
|
12
|
+
*/
|
|
13
|
+
export const roocodeAdapter = {
|
|
14
|
+
toolId: 'roocode',
|
|
15
|
+
getFilePath(commandId) {
|
|
16
|
+
return path.join('.roo', 'commands', `freespec-${commandId}.md`);
|
|
17
|
+
},
|
|
18
|
+
formatFile(content) {
|
|
19
|
+
return `# ${content.name}
|
|
20
|
+
|
|
21
|
+
${content.description}
|
|
22
|
+
|
|
23
|
+
${content.body}
|
|
24
|
+
`;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=roocode.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trae Command Adapter
|
|
3
|
+
*
|
|
4
|
+
* Formats commands for Trae IDE following its command specification.
|
|
5
|
+
*/
|
|
6
|
+
import type { ToolCommandAdapter } from '../types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Trae adapter for command generation.
|
|
9
|
+
* File path: .trae/commands/freespec-<id>.md
|
|
10
|
+
* Frontmatter: name, description
|
|
11
|
+
*/
|
|
12
|
+
export declare const traeAdapter: ToolCommandAdapter;
|
|
13
|
+
//# sourceMappingURL=trae.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trae Command Adapter
|
|
3
|
+
*
|
|
4
|
+
* Formats commands for Trae IDE following its command specification.
|
|
5
|
+
*/
|
|
6
|
+
import path from 'path';
|
|
7
|
+
import { escapeYamlValue } from '../yaml.js';
|
|
8
|
+
/**
|
|
9
|
+
* Trae adapter for command generation.
|
|
10
|
+
* File path: .trae/commands/freespec-<id>.md
|
|
11
|
+
* Frontmatter: name, description
|
|
12
|
+
*/
|
|
13
|
+
export const traeAdapter = {
|
|
14
|
+
toolId: 'trae',
|
|
15
|
+
getFilePath(commandId) {
|
|
16
|
+
return path.join('.trae', 'commands', `freespec-${commandId}.md`);
|
|
17
|
+
},
|
|
18
|
+
formatFile(content) {
|
|
19
|
+
return `---
|
|
20
|
+
name: ${escapeYamlValue(content.name)}
|
|
21
|
+
description: ${escapeYamlValue(content.description)}
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
${content.body}
|
|
25
|
+
`;
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=trae.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ZCode Command Adapter
|
|
3
|
+
*
|
|
4
|
+
* Formats commands for ZCode following its frontmatter specification.
|
|
5
|
+
* ZCode shares Claude Code's command format conventions.
|
|
6
|
+
* File path: .zcode/commands/freespec/<id>.md
|
|
7
|
+
* Frontmatter: name, description, category, tags
|
|
8
|
+
*/
|
|
9
|
+
import type { ToolCommandAdapter } from '../types.js';
|
|
10
|
+
/**
|
|
11
|
+
* ZCode adapter for command generation.
|
|
12
|
+
* File path: .zcode/commands/freespec/<id>.md
|
|
13
|
+
* Frontmatter: name, description, category, tags
|
|
14
|
+
*/
|
|
15
|
+
export declare const zcodeAdapter: ToolCommandAdapter;
|
|
16
|
+
//# sourceMappingURL=zcode.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ZCode Command Adapter
|
|
3
|
+
*
|
|
4
|
+
* Formats commands for ZCode following its frontmatter specification.
|
|
5
|
+
* ZCode shares Claude Code's command format conventions.
|
|
6
|
+
* File path: .zcode/commands/freespec/<id>.md
|
|
7
|
+
* Frontmatter: name, description, category, tags
|
|
8
|
+
*/
|
|
9
|
+
import path from 'path';
|
|
10
|
+
import { escapeYamlValue, formatTagsArray } from '../yaml.js';
|
|
11
|
+
/**
|
|
12
|
+
* ZCode adapter for command generation.
|
|
13
|
+
* File path: .zcode/commands/freespec/<id>.md
|
|
14
|
+
* Frontmatter: name, description, category, tags
|
|
15
|
+
*/
|
|
16
|
+
export const zcodeAdapter = {
|
|
17
|
+
toolId: 'zcode',
|
|
18
|
+
getFilePath(commandId) {
|
|
19
|
+
return path.join('.zcode', 'commands', 'freespec', `${commandId}.md`);
|
|
20
|
+
},
|
|
21
|
+
formatFile(content) {
|
|
22
|
+
return `---
|
|
23
|
+
name: ${escapeYamlValue(content.name)}
|
|
24
|
+
description: ${escapeYamlValue(content.description)}
|
|
25
|
+
category: ${escapeYamlValue(content.category)}
|
|
26
|
+
tags: ${formatTagsArray(content.tags)}
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
${content.body}
|
|
30
|
+
`;
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=zcode.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command Generator
|
|
3
|
+
*
|
|
4
|
+
* Functions for generating command files using tool adapters.
|
|
5
|
+
*/
|
|
6
|
+
import type { CommandContent, ToolCommandAdapter, GeneratedCommand } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Generate a single command file using the provided adapter.
|
|
9
|
+
*
|
|
10
|
+
* Command bodies are authored with `/freespec:<id>` references. Tools whose command
|
|
11
|
+
* files are invoked by filename register `/freespec-<id>` instead, and Amazon Q
|
|
12
|
+
* surfaces them in its prompt library as `@freespec-<id>`, so the body is rewritten
|
|
13
|
+
* to the form that tool answers to before the adapter formats it. Doing it here
|
|
14
|
+
* rather than per adapter keeps every tool in step (#727, #1307); adapters stay
|
|
15
|
+
* pure formatters.
|
|
16
|
+
*
|
|
17
|
+
* @param content - The tool-agnostic command content
|
|
18
|
+
* @param adapter - The tool-specific adapter
|
|
19
|
+
* @returns Generated command with path and file content
|
|
20
|
+
*/
|
|
21
|
+
export declare function generateCommand(content: CommandContent, adapter: ToolCommandAdapter): GeneratedCommand;
|
|
22
|
+
/**
|
|
23
|
+
* Generate multiple command files using the provided adapter.
|
|
24
|
+
* @param contents - Array of tool-agnostic command contents
|
|
25
|
+
* @param adapter - The tool-specific adapter
|
|
26
|
+
* @returns Array of generated commands with paths and file contents
|
|
27
|
+
*/
|
|
28
|
+
export declare function generateCommands(contents: CommandContent[], adapter: ToolCommandAdapter): GeneratedCommand[];
|
|
29
|
+
//# sourceMappingURL=generator.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command Generator
|
|
3
|
+
*
|
|
4
|
+
* Functions for generating command files using tool adapters.
|
|
5
|
+
*/
|
|
6
|
+
import { getInvocationForAdapter, needsInvocationRewrite } from './invocation.js';
|
|
7
|
+
import { transformCommandInvocations } from '../../utils/command-references.js';
|
|
8
|
+
import { assertWorkflowConditionalsResolved } from '../templates/optional-workflow.js';
|
|
9
|
+
/**
|
|
10
|
+
* Generate a single command file using the provided adapter.
|
|
11
|
+
*
|
|
12
|
+
* Command bodies are authored with `/freespec:<id>` references. Tools whose command
|
|
13
|
+
* files are invoked by filename register `/freespec-<id>` instead, and Amazon Q
|
|
14
|
+
* surfaces them in its prompt library as `@freespec-<id>`, so the body is rewritten
|
|
15
|
+
* to the form that tool answers to before the adapter formats it. Doing it here
|
|
16
|
+
* rather than per adapter keeps every tool in step (#727, #1307); adapters stay
|
|
17
|
+
* pure formatters.
|
|
18
|
+
*
|
|
19
|
+
* @param content - The tool-agnostic command content
|
|
20
|
+
* @param adapter - The tool-specific adapter
|
|
21
|
+
* @returns Generated command with path and file content
|
|
22
|
+
*/
|
|
23
|
+
export function generateCommand(content, adapter) {
|
|
24
|
+
assertWorkflowConditionalsResolved(content.body, `Command '${content.id}' was generated without resolving its optional-workflow blocks`);
|
|
25
|
+
const invocation = getInvocationForAdapter(adapter);
|
|
26
|
+
const formatted = needsInvocationRewrite(invocation)
|
|
27
|
+
? { ...content, body: transformCommandInvocations(content.body, invocation) }
|
|
28
|
+
: content;
|
|
29
|
+
return {
|
|
30
|
+
path: adapter.getFilePath(content.id),
|
|
31
|
+
fileContent: adapter.formatFile(formatted),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Generate multiple command files using the provided adapter.
|
|
36
|
+
* @param contents - Array of tool-agnostic command contents
|
|
37
|
+
* @param adapter - The tool-specific adapter
|
|
38
|
+
* @returns Array of generated commands with paths and file contents
|
|
39
|
+
*/
|
|
40
|
+
export function generateCommands(contents, adapter) {
|
|
41
|
+
return contents.map((content) => generateCommand(content, adapter));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command Generation Module
|
|
3
|
+
*
|
|
4
|
+
* Generic command generation system with tool-specific adapters.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { generateCommands, CommandAdapterRegistry, type CommandContent } from './command-generation/index.js';
|
|
9
|
+
*
|
|
10
|
+
* const contents: CommandContent[] = [...];
|
|
11
|
+
* const adapter = CommandAdapterRegistry.get('cursor');
|
|
12
|
+
* if (adapter) {
|
|
13
|
+
* const commands = generateCommands(contents, adapter);
|
|
14
|
+
* // Write commands to disk
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export type { CommandContent, ToolCommandAdapter, GeneratedCommand, } from './types.js';
|
|
19
|
+
export { CommandAdapterRegistry } from './registry.js';
|
|
20
|
+
export { generateCommand, generateCommands } from './generator.js';
|
|
21
|
+
export { claudeAdapter, cursorAdapter, devinAdapter } from './adapters/index.js';
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command Generation Module
|
|
3
|
+
*
|
|
4
|
+
* Generic command generation system with tool-specific adapters.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { generateCommands, CommandAdapterRegistry, type CommandContent } from './command-generation/index.js';
|
|
9
|
+
*
|
|
10
|
+
* const contents: CommandContent[] = [...];
|
|
11
|
+
* const adapter = CommandAdapterRegistry.get('cursor');
|
|
12
|
+
* if (adapter) {
|
|
13
|
+
* const commands = generateCommands(contents, adapter);
|
|
14
|
+
* // Write commands to disk
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
// Registry
|
|
19
|
+
export { CommandAdapterRegistry } from './registry.js';
|
|
20
|
+
// Generator functions
|
|
21
|
+
export { generateCommand, generateCommands } from './generator.js';
|
|
22
|
+
// Adapters (for direct access if needed)
|
|
23
|
+
export { claudeAdapter, cursorAdapter, devinAdapter } from './adapters/index.js';
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command Invocation
|
|
3
|
+
*
|
|
4
|
+
* How a tool spells a FreeSpec command has two parts, and only one of them
|
|
5
|
+
* can be read off the file the adapter writes:
|
|
6
|
+
*
|
|
7
|
+
* - The *name* comes from the file. `.../commands/freespec/<id>.md` is namespaced
|
|
8
|
+
* by its directory, so the tool registers `freespec:<id>` (Claude Code, Gemini,
|
|
9
|
+
* Crush, ...). `.../commands/freespec-<id>.md` names the command with the
|
|
10
|
+
* filename, so the tool registers `freespec-<id>` (Cursor, GitHub Copilot,
|
|
11
|
+
* OpenCode, ...).
|
|
12
|
+
* - The *prefix* is the tool's own and cannot be derived. Almost every tool
|
|
13
|
+
* uses `/`; Amazon Q loads these files into its prompt library, which is
|
|
14
|
+
* invoked with `@` (`@freespec-propose`), so its adapter declares that prefix.
|
|
15
|
+
*
|
|
16
|
+
* Deriving the name from `getFilePath` keeps generated cross-references and
|
|
17
|
+
* onboarding hints in step with the files FreeSpec actually writes. A
|
|
18
|
+
* hand-maintained list drifted before: only OpenCode was rewritten when the
|
|
19
|
+
* hyphen form was introduced (#727), and Cursor still advertised `/freespec:`
|
|
20
|
+
* commands its palette never registered (#1307). Carrying the prefix as
|
|
21
|
+
* adapter metadata rather than inferring it keeps the one tool that does not
|
|
22
|
+
* use a slash from being advertised as if it did.
|
|
23
|
+
*/
|
|
24
|
+
import type { ToolCommandAdapter } from './types.js';
|
|
25
|
+
export type CommandInvocationStyle = 'namespaced' | 'flat';
|
|
26
|
+
/**
|
|
27
|
+
* Everything needed to spell one of a tool's FreeSpec commands.
|
|
28
|
+
*/
|
|
29
|
+
export interface CommandInvocation {
|
|
30
|
+
/** How the command file names the command. */
|
|
31
|
+
style: CommandInvocationStyle;
|
|
32
|
+
/** What the user types before the name, e.g. `/` or Amazon Q's `@`. */
|
|
33
|
+
prefix: string;
|
|
34
|
+
}
|
|
35
|
+
/** The form these docs, command bodies, and skill templates are authored in. */
|
|
36
|
+
export declare const CANONICAL_INVOCATION: CommandInvocation;
|
|
37
|
+
/**
|
|
38
|
+
* Classifies a generated command file by the name the tool will answer to.
|
|
39
|
+
*
|
|
40
|
+
* The test is the filename, not the directory: an `freespec-` prefix means the
|
|
41
|
+
* filename is the command. Every other shape is treated as namespaced, which
|
|
42
|
+
* is what all seven `freespec/<id>.*` adapters need. An adapter that neither
|
|
43
|
+
* prefixes the filename nor nests under `freespec/` would land here too — none
|
|
44
|
+
* does, and the registry-wide test in invocation.test.ts fails if one appears.
|
|
45
|
+
*
|
|
46
|
+
* @param commandFilePath - Path returned by an adapter's `getFilePath`
|
|
47
|
+
* @returns 'flat' when the filename carries the `freespec-` prefix, otherwise
|
|
48
|
+
* 'namespaced'
|
|
49
|
+
*/
|
|
50
|
+
export declare function getInvocationStyleForPath(commandFilePath: string): CommandInvocationStyle;
|
|
51
|
+
/**
|
|
52
|
+
* Resolves how a tool's generated commands are invoked: the name from the
|
|
53
|
+
* files its adapter writes, the prefix from the adapter's own declaration.
|
|
54
|
+
*
|
|
55
|
+
* @param adapter - The tool-specific command adapter
|
|
56
|
+
* @returns The invocation shared by every command that adapter generates
|
|
57
|
+
*/
|
|
58
|
+
export declare function getInvocationForAdapter(adapter: ToolCommandAdapter): CommandInvocation;
|
|
59
|
+
/**
|
|
60
|
+
* Spells one command the way the tool registers it.
|
|
61
|
+
*
|
|
62
|
+
* @param invocation - The tool's invocation, from getInvocationForAdapter()
|
|
63
|
+
* @param commandId - The command identifier (e.g. 'apply')
|
|
64
|
+
* @returns What the user types, e.g. `/freespec:apply`, `/freespec-apply`, `@freespec-apply`
|
|
65
|
+
*/
|
|
66
|
+
export declare function formatCommandInvocation(invocation: CommandInvocation, commandId: string): string;
|
|
67
|
+
/**
|
|
68
|
+
* Whether a tool's invocation differs from the canonical `/freespec:<id>` that
|
|
69
|
+
* command bodies and skill templates are authored in — that is, whether
|
|
70
|
+
* generated text has to be rewritten for that tool at all.
|
|
71
|
+
*/
|
|
72
|
+
export declare function needsInvocationRewrite(invocation: CommandInvocation): boolean;
|
|
73
|
+
//# sourceMappingURL=invocation.d.ts.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command Invocation
|
|
3
|
+
*
|
|
4
|
+
* How a tool spells a FreeSpec command has two parts, and only one of them
|
|
5
|
+
* can be read off the file the adapter writes:
|
|
6
|
+
*
|
|
7
|
+
* - The *name* comes from the file. `.../commands/freespec/<id>.md` is namespaced
|
|
8
|
+
* by its directory, so the tool registers `freespec:<id>` (Claude Code, Gemini,
|
|
9
|
+
* Crush, ...). `.../commands/freespec-<id>.md` names the command with the
|
|
10
|
+
* filename, so the tool registers `freespec-<id>` (Cursor, GitHub Copilot,
|
|
11
|
+
* OpenCode, ...).
|
|
12
|
+
* - The *prefix* is the tool's own and cannot be derived. Almost every tool
|
|
13
|
+
* uses `/`; Amazon Q loads these files into its prompt library, which is
|
|
14
|
+
* invoked with `@` (`@freespec-propose`), so its adapter declares that prefix.
|
|
15
|
+
*
|
|
16
|
+
* Deriving the name from `getFilePath` keeps generated cross-references and
|
|
17
|
+
* onboarding hints in step with the files FreeSpec actually writes. A
|
|
18
|
+
* hand-maintained list drifted before: only OpenCode was rewritten when the
|
|
19
|
+
* hyphen form was introduced (#727), and Cursor still advertised `/freespec:`
|
|
20
|
+
* commands its palette never registered (#1307). Carrying the prefix as
|
|
21
|
+
* adapter metadata rather than inferring it keeps the one tool that does not
|
|
22
|
+
* use a slash from being advertised as if it did.
|
|
23
|
+
*/
|
|
24
|
+
import path from 'path';
|
|
25
|
+
/** The form these docs, command bodies, and skill templates are authored in. */
|
|
26
|
+
export const CANONICAL_INVOCATION = { style: 'namespaced', prefix: '/' };
|
|
27
|
+
/**
|
|
28
|
+
* Classifies a generated command file by the name the tool will answer to.
|
|
29
|
+
*
|
|
30
|
+
* The test is the filename, not the directory: an `freespec-` prefix means the
|
|
31
|
+
* filename is the command. Every other shape is treated as namespaced, which
|
|
32
|
+
* is what all seven `freespec/<id>.*` adapters need. An adapter that neither
|
|
33
|
+
* prefixes the filename nor nests under `freespec/` would land here too — none
|
|
34
|
+
* does, and the registry-wide test in invocation.test.ts fails if one appears.
|
|
35
|
+
*
|
|
36
|
+
* @param commandFilePath - Path returned by an adapter's `getFilePath`
|
|
37
|
+
* @returns 'flat' when the filename carries the `freespec-` prefix, otherwise
|
|
38
|
+
* 'namespaced'
|
|
39
|
+
*/
|
|
40
|
+
export function getInvocationStyleForPath(commandFilePath) {
|
|
41
|
+
return path.basename(commandFilePath).startsWith('freespec-') ? 'flat' : 'namespaced';
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Resolves how a tool's generated commands are invoked: the name from the
|
|
45
|
+
* files its adapter writes, the prefix from the adapter's own declaration.
|
|
46
|
+
*
|
|
47
|
+
* @param adapter - The tool-specific command adapter
|
|
48
|
+
* @returns The invocation shared by every command that adapter generates
|
|
49
|
+
*/
|
|
50
|
+
export function getInvocationForAdapter(adapter) {
|
|
51
|
+
return {
|
|
52
|
+
// Any command id works: every adapter applies one naming rule to all of them.
|
|
53
|
+
style: getInvocationStyleForPath(adapter.getFilePath('explore')),
|
|
54
|
+
prefix: adapter.invocationPrefix ?? CANONICAL_INVOCATION.prefix,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Spells one command the way the tool registers it.
|
|
59
|
+
*
|
|
60
|
+
* @param invocation - The tool's invocation, from getInvocationForAdapter()
|
|
61
|
+
* @param commandId - The command identifier (e.g. 'apply')
|
|
62
|
+
* @returns What the user types, e.g. `/freespec:apply`, `/freespec-apply`, `@freespec-apply`
|
|
63
|
+
*/
|
|
64
|
+
export function formatCommandInvocation(invocation, commandId) {
|
|
65
|
+
const separator = invocation.style === 'namespaced' ? ':' : '-';
|
|
66
|
+
return `${invocation.prefix}freespec${separator}${commandId}`;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Whether a tool's invocation differs from the canonical `/freespec:<id>` that
|
|
70
|
+
* command bodies and skill templates are authored in — that is, whether
|
|
71
|
+
* generated text has to be rewritten for that tool at all.
|
|
72
|
+
*/
|
|
73
|
+
export function needsInvocationRewrite(invocation) {
|
|
74
|
+
return (invocation.style !== CANONICAL_INVOCATION.style ||
|
|
75
|
+
invocation.prefix !== CANONICAL_INVOCATION.prefix);
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=invocation.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command Adapter Registry
|
|
3
|
+
*
|
|
4
|
+
* Centralized registry for tool command adapters.
|
|
5
|
+
* Similar pattern to existing SlashCommandRegistry in the codebase.
|
|
6
|
+
*/
|
|
7
|
+
import type { ToolCommandAdapter } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Registry for looking up tool command adapters.
|
|
10
|
+
*/
|
|
11
|
+
export declare class CommandAdapterRegistry {
|
|
12
|
+
private static adapters;
|
|
13
|
+
/**
|
|
14
|
+
* Register a tool command adapter.
|
|
15
|
+
* @param adapter - The adapter to register
|
|
16
|
+
*/
|
|
17
|
+
static register(adapter: ToolCommandAdapter): void;
|
|
18
|
+
/**
|
|
19
|
+
* Get an adapter by tool ID.
|
|
20
|
+
* @param toolId - The tool identifier (e.g., 'claude', 'cursor')
|
|
21
|
+
* @returns The adapter or undefined if not registered
|
|
22
|
+
*/
|
|
23
|
+
static get(toolId: string): ToolCommandAdapter | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Get all registered adapters.
|
|
26
|
+
* @returns Array of all registered adapters
|
|
27
|
+
*/
|
|
28
|
+
static getAll(): ToolCommandAdapter[];
|
|
29
|
+
/**
|
|
30
|
+
* Check if an adapter is registered for a tool.
|
|
31
|
+
* @param toolId - The tool identifier
|
|
32
|
+
* @returns True if an adapter exists
|
|
33
|
+
*/
|
|
34
|
+
static has(toolId: string): boolean;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command Adapter Registry
|
|
3
|
+
*
|
|
4
|
+
* Centralized registry for tool command adapters.
|
|
5
|
+
* Similar pattern to existing SlashCommandRegistry in the codebase.
|
|
6
|
+
*/
|
|
7
|
+
import { amazonQAdapter } from './adapters/amazon-q.js';
|
|
8
|
+
import { antigravityAdapter } from './adapters/antigravity.js';
|
|
9
|
+
import { atomcodeAdapter } from './adapters/atomcode.js';
|
|
10
|
+
import { auggieAdapter } from './adapters/auggie.js';
|
|
11
|
+
import { bobAdapter } from './adapters/bob.js';
|
|
12
|
+
import { claudeAdapter } from './adapters/claude.js';
|
|
13
|
+
import { clineAdapter } from './adapters/cline.js';
|
|
14
|
+
import { commandCodeAdapter } from './adapters/command-code.js';
|
|
15
|
+
import { devinAdapter } from './adapters/devin.js';
|
|
16
|
+
import { codebuddyAdapter } from './adapters/codebuddy.js';
|
|
17
|
+
import { codeStudioAdapter } from './adapters/codestudio.js';
|
|
18
|
+
import { continueAdapter } from './adapters/continue.js';
|
|
19
|
+
import { costrictAdapter } from './adapters/costrict.js';
|
|
20
|
+
import { crushAdapter } from './adapters/crush.js';
|
|
21
|
+
import { cursorAdapter } from './adapters/cursor.js';
|
|
22
|
+
import { easycodeAdapter } from './adapters/easycode.js';
|
|
23
|
+
import { factoryAdapter } from './adapters/factory.js';
|
|
24
|
+
import { geminiAdapter } from './adapters/gemini.js';
|
|
25
|
+
import { githubCopilotAdapter } from './adapters/github-copilot.js';
|
|
26
|
+
import { gigacodeAdapter } from './adapters/gigacode.js';
|
|
27
|
+
import { iflowAdapter } from './adapters/iflow.js';
|
|
28
|
+
import { junieAdapter } from './adapters/junie.js';
|
|
29
|
+
import { kilocodeAdapter } from './adapters/kilocode.js';
|
|
30
|
+
import { kiroAdapter } from './adapters/kiro.js';
|
|
31
|
+
import { ohMyPiAdapter } from './adapters/oh-my-pi.js';
|
|
32
|
+
import { opencodeAdapter } from './adapters/opencode.js';
|
|
33
|
+
import { piAdapter } from './adapters/pi.js';
|
|
34
|
+
import { codeassistantAdapter } from './adapters/codeassistant.js';
|
|
35
|
+
import { qoderAdapter } from './adapters/qoder.js';
|
|
36
|
+
import { lingmaAdapter } from './adapters/lingma.js';
|
|
37
|
+
import { qwenAdapter } from './adapters/qwen.js';
|
|
38
|
+
import { roocodeAdapter } from './adapters/roocode.js';
|
|
39
|
+
import { traeAdapter } from './adapters/trae.js';
|
|
40
|
+
import { zcodeAdapter } from './adapters/zcode.js';
|
|
41
|
+
/**
|
|
42
|
+
* Registry for looking up tool command adapters.
|
|
43
|
+
*/
|
|
44
|
+
export class CommandAdapterRegistry {
|
|
45
|
+
static adapters = new Map();
|
|
46
|
+
// Static initializer - register built-in adapters
|
|
47
|
+
static {
|
|
48
|
+
CommandAdapterRegistry.register(amazonQAdapter);
|
|
49
|
+
CommandAdapterRegistry.register(antigravityAdapter);
|
|
50
|
+
CommandAdapterRegistry.register(atomcodeAdapter);
|
|
51
|
+
CommandAdapterRegistry.register(auggieAdapter);
|
|
52
|
+
CommandAdapterRegistry.register(bobAdapter);
|
|
53
|
+
CommandAdapterRegistry.register(claudeAdapter);
|
|
54
|
+
CommandAdapterRegistry.register(clineAdapter);
|
|
55
|
+
CommandAdapterRegistry.register(commandCodeAdapter);
|
|
56
|
+
CommandAdapterRegistry.register(devinAdapter);
|
|
57
|
+
CommandAdapterRegistry.register(codebuddyAdapter);
|
|
58
|
+
CommandAdapterRegistry.register(codeStudioAdapter);
|
|
59
|
+
CommandAdapterRegistry.register(continueAdapter);
|
|
60
|
+
CommandAdapterRegistry.register(costrictAdapter);
|
|
61
|
+
CommandAdapterRegistry.register(crushAdapter);
|
|
62
|
+
CommandAdapterRegistry.register(cursorAdapter);
|
|
63
|
+
CommandAdapterRegistry.register(easycodeAdapter);
|
|
64
|
+
CommandAdapterRegistry.register(factoryAdapter);
|
|
65
|
+
CommandAdapterRegistry.register(geminiAdapter);
|
|
66
|
+
CommandAdapterRegistry.register(githubCopilotAdapter);
|
|
67
|
+
CommandAdapterRegistry.register(gigacodeAdapter);
|
|
68
|
+
CommandAdapterRegistry.register(iflowAdapter);
|
|
69
|
+
CommandAdapterRegistry.register(junieAdapter);
|
|
70
|
+
CommandAdapterRegistry.register(kilocodeAdapter);
|
|
71
|
+
CommandAdapterRegistry.register(kiroAdapter);
|
|
72
|
+
CommandAdapterRegistry.register(ohMyPiAdapter);
|
|
73
|
+
CommandAdapterRegistry.register(opencodeAdapter);
|
|
74
|
+
CommandAdapterRegistry.register(piAdapter);
|
|
75
|
+
CommandAdapterRegistry.register(codeassistantAdapter);
|
|
76
|
+
CommandAdapterRegistry.register(qoderAdapter);
|
|
77
|
+
CommandAdapterRegistry.register(lingmaAdapter);
|
|
78
|
+
CommandAdapterRegistry.register(qwenAdapter);
|
|
79
|
+
CommandAdapterRegistry.register(roocodeAdapter);
|
|
80
|
+
CommandAdapterRegistry.register(traeAdapter);
|
|
81
|
+
CommandAdapterRegistry.register(zcodeAdapter);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Register a tool command adapter.
|
|
85
|
+
* @param adapter - The adapter to register
|
|
86
|
+
*/
|
|
87
|
+
static register(adapter) {
|
|
88
|
+
CommandAdapterRegistry.adapters.set(adapter.toolId, adapter);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Get an adapter by tool ID.
|
|
92
|
+
* @param toolId - The tool identifier (e.g., 'claude', 'cursor')
|
|
93
|
+
* @returns The adapter or undefined if not registered
|
|
94
|
+
*/
|
|
95
|
+
static get(toolId) {
|
|
96
|
+
return CommandAdapterRegistry.adapters.get(toolId);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Get all registered adapters.
|
|
100
|
+
* @returns Array of all registered adapters
|
|
101
|
+
*/
|
|
102
|
+
static getAll() {
|
|
103
|
+
return Array.from(CommandAdapterRegistry.adapters.values());
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Check if an adapter is registered for a tool.
|
|
107
|
+
* @param toolId - The tool identifier
|
|
108
|
+
* @returns True if an adapter exists
|
|
109
|
+
*/
|
|
110
|
+
static has(toolId) {
|
|
111
|
+
return CommandAdapterRegistry.adapters.has(toolId);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared TOML string escaping for command adapters.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* TOML basic strings are escape-active: a backslash or double quote in the
|
|
6
|
+
* value breaks the file if written raw. Newlines cannot appear in a
|
|
7
|
+
* single-line basic string at all, so they are escaped too.
|
|
8
|
+
*/
|
|
9
|
+
export declare function escapeTomlBasicString(value: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Multiline basic strings keep raw newlines and tabs, but backslashes are
|
|
12
|
+
* still escape-active, any run of three quotes would end the string, and the
|
|
13
|
+
* same control characters are invalid as in single-line basic strings — a
|
|
14
|
+
* lone carriage return included (only LF and CRLF may appear raw; CRLF is
|
|
15
|
+
* normalized away so the emitted file is single-convention). Escapes are
|
|
16
|
+
* introduced after backslash-doubling so they are not re-doubled.
|
|
17
|
+
*/
|
|
18
|
+
export declare function escapeTomlMultilineBasicString(value: string): string;
|
|
19
|
+
//# sourceMappingURL=toml.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared TOML string escaping for command adapters.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Control characters (C0 except tab/newline/carriage return, plus DEL) are
|
|
6
|
+
* invalid inside TOML strings and must be written as escapes.
|
|
7
|
+
*/
|
|
8
|
+
const TOML_CONTROL_CHARS = new RegExp('[\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f]', 'g');
|
|
9
|
+
/**
|
|
10
|
+
* TOML basic strings are escape-active: a backslash or double quote in the
|
|
11
|
+
* value breaks the file if written raw. Newlines cannot appear in a
|
|
12
|
+
* single-line basic string at all, so they are escaped too.
|
|
13
|
+
*/
|
|
14
|
+
export function escapeTomlBasicString(value) {
|
|
15
|
+
return value
|
|
16
|
+
.replace(/\\/g, '\\\\')
|
|
17
|
+
.replace(/"/g, '\\"')
|
|
18
|
+
.replace(/\n/g, '\\n')
|
|
19
|
+
.replace(/\r/g, '\\r')
|
|
20
|
+
.replace(/\t/g, '\\t')
|
|
21
|
+
.replace(TOML_CONTROL_CHARS, (c) => `\\u${c.charCodeAt(0).toString(16).padStart(4, '0')}`);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Multiline basic strings keep raw newlines and tabs, but backslashes are
|
|
25
|
+
* still escape-active, any run of three quotes would end the string, and the
|
|
26
|
+
* same control characters are invalid as in single-line basic strings — a
|
|
27
|
+
* lone carriage return included (only LF and CRLF may appear raw; CRLF is
|
|
28
|
+
* normalized away so the emitted file is single-convention). Escapes are
|
|
29
|
+
* introduced after backslash-doubling so they are not re-doubled.
|
|
30
|
+
*/
|
|
31
|
+
export function escapeTomlMultilineBasicString(value) {
|
|
32
|
+
return value
|
|
33
|
+
.replace(/\r\n/g, '\n')
|
|
34
|
+
.replace(/\\/g, '\\\\')
|
|
35
|
+
.replace(/"""/g, '""\\"')
|
|
36
|
+
.replace(/\r/g, '\\r')
|
|
37
|
+
.replace(TOML_CONTROL_CHARS, (c) => `\\u${c.charCodeAt(0).toString(16).padStart(4, '0')}`);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=toml.js.map
|