@kb-labs/commit-cli 0.5.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 (118) hide show
  1. package/README.md +120 -0
  2. package/dist/cli/commands/apply.d.ts +22 -0
  3. package/dist/cli/commands/apply.js +132 -0
  4. package/dist/cli/commands/apply.js.map +1 -0
  5. package/dist/cli/commands/flags.d.ts +99 -0
  6. package/dist/cli/commands/flags.js +73 -0
  7. package/dist/cli/commands/flags.js.map +1 -0
  8. package/dist/cli/commands/generate.d.ts +45 -0
  9. package/dist/cli/commands/generate.js +149 -0
  10. package/dist/cli/commands/generate.js.map +1 -0
  11. package/dist/cli/commands/index.d.ts +1 -0
  12. package/dist/cli/commands/index.js +73 -0
  13. package/dist/cli/commands/index.js.map +1 -0
  14. package/dist/cli/commands/open.d.ts +50 -0
  15. package/dist/cli/commands/open.js +80 -0
  16. package/dist/cli/commands/open.js.map +1 -0
  17. package/dist/cli/commands/push.d.ts +18 -0
  18. package/dist/cli/commands/push.js +71 -0
  19. package/dist/cli/commands/push.js.map +1 -0
  20. package/dist/cli/commands/reset.d.ts +15 -0
  21. package/dist/cli/commands/reset.js +52 -0
  22. package/dist/cli/commands/reset.js.map +1 -0
  23. package/dist/cli/commands/run.d.ts +51 -0
  24. package/dist/cli/commands/run.js +190 -0
  25. package/dist/cli/commands/run.js.map +1 -0
  26. package/dist/index.d.ts +5 -0
  27. package/dist/index.js +916 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/lifecycle/setup.d.ts +53 -0
  30. package/dist/lifecycle/setup.js +96 -0
  31. package/dist/lifecycle/setup.js.map +1 -0
  32. package/dist/manifest.d.ts +207 -0
  33. package/dist/manifest.js +833 -0
  34. package/dist/manifest.js.map +1 -0
  35. package/dist/rest/handlers/actions-handler.d.ts +16 -0
  36. package/dist/rest/handlers/actions-handler.js +15 -0
  37. package/dist/rest/handlers/actions-handler.js.map +1 -0
  38. package/dist/rest/handlers/apply-handler.d.ts +26 -0
  39. package/dist/rest/handlers/apply-handler.js +115 -0
  40. package/dist/rest/handlers/apply-handler.js.map +1 -0
  41. package/dist/rest/handlers/diff-handler.d.ts +20 -0
  42. package/dist/rest/handlers/diff-handler.js +64 -0
  43. package/dist/rest/handlers/diff-handler.js.map +1 -0
  44. package/dist/rest/handlers/files-handler.d.ts +16 -0
  45. package/dist/rest/handlers/files-handler.js +143 -0
  46. package/dist/rest/handlers/files-handler.js.map +1 -0
  47. package/dist/rest/handlers/generate-handler.d.ts +66 -0
  48. package/dist/rest/handlers/generate-handler.js +97 -0
  49. package/dist/rest/handlers/generate-handler.js.map +1 -0
  50. package/dist/rest/handlers/git-status-handler.d.ts +13 -0
  51. package/dist/rest/handlers/git-status-handler.js +58 -0
  52. package/dist/rest/handlers/git-status-handler.js.map +1 -0
  53. package/dist/rest/handlers/patch-plan-handler.d.ts +23 -0
  54. package/dist/rest/handlers/patch-plan-handler.js +50 -0
  55. package/dist/rest/handlers/patch-plan-handler.js.map +1 -0
  56. package/dist/rest/handlers/plan-handler.d.ts +50 -0
  57. package/dist/rest/handlers/plan-handler.js +32 -0
  58. package/dist/rest/handlers/plan-handler.js.map +1 -0
  59. package/dist/rest/handlers/push-handler.d.ts +25 -0
  60. package/dist/rest/handlers/push-handler.js +75 -0
  61. package/dist/rest/handlers/push-handler.js.map +1 -0
  62. package/dist/rest/handlers/regenerate-handler.d.ts +37 -0
  63. package/dist/rest/handlers/regenerate-handler.js +124 -0
  64. package/dist/rest/handlers/regenerate-handler.js.map +1 -0
  65. package/dist/rest/handlers/reset-handler.d.ts +17 -0
  66. package/dist/rest/handlers/reset-handler.js +30 -0
  67. package/dist/rest/handlers/reset-handler.js.map +1 -0
  68. package/dist/rest/handlers/scope-resolver.d.ts +15 -0
  69. package/dist/rest/handlers/scope-resolver.js +12 -0
  70. package/dist/rest/handlers/scope-resolver.js.map +1 -0
  71. package/dist/rest/handlers/scopes-handler.d.ts +12 -0
  72. package/dist/rest/handlers/scopes-handler.js +24 -0
  73. package/dist/rest/handlers/scopes-handler.js.map +1 -0
  74. package/dist/rest/handlers/status-handler.d.ts +27 -0
  75. package/dist/rest/handlers/status-handler.js +91 -0
  76. package/dist/rest/handlers/status-handler.js.map +1 -0
  77. package/dist/rest/handlers/summarize-handler.d.ts +21 -0
  78. package/dist/rest/handlers/summarize-handler.js +106 -0
  79. package/dist/rest/handlers/summarize-handler.js.map +1 -0
  80. package/dist/widgets/220.js +446 -0
  81. package/dist/widgets/220.js.map +1 -0
  82. package/dist/widgets/331.js +2 -0
  83. package/dist/widgets/331.js.map +1 -0
  84. package/dist/widgets/403.js +2 -0
  85. package/dist/widgets/403.js.map +1 -0
  86. package/dist/widgets/406.js +35 -0
  87. package/dist/widgets/406.js.map +1 -0
  88. package/dist/widgets/455.js +2 -0
  89. package/dist/widgets/455.js.map +1 -0
  90. package/dist/widgets/482.js +2 -0
  91. package/dist/widgets/482.js.map +1 -0
  92. package/dist/widgets/485.js +2 -0
  93. package/dist/widgets/485.js.map +1 -0
  94. package/dist/widgets/527.js +2 -0
  95. package/dist/widgets/527.js.map +1 -0
  96. package/dist/widgets/628.js +2 -0
  97. package/dist/widgets/628.js.map +1 -0
  98. package/dist/widgets/694.js +2 -0
  99. package/dist/widgets/694.js.map +1 -0
  100. package/dist/widgets/712.js +2 -0
  101. package/dist/widgets/712.js.map +1 -0
  102. package/dist/widgets/866.js +2 -0
  103. package/dist/widgets/866.js.map +1 -0
  104. package/dist/widgets/915.js +39 -0
  105. package/dist/widgets/915.js.map +1 -0
  106. package/dist/widgets/957.js +10 -0
  107. package/dist/widgets/957.js.map +1 -0
  108. package/dist/widgets/983.js +2 -0
  109. package/dist/widgets/983.js.map +1 -0
  110. package/dist/widgets/@mf-types.d.ts +3 -0
  111. package/dist/widgets/@mf-types.zip +0 -0
  112. package/dist/widgets/__federation_expose_CommitOverview.js +2 -0
  113. package/dist/widgets/__federation_expose_CommitOverview.js.map +1 -0
  114. package/dist/widgets/mf-manifest.json +260 -0
  115. package/dist/widgets/mf-stats.json +302 -0
  116. package/dist/widgets/remoteEntry.js +7 -0
  117. package/dist/widgets/remoteEntry.js.map +1 -0
  118. package/package.json +95 -0
@@ -0,0 +1,833 @@
1
+ import { combinePermissions, gitWorkflowPreset, kbPlatformPreset, defineCommandFlags } from '@kb-labs/sdk';
2
+ import { COMMIT_ENV_VARS, COMMIT_CACHE_PREFIX, COMMIT_ROUTES, COMMIT_BASE_PATH } from '@kb-labs/commit-contracts';
3
+
4
+ // src/manifest.ts
5
+
6
+ // src/cli/commands/flags.ts
7
+ var generateFlags = {
8
+ scope: {
9
+ type: "string",
10
+ description: "Filter by package name (@kb-labs/core), wildcard (@kb-labs/*), or path pattern (packages/**)",
11
+ alias: "s"
12
+ },
13
+ json: {
14
+ type: "boolean",
15
+ description: "Output JSON",
16
+ default: false
17
+ }
18
+ };
19
+ var applyFlags = {
20
+ force: {
21
+ type: "boolean",
22
+ description: "Apply even if working tree changed",
23
+ default: false,
24
+ alias: "f"
25
+ },
26
+ json: {
27
+ type: "boolean",
28
+ description: "Output JSON",
29
+ default: false
30
+ }
31
+ };
32
+ var pushFlags = {
33
+ force: {
34
+ type: "boolean",
35
+ description: "Force push (dangerous!)",
36
+ default: false,
37
+ alias: "f"
38
+ },
39
+ json: {
40
+ type: "boolean",
41
+ description: "Output JSON",
42
+ default: false
43
+ }
44
+ };
45
+ var runFlags = {
46
+ scope: {
47
+ type: "string",
48
+ description: "Filter by package name (@kb-labs/core), wildcard (@kb-labs/*), or path pattern (packages/**)",
49
+ alias: "s"
50
+ },
51
+ json: {
52
+ type: "boolean",
53
+ description: "Output JSON",
54
+ default: false
55
+ },
56
+ "dry-run": {
57
+ type: "boolean",
58
+ description: "Generate plan only, do not apply",
59
+ default: false
60
+ },
61
+ "with-push": {
62
+ type: "boolean",
63
+ description: "Push after apply",
64
+ default: false
65
+ }
66
+ };
67
+ var jsonOnlyFlags = {
68
+ json: {
69
+ type: "boolean",
70
+ description: "Output JSON",
71
+ default: false
72
+ }
73
+ };
74
+ var emptyFlags = {};
75
+
76
+ // src/manifest.ts
77
+ var pluginPermissions = combinePermissions().with(gitWorkflowPreset).with(kbPlatformPreset).withEnv([...COMMIT_ENV_VARS]).withFs({
78
+ mode: "readWrite",
79
+ allow: [".kb/commit/**"]
80
+ }).withPlatform({
81
+ llm: true,
82
+ // Full LLM access for commit generation
83
+ cache: [COMMIT_CACHE_PREFIX],
84
+ // Cache namespace prefix from contracts
85
+ analytics: true
86
+ // Track commit generation events
87
+ }).withQuotas({
88
+ timeoutMs: 6e5,
89
+ // 10 min for LLM
90
+ memoryMb: 512
91
+ }).build();
92
+ var manifest = {
93
+ schema: "kb.plugin/3",
94
+ id: "@kb-labs/commit",
95
+ version: "0.1.0",
96
+ configSection: "commit",
97
+ display: {
98
+ name: "Commit Generator",
99
+ description: "AI-powered commit generation with conventional commit support.",
100
+ tags: ["commit", "git", "ai", "conventional-commits"]
101
+ },
102
+ // Platform requirements (LLM is optional but preferred)
103
+ platform: {
104
+ requires: ["storage", "cache"],
105
+ optional: ["llm", "analytics", "logger"]
106
+ },
107
+ // TODO: Implement V3 setup handler
108
+ // Setup temporarily disabled during migration - needs proper V3 implementation
109
+ // setup: {
110
+ // handler: './lifecycle/setup.js#default',
111
+ // handlerPath: './lifecycle/setup.js',
112
+ // describe: 'Initialize .kb/commit/ directory structure.',
113
+ // permissions: permissions.combine(
114
+ // permissions.presets.pluginWorkspace('commit'),
115
+ // {
116
+ // quotas: { timeoutMs: 10000, memoryMb: 128, cpuMs: 3000 },
117
+ // }
118
+ // ),
119
+ // },
120
+ // V3: cli wrapper with commands array
121
+ cli: {
122
+ commands: [
123
+ // Main command: commit (default flow)
124
+ {
125
+ id: "commit:commit",
126
+ // ✅ With plugin prefix
127
+ group: "commit",
128
+ describe: "Generate and apply commits (default flow).",
129
+ longDescription: "Analyzes changes, generates commit plan with LLM, applies commits locally. Use --dry-run to preview without applying, --with-push to push after applying.",
130
+ // ✅ V3: handler with #default suffix
131
+ handler: "./cli/commands/run.js#default",
132
+ handlerPath: "./cli/commands/run.js",
133
+ flags: defineCommandFlags(runFlags),
134
+ examples: [
135
+ "kb commit commit",
136
+ "kb commit commit --dry-run",
137
+ "kb commit commit --with-push",
138
+ 'kb commit commit --scope "src/components/**"'
139
+ ]
140
+ },
141
+ // commit:generate - Generate commit plan
142
+ {
143
+ id: "commit:generate",
144
+ group: "commit",
145
+ describe: "Generate commit plan from git changes.",
146
+ longDescription: "Analyzes staged and unstaged changes using git diff, then uses LLM to group related changes and generate conventional commit messages.",
147
+ handler: "./cli/commands/generate.js#default",
148
+ handlerPath: "./cli/commands/generate.js",
149
+ flags: defineCommandFlags(generateFlags),
150
+ examples: [
151
+ "kb commit generate",
152
+ "kb commit generate --json",
153
+ 'kb commit generate --scope "packages/**"'
154
+ ]
155
+ },
156
+ // commit:apply - Apply commit plan
157
+ {
158
+ id: "commit:apply",
159
+ group: "commit",
160
+ describe: "Apply current commit plan (create local commits).",
161
+ longDescription: "Creates git commits according to the current plan. Checks for staleness (working tree changes since plan generation) unless --force is used.",
162
+ handler: "./cli/commands/apply.js#default",
163
+ handlerPath: "./cli/commands/apply.js",
164
+ flags: defineCommandFlags(applyFlags),
165
+ examples: [
166
+ "kb commit apply",
167
+ "kb commit apply --force"
168
+ ]
169
+ },
170
+ // commit:push - Push commits
171
+ {
172
+ id: "commit:push",
173
+ group: "commit",
174
+ describe: "Push commits to remote repository.",
175
+ longDescription: "Pushes local commits to the remote. Refuses force push to protected branches (main, master) by default.",
176
+ handler: "./cli/commands/push.js#default",
177
+ handlerPath: "./cli/commands/push.js",
178
+ flags: defineCommandFlags(pushFlags),
179
+ examples: [
180
+ "kb commit push"
181
+ ]
182
+ },
183
+ // commit:open - Show current plan
184
+ {
185
+ id: "commit:open",
186
+ group: "commit",
187
+ describe: "Show current commit plan.",
188
+ longDescription: "Displays the current commit plan if one exists.",
189
+ handler: "./cli/commands/open.js#default",
190
+ handlerPath: "./cli/commands/open.js",
191
+ flags: defineCommandFlags(jsonOnlyFlags),
192
+ examples: [
193
+ "kb commit open",
194
+ "kb commit open --json"
195
+ ]
196
+ },
197
+ // commit:reset - Clear current plan
198
+ {
199
+ id: "commit:reset",
200
+ group: "commit",
201
+ describe: "Clear current commit plan.",
202
+ longDescription: "Removes the current commit plan from storage.",
203
+ handler: "./cli/commands/reset.js#default",
204
+ handlerPath: "./cli/commands/reset.js",
205
+ flags: defineCommandFlags(emptyFlags),
206
+ examples: [
207
+ "kb commit reset"
208
+ ]
209
+ }
210
+ ]
211
+ },
212
+ capabilities: [],
213
+ // ✅ V3: Manifest-first permissions using composable presets
214
+ permissions: pluginPermissions,
215
+ // REST API routes (inherit permissions from manifest)
216
+ rest: {
217
+ basePath: COMMIT_BASE_PATH,
218
+ routes: [
219
+ // GET /scopes
220
+ {
221
+ method: "GET",
222
+ path: COMMIT_ROUTES.SCOPES,
223
+ handler: "./rest/handlers/scopes-handler.js#default",
224
+ output: {
225
+ zod: "@kb-labs/sdk#SelectDataSchema"
226
+ }
227
+ },
228
+ // GET /status
229
+ {
230
+ method: "GET",
231
+ path: COMMIT_ROUTES.STATUS,
232
+ handler: "./rest/handlers/status-handler.js#default",
233
+ output: {
234
+ zod: "@kb-labs/commit-contracts#StatusResponseSchema"
235
+ }
236
+ },
237
+ // POST /generate
238
+ {
239
+ method: "POST",
240
+ path: COMMIT_ROUTES.GENERATE,
241
+ handler: "./rest/handlers/generate-handler.js#default",
242
+ input: {
243
+ zod: "@kb-labs/commit-contracts#GenerateRequestSchema"
244
+ },
245
+ output: {
246
+ zod: "@kb-labs/commit-contracts#GenerateResponseSchema"
247
+ },
248
+ timeoutMs: 3e5
249
+ // 5 minutes for LLM analysis
250
+ },
251
+ // GET /plan
252
+ {
253
+ method: "GET",
254
+ path: COMMIT_ROUTES.PLAN,
255
+ handler: "./rest/handlers/plan-handler.js#default",
256
+ output: {
257
+ zod: "@kb-labs/commit-contracts#PlanResponseSchema"
258
+ }
259
+ },
260
+ // POST /apply
261
+ {
262
+ method: "POST",
263
+ path: COMMIT_ROUTES.APPLY,
264
+ handler: "./rest/handlers/apply-handler.js#default",
265
+ input: {
266
+ zod: "@kb-labs/commit-contracts#ApplyRequestSchema"
267
+ },
268
+ output: {
269
+ zod: "@kb-labs/commit-contracts#ApplyResponseSchema"
270
+ },
271
+ timeoutMs: 6e5
272
+ // 10 min for pre/post hooks
273
+ },
274
+ // POST /push
275
+ {
276
+ method: "POST",
277
+ path: COMMIT_ROUTES.PUSH,
278
+ handler: "./rest/handlers/push-handler.js#default",
279
+ input: {
280
+ zod: "@kb-labs/commit-contracts#PushRequestSchema"
281
+ },
282
+ output: {
283
+ zod: "@kb-labs/commit-contracts#PushResponseSchema"
284
+ },
285
+ timeoutMs: 6e5
286
+ // 10 min for pre/post push hooks
287
+ },
288
+ // DELETE /plan
289
+ {
290
+ method: "DELETE",
291
+ path: COMMIT_ROUTES.RESET,
292
+ handler: "./rest/handlers/reset-handler.js#default",
293
+ output: {
294
+ zod: "@kb-labs/commit-contracts#ResetResponseSchema"
295
+ }
296
+ },
297
+ // GET /git-status
298
+ {
299
+ method: "GET",
300
+ path: COMMIT_ROUTES.GIT_STATUS,
301
+ handler: "./rest/handlers/git-status-handler.js#default",
302
+ output: {
303
+ zod: "@kb-labs/commit-contracts#GitStatusResponseSchema"
304
+ }
305
+ },
306
+ // GET /files
307
+ {
308
+ method: "GET",
309
+ path: COMMIT_ROUTES.FILES,
310
+ handler: "./rest/handlers/files-handler.js#default"
311
+ },
312
+ // GET /diff
313
+ {
314
+ method: "GET",
315
+ path: COMMIT_ROUTES.DIFF,
316
+ handler: "./rest/handlers/diff-handler.js#default",
317
+ output: {
318
+ zod: "@kb-labs/commit-contracts#FileDiffResponseSchema"
319
+ }
320
+ },
321
+ // POST /summarize
322
+ {
323
+ method: "POST",
324
+ path: COMMIT_ROUTES.SUMMARIZE,
325
+ handler: "./rest/handlers/summarize-handler.js#default",
326
+ input: {
327
+ zod: "@kb-labs/commit-contracts#SummarizeRequestSchema"
328
+ },
329
+ output: {
330
+ zod: "@kb-labs/commit-contracts#SummarizeResponseSchema"
331
+ }
332
+ },
333
+ // GET /actions
334
+ {
335
+ method: "GET",
336
+ path: COMMIT_ROUTES.ACTIONS,
337
+ handler: "./rest/handlers/actions-handler.js#default",
338
+ output: {
339
+ zod: "@kb-labs/commit-contracts#ActionsResponseSchema"
340
+ }
341
+ },
342
+ // PATCH /plan — edit a single commit in the plan
343
+ {
344
+ method: "PATCH",
345
+ path: COMMIT_ROUTES.PATCH_PLAN,
346
+ handler: "./rest/handlers/patch-plan-handler.js#default",
347
+ input: {
348
+ zod: "@kb-labs/commit-contracts#PatchPlanRequestSchema"
349
+ },
350
+ output: {
351
+ zod: "@kb-labs/commit-contracts#PatchPlanResponseSchema"
352
+ }
353
+ },
354
+ // POST /regenerate-commit — regenerate a single commit with LLM
355
+ {
356
+ method: "POST",
357
+ path: COMMIT_ROUTES.REGENERATE_COMMIT,
358
+ handler: "./rest/handlers/regenerate-handler.js#default",
359
+ input: {
360
+ zod: "@kb-labs/commit-contracts#RegenerateCommitRequestSchema"
361
+ },
362
+ output: {
363
+ zod: "@kb-labs/commit-contracts#RegenerateCommitResponseSchema"
364
+ },
365
+ timeoutMs: 3e5
366
+ // 5 minutes for LLM analysis
367
+ }
368
+ ]
369
+ },
370
+ // Studio V2 — Module Federation pages
371
+ studio: {
372
+ version: 2,
373
+ remoteName: "commitPlugin",
374
+ pages: [
375
+ {
376
+ id: "commit.overview",
377
+ title: "Commit",
378
+ icon: "GitlabOutlined",
379
+ route: "/p/commit",
380
+ entry: "./CommitOverview",
381
+ order: 1
382
+ }
383
+ ],
384
+ menus: [
385
+ {
386
+ id: "commit",
387
+ label: "Commit",
388
+ icon: "GitlabOutlined",
389
+ target: "commit.overview",
390
+ order: 30
391
+ }
392
+ ]
393
+ },
394
+ // Legacy V1 studio widgets (deleted)
395
+ /*
396
+ _legacy_studio: {
397
+ widgets: [
398
+ // Workspace Selector
399
+ {
400
+ id: 'commit.workspace-selector',
401
+ kind: 'select',
402
+ title: 'Select Scope',
403
+ description: 'Choose monorepo package or repository',
404
+ data: {
405
+ source: {
406
+ type: 'rest',
407
+ routeId: COMMIT_WIDGET_ROUTES.SCOPES,
408
+ method: 'GET',
409
+ },
410
+ },
411
+ options: {
412
+ searchable: true,
413
+ placeholder: 'Select scope...',
414
+ },
415
+ events: {
416
+ emit: [{
417
+ name: COMMIT_EVENTS.SCOPE_CHANGED,
418
+ payloadMap: { scope: 'value' }, // Maps selected value to payload.scope
419
+ }],
420
+ },
421
+ layoutHint: { w: 6, h: 1, minH: 1 },
422
+ order: 0,
423
+ },
424
+ // Status Metrics
425
+ {
426
+ id: 'commit.status',
427
+ kind: 'metric-group',
428
+ title: 'Commit Status',
429
+ description: 'Current plan and git status',
430
+ data: {
431
+ source: {
432
+ type: 'rest',
433
+ routeId: COMMIT_WIDGET_ROUTES.STATUS,
434
+ method: 'GET',
435
+ },
436
+ },
437
+ events: {
438
+ subscribe: [
439
+ {
440
+ name: COMMIT_EVENTS.SCOPE_CHANGED,
441
+ paramsMap: { scope: 'scope' }, // Maps payload.workspace to params.workspace
442
+ },
443
+ COMMIT_EVENTS.FORM_SUBMITTED,
444
+ ],
445
+ },
446
+ layoutHint: { w: 6, h: 2, minH: 2 },
447
+ order: 1,
448
+ },
449
+ // Plan Viewer (child of commit.plan-section)
450
+ {
451
+ id: 'commit.plan-viewer',
452
+ kind: 'cardlist',
453
+ title: '', // Title shown in parent section
454
+ description: '',
455
+ data: {
456
+ source: {
457
+ type: 'rest',
458
+ routeId: COMMIT_WIDGET_ROUTES.PLAN,
459
+ method: 'GET',
460
+ },
461
+ },
462
+ options: {
463
+ layout: 'list',
464
+ emptyMessage: 'No plan. Click Generate Plan to create commits.',
465
+ },
466
+ events: {
467
+ subscribe: [
468
+ {
469
+ name: COMMIT_EVENTS.SCOPE_CHANGED,
470
+ paramsMap: { scope: 'scope' },
471
+ },
472
+ {
473
+ name: COMMIT_EVENTS.PLAN_GENERATED,
474
+ // When plan is generated, update widget data with cards
475
+ // No paramsMap - use entire payload as widget data
476
+ },
477
+ COMMIT_EVENTS.FORM_SUBMITTED,
478
+ ],
479
+ },
480
+ order: 2,
481
+ },
482
+ // Git Files Table (child of commit.files-section)
483
+ {
484
+ id: 'commit.git-files',
485
+ kind: 'table',
486
+ title: '', // Title shown in parent section
487
+ description: '',
488
+ data: {
489
+ source: {
490
+ type: 'rest',
491
+ routeId: COMMIT_WIDGET_ROUTES.FILES,
492
+ method: 'GET',
493
+ },
494
+ },
495
+ options: {
496
+ columns: [
497
+ {
498
+ id: 'path',
499
+ label: 'File',
500
+ sortable: true,
501
+ width: '60%',
502
+ },
503
+ {
504
+ id: 'status',
505
+ label: 'Status',
506
+ sortable: true,
507
+ width: 80,
508
+ },
509
+ {
510
+ id: 'changes',
511
+ label: 'Changes',
512
+ sortable: false,
513
+ width: 120,
514
+ },
515
+ ],
516
+ pagination: false,
517
+ rowSelection: false,
518
+ size: 'small',
519
+ },
520
+ events: {
521
+ subscribe: [{
522
+ name: COMMIT_EVENTS.SCOPE_CHANGED,
523
+ paramsMap: { scope: 'scope' },
524
+ }],
525
+ },
526
+ order: 3,
527
+ },
528
+ // Quick Actions Widget
529
+ {
530
+ id: 'commit.actions',
531
+ kind: 'card',
532
+ title: 'Quick Actions',
533
+ description: 'Common commit workflow actions',
534
+ data: {
535
+ source: {
536
+ type: 'rest',
537
+ routeId: COMMIT_WIDGET_ROUTES.ACTIONS,
538
+ method: 'GET',
539
+ },
540
+ },
541
+ events: {
542
+ subscribe: [{
543
+ name: COMMIT_EVENTS.SCOPE_CHANGED,
544
+ paramsMap: { scope: 'scope' },
545
+ }],
546
+ },
547
+ actions: [
548
+ {
549
+ id: 'generate',
550
+ label: 'Generate Plan',
551
+ icon: 'ThunderboltOutlined',
552
+ variant: 'primary',
553
+ handler: {
554
+ type: 'rest',
555
+ routeId: COMMIT_WIDGET_ROUTES.GENERATE,
556
+ method: 'POST',
557
+ bodyMap: { scope: 'scope' },
558
+ onSuccess: {
559
+ emitEvent: COMMIT_EVENTS.PLAN_GENERATED,
560
+ // Response data will be used as payload (contains plan + workspace)
561
+ },
562
+ },
563
+ },
564
+ {
565
+ id: 'apply',
566
+ label: 'Apply Commits',
567
+ icon: 'CheckOutlined',
568
+ variant: 'default',
569
+ handler: {
570
+ type: 'rest',
571
+ routeId: COMMIT_WIDGET_ROUTES.APPLY,
572
+ method: 'POST',
573
+ bodyMap: { scope: 'scope' },
574
+ },
575
+ confirm: {
576
+ title: 'Apply Commits',
577
+ description: 'This will create git commits according to the plan. Continue?',
578
+ confirmLabel: 'Apply',
579
+ cancelLabel: 'Cancel',
580
+ },
581
+ },
582
+ {
583
+ id: 'push',
584
+ label: 'Push',
585
+ icon: 'UploadOutlined',
586
+ handler: {
587
+ type: 'rest',
588
+ routeId: COMMIT_WIDGET_ROUTES.PUSH,
589
+ method: 'POST',
590
+ bodyMap: { scope: 'scope' },
591
+ },
592
+ confirm: {
593
+ title: 'Push to Remote',
594
+ description: 'This will push commits to the remote repository. Continue?',
595
+ confirmLabel: 'Push',
596
+ cancelLabel: 'Cancel',
597
+ },
598
+ },
599
+ ],
600
+ layoutHint: { w: 6, h: 3, minH: 2 },
601
+ order: 6,
602
+ },
603
+ // Files Section (collapsible, GitLab-style)
604
+ {
605
+ id: 'commit.files-section',
606
+ kind: 'section',
607
+ title: 'Changed Files',
608
+ description: 'Files with uncommitted changes',
609
+ data: {
610
+ source: { type: 'static' }, // Sections use static source (no data)
611
+ },
612
+ options: {
613
+ collapsible: true,
614
+ defaultExpanded: true,
615
+ variant: 'bordered',
616
+ icon: 'FolderOutlined',
617
+ showDivider: true,
618
+ },
619
+ children: ['commit.git-files'],
620
+ events: {
621
+ subscribe: [{
622
+ name: COMMIT_EVENTS.SCOPE_CHANGED,
623
+ paramsMap: { scope: 'scope' },
624
+ }],
625
+ },
626
+ layoutHint: { w: 6, h: 8, minH: 4 },
627
+ order: 4,
628
+ },
629
+ // Plan Section (collapsible, GitLab-style)
630
+ {
631
+ id: 'commit.plan-section',
632
+ kind: 'section',
633
+ title: 'Commit Plan',
634
+ description: 'Generated commits ready to apply',
635
+ data: {
636
+ source: { type: 'static' }, // Sections use static source (no data)
637
+ },
638
+ options: {
639
+ collapsible: true,
640
+ defaultExpanded: true,
641
+ variant: 'bordered',
642
+ icon: 'FileTextOutlined',
643
+ showDivider: true,
644
+ },
645
+ children: ['commit.plan-viewer'],
646
+ events: {
647
+ subscribe: [
648
+ {
649
+ name: COMMIT_EVENTS.SCOPE_CHANGED,
650
+ paramsMap: { scope: 'scope' },
651
+ },
652
+ COMMIT_EVENTS.FORM_SUBMITTED,
653
+ ],
654
+ },
655
+ layoutHint: { w: 6, h: 8, minH: 4 },
656
+ order: 5,
657
+ },
658
+ ],
659
+ // Studio menus
660
+ menus: [
661
+ {
662
+ id: 'commit-menu',
663
+ label: 'Commit',
664
+ icon: 'GitlabOutlined',
665
+ target: '/plugins/commit/overview',
666
+ order: 0,
667
+ },
668
+ {
669
+ id: 'commit-overview',
670
+ label: 'Overview',
671
+ icon: 'DashboardOutlined',
672
+ parentId: 'commit-menu',
673
+ target: '/plugins/commit/overview',
674
+ order: 1,
675
+ },
676
+ {
677
+ id: 'commit-plan',
678
+ label: 'Plan',
679
+ icon: 'UnorderedListOutlined',
680
+ parentId: 'commit-menu',
681
+ target: '/plugins/commit/plan',
682
+ order: 2,
683
+ },
684
+ {
685
+ id: 'commit-files',
686
+ label: 'Files',
687
+ icon: 'FileTextOutlined',
688
+ parentId: 'commit-menu',
689
+ target: '/plugins/commit/files',
690
+ order: 3,
691
+ },
692
+ ],
693
+ // Studio layouts
694
+ layouts: [
695
+ // Overview page - Quick status and actions
696
+ {
697
+ id: 'commit.overview',
698
+ kind: 'grid',
699
+ title: 'Overview',
700
+ description: 'Workspace status and quick actions',
701
+ icon: 'home',
702
+ widgets: [
703
+ 'commit.workspace-selector',
704
+ 'commit.status',
705
+ 'commit.actions',
706
+ 'commit.plan-section', // Show plan section on overview too
707
+ ],
708
+ config: {
709
+ cols: 6,
710
+ gap: 16,
711
+ },
712
+ order: 1,
713
+ },
714
+ // Plan page - GitLab-style commit plan view
715
+ {
716
+ id: 'commit.plan',
717
+ kind: 'grid',
718
+ title: 'Commit Plan',
719
+ description: 'Review and manage generated commits',
720
+ icon: 'list',
721
+ widgets: [
722
+ 'commit.workspace-selector',
723
+ 'commit.files-section',
724
+ 'commit.plan-section',
725
+ ],
726
+ actions: [
727
+ {
728
+ id: 'generate',
729
+ label: 'Generate Plan',
730
+ icon: 'ThunderboltOutlined',
731
+ variant: 'primary',
732
+ handler: {
733
+ type: 'rest',
734
+ routeId: COMMIT_WIDGET_ROUTES.GENERATE,
735
+ method: 'POST',
736
+ },
737
+ },
738
+ {
739
+ id: 'apply',
740
+ label: 'Apply Commits',
741
+ icon: 'CheckOutlined',
742
+ variant: 'default',
743
+ handler: {
744
+ type: 'rest',
745
+ routeId: COMMIT_WIDGET_ROUTES.APPLY,
746
+ method: 'POST',
747
+ },
748
+ confirm: {
749
+ title: 'Apply Commits',
750
+ description: 'This will create git commits according to the plan. Continue?',
751
+ confirmLabel: 'Apply',
752
+ cancelLabel: 'Cancel',
753
+ },
754
+ },
755
+ {
756
+ id: 'push',
757
+ label: 'Push',
758
+ icon: 'UploadOutlined',
759
+ handler: {
760
+ type: 'rest',
761
+ routeId: COMMIT_WIDGET_ROUTES.PUSH,
762
+ method: 'POST',
763
+ },
764
+ confirm: {
765
+ title: 'Push to Remote',
766
+ description: 'This will push commits to the remote repository. Continue?',
767
+ confirmLabel: 'Push',
768
+ cancelLabel: 'Cancel',
769
+ },
770
+ },
771
+ {
772
+ id: 'reset',
773
+ label: 'Reset Plan',
774
+ icon: 'DeleteOutlined',
775
+ variant: 'danger',
776
+ handler: {
777
+ type: 'rest',
778
+ routeId: COMMIT_WIDGET_ROUTES.RESET,
779
+ method: 'DELETE',
780
+ },
781
+ confirm: {
782
+ title: 'Reset Plan',
783
+ description: 'This will delete the current commit plan. This action cannot be undone.',
784
+ confirmLabel: 'Delete',
785
+ cancelLabel: 'Cancel',
786
+ },
787
+ },
788
+ ],
789
+ config: {
790
+ cols: 6,
791
+ gap: 16,
792
+ },
793
+ order: 2,
794
+ },
795
+ // Files page - Changed files table
796
+ {
797
+ id: 'commit.files',
798
+ kind: 'grid',
799
+ title: 'Changed Files',
800
+ description: 'Git status and modified files',
801
+ icon: 'file',
802
+ widgets: [
803
+ 'commit.workspace-selector',
804
+ 'commit.git-files',
805
+ ],
806
+ config: {
807
+ cols: 6,
808
+ gap: 16,
809
+ },
810
+ order: 3,
811
+ },
812
+ ],
813
+ },
814
+ */
815
+ // Artifacts
816
+ artifacts: [
817
+ {
818
+ id: "commit.plan.json",
819
+ pathTemplate: ".kb/commit/current/plan.json",
820
+ description: "Current commit plan."
821
+ },
822
+ {
823
+ id: "commit.status.json",
824
+ pathTemplate: ".kb/commit/current/status.json",
825
+ description: "Git status snapshot at plan generation time."
826
+ }
827
+ ]
828
+ };
829
+ var manifest_default = manifest;
830
+
831
+ export { manifest_default as default, manifest };
832
+ //# sourceMappingURL=manifest.js.map
833
+ //# sourceMappingURL=manifest.js.map