commandmate 0.2.3 → 0.2.5

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 (89) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +25 -25
  3. package/.next/app-path-routes-manifest.json +1 -1
  4. package/.next/build-manifest.json +7 -7
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/cache/config.json +3 -3
  7. package/.next/cache/fetch-cache/e7a5282a8c6f6e86940328b91498c8c8abc4b300cf449cb16e8ecd707767c12b +1 -0
  8. package/.next/cache/webpack/client-production/0.pack +0 -0
  9. package/.next/cache/webpack/client-production/1.pack +0 -0
  10. package/.next/cache/webpack/client-production/2.pack +0 -0
  11. package/.next/cache/webpack/client-production/index.pack +0 -0
  12. package/.next/cache/webpack/client-production/index.pack.old +0 -0
  13. package/.next/cache/webpack/edge-server-production/index.pack +0 -0
  14. package/.next/cache/webpack/server-production/0.pack +0 -0
  15. package/.next/cache/webpack/server-production/index.pack +0 -0
  16. package/.next/next-server.js.nft.json +1 -1
  17. package/.next/prerender-manifest.json +1 -1
  18. package/.next/required-server-files.json +1 -1
  19. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/app/update-check/route.js +1 -0
  21. package/.next/server/app/api/app/update-check/route.js.nft.json +1 -0
  22. package/.next/server/app/api/app/update-check.body +1 -0
  23. package/.next/server/app/api/app/update-check.meta +1 -0
  24. package/.next/server/app/api/repositories/restore/route.js +1 -1
  25. package/.next/server/app/api/repositories/scan/route.js +1 -1
  26. package/.next/server/app/api/repositories/sync/route.js +1 -1
  27. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js +1 -1
  28. package/.next/server/app/api/worktrees/[id]/logs/route.js +2 -2
  29. package/.next/server/app/api/worktrees/[id]/search/route.js +1 -1
  30. package/.next/server/app/page_client-reference-manifest.js +1 -1
  31. package/.next/server/app/proxy/[...path]/route.js +1 -1
  32. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  33. package/.next/server/app/worktrees/[id]/page.js +3 -3
  34. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  35. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  36. package/.next/server/app-paths-manifest.json +10 -9
  37. package/.next/server/chunks/2683.js +1 -1
  38. package/.next/server/chunks/5488.js +1 -1
  39. package/.next/server/chunks/5823.js +1 -1
  40. package/.next/server/chunks/7425.js +3 -3
  41. package/.next/server/chunks/7536.js +1 -1
  42. package/.next/server/chunks/9367.js +2 -2
  43. package/.next/server/middleware-build-manifest.js +1 -1
  44. package/.next/server/pages/500.html +1 -1
  45. package/.next/server/server-reference-manifest.json +1 -1
  46. package/.next/static/chunks/{816-bb41b20a51ae924a.js → 816-af44cb865b0c980e.js} +1 -1
  47. package/.next/static/chunks/app/page-43b5de1a0a788b1f.js +1 -0
  48. package/.next/static/chunks/app/worktrees/[id]/{page-9d77c6f755d08086.js → page-66b59fb8c9ee90f4.js} +1 -1
  49. package/.next/static/chunks/{main-b6d727aa9248d4f2.js → main-f00f82f1cf18dd99.js} +1 -1
  50. package/.next/static/chunks/{webpack-e6531fcf859d9451.js → webpack-af8567a485ade35a.js} +1 -1
  51. package/.next/static/css/{4eca30cb81bc52b4.css → 6a92c8ad3c94d15a.css} +1 -1
  52. package/.next/trace +5 -5
  53. package/.next/types/app/api/app/update-check/route.ts +343 -0
  54. package/dist/cli/commands/docs.d.ts +22 -0
  55. package/dist/cli/commands/docs.d.ts.map +1 -0
  56. package/dist/cli/commands/docs.js +96 -0
  57. package/dist/cli/commands/init.d.ts.map +1 -1
  58. package/dist/cli/commands/init.js +3 -0
  59. package/dist/cli/commands/issue.d.ts +23 -0
  60. package/dist/cli/commands/issue.d.ts.map +1 -0
  61. package/dist/cli/commands/issue.js +143 -0
  62. package/dist/cli/config/ai-integration-messages.d.ts +6 -0
  63. package/dist/cli/config/ai-integration-messages.d.ts.map +1 -0
  64. package/dist/cli/config/ai-integration-messages.js +27 -0
  65. package/dist/cli/config/cli-dependencies.d.ts.map +1 -1
  66. package/dist/cli/config/cli-dependencies.js +6 -0
  67. package/dist/cli/config/security-messages.d.ts +3 -1
  68. package/dist/cli/config/security-messages.d.ts.map +1 -1
  69. package/dist/cli/config/security-messages.js +4 -1
  70. package/dist/cli/index.js +15 -2
  71. package/dist/cli/types/index.d.ts +23 -0
  72. package/dist/cli/types/index.d.ts.map +1 -1
  73. package/dist/cli/utils/docs-reader.d.ts +42 -0
  74. package/dist/cli/utils/docs-reader.d.ts.map +1 -0
  75. package/dist/cli/utils/docs-reader.js +155 -0
  76. package/dist/cli/utils/input-validators.d.ts +32 -0
  77. package/dist/cli/utils/input-validators.d.ts.map +1 -1
  78. package/dist/cli/utils/input-validators.js +51 -1
  79. package/dist/cli/utils/preflight.d.ts.map +1 -1
  80. package/dist/cli/utils/preflight.js +1 -0
  81. package/dist/config/github-links.d.ts +16 -0
  82. package/dist/config/github-links.d.ts.map +1 -0
  83. package/dist/config/github-links.js +22 -0
  84. package/dist/server/src/lib/prompt-detector.js +207 -67
  85. package/package.json +1 -1
  86. package/.next/static/chunks/app/page-792c0577dc44e5e5.js +0 -1
  87. /package/.next/static/chunks/{4733-db0112b08802aaa7.js → 4733-50bdfc169adb4881.js} +0 -0
  88. /package/.next/static/{rppRTm2sRWa4sZE7ili8A → zoVKZmyy2snskN1roYhHr}/_buildManifest.js +0 -0
  89. /package/.next/static/{rppRTm2sRWa4sZE7ili8A → zoVKZmyy2snskN1roYhHr}/_ssgManifest.js +0 -0
@@ -0,0 +1,343 @@
1
+ // File: /home/runner/work/CommandMate/CommandMate/src/app/api/app/update-check/route.ts
2
+ import * as entry from '../../../../../../src/app/api/app/update-check/route.js'
3
+ import type { NextRequest } from 'next/server.js'
4
+
5
+ type TEntry = typeof import('../../../../../../src/app/api/app/update-check/route.js')
6
+
7
+ // Check that the entry is a valid entry
8
+ checkFields<Diff<{
9
+ GET?: Function
10
+ HEAD?: Function
11
+ OPTIONS?: Function
12
+ POST?: Function
13
+ PUT?: Function
14
+ DELETE?: Function
15
+ PATCH?: Function
16
+ config?: {}
17
+ generateStaticParams?: Function
18
+ revalidate?: RevalidateRange<TEntry> | false
19
+ dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static'
20
+ dynamicParams?: boolean
21
+ fetchCache?: 'auto' | 'force-no-store' | 'only-no-store' | 'default-no-store' | 'default-cache' | 'only-cache' | 'force-cache'
22
+ preferredRegion?: 'auto' | 'global' | 'home' | string | string[]
23
+ runtime?: 'nodejs' | 'experimental-edge' | 'edge'
24
+ maxDuration?: number
25
+
26
+ }, TEntry, ''>>()
27
+
28
+ // Check the prop type of the entry function
29
+ if ('GET' in entry) {
30
+ checkFields<
31
+ Diff<
32
+ ParamCheck<Request | NextRequest>,
33
+ {
34
+ __tag__: 'GET'
35
+ __param_position__: 'first'
36
+ __param_type__: FirstArg<MaybeField<TEntry, 'GET'>>
37
+ },
38
+ 'GET'
39
+ >
40
+ >()
41
+ checkFields<
42
+ Diff<
43
+ ParamCheck<PageParams>,
44
+ {
45
+ __tag__: 'GET'
46
+ __param_position__: 'second'
47
+ __param_type__: SecondArg<MaybeField<TEntry, 'GET'>>
48
+ },
49
+ 'GET'
50
+ >
51
+ >()
52
+
53
+ checkFields<
54
+ Diff<
55
+ {
56
+ __tag__: 'GET',
57
+ __return_type__: Response | void | never | Promise<Response | void | never>
58
+ },
59
+ {
60
+ __tag__: 'GET',
61
+ __return_type__: ReturnType<MaybeField<TEntry, 'GET'>>
62
+ },
63
+ 'GET'
64
+ >
65
+ >()
66
+ }
67
+ // Check the prop type of the entry function
68
+ if ('HEAD' in entry) {
69
+ checkFields<
70
+ Diff<
71
+ ParamCheck<Request | NextRequest>,
72
+ {
73
+ __tag__: 'HEAD'
74
+ __param_position__: 'first'
75
+ __param_type__: FirstArg<MaybeField<TEntry, 'HEAD'>>
76
+ },
77
+ 'HEAD'
78
+ >
79
+ >()
80
+ checkFields<
81
+ Diff<
82
+ ParamCheck<PageParams>,
83
+ {
84
+ __tag__: 'HEAD'
85
+ __param_position__: 'second'
86
+ __param_type__: SecondArg<MaybeField<TEntry, 'HEAD'>>
87
+ },
88
+ 'HEAD'
89
+ >
90
+ >()
91
+
92
+ checkFields<
93
+ Diff<
94
+ {
95
+ __tag__: 'HEAD',
96
+ __return_type__: Response | void | never | Promise<Response | void | never>
97
+ },
98
+ {
99
+ __tag__: 'HEAD',
100
+ __return_type__: ReturnType<MaybeField<TEntry, 'HEAD'>>
101
+ },
102
+ 'HEAD'
103
+ >
104
+ >()
105
+ }
106
+ // Check the prop type of the entry function
107
+ if ('OPTIONS' in entry) {
108
+ checkFields<
109
+ Diff<
110
+ ParamCheck<Request | NextRequest>,
111
+ {
112
+ __tag__: 'OPTIONS'
113
+ __param_position__: 'first'
114
+ __param_type__: FirstArg<MaybeField<TEntry, 'OPTIONS'>>
115
+ },
116
+ 'OPTIONS'
117
+ >
118
+ >()
119
+ checkFields<
120
+ Diff<
121
+ ParamCheck<PageParams>,
122
+ {
123
+ __tag__: 'OPTIONS'
124
+ __param_position__: 'second'
125
+ __param_type__: SecondArg<MaybeField<TEntry, 'OPTIONS'>>
126
+ },
127
+ 'OPTIONS'
128
+ >
129
+ >()
130
+
131
+ checkFields<
132
+ Diff<
133
+ {
134
+ __tag__: 'OPTIONS',
135
+ __return_type__: Response | void | never | Promise<Response | void | never>
136
+ },
137
+ {
138
+ __tag__: 'OPTIONS',
139
+ __return_type__: ReturnType<MaybeField<TEntry, 'OPTIONS'>>
140
+ },
141
+ 'OPTIONS'
142
+ >
143
+ >()
144
+ }
145
+ // Check the prop type of the entry function
146
+ if ('POST' in entry) {
147
+ checkFields<
148
+ Diff<
149
+ ParamCheck<Request | NextRequest>,
150
+ {
151
+ __tag__: 'POST'
152
+ __param_position__: 'first'
153
+ __param_type__: FirstArg<MaybeField<TEntry, 'POST'>>
154
+ },
155
+ 'POST'
156
+ >
157
+ >()
158
+ checkFields<
159
+ Diff<
160
+ ParamCheck<PageParams>,
161
+ {
162
+ __tag__: 'POST'
163
+ __param_position__: 'second'
164
+ __param_type__: SecondArg<MaybeField<TEntry, 'POST'>>
165
+ },
166
+ 'POST'
167
+ >
168
+ >()
169
+
170
+ checkFields<
171
+ Diff<
172
+ {
173
+ __tag__: 'POST',
174
+ __return_type__: Response | void | never | Promise<Response | void | never>
175
+ },
176
+ {
177
+ __tag__: 'POST',
178
+ __return_type__: ReturnType<MaybeField<TEntry, 'POST'>>
179
+ },
180
+ 'POST'
181
+ >
182
+ >()
183
+ }
184
+ // Check the prop type of the entry function
185
+ if ('PUT' in entry) {
186
+ checkFields<
187
+ Diff<
188
+ ParamCheck<Request | NextRequest>,
189
+ {
190
+ __tag__: 'PUT'
191
+ __param_position__: 'first'
192
+ __param_type__: FirstArg<MaybeField<TEntry, 'PUT'>>
193
+ },
194
+ 'PUT'
195
+ >
196
+ >()
197
+ checkFields<
198
+ Diff<
199
+ ParamCheck<PageParams>,
200
+ {
201
+ __tag__: 'PUT'
202
+ __param_position__: 'second'
203
+ __param_type__: SecondArg<MaybeField<TEntry, 'PUT'>>
204
+ },
205
+ 'PUT'
206
+ >
207
+ >()
208
+
209
+ checkFields<
210
+ Diff<
211
+ {
212
+ __tag__: 'PUT',
213
+ __return_type__: Response | void | never | Promise<Response | void | never>
214
+ },
215
+ {
216
+ __tag__: 'PUT',
217
+ __return_type__: ReturnType<MaybeField<TEntry, 'PUT'>>
218
+ },
219
+ 'PUT'
220
+ >
221
+ >()
222
+ }
223
+ // Check the prop type of the entry function
224
+ if ('DELETE' in entry) {
225
+ checkFields<
226
+ Diff<
227
+ ParamCheck<Request | NextRequest>,
228
+ {
229
+ __tag__: 'DELETE'
230
+ __param_position__: 'first'
231
+ __param_type__: FirstArg<MaybeField<TEntry, 'DELETE'>>
232
+ },
233
+ 'DELETE'
234
+ >
235
+ >()
236
+ checkFields<
237
+ Diff<
238
+ ParamCheck<PageParams>,
239
+ {
240
+ __tag__: 'DELETE'
241
+ __param_position__: 'second'
242
+ __param_type__: SecondArg<MaybeField<TEntry, 'DELETE'>>
243
+ },
244
+ 'DELETE'
245
+ >
246
+ >()
247
+
248
+ checkFields<
249
+ Diff<
250
+ {
251
+ __tag__: 'DELETE',
252
+ __return_type__: Response | void | never | Promise<Response | void | never>
253
+ },
254
+ {
255
+ __tag__: 'DELETE',
256
+ __return_type__: ReturnType<MaybeField<TEntry, 'DELETE'>>
257
+ },
258
+ 'DELETE'
259
+ >
260
+ >()
261
+ }
262
+ // Check the prop type of the entry function
263
+ if ('PATCH' in entry) {
264
+ checkFields<
265
+ Diff<
266
+ ParamCheck<Request | NextRequest>,
267
+ {
268
+ __tag__: 'PATCH'
269
+ __param_position__: 'first'
270
+ __param_type__: FirstArg<MaybeField<TEntry, 'PATCH'>>
271
+ },
272
+ 'PATCH'
273
+ >
274
+ >()
275
+ checkFields<
276
+ Diff<
277
+ ParamCheck<PageParams>,
278
+ {
279
+ __tag__: 'PATCH'
280
+ __param_position__: 'second'
281
+ __param_type__: SecondArg<MaybeField<TEntry, 'PATCH'>>
282
+ },
283
+ 'PATCH'
284
+ >
285
+ >()
286
+
287
+ checkFields<
288
+ Diff<
289
+ {
290
+ __tag__: 'PATCH',
291
+ __return_type__: Response | void | never | Promise<Response | void | never>
292
+ },
293
+ {
294
+ __tag__: 'PATCH',
295
+ __return_type__: ReturnType<MaybeField<TEntry, 'PATCH'>>
296
+ },
297
+ 'PATCH'
298
+ >
299
+ >()
300
+ }
301
+
302
+ // Check the arguments and return type of the generateStaticParams function
303
+ if ('generateStaticParams' in entry) {
304
+ checkFields<Diff<{ params: PageParams }, FirstArg<MaybeField<TEntry, 'generateStaticParams'>>, 'generateStaticParams'>>()
305
+ checkFields<Diff<{ __tag__: 'generateStaticParams', __return_type__: any[] | Promise<any[]> }, { __tag__: 'generateStaticParams', __return_type__: ReturnType<MaybeField<TEntry, 'generateStaticParams'>> }>>()
306
+ }
307
+
308
+ type PageParams = any
309
+ export interface PageProps {
310
+ params?: any
311
+ searchParams?: any
312
+ }
313
+ export interface LayoutProps {
314
+ children?: React.ReactNode
315
+
316
+ params?: any
317
+ }
318
+
319
+ // =============
320
+ // Utility types
321
+ type RevalidateRange<T> = T extends { revalidate: any } ? NonNegative<T['revalidate']> : never
322
+
323
+ // If T is unknown or any, it will be an empty {} type. Otherwise, it will be the same as Omit<T, keyof Base>.
324
+ type OmitWithTag<T, K extends keyof any, _M> = Omit<T, K>
325
+ type Diff<Base, T extends Base, Message extends string = ''> = 0 extends (1 & T) ? {} : OmitWithTag<T, keyof Base, Message>
326
+
327
+ type FirstArg<T extends Function> = T extends (...args: [infer T, any]) => any ? unknown extends T ? any : T : never
328
+ type SecondArg<T extends Function> = T extends (...args: [any, infer T]) => any ? unknown extends T ? any : T : never
329
+ type MaybeField<T, K extends string> = T extends { [k in K]: infer G } ? G extends Function ? G : never : never
330
+
331
+ type ParamCheck<T> = {
332
+ __tag__: string
333
+ __param_position__: string
334
+ __param_type__: T
335
+ }
336
+
337
+ function checkFields<_ extends { [k in keyof any]: never }>() {}
338
+
339
+ // https://github.com/sindresorhus/type-fest
340
+ type Numeric = number | bigint
341
+ type Zero = 0 | 0n
342
+ type Negative<T extends Numeric> = T extends Zero ? never : `${T}` extends `-${string}` ? T : never
343
+ type NonNegative<T extends Numeric> = T extends Zero ? T : Negative<T> extends never ? T : '__invalid_negative_number__'
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Docs Command
3
+ * Issue #264: Documentation retrieval (RAG-like usage for AI tools)
4
+ *
5
+ * [MF-CONS-001] Uses createDocsCommand() factory + addCommand() pattern,
6
+ * unified with issue command registration style.
7
+ *
8
+ * [SF-003] SRP: This handler only does argument parsing and output formatting.
9
+ * File I/O and search logic are delegated to DocsReader utility (docs-reader.ts).
10
+ *
11
+ * [SF-CONS-005] Uses console.log directly (status command pattern) since this is
12
+ * an output-only command with no server lifecycle management.
13
+ *
14
+ * @module docs-command
15
+ */
16
+ import { Command } from 'commander';
17
+ /**
18
+ * Create the docs command.
19
+ * [MF-CONS-001] Returns a Command instance for program.addCommand().
20
+ */
21
+ export declare function createDocsCommand(): Command;
22
+ //# sourceMappingURL=docs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAwE3C"}
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ /**
3
+ * Docs Command
4
+ * Issue #264: Documentation retrieval (RAG-like usage for AI tools)
5
+ *
6
+ * [MF-CONS-001] Uses createDocsCommand() factory + addCommand() pattern,
7
+ * unified with issue command registration style.
8
+ *
9
+ * [SF-003] SRP: This handler only does argument parsing and output formatting.
10
+ * File I/O and search logic are delegated to DocsReader utility (docs-reader.ts).
11
+ *
12
+ * [SF-CONS-005] Uses console.log directly (status command pattern) since this is
13
+ * an output-only command with no server lifecycle management.
14
+ *
15
+ * @module docs-command
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.createDocsCommand = createDocsCommand;
19
+ const commander_1 = require("commander");
20
+ const types_1 = require("../types");
21
+ const docs_reader_1 = require("../utils/docs-reader");
22
+ /**
23
+ * Create the docs command.
24
+ * [MF-CONS-001] Returns a Command instance for program.addCommand().
25
+ */
26
+ function createDocsCommand() {
27
+ const docsCommand = new commander_1.Command('docs')
28
+ .description('Access CommandMate documentation')
29
+ .option('-s, --section <name>', 'Show specific documentation section')
30
+ .option('-q, --search <query>', 'Search documentation')
31
+ .option('-a, --all', 'Show all available section names')
32
+ .action((options) => {
33
+ if (options.all) {
34
+ const sections = (0, docs_reader_1.getAvailableSections)();
35
+ console.log('Available documentation sections:');
36
+ console.log('');
37
+ sections.forEach(s => console.log(` - ${s}`));
38
+ console.log('');
39
+ console.log('Usage: commandmate docs --section <name>');
40
+ process.exit(types_1.ExitCode.SUCCESS);
41
+ }
42
+ if (options.section) {
43
+ if (!(0, docs_reader_1.isValidSection)(options.section)) {
44
+ console.error(`Unknown section: ${options.section}`);
45
+ console.error('');
46
+ console.error('Available sections:');
47
+ (0, docs_reader_1.getAvailableSections)().forEach(s => console.error(` - ${s}`));
48
+ process.exit(types_1.ExitCode.UNEXPECTED_ERROR);
49
+ }
50
+ try {
51
+ const content = (0, docs_reader_1.readSection)(options.section);
52
+ console.log(content);
53
+ }
54
+ catch (error) {
55
+ console.error(`Error reading section: ${(0, types_1.getErrorMessage)(error)}`);
56
+ process.exit(types_1.ExitCode.UNEXPECTED_ERROR);
57
+ }
58
+ process.exit(types_1.ExitCode.SUCCESS);
59
+ }
60
+ if (options.search) {
61
+ try {
62
+ const results = (0, docs_reader_1.searchDocs)(options.search);
63
+ if (results.length === 0) {
64
+ console.log(`No results found for: "${options.search}"`);
65
+ }
66
+ else {
67
+ console.log(`Search results for: "${options.search}"`);
68
+ console.log('');
69
+ for (const result of results) {
70
+ console.log(`--- ${result.section} ---`);
71
+ result.matches.forEach(match => console.log(` ${match.trim()}`));
72
+ console.log('');
73
+ }
74
+ }
75
+ }
76
+ catch (error) {
77
+ console.error(`Search error: ${(0, types_1.getErrorMessage)(error)}`);
78
+ process.exit(types_1.ExitCode.UNEXPECTED_ERROR);
79
+ }
80
+ process.exit(types_1.ExitCode.SUCCESS);
81
+ }
82
+ // No option specified: show help
83
+ const sections = (0, docs_reader_1.getAvailableSections)();
84
+ console.log('CommandMate Documentation');
85
+ console.log('');
86
+ console.log('Available sections:');
87
+ sections.forEach(s => console.log(` - ${s}`));
88
+ console.log('');
89
+ console.log('Usage:');
90
+ console.log(' commandmate docs --section <name> Show specific section');
91
+ console.log(' commandmate docs --search <query> Search documentation');
92
+ console.log(' commandmate docs --all List all sections');
93
+ process.exit(types_1.ExitCode.SUCCESS);
94
+ });
95
+ return docsCommand;
96
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,WAAW,EAAuB,MAAM,UAAU,CAAC;AA+H5D;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAyIrE"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,WAAW,EAAuB,MAAM,UAAU,CAAC;AAgI5D;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA4IrE"}
@@ -12,6 +12,7 @@ const os_1 = require("os");
12
12
  const types_1 = require("../types");
13
13
  const logger_1 = require("../utils/logger");
14
14
  const preflight_1 = require("../utils/preflight");
15
+ const ai_integration_messages_1 = require("../config/ai-integration-messages");
15
16
  const env_setup_1 = require("../utils/env-setup");
16
17
  const prompt_1 = require("../utils/prompt");
17
18
  const security_logger_1 = require("../utils/security-logger");
@@ -210,6 +211,8 @@ async function initCommand(options) {
210
211
  logger.info(' 1. Run "commandmate start" to start the server');
211
212
  }
212
213
  logger.blank();
214
+ // Issue #264: Display AI tool integration guide
215
+ console.log(ai_integration_messages_1.AI_INTEGRATION_GUIDE);
213
216
  (0, security_logger_1.logSecurityEvent)({
214
217
  timestamp: new Date().toISOString(),
215
218
  command: 'init',
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Issue Command
3
+ * Issue #264: gh CLI integration for issue management
4
+ *
5
+ * [MF-CONS-001] Uses createIssueCommand() factory + addCommand() pattern
6
+ * because subcommands (create/search/list) require nested Command definition,
7
+ * which is not possible with the inline program.command().action() pattern
8
+ * used by init/start/stop/status.
9
+ *
10
+ * Security:
11
+ * - [SEC-MF-001] Input length validation (title: 256, body: 65536)
12
+ * - [SEC-SF-001] Label sanitization (control/zero-width character removal)
13
+ * - Command injection prevention: spawnSync with array args (no shell: true)
14
+ *
15
+ * @module issue-command
16
+ */
17
+ import { Command } from 'commander';
18
+ /**
19
+ * Create the issue command with subcommands.
20
+ * [MF-CONS-001] Returns a Command instance for program.addCommand().
21
+ */
22
+ export declare function createIssueCommand(): Command;
23
+ //# sourceMappingURL=issue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issue.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/issue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0CpC;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAsG5C"}
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ /**
3
+ * Issue Command
4
+ * Issue #264: gh CLI integration for issue management
5
+ *
6
+ * [MF-CONS-001] Uses createIssueCommand() factory + addCommand() pattern
7
+ * because subcommands (create/search/list) require nested Command definition,
8
+ * which is not possible with the inline program.command().action() pattern
9
+ * used by init/start/stop/status.
10
+ *
11
+ * Security:
12
+ * - [SEC-MF-001] Input length validation (title: 256, body: 65536)
13
+ * - [SEC-SF-001] Label sanitization (control/zero-width character removal)
14
+ * - Command injection prevention: spawnSync with array args (no shell: true)
15
+ *
16
+ * @module issue-command
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.createIssueCommand = createIssueCommand;
20
+ const commander_1 = require("commander");
21
+ const child_process_1 = require("child_process");
22
+ const types_1 = require("../types");
23
+ const input_validators_1 = require("../utils/input-validators");
24
+ /**
25
+ * gh CLI template name mapping.
26
+ * Uses front matter `name` values, NOT filenames.
27
+ * UI URLs use `template=bug_report.md` (filename) for web interface.
28
+ */
29
+ const TEMPLATE_MAP = {
30
+ bug: 'Bug Report',
31
+ feature: 'Feature Request',
32
+ question: 'Question',
33
+ };
34
+ /**
35
+ * Check if gh CLI is available.
36
+ */
37
+ function isGhAvailable() {
38
+ const result = (0, child_process_1.spawnSync)('gh', ['--version'], {
39
+ encoding: 'utf-8',
40
+ timeout: 5000,
41
+ });
42
+ return !result.error && result.status === 0;
43
+ }
44
+ /**
45
+ * Guard: exit with DEPENDENCY_ERROR if gh CLI is not installed.
46
+ * [DRY] Extracted from repeated checks in create/search/list subcommands.
47
+ */
48
+ function requireGhCli() {
49
+ if (!isGhAvailable()) {
50
+ console.error('Error: gh CLI is not installed. Install it from https://cli.github.com/');
51
+ process.exit(types_1.ExitCode.DEPENDENCY_ERROR);
52
+ }
53
+ }
54
+ /**
55
+ * Create the issue command with subcommands.
56
+ * [MF-CONS-001] Returns a Command instance for program.addCommand().
57
+ */
58
+ function createIssueCommand() {
59
+ const issueCommand = new commander_1.Command('issue')
60
+ .description('Manage GitHub issues (requires gh CLI)');
61
+ // Subcommand: create
62
+ issueCommand
63
+ .command('create')
64
+ .description('Create a new GitHub issue')
65
+ .option('--bug', 'Use bug report template')
66
+ .option('--feature', 'Use feature request template')
67
+ .option('--question', 'Use question template')
68
+ .option('--title <title>', 'Issue title')
69
+ .option('--body <body>', 'Issue body')
70
+ .option('--labels <labels>', 'Labels (comma-separated)')
71
+ .action((options) => {
72
+ requireGhCli();
73
+ // [SEC-MF-001] Input length validation
74
+ if (options.title) {
75
+ const titleResult = (0, input_validators_1.validateIssueTitle)(options.title);
76
+ if (!titleResult.valid) {
77
+ console.error(`Error: ${titleResult.error}`);
78
+ process.exit(types_1.ExitCode.UNEXPECTED_ERROR);
79
+ }
80
+ }
81
+ if (options.body) {
82
+ const bodyResult = (0, input_validators_1.validateIssueBody)(options.body);
83
+ if (!bodyResult.valid) {
84
+ console.error(`Error: ${bodyResult.error}`);
85
+ process.exit(types_1.ExitCode.UNEXPECTED_ERROR);
86
+ }
87
+ }
88
+ const args = ['issue', 'create'];
89
+ // Template selection
90
+ const templateKey = options.bug ? 'bug' : options.feature ? 'feature' : options.question ? 'question' : null;
91
+ if (templateKey && TEMPLATE_MAP[templateKey]) {
92
+ args.push('--template', TEMPLATE_MAP[templateKey]);
93
+ }
94
+ if (options.title) {
95
+ args.push('--title', options.title);
96
+ }
97
+ if (options.body) {
98
+ args.push('--body', options.body);
99
+ }
100
+ // [SEC-SF-001] Label sanitization
101
+ if (options.labels) {
102
+ const sanitized = options.labels
103
+ .split(',')
104
+ .map(l => (0, input_validators_1.sanitizeLabel)(l))
105
+ .filter(l => l.length > 0)
106
+ .join(',');
107
+ if (sanitized) {
108
+ args.push('--label', sanitized);
109
+ }
110
+ }
111
+ // Execute gh CLI with array args (no shell injection)
112
+ const result = (0, child_process_1.spawnSync)('gh', args, {
113
+ stdio: 'inherit',
114
+ encoding: 'utf-8',
115
+ });
116
+ process.exit(result.status ?? types_1.ExitCode.UNEXPECTED_ERROR);
117
+ });
118
+ // Subcommand: search
119
+ issueCommand
120
+ .command('search <query>')
121
+ .description('Search GitHub issues')
122
+ .action((query) => {
123
+ requireGhCli();
124
+ const result = (0, child_process_1.spawnSync)('gh', ['issue', 'list', '--search', query], {
125
+ stdio: 'inherit',
126
+ encoding: 'utf-8',
127
+ });
128
+ process.exit(result.status ?? types_1.ExitCode.UNEXPECTED_ERROR);
129
+ });
130
+ // Subcommand: list
131
+ issueCommand
132
+ .command('list')
133
+ .description('List GitHub issues')
134
+ .action(() => {
135
+ requireGhCli();
136
+ const result = (0, child_process_1.spawnSync)('gh', ['issue', 'list'], {
137
+ stdio: 'inherit',
138
+ encoding: 'utf-8',
139
+ });
140
+ process.exit(result.status ?? types_1.ExitCode.UNEXPECTED_ERROR);
141
+ });
142
+ return issueCommand;
143
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * AI Integration Guide Messages
3
+ * Issue #264: Display AI tool integration guide after init completion
4
+ */
5
+ export declare const AI_INTEGRATION_GUIDE = "\n\u001B[1m\u2501\u2501\u2501 AI Tool Integration \u2501\u2501\u2501\u001B[0m\nCommandMate commands can be used from Claude Code or Codex:\n\n Issue management:\n commandmate issue create --bug --title \"Title\" --body \"Description\"\n commandmate issue create --feature --title \"Title\" --body \"Description\"\n commandmate issue create --question --title \"Question\" --body \"Details\"\n commandmate issue search \"keyword\"\n commandmate issue list\n\n Documentation (RAG):\n commandmate docs # Show all documentation sections\n commandmate docs --section <name> # Show specific section\n commandmate docs --search <query> # Search documentation\n\n Tip: Add to your CLAUDE.md or system prompt:\n \"Use `commandmate --help` to see available commands.\"\n\u001B[1m\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u001B[0m\n";
6
+ //# sourceMappingURL=ai-integration-messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-integration-messages.d.ts","sourceRoot":"","sources":["../../../src/cli/config/ai-integration-messages.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,oBAAoB,w+BAmBhC,CAAC"}