@codeyam/codeyam-cli 0.1.0-staging.c9dc00c → 0.1.0-staging.d3e886e

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 (189) hide show
  1. package/analyzer-template/.build-info.json +7 -7
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/package.json +1 -1
  4. package/analyzer-template/packages/ai/index.ts +1 -0
  5. package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +14 -0
  6. package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +101 -0
  7. package/analyzer-template/packages/ai/src/lib/astScopes/sharedPatterns.ts +28 -0
  8. package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +6 -0
  9. package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +172 -8
  10. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.ts +70 -19
  11. package/analyzer-template/packages/ai/src/lib/dataStructureChunking.ts +40 -13
  12. package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +32 -5
  13. package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +134 -2
  14. package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionals.ts +359 -142
  15. package/analyzer-template/packages/ai/src/lib/mergeJsonTypeDefinitions.ts +5 -0
  16. package/analyzer-template/packages/ai/src/lib/promptGenerators/collapseNullableObjects.ts +118 -0
  17. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.ts +24 -4
  18. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +18 -0
  19. package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +50 -25
  20. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +153 -76
  21. package/analyzer-template/packages/database/src/lib/kysely/tables/debugReportsTable.ts +1 -1
  22. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts +1 -1
  23. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts.map +1 -1
  24. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js +93 -2
  25. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js.map +1 -1
  26. package/analyzer-template/packages/utils/src/lib/fs/rsyncCopy.ts +108 -2
  27. package/analyzer-template/project/constructMockCode.ts +2 -2
  28. package/analyzer-template/project/writeScenarioComponents.ts +14 -0
  29. package/background/src/lib/virtualized/project/constructMockCode.js +2 -2
  30. package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
  31. package/background/src/lib/virtualized/project/writeScenarioComponents.js +10 -0
  32. package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
  33. package/codeyam-cli/scripts/apply-setup.js +1 -1
  34. package/codeyam-cli/src/codeyam-cli.js +18 -2
  35. package/codeyam-cli/src/codeyam-cli.js.map +1 -1
  36. package/codeyam-cli/src/commands/analyze.js +2 -2
  37. package/codeyam-cli/src/commands/analyze.js.map +1 -1
  38. package/codeyam-cli/src/commands/default.js +18 -17
  39. package/codeyam-cli/src/commands/default.js.map +1 -1
  40. package/codeyam-cli/src/commands/init.js +27 -93
  41. package/codeyam-cli/src/commands/init.js.map +1 -1
  42. package/codeyam-cli/src/commands/memory.js +9 -9
  43. package/codeyam-cli/src/commands/memory.js.map +1 -1
  44. package/codeyam-cli/src/commands/setup-simulations.js +1 -1
  45. package/codeyam-cli/src/commands/verify.js +12 -2
  46. package/codeyam-cli/src/commands/verify.js.map +1 -1
  47. package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js +179 -0
  48. package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js.map +1 -0
  49. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +11 -11
  50. package/codeyam-cli/src/utils/backgroundServer.js +90 -23
  51. package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
  52. package/codeyam-cli/src/utils/generateReport.js +2 -2
  53. package/codeyam-cli/src/utils/install-skills.js +13 -13
  54. package/codeyam-cli/src/utils/labsAutoCheck.js +0 -29
  55. package/codeyam-cli/src/utils/labsAutoCheck.js.map +1 -1
  56. package/codeyam-cli/src/utils/npmVersionCheck.js +76 -0
  57. package/codeyam-cli/src/utils/npmVersionCheck.js.map +1 -0
  58. package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js +4 -4
  59. package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js.map +1 -1
  60. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js +2 -2
  61. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js.map +1 -1
  62. package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js +4 -4
  63. package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js.map +1 -1
  64. package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js +3 -3
  65. package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js.map +1 -1
  66. package/codeyam-cli/src/utils/rules/__tests__/ruleState.test.js +23 -23
  67. package/codeyam-cli/src/utils/rules/__tests__/ruleState.test.js.map +1 -1
  68. package/codeyam-cli/src/utils/rules/ruleState.js +10 -10
  69. package/codeyam-cli/src/utils/rules/ruleState.js.map +1 -1
  70. package/codeyam-cli/src/utils/rules/staleness.js +6 -6
  71. package/codeyam-cli/src/utils/rules/staleness.js.map +1 -1
  72. package/codeyam-cli/src/utils/serverState.js +37 -10
  73. package/codeyam-cli/src/utils/serverState.js.map +1 -1
  74. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +7 -7
  75. package/codeyam-cli/src/webserver/__tests__/dependency-smoke.test.js +66 -0
  76. package/codeyam-cli/src/webserver/__tests__/dependency-smoke.test.js.map +1 -0
  77. package/codeyam-cli/src/webserver/app/lib/dbNotifier.js.map +1 -1
  78. package/codeyam-cli/src/webserver/backgroundServer.js +26 -7
  79. package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
  80. package/codeyam-cli/src/webserver/bootstrap.js +11 -0
  81. package/codeyam-cli/src/webserver/bootstrap.js.map +1 -1
  82. package/codeyam-cli/src/webserver/build/client/assets/{CopyButton-CA3JxPb7.js → CopyButton-jNYXRRNI.js} +1 -1
  83. package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-B86KKU7e.js → EntityItem-bwuHPyTa.js} +1 -1
  84. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-B5ctlSYt.js → EntityTypeBadge-CvzqMxcu.js} +1 -1
  85. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-BqY8gDAW.js → EntityTypeIcon-BH0XDim7.js} +1 -1
  86. package/codeyam-cli/src/webserver/build/client/assets/{InlineSpinner-ClaLpuOo.js → InlineSpinner-EhOseatT.js} +1 -1
  87. package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-BDhPilK7.js → InteractivePreview-yjIHlOGa.js} +2 -2
  88. package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-VeqEBv9v.js → LibraryFunctionPreview-Cq5o8jL4.js} +1 -1
  89. package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-Bs7Nn1Jr.js → LoadingDots-BvMu2i-g.js} +1 -1
  90. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-Bm3PmcCz.js → LogViewer-kgBTLoJD.js} +1 -1
  91. package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-C6PKeMYR.js → ReportIssueModal-BzPgx-xO.js} +2 -2
  92. package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-Gq3Ocjo6.js → SafeScreenshot-CwZrv-Ok.js} +1 -1
  93. package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-BNLaXBHR.js → ScenarioViewer-BX2Ny2Qj.js} +2 -2
  94. package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-CiwXDxLh.js → TruncatedFilePath-CDpEprKa.js} +1 -1
  95. package/codeyam-cli/src/webserver/build/client/assets/{_index-B3TDXxnk.js → _index-BRx8ZGZo.js} +1 -1
  96. package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-BtBFH820.js → activity.(_tab)-4S4yPfFw.js} +1 -1
  97. package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-DHKuQSmR.js +17 -0
  98. package/codeyam-cli/src/webserver/build/client/assets/{book-open-PttOB2SF.js → book-open-D4IPYH_y.js} +1 -1
  99. package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-TJp6ofnp.js → chevron-down-CG65viiV.js} +1 -1
  100. package/codeyam-cli/src/webserver/build/client/assets/{chunk-JZWAC4HX-JE9ZIoBl.js → chunk-JZWAC4HX-DB3aFuEO.js} +9 -9
  101. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-CXhHQYrI.js → circle-check-igfMr5DY.js} +1 -1
  102. package/codeyam-cli/src/webserver/build/client/assets/{copy-6y9ALfGT.js → copy-Coc4o_8c.js} +1 -1
  103. package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-Ca9fAY46.js → createLucideIcon-D1zB-pYc.js} +1 -1
  104. package/codeyam-cli/src/webserver/build/client/assets/{dev.empty-C5lqplTC.js → dev.empty-JTAjQ54M.js} +1 -1
  105. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-n38keI1k.js → entity._sha._-B0h9AqE6.js} +2 -2
  106. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.fullscreen-CBoafmVs.js → entity._sha.scenarios._scenarioId.fullscreen-DjLxr2JB.js} +1 -1
  107. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-DGgZjdFg.js → entity._sha_.create-scenario-CtYowLOt.js} +1 -1
  108. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-38yPijoD.js → entity._sha_.edit._scenarioId-PePWg17F.js} +1 -1
  109. package/codeyam-cli/src/webserver/build/client/assets/{entry.client-BSHEfydn.js → entry.client-I-Wo99C_.js} +1 -1
  110. package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-DCPhhSMo.js → fileTableUtils-9sMMAiWJ.js} +1 -1
  111. package/codeyam-cli/src/webserver/build/client/assets/{files-0N0YJQv7.js → files-Co65J0s3.js} +1 -1
  112. package/codeyam-cli/src/webserver/build/client/assets/{git-DXnyr8uP.js → git-BdHOxVfg.js} +1 -1
  113. package/codeyam-cli/src/webserver/build/client/assets/globals-CCgBKWy4.css +1 -0
  114. package/codeyam-cli/src/webserver/build/client/assets/{index-ChN9-fAY.js → index-CUM5iXwc.js} +1 -1
  115. package/codeyam-cli/src/webserver/build/client/assets/{index-CcsFv748.js → index-_417gcQW.js} +1 -1
  116. package/codeyam-cli/src/webserver/build/client/assets/labs-BK0C1H1T.js +1 -0
  117. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-CTqLEAGU.js → loader-circle-TzRHMVog.js} +1 -1
  118. package/codeyam-cli/src/webserver/build/client/assets/manifest-390cb8fa.js +1 -0
  119. package/codeyam-cli/src/webserver/build/client/assets/memory-CzZySbBE.js +78 -0
  120. package/codeyam-cli/src/webserver/build/client/assets/{pause-D6vreykR.js → pause-hjzB7t2z.js} +1 -1
  121. package/codeyam-cli/src/webserver/build/client/assets/root-DnbDhvTU.js +62 -0
  122. package/codeyam-cli/src/webserver/build/client/assets/{search-B8VUL8nl.js → search-DcAwD_Ln.js} +1 -1
  123. package/codeyam-cli/src/webserver/build/client/assets/settings-CclxrcPK.js +1 -0
  124. package/codeyam-cli/src/webserver/build/client/assets/{simulations-CPoAg7Zo.js → simulations-DVNJVQgD.js} +1 -1
  125. package/codeyam-cli/src/webserver/build/client/assets/{terminal-BrCP7uQo.js → terminal-DbEAHMbA.js} +1 -1
  126. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-BZz2NjYa.js → triangle-alert-CAD5b1o_.js} +1 -1
  127. package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-DNwUduNu.js → useCustomSizes-BqgrAzs3.js} +1 -1
  128. package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-COky1GVF.js → useLastLogLine-DAFqfEDH.js} +1 -1
  129. package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-CpZgwliL.js → useReportContext-DZlYx2c4.js} +1 -1
  130. package/codeyam-cli/src/webserver/build/client/assets/{useToast-Bv9JFvUO.js → useToast-ihdMtlf6.js} +1 -1
  131. package/codeyam-cli/src/webserver/build/server/assets/{index-Cz2RkDCa.js → index-CxaRxKVt.js} +1 -1
  132. package/codeyam-cli/src/webserver/build/server/assets/server-build-D4DT0nM_.js +259 -0
  133. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  134. package/codeyam-cli/src/webserver/build-info.json +5 -5
  135. package/codeyam-cli/templates/{codeyam:debug.md → codeyam-debug.md} +1 -1
  136. package/codeyam-cli/templates/{codeyam:diagnose.md → codeyam-diagnose.md} +1 -1
  137. package/codeyam-cli/templates/codeyam-memory-hook.sh +14 -14
  138. package/codeyam-cli/templates/{codeyam:memory.md → codeyam-memory.md} +16 -23
  139. package/codeyam-cli/templates/{codeyam:new-rule.md → codeyam-new-rule.md} +1 -1
  140. package/codeyam-cli/templates/{codeyam:setup.md → codeyam-setup.md} +1 -1
  141. package/codeyam-cli/templates/{codeyam:sim.md → codeyam-sim.md} +1 -1
  142. package/codeyam-cli/templates/{codeyam:test.md → codeyam-test.md} +1 -1
  143. package/codeyam-cli/templates/{codeyam:verify.md → codeyam-verify.md} +1 -1
  144. package/codeyam-cli/templates/rule-reflection-hook.py +5 -5
  145. package/codeyam-cli/templates/rules-instructions.md +11 -15
  146. package/package.json +8 -8
  147. package/packages/ai/index.js +1 -1
  148. package/packages/ai/index.js.map +1 -1
  149. package/packages/ai/src/lib/analyzeScope.js +14 -0
  150. package/packages/ai/src/lib/analyzeScope.js.map +1 -1
  151. package/packages/ai/src/lib/astScopes/processExpression.js +78 -1
  152. package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
  153. package/packages/ai/src/lib/astScopes/sharedPatterns.js +25 -0
  154. package/packages/ai/src/lib/astScopes/sharedPatterns.js.map +1 -1
  155. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +124 -7
  156. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  157. package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js +59 -17
  158. package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js.map +1 -1
  159. package/packages/ai/src/lib/dataStructureChunking.js +30 -11
  160. package/packages/ai/src/lib/dataStructureChunking.js.map +1 -1
  161. package/packages/ai/src/lib/generateEntityScenarioData.js +22 -3
  162. package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
  163. package/packages/ai/src/lib/generateExecutionFlows.js +97 -2
  164. package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
  165. package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js +242 -81
  166. package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js.map +1 -1
  167. package/packages/ai/src/lib/mergeJsonTypeDefinitions.js +5 -0
  168. package/packages/ai/src/lib/mergeJsonTypeDefinitions.js.map +1 -1
  169. package/packages/ai/src/lib/promptGenerators/collapseNullableObjects.js +97 -0
  170. package/packages/ai/src/lib/promptGenerators/collapseNullableObjects.js.map +1 -0
  171. package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js +17 -2
  172. package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js.map +1 -1
  173. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +11 -1
  174. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
  175. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +42 -13
  176. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
  177. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +123 -67
  178. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
  179. package/packages/utils/src/lib/fs/rsyncCopy.js +93 -2
  180. package/packages/utils/src/lib/fs/rsyncCopy.js.map +1 -1
  181. package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-CN61MOMa.js +0 -11
  182. package/codeyam-cli/src/webserver/build/client/assets/api.labs-survey-l0sNRNKZ.js +0 -1
  183. package/codeyam-cli/src/webserver/build/client/assets/globals-EVn6Z9pz.css +0 -1
  184. package/codeyam-cli/src/webserver/build/client/assets/labs-CmBYA0PH.js +0 -1
  185. package/codeyam-cli/src/webserver/build/client/assets/manifest-aa4ff97b.js +0 -1
  186. package/codeyam-cli/src/webserver/build/client/assets/memory-BSlqS1QA.js +0 -81
  187. package/codeyam-cli/src/webserver/build/client/assets/root-DVAbJY8B.js +0 -62
  188. package/codeyam-cli/src/webserver/build/client/assets/settings-BK-cnzp-.js +0 -1
  189. package/codeyam-cli/src/webserver/build/server/assets/server-build-CUVsWicu.js +0 -260
@@ -6,7 +6,6 @@ import { setProjectRoot } from "../state.js";
6
6
  import { AnalysisQueue } from "../utils/queue/manager.js";
7
7
  import { checkForStaleProcesses } from "../utils/queue/heartbeat.js";
8
8
  import { dbNotifier } from "./app/lib/dbNotifier.js";
9
- import { checkLabsApproval } from "../utils/labsAutoCheck.js";
10
9
  import { loadEntities, loadAnalyses, updateProjectMetadata, } from "../../../packages/database/index.js";
11
10
  import fs from 'fs';
12
11
  import path from 'path';
@@ -38,6 +37,7 @@ console.log(`Starting CodeYam background server on port ${port}...`);
38
37
  let fileWatcher = null;
39
38
  let analysisQueue = null;
40
39
  let heartbeatInterval = null;
40
+ let rulesWatcher = null;
41
41
  // Memory monitoring - log every minute to track memory usage patterns
42
42
  setInterval(() => {
43
43
  const mem = process.memoryUsage();
@@ -82,12 +82,6 @@ async function main() {
82
82
  console.warn('⚠️ Failed to run labs migration check:', error);
83
83
  }
84
84
  }
85
- // Auto-check labs approval for waitlisted projects
86
- if (project?.slug &&
87
- project.metadata?.labs?.waitlisted === true &&
88
- project.metadata?.labs?.simulations !== true) {
89
- void checkLabsApproval(project.slug).catch(() => { });
90
- }
91
85
  // Start file watcher BEFORE the server if we have project and branch info
92
86
  // This ensures the database is in sync with the filesystem before accepting requests
93
87
  if (project?.id && branch?.id) {
@@ -132,6 +126,25 @@ async function main() {
132
126
  dbNotifier, // Pass the SAME dbNotifier instance to Remix routes
133
127
  });
134
128
  console.log(`✅ CodeYam server running at ${url}`);
129
+ // Watch .claude/rules/ for changes so the memory page auto-refreshes
130
+ try {
131
+ const rulesDir = path.join(rootPath, '.claude', 'rules');
132
+ fs.mkdirSync(rulesDir, { recursive: true });
133
+ const { default: chokidar } = await import('chokidar');
134
+ rulesWatcher = chokidar.watch(rulesDir, {
135
+ persistent: true,
136
+ ignoreInitial: true,
137
+ depth: 5,
138
+ });
139
+ rulesWatcher
140
+ .on('add', () => dbNotifier.notifyChange('rules'))
141
+ .on('change', () => dbNotifier.notifyChange('rules'))
142
+ .on('unlink', () => dbNotifier.notifyChange('rules'));
143
+ console.log(`👀 Watching .claude/rules/ for memory page updates`);
144
+ }
145
+ catch (error) {
146
+ console.warn('⚠️ Failed to start rules watcher:', error);
147
+ }
135
148
  }
136
149
  main().catch((error) => {
137
150
  console.error('❌ Failed to start CodeYam server:', error);
@@ -143,6 +156,9 @@ process.on('SIGTERM', () => {
143
156
  if (fileWatcher) {
144
157
  fileWatcher.stop();
145
158
  }
159
+ if (rulesWatcher) {
160
+ void rulesWatcher.close();
161
+ }
146
162
  if (analysisQueue) {
147
163
  analysisQueue.pause();
148
164
  }
@@ -156,6 +172,9 @@ process.on('SIGINT', () => {
156
172
  if (fileWatcher) {
157
173
  fileWatcher.stop();
158
174
  }
175
+ if (rulesWatcher) {
176
+ void rulesWatcher.close();
177
+ }
159
178
  if (analysisQueue) {
160
179
  analysisQueue.pause();
161
180
  }
@@ -1 +1 @@
1
- {"version":3,"file":"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IAC5B,CAAC;IACD,IAAI,aAAa,EAAE,CAAC;QAClB,aAAa,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;IACD,IAAI,iBAAiB,EAAE,CAAC;QACtB,aAAa,CAAC,iBAAiB,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -3,7 +3,18 @@
3
3
  if (!process.env.NODE_ENV) {
4
4
  process.env.NODE_ENV = 'production';
5
5
  }
6
+ import * as fs from 'fs';
7
+ import * as path from 'path';
6
8
  import * as net from 'net';
9
+ // On Windows, the server is launched via PowerShell Start-Process which can't
10
+ // redirect stdout/stderr. Redirect to log files here when CODEYAM_LOG_DIR is set.
11
+ if (process.env.CODEYAM_LOG_DIR) {
12
+ const logDir = process.env.CODEYAM_LOG_DIR;
13
+ const outStream = fs.createWriteStream(path.join(logDir, 'background-server.log'), { flags: 'a' });
14
+ const errStream = fs.createWriteStream(path.join(logDir, 'background-server-error.log'), { flags: 'a' });
15
+ process.stdout.write = (chunk, ...args) => outStream.write(chunk, ...args);
16
+ process.stderr.write = (chunk, ...args) => errStream.write(chunk, ...args);
17
+ }
7
18
  /**
8
19
  * Check if a port is available by attempting to create a server on it
9
20
  */
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../../src/webserver/bootstrap.ts"],"names":[],"mappings":";AAEA,4DAA4D;AAC5D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IAC1B,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,YAAY,CAAC;AACtC,CAAC;AAED,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B;;GAEG;AACH,SAAS,eAAe,CAAC,IAAY;IACnC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,MAAM,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC;QAClC,MA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IAE1D,gFAAgF;IAChF,wEAAwE;IACxE,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,KAAK,MAAM,EAAE,CAAC;QACjD,OAAO,CAAC,GAAG,CAAC,gCAAgC,IAAI,yBAAyB,CAAC,CAAC;QAC3E,MAAM,aAAa,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,OAAO,CAAC,KAAK,CACX,oBAAoB,IAAI,0CAA0C,CACnE,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,CAAC,GAAG,CACT,oBAAoB,IAAI,uCAAuC,CAChE,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;AACxC,CAAC,CAAC,EAAE,CAAC"}
@@ -1 +1 @@
1
- import{r as i,j as o}from"./chunk-JZWAC4HX-JE9ZIoBl.js";import{C as x,a as m}from"./copy-6y9ALfGT.js";function y({content:a,label:l="Copy",copiedLabel:p="✓ Copied!",className:c="",duration:t=2e3,ariaLabel:C,icon:n=!1,iconSize:s=14}){const[e,r]=i.useState(!1),d=i.useCallback(()=>{navigator.clipboard.writeText(a).then(()=>{r(!0),setTimeout(()=>r(!1),t)}).catch(u=>{console.error("Failed to copy:",u)})},[a,t]);return o.jsx("button",{onClick:d,className:`cursor-pointer ${c}`,disabled:e,"aria-label":C||(e?"Copied to clipboard":"Copy to clipboard"),"aria-live":"polite",children:n?e?o.jsx(x,{size:s,className:"text-green-500"}):o.jsx(m,{size:s}):e?p:l})}export{y as C};
1
+ import{r as i,j as o}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{C as x,a as m}from"./copy-Coc4o_8c.js";function y({content:a,label:l="Copy",copiedLabel:p="✓ Copied!",className:c="",duration:t=2e3,ariaLabel:C,icon:n=!1,iconSize:s=14}){const[e,r]=i.useState(!1),d=i.useCallback(()=>{navigator.clipboard.writeText(a).then(()=>{r(!0),setTimeout(()=>r(!1),t)}).catch(u=>{console.error("Failed to copy:",u)})},[a,t]);return o.jsx("button",{onClick:d,className:`cursor-pointer ${c}`,disabled:e,"aria-label":C||(e?"Copied to clipboard":"Copy to clipboard"),"aria-live":"polite",children:n?e?o.jsx(x,{size:s,className:"text-green-500"}):o.jsx(m,{size:s}):e?p:l})}export{y as C};
@@ -1,4 +1,4 @@
1
- import{c as k}from"./createLucideIcon-Ca9fAY46.js";import{c as E,r as u,j as e,L as N}from"./chunk-JZWAC4HX-JE9ZIoBl.js";import{u as T}from"./useToast-Bv9JFvUO.js";import{f as D,g as F}from"./fileTableUtils-DCPhhSMo.js";import{T as P}from"./TruncatedFilePath-CiwXDxLh.js";import{S as C}from"./SafeScreenshot-Gq3Ocjo6.js";import{L as B}from"./LibraryFunctionPreview-VeqEBv9v.js";import{T as I}from"./triangle-alert-BZz2NjYa.js";import{E as v}from"./EntityTypeIcon-BqY8gDAW.js";import{E as L}from"./EntityTypeBadge-B5ctlSYt.js";/**
1
+ import{c as k}from"./createLucideIcon-D1zB-pYc.js";import{c as E,r as u,j as e,L as N}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{u as T}from"./useToast-ihdMtlf6.js";import{f as D,g as F}from"./fileTableUtils-9sMMAiWJ.js";import{T as P}from"./TruncatedFilePath-CDpEprKa.js";import{S as C}from"./SafeScreenshot-CwZrv-Ok.js";import{L as B}from"./LibraryFunctionPreview-Cq5o8jL4.js";import{T as I}from"./triangle-alert-CAD5b1o_.js";import{E as v}from"./EntityTypeIcon-BH0XDim7.js";import{E as L}from"./EntityTypeBadge-CvzqMxcu.js";/**
2
2
  * @license lucide-react v0.556.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as o}from"./chunk-JZWAC4HX-JE9ZIoBl.js";const l={visual:{label:"VISUAL",bgColor:"#f9f9f9",textColor:"#9040f5"},library:{label:"LIBRARY",bgColor:"#f9f9f9",textColor:"#06b6d5"},type:{label:"TYPE",bgColor:"#ffe1e1",textColor:"#db2627"},other:{label:"OTHER",bgColor:"#f9f9f9",textColor:"#646464"}};function n({type:t,className:r=""}){const e=l[t]||l.other;return o.jsx("div",{className:`inline-flex items-center justify-center px-[4px] rounded-[4px] ${r}`,style:{backgroundColor:e.bgColor,color:e.textColor,height:"15px"},children:o.jsx("span",{className:"text-[10px] font-['IBM_Plex_Sans'] font-semibold leading-[15px] uppercase",children:e.label})})}export{n as E};
1
+ import{j as o}from"./chunk-JZWAC4HX-DB3aFuEO.js";const l={visual:{label:"VISUAL",bgColor:"#f9f9f9",textColor:"#9040f5"},library:{label:"LIBRARY",bgColor:"#f9f9f9",textColor:"#06b6d5"},type:{label:"TYPE",bgColor:"#ffe1e1",textColor:"#db2627"},other:{label:"OTHER",bgColor:"#f9f9f9",textColor:"#646464"}};function n({type:t,className:r=""}){const e=l[t]||l.other;return o.jsx("div",{className:`inline-flex items-center justify-center px-[4px] rounded-[4px] ${r}`,style:{backgroundColor:e.bgColor,color:e.textColor,height:"15px"},children:o.jsx("span",{className:"text-[10px] font-['IBM_Plex_Sans'] font-semibold leading-[15px] uppercase",children:e.label})})}export{n as E};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./chunk-JZWAC4HX-JE9ZIoBl.js";import{c}from"./createLucideIcon-Ca9fAY46.js";/**
1
+ import{j as e}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{c}from"./createLucideIcon-D1zB-pYc.js";/**
2
2
  * @license lucide-react v0.556.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as _,r as e,j as h}from"./chunk-JZWAC4HX-JE9ZIoBl.js";import{u as K}from"./useLastLogLine-COky1GVF.js";function U(s){const r=s.replace(/[^a-zA-Z0-9_]+/g,"_");return r.slice(0,1).toUpperCase()+r.slice(1)}function V({analysisId:s,scenarioId:r,scenarioName:a,projectSlug:i,enabled:g=!0,refreshTrigger:f=0}){const k=_(),[S,w]=e.useState(null),[A,E]=e.useState(!1),[B,c]=e.useState(!1),[q,l]=e.useState(!1),d=e.useRef(!1),x=e.useRef(null),I=e.useRef(null),[M,m]=e.useState(0),[z,R]=e.useState(0),n=e.useRef(null),u=e.useRef(!1),{interactiveUrl:b,resetLogs:L}=K(i,g),y=e.useRef(r),F=e.useRef(f);e.useEffect(()=>{F.current!==f&&(F.current=f,S&&(console.log("[useInteractiveMode] Manual refresh triggered"),c(!0),l(!1),m(0),R(t=>t+1),u.current=!1,n.current&&(clearTimeout(n.current),n.current=null)))},[f,S]),e.useEffect(()=>{if(y.current!==r&&(y.current=r,x.current&&I.current&&a)){const t=U(I.current),o=U(a),p=x.current.replace(t,o);w(p),c(!0),l(!1),m(0),R(v=>v+1),u.current=!1,n.current&&(clearTimeout(n.current),n.current=null);return}},[r,a]),e.useEffect(()=>{if(b){const t=b+"?width=600px";x.current=t,a&&(I.current=a),w(t),E(!1),c(!0)}},[b]),e.useEffect(()=>{const t=o=>{o.data.type==="codeyam-resize"&&(u.current||(u.current=!0,n.current&&(clearTimeout(n.current),n.current=null),m(0),l(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{c(!1)})})))};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)},[]);const j=()=>{u.current=!1,n.current&&clearTimeout(n.current);const t=500*Math.pow(2,M);n.current=setTimeout(()=>{u.current||(M<2?(m(o=>o+1),R(o=>o+1),c(!0)):(console.error("[useInteractiveMode] Interactive mode failed to load after 3 attempts - showing iframe anyway"),l(!0),c(!1)))},t)};return e.useEffect(()=>{g&&!d.current&&r&&s&&(d.current=!0,E(!0),l(!1),w(null),(async()=>{if(i)try{await fetch(`/api/logs/${i}`,{method:"DELETE"})}catch(o){console.error("[useInteractiveMode] Failed to clear log file:",o)}L(),k.submit({action:"start",analysisId:s,scenarioId:r},{method:"post",action:"/api/interactive-mode"})})())},[g,r,s,L,i]),e.useEffect(()=>{const t=s,o=()=>{if(d.current&&t){const v=new URLSearchParams({action:"stop",analysisId:t});console.log("[useInteractiveMode] Sending stop request via sendBeacon");const T=navigator.sendBeacon("/api/interactive-mode",v);console.log("[useInteractiveMode] sendBeacon result:",T),T||(console.log("[useInteractiveMode] sendBeacon failed, using fetch fallback"),fetch("/api/interactive-mode",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:v,keepalive:!0}).catch(D=>console.error("Failed to stop interactive mode:",D)))}},p=()=>{o()};return window.addEventListener("beforeunload",p),()=>{window.removeEventListener("beforeunload",p),console.log("[useInteractiveMode] Cleanup running:",{hasStarted:d.current,analysisId:t}),o()}},[s]),{interactiveServerUrl:S,isStarting:A,isLoading:B,showIframe:q,iframeKey:z,onIframeLoad:j}}function Z(){return h.jsxs("div",{className:"spinner-container",children:[h.jsx("span",{className:"loader"}),h.jsx("style",{children:`
1
+ import{c as _,r as e,j as h}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{u as K}from"./useLastLogLine-DAFqfEDH.js";function U(s){const r=s.replace(/[^a-zA-Z0-9_]+/g,"_");return r.slice(0,1).toUpperCase()+r.slice(1)}function V({analysisId:s,scenarioId:r,scenarioName:a,projectSlug:i,enabled:g=!0,refreshTrigger:f=0}){const k=_(),[S,w]=e.useState(null),[A,E]=e.useState(!1),[B,c]=e.useState(!1),[q,l]=e.useState(!1),d=e.useRef(!1),x=e.useRef(null),I=e.useRef(null),[M,m]=e.useState(0),[z,R]=e.useState(0),n=e.useRef(null),u=e.useRef(!1),{interactiveUrl:b,resetLogs:L}=K(i,g),y=e.useRef(r),F=e.useRef(f);e.useEffect(()=>{F.current!==f&&(F.current=f,S&&(console.log("[useInteractiveMode] Manual refresh triggered"),c(!0),l(!1),m(0),R(t=>t+1),u.current=!1,n.current&&(clearTimeout(n.current),n.current=null)))},[f,S]),e.useEffect(()=>{if(y.current!==r&&(y.current=r,x.current&&I.current&&a)){const t=U(I.current),o=U(a),p=x.current.replace(t,o);w(p),c(!0),l(!1),m(0),R(v=>v+1),u.current=!1,n.current&&(clearTimeout(n.current),n.current=null);return}},[r,a]),e.useEffect(()=>{if(b){const t=b+"?width=600px";x.current=t,a&&(I.current=a),w(t),E(!1),c(!0)}},[b]),e.useEffect(()=>{const t=o=>{o.data.type==="codeyam-resize"&&(u.current||(u.current=!0,n.current&&(clearTimeout(n.current),n.current=null),m(0),l(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{c(!1)})})))};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)},[]);const j=()=>{u.current=!1,n.current&&clearTimeout(n.current);const t=500*Math.pow(2,M);n.current=setTimeout(()=>{u.current||(M<2?(m(o=>o+1),R(o=>o+1),c(!0)):(console.error("[useInteractiveMode] Interactive mode failed to load after 3 attempts - showing iframe anyway"),l(!0),c(!1)))},t)};return e.useEffect(()=>{g&&!d.current&&r&&s&&(d.current=!0,E(!0),l(!1),w(null),(async()=>{if(i)try{await fetch(`/api/logs/${i}`,{method:"DELETE"})}catch(o){console.error("[useInteractiveMode] Failed to clear log file:",o)}L(),k.submit({action:"start",analysisId:s,scenarioId:r},{method:"post",action:"/api/interactive-mode"})})())},[g,r,s,L,i]),e.useEffect(()=>{const t=s,o=()=>{if(d.current&&t){const v=new URLSearchParams({action:"stop",analysisId:t});console.log("[useInteractiveMode] Sending stop request via sendBeacon");const T=navigator.sendBeacon("/api/interactive-mode",v);console.log("[useInteractiveMode] sendBeacon result:",T),T||(console.log("[useInteractiveMode] sendBeacon failed, using fetch fallback"),fetch("/api/interactive-mode",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:v,keepalive:!0}).catch(D=>console.error("Failed to stop interactive mode:",D)))}},p=()=>{o()};return window.addEventListener("beforeunload",p),()=>{window.removeEventListener("beforeunload",p),console.log("[useInteractiveMode] Cleanup running:",{hasStarted:d.current,analysisId:t}),o()}},[s]),{interactiveServerUrl:S,isStarting:A,isLoading:B,showIframe:q,iframeKey:z,onIframeLoad:j}}function Z(){return h.jsxs("div",{className:"spinner-container",children:[h.jsx("span",{className:"loader"}),h.jsx("style",{children:`
2
2
  .loader {
3
3
  width: 48px;
4
4
  height: 48px;
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CcsFv748.js","assets/chunk-JZWAC4HX-JE9ZIoBl.js","assets/index-ChN9-fAY.js","assets/styles-CMKNK2uU.css"])))=>i.map(i=>d[i]);
2
- import{r as t,j as e}from"./chunk-JZWAC4HX-JE9ZIoBl.js";import{_ as L}from"./preload-helper-ckwbz45p.js";import{u as Q}from"./useLastLogLine-COky1GVF.js";import{S as P,I as B}from"./InlineSpinner-ClaLpuOo.js";const $=t.createContext({dimensions:{height:720,width:1200},updateDimensions:()=>{},iframeRef:{current:null},scale:1,updateScale:()=>{},maxWidth:1200,updateMaxWidth:()=>{}}),U=()=>{const o=t.useContext($);if(!o)throw new Error("useWebContainer must be used within a WebContainerProvider");return o},oe=({children:o})=>{const[i,r]=t.useState({height:720,width:1200}),[d,f]=t.useState(1),[u,g]=t.useState(1200),x=t.useRef(null),h=t.useCallback(({height:l,width:j})=>{r(S=>({height:l??S.height,width:j??S.width}))},[]),v=t.useCallback(l=>{f(l)},[]),w=t.useCallback(l=>{g(l)},[]);return e.jsx($.Provider,{value:{dimensions:i,updateDimensions:h,iframeRef:x,scale:d,updateScale:v,maxWidth:u,updateMaxWidth:w},children:o})},X=typeof window<"u";function Z(){const[o,i]=t.useState(null);return t.useEffect(()=>{L(()=>import("./index-CcsFv748.js").then(r=>r.i),__vite__mapDeps([0,1,2])).then(r=>{i(()=>r.ResizableBox)}),L(()=>Promise.resolve({}),__vite__mapDeps([3]))},[]),o}const ee=1200,te=720,H=30,se=({id:o,scenarioName:i,iframeUrl:r,defaultWidth:d=1440,defaultHeight:f=900,onDataOverride:u,onIframeLoad:g,onScaleChange:x,onDimensionChange:h})=>{const v=Z(),[w,l]=t.useState(!1),[j,S]=t.useState(!1),[c,A]=t.useState(ee),[_,D]=t.useState(te),[E,T]=t.useState(null),[M,I]=t.useState(null),{dimensions:a,updateDimensions:y,iframeRef:m,updateScale:N,updateMaxWidth:R}=U(),k=t.useMemo(()=>Math.min(1,c/a.width),[c,a.width]),p=M!==null?M:k;t.useEffect(()=>{w||(N(p),x==null||x(p))},[p,N,x,w]),t.useEffect(()=>{R(c)},[c,R]);const G=t.useCallback(()=>{l(!0),I(k)},[k]),O=t.useCallback(()=>{l(!1),I(null)},[]),V=t.useCallback((n,s)=>{const b=M!==null?M:1,z=Math.round(s.size.width/b);y({width:z}),h==null||h(z,a.height)},[y,M,h,a.height]),F=t.useCallback(()=>{setTimeout(()=>{S(!0)},100),g&&g()},[g]);t.useEffect(()=>{const n=s=>{if(s.data.type==="codeyam-resize"){if(i&&s.data.name!==i||a.height===s.data.height||s.data.height===0)return;y({height:s.data.height})}};return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}},[m,i,d,a,y]),t.useEffect(()=>{j&&u&&u(m.current)},[j,u,m]),t.useEffect(()=>{if(!i)return;const n=setInterval(()=>{var s,b;(b=(s=m==null?void 0:m.current)==null?void 0:s.contentWindow)==null||b.postMessage({type:"codeyam-respond",name:i},"*")},1e3);return()=>clearInterval(n)},[i,m]),t.useEffect(()=>{const n=()=>{const s=document.getElementById("scenario-container");if(!s)return;const b=s.getBoundingClientRect(),z=s.clientWidth-H*2,q=window.innerHeight-b.top-H*2,J=Math.max(q,400),K=window.innerHeight-b.top;A(z),D(J),T(K)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),t.useEffect(()=>{y({width:d,height:f})},[d,f,y]);const C=t.useMemo(()=>a.width*p,[a.width,p]),W=t.useMemo(()=>{const n=a.height,s=n*p;return n&&n!==720&&n!==900&&s<_?s:_},[a.height,_,p]),Y=t.useCallback(()=>{window.history.back()},[]);return!X||!v?e.jsx("div",{className:"relative bg-gray-100 w-full h-full flex items-center justify-center",children:e.jsx("p",{className:"text-gray-500",children:"Loading interactive view..."})}):e.jsxs("div",{id:"scenario-container",className:"relative bg-gray-100 w-full flex items-center justify-center",style:E?{height:`${E}px`}:{},children:[w&&e.jsx("div",{className:"fixed inset-0 z-50 bg-transparent"}),e.jsx("style",{children:`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-_417gcQW.js","assets/chunk-JZWAC4HX-DB3aFuEO.js","assets/index-CUM5iXwc.js","assets/styles-CMKNK2uU.css"])))=>i.map(i=>d[i]);
2
+ import{r as t,j as e}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{_ as L}from"./preload-helper-ckwbz45p.js";import{u as Q}from"./useLastLogLine-DAFqfEDH.js";import{S as P,I as B}from"./InlineSpinner-EhOseatT.js";const $=t.createContext({dimensions:{height:720,width:1200},updateDimensions:()=>{},iframeRef:{current:null},scale:1,updateScale:()=>{},maxWidth:1200,updateMaxWidth:()=>{}}),U=()=>{const o=t.useContext($);if(!o)throw new Error("useWebContainer must be used within a WebContainerProvider");return o},oe=({children:o})=>{const[i,r]=t.useState({height:720,width:1200}),[d,f]=t.useState(1),[u,g]=t.useState(1200),x=t.useRef(null),h=t.useCallback(({height:l,width:j})=>{r(S=>({height:l??S.height,width:j??S.width}))},[]),v=t.useCallback(l=>{f(l)},[]),w=t.useCallback(l=>{g(l)},[]);return e.jsx($.Provider,{value:{dimensions:i,updateDimensions:h,iframeRef:x,scale:d,updateScale:v,maxWidth:u,updateMaxWidth:w},children:o})},X=typeof window<"u";function Z(){const[o,i]=t.useState(null);return t.useEffect(()=>{L(()=>import("./index-_417gcQW.js").then(r=>r.i),__vite__mapDeps([0,1,2])).then(r=>{i(()=>r.ResizableBox)}),L(()=>Promise.resolve({}),__vite__mapDeps([3]))},[]),o}const ee=1200,te=720,H=30,se=({id:o,scenarioName:i,iframeUrl:r,defaultWidth:d=1440,defaultHeight:f=900,onDataOverride:u,onIframeLoad:g,onScaleChange:x,onDimensionChange:h})=>{const v=Z(),[w,l]=t.useState(!1),[j,S]=t.useState(!1),[c,A]=t.useState(ee),[_,D]=t.useState(te),[E,T]=t.useState(null),[M,I]=t.useState(null),{dimensions:a,updateDimensions:y,iframeRef:m,updateScale:N,updateMaxWidth:R}=U(),k=t.useMemo(()=>Math.min(1,c/a.width),[c,a.width]),p=M!==null?M:k;t.useEffect(()=>{w||(N(p),x==null||x(p))},[p,N,x,w]),t.useEffect(()=>{R(c)},[c,R]);const G=t.useCallback(()=>{l(!0),I(k)},[k]),O=t.useCallback(()=>{l(!1),I(null)},[]),V=t.useCallback((n,s)=>{const b=M!==null?M:1,z=Math.round(s.size.width/b);y({width:z}),h==null||h(z,a.height)},[y,M,h,a.height]),F=t.useCallback(()=>{setTimeout(()=>{S(!0)},100),g&&g()},[g]);t.useEffect(()=>{const n=s=>{if(s.data.type==="codeyam-resize"){if(i&&s.data.name!==i||a.height===s.data.height||s.data.height===0)return;y({height:s.data.height})}};return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}},[m,i,d,a,y]),t.useEffect(()=>{j&&u&&u(m.current)},[j,u,m]),t.useEffect(()=>{if(!i)return;const n=setInterval(()=>{var s,b;(b=(s=m==null?void 0:m.current)==null?void 0:s.contentWindow)==null||b.postMessage({type:"codeyam-respond",name:i},"*")},1e3);return()=>clearInterval(n)},[i,m]),t.useEffect(()=>{const n=()=>{const s=document.getElementById("scenario-container");if(!s)return;const b=s.getBoundingClientRect(),z=s.clientWidth-H*2,q=window.innerHeight-b.top-H*2,J=Math.max(q,400),K=window.innerHeight-b.top;A(z),D(J),T(K)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),t.useEffect(()=>{y({width:d,height:f})},[d,f,y]);const C=t.useMemo(()=>a.width*p,[a.width,p]),W=t.useMemo(()=>{const n=a.height,s=n*p;return n&&n!==720&&n!==900&&s<_?s:_},[a.height,_,p]),Y=t.useCallback(()=>{window.history.back()},[]);return!X||!v?e.jsx("div",{className:"relative bg-gray-100 w-full h-full flex items-center justify-center",children:e.jsx("p",{className:"text-gray-500",children:"Loading interactive view..."})}):e.jsxs("div",{id:"scenario-container",className:"relative bg-gray-100 w-full flex items-center justify-center",style:E?{height:`${E}px`}:{},children:[w&&e.jsx("div",{className:"fixed inset-0 z-50 bg-transparent"}),e.jsx("style",{children:`
3
3
  .react-resizable-handle-e {
4
4
  display: flex !important;
5
5
  align-items: center !important;
@@ -1,3 +1,3 @@
1
- import{j as r,L as C}from"./chunk-JZWAC4HX-JE9ZIoBl.js";import{g as L}from"./scenarioStatus-B_8jpV3e.js";function M({scenario:s,entitySha:m,size:g="medium",showBorder:j=!0,isOutdated:E=!1}){var x,h,u,p,$,f;const t=L(s,void 0,void 0,m,void 0),e=(x=s.metadata)==null?void 0:x.executionResult,o=!!e,b=(((u=(h=s.metadata)==null?void 0:h.data)==null?void 0:u.argumentsData)||[]).length,c=(e==null?void 0:e.returnValue)!==void 0&&(e==null?void 0:e.returnValue)!==null,i=(($=(p=e==null?void 0:e.sideEffects)==null?void 0:p.consoleOutput)==null?void 0:$.length)||0,d=((f=e==null?void 0:e.timing)==null?void 0:f.duration)||0;let a=0;b>0&&a++,b>2&&a++,c&&a++,i>0&&a++,a=Math.min(3,a);const l=g==="small"?{width:"w-[50px]",height:"h-[38px]",iconSize:"text-base",textSize:"text-[8px]"}:{width:"w-20",height:"h-15",iconSize:"text-xl",textSize:"text-[10px]"},n=t.hasError?{border:"border-red-400",bg:"bg-red-50",icon:"text-red-600",badge:"bg-red-100 text-red-700"}:o?E?{border:"border-amber-500",bg:"bg-amber-50",icon:"text-amber-700",badge:"bg-amber-100 text-amber-700"}:{border:"border-blue-400",bg:"bg-blue-50",icon:"text-blue-600",badge:"bg-blue-100 text-blue-700"}:{border:"border-gray-300 border-dashed",bg:"bg-gray-50",icon:"text-gray-400",badge:"bg-gray-100 text-gray-600"},w=j?`border-2 ${n.border}`:"",S=Array.from({length:3},(v,y)=>r.jsx("div",{className:`w-1 h-1 rounded-full ${y<a?n.icon.replace("text-","bg-"):"bg-gray-300"}`},y)),N=t.hasError?`Error: ${t.errorMessage||"Unknown error"}`:o?`${s.name}
1
+ import{j as r,L as C}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{g as L}from"./scenarioStatus-B_8jpV3e.js";function M({scenario:s,entitySha:m,size:g="medium",showBorder:j=!0,isOutdated:E=!1}){var x,h,u,p,$,f;const t=L(s,void 0,void 0,m,void 0),e=(x=s.metadata)==null?void 0:x.executionResult,o=!!e,b=(((u=(h=s.metadata)==null?void 0:h.data)==null?void 0:u.argumentsData)||[]).length,c=(e==null?void 0:e.returnValue)!==void 0&&(e==null?void 0:e.returnValue)!==null,i=(($=(p=e==null?void 0:e.sideEffects)==null?void 0:p.consoleOutput)==null?void 0:$.length)||0,d=((f=e==null?void 0:e.timing)==null?void 0:f.duration)||0;let a=0;b>0&&a++,b>2&&a++,c&&a++,i>0&&a++,a=Math.min(3,a);const l=g==="small"?{width:"w-[50px]",height:"h-[38px]",iconSize:"text-base",textSize:"text-[8px]"}:{width:"w-20",height:"h-15",iconSize:"text-xl",textSize:"text-[10px]"},n=t.hasError?{border:"border-red-400",bg:"bg-red-50",icon:"text-red-600",badge:"bg-red-100 text-red-700"}:o?E?{border:"border-amber-500",bg:"bg-amber-50",icon:"text-amber-700",badge:"bg-amber-100 text-amber-700"}:{border:"border-blue-400",bg:"bg-blue-50",icon:"text-blue-600",badge:"bg-blue-100 text-blue-700"}:{border:"border-gray-300 border-dashed",bg:"bg-gray-50",icon:"text-gray-400",badge:"bg-gray-100 text-gray-600"},w=j?`border-2 ${n.border}`:"",S=Array.from({length:3},(v,y)=>r.jsx("div",{className:`w-1 h-1 rounded-full ${y<a?n.icon.replace("text-","bg-"):"bg-gray-300"}`},y)),N=t.hasError?`Error: ${t.errorMessage||"Unknown error"}`:o?`${s.name}
2
2
  ${b} args → ${c?"value":"void"}${i>0?` (${i} logs)`:""}
3
3
  ${d}ms`:`Not executed: ${s.name}`;return r.jsxs(C,{to:`/entity/${m}/scenarios/${s.id}`,className:`relative ${l.width} ${l.height} ${w} rounded ${n.bg} flex flex-col items-center justify-center gap-0.5 cursor-pointer transition-all hover:scale-105 hover:shadow-md`,title:N,onClick:v=>v.stopPropagation(),children:[r.jsx("div",{className:`${n.icon} ${l.iconSize} font-mono font-bold`,children:t.hasError?"⚠":o?"ƒ":"○"}),o&&!t.hasError&&r.jsxs("div",{className:`flex items-center gap-0.5 ${l.textSize} ${n.badge} px-1 rounded`,children:[r.jsx("span",{children:b}),r.jsx("span",{children:"→"}),r.jsx("span",{children:c?"✓":"∅"})]}),o&&!t.hasError&&g==="medium"&&r.jsx("div",{className:"flex gap-0.5 mt-0.5",children:S}),o&&!t.hasError&&d>100&&g==="medium"&&r.jsx("div",{className:`absolute top-0.5 right-0.5 ${l.textSize} ${n.badge} px-1 rounded`,children:d>1e3?`${Math.round(d/1e3)}s`:`${d}ms`}),o&&!t.hasError&&i>0&&g==="medium"&&r.jsxs("div",{className:"absolute bottom-0.5 left-0.5 text-[8px] text-gray-500",children:["📝",i]})]})}export{M as L};
@@ -1,4 +1,4 @@
1
- import{j as i}from"./chunk-JZWAC4HX-JE9ZIoBl.js";let s=!1;function r(){if(s)return;const e=document.createElement("style");e.textContent=`
1
+ import{j as i}from"./chunk-JZWAC4HX-DB3aFuEO.js";let s=!1;function r(){if(s)return;const e=document.createElement("style");e.textContent=`
2
2
  @keyframes strongPulse {
3
3
  0%, 100% { opacity: 0.2; }
4
4
  50% { opacity: 1; }
@@ -1,3 +1,3 @@
1
- import{r,j as e}from"./chunk-JZWAC4HX-JE9ZIoBl.js";function w({projectSlug:x,onClose:l}){const[m,o]=r.useState("Loading logs..."),[u,g]=r.useState(!0),[d,f]=r.useState(!0),[n,b]=r.useState("all"),a=r.useRef(null);return r.useEffect(()=>{const t=async()=>{try{const s=await fetch(`/api/logs/${x}`);if(s.ok){const h=await s.text();if(n==="all")o(h);else{const c=h.trim().split(`
1
+ import{r,j as e}from"./chunk-JZWAC4HX-DB3aFuEO.js";function w({projectSlug:x,onClose:l}){const[m,o]=r.useState("Loading logs..."),[u,g]=r.useState(!0),[d,f]=r.useState(!0),[n,b]=r.useState("all"),a=r.useRef(null);return r.useEffect(()=>{const t=async()=>{try{const s=await fetch(`/api/logs/${x}`);if(s.ok){const h=await s.text();if(n==="all")o(h);else{const c=h.trim().split(`
2
2
  `).filter(i=>{if(i.length===0)return!1;const p=i.match(/^.*CodeYam Log Level (\d+):/);return!!p&&Number(p[1])<=n});o(c.map(i=>i.replace(/^.*CodeYam Log Level \d+:\s*/,"")).join(`
3
3
  `))}d&&a.current&&setTimeout(()=>{var c;(c=a.current)==null||c.scrollTo({top:a.current.scrollHeight,behavior:"smooth"})},100)}else o(`Error: ${s.status} - ${await s.text()}`)}catch(s){o(`Error fetching logs: ${s.message}`)}};if(t().catch(()=>{}),u){const s=setInterval(()=>{t().catch(()=>{})},2e3);return()=>clearInterval(s)}},[x,u,d,n]),r.useEffect(()=>{const t=s=>{s.key==="Escape"&&l()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[l]),e.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-9999 p-5",onClick:l,children:e.jsxs("div",{className:"bg-[#1e1e1e] rounded-lg shadow-2xl flex flex-col max-w-[1200px] w-full max-h-[90vh] overflow-hidden",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex justify-between items-center px-5 py-4 border-b border-[#333] bg-[#252525]",children:[e.jsxs("h3",{className:"m-0 text-lg font-semibold text-white",children:["Analysis Logs - ",x]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[#ccc] select-none",children:[e.jsx("span",{children:"Log Level:"}),e.jsxs("select",{value:n,onChange:t=>b(t.target.value==="all"?"all":Number(t.target.value)),className:"bg-[#333] text-white border border-[#555] rounded px-2 py-1 text-sm cursor-pointer outline-none transition-all hover:border-[#777] hover:bg-[#3a3a3a] focus:border-blue-600",children:[e.jsx("option",{value:"1",children:"1"}),e.jsx("option",{value:"2",children:"2"}),e.jsx("option",{value:"3",children:"3"}),e.jsx("option",{value:"4",children:"4"}),e.jsx("option",{value:"all",children:"All"})]})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-sm text-[#ccc] cursor-pointer select-none group",children:[e.jsx("input",{type:"checkbox",checked:u,onChange:t=>g(t.target.checked),className:"cursor-pointer"}),e.jsx("span",{className:"group-hover:text-white",children:"Auto-refresh"})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-sm text-[#ccc] cursor-pointer select-none group",children:[e.jsx("input",{type:"checkbox",checked:d,onChange:t=>f(t.target.checked),className:"cursor-pointer"}),e.jsx("span",{className:"group-hover:text-white",children:"Auto-scroll"})]}),e.jsx("button",{onClick:l,className:"bg-transparent border-none text-[#999] text-2xl cursor-pointer p-0 w-8 h-8 flex items-center justify-center rounded transition-all hover:bg-[#333] hover:text-white",title:"Close (Esc)",children:"✕"})]})]}),e.jsx("pre",{className:"flex-1 m-0 px-5 py-4 overflow-auto font-mono text-[13px] leading-relaxed text-[#d4d4d4] bg-[#1e1e1e] whitespace-pre-wrap wrap-break-word scrollbar-thin scrollbar-thumb-[#424242] scrollbar-track-[#1e1e1e] hover:scrollbar-thumb-[#4f4f4f]",ref:a,children:m})]})})}export{w as L};
@@ -1,4 +1,4 @@
1
- import{r as t,c as T,j as e}from"./chunk-JZWAC4HX-JE9ZIoBl.js";import{c as S}from"./createLucideIcon-Ca9fAY46.js";import{C as F}from"./circle-check-CXhHQYrI.js";import{T as k}from"./triangle-alert-BZz2NjYa.js";import{C as E,a as A}from"./copy-6y9ALfGT.js";/**
1
+ import{r as t,c as T,j as e}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{c as S}from"./createLucideIcon-D1zB-pYc.js";import{C as F}from"./circle-check-igfMr5DY.js";import{T as k}from"./triangle-alert-CAD5b1o_.js";import{C as E,a as A}from"./copy-Coc4o_8c.js";/**
2
2
  * @license lucide-react v0.556.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -8,4 +8,4 @@ import{r as t,c as T,j as e}from"./chunk-JZWAC4HX-JE9ZIoBl.js";import{c as S}fro
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const L=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],w=S("settings",L);function Y(r){return r.scenarioName&&r.entityName?`${r.entityName} → "${r.scenarioName}"`:r.entityName?r.entityName:r.scenarioId?`Scenario: ${r.scenarioId.slice(0,8)}...`:r.entitySha?`Entity: ${r.entitySha.slice(0,8)}...`:"General feedback"}function _({content:r,className:x=""}){const[s,o]=t.useState(!1),i=t.useCallback(()=>{navigator.clipboard.writeText(r).then(()=>{o(!0),setTimeout(()=>o(!1),2e3)}).catch(n=>{console.error("Failed to copy:",n)})},[r]);return e.jsx("button",{onClick:i,className:`cursor-pointer flex items-center gap-1 ${x}`,disabled:s,"aria-label":s?"Copied to clipboard":"Copy to clipboard",children:s?e.jsxs(e.Fragment,{children:[e.jsx(E,{size:14}),"Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(A,{size:14}),"Copy"]})})}function G({isOpen:r,onClose:x,context:s,defaultEmail:o="",screenshotDataUrl:i}){const[n,y]=t.useState(""),[b,I]=t.useState(o),[u,j]=t.useState(!1),[c,f]=t.useState(!1),[M,N]=t.useState(null),[m,h]=t.useState(null),l=T(),d=l.state!=="idle",g=!!(s.scenarioId||s.analysisId),$=s.analysisId||s.scenarioId||"",v=()=>{const a=`/codeyam:diagnose ${$}`;return n.trim()?`${a} ${n.trim()}`:a};if(l.data&&!c&&!m){const a=l.data;a.success&&a.reportId?(f(!0),N(a.reportId)):a.error&&h(a.error)}const D=async()=>{h(null);const a=new FormData;if(a.append("issueType","other"),a.append("description",n),a.append("email",b),a.append("source",s.source),a.append("entitySha",s.entitySha||""),a.append("scenarioId",s.scenarioId||""),a.append("analysisId",s.analysisId||""),a.append("currentUrl",s.currentUrl),a.append("entityName",s.entityName||""),a.append("entityType",s.entityType||""),a.append("scenarioName",s.scenarioName||""),a.append("errorMessage",s.errorMessage||""),i)try{const R=await(await fetch(i)).blob();a.append("screenshot",R,"screenshot.jpg")}catch(C){console.error("Failed to convert screenshot:",C)}l.submit(a,{method:"post",action:"/api/generate-report",encType:"multipart/form-data"})},p=()=>{y(""),j(!1),f(!1),N(null),h(null),x()},z=a=>{a.key==="Escape"&&p()};return r?e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center p-4 z-50",onKeyDown:z,children:e.jsxs("div",{className:"bg-white rounded-lg max-w-lg w-full p-6 shadow-xl max-h-[90vh] overflow-y-auto",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[d?e.jsx("div",{className:"animate-spin",children:e.jsx(w,{size:24,style:{strokeWidth:1.5}})}):c?e.jsx(F,{size:24,style:{color:"#10B981",strokeWidth:1.5}}):e.jsx(B,{size:24,style:{color:"#005C75",strokeWidth:1.5}}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:c?"Report Submitted":"Report Issue"})]}),e.jsx("button",{onClick:p,className:"text-gray-400 hover:text-gray-600 transition-colors cursor-pointer","aria-label":"Close",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),c?e.jsxs("div",{children:[e.jsxs("div",{className:"mb-6 p-4 bg-green-50 rounded-lg border border-green-200",children:[e.jsx("p",{className:"text-sm text-green-800 font-medium mb-1",children:"Thank you for your feedback!"}),e.jsxs("p",{className:"text-xs text-green-700",children:["Report ID:"," ",e.jsx("code",{className:"bg-green-100 px-1 rounded",children:M})]})]}),e.jsx("p",{className:"text-sm text-gray-600 mb-6",children:"The CodeYam team will investigate and may reach out if you provided an email address."}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:p,className:"px-4 py-2 bg-[#005c75] text-white text-sm font-medium rounded-md hover:bg-[#004a5c] transition-colors cursor-pointer",children:"Done"})})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"mb-4 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-sm font-medium text-gray-900",title:`${s.source}${s.entitySha?` • Entity: ${s.entitySha}`:""}${s.scenarioId?` • Scenario: ${s.scenarioId}`:""}${s.analysisId?` • Analysis: ${s.analysisId}`:""}`,children:Y(s)}),e.jsx("button",{type:"button",onClick:()=>j(!u),className:"text-xs text-gray-500 hover:text-gray-700 underline cursor-pointer",children:u?"Hide":"Details"})]}),u&&e.jsxs("div",{className:"mt-2 pt-2 border-t border-gray-200 text-xs text-gray-600 space-y-1 break-all",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"Source:"})," ",s.source]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"URL:"})," ",s.currentUrl]}),s.entitySha&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"Entity:"})," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:s.entitySha})]}),s.scenarioId&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"Scenario:"})," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:s.scenarioId})]}),s.analysisId&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"Analysis:"})," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:s.analysisId})]})]})]}),i&&e.jsxs("div",{className:"mb-4 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[e.jsx("div",{className:"text-xs text-gray-500 mb-2",children:"Screenshot (will be included in report)"}),e.jsx("img",{src:i,alt:"Page screenshot",className:"w-full max-h-[150px] object-contain rounded border border-gray-300"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700 mb-2",children:"What happened?"}),e.jsx("textarea",{id:"description",value:n,onChange:a=>y(a.target.value),placeholder:"Optional: Describe what you expected vs what happened...",rows:3,className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75] resize-none"})]}),g&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-4 p-4 bg-purple-50 rounded-lg border border-purple-200",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("span",{className:"text-lg",children:"🔧"}),e.jsx("h3",{className:"text-sm font-semibold text-purple-900",children:"Diagnose & Fix (Recommended)"})]}),e.jsx("p",{className:"text-xs text-purple-700 mb-3",children:"Run this command in Claude Code to investigate the issue locally and potentially fix it. A detailed report will also be uploaded."}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"bg-gray-800 text-gray-50 px-3 py-2.5 pr-20 rounded-md text-xs font-mono overflow-x-auto whitespace-nowrap",children:v()}),e.jsx(_,{content:v(),className:"absolute top-1.5 right-2 px-2 py-1 bg-purple-600 text-white border-none rounded text-[11px] font-medium hover:bg-purple-700 transition-colors"})]})]}),e.jsxs("div",{className:"relative my-5",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-gray-300"})}),e.jsx("div",{className:"relative flex justify-center",children:e.jsx("span",{className:"bg-white px-3 text-xs text-gray-500 uppercase",children:"or"})})]})]}),e.jsxs("div",{className:g?"opacity-75":"",children:[g&&e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("span",{className:"text-lg",children:"📤"}),e.jsx("h3",{className:"text-sm font-semibold text-gray-700",children:"Quick Report"}),e.jsx("span",{className:"text-xs text-gray-500",children:"(won't investigate locally)"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-2",children:"Your email"}),e.jsx("input",{id:"email",type:"email",value:b,onChange:a=>I(a.target.value),placeholder:"you@example.com",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"})]}),e.jsxs("div",{className:"mb-4 p-3 bg-amber-50 rounded-lg border border-amber-200 flex gap-2",children:[e.jsx(k,{size:16,className:"flex-shrink-0 mt-0.5",style:{color:"#D97706"}}),e.jsxs("div",{className:"text-xs text-amber-800",children:[e.jsx("p",{className:"font-medium mb-1",children:"Source code will be uploaded"}),e.jsx("p",{children:"This report includes your project source code, git history, and CodeYam logs. Only submit if you're comfortable sharing this with the CodeYam team."})]})]}),d&&e.jsx("div",{className:"mb-4 text-center",children:e.jsx("p",{className:"text-sm text-gray-600",children:l.formData?"Uploading report...":"Creating archive..."})}),m&&e.jsxs("div",{className:"mb-4 p-3 bg-red-50 rounded-lg border border-red-200 flex gap-2",children:[e.jsx(k,{size:16,className:"flex-shrink-0 mt-0.5",style:{color:"#DC2626"}}),e.jsxs("div",{className:"text-xs text-red-800",children:[e.jsx("p",{className:"font-medium mb-1",children:"Upload failed"}),e.jsx("p",{children:m})]})]}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx("button",{onClick:p,disabled:d,className:"px-4 py-2 bg-gray-100 text-gray-700 text-sm font-medium rounded-md hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-300 transition-colors disabled:opacity-50 cursor-pointer",children:"Cancel"}),e.jsx("button",{onClick:()=>void D(),disabled:d,className:"px-4 py-2 bg-[#005c75] text-white text-sm font-medium rounded-md hover:bg-[#004a5c] focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 transition-colors disabled:bg-gray-300 disabled:cursor-not-allowed flex items-center gap-2 cursor-pointer",children:d?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"animate-spin",children:e.jsx(w,{size:16,style:{strokeWidth:1.5}})}),"Submitting..."]}):m?"Try Again":"Submit Report"})]})]})]})]})}):null}export{B,G as R,w as S};
11
+ */const L=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],w=S("settings",L);function Y(r){return r.scenarioName&&r.entityName?`${r.entityName} → "${r.scenarioName}"`:r.entityName?r.entityName:r.scenarioId?`Scenario: ${r.scenarioId.slice(0,8)}...`:r.entitySha?`Entity: ${r.entitySha.slice(0,8)}...`:"General feedback"}function _({content:r,className:x=""}){const[s,o]=t.useState(!1),i=t.useCallback(()=>{navigator.clipboard.writeText(r).then(()=>{o(!0),setTimeout(()=>o(!1),2e3)}).catch(n=>{console.error("Failed to copy:",n)})},[r]);return e.jsx("button",{onClick:i,className:`cursor-pointer flex items-center gap-1 ${x}`,disabled:s,"aria-label":s?"Copied to clipboard":"Copy to clipboard",children:s?e.jsxs(e.Fragment,{children:[e.jsx(E,{size:14}),"Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(A,{size:14}),"Copy"]})})}function G({isOpen:r,onClose:x,context:s,defaultEmail:o="",screenshotDataUrl:i}){const[n,y]=t.useState(""),[b,I]=t.useState(o),[u,j]=t.useState(!1),[c,f]=t.useState(!1),[M,N]=t.useState(null),[m,h]=t.useState(null),l=T(),d=l.state!=="idle",g=!!(s.scenarioId||s.analysisId),$=s.analysisId||s.scenarioId||"",v=()=>{const a=`/codeyam-diagnose ${$}`;return n.trim()?`${a} ${n.trim()}`:a};if(l.data&&!c&&!m){const a=l.data;a.success&&a.reportId?(f(!0),N(a.reportId)):a.error&&h(a.error)}const D=async()=>{h(null);const a=new FormData;if(a.append("issueType","other"),a.append("description",n),a.append("email",b),a.append("source",s.source),a.append("entitySha",s.entitySha||""),a.append("scenarioId",s.scenarioId||""),a.append("analysisId",s.analysisId||""),a.append("currentUrl",s.currentUrl),a.append("entityName",s.entityName||""),a.append("entityType",s.entityType||""),a.append("scenarioName",s.scenarioName||""),a.append("errorMessage",s.errorMessage||""),i)try{const R=await(await fetch(i)).blob();a.append("screenshot",R,"screenshot.jpg")}catch(C){console.error("Failed to convert screenshot:",C)}l.submit(a,{method:"post",action:"/api/generate-report",encType:"multipart/form-data"})},p=()=>{y(""),j(!1),f(!1),N(null),h(null),x()},z=a=>{a.key==="Escape"&&p()};return r?e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center p-4 z-50",onKeyDown:z,children:e.jsxs("div",{className:"bg-white rounded-lg max-w-lg w-full p-6 shadow-xl max-h-[90vh] overflow-y-auto",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[d?e.jsx("div",{className:"animate-spin",children:e.jsx(w,{size:24,style:{strokeWidth:1.5}})}):c?e.jsx(F,{size:24,style:{color:"#10B981",strokeWidth:1.5}}):e.jsx(B,{size:24,style:{color:"#005C75",strokeWidth:1.5}}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:c?"Report Submitted":"Report Issue"})]}),e.jsx("button",{onClick:p,className:"text-gray-400 hover:text-gray-600 transition-colors cursor-pointer","aria-label":"Close",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),c?e.jsxs("div",{children:[e.jsxs("div",{className:"mb-6 p-4 bg-green-50 rounded-lg border border-green-200",children:[e.jsx("p",{className:"text-sm text-green-800 font-medium mb-1",children:"Thank you for your feedback!"}),e.jsxs("p",{className:"text-xs text-green-700",children:["Report ID:"," ",e.jsx("code",{className:"bg-green-100 px-1 rounded",children:M})]})]}),e.jsx("p",{className:"text-sm text-gray-600 mb-6",children:"The CodeYam team will investigate and may reach out if you provided an email address."}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:p,className:"px-4 py-2 bg-[#005c75] text-white text-sm font-medium rounded-md hover:bg-[#004a5c] transition-colors cursor-pointer",children:"Done"})})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"mb-4 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-sm font-medium text-gray-900",title:`${s.source}${s.entitySha?` • Entity: ${s.entitySha}`:""}${s.scenarioId?` • Scenario: ${s.scenarioId}`:""}${s.analysisId?` • Analysis: ${s.analysisId}`:""}`,children:Y(s)}),e.jsx("button",{type:"button",onClick:()=>j(!u),className:"text-xs text-gray-500 hover:text-gray-700 underline cursor-pointer",children:u?"Hide":"Details"})]}),u&&e.jsxs("div",{className:"mt-2 pt-2 border-t border-gray-200 text-xs text-gray-600 space-y-1 break-all",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"Source:"})," ",s.source]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"URL:"})," ",s.currentUrl]}),s.entitySha&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"Entity:"})," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:s.entitySha})]}),s.scenarioId&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"Scenario:"})," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:s.scenarioId})]}),s.analysisId&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"Analysis:"})," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:s.analysisId})]})]})]}),i&&e.jsxs("div",{className:"mb-4 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[e.jsx("div",{className:"text-xs text-gray-500 mb-2",children:"Screenshot (will be included in report)"}),e.jsx("img",{src:i,alt:"Page screenshot",className:"w-full max-h-[150px] object-contain rounded border border-gray-300"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700 mb-2",children:"What happened?"}),e.jsx("textarea",{id:"description",value:n,onChange:a=>y(a.target.value),placeholder:"Optional: Describe what you expected vs what happened...",rows:3,className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75] resize-none"})]}),g&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-4 p-4 bg-purple-50 rounded-lg border border-purple-200",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("span",{className:"text-lg",children:"🔧"}),e.jsx("h3",{className:"text-sm font-semibold text-purple-900",children:"Diagnose & Fix (Recommended)"})]}),e.jsx("p",{className:"text-xs text-purple-700 mb-3",children:"Run this command in Claude Code to investigate the issue locally and potentially fix it. A detailed report will also be uploaded."}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"bg-gray-800 text-gray-50 px-3 py-2.5 pr-20 rounded-md text-xs font-mono overflow-x-auto whitespace-nowrap",children:v()}),e.jsx(_,{content:v(),className:"absolute top-1.5 right-2 px-2 py-1 bg-purple-600 text-white border-none rounded text-[11px] font-medium hover:bg-purple-700 transition-colors"})]})]}),e.jsxs("div",{className:"relative my-5",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-gray-300"})}),e.jsx("div",{className:"relative flex justify-center",children:e.jsx("span",{className:"bg-white px-3 text-xs text-gray-500 uppercase",children:"or"})})]})]}),e.jsxs("div",{className:g?"opacity-75":"",children:[g&&e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("span",{className:"text-lg",children:"📤"}),e.jsx("h3",{className:"text-sm font-semibold text-gray-700",children:"Quick Report"}),e.jsx("span",{className:"text-xs text-gray-500",children:"(won't investigate locally)"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-2",children:"Your email"}),e.jsx("input",{id:"email",type:"email",value:b,onChange:a=>I(a.target.value),placeholder:"you@example.com",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"})]}),e.jsxs("div",{className:"mb-4 p-3 bg-amber-50 rounded-lg border border-amber-200 flex gap-2",children:[e.jsx(k,{size:16,className:"flex-shrink-0 mt-0.5",style:{color:"#D97706"}}),e.jsxs("div",{className:"text-xs text-amber-800",children:[e.jsx("p",{className:"font-medium mb-1",children:"Source code will be uploaded"}),e.jsx("p",{children:"This report includes your project source code, git history, and CodeYam logs. Only submit if you're comfortable sharing this with the CodeYam team."})]})]}),d&&e.jsx("div",{className:"mb-4 text-center",children:e.jsx("p",{className:"text-sm text-gray-600",children:l.formData?"Uploading report...":"Creating archive..."})}),m&&e.jsxs("div",{className:"mb-4 p-3 bg-red-50 rounded-lg border border-red-200 flex gap-2",children:[e.jsx(k,{size:16,className:"flex-shrink-0 mt-0.5",style:{color:"#DC2626"}}),e.jsxs("div",{className:"text-xs text-red-800",children:[e.jsx("p",{className:"font-medium mb-1",children:"Upload failed"}),e.jsx("p",{children:m})]})]}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx("button",{onClick:p,disabled:d,className:"px-4 py-2 bg-gray-100 text-gray-700 text-sm font-medium rounded-md hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-300 transition-colors disabled:opacity-50 cursor-pointer",children:"Cancel"}),e.jsx("button",{onClick:()=>void D(),disabled:d,className:"px-4 py-2 bg-[#005c75] text-white text-sm font-medium rounded-md hover:bg-[#004a5c] focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 transition-colors disabled:bg-gray-300 disabled:cursor-not-allowed flex items-center gap-2 cursor-pointer",children:d?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"animate-spin",children:e.jsx(w,{size:16,style:{strokeWidth:1.5}})}),"Submitting..."]}):m?"Try Again":"Submit Report"})]})]})]})]})}):null}export{B,G as R,w as S};
@@ -1 +1 @@
1
- import{r as a,j as e}from"./chunk-JZWAC4HX-JE9ZIoBl.js";function j({screenshotPath:l,cacheBuster:o,alt:x,className:f="",title:n}){const[i,s]=a.useState("loading"),[c,r]=a.useState(!1),d=a.useRef(null),u=o?`/api/screenshot/${l}?cb=${o}`:`/api/screenshot/${l}`,m=()=>{s("success"),r(!0)},h=()=>{s("error"),r(!1)};return a.useEffect(()=>{s("loading"),r(!1);const t=d.current;t!=null&&t.complete&&(t.naturalHeight!==0?(s("success"),r(!0)):(s("error"),r(!1)))},[u]),l?e.jsxs("div",{className:"relative w-full h-full flex items-center justify-center",title:n,children:[e.jsx("img",{ref:d,src:u,alt:x,onLoad:m,onError:h,className:f||"max-w-full max-h-full object-contain",style:{visibility:c?"visible":"hidden",position:c?"relative":"absolute"}}),i==="loading"&&e.jsx("div",{className:"absolute inset-0 bg-gray-100 animate-pulse rounded flex items-center justify-center",children:e.jsx("svg",{className:"w-8 h-8 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),i==="error"&&e.jsxs("div",{className:"absolute inset-0 border-2 border-dashed border-gray-300 bg-gray-50 rounded flex flex-col items-center justify-center text-xs gap-1",children:[e.jsx("span",{className:"text-2xl text-gray-400",children:"📷"}),e.jsx("span",{className:"text-gray-400 whitespace-nowrap",children:"No Screenshot"})]})]}):e.jsx("div",{className:"w-full h-full border-2 border-dashed border-gray-300 bg-gray-50 rounded flex flex-col items-center justify-center text-xs gap-1",title:n,children:e.jsx("span",{className:"text-2xl text-gray-400",children:"📷"})})}export{j as S};
1
+ import{r as a,j as e}from"./chunk-JZWAC4HX-DB3aFuEO.js";function j({screenshotPath:l,cacheBuster:o,alt:x,className:f="",title:n}){const[i,s]=a.useState("loading"),[c,r]=a.useState(!1),d=a.useRef(null),u=o?`/api/screenshot/${l}?cb=${o}`:`/api/screenshot/${l}`,m=()=>{s("success"),r(!0)},h=()=>{s("error"),r(!1)};return a.useEffect(()=>{s("loading"),r(!1);const t=d.current;t!=null&&t.complete&&(t.naturalHeight!==0?(s("success"),r(!0)):(s("error"),r(!1)))},[u]),l?e.jsxs("div",{className:"relative w-full h-full flex items-center justify-center",title:n,children:[e.jsx("img",{ref:d,src:u,alt:x,onLoad:m,onError:h,className:f||"max-w-full max-h-full object-contain",style:{visibility:c?"visible":"hidden",position:c?"relative":"absolute"}}),i==="loading"&&e.jsx("div",{className:"absolute inset-0 bg-gray-100 animate-pulse rounded flex items-center justify-center",children:e.jsx("svg",{className:"w-8 h-8 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),i==="error"&&e.jsxs("div",{className:"absolute inset-0 border-2 border-dashed border-gray-300 bg-gray-50 rounded flex flex-col items-center justify-center text-xs gap-1",children:[e.jsx("span",{className:"text-2xl text-gray-400",children:"📷"}),e.jsx("span",{className:"text-gray-400 whitespace-nowrap",children:"No Screenshot"})]})]}):e.jsx("div",{className:"w-full h-full border-2 border-dashed border-gray-300 bg-gray-50 rounded flex flex-col items-center justify-center text-xs gap-1",title:n,children:e.jsx("span",{className:"text-2xl text-gray-400",children:"📷"})})}export{j as S};
@@ -1,8 +1,8 @@
1
- import{r as i,j as e,c as ge,L as ie}from"./chunk-JZWAC4HX-JE9ZIoBl.js";import{I as be}from"./InteractivePreview-BDhPilK7.js";import{u as je,V as we,S as Ne}from"./useCustomSizes-DNwUduNu.js";import{L as J}from"./LogViewer-Bm3PmcCz.js";import{S as ve}from"./SafeScreenshot-Gq3Ocjo6.js";import{u as ke}from"./useLastLogLine-COky1GVF.js";import{u as Ce}from"./InlineSpinner-ClaLpuOo.js";import{_ as ye}from"./preload-helper-ckwbz45p.js";import{R as Ie}from"./ReportIssueModal-C6PKeMYR.js";import{C as Ee,a as Le}from"./copy-6y9ALfGT.js";import{g as Pe}from"./scenarioStatus-B_8jpV3e.js";function $e({presets:s,customSizes:t,currentWidth:n,currentHeight:o,scale:v,onSizeChange:N,onSaveCustomSize:w,onRemoveCustomSize:d,className:k=""}){const[h,x]=i.useState(!1),[g,b]=i.useState(String(n)),[m,j]=i.useState(String(o)),[C,u]=i.useState(!1),[l,R]=i.useState(!1),P=i.useRef(null);i.useEffect(()=>{C||b(String(n))},[n,C]),i.useEffect(()=>{l||j(String(o))},[o,l]),i.useEffect(()=>{const r=f=>{P.current&&!P.current.contains(f.target)&&x(!1)};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[]);const $=i.useMemo(()=>{const r=s.find(c=>c.width===n&&c.height===o);if(r)return r.name;const f=t.find(c=>c.width===n&&c.height===o);return f?f.name:"Custom"},[s,t,n,o]),O=$==="Custom",S=r=>{N(r.width,r.height),x(!1)},W=r=>{const f=r.target.value;b(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&N(c,o)},U=r=>{const f=r.target.value;j(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&N(n,c)},A=()=>{u(!1);const r=parseInt(g,10);(isNaN(r)||r<=0)&&b(String(n))},K=()=>{R(!1);const r=parseInt(m,10);(isNaN(r)||r<=0)&&j(String(o))},D=r=>{(r.key==="Enter"||r.key==="Escape")&&r.target.blur()};return e.jsxs("div",{className:`flex items-center gap-3 ${k}`,children:[e.jsxs("div",{className:"relative",ref:P,children:[e.jsxs("button",{onClick:()=>x(!h),className:"flex items-center gap-2 px-3 py-1.5 bg-white border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 min-w-[120px] justify-between",children:[e.jsx("span",{children:$}),e.jsx("svg",{className:`w-4 h-4 transition-transform ${h?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),h&&e.jsx("div",{className:"absolute top-full left-0 mt-1 min-w-full bg-white border border-gray-200 rounded-md shadow-lg z-50",children:e.jsxs("div",{className:"py-1",children:[s.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Presets"}),s.map(r=>e.jsxs("button",{onClick:()=>S(r),className:`w-full text-left px-3 py-2 text-sm hover:bg-gray-100 flex justify-between items-center gap-4 whitespace-nowrap ${$===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]},r.name))]}),t.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-gray-100 my-1"}),e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Custom"}),[...t].sort((r,f)=>r.width-f.width).map(r=>e.jsxs("div",{className:`flex items-center gap-1 hover:bg-gray-100 ${$===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsxs("button",{onClick:()=>S(r),className:"flex-1 text-left px-3 py-2 text-sm flex justify-between items-center gap-4 whitespace-nowrap cursor-pointer",children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]}),d&&e.jsx("button",{onClick:f=>{f.stopPropagation(),$===r.name&&s.length>0&&N(s[0].width,s[0].height),d(r.name)},className:"p-1.5 mr-1 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded cursor-pointer transition-colors",title:"Remove custom size",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},r.name))]})]})})]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:g,onChange:W,onFocus:()=>u(!0),onBlur:A,onKeyDown:D,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),e.jsx("span",{className:"text-gray-400 mx-1",children:"×"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:m,onChange:U,onFocus:()=>R(!0),onBlur:K,onKeyDown:D,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),v!==void 0&&v<1&&e.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",Math.round(v*100),"%)"]})]}),O&&e.jsx("button",{onClick:w,className:"px-3 py-1.5 bg-[#005c75] text-white text-sm font-medium rounded-md hover:bg-[#004a5c] focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 transition-colors",children:"Save Custom Size"})]})}function de({size:s=24,className:t=""}){return e.jsxs("svg",{width:s,height:s,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",fill:"#ef4444",stroke:"none"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13",stroke:"#FFFFFF",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1",fill:"#FFFFFF"})]})}function _e({scenario:s,analysis:t,entity:n}){var w,d,k;const o=((w=s.metadata)==null?void 0:w.executionResult)||null,v=((k=(d=s.metadata)==null?void 0:d.data)==null?void 0:k.argumentsData)||[],N=h=>{var j,C,u;if(!h)return"No execution results available yet. Run the function to capture side effects including console output, file operations, and API calls.";const x=[],g=((j=h.sideEffects)==null?void 0:j.consoleOutput)||[];g.length>0&&(x.push(`Console Output: ${g.length} log ${g.length===1?"entry":"entries"} captured`),g.forEach(l=>{x.push(` [${l.level.toUpperCase()}] ${l.args.join(" ")}`)}));const b=((C=h.sideEffects)==null?void 0:C.fileWrites)||[];b.length>0&&(x.push(`
1
+ import{r as i,j as e,c as ge,L as ie}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{I as be}from"./InteractivePreview-yjIHlOGa.js";import{u as je,V as we,S as Ne}from"./useCustomSizes-BqgrAzs3.js";import{L as J}from"./LogViewer-kgBTLoJD.js";import{S as ve}from"./SafeScreenshot-CwZrv-Ok.js";import{u as ke}from"./useLastLogLine-DAFqfEDH.js";import{u as Ce}from"./InlineSpinner-EhOseatT.js";import{_ as ye}from"./preload-helper-ckwbz45p.js";import{R as Ie}from"./ReportIssueModal-BzPgx-xO.js";import{C as Ee,a as Le}from"./copy-Coc4o_8c.js";import{g as Pe}from"./scenarioStatus-B_8jpV3e.js";function $e({presets:s,customSizes:t,currentWidth:n,currentHeight:o,scale:v,onSizeChange:N,onSaveCustomSize:w,onRemoveCustomSize:d,className:k=""}){const[h,x]=i.useState(!1),[g,b]=i.useState(String(n)),[m,j]=i.useState(String(o)),[C,u]=i.useState(!1),[l,R]=i.useState(!1),P=i.useRef(null);i.useEffect(()=>{C||b(String(n))},[n,C]),i.useEffect(()=>{l||j(String(o))},[o,l]),i.useEffect(()=>{const r=f=>{P.current&&!P.current.contains(f.target)&&x(!1)};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[]);const $=i.useMemo(()=>{const r=s.find(c=>c.width===n&&c.height===o);if(r)return r.name;const f=t.find(c=>c.width===n&&c.height===o);return f?f.name:"Custom"},[s,t,n,o]),O=$==="Custom",S=r=>{N(r.width,r.height),x(!1)},W=r=>{const f=r.target.value;b(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&N(c,o)},U=r=>{const f=r.target.value;j(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&N(n,c)},A=()=>{u(!1);const r=parseInt(g,10);(isNaN(r)||r<=0)&&b(String(n))},K=()=>{R(!1);const r=parseInt(m,10);(isNaN(r)||r<=0)&&j(String(o))},D=r=>{(r.key==="Enter"||r.key==="Escape")&&r.target.blur()};return e.jsxs("div",{className:`flex items-center gap-3 ${k}`,children:[e.jsxs("div",{className:"relative",ref:P,children:[e.jsxs("button",{onClick:()=>x(!h),className:"flex items-center gap-2 px-3 py-1.5 bg-white border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 min-w-[120px] justify-between",children:[e.jsx("span",{children:$}),e.jsx("svg",{className:`w-4 h-4 transition-transform ${h?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),h&&e.jsx("div",{className:"absolute top-full left-0 mt-1 min-w-full bg-white border border-gray-200 rounded-md shadow-lg z-50",children:e.jsxs("div",{className:"py-1",children:[s.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Presets"}),s.map(r=>e.jsxs("button",{onClick:()=>S(r),className:`w-full text-left px-3 py-2 text-sm hover:bg-gray-100 flex justify-between items-center gap-4 whitespace-nowrap ${$===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]},r.name))]}),t.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-gray-100 my-1"}),e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Custom"}),[...t].sort((r,f)=>r.width-f.width).map(r=>e.jsxs("div",{className:`flex items-center gap-1 hover:bg-gray-100 ${$===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsxs("button",{onClick:()=>S(r),className:"flex-1 text-left px-3 py-2 text-sm flex justify-between items-center gap-4 whitespace-nowrap cursor-pointer",children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]}),d&&e.jsx("button",{onClick:f=>{f.stopPropagation(),$===r.name&&s.length>0&&N(s[0].width,s[0].height),d(r.name)},className:"p-1.5 mr-1 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded cursor-pointer transition-colors",title:"Remove custom size",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},r.name))]})]})})]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:g,onChange:W,onFocus:()=>u(!0),onBlur:A,onKeyDown:D,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),e.jsx("span",{className:"text-gray-400 mx-1",children:"×"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:m,onChange:U,onFocus:()=>R(!0),onBlur:K,onKeyDown:D,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),v!==void 0&&v<1&&e.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",Math.round(v*100),"%)"]})]}),O&&e.jsx("button",{onClick:w,className:"px-3 py-1.5 bg-[#005c75] text-white text-sm font-medium rounded-md hover:bg-[#004a5c] focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 transition-colors",children:"Save Custom Size"})]})}function de({size:s=24,className:t=""}){return e.jsxs("svg",{width:s,height:s,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",fill:"#ef4444",stroke:"none"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13",stroke:"#FFFFFF",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1",fill:"#FFFFFF"})]})}function _e({scenario:s,analysis:t,entity:n}){var w,d,k;const o=((w=s.metadata)==null?void 0:w.executionResult)||null,v=((k=(d=s.metadata)==null?void 0:d.data)==null?void 0:k.argumentsData)||[],N=h=>{var j,C,u;if(!h)return"No execution results available yet. Run the function to capture side effects including console output, file operations, and API calls.";const x=[],g=((j=h.sideEffects)==null?void 0:j.consoleOutput)||[];g.length>0&&(x.push(`Console Output: ${g.length} log ${g.length===1?"entry":"entries"} captured`),g.forEach(l=>{x.push(` [${l.level.toUpperCase()}] ${l.args.join(" ")}`)}));const b=((C=h.sideEffects)==null?void 0:C.fileWrites)||[];b.length>0&&(x.push(`
2
2
  File System Operations: ${b.length} ${b.length===1?"operation":"operations"} detected`),b.forEach(l=>{x.push(` ${l.operation}: ${l.path}${l.size?` (${l.size} bytes)`:""}`)}));const m=((u=h.sideEffects)==null?void 0:u.apiCalls)||[];return m.length>0&&(x.push(`
3
3
  API Calls: ${m.length} ${m.length===1?"call":"calls"} made`),m.forEach(l=>{x.push(` ${l.method} ${l.url}${l.status?` → ${l.status}`:""}${l.duration?` (${l.duration}ms)`:""}`)})),h.error&&x.push(`
4
4
  Error: ${h.error.name||"Error"}: ${h.error.message}`),x.length===0?"No side effects detected. The function executed without console output, file operations, or API calls.":x.join(`
5
- `)};return e.jsxs("div",{className:"flex w-full h-full gap-0",children:[e.jsxs("div",{className:"flex-1 border border-gray-200 bg-white rounded flex flex-col",children:[e.jsx("div",{className:"px-4 pt-3.5 pb-2.5",children:e.jsx("h3",{className:"text-[9px] font-semibold text-[#005c75] uppercase tracking-wide text-center m-0",children:"Input Data"})}),e.jsx("div",{className:"flex-1 overflow-auto px-4 pb-0",children:e.jsx("pre",{className:"text-xs font-mono text-gray-800 whitespace-pre-wrap break-words m-0",children:JSON.stringify(v,null,2)})})]}),e.jsxs("div",{className:"flex-1 border border-gray-200 bg-white rounded flex flex-col ml-[-1px]",children:[e.jsx("div",{className:"px-4 pt-3.5 pb-2.5",children:e.jsx("h3",{className:"text-[9px] font-semibold text-[#005c75] uppercase tracking-wide text-center m-0",children:"Returned Data"})}),e.jsx("div",{className:"flex-1 overflow-auto px-4 pb-0",children:o?e.jsx("pre",{className:"text-xs font-mono text-gray-800 whitespace-pre-wrap break-words m-0",children:o.returnValue!==void 0?JSON.stringify(o.returnValue,null,2):"undefined"}):e.jsx("div",{className:"text-sm text-gray-500 italic",children:"No execution results yet"})})]}),e.jsxs("div",{className:"flex-1 border border-gray-200 bg-white rounded flex flex-col ml-[-1px]",children:[e.jsx("div",{className:"px-4 pt-3.5 pb-2.5",children:e.jsx("h3",{className:"text-[9px] font-semibold text-[#005c75] uppercase tracking-wide text-center m-0",children:"Side Effects"})}),e.jsx("div",{className:"flex-1 overflow-auto px-4 pb-4",children:e.jsx("p",{className:"text-sm text-gray-700 leading-[22px] m-0 whitespace-pre-wrap",children:N(o)})})]})]})}const F={commandBoxBg:"#f6f9fc",commandBoxBorder:"#e1e1e1",commandBoxText:"#005c75",heading:"#000",subtext:"#646464",link:"#005c75"};function T({scenarioId:s,analysisId:t}){const[n,o]=i.useState(!1),[v,N]=i.useState(!1),[w,d]=i.useState(null),[k,h]=i.useState(!1),x=s||t;if(!x)return null;const g=`/codeyam:diagnose ${x}`,b=async()=>{N(!0);try{const{default:j}=await ye(async()=>{const{default:l}=await import("./html2canvas-pro.esm-fmIEn3Bc.js");return{default:l}},[]),u=(await j(document.body,{scale:.5})).toDataURL("image/jpeg",.8);d(u),o(!0)}catch(j){console.error("Screenshot capture failed:",j),o(!0)}finally{N(!1)}},m=()=>{o(!1),d(null)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-center p-6 bg-cywhite-100 rounded-lg border-cygray-30 border",children:[e.jsx("h3",{className:"font-semibold font-['IBM_Plex_Sans']",style:{fontSize:"18px",lineHeight:"26px",color:F.heading},children:"Claude can help debug this error."}),e.jsx("p",{className:"m-0 mb-4 font-['IBM_Plex_Sans']",style:{fontSize:"14px",lineHeight:"18px",color:F.subtext},children:"Simply run this command in Claude Code:"}),e.jsxs("div",{className:"flex items-center justify-between rounded mx-auto mb-3 border",style:{backgroundColor:F.commandBoxBg,borderColor:F.commandBoxBorder,maxWidth:"505px",height:"35px",paddingLeft:"13px",paddingRight:"13px",paddingTop:"6px",paddingBottom:"6px"},children:[e.jsx("code",{className:"font-mono font-['IBM_Plex_Mono'] flex-1 text-left",style:{fontSize:"12px",lineHeight:"20px",color:F.commandBoxText},children:g}),e.jsx("button",{onClick:j=>{j.stopPropagation(),navigator.clipboard.writeText(g),h(!0),setTimeout(()=>h(!1),2e3)},className:"ml-3 cursor-pointer p-0 bg-transparent border-none hover:opacity-80 transition-opacity",style:{width:"14px",height:"14px",color:k?"#22c55e":F.commandBoxText},title:k?"Copied!":"Copy command","aria-label":"Copy command to clipboard",children:k?e.jsx(Ee,{size:14}):e.jsx(Le,{size:14})})]}),e.jsxs("p",{className:"m-0 font-['IBM_Plex_Sans']",style:{fontSize:"12px",lineHeight:"15px",color:"#005c75"},children:["If Claude is unable to address this issue or suggests reporting it,"," ",e.jsx("button",{onClick:()=>void b(),disabled:v,className:"underline cursor-pointer bg-transparent border-none p-0 font-normal hover:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed font-['IBM_Plex_Sans']",style:{fontSize:"12px",lineHeight:"15px",color:F.link},children:v?"capturing...":"please do so here"}),"."]})]}),e.jsx(Ie,{isOpen:n,onClose:m,context:{source:s?"scenario-page":"entity-page",entitySha:void 0,scenarioId:s,analysisId:t,currentUrl:typeof window<"u"?window.location.pathname:"/"},screenshotDataUrl:w??void 0})]})}const ce=1440,H=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1440,height:900}],E={background:"#ffdcd9",border:"#fda4a4",text:"#ef4444",link:"#991b1b"};function Oe({selectedScenario:s,analysis:t,entity:n,viewMode:o,cacheBuster:v,hasScenarios:N,isAnalyzing:w=!1,projectSlug:d,hasAnApiKey:k=!0,processIsRunning:h,queueState:x}){var Q,X,Z,ee,te,se,re,ne,oe,ae,le;const g=ge(),[b,m]=i.useState(!1),[j,C]=i.useState(!1),[u,l]=i.useState({name:"Desktop",width:ce,height:900}),[R,P]=i.useState(ce),[$,O]=i.useState(1),{customSizes:S,addCustomSize:W,removeCustomSize:U}=je(d),A=i.useMemo(()=>[...H,...S],[S]),K=(a,I)=>{P(a);const y=A.find(p=>p.width===a&&p.height===I);l({name:(y==null?void 0:y.name)||"Custom",width:a,height:I})},D=a=>{P(a.width),l({name:a.name,width:a.width,height:a.height})},r=a=>{W(a,u.width,u.height??900),C(!1),l(I=>({...I,name:a}))},f=(a,I)=>{P(a);const y=A.find(p=>p.width===a&&p.height===I);l(p=>({name:(y==null?void 0:y.name)||"Custom",width:a,height:p.height}))},c=(X=(Q=s==null?void 0:s.metadata)==null?void 0:Q.screenshotPaths)==null?void 0:X[0],M=i.useMemo(()=>s?Pe(s,t==null?void 0:t.status,h,n==null?void 0:n.sha,x):null,[s,t==null?void 0:t.status,h,n==null?void 0:n.sha,x]),L=i.useMemo(()=>{var I,y;const a=[];if((I=t==null?void 0:t.status)!=null&&I.errors&&t.status.errors.length>0)for(const p of t.status.errors)a.push({source:`${p.phase} phase`,message:p.message,stack:p.stack});if((y=t==null?void 0:t.status)!=null&&y.steps)for(const p of t.status.steps)p.error&&a.push({source:p.name,message:p.error,stack:p.errorStack});return a},[(Z=t==null?void 0:t.status)==null?void 0:Z.errors,(ee=t==null?void 0:t.status)==null?void 0:ee.steps]),_=(M==null?void 0:M.errorMessage)||null,Y=(M==null?void 0:M.errorStack)||null,{interactiveServerUrl:q,isStarting:G,isLoading:xe,showIframe:me,iframeKey:he,onIframeLoad:ue}=Ce({analysisId:t==null?void 0:t.id,scenarioId:s==null?void 0:s.id,scenarioName:s==null?void 0:s.name,projectSlug:d,enabled:o==="interactive"}),V=i.useMemo(()=>q||null,[q]),z=!w&&N&&s&&!((se=(te=s.metadata)==null?void 0:te.screenshotPaths)!=null&&se[0])&&((ne=(re=t==null?void 0:t.status)==null?void 0:re.scenarios)==null?void 0:ne.some(a=>a.name===s.name&&a.screenshotStartedAt&&!a.screenshotFinishedAt)),{lastLine:B}=ke(d,w||o==="interactive"||z||!1);if(!s){if(w&&n)return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-12 text-center bg-[#f6f9fc]",children:e.jsxs("div",{className:"flex flex-col items-center gap-6 max-w-2xl",children:[e.jsx("div",{className:"w-12 h-12 mb-2",children:e.jsx("svg",{className:"animate-spin",viewBox:"0 0 50 50",children:e.jsx("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:"#005c75",strokeWidth:"4",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})})}),e.jsx("h2",{className:"text-2xl font-semibold text-[#005c75] leading-[30px] m-0 font-['IBM_Plex_Sans']",children:z?"Capturing screenshots...":"Analyzing..."}),e.jsx("p",{className:"text-xs text-[#8e8e8e] text-center leading-5 m-0 font-['IBM_Plex_Mono']",children:"This may take a few minutes."}),B&&e.jsx("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 max-w-xl",children:B}),d&&e.jsx("button",{onClick:()=>m(!0),className:"w-[148px] px-2.5 py-[5px] bg-[#005c75] text-white border-none rounded-sm text-xs font-medium cursor-pointer transition-colors hover:bg-[#004a5c] font-['IBM_Plex_Sans']",children:"View full logs"})]})}),b&&d&&e.jsx(J,{projectSlug:d,onClose:()=>m(!1)})]});if(!N&&n&&!w){if(L.length>0){const a=L.length===1?((oe=L[0])==null?void 0:oe.message)||"An error occurred during analysis.":`${L.length} errors occurred during analysis.`;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-1 flex flex-col justify-center items-center px-5",style:{minHeight:"75vh"},children:e.jsxs("div",{className:"w-full flex flex-col gap-4",style:{maxWidth:"600px"},children:[e.jsx("div",{className:"p-4 rounded",style:{backgroundColor:E.background,border:`2px solid ${E.border}`},role:"alert",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(de,{size:24,className:"shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("p",{className:"m-0 font-['IBM_Plex_Sans']",style:{fontSize:"14px",lineHeight:"20px",color:E.text},children:[e.jsx("span",{className:"font-semibold",children:"Analysis Error."})," ",a," ",e.jsx("button",{onClick:()=>m(!0),className:"underline cursor-pointer bg-transparent border-none p-0 font-medium hover:opacity-80",style:{color:E.link},children:"See logs"})," ","for details."]})})]})}),e.jsx("div",{className:"bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(T,{analysisId:t==null?void 0:t.id})})]})}),b&&d&&e.jsx(J,{projectSlug:d,onClose:()=>m(!1)})]})}return e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center bg-[#f6f9fc]",children:e.jsxs("div",{className:"max-w-[600px]",children:[e.jsx("h2",{className:"text-[28px] font-semibold text-[#343434] mb-4 m-0 leading-10",children:"No simulations yet"}),e.jsx("p",{className:"text-base font-normal text-[#3e3e3e] mb-8 leading-6 m-0",children:"Analyze the code to create simulations and create test scenarios automatically."}),n.filePath&&e.jsx("button",{onClick:()=>{g.submit({entitySha:n.sha,filePath:n.filePath},{method:"post",action:"/api/analyze"})},disabled:g.state!=="idle",className:"h-[54px] w-[183px] px-2.5 py-[5px] bg-[#005c75] text-white border-none rounded-lg text-base font-medium cursor-pointer transition-all hover:bg-[#004a5e] disabled:bg-gray-400 disabled:cursor-not-allowed",children:g.state!=="idle"?"Analyzing...":"Analyze"})]})})}return e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:e.jsx("p",{className:"text-base text-gray-500 m-0",children:"Select a scenario to view its screenshot"})})}const fe=o==="screenshot"&&(c||_)||o==="interactive"&&(V||G)||o==="data",pe=(w||z&&!c)&&!_&&o==="screenshot";return e.jsxs(e.Fragment,{children:[e.jsx("main",{className:"flex-1 overflow-auto flex flex-col min-w-0",style:{backgroundImage:`
5
+ `)};return e.jsxs("div",{className:"flex w-full h-full gap-0",children:[e.jsxs("div",{className:"flex-1 border border-gray-200 bg-white rounded flex flex-col",children:[e.jsx("div",{className:"px-4 pt-3.5 pb-2.5",children:e.jsx("h3",{className:"text-[9px] font-semibold text-[#005c75] uppercase tracking-wide text-center m-0",children:"Input Data"})}),e.jsx("div",{className:"flex-1 overflow-auto px-4 pb-0",children:e.jsx("pre",{className:"text-xs font-mono text-gray-800 whitespace-pre-wrap break-words m-0",children:JSON.stringify(v,null,2)})})]}),e.jsxs("div",{className:"flex-1 border border-gray-200 bg-white rounded flex flex-col ml-[-1px]",children:[e.jsx("div",{className:"px-4 pt-3.5 pb-2.5",children:e.jsx("h3",{className:"text-[9px] font-semibold text-[#005c75] uppercase tracking-wide text-center m-0",children:"Returned Data"})}),e.jsx("div",{className:"flex-1 overflow-auto px-4 pb-0",children:o?e.jsx("pre",{className:"text-xs font-mono text-gray-800 whitespace-pre-wrap break-words m-0",children:o.returnValue!==void 0?JSON.stringify(o.returnValue,null,2):"undefined"}):e.jsx("div",{className:"text-sm text-gray-500 italic",children:"No execution results yet"})})]}),e.jsxs("div",{className:"flex-1 border border-gray-200 bg-white rounded flex flex-col ml-[-1px]",children:[e.jsx("div",{className:"px-4 pt-3.5 pb-2.5",children:e.jsx("h3",{className:"text-[9px] font-semibold text-[#005c75] uppercase tracking-wide text-center m-0",children:"Side Effects"})}),e.jsx("div",{className:"flex-1 overflow-auto px-4 pb-4",children:e.jsx("p",{className:"text-sm text-gray-700 leading-[22px] m-0 whitespace-pre-wrap",children:N(o)})})]})]})}const F={commandBoxBg:"#f6f9fc",commandBoxBorder:"#e1e1e1",commandBoxText:"#005c75",heading:"#000",subtext:"#646464",link:"#005c75"};function T({scenarioId:s,analysisId:t}){const[n,o]=i.useState(!1),[v,N]=i.useState(!1),[w,d]=i.useState(null),[k,h]=i.useState(!1),x=s||t;if(!x)return null;const g=`/codeyam-diagnose ${x}`,b=async()=>{N(!0);try{const{default:j}=await ye(async()=>{const{default:l}=await import("./html2canvas-pro.esm-fmIEn3Bc.js");return{default:l}},[]),u=(await j(document.body,{scale:.5})).toDataURL("image/jpeg",.8);d(u),o(!0)}catch(j){console.error("Screenshot capture failed:",j),o(!0)}finally{N(!1)}},m=()=>{o(!1),d(null)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-center p-6 bg-cywhite-100 rounded-lg border-cygray-30 border",children:[e.jsx("h3",{className:"font-semibold font-['IBM_Plex_Sans']",style:{fontSize:"18px",lineHeight:"26px",color:F.heading},children:"Claude can help debug this error."}),e.jsx("p",{className:"m-0 mb-4 font-['IBM_Plex_Sans']",style:{fontSize:"14px",lineHeight:"18px",color:F.subtext},children:"Simply run this command in Claude Code:"}),e.jsxs("div",{className:"flex items-center justify-between rounded mx-auto mb-3 border",style:{backgroundColor:F.commandBoxBg,borderColor:F.commandBoxBorder,maxWidth:"505px",height:"35px",paddingLeft:"13px",paddingRight:"13px",paddingTop:"6px",paddingBottom:"6px"},children:[e.jsx("code",{className:"font-mono font-['IBM_Plex_Mono'] flex-1 text-left",style:{fontSize:"12px",lineHeight:"20px",color:F.commandBoxText},children:g}),e.jsx("button",{onClick:j=>{j.stopPropagation(),navigator.clipboard.writeText(g),h(!0),setTimeout(()=>h(!1),2e3)},className:"ml-3 cursor-pointer p-0 bg-transparent border-none hover:opacity-80 transition-opacity",style:{width:"14px",height:"14px",color:k?"#22c55e":F.commandBoxText},title:k?"Copied!":"Copy command","aria-label":"Copy command to clipboard",children:k?e.jsx(Ee,{size:14}):e.jsx(Le,{size:14})})]}),e.jsxs("p",{className:"m-0 font-['IBM_Plex_Sans']",style:{fontSize:"12px",lineHeight:"15px",color:"#005c75"},children:["If Claude is unable to address this issue or suggests reporting it,"," ",e.jsx("button",{onClick:()=>void b(),disabled:v,className:"underline cursor-pointer bg-transparent border-none p-0 font-normal hover:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed font-['IBM_Plex_Sans']",style:{fontSize:"12px",lineHeight:"15px",color:F.link},children:v?"capturing...":"please do so here"}),"."]})]}),e.jsx(Ie,{isOpen:n,onClose:m,context:{source:s?"scenario-page":"entity-page",entitySha:void 0,scenarioId:s,analysisId:t,currentUrl:typeof window<"u"?window.location.pathname:"/"},screenshotDataUrl:w??void 0})]})}const ce=1440,H=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1440,height:900}],E={background:"#ffdcd9",border:"#fda4a4",text:"#ef4444",link:"#991b1b"};function Oe({selectedScenario:s,analysis:t,entity:n,viewMode:o,cacheBuster:v,hasScenarios:N,isAnalyzing:w=!1,projectSlug:d,hasAnApiKey:k=!0,processIsRunning:h,queueState:x}){var Q,X,Z,ee,te,se,re,ne,oe,ae,le;const g=ge(),[b,m]=i.useState(!1),[j,C]=i.useState(!1),[u,l]=i.useState({name:"Desktop",width:ce,height:900}),[R,P]=i.useState(ce),[$,O]=i.useState(1),{customSizes:S,addCustomSize:W,removeCustomSize:U}=je(d),A=i.useMemo(()=>[...H,...S],[S]),K=(a,I)=>{P(a);const y=A.find(p=>p.width===a&&p.height===I);l({name:(y==null?void 0:y.name)||"Custom",width:a,height:I})},D=a=>{P(a.width),l({name:a.name,width:a.width,height:a.height})},r=a=>{W(a,u.width,u.height??900),C(!1),l(I=>({...I,name:a}))},f=(a,I)=>{P(a);const y=A.find(p=>p.width===a&&p.height===I);l(p=>({name:(y==null?void 0:y.name)||"Custom",width:a,height:p.height}))},c=(X=(Q=s==null?void 0:s.metadata)==null?void 0:Q.screenshotPaths)==null?void 0:X[0],M=i.useMemo(()=>s?Pe(s,t==null?void 0:t.status,h,n==null?void 0:n.sha,x):null,[s,t==null?void 0:t.status,h,n==null?void 0:n.sha,x]),L=i.useMemo(()=>{var I,y;const a=[];if((I=t==null?void 0:t.status)!=null&&I.errors&&t.status.errors.length>0)for(const p of t.status.errors)a.push({source:`${p.phase} phase`,message:p.message,stack:p.stack});if((y=t==null?void 0:t.status)!=null&&y.steps)for(const p of t.status.steps)p.error&&a.push({source:p.name,message:p.error,stack:p.errorStack});return a},[(Z=t==null?void 0:t.status)==null?void 0:Z.errors,(ee=t==null?void 0:t.status)==null?void 0:ee.steps]),_=(M==null?void 0:M.errorMessage)||null,Y=(M==null?void 0:M.errorStack)||null,{interactiveServerUrl:q,isStarting:G,isLoading:xe,showIframe:me,iframeKey:he,onIframeLoad:ue}=Ce({analysisId:t==null?void 0:t.id,scenarioId:s==null?void 0:s.id,scenarioName:s==null?void 0:s.name,projectSlug:d,enabled:o==="interactive"}),V=i.useMemo(()=>q||null,[q]),z=!w&&N&&s&&!((se=(te=s.metadata)==null?void 0:te.screenshotPaths)!=null&&se[0])&&((ne=(re=t==null?void 0:t.status)==null?void 0:re.scenarios)==null?void 0:ne.some(a=>a.name===s.name&&a.screenshotStartedAt&&!a.screenshotFinishedAt)),{lastLine:B}=ke(d,w||o==="interactive"||z||!1);if(!s){if(w&&n)return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-12 text-center bg-[#f6f9fc]",children:e.jsxs("div",{className:"flex flex-col items-center gap-6 max-w-2xl",children:[e.jsx("div",{className:"w-12 h-12 mb-2",children:e.jsx("svg",{className:"animate-spin",viewBox:"0 0 50 50",children:e.jsx("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:"#005c75",strokeWidth:"4",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})})}),e.jsx("h2",{className:"text-2xl font-semibold text-[#005c75] leading-[30px] m-0 font-['IBM_Plex_Sans']",children:z?"Capturing screenshots...":"Analyzing..."}),e.jsx("p",{className:"text-xs text-[#8e8e8e] text-center leading-5 m-0 font-['IBM_Plex_Mono']",children:"This may take a few minutes."}),B&&e.jsx("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 max-w-xl",children:B}),d&&e.jsx("button",{onClick:()=>m(!0),className:"w-[148px] px-2.5 py-[5px] bg-[#005c75] text-white border-none rounded-sm text-xs font-medium cursor-pointer transition-colors hover:bg-[#004a5c] font-['IBM_Plex_Sans']",children:"View full logs"})]})}),b&&d&&e.jsx(J,{projectSlug:d,onClose:()=>m(!1)})]});if(!N&&n&&!w){if(L.length>0){const a=L.length===1?((oe=L[0])==null?void 0:oe.message)||"An error occurred during analysis.":`${L.length} errors occurred during analysis.`;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-1 flex flex-col justify-center items-center px-5",style:{minHeight:"75vh"},children:e.jsxs("div",{className:"w-full flex flex-col gap-4",style:{maxWidth:"600px"},children:[e.jsx("div",{className:"p-4 rounded",style:{backgroundColor:E.background,border:`2px solid ${E.border}`},role:"alert",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(de,{size:24,className:"shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("p",{className:"m-0 font-['IBM_Plex_Sans']",style:{fontSize:"14px",lineHeight:"20px",color:E.text},children:[e.jsx("span",{className:"font-semibold",children:"Analysis Error."})," ",a," ",e.jsx("button",{onClick:()=>m(!0),className:"underline cursor-pointer bg-transparent border-none p-0 font-medium hover:opacity-80",style:{color:E.link},children:"See logs"})," ","for details."]})})]})}),e.jsx("div",{className:"bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(T,{analysisId:t==null?void 0:t.id})})]})}),b&&d&&e.jsx(J,{projectSlug:d,onClose:()=>m(!1)})]})}return e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center bg-[#f6f9fc]",children:e.jsxs("div",{className:"max-w-[600px]",children:[e.jsx("h2",{className:"text-[28px] font-semibold text-[#343434] mb-4 m-0 leading-10",children:"No simulations yet"}),e.jsx("p",{className:"text-base font-normal text-[#3e3e3e] mb-8 leading-6 m-0",children:"Analyze the code to create simulations and create test scenarios automatically."}),n.filePath&&e.jsx("button",{onClick:()=>{g.submit({entitySha:n.sha,filePath:n.filePath},{method:"post",action:"/api/analyze"})},disabled:g.state!=="idle",className:"h-[54px] w-[183px] px-2.5 py-[5px] bg-[#005c75] text-white border-none rounded-lg text-base font-medium cursor-pointer transition-all hover:bg-[#004a5e] disabled:bg-gray-400 disabled:cursor-not-allowed",children:g.state!=="idle"?"Analyzing...":"Analyze"})]})})}return e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:e.jsx("p",{className:"text-base text-gray-500 m-0",children:"Select a scenario to view its screenshot"})})}const fe=o==="screenshot"&&(c||_)||o==="interactive"&&(V||G)||o==="data",pe=(w||z&&!c)&&!_&&o==="screenshot";return e.jsxs(e.Fragment,{children:[e.jsx("main",{className:"flex-1 overflow-auto flex flex-col min-w-0",style:{backgroundImage:`
6
6
  linear-gradient(45deg, #ebebeb 25%, transparent 25%),
7
7
  linear-gradient(-45deg, #ebebeb 25%, transparent 25%),
8
8
  linear-gradient(45deg, transparent 75%, #ebebeb 75%),
@@ -1 +1 @@
1
- import{j as v}from"./chunk-JZWAC4HX-JE9ZIoBl.js";function O({filePath:n,maxLength:x=60,className:f,style:u}){const o=((t,r)=>{if(t.length<=r)return t;const a="...",c=r-a.length,i=Math.ceil(c*.4),d=Math.floor(c*.6),e=t.slice(0,i),s=t.slice(-d),h=e.lastIndexOf("/"),l=s.indexOf("/"),g=h>i*.5?e.slice(0,h+1):e,m=l!==-1&&l<d*.5?s.slice(l):s;return`${g}${a}${m}`})(n,x),p=o!==n;return v.jsx("span",{className:f||"font-normal text-gray-900 text-[14px] select-text cursor-text",style:{...u,display:"inline-block",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:p?n:void 0,children:o})}export{O as T};
1
+ import{j as v}from"./chunk-JZWAC4HX-DB3aFuEO.js";function O({filePath:n,maxLength:x=60,className:f,style:u}){const o=((t,r)=>{if(t.length<=r)return t;const a="...",c=r-a.length,i=Math.ceil(c*.4),d=Math.floor(c*.6),e=t.slice(0,i),s=t.slice(-d),h=e.lastIndexOf("/"),l=s.indexOf("/"),g=h>i*.5?e.slice(0,h+1):e,m=l!==-1&&l<d*.5?s.slice(l):s;return`${g}${a}${m}`})(n,x),p=o!==n;return v.jsx("span",{className:f||"font-normal text-gray-900 text-[14px] select-text cursor-text",style:{...u,display:"inline-block",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:p?n:void 0,children:o})}export{O as T};
@@ -1,4 +1,4 @@
1
- import{r as u,j as e,L as p,w as se,u as te,c as ae,f as re}from"./chunk-JZWAC4HX-JE9ZIoBl.js";import{u as ne}from"./useLastLogLine-COky1GVF.js";import{u as le}from"./useToast-Bv9JFvUO.js";import{u as oe}from"./useReportContext-CpZgwliL.js";import{L as ie}from"./LogViewer-Bm3PmcCz.js";import{I as E,C as P,E as ce}from"./EntityTypeIcon-BqY8gDAW.js";import{S as Y}from"./SafeScreenshot-Gq3Ocjo6.js";import{g as de}from"./scenarioStatus-B_8jpV3e.js";import{c as q}from"./createLucideIcon-Ca9fAY46.js";import{C as xe}from"./circle-check-CXhHQYrI.js";import{L as S}from"./loader-circle-CTqLEAGU.js";/**
1
+ import{r as u,j as e,L as p,w as se,u as te,c as ae,f as re}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{u as ne}from"./useLastLogLine-DAFqfEDH.js";import{u as le}from"./useToast-ihdMtlf6.js";import{u as oe}from"./useReportContext-DZlYx2c4.js";import{L as ie}from"./LogViewer-kgBTLoJD.js";import{I as E,C as P,E as ce}from"./EntityTypeIcon-BH0XDim7.js";import{S as Y}from"./SafeScreenshot-CwZrv-Ok.js";import{g as de}from"./scenarioStatus-B_8jpV3e.js";import{c as q}from"./createLucideIcon-D1zB-pYc.js";import{C as xe}from"./circle-check-igfMr5DY.js";import{L as S}from"./loader-circle-TzRHMVog.js";/**
2
2
  * @license lucide-react v0.556.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{j as e,w as se,u as te,h as re,r as f,L as b,f as R}from"./chunk-JZWAC4HX-JE9ZIoBl.js";import{L as oe}from"./LogViewer-Bm3PmcCz.js";import{u as ie}from"./useLastLogLine-COky1GVF.js";import{u as le}from"./useReportContext-CpZgwliL.js";import{E as q}from"./EntityTypeIcon-BqY8gDAW.js";import{E as ee}from"./EntityTypeBadge-B5ctlSYt.js";import{S as Z}from"./SafeScreenshot-Gq3Ocjo6.js";import{L as ae}from"./LoadingDots-Bs7Nn1Jr.js";import{L as ne}from"./loader-circle-CTqLEAGU.js";import{P as ce,F as de}from"./pause-D6vreykR.js";import{c as X}from"./createLucideIcon-Ca9fAY46.js";/**
1
+ import{j as e,w as se,u as te,i as re,r as f,L as b,f as R}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{L as oe}from"./LogViewer-kgBTLoJD.js";import{u as ie}from"./useLastLogLine-DAFqfEDH.js";import{u as le}from"./useReportContext-DZlYx2c4.js";import{E as q}from"./EntityTypeIcon-BH0XDim7.js";import{E as ee}from"./EntityTypeBadge-CvzqMxcu.js";import{S as Z}from"./SafeScreenshot-CwZrv-Ok.js";import{L as ae}from"./LoadingDots-BvMu2i-g.js";import{L as ne}from"./loader-circle-TzRHMVog.js";import{P as ce,F as de}from"./pause-hjzB7t2z.js";import{c as X}from"./createLucideIcon-D1zB-pYc.js";/**
2
2
  * @license lucide-react v0.556.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1,17 @@
1
+ import{w as C,u as T,a as E,g as A,r as i,j as e,L as $}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{u as O}from"./useReportContext-DZlYx2c4.js";import{c as v}from"./createLucideIcon-D1zB-pYc.js";import{T as S,C as N}from"./terminal-DbEAHMbA.js";import{S as R}from"./search-DcAwD_Ln.js";import{C as w}from"./chevron-down-CG65viiV.js";import{B as L}from"./book-open-D4IPYH_y.js";import{T as M}from"./triangle-alert-CAD5b1o_.js";/**
2
+ * @license lucide-react v0.556.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const I=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],B=v("arrow-left",I);/**
7
+ * @license lucide-react v0.556.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const F=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],D=v("message-square",F);/**
12
+ * @license lucide-react v0.556.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const V=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],U=v("save",V),oe=()=>[{title:"Agent Transcripts - CodeYam"},{name:"description",content:"View background agent transcripts and tool call history"}];function P(t){if(!t)return"";try{return new Date(t).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return t}}function H(t){if(!t)return"";try{return new Date(t).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})}catch{return t}}function y({type:t,toolName:s}){const a={user_prompt:"bg-[#00b4d8] text-black",assistant_text:"bg-[#a8dadc] text-black",tool_call:"bg-[#f4a261] text-black",tool_result:"bg-[#2a9d8f] text-black",context:"bg-[#7c3aed] text-white"},r={user_prompt:"USER",assistant_text:"ASSISTANT",tool_call:s||"TOOL",tool_result:"RESULT",context:"CONTEXT"};return e.jsx("span",{className:`inline-block px-2 py-0.5 rounded text-[10px] font-bold uppercase tracking-wide ${a[t]||"bg-gray-300 text-black"}`,children:r[t]||t})}function z({input:t}){return e.jsx("div",{className:"text-xs font-mono space-y-1",children:Object.entries(t).map(([s,a])=>{let r=typeof a=="string"?a:JSON.stringify(a);return r.length>500&&(r=r.slice(0,500)+"..."),e.jsxs("div",{children:[e.jsxs("span",{className:"text-[#f4a261] font-bold",children:[s,":"]})," ",e.jsx("span",{className:"text-gray-700",children:r})]},s)})})}function q({content:t,truncated:s,fullLength:a}){const[r,l]=i.useState(!1);return e.jsxs("div",{children:[e.jsxs("pre",{className:"whitespace-pre-wrap break-words text-xs max-h-96 overflow-y-auto text-gray-700",children:[t,s&&!r&&"..."]}),s&&e.jsx("button",{onClick:()=>l(!r),className:"text-[11px] text-gray-500 hover:text-gray-700 mt-1 font-mono cursor-pointer",children:r?"Show less":`Show more (${(a||0)-t.length} more chars)`})]})}function J({entry:t,pairedResult:s}){const[a,r]=i.useState(!1),l=P(t.timestamp||"");return t.type==="user_prompt"?e.jsxs("div",{className:"my-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(y,{type:"user_prompt"}),e.jsx("span",{className:"text-[11px] text-gray-400 font-mono",children:l})]}),e.jsx("pre",{className:"bg-white border border-gray-200 rounded-md p-3 whitespace-pre-wrap break-words text-xs font-mono border-l-[3px] border-l-[#00b4d8] max-h-72 overflow-y-auto text-gray-800",children:t.text})]}):t.type==="assistant_text"?e.jsxs("div",{className:"my-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(y,{type:"assistant_text"}),e.jsx("span",{className:"text-[11px] text-gray-400 font-mono",children:l})]}),e.jsx("div",{className:"bg-white border border-gray-200 rounded-md p-3 whitespace-pre-wrap break-words text-sm border-l-[3px] border-l-[#a8dadc] text-gray-800",children:t.text})]}):t.type==="tool_call"?e.jsxs("div",{className:"my-2",children:[e.jsxs("button",{onClick:()=>r(!a),className:"flex items-center gap-2 w-full text-left bg-white border border-gray-200 rounded-md px-3 py-2 hover:bg-gray-50 cursor-pointer",children:[a?e.jsx(w,{className:"w-3 h-3 text-gray-400 flex-shrink-0"}):e.jsx(N,{className:"w-3 h-3 text-gray-400 flex-shrink-0"}),e.jsx(y,{type:"tool_call",toolName:t.name}),e.jsx("span",{className:"text-xs text-gray-500 font-mono truncate flex-1",children:t.summary||""}),e.jsx("span",{className:"text-[11px] text-gray-400 font-mono flex-shrink-0",children:l})]}),a&&e.jsxs("div",{className:"bg-white border border-t-0 border-gray-200 rounded-b-md px-3 py-2 border-l-[3px] border-l-[#f4a261]",children:[e.jsx(z,{input:t.input||{}}),s&&e.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-200",children:[e.jsxs("div",{className:"text-[11px] font-bold uppercase tracking-wide text-[#2a9d8f] mb-1",children:["Result",s.is_error?" (Error)":"",":"]}),e.jsx(q,{content:s.content||"",truncated:s.truncated,fullLength:s.fullLength})]})]})]}):(t.type==="tool_result",null)}function K({context:t}){const[s,a]=i.useState(!1);return e.jsxs("div",{className:"my-2",children:[e.jsxs("button",{onClick:()=>a(!s),className:"flex items-center gap-2 mb-1 cursor-pointer hover:opacity-80",children:[s?e.jsx(w,{className:"w-3 h-3 text-gray-400"}):e.jsx(N,{className:"w-3 h-3 text-gray-400"}),e.jsx(y,{type:"context"}),e.jsx("span",{className:"text-xs text-gray-500",children:"Full prompt context"})]}),s&&e.jsx("pre",{className:"bg-gray-50 border border-gray-200 rounded-md p-3 whitespace-pre-wrap break-words text-xs font-mono border-l-[3px] border-l-[#7c3aed] max-h-96 overflow-y-auto text-gray-700",children:t})]})}function W({snippet:t}){const[s,a]=i.useState(!1),r=t.split(`
17
+ `).filter(c=>c.trim()),l=r.slice(0,4),m=r.length>4,f=s?r:l;return e.jsxs("div",{className:"my-2 bg-blue-50 border border-blue-200 rounded-md p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(D,{className:"w-3.5 h-3.5 text-blue-600"}),e.jsx("span",{className:"text-xs font-bold text-blue-800",children:"Source Conversation"}),e.jsxs("span",{className:"text-[10px] text-blue-500",children:[r.length," message",r.length!==1?"s":""]})]}),e.jsx("div",{className:"space-y-1",children:f.map((c,p)=>{const x=c.match(/^\[(\w+)\]:\s*(.*)/);if(!x)return null;const[,b,h]=x,u=b==="user";return e.jsxs("div",{className:"text-xs",children:[e.jsxs("span",{className:`font-bold ${u?"text-blue-700":"text-gray-500"}`,children:[u?"User":"Assistant",":"]})," ",e.jsx("span",{className:"text-gray-700",children:h.length>200?h.slice(0,200)+"...":h})]},p)})}),m&&e.jsx("button",{onClick:()=>a(!s),className:"text-[11px] text-blue-600 hover:text-blue-800 mt-2 font-mono cursor-pointer",children:s?"Show less":`Show all ${r.length} messages`})]})}function X({change:t}){const[s,a]=i.useState(!1),r=t.action==="created"?!!t.content:t.action==="modified"?!!(t.oldString||t.newString):!1;return e.jsxs("li",{children:[e.jsx("button",{onClick:()=>r&&a(!s),className:`text-left w-full ${r?"hover:text-green-900 cursor-pointer":""}`,children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[r&&(s?e.jsx(w,{className:"w-3 h-3 inline flex-shrink-0"}):e.jsx(N,{className:"w-3 h-3 inline flex-shrink-0"})),t.action==="created"?"Created":"Modified"," ",t.filePath]})}),s&&t.action==="created"&&t.content&&e.jsx("pre",{className:"mt-1 mb-2 ml-4 p-2 bg-white border border-green-200 rounded text-[11px] text-gray-700 whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:t.content}),s&&t.action==="modified"&&e.jsxs("div",{className:"mt-1 mb-2 ml-4 space-y-1",children:[t.oldString&&e.jsxs("pre",{className:"p-2 bg-red-50 border border-red-200 rounded text-[11px] text-red-800 whitespace-pre-wrap break-words max-h-32 overflow-y-auto",children:["- ",t.oldString]}),t.newString&&e.jsxs("pre",{className:"p-2 bg-green-50 border border-green-300 rounded text-[11px] text-green-800 whitespace-pre-wrap break-words max-h-32 overflow-y-auto",children:["+ ",t.newString]})]})]})}function Y({changes:t}){const s=t.filter(r=>r.action==="touched"),a=t.filter(r=>r.action!=="touched");return e.jsxs("div",{className:"my-2 bg-green-50 border border-green-200 rounded-md p-3",children:[e.jsx("div",{className:"text-xs font-bold text-green-800 mb-1",children:"Rule Changes:"}),e.jsxs("ul",{className:"text-xs text-green-700 space-y-0.5 font-mono",children:[a.map((r,l)=>e.jsx(X,{change:r},l)),s.length>0&&e.jsxs("li",{children:["Touched timestamps on ",s.length," rule",s.length!==1?"s":""]})]})]})}function G({agent:t,defaultOpen:s,isAdmin:a}){const[r,l]=i.useState(s),[m,f]=i.useState(!1),[c,p]=i.useState(null),x=i.useMemo(()=>{const o={};for(const n of t.entries)n.type==="tool_result"&&n.tool_use_id&&(o[n.tool_use_id]=n);return o},[t.entries]),b=i.useMemo(()=>{const o=new Set;for(const n of t.entries)n.type==="tool_call"&&n.tool_use_id&&x[n.tool_use_id]&&o.add(n.tool_use_id);return o},[t.entries,x]),h=o=>{o.stopPropagation(),f(!0),p(null),fetch("/api/save-fixture",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:t.id})}).then(n=>n.json()).then(n=>{n.success?p(`Saved to ${n.fixturePath}`):p(`Error: ${n.error}`)}).catch(n=>{p(`Error: ${n instanceof Error?n.message:String(n)}`)}).finally(()=>{f(!1)})},u=(t.ruleChanges||[]).filter(o=>o.action!=="touched"),j=(t.ruleChanges||[]).filter(o=>o.action==="touched"),g=u.length>0,d=j.length>0,k=g||d;return e.jsxs("div",{className:`bg-white border rounded-lg overflow-hidden mb-4 ${g?"border-green-300":"border-gray-200"}`,children:[e.jsxs("button",{onClick:()=>l(!r),className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-gray-50 cursor-pointer",children:[r?e.jsx(w,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}):e.jsx(N,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),e.jsx("span",{className:"text-sm font-bold text-[#005C75] font-mono",children:t.id.slice(0,8)}),t.slug&&e.jsx("span",{className:"text-xs text-gray-500",children:t.slug}),g&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-800",children:[e.jsx(L,{className:"w-3 h-3"}),u.length===1?"1 rule changed":`${u.length} rules changed`]}),!g&&d&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold bg-gray-100 text-gray-500",children:[j.length," timestamp",j.length!==1?"s":""," ","touched"]}),t.hasConfusion&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold bg-amber-100 text-amber-800",children:[e.jsx(M,{className:"w-3 h-3"}),"Confusion Detected"]}),e.jsxs("span",{className:"text-[11px] text-gray-400 font-mono",children:[t.stats.toolCalls," tool calls, ",t.stats.textBlocks," text blocks"]}),e.jsxs("span",{className:"text-[11px] text-gray-400 font-mono ml-auto flex items-center gap-2",children:[H(t.timestamp),a&&g&&e.jsxs("button",{onClick:h,disabled:m,className:"inline-flex items-center gap-1 px-2 py-1 rounded text-[10px] font-bold bg-gray-100 text-gray-600 hover:bg-gray-200 disabled:opacity-50 cursor-pointer",title:"Save as test fixture",children:[e.jsx(U,{className:"w-3 h-3"}),m?"Saving...":"Save Fixture"]})]})]}),c&&e.jsx("div",{className:`px-4 py-2 text-xs font-mono ${c.startsWith("Error")?"bg-red-50 text-red-700":"bg-green-50 text-green-700"}`,children:c}),r&&e.jsxs("div",{className:"px-4 pb-4 border-t border-gray-100",children:[t.conversationSnippet&&e.jsx(W,{snippet:t.conversationSnippet}),k&&e.jsx(Y,{changes:t.ruleChanges}),t.context&&e.jsx(K,{context:t.context}),t.entries.map((o,n)=>{if(o.type==="tool_result"&&o.tool_use_id&&b.has(o.tool_use_id))return null;const _=o.type==="tool_call"&&o.tool_use_id?x[o.tool_use_id]:void 0;return e.jsx(J,{entry:o,pairedResult:_},`${t.id}-${n}`)})]})]})}const le=C(function(){const{agents:s,error:a,search:r}=T(),l=E(),m=A("root"),f=(m==null?void 0:m.isAdmin)??!1,[c,p]=i.useState(r),[x,b]=i.useState(!1),[h,u]=i.useState(0);O({source:"agent-transcripts-page"});const j=d=>{d.preventDefault(),window.location.href=`/agent-transcripts${c?`?search=${encodeURIComponent(c)}`:""}`},g=()=>{b(!x),u(d=>d+1)};return a?e.jsx("div",{className:"bg-[#F8F7F6] min-h-screen",children:e.jsxs("div",{className:"px-12 py-6 font-sans",children:[e.jsx("h1",{className:"text-[28px] font-semibold text-gray-900",children:"Error"}),e.jsx("p",{className:"text-base text-gray-500",children:a})]})}):e.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:e.jsxs("div",{className:"px-20 py-12 font-sans",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[e.jsx("button",{onClick:()=>{l("/memory")},className:"text-gray-600 hover:text-[#005C75] transition-colors cursor-pointer",title:"Back to Memory","aria-label":"Back to Memory",children:e.jsx(B,{className:"w-5 h-5"})}),e.jsx(S,{className:"w-6 h-6 text-[#232323]"}),e.jsx("h1",{className:"text-[24px] font-semibold mb-0",style:{fontFamily:"Sora",color:"#232323"},children:"Agent Transcripts"})]}),e.jsx("p",{className:"text-[15px] text-gray-500 ml-14",children:"View background agent transcripts and tool call history"})]}),e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsxs("form",{onSubmit:j,className:"relative flex-1 max-w-md",children:[e.jsx(R,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx("input",{type:"text",value:c,onChange:d=>p(d.target.value),placeholder:"Search transcripts...",className:"w-full pl-10 pr-4 py-2 border border-gray-200 rounded-md bg-white focus:outline-none focus:ring-2 focus:ring-[#005C75] focus:border-transparent text-sm"})]}),e.jsx("button",{onClick:g,className:"text-xs text-[#005C75] hover:underline cursor-pointer font-mono uppercase font-semibold",children:x?"Collapse All":"Expand All"})]}),e.jsxs("div",{className:"text-sm text-gray-500 mb-4",children:[s.length," agent",s.length!==1?"s":""," found",r&&e.jsxs("span",{children:[" ","matching “",r,"”",e.jsx($,{to:"/agent-transcripts",className:"text-[#005C75] hover:underline ml-2",children:"Clear"})]})]}),s.length===0?e.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-12 text-center",children:[e.jsx(S,{className:"w-12 h-12 text-gray-300 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No Agent Transcripts Found"}),e.jsx("p",{className:"text-gray-500",children:"Background agent output files will appear here when available."})]}):e.jsx("div",{children:s.map(d=>e.jsx(G,{agent:d,defaultOpen:x,isAdmin:f},d.id))},h)]})})});export{le as default,oe as meta};
@@ -1,4 +1,4 @@
1
- import{c as o}from"./createLucideIcon-Ca9fAY46.js";/**
1
+ import{c as o}from"./createLucideIcon-D1zB-pYc.js";/**
2
2
  * @license lucide-react v0.556.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./createLucideIcon-Ca9fAY46.js";/**
1
+ import{c as o}from"./createLucideIcon-D1zB-pYc.js";/**
2
2
  * @license lucide-react v0.556.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.