@juspay/shooter 1.12.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/.claude/hooks/notifier.cjs +199 -81
  2. package/build/client/_app/immutable/chunks/BX6TUKUr.js +3 -0
  3. package/build/client/_app/immutable/chunks/BX6TUKUr.js.br +0 -0
  4. package/build/client/_app/immutable/chunks/BX6TUKUr.js.gz +0 -0
  5. package/build/client/_app/immutable/chunks/{DfsJh23H.js → C8fuqb5_.js} +1 -1
  6. package/build/client/_app/immutable/chunks/C8fuqb5_.js.br +0 -0
  7. package/build/client/_app/immutable/chunks/C8fuqb5_.js.gz +0 -0
  8. package/build/client/_app/immutable/chunks/{DTGtOxE1.js → DXE_ttSN.js} +1 -1
  9. package/build/client/_app/immutable/chunks/DXE_ttSN.js.br +0 -0
  10. package/build/client/_app/immutable/chunks/DXE_ttSN.js.gz +0 -0
  11. package/build/client/_app/immutable/entry/{app.B-sEFuLK.js → app.nFNxeHLO.js} +2 -2
  12. package/build/client/_app/immutable/entry/app.nFNxeHLO.js.br +0 -0
  13. package/build/client/_app/immutable/entry/app.nFNxeHLO.js.gz +0 -0
  14. package/build/client/_app/immutable/entry/start.Ja5Vj3Hy.js +1 -0
  15. package/build/client/_app/immutable/entry/start.Ja5Vj3Hy.js.br +2 -0
  16. package/build/client/_app/immutable/entry/start.Ja5Vj3Hy.js.gz +0 -0
  17. package/build/client/_app/immutable/nodes/{0.-0SstbRm.js → 0.DPygfoxx.js} +1 -1
  18. package/build/client/_app/immutable/nodes/0.DPygfoxx.js.br +0 -0
  19. package/build/client/_app/immutable/nodes/0.DPygfoxx.js.gz +0 -0
  20. package/build/client/_app/immutable/nodes/{1.BVLzPogE.js → 1.CMzJ-vKL.js} +1 -1
  21. package/build/client/_app/immutable/nodes/1.CMzJ-vKL.js.br +0 -0
  22. package/build/client/_app/immutable/nodes/1.CMzJ-vKL.js.gz +0 -0
  23. package/build/client/_app/immutable/nodes/{2.CiUyTQg5.js → 2.Vq2hU4jC.js} +1 -1
  24. package/build/client/_app/immutable/nodes/2.Vq2hU4jC.js.br +0 -0
  25. package/build/client/_app/immutable/nodes/2.Vq2hU4jC.js.gz +0 -0
  26. package/build/client/_app/immutable/nodes/{3.C9vlOBU0.js → 3.C9533L9p.js} +1 -1
  27. package/build/client/_app/immutable/nodes/3.C9533L9p.js.br +0 -0
  28. package/build/client/_app/immutable/nodes/3.C9533L9p.js.gz +0 -0
  29. package/build/client/_app/immutable/nodes/{6.BSsUBbIT.js → 6.BJ2KZBR0.js} +1 -1
  30. package/build/client/_app/immutable/nodes/6.BJ2KZBR0.js.br +0 -0
  31. package/build/client/_app/immutable/nodes/6.BJ2KZBR0.js.gz +0 -0
  32. package/build/client/_app/immutable/nodes/{7.BIQq9Yuz.js → 7.BW3qRNSj.js} +1 -1
  33. package/build/client/_app/immutable/nodes/7.BW3qRNSj.js.br +0 -0
  34. package/build/client/_app/immutable/nodes/7.BW3qRNSj.js.gz +0 -0
  35. package/build/client/_app/immutable/nodes/{8.BU_sJ5_M.js → 8.BBF3ti4G.js} +1 -1
  36. package/build/client/_app/immutable/nodes/8.BBF3ti4G.js.br +0 -0
  37. package/build/client/_app/immutable/nodes/8.BBF3ti4G.js.gz +0 -0
  38. package/build/client/_app/immutable/nodes/{9.C1vJI771.js → 9.LI1n0A_s.js} +1 -1
  39. package/build/client/_app/immutable/nodes/9.LI1n0A_s.js.br +0 -0
  40. package/build/client/_app/immutable/nodes/9.LI1n0A_s.js.gz +0 -0
  41. package/build/client/_app/version.json +1 -1
  42. package/build/client/_app/version.json.br +0 -0
  43. package/build/client/_app/version.json.gz +0 -0
  44. package/build/server/chunks/{0-DgzcVTc0.js → 0-C5VG6nCZ.js} +2 -2
  45. package/build/server/chunks/{0-DgzcVTc0.js.map → 0-C5VG6nCZ.js.map} +1 -1
  46. package/build/server/chunks/{1-iMvE8O_M.js → 1-CxT3oFDd.js} +2 -2
  47. package/build/server/chunks/{1-iMvE8O_M.js.map → 1-CxT3oFDd.js.map} +1 -1
  48. package/build/server/chunks/{2-BJrmwHii.js → 2-D-hS2r7O.js} +2 -2
  49. package/build/server/chunks/{2-BJrmwHii.js.map → 2-D-hS2r7O.js.map} +1 -1
  50. package/build/server/chunks/{3-Ds3b4DfT.js → 3-qAPXfbJm.js} +2 -2
  51. package/build/server/chunks/{3-Ds3b4DfT.js.map → 3-qAPXfbJm.js.map} +1 -1
  52. package/build/server/chunks/{6-DEbZkQEO.js → 6-Vj-4wida.js} +2 -2
  53. package/build/server/chunks/{6-DEbZkQEO.js.map → 6-Vj-4wida.js.map} +1 -1
  54. package/build/server/chunks/{7-BrQeR-CO.js → 7-BYfx84Bj.js} +2 -2
  55. package/build/server/chunks/{7-BrQeR-CO.js.map → 7-BYfx84Bj.js.map} +1 -1
  56. package/build/server/chunks/{8-e5TDwEpx.js → 8-CN6v3xbl.js} +2 -2
  57. package/build/server/chunks/{8-e5TDwEpx.js.map → 8-CN6v3xbl.js.map} +1 -1
  58. package/build/server/chunks/{9-1iqRqatJ.js → 9-BcAY9pkm.js} +2 -2
  59. package/build/server/chunks/{9-1iqRqatJ.js.map → 9-BcAY9pkm.js.map} +1 -1
  60. package/build/server/chunks/{_server.ts-C-W5J15L.js → _server.ts-CFX-S_8q.js} +20 -2
  61. package/build/server/chunks/_server.ts-CFX-S_8q.js.map +1 -0
  62. package/build/server/index.js +1 -1
  63. package/build/server/index.js.map +1 -1
  64. package/build/server/manifest.js +10 -10
  65. package/build/server/manifest.js.map +1 -1
  66. package/package.json +2 -2
  67. package/src/routes/api/notify/+server.ts +43 -2
  68. package/build/client/_app/immutable/chunks/DTGtOxE1.js.br +0 -0
  69. package/build/client/_app/immutable/chunks/DTGtOxE1.js.gz +0 -0
  70. package/build/client/_app/immutable/chunks/DfsJh23H.js.br +0 -0
  71. package/build/client/_app/immutable/chunks/DfsJh23H.js.gz +0 -0
  72. package/build/client/_app/immutable/chunks/DlSs5Yra.js +0 -3
  73. package/build/client/_app/immutable/chunks/DlSs5Yra.js.br +0 -0
  74. package/build/client/_app/immutable/chunks/DlSs5Yra.js.gz +0 -0
  75. package/build/client/_app/immutable/entry/app.B-sEFuLK.js.br +0 -0
  76. package/build/client/_app/immutable/entry/app.B-sEFuLK.js.gz +0 -0
  77. package/build/client/_app/immutable/entry/start.A2buqyYO.js +0 -1
  78. package/build/client/_app/immutable/entry/start.A2buqyYO.js.br +0 -2
  79. package/build/client/_app/immutable/entry/start.A2buqyYO.js.gz +0 -0
  80. package/build/client/_app/immutable/nodes/0.-0SstbRm.js.br +0 -0
  81. package/build/client/_app/immutable/nodes/0.-0SstbRm.js.gz +0 -0
  82. package/build/client/_app/immutable/nodes/1.BVLzPogE.js.br +0 -0
  83. package/build/client/_app/immutable/nodes/1.BVLzPogE.js.gz +0 -0
  84. package/build/client/_app/immutable/nodes/2.CiUyTQg5.js.br +0 -0
  85. package/build/client/_app/immutable/nodes/2.CiUyTQg5.js.gz +0 -0
  86. package/build/client/_app/immutable/nodes/3.C9vlOBU0.js.br +0 -0
  87. package/build/client/_app/immutable/nodes/3.C9vlOBU0.js.gz +0 -0
  88. package/build/client/_app/immutable/nodes/6.BSsUBbIT.js.br +0 -0
  89. package/build/client/_app/immutable/nodes/6.BSsUBbIT.js.gz +0 -0
  90. package/build/client/_app/immutable/nodes/7.BIQq9Yuz.js.br +0 -0
  91. package/build/client/_app/immutable/nodes/7.BIQq9Yuz.js.gz +0 -0
  92. package/build/client/_app/immutable/nodes/8.BU_sJ5_M.js.br +0 -0
  93. package/build/client/_app/immutable/nodes/8.BU_sJ5_M.js.gz +0 -0
  94. package/build/client/_app/immutable/nodes/9.C1vJI771.js.br +0 -0
  95. package/build/client/_app/immutable/nodes/9.C1vJI771.js.gz +0 -0
  96. package/build/server/chunks/_server.ts-C-W5J15L.js.map +0 -1
@@ -523,19 +523,124 @@ function handleSessionStart(_event) {
523
523
  debugLog(`New session started: ${getSessionIdentifier()}`);
524
524
  }
525
525
 
526
+ /**
527
+ * Plan-mode approval options surfaced when Claude calls ExitPlanMode.
528
+ *
529
+ * iOS shows the first 3 + Open-in-Shooter on the lock screen (4 button
530
+ * cap); plan_keep is reachable via the Decide screen.
531
+ */
532
+ const PLAN_MODE_OPTIONS = [
533
+ { id: 'plan_auto', label: 'Auto Mode', hint: 'Bypass permissions for the rest of the session' },
534
+ {
535
+ id: 'plan_accept',
536
+ label: 'Accept Edits',
537
+ hint: 'Auto-accept file edits; still ask for risky operations',
538
+ },
539
+ { id: 'plan_review', label: 'Review Each', hint: 'Default — ask for each tool invocation' },
540
+ { id: 'plan_keep', label: 'Keep Planning', hint: 'Stay in plan mode without exiting' },
541
+ ];
542
+
543
+ /**
544
+ * Map plan_* decisions to the hookSpecificOutput shape Claude Code's
545
+ * PermissionRequest hook expects:
546
+ * plan_auto/accept/review → allow + updatedPermissions.setMode
547
+ * plan_keep → deny (stay in plan mode)
548
+ *
549
+ * Exported via test hook for unit testing without spinning up CC.
550
+ */
551
+ function planDecisionToHookResponse(decision) {
552
+ const modeMap = {
553
+ plan_auto: 'bypassPermissions',
554
+ plan_accept: 'acceptEdits',
555
+ plan_review: 'default',
556
+ };
557
+ if (decision === 'plan_keep') {
558
+ return {
559
+ hookSpecificOutput: {
560
+ hookEventName: 'PermissionRequest',
561
+ permissionDecision: 'deny',
562
+ permissionDecisionReason: 'User chose to keep planning',
563
+ },
564
+ };
565
+ }
566
+ const mode = modeMap[decision];
567
+ if (!mode) return null;
568
+ return {
569
+ hookSpecificOutput: {
570
+ hookEventName: 'PermissionRequest',
571
+ decision: {
572
+ behavior: 'allow',
573
+ updatedPermissions: [{ type: 'setMode', mode, destination: 'session' }],
574
+ },
575
+ },
576
+ };
577
+ }
578
+
579
+ /**
580
+ * Map a binary allow|deny decision to the hookSpecificOutput shape.
581
+ */
582
+ function binaryDecisionToHookResponse(decision, wsActive) {
583
+ return {
584
+ hookSpecificOutput: {
585
+ hookEventName: 'PermissionRequest',
586
+ permissionDecision: decision,
587
+ permissionDecisionReason: `User ${decision === 'allow' ? 'approved' : 'denied'} via ${wsActive ? 'WebSocket' : 'iPhone notification'}`,
588
+ },
589
+ };
590
+ }
591
+
592
+ /**
593
+ * Detect whether this permission request is the plan-mode approval
594
+ * (ExitPlanMode tool). Plan-mode gets a richer 4-option notification
595
+ * instead of binary allow/deny.
596
+ */
597
+ function isPlanModePermission(d) {
598
+ return d.tool === 'ExitPlanMode' || d.toolName === 'ExitPlanMode';
599
+ }
600
+
601
+ /**
602
+ * Build the notification body for a plan-mode approval. The plan
603
+ * content itself sits in body + question so the iOS Decide screen can
604
+ * show it; the body also lists the numbered options for lock-screen
605
+ * users who don't open the app.
606
+ */
607
+ function buildPlanModeNotification(event) {
608
+ const d = event.data;
609
+ const toolInput = d.toolInput || {};
610
+ const plan = typeof toolInput.plan === 'string' ? toolInput.plan : '';
611
+ const planSummary = summarize(plan, 300) || 'Plan ready for approval';
612
+
613
+ const title = `${event.projectName} · Plan ready`;
614
+ const subtitle = summarize(plan, 70) || 'Review and choose how to proceed';
615
+ const body = [
616
+ planSummary,
617
+ '',
618
+ '1. Auto Mode 2. Accept Edits 3. Review Each 4. Keep Planning',
619
+ ].join('\n');
620
+
621
+ return { title, subtitle, body, question: plan };
622
+ }
623
+
526
624
  /**
527
625
  * Handle permission events (agent needs user to approve a tool)
528
626
  *
529
627
  * Builds a rich notification with tool name + details when available,
530
628
  * falls back to the message text when tool details aren't available.
531
629
  * Content is identical between Claude Code and OpenCode.
630
+ *
631
+ * Plan-mode (ExitPlanMode tool) gets a special 4-option flow instead
632
+ * of binary allow/deny — see PLAN_MODE_OPTIONS + planDecisionToHookResponse.
532
633
  */
533
634
  async function handlePermission(event) {
534
635
  const d = event.data;
535
636
  debugLog(`Permission event: tool=${d.tool}, message=${d.message}`);
536
637
 
638
+ const planMode = isPlanModePermission(d);
639
+
537
640
  const ctx = getSessionContext(d.sessionId);
538
- const { title, subtitle, body } = buildPermissionNotification(event, ctx);
641
+ const { title, subtitle, body } = planMode
642
+ ? buildPlanModeNotification(event)
643
+ : buildPermissionNotification(event, ctx);
539
644
 
540
645
  // Check if WebSocket clients are connected — if so, the events channel
541
646
  // will broadcast the permission-requested event and we skip the push notification
@@ -544,12 +649,20 @@ async function handlePermission(event) {
544
649
  // For Claude Code PermissionRequest: block and poll for iPhone response
545
650
  if (IS_CLAUDE_CODE && event.source === 'claude-code') {
546
651
  const requestId = Math.random().toString(36).substring(2, 15);
547
- debugLog(`Starting bidirectional permission flow (requestId: ${requestId})`);
652
+ debugLog(
653
+ `Starting bidirectional permission flow (requestId: ${requestId}, planMode: ${planMode})`
654
+ );
655
+
656
+ const extras = { skipPush: wsActive, subtitle };
657
+ if (planMode) {
658
+ extras.notificationCategory = 'CLAUDE_PLAN_APPROVAL';
659
+ extras.options = PLAN_MODE_OPTIONS;
660
+ extras.question =
661
+ typeof d.toolInput?.plan === 'string' ? d.toolInput.plan : 'Approve plan and proceed?';
662
+ extras.responseKind = 'hook';
663
+ }
548
664
 
549
- let result;
550
665
  if (wsActive) {
551
- // WebSocket clients connected — skip push notification, but still register
552
- // the pending request on the server so polling can find it.
553
666
  debugLog(`[Notifier] WebSocket clients connected, skipping push notification`);
554
667
  if (IS_CLAUDE_CODE) {
555
668
  console.error(`\n=== WEBSOCKET ACTIVE — SKIPPING PUSH [${requestId}] ===`);
@@ -557,42 +670,32 @@ async function handlePermission(event) {
557
670
  console.error(`Message: ${body}`);
558
671
  console.error(`=== REGISTERING REQUEST & POLLING VIA WEBSOCKET CHANNEL ===\n`);
559
672
  }
560
-
561
- // Register the pending request but skip the actual push notification —
562
- // the events channel will broadcast the permission to connected clients.
563
- result = await sendNotificationAndPoll(
564
- title,
565
- body,
566
- 'permission',
567
- event.source,
568
- requestId,
569
- d,
570
- { skipPush: true, subtitle }
571
- );
572
- } else {
573
- // No WebSocket clients — send push notification and poll
574
- result = await sendNotificationAndPoll(
575
- title,
576
- body,
577
- 'permission',
578
- event.source,
579
- requestId,
580
- d,
581
- { subtitle }
582
- );
583
673
  }
584
674
 
675
+ const result = await sendNotificationAndPoll(
676
+ title,
677
+ body,
678
+ 'permission',
679
+ event.source,
680
+ requestId,
681
+ d,
682
+ extras
683
+ );
684
+
585
685
  if (result && result.decision) {
586
- const hookResponse = {
587
- hookSpecificOutput: {
588
- hookEventName: 'PermissionRequest',
589
- permissionDecision: result.decision,
590
- permissionDecisionReason: `User ${result.decision === 'allow' ? 'approved' : 'denied'} via ${wsActive ? 'WebSocket' : 'iPhone notification'}`,
591
- },
592
- };
593
- // Write decision to stdout for Claude Code to read
594
- process.stdout.write(JSON.stringify(hookResponse));
595
- debugLog(`Wrote hook decision to stdout: ${result.decision}`);
686
+ // Plan-mode decisions (plan_auto/accept/review/keep) need the
687
+ // richer hookSpecificOutput shape with updatedPermissions.setMode.
688
+ // Binary allow/deny falls through the legacy path.
689
+ const hookResponse = planMode
690
+ ? planDecisionToHookResponse(result.decision)
691
+ : binaryDecisionToHookResponse(result.decision, wsActive);
692
+
693
+ if (hookResponse) {
694
+ process.stdout.write(JSON.stringify(hookResponse));
695
+ debugLog(`Wrote hook decision to stdout: ${result.decision}`);
696
+ } else {
697
+ debugLog(`Unknown decision shape '${result.decision}' — falling through to local dialog`);
698
+ }
596
699
  } else {
597
700
  debugLog('No response received - falling through to local permission dialog');
598
701
  // Output nothing → Claude Code shows normal permission dialog
@@ -608,6 +711,11 @@ async function handlePermission(event) {
608
711
  }
609
712
  }
610
713
 
714
+ // Pure helpers above are also re-exported alongside OpenCodePlugin at
715
+ // the bottom of this file for unit testing. The single module.exports
716
+ // block lives at the end of the file (see "Exports and Main Execution"
717
+ // section).
718
+
611
719
  /**
612
720
  * Handle permission_notification events (Notification hook with permission_prompt type).
613
721
  *
@@ -1176,8 +1284,47 @@ function sendNotificationAndPoll(
1176
1284
  source,
1177
1285
  requestId,
1178
1286
  eventData,
1179
- { skipPush = false, subtitle = '' } = {}
1287
+ {
1288
+ skipPush = false,
1289
+ subtitle = '',
1290
+ // Dynamic-options extras forwarded to /api/notify body so the server
1291
+ // can persist them on the pending_requests row + set the right APNs
1292
+ // category. Undefined → server falls back to the binary CLAUDE_PERMISSION
1293
+ // flow (preserves legacy behavior).
1294
+ notificationCategory,
1295
+ question,
1296
+ options,
1297
+ responseKind,
1298
+ } = {}
1180
1299
  ) {
1300
+ // Common body shared between the skipPush (register-only) and the
1301
+ // full push paths. Splitting reduces drift between the two.
1302
+ const buildNotifyBody = (timestamp, finalBody) => ({
1303
+ title,
1304
+ ...(subtitle ? { subtitle } : {}),
1305
+ message: finalBody,
1306
+ waitForResponse: true,
1307
+ ...(skipPush ? { skipPush: true } : {}),
1308
+ ...(DEVICE_TOKEN && { deviceToken: DEVICE_TOKEN }),
1309
+ ...(notificationCategory && { notificationCategory }),
1310
+ ...(question !== undefined && { question }),
1311
+ ...(options && { options }),
1312
+ ...(responseKind && { responseKind }),
1313
+ data: {
1314
+ category,
1315
+ project: getProjectName(),
1316
+ timestamp,
1317
+ requestId,
1318
+ clientTimestamp: timestamp,
1319
+ source: 'shooter-completion-detector',
1320
+ environment: USE_LOCAL ? 'local' : 'remote',
1321
+ runtime: source,
1322
+ toolName: eventData.tool || '',
1323
+ toolInput: eventData.toolInput || {},
1324
+ sessionId: eventData.sessionId || '',
1325
+ },
1326
+ });
1327
+
1181
1328
  return new Promise((resolve) => {
1182
1329
  const timestamp = new Date().toISOString();
1183
1330
 
@@ -1194,27 +1341,7 @@ function sendNotificationAndPoll(
1194
1341
  // Register the pending request on the server so polling finds it.
1195
1342
  // We still need to POST with waitForResponse so the server creates
1196
1343
  // the pending-request entry, but we mark it as ws-only.
1197
- const registerPayload = JSON.stringify({
1198
- title,
1199
- ...(subtitle ? { subtitle } : {}),
1200
- message: finalBody,
1201
- waitForResponse: true,
1202
- skipPush: true,
1203
- ...(DEVICE_TOKEN && { deviceToken: DEVICE_TOKEN }),
1204
- data: {
1205
- category,
1206
- project: getProjectName(),
1207
- timestamp,
1208
- requestId,
1209
- clientTimestamp: timestamp,
1210
- source: 'shooter-completion-detector',
1211
- environment: USE_LOCAL ? 'local' : 'remote',
1212
- runtime: source,
1213
- toolName: eventData.tool || '',
1214
- toolInput: eventData.toolInput || {},
1215
- sessionId: eventData.sessionId || '',
1216
- },
1217
- });
1344
+ const registerPayload = JSON.stringify(buildNotifyBody(timestamp, finalBody));
1218
1345
 
1219
1346
  const registerOptions = {
1220
1347
  method: 'POST',
@@ -1263,26 +1390,7 @@ function sendNotificationAndPoll(
1263
1390
 
1264
1391
  debugLog(`Sending bidirectional notification: "${title}" (requestId: ${requestId})`);
1265
1392
 
1266
- const payload = JSON.stringify({
1267
- title,
1268
- ...(subtitle ? { subtitle } : {}),
1269
- message: finalBody,
1270
- waitForResponse: true,
1271
- ...(DEVICE_TOKEN && { deviceToken: DEVICE_TOKEN }),
1272
- data: {
1273
- category,
1274
- project: getProjectName(),
1275
- timestamp,
1276
- requestId,
1277
- clientTimestamp: timestamp,
1278
- source: 'shooter-completion-detector',
1279
- environment: USE_LOCAL ? 'local' : 'remote',
1280
- runtime: source,
1281
- toolName: eventData.tool || '',
1282
- toolInput: eventData.toolInput || {},
1283
- sessionId: eventData.sessionId || '',
1284
- },
1285
- });
1393
+ const payload = JSON.stringify(buildNotifyBody(timestamp, finalBody));
1286
1394
 
1287
1395
  const options = {
1288
1396
  method: 'POST',
@@ -1643,11 +1751,21 @@ const OpenCodePlugin = async (ctx) => {
1643
1751
  // Exports and Main Execution
1644
1752
  // ============================================
1645
1753
 
1646
- // Export for OpenCode plugin system
1754
+ // Export for OpenCode plugin system + unit tests.
1755
+ //
1756
+ // The default export remains OpenCodePlugin so the OpenCode plugin
1757
+ // loader (which does `require(notifier.cjs)()`) keeps working. Pure
1758
+ // helpers (plan-mode routing, etc.) are attached as named properties
1759
+ // so tests/ can require them without spawning the full hook script.
1647
1760
  if (typeof module !== 'undefined' && module.exports) {
1648
1761
  module.exports = OpenCodePlugin;
1649
1762
  module.exports.OpenCodePlugin = OpenCodePlugin;
1650
1763
  module.exports.ShooterNotifier = OpenCodePlugin;
1764
+ // Pure-function exports for unit tests (tests/plan-mode-routing.test.cjs).
1765
+ module.exports.PLAN_MODE_OPTIONS = PLAN_MODE_OPTIONS;
1766
+ module.exports.binaryDecisionToHookResponse = binaryDecisionToHookResponse;
1767
+ module.exports.isPlanModePermission = isPlanModePermission;
1768
+ module.exports.planDecisionToHookResponse = planDecisionToHookResponse;
1651
1769
  }
1652
1770
 
1653
1771
  // Run main() when called directly from CLI (Claude Code)
@@ -0,0 +1,3 @@
1
+ import{bv as Te,v as qe,s as j,g as P,b as N,P as oe,bw as At}from"./DYuMZGL5.js";class pe{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Le{constructor(t,n){this.status=t,this.location=n}}class je extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function Et(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function kt(e){return e.split("%25").map(decodeURI).join("%25")}function Rt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function ye({href:e}){return e.split("#")[0]}function St(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;const It=new TextDecoder;function Ut(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const Tt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&z.delete(Pe(e)),Tt(e,t));const z=new Map;function Lt(e,t){const n=Pe(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...s}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&z.set(n,{body:a,init:s,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(a=Ut(a)),Promise.resolve(new Response(a,s))}return window.fetch(e,t)}function jt(e,t,n){if(z.size>0){const r=Pe(e,n),a=z.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(a.body,a.init);z.delete(r)}}return window.fetch(t,n)}function Pe(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${St(...a)}"]`}return r}const Pt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Nt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${xt(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return t.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const o=r.split(/\[(.+?)\](?!\])/);return"/"+o.map((i,l)=>{if(l%2){if(i.startsWith("x+"))return ve(String.fromCharCode(parseInt(i.slice(2),16)));if(i.startsWith("u+"))return ve(String.fromCharCode(...i.slice(2).split("-").map(g=>parseInt(g,16))));const u=Pt.exec(i),[,d,p,h,f]=u;return t.push({name:h,matcher:f,optional:!!d,rest:!!p,chained:p?l===1&&o[0]==="":!1}),p?"([^]*?)":d?"([^/]*)?":"([^/]+?)"}return ve(i)}).join("")}).join("")}/?$`),params:t}}function Ot(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function xt(e){return e.slice(1).split("/").filter(Ot)}function Ct(e,t,n){const r={},a=e.slice(1),s=a.filter(c=>c!==void 0);let o=0;for(let c=0;c<t.length;c+=1){const i=t[c];let l=a[c-o];if(i.chained&&i.rest&&o&&(l=a.slice(c-o,c+1).filter(u=>u).join("/"),o=0),l===void 0)if(i.rest)l="";else continue;if(!i.matcher||n[i.matcher](l)){r[i.name]=l;const u=t[c+1],d=a[c+1];u&&!u.rest&&u.optional&&d&&i.chained&&(o=0),!u&&!d&&Object.keys(r).length===s.length&&(o=0);continue}if(i.optional&&i.chained){o++;continue}return}if(!o)return r}function ve(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Dt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([c,[i,l,u]])=>{const{pattern:d,params:p}=Nt(c),h={id:c,exec:f=>{const g=d.exec(f);if(g)return Ct(g,p,r)},errors:[1,...u||[]].map(f=>e[f]),layouts:[0,...l||[]].map(o),leaf:s(i)};return h.errors.length=h.layouts.length=Math.max(h.errors.length,h.layouts.length),h});function s(c){const i=c<0;return i&&(c=~c),[i,e[c]]}function o(c){return c===void 0?c:[a.has(c),e[c]]}}function Qe(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Ve(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const U=globalThis.__sveltekit_9wjqda?.base??"",$t=globalThis.__sveltekit_9wjqda?.assets??U??"",Bt="1779661792943",et="sveltekit:snapshot",tt="sveltekit:scroll",nt="sveltekit:states",Ft="sveltekit:pageurl",V="sveltekit:history",Q="sveltekit:navigation",B={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},re=location.origin;function Ne(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function M(){return{x:pageXOffset,y:pageYOffset}}function q(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Ye={...B,"":B.hover};function rt(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function at(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=rt(e)}}function Ee(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const c=location.hash.split("#")[1]||"/";r.hash=`#${c}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,s=!r||!!a||_e(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),o=r?.origin===re&&e.hasAttribute("download");return{url:r,external:s,target:a,download:o}}function se(e){let t=null,n=null,r=null,a=null,s=null,o=null,c=e;for(;c&&c!==document.documentElement;)r===null&&(r=q(c,"preload-code")),a===null&&(a=q(c,"preload-data")),t===null&&(t=q(c,"keepfocus")),n===null&&(n=q(c,"noscroll")),s===null&&(s=q(c,"reload")),o===null&&(o=q(c,"replacestate")),c=rt(c);function i(l){switch(l){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Ye[r??"off"],preload_data:Ye[a??"off"],keepfocus:i(t),noscroll:i(n),reload:i(s),replace_state:i(o)}}function Ge(e){const t=Te(e);let n=!0;function r(){n=!0,t.update(o=>o)}function a(o){n=!1,t.set(o)}function s(o){let c;return t.subscribe(i=>{(c===void 0||n&&i!==c)&&o(c=i)})}return{notify:r,set:a,subscribe:s}}const ot={v:()=>{}};function Mt(){const{set:e,subscribe:t}=Te(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${$t}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const o=(await a.json()).version!==Bt;return o&&(e(!0),ot.v(),clearTimeout(n)),o}catch{return!1}}return{subscribe:t,check:r}}function _e(e,t,n){return e.origin!==re||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function Pn(e){}const qt=-1,Vt=-2,Yt=-3,Gt=-4,Kt=-5,Wt=-6,Ht=-7,st=2**32-1,ke=st-1;function Xt(e){return!(!Number.isInteger(e)||e<0||e>ke)}function zt(e){return!(!Number.isInteger(e)||e<0||e>st)}function Jt(e){return Uint8Array.fromBase64(e).buffer}function Zt(e){return Uint8Array.from(Buffer.from(e,"base64")).buffer}function Qt(e){const t=atob(e),n=t.length,r=new Uint8Array(n);for(let a=0;a<n;a++)r[a]=t.charCodeAt(a);return r.buffer}const en=typeof Uint8Array.fromBase64=="function",tn=typeof process=="object"&&process.versions?.node!==void 0,nn=en?Jt:tn?Zt:Qt;function rn(e,t){if(typeof e=="number")return s(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const n=e,r=Array(n.length);let a=null;function s(o,c=!1){if(o===qt)return;if(o===Yt)return NaN;if(o===Gt)return 1/0;if(o===Kt)return-1/0;if(o===Wt)return-0;if(c||typeof o!="number")throw new Error("Invalid input");if(o in r)return r[o];const i=n[o];if(!i||typeof i!="object")r[o]=i;else if(Array.isArray(i))if(typeof i[0]=="string"){const l=i[0],u=t&&Object.hasOwn(t,l)?t[l]:void 0;if(u){let d=i[1];if(typeof d!="number"&&(d=n.push(i[1])-1),a??=new Set,a.has(d))throw new Error("Invalid circular reference");return a.add(d),r[o]=u(s(d)),a.delete(d),r[o]}switch(l){case"Date":r[o]=new Date(i[1]);break;case"Set":const d=new Set;r[o]=d;for(let f=1;f<i.length;f+=1)d.add(s(i[f]));break;case"Map":const p=new Map;r[o]=p;for(let f=1;f<i.length;f+=2)p.set(s(i[f]),s(i[f+1]));break;case"RegExp":r[o]=new RegExp(i[1],i[2]);break;case"Object":{const f=i[1];if(typeof n[f]=="object"&&n[f][0]!=="BigInt")throw new Error("Invalid input");r[o]=Object(s(f));break}case"BigInt":r[o]=BigInt(i[1]);break;case"null":const h=Object.create(null);r[o]=h;for(let f=1;f<i.length;f+=2){if(i[f]==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");h[i[f]]=s(i[f+1])}break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Float16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":case"DataView":{if(n[i[1]][0]!=="ArrayBuffer")throw new Error("Invalid data");const f=globalThis[l],g=s(i[1]);r[o]=i[2]!==void 0?new f(g,i[2],i[3]):new f(g);break}case"ArrayBuffer":{const f=i[1];if(typeof f!="string")throw new Error("Invalid ArrayBuffer encoding");const g=nn(f);r[o]=g;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const f=l.slice(9);r[o]=Temporal[f].from(i[1]);break}case"URL":{const f=new URL(i[1]);r[o]=f;break}case"URLSearchParams":{const f=new URLSearchParams(i[1]);r[o]=f;break}default:throw new Error(`Unknown type ${l}`)}}else if(i[0]===Ht){const l=i[1];if(!zt(l))throw new Error("Invalid input");const u=[];r[o]=u,u[ke]=void 0,delete u[ke];for(let d=2;d<i.length;d+=2){const p=i[d];if(!Xt(p)||p>=l)throw new Error("Invalid input");u[p]=s(i[d+1])}u.length=l}else{const l=new Array(i.length);r[o]=l;for(let u=0;u<i.length;u+=1){const d=i[u];d!==Vt&&(l[u]=s(d))}}else{const l={};r[o]=l;for(const u of Object.keys(i)){if(u==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const d=i[u];l[u]=s(d)}}return r[o]}return s(0)}const it=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...it];const an=new Set([...it]);[...an];function on(e){return e.filter(t=>t!=null)}const sn="x-sveltekit-invalidated",cn="x-sveltekit-trailing-slash";function ie(e){return e instanceof pe||e instanceof je?e.status:500}function ln(e){return e instanceof je?e.text:"Internal Error"}let S,ee,be;const fn=qe.toString().includes("$$")||/function \w+\(\) \{\}/.test(qe.toString()),Ke="a:";fn?(S={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(Ke)},ee={current:null},be={current:!1}):(S=new class{#e=j({});get data(){return P(this.#e)}set data(t){N(this.#e,t)}#t=j(null);get form(){return P(this.#t)}set form(t){N(this.#t,t)}#n=j(null);get error(){return P(this.#n)}set error(t){N(this.#n,t)}#r=j({});get params(){return P(this.#r)}set params(t){N(this.#r,t)}#a=j({id:null});get route(){return P(this.#a)}set route(t){N(this.#a,t)}#o=j({});get state(){return P(this.#o)}set state(t){N(this.#o,t)}#s=j(-1);get status(){return P(this.#s)}set status(t){N(this.#s,t)}#i=j(new URL(Ke));get url(){return P(this.#i)}set url(t){N(this.#i,t)}},ee=new class{#e=j(null);get current(){return P(this.#e)}set current(t){N(this.#e,t)}},be=new class{#e=j(!1);get current(){return P(this.#e)}set current(t){N(this.#e,t)}},ot.v=()=>be.current=!0);function un(e){Object.assign(S,e)}const dn="/__data.json",hn=".html__data.json";function pn(e){return e.endsWith(".html")?e.replace(/\.html$/,hn):e.replace(/\/$/,"")+dn}const _n=new Set(["icon","shortcut icon","apple-touch-icon"]);let H=null;const D=Qe(tt)??{},te=Qe(et)??{},C={url:Ge({}),page:Ge({}),navigating:Te(null),updated:Mt()};function Oe(e){D[e]=M()}function gn(e,t){let n=e+1;for(;D[n];)delete D[n],n+=1;for(n=t+1;te[n];)delete te[n],n+=1}function K(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function ct(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(U||"/");e&&await e.update()}}function We(){}let xe,Re,ce,x,Se,A;const le=[],fe=[];let L=null;function Ie(){L?.fork?.then(e=>e?.discard()),L=null}const ae=new Map,lt=new Set,mn=new Set,J=new Set;let w={branch:[],error:null,url:null},Ce=!1,ue=!1,He=!0,ne=!1,X=!1,ft=!1,De=!1,ut,R,I,F;const Z=new Set,Xe=new Map;async function Cn(e,t,n){globalThis.__sveltekit_9wjqda?.data&&globalThis.__sveltekit_9wjqda.data,document.URL!==location.href&&(location.href=location.href),A=e,await e.hooks.init?.(),xe=Dt(e),x=document.documentElement,Se=t,Re=e.nodes[0],ce=e.nodes[1],Re(),ce(),R=history.state?.[V],I=history.state?.[Q],R||(R=I=Date.now(),history.replaceState({...history.state,[V]:R,[Q]:I},""));const r=D[R];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await Un(Se,n)):(await Y({type:"enter",url:Ne(A.hash?Ln(new URL(location.href)):location.href),replace_state:!0}),a()),In()}function wn(){le.length=0,De=!1}function dt(e){fe.some(t=>t?.snapshot)&&(te[e]=fe.map(t=>t?.snapshot?.capture()))}function ht(e){te[e]?.forEach((t,n)=>{fe[n]?.snapshot?.restore(t)})}function ze(){Oe(R),Ve(tt,D),dt(I),Ve(et,te)}async function pt(e,t,n,r){let a;t.invalidateAll&&Ie(),await Y({type:"goto",url:Ne(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(De=!0,a=[...Xe.keys()]),t.invalidate&&t.invalidate.forEach(Sn)}}),t.invalidateAll&&oe().then(oe).then(()=>{Xe.forEach(({resource:s},o)=>{a?.includes(o)&&s.refresh?.()})})}async function yn(e){if(e.id!==L?.id){Ie();const t={};Z.add(t),L={id:e.id,token:t,promise:gt({...e,preload:t}).then(n=>(Z.delete(t),n.type==="loaded"&&n.state.error&&Ie(),n)),fork:null}}return L.promise}async function Ae(e){const t=(await me(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(n=>n[1]()))}async function _t(e,t,n){const r={params:w.params,route:{id:w.route?.id??null},url:new URL(location.href)};w={...e.state,nav:r};const a=document.querySelector("style[data-sveltekit]");if(a&&a.remove(),Object.assign(S,e.props.page),ut=new A.root({target:t,props:{...e.props,stores:C,components:fe},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),ht(I),n){const s={from:null,to:{...r,scroll:D[R]??M()},willUnload:!1,type:"enter",complete:Promise.resolve()};J.forEach(o=>o(s))}ue=!0}async function de({url:e,params:t,branch:n,errors:r,status:a,error:s,route:o,form:c}){let i="never";if(U&&(e.pathname===U||e.pathname===U+"/"))i="always";else for(const f of n)f?.slash!==void 0&&(i=f.slash);e.pathname=Et(e.pathname,i),e.search=e.search;const l={type:"loaded",state:{url:e,params:t,branch:n,error:s,route:o},props:{constructors:on(n).map(f=>f.node.component),page:Me(S)}};c!==void 0&&(l.props.form=c);let u={},d=!S,p=0;for(let f=0;f<Math.max(n.length,w.branch.length);f+=1){const g=n[f],b=w.branch[f];g?.data!==b?.data&&(d=!0),g&&(u={...u,...g.data},d&&(l.props[`data_${p}`]=u),p+=1)}return(!w.url||e.href!==w.url.href||w.error!==s||c!==void 0&&c!==S.form||d)&&(l.props.page={error:s,params:t,route:{id:o?.id??null},state:{},status:a,url:new URL(e),form:c??null,data:d?u:S.data}),l}async function $e({loader:e,parent:t,url:n,params:r,route:a,server_data_node:s}){let o=null;const c={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},i=await e();return{node:i,loader:e,server:s,universal:i.universal?.load?{type:"data",data:o,uses:c}:null,data:o??s?.data??null,slash:i.universal?.trailingSlash??s?.slash}}function vn(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const s=ue?jt(r,a.href,t):Lt(r,t);return{resolved:a,promise:s}}function Je(e,t,n,r,a,s){if(De)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const o of a.search_params)if(r.has(o))return!0;for(const o of a.params)if(s[o]!==w.params[o])return!0;for(const o of a.dependencies)if(le.some(c=>c(new URL(o))))return!0;return!1}function Be(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function bn(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),s=t.searchParams.getAll(r);a.every(o=>s.includes(o))&&s.every(o=>a.includes(o))&&n.delete(r)}return n}function Ze({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Me(S),constructors:[]}}}async function gt({id:e,invalidating:t,url:n,params:r,route:a,preload:s}){if(L?.id===e)return Z.delete(L.token),L.promise;const{errors:o,layouts:c,leaf:i}=a,l=[...c,i];o.forEach(m=>m?.().catch(()=>{})),l.forEach(m=>m?.[1]().catch(()=>{}));let u=null;const d=w.url?e!==he(w.url):!1,p=w.route?a.id!==w.route.id:!1,h=bn(w.url,n);let f=!1;{const m=l.map((y,E)=>{const k=w.branch[E],v=!!y?.[0]&&(k?.loader!==y[1]||Je(f,p,d,h,k.server?.uses,r));return v&&(f=!0),v});if(m.some(Boolean)){try{u=await yt(n,m)}catch(y){const E=await G(y,{url:n,params:r,route:{id:e}});return Z.has(s)?Ze({error:E,url:n,params:r,route:a}):ge({status:ie(y),error:E,url:n,route:a})}if(u.type==="redirect")return u}}const g=u?.nodes;let b=!1;const _=l.map(async(m,y)=>{if(!m)return;const E=w.branch[y],k=g?.[y];if((!k||k.type==="skip")&&m[1]===E?.loader&&!Je(b,p,d,h,E.universal?.uses,r))return E;if(b=!0,k?.type==="error")throw k;return $e({loader:m[1],url:n,params:r,route:a,parent:async()=>{const O={};for(let $=0;$<y;$+=1)Object.assign(O,(await _[$])?.data);return O},server_data_node:Be(k===void 0&&m[0]?{type:"skip"}:k??null,m[0]?E?.server:void 0)})});for(const m of _)m.catch(()=>{});const T=[];for(let m=0;m<l.length;m+=1)if(l[m])try{T.push(await _[m])}catch(y){if(y instanceof Le)return{type:"redirect",location:y.location};if(Z.has(s))return Ze({error:await G(y,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let E=ie(y),k;if(g?.includes(y))E=y.status??E,k=y.error;else if(y instanceof pe)k=y.body;else{if(await C.updated.check())return await ct(),await K(n);k=await G(y,{params:r,url:n,route:{id:a.id}})}const v=await An(m,T,o);return v?de({url:n,params:r,branch:T.slice(0,v.idx).concat(v.node),errors:o,status:E,error:k,route:a}):await wt(n,{id:a.id},k,E)}else T.push(void 0);return de({url:n,params:r,branch:T,errors:o,status:200,error:null,route:a,form:t?void 0:null})}async function An(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function ge({status:e,error:t,url:n,route:r}){const a={};let s=null;if(A.server_loads[0]===0)try{const c=await yt(n,[!0]);if(c.type!=="data"||c.nodes[0]&&c.nodes[0].type!=="data")throw 0;s=c.nodes[0]??null}catch{(n.origin!==re||n.pathname!==location.pathname||Ce)&&await K(n)}try{const o=await $e({loader:Re,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Be(s)}),c={node:await ce(),loader:ce,universal:null,server:null,data:null};return de({url:n,params:a,branch:[o,c],status:e,error:t,errors:[],route:null})}catch(o){if(o instanceof Le)return pt(new URL(o.location,location.href),{},0);throw o}}async function En(e){const t=e.href;if(ae.has(t))return ae.get(t);let n;try{const r=(async()=>{let a=await A.hooks.reroute({url:new URL(e),fetch:async(s,o)=>vn(s,o,e).promise})??e;if(typeof a=="string"){const s=new URL(e);A.hash?s.hash=a:s.pathname=a,a=s}return a})();ae.set(t,r),n=await r}catch{ae.delete(t);return}return n}async function me(e,t){if(e&&!_e(e,U,A.hash)){const n=await En(e);if(!n)return;const r=kn(n);for(const a of xe){const s=a.exec(r);if(s)return{id:he(e),invalidating:t,route:a,params:Rt(s),url:e}}}}function kn(e){return kt(A.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(U.length))||"/"}function he(e){return(A.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function mt({url:e,type:t,intent:n,delta:r,event:a,scroll:s}){let o=!1;const c=Fe(w,n,e,t,s??null);r!==void 0&&(c.navigation.delta=r),a!==void 0&&(c.navigation.event=a);const i={...c.navigation,cancel:()=>{o=!0,c.reject(new Error("navigation cancelled"))}};return ne||lt.forEach(l=>l(i)),o?null:c}async function Y({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:o={},redirect_count:c=0,nav_token:i={},accept:l=We,block:u=We,event:d}){const p=F;F=i;const h=await me(t,!1),f=e==="enter"?Fe(w,h,t,e):mt({url:t,type:e,delta:n?.delta,intent:h,scroll:n?.scroll,event:d});if(!f){u(),F===i&&(F=p);return}const g=R,b=I;l(),ne=!0,ue&&f.navigation.type!=="enter"&&C.navigating.set(ee.current=f.navigation);let _=h&&await gt(h);if(!_){if(_e(t,U,A.hash))return await K(t,s);_=await wt(t,{id:null},await G(new je(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,s)}if(t=h?.url||t,F!==i)return f.reject(new Error("navigation aborted")),!1;if(_.type==="redirect"){if(c<20){await Y({type:e,url:new URL(_.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:s,state:o,redirect_count:c+1,nav_token:i}),f.fulfil(void 0);return}_=await ge({status:500,error:await G(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else _.props.page.status>=400&&await C.updated.check()&&(await ct(),await K(t,s));if(wn(),Oe(g),dt(b),_.props.page.url.pathname!==t.pathname&&(t.pathname=_.props.page.url.pathname),o=n?n.state:o,!n){const v=s?0:1,O={[V]:R+=v,[Q]:I+=v,[nt]:o};(s?history.replaceState:history.pushState).call(history,O,"",t),s||gn(R,I)}const T=h&&L?.id===h.id?L.fork:null;L=null,_.props.page.state=o;let m;if(ue){const v=(await Promise.all(Array.from(mn,W=>W(f.navigation)))).filter(W=>typeof W=="function");if(v.length>0){let W=function(){v.forEach(we=>{J.delete(we)})};v.push(W),v.forEach(we=>{J.add(we)})}const O=f.navigation.to;w={..._.state,nav:{params:O.params,route:O.route,url:O.url}},_.props.page&&(_.props.page.url=t);const $=T&&await T;$?m=$.commit():(H=null,ut.$set(_.props),H&&Object.assign(_.props.page,H),un(_.props.page),m=At?.()),ft=!0}else await _t(_,Se,!1);const{activeElement:y}=document;await m,await oe(),await oe();let E=null;if(He){const v=n?n.scroll:a?M():null;v?scrollTo(v.x,v.y):(E=t.hash&&document.getElementById(bt(t)))?E.scrollIntoView():scrollTo(0,0)}const k=document.activeElement!==y&&document.activeElement!==document.body;!r&&!k&&Tn(t,!E),He=!0,_.props.page&&(H&&Object.assign(_.props.page,H),Object.assign(S,_.props.page)),ne=!1,e==="popstate"&&ht(I),f.fulfil(void 0),f.navigation.to&&(f.navigation.to.scroll=M()),J.forEach(v=>v(f.navigation)),C.navigating.set(ee.current=null)}async function wt(e,t,n,r,a){return e.origin===re&&e.pathname===location.pathname&&!Ce?await ge({status:r,error:n,url:e,route:t}):await K(e,a)}function Rn(){let e,t={element:void 0,href:void 0},n;x.addEventListener("mousemove",c=>{const i=c.target;clearTimeout(e),e=setTimeout(()=>{s(i,B.hover)},20)});function r(c){c.defaultPrevented||s(c.composedPath()[0],B.tap)}x.addEventListener("mousedown",r),x.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(c=>{for(const i of c)i.isIntersecting&&(Ae(new URL(i.target.href)),a.unobserve(i.target))},{threshold:0});async function s(c,i){const l=at(c,x),u=l===t.element&&l?.href===t.href&&i>=n;if(!l||u)return;const{url:d,external:p,download:h}=Ee(l,U,A.hash);if(p||h)return;const f=se(l),g=d&&he(w.url)===he(d);if(!(f.reload||g))if(i<=f.preload_data){t={element:l,href:l.href},n=B.tap;const b=await me(d,!1);if(!b)return;yn(b)}else i<=f.preload_code&&(t={element:l,href:l.href},n=i,Ae(d))}function o(){a.disconnect();for(const c of x.querySelectorAll("a")){const{url:i,external:l,download:u}=Ee(c,U,A.hash);if(l||u)continue;const d=se(c);d.reload||(d.preload_code===B.viewport&&a.observe(c),d.preload_code===B.eager&&Ae(i))}}J.add(o),o()}function G(e,t){if(e instanceof pe)return e.body;const n=ie(e),r=ln(e);return A.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Dn(e,t={}){return e=new URL(Ne(e)),e.origin!==re?Promise.reject(new Error("goto: invalid URL")):pt(e,t,0)}function Sn(e){if(typeof e=="function")le.push(e);else{const{href:t}=new URL(e,location.href);le.push(n=>n.href===t)}}function In(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(ze(),!ne){const r=Fe(w,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};lt.forEach(s=>s(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&ze()}),navigator.connection?.saveData||Rn(),x.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=at(t.composedPath()[0],x);if(!n)return;const{url:r,external:a,target:s,download:o}=Ee(n,U,A.hash);if(!r)return;if(s==="_parent"||s==="_top"){if(window.parent!==window)return}else if(s&&s!=="_self")return;const c=se(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||o)return;const[l,u]=(A.hash?r.hash.replace(/^#/,""):r.href).split("#"),d=l===ye(location);if(a||c.reload&&(!d||!u)){mt({url:r,type:"link",event:t})?ne=!0:t.preventDefault();return}if(u!==void 0&&d){const[,p]=w.url.href.split("#");if(p===u){if(t.preventDefault(),u===""||u==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const h=n.ownerDocument.getElementById(decodeURIComponent(u));h&&(h.scrollIntoView(),h.focus())}return}if(X=!0,Oe(R),e(r),!c.replace_state)return;X=!1}t.preventDefault(),await new Promise(p=>{requestAnimationFrame(()=>{setTimeout(p,0)}),setTimeout(p,100)}),await Y({type:"link",url:r,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??r.href===location.href,event:t})}),x.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const o=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(_e(o,U,!1))return;const c=t.target,i=se(c);if(i.reload)return;t.preventDefault(),t.stopPropagation();const l=new FormData(c,r);o.search=new URLSearchParams(l).toString(),Y({type:"form",url:o,keepfocus:i.keepfocus,noscroll:i.noscroll,replace_state:i.replace_state??o.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!Ue){if(t.state?.[V]){const n=t.state[V];if(F={},n===R)return;const r=D[n],a=t.state[nt]??{},s=new URL(t.state[Ft]??location.href),o=t.state[Q],c=w.url?ye(location)===ye(w.url):!1;if(o===I&&(ft||c)){a!==S.state&&(S.state=a),e(s),D[R]=M(),r&&scrollTo(r.x,r.y),R=n;return}const l=n-R;await Y({type:"popstate",url:s,popped:{state:a,scroll:r,delta:l},accept:()=>{R=n,I=o},block:()=>{history.go(-l)},nav_token:F,event:t})}else if(!X){const n=new URL(location.href);e(n),A.hash&&location.reload()}}}),addEventListener("hashchange",()=>{X&&(X=!1,history.replaceState({...history.state,[V]:++R,[Q]:I},"",location.href))});for(const t of document.querySelectorAll("link"))_n.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&C.navigating.set(ee.current=null)});function e(t){w.url=S.url=t,C.page.set(Me(S)),C.page.notify()}}async function Un(e,{status:t=200,error:n,node_ids:r,params:a,route:s,server_route:o,data:c,form:i}){Ce=!0;const l=new URL(location.href);let u;({params:a={},route:s={id:null}}=await me(l,!1)||{}),u=xe.find(({id:h})=>h===s.id);let d,p=!0;try{const h=r.map(async(g,b)=>{const _=c[b];return _?.uses&&(_.uses=vt(_.uses)),$e({loader:A.nodes[g],url:l,params:a,route:s,parent:async()=>{const T={};for(let m=0;m<b;m+=1)Object.assign(T,(await h[m]).data);return T},server_data_node:Be(_)})}),f=await Promise.all(h);if(u){const g=u.layouts;for(let b=0;b<g.length;b++)g[b]||f.splice(b,0,void 0)}d=await de({url:l,params:a,branch:f,status:t,error:n,errors:u?.errors,form:i,route:u??null})}catch(h){if(h instanceof Le){await K(new URL(h.location,location.href));return}d=await ge({status:ie(h),error:await G(h,{url:l,params:a,route:s}),url:l,route:s}),e.textContent="",p=!1}d.props.page&&(d.props.page.state={}),await _t(d,e,p)}async function yt(e,t){const n=new URL(e);n.pathname=pn(e.pathname),e.pathname.endsWith("/")&&n.searchParams.append(cn,"1"),n.searchParams.append(sn,t.map(s=>s?"1":"0").join(""));const r=window.fetch,a=await r(n.href,{});if(!a.ok){let s;throw a.headers.get("content-type")?.includes("application/json")?s=await a.json():a.status===404?s="Not Found":a.status===500&&(s="Internal Error"),new pe(a.status,s)}return new Promise(async s=>{const o=new Map,c=a.body.getReader();function i(u){return rn(u,{...A.decoders,Promise:d=>new Promise((p,h)=>{o.set(d,{fulfil:p,reject:h})})})}let l="";for(;;){const{done:u,value:d}=await c.read();if(u&&!l)break;for(l+=!d&&l?`
2
+ `:It.decode(d,{stream:!0});;){const p=l.indexOf(`
3
+ `);if(p===-1)break;const h=JSON.parse(l.slice(0,p));if(l=l.slice(p+1),h.type==="redirect")return s(h);if(h.type==="data")h.nodes?.forEach(f=>{f?.type==="data"&&(f.uses=vt(f.uses),f.data=i(f.data))}),s(h);else if(h.type==="chunk"){const{id:f,data:g,error:b}=h,_=o.get(f);o.delete(f),b?_.reject(i(b)):_.fulfil(i(g))}}}})}function vt(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let Ue=!1;function Tn(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=bt(e);if(r&&document.getElementById(r)){const{x:s,y:o}=M();setTimeout(()=>{const c=history.state;Ue=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(c,"",e),t&&scrollTo(s,o),Ue=!1})}else{const s=document.body,o=s.getAttribute("tabindex");s.tabIndex=-1,s.focus({preventScroll:!0,focusVisible:!1}),o!==null?s.setAttribute("tabindex",o):s.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const s=[];for(let o=0;o<a.rangeCount;o+=1)s.push(a.getRangeAt(o));setTimeout(()=>{if(a.rangeCount===s.length){for(let o=0;o<a.rangeCount;o+=1){const c=s[o],i=a.getRangeAt(o);if(c.commonAncestorContainer!==i.commonAncestorContainer||c.startContainer!==i.startContainer||c.endContainer!==i.endContainer||c.startOffset!==i.startOffset||c.endOffset!==i.endOffset)return}a.removeAllRanges()}})}}}function Fe(e,t,n,r,a=null){let s,o;const c=new Promise((l,u)=>{s=l,o=u});return c.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:M()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:a},willUnload:!t,type:r,complete:c},fulfil:s,reject:o}}function Me(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function Ln(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function bt(e){let t;if(A.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Cn as a,Dn as g,Pn as l,S as p,C as s};
@@ -1 +1 @@
1
- import{s as e}from"./DlSs5Yra.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p};
1
+ import{s as e}from"./BX6TUKUr.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p};
@@ -1 +1 @@
1
- import{s as r,p as e}from"./DlSs5Yra.js";const a={get params(){return e.params},get url(){return e.url}};r.updated.check;const s=a;export{s as p};
1
+ import{s as r,p as e}from"./BX6TUKUr.js";const a={get params(){return e.params},get url(){return e.url}};r.updated.check;const s=a;export{s as p};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.-0SstbRm.js","../chunks/Cg3dlX05.js","../chunks/DYuMZGL5.js","../chunks/DZvnhU_8.js","../assets/ColorPicker.CV4IKef4.css","../chunks/DlSs5Yra.js","../chunks/DfsJh23H.js","../chunks/Bn-6X1BO.js","../chunks/CG453M9q.js","../chunks/CSjf4fBs.js","../assets/0.BZLcOr5z.css","../nodes/1.BVLzPogE.js","../chunks/DZQMsHM5.js","../assets/1.B_AnTlN1.css","../nodes/2.CiUyTQg5.js","../chunks/BRqaaL5D.js","../chunks/xs1Xl3_e.js","../chunks/gQJcRhou.js","../chunks/BDcFu3l7.js","../chunks/BLszSzTT.js","../chunks/C_9BZILB.js","../chunks/CRkG7oE4.js","../chunks/pRcLbE0d.js","../chunks/C5VOyQCG.js","../assets/2.DjiwkLqE.css","../nodes/3.C9vlOBU0.js","../assets/3.DHxQoulp.css","../nodes/4.BSVqdrrD.js","../chunks/DzuS5Nbr.js","../assets/4.D4EDSN4H.css","../nodes/5.Cfj35gpY.js","../assets/5.C5qz-NeI.css","../nodes/6.BSsUBbIT.js","../chunks/DTGtOxE1.js","../assets/6.DzV0p3l-.css","../nodes/7.BIQq9Yuz.js","../chunks/Pw0jDB7M.js","../assets/ChatView.Bnlg-oAF.css","../assets/7.CEbRAOOf.css","../nodes/8.BU_sJ5_M.js","../assets/8.BhoBXADL.css","../nodes/9.C1vJI771.js","../chunks/PPVm8Dsz.js","../assets/9.v5KA95xm.css"])))=>i.map(i=>d[i]);
2
- import{_}from"../chunks/PPVm8Dsz.js";import{j as V,Q as H,f as Q,R as U,S as W,T as X,m as q,l as j,U as z,n as J,b,V as K,g as u,W as Z,X as $,Y as tt,p as et,E as rt,F as at,v as st,P as ot,A as R,d as nt,w as it,s as O,c as ct,r as _t,t as ut,x as p}from"../chunks/DYuMZGL5.js";import{B as mt,k as dt,m as lt,u as ft,p as T,i as A,a as v,j as x,f as k,g as D,t as ht,s as vt}from"../chunks/Cg3dlX05.js";function I(s,t,a){var n;V&&(n=J,H());var o=new mt(s);Q(()=>{var e=t()??null;if(V){var r=W(n),c=r===z,P=e!==null;if(c!==P){var g=X();q(g),o.anchor=g,j(!1),o.ensure(e,e&&(f=>a(f,e))),j(!0);return}}o.ensure(e,e&&(f=>a(f,e)))},U)}function gt(s){return class extends Et{constructor(t){super({component:s,...t})}}}class Et{#e;#t;constructor(t){var a=new Map,n=(e,r)=>{var c=tt(r,!1,!1);return a.set(e,c),c};const o=new Proxy({...t.props||{},$$events:{}},{get(e,r){return u(a.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===K?!0:(u(a.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,c){return b(a.get(r)??n(r,c),c),Reflect.set(e,r,c)}});this.#t=(t.hydrate?dt:lt)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&Z(),this.#e=o.$$events;for(const e of Object.keys(this.#t))e==="$set"||e==="$destroy"||e==="$on"||$(this,e,{get(){return this.#t[e]},set(r){this.#t[e]=r},enumerable:!0});this.#t.$set=e=>{Object.assign(o,e)},this.#t.$destroy=()=>{ft(this.#t)}}$set(t){this.#t.$set(t)}$on(t,a){this.#e[t]=this.#e[t]||[];const n=(...o)=>a.call(this,...o);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(o=>o!==n)}}$destroy(){this.#t.$destroy()}}const xt={};var yt=k('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),Rt=k("<!> <!>",1);function bt(s,t){et(t,!0);let a=T(t,"components",23,()=>[]),n=T(t,"data_0",3,null),o=T(t,"data_1",3,null);rt(()=>t.stores.page.set(t.page)),at(()=>{t.stores,t.page,t.constructors,a(),t.form,n(),o(),t.stores.page.notify()});let e=O(!1),r=O(!1),c=O(null);st(()=>{const i=t.stores.page.subscribe(()=>{u(e)&&(b(r,!0),ot().then(()=>{b(c,document.title||"untitled page",!0)}))});return b(e,!0),i});const P=p(()=>t.constructors[1]);var g=Rt(),f=R(g);{var S=i=>{const m=p(()=>t.constructors[0]);var d=x(),E=R(d);I(E,()=>u(m),(l,h)=>{D(h(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(y,Ot)=>{var L=x(),N=R(L);I(N,()=>u(P),(Y,B)=>{D(B(Y,{get data(){return o()},get form(){return t.form},get params(){return t.page.params}}),G=>a()[1]=G,()=>a()?.[1])}),v(y,L)},$$slots:{default:!0}}),y=>a()[0]=y,()=>a()?.[0])}),v(i,d)},C=i=>{const m=p(()=>t.constructors[0]);var d=x(),E=R(d);I(E,()=>u(m),(l,h)=>{D(h(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),y=>a()[0]=y,()=>a()?.[0])}),v(i,d)};A(f,i=>{t.constructors[1]?i(S):i(C,-1)})}var F=nt(f,2);{var M=i=>{var m=yt(),d=ct(m);{var E=l=>{var h=ht();ut(()=>vt(h,u(c))),v(l,h)};A(d,l=>{u(r)&&l(E)})}_t(m),v(i,m)};A(F,i=>{u(e)&&i(M)})}v(s,g),it()}const Dt=gt(bt),It=[()=>_(()=>import("../nodes/0.-0SstbRm.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url),()=>_(()=>import("../nodes/1.BVLzPogE.js"),__vite__mapDeps([11,1,2,12,5,6,3,4,13]),import.meta.url),()=>_(()=>import("../nodes/2.CiUyTQg5.js"),__vite__mapDeps([14,1,2,3,4,12,5,7,15,8,16,17,18,19,20,21,22,23,24]),import.meta.url),()=>_(()=>import("../nodes/3.C9vlOBU0.js"),__vite__mapDeps([25,1,2,12,5,3,4,17,18,19,20,21,22,26]),import.meta.url),()=>_(()=>import("../nodes/4.BSVqdrrD.js"),__vite__mapDeps([27,1,2,3,4,12,28,17,18,22,29]),import.meta.url),()=>_(()=>import("../nodes/5.Cfj35gpY.js"),__vite__mapDeps([30,1,2,3,4,21,17,18,22,31]),import.meta.url),()=>_(()=>import("../nodes/6.BSsUBbIT.js"),__vite__mapDeps([32,1,2,3,4,12,5,33,28,7,15,16,17,18,19,23,34]),import.meta.url),()=>_(()=>import("../nodes/7.BIQq9Yuz.js"),__vite__mapDeps([35,1,2,12,3,4,33,5,16,18,36,20,37,38]),import.meta.url),()=>_(()=>import("../nodes/8.BU_sJ5_M.js"),__vite__mapDeps([39,1,2,3,4,12,5,15,8,9,16,17,18,23,40]),import.meta.url),()=>_(()=>import("../nodes/9.C1vJI771.js"),__vite__mapDeps([41,42,1,2,12,3,4,5,6,28,36,18,20,37,23,43]),import.meta.url)],Lt=[0],Vt={"/":[-3],"/activity":[-4],"/config":[-5],"/neurolink":[-6],"/project":[6],"/session/[id]":[7],"/terminals":[8],"/terminals/[id]":[9]},w={handleError:(({error:s})=>{console.error(s)}),reroute:(()=>{}),transport:{}},Pt=Object.fromEntries(Object.entries(w.transport).map(([s,t])=>[s,t.decode])),jt=Object.fromEntries(Object.entries(w.transport).map(([s,t])=>[s,t.encode])),kt=!1,wt=(s,t)=>Pt[s](t);export{wt as decode,Pt as decoders,Vt as dictionary,jt as encoders,kt as hash,w as hooks,xt as matchers,It as nodes,Dt as root,Lt as server_loads};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.DPygfoxx.js","../chunks/Cg3dlX05.js","../chunks/DYuMZGL5.js","../chunks/DZvnhU_8.js","../assets/ColorPicker.CV4IKef4.css","../chunks/BX6TUKUr.js","../chunks/C8fuqb5_.js","../chunks/Bn-6X1BO.js","../chunks/CG453M9q.js","../chunks/CSjf4fBs.js","../assets/0.BZLcOr5z.css","../nodes/1.CMzJ-vKL.js","../chunks/DZQMsHM5.js","../assets/1.B_AnTlN1.css","../nodes/2.Vq2hU4jC.js","../chunks/BRqaaL5D.js","../chunks/xs1Xl3_e.js","../chunks/gQJcRhou.js","../chunks/BDcFu3l7.js","../chunks/BLszSzTT.js","../chunks/C_9BZILB.js","../chunks/CRkG7oE4.js","../chunks/pRcLbE0d.js","../chunks/C5VOyQCG.js","../assets/2.DjiwkLqE.css","../nodes/3.C9533L9p.js","../assets/3.DHxQoulp.css","../nodes/4.BSVqdrrD.js","../chunks/DzuS5Nbr.js","../assets/4.D4EDSN4H.css","../nodes/5.Cfj35gpY.js","../assets/5.C5qz-NeI.css","../nodes/6.BJ2KZBR0.js","../chunks/DXE_ttSN.js","../assets/6.DzV0p3l-.css","../nodes/7.BW3qRNSj.js","../chunks/Pw0jDB7M.js","../assets/ChatView.Bnlg-oAF.css","../assets/7.CEbRAOOf.css","../nodes/8.BBF3ti4G.js","../assets/8.BhoBXADL.css","../nodes/9.LI1n0A_s.js","../chunks/PPVm8Dsz.js","../assets/9.v5KA95xm.css"])))=>i.map(i=>d[i]);
2
+ import{_}from"../chunks/PPVm8Dsz.js";import{j as V,Q as H,f as Q,R as U,S as W,T as X,m as q,l as j,U as z,n as J,b,V as K,g as u,W as Z,X as $,Y as tt,p as et,E as rt,F as at,v as st,P as ot,A as R,d as nt,w as it,s as O,c as ct,r as _t,t as ut,x as p}from"../chunks/DYuMZGL5.js";import{B as mt,k as dt,m as lt,u as ft,p as T,i as A,a as v,j as x,f as k,g as D,t as ht,s as vt}from"../chunks/Cg3dlX05.js";function I(s,t,a){var n;V&&(n=J,H());var o=new mt(s);Q(()=>{var e=t()??null;if(V){var r=W(n),c=r===z,P=e!==null;if(c!==P){var g=X();q(g),o.anchor=g,j(!1),o.ensure(e,e&&(f=>a(f,e))),j(!0);return}}o.ensure(e,e&&(f=>a(f,e)))},U)}function gt(s){return class extends Et{constructor(t){super({component:s,...t})}}}class Et{#e;#t;constructor(t){var a=new Map,n=(e,r)=>{var c=tt(r,!1,!1);return a.set(e,c),c};const o=new Proxy({...t.props||{},$$events:{}},{get(e,r){return u(a.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===K?!0:(u(a.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,c){return b(a.get(r)??n(r,c),c),Reflect.set(e,r,c)}});this.#t=(t.hydrate?dt:lt)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&Z(),this.#e=o.$$events;for(const e of Object.keys(this.#t))e==="$set"||e==="$destroy"||e==="$on"||$(this,e,{get(){return this.#t[e]},set(r){this.#t[e]=r},enumerable:!0});this.#t.$set=e=>{Object.assign(o,e)},this.#t.$destroy=()=>{ft(this.#t)}}$set(t){this.#t.$set(t)}$on(t,a){this.#e[t]=this.#e[t]||[];const n=(...o)=>a.call(this,...o);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(o=>o!==n)}}$destroy(){this.#t.$destroy()}}const xt={};var yt=k('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),Rt=k("<!> <!>",1);function bt(s,t){et(t,!0);let a=T(t,"components",23,()=>[]),n=T(t,"data_0",3,null),o=T(t,"data_1",3,null);rt(()=>t.stores.page.set(t.page)),at(()=>{t.stores,t.page,t.constructors,a(),t.form,n(),o(),t.stores.page.notify()});let e=O(!1),r=O(!1),c=O(null);st(()=>{const i=t.stores.page.subscribe(()=>{u(e)&&(b(r,!0),ot().then(()=>{b(c,document.title||"untitled page",!0)}))});return b(e,!0),i});const P=p(()=>t.constructors[1]);var g=Rt(),f=R(g);{var S=i=>{const m=p(()=>t.constructors[0]);var d=x(),E=R(d);I(E,()=>u(m),(l,h)=>{D(h(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(y,Ot)=>{var L=x(),N=R(L);I(N,()=>u(P),(Y,B)=>{D(B(Y,{get data(){return o()},get form(){return t.form},get params(){return t.page.params}}),G=>a()[1]=G,()=>a()?.[1])}),v(y,L)},$$slots:{default:!0}}),y=>a()[0]=y,()=>a()?.[0])}),v(i,d)},C=i=>{const m=p(()=>t.constructors[0]);var d=x(),E=R(d);I(E,()=>u(m),(l,h)=>{D(h(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),y=>a()[0]=y,()=>a()?.[0])}),v(i,d)};A(f,i=>{t.constructors[1]?i(S):i(C,-1)})}var F=nt(f,2);{var M=i=>{var m=yt(),d=ct(m);{var E=l=>{var h=ht();ut(()=>vt(h,u(c))),v(l,h)};A(d,l=>{u(r)&&l(E)})}_t(m),v(i,m)};A(F,i=>{u(e)&&i(M)})}v(s,g),it()}const Dt=gt(bt),It=[()=>_(()=>import("../nodes/0.DPygfoxx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url),()=>_(()=>import("../nodes/1.CMzJ-vKL.js"),__vite__mapDeps([11,1,2,12,5,6,3,4,13]),import.meta.url),()=>_(()=>import("../nodes/2.Vq2hU4jC.js"),__vite__mapDeps([14,1,2,3,4,12,5,7,15,8,16,17,18,19,20,21,22,23,24]),import.meta.url),()=>_(()=>import("../nodes/3.C9533L9p.js"),__vite__mapDeps([25,1,2,12,5,3,4,17,18,19,20,21,22,26]),import.meta.url),()=>_(()=>import("../nodes/4.BSVqdrrD.js"),__vite__mapDeps([27,1,2,3,4,12,28,17,18,22,29]),import.meta.url),()=>_(()=>import("../nodes/5.Cfj35gpY.js"),__vite__mapDeps([30,1,2,3,4,21,17,18,22,31]),import.meta.url),()=>_(()=>import("../nodes/6.BJ2KZBR0.js"),__vite__mapDeps([32,1,2,3,4,12,5,33,28,7,15,16,17,18,19,23,34]),import.meta.url),()=>_(()=>import("../nodes/7.BW3qRNSj.js"),__vite__mapDeps([35,1,2,12,3,4,33,5,16,18,36,20,37,38]),import.meta.url),()=>_(()=>import("../nodes/8.BBF3ti4G.js"),__vite__mapDeps([39,1,2,3,4,12,5,15,8,9,16,17,18,23,40]),import.meta.url),()=>_(()=>import("../nodes/9.LI1n0A_s.js"),__vite__mapDeps([41,42,1,2,12,3,4,5,6,28,36,18,20,37,23,43]),import.meta.url)],Lt=[0],Vt={"/":[-3],"/activity":[-4],"/config":[-5],"/neurolink":[-6],"/project":[6],"/session/[id]":[7],"/terminals":[8],"/terminals/[id]":[9]},w={handleError:(({error:s})=>{console.error(s)}),reroute:(()=>{}),transport:{}},Pt=Object.fromEntries(Object.entries(w.transport).map(([s,t])=>[s,t.decode])),jt=Object.fromEntries(Object.entries(w.transport).map(([s,t])=>[s,t.encode])),kt=!1,wt=(s,t)=>Pt[s](t);export{wt as decode,Pt as decoders,Vt as dictionary,jt as encoders,kt as hash,w as hooks,xt as matchers,It as nodes,Dt as root,Lt as server_loads};
@@ -0,0 +1 @@
1
+ import{l as o,a as r}from"../chunks/BX6TUKUr.js";export{o as load_css,r as start};
@@ -0,0 +1,2 @@
1
+ )�import{l as o,a as r}from"../chunks/BX6TUKUr.js";export{o as load_css,r as start};
2
+ 
@@ -1,4 +1,4 @@
1
- import{a as A,c as F,f as K,e as M}from"../chunks/Cg3dlX05.js";import{p as U,F as V,v as z,t as G,w as H,b as m,c as a,d as i,g as l,r as s,B as w,s as J,x as _}from"../chunks/DYuMZGL5.js";import{P as Q,B as X,a as Y,c as h,s as y}from"../chunks/DZvnhU_8.js";import{g as Z}from"../chunks/DlSs5Yra.js";import{p as tt}from"../chunks/DfsJh23H.js";import{B as et}from"../chunks/Bn-6X1BO.js";import{S as at}from"../chunks/CG453M9q.js";import{T as st}from"../chunks/CSjf4fBs.js";const rt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
1
+ import{a as A,c as F,f as K,e as M}from"../chunks/Cg3dlX05.js";import{p as U,F as V,v as z,t as G,w as H,b as m,c as a,d as i,g as l,r as s,B as w,s as J,x as _}from"../chunks/DYuMZGL5.js";import{P as Q,B as X,a as Y,c as h,s as y}from"../chunks/DZvnhU_8.js";import{g as Z}from"../chunks/BX6TUKUr.js";import{p as tt}from"../chunks/C8fuqb5_.js";import{B as et}from"../chunks/Bn-6X1BO.js";import{S as at}from"../chunks/CG453M9q.js";import{T as st}from"../chunks/CSjf4fBs.js";const rt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
2
2
  <rect x="3" y="3" width="7" height="7"/>
3
3
  <rect x="14" y="3" width="7" height="7"/>
4
4
  <rect x="3" y="14" width="7" height="7"/>
@@ -1 +1 @@
1
- import{i as b,a as c,c as J,f as K,s as k,e as L,t as d}from"../chunks/Cg3dlX05.js";import{D as M,E as N,F as w,G as P,I as y,J as q,g as G,K as z,L as C,M as O,p as Q,t as j,w as R,c as f,d as g,N as U,$ as V,r as v}from"../chunks/DYuMZGL5.js";import{h as W}from"../chunks/DZQMsHM5.js";import{g as X}from"../chunks/DlSs5Yra.js";import{p as Y}from"../chunks/DfsJh23H.js";import{B as $}from"../chunks/DZvnhU_8.js";function Z(n=!1){const r=M,s=r.l.u;if(!s)return;let p=()=>z(r.s);if(n){let i=0,a={};const _=C(()=>{let l=!1;const m=r.s;for(const o in m)m[o]!==a[o]&&(a[o]=m[o],l=!0);return l&&i++,i});p=()=>G(_)}s.b.length&&N(()=>{B(r,p),y(s.b)}),w(()=>{const i=P(()=>s.m.map(q));return()=>{for(const a of i)typeof a=="function"&&a()}}),s.a.length&&w(()=>{B(r,p),y(s.a)})}function B(n,r){if(n.l.s)for(const s of n.l.s)G(s);r()}O();var ee=K('<main class="error-page svelte-1j96wlh"><div class="error-content svelte-1j96wlh"><div class="error-code svelte-1j96wlh"> </div> <h1 class="error-title svelte-1j96wlh"><!></h1> <p class="error-message svelte-1j96wlh"><!></p> <div class="error-actions svelte-1j96wlh"><!> <!></div></div></main>');function ie(n,r){Q(r,!1);const s=()=>L(Y,"$page",p),[p,i]=J();Z();var a=ee();W("1j96wlh",e=>{U(()=>{V.title="Error - Shooter"})});var _=f(a),l=f(_),m=f(l,!0);v(l);var o=g(l,2),E=f(o);{var S=e=>{var t=d("Page not found");c(e,t)},T=e=>{var t=d("Something went wrong");c(e,t)};b(E,e=>{s().status===404?e(S):e(T,-1)})}v(o);var u=g(o,2),A=f(u);{var D=e=>{var t=d();j(()=>k(t,s().error.message)),c(e,t)},F=e=>{var t=d("The page you're looking for doesn't exist or has been moved.");c(e,t)},H=e=>{var t=d("An unexpected error occurred. Try refreshing or going back.");c(e,t)};b(A,e=>{s().error?.message?e(D):s().status===404?e(F,1):e(H,-1)})}v(u);var h=g(u,2),x=f(h);$(x,{text:"Go Home",classes:"btn-primary",onclick:()=>{X("/")}});var I=g(x,2);$(I,{text:"Go Back",classes:"btn-secondary",onclick:()=>{history.back()}}),v(h),v(_),v(a),j(()=>k(m,s().status)),c(n,a),R(),i()}export{ie as component};
1
+ import{i as b,a as c,c as J,f as K,s as k,e as L,t as d}from"../chunks/Cg3dlX05.js";import{D as M,E as N,F as w,G as P,I as y,J as q,g as G,K as z,L as C,M as O,p as Q,t as j,w as R,c as f,d as g,N as U,$ as V,r as v}from"../chunks/DYuMZGL5.js";import{h as W}from"../chunks/DZQMsHM5.js";import{g as X}from"../chunks/BX6TUKUr.js";import{p as Y}from"../chunks/C8fuqb5_.js";import{B as $}from"../chunks/DZvnhU_8.js";function Z(n=!1){const r=M,s=r.l.u;if(!s)return;let p=()=>z(r.s);if(n){let i=0,a={};const _=C(()=>{let l=!1;const m=r.s;for(const o in m)m[o]!==a[o]&&(a[o]=m[o],l=!0);return l&&i++,i});p=()=>G(_)}s.b.length&&N(()=>{B(r,p),y(s.b)}),w(()=>{const i=P(()=>s.m.map(q));return()=>{for(const a of i)typeof a=="function"&&a()}}),s.a.length&&w(()=>{B(r,p),y(s.a)})}function B(n,r){if(n.l.s)for(const s of n.l.s)G(s);r()}O();var ee=K('<main class="error-page svelte-1j96wlh"><div class="error-content svelte-1j96wlh"><div class="error-code svelte-1j96wlh"> </div> <h1 class="error-title svelte-1j96wlh"><!></h1> <p class="error-message svelte-1j96wlh"><!></p> <div class="error-actions svelte-1j96wlh"><!> <!></div></div></main>');function ie(n,r){Q(r,!1);const s=()=>L(Y,"$page",p),[p,i]=J();Z();var a=ee();W("1j96wlh",e=>{U(()=>{V.title="Error - Shooter"})});var _=f(a),l=f(_),m=f(l,!0);v(l);var o=g(l,2),E=f(o);{var S=e=>{var t=d("Page not found");c(e,t)},T=e=>{var t=d("Something went wrong");c(e,t)};b(E,e=>{s().status===404?e(S):e(T,-1)})}v(o);var u=g(o,2),A=f(u);{var D=e=>{var t=d();j(()=>k(t,s().error.message)),c(e,t)},F=e=>{var t=d("The page you're looking for doesn't exist or has been moved.");c(e,t)},H=e=>{var t=d("An unexpected error occurred. Try refreshing or going back.");c(e,t)};b(A,e=>{s().error?.message?e(D):s().status===404?e(F,1):e(H,-1)})}v(u);var h=g(u,2),x=f(h);$(x,{text:"Go Home",classes:"btn-primary",onclick:()=>{X("/")}});var I=g(x,2);$(I,{text:"Go Back",classes:"btn-secondary",onclick:()=>{history.back()}}),v(h),v(_),v(a),j(()=>k(m,s().status)),c(n,a),R(),i()}export{ie as component};
@@ -1,4 +1,4 @@
1
- import{d as vt,i as D,s as C,b as Fe,a as h,f as p}from"../chunks/Cg3dlX05.js";import{p as ze,c,r as l,d as v,g as r,t as B,w as je,x as M,A as me,s as q,q as et,b as _,v as ft,y as gt,N as mt,$ as ht,B as Ge}from"../chunks/DYuMZGL5.js";import{P as tt,k as pt,d as Re,s as _t,g as St,e as de,j as Le,B as Te,c as De,b as yt,i as Ue}from"../chunks/DZvnhU_8.js";import{h as bt}from"../chunks/DZQMsHM5.js";import{g as Ve}from"../chunks/DlSs5Yra.js";import{B as wt}from"../chunks/Bn-6X1BO.js";import{R as Ct,S as We}from"../chunks/BRqaaL5D.js";import{S as xt}from"../chunks/CG453M9q.js";import{c as kt,s as At,g as Et}from"../chunks/xs1Xl3_e.js";import{i as Nt}from"../chunks/gQJcRhou.js";import"../chunks/BDcFu3l7.js";import{f as It}from"../chunks/BLszSzTT.js";import{S as Pt}from"../chunks/C_9BZILB.js";import{i as Tt,N as Dt}from"../chunks/CRkG7oE4.js";import{d as Ot}from"../chunks/pRcLbE0d.js";import{E as He}from"../chunks/C5VOyQCG.js";var Rt=p('<p class="goal-text svelte-1qbe2oo"> </p>'),zt=p('<span class="summarizing svelte-1qbe2oo">Analyzing…</span>'),jt=p('<span class="summary-text svelte-1qbe2oo"> </span>'),Lt=p('<span class="summary-fallback svelte-1qbe2oo"> </span>'),Mt=p('<span class="stat stat-error svelte-1qbe2oo"> </span>'),qt=p('<div class="card svelte-1qbe2oo" role="button" tabindex="0"><div class="card-header svelte-1qbe2oo"><span class="project-name svelte-1qbe2oo"> </span> <!></div> <!> <div class="summary-row svelte-1qbe2oo"><!></div> <div class="stats-row svelte-1qbe2oo"><span class="stat svelte-1qbe2oo"><span></span> </span> <span class="stat svelte-1qbe2oo"> </span> <!> <span class="stat stat-path svelte-1qbe2oo"> </span></div></div>');function Je(t,e){ze(e,!0);function s(d){const u=Math.floor(d/1e3);if(u<60)return`${u}s`;const i=Math.floor(u/60);return i<60?`${i}m ${u%60}s`:`${Math.floor(i/60)}h ${i%60}m`}function n(d){const u=d.replace(/\/$/,"").split("/");return u.length<=2?d:u.slice(-2).join("/")}const a=M(()=>e.card.status==="running"&&e.card.isActive?"var(--ds-green-700)":e.card.status==="running"?"var(--ds-blue-700)":e.card.status==="idle"?"var(--ds-amber-700)":e.card.status==="error"?"var(--ds-red-700)":"var(--ds-gray-600)"),o=M(()=>e.card.status==="running"&&e.card.isActive||e.card.status==="running"?"● Running":e.card.status==="idle"?"◎ Idle":e.card.status==="exited"?"○ Done":e.card.status==="error"?"✕ Error":e.card.status),S=M(()=>e.card.status==="running"&&e.card.isActive?"status-pill status-pill--running-active":e.card.status==="running"?"status-pill status-pill--running":e.card.status==="idle"?"status-pill status-pill--idle":e.card.status==="exited"?"status-pill status-pill--exited":e.card.status==="error"?"status-pill status-pill--error":"status-pill"),y=M(()=>e.card.toolCallCount===0?"Waiting for activity…":e.card.toolCallCount===1?"1 tool call so far":`${e.card.toolCallCount} tool calls so far`);function E(d){(d.key==="Enter"||d.key===" ")&&(d.key===" "&&d.preventDefault(),e.onclick?.())}var b=qt(),g=c(b),f=c(g),x=c(f,!0);l(f);var k=v(f,2);tt(k,{get text(){return r(o)},get classes(){return r(S)}}),l(g);var T=v(g,2);{var Se=d=>{var u=Rt(),i=c(u,!0);l(u),B(()=>C(i,e.card.goal)),h(d,u)};D(T,d=>{e.card.goal&&d(Se)})}var $=v(T,2),ye=c($);{var be=d=>{var u=zt();h(d,u)},ee=d=>{var u=jt(),i=c(u,!0);l(u),B(()=>C(i,e.card.summary)),h(d,u)},te=d=>{var u=Lt(),i=c(u,!0);l(u),B(()=>C(i,r(y))),h(d,u)};D(ye,d=>{e.card.isSummarizing?d(be):e.card.summary?d(ee,1):e.card.status==="running"&&d(te,2)})}l($);var W=v($,2),F=c(W),ae=c(F),we=v(ae);l(F);var se=v(F,2),Ce=c(se);l(se);var re=v(se,2);{var xe=d=>{var u=Mt(),i=c(u);l(u),B(()=>C(i,`${e.card.errorCount??""} errors`)),h(d,u)};D(re,d=>{e.card.errorCount>0&&d(xe)})}var oe=v(re,2),ke=c(oe,!0);l(oe),l(W),l(b),B((d,u)=>{pt(b,`--status-color: ${r(a)??""}`),Re(b,"aria-label",`Open ${e.card.projectName??""} session`),C(x,e.card.projectName),_t(ae,1,St(e.card.status==="running"&&e.card.isActive?"status-dot-active":"status-dot-static"),"svelte-1qbe2oo"),C(we,` ${d??""}`),C(Ce,`${e.card.toolCallCount??""} tools`),Re(oe,"title",e.card.cwd),C(ke,u)},[()=>s(e.card.duration),()=>n(e.card.cwd)]),Fe("click",b,function(...d){e.onclick?.apply(this,d)}),Fe("keydown",b,E),h(t,b),je()}vt(["click","keydown"]);var Bt=p('<div class="section svelte-14sxgtb"><h3 class="section-label svelte-14sxgtb">Active</h3> <!></div>'),Kt=p('<div class="section svelte-14sxgtb"><h3 class="section-label svelte-14sxgtb">Recent</h3> <!></div>'),Yt=p("<!> <!>",1);function Ft(t,e){ze(e,!0);const s=M(()=>e.cards.filter(g=>g.status==="running")),n=M(()=>e.cards.filter(g=>g.status!=="running"));function a(g){e.onCardClick?.(g)}var o=Yt(),S=me(o);{var y=g=>{var f=Bt(),x=v(c(f),2);de(x,17,()=>r(s),k=>k.terminalId,(k,T)=>{Je(k,{get card(){return r(T)},onclick:()=>{a(r(T))}})}),l(f),h(g,f)};D(S,g=>{r(s).length>0&&g(y)})}var E=v(S,2);{var b=g=>{var f=Kt(),x=v(c(f),2);de(x,17,()=>r(n),k=>k.terminalId,(k,T)=>{Je(k,{get card(){return r(T)},onclick:()=>{a(r(T))}})}),l(f),h(g,f)};D(E,g=>{r(n).length>0&&g(b)})}h(t,o),je()}const Gt=new Set(["agent-question","terminal-exited","tool-failed"]);let fe=null,ge=null,he=null;class Ut{async summarize(e){const s=this.chooseTone(e),n=s==="conversational"?this.buildConversationalPrompt(e):this.buildStatusReportPrompt(e);try{const a=await Vt();if(!a)return console.log("[SessionSummarizer] NeuroLink not available, using fallback."),{generatedAt:new Date().toISOString(),text:this.fallbackText(e),tone:s};const o=await a.generate({input:{text:n},...he?{model:he.model,provider:he.provider}:{}}),S=Ht(o.content??"").trim()||this.fallbackText(e);return{generatedAt:new Date().toISOString(),text:S,tone:s}}catch(a){return console.warn("[SessionSummarizer] summarize failed:",a instanceof Error?a.message:String(a)),{generatedAt:new Date().toISOString(),text:this.fallbackText(e),tone:s}}}buildConversationalPrompt(e){const s=e.goal??"unknown",n=e.recentEvents.map(a=>{const o=[a.type];return a.tool&&o.push(`tool=${a.tool}`),a.error&&o.push(`error=${a.error}`),a.command&&o.push(`command=${a.command}`),o.join(" ")}).join(", ");return`You are monitoring a coding session. Based on the context below, write ONE sentence (max 100 chars) describing what's happening in plain English. Be specific about what Claude did or is doing.
1
+ import{d as vt,i as D,s as C,b as Fe,a as h,f as p}from"../chunks/Cg3dlX05.js";import{p as ze,c,r as l,d as v,g as r,t as B,w as je,x as M,A as me,s as q,q as et,b as _,v as ft,y as gt,N as mt,$ as ht,B as Ge}from"../chunks/DYuMZGL5.js";import{P as tt,k as pt,d as Re,s as _t,g as St,e as de,j as Le,B as Te,c as De,b as yt,i as Ue}from"../chunks/DZvnhU_8.js";import{h as bt}from"../chunks/DZQMsHM5.js";import{g as Ve}from"../chunks/BX6TUKUr.js";import{B as wt}from"../chunks/Bn-6X1BO.js";import{R as Ct,S as We}from"../chunks/BRqaaL5D.js";import{S as xt}from"../chunks/CG453M9q.js";import{c as kt,s as At,g as Et}from"../chunks/xs1Xl3_e.js";import{i as Nt}from"../chunks/gQJcRhou.js";import"../chunks/BDcFu3l7.js";import{f as It}from"../chunks/BLszSzTT.js";import{S as Pt}from"../chunks/C_9BZILB.js";import{i as Tt,N as Dt}from"../chunks/CRkG7oE4.js";import{d as Ot}from"../chunks/pRcLbE0d.js";import{E as He}from"../chunks/C5VOyQCG.js";var Rt=p('<p class="goal-text svelte-1qbe2oo"> </p>'),zt=p('<span class="summarizing svelte-1qbe2oo">Analyzing…</span>'),jt=p('<span class="summary-text svelte-1qbe2oo"> </span>'),Lt=p('<span class="summary-fallback svelte-1qbe2oo"> </span>'),Mt=p('<span class="stat stat-error svelte-1qbe2oo"> </span>'),qt=p('<div class="card svelte-1qbe2oo" role="button" tabindex="0"><div class="card-header svelte-1qbe2oo"><span class="project-name svelte-1qbe2oo"> </span> <!></div> <!> <div class="summary-row svelte-1qbe2oo"><!></div> <div class="stats-row svelte-1qbe2oo"><span class="stat svelte-1qbe2oo"><span></span> </span> <span class="stat svelte-1qbe2oo"> </span> <!> <span class="stat stat-path svelte-1qbe2oo"> </span></div></div>');function Je(t,e){ze(e,!0);function s(d){const u=Math.floor(d/1e3);if(u<60)return`${u}s`;const i=Math.floor(u/60);return i<60?`${i}m ${u%60}s`:`${Math.floor(i/60)}h ${i%60}m`}function n(d){const u=d.replace(/\/$/,"").split("/");return u.length<=2?d:u.slice(-2).join("/")}const a=M(()=>e.card.status==="running"&&e.card.isActive?"var(--ds-green-700)":e.card.status==="running"?"var(--ds-blue-700)":e.card.status==="idle"?"var(--ds-amber-700)":e.card.status==="error"?"var(--ds-red-700)":"var(--ds-gray-600)"),o=M(()=>e.card.status==="running"&&e.card.isActive||e.card.status==="running"?"● Running":e.card.status==="idle"?"◎ Idle":e.card.status==="exited"?"○ Done":e.card.status==="error"?"✕ Error":e.card.status),S=M(()=>e.card.status==="running"&&e.card.isActive?"status-pill status-pill--running-active":e.card.status==="running"?"status-pill status-pill--running":e.card.status==="idle"?"status-pill status-pill--idle":e.card.status==="exited"?"status-pill status-pill--exited":e.card.status==="error"?"status-pill status-pill--error":"status-pill"),y=M(()=>e.card.toolCallCount===0?"Waiting for activity…":e.card.toolCallCount===1?"1 tool call so far":`${e.card.toolCallCount} tool calls so far`);function E(d){(d.key==="Enter"||d.key===" ")&&(d.key===" "&&d.preventDefault(),e.onclick?.())}var b=qt(),g=c(b),f=c(g),x=c(f,!0);l(f);var k=v(f,2);tt(k,{get text(){return r(o)},get classes(){return r(S)}}),l(g);var T=v(g,2);{var Se=d=>{var u=Rt(),i=c(u,!0);l(u),B(()=>C(i,e.card.goal)),h(d,u)};D(T,d=>{e.card.goal&&d(Se)})}var $=v(T,2),ye=c($);{var be=d=>{var u=zt();h(d,u)},ee=d=>{var u=jt(),i=c(u,!0);l(u),B(()=>C(i,e.card.summary)),h(d,u)},te=d=>{var u=Lt(),i=c(u,!0);l(u),B(()=>C(i,r(y))),h(d,u)};D(ye,d=>{e.card.isSummarizing?d(be):e.card.summary?d(ee,1):e.card.status==="running"&&d(te,2)})}l($);var W=v($,2),F=c(W),ae=c(F),we=v(ae);l(F);var se=v(F,2),Ce=c(se);l(se);var re=v(se,2);{var xe=d=>{var u=Mt(),i=c(u);l(u),B(()=>C(i,`${e.card.errorCount??""} errors`)),h(d,u)};D(re,d=>{e.card.errorCount>0&&d(xe)})}var oe=v(re,2),ke=c(oe,!0);l(oe),l(W),l(b),B((d,u)=>{pt(b,`--status-color: ${r(a)??""}`),Re(b,"aria-label",`Open ${e.card.projectName??""} session`),C(x,e.card.projectName),_t(ae,1,St(e.card.status==="running"&&e.card.isActive?"status-dot-active":"status-dot-static"),"svelte-1qbe2oo"),C(we,` ${d??""}`),C(Ce,`${e.card.toolCallCount??""} tools`),Re(oe,"title",e.card.cwd),C(ke,u)},[()=>s(e.card.duration),()=>n(e.card.cwd)]),Fe("click",b,function(...d){e.onclick?.apply(this,d)}),Fe("keydown",b,E),h(t,b),je()}vt(["click","keydown"]);var Bt=p('<div class="section svelte-14sxgtb"><h3 class="section-label svelte-14sxgtb">Active</h3> <!></div>'),Kt=p('<div class="section svelte-14sxgtb"><h3 class="section-label svelte-14sxgtb">Recent</h3> <!></div>'),Yt=p("<!> <!>",1);function Ft(t,e){ze(e,!0);const s=M(()=>e.cards.filter(g=>g.status==="running")),n=M(()=>e.cards.filter(g=>g.status!=="running"));function a(g){e.onCardClick?.(g)}var o=Yt(),S=me(o);{var y=g=>{var f=Bt(),x=v(c(f),2);de(x,17,()=>r(s),k=>k.terminalId,(k,T)=>{Je(k,{get card(){return r(T)},onclick:()=>{a(r(T))}})}),l(f),h(g,f)};D(S,g=>{r(s).length>0&&g(y)})}var E=v(S,2);{var b=g=>{var f=Kt(),x=v(c(f),2);de(x,17,()=>r(n),k=>k.terminalId,(k,T)=>{Je(k,{get card(){return r(T)},onclick:()=>{a(r(T))}})}),l(f),h(g,f)};D(E,g=>{r(n).length>0&&g(b)})}h(t,o),je()}const Gt=new Set(["agent-question","terminal-exited","tool-failed"]);let fe=null,ge=null,he=null;class Ut{async summarize(e){const s=this.chooseTone(e),n=s==="conversational"?this.buildConversationalPrompt(e):this.buildStatusReportPrompt(e);try{const a=await Vt();if(!a)return console.log("[SessionSummarizer] NeuroLink not available, using fallback."),{generatedAt:new Date().toISOString(),text:this.fallbackText(e),tone:s};const o=await a.generate({input:{text:n},...he?{model:he.model,provider:he.provider}:{}}),S=Ht(o.content??"").trim()||this.fallbackText(e);return{generatedAt:new Date().toISOString(),text:S,tone:s}}catch(a){return console.warn("[SessionSummarizer] summarize failed:",a instanceof Error?a.message:String(a)),{generatedAt:new Date().toISOString(),text:this.fallbackText(e),tone:s}}}buildConversationalPrompt(e){const s=e.goal??"unknown",n=e.recentEvents.map(a=>{const o=[a.type];return a.tool&&o.push(`tool=${a.tool}`),a.error&&o.push(`error=${a.error}`),a.command&&o.push(`command=${a.command}`),o.join(" ")}).join(", ");return`You are monitoring a coding session. Based on the context below, write ONE sentence (max 100 chars) describing what's happening in plain English. Be specific about what Claude did or is doing.
2
2
 
3
3
  Goal: ${s}
4
4
  Recent events: ${n}
@@ -1,4 +1,4 @@
1
- import{i as P,s as h,a as g,t as Be,f as A}from"../chunks/Cg3dlX05.js";import{s as b,q as ke,b as _,g as n,p as Ee,v as Pe,y as Ge,c as u,d as p,r as d,t as E,B as He,w as Ne,x as N,N as Ve,$ as We}from"../chunks/DYuMZGL5.js";import{h as Je}from"../chunks/DZQMsHM5.js";import{g as ce}from"../chunks/DlSs5Yra.js";import{j as ue,e as le,B as qe,s as Ae,b as Xe}from"../chunks/DZvnhU_8.js";import{g as je,i as Ze}from"../chunks/gQJcRhou.js";import"../chunks/BDcFu3l7.js";import{f as we}from"../chunks/BLszSzTT.js";import{S as Qe}from"../chunks/C_9BZILB.js";import{i as et,N as tt}from"../chunks/CRkG7oE4.js";import{d as ot}from"../chunks/pRcLbE0d.js";const rt=6e4,Se=3;let Q=null,Y=null,L=0,$e=0;async function st(e,t){if(e.length===0)return{error:null,text:""};let i;try{i=await it()}catch{const o=e.map(x=>w(x.data.tool)||x.type),l=Array.from(new Set(o));return{error:"AI SDK failed to load",text:`${e.length} events: ${l.join(", ")}`}}if(!i){const o=e.map(x=>w(x.data.tool)||x.type),l=Array.from(new Set(o));return{error:"No AI provider configured",text:`${e.length} events: ${l.join(", ")}`}}const s=at(e),a=`You are a coding activity summarizer. Given these events from active Claude Code sessions, write a 1-2 sentence summary (max 150 chars) of what's happening. Be specific — mention tool names, file names, and what's being accomplished.
1
+ import{i as P,s as h,a as g,t as Be,f as A}from"../chunks/Cg3dlX05.js";import{s as b,q as ke,b as _,g as n,p as Ee,v as Pe,y as Ge,c as u,d as p,r as d,t as E,B as He,w as Ne,x as N,N as Ve,$ as We}from"../chunks/DYuMZGL5.js";import{h as Je}from"../chunks/DZQMsHM5.js";import{g as ce}from"../chunks/BX6TUKUr.js";import{j as ue,e as le,B as qe,s as Ae,b as Xe}from"../chunks/DZvnhU_8.js";import{g as je,i as Ze}from"../chunks/gQJcRhou.js";import"../chunks/BDcFu3l7.js";import{f as we}from"../chunks/BLszSzTT.js";import{S as Qe}from"../chunks/C_9BZILB.js";import{i as et,N as tt}from"../chunks/CRkG7oE4.js";import{d as ot}from"../chunks/pRcLbE0d.js";const rt=6e4,Se=3;let Q=null,Y=null,L=0,$e=0;async function st(e,t){if(e.length===0)return{error:null,text:""};let i;try{i=await it()}catch{const o=e.map(x=>w(x.data.tool)||x.type),l=Array.from(new Set(o));return{error:"AI SDK failed to load",text:`${e.length} events: ${l.join(", ")}`}}if(!i){const o=e.map(x=>w(x.data.tool)||x.type),l=Array.from(new Set(o));return{error:"No AI provider configured",text:`${e.length} events: ${l.join(", ")}`}}const s=at(e),a=`You are a coding activity summarizer. Given these events from active Claude Code sessions, write a 1-2 sentence summary (max 150 chars) of what's happening. Be specific — mention tool names, file names, and what's being accomplished.
2
2
 
3
3
  ${t?`Project: ${t}
4
4
  `:""}Events: