yepanywhere 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (635) hide show
  1. package/bundled/@yep-anywhere/shared/dist/app-types.d.ts +229 -0
  2. package/bundled/@yep-anywhere/shared/dist/app-types.d.ts.map +1 -0
  3. package/bundled/@yep-anywhere/shared/dist/app-types.js +46 -0
  4. package/bundled/@yep-anywhere/shared/dist/app-types.js.map +1 -0
  5. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/DocumentContentSchema.d.ts +16 -0
  6. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/DocumentContentSchema.d.ts.map +1 -0
  7. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/DocumentContentSchema.js +17 -0
  8. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/DocumentContentSchema.js.map +1 -0
  9. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ImageContentSchema.d.ts +15 -0
  10. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ImageContentSchema.d.ts.map +1 -0
  11. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ImageContentSchema.js +10 -0
  12. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ImageContentSchema.js.map +1 -0
  13. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/TextContentSchema.d.ts +6 -0
  14. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/TextContentSchema.d.ts.map +1 -0
  15. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/TextContentSchema.js +6 -0
  16. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/TextContentSchema.js.map +1 -0
  17. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ThinkingContentSchema.d.ts +7 -0
  18. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ThinkingContentSchema.d.ts.map +1 -0
  19. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ThinkingContentSchema.js +7 -0
  20. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ThinkingContentSchema.js.map +1 -0
  21. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolResultContentSchema.d.ts +24 -0
  22. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolResultContentSchema.d.ts.map +1 -0
  23. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolResultContentSchema.js +13 -0
  24. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolResultContentSchema.js.map +1 -0
  25. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolUseContentSchema.d.ts +8 -0
  26. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolUseContentSchema.d.ts.map +1 -0
  27. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolUseContentSchema.js +8 -0
  28. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolUseContentSchema.js.map +1 -0
  29. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/AssistantEntrySchema.d.ts +78 -0
  30. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/AssistantEntrySchema.d.ts.map +1 -0
  31. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/AssistantEntrySchema.js +13 -0
  32. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/AssistantEntrySchema.js.map +1 -0
  33. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/BaseEntrySchema.d.ts +18 -0
  34. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/BaseEntrySchema.d.ts.map +1 -0
  35. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/BaseEntrySchema.js +19 -0
  36. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/BaseEntrySchema.js.map +1 -0
  37. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/FileHistorySnapshotEntrySchema.d.ts +13 -0
  38. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/FileHistorySnapshotEntrySchema.d.ts.map +1 -0
  39. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/FileHistorySnapshotEntrySchema.js +14 -0
  40. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/FileHistorySnapshotEntrySchema.js.map +1 -0
  41. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/QueueOperationEntrySchema.d.ts +68 -0
  42. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/QueueOperationEntrySchema.d.ts.map +1 -0
  43. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/QueueOperationEntrySchema.js +37 -0
  44. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/QueueOperationEntrySchema.js.map +1 -0
  45. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SummaryEntrySchema.d.ts +8 -0
  46. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SummaryEntrySchema.d.ts.map +1 -0
  47. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SummaryEntrySchema.js +7 -0
  48. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SummaryEntrySchema.js.map +1 -0
  49. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.d.ts +52 -0
  50. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.d.ts.map +1 -0
  51. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.js +29 -0
  52. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.js.map +1 -0
  53. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/UserEntrySchema.d.ts +72 -0
  54. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/UserEntrySchema.d.ts.map +1 -0
  55. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/UserEntrySchema.js +10 -0
  56. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/UserEntrySchema.js.map +1 -0
  57. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/normalizeQueueOperationContent.d.ts +14 -0
  58. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/normalizeQueueOperationContent.d.ts.map +1 -0
  59. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/normalizeQueueOperationContent.js +39 -0
  60. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/normalizeQueueOperationContent.js.map +1 -0
  61. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/guards.d.ts +15 -0
  62. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/guards.d.ts.map +1 -0
  63. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/guards.js +26 -0
  64. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/guards.js.map +1 -0
  65. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/index.d.ts +566 -0
  66. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/index.d.ts.map +1 -0
  67. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/index.js +39 -0
  68. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/index.js.map +1 -0
  69. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/AssistantMessageSchema.d.ts +93 -0
  70. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/AssistantMessageSchema.d.ts.map +1 -0
  71. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/AssistantMessageSchema.js +40 -0
  72. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/AssistantMessageSchema.js.map +1 -0
  73. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/UserMessageSchema.d.ts +105 -0
  74. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/UserMessageSchema.d.ts.map +1 -0
  75. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/UserMessageSchema.js +20 -0
  76. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/UserMessageSchema.js.map +1 -0
  77. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/CommonToolSchema.d.ts +53 -0
  78. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/CommonToolSchema.d.ts.map +1 -0
  79. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/CommonToolSchema.js +54 -0
  80. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/CommonToolSchema.js.map +1 -0
  81. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/StructuredPatchSchema.d.ts +9 -0
  82. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/StructuredPatchSchema.d.ts.map +1 -0
  83. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/StructuredPatchSchema.js +9 -0
  84. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/StructuredPatchSchema.js.map +1 -0
  85. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/TodoSchema.d.ts +32 -0
  86. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/TodoSchema.d.ts.map +1 -0
  87. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/TodoSchema.js +12 -0
  88. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/TodoSchema.js.map +1 -0
  89. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/ToolResultSchemas.d.ts +288 -0
  90. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/ToolResultSchemas.d.ts.map +1 -0
  91. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/ToolResultSchemas.js +293 -0
  92. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/ToolResultSchemas.js.map +1 -0
  93. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/index.d.ts +83 -0
  94. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/index.d.ts.map +1 -0
  95. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/index.js +10 -0
  96. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/index.js.map +1 -0
  97. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/types.d.ts +42 -0
  98. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/types.d.ts.map +1 -0
  99. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/types.js +11 -0
  100. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/types.js.map +1 -0
  101. package/bundled/@yep-anywhere/shared/dist/codex-schema/content.d.ts +99 -0
  102. package/bundled/@yep-anywhere/shared/dist/codex-schema/content.d.ts.map +1 -0
  103. package/bundled/@yep-anywhere/shared/dist/codex-schema/content.js +64 -0
  104. package/bundled/@yep-anywhere/shared/dist/codex-schema/content.js.map +1 -0
  105. package/bundled/@yep-anywhere/shared/dist/codex-schema/index.d.ts +17 -0
  106. package/bundled/@yep-anywhere/shared/dist/codex-schema/index.d.ts.map +1 -0
  107. package/bundled/@yep-anywhere/shared/dist/codex-schema/index.js +17 -0
  108. package/bundled/@yep-anywhere/shared/dist/codex-schema/index.js.map +1 -0
  109. package/bundled/@yep-anywhere/shared/dist/codex-schema/session.d.ts +600 -0
  110. package/bundled/@yep-anywhere/shared/dist/codex-schema/session.d.ts.map +1 -0
  111. package/bundled/@yep-anywhere/shared/dist/codex-schema/session.js +282 -0
  112. package/bundled/@yep-anywhere/shared/dist/codex-schema/session.js.map +1 -0
  113. package/bundled/@yep-anywhere/shared/dist/codex-schema/types.d.ts +7 -0
  114. package/bundled/@yep-anywhere/shared/dist/codex-schema/types.d.ts.map +1 -0
  115. package/bundled/@yep-anywhere/shared/dist/codex-schema/types.js +6 -0
  116. package/bundled/@yep-anywhere/shared/dist/codex-schema/types.js.map +1 -0
  117. package/bundled/@yep-anywhere/shared/dist/dag.d.ts +35 -0
  118. package/bundled/@yep-anywhere/shared/dist/dag.d.ts.map +1 -0
  119. package/bundled/@yep-anywhere/shared/dist/dag.js +75 -0
  120. package/bundled/@yep-anywhere/shared/dist/dag.js.map +1 -0
  121. package/bundled/@yep-anywhere/shared/dist/filePathDetection.d.ts +72 -0
  122. package/bundled/@yep-anywhere/shared/dist/filePathDetection.d.ts.map +1 -0
  123. package/bundled/@yep-anywhere/shared/dist/filePathDetection.js +376 -0
  124. package/bundled/@yep-anywhere/shared/dist/filePathDetection.js.map +1 -0
  125. package/bundled/@yep-anywhere/shared/dist/gemini-schema/content.d.ts +95 -0
  126. package/bundled/@yep-anywhere/shared/dist/gemini-schema/content.d.ts.map +1 -0
  127. package/bundled/@yep-anywhere/shared/dist/gemini-schema/content.js +57 -0
  128. package/bundled/@yep-anywhere/shared/dist/gemini-schema/content.js.map +1 -0
  129. package/bundled/@yep-anywhere/shared/dist/gemini-schema/events.d.ts +174 -0
  130. package/bundled/@yep-anywhere/shared/dist/gemini-schema/events.d.ts.map +1 -0
  131. package/bundled/@yep-anywhere/shared/dist/gemini-schema/events.js +117 -0
  132. package/bundled/@yep-anywhere/shared/dist/gemini-schema/events.js.map +1 -0
  133. package/bundled/@yep-anywhere/shared/dist/gemini-schema/index.d.ts +18 -0
  134. package/bundled/@yep-anywhere/shared/dist/gemini-schema/index.d.ts.map +1 -0
  135. package/bundled/@yep-anywhere/shared/dist/gemini-schema/index.js +18 -0
  136. package/bundled/@yep-anywhere/shared/dist/gemini-schema/index.js.map +1 -0
  137. package/bundled/@yep-anywhere/shared/dist/gemini-schema/session.d.ts +267 -0
  138. package/bundled/@yep-anywhere/shared/dist/gemini-schema/session.d.ts.map +1 -0
  139. package/bundled/@yep-anywhere/shared/dist/gemini-schema/session.js +147 -0
  140. package/bundled/@yep-anywhere/shared/dist/gemini-schema/session.js.map +1 -0
  141. package/bundled/@yep-anywhere/shared/dist/gemini-schema/types.d.ts +7 -0
  142. package/bundled/@yep-anywhere/shared/dist/gemini-schema/types.d.ts.map +1 -0
  143. package/bundled/@yep-anywhere/shared/dist/gemini-schema/types.js +6 -0
  144. package/bundled/@yep-anywhere/shared/dist/gemini-schema/types.js.map +1 -0
  145. package/bundled/@yep-anywhere/shared/dist/ideMetadata.d.ts +30 -0
  146. package/bundled/@yep-anywhere/shared/dist/ideMetadata.d.ts.map +1 -0
  147. package/bundled/@yep-anywhere/shared/dist/ideMetadata.js +58 -0
  148. package/bundled/@yep-anywhere/shared/dist/ideMetadata.js.map +1 -0
  149. package/bundled/@yep-anywhere/shared/dist/index.d.ts +24 -0
  150. package/bundled/@yep-anywhere/shared/dist/index.d.ts.map +1 -0
  151. package/bundled/@yep-anywhere/shared/dist/index.js +17 -0
  152. package/bundled/@yep-anywhere/shared/dist/index.js.map +1 -0
  153. package/bundled/@yep-anywhere/shared/dist/opencode-schema/events.d.ts +457 -0
  154. package/bundled/@yep-anywhere/shared/dist/opencode-schema/events.d.ts.map +1 -0
  155. package/bundled/@yep-anywhere/shared/dist/opencode-schema/events.js +217 -0
  156. package/bundled/@yep-anywhere/shared/dist/opencode-schema/events.js.map +1 -0
  157. package/bundled/@yep-anywhere/shared/dist/opencode-schema/index.d.ts +23 -0
  158. package/bundled/@yep-anywhere/shared/dist/opencode-schema/index.d.ts.map +1 -0
  159. package/bundled/@yep-anywhere/shared/dist/opencode-schema/index.js +23 -0
  160. package/bundled/@yep-anywhere/shared/dist/opencode-schema/index.js.map +1 -0
  161. package/bundled/@yep-anywhere/shared/dist/opencode-schema/session.d.ts +149 -0
  162. package/bundled/@yep-anywhere/shared/dist/opencode-schema/session.d.ts.map +1 -0
  163. package/bundled/@yep-anywhere/shared/dist/opencode-schema/session.js +158 -0
  164. package/bundled/@yep-anywhere/shared/dist/opencode-schema/session.js.map +1 -0
  165. package/bundled/@yep-anywhere/shared/dist/opencode-schema/types.d.ts +7 -0
  166. package/bundled/@yep-anywhere/shared/dist/opencode-schema/types.d.ts.map +1 -0
  167. package/bundled/@yep-anywhere/shared/dist/opencode-schema/types.js +6 -0
  168. package/bundled/@yep-anywhere/shared/dist/opencode-schema/types.js.map +1 -0
  169. package/bundled/@yep-anywhere/shared/dist/projectId.d.ts +48 -0
  170. package/bundled/@yep-anywhere/shared/dist/projectId.d.ts.map +1 -0
  171. package/bundled/@yep-anywhere/shared/dist/projectId.js +74 -0
  172. package/bundled/@yep-anywhere/shared/dist/projectId.js.map +1 -0
  173. package/bundled/@yep-anywhere/shared/dist/session/SessionView.d.ts +171 -0
  174. package/bundled/@yep-anywhere/shared/dist/session/SessionView.d.ts.map +1 -0
  175. package/bundled/@yep-anywhere/shared/dist/session/SessionView.js +189 -0
  176. package/bundled/@yep-anywhere/shared/dist/session/SessionView.js.map +1 -0
  177. package/bundled/@yep-anywhere/shared/dist/session/UnifiedSession.d.ts +31 -0
  178. package/bundled/@yep-anywhere/shared/dist/session/UnifiedSession.d.ts.map +1 -0
  179. package/bundled/@yep-anywhere/shared/dist/session/UnifiedSession.js +2 -0
  180. package/bundled/@yep-anywhere/shared/dist/session/UnifiedSession.js.map +1 -0
  181. package/bundled/@yep-anywhere/shared/dist/session/index.d.ts +3 -0
  182. package/bundled/@yep-anywhere/shared/dist/session/index.d.ts.map +1 -0
  183. package/bundled/@yep-anywhere/shared/dist/session/index.js +2 -0
  184. package/bundled/@yep-anywhere/shared/dist/session/index.js.map +1 -0
  185. package/bundled/@yep-anywhere/shared/dist/types.d.ts +172 -0
  186. package/bundled/@yep-anywhere/shared/dist/types.d.ts.map +1 -0
  187. package/bundled/@yep-anywhere/shared/dist/types.js +33 -0
  188. package/bundled/@yep-anywhere/shared/dist/types.js.map +1 -0
  189. package/bundled/@yep-anywhere/shared/dist/upload.d.ts +58 -0
  190. package/bundled/@yep-anywhere/shared/dist/upload.d.ts.map +1 -0
  191. package/bundled/@yep-anywhere/shared/dist/upload.js +6 -0
  192. package/bundled/@yep-anywhere/shared/dist/upload.js.map +1 -0
  193. package/bundled/@yep-anywhere/shared/package.json +7 -0
  194. package/client-dist/assets/index-C7DeAWG4.css +1 -0
  195. package/client-dist/assets/index-yX0HPwrz.js +147 -0
  196. package/client-dist/badge-96.png +0 -0
  197. package/client-dist/badge.svg +20 -0
  198. package/client-dist/debug-streaming.html +746 -0
  199. package/client-dist/favicon.ico +0 -0
  200. package/client-dist/icon-192.png +0 -0
  201. package/client-dist/icon-512.png +0 -0
  202. package/client-dist/icon.svg +27 -0
  203. package/client-dist/index.html +35 -0
  204. package/client-dist/manifest.json +23 -0
  205. package/client-dist/sw.js +482 -0
  206. package/dist/app.d.ts +67 -0
  207. package/dist/app.d.ts.map +1 -0
  208. package/dist/app.js +236 -0
  209. package/dist/app.js.map +1 -0
  210. package/dist/augments/augment-generator.d.ts +30 -0
  211. package/dist/augments/augment-generator.d.ts.map +1 -0
  212. package/dist/augments/augment-generator.js +171 -0
  213. package/dist/augments/augment-generator.js.map +1 -0
  214. package/dist/augments/block-detector.d.ts +81 -0
  215. package/dist/augments/block-detector.d.ts.map +1 -0
  216. package/dist/augments/block-detector.js +615 -0
  217. package/dist/augments/block-detector.js.map +1 -0
  218. package/dist/augments/edit-augments.d.ts +138 -0
  219. package/dist/augments/edit-augments.d.ts.map +1 -0
  220. package/dist/augments/edit-augments.js +665 -0
  221. package/dist/augments/edit-augments.js.map +1 -0
  222. package/dist/augments/index.d.ts +14 -0
  223. package/dist/augments/index.d.ts.map +1 -0
  224. package/dist/augments/index.js +20 -0
  225. package/dist/augments/index.js.map +1 -0
  226. package/dist/augments/markdown-augments.d.ts +33 -0
  227. package/dist/augments/markdown-augments.d.ts.map +1 -0
  228. package/dist/augments/markdown-augments.js +128 -0
  229. package/dist/augments/markdown-augments.js.map +1 -0
  230. package/dist/augments/read-augments.d.ts +40 -0
  231. package/dist/augments/read-augments.d.ts.map +1 -0
  232. package/dist/augments/read-augments.js +64 -0
  233. package/dist/augments/read-augments.js.map +1 -0
  234. package/dist/augments/stream-coordinator.d.ts +32 -0
  235. package/dist/augments/stream-coordinator.d.ts.map +1 -0
  236. package/dist/augments/stream-coordinator.js +115 -0
  237. package/dist/augments/stream-coordinator.js.map +1 -0
  238. package/dist/augments/write-augments.d.ts +32 -0
  239. package/dist/augments/write-augments.d.ts.map +1 -0
  240. package/dist/augments/write-augments.js +27 -0
  241. package/dist/augments/write-augments.js.map +1 -0
  242. package/dist/auth/AuthService.d.ts +98 -0
  243. package/dist/auth/AuthService.d.ts.map +1 -0
  244. package/dist/auth/AuthService.js +217 -0
  245. package/dist/auth/AuthService.js.map +1 -0
  246. package/dist/auth/index.d.ts +3 -0
  247. package/dist/auth/index.d.ts.map +1 -0
  248. package/dist/auth/index.js +3 -0
  249. package/dist/auth/index.js.map +1 -0
  250. package/dist/auth/routes.d.ts +13 -0
  251. package/dist/auth/routes.d.ts.map +1 -0
  252. package/dist/auth/routes.js +149 -0
  253. package/dist/auth/routes.js.map +1 -0
  254. package/dist/cli.d.ts +19 -0
  255. package/dist/cli.d.ts.map +1 -0
  256. package/dist/cli.js +152 -0
  257. package/dist/cli.js.map +1 -0
  258. package/dist/config.d.ts +76 -0
  259. package/dist/config.d.ts.map +1 -0
  260. package/dist/config.js +124 -0
  261. package/dist/config.js.map +1 -0
  262. package/dist/dev-mock.d.ts +18 -0
  263. package/dist/dev-mock.d.ts.map +1 -0
  264. package/dist/dev-mock.js +260 -0
  265. package/dist/dev-mock.js.map +1 -0
  266. package/dist/frontend/index.d.ts +10 -0
  267. package/dist/frontend/index.d.ts.map +1 -0
  268. package/dist/frontend/index.js +10 -0
  269. package/dist/frontend/index.js.map +1 -0
  270. package/dist/frontend/proxy.d.ts +70 -0
  271. package/dist/frontend/proxy.d.ts.map +1 -0
  272. package/dist/frontend/proxy.js +329 -0
  273. package/dist/frontend/proxy.js.map +1 -0
  274. package/dist/frontend/static.d.ts +16 -0
  275. package/dist/frontend/static.d.ts.map +1 -0
  276. package/dist/frontend/static.js +106 -0
  277. package/dist/frontend/static.js.map +1 -0
  278. package/dist/highlighting/index.d.ts +43 -0
  279. package/dist/highlighting/index.d.ts.map +1 -0
  280. package/dist/highlighting/index.js +224 -0
  281. package/dist/highlighting/index.js.map +1 -0
  282. package/dist/index.d.ts +2 -0
  283. package/dist/index.d.ts.map +1 -0
  284. package/dist/index.js +259 -0
  285. package/dist/index.js.map +1 -0
  286. package/dist/indexes/SessionIndexService.d.ts +106 -0
  287. package/dist/indexes/SessionIndexService.d.ts.map +1 -0
  288. package/dist/indexes/SessionIndexService.js +356 -0
  289. package/dist/indexes/SessionIndexService.js.map +1 -0
  290. package/dist/indexes/index.d.ts +3 -0
  291. package/dist/indexes/index.d.ts.map +1 -0
  292. package/dist/indexes/index.js +2 -0
  293. package/dist/indexes/index.js.map +1 -0
  294. package/dist/indexes/types.d.ts +55 -0
  295. package/dist/indexes/types.d.ts.map +1 -0
  296. package/dist/indexes/types.js +8 -0
  297. package/dist/indexes/types.js.map +1 -0
  298. package/dist/logging/index.d.ts +2 -0
  299. package/dist/logging/index.d.ts.map +1 -0
  300. package/dist/logging/index.js +2 -0
  301. package/dist/logging/index.js.map +1 -0
  302. package/dist/logging/logger.d.ts +81 -0
  303. package/dist/logging/logger.d.ts.map +1 -0
  304. package/dist/logging/logger.js +257 -0
  305. package/dist/logging/logger.js.map +1 -0
  306. package/dist/maintenance/debug-routes.d.ts +39 -0
  307. package/dist/maintenance/debug-routes.d.ts.map +1 -0
  308. package/dist/maintenance/debug-routes.js +561 -0
  309. package/dist/maintenance/debug-routes.js.map +1 -0
  310. package/dist/maintenance/index.d.ts +3 -0
  311. package/dist/maintenance/index.d.ts.map +1 -0
  312. package/dist/maintenance/index.js +3 -0
  313. package/dist/maintenance/index.js.map +1 -0
  314. package/dist/maintenance/server.d.ts +53 -0
  315. package/dist/maintenance/server.d.ts.map +1 -0
  316. package/dist/maintenance/server.js +419 -0
  317. package/dist/maintenance/server.js.map +1 -0
  318. package/dist/metadata/SessionMetadataService.d.ts +96 -0
  319. package/dist/metadata/SessionMetadataService.d.ts.map +1 -0
  320. package/dist/metadata/SessionMetadataService.js +209 -0
  321. package/dist/metadata/SessionMetadataService.js.map +1 -0
  322. package/dist/metadata/index.d.ts +2 -0
  323. package/dist/metadata/index.d.ts.map +1 -0
  324. package/dist/metadata/index.js +2 -0
  325. package/dist/metadata/index.js.map +1 -0
  326. package/dist/middleware/auth.d.ts +18 -0
  327. package/dist/middleware/auth.d.ts.map +1 -0
  328. package/dist/middleware/auth.js +53 -0
  329. package/dist/middleware/auth.js.map +1 -0
  330. package/dist/middleware/security.d.ts +4 -0
  331. package/dist/middleware/security.d.ts.map +1 -0
  332. package/dist/middleware/security.js +28 -0
  333. package/dist/middleware/security.js.map +1 -0
  334. package/dist/notifications/NotificationService.d.ts +76 -0
  335. package/dist/notifications/NotificationService.d.ts.map +1 -0
  336. package/dist/notifications/NotificationService.js +155 -0
  337. package/dist/notifications/NotificationService.js.map +1 -0
  338. package/dist/notifications/index.d.ts +2 -0
  339. package/dist/notifications/index.d.ts.map +1 -0
  340. package/dist/notifications/index.js +2 -0
  341. package/dist/notifications/index.js.map +1 -0
  342. package/dist/projects/codex-scanner.d.ts +52 -0
  343. package/dist/projects/codex-scanner.d.ts.map +1 -0
  344. package/dist/projects/codex-scanner.js +167 -0
  345. package/dist/projects/codex-scanner.js.map +1 -0
  346. package/dist/projects/gemini-project-map.d.ts +54 -0
  347. package/dist/projects/gemini-project-map.d.ts.map +1 -0
  348. package/dist/projects/gemini-project-map.js +116 -0
  349. package/dist/projects/gemini-project-map.js.map +1 -0
  350. package/dist/projects/gemini-scanner.d.ts +58 -0
  351. package/dist/projects/gemini-scanner.d.ts.map +1 -0
  352. package/dist/projects/gemini-scanner.js +210 -0
  353. package/dist/projects/gemini-scanner.js.map +1 -0
  354. package/dist/projects/index.d.ts +16 -0
  355. package/dist/projects/index.d.ts.map +1 -0
  356. package/dist/projects/index.js +17 -0
  357. package/dist/projects/index.js.map +1 -0
  358. package/dist/projects/paths.d.ts +127 -0
  359. package/dist/projects/paths.d.ts.map +1 -0
  360. package/dist/projects/paths.js +185 -0
  361. package/dist/projects/paths.js.map +1 -0
  362. package/dist/projects/scanner.d.ts +45 -0
  363. package/dist/projects/scanner.d.ts.map +1 -0
  364. package/dist/projects/scanner.js +287 -0
  365. package/dist/projects/scanner.js.map +1 -0
  366. package/dist/push/PushNotifier.d.ts +48 -0
  367. package/dist/push/PushNotifier.d.ts.map +1 -0
  368. package/dist/push/PushNotifier.js +145 -0
  369. package/dist/push/PushNotifier.js.map +1 -0
  370. package/dist/push/PushService.d.ts +95 -0
  371. package/dist/push/PushService.d.ts.map +1 -0
  372. package/dist/push/PushService.js +245 -0
  373. package/dist/push/PushService.js.map +1 -0
  374. package/dist/push/index.d.ts +9 -0
  375. package/dist/push/index.d.ts.map +1 -0
  376. package/dist/push/index.js +8 -0
  377. package/dist/push/index.js.map +1 -0
  378. package/dist/push/routes.d.ts +10 -0
  379. package/dist/push/routes.d.ts.map +1 -0
  380. package/dist/push/routes.js +111 -0
  381. package/dist/push/routes.js.map +1 -0
  382. package/dist/push/types.d.ts +80 -0
  383. package/dist/push/types.d.ts.map +1 -0
  384. package/dist/push/types.js +5 -0
  385. package/dist/push/types.js.map +1 -0
  386. package/dist/push/vapid.d.ts +42 -0
  387. package/dist/push/vapid.d.ts.map +1 -0
  388. package/dist/push/vapid.js +132 -0
  389. package/dist/push/vapid.js.map +1 -0
  390. package/dist/recents/RecentsService.d.ts +77 -0
  391. package/dist/recents/RecentsService.d.ts.map +1 -0
  392. package/dist/recents/RecentsService.js +155 -0
  393. package/dist/recents/RecentsService.js.map +1 -0
  394. package/dist/recents/index.d.ts +2 -0
  395. package/dist/recents/index.d.ts.map +1 -0
  396. package/dist/recents/index.js +2 -0
  397. package/dist/recents/index.js.map +1 -0
  398. package/dist/routes/activity.d.ts +7 -0
  399. package/dist/routes/activity.d.ts.map +1 -0
  400. package/dist/routes/activity.js +80 -0
  401. package/dist/routes/activity.js.map +1 -0
  402. package/dist/routes/beads.d.ts +42 -0
  403. package/dist/routes/beads.d.ts.map +1 -0
  404. package/dist/routes/beads.js +101 -0
  405. package/dist/routes/beads.js.map +1 -0
  406. package/dist/routes/debug-streaming.d.ts +7 -0
  407. package/dist/routes/debug-streaming.d.ts.map +1 -0
  408. package/dist/routes/debug-streaming.js +88 -0
  409. package/dist/routes/debug-streaming.js.map +1 -0
  410. package/dist/routes/dev.d.ts +11 -0
  411. package/dist/routes/dev.d.ts.map +1 -0
  412. package/dist/routes/dev.js +55 -0
  413. package/dist/routes/dev.js.map +1 -0
  414. package/dist/routes/files.d.ts +7 -0
  415. package/dist/routes/files.d.ts.map +1 -0
  416. package/dist/routes/files.js +429 -0
  417. package/dist/routes/files.js.map +1 -0
  418. package/dist/routes/global-sessions.d.ts +76 -0
  419. package/dist/routes/global-sessions.d.ts.map +1 -0
  420. package/dist/routes/global-sessions.js +207 -0
  421. package/dist/routes/global-sessions.js.map +1 -0
  422. package/dist/routes/health.d.ts +3 -0
  423. package/dist/routes/health.d.ts.map +1 -0
  424. package/dist/routes/health.js +6 -0
  425. package/dist/routes/health.js.map +1 -0
  426. package/dist/routes/inbox.d.ts +45 -0
  427. package/dist/routes/inbox.d.ts.map +1 -0
  428. package/dist/routes/inbox.js +174 -0
  429. package/dist/routes/inbox.js.map +1 -0
  430. package/dist/routes/processes.d.ts +16 -0
  431. package/dist/routes/processes.d.ts.map +1 -0
  432. package/dist/routes/processes.js +82 -0
  433. package/dist/routes/processes.js.map +1 -0
  434. package/dist/routes/projects.d.ts +30 -0
  435. package/dist/routes/projects.d.ts.map +1 -0
  436. package/dist/routes/projects.js +316 -0
  437. package/dist/routes/projects.js.map +1 -0
  438. package/dist/routes/providers.d.ts +9 -0
  439. package/dist/routes/providers.d.ts.map +1 -0
  440. package/dist/routes/providers.js +63 -0
  441. package/dist/routes/providers.js.map +1 -0
  442. package/dist/routes/recents.d.ts +14 -0
  443. package/dist/routes/recents.d.ts.map +1 -0
  444. package/dist/routes/recents.js +82 -0
  445. package/dist/routes/recents.js.map +1 -0
  446. package/dist/routes/sessions.d.ts +26 -0
  447. package/dist/routes/sessions.d.ts.map +1 -0
  448. package/dist/routes/sessions.js +962 -0
  449. package/dist/routes/sessions.js.map +1 -0
  450. package/dist/routes/stream.d.ts +7 -0
  451. package/dist/routes/stream.d.ts.map +1 -0
  452. package/dist/routes/stream.js +561 -0
  453. package/dist/routes/stream.js.map +1 -0
  454. package/dist/routes/upload.d.ts +14 -0
  455. package/dist/routes/upload.d.ts.map +1 -0
  456. package/dist/routes/upload.js +278 -0
  457. package/dist/routes/upload.js.map +1 -0
  458. package/dist/sdk/cli-detection.d.ts +47 -0
  459. package/dist/sdk/cli-detection.d.ts.map +1 -0
  460. package/dist/sdk/cli-detection.js +122 -0
  461. package/dist/sdk/cli-detection.js.map +1 -0
  462. package/dist/sdk/messageLogger.d.ts +15 -0
  463. package/dist/sdk/messageLogger.d.ts.map +1 -0
  464. package/dist/sdk/messageLogger.js +68 -0
  465. package/dist/sdk/messageLogger.js.map +1 -0
  466. package/dist/sdk/messageQueue.d.ts +49 -0
  467. package/dist/sdk/messageQueue.d.ts.map +1 -0
  468. package/dist/sdk/messageQueue.js +186 -0
  469. package/dist/sdk/messageQueue.js.map +1 -0
  470. package/dist/sdk/mock.d.ts +16 -0
  471. package/dist/sdk/mock.d.ts.map +1 -0
  472. package/dist/sdk/mock.js +81 -0
  473. package/dist/sdk/mock.js.map +1 -0
  474. package/dist/sdk/providers/__mocks__/base.d.ts +78 -0
  475. package/dist/sdk/providers/__mocks__/base.d.ts.map +1 -0
  476. package/dist/sdk/providers/__mocks__/base.js +185 -0
  477. package/dist/sdk/providers/__mocks__/base.js.map +1 -0
  478. package/dist/sdk/providers/__mocks__/claude.d.ts +33 -0
  479. package/dist/sdk/providers/__mocks__/claude.d.ts.map +1 -0
  480. package/dist/sdk/providers/__mocks__/claude.js +146 -0
  481. package/dist/sdk/providers/__mocks__/claude.js.map +1 -0
  482. package/dist/sdk/providers/__mocks__/codex.d.ts +45 -0
  483. package/dist/sdk/providers/__mocks__/codex.d.ts.map +1 -0
  484. package/dist/sdk/providers/__mocks__/codex.js +160 -0
  485. package/dist/sdk/providers/__mocks__/codex.js.map +1 -0
  486. package/dist/sdk/providers/__mocks__/factory.d.ts +40 -0
  487. package/dist/sdk/providers/__mocks__/factory.d.ts.map +1 -0
  488. package/dist/sdk/providers/__mocks__/factory.js +183 -0
  489. package/dist/sdk/providers/__mocks__/factory.js.map +1 -0
  490. package/dist/sdk/providers/__mocks__/gemini.d.ts +43 -0
  491. package/dist/sdk/providers/__mocks__/gemini.d.ts.map +1 -0
  492. package/dist/sdk/providers/__mocks__/gemini.js +198 -0
  493. package/dist/sdk/providers/__mocks__/gemini.js.map +1 -0
  494. package/dist/sdk/providers/__mocks__/index.d.ts +23 -0
  495. package/dist/sdk/providers/__mocks__/index.d.ts.map +1 -0
  496. package/dist/sdk/providers/__mocks__/index.js +25 -0
  497. package/dist/sdk/providers/__mocks__/index.js.map +1 -0
  498. package/dist/sdk/providers/__mocks__/opencode.d.ts +33 -0
  499. package/dist/sdk/providers/__mocks__/opencode.d.ts.map +1 -0
  500. package/dist/sdk/providers/__mocks__/opencode.js +136 -0
  501. package/dist/sdk/providers/__mocks__/opencode.js.map +1 -0
  502. package/dist/sdk/providers/__mocks__/types.d.ts +50 -0
  503. package/dist/sdk/providers/__mocks__/types.d.ts.map +1 -0
  504. package/dist/sdk/providers/__mocks__/types.js +8 -0
  505. package/dist/sdk/providers/__mocks__/types.js.map +1 -0
  506. package/dist/sdk/providers/claude.d.ts +63 -0
  507. package/dist/sdk/providers/claude.d.ts.map +1 -0
  508. package/dist/sdk/providers/claude.js +252 -0
  509. package/dist/sdk/providers/claude.js.map +1 -0
  510. package/dist/sdk/providers/codex-oss.d.ts +108 -0
  511. package/dist/sdk/providers/codex-oss.d.ts.map +1 -0
  512. package/dist/sdk/providers/codex-oss.js +744 -0
  513. package/dist/sdk/providers/codex-oss.js.map +1 -0
  514. package/dist/sdk/providers/codex.d.ts +82 -0
  515. package/dist/sdk/providers/codex.d.ts.map +1 -0
  516. package/dist/sdk/providers/codex.js +597 -0
  517. package/dist/sdk/providers/codex.js.map +1 -0
  518. package/dist/sdk/providers/gemini.d.ts +78 -0
  519. package/dist/sdk/providers/gemini.d.ts.map +1 -0
  520. package/dist/sdk/providers/gemini.js +536 -0
  521. package/dist/sdk/providers/gemini.js.map +1 -0
  522. package/dist/sdk/providers/index.d.ts +22 -0
  523. package/dist/sdk/providers/index.d.ts.map +1 -0
  524. package/dist/sdk/providers/index.js +53 -0
  525. package/dist/sdk/providers/index.js.map +1 -0
  526. package/dist/sdk/providers/opencode.d.ts +95 -0
  527. package/dist/sdk/providers/opencode.d.ts.map +1 -0
  528. package/dist/sdk/providers/opencode.js +586 -0
  529. package/dist/sdk/providers/opencode.js.map +1 -0
  530. package/dist/sdk/providers/types.d.ts +99 -0
  531. package/dist/sdk/providers/types.d.ts.map +1 -0
  532. package/dist/sdk/providers/types.js +2 -0
  533. package/dist/sdk/providers/types.js.map +1 -0
  534. package/dist/sdk/real.d.ts +20 -0
  535. package/dist/sdk/real.d.ts.map +1 -0
  536. package/dist/sdk/real.js +22 -0
  537. package/dist/sdk/real.js.map +1 -0
  538. package/dist/sdk/types.d.ts +113 -0
  539. package/dist/sdk/types.d.ts.map +1 -0
  540. package/dist/sdk/types.js +3 -0
  541. package/dist/sdk/types.js.map +1 -0
  542. package/dist/sessions/Session.d.ts +80 -0
  543. package/dist/sessions/Session.d.ts.map +1 -0
  544. package/dist/sessions/Session.js +119 -0
  545. package/dist/sessions/Session.js.map +1 -0
  546. package/dist/sessions/codex-reader.d.ts +166 -0
  547. package/dist/sessions/codex-reader.d.ts.map +1 -0
  548. package/dist/sessions/codex-reader.js +664 -0
  549. package/dist/sessions/codex-reader.js.map +1 -0
  550. package/dist/sessions/dag.d.ts +62 -0
  551. package/dist/sessions/dag.d.ts.map +1 -0
  552. package/dist/sessions/dag.js +175 -0
  553. package/dist/sessions/dag.js.map +1 -0
  554. package/dist/sessions/fork.d.ts +34 -0
  555. package/dist/sessions/fork.d.ts.map +1 -0
  556. package/dist/sessions/fork.js +58 -0
  557. package/dist/sessions/fork.js.map +1 -0
  558. package/dist/sessions/gemini-reader.d.ts +103 -0
  559. package/dist/sessions/gemini-reader.d.ts.map +1 -0
  560. package/dist/sessions/gemini-reader.js +332 -0
  561. package/dist/sessions/gemini-reader.js.map +1 -0
  562. package/dist/sessions/normalization.d.ts +7 -0
  563. package/dist/sessions/normalization.d.ts.map +1 -0
  564. package/dist/sessions/normalization.js +429 -0
  565. package/dist/sessions/normalization.js.map +1 -0
  566. package/dist/sessions/opencode-reader.d.ts +99 -0
  567. package/dist/sessions/opencode-reader.d.ts.map +1 -0
  568. package/dist/sessions/opencode-reader.js +370 -0
  569. package/dist/sessions/opencode-reader.js.map +1 -0
  570. package/dist/sessions/reader.d.ts +118 -0
  571. package/dist/sessions/reader.d.ts.map +1 -0
  572. package/dist/sessions/reader.js +444 -0
  573. package/dist/sessions/reader.js.map +1 -0
  574. package/dist/sessions/types.d.ts +77 -0
  575. package/dist/sessions/types.d.ts.map +1 -0
  576. package/dist/sessions/types.js +8 -0
  577. package/dist/sessions/types.js.map +1 -0
  578. package/dist/supervisor/ExternalSessionTracker.d.ts +94 -0
  579. package/dist/supervisor/ExternalSessionTracker.d.ts.map +1 -0
  580. package/dist/supervisor/ExternalSessionTracker.js +507 -0
  581. package/dist/supervisor/ExternalSessionTracker.js.map +1 -0
  582. package/dist/supervisor/Process.d.ts +230 -0
  583. package/dist/supervisor/Process.d.ts.map +1 -0
  584. package/dist/supervisor/Process.js +878 -0
  585. package/dist/supervisor/Process.js.map +1 -0
  586. package/dist/supervisor/Supervisor.d.ts +191 -0
  587. package/dist/supervisor/Supervisor.d.ts.map +1 -0
  588. package/dist/supervisor/Supervisor.js +933 -0
  589. package/dist/supervisor/Supervisor.js.map +1 -0
  590. package/dist/supervisor/WorkerQueue.d.ts +113 -0
  591. package/dist/supervisor/WorkerQueue.d.ts.map +1 -0
  592. package/dist/supervisor/WorkerQueue.js +148 -0
  593. package/dist/supervisor/WorkerQueue.js.map +1 -0
  594. package/dist/supervisor/types.d.ts +176 -0
  595. package/dist/supervisor/types.d.ts.map +1 -0
  596. package/dist/supervisor/types.js +7 -0
  597. package/dist/supervisor/types.js.map +1 -0
  598. package/dist/testing/mockProjectData.d.ts +5 -0
  599. package/dist/testing/mockProjectData.d.ts.map +1 -0
  600. package/dist/testing/mockProjectData.js +27 -0
  601. package/dist/testing/mockProjectData.js.map +1 -0
  602. package/dist/uploads/index.d.ts +3 -0
  603. package/dist/uploads/index.d.ts.map +1 -0
  604. package/dist/uploads/index.js +2 -0
  605. package/dist/uploads/index.js.map +1 -0
  606. package/dist/uploads/manager.d.ts +84 -0
  607. package/dist/uploads/manager.d.ts.map +1 -0
  608. package/dist/uploads/manager.js +215 -0
  609. package/dist/uploads/manager.js.map +1 -0
  610. package/dist/utils/fileLock.d.ts +57 -0
  611. package/dist/utils/fileLock.d.ts.map +1 -0
  612. package/dist/utils/fileLock.js +91 -0
  613. package/dist/utils/fileLock.js.map +1 -0
  614. package/dist/watcher/BatchProcessor.d.ts +58 -0
  615. package/dist/watcher/BatchProcessor.d.ts.map +1 -0
  616. package/dist/watcher/BatchProcessor.js +105 -0
  617. package/dist/watcher/BatchProcessor.js.map +1 -0
  618. package/dist/watcher/EventBus.d.ts +157 -0
  619. package/dist/watcher/EventBus.d.ts.map +1 -0
  620. package/dist/watcher/EventBus.js +36 -0
  621. package/dist/watcher/EventBus.js.map +1 -0
  622. package/dist/watcher/FileWatcher.d.ts +42 -0
  623. package/dist/watcher/FileWatcher.d.ts.map +1 -0
  624. package/dist/watcher/FileWatcher.js +165 -0
  625. package/dist/watcher/FileWatcher.js.map +1 -0
  626. package/dist/watcher/SourceWatcher.d.ts +36 -0
  627. package/dist/watcher/SourceWatcher.d.ts.map +1 -0
  628. package/dist/watcher/SourceWatcher.js +97 -0
  629. package/dist/watcher/SourceWatcher.js.map +1 -0
  630. package/dist/watcher/index.d.ts +9 -0
  631. package/dist/watcher/index.d.ts.map +1 -0
  632. package/dist/watcher/index.js +5 -0
  633. package/dist/watcher/index.js.map +1 -0
  634. package/package.json +54 -0
  635. package/scripts/postinstall.js +48 -0
@@ -0,0 +1,665 @@
1
+ /**
2
+ * Edit augment service - computes structuredPatch and highlighted diff HTML
3
+ * for Edit tool_use blocks.
4
+ *
5
+ * This enables consistent unified diff display for both pending (tool_use)
6
+ * and completed (tool_result) edits.
7
+ */
8
+ import { diffWordsWithSpace, structuredPatch } from "diff";
9
+ import { getLanguageForPath, highlightCode } from "../highlighting/index.js";
10
+ /** Number of context lines to include in the diff */
11
+ const CONTEXT_LINES = 3;
12
+ /**
13
+ * Convert jsdiff patch hunks to our PatchHunk format.
14
+ * jsdiff hunks have the same structure but we need to add line prefixes.
15
+ */
16
+ function convertHunks(hunks) {
17
+ return hunks.map((hunk) => ({
18
+ oldStart: hunk.oldStart,
19
+ oldLines: hunk.oldLines,
20
+ newStart: hunk.newStart,
21
+ newLines: hunk.newLines,
22
+ // Filter out "" - not useful for UI display
23
+ lines: hunk.lines.filter((line) => line !== "\"),
24
+ }));
25
+ }
26
+ /**
27
+ * Convert structured patch hunks to unified diff text for highlighting.
28
+ */
29
+ function patchToUnifiedText(hunks) {
30
+ const lines = [];
31
+ for (const hunk of hunks) {
32
+ // Add hunk header
33
+ lines.push(`@@ -${hunk.oldStart},${hunk.oldLines} +${hunk.newStart},${hunk.newLines} @@`);
34
+ // Add diff lines (already prefixed with ' ', '-', or '+')
35
+ lines.push(...hunk.lines);
36
+ }
37
+ return lines.join("\n");
38
+ }
39
+ /**
40
+ * Extract the inner content of each <span class="line">...</span> from Shiki HTML.
41
+ * Handles nested spans by counting depth.
42
+ */
43
+ function extractShikiLines(html) {
44
+ const lines = [];
45
+ const lineStartRegex = /<span class="line">/g;
46
+ let match = lineStartRegex.exec(html);
47
+ while (match !== null) {
48
+ const startPos = match.index + match[0].length;
49
+ let depth = 1;
50
+ let pos = startPos;
51
+ // Find the matching closing </span> by tracking nesting depth
52
+ while (depth > 0 && pos < html.length) {
53
+ const nextOpen = html.indexOf("<span", pos);
54
+ const nextClose = html.indexOf("</span>", pos);
55
+ if (nextClose === -1)
56
+ break;
57
+ if (nextOpen !== -1 && nextOpen < nextClose) {
58
+ depth++;
59
+ pos = nextOpen + 5; // Move past "<span"
60
+ }
61
+ else {
62
+ depth--;
63
+ if (depth === 0) {
64
+ lines.push(html.slice(startPos, nextClose));
65
+ }
66
+ pos = nextClose + 7; // Move past "</span>"
67
+ }
68
+ }
69
+ match = lineStartRegex.exec(html);
70
+ }
71
+ return lines;
72
+ }
73
+ /**
74
+ * Pre-compute word diffs for replacement pairs in a hunk.
75
+ * Returns maps from line indices to word diffs.
76
+ */
77
+ function computeHunkWordDiffs(hunk, hunkOldStartIdx, // Starting index in oldLines for this hunk
78
+ hunkNewStartIdx) {
79
+ const oldLineDiffs = new Map();
80
+ const newLineDiffs = new Map();
81
+ // Find replacement pairs in this hunk
82
+ const { pairs } = findReplacePairs(hunk.lines);
83
+ // For each pair, compute word diff and store by absolute line index
84
+ // We need to map the pair's relative indices back to the oldLines/newLines arrays
85
+ // Track how many - and + lines we've seen to compute absolute indices
86
+ let oldOffset = 0;
87
+ let newOffset = 0;
88
+ let currentRemovals = [];
89
+ let currentAdditions = [];
90
+ const flushPairs = () => {
91
+ const pairCount = Math.min(currentRemovals.length, currentAdditions.length);
92
+ for (let i = 0; i < pairCount; i++) {
93
+ const removal = currentRemovals[i];
94
+ const addition = currentAdditions[i];
95
+ if (removal && addition) {
96
+ const wordDiff = computeWordDiff(removal.text, addition.text);
97
+ // Only add if there are actual changes (not all unchanged)
98
+ const hasChanges = wordDiff.some((seg) => seg.type === "removed" || seg.type === "added");
99
+ if (hasChanges) {
100
+ oldLineDiffs.set(removal.absIdx, wordDiff);
101
+ newLineDiffs.set(addition.absIdx, wordDiff);
102
+ }
103
+ }
104
+ }
105
+ currentRemovals = [];
106
+ currentAdditions = [];
107
+ };
108
+ for (const line of hunk.lines) {
109
+ const prefix = line[0];
110
+ const text = line.slice(1);
111
+ if (prefix === "-") {
112
+ // If we were collecting additions, flush first
113
+ if (currentAdditions.length > 0) {
114
+ flushPairs();
115
+ }
116
+ currentRemovals.push({
117
+ absIdx: hunkOldStartIdx + oldOffset,
118
+ text,
119
+ });
120
+ oldOffset++;
121
+ }
122
+ else if (prefix === "+") {
123
+ currentAdditions.push({
124
+ absIdx: hunkNewStartIdx + newOffset,
125
+ text,
126
+ });
127
+ newOffset++;
128
+ }
129
+ else if (prefix === " ") {
130
+ flushPairs();
131
+ oldOffset++;
132
+ newOffset++;
133
+ }
134
+ else if (line.startsWith("@@")) {
135
+ flushPairs();
136
+ }
137
+ }
138
+ // Flush any remaining pairs
139
+ flushPairs();
140
+ return { oldLineDiffs, newLineDiffs };
141
+ }
142
+ /**
143
+ * Build syntax-highlighted diff HTML by highlighting old_string and new_string
144
+ * separately with the file's language, then reconstructing the diff.
145
+ *
146
+ * @returns Highlighted HTML or null if language is unknown/unsupported
147
+ */
148
+ async function highlightDiffWithSyntax(oldString, newString, hunks, filePath) {
149
+ // Detect language from file extension
150
+ const lang = getLanguageForPath(filePath);
151
+ if (!lang)
152
+ return null;
153
+ // Highlight both strings with the file's language
154
+ // Handle empty strings - highlightCode returns null for empty input
155
+ const oldResult = oldString.length > 0 ? await highlightCode(oldString, lang) : null;
156
+ const newResult = newString.length > 0 ? await highlightCode(newString, lang) : null;
157
+ // If both fail (not just empty), fall back
158
+ if (!oldResult && oldString.length > 0)
159
+ return null;
160
+ if (!newResult && newString.length > 0)
161
+ return null;
162
+ // Extract lines from Shiki HTML
163
+ const oldLines = oldResult ? extractShikiLines(oldResult.html) : [];
164
+ const newLines = newResult ? extractShikiLines(newResult.html) : [];
165
+ // Pre-compute word diffs for all hunks
166
+ const allOldLineDiffs = new Map();
167
+ const allNewLineDiffs = new Map();
168
+ for (const hunk of hunks) {
169
+ const hunkOldStartIdx = hunk.oldStart - 1; // Convert to 0-indexed
170
+ const hunkNewStartIdx = hunk.newStart - 1;
171
+ const { oldLineDiffs, newLineDiffs } = computeHunkWordDiffs(hunk, hunkOldStartIdx, hunkNewStartIdx);
172
+ // Merge into global maps
173
+ for (const [idx, diff] of oldLineDiffs) {
174
+ allOldLineDiffs.set(idx, diff);
175
+ }
176
+ for (const [idx, diff] of newLineDiffs) {
177
+ allNewLineDiffs.set(idx, diff);
178
+ }
179
+ }
180
+ // Build diff HTML by mapping hunk lines to highlighted source lines
181
+ const resultLines = [];
182
+ for (const hunk of hunks) {
183
+ // Add hunk header (hidden by CSS but needed for tests)
184
+ resultLines.push(`<span class="line line-hunk">@@ -${hunk.oldStart},${hunk.oldLines} +${hunk.newStart},${hunk.newLines} @@</span>`);
185
+ let oldIdx = hunk.oldStart - 1; // 0-indexed
186
+ let newIdx = hunk.newStart - 1;
187
+ for (const line of hunk.lines) {
188
+ const prefix = line[0];
189
+ let lineClass;
190
+ let content;
191
+ if (prefix === " ") {
192
+ // Context line - use old (identical in both)
193
+ lineClass = "line line-context";
194
+ content = oldLines[oldIdx++] ?? "";
195
+ newIdx++;
196
+ }
197
+ else if (prefix === "-") {
198
+ // Deleted line - use old
199
+ lineClass = "line line-deleted";
200
+ content = oldLines[oldIdx] ?? "";
201
+ // Apply word diff if available
202
+ const wordDiff = allOldLineDiffs.get(oldIdx);
203
+ if (wordDiff) {
204
+ content = injectWordDiffMarkers(content, wordDiff, "old");
205
+ }
206
+ oldIdx++;
207
+ }
208
+ else if (prefix === "+") {
209
+ // Inserted line - use new
210
+ lineClass = "line line-inserted";
211
+ content = newLines[newIdx] ?? "";
212
+ // Apply word diff if available
213
+ const wordDiff = allNewLineDiffs.get(newIdx);
214
+ if (wordDiff) {
215
+ content = injectWordDiffMarkers(content, wordDiff, "new");
216
+ }
217
+ newIdx++;
218
+ }
219
+ else {
220
+ continue; // Skip unexpected
221
+ }
222
+ resultLines.push(`<span class="${lineClass}"><span class="diff-prefix">${escapeHtml(prefix)}</span>${content}</span>`);
223
+ }
224
+ }
225
+ return `<pre class="shiki"><code class="language-${lang}">${resultLines.join("\n")}</code></pre>`;
226
+ }
227
+ /**
228
+ * Compute an edit augment for an Edit tool_use.
229
+ *
230
+ * @param toolUseId - The tool_use ID to associate with this augment
231
+ * @param input - The Edit tool input containing file_path, old_string, new_string
232
+ * @returns EditAugment with structuredPatch and highlighted diff HTML
233
+ */
234
+ export async function computeEditAugment(toolUseId, input) {
235
+ const { file_path, old_string, new_string } = input;
236
+ // Compute structured patch using jsdiff
237
+ const patch = structuredPatch(file_path, file_path, old_string, new_string, "", // oldHeader
238
+ "", // newHeader
239
+ { context: CONTEXT_LINES });
240
+ // Convert hunks to our format
241
+ const structuredPatchResult = convertHunks(patch.hunks);
242
+ // Try syntax-highlighted diff first (highlights code with file's language)
243
+ let diffHtml = await highlightDiffWithSyntax(old_string, new_string, structuredPatchResult, file_path);
244
+ // Fall back to diff-only highlighting if syntax highlighting fails
245
+ if (!diffHtml) {
246
+ const diffText = patchToUnifiedText(structuredPatchResult);
247
+ const highlightResult = await highlightCode(diffText, "diff");
248
+ if (highlightResult) {
249
+ // Post-process to add line type classes for background colors
250
+ diffHtml = addDiffLineClasses(highlightResult.html);
251
+ }
252
+ else {
253
+ // Fallback to plain text wrapped in pre/code
254
+ diffHtml = `<pre class="shiki"><code class="language-diff">${escapeHtml(diffText)}</code></pre>`;
255
+ }
256
+ }
257
+ return {
258
+ toolUseId,
259
+ type: "edit",
260
+ structuredPatch: structuredPatchResult,
261
+ diffHtml,
262
+ filePath: file_path,
263
+ };
264
+ }
265
+ /**
266
+ * Add diff line type classes to shiki HTML output.
267
+ * Detects line content and adds classes like "line-deleted", "line-inserted", "line-context", "line-hunk".
268
+ * This enables CSS background colors for traditional diff styling.
269
+ */
270
+ function addDiffLineClasses(html) {
271
+ // Match each <span class="line">...</span> and inspect content
272
+ return html.replace(/<span class="line">([\s\S]*?)<\/span>/g, (_match, content) => {
273
+ // Decode HTML entities to check the actual first character
274
+ const decoded = content
275
+ .replace(/&lt;/g, "<")
276
+ .replace(/&gt;/g, ">")
277
+ .replace(/&amp;/g, "&");
278
+ // Get the visible text (strip HTML tags)
279
+ const textContent = decoded.replace(/<[^>]*>/g, "");
280
+ const firstChar = textContent[0];
281
+ let lineClass = "line";
282
+ if (firstChar === "-") {
283
+ lineClass = "line line-deleted";
284
+ }
285
+ else if (firstChar === "+") {
286
+ lineClass = "line line-inserted";
287
+ }
288
+ else if (firstChar === "@") {
289
+ lineClass = "line line-hunk";
290
+ }
291
+ else if (firstChar === " ") {
292
+ lineClass = "line line-context";
293
+ }
294
+ return `<span class="${lineClass}">${content}</span>`;
295
+ });
296
+ }
297
+ /**
298
+ * Escape HTML special characters for fallback rendering.
299
+ */
300
+ function escapeHtml(text) {
301
+ return text
302
+ .replace(/&/g, "&amp;")
303
+ .replace(/</g, "&lt;")
304
+ .replace(/>/g, "&gt;")
305
+ .replace(/"/g, "&quot;")
306
+ .replace(/'/g, "&#039;");
307
+ }
308
+ /**
309
+ * Find consecutive -/+ line pairs in diff hunk lines that represent "replacements".
310
+ * These pairs are candidates for word-level diffing.
311
+ *
312
+ * Pairing strategy:
313
+ * - Match removed lines with added lines in order (first - with first +, etc.)
314
+ * - If there are more - than +, extra removed lines have no pair
315
+ * - If there are more + than -, extra added lines have no pair
316
+ * - Context lines (space prefix) or hunk headers (@@) reset the grouping
317
+ *
318
+ * @param hunkLines - Array of diff lines with prefixes: ' ', '-', '+', or starting with '@@'
319
+ * @returns Object containing pairs and unpaired lines
320
+ */
321
+ function findReplacePairs(hunkLines) {
322
+ const result = {
323
+ pairs: [],
324
+ unpairedRemovals: [],
325
+ unpairedAdditions: [],
326
+ };
327
+ // Collect removals and additions in the current contiguous group
328
+ let currentRemovals = [];
329
+ let currentAdditions = [];
330
+ /**
331
+ * Process the current group of removals and additions, creating pairs
332
+ * and tracking unpaired lines.
333
+ */
334
+ function flushGroup() {
335
+ // Pair up removals and additions in order
336
+ const pairCount = Math.min(currentRemovals.length, currentAdditions.length);
337
+ for (let i = 0; i < pairCount; i++) {
338
+ const removal = currentRemovals[i];
339
+ const addition = currentAdditions[i];
340
+ if (removal && addition) {
341
+ result.pairs.push({
342
+ oldLineIndex: i,
343
+ newLineIndex: i,
344
+ oldText: removal.text,
345
+ newText: addition.text,
346
+ });
347
+ }
348
+ }
349
+ // Track unpaired removals (when more - than +)
350
+ for (let i = pairCount; i < currentRemovals.length; i++) {
351
+ const removal = currentRemovals[i];
352
+ if (removal) {
353
+ result.unpairedRemovals.push(removal);
354
+ }
355
+ }
356
+ // Track unpaired additions (when more + than -)
357
+ for (let i = pairCount; i < currentAdditions.length; i++) {
358
+ const addition = currentAdditions[i];
359
+ if (addition) {
360
+ result.unpairedAdditions.push(addition);
361
+ }
362
+ }
363
+ // Reset for next group
364
+ currentRemovals = [];
365
+ currentAdditions = [];
366
+ }
367
+ for (const line of hunkLines) {
368
+ const prefix = line[0];
369
+ if (prefix === "-") {
370
+ // If we were collecting additions, flush the group first
371
+ // (additions after removals is normal, but - after + means new group)
372
+ if (currentAdditions.length > 0) {
373
+ flushGroup();
374
+ }
375
+ currentRemovals.push({
376
+ index: currentRemovals.length,
377
+ text: line.slice(1),
378
+ });
379
+ }
380
+ else if (prefix === "+") {
381
+ // Additions are added to current group
382
+ currentAdditions.push({
383
+ index: currentAdditions.length,
384
+ text: line.slice(1),
385
+ });
386
+ }
387
+ else if (prefix === " " || line.startsWith("@@")) {
388
+ // Context line or hunk header - flush current group and reset
389
+ flushGroup();
390
+ }
391
+ // Skip other lines (like "")
392
+ }
393
+ // Flush any remaining group
394
+ flushGroup();
395
+ return result;
396
+ }
397
+ /**
398
+ * Compute word-level diff between two strings.
399
+ * Uses jsdiff's diffWordsWithSpace to find word-by-word changes.
400
+ * Unlike diffWords, this treats whitespace as significant, so leading
401
+ * indentation is preserved as unchanged when only words change.
402
+ *
403
+ * @param oldLine - The original string
404
+ * @param newLine - The modified string
405
+ * @returns Array of diff segments with their types
406
+ */
407
+ function computeWordDiff(oldLine, newLine) {
408
+ const changes = diffWordsWithSpace(oldLine, newLine);
409
+ return changes.map((change) => ({
410
+ text: change.value,
411
+ type: change.added ? "added" : change.removed ? "removed" : "unchanged",
412
+ }));
413
+ }
414
+ /**
415
+ * Maps HTML entity names to their decoded characters.
416
+ */
417
+ const HTML_ENTITY_MAP = {
418
+ "&lt;": "<",
419
+ "&gt;": ">",
420
+ "&amp;": "&",
421
+ "&quot;": '"',
422
+ "&#039;": "'",
423
+ "&apos;": "'",
424
+ };
425
+ /**
426
+ * Parse HTML into segments of text content and tags.
427
+ * Text content has HTML entities decoded for matching against plain text.
428
+ */
429
+ function parseHtmlSegments(html) {
430
+ const segments = [];
431
+ const tagRegex = /<[^>]*>/g;
432
+ let lastIndex = 0;
433
+ for (const match of html.matchAll(tagRegex)) {
434
+ // Add text content before this tag
435
+ if (match.index > lastIndex) {
436
+ const content = html.slice(lastIndex, match.index);
437
+ segments.push({
438
+ type: "text",
439
+ content,
440
+ plainText: decodeHtmlEntities(content),
441
+ });
442
+ }
443
+ // Add the tag itself
444
+ segments.push({
445
+ type: "tag",
446
+ content: match[0],
447
+ });
448
+ lastIndex = match.index + match[0].length;
449
+ }
450
+ // Add any remaining text after the last tag
451
+ if (lastIndex < html.length) {
452
+ const content = html.slice(lastIndex);
453
+ segments.push({
454
+ type: "text",
455
+ content,
456
+ plainText: decodeHtmlEntities(content),
457
+ });
458
+ }
459
+ return segments;
460
+ }
461
+ /**
462
+ * Decode HTML entities in a string to their plain text equivalents.
463
+ * Handles named entities (&lt;), decimal entities (&#60;), and hex entities (&#x3C;).
464
+ */
465
+ function decodeHtmlEntities(html) {
466
+ return html.replace(/&[^;]+;/g, (entity) => {
467
+ // Check named entity map first
468
+ if (HTML_ENTITY_MAP[entity]) {
469
+ return HTML_ENTITY_MAP[entity];
470
+ }
471
+ // Handle numeric entities: &#60; (decimal) or &#x3C; (hex)
472
+ if (entity.startsWith("&#")) {
473
+ const isHex = entity[2] === "x" || entity[2] === "X";
474
+ const numStr = isHex ? entity.slice(3, -1) : entity.slice(2, -1);
475
+ const codePoint = Number.parseInt(numStr, isHex ? 16 : 10);
476
+ if (!Number.isNaN(codePoint)) {
477
+ return String.fromCodePoint(codePoint);
478
+ }
479
+ }
480
+ return entity;
481
+ });
482
+ }
483
+ /**
484
+ * Inject word-level diff markers into syntax-highlighted HTML.
485
+ *
486
+ * This function takes syntax-highlighted HTML (from Shiki) and a word diff,
487
+ * then wraps changed portions in <span class="diff-word-removed"> or
488
+ * <span class="diff-word-added"> tags without breaking the HTML structure.
489
+ *
490
+ * @param html - Syntax-highlighted HTML for a single line (inner content of <span class="line">)
491
+ * @param wordDiff - Word diff segments from computeWordDiff()
492
+ * @param mode - Whether this is the 'old' (removed) or 'new' (added) line
493
+ * @returns HTML with word diff markers injected
494
+ */
495
+ function injectWordDiffMarkers(html, wordDiff, mode) {
496
+ // Determine which segment type to highlight based on mode
497
+ const targetType = mode === "old" ? "removed" : "added";
498
+ const cssClass = mode === "old" ? "diff-word-removed" : "diff-word-added";
499
+ // Build the plain text that should appear in this version
500
+ // In 'old' mode: unchanged + removed
501
+ // In 'new' mode: unchanged + added
502
+ const relevantSegments = wordDiff.filter((seg) => seg.type === "unchanged" || seg.type === targetType);
503
+ // Parse HTML into text and tag segments
504
+ const htmlSegments = parseHtmlSegments(html);
505
+ // Build result by walking through word diff segments and HTML segments together
506
+ const result = [];
507
+ let htmlSegmentIndex = 0;
508
+ let htmlTextOffset = 0; // Offset within current text segment's plainText
509
+ for (const segment of relevantSegments) {
510
+ const segmentText = segment.text;
511
+ let remaining = segmentText.length;
512
+ const needsHighlight = segment.type === targetType;
513
+ // Track if we're in the middle of a highlight span
514
+ let highlightParts = [];
515
+ while (remaining > 0) {
516
+ const htmlSeg = htmlSegments[htmlSegmentIndex];
517
+ if (!htmlSeg)
518
+ break;
519
+ if (htmlSeg.type === "tag") {
520
+ // Tags pass through unchanged
521
+ // If we're collecting highlight parts, we need to close/reopen the highlight
522
+ if (needsHighlight && highlightParts.length > 0) {
523
+ // Flush accumulated highlight parts before the tag
524
+ result.push(`<span class="${cssClass}">${highlightParts.join("")}</span>`);
525
+ highlightParts = [];
526
+ }
527
+ result.push(htmlSeg.content);
528
+ htmlSegmentIndex++;
529
+ continue;
530
+ }
531
+ // Text segment
532
+ const plainText = htmlSeg.plainText ?? "";
533
+ const availableText = plainText.slice(htmlTextOffset);
534
+ const availableLen = availableText.length;
535
+ if (availableLen === 0) {
536
+ // Move to next segment
537
+ htmlSegmentIndex++;
538
+ htmlTextOffset = 0;
539
+ continue;
540
+ }
541
+ // How much of this text segment do we need?
542
+ const takeLen = Math.min(remaining, availableLen);
543
+ const takenPlainText = availableText.slice(0, takeLen);
544
+ // Convert taken plain text back to HTML (re-encode entities)
545
+ const takenHtml = convertPlainTextToHtml(htmlSeg.content, htmlTextOffset, takenPlainText);
546
+ if (needsHighlight) {
547
+ highlightParts.push(takenHtml);
548
+ }
549
+ else {
550
+ result.push(takenHtml);
551
+ }
552
+ remaining -= takeLen;
553
+ htmlTextOffset += takeLen;
554
+ // If we've consumed this segment, move to next
555
+ if (htmlTextOffset >= plainText.length) {
556
+ htmlSegmentIndex++;
557
+ htmlTextOffset = 0;
558
+ }
559
+ }
560
+ // Flush any remaining highlight parts
561
+ if (needsHighlight && highlightParts.length > 0) {
562
+ result.push(`<span class="${cssClass}">${highlightParts.join("")}</span>`);
563
+ }
564
+ }
565
+ // Append any remaining HTML segments (tags after all text is consumed)
566
+ for (let i = htmlSegmentIndex; i < htmlSegments.length; i++) {
567
+ const htmlSeg = htmlSegments[i];
568
+ if (!htmlSeg)
569
+ continue;
570
+ if (htmlSeg.type === "tag") {
571
+ result.push(htmlSeg.content);
572
+ }
573
+ else if (i === htmlSegmentIndex && htmlTextOffset > 0) {
574
+ // First remaining segment may have a partial offset
575
+ const remainingText = (htmlSeg.plainText ?? "").slice(htmlTextOffset);
576
+ if (remainingText.length > 0) {
577
+ result.push(htmlSeg.content.slice(findHtmlOffsetForPlainTextOffset(htmlSeg.content, htmlTextOffset)));
578
+ }
579
+ }
580
+ else {
581
+ // Full text segment
582
+ result.push(htmlSeg.content);
583
+ }
584
+ }
585
+ return result.join("");
586
+ }
587
+ /**
588
+ * Convert a portion of plain text back to its HTML representation,
589
+ * using the original HTML as a reference for entity encoding.
590
+ *
591
+ * @param originalHtml - The original HTML text segment (with entities)
592
+ * @param startPlainOffset - Starting offset in the decoded plain text
593
+ * @param plainText - The plain text portion we want to convert
594
+ * @returns The HTML representation of the plain text
595
+ */
596
+ function convertPlainTextToHtml(originalHtml, startPlainOffset, plainText) {
597
+ // Find the starting position in the original HTML
598
+ const htmlStart = findHtmlOffsetForPlainTextOffset(originalHtml, startPlainOffset);
599
+ // Find the ending position
600
+ const htmlEnd = findHtmlOffsetForPlainTextOffset(originalHtml, startPlainOffset + plainText.length);
601
+ return originalHtml.slice(htmlStart, htmlEnd);
602
+ }
603
+ /**
604
+ * Check if an HTML entity decodes to a single character.
605
+ * Handles named entities, decimal entities (&#60;), and hex entities (&#x3C;).
606
+ */
607
+ function isValidHtmlEntity(entity) {
608
+ if (HTML_ENTITY_MAP[entity]) {
609
+ return true;
610
+ }
611
+ // Check numeric entities: &#60; or &#x3C;
612
+ if (entity.startsWith("&#")) {
613
+ const isHex = entity[2] === "x" || entity[2] === "X";
614
+ const numStr = isHex ? entity.slice(3, -1) : entity.slice(2, -1);
615
+ const codePoint = Number.parseInt(numStr, isHex ? 16 : 10);
616
+ return !Number.isNaN(codePoint);
617
+ }
618
+ return false;
619
+ }
620
+ /**
621
+ * Find the position in HTML string that corresponds to a position in decoded plain text.
622
+ *
623
+ * @param html - HTML string (may contain entities)
624
+ * @param plainOffset - Offset in the decoded plain text
625
+ * @returns Offset in the HTML string
626
+ */
627
+ function findHtmlOffsetForPlainTextOffset(html, plainOffset) {
628
+ let htmlPos = 0;
629
+ let plainPos = 0;
630
+ while (plainPos < plainOffset && htmlPos < html.length) {
631
+ // Check for HTML entity
632
+ if (html[htmlPos] === "&") {
633
+ // Find the end of the entity
634
+ const semiPos = html.indexOf(";", htmlPos);
635
+ if (semiPos !== -1) {
636
+ const entity = html.slice(htmlPos, semiPos + 1);
637
+ if (isValidHtmlEntity(entity)) {
638
+ // This entity decodes to one character
639
+ htmlPos = semiPos + 1;
640
+ plainPos++;
641
+ continue;
642
+ }
643
+ }
644
+ }
645
+ // Regular character
646
+ htmlPos++;
647
+ plainPos++;
648
+ }
649
+ return htmlPos;
650
+ }
651
+ /**
652
+ * @internal
653
+ * Exported for testing purposes only. Do not use in production code.
654
+ */
655
+ export const __test__ = {
656
+ extractShikiLines,
657
+ addDiffLineClasses,
658
+ convertHunks,
659
+ patchToUnifiedText,
660
+ escapeHtml,
661
+ computeWordDiff,
662
+ findReplacePairs,
663
+ injectWordDiffMarkers,
664
+ };
665
+ //# sourceMappingURL=edit-augments.js.map