@starlein/paperclip-plugin-company-wizard 0.2.4 → 0.3.15

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 (56) hide show
  1. package/README.md +60 -3
  2. package/dist/manifest.js +4 -5
  3. package/dist/manifest.js.map +2 -2
  4. package/dist/ui/index.css +563 -578
  5. package/dist/ui/index.css.map +2 -2
  6. package/dist/ui/index.js +1143 -559
  7. package/dist/ui/index.js.map +4 -4
  8. package/dist/worker.js +679 -253
  9. package/dist/worker.js.map +4 -4
  10. package/package.json +12 -7
  11. package/templates/ai-wizard/config-format.md +12 -4
  12. package/templates/ai-wizard/interview-system.md +3 -2
  13. package/templates/ai-wizard/messages.json +1 -1
  14. package/templates/ai-wizard/single-shot-system.md +4 -0
  15. package/templates/bootstrap-instructions.md +12 -2
  16. package/templates/modules/auto-assign/agents/ceo/heartbeat-section.md +1 -1
  17. package/templates/modules/auto-assign/agents/ceo/skills/auto-assign.fallback.md +1 -1
  18. package/templates/modules/auto-assign/agents/product-owner/heartbeat-section.md +1 -1
  19. package/templates/modules/auto-assign/module.meta.json +1 -1
  20. package/templates/modules/auto-assign/skills/auto-assign.md +1 -1
  21. package/templates/modules/backlog/module.meta.json +4 -3
  22. package/templates/modules/build-api/module.meta.json +1 -0
  23. package/templates/modules/ci-cd/module.meta.json +2 -1
  24. package/templates/modules/game-design/module.meta.json +18 -0
  25. package/templates/modules/game-design/skills/audio-design.fallback.md +16 -0
  26. package/templates/modules/game-design/skills/audio-design.md +28 -0
  27. package/templates/modules/game-design/skills/level-design.fallback.md +17 -0
  28. package/templates/modules/game-design/skills/level-design.md +29 -0
  29. package/templates/modules/github-repo/README.md +1 -0
  30. package/templates/modules/github-repo/module.meta.json +4 -1
  31. package/templates/modules/pr-review/README.md +5 -5
  32. package/templates/modules/pr-review/agents/code-reviewer/skills/code-review.md +7 -6
  33. package/templates/modules/pr-review/agents/devops/skills/infra-review.md +6 -6
  34. package/templates/modules/pr-review/agents/engineer/skills/pr-workflow.md +11 -6
  35. package/templates/modules/pr-review/agents/product-owner/skills/product-review.md +7 -6
  36. package/templates/modules/pr-review/agents/qa/skills/qa-review.md +6 -6
  37. package/templates/modules/pr-review/agents/ui-designer/skills/design-review.md +6 -6
  38. package/templates/modules/pr-review/agents/ux-researcher/skills/ux-review.md +6 -6
  39. package/templates/modules/pr-review/docs/pr-conventions.md +16 -15
  40. package/templates/modules/pr-review/module.meta.json +8 -3
  41. package/templates/modules/stall-detection/module.meta.json +1 -1
  42. package/templates/modules/website-relaunch/module.meta.json +2 -1
  43. package/templates/presets/build-game/preset.meta.json +2 -1
  44. package/templates/presets/content/preset.meta.json +3 -1
  45. package/templates/presets/full/preset.meta.json +1 -0
  46. package/templates/presets/gtm/preset.meta.json +3 -1
  47. package/templates/presets/launch-pack/preset.meta.json +1 -0
  48. package/templates/presets/quality/preset.meta.json +2 -1
  49. package/templates/presets/repo-maintenance/preset.meta.json +2 -1
  50. package/templates/presets/secure/preset.meta.json +1 -0
  51. package/templates/roles/security-engineer/role.meta.json +1 -1
  52. package/templates/roles/cfo/AGENTS.md +0 -31
  53. package/templates/roles/cfo/HEARTBEAT.md +0 -37
  54. package/templates/roles/cfo/SOUL.md +0 -17
  55. package/templates/roles/cfo/TOOLS.md +0 -3
  56. package/templates/roles/cfo/role.meta.json +0 -17
package/dist/ui/index.js CHANGED
@@ -187,8 +187,16 @@ var __iconNode10 = [
187
187
  ];
188
188
  var CircleCheck = createLucideIcon("circle-check", __iconNode10);
189
189
 
190
- // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/clipboard-check.js
190
+ // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/circle-plus.js
191
191
  var __iconNode11 = [
192
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
193
+ ["path", { d: "M8 12h8", key: "1wcyev" }],
194
+ ["path", { d: "M12 8v8", key: "napkw2" }]
195
+ ];
196
+ var CirclePlus = createLucideIcon("circle-plus", __iconNode11);
197
+
198
+ // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/clipboard-check.js
199
+ var __iconNode12 = [
192
200
  ["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
193
201
  [
194
202
  "path",
@@ -199,10 +207,10 @@ var __iconNode11 = [
199
207
  ],
200
208
  ["path", { d: "m9 14 2 2 4-4", key: "df797q" }]
201
209
  ];
202
- var ClipboardCheck = createLucideIcon("clipboard-check", __iconNode11);
210
+ var ClipboardCheck = createLucideIcon("clipboard-check", __iconNode12);
203
211
 
204
212
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/cpu.js
205
- var __iconNode12 = [
213
+ var __iconNode13 = [
206
214
  ["path", { d: "M12 20v2", key: "1lh1kg" }],
207
215
  ["path", { d: "M12 2v2", key: "tus03m" }],
208
216
  ["path", { d: "M17 20v2", key: "1rnc9c" }],
@@ -218,10 +226,10 @@ var __iconNode12 = [
218
226
  ["rect", { x: "4", y: "4", width: "16", height: "16", rx: "2", key: "1vbyd7" }],
219
227
  ["rect", { x: "8", y: "8", width: "8", height: "8", rx: "1", key: "z9xiuo" }]
220
228
  ];
221
- var Cpu = createLucideIcon("cpu", __iconNode12);
229
+ var Cpu = createLucideIcon("cpu", __iconNode13);
222
230
 
223
231
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/crown.js
224
- var __iconNode13 = [
232
+ var __iconNode14 = [
225
233
  [
226
234
  "path",
227
235
  {
@@ -231,18 +239,18 @@ var __iconNode13 = [
231
239
  ],
232
240
  ["path", { d: "M5 21h14", key: "11awu3" }]
233
241
  ];
234
- var Crown = createLucideIcon("crown", __iconNode13);
242
+ var Crown = createLucideIcon("crown", __iconNode14);
235
243
 
236
244
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/external-link.js
237
- var __iconNode14 = [
245
+ var __iconNode15 = [
238
246
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
239
247
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
240
248
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
241
249
  ];
242
- var ExternalLink = createLucideIcon("external-link", __iconNode14);
250
+ var ExternalLink = createLucideIcon("external-link", __iconNode15);
243
251
 
244
252
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/file-text.js
245
- var __iconNode15 = [
253
+ var __iconNode16 = [
246
254
  [
247
255
  "path",
248
256
  {
@@ -255,10 +263,10 @@ var __iconNode15 = [
255
263
  ["path", { d: "M16 13H8", key: "t4e002" }],
256
264
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
257
265
  ];
258
- var FileText = createLucideIcon("file-text", __iconNode15);
266
+ var FileText = createLucideIcon("file-text", __iconNode16);
259
267
 
260
268
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/flask-conical.js
261
- var __iconNode16 = [
269
+ var __iconNode17 = [
262
270
  [
263
271
  "path",
264
272
  {
@@ -269,10 +277,31 @@ var __iconNode16 = [
269
277
  ["path", { d: "M6.453 15h11.094", key: "3shlmq" }],
270
278
  ["path", { d: "M8.5 2h7", key: "csnxdl" }]
271
279
  ];
272
- var FlaskConical = createLucideIcon("flask-conical", __iconNode16);
280
+ var FlaskConical = createLucideIcon("flask-conical", __iconNode17);
281
+
282
+ // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/git-branch.js
283
+ var __iconNode18 = [
284
+ ["path", { d: "M15 6a9 9 0 0 0-9 9V3", key: "1cii5b" }],
285
+ ["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
286
+ ["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }]
287
+ ];
288
+ var GitBranch = createLucideIcon("git-branch", __iconNode18);
289
+
290
+ // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/github.js
291
+ var __iconNode19 = [
292
+ [
293
+ "path",
294
+ {
295
+ d: "M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",
296
+ key: "tonef"
297
+ }
298
+ ],
299
+ ["path", { d: "M9 18c-4.51 2-5-2-7-2", key: "9comsn" }]
300
+ ];
301
+ var Github = createLucideIcon("github", __iconNode19);
273
302
 
274
303
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/layers.js
275
- var __iconNode17 = [
304
+ var __iconNode20 = [
276
305
  [
277
306
  "path",
278
307
  {
@@ -295,31 +324,31 @@ var __iconNode17 = [
295
324
  }
296
325
  ]
297
326
  ];
298
- var Layers = createLucideIcon("layers", __iconNode17);
327
+ var Layers = createLucideIcon("layers", __iconNode20);
299
328
 
300
329
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/list-checks.js
301
- var __iconNode18 = [
330
+ var __iconNode21 = [
302
331
  ["path", { d: "M13 5h8", key: "a7qcls" }],
303
332
  ["path", { d: "M13 12h8", key: "h98zly" }],
304
333
  ["path", { d: "M13 19h8", key: "c3s6r1" }],
305
334
  ["path", { d: "m3 17 2 2 4-4", key: "1jhpwq" }],
306
335
  ["path", { d: "m3 7 2 2 4-4", key: "1obspn" }]
307
336
  ];
308
- var ListChecks = createLucideIcon("list-checks", __iconNode18);
337
+ var ListChecks = createLucideIcon("list-checks", __iconNode21);
309
338
 
310
339
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/loader-circle.js
311
- var __iconNode19 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
312
- var LoaderCircle = createLucideIcon("loader-circle", __iconNode19);
340
+ var __iconNode22 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
341
+ var LoaderCircle = createLucideIcon("loader-circle", __iconNode22);
313
342
 
314
343
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/lock.js
315
- var __iconNode20 = [
344
+ var __iconNode23 = [
316
345
  ["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
317
346
  ["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
318
347
  ];
319
- var Lock = createLucideIcon("lock", __iconNode20);
348
+ var Lock = createLucideIcon("lock", __iconNode23);
320
349
 
321
350
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/message-square.js
322
- var __iconNode21 = [
351
+ var __iconNode24 = [
323
352
  [
324
353
  "path",
325
354
  {
@@ -328,10 +357,10 @@ var __iconNode21 = [
328
357
  }
329
358
  ]
330
359
  ];
331
- var MessageSquare = createLucideIcon("message-square", __iconNode21);
360
+ var MessageSquare = createLucideIcon("message-square", __iconNode24);
332
361
 
333
362
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/pencil.js
334
- var __iconNode22 = [
363
+ var __iconNode25 = [
335
364
  [
336
365
  "path",
337
366
  {
@@ -341,19 +370,19 @@ var __iconNode22 = [
341
370
  ],
342
371
  ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
343
372
  ];
344
- var Pencil = createLucideIcon("pencil", __iconNode22);
373
+ var Pencil = createLucideIcon("pencil", __iconNode25);
345
374
 
346
375
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/refresh-cw.js
347
- var __iconNode23 = [
376
+ var __iconNode26 = [
348
377
  ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
349
378
  ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
350
379
  ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
351
380
  ["path", { d: "M8 16H3v5", key: "1cv678" }]
352
381
  ];
353
- var RefreshCw = createLucideIcon("refresh-cw", __iconNode23);
382
+ var RefreshCw = createLucideIcon("refresh-cw", __iconNode26);
354
383
 
355
384
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/rocket.js
356
- var __iconNode24 = [
385
+ var __iconNode27 = [
357
386
  ["path", { d: "M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5", key: "qeys4" }],
358
387
  [
359
388
  "path",
@@ -371,17 +400,17 @@ var __iconNode24 = [
371
400
  ],
372
401
  ["path", { d: "M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05", key: "92ym6u" }]
373
402
  ];
374
- var Rocket = createLucideIcon("rocket", __iconNode24);
403
+ var Rocket = createLucideIcon("rocket", __iconNode27);
375
404
 
376
405
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/rotate-ccw.js
377
- var __iconNode25 = [
406
+ var __iconNode28 = [
378
407
  ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
379
408
  ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
380
409
  ];
381
- var RotateCcw = createLucideIcon("rotate-ccw", __iconNode25);
410
+ var RotateCcw = createLucideIcon("rotate-ccw", __iconNode28);
382
411
 
383
412
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/send.js
384
- var __iconNode26 = [
413
+ var __iconNode29 = [
385
414
  [
386
415
  "path",
387
416
  {
@@ -391,19 +420,19 @@ var __iconNode26 = [
391
420
  ],
392
421
  ["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
393
422
  ];
394
- var Send = createLucideIcon("send", __iconNode26);
423
+ var Send = createLucideIcon("send", __iconNode29);
395
424
 
396
425
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/settings-2.js
397
- var __iconNode27 = [
426
+ var __iconNode30 = [
398
427
  ["path", { d: "M14 17H5", key: "gfn3mx" }],
399
428
  ["path", { d: "M19 7h-9", key: "6i9tg" }],
400
429
  ["circle", { cx: "17", cy: "17", r: "3", key: "18b49y" }],
401
430
  ["circle", { cx: "7", cy: "7", r: "3", key: "dfmy0x" }]
402
431
  ];
403
- var Settings2 = createLucideIcon("settings-2", __iconNode27);
432
+ var Settings2 = createLucideIcon("settings-2", __iconNode30);
404
433
 
405
434
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/settings.js
406
- var __iconNode28 = [
435
+ var __iconNode31 = [
407
436
  [
408
437
  "path",
409
438
  {
@@ -413,10 +442,10 @@ var __iconNode28 = [
413
442
  ],
414
443
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
415
444
  ];
416
- var Settings = createLucideIcon("settings", __iconNode28);
445
+ var Settings = createLucideIcon("settings", __iconNode31);
417
446
 
418
447
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/shield.js
419
- var __iconNode29 = [
448
+ var __iconNode32 = [
420
449
  [
421
450
  "path",
422
451
  {
@@ -425,10 +454,10 @@ var __iconNode29 = [
425
454
  }
426
455
  ]
427
456
  ];
428
- var Shield = createLucideIcon("shield", __iconNode29);
457
+ var Shield = createLucideIcon("shield", __iconNode32);
429
458
 
430
459
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/sparkles.js
431
- var __iconNode30 = [
460
+ var __iconNode33 = [
432
461
  [
433
462
  "path",
434
463
  {
@@ -440,18 +469,18 @@ var __iconNode30 = [
440
469
  ["path", { d: "M22 4h-4", key: "gwowj6" }],
441
470
  ["circle", { cx: "4", cy: "20", r: "2", key: "6kqj1y" }]
442
471
  ];
443
- var Sparkles = createLucideIcon("sparkles", __iconNode30);
472
+ var Sparkles = createLucideIcon("sparkles", __iconNode33);
444
473
 
445
474
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/target.js
446
- var __iconNode31 = [
475
+ var __iconNode34 = [
447
476
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
448
477
  ["circle", { cx: "12", cy: "12", r: "6", key: "1vlfrh" }],
449
478
  ["circle", { cx: "12", cy: "12", r: "2", key: "1c9p78" }]
450
479
  ];
451
- var Target = createLucideIcon("target", __iconNode31);
480
+ var Target = createLucideIcon("target", __iconNode34);
452
481
 
453
482
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/triangle-alert.js
454
- var __iconNode32 = [
483
+ var __iconNode35 = [
455
484
  [
456
485
  "path",
457
486
  {
@@ -462,34 +491,34 @@ var __iconNode32 = [
462
491
  ["path", { d: "M12 9v4", key: "juzpu7" }],
463
492
  ["path", { d: "M12 17h.01", key: "p32p05" }]
464
493
  ];
465
- var TriangleAlert = createLucideIcon("triangle-alert", __iconNode32);
494
+ var TriangleAlert = createLucideIcon("triangle-alert", __iconNode35);
466
495
 
467
496
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/user.js
468
- var __iconNode33 = [
497
+ var __iconNode36 = [
469
498
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
470
499
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
471
500
  ];
472
- var User = createLucideIcon("user", __iconNode33);
501
+ var User = createLucideIcon("user", __iconNode36);
473
502
 
474
503
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/users.js
475
- var __iconNode34 = [
504
+ var __iconNode37 = [
476
505
  ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
477
506
  ["path", { d: "M16 3.128a4 4 0 0 1 0 7.744", key: "16gr8j" }],
478
507
  ["path", { d: "M22 21v-2a4 4 0 0 0-3-3.87", key: "kshegd" }],
479
508
  ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }]
480
509
  ];
481
- var Users = createLucideIcon("users", __iconNode34);
510
+ var Users = createLucideIcon("users", __iconNode37);
482
511
 
483
512
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/workflow.js
484
- var __iconNode35 = [
513
+ var __iconNode38 = [
485
514
  ["rect", { width: "8", height: "8", x: "3", y: "3", rx: "2", key: "by2w9f" }],
486
515
  ["path", { d: "M7 11v4a2 2 0 0 0 2 2h4", key: "xkn7yn" }],
487
516
  ["rect", { width: "8", height: "8", x: "13", y: "13", rx: "2", key: "1cgmvn" }]
488
517
  ];
489
- var Workflow = createLucideIcon("workflow", __iconNode35);
518
+ var Workflow = createLucideIcon("workflow", __iconNode38);
490
519
 
491
520
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/wrench.js
492
- var __iconNode36 = [
521
+ var __iconNode39 = [
493
522
  [
494
523
  "path",
495
524
  {
@@ -498,17 +527,17 @@ var __iconNode36 = [
498
527
  }
499
528
  ]
500
529
  ];
501
- var Wrench = createLucideIcon("wrench", __iconNode36);
530
+ var Wrench = createLucideIcon("wrench", __iconNode39);
502
531
 
503
532
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/x.js
504
- var __iconNode37 = [
533
+ var __iconNode40 = [
505
534
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
506
535
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
507
536
  ];
508
- var X = createLucideIcon("x", __iconNode37);
537
+ var X = createLucideIcon("x", __iconNode40);
509
538
 
510
539
  // node_modules/.pnpm/lucide-react@0.574.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/zap.js
511
- var __iconNode38 = [
540
+ var __iconNode41 = [
512
541
  [
513
542
  "path",
514
543
  {
@@ -517,10 +546,10 @@ var __iconNode38 = [
517
546
  }
518
547
  ]
519
548
  ];
520
- var Zap = createLucideIcon("zap", __iconNode38);
549
+ var Zap = createLucideIcon("zap", __iconNode41);
521
550
 
522
551
  // src/ui/components/WizardShell.tsx
523
- import { useEffect as useEffect5 } from "react";
552
+ import { useEffect as useEffect6 } from "react";
524
553
 
525
554
  // src/ui/context/WizardContext.tsx
526
555
  import { createContext, useCallback, useContext, useState } from "react";
@@ -529,6 +558,7 @@ var MANUAL_STEPS = [
529
558
  "onboarding",
530
559
  "name",
531
560
  "goal",
561
+ "repository",
532
562
  "preset",
533
563
  "modules",
534
564
  "roles",
@@ -571,6 +601,7 @@ var initialState = {
571
601
  companyName: "",
572
602
  goals: [],
573
603
  projects: [],
604
+ issues: [],
574
605
  ceoAdapter: { type: "codex_local", cwd: "", model: "gpt-5.5" },
575
606
  existingCompanyId: "",
576
607
  presetName: "",
@@ -4334,8 +4365,273 @@ function StepGoal() {
4334
4365
  ] });
4335
4366
  }
4336
4367
 
4368
+ // src/ui/components/steps/StepRepository.tsx
4369
+ import { useCallback as useCallback4, useState as useState4 } from "react";
4370
+
4371
+ // src/ui/lib/repository.ts
4372
+ function resolveWorkspaceSourceType(project) {
4373
+ const sourceType = project?.workspace?.sourceType || project?.workspaceSourceType;
4374
+ return typeof sourceType === "string" ? sourceType.trim() : void 0;
4375
+ }
4376
+ function getRepositoryMode(project) {
4377
+ const workspace = project?.workspace;
4378
+ const sourceType = resolveWorkspaceSourceType(project);
4379
+ if (sourceType === "git_repo" || workspace?.repoUrl || project?.repoUrl || typeof sourceType === "string" && sourceType !== "local_path" && sourceType.length > 0) {
4380
+ return "external";
4381
+ }
4382
+ return "new";
4383
+ }
4384
+ function isExternalRepository(project) {
4385
+ const sourceType = resolveWorkspaceSourceType(project);
4386
+ return typeof sourceType === "string" && sourceType !== "local_path" && sourceType.length > 0 || Boolean(project?.workspace?.repoUrl || project?.repoUrl);
4387
+ }
4388
+ function getRepositoryUrl(project) {
4389
+ return project?.workspace?.repoUrl || project?.repoUrl || "";
4390
+ }
4391
+ function getRepositoryRef(project, mode) {
4392
+ return project?.workspace?.defaultRef || project?.workspace?.repoRef || project?.defaultRef || project?.repoRef || (mode === "external" ? "origin/main" : "main");
4393
+ }
4394
+ function normalizeNewRepoBranch(value) {
4395
+ const raw = value.trim().replace(/^origin\//, "") || "main";
4396
+ return /^[A-Za-z0-9._/-]+$/.test(raw) ? raw : "main";
4397
+ }
4398
+ function repositoryProjectFields(mode, repoUrl, repoRef) {
4399
+ if (mode === "external") {
4400
+ const ref = repoRef.trim() || "origin/main";
4401
+ const url = repoUrl.trim();
4402
+ return {
4403
+ workspaceSourceType: "git_repo",
4404
+ repoUrl: url,
4405
+ repoRef: ref,
4406
+ defaultRef: ref,
4407
+ workspace: {
4408
+ sourceType: "git_repo",
4409
+ repoUrl: url,
4410
+ repoRef: ref,
4411
+ defaultRef: ref,
4412
+ isPrimary: true
4413
+ },
4414
+ executionWorkspacePolicy: {
4415
+ defaultMode: "isolated_workspace",
4416
+ workspaceStrategy: { type: "git_worktree", baseRef: ref }
4417
+ }
4418
+ };
4419
+ }
4420
+ const branch = normalizeNewRepoBranch(repoRef);
4421
+ return {
4422
+ workspaceSourceType: "local_path",
4423
+ repoUrl: void 0,
4424
+ repoRef: void 0,
4425
+ defaultRef: branch,
4426
+ workspace: {
4427
+ sourceType: "local_path",
4428
+ defaultRef: branch,
4429
+ setupCommand: `git init -b ${branch}`,
4430
+ isPrimary: true
4431
+ },
4432
+ executionWorkspacePolicy: void 0
4433
+ };
4434
+ }
4435
+
4436
+ // src/ui/components/steps/StepRepository.tsx
4437
+ import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
4438
+ function getPrimaryProject(stateProjects) {
4439
+ return stateProjects.length > 0 ? stateProjects[0] : null;
4440
+ }
4441
+ function buildProject({
4442
+ existing,
4443
+ companyName,
4444
+ goalTitles,
4445
+ goalDescription,
4446
+ mode,
4447
+ repoUrl,
4448
+ repoRef
4449
+ }) {
4450
+ const name = existing?.name?.trim() || companyName || "Main Project";
4451
+ const description = existing?.description?.trim() || goalDescription || `Main project for ${companyName}`;
4452
+ const goals = existing?.goals?.length ? existing.goals : goalTitles;
4453
+ return {
4454
+ ...existing ?? {},
4455
+ name,
4456
+ description,
4457
+ goals,
4458
+ ...repositoryProjectFields(mode, repoUrl, repoRef)
4459
+ };
4460
+ }
4461
+ function ModeCard({
4462
+ icon: Icon2,
4463
+ title,
4464
+ description,
4465
+ selected,
4466
+ onClick
4467
+ }) {
4468
+ return /* @__PURE__ */ jsxs4(
4469
+ "button",
4470
+ {
4471
+ type: "button",
4472
+ onClick,
4473
+ className: cn(
4474
+ "flex items-start gap-4 rounded-lg border p-4 text-left transition-all duration-150",
4475
+ selected ? "border-foreground/30 bg-accent" : "border-border hover:border-foreground/15 hover:bg-accent/50"
4476
+ ),
4477
+ children: [
4478
+ /* @__PURE__ */ jsx8(
4479
+ "div",
4480
+ {
4481
+ className: cn(
4482
+ "mt-0.5 h-8 w-8 rounded-md flex items-center justify-center shrink-0",
4483
+ selected ? "bg-foreground text-background" : "bg-secondary"
4484
+ ),
4485
+ children: selected ? /* @__PURE__ */ jsx8(Check, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx8(Icon2, { className: "h-4 w-4" })
4486
+ }
4487
+ ),
4488
+ /* @__PURE__ */ jsxs4("div", { className: "space-y-1", children: [
4489
+ /* @__PURE__ */ jsx8("p", { className: "text-sm font-medium", children: title }),
4490
+ /* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: description })
4491
+ ] })
4492
+ ]
4493
+ }
4494
+ );
4495
+ }
4496
+ function StepRepository() {
4497
+ const state = useWizard();
4498
+ const dispatch = useWizardDispatch();
4499
+ const existingProject = getPrimaryProject(state.projects);
4500
+ const initialMode = getRepositoryMode(existingProject);
4501
+ const [mode, setMode] = useState4(initialMode);
4502
+ const [repoUrl, setRepoUrl] = useState4(getRepositoryUrl(existingProject));
4503
+ const [repoRef, setRepoRef] = useState4(getRepositoryRef(existingProject, initialMode));
4504
+ const companyName = state.companyName.trim() || "Company";
4505
+ const goalTitles = state.goals.map((g) => g.title).filter(Boolean);
4506
+ const goalDescription = state.goals[0]?.description || "";
4507
+ const externalRepoMissing = mode === "external" && !repoUrl.trim();
4508
+ const chooseMode = (nextMode) => {
4509
+ setMode(nextMode);
4510
+ if (nextMode === "external" && (!repoRef.trim() || repoRef.trim() === "main")) {
4511
+ setRepoRef("origin/main");
4512
+ }
4513
+ if (nextMode === "new" && (!repoRef.trim() || repoRef.trim().startsWith("origin/"))) {
4514
+ setRepoRef("main");
4515
+ }
4516
+ };
4517
+ const handleNext = useCallback4(() => {
4518
+ if (externalRepoMissing) return;
4519
+ const updatedProject = buildProject({
4520
+ existing: existingProject,
4521
+ companyName,
4522
+ goalTitles,
4523
+ goalDescription,
4524
+ mode,
4525
+ repoUrl,
4526
+ repoRef
4527
+ });
4528
+ dispatch({ type: "SET_PROJECTS", projects: [updatedProject, ...state.projects.slice(1)] });
4529
+ dispatch({ type: "GO_TO", step: nextStep(state) });
4530
+ }, [
4531
+ companyName,
4532
+ dispatch,
4533
+ existingProject,
4534
+ externalRepoMissing,
4535
+ goalDescription,
4536
+ goalTitles,
4537
+ mode,
4538
+ repoRef,
4539
+ repoUrl,
4540
+ state
4541
+ ]);
4542
+ return /* @__PURE__ */ jsxs4("div", { className: "space-y-6", children: [
4543
+ /* @__PURE__ */ jsxs4("div", { className: "space-y-2", children: [
4544
+ /* @__PURE__ */ jsx8("h2", { className: "text-xl font-semibold tracking-tight", children: "Repository setup" }),
4545
+ /* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: "Should Paperclip create a fresh Git repository for this project, or should the agents work from an existing external repository such as GitHub?" })
4546
+ ] }),
4547
+ /* @__PURE__ */ jsxs4("div", { className: "grid gap-3 sm:grid-cols-2", children: [
4548
+ /* @__PURE__ */ jsx8(
4549
+ ModeCard,
4550
+ {
4551
+ icon: CirclePlus,
4552
+ title: "Create a new Git repository",
4553
+ description: "Start with a fresh local project workspace. Paperclip will initialize Git during bootstrap.",
4554
+ selected: mode === "new",
4555
+ onClick: () => chooseMode("new")
4556
+ }
4557
+ ),
4558
+ /* @__PURE__ */ jsx8(
4559
+ ModeCard,
4560
+ {
4561
+ icon: Github,
4562
+ title: "Use an external repository",
4563
+ description: "Connect an existing GitHub, GitLab, or other remote Git repository.",
4564
+ selected: mode === "external",
4565
+ onClick: () => chooseMode("external")
4566
+ }
4567
+ )
4568
+ ] }),
4569
+ mode === "external" ? /* @__PURE__ */ jsxs4("div", { className: "space-y-4 rounded-lg border p-4", children: [
4570
+ /* @__PURE__ */ jsxs4("div", { className: "space-y-2", children: [
4571
+ /* @__PURE__ */ jsx8("label", { className: "text-sm font-medium", children: "Repository URL" }),
4572
+ /* @__PURE__ */ jsx8(
4573
+ Input,
4574
+ {
4575
+ placeholder: "https://github.com/org/repo",
4576
+ value: repoUrl,
4577
+ onChange: (e) => setRepoUrl(e.target.value),
4578
+ autoFocus: true
4579
+ }
4580
+ ),
4581
+ /* @__PURE__ */ jsx8("p", { className: "text-xs text-muted-foreground", children: "Do not paste tokens or credentials into the URL. Configure provider access as Paperclip company secrets instead." })
4582
+ ] }),
4583
+ /* @__PURE__ */ jsxs4("div", { className: "space-y-2", children: [
4584
+ /* @__PURE__ */ jsxs4("label", { className: "text-sm font-medium", children: [
4585
+ "Default ref ",
4586
+ /* @__PURE__ */ jsx8("span", { className: "text-muted-foreground font-normal", children: "(optional)" })
4587
+ ] }),
4588
+ /* @__PURE__ */ jsx8(
4589
+ Input,
4590
+ {
4591
+ placeholder: "origin/main",
4592
+ value: repoRef,
4593
+ onChange: (e) => setRepoRef(e.target.value),
4594
+ onKeyDown: (e) => e.key === "Enter" && handleNext()
4595
+ }
4596
+ )
4597
+ ] })
4598
+ ] }) : /* @__PURE__ */ jsxs4("div", { className: "space-y-4 rounded-lg border p-4", children: [
4599
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-start gap-3", children: [
4600
+ /* @__PURE__ */ jsx8(GitBranch, { className: "h-4 w-4 text-muted-foreground shrink-0 mt-0.5" }),
4601
+ /* @__PURE__ */ jsxs4("div", { className: "space-y-1", children: [
4602
+ /* @__PURE__ */ jsx8("p", { className: "text-sm font-medium", children: "Fresh repository workspace" }),
4603
+ /* @__PURE__ */ jsxs4("p", { className: "text-sm text-muted-foreground", children: [
4604
+ 'The bootstrap will create project "',
4605
+ existingProject?.name || companyName,
4606
+ '" with a local workspace and run',
4607
+ " ",
4608
+ /* @__PURE__ */ jsx8("code", { className: "bg-muted px-1 py-0.5 rounded", children: "git init" }),
4609
+ "."
4610
+ ] })
4611
+ ] })
4612
+ ] }),
4613
+ /* @__PURE__ */ jsxs4("div", { className: "space-y-2", children: [
4614
+ /* @__PURE__ */ jsxs4("label", { className: "text-sm font-medium", children: [
4615
+ "Initial branch ",
4616
+ /* @__PURE__ */ jsx8("span", { className: "text-muted-foreground font-normal", children: "(optional)" })
4617
+ ] }),
4618
+ /* @__PURE__ */ jsx8(
4619
+ Input,
4620
+ {
4621
+ placeholder: "main",
4622
+ value: repoRef,
4623
+ onChange: (e) => setRepoRef(e.target.value),
4624
+ onKeyDown: (e) => e.key === "Enter" && handleNext()
4625
+ }
4626
+ )
4627
+ ] })
4628
+ ] }),
4629
+ /* @__PURE__ */ jsx8("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx8(Button, { onClick: handleNext, disabled: externalRepoMissing, children: "Continue" }) })
4630
+ ] });
4631
+ }
4632
+
4337
4633
  // src/ui/components/ui/badge.tsx
4338
- import { jsx as jsx8 } from "react/jsx-runtime";
4634
+ import { jsx as jsx9 } from "react/jsx-runtime";
4339
4635
  var badgeVariants = cva(
4340
4636
  "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
4341
4637
  {
@@ -4351,11 +4647,11 @@ var badgeVariants = cva(
4351
4647
  }
4352
4648
  );
4353
4649
  function Badge({ className, variant, ...props }) {
4354
- return /* @__PURE__ */ jsx8("div", { className: cn(badgeVariants({ variant }), className), ...props });
4650
+ return /* @__PURE__ */ jsx9("div", { className: cn(badgeVariants({ variant }), className), ...props });
4355
4651
  }
4356
4652
 
4357
4653
  // src/ui/components/steps/StepPreset.tsx
4358
- import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
4654
+ import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
4359
4655
  var PRESET_ICONS = {
4360
4656
  fast: Zap,
4361
4657
  quality: Shield,
@@ -4370,16 +4666,16 @@ function StepPreset() {
4370
4666
  const handleSelect = (name) => {
4371
4667
  dispatch({ type: "SET_PRESET", name });
4372
4668
  };
4373
- return /* @__PURE__ */ jsxs4("div", { className: "space-y-6", children: [
4374
- /* @__PURE__ */ jsxs4("div", { className: "space-y-2", children: [
4375
- /* @__PURE__ */ jsx9("h2", { className: "text-xl font-semibold tracking-tight", children: "Team preset" }),
4376
- /* @__PURE__ */ jsx9("p", { className: "text-sm text-muted-foreground", children: "Choose a pre-configured team setup, or go custom." })
4669
+ return /* @__PURE__ */ jsxs5("div", { className: "space-y-6", children: [
4670
+ /* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
4671
+ /* @__PURE__ */ jsx10("h2", { className: "text-xl font-semibold tracking-tight", children: "Team preset" }),
4672
+ /* @__PURE__ */ jsx10("p", { className: "text-sm text-muted-foreground", children: "Choose a pre-configured team setup, or go custom." })
4377
4673
  ] }),
4378
- /* @__PURE__ */ jsxs4("div", { className: "grid gap-3 max-h-[60vh] overflow-y-auto pr-1", children: [
4674
+ /* @__PURE__ */ jsxs5("div", { className: "grid gap-3 max-h-[60vh] overflow-y-auto pr-1", children: [
4379
4675
  state.presets.map((preset) => {
4380
4676
  const Icon2 = PRESET_ICONS[preset.name] || Settings;
4381
4677
  const selected = state.presetName === preset.name;
4382
- return /* @__PURE__ */ jsxs4(
4678
+ return /* @__PURE__ */ jsxs5(
4383
4679
  "button",
4384
4680
  {
4385
4681
  onClick: () => handleSelect(preset.name),
@@ -4388,38 +4684,38 @@ function StepPreset() {
4388
4684
  selected ? "border-foreground/30 bg-accent" : "border-border hover:border-foreground/15 hover:bg-accent/50"
4389
4685
  ),
4390
4686
  children: [
4391
- /* @__PURE__ */ jsx9(
4687
+ /* @__PURE__ */ jsx10(
4392
4688
  "div",
4393
4689
  {
4394
4690
  className: cn(
4395
4691
  "mt-0.5 h-8 w-8 rounded-md flex items-center justify-center shrink-0",
4396
4692
  selected ? "bg-foreground text-background" : "bg-secondary"
4397
4693
  ),
4398
- children: selected ? /* @__PURE__ */ jsx9(Check, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx9(Icon2, { className: "h-4 w-4" })
4694
+ children: selected ? /* @__PURE__ */ jsx10(Check, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx10(Icon2, { className: "h-4 w-4" })
4399
4695
  }
4400
4696
  ),
4401
- /* @__PURE__ */ jsxs4("div", { className: "flex-1 min-w-0", children: [
4402
- /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
4403
- /* @__PURE__ */ jsx9("span", { className: "font-medium text-sm capitalize", children: preset.name }),
4404
- preset.modules && /* @__PURE__ */ jsxs4(Badge, { variant: "secondary", className: "text-[10px]", children: [
4697
+ /* @__PURE__ */ jsxs5("div", { className: "flex-1 min-w-0", children: [
4698
+ /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2", children: [
4699
+ /* @__PURE__ */ jsx10("span", { className: "font-medium text-sm capitalize", children: preset.name }),
4700
+ preset.modules && /* @__PURE__ */ jsxs5(Badge, { variant: "secondary", className: "text-[10px]", children: [
4405
4701
  preset.modules.length,
4406
4702
  " modules"
4407
4703
  ] }),
4408
- preset.roles && preset.roles.length > 0 && /* @__PURE__ */ jsxs4(Badge, { variant: "secondary", className: "text-[10px]", children: [
4704
+ preset.roles && preset.roles.length > 0 && /* @__PURE__ */ jsxs5(Badge, { variant: "secondary", className: "text-[10px]", children: [
4409
4705
  "+",
4410
4706
  preset.roles.length,
4411
4707
  " roles"
4412
4708
  ] })
4413
4709
  ] }),
4414
- /* @__PURE__ */ jsx9("p", { className: "text-sm text-muted-foreground mt-0.5", children: preset.description }),
4415
- preset.constraints && preset.constraints.length > 0 && /* @__PURE__ */ jsx9("p", { className: "text-xs text-muted-foreground/70 mt-1", children: preset.constraints.join(" \xB7 ") })
4710
+ /* @__PURE__ */ jsx10("p", { className: "text-sm text-muted-foreground mt-0.5", children: preset.description }),
4711
+ preset.constraints && preset.constraints.length > 0 && /* @__PURE__ */ jsx10("p", { className: "text-xs text-muted-foreground/70 mt-1", children: preset.constraints.join(" \xB7 ") })
4416
4712
  ] })
4417
4713
  ]
4418
4714
  },
4419
4715
  preset.name
4420
4716
  );
4421
4717
  }),
4422
- /* @__PURE__ */ jsxs4(
4718
+ /* @__PURE__ */ jsxs5(
4423
4719
  "button",
4424
4720
  {
4425
4721
  onClick: () => handleSelect("custom"),
@@ -4428,25 +4724,25 @@ function StepPreset() {
4428
4724
  state.presetName === "custom" ? "border-foreground/30 bg-accent" : "border-border hover:border-foreground/15 hover:bg-accent/50"
4429
4725
  ),
4430
4726
  children: [
4431
- /* @__PURE__ */ jsx9(
4727
+ /* @__PURE__ */ jsx10(
4432
4728
  "div",
4433
4729
  {
4434
4730
  className: cn(
4435
4731
  "mt-0.5 h-8 w-8 rounded-md flex items-center justify-center shrink-0",
4436
4732
  state.presetName === "custom" ? "bg-foreground text-background" : "bg-secondary"
4437
4733
  ),
4438
- children: state.presetName === "custom" ? /* @__PURE__ */ jsx9(Check, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx9(Settings, { className: "h-4 w-4" })
4734
+ children: state.presetName === "custom" ? /* @__PURE__ */ jsx10(Check, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx10(Settings, { className: "h-4 w-4" })
4439
4735
  }
4440
4736
  ),
4441
- /* @__PURE__ */ jsxs4("div", { children: [
4442
- /* @__PURE__ */ jsx9("span", { className: "font-medium text-sm", children: "Custom" }),
4443
- /* @__PURE__ */ jsx9("p", { className: "text-sm text-muted-foreground mt-0.5", children: "Pick modules and roles manually" })
4737
+ /* @__PURE__ */ jsxs5("div", { children: [
4738
+ /* @__PURE__ */ jsx10("span", { className: "font-medium text-sm", children: "Custom" }),
4739
+ /* @__PURE__ */ jsx10("p", { className: "text-sm text-muted-foreground mt-0.5", children: "Pick modules and roles manually" })
4444
4740
  ] })
4445
4741
  ]
4446
4742
  }
4447
4743
  )
4448
4744
  ] }),
4449
- /* @__PURE__ */ jsx9("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx9(
4745
+ /* @__PURE__ */ jsx10("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx10(
4450
4746
  Button,
4451
4747
  {
4452
4748
  onClick: () => dispatch({ type: "GO_TO", step: nextStep(state) }),
@@ -4458,7 +4754,7 @@ function StepPreset() {
4458
4754
  }
4459
4755
 
4460
4756
  // src/ui/components/steps/StepModules.tsx
4461
- import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
4757
+ import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
4462
4758
  function StepModules() {
4463
4759
  const state = useWizard();
4464
4760
  const dispatch = useWizardDispatch();
@@ -4502,16 +4798,16 @@ function StepModules() {
4502
4798
  const isLocked = (name) => {
4503
4799
  return selected.has(name) && getBlockingDependents(name).length > 0;
4504
4800
  };
4505
- return /* @__PURE__ */ jsxs5("div", { className: "space-y-6", children: [
4506
- /* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
4507
- /* @__PURE__ */ jsx10("h2", { className: "text-xl font-semibold tracking-tight", children: "Modules" }),
4508
- /* @__PURE__ */ jsx10("p", { className: "text-sm text-muted-foreground", children: "Capabilities to enable. Dependencies are auto-selected." })
4801
+ return /* @__PURE__ */ jsxs6("div", { className: "space-y-6", children: [
4802
+ /* @__PURE__ */ jsxs6("div", { className: "space-y-2", children: [
4803
+ /* @__PURE__ */ jsx11("h2", { className: "text-xl font-semibold tracking-tight", children: "Modules" }),
4804
+ /* @__PURE__ */ jsx11("p", { className: "text-sm text-muted-foreground", children: "Capabilities to enable. Dependencies are auto-selected." })
4509
4805
  ] }),
4510
- /* @__PURE__ */ jsx10("div", { className: "grid gap-2 max-h-[60vh] overflow-y-auto pr-1", children: state.modules.map((mod) => {
4806
+ /* @__PURE__ */ jsx11("div", { className: "grid gap-2 max-h-[60vh] overflow-y-auto pr-1", children: state.modules.map((mod) => {
4511
4807
  const isSelected = selected.has(mod.name);
4512
4808
  const locked = isLocked(mod.name);
4513
4809
  const capCount = mod.capabilities?.length ?? 0;
4514
- return /* @__PURE__ */ jsxs5(
4810
+ return /* @__PURE__ */ jsxs6(
4515
4811
  "button",
4516
4812
  {
4517
4813
  onClick: () => toggle(mod.name),
@@ -4522,43 +4818,43 @@ function StepModules() {
4522
4818
  locked && isSelected && "opacity-80"
4523
4819
  ),
4524
4820
  children: [
4525
- /* @__PURE__ */ jsx10(
4821
+ /* @__PURE__ */ jsx11(
4526
4822
  "div",
4527
4823
  {
4528
4824
  className: cn(
4529
4825
  "h-5 w-5 rounded flex items-center justify-center shrink-0 border mt-0.5",
4530
4826
  isSelected ? "bg-foreground border-foreground text-background" : "border-input"
4531
4827
  ),
4532
- children: isSelected && (locked ? /* @__PURE__ */ jsx10(Lock, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx10(Check, { className: "h-3 w-3" }))
4828
+ children: isSelected && (locked ? /* @__PURE__ */ jsx11(Lock, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx11(Check, { className: "h-3 w-3" }))
4533
4829
  }
4534
4830
  ),
4535
- /* @__PURE__ */ jsxs5("div", { className: "flex-1 min-w-0", children: [
4536
- /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 flex-wrap", children: [
4537
- /* @__PURE__ */ jsx10("span", { className: "text-sm font-medium", children: mod.name }),
4538
- mod.activatesWithRoles && mod.activatesWithRoles.length > 0 && /* @__PURE__ */ jsxs5(Badge, { variant: "outline", className: "text-[10px]", children: [
4831
+ /* @__PURE__ */ jsxs6("div", { className: "flex-1 min-w-0", children: [
4832
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2 flex-wrap", children: [
4833
+ /* @__PURE__ */ jsx11("span", { className: "text-sm font-medium", children: mod.name }),
4834
+ mod.activatesWithRoles && mod.activatesWithRoles.length > 0 && /* @__PURE__ */ jsxs6(Badge, { variant: "outline", className: "text-[10px]", children: [
4539
4835
  "needs ",
4540
4836
  mod.activatesWithRoles.join("/")
4541
4837
  ] }),
4542
- (mod.issues?.length ?? mod.tasks?.length ?? 0) > 0 && /* @__PURE__ */ jsxs5(Badge, { variant: "secondary", className: "text-[10px]", children: [
4838
+ (mod.issues?.length ?? mod.tasks?.length ?? 0) > 0 && /* @__PURE__ */ jsxs6(Badge, { variant: "secondary", className: "text-[10px]", children: [
4543
4839
  mod.issues?.length ?? mod.tasks?.length ?? 0,
4544
4840
  " tasks"
4545
4841
  ] }),
4546
- capCount > 0 && /* @__PURE__ */ jsxs5(Badge, { variant: "secondary", className: "text-[10px]", children: [
4842
+ capCount > 0 && /* @__PURE__ */ jsxs6(Badge, { variant: "secondary", className: "text-[10px]", children: [
4547
4843
  capCount,
4548
4844
  " ",
4549
4845
  capCount === 1 ? "capability" : "capabilities"
4550
4846
  ] })
4551
4847
  ] }),
4552
- /* @__PURE__ */ jsx10("p", { className: "text-xs text-muted-foreground mt-0.5", children: mod.description }),
4553
- capCount > 0 && /* @__PURE__ */ jsx10("div", { className: "flex flex-wrap gap-x-3 gap-y-0.5 mt-1", children: mod.capabilities.map((cap) => /* @__PURE__ */ jsxs5("span", { className: "text-[11px] text-muted-foreground/70", children: [
4848
+ /* @__PURE__ */ jsx11("p", { className: "text-xs text-muted-foreground mt-0.5", children: mod.description }),
4849
+ capCount > 0 && /* @__PURE__ */ jsx11("div", { className: "flex flex-wrap gap-x-3 gap-y-0.5 mt-1", children: mod.capabilities.map((cap) => /* @__PURE__ */ jsxs6("span", { className: "text-[11px] text-muted-foreground/70", children: [
4554
4850
  cap.skill,
4555
4851
  " ",
4556
- /* @__PURE__ */ jsxs5("span", { className: "text-muted-foreground/40", children: [
4852
+ /* @__PURE__ */ jsxs6("span", { className: "text-muted-foreground/40", children: [
4557
4853
  "\u2192 ",
4558
4854
  cap.owners.join(", ")
4559
4855
  ] })
4560
4856
  ] }, cap.skill)) }),
4561
- mod.requires && mod.requires.length > 0 && /* @__PURE__ */ jsxs5("p", { className: "text-[11px] text-muted-foreground/60 mt-0.5", children: [
4857
+ mod.requires && mod.requires.length > 0 && /* @__PURE__ */ jsxs6("p", { className: "text-[11px] text-muted-foreground/60 mt-0.5", children: [
4562
4858
  "requires ",
4563
4859
  mod.requires.join(", ")
4564
4860
  ] })
@@ -4568,20 +4864,20 @@ function StepModules() {
4568
4864
  mod.name
4569
4865
  );
4570
4866
  }) }),
4571
- /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between", children: [
4572
- /* @__PURE__ */ jsxs5("p", { className: "text-xs text-muted-foreground", children: [
4867
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between", children: [
4868
+ /* @__PURE__ */ jsxs6("p", { className: "text-xs text-muted-foreground", children: [
4573
4869
  selected.size,
4574
4870
  " of ",
4575
4871
  state.modules.length,
4576
4872
  " selected"
4577
4873
  ] }),
4578
- /* @__PURE__ */ jsx10(Button, { onClick: () => dispatch({ type: "GO_TO", step: nextStep(state) }), children: "Continue" })
4874
+ /* @__PURE__ */ jsx11(Button, { onClick: () => dispatch({ type: "GO_TO", step: nextStep(state) }), children: "Continue" })
4579
4875
  ] })
4580
4876
  ] });
4581
4877
  }
4582
4878
 
4583
4879
  // src/ui/components/steps/StepRoles.tsx
4584
- import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
4880
+ import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
4585
4881
  function StepRoles() {
4586
4882
  const state = useWizard();
4587
4883
  const dispatch = useWizardDispatch();
@@ -4597,39 +4893,39 @@ function StepRoles() {
4597
4893
  }
4598
4894
  dispatch({ type: "SET_ROLES", roles: [...next] });
4599
4895
  };
4600
- return /* @__PURE__ */ jsxs6("div", { className: "space-y-6", children: [
4601
- /* @__PURE__ */ jsxs6("div", { className: "space-y-2", children: [
4602
- /* @__PURE__ */ jsx11("h2", { className: "text-xl font-semibold tracking-tight", children: "Team roles" }),
4603
- /* @__PURE__ */ jsx11("p", { className: "text-sm text-muted-foreground", children: "Base roles are always included. Add specialists as needed." })
4896
+ return /* @__PURE__ */ jsxs7("div", { className: "space-y-6", children: [
4897
+ /* @__PURE__ */ jsxs7("div", { className: "space-y-2", children: [
4898
+ /* @__PURE__ */ jsx12("h2", { className: "text-xl font-semibold tracking-tight", children: "Team roles" }),
4899
+ /* @__PURE__ */ jsx12("p", { className: "text-sm text-muted-foreground", children: "Base roles are always included. Add specialists as needed." })
4604
4900
  ] }),
4605
- /* @__PURE__ */ jsxs6("div", { className: "max-h-[60vh] overflow-y-auto pr-1 space-y-4", children: [
4606
- /* @__PURE__ */ jsxs6("div", { className: "space-y-2", children: [
4607
- /* @__PURE__ */ jsx11("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: "Base team" }),
4608
- /* @__PURE__ */ jsx11("div", { className: "grid gap-2", children: baseRoles.map((role) => /* @__PURE__ */ jsxs6(
4901
+ /* @__PURE__ */ jsxs7("div", { className: "max-h-[60vh] overflow-y-auto pr-1 space-y-4", children: [
4902
+ /* @__PURE__ */ jsxs7("div", { className: "space-y-2", children: [
4903
+ /* @__PURE__ */ jsx12("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: "Base team" }),
4904
+ /* @__PURE__ */ jsx12("div", { className: "grid gap-2", children: baseRoles.map((role) => /* @__PURE__ */ jsxs7(
4609
4905
  "div",
4610
4906
  {
4611
4907
  className: "flex items-start gap-3 rounded-lg border border-foreground/10 bg-accent/50 p-3",
4612
4908
  children: [
4613
- /* @__PURE__ */ jsx11("div", { className: "h-5 w-5 rounded flex items-center justify-center shrink-0 bg-foreground text-background mt-0.5", children: /* @__PURE__ */ jsx11(Crown, { className: "h-3 w-3" }) }),
4614
- /* @__PURE__ */ jsxs6("div", { className: "flex-1 min-w-0", children: [
4615
- /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2", children: [
4616
- /* @__PURE__ */ jsx11("span", { className: "text-sm font-medium", children: role.title }),
4617
- role.division && /* @__PURE__ */ jsx11(Badge, { variant: "outline", className: "text-[10px]", children: role.division }),
4618
- /* @__PURE__ */ jsx11(Badge, { variant: "secondary", className: "ml-auto text-[10px]", children: "required" })
4909
+ /* @__PURE__ */ jsx12("div", { className: "h-5 w-5 rounded flex items-center justify-center shrink-0 bg-foreground text-background mt-0.5", children: /* @__PURE__ */ jsx12(Crown, { className: "h-3 w-3" }) }),
4910
+ /* @__PURE__ */ jsxs7("div", { className: "flex-1 min-w-0", children: [
4911
+ /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-2", children: [
4912
+ /* @__PURE__ */ jsx12("span", { className: "text-sm font-medium", children: role.title }),
4913
+ role.division && /* @__PURE__ */ jsx12(Badge, { variant: "outline", className: "text-[10px]", children: role.division }),
4914
+ /* @__PURE__ */ jsx12(Badge, { variant: "secondary", className: "ml-auto text-[10px]", children: "required" })
4619
4915
  ] }),
4620
- /* @__PURE__ */ jsx11("p", { className: "text-xs text-muted-foreground mt-0.5", children: role.description }),
4621
- role.tagline && /* @__PURE__ */ jsx11("p", { className: "text-[11px] text-muted-foreground/60 mt-0.5 italic", children: role.tagline })
4916
+ /* @__PURE__ */ jsx12("p", { className: "text-xs text-muted-foreground mt-0.5", children: role.description }),
4917
+ role.tagline && /* @__PURE__ */ jsx12("p", { className: "text-[11px] text-muted-foreground/60 mt-0.5 italic", children: role.tagline })
4622
4918
  ] })
4623
4919
  ]
4624
4920
  },
4625
4921
  role.name
4626
4922
  )) })
4627
4923
  ] }),
4628
- /* @__PURE__ */ jsxs6("div", { className: "space-y-2", children: [
4629
- /* @__PURE__ */ jsx11("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: "Specialists" }),
4630
- /* @__PURE__ */ jsx11("div", { className: "grid gap-2", children: extraRoles.map((role) => {
4924
+ /* @__PURE__ */ jsxs7("div", { className: "space-y-2", children: [
4925
+ /* @__PURE__ */ jsx12("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: "Specialists" }),
4926
+ /* @__PURE__ */ jsx12("div", { className: "grid gap-2", children: extraRoles.map((role) => {
4631
4927
  const isSelected = selected.has(role.name);
4632
- return /* @__PURE__ */ jsxs6(
4928
+ return /* @__PURE__ */ jsxs7(
4633
4929
  "button",
4634
4930
  {
4635
4931
  onClick: () => toggle(role.name),
@@ -4638,28 +4934,28 @@ function StepRoles() {
4638
4934
  isSelected ? "border-foreground/20 bg-accent" : "border-border hover:border-foreground/10 hover:bg-accent/30"
4639
4935
  ),
4640
4936
  children: [
4641
- /* @__PURE__ */ jsx11(
4937
+ /* @__PURE__ */ jsx12(
4642
4938
  "div",
4643
4939
  {
4644
4940
  className: cn(
4645
4941
  "h-5 w-5 rounded flex items-center justify-center shrink-0 border mt-0.5",
4646
4942
  isSelected ? "bg-foreground border-foreground text-background" : "border-input"
4647
4943
  ),
4648
- children: isSelected && /* @__PURE__ */ jsx11(Check, { className: "h-3 w-3" })
4944
+ children: isSelected && /* @__PURE__ */ jsx12(Check, { className: "h-3 w-3" })
4649
4945
  }
4650
4946
  ),
4651
- /* @__PURE__ */ jsxs6("div", { className: "flex-1 min-w-0", children: [
4652
- /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2 flex-wrap", children: [
4653
- /* @__PURE__ */ jsx11("span", { className: "text-sm font-medium", children: role.title }),
4654
- role.division && /* @__PURE__ */ jsx11(Badge, { variant: "outline", className: "text-[10px]", children: role.division }),
4655
- role.reportsTo && /* @__PURE__ */ jsxs6("span", { className: "text-[10px] text-muted-foreground", children: [
4947
+ /* @__PURE__ */ jsxs7("div", { className: "flex-1 min-w-0", children: [
4948
+ /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-2 flex-wrap", children: [
4949
+ /* @__PURE__ */ jsx12("span", { className: "text-sm font-medium", children: role.title }),
4950
+ role.division && /* @__PURE__ */ jsx12(Badge, { variant: "outline", className: "text-[10px]", children: role.division }),
4951
+ role.reportsTo && /* @__PURE__ */ jsxs7("span", { className: "text-[10px] text-muted-foreground", children: [
4656
4952
  "reports to ",
4657
4953
  role.reportsTo
4658
4954
  ] })
4659
4955
  ] }),
4660
- /* @__PURE__ */ jsx11("p", { className: "text-xs text-muted-foreground mt-0.5", children: role.description }),
4661
- role.tagline && /* @__PURE__ */ jsx11("p", { className: "text-[11px] text-muted-foreground/60 mt-0.5 italic", children: role.tagline }),
4662
- isSelected && role.enhances && role.enhances.length > 0 && /* @__PURE__ */ jsx11("div", { className: "flex flex-wrap gap-x-3 gap-y-0.5 mt-1", children: role.enhances.map((e, i) => /* @__PURE__ */ jsxs6("span", { className: "text-[11px] text-muted-foreground/70", children: [
4956
+ /* @__PURE__ */ jsx12("p", { className: "text-xs text-muted-foreground mt-0.5", children: role.description }),
4957
+ role.tagline && /* @__PURE__ */ jsx12("p", { className: "text-[11px] text-muted-foreground/60 mt-0.5 italic", children: role.tagline }),
4958
+ isSelected && role.enhances && role.enhances.length > 0 && /* @__PURE__ */ jsx12("div", { className: "flex flex-wrap gap-x-3 gap-y-0.5 mt-1", children: role.enhances.map((e, i) => /* @__PURE__ */ jsxs7("span", { className: "text-[11px] text-muted-foreground/70", children: [
4663
4959
  "+ ",
4664
4960
  e
4665
4961
  ] }, i)) })
@@ -4671,50 +4967,50 @@ function StepRoles() {
4671
4967
  }) })
4672
4968
  ] })
4673
4969
  ] }),
4674
- /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between", children: [
4675
- /* @__PURE__ */ jsxs6("p", { className: "text-xs text-muted-foreground", children: [
4970
+ /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between", children: [
4971
+ /* @__PURE__ */ jsxs7("p", { className: "text-xs text-muted-foreground", children: [
4676
4972
  baseRoles.length + selected.size,
4677
4973
  " total agents"
4678
4974
  ] }),
4679
- /* @__PURE__ */ jsx11(Button, { onClick: () => dispatch({ type: "GO_TO", step: nextStep(state) }), children: "Continue" })
4975
+ /* @__PURE__ */ jsx12(Button, { onClick: () => dispatch({ type: "GO_TO", step: nextStep(state) }), children: "Continue" })
4680
4976
  ] })
4681
4977
  ] });
4682
4978
  }
4683
4979
 
4684
4980
  // src/ui/components/steps/StepSummary.tsx
4685
- import { useEffect as useEffect2, useRef as useRef2, useState as useState6 } from "react";
4981
+ import { useEffect as useEffect3, useRef as useRef3, useState as useState7 } from "react";
4686
4982
  import { usePluginAction as usePluginAction3 } from "@paperclipai/plugin-sdk/ui";
4687
4983
 
4688
4984
  // src/ui/components/ConfigReview.tsx
4689
- import { useState as useState5, useCallback as useCallback5 } from "react";
4985
+ import { useEffect as useEffect2, useState as useState6, useCallback as useCallback6, useRef as useRef2 } from "react";
4690
4986
  import { usePluginAction as usePluginAction2 } from "@paperclipai/plugin-sdk/ui";
4691
4987
 
4692
4988
  // src/ui/components/ui/hover-card.tsx
4693
4989
  import {
4694
- useState as useState4,
4990
+ useState as useState5,
4695
4991
  useRef,
4696
4992
  useEffect,
4697
- useCallback as useCallback4,
4993
+ useCallback as useCallback5,
4698
4994
  createContext as createContext2,
4699
4995
  useContext as useContext2
4700
4996
  } from "react";
4701
4997
  import * as ReactDOM from "react-dom";
4702
- import { Fragment, jsx as jsx12 } from "react/jsx-runtime";
4998
+ import { Fragment, jsx as jsx13 } from "react/jsx-runtime";
4703
4999
  var HoverCardContext = createContext2({ open: false, triggerRef: { current: null } });
4704
5000
  function HoverCardRoot({
4705
5001
  children,
4706
5002
  openDelay = 200,
4707
5003
  closeDelay = 100
4708
5004
  }) {
4709
- const [open, setOpen] = useState4(false);
5005
+ const [open, setOpen] = useState5(false);
4710
5006
  const openTimer = useRef(void 0);
4711
5007
  const closeTimer = useRef(void 0);
4712
5008
  const triggerRef = useRef(null);
4713
- const handleEnter = useCallback4(() => {
5009
+ const handleEnter = useCallback5(() => {
4714
5010
  clearTimeout(closeTimer.current);
4715
5011
  openTimer.current = setTimeout(() => setOpen(true), openDelay);
4716
5012
  }, [openDelay]);
4717
- const handleLeave = useCallback4(() => {
5013
+ const handleLeave = useCallback5(() => {
4718
5014
  clearTimeout(openTimer.current);
4719
5015
  closeTimer.current = setTimeout(() => setOpen(false), closeDelay);
4720
5016
  }, [closeDelay]);
@@ -4725,7 +5021,7 @@ function HoverCardRoot({
4725
5021
  },
4726
5022
  []
4727
5023
  );
4728
- return /* @__PURE__ */ jsx12(HoverCardContext.Provider, { value: { open, triggerRef }, children: /* @__PURE__ */ jsx12(
5024
+ return /* @__PURE__ */ jsx13(HoverCardContext.Provider, { value: { open, triggerRef }, children: /* @__PURE__ */ jsx13(
4729
5025
  "div",
4730
5026
  {
4731
5027
  ref: triggerRef,
@@ -4737,7 +5033,7 @@ function HoverCardRoot({
4737
5033
  ) });
4738
5034
  }
4739
5035
  function HoverCardTrigger({ children }) {
4740
- return /* @__PURE__ */ jsx12(Fragment, { children });
5036
+ return /* @__PURE__ */ jsx13(Fragment, { children });
4741
5037
  }
4742
5038
  function HoverCardContent({
4743
5039
  children,
@@ -4747,7 +5043,7 @@ function HoverCardContent({
4747
5043
  sideOffset = 6
4748
5044
  }) {
4749
5045
  const { open, triggerRef } = useContext2(HoverCardContext);
4750
- const [pos, setPos] = useState4(null);
5046
+ const [pos, setPos] = useState5(null);
4751
5047
  const contentRef = useRef(null);
4752
5048
  useEffect(() => {
4753
5049
  if (!open || !triggerRef.current) {
@@ -4775,7 +5071,7 @@ function HoverCardContent({
4775
5071
  setPos({ top, left });
4776
5072
  }, [open, side, align, sideOffset, triggerRef]);
4777
5073
  if (!open) return null;
4778
- return /* @__PURE__ */ jsx12(
5074
+ return /* @__PURE__ */ jsx13(
4779
5075
  "div",
4780
5076
  {
4781
5077
  ref: contentRef,
@@ -4798,28 +5094,28 @@ function HoverCardPortal({ children }) {
4798
5094
  }
4799
5095
 
4800
5096
  // src/ui/components/ConfigReview.tsx
4801
- import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
5097
+ import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
4802
5098
  function SummaryRow({
4803
5099
  icon: Icon2,
4804
5100
  label,
4805
5101
  onEdit,
4806
5102
  children
4807
5103
  }) {
4808
- return /* @__PURE__ */ jsxs7("div", { className: "group flex items-start gap-3 py-3", children: [
4809
- /* @__PURE__ */ jsx13(Icon2, { className: "h-4 w-4 mt-0.5 text-muted-foreground shrink-0" }),
4810
- /* @__PURE__ */ jsxs7("div", { className: "flex-1 min-w-0", children: [
4811
- /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-2 mb-1", children: [
4812
- /* @__PURE__ */ jsx13("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: label }),
4813
- onEdit && /* @__PURE__ */ jsx13(
5104
+ return /* @__PURE__ */ jsxs8("div", { className: "group flex items-start gap-3 py-3", children: [
5105
+ /* @__PURE__ */ jsx14(Icon2, { className: "h-4 w-4 mt-0.5 text-muted-foreground shrink-0" }),
5106
+ /* @__PURE__ */ jsxs8("div", { className: "flex-1 min-w-0", children: [
5107
+ /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2 mb-1", children: [
5108
+ /* @__PURE__ */ jsx14("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: label }),
5109
+ onEdit && /* @__PURE__ */ jsx14(
4814
5110
  "button",
4815
5111
  {
4816
5112
  onClick: onEdit,
4817
5113
  className: "opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",
4818
- children: /* @__PURE__ */ jsx13(Pencil, { className: "h-3 w-3" })
5114
+ children: /* @__PURE__ */ jsx14(Pencil, { className: "h-3 w-3" })
4819
5115
  }
4820
5116
  )
4821
5117
  ] }),
4822
- /* @__PURE__ */ jsx13("div", { className: "text-sm", children })
5118
+ /* @__PURE__ */ jsx14("div", { className: "text-sm", children })
4823
5119
  ] })
4824
5120
  ] });
4825
5121
  }
@@ -4830,10 +5126,10 @@ function InlineEdit({
4830
5126
  multiline,
4831
5127
  placeholder
4832
5128
  }) {
4833
- const [draft, setDraft] = useState5(value);
5129
+ const [draft, setDraft] = useState6(value);
4834
5130
  const InputTag = multiline ? "textarea" : "input";
4835
- return /* @__PURE__ */ jsxs7("div", { className: "flex gap-1.5 items-start", children: [
4836
- /* @__PURE__ */ jsx13(
5131
+ return /* @__PURE__ */ jsxs8("div", { className: "flex gap-1.5 items-start", children: [
5132
+ /* @__PURE__ */ jsx14(
4837
5133
  InputTag,
4838
5134
  {
4839
5135
  className: cn(
@@ -4853,24 +5149,140 @@ function InlineEdit({
4853
5149
  }
4854
5150
  }
4855
5151
  ),
4856
- /* @__PURE__ */ jsx13(
5152
+ /* @__PURE__ */ jsx14(
4857
5153
  "button",
4858
5154
  {
4859
5155
  onClick: () => onSave(draft),
4860
5156
  className: "h-7 w-7 rounded flex items-center justify-center border hover:bg-accent shrink-0",
4861
- children: /* @__PURE__ */ jsx13(Check, { className: "h-3.5 w-3.5" })
5157
+ children: /* @__PURE__ */ jsx14(Check, { className: "h-3.5 w-3.5" })
4862
5158
  }
4863
5159
  ),
4864
- /* @__PURE__ */ jsx13(
5160
+ /* @__PURE__ */ jsx14(
4865
5161
  "button",
4866
5162
  {
4867
5163
  onClick: onCancel,
4868
5164
  className: "h-7 w-7 rounded flex items-center justify-center border hover:bg-accent shrink-0",
4869
- children: /* @__PURE__ */ jsx13(X, { className: "h-3.5 w-3.5" })
5165
+ children: /* @__PURE__ */ jsx14(X, { className: "h-3.5 w-3.5" })
4870
5166
  }
4871
5167
  )
4872
5168
  ] });
4873
5169
  }
5170
+ function RepositoryEdit({
5171
+ project,
5172
+ onSave,
5173
+ onCancel
5174
+ }) {
5175
+ const initialMode = getRepositoryMode(project);
5176
+ const [mode, setMode] = useState6(initialMode);
5177
+ const [repoUrl, setRepoUrl] = useState6(getRepositoryUrl(project));
5178
+ const [repoRef, setRepoRef] = useState6(getRepositoryRef(project, initialMode));
5179
+ const chooseMode = (next) => {
5180
+ setMode(next);
5181
+ if (next === "external" && (!repoRef.trim() || repoRef.trim() === "main")) {
5182
+ setRepoRef("origin/main");
5183
+ }
5184
+ if (next === "new" && (!repoRef.trim() || repoRef.trim().startsWith("origin/"))) {
5185
+ setRepoRef("main");
5186
+ }
5187
+ };
5188
+ const externalRepoMissing = mode === "external" && !repoUrl.trim();
5189
+ const save = () => {
5190
+ if (externalRepoMissing) return;
5191
+ onSave(repositoryProjectFields(mode, repoUrl, repoRef));
5192
+ };
5193
+ const modeButton = (value, Icon2, label) => /* @__PURE__ */ jsxs8(
5194
+ "button",
5195
+ {
5196
+ type: "button",
5197
+ onClick: () => chooseMode(value),
5198
+ className: cn(
5199
+ "flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs transition-colors",
5200
+ mode === value ? "border-foreground/30 bg-accent text-foreground" : "border-border text-muted-foreground hover:bg-accent/50"
5201
+ ),
5202
+ children: [
5203
+ /* @__PURE__ */ jsx14(Icon2, { className: "h-3.5 w-3.5" }),
5204
+ label
5205
+ ]
5206
+ }
5207
+ );
5208
+ const inputClass = "flex w-full rounded-md border border-input bg-transparent px-2 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring";
5209
+ return /* @__PURE__ */ jsxs8("div", { className: "space-y-2.5 py-1", children: [
5210
+ /* @__PURE__ */ jsxs8("div", { className: "flex gap-2", children: [
5211
+ modeButton("new", CirclePlus, "New repository"),
5212
+ modeButton("external", Github, "Existing repository")
5213
+ ] }),
5214
+ mode === "external" ? /* @__PURE__ */ jsxs8("div", { className: "space-y-2", children: [
5215
+ /* @__PURE__ */ jsx14(
5216
+ "input",
5217
+ {
5218
+ className: inputClass,
5219
+ value: repoUrl,
5220
+ onChange: (e) => setRepoUrl(e.target.value),
5221
+ placeholder: "https://github.com/org/repo",
5222
+ autoFocus: true,
5223
+ onKeyDown: (e) => {
5224
+ if (e.key === "Enter") save();
5225
+ if (e.key === "Escape") onCancel();
5226
+ }
5227
+ }
5228
+ ),
5229
+ /* @__PURE__ */ jsx14(
5230
+ "input",
5231
+ {
5232
+ className: inputClass,
5233
+ value: repoRef,
5234
+ onChange: (e) => setRepoRef(e.target.value),
5235
+ placeholder: "Default ref (e.g. origin/main)",
5236
+ onKeyDown: (e) => {
5237
+ if (e.key === "Enter") save();
5238
+ if (e.key === "Escape") onCancel();
5239
+ }
5240
+ }
5241
+ ),
5242
+ /* @__PURE__ */ jsx14("p", { className: "text-xs text-muted-foreground", children: "Do not paste tokens or credentials. Configure provider access as company secrets." })
5243
+ ] }) : /* @__PURE__ */ jsx14(
5244
+ "input",
5245
+ {
5246
+ className: inputClass,
5247
+ value: repoRef,
5248
+ onChange: (e) => setRepoRef(e.target.value),
5249
+ placeholder: "Initial branch (e.g. main)",
5250
+ autoFocus: true,
5251
+ onKeyDown: (e) => {
5252
+ if (e.key === "Enter") save();
5253
+ if (e.key === "Escape") onCancel();
5254
+ }
5255
+ }
5256
+ ),
5257
+ /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-1.5", children: [
5258
+ /* @__PURE__ */ jsxs8(
5259
+ "button",
5260
+ {
5261
+ type: "button",
5262
+ onClick: save,
5263
+ disabled: externalRepoMissing,
5264
+ className: "flex items-center gap-1 text-xs px-2 py-1 rounded border hover:bg-accent disabled:opacity-50",
5265
+ children: [
5266
+ /* @__PURE__ */ jsx14(Check, { className: "h-3 w-3" }),
5267
+ " Save"
5268
+ ]
5269
+ }
5270
+ ),
5271
+ /* @__PURE__ */ jsxs8(
5272
+ "button",
5273
+ {
5274
+ type: "button",
5275
+ onClick: onCancel,
5276
+ className: "flex items-center gap-1 text-xs px-2 py-1 rounded border hover:bg-accent",
5277
+ children: [
5278
+ /* @__PURE__ */ jsx14(X, { className: "h-3 w-3" }),
5279
+ " Cancel"
5280
+ ]
5281
+ }
5282
+ )
5283
+ ] })
5284
+ ] });
5285
+ }
4874
5286
  function ModuleDetail({ mod, allRoleNames }) {
4875
5287
  const moduleIssues = mod.issues ?? mod.tasks ?? [];
4876
5288
  const hasCapabilities = mod.capabilities && mod.capabilities.length > 0;
@@ -4878,11 +5290,11 @@ function ModuleDetail({ mod, allRoleNames }) {
4878
5290
  const hasRequires = mod.requires && mod.requires.length > 0;
4879
5291
  const hasRoleGating = mod.activatesWithRoles && mod.activatesWithRoles.length > 0;
4880
5292
  const isGated = hasRoleGating && !mod.activatesWithRoles.some((r2) => allRoleNames.has(r2));
4881
- return /* @__PURE__ */ jsxs7("div", { className: cn("rounded-lg border p-3 space-y-2.5", isGated && "opacity-50"), children: [
4882
- /* @__PURE__ */ jsxs7("div", { children: [
4883
- /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-2", children: [
4884
- /* @__PURE__ */ jsx13("span", { className: "text-sm font-medium", children: mod.name }),
4885
- isGated && /* @__PURE__ */ jsx13(
5293
+ return /* @__PURE__ */ jsxs8("div", { className: cn("rounded-lg border p-3 space-y-2.5", isGated && "opacity-50"), children: [
5294
+ /* @__PURE__ */ jsxs8("div", { children: [
5295
+ /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
5296
+ /* @__PURE__ */ jsx14("span", { className: "text-sm font-medium", children: mod.name }),
5297
+ isGated && /* @__PURE__ */ jsx14(
4886
5298
  Badge,
4887
5299
  {
4888
5300
  variant: "outline",
@@ -4891,37 +5303,37 @@ function ModuleDetail({ mod, allRoleNames }) {
4891
5303
  }
4892
5304
  )
4893
5305
  ] }),
4894
- mod.description && /* @__PURE__ */ jsx13("p", { className: "text-xs text-muted-foreground mt-0.5", children: mod.description })
5306
+ mod.description && /* @__PURE__ */ jsx14("p", { className: "text-xs text-muted-foreground mt-0.5", children: mod.description })
4895
5307
  ] }),
4896
- hasRequires && /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
4897
- /* @__PURE__ */ jsx13(Layers, { className: "h-3 w-3 shrink-0" }),
4898
- /* @__PURE__ */ jsxs7("span", { children: [
5308
+ hasRequires && /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
5309
+ /* @__PURE__ */ jsx14(Layers, { className: "h-3 w-3 shrink-0" }),
5310
+ /* @__PURE__ */ jsxs8("span", { children: [
4899
5311
  "Requires: ",
4900
5312
  mod.requires.join(", ")
4901
5313
  ] })
4902
5314
  ] }),
4903
- hasRoleGating && /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
4904
- /* @__PURE__ */ jsx13(Shield, { className: "h-3 w-3 shrink-0" }),
4905
- /* @__PURE__ */ jsxs7("span", { children: [
5315
+ hasRoleGating && /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
5316
+ /* @__PURE__ */ jsx14(Shield, { className: "h-3 w-3 shrink-0" }),
5317
+ /* @__PURE__ */ jsxs8("span", { children: [
4906
5318
  "Activates with: ",
4907
5319
  mod.activatesWithRoles.join(", ")
4908
5320
  ] })
4909
5321
  ] }),
4910
- hasCapabilities && /* @__PURE__ */ jsxs7("div", { className: "space-y-1", children: [
4911
- /* @__PURE__ */ jsxs7("p", { className: "text-[10px] font-medium text-muted-foreground uppercase tracking-wider flex items-center gap-1", children: [
4912
- /* @__PURE__ */ jsx13(Workflow, { className: "h-3 w-3" }),
5322
+ hasCapabilities && /* @__PURE__ */ jsxs8("div", { className: "space-y-1", children: [
5323
+ /* @__PURE__ */ jsxs8("p", { className: "text-[10px] font-medium text-muted-foreground uppercase tracking-wider flex items-center gap-1", children: [
5324
+ /* @__PURE__ */ jsx14(Workflow, { className: "h-3 w-3" }),
4913
5325
  " Capabilities"
4914
5326
  ] }),
4915
- /* @__PURE__ */ jsx13("div", { className: "space-y-1", children: mod.capabilities.map((cap) => /* @__PURE__ */ jsxs7(
5327
+ /* @__PURE__ */ jsx14("div", { className: "space-y-1", children: mod.capabilities.map((cap) => /* @__PURE__ */ jsxs8(
4916
5328
  "div",
4917
5329
  {
4918
5330
  className: "flex items-start gap-2 rounded bg-accent/50 px-2 py-1.5",
4919
5331
  children: [
4920
- /* @__PURE__ */ jsx13(Wrench, { className: "h-3 w-3 mt-0.5 text-muted-foreground shrink-0" }),
4921
- /* @__PURE__ */ jsxs7("div", { className: "text-xs", children: [
4922
- /* @__PURE__ */ jsx13("span", { className: "font-medium", children: cap.skill }),
4923
- /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground ml-1.5", children: cap.owners.join(" \u2192 ") }),
4924
- cap.fallbackSkill && /* @__PURE__ */ jsxs7("span", { className: "text-muted-foreground ml-1", children: [
5332
+ /* @__PURE__ */ jsx14(Wrench, { className: "h-3 w-3 mt-0.5 text-muted-foreground shrink-0" }),
5333
+ /* @__PURE__ */ jsxs8("div", { className: "text-xs", children: [
5334
+ /* @__PURE__ */ jsx14("span", { className: "font-medium", children: cap.skill }),
5335
+ /* @__PURE__ */ jsx14("span", { className: "text-muted-foreground ml-1.5", children: cap.owners.join(" \u2192 ") }),
5336
+ cap.fallbackSkill && /* @__PURE__ */ jsxs8("span", { className: "text-muted-foreground ml-1", children: [
4925
5337
  "(fallback: ",
4926
5338
  cap.fallbackSkill,
4927
5339
  ")"
@@ -4932,24 +5344,24 @@ function ModuleDetail({ mod, allRoleNames }) {
4932
5344
  cap.skill
4933
5345
  )) })
4934
5346
  ] }),
4935
- hasTasks && /* @__PURE__ */ jsxs7("div", { className: "space-y-1", children: [
4936
- /* @__PURE__ */ jsxs7("p", { className: "text-[10px] font-medium text-muted-foreground uppercase tracking-wider flex items-center gap-1", children: [
4937
- /* @__PURE__ */ jsx13(ListChecks, { className: "h-3 w-3" }),
5347
+ hasTasks && /* @__PURE__ */ jsxs8("div", { className: "space-y-1", children: [
5348
+ /* @__PURE__ */ jsxs8("p", { className: "text-[10px] font-medium text-muted-foreground uppercase tracking-wider flex items-center gap-1", children: [
5349
+ /* @__PURE__ */ jsx14(ListChecks, { className: "h-3 w-3" }),
4938
5350
  " Initial tasks"
4939
5351
  ] }),
4940
- /* @__PURE__ */ jsx13("div", { className: "space-y-1", children: moduleIssues.map((task) => /* @__PURE__ */ jsxs7(
5352
+ /* @__PURE__ */ jsx14("div", { className: "space-y-1", children: moduleIssues.map((task) => /* @__PURE__ */ jsxs8(
4941
5353
  "div",
4942
5354
  {
4943
5355
  className: "flex items-start gap-2 rounded bg-accent/50 px-2 py-1.5",
4944
5356
  children: [
4945
- /* @__PURE__ */ jsx13(ChevronRight, { className: "h-3 w-3 mt-0.5 text-muted-foreground shrink-0" }),
4946
- /* @__PURE__ */ jsxs7("div", { className: "text-xs", children: [
4947
- /* @__PURE__ */ jsx13("span", { className: "font-medium", children: task.title }),
4948
- /* @__PURE__ */ jsxs7("span", { className: "text-muted-foreground ml-1.5", children: [
5357
+ /* @__PURE__ */ jsx14(ChevronRight, { className: "h-3 w-3 mt-0.5 text-muted-foreground shrink-0" }),
5358
+ /* @__PURE__ */ jsxs8("div", { className: "text-xs", children: [
5359
+ /* @__PURE__ */ jsx14("span", { className: "font-medium", children: task.title }),
5360
+ /* @__PURE__ */ jsxs8("span", { className: "text-muted-foreground ml-1.5", children: [
4949
5361
  "\u2192 ",
4950
5362
  task.assignTo
4951
5363
  ] }),
4952
- task.description && /* @__PURE__ */ jsx13("p", { className: "text-muted-foreground mt-0.5", children: task.description })
5364
+ task.description && /* @__PURE__ */ jsx14("p", { className: "text-muted-foreground mt-0.5", children: task.description })
4953
5365
  ] })
4954
5366
  ]
4955
5367
  },
@@ -4960,35 +5372,35 @@ function ModuleDetail({ mod, allRoleNames }) {
4960
5372
  }
4961
5373
  function RoleDetail({ role }) {
4962
5374
  const adapter = role.adapter;
4963
- return /* @__PURE__ */ jsxs7("div", { className: "rounded-lg border p-3 space-y-2", children: [
4964
- /* @__PURE__ */ jsxs7("div", { children: [
4965
- /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-2", children: [
4966
- role._base && /* @__PURE__ */ jsx13(Crown, { className: "h-3.5 w-3.5 text-muted-foreground" }),
4967
- /* @__PURE__ */ jsx13("span", { className: "text-sm font-medium", children: role.title }),
4968
- /* @__PURE__ */ jsx13("span", { className: "text-xs text-muted-foreground", children: role.name })
5375
+ return /* @__PURE__ */ jsxs8("div", { className: "rounded-lg border p-3 space-y-2", children: [
5376
+ /* @__PURE__ */ jsxs8("div", { children: [
5377
+ /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
5378
+ role._base && /* @__PURE__ */ jsx14(Crown, { className: "h-3.5 w-3.5 text-muted-foreground" }),
5379
+ /* @__PURE__ */ jsx14("span", { className: "text-sm font-medium", children: role.title }),
5380
+ /* @__PURE__ */ jsx14("span", { className: "text-xs text-muted-foreground", children: role.name })
4969
5381
  ] }),
4970
- /* @__PURE__ */ jsx13("p", { className: "text-xs text-muted-foreground mt-0.5", children: role.description })
5382
+ /* @__PURE__ */ jsx14("p", { className: "text-xs text-muted-foreground mt-0.5", children: role.description })
4971
5383
  ] }),
4972
- /* @__PURE__ */ jsxs7("div", { className: "flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground", children: [
4973
- role.paperclipRole && /* @__PURE__ */ jsxs7("span", { className: "flex items-center gap-1", children: [
4974
- /* @__PURE__ */ jsx13(Cpu, { className: "h-3 w-3" }),
5384
+ /* @__PURE__ */ jsxs8("div", { className: "flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground", children: [
5385
+ role.paperclipRole && /* @__PURE__ */ jsxs8("span", { className: "flex items-center gap-1", children: [
5386
+ /* @__PURE__ */ jsx14(Cpu, { className: "h-3 w-3" }),
4975
5387
  role.paperclipRole
4976
5388
  ] }),
4977
- role.reportsTo && /* @__PURE__ */ jsxs7("span", { className: "flex items-center gap-1", children: [
4978
- /* @__PURE__ */ jsx13(ArrowUpRight, { className: "h-3 w-3" }),
5389
+ role.reportsTo && /* @__PURE__ */ jsxs8("span", { className: "flex items-center gap-1", children: [
5390
+ /* @__PURE__ */ jsx14(ArrowUpRight, { className: "h-3 w-3" }),
4979
5391
  "reports to ",
4980
5392
  role.reportsTo
4981
5393
  ] }),
4982
- adapter?.model && /* @__PURE__ */ jsxs7("span", { className: "flex items-center gap-1", children: [
4983
- /* @__PURE__ */ jsx13(Wrench, { className: "h-3 w-3" }),
5394
+ adapter?.model && /* @__PURE__ */ jsxs8("span", { className: "flex items-center gap-1", children: [
5395
+ /* @__PURE__ */ jsx14(Wrench, { className: "h-3 w-3" }),
4984
5396
  adapter.model,
4985
5397
  adapter.effort && ` (${adapter.effort})`
4986
5398
  ] })
4987
5399
  ] }),
4988
- role.enhances && role.enhances.length > 0 && /* @__PURE__ */ jsxs7("div", { className: "space-y-1", children: [
4989
- /* @__PURE__ */ jsx13("p", { className: "text-[10px] font-medium text-muted-foreground uppercase tracking-wider", children: "Enhances" }),
4990
- /* @__PURE__ */ jsx13("ul", { className: "space-y-0.5", children: role.enhances.map((e, i) => /* @__PURE__ */ jsxs7("li", { className: "text-xs text-muted-foreground flex items-start gap-1.5", children: [
4991
- /* @__PURE__ */ jsx13("span", { className: "text-foreground/30 mt-px", children: "\xB7" }),
5400
+ role.enhances && role.enhances.length > 0 && /* @__PURE__ */ jsxs8("div", { className: "space-y-1", children: [
5401
+ /* @__PURE__ */ jsx14("p", { className: "text-[10px] font-medium text-muted-foreground uppercase tracking-wider", children: "Enhances" }),
5402
+ /* @__PURE__ */ jsx14("ul", { className: "space-y-0.5", children: role.enhances.map((e, i) => /* @__PURE__ */ jsxs8("li", { className: "text-xs text-muted-foreground flex items-start gap-1.5", children: [
5403
+ /* @__PURE__ */ jsx14("span", { className: "text-foreground/30 mt-px", children: "\xB7" }),
4992
5404
  e
4993
5405
  ] }, i)) })
4994
5406
  ] })
@@ -5021,9 +5433,9 @@ function FileEntry({
5021
5433
  onSaveOverride,
5022
5434
  onResetOverride
5023
5435
  }) {
5024
- const [expanded, setExpanded] = useState5(false);
5025
- const [editing, setEditing] = useState5(false);
5026
- const [draft, setDraft] = useState5(override ?? content);
5436
+ const [expanded, setExpanded] = useState6(false);
5437
+ const [editing, setEditing] = useState6(false);
5438
+ const [draft, setDraft] = useState6(override ?? content);
5027
5439
  const parts = filePath.split("/");
5028
5440
  const fileName = parts.length >= 3 && parts[0] === "agents" ? parts.slice(2).join("/") : parts.pop();
5029
5441
  const hasOverride = override !== void 0;
@@ -5046,12 +5458,12 @@ function FileEntry({
5046
5458
  setEditing(false);
5047
5459
  };
5048
5460
  const displayContent = override ?? content;
5049
- return /* @__PURE__ */ jsxs7(
5461
+ return /* @__PURE__ */ jsxs8(
5050
5462
  "div",
5051
5463
  {
5052
5464
  className: cn("rounded border", hasOverride && "border-blue-400/60 dark:border-blue-500/50"),
5053
5465
  children: [
5054
- /* @__PURE__ */ jsxs7(
5466
+ /* @__PURE__ */ jsxs8(
5055
5467
  "button",
5056
5468
  {
5057
5469
  className: "w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-accent/50 transition-colors",
@@ -5059,12 +5471,12 @@ function FileEntry({
5059
5471
  if (!editing) setExpanded((v) => !v);
5060
5472
  },
5061
5473
  children: [
5062
- /* @__PURE__ */ jsx13(FileText, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }),
5063
- /* @__PURE__ */ jsxs7("span", { className: "text-xs font-medium flex-1 min-w-0 truncate", children: [
5474
+ /* @__PURE__ */ jsx14(FileText, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }),
5475
+ /* @__PURE__ */ jsxs8("span", { className: "text-xs font-medium flex-1 min-w-0 truncate", children: [
5064
5476
  fileName,
5065
- hasOverride && /* @__PURE__ */ jsx13("span", { className: "ml-1.5 text-[10px] text-blue-600 dark:text-blue-400 font-normal", children: "edited" })
5477
+ hasOverride && /* @__PURE__ */ jsx14("span", { className: "ml-1.5 text-[10px] text-blue-600 dark:text-blue-400 font-normal", children: "edited" })
5066
5478
  ] }),
5067
- !editing && /* @__PURE__ */ jsx13(
5479
+ !editing && /* @__PURE__ */ jsx14(
5068
5480
  "span",
5069
5481
  {
5070
5482
  role: "button",
@@ -5080,15 +5492,15 @@ function FileEntry({
5080
5492
  }
5081
5493
  },
5082
5494
  className: "opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground p-0.5 rounded",
5083
- children: /* @__PURE__ */ jsx13(Pencil, { className: "h-3 w-3" })
5495
+ children: /* @__PURE__ */ jsx14(Pencil, { className: "h-3 w-3" })
5084
5496
  }
5085
5497
  ),
5086
- !editing && (expanded ? /* @__PURE__ */ jsx13(ChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }) : /* @__PURE__ */ jsx13(ChevronRight, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }))
5498
+ !editing && (expanded ? /* @__PURE__ */ jsx14(ChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }) : /* @__PURE__ */ jsx14(ChevronRight, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }))
5087
5499
  ]
5088
5500
  }
5089
5501
  ),
5090
- (expanded || editing) && /* @__PURE__ */ jsx13("div", { className: "border-t", children: editing ? /* @__PURE__ */ jsxs7("div", { className: "p-2 space-y-1.5", children: [
5091
- /* @__PURE__ */ jsx13(
5502
+ (expanded || editing) && /* @__PURE__ */ jsx14("div", { className: "border-t", children: editing ? /* @__PURE__ */ jsxs8("div", { className: "p-2 space-y-1.5", children: [
5503
+ /* @__PURE__ */ jsx14(
5092
5504
  "textarea",
5093
5505
  {
5094
5506
  className: "w-full font-mono text-xs rounded border border-input bg-transparent px-2 py-1.5 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring resize-y",
@@ -5098,50 +5510,50 @@ function FileEntry({
5098
5510
  autoFocus: true
5099
5511
  }
5100
5512
  ),
5101
- /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-1.5", children: [
5102
- /* @__PURE__ */ jsxs7(
5513
+ /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-1.5", children: [
5514
+ /* @__PURE__ */ jsxs8(
5103
5515
  "button",
5104
5516
  {
5105
5517
  onClick: handleSave,
5106
5518
  className: "flex items-center gap-1 text-xs px-2 py-1 rounded border hover:bg-accent",
5107
5519
  children: [
5108
- /* @__PURE__ */ jsx13(Check, { className: "h-3 w-3" }),
5520
+ /* @__PURE__ */ jsx14(Check, { className: "h-3 w-3" }),
5109
5521
  " Save"
5110
5522
  ]
5111
5523
  }
5112
5524
  ),
5113
- /* @__PURE__ */ jsxs7(
5525
+ /* @__PURE__ */ jsxs8(
5114
5526
  "button",
5115
5527
  {
5116
5528
  onClick: handleCancel,
5117
5529
  className: "flex items-center gap-1 text-xs px-2 py-1 rounded border hover:bg-accent",
5118
5530
  children: [
5119
- /* @__PURE__ */ jsx13(X, { className: "h-3 w-3" }),
5531
+ /* @__PURE__ */ jsx14(X, { className: "h-3 w-3" }),
5120
5532
  " Cancel"
5121
5533
  ]
5122
5534
  }
5123
5535
  ),
5124
- hasOverride && /* @__PURE__ */ jsxs7(
5536
+ hasOverride && /* @__PURE__ */ jsxs8(
5125
5537
  "button",
5126
5538
  {
5127
5539
  onClick: handleReset,
5128
5540
  className: "flex items-center gap-1 text-xs px-2 py-1 rounded border hover:bg-accent text-muted-foreground ml-auto",
5129
5541
  children: [
5130
- /* @__PURE__ */ jsx13(RotateCcw, { className: "h-3 w-3" }),
5542
+ /* @__PURE__ */ jsx14(RotateCcw, { className: "h-3 w-3" }),
5131
5543
  " Reset to default"
5132
5544
  ]
5133
5545
  }
5134
5546
  )
5135
5547
  ] })
5136
- ] }) : /* @__PURE__ */ jsxs7("div", { className: "group relative", children: [
5137
- /* @__PURE__ */ jsx13("pre", { className: "p-3 font-mono text-xs overflow-x-auto whitespace-pre-wrap wrap-break-word text-muted-foreground max-h-[400px] overflow-y-auto", children: displayContent }),
5138
- /* @__PURE__ */ jsxs7(
5548
+ ] }) : /* @__PURE__ */ jsxs8("div", { className: "group relative", children: [
5549
+ /* @__PURE__ */ jsx14("pre", { className: "p-3 font-mono text-xs overflow-x-auto whitespace-pre-wrap wrap-break-word text-muted-foreground max-h-[400px] overflow-y-auto", children: displayContent }),
5550
+ /* @__PURE__ */ jsxs8(
5139
5551
  "button",
5140
5552
  {
5141
5553
  onClick: handleEdit,
5142
5554
  className: "absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity flex items-center gap-1 text-xs px-1.5 py-0.5 rounded border bg-background hover:bg-accent",
5143
5555
  children: [
5144
- /* @__PURE__ */ jsx13(Pencil, { className: "h-3 w-3" }),
5556
+ /* @__PURE__ */ jsx14(Pencil, { className: "h-3 w-3" }),
5145
5557
  " Edit"
5146
5558
  ]
5147
5559
  }
@@ -5154,14 +5566,15 @@ function FileEntry({
5154
5566
  function ConfigReview() {
5155
5567
  const state = useWizard();
5156
5568
  const dispatch = useWizardDispatch();
5157
- const [editing, setEditing] = useState5(null);
5158
- const [showDetails, setShowDetails] = useState5(false);
5159
- const [showFiles, setShowFiles] = useState5(false);
5160
- const [loadingFiles, setLoadingFiles] = useState5(false);
5161
- const [previewFiles, setPreviewFiles] = useState5(null);
5162
- const [previewError, setPreviewError] = useState5(null);
5569
+ const [editing, setEditing] = useState6(null);
5570
+ const [showDetails, setShowDetails] = useState6(false);
5571
+ const [showFiles, setShowFiles] = useState6(false);
5572
+ const [loadingFiles, setLoadingFiles] = useState6(false);
5573
+ const [previewFiles, setPreviewFiles] = useState6(null);
5574
+ const [previewError, setPreviewError] = useState6(null);
5575
+ const lastPreviewRepoFingerprint = useRef2("");
5163
5576
  const previewFilesAction = usePluginAction2("preview-files");
5164
- const loadPreview = useCallback5(async () => {
5577
+ const loadPreview = useCallback6(async () => {
5165
5578
  setLoadingFiles(true);
5166
5579
  setPreviewError(null);
5167
5580
  try {
@@ -5171,7 +5584,8 @@ function ConfigReview() {
5171
5584
  selectedModules: state.selectedModules,
5172
5585
  selectedRoles: state.selectedRoles,
5173
5586
  goals: state.goals.length > 0 ? state.goals : void 0,
5174
- projects: state.projects.length > 0 ? state.projects : void 0
5587
+ projects: state.projects.length > 0 ? state.projects : void 0,
5588
+ issues: state.issues.length > 0 ? state.issues : void 0
5175
5589
  });
5176
5590
  if (result.error) {
5177
5591
  setPreviewError(result.error);
@@ -5190,6 +5604,7 @@ function ConfigReview() {
5190
5604
  state.selectedRoles,
5191
5605
  state.goals,
5192
5606
  state.projects,
5607
+ state.issues,
5193
5608
  previewFilesAction
5194
5609
  ]);
5195
5610
  const allRoles = getAllRoles(state);
@@ -5207,6 +5622,12 @@ function ConfigReview() {
5207
5622
  const baseRoleNames = state.roles.filter((r2) => r2._base).map((r2) => r2.name);
5208
5623
  const activeRoleData = state.roles.filter((r2) => r2._base || selectedRoleSet.has(r2.name));
5209
5624
  const selectedModuleData = state.modules.filter((m) => selectedModSet.has(m.name));
5625
+ const primaryProject = state.projects[0];
5626
+ const primaryWorkspace = primaryProject?.workspace;
5627
+ const primaryRepoUrl = primaryWorkspace?.repoUrl || primaryProject?.repoUrl || "";
5628
+ const primaryRepoRef = primaryWorkspace?.defaultRef || primaryWorkspace?.repoRef || primaryProject?.defaultRef || primaryProject?.repoRef || "";
5629
+ const isExternalRepo = isExternalRepository(primaryProject);
5630
+ const repositoryFingerprint = `${isExternalRepo ? "external" : "new"}|${primaryWorkspace?.sourceType || primaryProject?.workspaceSourceType || ""}|${primaryRepoUrl}|${primaryRepoRef}|${primaryWorkspace?.defaultRef || ""}|${primaryWorkspace?.setupCommand || ""}`;
5210
5631
  const totalCapabilities = selectedModuleData.reduce(
5211
5632
  (sum, m) => sum + (m.capabilities?.length ?? 0),
5212
5633
  0
@@ -5233,9 +5654,31 @@ function ConfigReview() {
5233
5654
  else next.add(name);
5234
5655
  dispatch({ type: "SET_ROLES", roles: [...next] });
5235
5656
  };
5236
- return /* @__PURE__ */ jsxs7(Fragment2, { children: [
5237
- /* @__PURE__ */ jsx13(Card, { children: /* @__PURE__ */ jsxs7(CardContent, { className: "divide-y p-0", children: [
5238
- /* @__PURE__ */ jsx13("div", { className: "px-4", children: /* @__PURE__ */ jsx13(SummaryRow, { icon: Building2, label: "Company", onEdit: () => setEditing("name"), children: editing === "name" ? /* @__PURE__ */ jsx13(
5657
+ const refreshPreview = useCallback6(() => {
5658
+ if (!showFiles || loadingFiles) return;
5659
+ if (!previewFiles || lastPreviewRepoFingerprint.current !== repositoryFingerprint) {
5660
+ lastPreviewRepoFingerprint.current = repositoryFingerprint;
5661
+ loadPreview();
5662
+ }
5663
+ }, [loadingFiles, previewFiles, repositoryFingerprint, showFiles, loadPreview]);
5664
+ useEffect2(() => {
5665
+ refreshPreview();
5666
+ }, [refreshPreview]);
5667
+ const saveRepository = (repo) => {
5668
+ const base = primaryProject ?? {
5669
+ name: state.companyName || "Main Project",
5670
+ description: state.goals[0]?.description || "",
5671
+ goals: state.goals.map((g) => g.title).filter(Boolean)
5672
+ };
5673
+ dispatch({
5674
+ type: "SET_PROJECTS",
5675
+ projects: [{ ...base, ...repo }, ...state.projects.slice(1)]
5676
+ });
5677
+ setEditing(null);
5678
+ };
5679
+ return /* @__PURE__ */ jsxs8(Fragment2, { children: [
5680
+ /* @__PURE__ */ jsx14(Card, { children: /* @__PURE__ */ jsxs8(CardContent, { className: "divide-y p-0", children: [
5681
+ /* @__PURE__ */ jsx14("div", { className: "px-4", children: /* @__PURE__ */ jsx14(SummaryRow, { icon: Building2, label: "Company", onEdit: () => setEditing("name"), children: editing === "name" ? /* @__PURE__ */ jsx14(
5239
5682
  InlineEdit,
5240
5683
  {
5241
5684
  value: state.companyName,
@@ -5246,21 +5689,21 @@ function ConfigReview() {
5246
5689
  onCancel: () => setEditing(null),
5247
5690
  placeholder: "Company name"
5248
5691
  }
5249
- ) : /* @__PURE__ */ jsxs7(Fragment2, { children: [
5250
- /* @__PURE__ */ jsx13("span", { className: "font-medium", children: state.companyName || "(unnamed)" }),
5251
- /* @__PURE__ */ jsxs7("span", { className: "text-muted-foreground ml-2", children: [
5692
+ ) : /* @__PURE__ */ jsxs8(Fragment2, { children: [
5693
+ /* @__PURE__ */ jsx14("span", { className: "font-medium", children: state.companyName || "(unnamed)" }),
5694
+ /* @__PURE__ */ jsxs8("span", { className: "text-muted-foreground ml-2", children: [
5252
5695
  "\u2192 ",
5253
5696
  toPascalCase2(state.companyName || "Company"),
5254
5697
  "/"
5255
5698
  ] })
5256
5699
  ] }) }) }),
5257
- /* @__PURE__ */ jsx13("div", { className: "px-4", children: /* @__PURE__ */ jsx13(
5700
+ /* @__PURE__ */ jsx14("div", { className: "px-4", children: /* @__PURE__ */ jsx14(
5258
5701
  SummaryRow,
5259
5702
  {
5260
5703
  icon: ArrowUpRight,
5261
5704
  label: "Target",
5262
5705
  onEdit: () => setEditing("existingCompanyId"),
5263
- children: editing === "existingCompanyId" ? /* @__PURE__ */ jsx13(
5706
+ children: editing === "existingCompanyId" ? /* @__PURE__ */ jsx14(
5264
5707
  InlineEdit,
5265
5708
  {
5266
5709
  value: state.existingCompanyId,
@@ -5271,13 +5714,47 @@ function ConfigReview() {
5271
5714
  onCancel: () => setEditing(null),
5272
5715
  placeholder: "Leave empty to create a new company, or paste existing company ID"
5273
5716
  }
5274
- ) : state.existingCompanyId ? /* @__PURE__ */ jsxs7(Fragment2, { children: [
5275
- /* @__PURE__ */ jsx13("span", { className: "font-medium", children: "Existing company" }),
5276
- /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground ml-2 font-mono text-xs", children: state.existingCompanyId })
5277
- ] }) : /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", children: "Create a new company" })
5717
+ ) : state.existingCompanyId ? /* @__PURE__ */ jsxs8(Fragment2, { children: [
5718
+ /* @__PURE__ */ jsx14("span", { className: "font-medium", children: "Existing company" }),
5719
+ /* @__PURE__ */ jsx14("span", { className: "text-muted-foreground ml-2 font-mono text-xs", children: state.existingCompanyId })
5720
+ ] }) : /* @__PURE__ */ jsx14("span", { className: "text-muted-foreground", children: "Create a new company" })
5278
5721
  }
5279
5722
  ) }),
5280
- /* @__PURE__ */ jsx13("div", { className: "px-4", children: /* @__PURE__ */ jsx13(SummaryRow, { icon: Target, label: "Goal", onEdit: () => setEditing("goal"), children: editing === "goal" ? /* @__PURE__ */ jsx13(
5723
+ /* @__PURE__ */ jsx14("div", { className: "px-4", children: /* @__PURE__ */ jsx14(SummaryRow, { icon: GitBranch, label: "Repository", onEdit: () => setEditing("repository"), children: editing === "repository" ? /* @__PURE__ */ jsx14(
5724
+ RepositoryEdit,
5725
+ {
5726
+ project: primaryProject ?? null,
5727
+ onSave: (repo) => {
5728
+ saveRepository(repo);
5729
+ },
5730
+ onCancel: () => setEditing(null)
5731
+ }
5732
+ ) : /* @__PURE__ */ jsx14(
5733
+ "button",
5734
+ {
5735
+ type: "button",
5736
+ onClick: () => setEditing("repository"),
5737
+ className: "group/repo w-full text-left rounded-md -mx-1 px-1 py-0.5 hover:bg-accent/50 transition-colors",
5738
+ children: isExternalRepo ? /* @__PURE__ */ jsxs8(Fragment2, { children: [
5739
+ /* @__PURE__ */ jsx14("span", { className: "font-medium", children: "External Git repository" }),
5740
+ /* @__PURE__ */ jsx14("span", { className: "ml-2 text-xs text-muted-foreground underline decoration-dotted underline-offset-2 group-hover/repo:text-foreground", children: "Change" }),
5741
+ primaryRepoUrl && /* @__PURE__ */ jsx14("p", { className: "text-xs text-muted-foreground mt-0.5 wrap-break-word", children: primaryRepoUrl }),
5742
+ primaryRepoRef && /* @__PURE__ */ jsxs8("p", { className: "text-xs text-muted-foreground mt-0.5", children: [
5743
+ "Ref: ",
5744
+ primaryRepoRef
5745
+ ] })
5746
+ ] }) : /* @__PURE__ */ jsxs8(Fragment2, { children: [
5747
+ /* @__PURE__ */ jsx14("span", { className: "font-medium", children: "Create a new Git repository" }),
5748
+ /* @__PURE__ */ jsx14("span", { className: "ml-2 text-xs text-muted-foreground underline decoration-dotted underline-offset-2 group-hover/repo:text-foreground", children: "Change \u2014 use an existing repository" }),
5749
+ /* @__PURE__ */ jsxs8("p", { className: "text-xs text-muted-foreground mt-0.5", children: [
5750
+ "Fresh local workspace",
5751
+ primaryRepoRef ? ` on ${primaryRepoRef}` : "",
5752
+ primaryWorkspace?.setupCommand ? ` \xB7 ${primaryWorkspace.setupCommand}` : ""
5753
+ ] })
5754
+ ] })
5755
+ }
5756
+ ) }) }),
5757
+ /* @__PURE__ */ jsx14("div", { className: "px-4", children: /* @__PURE__ */ jsx14(SummaryRow, { icon: Target, label: "Goal", onEdit: () => setEditing("goal"), children: editing === "goal" ? /* @__PURE__ */ jsx14(
5281
5758
  InlineEdit,
5282
5759
  {
5283
5760
  value: state.goals[0]?.title || "",
@@ -5291,9 +5768,9 @@ function ConfigReview() {
5291
5768
  onCancel: () => setEditing(null),
5292
5769
  placeholder: "Goal title"
5293
5770
  }
5294
- ) : editing === "goalDesc" ? /* @__PURE__ */ jsxs7("div", { className: "space-y-1", children: [
5295
- /* @__PURE__ */ jsx13("span", { children: state.goals[0]?.title || "(no goal)" }),
5296
- /* @__PURE__ */ jsx13(
5771
+ ) : editing === "goalDesc" ? /* @__PURE__ */ jsxs8("div", { className: "space-y-1", children: [
5772
+ /* @__PURE__ */ jsx14("span", { children: state.goals[0]?.title || "(no goal)" }),
5773
+ /* @__PURE__ */ jsx14(
5297
5774
  InlineEdit,
5298
5775
  {
5299
5776
  value: state.goals[0]?.description || "",
@@ -5309,21 +5786,21 @@ function ConfigReview() {
5309
5786
  multiline: true
5310
5787
  }
5311
5788
  )
5312
- ] }) : /* @__PURE__ */ jsxs7(Fragment2, { children: [
5313
- /* @__PURE__ */ jsx13("span", { children: state.goals[0]?.title || "(no goal)" }),
5314
- state.goals[0]?.description && /* @__PURE__ */ jsx13("p", { className: "text-xs text-muted-foreground mt-0.5", children: state.goals[0].description }),
5315
- state.goals.length > 1 && /* @__PURE__ */ jsxs7("p", { className: "text-xs text-muted-foreground mt-0.5", children: [
5789
+ ] }) : /* @__PURE__ */ jsxs8(Fragment2, { children: [
5790
+ /* @__PURE__ */ jsx14("span", { children: state.goals[0]?.title || "(no goal)" }),
5791
+ state.goals[0]?.description && /* @__PURE__ */ jsx14("p", { className: "text-xs text-muted-foreground mt-0.5", children: state.goals[0].description }),
5792
+ state.goals.length > 1 && /* @__PURE__ */ jsxs8("p", { className: "text-xs text-muted-foreground mt-0.5", children: [
5316
5793
  "+ ",
5317
5794
  state.goals.length - 1,
5318
5795
  " sub-goal",
5319
5796
  state.goals.length > 2 ? "s" : ""
5320
5797
  ] })
5321
5798
  ] }) }) }),
5322
- /* @__PURE__ */ jsx13("div", { className: "px-4", children: /* @__PURE__ */ jsxs7(SummaryRow, { icon: Blocks, label: `Modules (${activeModules.length})`, children: [
5323
- /* @__PURE__ */ jsx13("div", { className: "flex flex-wrap gap-1.5", children: state.modules.map((m) => {
5799
+ /* @__PURE__ */ jsx14("div", { className: "px-4", children: /* @__PURE__ */ jsxs8(SummaryRow, { icon: Blocks, label: `Modules (${activeModules.length})`, children: [
5800
+ /* @__PURE__ */ jsx14("div", { className: "flex flex-wrap gap-1.5", children: state.modules.map((m) => {
5324
5801
  const isActive = selectedModSet.has(m.name);
5325
- return /* @__PURE__ */ jsxs7(HoverCardRoot, { openDelay: 200, closeDelay: 100, children: [
5326
- /* @__PURE__ */ jsx13(HoverCardTrigger, { asChild: true, children: /* @__PURE__ */ jsx13("button", { onClick: () => toggleModule(m.name), children: /* @__PURE__ */ jsx13(
5802
+ return /* @__PURE__ */ jsxs8(HoverCardRoot, { openDelay: 200, closeDelay: 100, children: [
5803
+ /* @__PURE__ */ jsx14(HoverCardTrigger, { asChild: true, children: /* @__PURE__ */ jsx14("button", { onClick: () => toggleModule(m.name), children: /* @__PURE__ */ jsx14(
5327
5804
  Badge,
5328
5805
  {
5329
5806
  variant: isActive ? "secondary" : "outline",
@@ -5334,28 +5811,28 @@ function ConfigReview() {
5334
5811
  children: m.name
5335
5812
  }
5336
5813
  ) }) }),
5337
- /* @__PURE__ */ jsx13(HoverCardPortal, { children: /* @__PURE__ */ jsx13(
5814
+ /* @__PURE__ */ jsx14(HoverCardPortal, { children: /* @__PURE__ */ jsx14(
5338
5815
  HoverCardContent,
5339
5816
  {
5340
5817
  side: "top",
5341
5818
  align: "center",
5342
5819
  sideOffset: 6,
5343
5820
  className: "z-50 w-80 rounded-lg border bg-popover p-0 shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
5344
- children: /* @__PURE__ */ jsx13(ModuleDetail, { mod: m, allRoleNames })
5821
+ children: /* @__PURE__ */ jsx14(ModuleDetail, { mod: m, allRoleNames })
5345
5822
  }
5346
5823
  ) })
5347
5824
  ] }, m.name);
5348
5825
  }) }),
5349
- (totalTasks > 0 || totalCapabilities > 0) && /* @__PURE__ */ jsx13("p", { className: "text-xs text-muted-foreground mt-1.5", children: [
5826
+ (totalTasks > 0 || totalCapabilities > 0) && /* @__PURE__ */ jsx14("p", { className: "text-xs text-muted-foreground mt-1.5", children: [
5350
5827
  totalTasks > 0 && `${totalTasks} initial tasks`,
5351
5828
  totalCapabilities > 0 && `${totalCapabilities} capabilities`
5352
5829
  ].filter(Boolean).join(" \xB7 ") })
5353
5830
  ] }) }),
5354
- /* @__PURE__ */ jsx13("div", { className: "px-4", children: /* @__PURE__ */ jsx13(SummaryRow, { icon: Users, label: `Team (${allRoles.length} agents)`, children: /* @__PURE__ */ jsx13("div", { className: "flex flex-wrap gap-1.5", children: state.roles.map((role) => {
5831
+ /* @__PURE__ */ jsx14("div", { className: "px-4", children: /* @__PURE__ */ jsx14(SummaryRow, { icon: Users, label: `Team (${allRoles.length} agents)`, children: /* @__PURE__ */ jsx14("div", { className: "flex flex-wrap gap-1.5", children: state.roles.map((role) => {
5355
5832
  const isBase = role._base;
5356
5833
  const isActive = isBase || selectedRoleSet.has(role.name);
5357
- return /* @__PURE__ */ jsxs7(HoverCardRoot, { openDelay: 200, closeDelay: 100, children: [
5358
- /* @__PURE__ */ jsx13(HoverCardTrigger, { asChild: true, children: /* @__PURE__ */ jsx13("button", { onClick: () => toggleRole(role.name), disabled: isBase, children: /* @__PURE__ */ jsx13(
5834
+ return /* @__PURE__ */ jsxs8(HoverCardRoot, { openDelay: 200, closeDelay: 100, children: [
5835
+ /* @__PURE__ */ jsx14(HoverCardTrigger, { asChild: true, children: /* @__PURE__ */ jsx14("button", { onClick: () => toggleRole(role.name), disabled: isBase, children: /* @__PURE__ */ jsx14(
5359
5836
  Badge,
5360
5837
  {
5361
5838
  variant: isActive ? "outline" : "secondary",
@@ -5368,42 +5845,43 @@ function ConfigReview() {
5368
5845
  children: role.title
5369
5846
  }
5370
5847
  ) }) }),
5371
- /* @__PURE__ */ jsx13(HoverCardPortal, { children: /* @__PURE__ */ jsx13(
5848
+ /* @__PURE__ */ jsx14(HoverCardPortal, { children: /* @__PURE__ */ jsx14(
5372
5849
  HoverCardContent,
5373
5850
  {
5374
5851
  side: "top",
5375
5852
  align: "center",
5376
5853
  sideOffset: 6,
5377
5854
  className: "z-50 w-80 rounded-lg border bg-popover p-0 shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
5378
- children: /* @__PURE__ */ jsx13(RoleDetail, { role })
5855
+ children: /* @__PURE__ */ jsx14(RoleDetail, { role })
5379
5856
  }
5380
5857
  ) })
5381
5858
  ] }, role.name);
5382
5859
  }) }) }) })
5383
5860
  ] }) }),
5384
- skippedModules.length > 0 && /* @__PURE__ */ jsxs7("div", { className: "flex items-start gap-2 rounded-lg border border-amber-500/30 bg-amber-500/10 p-3 text-sm", children: [
5385
- /* @__PURE__ */ jsx13(TriangleAlert, { className: "h-4 w-4 text-amber-500 shrink-0 mt-0.5" }),
5386
- /* @__PURE__ */ jsxs7("div", { children: [
5387
- /* @__PURE__ */ jsxs7("p", { className: "font-medium text-amber-800 dark:text-amber-200", children: [
5861
+ skippedModules.length > 0 && /* @__PURE__ */ jsxs8("div", { className: "flex items-start gap-2 rounded-lg border border-amber-500/30 bg-amber-500/10 p-3 text-sm", children: [
5862
+ /* @__PURE__ */ jsx14(TriangleAlert, { className: "h-4 w-4 text-amber-500 shrink-0 mt-0.5" }),
5863
+ /* @__PURE__ */ jsxs8("div", { children: [
5864
+ /* @__PURE__ */ jsxs8("p", { className: "font-medium text-amber-800 dark:text-amber-200", children: [
5388
5865
  skippedModules.length,
5389
5866
  " module(s) will be skipped"
5390
5867
  ] }),
5391
- /* @__PURE__ */ jsxs7("p", { className: "text-xs text-amber-700 dark:text-amber-300 mt-0.5", children: [
5868
+ /* @__PURE__ */ jsxs8("p", { className: "text-xs text-amber-700 dark:text-amber-300 mt-0.5", children: [
5392
5869
  skippedModules.join(", "),
5393
5870
  " \u2014 missing required roles"
5394
5871
  ] })
5395
5872
  ] })
5396
5873
  ] }),
5397
- /* @__PURE__ */ jsxs7(
5874
+ /* @__PURE__ */ jsxs8(
5398
5875
  "button",
5399
5876
  {
5877
+ type: "button",
5400
5878
  onClick: () => setShowDetails((v) => !v),
5401
5879
  className: "w-full flex items-center justify-center gap-2 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors py-2",
5402
5880
  children: [
5403
- showDetails ? /* @__PURE__ */ jsx13(ChevronDown, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx13(ChevronRight, { className: "h-3.5 w-3.5" }),
5881
+ showDetails ? /* @__PURE__ */ jsx14(ChevronDown, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx14(ChevronRight, { className: "h-3.5 w-3.5" }),
5404
5882
  showDetails ? "Hide" : "Show",
5405
5883
  " detailed configuration",
5406
- /* @__PURE__ */ jsxs7("span", { className: "text-muted-foreground/60", children: [
5884
+ /* @__PURE__ */ jsxs8("span", { className: "text-muted-foreground/60", children: [
5407
5885
  "(",
5408
5886
  activeRoleData.length,
5409
5887
  " roles \xB7 ",
@@ -5416,20 +5894,20 @@ function ConfigReview() {
5416
5894
  ]
5417
5895
  }
5418
5896
  ),
5419
- /* @__PURE__ */ jsxs7(
5897
+ /* @__PURE__ */ jsxs8(
5420
5898
  "button",
5421
5899
  {
5900
+ type: "button",
5422
5901
  onClick: () => {
5423
5902
  const next = !showFiles;
5424
5903
  setShowFiles(next);
5425
- if (next && !previewFiles && !loadingFiles) loadPreview();
5426
5904
  },
5427
5905
  className: "w-full flex items-center justify-center gap-2 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors py-2",
5428
5906
  children: [
5429
- showFiles ? /* @__PURE__ */ jsx13(ChevronDown, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx13(ChevronRight, { className: "h-3.5 w-3.5" }),
5907
+ showFiles ? /* @__PURE__ */ jsx14(ChevronDown, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx14(ChevronRight, { className: "h-3.5 w-3.5" }),
5430
5908
  showFiles ? "Hide" : "Preview",
5431
5909
  " generated files",
5432
- previewFiles && /* @__PURE__ */ jsxs7("span", { className: "text-muted-foreground/60", children: [
5910
+ previewFiles && /* @__PURE__ */ jsxs8("span", { className: "text-muted-foreground/60", children: [
5433
5911
  "(",
5434
5912
  Object.keys(previewFiles).length,
5435
5913
  " files",
@@ -5439,39 +5917,40 @@ function ConfigReview() {
5439
5917
  ]
5440
5918
  }
5441
5919
  ),
5442
- showFiles && /* @__PURE__ */ jsxs7("div", { className: "space-y-3", children: [
5443
- loadingFiles && /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground", children: [
5444
- /* @__PURE__ */ jsx13(LoaderCircle, { className: "h-4 w-4 animate-spin" }),
5920
+ showFiles && /* @__PURE__ */ jsxs8("div", { className: "space-y-3", children: [
5921
+ loadingFiles && /* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground", children: [
5922
+ /* @__PURE__ */ jsx14(LoaderCircle, { className: "h-4 w-4 animate-spin" }),
5445
5923
  "Assembling preview..."
5446
5924
  ] }),
5447
- previewError && !loadingFiles && /* @__PURE__ */ jsxs7("div", { className: "flex items-start gap-2 rounded-lg border border-destructive/30 bg-destructive/5 p-3 text-sm", children: [
5448
- /* @__PURE__ */ jsx13(TriangleAlert, { className: "h-4 w-4 text-destructive shrink-0 mt-0.5" }),
5449
- /* @__PURE__ */ jsxs7("div", { children: [
5450
- /* @__PURE__ */ jsx13("p", { className: "font-medium", children: "Preview failed" }),
5451
- /* @__PURE__ */ jsx13("p", { className: "text-xs text-muted-foreground mt-0.5", children: previewError })
5925
+ previewError && !loadingFiles && /* @__PURE__ */ jsxs8("div", { className: "flex items-start gap-2 rounded-lg border border-destructive/30 bg-destructive/5 p-3 text-sm", children: [
5926
+ /* @__PURE__ */ jsx14(TriangleAlert, { className: "h-4 w-4 text-destructive shrink-0 mt-0.5" }),
5927
+ /* @__PURE__ */ jsxs8("div", { children: [
5928
+ /* @__PURE__ */ jsx14("p", { className: "font-medium", children: "Preview failed" }),
5929
+ /* @__PURE__ */ jsx14("p", { className: "text-xs text-muted-foreground mt-0.5", children: previewError })
5452
5930
  ] })
5453
5931
  ] }),
5454
- previewFiles && !loadingFiles && /* @__PURE__ */ jsxs7(Fragment2, { children: [
5455
- /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between", children: [
5456
- /* @__PURE__ */ jsx13("p", { className: "text-xs text-muted-foreground", children: "Click a file to expand. Use the edit button to override its content before provisioning." }),
5457
- /* @__PURE__ */ jsxs7(
5932
+ previewFiles && !loadingFiles && /* @__PURE__ */ jsxs8(Fragment2, { children: [
5933
+ /* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between", children: [
5934
+ /* @__PURE__ */ jsx14("p", { className: "text-xs text-muted-foreground", children: "Click a file to expand. Use the edit button to override its content before provisioning." }),
5935
+ /* @__PURE__ */ jsxs8(
5458
5936
  "button",
5459
5937
  {
5938
+ type: "button",
5460
5939
  onClick: loadPreview,
5461
5940
  className: "flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",
5462
5941
  children: [
5463
- /* @__PURE__ */ jsx13(RefreshCw, { className: "h-3 w-3" }),
5942
+ /* @__PURE__ */ jsx14(RefreshCw, { className: "h-3 w-3" }),
5464
5943
  "Refresh"
5465
5944
  ]
5466
5945
  }
5467
5946
  )
5468
5947
  ] }),
5469
- groupFiles(previewFiles).map(({ group, paths }) => /* @__PURE__ */ jsxs7("div", { className: "space-y-1", children: [
5470
- group && /* @__PURE__ */ jsxs7("p", { className: "text-[10px] font-medium text-muted-foreground uppercase tracking-wider px-0.5", children: [
5948
+ groupFiles(previewFiles).map(({ group, paths }) => /* @__PURE__ */ jsxs8("div", { className: "space-y-1", children: [
5949
+ group && /* @__PURE__ */ jsxs8("p", { className: "text-[10px] font-medium text-muted-foreground uppercase tracking-wider px-0.5", children: [
5471
5950
  group,
5472
5951
  "/"
5473
5952
  ] }),
5474
- /* @__PURE__ */ jsx13("div", { className: "space-y-1", children: paths.map((filePath) => /* @__PURE__ */ jsx13(
5953
+ /* @__PURE__ */ jsx14("div", { className: "space-y-1", children: paths.map((filePath) => /* @__PURE__ */ jsx14(
5475
5954
  FileEntry,
5476
5955
  {
5477
5956
  filePath,
@@ -5485,57 +5964,57 @@ function ConfigReview() {
5485
5964
  ] }, group || "_root"))
5486
5965
  ] })
5487
5966
  ] }),
5488
- showDetails && /* @__PURE__ */ jsxs7("div", { className: "space-y-6", children: [
5967
+ showDetails && /* @__PURE__ */ jsxs8("div", { className: "space-y-6", children: [
5489
5968
  state.presetName && state.presetName !== "custom" && (() => {
5490
5969
  const preset = state.presets.find((p) => p.name === state.presetName);
5491
5970
  if (!preset) return null;
5492
- return /* @__PURE__ */ jsxs7("div", { children: [
5493
- /* @__PURE__ */ jsx13("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2", children: "Preset" }),
5494
- /* @__PURE__ */ jsx13(Card, { children: /* @__PURE__ */ jsxs7(CardContent, { className: "p-3 space-y-1.5", children: [
5495
- /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-2", children: [
5496
- /* @__PURE__ */ jsx13("span", { className: "text-sm font-medium capitalize", children: preset.name }),
5497
- preset.base && /* @__PURE__ */ jsxs7(Badge, { variant: "outline", className: "text-[10px]", children: [
5971
+ return /* @__PURE__ */ jsxs8("div", { children: [
5972
+ /* @__PURE__ */ jsx14("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2", children: "Preset" }),
5973
+ /* @__PURE__ */ jsx14(Card, { children: /* @__PURE__ */ jsxs8(CardContent, { className: "p-3 space-y-1.5", children: [
5974
+ /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
5975
+ /* @__PURE__ */ jsx14("span", { className: "text-sm font-medium capitalize", children: preset.name }),
5976
+ preset.base && /* @__PURE__ */ jsxs8(Badge, { variant: "outline", className: "text-[10px]", children: [
5498
5977
  "extends ",
5499
5978
  preset.base
5500
5979
  ] })
5501
5980
  ] }),
5502
- /* @__PURE__ */ jsx13("p", { className: "text-xs text-muted-foreground", children: preset.description }),
5503
- preset.constraints && preset.constraints.length > 0 && /* @__PURE__ */ jsxs7("div", { className: "flex items-start gap-1.5 text-xs text-amber-700 dark:text-amber-300 mt-1", children: [
5504
- /* @__PURE__ */ jsx13(TriangleAlert, { className: "h-3 w-3 shrink-0 mt-0.5" }),
5505
- /* @__PURE__ */ jsx13("span", { children: preset.constraints.join(" \xB7 ") })
5981
+ /* @__PURE__ */ jsx14("p", { className: "text-xs text-muted-foreground", children: preset.description }),
5982
+ preset.constraints && preset.constraints.length > 0 && /* @__PURE__ */ jsxs8("div", { className: "flex items-start gap-1.5 text-xs text-amber-700 dark:text-amber-300 mt-1", children: [
5983
+ /* @__PURE__ */ jsx14(TriangleAlert, { className: "h-3 w-3 shrink-0 mt-0.5" }),
5984
+ /* @__PURE__ */ jsx14("span", { children: preset.constraints.join(" \xB7 ") })
5506
5985
  ] })
5507
5986
  ] }) })
5508
5987
  ] });
5509
5988
  })(),
5510
- /* @__PURE__ */ jsxs7("div", { children: [
5511
- /* @__PURE__ */ jsxs7("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2", children: [
5989
+ /* @__PURE__ */ jsxs8("div", { children: [
5990
+ /* @__PURE__ */ jsxs8("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2", children: [
5512
5991
  "Team \u2014 ",
5513
5992
  activeRoleData.length,
5514
5993
  " agents"
5515
5994
  ] }),
5516
- /* @__PURE__ */ jsx13("div", { className: "grid gap-2", children: activeRoleData.map((role) => /* @__PURE__ */ jsx13(RoleDetail, { role }, role.name)) })
5995
+ /* @__PURE__ */ jsx14("div", { className: "grid gap-2", children: activeRoleData.map((role) => /* @__PURE__ */ jsx14(RoleDetail, { role }, role.name)) })
5517
5996
  ] }),
5518
- /* @__PURE__ */ jsxs7("div", { children: [
5519
- /* @__PURE__ */ jsxs7("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2", children: [
5997
+ /* @__PURE__ */ jsxs8("div", { children: [
5998
+ /* @__PURE__ */ jsxs8("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2", children: [
5520
5999
  "Modules \u2014 ",
5521
6000
  selectedModuleData.length,
5522
6001
  " active"
5523
6002
  ] }),
5524
- /* @__PURE__ */ jsx13("div", { className: "grid gap-2", children: selectedModuleData.map((mod) => /* @__PURE__ */ jsx13(ModuleDetail, { mod, allRoleNames }, mod.name)) })
6003
+ /* @__PURE__ */ jsx14("div", { className: "grid gap-2", children: selectedModuleData.map((mod) => /* @__PURE__ */ jsx14(ModuleDetail, { mod, allRoleNames }, mod.name)) })
5525
6004
  ] })
5526
6005
  ] })
5527
6006
  ] });
5528
6007
  }
5529
6008
 
5530
6009
  // src/ui/components/steps/StepSummary.tsx
5531
- import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
6010
+ import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
5532
6011
  function StepSummary() {
5533
6012
  const state = useWizard();
5534
6013
  const dispatch = useWizardDispatch();
5535
6014
  const checkAuth = usePluginAction3("check-auth");
5536
- const [authError, setAuthError] = useState6(null);
5537
- const checked = useRef2(false);
5538
- useEffect2(() => {
6015
+ const [authError, setAuthError] = useState7(null);
6016
+ const checked = useRef3(false);
6017
+ useEffect3(() => {
5539
6018
  if (checked.current) return;
5540
6019
  checked.current = true;
5541
6020
  checkAuth({}).then((result) => {
@@ -5544,18 +6023,18 @@ function StepSummary() {
5544
6023
  setAuthError(err?.message || "Could not verify API connection");
5545
6024
  });
5546
6025
  }, []);
5547
- return /* @__PURE__ */ jsxs8("div", { className: "space-y-6", children: [
5548
- /* @__PURE__ */ jsxs8("div", { className: "space-y-2", children: [
5549
- /* @__PURE__ */ jsx14("h2", { className: "text-xl font-semibold tracking-tight", children: "Review" }),
5550
- /* @__PURE__ */ jsx14("p", { className: "text-sm text-muted-foreground", children: "Confirm your company configuration before creating. Click any field to edit." })
6026
+ return /* @__PURE__ */ jsxs9("div", { className: "space-y-6", children: [
6027
+ /* @__PURE__ */ jsxs9("div", { className: "space-y-2", children: [
6028
+ /* @__PURE__ */ jsx15("h2", { className: "text-xl font-semibold tracking-tight", children: "Review" }),
6029
+ /* @__PURE__ */ jsx15("p", { className: "text-sm text-muted-foreground", children: "Confirm your company configuration before creating. Click any field to edit." })
5551
6030
  ] }),
5552
- /* @__PURE__ */ jsx14(ConfigReview, {}),
5553
- authError && /* @__PURE__ */ jsxs8("div", { className: "flex items-start gap-3 rounded-lg border border-amber-500/30 bg-amber-500/10 p-4", children: [
5554
- /* @__PURE__ */ jsx14(TriangleAlert, { className: "h-4 w-4 text-amber-500 shrink-0 mt-0.5" }),
5555
- /* @__PURE__ */ jsxs8("div", { className: "space-y-2 flex-1 min-w-0", children: [
5556
- /* @__PURE__ */ jsx14("p", { className: "text-sm font-medium text-amber-800 dark:text-amber-200", children: "API connection failed" }),
5557
- /* @__PURE__ */ jsx14("p", { className: "text-xs text-amber-700 dark:text-amber-300 wrap-break-word", children: authError }),
5558
- /* @__PURE__ */ jsxs8(
6031
+ /* @__PURE__ */ jsx15(ConfigReview, {}),
6032
+ authError && /* @__PURE__ */ jsxs9("div", { className: "flex items-start gap-3 rounded-lg border border-amber-500/30 bg-amber-500/10 p-4", children: [
6033
+ /* @__PURE__ */ jsx15(TriangleAlert, { className: "h-4 w-4 text-amber-500 shrink-0 mt-0.5" }),
6034
+ /* @__PURE__ */ jsxs9("div", { className: "space-y-2 flex-1 min-w-0", children: [
6035
+ /* @__PURE__ */ jsx15("p", { className: "text-sm font-medium text-amber-800 dark:text-amber-200", children: "API connection failed" }),
6036
+ /* @__PURE__ */ jsx15("p", { className: "text-xs text-amber-700 dark:text-amber-300 wrap-break-word", children: authError }),
6037
+ /* @__PURE__ */ jsxs9(
5559
6038
  Button,
5560
6039
  {
5561
6040
  variant: "outline",
@@ -5565,59 +6044,81 @@ function StepSummary() {
5565
6044
  window.location.href = getPluginSettingsUrl();
5566
6045
  },
5567
6046
  children: [
5568
- /* @__PURE__ */ jsx14(Settings, { className: "h-3 w-3 mr-1.5" }),
6047
+ /* @__PURE__ */ jsx15(Settings, { className: "h-3 w-3 mr-1.5" }),
5569
6048
  "Plugin Settings"
5570
6049
  ]
5571
6050
  }
5572
6051
  )
5573
6052
  ] })
5574
6053
  ] }),
5575
- /* @__PURE__ */ jsxs8("div", { className: "flex justify-end gap-3", children: [
5576
- /* @__PURE__ */ jsx14(Button, { variant: "outline", onClick: () => dispatch({ type: "GO_TO", step: "roles" }), children: "Back" }),
5577
- /* @__PURE__ */ jsx14(Button, { onClick: () => dispatch({ type: "GO_TO", step: "provision" }), children: state.existingCompanyId ? "Provision into Existing Company" : "Create Company" })
6054
+ /* @__PURE__ */ jsxs9("div", { className: "flex justify-end gap-3", children: [
6055
+ /* @__PURE__ */ jsx15(Button, { variant: "outline", onClick: () => dispatch({ type: "GO_TO", step: "roles" }), children: "Back" }),
6056
+ /* @__PURE__ */ jsx15(Button, { onClick: () => dispatch({ type: "GO_TO", step: "provision" }), children: state.existingCompanyId ? "Provision into Existing Company" : "Create Company" })
5578
6057
  ] })
5579
6058
  ] });
5580
6059
  }
5581
6060
 
5582
6061
  // src/ui/components/steps/StepAiWizard.tsx
5583
- import { useState as useState7, useRef as useRef3, useEffect as useEffect3 } from "react";
6062
+ import { useState as useState8, useRef as useRef4, useEffect as useEffect4 } from "react";
5584
6063
  import { usePluginAction as usePluginAction4 } from "@paperclipai/plugin-sdk/ui";
5585
6064
 
5586
6065
  // raw:/paperclip/paperclip-plugin-company-wizard/src/ui/prompts/interview-system.md
5587
- var interview_system_default = "You are the Clipper AI Wizard \u2014 an expert at assembling AI agent teams. You're enthusiastic but concise. Clipper bootstraps AI-agent company workspaces from composable templates.\n\nYou are conducting a guided interview to understand what company to set up.\n\n{{CATALOG}}\n\n## How Roles Work\n\n- **Base roles** (marked \"always included\") are auto-added. You do NOT list them in the JSON.\n- **All other roles** (listed under \"Available Extra Roles\") are OPTIONAL and must be EXPLICITLY listed in your JSON `roles` array if you want them.\n- **Critically: `engineer` is NOT a base role.** Most software projects need an engineer. If the project involves writing code, building software, or maintaining a repository, you MUST include `engineer` in your `roles` array. The preset does NOT auto-add roles \u2014 you must list every non-base role the company needs.\n- When in doubt, include the engineer. A company that builds software without an engineer agent will have no one to write code.\n\n## Interview Rules\n\n- Ask exactly ONE question per turn. Keep it short and energetic (1-2 sentences). Use a conversational tone.\n- Do NOT output JSON during questions \u2014 just ask the question as plain text.\n- Tailor each question based on previous answers. Show you understood what they said.\n- After 3 questions, summarize what you understood in a brief, enthusiastic paragraph. End with: \"Ready to generate your configuration?\"\n- When the user confirms, output a human-readable recommendation with reasoning, then the JSON config.\n\n## What to Ask About\n\nAcross your 3 questions, try to cover as many of these as the user's initial description left unclear:\n\n1. **What they're building** \u2014 Product type, target users, domain (fintech, SaaS, game, etc.)\n2. **Current stage** \u2014 Greenfield, existing codebase, research phase, relaunch?\n3. **Quality vs speed** \u2014 Ship fast, iterate? Or production-grade, high quality from the start?\n4. **Team needs** \u2014 Do they need code review, security, design, marketing, docs, DevOps?\n5. **Special requirements** \u2014 Compliance, accessibility, specific tech stack, CI/CD, game engine?\n6. **Repository** \u2014 Is there an existing repo? What language/framework?\n\nDon't ask about things already clear from the initial description. Skip to what's missing.\n\n## Information Preservation\n\nThe user's interview answers are the primary source of context for the company. When generating the configuration:\n\n- **`companyDescription`**: Write a comprehensive 2-4 paragraph description that captures EVERYTHING learned during the interview \u2014 what the company does, what it's building, who it's for, key technical decisions, constraints, priorities, and any special context. This is the company's permanent record. Be thorough. Do NOT summarize into a single vague sentence.\n- **`goals`**: Array of goals. The first goal is the main company goal \u2014 its description is the most important field. Write a THOROUGH, DETAILED description that includes EVERYTHING the user shared: full requirements, technical specs, acceptance criteria, constraints, edge cases, API contracts, user stories, design decisions, performance targets. If the user dropped a full spec, reproduce it in full. This is the primary brief all agents work from. Multiple paragraphs expected. Additional goals can be sub-goals (use `parentGoal` to reference the parent's title). Most setups need 1 main goal + 0-2 sub-goals.\n- **`projects`**: Array of projects. Each has a `name`, `description`, and `goals` array (goal titles it's linked to). Most setups need just one project linked to all goals.\n\n## RECOMMENDATION Format (when generating config)\n\n- One paragraph explaining your reasoning: why this preset, why these modules, why these roles.\n- A bullet list of the key choices.\n\nThen output the JSON (no markdown fences):\n{{CONFIG_FORMAT}}\n\n## Rules\n\n- `modules` should list ALL modules to activate (including preset ones).\n- `roles` should list ALL non-base roles the company needs. This includes roles that come with the preset. The system does not auto-add preset roles \u2014 you must list them explicitly.\n- If the project involves building software, `engineer` MUST be in `roles`.\n- Be pragmatic \u2014 don't over-engineer. Match the config to actual needs.\n";
6066
+ var interview_system_default = 'You are the Clipper AI Wizard \u2014 an expert at assembling AI agent teams. You\'re enthusiastic but concise. Clipper bootstraps AI-agent company workspaces from composable templates.\n\nYou are conducting a guided interview to understand what company to set up.\n\n{{CATALOG}}\n\n## How Roles Work\n\n- **Base roles** (marked "always included") are auto-added. You do NOT list them in the JSON.\n- **All other roles** (listed under "Available Extra Roles") are OPTIONAL and must be EXPLICITLY listed in your JSON `roles` array if you want them.\n- **Critically: `engineer` is NOT a base role.** Most software projects need an engineer. If the project involves writing code, building software, or maintaining a repository, you MUST include `engineer` in your `roles` array. The preset does NOT auto-add roles \u2014 you must list every non-base role the company needs.\n- When in doubt, include the engineer. A company that builds software without an engineer agent will have no one to write code.\n\n## Interview Rules\n\n- Ask exactly ONE question per turn. Keep it short and energetic (1-2 sentences). Use a conversational tone.\n- Do NOT output JSON during questions \u2014 just ask the question as plain text.\n- Tailor each question based on previous answers. Show you understood what they said.\n- After 3 questions, summarize what you understood in a brief, enthusiastic paragraph. End with: "Ready to generate your configuration?"\n- When the user confirms, output a human-readable recommendation with reasoning, then the JSON config.\n\n## What to Ask About\n\nAcross your 3 questions, try to cover as many of these as the user\'s initial description left unclear:\n\n1. **What they\'re building** \u2014 Product type, target users, domain (fintech, SaaS, game, etc.)\n2. **Current stage** \u2014 Greenfield, existing codebase, research phase, relaunch?\n3. **Quality vs speed** \u2014 Ship fast, iterate? Or production-grade, high quality from the start?\n4. **Team needs** \u2014 Do they need code review, security, design, marketing, docs, DevOps?\n5. **Special requirements** \u2014 Compliance, accessibility, specific tech stack, CI/CD, game engine?\n6. **Repository** \u2014 Should Paperclip create a new Git repository/workspace, or should the agents use an existing external repo such as GitHub/GitLab? If external, ask for URL and branch/ref; never ask for tokens.\n\nDon\'t ask about things already clear from the initial description. Skip to what\'s missing.\n\n## Information Preservation\n\nThe user\'s interview answers are the primary source of context for the company. When generating the configuration:\n\n- **`companyDescription`**: Write a comprehensive 2-4 paragraph description that captures EVERYTHING learned during the interview \u2014 what the company does, what it\'s building, who it\'s for, key technical decisions, constraints, priorities, and any special context. This is the company\'s permanent record. Be thorough. Do NOT summarize into a single vague sentence.\n- **`goals`**: Array of goals. The first goal is the main user-specific company goal \u2014 its description is the most important field. Write a THOROUGH, DETAILED description that includes EVERYTHING the user shared: full requirements, technical specs, acceptance criteria, constraints, edge cases, API contracts, user stories, design decisions, performance targets. If the user dropped a full spec, reproduce it in full. This is the primary brief all agents work from. Multiple paragraphs expected. Additional goals can be sub-goals (use `parentGoal` to reference the parent\'s title). Most setups need 1 main goal + 0-2 sub-goals. Preset/module template goals are added by the wizard after your JSON, so do NOT replace the user\'s objective with generic preset goals like "Build a REST API" or "Set up CI/CD" unless the user explicitly asked only for that.\n- **`projects`**: Array of projects. Each has a `name`, `description`, `goals` array (goal titles it\'s linked to), and repository workspace metadata. If the user chose an external repo, use `workspace.sourceType: "git_repo"` with `repoUrl`, `repoRef`/`defaultRef`, and isolated git worktrees. If no external repo was provided, use a fresh local Git repository with `workspace.sourceType: "local_path"`, `workspace.defaultRef: "main"`, `workspace.setupCommand: "git init -b main"`, and `workspace.isPrimary: true`.\n- **`issues`**: Array of 6-12 CONCRETE, domain-specific initial work items taken straight from what you learned in the interview \u2014 the real features, components, and integrations the user actually described, each with a `title`, a `description` with acceptance criteria, a `priority` (`critical`/`high`/`medium`/`low`), and `assignTo` set to a role on the team. These seed the backlog so the project starts in its actual domain. Do NOT put generic scaffolding here (vision docs, linters, CI, branch protection) \u2014 the wizard adds those automatically.\n\n## RECOMMENDATION Format (when generating config)\n\n- One paragraph explaining your reasoning: why this preset, why these modules, why these roles.\n- A bullet list of the key choices.\n\nThen output the JSON (no markdown fences):\n{{CONFIG_FORMAT}}\n\n## Rules\n\n- `modules` should list ALL modules to activate (including preset ones).\n- `roles` should list ALL non-base roles the company needs. This includes roles that come with the preset. The system does not auto-add preset roles \u2014 you must list them explicitly.\n- If the project involves building software, `engineer` MUST be in `roles`.\n- The primary project MUST state whether it uses a fresh local Git repository or an external Git repository. Do not put credentials or tokens in repository fields.\n- Be pragmatic \u2014 don\'t over-engineer. Match the config to actual needs.\n';
5588
6067
 
5589
6068
  // raw:/paperclip/paperclip-plugin-company-wizard/src/ui/prompts/single-shot-system.md
5590
- var single_shot_system_default = 'You are the Clipper AI Wizard. Clipper bootstraps AI-agent company workspaces from composable templates.\n\nGiven a natural language description of what the user wants to build, you select the best configuration.\n\n{{CATALOG}}\n\n## How Roles Work\n\n- **Base roles** (marked "always included") are auto-added. You do NOT list them in the JSON.\n- **All other roles** (listed under "Available Extra Roles") are OPTIONAL and must be EXPLICITLY listed in your JSON `roles` array if you want them.\n- **Critically: `engineer` is NOT a base role.** Most software projects need an engineer. If the project involves writing code, building software, or maintaining a repository, you MUST include `engineer` in your `roles` array. The preset does NOT auto-add roles \u2014 you must list every non-base role the company needs.\n- When in doubt, include the engineer. A company that builds software without an engineer agent will have no one to write code.\n\n## Instructions\n\n1. Analyze the user\'s description to understand: what they\'re building, their team size preference, quality vs speed priority, and any specific needs.\n2. Select the best preset as a starting point.\n3. List ALL modules to activate (including preset ones). Add extra modules beyond the preset if the description warrants them.\n4. List ALL non-base roles the company needs. This includes roles from the preset. If the project involves software, include `engineer`.\n5. Suggest a company name (PascalCase-friendly, short, memorable) if not obvious from the description.\n6. Write a thorough company description (2-4 paragraphs) capturing everything the user described \u2014 product, audience, tech stack, constraints, priorities, stage, and special context. This is the company\'s permanent record.\n7. Define goals as an array. The first goal is the main company goal \u2014 its description is the most important field. Include EVERYTHING the user described: full requirements, technical specs, acceptance criteria, constraints, edge cases, API contracts, user stories, performance targets. If the user provided a detailed spec, reproduce it in full. This is the primary brief all agents work from. Do NOT summarize \u2014 preserve every detail. Add sub-goals with `parentGoal` if the description warrants separate workstreams.\n8. Define projects as an array. Most setups need one project linked to all goals. Name and describe the project concretely.\n\nFirst write one paragraph explaining your reasoning: why this preset, why these modules, why these roles.\n\nThen output the JSON (no markdown fences):\n{{CONFIG_FORMAT}}\n';
6069
+ var single_shot_system_default = 'You are the Clipper AI Wizard. Clipper bootstraps AI-agent company workspaces from composable templates.\n\nGiven a natural language description of what the user wants to build, you select the best configuration.\n\n{{CATALOG}}\n\n## How Roles Work\n\n- **Base roles** (marked "always included") are auto-added. You do NOT list them in the JSON.\n- **All other roles** (listed under "Available Extra Roles") are OPTIONAL and must be EXPLICITLY listed in your JSON `roles` array if you want them.\n- **Critically: `engineer` is NOT a base role.** Most software projects need an engineer. If the project involves writing code, building software, or maintaining a repository, you MUST include `engineer` in your `roles` array. The preset does NOT auto-add roles \u2014 you must list every non-base role the company needs.\n- When in doubt, include the engineer. A company that builds software without an engineer agent will have no one to write code.\n\n## Instructions\n\n1. Analyze the user\'s description to understand: what they\'re building, their team size preference, quality vs speed priority, and any specific needs.\n2. Select the best preset as a starting point.\n3. List ALL modules to activate (including preset ones). Add extra modules beyond the preset if the description warrants them.\n4. List ALL non-base roles the company needs. This includes roles from the preset. If the project involves software, include `engineer`.\n5. Suggest a company name (PascalCase-friendly, short, memorable) if not obvious from the description.\n6. Write a thorough company description (2-4 paragraphs) capturing everything the user described \u2014 product, audience, tech stack, constraints, priorities, stage, and special context. This is the company\'s permanent record.\n7. Define goals as an array. The first goal is the main user-specific company goal \u2014 its description is the most important field. Include EVERYTHING the user described: full requirements, technical specs, acceptance criteria, constraints, edge cases, API contracts, user stories, performance targets. If the user provided a detailed spec, reproduce it in full. This is the primary brief all agents work from. Do NOT summarize \u2014 preserve every detail. Add sub-goals with `parentGoal` if the description warrants separate workstreams. Preset/module template goals are added by the wizard after your JSON, so do NOT replace the user\'s objective with generic preset goals like "Build a REST API" or "Set up CI/CD" unless the user explicitly asked only for that.\n8. Define projects as an array. Most setups need one project linked to all goals. Name and describe the project concretely.\n9. Always decide the repository setup for the primary project:\n - If the user gives an existing GitHub/GitLab/remote Git repo, set `workspace.sourceType: "git_repo"`, include `repoUrl`, set `repoRef`/`defaultRef` when known (default to `origin/main`), and use `executionWorkspacePolicy.defaultMode: "isolated_workspace"` with a `git_worktree` strategy.\n - If no external repository is given, assume Paperclip should create a fresh local Git repository. Set `workspace.sourceType: "local_path"`, `workspace.defaultRef: "main"`, `workspace.setupCommand: "git init -b main"`, and `workspace.isPrimary: true`. Do NOT include an `executionWorkspacePolicy` for a fresh local repository \u2014 the repo and its base ref do not exist yet, so isolated git worktrees would fail on the first run. Agents work in the shared project workspace until the repo is established.\n - Never include credentials or tokens in repository URLs or project text.\n10. Define an `issues` array of 6-12 CONCRETE, domain-specific initial work items taken straight from the description \u2014 the real features, components, and integrations the user actually described, each with a `title`, a `description` with acceptance criteria, a `priority`, and `assignTo` set to a role on the team. These seed the backlog so the project starts in its actual domain instead of only doing generic setup. Do NOT put generic scaffolding here (vision docs, linters, CI, branch protection) \u2014 the wizard adds those automatically.\n\nFirst write one paragraph explaining your reasoning: why this preset, why these modules, why these roles.\n\nThen output the JSON (no markdown fences):\n{{CONFIG_FORMAT}}\n';
5591
6070
 
5592
6071
  // src/ui/prompts/messages.json
5593
6072
  var messages_default = {
5594
6073
  interviewStart: "Here's what I want to build:\n\n{{DESCRIPTION}}\n\nStart the interview. Ask your first question.",
5595
6074
  singleShot: "{{DESCRIPTION}}",
5596
- generateConfig: "Generate the configuration now. Remember: include ALL non-base roles the company needs in the roles array (engineer is NOT a base role \u2014 list it if this project involves code). Write a thorough companyDescription that captures everything we discussed. The first goal's description must contain ALL requirements, specs, and details \u2014 this is the primary brief for all agents.",
5597
- configFormat: `{
6075
+ generateConfig: "Generate the configuration now. Remember: include ALL non-base roles the company needs in the roles array (engineer is NOT a base role \u2014 list it if this project involves code). Write a thorough companyDescription that captures everything we discussed. The goals array must preserve the user-specific objectives; preset/module template goals are added later by the wizard, so do not replace the user's requested outcome with a generic preset goal like \"Build a REST API\" unless that is truly the entire objective. The first goal's description must contain ALL requirements, specs, and details \u2014 this is the primary brief for all agents. The primary project must explicitly choose repository setup: either a fresh local Git repository or an external Git repository such as GitHub. Never include credentials or tokens in repository fields. Also include an `issues` array of 6-12 CONCRETE, domain-specific initial work items taken straight from the brief \u2014 the real features, components, and integrations the user's spec actually describes, each with a `title`, a `description` with acceptance criteria, a `priority`, and `assignTo` set to a role on the team. These seed the backlog so the project starts in its actual domain. Do NOT put generic scaffolding here (vision docs, linters, CI, branch protection) \u2014 the wizard adds those automatically.",
6076
+ configFormat: `Respond with ONLY a JSON object using this shape. Use exactly one project object for a single-project setup. For a fresh/new repository, use workspace.sourceType=local_path, defaultRef=main, setupCommand=git init -b main, and isPrimary=true, and do NOT include executionWorkspacePolicy (the repo does not exist yet, so isolated git worktrees would fail on the first run). For an existing external repo, use workspace.sourceType=git_repo, include repoUrl plus repoRef/defaultRef (default origin/main), and include executionWorkspacePolicy with isolated git_worktree.
6077
+ {
5598
6078
  "name": "CompanyName",
5599
6079
  "companyDescription": "Comprehensive 2-4 paragraph description of what this company does, what it is building, who it is for, key technical decisions, priorities, constraints, and any special context. This is the company's permanent record \u2014 be thorough and specific.",
5600
6080
  "goals": [
5601
6081
  {
5602
- "title": "Main goal title",
5603
- "description": "THOROUGH description with ALL requirements, specs, acceptance criteria, constraints, edge cases, and every detail the user provided. This is the primary brief for all agents \u2014 preserve every detail, do NOT summarize. Multiple paragraphs expected."
6082
+ "title": "Main user-specific goal title",
6083
+ "description": "THOROUGH description with ALL requirements, specs, acceptance criteria, constraints, edge cases, and every detail the user provided. This is the primary brief for all agents \u2014 preserve every detail, do NOT summarize. Multiple paragraphs expected. Do not use a generic preset goal title unless the user asked for exactly that."
5604
6084
  },
5605
6085
  {
5606
- "title": "Optional sub-goal title",
5607
- "description": "Sub-goal description...",
5608
- "parentGoal": "Main goal title"
6086
+ "title": "Additional user-specific goal if needed",
6087
+ "description": "Sub-goal or parallel objective description...",
6088
+ "parentGoal": "Main user-specific goal title"
5609
6089
  }
5610
6090
  ],
5611
6091
  "projects": [
5612
6092
  {
5613
6093
  "name": "ProjectName",
5614
6094
  "description": "Concrete project description \u2014 what is being built and key technical details.",
5615
- "goals": ["Main goal title", "Optional sub-goal title"]
6095
+ "goals": [
6096
+ "Main user-specific goal title",
6097
+ "Additional user-specific goal if needed"
6098
+ ],
6099
+ "workspace": {
6100
+ "sourceType": "local_path",
6101
+ "defaultRef": "main",
6102
+ "setupCommand": "git init -b main",
6103
+ "isPrimary": true
6104
+ }
6105
+ }
6106
+ ],
6107
+ "issues": [
6108
+ {
6109
+ "title": "Concrete, project-specific first work item taken straight from the brief",
6110
+ "description": "What to build and the acceptance criteria, grounded in the user's actual spec \u2014 NOT generic scaffolding.",
6111
+ "priority": "critical | high | medium | low",
6112
+ "assignTo": "engineer"
5616
6113
  }
5617
6114
  ],
5618
6115
  "preset": "preset-name",
5619
- "modules": ["all-modules-to-activate-including-preset-ones"],
5620
- "roles": ["all-non-base-roles-needed-including-preset-ones-engineer-is-not-base"],
6116
+ "modules": [
6117
+ "all-modules-to-activate-including-preset-ones"
6118
+ ],
6119
+ "roles": [
6120
+ "all-non-base-roles-needed-including-preset-ones-engineer-is-not-base"
6121
+ ],
5621
6122
  "explanation": "2-3 sentences explaining WHY this configuration fits the described company."
5622
6123
  }`
5623
6124
  };
@@ -5631,7 +6132,7 @@ var examples_default = [
5631
6132
  ];
5632
6133
 
5633
6134
  // src/ui/components/steps/StepAiWizard.tsx
5634
- import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
6135
+ import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
5635
6136
  var LOADING_MESSAGES = [
5636
6137
  "Understanding your vision...",
5637
6138
  "Analyzing requirements...",
@@ -5643,9 +6144,55 @@ var CONFIG_STEPS = [
5643
6144
  "Selecting strategy preset",
5644
6145
  "Choosing capability modules",
5645
6146
  "Assembling agent team",
6147
+ "Resolving repository setup",
5646
6148
  "Defining company goal",
5647
6149
  "Finalizing configuration"
5648
6150
  ];
6151
+ function isPlainObject(value) {
6152
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6153
+ }
6154
+ function copyStringField(source, target, key) {
6155
+ const value = source[key];
6156
+ if (typeof value === "string" && value.trim()) target[key] = value.trim();
6157
+ }
6158
+ function normalizeWorkspaceConfig(value) {
6159
+ if (!isPlainObject(value)) return void 0;
6160
+ const workspace = {};
6161
+ for (const key of [
6162
+ "name",
6163
+ "sourceType",
6164
+ "cwd",
6165
+ "repoUrl",
6166
+ "repoRef",
6167
+ "defaultRef",
6168
+ "visibility",
6169
+ "setupCommand",
6170
+ "cleanupCommand",
6171
+ "remoteProvider",
6172
+ "remoteWorkspaceRef",
6173
+ "sharedWorkspaceKey"
6174
+ ]) {
6175
+ copyStringField(value, workspace, key);
6176
+ }
6177
+ if (typeof value.isPrimary === "boolean") workspace.isPrimary = value.isPrimary;
6178
+ if (isPlainObject(value.metadata)) workspace.metadata = value.metadata;
6179
+ if (isPlainObject(value.runtimeConfig)) workspace.runtimeConfig = value.runtimeConfig;
6180
+ return Object.keys(workspace).length > 0 ? workspace : void 0;
6181
+ }
6182
+ function normalizeExecutionWorkspacePolicy(value) {
6183
+ if (!isPlainObject(value)) return void 0;
6184
+ const policy = {};
6185
+ copyStringField(value, policy, "defaultMode");
6186
+ copyStringField(value, policy, "defaultProjectWorkspaceId");
6187
+ copyStringField(value, policy, "environmentId");
6188
+ if (typeof value.allowIssueOverride === "boolean") {
6189
+ policy.allowIssueOverride = value.allowIssueOverride;
6190
+ }
6191
+ if (isPlainObject(value.workspaceStrategy)) {
6192
+ policy.workspaceStrategy = { ...value.workspaceStrategy };
6193
+ }
6194
+ return Object.keys(policy).length > 0 ? policy : void 0;
6195
+ }
5649
6196
  function PhaseIndicator({
5650
6197
  phase,
5651
6198
  questionCount
@@ -5658,13 +6205,13 @@ function PhaseIndicator({
5658
6205
  ];
5659
6206
  const phaseKeys = phases.map((p) => p.key);
5660
6207
  const activeIdx = phaseKeys.indexOf(phase);
5661
- return /* @__PURE__ */ jsx15("div", { className: "flex items-center gap-1", children: phases.map((p, i) => {
6208
+ return /* @__PURE__ */ jsx16("div", { className: "flex items-center gap-1", children: phases.map((p, i) => {
5662
6209
  const Icon2 = p.icon;
5663
6210
  const isActive = i === activeIdx;
5664
6211
  const isDone = i < activeIdx;
5665
- return /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-1", children: [
5666
- i > 0 && /* @__PURE__ */ jsx15("div", { className: cn("w-6 h-px", isDone ? "bg-foreground" : "bg-border") }),
5667
- /* @__PURE__ */ jsxs9(
6212
+ return /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1", children: [
6213
+ i > 0 && /* @__PURE__ */ jsx16("div", { className: cn("w-6 h-px", isDone ? "bg-foreground" : "bg-border") }),
6214
+ /* @__PURE__ */ jsxs10(
5668
6215
  "div",
5669
6216
  {
5670
6217
  className: cn(
@@ -5674,9 +6221,9 @@ function PhaseIndicator({
5674
6221
  !isActive && !isDone && "text-muted-foreground"
5675
6222
  ),
5676
6223
  children: [
5677
- isDone ? /* @__PURE__ */ jsx15(CircleCheck, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx15(Icon2, { className: cn("h-3 w-3", isActive && "animate-pulse") }),
5678
- /* @__PURE__ */ jsx15("span", { className: "hidden sm:inline", children: p.label }),
5679
- p.key === "interview" && isActive && questionCount > 0 && /* @__PURE__ */ jsxs9("span", { className: "text-[10px] opacity-70", children: [
6224
+ isDone ? /* @__PURE__ */ jsx16(CircleCheck, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx16(Icon2, { className: cn("h-3 w-3", isActive && "animate-pulse") }),
6225
+ /* @__PURE__ */ jsx16("span", { className: "hidden sm:inline", children: p.label }),
6226
+ p.key === "interview" && isActive && questionCount > 0 && /* @__PURE__ */ jsxs10("span", { className: "text-[10px] opacity-70", children: [
5680
6227
  questionCount,
5681
6228
  "/3"
5682
6229
  ] })
@@ -5687,9 +6234,9 @@ function PhaseIndicator({
5687
6234
  }) });
5688
6235
  }
5689
6236
  function ConfiguringAnimation({ ready, onDone }) {
5690
- const [step, setStep] = useState7(0);
5691
- const [animDone, setAnimDone] = useState7(false);
5692
- useEffect3(() => {
6237
+ const [step, setStep] = useState8(0);
6238
+ const [animDone, setAnimDone] = useState8(false);
6239
+ useEffect4(() => {
5693
6240
  if (step < CONFIG_STEPS.length) {
5694
6241
  const timer = setTimeout(() => setStep((s) => s + 1), 600);
5695
6242
  return () => clearTimeout(timer);
@@ -5697,19 +6244,19 @@ function ConfiguringAnimation({ ready, onDone }) {
5697
6244
  setAnimDone(true);
5698
6245
  }
5699
6246
  }, [step]);
5700
- useEffect3(() => {
6247
+ useEffect4(() => {
5701
6248
  if (animDone && ready) {
5702
6249
  const timer = setTimeout(onDone, 300);
5703
6250
  return () => clearTimeout(timer);
5704
6251
  }
5705
6252
  }, [animDone, ready, onDone]);
5706
6253
  const allStepsDone = step >= CONFIG_STEPS.length;
5707
- return /* @__PURE__ */ jsxs9("div", { className: "flex flex-col items-center justify-center py-12 space-y-6", children: [
5708
- /* @__PURE__ */ jsxs9("div", { className: "relative", children: [
5709
- /* @__PURE__ */ jsx15("div", { className: "h-12 w-12 rounded-full bg-foreground/5 flex items-center justify-center", children: /* @__PURE__ */ jsx15(Sparkles, { className: "h-6 w-6 text-foreground animate-pulse" }) }),
5710
- /* @__PURE__ */ jsx15("div", { className: "absolute inset-0 rounded-full border-2 border-foreground/20 animate-ping" })
6254
+ return /* @__PURE__ */ jsxs10("div", { className: "flex flex-col items-center justify-center py-12 space-y-6", children: [
6255
+ /* @__PURE__ */ jsxs10("div", { className: "relative", children: [
6256
+ /* @__PURE__ */ jsx16("div", { className: "h-12 w-12 rounded-full bg-foreground/5 flex items-center justify-center", children: /* @__PURE__ */ jsx16(Sparkles, { className: "h-6 w-6 text-foreground animate-pulse" }) }),
6257
+ /* @__PURE__ */ jsx16("div", { className: "absolute inset-0 rounded-full border-2 border-foreground/20 animate-ping" })
5711
6258
  ] }),
5712
- /* @__PURE__ */ jsx15("div", { className: "space-y-2 w-full max-w-xs", children: CONFIG_STEPS.map((label, i) => /* @__PURE__ */ jsxs9(
6259
+ /* @__PURE__ */ jsx16("div", { className: "space-y-2 w-full max-w-xs", children: CONFIG_STEPS.map((label, i) => /* @__PURE__ */ jsxs10(
5713
6260
  "div",
5714
6261
  {
5715
6262
  className: cn(
@@ -5719,14 +6266,14 @@ function ConfiguringAnimation({ ready, onDone }) {
5719
6266
  i > step && "text-muted-foreground/40"
5720
6267
  ),
5721
6268
  children: [
5722
- /* @__PURE__ */ jsx15("div", { className: "w-4 flex justify-center", children: i < step ? /* @__PURE__ */ jsx15(CircleCheck, { className: "h-3.5 w-3.5" }) : i === step ? /* @__PURE__ */ jsx15(LoaderCircle, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsx15("div", { className: "h-1.5 w-1.5 rounded-full bg-current" }) }),
6269
+ /* @__PURE__ */ jsx16("div", { className: "w-4 flex justify-center", children: i < step ? /* @__PURE__ */ jsx16(CircleCheck, { className: "h-3.5 w-3.5" }) : i === step ? /* @__PURE__ */ jsx16(LoaderCircle, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsx16("div", { className: "h-1.5 w-1.5 rounded-full bg-current" }) }),
5723
6270
  label
5724
6271
  ]
5725
6272
  },
5726
6273
  label
5727
6274
  )) }),
5728
- allStepsDone && !ready && /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
5729
- /* @__PURE__ */ jsx15(LoaderCircle, { className: "h-3.5 w-3.5 animate-spin" }),
6275
+ allStepsDone && !ready && /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
6276
+ /* @__PURE__ */ jsx16(LoaderCircle, { className: "h-3.5 w-3.5 animate-spin" }),
5730
6277
  "Waiting for AI response..."
5731
6278
  ] })
5732
6279
  ] });
@@ -5736,33 +6283,33 @@ function StepAiWizard() {
5736
6283
  const dispatch = useWizardDispatch();
5737
6284
  const aiChat = usePluginAction4("ai-chat");
5738
6285
  const checkAiConfig = usePluginAction4("check-ai-config");
5739
- const [messages, setMessages] = useState7([]);
5740
- const [input, setInput] = useState7("");
5741
- const [loading, setLoading] = useState7(false);
5742
- const [phase, setPhase] = useState7("describe");
5743
- const [questionCount, setQuestionCount] = useState7(0);
5744
- const [loadingMsg, setLoadingMsg] = useState7(LOADING_MESSAGES[0]);
5745
- const [configReady, setConfigReady] = useState7(false);
5746
- const [configWarning, setConfigWarning] = useState7(null);
5747
- const scrollRef = useRef3(null);
5748
- const inputRef = useRef3(null);
5749
- const pendingConfigRef = useRef3(null);
5750
- useEffect3(() => {
6286
+ const [messages, setMessages] = useState8([]);
6287
+ const [input, setInput] = useState8("");
6288
+ const [loading, setLoading] = useState8(false);
6289
+ const [phase, setPhase] = useState8("describe");
6290
+ const [questionCount, setQuestionCount] = useState8(0);
6291
+ const [loadingMsg, setLoadingMsg] = useState8(LOADING_MESSAGES[0]);
6292
+ const [configReady, setConfigReady] = useState8(false);
6293
+ const [configWarning, setConfigWarning] = useState8(null);
6294
+ const scrollRef = useRef4(null);
6295
+ const inputRef = useRef4(null);
6296
+ const pendingConfigRef = useRef4(null);
6297
+ useEffect4(() => {
5751
6298
  checkAiConfig({}).then((result) => {
5752
6299
  if (!result.ok) setConfigWarning(result.error);
5753
6300
  else setConfigWarning(null);
5754
6301
  }).catch(() => {
5755
6302
  });
5756
6303
  }, []);
5757
- useEffect3(() => {
6304
+ useEffect4(() => {
5758
6305
  scrollRef.current?.scrollTo({ top: scrollRef.current.scrollHeight, behavior: "smooth" });
5759
6306
  }, [messages, loading]);
5760
- useEffect3(() => {
6307
+ useEffect4(() => {
5761
6308
  if (!loading && phase === "interview") {
5762
6309
  inputRef.current?.focus();
5763
6310
  }
5764
6311
  }, [loading, phase]);
5765
- useEffect3(() => {
6312
+ useEffect4(() => {
5766
6313
  if (!loading) return;
5767
6314
  const interval = setInterval(() => {
5768
6315
  setLoadingMsg(LOADING_MESSAGES[Math.floor(Math.random() * LOADING_MESSAGES.length)]);
@@ -5789,14 +6336,22 @@ function StepAiWizard() {
5789
6336
  const systemPrompt = interview_system_default.replace("{{CATALOG}}", buildCatalog()).replace("{{CONFIG_FORMAT}}", messages_default.configFormat);
5790
6337
  const singleShotPrompt = single_shot_system_default.replace("{{CATALOG}}", buildCatalog()).replace("{{CONFIG_FORMAT}}", messages_default.configFormat);
5791
6338
  const callApi = async (allMessages, system) => {
5792
- const result = await aiChat({
6339
+ const start = await aiChat({
6340
+ mode: "start",
5793
6341
  messages: allMessages.map((m) => ({ role: m.role, content: m.content })),
5794
6342
  system: system || systemPrompt
5795
6343
  });
5796
- if (result.error) {
5797
- throw new Error(result.error);
6344
+ if (start.error) throw new Error(start.error);
6345
+ if (!start.jobId) throw new Error("AI did not start a generation job");
6346
+ const POLL_INTERVAL_MS = 1500;
6347
+ const MAX_ATTEMPTS = 320;
6348
+ for (let attempt = 0; attempt < MAX_ATTEMPTS; attempt++) {
6349
+ await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS));
6350
+ const poll = await aiChat({ mode: "poll", jobId: start.jobId });
6351
+ if (poll.status === "done") return poll.text || "";
6352
+ if (poll.status === "error") throw new Error(poll.error || "AI generation failed");
5798
6353
  }
5799
- return result.text;
6354
+ throw new Error("AI generation timed out. Please try again.");
5800
6355
  };
5801
6356
  const tryExtractConfig = (text) => {
5802
6357
  const candidates = [];
@@ -6018,11 +6573,28 @@ function StepAiWizard() {
6018
6573
  }
6019
6574
  let parsedProjects;
6020
6575
  if (Array.isArray(config.projects)) {
6021
- parsedProjects = config.projects.map((p) => ({
6022
- name: String(p.name || ""),
6023
- description: String(p.description || ""),
6024
- goals: Array.isArray(p.goals) ? p.goals.map(String) : []
6025
- }));
6576
+ parsedProjects = config.projects.map((p) => {
6577
+ const workspace = normalizeWorkspaceConfig(p.workspace);
6578
+ const executionWorkspacePolicy = normalizeExecutionWorkspacePolicy(
6579
+ p.executionWorkspacePolicy
6580
+ );
6581
+ const project = {
6582
+ name: String(p.name || ""),
6583
+ description: String(p.description || ""),
6584
+ goals: Array.isArray(p.goals) ? p.goals.map(String) : []
6585
+ };
6586
+ if (workspace) project.workspace = workspace;
6587
+ if (typeof p.workspaceSourceType === "string" && p.workspaceSourceType.trim()) {
6588
+ project.workspaceSourceType = p.workspaceSourceType.trim();
6589
+ }
6590
+ if (typeof p.repoUrl === "string" && p.repoUrl.trim()) project.repoUrl = p.repoUrl.trim();
6591
+ if (typeof p.repoRef === "string" && p.repoRef.trim()) project.repoRef = p.repoRef.trim();
6592
+ if (typeof p.defaultRef === "string" && p.defaultRef.trim()) {
6593
+ project.defaultRef = p.defaultRef.trim();
6594
+ }
6595
+ if (executionWorkspacePolicy) project.executionWorkspacePolicy = executionWorkspacePolicy;
6596
+ return project;
6597
+ });
6026
6598
  } else if (config.project) {
6027
6599
  parsedProjects = [
6028
6600
  {
@@ -6034,12 +6606,19 @@ function StepAiWizard() {
6034
6606
  } else {
6035
6607
  parsedProjects = [];
6036
6608
  }
6609
+ const parsedIssues = Array.isArray(config.issues) ? config.issues.filter((i) => i && (i.title || i.name)).map((i) => ({
6610
+ title: String(i.title || i.name || ""),
6611
+ description: String(i.description || ""),
6612
+ ...i.priority ? { priority: String(i.priority) } : {},
6613
+ ...i.assignTo ? { assignTo: String(i.assignTo) } : {}
6614
+ })) : [];
6037
6615
  dispatch({
6038
6616
  type: "APPLY_AI_RESULT",
6039
6617
  result: {
6040
6618
  companyName: config.name || state.aiDescription.slice(0, 30),
6041
6619
  goals: parsedGoals,
6042
6620
  projects: parsedProjects,
6621
+ issues: parsedIssues,
6043
6622
  presetName: state.presets.some((p) => p.name === config.preset) ? config.preset : "custom",
6044
6623
  selectedModules: mergedModules,
6045
6624
  selectedRoles: mergedRoles,
@@ -6059,23 +6638,23 @@ function StepAiWizard() {
6059
6638
  pendingConfigRef.current = null;
6060
6639
  };
6061
6640
  if (phase === "describe") {
6062
- return /* @__PURE__ */ jsxs9("div", { className: "space-y-6", children: [
6063
- /* @__PURE__ */ jsxs9("div", { className: "space-y-3", children: [
6064
- /* @__PURE__ */ jsx15(PhaseIndicator, { phase, questionCount }),
6065
- /* @__PURE__ */ jsxs9("div", { children: [
6066
- /* @__PURE__ */ jsx15("h2", { className: "text-xl font-semibold tracking-tight", children: "What are you building?" }),
6067
- /* @__PURE__ */ jsx15("p", { className: "text-sm text-muted-foreground mt-1", children: "Describe your company or idea. Our AI will interview you and assemble the perfect agent team." })
6641
+ return /* @__PURE__ */ jsxs10("div", { className: "space-y-6", children: [
6642
+ /* @__PURE__ */ jsxs10("div", { className: "space-y-3", children: [
6643
+ /* @__PURE__ */ jsx16(PhaseIndicator, { phase, questionCount }),
6644
+ /* @__PURE__ */ jsxs10("div", { children: [
6645
+ /* @__PURE__ */ jsx16("h2", { className: "text-xl font-semibold tracking-tight", children: "What are you building?" }),
6646
+ /* @__PURE__ */ jsx16("p", { className: "text-sm text-muted-foreground mt-1", children: "Describe your company or idea. Our AI will interview you and assemble the perfect agent team." })
6068
6647
  ] })
6069
6648
  ] }),
6070
- configWarning && /* @__PURE__ */ jsxs9("div", { className: "rounded-lg border border-amber-500/30 bg-amber-500/10 dark:bg-amber-500/5 p-4", children: [
6071
- /* @__PURE__ */ jsxs9("div", { className: "flex items-start gap-3", children: [
6072
- /* @__PURE__ */ jsx15(TriangleAlert, { className: "h-5 w-5 text-amber-500 dark:text-amber-400 shrink-0 mt-0.5" }),
6073
- /* @__PURE__ */ jsxs9("div", { className: "space-y-1", children: [
6074
- /* @__PURE__ */ jsx15("p", { className: "text-sm font-medium", children: "API key missing" }),
6075
- /* @__PURE__ */ jsx15("p", { className: "text-sm text-muted-foreground", children: configWarning })
6649
+ configWarning && /* @__PURE__ */ jsxs10("div", { className: "rounded-lg border border-amber-500/30 bg-amber-500/10 dark:bg-amber-500/5 p-4", children: [
6650
+ /* @__PURE__ */ jsxs10("div", { className: "flex items-start gap-3", children: [
6651
+ /* @__PURE__ */ jsx16(TriangleAlert, { className: "h-5 w-5 text-amber-500 dark:text-amber-400 shrink-0 mt-0.5" }),
6652
+ /* @__PURE__ */ jsxs10("div", { className: "space-y-1", children: [
6653
+ /* @__PURE__ */ jsx16("p", { className: "text-sm font-medium", children: "API key missing" }),
6654
+ /* @__PURE__ */ jsx16("p", { className: "text-sm text-muted-foreground", children: configWarning })
6076
6655
  ] })
6077
6656
  ] }),
6078
- /* @__PURE__ */ jsx15("div", { className: "mt-3 pl-8", children: /* @__PURE__ */ jsxs9(
6657
+ /* @__PURE__ */ jsx16("div", { className: "mt-3 pl-8", children: /* @__PURE__ */ jsxs10(
6079
6658
  Button,
6080
6659
  {
6081
6660
  variant: "outline",
@@ -6084,14 +6663,14 @@ function StepAiWizard() {
6084
6663
  window.location.href = getPluginSettingsUrl();
6085
6664
  },
6086
6665
  children: [
6087
- /* @__PURE__ */ jsx15(Settings, { className: "h-3.5 w-3.5 mr-1.5" }),
6666
+ /* @__PURE__ */ jsx16(Settings, { className: "h-3.5 w-3.5 mr-1.5" }),
6088
6667
  "Plugin Settings"
6089
6668
  ]
6090
6669
  }
6091
6670
  ) })
6092
6671
  ] }),
6093
- /* @__PURE__ */ jsxs9("div", { className: "space-y-3", children: [
6094
- /* @__PURE__ */ jsx15(
6672
+ /* @__PURE__ */ jsxs10("div", { className: "space-y-3", children: [
6673
+ /* @__PURE__ */ jsx16(
6095
6674
  "textarea",
6096
6675
  {
6097
6676
  className: "flex min-h-[120px] w-full rounded-lg border border-input bg-transparent px-3 py-2.5 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring resize-none",
@@ -6101,9 +6680,9 @@ function StepAiWizard() {
6101
6680
  autoFocus: true
6102
6681
  }
6103
6682
  ),
6104
- /* @__PURE__ */ jsxs9("div", { className: "space-y-1.5", children: [
6105
- /* @__PURE__ */ jsx15("p", { className: "text-xs text-muted-foreground", children: "Try an example:" }),
6106
- /* @__PURE__ */ jsx15("div", { className: "flex flex-wrap gap-1.5", children: examples_default.map((prompt) => /* @__PURE__ */ jsx15(
6683
+ /* @__PURE__ */ jsxs10("div", { className: "space-y-1.5", children: [
6684
+ /* @__PURE__ */ jsx16("p", { className: "text-xs text-muted-foreground", children: "Try an example:" }),
6685
+ /* @__PURE__ */ jsx16("div", { className: "flex flex-wrap gap-1.5", children: examples_default.map((prompt) => /* @__PURE__ */ jsx16(
6107
6686
  "button",
6108
6687
  {
6109
6688
  onClick: () => {
@@ -6117,68 +6696,68 @@ function StepAiWizard() {
6117
6696
  )) })
6118
6697
  ] })
6119
6698
  ] }),
6120
- /* @__PURE__ */ jsxs9("div", { className: "flex justify-end gap-2", children: [
6121
- /* @__PURE__ */ jsx15(Button, { variant: "outline", onClick: () => dispatch({ type: "GO_TO", step: "onboarding" }), children: "Back" }),
6122
- /* @__PURE__ */ jsxs9(
6699
+ /* @__PURE__ */ jsxs10("div", { className: "flex justify-end gap-2", children: [
6700
+ /* @__PURE__ */ jsx16(Button, { variant: "outline", onClick: () => dispatch({ type: "GO_TO", step: "onboarding" }), children: "Back" }),
6701
+ /* @__PURE__ */ jsxs10(
6123
6702
  Button,
6124
6703
  {
6125
6704
  variant: "outline",
6126
6705
  onClick: () => quickGenerate(),
6127
6706
  disabled: !state.aiDescription.trim(),
6128
6707
  children: [
6129
- /* @__PURE__ */ jsx15(Zap, { className: "h-4 w-4" }),
6708
+ /* @__PURE__ */ jsx16(Zap, { className: "h-4 w-4" }),
6130
6709
  "Quick generate"
6131
6710
  ]
6132
6711
  }
6133
6712
  ),
6134
- /* @__PURE__ */ jsxs9(Button, { onClick: () => startInterview(), disabled: !state.aiDescription.trim(), children: [
6135
- /* @__PURE__ */ jsx15(MessageSquare, { className: "h-4 w-4" }),
6713
+ /* @__PURE__ */ jsxs10(Button, { onClick: () => startInterview(), disabled: !state.aiDescription.trim(), children: [
6714
+ /* @__PURE__ */ jsx16(MessageSquare, { className: "h-4 w-4" }),
6136
6715
  "Interview",
6137
- /* @__PURE__ */ jsx15(ArrowRight, { className: "h-3.5 w-3.5" })
6716
+ /* @__PURE__ */ jsx16(ArrowRight, { className: "h-3.5 w-3.5" })
6138
6717
  ] })
6139
6718
  ] })
6140
6719
  ] });
6141
6720
  }
6142
6721
  if (phase === "configuring") {
6143
- return /* @__PURE__ */ jsxs9("div", { className: "space-y-6", children: [
6144
- /* @__PURE__ */ jsx15(PhaseIndicator, { phase, questionCount }),
6145
- /* @__PURE__ */ jsx15(ConfiguringAnimation, { ready: configReady, onDone: applyConfigToState })
6722
+ return /* @__PURE__ */ jsxs10("div", { className: "space-y-6", children: [
6723
+ /* @__PURE__ */ jsx16(PhaseIndicator, { phase, questionCount }),
6724
+ /* @__PURE__ */ jsx16(ConfiguringAnimation, { ready: configReady, onDone: applyConfigToState })
6146
6725
  ] });
6147
6726
  }
6148
6727
  if (phase === "review") {
6149
- return /* @__PURE__ */ jsxs9("div", { className: "space-y-6", children: [
6150
- /* @__PURE__ */ jsxs9("div", { className: "space-y-3", children: [
6151
- /* @__PURE__ */ jsx15(PhaseIndicator, { phase, questionCount }),
6152
- /* @__PURE__ */ jsxs9("div", { children: [
6153
- /* @__PURE__ */ jsx15("h2", { className: "text-xl font-semibold tracking-tight", children: "Review configuration" }),
6154
- /* @__PURE__ */ jsx15("p", { className: "text-sm text-muted-foreground mt-1", children: "Here's what the AI assembled. Adjust anything, then create your company." })
6728
+ return /* @__PURE__ */ jsxs10("div", { className: "space-y-6", children: [
6729
+ /* @__PURE__ */ jsxs10("div", { className: "space-y-3", children: [
6730
+ /* @__PURE__ */ jsx16(PhaseIndicator, { phase, questionCount }),
6731
+ /* @__PURE__ */ jsxs10("div", { children: [
6732
+ /* @__PURE__ */ jsx16("h2", { className: "text-xl font-semibold tracking-tight", children: "Review configuration" }),
6733
+ /* @__PURE__ */ jsx16("p", { className: "text-sm text-muted-foreground mt-1", children: "Here's what the AI assembled. Adjust anything, then create your company." })
6155
6734
  ] })
6156
6735
  ] }),
6157
- state.aiExplanation && /* @__PURE__ */ jsx15("div", { className: "rounded-lg border border-foreground/10 bg-accent/50 px-4 py-3", children: /* @__PURE__ */ jsx15("p", { className: "text-sm text-foreground/80 leading-relaxed", children: state.aiExplanation }) }),
6158
- /* @__PURE__ */ jsx15(ConfigReview, {}),
6159
- /* @__PURE__ */ jsxs9("div", { className: "flex justify-between", children: [
6160
- /* @__PURE__ */ jsxs9(
6736
+ state.aiExplanation && /* @__PURE__ */ jsx16("div", { className: "rounded-lg border border-foreground/10 bg-accent/50 px-4 py-3", children: /* @__PURE__ */ jsx16("p", { className: "text-sm text-foreground/80 leading-relaxed", children: state.aiExplanation }) }),
6737
+ /* @__PURE__ */ jsx16(ConfigReview, {}),
6738
+ /* @__PURE__ */ jsxs10("div", { className: "flex justify-between", children: [
6739
+ /* @__PURE__ */ jsxs10(
6161
6740
  Button,
6162
6741
  {
6163
6742
  variant: "outline",
6164
6743
  onClick: () => setPhase(messages.length > 0 ? "interview" : "describe"),
6165
6744
  children: [
6166
- /* @__PURE__ */ jsx15(ChevronLeft, { className: "h-3.5 w-3.5" }),
6745
+ /* @__PURE__ */ jsx16(ChevronLeft, { className: "h-3.5 w-3.5" }),
6167
6746
  messages.length > 0 ? "Back to interview" : "Back"
6168
6747
  ]
6169
6748
  }
6170
6749
  ),
6171
- /* @__PURE__ */ jsxs9(Button, { onClick: () => dispatch({ type: "GO_TO", step: "provision" }), children: [
6172
- /* @__PURE__ */ jsx15(Sparkles, { className: "h-4 w-4" }),
6750
+ /* @__PURE__ */ jsxs10(Button, { onClick: () => dispatch({ type: "GO_TO", step: "provision" }), children: [
6751
+ /* @__PURE__ */ jsx16(Sparkles, { className: "h-4 w-4" }),
6173
6752
  "Create Company"
6174
6753
  ] })
6175
6754
  ] })
6176
6755
  ] });
6177
6756
  }
6178
- return /* @__PURE__ */ jsxs9("div", { className: "space-y-4", children: [
6179
- /* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-between", children: [
6180
- /* @__PURE__ */ jsx15(PhaseIndicator, { phase, questionCount }),
6181
- /* @__PURE__ */ jsxs9(
6757
+ return /* @__PURE__ */ jsxs10("div", { className: "space-y-4", children: [
6758
+ /* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-between", children: [
6759
+ /* @__PURE__ */ jsx16(PhaseIndicator, { phase, questionCount }),
6760
+ /* @__PURE__ */ jsxs10(
6182
6761
  Button,
6183
6762
  {
6184
6763
  variant: "ghost",
@@ -6186,58 +6765,58 @@ function StepAiWizard() {
6186
6765
  onClick: resetInterview,
6187
6766
  className: "text-muted-foreground",
6188
6767
  children: [
6189
- /* @__PURE__ */ jsx15(RotateCcw, { className: "h-3 w-3" }),
6768
+ /* @__PURE__ */ jsx16(RotateCcw, { className: "h-3 w-3" }),
6190
6769
  "Reset"
6191
6770
  ]
6192
6771
  }
6193
6772
  )
6194
6773
  ] }),
6195
- /* @__PURE__ */ jsxs9(
6774
+ /* @__PURE__ */ jsxs10(
6196
6775
  "div",
6197
6776
  {
6198
6777
  ref: scrollRef,
6199
6778
  className: "space-y-4 max-h-[420px] overflow-y-auto rounded-lg border bg-accent/20 p-4",
6200
6779
  children: [
6201
- messages.map((msg, i) => /* @__PURE__ */ jsxs9(
6780
+ messages.map((msg, i) => /* @__PURE__ */ jsxs10(
6202
6781
  "div",
6203
6782
  {
6204
6783
  className: cn("flex gap-2.5 items-start", msg.role === "user" && "flex-row-reverse"),
6205
6784
  children: [
6206
- /* @__PURE__ */ jsx15(
6785
+ /* @__PURE__ */ jsx16(
6207
6786
  "div",
6208
6787
  {
6209
6788
  className: cn(
6210
6789
  "h-7 w-7 rounded-full flex items-center justify-center shrink-0",
6211
6790
  msg.role === "user" ? "bg-foreground text-background" : "bg-background border border-border"
6212
6791
  ),
6213
- children: msg.role === "user" ? /* @__PURE__ */ jsx15(User, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx15(Sparkles, { className: "h-3.5 w-3.5" })
6792
+ children: msg.role === "user" ? /* @__PURE__ */ jsx16(User, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx16(Sparkles, { className: "h-3.5 w-3.5" })
6214
6793
  }
6215
6794
  ),
6216
- /* @__PURE__ */ jsx15(
6795
+ /* @__PURE__ */ jsx16(
6217
6796
  "div",
6218
6797
  {
6219
6798
  className: cn(
6220
6799
  "rounded-lg px-3 py-2 max-w-[85%]",
6221
6800
  msg.role === "user" ? "bg-foreground text-background" : "bg-background border border-border"
6222
6801
  ),
6223
- children: /* @__PURE__ */ jsx15("div", { className: "text-sm whitespace-pre-wrap leading-relaxed", children: msg.content })
6802
+ children: /* @__PURE__ */ jsx16("div", { className: "text-sm whitespace-pre-wrap leading-relaxed", children: msg.content })
6224
6803
  }
6225
6804
  )
6226
6805
  ]
6227
6806
  },
6228
6807
  i
6229
6808
  )),
6230
- loading && /* @__PURE__ */ jsxs9("div", { className: "flex gap-2.5 items-start", children: [
6231
- /* @__PURE__ */ jsx15("div", { className: "h-7 w-7 rounded-full flex items-center justify-center shrink-0 bg-background border border-border", children: /* @__PURE__ */ jsx15(Sparkles, { className: "h-3.5 w-3.5 animate-pulse" }) }),
6232
- /* @__PURE__ */ jsx15("div", { className: "rounded-lg px-3 py-2 bg-background border border-border", children: /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
6233
- /* @__PURE__ */ jsx15(LoaderCircle, { className: "h-3.5 w-3.5 animate-spin" }),
6809
+ loading && /* @__PURE__ */ jsxs10("div", { className: "flex gap-2.5 items-start", children: [
6810
+ /* @__PURE__ */ jsx16("div", { className: "h-7 w-7 rounded-full flex items-center justify-center shrink-0 bg-background border border-border", children: /* @__PURE__ */ jsx16(Sparkles, { className: "h-3.5 w-3.5 animate-pulse" }) }),
6811
+ /* @__PURE__ */ jsx16("div", { className: "rounded-lg px-3 py-2 bg-background border border-border", children: /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
6812
+ /* @__PURE__ */ jsx16(LoaderCircle, { className: "h-3.5 w-3.5 animate-spin" }),
6234
6813
  loadingMsg
6235
6814
  ] }) })
6236
6815
  ] })
6237
6816
  ]
6238
6817
  }
6239
6818
  ),
6240
- !loading && /* @__PURE__ */ jsxs9(
6819
+ !loading && /* @__PURE__ */ jsxs10(
6241
6820
  "button",
6242
6821
  {
6243
6822
  onClick: requestConfig,
@@ -6246,14 +6825,14 @@ function StepAiWizard() {
6246
6825
  questionCount >= 3 ? "border-foreground/30 hover:border-foreground/50 hover:bg-accent/50" : "border-border hover:border-foreground/20 hover:bg-accent/30 text-muted-foreground"
6247
6826
  ),
6248
6827
  children: [
6249
- /* @__PURE__ */ jsx15(Sparkles, { className: "h-4 w-4" }),
6828
+ /* @__PURE__ */ jsx16(Sparkles, { className: "h-4 w-4" }),
6250
6829
  questionCount >= 3 ? "Generate configuration" : "Skip \u2014 generate now",
6251
- /* @__PURE__ */ jsx15(ArrowRight, { className: "h-3.5 w-3.5" })
6830
+ /* @__PURE__ */ jsx16(ArrowRight, { className: "h-3.5 w-3.5" })
6252
6831
  ]
6253
6832
  }
6254
6833
  ),
6255
- /* @__PURE__ */ jsxs9("div", { className: "flex gap-2", children: [
6256
- /* @__PURE__ */ jsx15(
6834
+ /* @__PURE__ */ jsxs10("div", { className: "flex gap-2", children: [
6835
+ /* @__PURE__ */ jsx16(
6257
6836
  "input",
6258
6837
  {
6259
6838
  ref: inputRef,
@@ -6267,14 +6846,14 @@ function StepAiWizard() {
6267
6846
  autoFocus: true
6268
6847
  }
6269
6848
  ),
6270
- /* @__PURE__ */ jsx15(
6849
+ /* @__PURE__ */ jsx16(
6271
6850
  Button,
6272
6851
  {
6273
6852
  size: "sm",
6274
6853
  onClick: sendMessage,
6275
6854
  disabled: !input.trim() || loading,
6276
6855
  className: "rounded-lg",
6277
- children: /* @__PURE__ */ jsx15(Send, { className: "h-3.5 w-3.5" })
6856
+ children: /* @__PURE__ */ jsx16(Send, { className: "h-3.5 w-3.5" })
6278
6857
  }
6279
6858
  )
6280
6859
  ] })
@@ -6282,9 +6861,9 @@ function StepAiWizard() {
6282
6861
  }
6283
6862
 
6284
6863
  // src/ui/components/steps/StepProvision.tsx
6285
- import { useEffect as useEffect4, useRef as useRef4 } from "react";
6864
+ import { useEffect as useEffect5, useRef as useRef5 } from "react";
6286
6865
  import { usePluginAction as usePluginAction5 } from "@paperclipai/plugin-sdk/ui";
6287
- import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
6866
+ import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
6288
6867
  function isConfigError(error) {
6289
6868
  return /authenticat|PAPERCLIP_EMAIL|PAPERCLIP_PASSWORD|paperclipEmail|paperclipPassword|credentials|unauthorized|forbidden/i.test(
6290
6869
  error
@@ -6293,13 +6872,13 @@ function isConfigError(error) {
6293
6872
  function StepProvision() {
6294
6873
  const state = useWizard();
6295
6874
  const dispatch = useWizardDispatch();
6296
- const started = useRef4(false);
6297
- const logEndRef = useRef4(null);
6875
+ const started = useRef5(false);
6876
+ const logEndRef = useRef5(null);
6298
6877
  const startProvision = usePluginAction5("start-provision");
6299
- useEffect4(() => {
6878
+ useEffect5(() => {
6300
6879
  logEndRef.current?.scrollIntoView({ behavior: "smooth" });
6301
6880
  }, [state.provisionLog]);
6302
- useEffect4(() => {
6881
+ useEffect5(() => {
6303
6882
  if (started.current) return;
6304
6883
  started.current = true;
6305
6884
  dispatch({ type: "SET_PROVISIONING", value: true });
@@ -6311,6 +6890,7 @@ function StepProvision() {
6311
6890
  companyDescription: state.companyDescription || void 0,
6312
6891
  goals: state.goals.length > 0 ? state.goals : void 0,
6313
6892
  projects: state.projects.length > 0 ? state.projects : void 0,
6893
+ issues: state.issues.length > 0 ? state.issues : void 0,
6314
6894
  ceoAdapter: state.ceoAdapter,
6315
6895
  presetName: state.presetName,
6316
6896
  selectedModules: state.selectedModules,
@@ -6341,32 +6921,32 @@ function StepProvision() {
6341
6921
  }, []);
6342
6922
  const isDone = !state.provisioning && state.provisionResult;
6343
6923
  const showConfigHint = state.error && isConfigError(state.error);
6344
- return /* @__PURE__ */ jsxs10("div", { className: "space-y-6", children: [
6345
- /* @__PURE__ */ jsxs10("div", { className: "space-y-2", children: [
6346
- /* @__PURE__ */ jsxs10("h2", { className: "text-xl font-semibold tracking-tight flex items-center gap-2", children: [
6347
- state.provisioning && /* @__PURE__ */ jsx16(LoaderCircle, { className: "h-5 w-5 animate-spin" }),
6924
+ return /* @__PURE__ */ jsxs11("div", { className: "space-y-6", children: [
6925
+ /* @__PURE__ */ jsxs11("div", { className: "space-y-2", children: [
6926
+ /* @__PURE__ */ jsxs11("h2", { className: "text-xl font-semibold tracking-tight flex items-center gap-2", children: [
6927
+ state.provisioning && /* @__PURE__ */ jsx17(LoaderCircle, { className: "h-5 w-5 animate-spin" }),
6348
6928
  state.provisioning ? "Provisioning..." : state.error ? "Error" : "Provisioned"
6349
6929
  ] }),
6350
- isDone && /* @__PURE__ */ jsx16("p", { className: "text-sm text-muted-foreground", children: "Company created. CEO will bootstrap the team on first heartbeat." })
6930
+ isDone && /* @__PURE__ */ jsx17("p", { className: "text-sm text-muted-foreground", children: "Company created. CEO will bootstrap the team on first heartbeat." })
6351
6931
  ] }),
6352
- showConfigHint && /* @__PURE__ */ jsxs10("div", { className: "rounded-lg border border-amber-500/30 bg-amber-500/10 dark:bg-amber-500/5 p-4 space-y-3", children: [
6353
- /* @__PURE__ */ jsxs10("div", { className: "flex items-start gap-3", children: [
6354
- /* @__PURE__ */ jsx16(TriangleAlert, { className: "h-5 w-5 text-amber-500 dark:text-amber-400 shrink-0 mt-0.5" }),
6355
- /* @__PURE__ */ jsxs10("div", { className: "space-y-1", children: [
6356
- /* @__PURE__ */ jsx16("p", { className: "text-sm font-medium", children: "Authentication required" }),
6357
- /* @__PURE__ */ jsxs10("p", { className: "text-sm text-muted-foreground", children: [
6932
+ showConfigHint && /* @__PURE__ */ jsxs11("div", { className: "rounded-lg border border-amber-500/30 bg-amber-500/10 dark:bg-amber-500/5 p-4 space-y-3", children: [
6933
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-start gap-3", children: [
6934
+ /* @__PURE__ */ jsx17(TriangleAlert, { className: "h-5 w-5 text-amber-500 dark:text-amber-400 shrink-0 mt-0.5" }),
6935
+ /* @__PURE__ */ jsxs11("div", { className: "space-y-1", children: [
6936
+ /* @__PURE__ */ jsx17("p", { className: "text-sm font-medium", children: "Authentication required" }),
6937
+ /* @__PURE__ */ jsxs11("p", { className: "text-sm text-muted-foreground", children: [
6358
6938
  "This Paperclip instance requires credentials. Configure",
6359
6939
  " ",
6360
- /* @__PURE__ */ jsx16("span", { className: "font-medium", children: "paperclipEmail" }),
6940
+ /* @__PURE__ */ jsx17("span", { className: "font-medium", children: "paperclipEmail" }),
6361
6941
  " and",
6362
6942
  " ",
6363
- /* @__PURE__ */ jsx16("span", { className: "font-medium", children: "paperclipPassword" }),
6943
+ /* @__PURE__ */ jsx17("span", { className: "font-medium", children: "paperclipPassword" }),
6364
6944
  " in the plugin settings."
6365
6945
  ] })
6366
6946
  ] })
6367
6947
  ] }),
6368
- /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2 pl-8", children: [
6369
- /* @__PURE__ */ jsxs10(
6948
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 pl-8", children: [
6949
+ /* @__PURE__ */ jsxs11(
6370
6950
  Button,
6371
6951
  {
6372
6952
  variant: "outline",
@@ -6375,12 +6955,12 @@ function StepProvision() {
6375
6955
  window.location.href = getPluginSettingsUrl();
6376
6956
  },
6377
6957
  children: [
6378
- /* @__PURE__ */ jsx16(Settings, { className: "h-3.5 w-3.5 mr-1.5" }),
6958
+ /* @__PURE__ */ jsx17(Settings, { className: "h-3.5 w-3.5 mr-1.5" }),
6379
6959
  "Plugin Settings"
6380
6960
  ]
6381
6961
  }
6382
6962
  ),
6383
- /* @__PURE__ */ jsxs10(
6963
+ /* @__PURE__ */ jsxs11(
6384
6964
  Button,
6385
6965
  {
6386
6966
  variant: "ghost",
@@ -6392,22 +6972,22 @@ function StepProvision() {
6392
6972
  dispatch({ type: "GO_TO", step: state.path === "ai" ? "ai-wizard" : "summary" });
6393
6973
  },
6394
6974
  children: [
6395
- /* @__PURE__ */ jsx16(RotateCcw, { className: "h-3.5 w-3.5 mr-1.5" }),
6975
+ /* @__PURE__ */ jsx17(RotateCcw, { className: "h-3.5 w-3.5 mr-1.5" }),
6396
6976
  "Back to Summary"
6397
6977
  ]
6398
6978
  }
6399
6979
  )
6400
6980
  ] })
6401
6981
  ] }),
6402
- state.error && !showConfigHint && /* @__PURE__ */ jsxs10("div", { className: "rounded-lg border border-destructive/30 bg-destructive/5 p-4 space-y-3", children: [
6403
- /* @__PURE__ */ jsxs10("div", { className: "flex items-start gap-3", children: [
6404
- /* @__PURE__ */ jsx16(TriangleAlert, { className: "h-5 w-5 text-destructive shrink-0 mt-0.5" }),
6405
- /* @__PURE__ */ jsxs10("div", { className: "space-y-1", children: [
6406
- /* @__PURE__ */ jsx16("p", { className: "text-sm font-medium", children: "Provisioning failed" }),
6407
- /* @__PURE__ */ jsx16("p", { className: "text-sm text-muted-foreground", children: state.error })
6982
+ state.error && !showConfigHint && /* @__PURE__ */ jsxs11("div", { className: "rounded-lg border border-destructive/30 bg-destructive/5 p-4 space-y-3", children: [
6983
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-start gap-3", children: [
6984
+ /* @__PURE__ */ jsx17(TriangleAlert, { className: "h-5 w-5 text-destructive shrink-0 mt-0.5" }),
6985
+ /* @__PURE__ */ jsxs11("div", { className: "space-y-1", children: [
6986
+ /* @__PURE__ */ jsx17("p", { className: "text-sm font-medium", children: "Provisioning failed" }),
6987
+ /* @__PURE__ */ jsx17("p", { className: "text-sm text-muted-foreground", children: state.error })
6408
6988
  ] })
6409
6989
  ] }),
6410
- /* @__PURE__ */ jsx16("div", { className: "pl-8", children: /* @__PURE__ */ jsxs10(
6990
+ /* @__PURE__ */ jsx17("div", { className: "pl-8", children: /* @__PURE__ */ jsxs11(
6411
6991
  Button,
6412
6992
  {
6413
6993
  variant: "ghost",
@@ -6419,14 +6999,14 @@ function StepProvision() {
6419
6999
  dispatch({ type: "GO_TO", step: state.path === "ai" ? "ai-wizard" : "summary" });
6420
7000
  },
6421
7001
  children: [
6422
- /* @__PURE__ */ jsx16(RotateCcw, { className: "h-3.5 w-3.5 mr-1.5" }),
7002
+ /* @__PURE__ */ jsx17(RotateCcw, { className: "h-3.5 w-3.5 mr-1.5" }),
6423
7003
  "Back to Summary"
6424
7004
  ]
6425
7005
  }
6426
7006
  ) })
6427
7007
  ] }),
6428
- /* @__PURE__ */ jsxs10("div", { className: "rounded-lg border bg-card p-4 font-mono text-xs max-h-[400px] overflow-y-auto", children: [
6429
- state.provisionLog.map((line, i) => /* @__PURE__ */ jsx16(
7008
+ /* @__PURE__ */ jsxs11("div", { className: "rounded-lg border bg-card p-4 font-mono text-xs max-h-[400px] overflow-y-auto", children: [
7009
+ state.provisionLog.map((line, i) => /* @__PURE__ */ jsx17(
6430
7010
  "div",
6431
7011
  {
6432
7012
  className: line.startsWith("\u2713") ? "text-green-600 py-0.5" : line.startsWith("!") ? "text-yellow-600 py-0.5" : line.startsWith("Error") ? "text-destructive py-0.5" : line.startsWith("+") || line.startsWith(" ") ? "text-foreground pl-2 py-0.5 bg-muted/50 rounded my-0.5" : "text-muted-foreground py-0.5",
@@ -6434,79 +7014,79 @@ function StepProvision() {
6434
7014
  },
6435
7015
  i
6436
7016
  )),
6437
- /* @__PURE__ */ jsx16("div", { ref: logEndRef })
7017
+ /* @__PURE__ */ jsx17("div", { ref: logEndRef })
6438
7018
  ] })
6439
7019
  ] });
6440
7020
  }
6441
7021
 
6442
7022
  // src/ui/components/steps/StepDone.tsx
6443
- import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
7023
+ import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
6444
7024
  function StepDone() {
6445
7025
  const state = useWizard();
6446
7026
  const dispatch = useWizardDispatch();
6447
7027
  const allRoles = getAllRoles(state);
6448
7028
  const result = state.provisionResult;
6449
- return /* @__PURE__ */ jsxs11("div", { className: "space-y-6", children: [
6450
- /* @__PURE__ */ jsxs11("div", { className: "flex items-start gap-3", children: [
6451
- /* @__PURE__ */ jsx17(CircleCheck, { className: "h-6 w-6 text-green-600 shrink-0 mt-0.5" }),
6452
- /* @__PURE__ */ jsxs11("div", { children: [
6453
- /* @__PURE__ */ jsx17("h2", { className: "text-xl font-semibold tracking-tight", children: state.companyName }),
6454
- /* @__PURE__ */ jsx17("p", { className: "text-sm text-muted-foreground mt-1", children: state.existingCompanyId ? "Workspace has been assembled and bootstrap tasks were added to the existing Paperclip company." : "Company has been assembled and registered with Paperclip." })
7029
+ return /* @__PURE__ */ jsxs12("div", { className: "space-y-6", children: [
7030
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-start gap-3", children: [
7031
+ /* @__PURE__ */ jsx18(CircleCheck, { className: "h-6 w-6 text-green-600 shrink-0 mt-0.5" }),
7032
+ /* @__PURE__ */ jsxs12("div", { children: [
7033
+ /* @__PURE__ */ jsx18("h2", { className: "text-xl font-semibold tracking-tight", children: state.companyName }),
7034
+ /* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground mt-1", children: state.existingCompanyId ? "Workspace has been assembled and bootstrap tasks were added to the existing Paperclip company." : "Company has been assembled and registered with Paperclip." })
6455
7035
  ] })
6456
7036
  ] }),
6457
- /* @__PURE__ */ jsx17(Card, { children: /* @__PURE__ */ jsxs11(CardContent, { className: "pt-6 space-y-4", children: [
6458
- state.goals[0]?.title && /* @__PURE__ */ jsxs11("div", { children: [
6459
- /* @__PURE__ */ jsx17("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-1", children: "Goal" }),
6460
- /* @__PURE__ */ jsx17("p", { className: "text-sm", children: state.goals[0].title })
7037
+ /* @__PURE__ */ jsx18(Card, { children: /* @__PURE__ */ jsxs12(CardContent, { className: "pt-6 space-y-4", children: [
7038
+ state.goals[0]?.title && /* @__PURE__ */ jsxs12("div", { children: [
7039
+ /* @__PURE__ */ jsx18("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-1", children: "Goal" }),
7040
+ /* @__PURE__ */ jsx18("p", { className: "text-sm", children: state.goals[0].title })
6461
7041
  ] }),
6462
- /* @__PURE__ */ jsxs11("div", { children: [
6463
- /* @__PURE__ */ jsxs11("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2", children: [
7042
+ /* @__PURE__ */ jsxs12("div", { children: [
7043
+ /* @__PURE__ */ jsxs12("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2", children: [
6464
7044
  "Team (",
6465
7045
  allRoles.length,
6466
7046
  " agents)"
6467
7047
  ] }),
6468
- /* @__PURE__ */ jsx17("div", { className: "flex flex-wrap gap-1.5", children: allRoles.map((r2) => {
7048
+ /* @__PURE__ */ jsx18("div", { className: "flex flex-wrap gap-1.5", children: allRoles.map((r2) => {
6469
7049
  const role = state.roles.find((ro) => ro.name === r2);
6470
- return /* @__PURE__ */ jsx17(Badge, { variant: "outline", className: "text-xs", children: role?.title || r2 }, r2);
7050
+ return /* @__PURE__ */ jsx18(Badge, { variant: "outline", className: "text-xs", children: role?.title || r2 }, r2);
6471
7051
  }) })
6472
7052
  ] }),
6473
- /* @__PURE__ */ jsxs11("div", { children: [
6474
- /* @__PURE__ */ jsxs11("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2", children: [
7053
+ /* @__PURE__ */ jsxs12("div", { children: [
7054
+ /* @__PURE__ */ jsxs12("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2", children: [
6475
7055
  "Modules (",
6476
7056
  state.selectedModules.length,
6477
7057
  ")"
6478
7058
  ] }),
6479
- /* @__PURE__ */ jsx17("div", { className: "flex flex-wrap gap-1.5", children: state.selectedModules.map((m) => /* @__PURE__ */ jsx17(Badge, { variant: "secondary", className: "text-xs", children: m }, m)) })
7059
+ /* @__PURE__ */ jsx18("div", { className: "flex flex-wrap gap-1.5", children: state.selectedModules.map((m) => /* @__PURE__ */ jsx18(Badge, { variant: "secondary", className: "text-xs", children: m }, m)) })
6480
7060
  ] }),
6481
- result?.issueIds && result.issueIds.length > 0 && /* @__PURE__ */ jsxs11("div", { children: [
6482
- /* @__PURE__ */ jsx17("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-1", children: "Issues" }),
6483
- /* @__PURE__ */ jsxs11("p", { className: "text-sm", children: [
7061
+ result?.issueIds && result.issueIds.length > 0 && /* @__PURE__ */ jsxs12("div", { children: [
7062
+ /* @__PURE__ */ jsx18("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-1", children: "Issues" }),
7063
+ /* @__PURE__ */ jsxs12("p", { className: "text-sm", children: [
6484
7064
  result.issueIds.length,
6485
7065
  " issues provisioned"
6486
7066
  ] })
6487
7067
  ] }),
6488
- state.presetName && /* @__PURE__ */ jsxs11("div", { children: [
6489
- /* @__PURE__ */ jsx17("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-1", children: "Preset" }),
6490
- /* @__PURE__ */ jsx17("p", { className: "text-sm capitalize", children: state.presetName })
7068
+ state.presetName && /* @__PURE__ */ jsxs12("div", { children: [
7069
+ /* @__PURE__ */ jsx18("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-1", children: "Preset" }),
7070
+ /* @__PURE__ */ jsx18("p", { className: "text-sm capitalize", children: state.presetName })
6491
7071
  ] }),
6492
- result?.companyId && /* @__PURE__ */ jsxs11("div", { children: [
6493
- /* @__PURE__ */ jsx17("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-1", children: "Company ID" }),
6494
- /* @__PURE__ */ jsx17("p", { className: "font-mono text-xs", children: result.companyId })
7072
+ result?.companyId && /* @__PURE__ */ jsxs12("div", { children: [
7073
+ /* @__PURE__ */ jsx18("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-1", children: "Company ID" }),
7074
+ /* @__PURE__ */ jsx18("p", { className: "font-mono text-xs", children: result.companyId })
6495
7075
  ] })
6496
7076
  ] }) }),
6497
- /* @__PURE__ */ jsxs11("div", { className: "flex gap-3", children: [
6498
- /* @__PURE__ */ jsxs11(Button, { variant: "outline", onClick: () => dispatch({ type: "RESET" }), children: [
6499
- /* @__PURE__ */ jsx17(RotateCcw, { className: "h-4 w-4" }),
7077
+ /* @__PURE__ */ jsxs12("div", { className: "flex gap-3", children: [
7078
+ /* @__PURE__ */ jsxs12(Button, { variant: "outline", onClick: () => dispatch({ type: "RESET" }), children: [
7079
+ /* @__PURE__ */ jsx18(RotateCcw, { className: "h-4 w-4" }),
6500
7080
  "Create another"
6501
7081
  ] }),
6502
- /* @__PURE__ */ jsx17(Button, { asChild: true, children: /* @__PURE__ */ jsxs11(
7082
+ /* @__PURE__ */ jsx18(Button, { asChild: true, children: /* @__PURE__ */ jsxs12(
6503
7083
  "a",
6504
7084
  {
6505
7085
  href: result?.paperclipUrl && result?.issuePrefix ? `${result.paperclipUrl}/${result.issuePrefix}/dashboard` : result?.paperclipUrl || "http://localhost:3100",
6506
7086
  target: "_blank",
6507
7087
  rel: "noopener noreferrer",
6508
7088
  children: [
6509
- /* @__PURE__ */ jsx17(ExternalLink, { className: "h-4 w-4" }),
7089
+ /* @__PURE__ */ jsx18(ExternalLink, { className: "h-4 w-4" }),
6510
7090
  "Open Paperclip"
6511
7091
  ]
6512
7092
  }
@@ -6516,11 +7096,12 @@ function StepDone() {
6516
7096
  }
6517
7097
 
6518
7098
  // src/ui/components/WizardShell.tsx
6519
- import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
7099
+ import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
6520
7100
  var STEP_COMPONENTS = {
6521
7101
  onboarding: StepOnboarding,
6522
7102
  name: StepName,
6523
7103
  goal: StepGoal,
7104
+ repository: StepRepository,
6524
7105
  preset: StepPreset,
6525
7106
  modules: StepModules,
6526
7107
  roles: StepRoles,
@@ -6535,15 +7116,15 @@ function StepIndicator() {
6535
7116
  const total = getTotalSteps(state);
6536
7117
  if (current < 1 || state.step === "provision" || state.step === "done" || state.step === "ai-wizard")
6537
7118
  return null;
6538
- return /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1.5", children: [
6539
- Array.from({ length: total }, (_, i) => /* @__PURE__ */ jsx18(
7119
+ return /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-1.5", children: [
7120
+ Array.from({ length: total }, (_, i) => /* @__PURE__ */ jsx19(
6540
7121
  "div",
6541
7122
  {
6542
7123
  className: `h-1.5 rounded-full transition-all duration-300 ${i + 1 <= current ? "w-6 bg-foreground" : "w-1.5 bg-muted-foreground/30"}`
6543
7124
  },
6544
7125
  i
6545
7126
  )),
6546
- /* @__PURE__ */ jsxs12("span", { className: "ml-2 text-xs text-muted-foreground", children: [
7127
+ /* @__PURE__ */ jsxs13("span", { className: "ml-2 text-xs text-muted-foreground", children: [
6547
7128
  current,
6548
7129
  "/",
6549
7130
  total
@@ -6554,15 +7135,15 @@ function WizardShell() {
6554
7135
  const state = useWizard();
6555
7136
  const dispatch = useWizardDispatch();
6556
7137
  const StepComponent = STEP_COMPONENTS[state.step];
6557
- useEffect5(() => {
7138
+ useEffect6(() => {
6558
7139
  window.scrollTo({ top: 0 });
6559
7140
  }, [state.step]);
6560
- return /* @__PURE__ */ jsxs12("div", { className: "flex flex-col", children: [
6561
- getUserStepIndex(state) >= 1 && state.step !== "provision" && state.step !== "done" && /* @__PURE__ */ jsx18("div", { className: "flex items-center justify-end px-6 py-3", children: /* @__PURE__ */ jsx18(StepIndicator, {}) }),
6562
- /* @__PURE__ */ jsx18("main", { className: "flex-1 flex items-start justify-center p-6", children: /* @__PURE__ */ jsx18("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ jsx18(StepComponent, {}) }) }),
6563
- state.error && /* @__PURE__ */ jsxs12("div", { className: "fixed bottom-0 inset-x-0 bg-destructive/10 border-t border-destructive/20 px-6 py-3 text-sm text-destructive flex items-center justify-between", children: [
6564
- /* @__PURE__ */ jsx18("span", { children: state.error }),
6565
- /* @__PURE__ */ jsx18(
7141
+ return /* @__PURE__ */ jsxs13("div", { className: "flex flex-col", children: [
7142
+ getUserStepIndex(state) >= 1 && state.step !== "provision" && state.step !== "done" && /* @__PURE__ */ jsx19("div", { className: "flex items-center justify-end px-6 py-3", children: /* @__PURE__ */ jsx19(StepIndicator, {}) }),
7143
+ /* @__PURE__ */ jsx19("main", { className: "flex-1 flex items-start justify-center p-6", children: /* @__PURE__ */ jsx19("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ jsx19(StepComponent, {}) }) }),
7144
+ state.error && /* @__PURE__ */ jsxs13("div", { className: "fixed bottom-0 inset-x-0 bg-destructive/10 border-t border-destructive/20 px-6 py-3 text-sm text-destructive flex items-center justify-between", children: [
7145
+ /* @__PURE__ */ jsx19("span", { children: state.error }),
7146
+ /* @__PURE__ */ jsx19(
6566
7147
  Button,
6567
7148
  {
6568
7149
  variant: "ghost",
@@ -6576,30 +7157,30 @@ function WizardShell() {
6576
7157
  }
6577
7158
 
6578
7159
  // src/ui/index.tsx
6579
- import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
7160
+ import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
6580
7161
  function WizardPage(_props) {
6581
7162
  const { data: templates, loading, error } = usePluginData("templates");
6582
7163
  if (error) {
6583
- return /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-center min-h-[400px] text-sm text-destructive", children: [
7164
+ return /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-center min-h-[400px] text-sm text-destructive", children: [
6584
7165
  "Failed to load templates: ",
6585
7166
  error.message
6586
7167
  ] });
6587
7168
  }
6588
7169
  if (loading || !templates) {
6589
- return /* @__PURE__ */ jsxs13("div", { className: "flex flex-col items-center justify-center min-h-[400px] gap-4 text-center px-6", children: [
6590
- /* @__PURE__ */ jsx19(LoaderCircle, { className: "h-6 w-6 animate-spin text-muted-foreground" }),
6591
- /* @__PURE__ */ jsxs13("div", { className: "space-y-1.5", children: [
6592
- /* @__PURE__ */ jsx19("p", { className: "text-sm font-medium", children: "Loading templates" }),
6593
- /* @__PURE__ */ jsx19("p", { className: "text-xs text-muted-foreground max-w-xs", children: "Checking your templates directory. If no local templates are found, they'll be downloaded from GitHub \u2014 this may take a moment." })
7170
+ return /* @__PURE__ */ jsxs14("div", { className: "flex flex-col items-center justify-center min-h-[400px] gap-4 text-center px-6", children: [
7171
+ /* @__PURE__ */ jsx20(LoaderCircle, { className: "h-6 w-6 animate-spin text-muted-foreground" }),
7172
+ /* @__PURE__ */ jsxs14("div", { className: "space-y-1.5", children: [
7173
+ /* @__PURE__ */ jsx20("p", { className: "text-sm font-medium", children: "Loading templates" }),
7174
+ /* @__PURE__ */ jsx20("p", { className: "text-xs text-muted-foreground max-w-xs", children: "Checking your templates directory. If no local templates are found, they'll be downloaded from GitHub \u2014 this may take a moment." })
6594
7175
  ] })
6595
7176
  ] });
6596
7177
  }
6597
- return /* @__PURE__ */ jsxs13("div", { className: "space-y-3", children: [
6598
- templates.loadErrors && templates.loadErrors.length > 0 && /* @__PURE__ */ jsx19("div", { className: "mx-4 mt-4 rounded-lg border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-800 dark:text-amber-200", children: /* @__PURE__ */ jsxs13("div", { className: "flex items-start gap-2", children: [
6599
- /* @__PURE__ */ jsx19(TriangleAlert, { className: "h-4 w-4 shrink-0 mt-0.5" }),
6600
- /* @__PURE__ */ jsxs13("div", { children: [
6601
- /* @__PURE__ */ jsx19("p", { className: "font-medium", children: "Some template files could not be loaded" }),
6602
- /* @__PURE__ */ jsxs13("p", { className: "mt-0.5 text-amber-700 dark:text-amber-300", children: [
7178
+ return /* @__PURE__ */ jsxs14("div", { className: "space-y-3", children: [
7179
+ templates.loadErrors && templates.loadErrors.length > 0 && /* @__PURE__ */ jsx20("div", { className: "mx-4 mt-4 rounded-lg border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-800 dark:text-amber-200", children: /* @__PURE__ */ jsxs14("div", { className: "flex items-start gap-2", children: [
7180
+ /* @__PURE__ */ jsx20(TriangleAlert, { className: "h-4 w-4 shrink-0 mt-0.5" }),
7181
+ /* @__PURE__ */ jsxs14("div", { children: [
7182
+ /* @__PURE__ */ jsx20("p", { className: "font-medium", children: "Some template files could not be loaded" }),
7183
+ /* @__PURE__ */ jsxs14("p", { className: "mt-0.5 text-amber-700 dark:text-amber-300", children: [
6603
7184
  templates.loadErrors.length,
6604
7185
  " parse warning",
6605
7186
  templates.loadErrors.length > 1 ? "s" : "",
@@ -6607,7 +7188,7 @@ function WizardPage(_props) {
6607
7188
  ] })
6608
7189
  ] })
6609
7190
  ] }) }),
6610
- /* @__PURE__ */ jsx19(WizardProvider, { templates, children: /* @__PURE__ */ jsx19(WizardShell, {}) })
7191
+ /* @__PURE__ */ jsx20(WizardProvider, { templates, children: /* @__PURE__ */ jsx20(WizardShell, {}) })
6611
7192
  ] });
6612
7193
  }
6613
7194
  function ToolbarButton({ context }) {
@@ -6618,7 +7199,7 @@ function ToolbarButton({ context }) {
6618
7199
  if (href !== "#") window.history.pushState({}, "", href);
6619
7200
  window.dispatchEvent(new PopStateEvent("popstate"));
6620
7201
  };
6621
- return /* @__PURE__ */ jsx19(
7202
+ return /* @__PURE__ */ jsx20(
6622
7203
  "a",
6623
7204
  {
6624
7205
  href,
@@ -6648,7 +7229,7 @@ function SidebarLink({ context }) {
6648
7229
  if (href !== "#") window.history.pushState({}, "", href);
6649
7230
  window.dispatchEvent(new PopStateEvent("popstate"));
6650
7231
  };
6651
- return /* @__PURE__ */ jsxs13(
7232
+ return /* @__PURE__ */ jsxs14(
6652
7233
  "a",
6653
7234
  {
6654
7235
  href,
@@ -6668,8 +7249,8 @@ function SidebarLink({ context }) {
6668
7249
  backgroundColor: isActive ? "var(--accent)" : "transparent"
6669
7250
  },
6670
7251
  children: [
6671
- /* @__PURE__ */ jsx19(Sparkles, { style: { width: 16, height: 16, flexShrink: 0 } }),
6672
- /* @__PURE__ */ jsx19("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: "Create Company" })
7252
+ /* @__PURE__ */ jsx20(Sparkles, { style: { width: 16, height: 16, flexShrink: 0 } }),
7253
+ /* @__PURE__ */ jsx20("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: "Create Company" })
6673
7254
  ]
6674
7255
  }
6675
7256
  );
@@ -6699,12 +7280,15 @@ lucide-react/dist/esm/icons/chevron-down.js:
6699
7280
  lucide-react/dist/esm/icons/chevron-left.js:
6700
7281
  lucide-react/dist/esm/icons/chevron-right.js:
6701
7282
  lucide-react/dist/esm/icons/circle-check.js:
7283
+ lucide-react/dist/esm/icons/circle-plus.js:
6702
7284
  lucide-react/dist/esm/icons/clipboard-check.js:
6703
7285
  lucide-react/dist/esm/icons/cpu.js:
6704
7286
  lucide-react/dist/esm/icons/crown.js:
6705
7287
  lucide-react/dist/esm/icons/external-link.js:
6706
7288
  lucide-react/dist/esm/icons/file-text.js:
6707
7289
  lucide-react/dist/esm/icons/flask-conical.js:
7290
+ lucide-react/dist/esm/icons/git-branch.js:
7291
+ lucide-react/dist/esm/icons/github.js:
6708
7292
  lucide-react/dist/esm/icons/layers.js:
6709
7293
  lucide-react/dist/esm/icons/list-checks.js:
6710
7294
  lucide-react/dist/esm/icons/loader-circle.js: