@dedesfr/prompter 0.9.0 → 1.1.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.
Files changed (225) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +105 -77
  3. package/dist/cli/index.js +25 -1
  4. package/dist/cli/index.js.map +1 -1
  5. package/dist/commands/init.d.ts.map +1 -1
  6. package/dist/commands/init.js +35 -9
  7. package/dist/commands/init.js.map +1 -1
  8. package/dist/commands/login.d.ts +4 -0
  9. package/dist/commands/login.d.ts.map +1 -0
  10. package/dist/commands/login.js +56 -0
  11. package/dist/commands/login.js.map +1 -0
  12. package/dist/commands/logout.d.ts +4 -0
  13. package/dist/commands/logout.d.ts.map +1 -0
  14. package/dist/commands/logout.js +14 -0
  15. package/dist/commands/logout.js.map +1 -0
  16. package/dist/commands/update.d.ts +0 -2
  17. package/dist/commands/update.d.ts.map +1 -1
  18. package/dist/commands/update.js +19 -48
  19. package/dist/commands/update.js.map +1 -1
  20. package/dist/commands/whoami.d.ts +4 -0
  21. package/dist/commands/whoami.d.ts.map +1 -0
  22. package/dist/commands/whoami.js +42 -0
  23. package/dist/commands/whoami.js.map +1 -0
  24. package/dist/core/auth-store.d.ts +10 -0
  25. package/dist/core/auth-store.d.ts.map +1 -0
  26. package/dist/core/auth-store.js +39 -0
  27. package/dist/core/auth-store.js.map +1 -0
  28. package/dist/core/config.d.ts +0 -7
  29. package/dist/core/config.d.ts.map +1 -1
  30. package/dist/core/config.js +0 -128
  31. package/dist/core/config.js.map +1 -1
  32. package/dist/core/registry.d.ts +18 -0
  33. package/dist/core/registry.d.ts.map +1 -0
  34. package/dist/core/registry.js +94 -0
  35. package/dist/core/registry.js.map +1 -0
  36. package/package.json +7 -1
  37. package/AGENTS.md +0 -123
  38. package/CLAUDE.md +0 -17
  39. package/build.js +0 -20
  40. package/convex-setup.md +0 -403
  41. package/dist/core/prompt-templates.d.ts +0 -23
  42. package/dist/core/prompt-templates.d.ts.map +0 -1
  43. package/dist/core/prompt-templates.js +0 -3485
  44. package/dist/core/prompt-templates.js.map +0 -1
  45. package/prompt/ai-humanizer.md +0 -45
  46. package/prompt/api-contract-generator.md +0 -234
  47. package/prompt/apply.md +0 -17
  48. package/prompt/archive.md +0 -21
  49. package/prompt/design-system.md +0 -210
  50. package/prompt/document-explainer.md +0 -149
  51. package/prompt/epic-generator.md +0 -198
  52. package/prompt/epic-single.md +0 -47
  53. package/prompt/erd-generator.md +0 -130
  54. package/prompt/fsd-generator.md +0 -157
  55. package/prompt/prd-agent-generator.md +0 -147
  56. package/prompt/prd-generator.md +0 -195
  57. package/prompt/product-brief.md +0 -289
  58. package/prompt/proposal.md +0 -22
  59. package/prompt/qa-test-scenario.md +0 -133
  60. package/prompt/skill-creator.md +0 -350
  61. package/prompt/story-generator.md +0 -278
  62. package/prompt/story-single.md +0 -70
  63. package/prompt/tdd-generator.md +0 -294
  64. package/prompt/tdd-lite-generator.md +0 -224
  65. package/prompt/wireframe-generator.md +0 -219
  66. package/skills/ai-context-generator/SKILL.md +0 -54
  67. package/skills/ai-context-generator/references/AGENTS.template.md +0 -83
  68. package/skills/ai-context-generator/references/CLAUDE.template.md +0 -39
  69. package/skills/ai-context-generator/references/behavioral-guidelines.md +0 -71
  70. package/skills/ai-context-generator/references/discovery-checklist.md +0 -40
  71. package/skills/ai-context-generator/references/examples/AGENTS.good.md +0 -103
  72. package/skills/ai-context-generator/references/extraction-checklist.md +0 -23
  73. package/skills/ai-context-generator/references/overlays/laravel.md +0 -44
  74. package/skills/ai-humanizer/SKILL.md +0 -50
  75. package/skills/api-contract-generator/SKILL.md +0 -243
  76. package/skills/apply/SKILL.md +0 -23
  77. package/skills/archive/SKILL.md +0 -27
  78. package/skills/cerebro/SKILL.md +0 -187
  79. package/skills/cerebro/references/agents.md +0 -213
  80. package/skills/code-review/SKILL.md +0 -373
  81. package/skills/code-review/assets/report-template-agent.md +0 -212
  82. package/skills/code-review/assets/report-template-compact.md +0 -81
  83. package/skills/code-review/assets/report-template-full.md +0 -264
  84. package/skills/code-review/assets/report-template-human.md +0 -168
  85. package/skills/code-review/references/universal-patterns.md +0 -495
  86. package/skills/design-md/README.md +0 -34
  87. package/skills/design-md/SKILL.md +0 -172
  88. package/skills/design-md/examples/DESIGN.md +0 -154
  89. package/skills/design-system/SKILL.md +0 -216
  90. package/skills/design-system-generator/SKILL.md +0 -324
  91. package/skills/design-system-generator/assets/design-system-template.md +0 -348
  92. package/skills/design-system-generator/references/extraction-patterns.md +0 -321
  93. package/skills/doc-builder/SKILL.md +0 -115
  94. package/skills/doc-builder/references/ui-patterns.md +0 -394
  95. package/skills/document-explainer/SKILL.md +0 -155
  96. package/skills/document-translator/SKILL.md +0 -58
  97. package/skills/enhance/SKILL.md +0 -47
  98. package/skills/enhance-prompt/README.md +0 -34
  99. package/skills/enhance-prompt/SKILL.md +0 -204
  100. package/skills/enhance-prompt/references/KEYWORDS.md +0 -114
  101. package/skills/epic-generator/SKILL.md +0 -204
  102. package/skills/epic-single/SKILL.md +0 -63
  103. package/skills/erd-generator/SKILL.md +0 -138
  104. package/skills/feature-planner/SKILL.md +0 -305
  105. package/skills/feature-planner/assets/implementation-plan-template.md +0 -85
  106. package/skills/frontend-design/LICENSE.txt +0 -177
  107. package/skills/frontend-design/SKILL.md +0 -42
  108. package/skills/fsd-generator/SKILL.md +0 -163
  109. package/skills/gamma-builder/SKILL.md +0 -134
  110. package/skills/laravel-code-review/SKILL.md +0 -383
  111. package/skills/laravel-code-review/assets/report-template-agent.md +0 -195
  112. package/skills/laravel-code-review/assets/report-template-compact.md +0 -79
  113. package/skills/laravel-code-review/assets/report-template-full.md +0 -253
  114. package/skills/laravel-code-review/assets/report-template-human.md +0 -159
  115. package/skills/laravel-code-review/references/laravel-patterns.md +0 -571
  116. package/skills/laravel-code-review/references/php84-features.md +0 -442
  117. package/skills/mcp-builder/LICENSE.txt +0 -202
  118. package/skills/mcp-builder/SKILL.md +0 -236
  119. package/skills/mcp-builder/reference/evaluation.md +0 -602
  120. package/skills/mcp-builder/reference/mcp_best_practices.md +0 -249
  121. package/skills/mcp-builder/reference/node_mcp_server.md +0 -970
  122. package/skills/mcp-builder/reference/python_mcp_server.md +0 -719
  123. package/skills/mcp-builder/scripts/connections.py +0 -151
  124. package/skills/mcp-builder/scripts/evaluation.py +0 -373
  125. package/skills/mcp-builder/scripts/example_evaluation.xml +0 -22
  126. package/skills/mcp-builder/scripts/requirements.txt +0 -2
  127. package/skills/meeting-notes/SKILL.md +0 -159
  128. package/skills/meeting-notes/evals/evals.json +0 -23
  129. package/skills/prd-agent-generator/SKILL.md +0 -132
  130. package/skills/prd-generator/SKILL.md +0 -211
  131. package/skills/product-brief/SKILL.md +0 -141
  132. package/skills/project-orchestrator/SKILL.md +0 -487
  133. package/skills/project-orchestrator/assets/caddy-vps-setup.md +0 -180
  134. package/skills/project-orchestrator/assets/plan-summary-template.md +0 -159
  135. package/skills/prompter-specs/SKILL.md +0 -115
  136. package/skills/prompter-workflow/SKILL.md +0 -166
  137. package/skills/prompter-workflow/evals/evals.json +0 -89
  138. package/skills/proposal/SKILL.md +0 -28
  139. package/skills/qa-test-scenario/SKILL.md +0 -149
  140. package/skills/skill-creator/SKILL.md +0 -173
  141. package/skills/sph-generator/SKILL.md +0 -488
  142. package/skills/story-generator/SKILL.md +0 -285
  143. package/skills/story-single/SKILL.md +0 -86
  144. package/skills/tdd-generator/SKILL.md +0 -300
  145. package/skills/tdd-lite-generator/SKILL.md +0 -230
  146. package/skills/ui-ux-pro/SKILL.md +0 -199
  147. package/skills/ui-ux-pro/assets/design-spec-template.md +0 -173
  148. package/skills/ui-ux-pro/references/component-patterns.md +0 -255
  149. package/skills/ui-ux-pro/references/design-principles.md +0 -167
  150. package/skills/wireframe-generator/SKILL.md +0 -227
  151. package/src/cli/index.ts +0 -223
  152. package/src/commands/archive.ts +0 -302
  153. package/src/commands/change.ts +0 -292
  154. package/src/commands/config.ts +0 -233
  155. package/src/commands/guide.ts +0 -50
  156. package/src/commands/init.ts +0 -597
  157. package/src/commands/list.ts +0 -194
  158. package/src/commands/show.ts +0 -138
  159. package/src/commands/spec.ts +0 -251
  160. package/src/commands/update.ts +0 -129
  161. package/src/commands/upgrade.ts +0 -30
  162. package/src/commands/validate.ts +0 -326
  163. package/src/core/artifact-graph/graph.ts +0 -167
  164. package/src/core/artifact-graph/index.ts +0 -44
  165. package/src/core/artifact-graph/instruction-loader.ts +0 -302
  166. package/src/core/artifact-graph/resolver.ts +0 -226
  167. package/src/core/artifact-graph/schema.ts +0 -124
  168. package/src/core/artifact-graph/state.ts +0 -64
  169. package/src/core/artifact-graph/types.ts +0 -65
  170. package/src/core/completions/command-registry.ts +0 -382
  171. package/src/core/completions/completion-provider.ts +0 -128
  172. package/src/core/completions/generators/bash-generator.ts +0 -191
  173. package/src/core/completions/generators/fish-generator.ts +0 -188
  174. package/src/core/completions/generators/powershell-generator.ts +0 -223
  175. package/src/core/completions/generators/zsh-generator.ts +0 -281
  176. package/src/core/completions/templates/bash-templates.ts +0 -24
  177. package/src/core/completions/templates/fish-templates.ts +0 -40
  178. package/src/core/completions/templates/powershell-templates.ts +0 -25
  179. package/src/core/completions/templates/zsh-templates.ts +0 -36
  180. package/src/core/completions/types.ts +0 -90
  181. package/src/core/config-schema.ts +0 -230
  182. package/src/core/config.ts +0 -181
  183. package/src/core/configurators/slash/antigravity.ts +0 -10
  184. package/src/core/configurators/slash/base.ts +0 -109
  185. package/src/core/configurators/slash/claude.ts +0 -10
  186. package/src/core/configurators/slash/codex.ts +0 -10
  187. package/src/core/configurators/slash/droid.ts +0 -10
  188. package/src/core/configurators/slash/forge.ts +0 -10
  189. package/src/core/configurators/slash/github-copilot.ts +0 -10
  190. package/src/core/configurators/slash/index.ts +0 -10
  191. package/src/core/configurators/slash/kilocode.ts +0 -10
  192. package/src/core/configurators/slash/opencode.ts +0 -10
  193. package/src/core/configurators/slash/registry.ts +0 -51
  194. package/src/core/converters/json-converter.ts +0 -62
  195. package/src/core/global-config.ts +0 -136
  196. package/src/core/parsers/change-parser.ts +0 -234
  197. package/src/core/parsers/markdown-parser.ts +0 -237
  198. package/src/core/parsers/requirement-blocks.ts +0 -234
  199. package/src/core/prompt-templates.ts +0 -3504
  200. package/src/core/schemas/base.schema.ts +0 -20
  201. package/src/core/schemas/change.schema.ts +0 -42
  202. package/src/core/schemas/index.ts +0 -20
  203. package/src/core/schemas/spec.schema.ts +0 -17
  204. package/src/core/skill-discovery.ts +0 -68
  205. package/src/core/specs-apply.ts +0 -483
  206. package/src/core/styles/palette.ts +0 -8
  207. package/src/core/templates/agents-template.ts +0 -459
  208. package/src/core/templates/claude-template.ts +0 -2
  209. package/src/core/templates/index.ts +0 -3
  210. package/src/core/templates/project-template.ts +0 -32
  211. package/src/core/validation/constants.ts +0 -48
  212. package/src/core/validation/types.ts +0 -19
  213. package/src/core/validation/validator.ts +0 -449
  214. package/src/core/view.ts +0 -219
  215. package/src/index.ts +0 -1
  216. package/src/utils/change-metadata.ts +0 -171
  217. package/src/utils/change-utils.ts +0 -131
  218. package/src/utils/file-system.ts +0 -252
  219. package/src/utils/index.ts +0 -12
  220. package/src/utils/interactive.ts +0 -29
  221. package/src/utils/item-discovery.ts +0 -66
  222. package/src/utils/match.ts +0 -26
  223. package/src/utils/shell-detection.ts +0 -62
  224. package/src/utils/task-progress.ts +0 -43
  225. package/tsconfig.json +0 -28
@@ -1,281 +0,0 @@
1
- import { CompletionGenerator, CommandDefinition, FlagDefinition } from '../types.js';
2
- import { ZSH_DYNAMIC_HELPERS } from '../templates/zsh-templates.js';
3
-
4
- /**
5
- * Generates Zsh completion scripts for the Prompter CLI.
6
- * Follows Zsh completion system conventions using the _prompter function.
7
- */
8
- export class ZshGenerator implements CompletionGenerator {
9
- readonly shell = 'zsh' as const;
10
-
11
- /**
12
- * Generate a Zsh completion script
13
- *
14
- * @param commands - Command definitions to generate completions for
15
- * @returns Zsh completion script as a string
16
- */
17
- generate(commands: CommandDefinition[]): string {
18
- // Build command list using push() for loop clarity
19
- const commandLines: string[] = [];
20
- for (const cmd of commands) {
21
- const escapedDesc = this.escapeDescription(cmd.description);
22
- commandLines.push(` '${cmd.name}:${escapedDesc}'`);
23
- }
24
- const commandList = commandLines.join('\n');
25
-
26
- // Build command cases using push() for loop clarity
27
- const commandCaseLines: string[] = [];
28
- for (const cmd of commands) {
29
- commandCaseLines.push(` ${cmd.name})`);
30
- commandCaseLines.push(` _prompter_${this.sanitizeFunctionName(cmd.name)}`);
31
- commandCaseLines.push(' ;;');
32
- }
33
- const commandCases = commandCaseLines.join('\n');
34
-
35
- // Build command functions using push() for loop clarity
36
- const commandFunctionLines: string[] = [];
37
- for (const cmd of commands) {
38
- commandFunctionLines.push(...this.generateCommandFunction(cmd));
39
- commandFunctionLines.push('');
40
- }
41
- const commandFunctions = commandFunctionLines.join('\n');
42
-
43
- // Dynamic completion helpers from template
44
- const helpers = ZSH_DYNAMIC_HELPERS;
45
-
46
- // Assemble final script with template literal
47
- return `#compdef prompter
48
-
49
- # Zsh completion script for Prompter CLI
50
- # Auto-generated - do not edit manually
51
-
52
- _prompter() {
53
- local context state line
54
- typeset -A opt_args
55
-
56
- local -a commands
57
- commands=(
58
- ${commandList}
59
- )
60
-
61
- _arguments -C \\
62
- "1: :->command" \\
63
- "*::arg:->args"
64
-
65
- case $state in
66
- command)
67
- _describe "prompter command" commands
68
- ;;
69
- args)
70
- case $words[1] in
71
- ${commandCases}
72
- esac
73
- ;;
74
- esac
75
- }
76
-
77
- ${commandFunctions}
78
- ${helpers}
79
- compdef _prompter prompter
80
- `;
81
- }
82
-
83
- /**
84
- * Generate completion function for a specific command
85
- */
86
- private generateCommandFunction(cmd: CommandDefinition): string[] {
87
- const funcName = `_prompter_${this.sanitizeFunctionName(cmd.name)}`;
88
- const lines: string[] = [];
89
-
90
- lines.push(`${funcName}() {`);
91
-
92
- // If command has subcommands, handle them
93
- if (cmd.subcommands && cmd.subcommands.length > 0) {
94
- lines.push(' local context state line');
95
- lines.push(' typeset -A opt_args');
96
- lines.push('');
97
- lines.push(' local -a subcommands');
98
- lines.push(' subcommands=(');
99
-
100
- for (const subcmd of cmd.subcommands) {
101
- const escapedDesc = this.escapeDescription(subcmd.description);
102
- lines.push(` '${subcmd.name}:${escapedDesc}'`);
103
- }
104
-
105
- lines.push(' )');
106
- lines.push('');
107
- lines.push(' _arguments -C \\');
108
-
109
- // Add command flags
110
- for (const flag of cmd.flags) {
111
- lines.push(' ' + this.generateFlagSpec(flag) + ' \\');
112
- }
113
-
114
- lines.push(' "1: :->subcommand" \\');
115
- lines.push(' "*::arg:->args"');
116
- lines.push('');
117
- lines.push(' case $state in');
118
- lines.push(' subcommand)');
119
- lines.push(' _describe "subcommand" subcommands');
120
- lines.push(' ;;');
121
- lines.push(' args)');
122
- lines.push(' case $words[1] in');
123
-
124
- for (const subcmd of cmd.subcommands) {
125
- lines.push(` ${subcmd.name})`);
126
- lines.push(` _prompter_${this.sanitizeFunctionName(cmd.name)}_${this.sanitizeFunctionName(subcmd.name)}`);
127
- lines.push(' ;;');
128
- }
129
-
130
- lines.push(' esac');
131
- lines.push(' ;;');
132
- lines.push(' esac');
133
- } else {
134
- // Command without subcommands
135
- lines.push(' _arguments \\');
136
-
137
- // Add flags
138
- for (const flag of cmd.flags) {
139
- lines.push(' ' + this.generateFlagSpec(flag) + ' \\');
140
- }
141
-
142
- // Add positional argument completion
143
- if (cmd.acceptsPositional) {
144
- const positionalSpec = this.generatePositionalSpec(cmd.positionalType);
145
- lines.push(' ' + positionalSpec);
146
- } else {
147
- // Remove trailing backslash from last flag
148
- if (lines[lines.length - 1].endsWith(' \\')) {
149
- lines[lines.length - 1] = lines[lines.length - 1].slice(0, -2);
150
- }
151
- }
152
- }
153
-
154
- lines.push('}');
155
-
156
- // Generate subcommand functions if they exist
157
- if (cmd.subcommands) {
158
- for (const subcmd of cmd.subcommands) {
159
- lines.push('');
160
- lines.push(...this.generateSubcommandFunction(cmd.name, subcmd));
161
- }
162
- }
163
-
164
- return lines;
165
- }
166
-
167
- /**
168
- * Generate completion function for a subcommand
169
- */
170
- private generateSubcommandFunction(parentName: string, subcmd: CommandDefinition): string[] {
171
- const funcName = `_prompter_${this.sanitizeFunctionName(parentName)}_${this.sanitizeFunctionName(subcmd.name)}`;
172
- const lines: string[] = [];
173
-
174
- lines.push(`${funcName}() {`);
175
- lines.push(' _arguments \\');
176
-
177
- // Add flags
178
- for (const flag of subcmd.flags) {
179
- lines.push(' ' + this.generateFlagSpec(flag) + ' \\');
180
- }
181
-
182
- // Add positional argument completion
183
- if (subcmd.acceptsPositional) {
184
- const positionalSpec = this.generatePositionalSpec(subcmd.positionalType);
185
- lines.push(' ' + positionalSpec);
186
- } else {
187
- // Remove trailing backslash from last flag
188
- if (lines[lines.length - 1].endsWith(' \\')) {
189
- lines[lines.length - 1] = lines[lines.length - 1].slice(0, -2);
190
- }
191
- }
192
-
193
- lines.push('}');
194
-
195
- return lines;
196
- }
197
-
198
- /**
199
- * Generate flag specification for _arguments
200
- */
201
- private generateFlagSpec(flag: FlagDefinition): string {
202
- const parts: string[] = [];
203
-
204
- // Handle mutually exclusive short and long forms
205
- if (flag.short) {
206
- parts.push(`'(-${flag.short} --${flag.name})'{-${flag.short},--${flag.name}}'`);
207
- } else {
208
- parts.push(`'--${flag.name}`);
209
- }
210
-
211
- // Add description
212
- const escapedDesc = this.escapeDescription(flag.description);
213
- parts.push(`[${escapedDesc}]`);
214
-
215
- // Add value completion if flag takes a value
216
- if (flag.takesValue) {
217
- if (flag.values && flag.values.length > 0) {
218
- // Provide specific value completions
219
- const valueList = flag.values.map(v => this.escapeValue(v)).join(' ');
220
- parts.push(`:value:(${valueList})`);
221
- } else {
222
- // Generic value placeholder
223
- parts.push(':value:');
224
- }
225
- }
226
-
227
- // Close the quote (needed for both short and long forms)
228
- parts.push("'");
229
-
230
- return parts.join('');
231
- }
232
-
233
- /**
234
- * Generate positional argument specification
235
- */
236
- private generatePositionalSpec(positionalType?: string): string {
237
- switch (positionalType) {
238
- case 'change-id':
239
- return "'*: :_prompter_complete_changes'";
240
- case 'spec-id':
241
- return "'*: :_prompter_complete_specs'";
242
- case 'change-or-spec-id':
243
- return "'*: :_prompter_complete_items'";
244
- case 'path':
245
- return "'*:path:_files'";
246
- case 'shell':
247
- return "'*:shell:(zsh bash fish powershell)'";
248
- default:
249
- return "'*: :_default'";
250
- }
251
- }
252
-
253
- /**
254
- * Escape special characters in descriptions
255
- */
256
- private escapeDescription(desc: string): string {
257
- return desc
258
- .replace(/\\/g, '\\\\')
259
- .replace(/'/g, "\\'")
260
- .replace(/\[/g, '\\[')
261
- .replace(/]/g, '\\]')
262
- .replace(/:/g, '\\:');
263
- }
264
-
265
- /**
266
- * Escape special characters in values
267
- */
268
- private escapeValue(value: string): string {
269
- return value
270
- .replace(/\\/g, '\\\\')
271
- .replace(/'/g, "\\'")
272
- .replace(/ /g, '\\ ');
273
- }
274
-
275
- /**
276
- * Sanitize command names for use in function names
277
- */
278
- private sanitizeFunctionName(name: string): string {
279
- return name.replace(/-/g, '_');
280
- }
281
- }
@@ -1,24 +0,0 @@
1
- /**
2
- * Static template strings for Bash completion scripts.
3
- * These are Bash-specific helper functions that never change.
4
- */
5
-
6
- export const BASH_DYNAMIC_HELPERS = `# Dynamic completion helpers
7
-
8
- _prompter_complete_changes() {
9
- local changes
10
- changes=$(prompter __complete changes 2>/dev/null | cut -f1)
11
- COMPREPLY=($(compgen -W "$changes" -- "$cur"))
12
- }
13
-
14
- _prompter_complete_specs() {
15
- local specs
16
- specs=$(prompter __complete specs 2>/dev/null | cut -f1)
17
- COMPREPLY=($(compgen -W "$specs" -- "$cur"))
18
- }
19
-
20
- _prompter_complete_items() {
21
- local items
22
- items=$(prompter __complete changes 2>/dev/null | cut -f1; prompter __complete specs 2>/dev/null | cut -f1)
23
- COMPREPLY=($(compgen -W "$items" -- "$cur"))
24
- }`;
@@ -1,40 +0,0 @@
1
- /**
2
- * Static template strings for Fish completion scripts.
3
- * These are Fish-specific helper functions that never change.
4
- */
5
-
6
- export const FISH_STATIC_HELPERS = `# Helper function to check if a subcommand is present
7
- function __fish_prompter_using_subcommand
8
- set -l cmd (commandline -opc)
9
- set -e cmd[1]
10
- for i in $argv
11
- if contains -- $i $cmd
12
- return 0
13
- end
14
- end
15
- return 1
16
- end
17
-
18
- function __fish_prompter_no_subcommand
19
- set -l cmd (commandline -opc)
20
- test (count $cmd) -eq 1
21
- end`;
22
-
23
- export const FISH_DYNAMIC_HELPERS = `# Dynamic completion helpers
24
-
25
- function __fish_prompter_changes
26
- prompter __complete changes 2>/dev/null | while read -l id desc
27
- printf '%s\\t%s\\n' "$id" "$desc"
28
- end
29
- end
30
-
31
- function __fish_prompter_specs
32
- prompter __complete specs 2>/dev/null | while read -l id desc
33
- printf '%s\\t%s\\n' "$id" "$desc"
34
- end
35
- end
36
-
37
- function __fish_prompter_items
38
- __fish_prompter_changes
39
- __fish_prompter_specs
40
- end`;
@@ -1,25 +0,0 @@
1
- /**
2
- * Static template strings for PowerShell completion scripts.
3
- * These are PowerShell-specific helper functions that never change.
4
- */
5
-
6
- export const POWERSHELL_DYNAMIC_HELPERS = `# Dynamic completion helpers
7
-
8
- function Get-PrompterChanges {
9
- $output = prompter __complete changes 2>$null
10
- if ($output) {
11
- $output | ForEach-Object {
12
- ($_ -split "\\t")[0]
13
- }
14
- }
15
- }
16
-
17
- function Get-PrompterSpecs {
18
- $output = prompter __complete specs 2>$null
19
- if ($output) {
20
- $output | ForEach-Object {
21
- ($_ -split "\\t")[0]
22
- }
23
- }
24
- }
25
- `;
@@ -1,36 +0,0 @@
1
- /**
2
- * Static template strings for Zsh completion scripts.
3
- * These are Zsh-specific helper functions that never change.
4
- */
5
-
6
- export const ZSH_DYNAMIC_HELPERS = `# Dynamic completion helpers
7
-
8
- # Use prompter __complete to get available changes
9
- _prompter_complete_changes() {
10
- local -a changes
11
- while IFS=$'\\t' read -r id desc; do
12
- changes+=("$id:$desc")
13
- done < <(prompter __complete changes 2>/dev/null)
14
- _describe "change" changes
15
- }
16
-
17
- # Use prompter __complete to get available specs
18
- _prompter_complete_specs() {
19
- local -a specs
20
- while IFS=$'\\t' read -r id desc; do
21
- specs+=("$id:$desc")
22
- done < <(prompter __complete specs 2>/dev/null)
23
- _describe "spec" specs
24
- }
25
-
26
- # Get both changes and specs
27
- _prompter_complete_items() {
28
- local -a items
29
- while IFS=$'\\t' read -r id desc; do
30
- items+=("$id:$desc")
31
- done < <(prompter __complete changes 2>/dev/null)
32
- while IFS=$'\\t' read -r id desc; do
33
- items+=("$id:$desc")
34
- done < <(prompter __complete specs 2>/dev/null)
35
- _describe "item" items
36
- }`;
@@ -1,90 +0,0 @@
1
- import { SupportedShell } from '../../utils/shell-detection.js';
2
-
3
- /**
4
- * Definition of a command-line flag/option
5
- */
6
- export interface FlagDefinition {
7
- /**
8
- * Flag name without dashes (e.g., "json", "strict", "no-interactive")
9
- */
10
- name: string;
11
-
12
- /**
13
- * Short flag name without dash (e.g., "y" for "-y")
14
- */
15
- short?: string;
16
-
17
- /**
18
- * Human-readable description of what the flag does
19
- */
20
- description: string;
21
-
22
- /**
23
- * Whether the flag takes an argument value
24
- */
25
- takesValue?: boolean;
26
-
27
- /**
28
- * Possible values for the flag (for completion suggestions)
29
- */
30
- values?: string[];
31
- }
32
-
33
- /**
34
- * Definition of a CLI command
35
- */
36
- export interface CommandDefinition {
37
- /**
38
- * Command name (e.g., "init", "validate", "show")
39
- */
40
- name: string;
41
-
42
- /**
43
- * Human-readable description of the command
44
- */
45
- description: string;
46
-
47
- /**
48
- * Flags/options supported by this command
49
- */
50
- flags: FlagDefinition[];
51
-
52
- /**
53
- * Subcommands (e.g., "change show", "spec validate")
54
- */
55
- subcommands?: CommandDefinition[];
56
-
57
- /**
58
- * Whether this command accepts a positional argument (e.g., item name, path)
59
- */
60
- acceptsPositional?: boolean;
61
-
62
- /**
63
- * Type of positional argument for dynamic completion
64
- * - 'change-id': Complete with active change IDs
65
- * - 'spec-id': Complete with spec IDs
66
- * - 'change-or-spec-id': Complete with both changes and specs
67
- * - 'path': Complete with file paths
68
- * - 'shell': Complete with supported shell names
69
- * - undefined: No specific completion
70
- */
71
- positionalType?: 'change-id' | 'spec-id' | 'change-or-spec-id' | 'path' | 'shell';
72
- }
73
-
74
- /**
75
- * Interface for shell-specific completion script generators
76
- */
77
- export interface CompletionGenerator {
78
- /**
79
- * The shell type this generator targets
80
- */
81
- readonly shell: SupportedShell;
82
-
83
- /**
84
- * Generate the completion script content
85
- *
86
- * @param commands - Command definitions to generate completions for
87
- * @returns The shell-specific completion script as a string
88
- */
89
- generate(commands: CommandDefinition[]): string;
90
- }