@tonyclaw/agent-inspector 2.0.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 (400) hide show
  1. package/.output/cli.js +1611 -0
  2. package/.output/nitro.json +17 -0
  3. package/.output/public/assets/CompareDrawer-CU5ZrWcL.js +1 -0
  4. package/.output/public/assets/ProxyViewerContainer-pEBqVp1d.js +101 -0
  5. package/.output/public/assets/ReplayDialog-F58yNg5j.js +1 -0
  6. package/.output/public/assets/RequestAnatomy-C9lT0qE_.js +1 -0
  7. package/.output/public/assets/ResponseView-DHJq6bnz.js +1 -0
  8. package/.output/public/assets/StreamingChunkSequence-BTgfpFUT.js +1 -0
  9. package/.output/public/assets/_sessionId-DsNRbnNm.js +1 -0
  10. package/.output/public/assets/alibaba-TTwafVwX.svg +1 -0
  11. package/.output/public/assets/index-CpWG2hFn.css +1 -0
  12. package/.output/public/assets/index-DmBV8Gve.js +1 -0
  13. package/.output/public/assets/json-viewer-CZVYLR8j.js +14 -0
  14. package/.output/public/assets/main-DHs7FBK3.js +18 -0
  15. package/.output/public/assets/minimax-BPMzvuL-.jpeg +0 -0
  16. package/.output/public/assets/qwen-CONDcHqt.png +0 -0
  17. package/.output/public/assets/zhipuai-BPNAnxo-.svg +219 -0
  18. package/.output/server/_chunks/ssr-renderer.mjs +22 -0
  19. package/.output/server/_libs/@radix-ui/react-accessible-icon+[...].mjs +1 -0
  20. package/.output/server/_libs/@radix-ui/react-dismissable-layer+[...].mjs +210 -0
  21. package/.output/server/_libs/@radix-ui/react-navigation-menu+[...].mjs +2 -0
  22. package/.output/server/_libs/@radix-ui/react-one-time-password-field+[...].mjs +2 -0
  23. package/.output/server/_libs/@radix-ui/react-password-toggle-field+[...].mjs +2 -0
  24. package/.output/server/_libs/@radix-ui/react-use-callback-ref+[...].mjs +11 -0
  25. package/.output/server/_libs/@radix-ui/react-use-controllable-state+[...].mjs +69 -0
  26. package/.output/server/_libs/@radix-ui/react-use-effect-event+[...].mjs +1 -0
  27. package/.output/server/_libs/@radix-ui/react-use-escape-keydown+[...].mjs +17 -0
  28. package/.output/server/_libs/@radix-ui/react-use-is-hydrated+[...].mjs +1 -0
  29. package/.output/server/_libs/@radix-ui/react-use-layout-effect+[...].mjs +6 -0
  30. package/.output/server/_libs/@radix-ui/react-visually-hidden+[...].mjs +34 -0
  31. package/.output/server/_libs/ajv-formats.mjs +330 -0
  32. package/.output/server/_libs/ajv.mjs +11444 -0
  33. package/.output/server/_libs/aria-hidden.mjs +122 -0
  34. package/.output/server/_libs/atomically.mjs +152 -0
  35. package/.output/server/_libs/bail.mjs +8 -0
  36. package/.output/server/_libs/cfworker__json-schema.mjs +1 -0
  37. package/.output/server/_libs/character-entities.mjs +2130 -0
  38. package/.output/server/_libs/class-variance-authority.mjs +44 -0
  39. package/.output/server/_libs/clsx.mjs +16 -0
  40. package/.output/server/_libs/comma-separated-tokens.mjs +10 -0
  41. package/.output/server/_libs/conf.mjs +635 -0
  42. package/.output/server/_libs/cookie-es.mjs +58 -0
  43. package/.output/server/_libs/core-util-is.mjs +75 -0
  44. package/.output/server/_libs/croner.mjs +1 -0
  45. package/.output/server/_libs/crossws.mjs +1 -0
  46. package/.output/server/_libs/debounce-fn.mjs +69 -0
  47. package/.output/server/_libs/decode-named-character-reference+[...].mjs +8 -0
  48. package/.output/server/_libs/dequal.mjs +27 -0
  49. package/.output/server/_libs/detect-node-es.mjs +1 -0
  50. package/.output/server/_libs/devlop.mjs +8 -0
  51. package/.output/server/_libs/diff.mjs +320 -0
  52. package/.output/server/_libs/dot-prop.mjs +265 -0
  53. package/.output/server/_libs/env-paths.mjs +57 -0
  54. package/.output/server/_libs/estree-util-is-identifier-name.mjs +11 -0
  55. package/.output/server/_libs/extend.mjs +97 -0
  56. package/.output/server/_libs/fast-deep-equal.mjs +38 -0
  57. package/.output/server/_libs/fast-uri.mjs +812 -0
  58. package/.output/server/_libs/floating-ui__core.mjs +725 -0
  59. package/.output/server/_libs/floating-ui__dom.mjs +622 -0
  60. package/.output/server/_libs/floating-ui__react-dom.mjs +292 -0
  61. package/.output/server/_libs/floating-ui__utils.mjs +320 -0
  62. package/.output/server/_libs/get-nonce.mjs +9 -0
  63. package/.output/server/_libs/h3-v2.mjs +276 -0
  64. package/.output/server/_libs/h3.mjs +408 -0
  65. package/.output/server/_libs/hast-util-to-jsx-runtime.mjs +388 -0
  66. package/.output/server/_libs/hast-util-whitespace.mjs +10 -0
  67. package/.output/server/_libs/hookable.mjs +1 -0
  68. package/.output/server/_libs/html-url-attributes.mjs +26 -0
  69. package/.output/server/_libs/immediate.mjs +74 -0
  70. package/.output/server/_libs/inherits.mjs +50 -0
  71. package/.output/server/_libs/inline-style-parser.mjs +142 -0
  72. package/.output/server/_libs/is-plain-obj.mjs +10 -0
  73. package/.output/server/_libs/isarray.mjs +14 -0
  74. package/.output/server/_libs/isbot.mjs +20 -0
  75. package/.output/server/_libs/json-schema-traverse.mjs +180 -0
  76. package/.output/server/_libs/jszip.mjs +3051 -0
  77. package/.output/server/_libs/lie.mjs +273 -0
  78. package/.output/server/_libs/lucide-react.mjs +492 -0
  79. package/.output/server/_libs/mdast-util-from-markdown.mjs +717 -0
  80. package/.output/server/_libs/mdast-util-to-hast.mjs +710 -0
  81. package/.output/server/_libs/mdast-util-to-string.mjs +38 -0
  82. package/.output/server/_libs/micromark-core-commonmark.mjs +2259 -0
  83. package/.output/server/_libs/micromark-factory-destination.mjs +94 -0
  84. package/.output/server/_libs/micromark-factory-label.mjs +63 -0
  85. package/.output/server/_libs/micromark-factory-space.mjs +24 -0
  86. package/.output/server/_libs/micromark-factory-title.mjs +65 -0
  87. package/.output/server/_libs/micromark-factory-whitespace.mjs +22 -0
  88. package/.output/server/_libs/micromark-util-character.mjs +44 -0
  89. package/.output/server/_libs/micromark-util-chunked.mjs +36 -0
  90. package/.output/server/_libs/micromark-util-classify-character+[...].mjs +12 -0
  91. package/.output/server/_libs/micromark-util-combine-extensions+[...].mjs +41 -0
  92. package/.output/server/_libs/micromark-util-decode-numeric-character-reference+[...].mjs +19 -0
  93. package/.output/server/_libs/micromark-util-decode-string.mjs +21 -0
  94. package/.output/server/_libs/micromark-util-encode.mjs +1 -0
  95. package/.output/server/_libs/micromark-util-html-tag-name.mjs +69 -0
  96. package/.output/server/_libs/micromark-util-normalize-identifier+[...].mjs +6 -0
  97. package/.output/server/_libs/micromark-util-resolve-all.mjs +15 -0
  98. package/.output/server/_libs/micromark-util-sanitize-uri.mjs +41 -0
  99. package/.output/server/_libs/micromark-util-subtokenize.mjs +346 -0
  100. package/.output/server/_libs/micromark.mjs +906 -0
  101. package/.output/server/_libs/mimic-function.mjs +47 -0
  102. package/.output/server/_libs/modelcontextprotocol__server.mjs +9738 -0
  103. package/.output/server/_libs/ocache.mjs +1 -0
  104. package/.output/server/_libs/ohash.mjs +1 -0
  105. package/.output/server/_libs/pako.mjs +4223 -0
  106. package/.output/server/_libs/process-nextick-args.mjs +48 -0
  107. package/.output/server/_libs/property-information.mjs +1209 -0
  108. package/.output/server/_libs/radix-ui.mjs +1 -0
  109. package/.output/server/_libs/radix-ui__number.mjs +6 -0
  110. package/.output/server/_libs/radix-ui__primitive.mjs +11 -0
  111. package/.output/server/_libs/radix-ui__react-accordion.mjs +1 -0
  112. package/.output/server/_libs/radix-ui__react-alert-dialog.mjs +1 -0
  113. package/.output/server/_libs/radix-ui__react-arrow.mjs +23 -0
  114. package/.output/server/_libs/radix-ui__react-aspect-ratio.mjs +1 -0
  115. package/.output/server/_libs/radix-ui__react-avatar.mjs +1 -0
  116. package/.output/server/_libs/radix-ui__react-checkbox.mjs +1 -0
  117. package/.output/server/_libs/radix-ui__react-collapsible.mjs +144 -0
  118. package/.output/server/_libs/radix-ui__react-collection.mjs +69 -0
  119. package/.output/server/_libs/radix-ui__react-compose-refs.mjs +39 -0
  120. package/.output/server/_libs/radix-ui__react-context-menu.mjs +1 -0
  121. package/.output/server/_libs/radix-ui__react-context.mjs +78 -0
  122. package/.output/server/_libs/radix-ui__react-dialog.mjs +325 -0
  123. package/.output/server/_libs/radix-ui__react-direction.mjs +9 -0
  124. package/.output/server/_libs/radix-ui__react-dropdown-menu.mjs +1 -0
  125. package/.output/server/_libs/radix-ui__react-focus-guards.mjs +29 -0
  126. package/.output/server/_libs/radix-ui__react-focus-scope.mjs +206 -0
  127. package/.output/server/_libs/radix-ui__react-form.mjs +1 -0
  128. package/.output/server/_libs/radix-ui__react-hover-card.mjs +1 -0
  129. package/.output/server/_libs/radix-ui__react-id.mjs +14 -0
  130. package/.output/server/_libs/radix-ui__react-label.mjs +1 -0
  131. package/.output/server/_libs/radix-ui__react-menu.mjs +1 -0
  132. package/.output/server/_libs/radix-ui__react-menubar.mjs +1 -0
  133. package/.output/server/_libs/radix-ui__react-popover.mjs +1 -0
  134. package/.output/server/_libs/radix-ui__react-popper.mjs +286 -0
  135. package/.output/server/_libs/radix-ui__react-portal.mjs +16 -0
  136. package/.output/server/_libs/radix-ui__react-presence.mjs +128 -0
  137. package/.output/server/_libs/radix-ui__react-primitive.mjs +42 -0
  138. package/.output/server/_libs/radix-ui__react-progress.mjs +1 -0
  139. package/.output/server/_libs/radix-ui__react-radio-group.mjs +1 -0
  140. package/.output/server/_libs/radix-ui__react-roving-focus.mjs +224 -0
  141. package/.output/server/_libs/radix-ui__react-scroll-area.mjs +721 -0
  142. package/.output/server/_libs/radix-ui__react-select.mjs +1163 -0
  143. package/.output/server/_libs/radix-ui__react-separator.mjs +28 -0
  144. package/.output/server/_libs/radix-ui__react-slider.mjs +1 -0
  145. package/.output/server/_libs/radix-ui__react-slot.mjs +99 -0
  146. package/.output/server/_libs/radix-ui__react-switch.mjs +1 -0
  147. package/.output/server/_libs/radix-ui__react-tabs.mjs +189 -0
  148. package/.output/server/_libs/radix-ui__react-toast.mjs +2 -0
  149. package/.output/server/_libs/radix-ui__react-toggle-group.mjs +1 -0
  150. package/.output/server/_libs/radix-ui__react-toggle.mjs +1 -0
  151. package/.output/server/_libs/radix-ui__react-toolbar.mjs +1 -0
  152. package/.output/server/_libs/radix-ui__react-tooltip.mjs +495 -0
  153. package/.output/server/_libs/radix-ui__react-use-previous.mjs +14 -0
  154. package/.output/server/_libs/radix-ui__react-use-size.mjs +39 -0
  155. package/.output/server/_libs/react-dom.mjs +10781 -0
  156. package/.output/server/_libs/react-markdown.mjs +147 -0
  157. package/.output/server/_libs/react-remove-scroll-bar.mjs +82 -0
  158. package/.output/server/_libs/react-remove-scroll.mjs +328 -0
  159. package/.output/server/_libs/react-style-singleton.mjs +69 -0
  160. package/.output/server/_libs/react.mjs +515 -0
  161. package/.output/server/_libs/readable-stream.mjs +1518 -0
  162. package/.output/server/_libs/remark-parse.mjs +19 -0
  163. package/.output/server/_libs/remark-rehype.mjs +21 -0
  164. package/.output/server/_libs/rou3.mjs +14 -0
  165. package/.output/server/_libs/safe-buffer.mjs +64 -0
  166. package/.output/server/_libs/semver.mjs +1938 -0
  167. package/.output/server/_libs/seroval-plugins.mjs +58 -0
  168. package/.output/server/_libs/seroval.mjs +1765 -0
  169. package/.output/server/_libs/setimmediate.mjs +152 -0
  170. package/.output/server/_libs/space-separated-tokens.mjs +6 -0
  171. package/.output/server/_libs/srvx.mjs +1029 -0
  172. package/.output/server/_libs/stubborn-fs.mjs +91 -0
  173. package/.output/server/_libs/stubborn-utils.mjs +66 -0
  174. package/.output/server/_libs/style-to-js.mjs +72 -0
  175. package/.output/server/_libs/style-to-object.mjs +38 -0
  176. package/.output/server/_libs/swr.mjs +939 -0
  177. package/.output/server/_libs/tailwind-merge.mjs +3010 -0
  178. package/.output/server/_libs/tanstack__history.mjs +217 -0
  179. package/.output/server/_libs/tanstack__react-router.mjs +1480 -0
  180. package/.output/server/_libs/tanstack__react-store.mjs +1 -0
  181. package/.output/server/_libs/tanstack__react-virtual.mjs +44 -0
  182. package/.output/server/_libs/tanstack__router-core.mjs +4827 -0
  183. package/.output/server/_libs/tanstack__store.mjs +1 -0
  184. package/.output/server/_libs/tanstack__virtual-core.mjs +1225 -0
  185. package/.output/server/_libs/tiny-invariant.mjs +12 -0
  186. package/.output/server/_libs/tiny-warning.mjs +5 -0
  187. package/.output/server/_libs/trim-lines.mjs +41 -0
  188. package/.output/server/_libs/trough.mjs +85 -0
  189. package/.output/server/_libs/tslib.mjs +1 -0
  190. package/.output/server/_libs/ufo.mjs +54 -0
  191. package/.output/server/_libs/uint8array-extras.mjs +69 -0
  192. package/.output/server/_libs/ungap__structured-clone.mjs +212 -0
  193. package/.output/server/_libs/unified.mjs +661 -0
  194. package/.output/server/_libs/unist-util-is.mjs +100 -0
  195. package/.output/server/_libs/unist-util-position.mjs +27 -0
  196. package/.output/server/_libs/unist-util-stringify-position.mjs +27 -0
  197. package/.output/server/_libs/unist-util-visit-parents.mjs +82 -0
  198. package/.output/server/_libs/unist-util-visit.mjs +24 -0
  199. package/.output/server/_libs/unstorage.mjs +1 -0
  200. package/.output/server/_libs/use-callback-ref.mjs +66 -0
  201. package/.output/server/_libs/use-sidecar.mjs +106 -0
  202. package/.output/server/_libs/use-sync-external-store.mjs +64 -0
  203. package/.output/server/_libs/util-deprecate.mjs +12 -0
  204. package/.output/server/_libs/vfile-message.mjs +138 -0
  205. package/.output/server/_libs/vfile.mjs +467 -0
  206. package/.output/server/_libs/when-exit.mjs +53 -0
  207. package/.output/server/_libs/zod.mjs +4524 -0
  208. package/.output/server/_sessionId-wMLPvC5g.mjs +123 -0
  209. package/.output/server/_ssr/CompareDrawer-BU4V0uVf.mjs +1041 -0
  210. package/.output/server/_ssr/ProxyViewerContainer-BnRwFEnn.mjs +5972 -0
  211. package/.output/server/_ssr/ReplayDialog-C7dn9pd_.mjs +322 -0
  212. package/.output/server/_ssr/RequestAnatomy-C1rWpe9-.mjs +353 -0
  213. package/.output/server/_ssr/ResponseView-hGpPaYsf.mjs +602 -0
  214. package/.output/server/_ssr/StreamingChunkSequence-BRWI1r_G.mjs +302 -0
  215. package/.output/server/_ssr/index-BKURLVPz.mjs +118 -0
  216. package/.output/server/_ssr/index.mjs +1184 -0
  217. package/.output/server/_ssr/json-viewer-BBd2DtQP.mjs +515 -0
  218. package/.output/server/_ssr/router-BcZ0D6AB.mjs +6317 -0
  219. package/.output/server/_ssr/start-HYkvq4Ni.mjs +4 -0
  220. package/.output/server/_tanstack-start-manifest_v-1y8ZVxRI.mjs +4 -0
  221. package/.output/server/index.mjs +436 -0
  222. package/.output/server/node_modules/tslib/modules/index.js +70 -0
  223. package/.output/server/node_modules/tslib/modules/package.json +3 -0
  224. package/.output/server/node_modules/tslib/package.json +47 -0
  225. package/.output/server/node_modules/tslib/tslib.js +484 -0
  226. package/.output/server/package.json +9 -0
  227. package/LICENSE +21 -0
  228. package/README.md +52 -0
  229. package/package.json +110 -0
  230. package/src/assets/favicon.svg +31 -0
  231. package/src/assets/logos/alibaba.svg +1 -0
  232. package/src/assets/logos/anthropic.svg +1 -0
  233. package/src/assets/logos/claude-code.svg +4 -0
  234. package/src/assets/logos/deepseek.svg +1 -0
  235. package/src/assets/logos/mcp.png +0 -0
  236. package/src/assets/logos/minimax.jpeg +0 -0
  237. package/src/assets/logos/openai.svg +1 -0
  238. package/src/assets/logos/opencode.svg +4 -0
  239. package/src/assets/logos/qwen.png +0 -0
  240. package/src/assets/logos/zhipuai.svg +219 -0
  241. package/src/cli/detect-tools.ts +147 -0
  242. package/src/cli/doctor.ts +521 -0
  243. package/src/cli/onboard.ts +224 -0
  244. package/src/cli/templates/command-onboard.ts +17 -0
  245. package/src/cli/templates/skill-onboard.ts +547 -0
  246. package/src/cli.ts +345 -0
  247. package/src/components/OnboardingBanner.tsx +67 -0
  248. package/src/components/ProxyViewer.tsx +545 -0
  249. package/src/components/ProxyViewerContainer.tsx +363 -0
  250. package/src/components/providers/ImportWizardDialog.tsx +349 -0
  251. package/src/components/providers/ProviderCard.tsx +474 -0
  252. package/src/components/providers/ProviderForm.tsx +494 -0
  253. package/src/components/providers/ProviderLogo.tsx +117 -0
  254. package/src/components/providers/ProvidersPanel.tsx +619 -0
  255. package/src/components/providers/SettingsDialog.tsx +202 -0
  256. package/src/components/proxy-viewer/CompareDrawer.tsx +893 -0
  257. package/src/components/proxy-viewer/ConversationGroup.tsx +107 -0
  258. package/src/components/proxy-viewer/ConversationHeader.tsx +300 -0
  259. package/src/components/proxy-viewer/LogEntry.tsx +543 -0
  260. package/src/components/proxy-viewer/LogEntryHeader.tsx +501 -0
  261. package/src/components/proxy-viewer/ReplayDialog.tsx +218 -0
  262. package/src/components/proxy-viewer/ResponseView.tsx +171 -0
  263. package/src/components/proxy-viewer/StreamingChunkSequence.tsx +188 -0
  264. package/src/components/proxy-viewer/ThreadConnector.tsx +136 -0
  265. package/src/components/proxy-viewer/TurnGroup.tsx +337 -0
  266. package/src/components/proxy-viewer/anatomy/RequestAnatomy.tsx +98 -0
  267. package/src/components/proxy-viewer/anatomy/SegmentBar.tsx +196 -0
  268. package/src/components/proxy-viewer/anatomy/tokenEstimate.ts +53 -0
  269. package/src/components/proxy-viewer/anatomy/types.ts +39 -0
  270. package/src/components/proxy-viewer/anatomy/useAnatomyJump.ts +114 -0
  271. package/src/components/proxy-viewer/cacheTrend.ts +50 -0
  272. package/src/components/proxy-viewer/diff/DiffView.tsx +321 -0
  273. package/src/components/proxy-viewer/diff/computeDiff.ts +178 -0
  274. package/src/components/proxy-viewer/diff/index.ts +3 -0
  275. package/src/components/proxy-viewer/formats/anthropic/ContentBlocks.tsx +157 -0
  276. package/src/components/proxy-viewer/formats/anthropic/ResponseView.tsx +66 -0
  277. package/src/components/proxy-viewer/formats/anthropic/thinkingExtract.ts +21 -0
  278. package/src/components/proxy-viewer/formats/index.tsx +33 -0
  279. package/src/components/proxy-viewer/formats/openai/ResponseView.tsx +170 -0
  280. package/src/components/proxy-viewer/index.ts +9 -0
  281. package/src/components/proxy-viewer/lazy.ts +37 -0
  282. package/src/components/proxy-viewer/log-formats/anthropic.ts +194 -0
  283. package/src/components/proxy-viewer/log-formats/index.ts +23 -0
  284. package/src/components/proxy-viewer/log-formats/openai.ts +167 -0
  285. package/src/components/proxy-viewer/log-formats/types.ts +40 -0
  286. package/src/components/proxy-viewer/log-formats/unknown.ts +18 -0
  287. package/src/components/proxy-viewer/logEntryVisibility.ts +39 -0
  288. package/src/components/proxy-viewer/requestDiff.ts +277 -0
  289. package/src/components/proxy-viewer/useCopyFeedback.ts +36 -0
  290. package/src/components/proxy-viewer/useKeyboardNavigation.ts +190 -0
  291. package/src/components/proxy-viewer/viewerState.ts +66 -0
  292. package/src/components/ui/badge.tsx +47 -0
  293. package/src/components/ui/button.tsx +47 -0
  294. package/src/components/ui/collapsible.tsx +21 -0
  295. package/src/components/ui/confirm-dialog.tsx +51 -0
  296. package/src/components/ui/crab-logo.tsx +95 -0
  297. package/src/components/ui/crab-variants.tsx +467 -0
  298. package/src/components/ui/dialog.tsx +129 -0
  299. package/src/components/ui/json-expansion-button.tsx +56 -0
  300. package/src/components/ui/json-viewer-bulk.ts +97 -0
  301. package/src/components/ui/json-viewer.tsx +494 -0
  302. package/src/components/ui/mcp-logo.tsx +20 -0
  303. package/src/components/ui/scroll-area.tsx +54 -0
  304. package/src/components/ui/select.tsx +178 -0
  305. package/src/components/ui/separator.tsx +28 -0
  306. package/src/components/ui/tabs.tsx +88 -0
  307. package/src/components/ui/tooltip.tsx +51 -0
  308. package/src/index.css +11 -0
  309. package/src/knowledge/candidateStore.ts +63 -0
  310. package/src/knowledge/distiller.ts +98 -0
  311. package/src/knowledge/openclawClient.ts +118 -0
  312. package/src/knowledge/redactor.ts +80 -0
  313. package/src/knowledge/types.ts +84 -0
  314. package/src/lib/apiClient.ts +49 -0
  315. package/src/lib/export-logs.ts +51 -0
  316. package/src/lib/mask.ts +4 -0
  317. package/src/lib/objectUtils.ts +22 -0
  318. package/src/lib/providerContract.ts +26 -0
  319. package/src/lib/providerTestContract.ts +107 -0
  320. package/src/lib/runtimeConfig.ts +25 -0
  321. package/src/lib/serverPort.ts +41 -0
  322. package/src/lib/sessionUrl.ts +44 -0
  323. package/src/lib/stopReason.ts +58 -0
  324. package/src/lib/useOnboarding.ts +80 -0
  325. package/src/lib/useProviders.ts +30 -0
  326. package/src/lib/useStripConfig.ts +108 -0
  327. package/src/lib/utils.ts +21 -0
  328. package/src/mcp/loopback.ts +76 -0
  329. package/src/mcp/previewExtractor.ts +166 -0
  330. package/src/mcp/server.ts +396 -0
  331. package/src/mcp/toolHandlers.ts +341 -0
  332. package/src/proxy/chunkStorage.ts +112 -0
  333. package/src/proxy/claudeCodeStrip.ts +99 -0
  334. package/src/proxy/config.ts +172 -0
  335. package/src/proxy/constants.ts +47 -0
  336. package/src/proxy/dataDir.ts +86 -0
  337. package/src/proxy/formats/anthropic/anthropicProvider.ts +75 -0
  338. package/src/proxy/formats/anthropic/handler.ts +71 -0
  339. package/src/proxy/formats/anthropic/index.ts +14 -0
  340. package/src/proxy/formats/anthropic/register.ts +4 -0
  341. package/src/proxy/formats/anthropic/schemas.ts +237 -0
  342. package/src/proxy/formats/anthropic/stream.ts +205 -0
  343. package/src/proxy/formats/handler.ts +46 -0
  344. package/src/proxy/formats/index.ts +12 -0
  345. package/src/proxy/formats/jsonSchema.ts +36 -0
  346. package/src/proxy/formats/openai/alibabaProvider.ts +38 -0
  347. package/src/proxy/formats/openai/handler.ts +96 -0
  348. package/src/proxy/formats/openai/index.ts +25 -0
  349. package/src/proxy/formats/openai/provider.ts +50 -0
  350. package/src/proxy/formats/openai/register.ts +4 -0
  351. package/src/proxy/formats/openai/schemas.ts +187 -0
  352. package/src/proxy/formats/openai/stream.ts +206 -0
  353. package/src/proxy/formats/protocol.ts +50 -0
  354. package/src/proxy/formats/providerRegistry.ts +51 -0
  355. package/src/proxy/formats/providers/index.ts +3 -0
  356. package/src/proxy/formats/registry.ts +66 -0
  357. package/src/proxy/handler.ts +334 -0
  358. package/src/proxy/logFinalizer.ts +305 -0
  359. package/src/proxy/logFinalizer.worker.ts +24 -0
  360. package/src/proxy/logIndex.ts +268 -0
  361. package/src/proxy/logger.ts +179 -0
  362. package/src/proxy/openaiOrphanToolStrip.ts +142 -0
  363. package/src/proxy/providerImporters.ts +491 -0
  364. package/src/proxy/providers.ts +613 -0
  365. package/src/proxy/schemas.ts +209 -0
  366. package/src/proxy/sessionProcess.ts +140 -0
  367. package/src/proxy/sessionRuntime.ts +85 -0
  368. package/src/proxy/sessionSupervisor.ts +283 -0
  369. package/src/proxy/sessionWorkerEntry.ts +26 -0
  370. package/src/proxy/socketTracker.ts +255 -0
  371. package/src/proxy/store.ts +412 -0
  372. package/src/proxy/upstream.ts +90 -0
  373. package/src/router.tsx +16 -0
  374. package/src/routes/__root.tsx +45 -0
  375. package/src/routes/api/config.paths.ts +14 -0
  376. package/src/routes/api/config.ts +53 -0
  377. package/src/routes/api/health.ts +15 -0
  378. package/src/routes/api/knowledge.candidates.$candidateId.promote.ts +32 -0
  379. package/src/routes/api/knowledge.candidates.ts +10 -0
  380. package/src/routes/api/knowledge.project-context.ts +18 -0
  381. package/src/routes/api/knowledge.search.ts +31 -0
  382. package/src/routes/api/knowledge.sessions.$sessionId.candidates.ts +16 -0
  383. package/src/routes/api/logs.$id.chunks.ts +36 -0
  384. package/src/routes/api/logs.$id.replay.ts +191 -0
  385. package/src/routes/api/logs.$id.ts +22 -0
  386. package/src/routes/api/logs.stream.ts +74 -0
  387. package/src/routes/api/logs.ts +59 -0
  388. package/src/routes/api/mcp.ts +25 -0
  389. package/src/routes/api/models.ts +10 -0
  390. package/src/routes/api/providers.$providerId.test.log.ts +293 -0
  391. package/src/routes/api/providers.$providerId.ts +50 -0
  392. package/src/routes/api/providers.export.ts +26 -0
  393. package/src/routes/api/providers.import.ts +47 -0
  394. package/src/routes/api/providers.scan.ts +23 -0
  395. package/src/routes/api/providers.ts +45 -0
  396. package/src/routes/api/sessions.ts +17 -0
  397. package/src/routes/index.tsx +6 -0
  398. package/src/routes/proxy/$.ts +15 -0
  399. package/src/routes/session/$sessionId.tsx +23 -0
  400. package/styles/globals.css +188 -0
@@ -0,0 +1,388 @@
1
+ import { s as stringify } from "./comma-separated-tokens.mjs";
2
+ import { o as ok } from "./devlop.mjs";
3
+ import { s as svg, h as html, f as find, a as hastToReact } from "./property-information.mjs";
4
+ import { s as stringify$1 } from "./space-separated-tokens.mjs";
5
+ import { s as styleToJs } from "./style-to-js.mjs";
6
+ import { w as whitespace } from "./hast-util-whitespace.mjs";
7
+ import { n as name } from "./estree-util-is-identifier-name.mjs";
8
+ import { V as VFileMessage } from "./vfile-message.mjs";
9
+ import { p as pointStart } from "./unist-util-position.mjs";
10
+ const own = {}.hasOwnProperty;
11
+ const emptyMap = /* @__PURE__ */ new Map();
12
+ const cap = /[A-Z]/g;
13
+ const tableElements = /* @__PURE__ */ new Set(["table", "tbody", "thead", "tfoot", "tr"]);
14
+ const tableCellElement = /* @__PURE__ */ new Set(["td", "th"]);
15
+ const docs = "https://github.com/syntax-tree/hast-util-to-jsx-runtime";
16
+ function toJsxRuntime(tree, options) {
17
+ if (!options || options.Fragment === void 0) {
18
+ throw new TypeError("Expected `Fragment` in options");
19
+ }
20
+ const filePath = options.filePath || void 0;
21
+ let create;
22
+ if (options.development) {
23
+ if (typeof options.jsxDEV !== "function") {
24
+ throw new TypeError(
25
+ "Expected `jsxDEV` in options when `development: true`"
26
+ );
27
+ }
28
+ create = developmentCreate(filePath, options.jsxDEV);
29
+ } else {
30
+ if (typeof options.jsx !== "function") {
31
+ throw new TypeError("Expected `jsx` in production options");
32
+ }
33
+ if (typeof options.jsxs !== "function") {
34
+ throw new TypeError("Expected `jsxs` in production options");
35
+ }
36
+ create = productionCreate(filePath, options.jsx, options.jsxs);
37
+ }
38
+ const state = {
39
+ Fragment: options.Fragment,
40
+ ancestors: [],
41
+ components: options.components || {},
42
+ create,
43
+ elementAttributeNameCase: options.elementAttributeNameCase || "react",
44
+ evaluater: options.createEvaluater ? options.createEvaluater() : void 0,
45
+ filePath,
46
+ ignoreInvalidStyle: options.ignoreInvalidStyle || false,
47
+ passKeys: options.passKeys !== false,
48
+ passNode: options.passNode || false,
49
+ schema: options.space === "svg" ? svg : html,
50
+ stylePropertyNameCase: options.stylePropertyNameCase || "dom",
51
+ tableCellAlignToStyle: options.tableCellAlignToStyle !== false
52
+ };
53
+ const result = one(state, tree, void 0);
54
+ if (result && typeof result !== "string") {
55
+ return result;
56
+ }
57
+ return state.create(
58
+ tree,
59
+ state.Fragment,
60
+ { children: result || void 0 },
61
+ void 0
62
+ );
63
+ }
64
+ function one(state, node, key) {
65
+ if (node.type === "element") {
66
+ return element(state, node, key);
67
+ }
68
+ if (node.type === "mdxFlowExpression" || node.type === "mdxTextExpression") {
69
+ return mdxExpression(state, node);
70
+ }
71
+ if (node.type === "mdxJsxFlowElement" || node.type === "mdxJsxTextElement") {
72
+ return mdxJsxElement(state, node, key);
73
+ }
74
+ if (node.type === "mdxjsEsm") {
75
+ return mdxEsm(state, node);
76
+ }
77
+ if (node.type === "root") {
78
+ return root(state, node, key);
79
+ }
80
+ if (node.type === "text") {
81
+ return text(state, node);
82
+ }
83
+ }
84
+ function element(state, node, key) {
85
+ const parentSchema = state.schema;
86
+ let schema = parentSchema;
87
+ if (node.tagName.toLowerCase() === "svg" && parentSchema.space === "html") {
88
+ schema = svg;
89
+ state.schema = schema;
90
+ }
91
+ state.ancestors.push(node);
92
+ const type = findComponentFromName(state, node.tagName, false);
93
+ const props = createElementProps(state, node);
94
+ let children = createChildren(state, node);
95
+ if (tableElements.has(node.tagName)) {
96
+ children = children.filter(function(child) {
97
+ return typeof child === "string" ? !whitespace(child) : true;
98
+ });
99
+ }
100
+ addNode(state, props, type, node);
101
+ addChildren(props, children);
102
+ state.ancestors.pop();
103
+ state.schema = parentSchema;
104
+ return state.create(node, type, props, key);
105
+ }
106
+ function mdxExpression(state, node) {
107
+ if (node.data && node.data.estree && state.evaluater) {
108
+ const program = node.data.estree;
109
+ const expression = program.body[0];
110
+ ok(expression.type === "ExpressionStatement");
111
+ return (
112
+ /** @type {Child | undefined} */
113
+ state.evaluater.evaluateExpression(expression.expression)
114
+ );
115
+ }
116
+ crashEstree(state, node.position);
117
+ }
118
+ function mdxEsm(state, node) {
119
+ if (node.data && node.data.estree && state.evaluater) {
120
+ return (
121
+ /** @type {Child | undefined} */
122
+ state.evaluater.evaluateProgram(node.data.estree)
123
+ );
124
+ }
125
+ crashEstree(state, node.position);
126
+ }
127
+ function mdxJsxElement(state, node, key) {
128
+ const parentSchema = state.schema;
129
+ let schema = parentSchema;
130
+ if (node.name === "svg" && parentSchema.space === "html") {
131
+ schema = svg;
132
+ state.schema = schema;
133
+ }
134
+ state.ancestors.push(node);
135
+ const type = node.name === null ? state.Fragment : findComponentFromName(state, node.name, true);
136
+ const props = createJsxElementProps(state, node);
137
+ const children = createChildren(state, node);
138
+ addNode(state, props, type, node);
139
+ addChildren(props, children);
140
+ state.ancestors.pop();
141
+ state.schema = parentSchema;
142
+ return state.create(node, type, props, key);
143
+ }
144
+ function root(state, node, key) {
145
+ const props = {};
146
+ addChildren(props, createChildren(state, node));
147
+ return state.create(node, state.Fragment, props, key);
148
+ }
149
+ function text(_, node) {
150
+ return node.value;
151
+ }
152
+ function addNode(state, props, type, node) {
153
+ if (typeof type !== "string" && type !== state.Fragment && state.passNode) {
154
+ props.node = node;
155
+ }
156
+ }
157
+ function addChildren(props, children) {
158
+ if (children.length > 0) {
159
+ const value = children.length > 1 ? children : children[0];
160
+ if (value) {
161
+ props.children = value;
162
+ }
163
+ }
164
+ }
165
+ function productionCreate(_, jsx, jsxs) {
166
+ return create;
167
+ function create(_2, type, props, key) {
168
+ const isStaticChildren = Array.isArray(props.children);
169
+ const fn = isStaticChildren ? jsxs : jsx;
170
+ return key ? fn(type, props, key) : fn(type, props);
171
+ }
172
+ }
173
+ function developmentCreate(filePath, jsxDEV) {
174
+ return create;
175
+ function create(node, type, props, key) {
176
+ const isStaticChildren = Array.isArray(props.children);
177
+ const point = pointStart(node);
178
+ return jsxDEV(
179
+ type,
180
+ props,
181
+ key,
182
+ isStaticChildren,
183
+ {
184
+ columnNumber: point ? point.column - 1 : void 0,
185
+ fileName: filePath,
186
+ lineNumber: point ? point.line : void 0
187
+ },
188
+ void 0
189
+ );
190
+ }
191
+ }
192
+ function createElementProps(state, node) {
193
+ const props = {};
194
+ let alignValue;
195
+ let prop;
196
+ for (prop in node.properties) {
197
+ if (prop !== "children" && own.call(node.properties, prop)) {
198
+ const result = createProperty(state, prop, node.properties[prop]);
199
+ if (result) {
200
+ const [key, value] = result;
201
+ if (state.tableCellAlignToStyle && key === "align" && typeof value === "string" && tableCellElement.has(node.tagName)) {
202
+ alignValue = value;
203
+ } else {
204
+ props[key] = value;
205
+ }
206
+ }
207
+ }
208
+ }
209
+ if (alignValue) {
210
+ const style = (
211
+ /** @type {Style} */
212
+ props.style || (props.style = {})
213
+ );
214
+ style[state.stylePropertyNameCase === "css" ? "text-align" : "textAlign"] = alignValue;
215
+ }
216
+ return props;
217
+ }
218
+ function createJsxElementProps(state, node) {
219
+ const props = {};
220
+ for (const attribute of node.attributes) {
221
+ if (attribute.type === "mdxJsxExpressionAttribute") {
222
+ if (attribute.data && attribute.data.estree && state.evaluater) {
223
+ const program = attribute.data.estree;
224
+ const expression = program.body[0];
225
+ ok(expression.type === "ExpressionStatement");
226
+ const objectExpression = expression.expression;
227
+ ok(objectExpression.type === "ObjectExpression");
228
+ const property = objectExpression.properties[0];
229
+ ok(property.type === "SpreadElement");
230
+ Object.assign(
231
+ props,
232
+ state.evaluater.evaluateExpression(property.argument)
233
+ );
234
+ } else {
235
+ crashEstree(state, node.position);
236
+ }
237
+ } else {
238
+ const name2 = attribute.name;
239
+ let value;
240
+ if (attribute.value && typeof attribute.value === "object") {
241
+ if (attribute.value.data && attribute.value.data.estree && state.evaluater) {
242
+ const program = attribute.value.data.estree;
243
+ const expression = program.body[0];
244
+ ok(expression.type === "ExpressionStatement");
245
+ value = state.evaluater.evaluateExpression(expression.expression);
246
+ } else {
247
+ crashEstree(state, node.position);
248
+ }
249
+ } else {
250
+ value = attribute.value === null ? true : attribute.value;
251
+ }
252
+ props[name2] = /** @type {Props[keyof Props]} */
253
+ value;
254
+ }
255
+ }
256
+ return props;
257
+ }
258
+ function createChildren(state, node) {
259
+ const children = [];
260
+ let index = -1;
261
+ const countsByName = state.passKeys ? /* @__PURE__ */ new Map() : emptyMap;
262
+ while (++index < node.children.length) {
263
+ const child = node.children[index];
264
+ let key;
265
+ if (state.passKeys) {
266
+ const name2 = child.type === "element" ? child.tagName : child.type === "mdxJsxFlowElement" || child.type === "mdxJsxTextElement" ? child.name : void 0;
267
+ if (name2) {
268
+ const count = countsByName.get(name2) || 0;
269
+ key = name2 + "-" + count;
270
+ countsByName.set(name2, count + 1);
271
+ }
272
+ }
273
+ const result = one(state, child, key);
274
+ if (result !== void 0) children.push(result);
275
+ }
276
+ return children;
277
+ }
278
+ function createProperty(state, prop, value) {
279
+ const info = find(state.schema, prop);
280
+ if (value === null || value === void 0 || typeof value === "number" && Number.isNaN(value)) {
281
+ return;
282
+ }
283
+ if (Array.isArray(value)) {
284
+ value = info.commaSeparated ? stringify(value) : stringify$1(value);
285
+ }
286
+ if (info.property === "style") {
287
+ let styleObject = typeof value === "object" ? value : parseStyle(state, String(value));
288
+ if (state.stylePropertyNameCase === "css") {
289
+ styleObject = transformStylesToCssCasing(styleObject);
290
+ }
291
+ return ["style", styleObject];
292
+ }
293
+ return [
294
+ state.elementAttributeNameCase === "react" && info.space ? hastToReact[info.property] || info.property : info.attribute,
295
+ value
296
+ ];
297
+ }
298
+ function parseStyle(state, value) {
299
+ try {
300
+ return styleToJs(value, { reactCompat: true });
301
+ } catch (error) {
302
+ if (state.ignoreInvalidStyle) {
303
+ return {};
304
+ }
305
+ const cause = (
306
+ /** @type {Error} */
307
+ error
308
+ );
309
+ const message = new VFileMessage("Cannot parse `style` attribute", {
310
+ ancestors: state.ancestors,
311
+ cause,
312
+ ruleId: "style",
313
+ source: "hast-util-to-jsx-runtime"
314
+ });
315
+ message.file = state.filePath || void 0;
316
+ message.url = docs + "#cannot-parse-style-attribute";
317
+ throw message;
318
+ }
319
+ }
320
+ function findComponentFromName(state, name$1, allowExpression) {
321
+ let result;
322
+ if (!allowExpression) {
323
+ result = { type: "Literal", value: name$1 };
324
+ } else if (name$1.includes(".")) {
325
+ const identifiers = name$1.split(".");
326
+ let index = -1;
327
+ let node;
328
+ while (++index < identifiers.length) {
329
+ const prop = name(identifiers[index]) ? { type: "Identifier", name: identifiers[index] } : { type: "Literal", value: identifiers[index] };
330
+ node = node ? {
331
+ type: "MemberExpression",
332
+ object: node,
333
+ property: prop,
334
+ computed: Boolean(index && prop.type === "Literal"),
335
+ optional: false
336
+ } : prop;
337
+ }
338
+ result = node;
339
+ } else {
340
+ result = name(name$1) && !/^[a-z]/.test(name$1) ? { type: "Identifier", name: name$1 } : { type: "Literal", value: name$1 };
341
+ }
342
+ if (result.type === "Literal") {
343
+ const name2 = (
344
+ /** @type {string | number} */
345
+ result.value
346
+ );
347
+ return own.call(state.components, name2) ? state.components[name2] : name2;
348
+ }
349
+ if (state.evaluater) {
350
+ return state.evaluater.evaluateExpression(result);
351
+ }
352
+ crashEstree(state);
353
+ }
354
+ function crashEstree(state, place) {
355
+ const message = new VFileMessage(
356
+ "Cannot handle MDX estrees without `createEvaluater`",
357
+ {
358
+ ancestors: state.ancestors,
359
+ place,
360
+ ruleId: "mdx-estree",
361
+ source: "hast-util-to-jsx-runtime"
362
+ }
363
+ );
364
+ message.file = state.filePath || void 0;
365
+ message.url = docs + "#cannot-handle-mdx-estrees-without-createevaluater";
366
+ throw message;
367
+ }
368
+ function transformStylesToCssCasing(domCasing) {
369
+ const cssCasing = {};
370
+ let from;
371
+ for (from in domCasing) {
372
+ if (own.call(domCasing, from)) {
373
+ cssCasing[transformStyleToCssCasing(from)] = domCasing[from];
374
+ }
375
+ }
376
+ return cssCasing;
377
+ }
378
+ function transformStyleToCssCasing(from) {
379
+ let to = from.replace(cap, toDash);
380
+ if (to.slice(0, 3) === "ms-") to = "-" + to;
381
+ return to;
382
+ }
383
+ function toDash($0) {
384
+ return "-" + $0.toLowerCase();
385
+ }
386
+ export {
387
+ toJsxRuntime as t
388
+ };
@@ -0,0 +1,10 @@
1
+ const re = /[ \t\n\f\r]/g;
2
+ function whitespace(thing) {
3
+ return typeof thing === "object" ? thing.type === "text" ? empty(thing.value) : false : empty(thing);
4
+ }
5
+ function empty(value) {
6
+ return value.replace(re, "") === "";
7
+ }
8
+ export {
9
+ whitespace as w
10
+ };
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,26 @@
1
+ const urlAttributes = {
2
+ action: ["form"],
3
+ cite: ["blockquote", "del", "ins", "q"],
4
+ data: ["object"],
5
+ formAction: ["button", "input"],
6
+ href: ["a", "area", "base", "link"],
7
+ icon: ["menuitem"],
8
+ itemId: null,
9
+ manifest: ["html"],
10
+ ping: ["a", "area"],
11
+ poster: ["video"],
12
+ src: [
13
+ "audio",
14
+ "embed",
15
+ "iframe",
16
+ "img",
17
+ "input",
18
+ "script",
19
+ "source",
20
+ "track",
21
+ "video"
22
+ ]
23
+ };
24
+ export {
25
+ urlAttributes as u
26
+ };
@@ -0,0 +1,74 @@
1
+ import { c as commonjsGlobal } from "./react.mjs";
2
+ var lib;
3
+ var hasRequiredLib;
4
+ function requireLib() {
5
+ if (hasRequiredLib) return lib;
6
+ hasRequiredLib = 1;
7
+ var Mutation = commonjsGlobal.MutationObserver || commonjsGlobal.WebKitMutationObserver;
8
+ var scheduleDrain;
9
+ if (process.browser) {
10
+ if (Mutation) {
11
+ var called = 0;
12
+ var observer = new Mutation(nextTick);
13
+ var element = commonjsGlobal.document.createTextNode("");
14
+ observer.observe(element, {
15
+ characterData: true
16
+ });
17
+ scheduleDrain = function() {
18
+ element.data = called = ++called % 2;
19
+ };
20
+ } else if (!commonjsGlobal.setImmediate && typeof commonjsGlobal.MessageChannel !== "undefined") {
21
+ var channel = new commonjsGlobal.MessageChannel();
22
+ channel.port1.onmessage = nextTick;
23
+ scheduleDrain = function() {
24
+ channel.port2.postMessage(0);
25
+ };
26
+ } else if ("document" in commonjsGlobal && "onreadystatechange" in commonjsGlobal.document.createElement("script")) {
27
+ scheduleDrain = function() {
28
+ var scriptEl = commonjsGlobal.document.createElement("script");
29
+ scriptEl.onreadystatechange = function() {
30
+ nextTick();
31
+ scriptEl.onreadystatechange = null;
32
+ scriptEl.parentNode.removeChild(scriptEl);
33
+ scriptEl = null;
34
+ };
35
+ commonjsGlobal.document.documentElement.appendChild(scriptEl);
36
+ };
37
+ } else {
38
+ scheduleDrain = function() {
39
+ setTimeout(nextTick, 0);
40
+ };
41
+ }
42
+ } else {
43
+ scheduleDrain = function() {
44
+ process.nextTick(nextTick);
45
+ };
46
+ }
47
+ var draining;
48
+ var queue = [];
49
+ function nextTick() {
50
+ draining = true;
51
+ var i, oldQueue;
52
+ var len = queue.length;
53
+ while (len) {
54
+ oldQueue = queue;
55
+ queue = [];
56
+ i = -1;
57
+ while (++i < len) {
58
+ oldQueue[i]();
59
+ }
60
+ len = queue.length;
61
+ }
62
+ draining = false;
63
+ }
64
+ lib = immediate;
65
+ function immediate(task) {
66
+ if (queue.push(task) === 1 && !draining) {
67
+ scheduleDrain();
68
+ }
69
+ }
70
+ return lib;
71
+ }
72
+ export {
73
+ requireLib as r
74
+ };
@@ -0,0 +1,50 @@
1
+ var inherits = { exports: {} };
2
+ var inherits_browser = { exports: {} };
3
+ var hasRequiredInherits_browser;
4
+ function requireInherits_browser() {
5
+ if (hasRequiredInherits_browser) return inherits_browser.exports;
6
+ hasRequiredInherits_browser = 1;
7
+ if (typeof Object.create === "function") {
8
+ inherits_browser.exports = function inherits2(ctor, superCtor) {
9
+ if (superCtor) {
10
+ ctor.super_ = superCtor;
11
+ ctor.prototype = Object.create(superCtor.prototype, {
12
+ constructor: {
13
+ value: ctor,
14
+ enumerable: false,
15
+ writable: true,
16
+ configurable: true
17
+ }
18
+ });
19
+ }
20
+ };
21
+ } else {
22
+ inherits_browser.exports = function inherits2(ctor, superCtor) {
23
+ if (superCtor) {
24
+ ctor.super_ = superCtor;
25
+ var TempCtor = function() {
26
+ };
27
+ TempCtor.prototype = superCtor.prototype;
28
+ ctor.prototype = new TempCtor();
29
+ ctor.prototype.constructor = ctor;
30
+ }
31
+ };
32
+ }
33
+ return inherits_browser.exports;
34
+ }
35
+ var hasRequiredInherits;
36
+ function requireInherits() {
37
+ if (hasRequiredInherits) return inherits.exports;
38
+ hasRequiredInherits = 1;
39
+ try {
40
+ var util = require("util");
41
+ if (typeof util.inherits !== "function") throw "";
42
+ inherits.exports = util.inherits;
43
+ } catch (e) {
44
+ inherits.exports = requireInherits_browser();
45
+ }
46
+ return inherits.exports;
47
+ }
48
+ export {
49
+ requireInherits as r
50
+ };
@@ -0,0 +1,142 @@
1
+ var cjs;
2
+ var hasRequiredCjs;
3
+ function requireCjs() {
4
+ if (hasRequiredCjs) return cjs;
5
+ hasRequiredCjs = 1;
6
+ var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
7
+ var NEWLINE_REGEX = /\n/g;
8
+ var WHITESPACE_REGEX = /^\s*/;
9
+ var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/;
10
+ var COLON_REGEX = /^:\s*/;
11
+ var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/;
12
+ var SEMICOLON_REGEX = /^[;\s]*/;
13
+ var TRIM_REGEX = /^\s+|\s+$/g;
14
+ var NEWLINE = "\n";
15
+ var FORWARD_SLASH = "/";
16
+ var ASTERISK = "*";
17
+ var EMPTY_STRING = "";
18
+ var TYPE_COMMENT = "comment";
19
+ var TYPE_DECLARATION = "declaration";
20
+ function index(style, options) {
21
+ if (typeof style !== "string") {
22
+ throw new TypeError("First argument must be a string");
23
+ }
24
+ if (!style) return [];
25
+ options = options || {};
26
+ var lineno = 1;
27
+ var column = 1;
28
+ function updatePosition(str) {
29
+ var lines = str.match(NEWLINE_REGEX);
30
+ if (lines) lineno += lines.length;
31
+ var i = str.lastIndexOf(NEWLINE);
32
+ column = ~i ? str.length - i : column + str.length;
33
+ }
34
+ function position() {
35
+ var start = { line: lineno, column };
36
+ return function(node) {
37
+ node.position = new Position(start);
38
+ whitespace();
39
+ return node;
40
+ };
41
+ }
42
+ function Position(start) {
43
+ this.start = start;
44
+ this.end = { line: lineno, column };
45
+ this.source = options.source;
46
+ }
47
+ Position.prototype.content = style;
48
+ function error(msg) {
49
+ var err = new Error(
50
+ options.source + ":" + lineno + ":" + column + ": " + msg
51
+ );
52
+ err.reason = msg;
53
+ err.filename = options.source;
54
+ err.line = lineno;
55
+ err.column = column;
56
+ err.source = style;
57
+ if (options.silent) ;
58
+ else {
59
+ throw err;
60
+ }
61
+ }
62
+ function match(re) {
63
+ var m = re.exec(style);
64
+ if (!m) return;
65
+ var str = m[0];
66
+ updatePosition(str);
67
+ style = style.slice(str.length);
68
+ return m;
69
+ }
70
+ function whitespace() {
71
+ match(WHITESPACE_REGEX);
72
+ }
73
+ function comments(rules) {
74
+ var c;
75
+ rules = rules || [];
76
+ while (c = comment()) {
77
+ if (c !== false) {
78
+ rules.push(c);
79
+ }
80
+ }
81
+ return rules;
82
+ }
83
+ function comment() {
84
+ var pos = position();
85
+ if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;
86
+ var i = 2;
87
+ while (EMPTY_STRING != style.charAt(i) && (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))) {
88
+ ++i;
89
+ }
90
+ i += 2;
91
+ if (EMPTY_STRING === style.charAt(i - 1)) {
92
+ return error("End of comment missing");
93
+ }
94
+ var str = style.slice(2, i - 2);
95
+ column += 2;
96
+ updatePosition(str);
97
+ style = style.slice(i);
98
+ column += 2;
99
+ return pos({
100
+ type: TYPE_COMMENT,
101
+ comment: str
102
+ });
103
+ }
104
+ function declaration() {
105
+ var pos = position();
106
+ var prop = match(PROPERTY_REGEX);
107
+ if (!prop) return;
108
+ comment();
109
+ if (!match(COLON_REGEX)) return error("property missing ':'");
110
+ var val = match(VALUE_REGEX);
111
+ var ret = pos({
112
+ type: TYPE_DECLARATION,
113
+ property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),
114
+ value: val ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING)) : EMPTY_STRING
115
+ });
116
+ match(SEMICOLON_REGEX);
117
+ return ret;
118
+ }
119
+ function declarations() {
120
+ var decls = [];
121
+ comments(decls);
122
+ var decl;
123
+ while (decl = declaration()) {
124
+ if (decl !== false) {
125
+ decls.push(decl);
126
+ comments(decls);
127
+ }
128
+ }
129
+ return decls;
130
+ }
131
+ whitespace();
132
+ return declarations();
133
+ }
134
+ function trim(str) {
135
+ return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;
136
+ }
137
+ cjs = index;
138
+ return cjs;
139
+ }
140
+ export {
141
+ requireCjs as r
142
+ };
@@ -0,0 +1,10 @@
1
+ function isPlainObject(value) {
2
+ if (typeof value !== "object" || value === null) {
3
+ return false;
4
+ }
5
+ const prototype = Object.getPrototypeOf(value);
6
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
7
+ }
8
+ export {
9
+ isPlainObject as i
10
+ };